From feab3ce8226551df4d3f0266ba3052f95e575ac6 Mon Sep 17 00:00:00 2001 From: dntzhang Date: Mon, 4 Mar 2019 10:21:59 +0800 Subject: [PATCH] omio - support staitc css --- README.CN.md | 31 +++++-------- README.EN.md | 13 +++--- README.md | 16 +++---- packages/omio/examples/simple/b.js | 44 ++++++++++--------- packages/omio/examples/simple/b.js.map | 2 +- packages/omio/examples/simple/main.js | 9 ++-- packages/omio/src/render-to-string.js | 8 ++-- packages/omio/src/vdom/component.js | 2 +- packages/omio/src/vdom/diff.js | 4 +- .../omio/test/browser/render-to-string.js | 2 +- 10 files changed, 61 insertions(+), 70 deletions(-) diff --git a/README.CN.md b/README.CN.md index 7c0c5b3f7..5567b3e8f 100644 --- a/README.CN.md +++ b/README.CN.md @@ -35,7 +35,7 @@ | [omi-tap](https://github.com/Tencent/omi/releases/tag/v4.0.24)| Omi 原生支持 tap 事件(omi v4.0.24+)| | [omi-finger](https://github.com/Tencent/omi/tree/master/packages/omi-finger)|Omi 官方手势库| | [omi-touch](https://github.com/Tencent/omi/tree/master/packages/omi-touch)|丝般顺滑的触摸运动| -| [omi-native](https://github.com/Tencent/omi/tree/master/packages/omi-native)|把 web components 渲染到 native,比如 IOS 、Android| +| [omi-snap](https://github.com/Tencent/omi/blob/master/tutorial/omi-snap.cn.md)|预渲染骨架屏| |[omi-i18n](https://github.com/i18next/omi-i18n)| Omi 国际化解决方案 | | [omi-page](https://github.com/Tencent/omi/tree/master/packages/omi-page) | 基于 [page.js](https://github.com/visionmedia/page.js) 的 Omi 路由| @@ -65,18 +65,6 @@ |-|-| | ![Omi](./assets/omi-render.jpg) | ![React](./assets/react-render.jpg) | -## omi-mp - -> 通过微信小程序开发和一键生成 Web 的 H5 SPA (基于 omi + [omi-router](https://github.com/Tencent/omi/tree/master/packages/omi-router)) - -看下官方模板的转换例子: - -| **Index** | **Logs** | -| ------------------------------- | ----------------------------------- | -|![](./assets/mp1.jpg)| ![](./assets/mp2.jpg)| - -因为 Web 里拉取不到用户登录态,更换了用户头像和名称。 - ## 必须收藏的资源 * [你必须收藏 ES6 Spread Operator 技巧](https://github.com/Tencent/omi/blob/master/tutorial/spread-operator.cn.md) @@ -230,11 +218,11 @@ import { render, WeElement, define } from 'omi' define('my-counter', class extends WeElement { static observe = true - css () { - return `span{ - color: red; + //也支持不加 static ,直接 css = .. + static css = ` + span{ + color: red; }` - } data = { count: 1 @@ -262,7 +250,7 @@ define('my-counter', class extends WeElement { render(, 'body') ``` -也可以手动调用 `this.update`,这样你就可以选择最佳的时机进行更新,而且能够兼容 IE8。 +也可以手动调用 `this.update`,这样你就可以选择最佳的时机进行更新, 比如: ```js import { render, WeElement, define } from 'omi' @@ -272,10 +260,10 @@ define('my-counter', class extends WeElement { count: 1 } - //也可以直接传递字符串 - css = `span{ + static css = ` + span{ color: red; - }` + }` sub = () => { this.data.count-- @@ -436,6 +424,7 @@ $ npm run build # release | **Template Type**| **Command**| **Describe**| | ------------ | -----------| ----------------- | |基础模板(v3.3.0+)|`omi init my-app`| 基础模板,支持 omi 和 omio(IE8+)| +|小程序模板(v3.3.5+)|`omi init-p my-app`| Omi 开发小程序 | |支持预渲染快照骨架的模板|`omi init-snap my-app`| 基础模板,支持 omi 和 omio(IE8+),内置预渲染| |TypeScript Template(omi-cli v3.3.0+)|`omi init-ts my-app`|使用 TypeScript 的模板| |Mobile Template|`omi init-weui my-app`| 使用了 weui 和 omi-router 的移动 web app 模板| diff --git a/README.EN.md b/README.EN.md index 317acd5d1..cfb270308 100644 --- a/README.EN.md +++ b/README.EN.md @@ -215,11 +215,10 @@ define('my-counter', class extends WeElement { count: 1 } - css () { - return `span{ - color: red; + static css = ` + span{ + color: red; }` - } sub = () => { this.data.count-- @@ -253,10 +252,10 @@ define('my-counter', class extends WeElement { count: 1 } - //You can also pass strings directly - css = `span{ + static css = ` + span{ color: red; - }` + }` sub = () => { this.data.count-- diff --git a/README.md b/README.md index 7497d7562..a88a4aae5 100644 --- a/README.md +++ b/README.md @@ -218,11 +218,11 @@ import { render, WeElement, define } from 'omi' define('my-counter', class extends WeElement { static observe = true - css () { - return `span{ - color: red; + //也支持不加 static ,直接 css = .. + static css = ` + span{ + color: red; }` - } data = { count: 1 @@ -250,7 +250,7 @@ define('my-counter', class extends WeElement { render(, 'body') ``` -也可以手动调用 `this.update`,这样你就可以选择最佳的时机进行更新,而且能够兼容 IE8。 +也可以手动调用 `this.update`,这样你就可以选择最佳的时机进行更新, 比如: ```js import { render, WeElement, define } from 'omi' @@ -260,10 +260,10 @@ define('my-counter', class extends WeElement { count: 1 } - //也可以直接传递字符串 - css = `span{ + static css = ` + span{ color: red; - }` + }` sub = () => { this.data.count-- diff --git a/packages/omio/examples/simple/b.js b/packages/omio/examples/simple/b.js index a01863336..941c346b9 100755 --- a/packages/omio/examples/simple/b.js +++ b/packages/omio/examples/simple/b.js @@ -178,7 +178,7 @@ return to; } - if (!Element.prototype.addEventListener) { + if (typeof Element !== 'undefined' && !Element.prototype.addEventListener) { var runListeners = function runListeners(oEvent) { if (!oEvent) { oEvent = window.event; @@ -758,8 +758,8 @@ while (c = mounts.pop()) { if (options.afterMount) options.afterMount(c); if (c.installed) c.installed(); - if (c.css) { - addStyleToHead(typeof c.css === 'function' ? c.css() : c.css, '_s' + getCtorName(c.constructor)); + if (c.constructor.css || c.css) { + addStyleToHead(c.constructor.css ? c.constructor.css : typeof c.css === 'function' ? c.css() : c.css, '_s' + getCtorName(c.constructor)); } } } @@ -1415,7 +1415,7 @@ rendered = component.render(props, data, context); //don't rerender - if (component.css) { + if (component.constructor.css || component.css) { addScopedAttrStatic(rendered, '_s' + getCtorName(component.constructor)); } @@ -1855,13 +1855,13 @@ var tempCss = void 0; if (opts.scopedCSS) { - if (c.css) { - var cssStr = typeof c.css === 'function' ? c.css() : c.css; + if (c.constructor.css || c.css) { + + var cssStr = c.constructor.css ? c.constructor.css : typeof c.css === 'function' ? c.css() : c.css; var cssAttr = '_s' + getCtorName(c.constructor); tempCss = ''; - } - if (c.css) { + addScopedAttrStatic(rendered, '_s' + getCtorName(c.constructor)); } @@ -2023,8 +2023,10 @@ getHost: getHost, renderToString: renderToString }; - options.root.omi = Omi; - options.root.Omi.version = 'omio-1.3.5'; + options.root.omi = options.root.Omi; + options.root.Omi.version = 'omio-1.3.7'; + + var _class2, _temp2; function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -2044,7 +2046,7 @@ _class.prototype.render = function render$$1() { //can get the parent's div style, can't get the h3's style return Omi.h( - 'div', + 'span', null, Omi.h( 'h3', @@ -2058,29 +2060,29 @@ return _class; }(Component)); - define('my-app', function (_Component2) { - _inherits$1(_class3, _Component2); + define('my-app', (_temp2 = _class2 = function (_Component2) { + _inherits$1(_class2, _Component2); - function _class3() { + function _class2() { var _temp, _this2, _ret; - _classCallCheck$2(this, _class3); + _classCallCheck$2(this, _class2); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } - return _ret = (_temp = (_this2 = _possibleConstructorReturn$1(this, _Component2.call.apply(_Component2, [this].concat(args))), _this2), _this2.css = 'div{\n font-size:30px;\n }', _this2.handleTap = function (e) { + return _ret = (_temp = (_this2 = _possibleConstructorReturn$1(this, _Component2.call.apply(_Component2, [this].concat(args))), _this2), _this2.handleTap = function (e) { _this2.name = 'Hello Omi !'; _this2.update(); }, _temp), _possibleConstructorReturn$1(_this2, _ret); } - _class3.prototype.install = function install() { + _class2.prototype.install = function install() { this.name = 'Omi'; }; - _class3.prototype.installed = function installed() { + _class2.prototype.installed = function installed() { var _this3 = this; setTimeout(function () { @@ -2089,7 +2091,7 @@ }, 1000); }; - _class3.prototype.render = function render$$1() { + _class2.prototype.render = function render$$1() { return Omi.h( 'div', null, @@ -2102,8 +2104,8 @@ ); }; - return _class3; - }(Component)); + return _class2; + }(Component), _class2.css = 'div{\n font-size:20px;\n }\n ', _temp2)); render(Omi.h('my-app', null), 'body'); diff --git a/packages/omio/examples/simple/b.js.map b/packages/omio/examples/simple/b.js.map index 3a776dec4..b43c56937 100755 --- a/packages/omio/examples/simple/b.js.map +++ b/packages/omio/examples/simple/b.js.map @@ -1 +1 @@ -{"version":3,"file":"b.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/style.js","../../src/vdom/diff.js","../../src/vdom/component-recycler.js","../../src/obaa.js","../../src/tick.js","../../src/observe.js","../../src/vdom/component.js","../../src/component.js","../../src/render.js","../../src/define.js","../../src/rpx.js","../../src/model-view.js","../../src/class.js","../../src/get-host.js","../../src/render-to-string.js","../../src/omi.js","main.js"],"sourcesContent":["/** Virtual DOM Node */\r\nexport function VNode() {}\r\n","function getGlobal() {\r\n if (\r\n typeof global !== 'object' ||\r\n !global ||\r\n global.Math !== Math ||\r\n global.Array !== Array\r\n ) {\r\n if (typeof self !== 'undefined') {\r\n return self\r\n } else if (typeof window !== 'undefined') {\r\n return window\r\n } else if (typeof global !== 'undefined') {\r\n return global\r\n }\r\n return (function() {\r\n return this\r\n })()\r\n }\r\n return global\r\n}\r\n\r\n/** Global options\r\n *\t@public\r\n *\t@namespace options {Object}\r\n */\r\nexport default {\r\n scopedStyle: true,\r\n mapping: {},\r\n isWeb: true,\r\n staticStyleMapping: {},\r\n doc: typeof document === 'object' ? document : null,\r\n root: getGlobal(),\r\n //styleCache :[{ctor:ctor,ctorName:ctorName,style:style}]\r\n styleCache: []\r\n //componentChange(component, element) { },\r\n /** If `true`, `prop` changes trigger synchronous component updates.\r\n *\t@name syncComponentUpdates\r\n *\t@type Boolean\r\n *\t@default true\r\n */\r\n //syncComponentUpdates: true,\r\n\r\n /** Processes all created VNodes.\r\n *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\r\n */\r\n //vnode(vnode) { }\r\n\r\n /** Hook invoked after a component is mounted. */\r\n //afterMount(component) { },\r\n\r\n /** Hook invoked after the DOM is updated with a component's latest render. */\r\n //afterUpdate(component) { }\r\n\r\n /** Hook invoked immediately before a component is unmounted. */\r\n // beforeUnmount(component) { }\r\n}\r\n","import { VNode } from './vnode'\r\nimport options from './options'\r\n\r\nconst stack = []\r\n\r\nconst EMPTY_CHILDREN = []\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 let children = EMPTY_CHILDREN,\r\n lastSimple,\r\n child,\r\n simple,\r\n i\r\n for (i = arguments.length; i-- > 2; ) {\r\n stack.push(arguments[i])\r\n }\r\n if (attributes && attributes.children != null) {\r\n if (!stack.length) stack.push(attributes.children)\r\n delete attributes.children\r\n }\r\n while (stack.length) {\r\n if ((child = stack.pop()) && child.pop !== undefined) {\r\n for (i = child.length; i--; ) stack.push(child[i])\r\n } else {\r\n if (typeof child === 'boolean') child = null\r\n\r\n if ((simple = typeof nodeName !== 'function')) {\r\n if (child == null) child = ''\r\n else if (typeof child === 'number') child = String(child)\r\n else if (typeof child !== 'string') simple = false\r\n }\r\n\r\n if (simple && lastSimple) {\r\n children[children.length - 1] += child\r\n } else if (children === EMPTY_CHILDREN) {\r\n children = [child]\r\n } else {\r\n children.push(child)\r\n }\r\n\r\n lastSimple = simple\r\n }\r\n }\r\n\r\n let p = new VNode()\r\n p.nodeName = nodeName\r\n p.children = children\r\n\tp.attributes = attributes == null ? undefined : attributes\r\n p.key = attributes == null ? undefined : attributes.key\r\n\r\n // if a \"vnode hook\" is defined, pass every created VNode to it\r\n if (options.vnode !== undefined) options.vnode(p)\r\n\r\n return p\r\n}\r\n","'use strict'\r\n/* eslint-disable no-unused-vars */\r\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols\r\nvar hasOwnProperty = Object.prototype.hasOwnProperty\r\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable\r\n\r\nfunction toObject(val) {\r\n if (val === null || val === undefined) {\r\n throw new TypeError('Object.assign cannot be called with null or undefined')\r\n }\r\n\r\n return Object(val)\r\n}\r\n\r\nexport function assign(target, source) {\r\n var from\r\n var to = toObject(target)\r\n var symbols\r\n\r\n for (var s = 1; s < arguments.length; s++) {\r\n from = Object(arguments[s])\r\n\r\n for (var key in from) {\r\n if (hasOwnProperty.call(from, key)) {\r\n to[key] = from[key]\r\n }\r\n }\r\n\r\n if (getOwnPropertySymbols) {\r\n symbols = getOwnPropertySymbols(from)\r\n for (var i = 0; i < symbols.length; i++) {\r\n if (propIsEnumerable.call(from, symbols[i])) {\r\n to[symbols[i]] = from[symbols[i]]\r\n }\r\n }\r\n }\r\n }\r\n\r\n return to\r\n}\r\n\r\nif (!Element.prototype.addEventListener) {\r\n var oListeners = {};\r\n function runListeners(oEvent) {\r\n if (!oEvent) { oEvent = window.event; }\r\n for (var iLstId = 0, iElId = 0, oEvtListeners = oListeners[oEvent.type]; iElId < oEvtListeners.aEls.length; iElId++) {\r\n if (oEvtListeners.aEls[iElId] === this) {\r\n for (iLstId; iLstId < oEvtListeners.aEvts[iElId].length; iLstId++) { oEvtListeners.aEvts[iElId][iLstId].call(this, oEvent); }\r\n break;\r\n }\r\n }\r\n }\r\n Element.prototype.addEventListener = function (sEventType, fListener /*, useCapture (will be ignored!) */) {\r\n if (oListeners.hasOwnProperty(sEventType)) {\r\n var oEvtListeners = oListeners[sEventType];\r\n for (var nElIdx = -1, iElId = 0; iElId < oEvtListeners.aEls.length; iElId++) {\r\n if (oEvtListeners.aEls[iElId] === this) { nElIdx = iElId; break; }\r\n }\r\n if (nElIdx === -1) {\r\n oEvtListeners.aEls.push(this);\r\n oEvtListeners.aEvts.push([fListener]);\r\n this[\"on\" + sEventType] = runListeners;\r\n } else {\r\n var aElListeners = oEvtListeners.aEvts[nElIdx];\r\n if (this[\"on\" + sEventType] !== runListeners) {\r\n aElListeners.splice(0);\r\n this[\"on\" + sEventType] = runListeners;\r\n }\r\n for (var iLstId = 0; iLstId < aElListeners.length; iLstId++) {\r\n if (aElListeners[iLstId] === fListener) { return; }\r\n }\r\n aElListeners.push(fListener);\r\n }\r\n } else {\r\n oListeners[sEventType] = { aEls: [this], aEvts: [[fListener]] };\r\n this[\"on\" + sEventType] = runListeners;\r\n }\r\n };\r\n Element.prototype.removeEventListener = function (sEventType, fListener /*, useCapture (will be ignored!) */) {\r\n if (!oListeners.hasOwnProperty(sEventType)) { return; }\r\n var oEvtListeners = oListeners[sEventType];\r\n for (var nElIdx = -1, iElId = 0; iElId < oEvtListeners.aEls.length; iElId++) {\r\n if (oEvtListeners.aEls[iElId] === this) { nElIdx = iElId; break; }\r\n }\r\n if (nElIdx === -1) { return; }\r\n for (var iLstId = 0, aElListeners = oEvtListeners.aEvts[nElIdx]; iLstId < aElListeners.length; iLstId++) {\r\n if (aElListeners[iLstId] === fListener) { aElListeners.splice(iLstId, 1); }\r\n }\r\n };\r\n}\r\n\r\n\r\nif (typeof Object.create !== 'function') {\r\n Object.create = function(proto, propertiesObject) {\r\n if (typeof proto !== 'object' && typeof proto !== 'function') {\r\n throw new TypeError('Object prototype may only be an Object: ' + proto)\r\n } else if (proto === null) {\r\n throw new Error(\r\n \"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\"\r\n )\r\n }\r\n\r\n // if (typeof propertiesObject != 'undefined') {\r\n // throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support a second argument.\");\r\n // }\r\n\r\n function F() {}\r\n F.prototype = proto\r\n\r\n return new F()\r\n }\r\n}\r\n\r\nif (!String.prototype.trim) {\r\n String.prototype.trim = function () {\r\n return this.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '')\r\n }\r\n}\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 for (let i in props) obj[i] = props[i]\r\n return obj\r\n}\r\n\r\n/** Invoke or update a ref, depending on whether it is a function or object ref.\r\n * @param {object|function} [ref=null]\r\n * @param {any} [value]\r\n */\r\nexport function applyRef(ref, value) {\r\n if (ref) {\r\n if (typeof ref == 'function') ref(value)\r\n else ref.current = value\r\n }\r\n}\r\n\r\n/**\r\n * Call a function asynchronously, as soon as possible. Makes\r\n * use of HTML Promise to schedule the callback if available,\r\n * otherwise falling back to `setTimeout` (mainly for IE<11).\r\n *\r\n * @param {Function} callback\r\n */\r\n\r\nlet usePromise = typeof Promise == 'function'\r\n\r\n// for native\r\nif (\r\n typeof document !== 'object' &&\r\n typeof global !== 'undefined' &&\r\n global.__config__\r\n) {\r\n if (global.__config__.platform === 'android') {\r\n usePromise = true\r\n } else {\r\n let systemVersion =\r\n (global.__config__.systemVersion &&\r\n global.__config__.systemVersion.split('.')[0]) ||\r\n 0\r\n if (systemVersion > 8) {\r\n usePromise = true\r\n }\r\n }\r\n}\r\n\r\nexport const defer = usePromise\r\n ? Promise.resolve().then.bind(Promise.resolve())\r\n : setTimeout\r\n\r\nexport function isArray(obj) {\r\n return Object.prototype.toString.call(obj) === '[object Array]'\r\n}\r\n\r\nexport function nProps(props) {\r\n if (!props || isArray(props)) return {}\r\n const result = {}\r\n Object.keys(props).forEach(key => {\r\n result[key] = props[key].value\r\n })\r\n return result\r\n}","import { extend } from './util'\r\nimport { h } from './h'\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n return h(\r\n vnode.nodeName,\r\n extend(extend({}, vnode.attributes), props),\r\n arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children\r\n )\r\n}\r\n","// render modes\r\n\r\nexport const NO_RENDER = 0\r\nexport const SYNC_RENDER = 1\r\nexport const FORCE_RENDER = 2\r\nexport const ASYNC_RENDER = 3\r\n\r\nexport const ATTR_KEY = '__omiattr_'\r\n\r\n// DOM properties that should NOT have \"px\" added when numeric\r\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i\r\n","import 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 if (items.push(component) == 1) {\r\n ;(options.debounceRendering || defer)(rerender)\r\n }\r\n}\r\n\r\n/** Rerender all enqueued dirty components */\r\nexport function rerender() {\r\n\tlet p\r\n\twhile ( (p = items.pop()) ) {\r\n renderComponent(p)\r\n\t}\r\n}","import { extend } from '../util'\r\nimport options from '../options'\r\n\r\nconst mapping = options.mapping\r\n/**\r\n * Check if two nodes are equivalent.\r\n *\r\n * @param {Node} node\t\t\tDOM Node to compare\r\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\r\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\r\n * @private\r\n */\r\nexport function isSameNodeType(node, vnode, hydrating) {\r\n if (typeof vnode === 'string' || typeof vnode === 'number') {\r\n return node.splitText !== undefined\r\n }\r\n if (typeof vnode.nodeName === 'string') {\r\n var ctor = mapping[vnode.nodeName]\r\n if (ctor) {\r\n return hydrating || node._componentConstructor === ctor\r\n }\r\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\r\n }\r\n return hydrating || node._componentConstructor === vnode.nodeName\r\n}\r\n\r\n/**\r\n * Check if an Element has a given nodeName, case-insensitively.\r\n *\r\n * @param {Element} node\tA DOM Element to inspect the name of.\r\n * @param {String} nodeName\tUnnormalized name to compare against.\r\n */\r\nexport function isNamedNode(node, nodeName) {\r\n return (\r\n node.normalizedNodeName === nodeName ||\r\n node.nodeName.toLowerCase() === nodeName.toLowerCase()\r\n )\r\n}\r\n\r\n/**\r\n * Reconstruct Component-style `props` from a VNode.\r\n * Ensures default/fallback values from `defaultProps`:\r\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\r\n *\r\n * @param {VNode} vnode\r\n * @returns {Object} props\r\n */\r\nexport function getNodeProps(vnode) {\r\n let props = extend({}, vnode.attributes)\r\n props.children = vnode.children\r\n\r\n let defaultProps = vnode.nodeName.defaultProps\r\n if (defaultProps !== undefined) {\r\n for (let i in defaultProps) {\r\n if (props[i] === undefined) {\r\n props[i] = defaultProps[i]\r\n }\r\n }\r\n }\r\n\r\n return props\r\n}\r\n","import { IS_NON_DIMENSIONAL } from '../constants'\r\nimport { applyRef } from '../util'\r\nimport options from '../options'\r\n\r\n/** 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 let node = isSvg\r\n ? options.doc.createElementNS('http://www.w3.org/2000/svg', nodeName)\r\n : options.doc.createElement(nodeName)\r\n node.normalizedNodeName = nodeName\r\n return node\r\n}\r\n\r\nfunction parseCSSText(cssText) {\r\n let cssTxt = cssText.replace(/\\/\\*(.|\\s)*?\\*\\//g, ' ').replace(/\\s+/g, ' ')\r\n let style = {},\r\n [a, b, rule] = cssTxt.match(/ ?(.*?) ?{([^}]*)}/) || [a, b, cssTxt]\r\n let cssToJs = s => s.replace(/\\W+\\w/g, match => match.slice(-1).toUpperCase())\r\n let properties = rule\r\n .split(';')\r\n .map(o => o.split(':').map(x => x && x.trim()))\r\n for (let [property, value] of properties) style[cssToJs(property)] = value\r\n return 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 let parentNode = node.parentNode\r\n if (parentNode) parentNode.removeChild(node)\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 if (name === 'className') name = 'class'\r\n\r\n if (name === 'key') {\r\n // ignore\r\n } else if (name === 'ref') {\r\n applyRef(old, null)\r\n applyRef(value, node)\r\n } else if (name === 'class' && !isSvg) {\r\n node.className = value || ''\r\n } else if (name === 'style') {\r\n if (options.isWeb) {\r\n if (!value || typeof value === 'string' || typeof old === 'string') {\r\n node.style.cssText = value || ''\r\n }\r\n if (value && typeof value === 'object') {\r\n if (typeof old !== 'string') {\r\n for (let i in old) if (!(i in value)) node.style[i] = ''\r\n }\r\n for (let i in value) {\r\n node.style[i] =\r\n typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\r\n ? value[i] + 'px'\r\n : value[i]\r\n }\r\n }\r\n } else {\r\n let oldJson = old,\r\n currentJson = value\r\n if (typeof old === 'string') {\r\n oldJson = parseCSSText(old)\r\n }\r\n if (typeof value == 'string') {\r\n currentJson = parseCSSText(value)\r\n }\r\n\r\n let result = {},\r\n changed = false\r\n\r\n if (oldJson) {\r\n for (let key in oldJson) {\r\n if (typeof currentJson == 'object' && !(key in currentJson)) {\r\n result[key] = ''\r\n changed = true\r\n }\r\n }\r\n\r\n for (let ckey in currentJson) {\r\n if (currentJson[ckey] !== oldJson[ckey]) {\r\n result[ckey] = currentJson[ckey]\r\n changed = true\r\n }\r\n }\r\n\r\n if (changed) {\r\n node.setStyles(result)\r\n }\r\n } else {\r\n node.setStyles(currentJson)\r\n }\r\n }\r\n } else if (name === 'dangerouslySetInnerHTML') {\r\n if (value) node.innerHTML = value.__html || ''\r\n } else if (name[0] == 'o' && name[1] == 'n') {\r\n let useCapture = name !== (name = name.replace(/Capture$/, ''))\r\n name = name.toLowerCase().substring(2)\r\n if (value) {\r\n if (!old) {\r\n node.addEventListener(name, eventProxy, useCapture)\r\n if (name == 'tap') {\r\n node.addEventListener('touchstart', touchStart, useCapture)\r\n node.addEventListener('touchend', touchEnd, useCapture)\r\n }\r\n }\r\n } else {\r\n node.removeEventListener(name, eventProxy, useCapture)\r\n if (name == 'tap') {\r\n node.removeEventListener('touchstart', touchStart, useCapture)\r\n node.removeEventListener('touchend', touchEnd, useCapture)\r\n }\r\n }\r\n ;(node._listeners || (node._listeners = {}))[name] = value\r\n } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\r\n setProperty(node, name, value == null ? '' : value)\r\n if (value == null || value === false) node.removeAttribute(name)\r\n } else {\r\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\r\n if (value == null || value === false) {\r\n if (ns)\r\n node.removeAttributeNS(\r\n 'http://www.w3.org/1999/xlink',\r\n name.toLowerCase()\r\n )\r\n else node.removeAttribute(name)\r\n } else if (typeof value !== 'function') {\r\n if (ns)\r\n node.setAttributeNS(\r\n 'http://www.w3.org/1999/xlink',\r\n name.toLowerCase(),\r\n value\r\n )\r\n else node.setAttribute(name, value)\r\n }\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 try {\r\n node[name] = value\r\n } catch (e) {}\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 return this._listeners[e.type]((options.event && options.event(e)) || e)\r\n}\r\n\r\nfunction touchStart(e) {\r\n this.___touchX = e.touches[0].pageX\r\n this.___touchY = e.touches[0].pageY\r\n this.___scrollTop = document.body.scrollTop\r\n}\r\n\r\nfunction touchEnd(e) {\r\n if (\r\n Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 &&\r\n Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 &&\r\n Math.abs(document.body.scrollTop - this.___scrollTop) < 30\r\n ) {\r\n this.dispatchEvent(new CustomEvent('tap', { detail: e }))\r\n }\r\n}","import options from './options'\r\n\r\nlet styleId = 0\r\n\r\nexport function getCtorName(ctor) {\r\n for (let i = 0, len = options.styleCache.length; i < len; i++) {\r\n let item = options.styleCache[i]\r\n\r\n if (item.ctor === ctor) {\r\n return item.attrName\r\n }\r\n }\r\n\r\n let attrName = 's' + styleId\r\n options.styleCache.push({ ctor, attrName })\r\n styleId++\r\n\r\n return attrName\r\n}\r\n\r\n// many thanks to https://github.com/thomaspark/scoper/\r\nexport function scoper(css, prefix) {\r\n prefix = '[' + prefix.toLowerCase() + ']'\r\n // https://www.w3.org/TR/css-syntax-3/#lexical\r\n css = css.replace(/\\/\\*[^*]*\\*+([^/][^*]*\\*+)*\\//g, '')\r\n // eslint-disable-next-line\r\n let re = new RegExp('([^\\r\\n,{}:]+)(:[^\\r\\n,{}]+)?(,(?=[^{}]*{)|\\s*{)', 'g')\r\n /**\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 css = css.replace(re, (g0, g1, g2, g3) => {\r\n if (typeof g2 === 'undefined') {\r\n g2 = ''\r\n }\r\n\r\n /* eslint-ignore-next-line */\r\n if (\r\n g1.match(\r\n /^\\s*(@media|\\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/\r\n )\r\n ) {\r\n return g1 + g2 + g3\r\n }\r\n\r\n let appendClass = g1.replace(/(\\s*)$/, '') + prefix + g2\r\n //let prependClass = prefix + ' ' + g1.trim() + g2;\r\n\r\n return appendClass + g3\r\n //return appendClass + ',' + prependClass + g3;\r\n })\r\n\r\n return css\r\n}\r\n\r\nexport function addStyle(cssText, id) {\r\n id = id.toLowerCase()\r\n let ele = document.getElementById(id)\r\n let head = document.getElementsByTagName('head')[0]\r\n if (ele && ele.parentNode === head) {\r\n head.removeChild(ele)\r\n }\r\n\r\n let someThingStyles = document.createElement('style')\r\n head.appendChild(someThingStyles)\r\n someThingStyles.setAttribute('type', 'text/css')\r\n someThingStyles.setAttribute('id', id)\r\n if (window.ActiveXObject) {\r\n someThingStyles.styleSheet.cssText = cssText\r\n } else {\r\n someThingStyles.textContent = cssText\r\n }\r\n}\r\n\r\nexport function addStyleWithoutId(cssText) {\r\n let head = document.getElementsByTagName('head')[0]\r\n let someThingStyles = document.createElement('style')\r\n head.appendChild(someThingStyles)\r\n someThingStyles.setAttribute('type', 'text/css')\r\n\r\n if (window.ActiveXObject) {\r\n someThingStyles.styleSheet.cssText = cssText\r\n } else {\r\n someThingStyles.textContent = cssText\r\n }\r\n}\r\n\r\nexport function addScopedAttrStatic(vdom, attr) {\r\n if (options.scopedStyle) {\r\n scopeVdom(attr, vdom)\r\n } \r\n}\r\n\r\nexport function addStyleToHead(style, attr) {\r\n if (options.scopedStyle) {\r\n if (!options.staticStyleMapping[attr]) {\r\n addStyle(scoper(style, attr), attr)\r\n options.staticStyleMapping[attr] = true\r\n }\r\n } else if (!options.staticStyleMapping[attr]) {\r\n addStyleWithoutId(style)\r\n options.staticStyleMapping[attr] = true\r\n }\r\n}\r\n\r\nexport function scopeVdom(attr, vdom) {\r\n if (typeof vdom === 'object') {\r\n vdom.attributes = vdom.attributes || {}\r\n vdom.attributes[attr] = ''\r\n vdom.css = vdom.css || {}\r\n vdom.css[attr] = ''\r\n vdom.children.forEach(child => scopeVdom(attr, child))\r\n }\r\n}\r\n\r\nexport function scopeHost(vdom, css) {\r\n if (typeof vdom === 'object' && css) {\r\n vdom.attributes = vdom.attributes || {}\r\n for (let key in css) {\r\n vdom.attributes[key] = ''\r\n }\r\n }\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 { applyRef } from '../util'\r\nimport { removeNode } from '../dom/index'\r\nimport { isArray } from '../util'\r\nimport { addStyleToHead, getCtorName } from '../style'\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 let c\r\n while ((c = mounts.pop())) {\r\n if (options.afterMount) options.afterMount(c)\r\n if (c.installed) c.installed()\r\n if(c.css){\r\n addStyleToHead(typeof c.css === 'function' ? c.css() : c.css, '_s' + getCtorName(c.constructor))\r\n }\r\n }\r\n}\r\n\r\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\r\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\r\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\r\n *\t@returns {Element} dom\t\t\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\r\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\r\n if (!diffLevel++) {\r\n // when first starting the diff, check if we're diffing an SVG or within an SVG\r\n isSvgMode = parent != null && parent.ownerSVGElement !== undefined\r\n\r\n // hydration is indicated by the existing element to be diffed not having a prop cache\r\n hydrating = dom != null && !(ATTR_KEY in dom)\r\n }\r\n let ret\r\n\r\n if (isArray(vnode)) {\r\n vnode = {\r\n nodeName: 'span',\r\n children: vnode\r\n }\r\n }\r\n\r\n ret = idiff(dom, vnode, context, mountAll, componentRoot)\r\n // append the element if its a new parent\r\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\r\n\r\n // diffLevel being reduced to 0 means we're exiting the diff\r\n if (!--diffLevel) {\r\n hydrating = false\r\n // invoke queued componentDidMount lifecycle methods\r\n if (!componentRoot) flushMounts()\r\n }\r\n\r\n return ret\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 let out = dom,\r\n prevSvgMode = isSvgMode\r\n\r\n // empty values (null, undefined, booleans) render as empty Text nodes\r\n if (vnode == null || typeof vnode === 'boolean') vnode = ''\r\n\r\n // If the VNode represents a Component, perform a component diff:\r\n let vnodeName = vnode.nodeName\r\n if (options.mapping[vnodeName]) {\r\n vnode.nodeName = options.mapping[vnodeName]\r\n return buildComponentFromVNode(dom, vnode, context, mountAll)\r\n }\r\n if (typeof vnodeName == 'function') {\r\n return buildComponentFromVNode(dom, vnode, context, mountAll)\r\n }\r\n\r\n // Fast case: Strings & Numbers create/update Text nodes.\r\n if (typeof vnode === 'string' || typeof vnode === 'number') {\r\n // update if it's already a Text node:\r\n if (\r\n dom &&\r\n dom.splitText !== undefined &&\r\n dom.parentNode &&\r\n (!dom._component || componentRoot)\r\n ) {\r\n /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\r\n if (dom.nodeValue != vnode) {\r\n dom.nodeValue = vnode\r\n }\r\n } else {\r\n // it wasn't a Text node: replace it with one and recycle the old Element\r\n out = document.createTextNode(vnode)\r\n if (dom) {\r\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n recollectNodeTree(dom, true)\r\n }\r\n }\r\n\r\n //ie8 error\r\n try {\r\n out[ATTR_KEY] = true\r\n } catch (e) {}\r\n\r\n return out\r\n }\r\n\r\n // Tracks entering and exiting SVG namespace when descending through the tree.\r\n isSvgMode =\r\n vnodeName === 'svg'\r\n ? true\r\n : vnodeName === 'foreignObject'\r\n ? false\r\n : isSvgMode\r\n\r\n // If there's no existing element or it's the wrong type, create a new one:\r\n vnodeName = String(vnodeName)\r\n if (!dom || !isNamedNode(dom, vnodeName)) {\r\n out = createNode(vnodeName, isSvgMode)\r\n\r\n if (dom) {\r\n // move children into the replacement node\r\n while (dom.firstChild) out.appendChild(dom.firstChild)\r\n\r\n // if the previous Element was mounted into the DOM, replace it inline\r\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n\r\n // recycle the old element (skips non-Element node types)\r\n recollectNodeTree(dom, true)\r\n }\r\n }\r\n\r\n let fc = out.firstChild,\r\n props = out[ATTR_KEY],\r\n vchildren = vnode.children\r\n\r\n if (props == null) {\r\n props = out[ATTR_KEY] = {}\r\n for (let a = out.attributes, i = a.length; i--; )\r\n props[a[i].name] = a[i].value\r\n }\r\n\r\n // Optimization: fast-path for elements containing a single TextNode:\r\n if (\r\n !hydrating &&\r\n vchildren &&\r\n vchildren.length === 1 &&\r\n typeof vchildren[0] === 'string' &&\r\n fc != null &&\r\n fc.splitText !== undefined &&\r\n fc.nextSibling == null\r\n ) {\r\n if (fc.nodeValue != vchildren[0]) {\r\n fc.nodeValue = vchildren[0]\r\n }\r\n }\r\n // otherwise, if there are existing or new children, diff them:\r\n else if ((vchildren && vchildren.length) || fc != null) {\r\n innerDiffNode(\r\n out,\r\n vchildren,\r\n context,\r\n mountAll,\r\n hydrating || props.dangerouslySetInnerHTML != null\r\n )\r\n }\r\n\r\n // Apply attributes/props from VNode to the DOM Element:\r\n diffAttributes(out, vnode.attributes, props)\r\n\r\n // restore previous SVG mode: (in case we're exiting an SVG namespace)\r\n isSvgMode = prevSvgMode\r\n\r\n return out\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 let originalChildren = dom.childNodes,\r\n children = [],\r\n keyed = {},\r\n keyedLen = 0,\r\n min = 0,\r\n len = originalChildren.length,\r\n childrenLen = 0,\r\n vlen = vchildren ? vchildren.length : 0,\r\n j,\r\n c,\r\n f,\r\n vchild,\r\n child\r\n\r\n // Build up a map of keyed children and an Array of unkeyed children:\r\n if (len !== 0) {\r\n for (let i = 0; i < len; i++) {\r\n let child = originalChildren[i],\r\n props = child[ATTR_KEY],\r\n key =\r\n vlen && props\r\n ? child._component\r\n ? child._component.__key\r\n : props.key\r\n : null\r\n if (key != null) {\r\n keyedLen++\r\n keyed[key] = child\r\n } else if (\r\n props ||\r\n (child.splitText !== undefined\r\n ? isHydrating\r\n ? child.nodeValue.trim()\r\n : true\r\n : isHydrating)\r\n ) {\r\n children[childrenLen++] = child\r\n }\r\n }\r\n }\r\n\r\n if (vlen !== 0) {\r\n for (let i = 0; i < vlen; i++) {\r\n vchild = vchildren[i]\r\n child = null\r\n\r\n // attempt to find a node based on key matching\r\n let key = vchild.key\r\n if (key != null) {\r\n if (keyedLen && keyed[key] !== undefined) {\r\n child = keyed[key]\r\n keyed[key] = undefined\r\n keyedLen--\r\n }\r\n }\r\n // attempt to pluck a node of the same type from the existing children\r\n else if (!child && min < childrenLen) {\r\n for (j = min; j < childrenLen; j++) {\r\n if (\r\n children[j] !== undefined &&\r\n isSameNodeType((c = children[j]), vchild, isHydrating)\r\n ) {\r\n child = c\r\n children[j] = undefined\r\n if (j === childrenLen - 1) childrenLen--\r\n if (j === min) min++\r\n break\r\n }\r\n }\r\n }\r\n\r\n // morph the matched/found/created DOM child to match vchild (deep)\r\n child = idiff(child, vchild, context, mountAll)\r\n\r\n f = originalChildren[i]\r\n if (child && child !== dom && child !== f) {\r\n if (f == null) {\r\n dom.appendChild(child)\r\n } else if (child === f.nextSibling) {\r\n removeNode(f)\r\n } else {\r\n dom.insertBefore(child, f)\r\n }\r\n }\r\n }\r\n }\r\n\r\n // remove unused keyed children:\r\n if (keyedLen) {\r\n for (let i in keyed)\r\n if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false)\r\n }\r\n\r\n // remove orphaned unkeyed children:\r\n while (min <= childrenLen) {\r\n if ((child = children[childrenLen--]) !== undefined)\r\n recollectNodeTree(child, false)\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 let component = node._component\r\n if (component) {\r\n // if node is owned by a Component, unmount that component (ends up recursing back here)\r\n unmountComponent(component)\r\n } else {\r\n // If the node's VNode had a ref function, invoke it with null here.\r\n // (this is part of the React spec, and smart for unsetting references)\r\n if (node[ATTR_KEY] != null) applyRef(node[ATTR_KEY].ref, null)\r\n\r\n if (unmountOnly === false || node[ATTR_KEY] == null) {\r\n removeNode(node)\r\n }\r\n\r\n removeChildren(node)\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 node = node.lastChild\r\n while (node) {\r\n let next = node.previousSibling\r\n recollectNodeTree(node, true)\r\n node = next\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 let name\r\n\r\n // remove attributes no longer present on the vnode by setting them to undefined\r\n for (name in old) {\r\n if (!(attrs && attrs[name] != null) && old[name] != null) {\r\n setAccessor(dom, name, old[name], (old[name] = undefined), isSvgMode)\r\n }\r\n }\r\n\r\n // add new & update changed attributes\r\n for (name in attrs) {\r\n if (\r\n name !== 'children' &&\r\n name !== 'innerHTML' &&\r\n (!(name in old) ||\r\n attrs[name] !==\r\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\r\n ) {\r\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\r\n }\r\n }\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/** Reclaim a component for later re-use by the recycler. */\r\nexport function collectComponent(component) {\r\n let name = component.constructor.name\r\n ;(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, vnode) {\r\n let list = components[Ctor.name],\r\n inst\r\n\r\n if (Ctor.prototype && Ctor.prototype.render) {\r\n inst = new Ctor(props, context)\r\n Component.call(inst, props, context)\r\n } else {\r\n inst = new Component(props, context)\r\n inst.constructor = Ctor\r\n inst.render = doRender\r\n }\r\n vnode && (inst.scopedCssAttr = vnode.css)\r\n\r\n if (list) {\r\n for (let i = list.length; i--; ) {\r\n if (list[i].constructor === Ctor) {\r\n inst.nextBase = list[i].nextBase\r\n list.splice(i, 1)\r\n break\r\n }\r\n }\r\n }\r\n return inst\r\n}\r\n\r\n/** The `.render()` method for a PFC backing instance. */\r\nfunction doRender(props, data, context) {\r\n return this.constructor(props, context)\r\n}\r\n","/* obaa 1.0.0\r\n * By dntzhang\r\n * Github: https://github.com/Tencent/omi\r\n * MIT Licensed.\r\n */\r\n\r\nvar obaa = function(target, arr, callback) {\r\n var _observe = function(target, arr, callback) {\r\n if (!target.$observer) target.$observer = this\r\n var $observer = target.$observer\r\n var eventPropArr = []\r\n if (obaa.isArray(target)) {\r\n if (target.length === 0) {\r\n target.$observeProps = {}\r\n target.$observeProps.$observerPath = '#'\r\n }\r\n $observer.mock(target)\r\n }\r\n for (var prop in target) {\r\n if (target.hasOwnProperty(prop)) {\r\n if (callback) {\r\n if (obaa.isArray(arr) && obaa.isInArray(arr, prop)) {\r\n eventPropArr.push(prop)\r\n $observer.watch(target, prop)\r\n } else if (obaa.isString(arr) && prop == arr) {\r\n eventPropArr.push(prop)\r\n $observer.watch(target, prop)\r\n }\r\n } else {\r\n eventPropArr.push(prop)\r\n $observer.watch(target, prop)\r\n }\r\n }\r\n }\r\n $observer.target = target\r\n if (!$observer.propertyChangedHandler) $observer.propertyChangedHandler = []\r\n var propChanged = callback ? callback : arr\r\n $observer.propertyChangedHandler.push({\r\n all: !callback,\r\n propChanged: propChanged,\r\n eventPropArr: eventPropArr\r\n })\r\n }\r\n _observe.prototype = {\r\n onPropertyChanged: function(prop, value, oldValue, target, path) {\r\n if (value !== oldValue && this.propertyChangedHandler) {\r\n var rootName = obaa._getRootName(prop, path)\r\n for (\r\n var i = 0, len = this.propertyChangedHandler.length;\r\n i < len;\r\n i++\r\n ) {\r\n var handler = this.propertyChangedHandler[i]\r\n if (\r\n handler.all ||\r\n obaa.isInArray(handler.eventPropArr, rootName) ||\r\n rootName.indexOf('Array-') === 0\r\n ) {\r\n handler.propChanged.call(this.target, prop, value, oldValue, path)\r\n }\r\n }\r\n }\r\n if (prop.indexOf('Array-') !== 0 && typeof value === 'object') {\r\n this.watch(target, prop, target.$observeProps.$observerPath)\r\n }\r\n },\r\n mock: function(target) {\r\n var self = this\r\n obaa.methods.forEach(function(item) {\r\n target[item] = function() {\r\n var old = Array.prototype.slice.call(this, 0)\r\n var result = Array.prototype[item].apply(\r\n this,\r\n Array.prototype.slice.call(arguments)\r\n )\r\n if (new RegExp('\\\\b' + item + '\\\\b').test(obaa.triggerStr)) {\r\n for (var cprop in this) {\r\n if (this.hasOwnProperty(cprop) && !obaa.isFunction(this[cprop])) {\r\n self.watch(this, cprop, this.$observeProps.$observerPath)\r\n }\r\n }\r\n //todo\r\n self.onPropertyChanged(\r\n 'Array-' + item,\r\n this,\r\n old,\r\n this,\r\n this.$observeProps.$observerPath\r\n )\r\n }\r\n return result\r\n }\r\n target[\r\n 'pure' + item.substring(0, 1).toUpperCase() + item.substring(1)\r\n ] = function() {\r\n return Array.prototype[item].apply(\r\n this,\r\n Array.prototype.slice.call(arguments)\r\n )\r\n }\r\n })\r\n },\r\n watch: function(target, prop, path) {\r\n if (prop === '$observeProps' || prop === '$observer') return\r\n if (obaa.isFunction(target[prop])) return\r\n if (!target.$observeProps) target.$observeProps = {}\r\n if (path !== undefined) {\r\n target.$observeProps.$observerPath = path\r\n } else {\r\n target.$observeProps.$observerPath = '#'\r\n }\r\n var self = this\r\n var currentValue = (target.$observeProps[prop] = target[prop])\r\n Object.defineProperty(target, prop, {\r\n get: function() {\r\n return this.$observeProps[prop]\r\n },\r\n set: function(value) {\r\n var old = this.$observeProps[prop]\r\n this.$observeProps[prop] = value\r\n self.onPropertyChanged(\r\n prop,\r\n value,\r\n old,\r\n this,\r\n target.$observeProps.$observerPath\r\n )\r\n }\r\n })\r\n if (typeof currentValue == 'object') {\r\n if (obaa.isArray(currentValue)) {\r\n this.mock(currentValue)\r\n if (currentValue.length === 0) {\r\n if (!currentValue.$observeProps) currentValue.$observeProps = {}\r\n if (path !== undefined) {\r\n currentValue.$observeProps.$observerPath = path\r\n } else {\r\n currentValue.$observeProps.$observerPath = '#'\r\n }\r\n }\r\n }\r\n for (var cprop in currentValue) {\r\n if (currentValue.hasOwnProperty(cprop)) {\r\n this.watch(\r\n currentValue,\r\n cprop,\r\n target.$observeProps.$observerPath + '-' + prop\r\n )\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return new _observe(target, arr, callback)\r\n}\r\n\r\nobaa.methods = [\r\n 'concat',\r\n 'copyWithin',\r\n 'entries',\r\n 'every',\r\n 'fill',\r\n 'filter',\r\n 'find',\r\n 'findIndex',\r\n 'forEach',\r\n 'includes',\r\n 'indexOf',\r\n 'join',\r\n 'keys',\r\n 'lastIndexOf',\r\n 'map',\r\n 'pop',\r\n 'push',\r\n 'reduce',\r\n 'reduceRight',\r\n 'reverse',\r\n 'shift',\r\n 'slice',\r\n 'some',\r\n 'sort',\r\n 'splice',\r\n 'toLocaleString',\r\n 'toString',\r\n 'unshift',\r\n 'values',\r\n 'size'\r\n]\r\nobaa.triggerStr = [\r\n 'concat',\r\n 'copyWithin',\r\n 'fill',\r\n 'pop',\r\n 'push',\r\n 'reverse',\r\n 'shift',\r\n 'sort',\r\n 'splice',\r\n 'unshift',\r\n 'size'\r\n].join(',')\r\n\r\nobaa.isArray = function(obj) {\r\n return Object.prototype.toString.call(obj) === '[object Array]'\r\n}\r\n\r\nobaa.isString = function(obj) {\r\n return typeof obj === 'string'\r\n}\r\n\r\nobaa.isInArray = function(arr, item) {\r\n for (var i = arr.length; --i > -1; ) {\r\n if (item === arr[i]) return true\r\n }\r\n return false\r\n}\r\n\r\nobaa.isFunction = function(obj) {\r\n return Object.prototype.toString.call(obj) == '[object Function]'\r\n}\r\n\r\nobaa._getRootName = function(prop, path) {\r\n if (path === '#') {\r\n return prop\r\n }\r\n return path.split('-')[1]\r\n}\r\n\r\nobaa.add = function(obj, prop) {\r\n var $observer = obj.$observer\r\n $observer.watch(obj, prop)\r\n}\r\n\r\nobaa.set = function(obj, prop, value, exec) {\r\n if (!exec) {\r\n obj[prop] = value\r\n }\r\n var $observer = obj.$observer\r\n $observer.watch(obj, prop)\r\n if (exec) {\r\n obj[prop] = value\r\n }\r\n}\r\n\r\nArray.prototype.size = function(length) {\r\n this.length = length\r\n}\r\n\r\nexport default obaa\r\n","const callbacks = []\r\nconst nextTickCallback = []\r\n\r\nexport function tick(fn, scope) {\r\n callbacks.push({ fn, scope })\r\n}\r\n\r\nexport function fireTick() {\r\n callbacks.forEach(item => {\r\n item.fn.call(item.scope)\r\n })\r\n\r\n nextTickCallback.forEach(nextItem => {\r\n nextItem.fn.call(nextItem.scope)\r\n })\r\n nextTickCallback.length = 0\r\n}\r\n\r\nexport function nextTick(fn, scope) {\r\n nextTickCallback.push({ fn, scope })\r\n}\r\n","import obaa from './obaa'\r\nimport { fireTick } from './tick'\r\n\r\nexport function proxyUpdate(ele) {\r\n let timeout = null\r\n obaa(ele.data, () => {\r\n if (ele._willUpdate) {\r\n return\r\n }\r\n if (ele.constructor.mergeUpdate) {\r\n clearTimeout(timeout)\r\n\r\n timeout = setTimeout(() => {\r\n ele.update()\r\n fireTick()\r\n }, 0)\r\n } else {\r\n ele.update()\r\n fireTick()\r\n }\r\n })\r\n}\r\n","import {\r\n SYNC_RENDER,\r\n NO_RENDER,\r\n FORCE_RENDER,\r\n ASYNC_RENDER,\r\n ATTR_KEY\r\n} from '../constants'\r\nimport options from '../options'\r\nimport { extend, applyRef } from '../util'\r\nimport { enqueueRender } from '../render-queue'\r\nimport { getNodeProps } from './index'\r\nimport {\r\n diff,\r\n mounts,\r\n diffLevel,\r\n flushMounts,\r\n recollectNodeTree,\r\n removeChildren\r\n} from './diff'\r\nimport { createComponent, collectComponent } from './component-recycler'\r\nimport { removeNode } from '../dom/index'\r\nimport {\r\n addScopedAttrStatic,\r\n getCtorName,\r\n scopeHost\r\n} from '../style'\r\nimport { proxyUpdate } from '../observe'\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 if (component._disable) return\r\n component._disable = true\r\n\r\n if ((component.__ref = props.ref)) delete props.ref\r\n if ((component.__key = props.key)) delete props.key\r\n\r\n if (!component.base || mountAll) {\r\n if (component.beforeInstall) component.beforeInstall()\r\n if (component.install) component.install()\r\n if (component.constructor.observe) {\r\n proxyUpdate(component)\r\n }\r\n } else if (component.receiveProps) {\r\n component.receiveProps(props, component.data, component.props)\r\n }\r\n\r\n if (context && context !== component.context) {\r\n if (!component.prevContext) component.prevContext = component.context\r\n component.context = context\r\n }\r\n\r\n if (!component.prevProps) component.prevProps = component.props\r\n component.props = props\r\n\r\n component._disable = false\r\n\r\n if (opts !== NO_RENDER) {\r\n if (\r\n opts === SYNC_RENDER ||\r\n options.syncComponentUpdates !== false ||\r\n !component.base\r\n ) {\r\n renderComponent(component, SYNC_RENDER, mountAll)\r\n } else {\r\n enqueueRender(component)\r\n }\r\n }\r\n\r\n applyRef(component.__ref, component)\r\n}\r\n\r\nfunction shallowComparison(old, attrs) {\r\n let name\r\n\r\n for (name in old) {\r\n if (attrs[name] == null && old[name] != null) {\r\n return true\r\n }\r\n }\r\n\r\n if (old.children.length > 0 || attrs.children.length > 0) {\r\n return true\r\n }\r\n\r\n for (name in attrs) {\r\n if (name != 'children') {\r\n let type = typeof attrs[name]\r\n if (type == 'function' || type == 'object') {\r\n return true\r\n } else if (attrs[name] != old[name]) {\r\n return true\r\n }\r\n }\r\n }\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 if (component._disable) return\r\n\r\n let props = component.props,\r\n data = component.data,\r\n context = component.context,\r\n previousProps = component.prevProps || props,\r\n previousState = component.prevState || data,\r\n previousContext = component.prevContext || context,\r\n isUpdate = component.base,\r\n nextBase = component.nextBase,\r\n initialBase = isUpdate || nextBase,\r\n initialChildComponent = component._component,\r\n skip = false,\r\n rendered,\r\n inst,\r\n cbase\r\n\r\n // if updating\r\n if (isUpdate) {\r\n component.props = previousProps\r\n component.data = previousState\r\n component.context = previousContext\r\n if (component.store || opts == FORCE_RENDER || shallowComparison(previousProps, props)) {\r\n skip = false\r\n if (component.beforeUpdate) {\r\n component.beforeUpdate(props, data, context)\r\n }\r\n } else {\r\n skip = true\r\n }\r\n component.props = props\r\n component.data = data\r\n component.context = context\r\n }\r\n\r\n component.prevProps = component.prevState = component.prevContext = component.nextBase = null\r\n\r\n if (!skip) {\r\n component.beforeRender && component.beforeRender()\r\n rendered = component.render(props, data, context)\r\n\r\n //don't rerender\r\n if (component.css) {\r\n addScopedAttrStatic(\r\n rendered,\r\n '_s' + getCtorName(component.constructor)\r\n )\r\n }\r\n\r\n scopeHost(rendered, component.scopedCssAttr)\r\n\r\n // context to pass to the child, can be updated via (grand-)parent component\r\n if (component.getChildContext) {\r\n context = extend(extend({}, context), component.getChildContext())\r\n }\r\n\r\n let childComponent = rendered && rendered.nodeName,\r\n toUnmount,\r\n base,\r\n ctor = options.mapping[childComponent]\r\n\r\n if (ctor) {\r\n // set up high order component link\r\n\r\n let childProps = getNodeProps(rendered)\r\n inst = initialChildComponent\r\n\r\n if (inst && inst.constructor === ctor && childProps.key == inst.__key) {\r\n setComponentProps(inst, childProps, SYNC_RENDER, context, false)\r\n } else {\r\n toUnmount = inst\r\n\r\n component._component = inst = createComponent(ctor, childProps, context)\r\n inst.nextBase = inst.nextBase || nextBase\r\n inst._parentComponent = component\r\n setComponentProps(inst, childProps, NO_RENDER, context, false)\r\n renderComponent(inst, SYNC_RENDER, mountAll, true)\r\n }\r\n\r\n base = inst.base\r\n } else {\r\n cbase = initialBase\r\n\r\n // destroy high order component link\r\n toUnmount = initialChildComponent\r\n if (toUnmount) {\r\n cbase = component._component = null\r\n }\r\n\r\n if (initialBase || opts === SYNC_RENDER) {\r\n if (cbase) cbase._component = null\r\n base = diff(\r\n cbase,\r\n rendered,\r\n context,\r\n mountAll || !isUpdate,\r\n initialBase && initialBase.parentNode,\r\n true\r\n )\r\n }\r\n }\r\n\r\n if (initialBase && base !== initialBase && inst !== initialChildComponent) {\r\n let baseParent = initialBase.parentNode\r\n if (baseParent && base !== baseParent) {\r\n baseParent.replaceChild(base, initialBase)\r\n\r\n if (!toUnmount) {\r\n initialBase._component = null\r\n recollectNodeTree(initialBase, false)\r\n }\r\n }\r\n }\r\n\r\n if (toUnmount) {\r\n unmountComponent(toUnmount)\r\n }\r\n\r\n component.base = base\r\n if (base && !isChild) {\r\n let componentRef = component,\r\n t = component\r\n while ((t = t._parentComponent)) {\r\n ;(componentRef = t).base = base\r\n }\r\n base._component = componentRef\r\n base._componentConstructor = componentRef.constructor\r\n }\r\n }\r\n\r\n if (!isUpdate || mountAll) {\r\n mounts.unshift(component)\r\n } else if (!skip) {\r\n // Ensure that pending componentDidMount() hooks of child components\r\n // are called before the componentDidUpdate() hook in the parent.\r\n // Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\r\n // flushMounts();\r\n\r\n if (component.afterUpdate) {\r\n //deprecated\r\n component.afterUpdate(previousProps, previousState, previousContext)\r\n }\r\n if (component.updated) {\r\n component.updated(previousProps, previousState, previousContext)\r\n }\r\n if (options.afterUpdate) options.afterUpdate(component)\r\n }\r\n\r\n if (component._renderCallbacks != null) {\r\n while (component._renderCallbacks.length)\r\n component._renderCallbacks.pop().call(component)\r\n }\r\n\r\n if (!diffLevel && !isChild) flushMounts()\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 let c = dom && dom._component,\r\n originalComponent = c,\r\n oldDom = dom,\r\n isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\r\n isOwner = isDirectOwner,\r\n props = getNodeProps(vnode)\r\n while (c && !isOwner && (c = c._parentComponent)) {\r\n isOwner = c.constructor === vnode.nodeName\r\n }\r\n\r\n if (c && isOwner && (!mountAll || c._component)) {\r\n setComponentProps(c, props, ASYNC_RENDER, context, mountAll)\r\n dom = c.base\r\n } else {\r\n if (originalComponent && !isDirectOwner) {\r\n unmountComponent(originalComponent)\r\n dom = oldDom = null\r\n }\r\n\r\n c = createComponent(vnode.nodeName, props, context, vnode)\r\n if (dom && !c.nextBase) {\r\n c.nextBase = dom\r\n // passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\r\n oldDom = null\r\n }\r\n setComponentProps(c, props, SYNC_RENDER, context, mountAll)\r\n dom = c.base\r\n\r\n if (oldDom && dom !== oldDom) {\r\n oldDom._component = null\r\n recollectNodeTree(oldDom, false)\r\n }\r\n }\r\n\r\n return dom\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 if (options.beforeUnmount) options.beforeUnmount(component)\r\n\r\n let base = component.base\r\n\r\n component._disable = true\r\n\r\n if (component.uninstall) component.uninstall()\r\n\r\n component.base = null\r\n\r\n // recursively tear down & recollect high-order component children:\r\n let inner = component._component\r\n if (inner) {\r\n unmountComponent(inner)\r\n } else if (base) {\r\n if (base[ATTR_KEY] != null) applyRef(base[ATTR_KEY].ref, null)\r\n\r\n component.nextBase = base\r\n\r\n removeNode(base)\r\n collectComponent(component)\r\n\r\n removeChildren(base)\r\n }\r\n\r\n applyRef(component.__ref, null)\r\n}\r\n","import { FORCE_RENDER } from './constants'\r\nimport { renderComponent } from './vdom/component'\r\nimport options from './options'\r\nimport { nProps, assign } from './util'\r\n\r\nlet id = 0\r\n\r\nexport default class Component {\r\n static is = 'WeElement'\r\n\r\n constructor(props, store) {\r\n this.props = assign(\r\n nProps(this.constructor.props),\r\n this.constructor.defaultProps,\r\n props\r\n )\r\n this.elementId = id++\r\n this.data = this.constructor.data || this.data || {}\r\n\r\n this._preCss = null\r\n\r\n this.store = store\r\n }\r\n\r\n update(callback) {\r\n this._willUpdate = true\r\n if (callback)\r\n (this._renderCallbacks = this._renderCallbacks || []).push(callback)\r\n renderComponent(this, FORCE_RENDER)\r\n if (options.componentChange) options.componentChange(this, this.base)\r\n this._willUpdate = false\r\n }\r\n\r\n fire(type, data) {\r\n Object.keys(this.props).every(key => {\r\n if ('on' + type.toLowerCase() === key.toLowerCase()) {\r\n this.props[key]({ detail: data })\r\n return false\r\n }\r\n return true\r\n })\r\n }\r\n\r\n render() {}\r\n}\r\n","import { diff } from './vdom/diff'\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 {object} [store]\r\n *\t@public\r\n */\r\nexport function render(vnode, parent, store, empty, merge) {\r\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\r\n\r\n if (empty) {\r\n while (parent.firstChild) {\r\n parent.removeChild(parent.firstChild)\r\n }\r\n }\r\n\r\n if (merge) {\r\n merge =\r\n typeof merge === 'string'\r\n ? document.querySelector(merge)\r\n : merge\r\n }\r\n\r\n return diff(merge, vnode, store, false, parent, false)\r\n}\r\n","import options from './options'\r\n\r\nexport function define(name, ctor) {\r\n options.mapping[name] = ctor\r\n}\r\n","export function rpx(str) {\r\n return str.replace(/([1-9]\\d*|0)(\\.\\d*)*rpx/g, (a, b) => {\r\n return (window.innerWidth * Number(b)) / 750 + 'px'\r\n })\r\n}\r\n","import Component from './component'\r\n\r\nexport default class ModelView extends Component {\r\n static observe = true\r\n\r\n static mergeUpdate = true\r\n\r\n beforeInstall() {\r\n this.data = this.vm.data\r\n }\r\n}\r\n","/**\r\n * classNames based on https://github.com/JedWatson/classnames\r\n * by Jed Watson\r\n * Licensed under the MIT License\r\n * https://github.com/JedWatson/classnames/blob/master/LICENSE\r\n * modified by dntzhang\r\n */\r\n\r\nvar hasOwn = {}.hasOwnProperty\r\n\r\nexport function classNames() {\r\n var classes = []\r\n\r\n for (var i = 0; i < arguments.length; i++) {\r\n var arg = arguments[i]\r\n if (!arg) continue\r\n\r\n var argType = typeof arg\r\n\r\n if (argType === 'string' || argType === 'number') {\r\n classes.push(arg)\r\n } else if (Array.isArray(arg) && arg.length) {\r\n var inner = classNames.apply(null, arg)\r\n if (inner) {\r\n classes.push(inner)\r\n }\r\n } else if (argType === 'object') {\r\n for (var key in arg) {\r\n if (hasOwn.call(arg, key) && arg[key]) {\r\n classes.push(key)\r\n }\r\n }\r\n }\r\n }\r\n\r\n return classes.join(' ')\r\n}\r\n\r\nexport function extractClass() {\r\n const [props, ...args] = Array.prototype.slice.call(arguments, 0)\r\n if (props) {\r\n if (props.class) {\r\n args.unshift(props.class)\r\n delete props.class\r\n } else if (props.className) {\r\n args.unshift(props.className)\r\n delete props.className\r\n }\r\n }\r\n if (args.length > 0) {\r\n return { class: classNames.apply(null, args) }\r\n }\r\n}\r\n","export function getHost(component) {\r\n let base = component.base\r\n if (base) {\r\n while (base.parentNode) {\r\n if (base.parentNode._component) {\r\n return base.parentNode._component\r\n } else {\r\n base = base.parentNode\r\n }\r\n }\r\n }\r\n}","/**\r\n * preact-render-to-string based on preact-render-to-string\r\n * by Jason Miller\r\n * Licensed under the MIT License\r\n * https://github.com/developit/preact-render-to-string\r\n *\r\n * modified by dntzhang\r\n */\r\n\r\nimport options from './options'\r\n\r\nimport {\r\n addScopedAttrStatic,\r\n getCtorName,\r\n scopeHost,\r\n scoper\r\n} from './style'\r\n\r\n\r\nconst encodeEntities = s => String(s)\r\n .replace(/&/g, '&')\r\n .replace(//g, '>')\r\n .replace(/\"/g, '"');\r\n\r\nconst indent = (s, char) => String(s).replace(/(\\n+)/g, '$1' + (char || '\\t'));\r\n\r\nconst mapping = options.mapping\r\n\r\nconst VOID_ELEMENTS = /^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/;\r\n\r\nconst isLargeString = (s, length, ignoreLines) => (String(s).length > (length || 40) || (!ignoreLines && String(s).indexOf('\\n') !== -1) || String(s).indexOf('<') !== -1);\r\n\r\nconst JS_TO_CSS = {};\r\n\r\n// Convert an Object style to a CSSText string\r\nfunction styleObjToCss(s) {\r\n let str = '';\r\n for (let prop in s) {\r\n let val = s[prop];\r\n if (val != null) {\r\n if (str) str += ' ';\r\n // str += jsToCss(prop);\r\n str += JS_TO_CSS[prop] || (JS_TO_CSS[prop] = prop.replace(/([A-Z])/g, '-$1').toLowerCase());\r\n str += ': ';\r\n str += val;\r\n if (typeof val === 'number' && IS_NON_DIMENSIONAL.test(prop) === false) {\r\n str += 'px';\r\n }\r\n str += ';';\r\n }\r\n }\r\n return str || undefined;\r\n}\r\n\r\n/** The default export is an alias of `render()`. */\r\nexport function renderToString(vnode, opts, store, isSvgMode, css) {\r\n if (vnode == null || typeof vnode === 'boolean') {\r\n return '';\r\n }\r\n\r\n let nodeName = vnode.nodeName,\r\n attributes = vnode.attributes,\r\n isComponent = false;\r\n store = store || {};\r\n opts = Object.assign({\r\n scopedCSS: true\r\n },opts)\r\n\r\n let pretty = true && opts.pretty,\r\n indentChar = pretty && typeof pretty === 'string' ? pretty : '\\t';\r\n\r\n // #text nodes\r\n if (typeof vnode !== 'object' && !nodeName) {\r\n return encodeEntities(vnode);\r\n }\r\n\r\n // components\r\n const ctor = mapping[nodeName]\r\n if (ctor) {\r\n isComponent = true;\r\n\r\n let props = getNodeProps(vnode),\r\n rendered;\r\n // class-based components\r\n let c = new ctor(props, store);\r\n // turn off stateful re-rendering:\r\n c._disable = c.__x = true;\r\n c.props = props;\r\n c.store = store;\r\n if (c.install) c.install();\r\n if (c.beforeRender) c.beforeRender();\r\n rendered = c.render(c.props, c.data, c.store);\r\n let tempCss \r\n if(opts.scopedCSS){\r\n\r\n if(c.css){\r\n const cssStr = typeof c.css === 'function' ? c.css() : c.css\r\n const cssAttr = '_s' + getCtorName(c.constructor)\r\n\r\n tempCss = ``\r\n }\r\n if (c.css) {\r\n addScopedAttrStatic(\r\n rendered,\r\n '_s' + getCtorName(c.constructor)\r\n )\r\n }\r\n \r\n c.scopedCSSAttr = vnode.css\r\n scopeHost(rendered, c.scopedCSSAttr)\r\n }\r\n\r\n return renderToString(rendered, opts, store, false, tempCss);\r\n }\r\n\r\n\r\n // render JSX to HTML\r\n let s = '', html;\r\n\r\n if (attributes) {\r\n let attrs = Object.keys(attributes);\r\n\r\n // allow sorting lexicographically for more determinism (useful for tests, such as via preact-jsx-chai)\r\n if (opts && opts.sortAttributes === true) attrs.sort();\r\n\r\n for (let i = 0; i < attrs.length; i++) {\r\n let name = attrs[i],\r\n v = attributes[name];\r\n if (name === 'children') continue;\r\n\r\n if (name.match(/[\\s\\n\\\\/='\"\\0<>]/)) continue;\r\n\r\n if (!(opts && opts.allAttributes) && (name === 'key' || name === 'ref')) continue;\r\n\r\n if (name === 'className') {\r\n if (attributes.class) continue;\r\n name = 'class';\r\n }\r\n else if (isSvgMode && name.match(/^xlink:?./)) {\r\n name = name.toLowerCase().replace(/^xlink:?/, 'xlink:');\r\n }\r\n\r\n if (name === 'style' && v && typeof v === 'object') {\r\n v = styleObjToCss(v);\r\n }\r\n\r\n let hooked = opts.attributeHook && opts.attributeHook(name, v, store, opts, isComponent);\r\n if (hooked || hooked === '') {\r\n s += hooked;\r\n continue;\r\n }\r\n\r\n if (name === 'dangerouslySetInnerHTML') {\r\n html = v && v.__html;\r\n }\r\n else if ((v || v === 0 || v === '') && typeof v !== 'function') {\r\n if (v === true || v === '') {\r\n v = name;\r\n // in non-xml mode, allow boolean attributes\r\n if (!opts || !opts.xml) {\r\n s += ' ' + name;\r\n continue;\r\n }\r\n }\r\n s += ` ${name}=\"${encodeEntities(v)}\"`;\r\n }\r\n }\r\n }\r\n\r\n // account for >1 multiline attribute\r\n if (pretty) {\r\n let sub = s.replace(/^\\n\\s*/, ' ');\r\n if (sub !== s && !~sub.indexOf('\\n')) s = sub;\r\n else if (pretty && ~s.indexOf('\\n')) s += '\\n';\r\n }\r\n\r\n s = `<${nodeName}${s}>`;\r\n if (String(nodeName).match(/[\\s\\n\\\\/='\"\\0<>]/)) throw s;\r\n\r\n let isVoid = String(nodeName).match(VOID_ELEMENTS);\r\n if (isVoid) s = s.replace(/>$/, ' />');\r\n\r\n let pieces = [];\r\n if (html) {\r\n // if multiline, indent.\r\n if (pretty && isLargeString(html)) {\r\n html = '\\n' + indentChar + indent(html, indentChar);\r\n }\r\n s += html;\r\n }\r\n else if (vnode.children) {\r\n let hasLarge = pretty && ~s.indexOf('\\n');\r\n for (let i = 0; i < vnode.children.length; i++) {\r\n let child = vnode.children[i];\r\n if (child != null && child !== false) {\r\n let childSvgMode = nodeName === 'svg' ? true : nodeName === 'foreignObject' ? false : isSvgMode,\r\n ret = renderToString(child, opts, store, childSvgMode);\r\n if (pretty && !hasLarge && isLargeString(ret)) hasLarge = true;\r\n if (ret) pieces.push(ret);\r\n }\r\n }\r\n if (pretty && hasLarge) {\r\n for (let i = pieces.length; i--;) {\r\n pieces[i] = '\\n' + indentChar + indent(pieces[i], indentChar);\r\n }\r\n }\r\n }\r\n\r\n if (pieces.length) {\r\n s += pieces.join('');\r\n }\r\n else if (opts && opts.xml) {\r\n return s.substring(0, s.length - 1) + ' />';\r\n }\r\n\r\n if (!isVoid) {\r\n if (pretty && ~s.indexOf('\\n')) s += '\\n';\r\n s += ``;\r\n }\r\n\r\n if(css) return css + s;\r\n return s;\r\n}\r\n\r\nfunction assign(obj, props) {\r\n for (let i in props) obj[i] = props[i];\r\n return obj;\r\n}\r\n\r\nfunction getNodeProps(vnode) {\r\n let props = assign({}, vnode.attributes);\r\n props.children = vnode.children;\r\n\r\n let defaultProps = vnode.nodeName.defaultProps;\r\n if (defaultProps !== undefined) {\r\n for (let i in defaultProps) {\r\n if (props[i] === undefined) {\r\n props[i] = defaultProps[i];\r\n }\r\n }\r\n }\r\n\r\n return props;\r\n}","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\nimport { define } from './define'\r\nimport { rpx } from './rpx'\r\nimport ModelView from './model-view'\r\nimport { classNames, extractClass } from './class'\r\nimport { getHost } from './get-host'\r\nimport { renderToString } from './render-to-string'\r\n\r\nconst WeElement = Component\r\nconst defineElement = define\r\nfunction createRef() {\r\n return {}\r\n}\r\n\r\noptions.root.Omi = {\r\n h,\r\n createElement,\r\n cloneElement,\r\n createRef,\r\n Component,\r\n render,\r\n rerender,\r\n options,\r\n WeElement,\r\n define,\r\n rpx,\r\n ModelView,\r\n defineElement,\r\n classNames,\r\n extractClass,\r\n getHost,\r\n renderToString\r\n}\r\noptions.root.omi = Omi\r\noptions.root.Omi.version = 'omio-1.3.5'\r\n\r\nexport default {\r\n h,\r\n createElement,\r\n cloneElement,\r\n createRef,\r\n Component,\r\n render,\r\n rerender,\r\n options,\r\n WeElement,\r\n define,\r\n rpx,\r\n ModelView,\r\n defineElement,\r\n classNames,\r\n extractClass,\r\n getHost,\r\n renderToString\r\n}\r\n\r\nexport {\r\n h,\r\n createElement,\r\n cloneElement,\r\n createRef,\r\n Component,\r\n render,\r\n rerender,\r\n options,\r\n WeElement,\r\n define,\r\n rpx,\r\n ModelView,\r\n defineElement,\r\n classNames,\r\n extractClass,\r\n getHost,\r\n renderToString\r\n}\r\n","import { define, render, Component } from '../../src/omi'\r\n\r\ndefine('my-hello', class extends Component {\r\n render() {\r\n //can get the parent's div style, can't get the h3's style\r\n return

{this.props.name}

\r\n }\r\n})\r\n\r\ndefine('my-app', class extends Component {\r\n \r\n css = `div{\r\n font-size:30px;\r\n }`\r\n\r\n install() {\r\n this.name = 'Omi'\r\n }\r\n\r\n handleTap = e => {\r\n this.name = 'Hello Omi !'\r\n this.update()\r\n }\r\n\r\n installed() {\r\n setTimeout(() => {\r\n this.name = 11\r\n this.update()\r\n }, 1000)\r\n }\r\n \r\n\r\n render() {\r\n return (\r\n
\r\n
tap me
\r\n \r\n
\r\n )\r\n }\r\n})\r\n\r\nrender(, 'body')\r\n"],"names":["VNode","getGlobal","global","Math","Array","self","window","scopedStyle","mapping","isWeb","staticStyleMapping","doc","document","root","styleCache","stack","EMPTY_CHILDREN","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","key","options","vnode","getOwnPropertySymbols","Object","hasOwnProperty","prototype","propIsEnumerable","propertyIsEnumerable","toObject","val","TypeError","assign","target","source","from","to","symbols","s","call","Element","addEventListener","runListeners","oEvent","event","iLstId","iElId","oEvtListeners","oListeners","type","aEls","aEvts","sEventType","fListener","nElIdx","aElListeners","splice","removeEventListener","create","proto","propertiesObject","Error","F","trim","replace","extend","obj","props","applyRef","ref","value","current","usePromise","Promise","__config__","platform","systemVersion","split","defer","resolve","then","bind","setTimeout","isArray","toString","nProps","result","keys","forEach","cloneElement","slice","NO_RENDER","SYNC_RENDER","FORCE_RENDER","ASYNC_RENDER","ATTR_KEY","IS_NON_DIMENSIONAL","items","enqueueRender","component","debounceRendering","rerender","renderComponent","isSameNodeType","node","hydrating","splitText","ctor","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","getNodeProps","defaultProps","createNode","isSvg","createElementNS","createElement","parseCSSText","cssText","cssTxt","match","a","b","rule","cssToJs","toUpperCase","properties","map","o","x","property","style","removeNode","parentNode","removeChild","setAccessor","name","old","className","test","oldJson","currentJson","changed","ckey","setStyles","innerHTML","__html","useCapture","substring","eventProxy","touchStart","touchEnd","_listeners","setProperty","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","e","___touchX","touches","pageX","___touchY","pageY","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","styleId","getCtorName","len","item","attrName","scoper","css","prefix","re","RegExp","g0","g1","g2","g3","appendClass","addStyle","id","ele","getElementById","head","getElementsByTagName","someThingStyles","appendChild","ActiveXObject","styleSheet","textContent","addStyleWithoutId","addScopedAttrStatic","vdom","attr","scopeVdom","addStyleToHead","scopeHost","mounts","diffLevel","isSvgMode","flushMounts","c","afterMount","installed","constructor","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","out","prevSvgMode","vnodeName","buildComponentFromVNode","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","firstChild","fc","vchildren","nextSibling","innerDiffNode","dangerouslySetInnerHTML","diffAttributes","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","childrenLen","vlen","j","f","vchild","__key","insertBefore","unmountOnly","unmountComponent","removeChildren","lastChild","next","previousSibling","attrs","components","collectComponent","createComponent","Ctor","list","inst","render","Component","doRender","scopedCssAttr","nextBase","data","obaa","arr","callback","_observe","$observer","eventPropArr","$observeProps","$observerPath","mock","prop","isInArray","watch","isString","propertyChangedHandler","propChanged","all","onPropertyChanged","oldValue","path","rootName","_getRootName","handler","indexOf","methods","apply","triggerStr","cprop","isFunction","currentValue","defineProperty","get","set","join","add","exec","size","callbacks","nextTickCallback","fireTick","fn","scope","nextItem","proxyUpdate","timeout","_willUpdate","mergeUpdate","clearTimeout","update","setComponentProps","opts","_disable","__ref","base","beforeInstall","install","observe","receiveProps","prevContext","prevProps","syncComponentUpdates","shallowComparison","isChild","previousProps","previousState","prevState","previousContext","isUpdate","initialBase","initialChildComponent","skip","rendered","cbase","store","beforeUpdate","beforeRender","getChildContext","childComponent","toUnmount","childProps","_parentComponent","baseParent","componentRef","t","unshift","afterUpdate","updated","_renderCallbacks","originalComponent","oldDom","isDirectOwner","isOwner","beforeUnmount","uninstall","inner","elementId","_preCss","componentChange","fire","every","is","empty","merge","querySelector","define","rpx","str","innerWidth","Number","ModelView","vm","hasOwn","classNames","classes","arg","argType","extractClass","args","class","getHost","encodeEntities","indent","char","VOID_ELEMENTS","isLargeString","ignoreLines","JS_TO_CSS","styleObjToCss","renderToString","isComponent","scopedCSS","pretty","indentChar","__x","tempCss","cssStr","cssAttr","scopedCSSAttr","html","sortAttributes","sort","v","allAttributes","hooked","attributeHook","xml","sub","isVoid","pieces","hasLarge","childSvgMode","WeElement","defineElement","createRef","Omi","omi","version","handleTap"],"mappings":";;;EAAA;AACA,EAAO,SAASA,KAAT,GAAiB;;ECDxB,SAASC,SAAT,GAAqB;EACnB,MACE,OAAOC,MAAP,KAAkB,QAAlB,IACA,CAACA,MADD,IAEAA,OAAOC,IAAP,KAAgBA,IAFhB,IAGAD,OAAOE,KAAP,KAAiBA,KAJnB,EAKE;EACA,QAAI,OAAOC,IAAP,KAAgB,WAApB,EAAiC;EAC/B,aAAOA,IAAP;EACD,KAFD,MAEO,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;EACxC,aAAOA,MAAP;EACD,KAFM,MAEA,IAAI,OAAOJ,MAAP,KAAkB,WAAtB,EAAmC;EACxC,aAAOA,MAAP;EACD;EACD,WAAQ,YAAW;EACjB,aAAO,IAAP;EACD,KAFM,EAAP;EAGD;EACD,SAAOA,MAAP;EACD;;EAED;;;;AAIA,gBAAe;EACbK,eAAa,IADA;EAEbC,WAAS,EAFI;EAGbC,SAAO,IAHM;EAIbC,sBAAoB,EAJP;EAKbC,OAAK,OAAOC,QAAP,KAAoB,QAApB,GAA+BA,QAA/B,GAA0C,IALlC;EAMbC,QAAMZ,WANO;EAOb;EACAa,cAAY;EACZ;EACA;;;;;EAKA;;EAEA;;;EAGA;;EAEA;EACA;;EAEA;EACA;;EAEA;EACA;EA7Ba,CAAf;;ECtBA,IAAMC,QAAQ,EAAd;;EAEA,IAAMC,iBAAiB,EAAvB;;EAEA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KvM,KAAL,CAAWsE;EAAjB;EAAL,KAAP;EACD,GAJH;;EAAA;EAAA,EAAiCkI,SAAjC;;EAOA4G,OAAO,QAAP;EAAA;;EAAA;EAAA;;EAAA;;EAAA;EAAA;EAAA;;EAAA,mJAEEnM,GAFF,8CAUEwP,SAVF,GAUc,aAAK;EACf,aAAKnS,IAAL,GAAY,aAAZ;EACA,aAAKsL,MAAL;EACD,KAbH;EAAA;;EAAA,oBAMEO,OANF,sBAMY;EACR,SAAK7L,IAAL,GAAY,KAAZ;EACD,GARH;;EAAA,oBAeE4E,SAfF,wBAec;EAAA;;EACVnI,eAAW,YAAM;EACf,aAAKuD,IAAL,GAAY,EAAZ;EACA,aAAKsL,MAAL;EACD,KAHD,EAGG,IAHH;EAID,GApBH;;EAAA,oBAuBErD,MAvBF,wBAuBW;EACP,WACE;EAAA;EAAA;EACE;EAAA;EAAA,UAAK,OAAO,KAAKkK,SAAjB;EAAA;EAAA,OADF;EAEE,0BAAU,MAAM,KAAKnS,IAArB;EAFF,KADF;EAMD,GA9BH;;EAAA;EAAA,EAA+BkI,SAA/B;;EAiCAD,OAAO,qBAAP,EAAmB,MAAnB;;;;"} \ No newline at end of file +{"version":3,"file":"b.js","sources":["../../src/vnode.js","../../src/options.js","../../src/h.js","../../src/util.js","../../src/clone-element.js","../../src/constants.js","../../src/render-queue.js","../../src/vdom/index.js","../../src/dom/index.js","../../src/style.js","../../src/vdom/diff.js","../../src/vdom/component-recycler.js","../../src/obaa.js","../../src/tick.js","../../src/observe.js","../../src/vdom/component.js","../../src/component.js","../../src/render.js","../../src/define.js","../../src/rpx.js","../../src/model-view.js","../../src/class.js","../../src/get-host.js","../../src/render-to-string.js","../../src/omi.js","main.js"],"sourcesContent":["/** Virtual DOM Node */\nexport function VNode() {}\n","function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n if (typeof self !== 'undefined') {\n return self\n } else if (typeof window !== 'undefined') {\n return window\n } else if (typeof global !== 'undefined') {\n return global\n }\n return (function() {\n return this\n })()\n }\n return global\n}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nexport default {\n scopedStyle: true,\n mapping: {},\n isWeb: true,\n staticStyleMapping: {},\n doc: typeof document === 'object' ? document : null,\n root: getGlobal(),\n //styleCache :[{ctor:ctor,ctorName:ctorName,style:style}]\n styleCache: []\n //componentChange(component, element) { },\n /** If `true`, `prop` changes trigger synchronous component updates.\n *\t@name syncComponentUpdates\n *\t@type Boolean\n *\t@default true\n */\n //syncComponentUpdates: true,\n\n /** Processes all created VNodes.\n *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\n */\n //vnode(vnode) { }\n\n /** Hook invoked after a component is mounted. */\n //afterMount(component) { },\n\n /** Hook invoked after the DOM is updated with a component's latest render. */\n //afterUpdate(component) { }\n\n /** Hook invoked immediately before a component is unmounted. */\n // beforeUnmount(component) { }\n}\n","import { VNode } from './vnode'\nimport options from './options'\n\nconst stack = []\n\nconst EMPTY_CHILDREN = []\n\n/**\n * JSX/hyperscript reviver.\n * @see http://jasonformat.com/wtf-is-jsx\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\n *\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\n *\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\n * the current _actual_ DOM structure, and applying only the differences.\n *\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\n * and optionally children to append to the element.\n *\n * @example The following DOM tree\n *\n * `
Hello!
`\n *\n * can be constructed using this function as:\n *\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\n *\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\n * @param {Object} attributes\tAny attributes/props to set on the created element.\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\n *\n * @public\n */\nexport function h(nodeName, attributes) {\n let children = EMPTY_CHILDREN,\n lastSimple,\n child,\n simple,\n i\n for (i = arguments.length; i-- > 2; ) {\n stack.push(arguments[i])\n }\n if (attributes && attributes.children != null) {\n if (!stack.length) stack.push(attributes.children)\n delete attributes.children\n }\n while (stack.length) {\n if ((child = stack.pop()) && child.pop !== undefined) {\n for (i = child.length; i--; ) stack.push(child[i])\n } else {\n if (typeof child === 'boolean') child = null\n\n if ((simple = typeof nodeName !== 'function')) {\n if (child == null) child = ''\n else if (typeof child === 'number') child = String(child)\n else if (typeof child !== 'string') simple = false\n }\n\n if (simple && lastSimple) {\n children[children.length - 1] += child\n } else if (children === EMPTY_CHILDREN) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n let p = new VNode()\n p.nodeName = nodeName\n p.children = children\n\tp.attributes = attributes == null ? undefined : attributes\n p.key = attributes == null ? undefined : attributes.key\n\n // if a \"vnode hook\" is defined, pass every created VNode to it\n if (options.vnode !== undefined) options.vnode(p)\n\n return p\n}\n","'use strict'\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols\nvar hasOwnProperty = Object.prototype.hasOwnProperty\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable\n\nfunction toObject(val) {\n if (val === null || val === undefined) {\n throw new TypeError('Object.assign cannot be called with null or undefined')\n }\n\n return Object(val)\n}\n\nexport function assign(target, source) {\n var from\n var to = toObject(target)\n var symbols\n\n for (var s = 1; s < arguments.length; s++) {\n from = Object(arguments[s])\n\n for (var key in from) {\n if (hasOwnProperty.call(from, key)) {\n to[key] = from[key]\n }\n }\n\n if (getOwnPropertySymbols) {\n symbols = getOwnPropertySymbols(from)\n for (var i = 0; i < symbols.length; i++) {\n if (propIsEnumerable.call(from, symbols[i])) {\n to[symbols[i]] = from[symbols[i]]\n }\n }\n }\n }\n\n return to\n}\n\nif (typeof Element !== 'undefined' && !Element.prototype.addEventListener) {\n var oListeners = {};\n function runListeners(oEvent) {\n if (!oEvent) { oEvent = window.event; }\n for (var iLstId = 0, iElId = 0, oEvtListeners = oListeners[oEvent.type]; iElId < oEvtListeners.aEls.length; iElId++) {\n if (oEvtListeners.aEls[iElId] === this) {\n for (iLstId; iLstId < oEvtListeners.aEvts[iElId].length; iLstId++) { oEvtListeners.aEvts[iElId][iLstId].call(this, oEvent); }\n break;\n }\n }\n }\n Element.prototype.addEventListener = function (sEventType, fListener /*, useCapture (will be ignored!) */) {\n if (oListeners.hasOwnProperty(sEventType)) {\n var oEvtListeners = oListeners[sEventType];\n for (var nElIdx = -1, iElId = 0; iElId < oEvtListeners.aEls.length; iElId++) {\n if (oEvtListeners.aEls[iElId] === this) { nElIdx = iElId; break; }\n }\n if (nElIdx === -1) {\n oEvtListeners.aEls.push(this);\n oEvtListeners.aEvts.push([fListener]);\n this[\"on\" + sEventType] = runListeners;\n } else {\n var aElListeners = oEvtListeners.aEvts[nElIdx];\n if (this[\"on\" + sEventType] !== runListeners) {\n aElListeners.splice(0);\n this[\"on\" + sEventType] = runListeners;\n }\n for (var iLstId = 0; iLstId < aElListeners.length; iLstId++) {\n if (aElListeners[iLstId] === fListener) { return; }\n }\n aElListeners.push(fListener);\n }\n } else {\n oListeners[sEventType] = { aEls: [this], aEvts: [[fListener]] };\n this[\"on\" + sEventType] = runListeners;\n }\n };\n Element.prototype.removeEventListener = function (sEventType, fListener /*, useCapture (will be ignored!) */) {\n if (!oListeners.hasOwnProperty(sEventType)) { return; }\n var oEvtListeners = oListeners[sEventType];\n for (var nElIdx = -1, iElId = 0; iElId < oEvtListeners.aEls.length; iElId++) {\n if (oEvtListeners.aEls[iElId] === this) { nElIdx = iElId; break; }\n }\n if (nElIdx === -1) { return; }\n for (var iLstId = 0, aElListeners = oEvtListeners.aEvts[nElIdx]; iLstId < aElListeners.length; iLstId++) {\n if (aElListeners[iLstId] === fListener) { aElListeners.splice(iLstId, 1); }\n }\n };\n}\n\n\nif (typeof Object.create !== 'function') {\n Object.create = function(proto, propertiesObject) {\n if (typeof proto !== 'object' && typeof proto !== 'function') {\n throw new TypeError('Object prototype may only be an Object: ' + proto)\n } else if (proto === null) {\n throw new Error(\n \"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\"\n )\n }\n\n // if (typeof propertiesObject != 'undefined') {\n // throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support a second argument.\");\n // }\n\n function F() {}\n F.prototype = proto\n\n return new F()\n }\n}\n\nif (!String.prototype.trim) {\n String.prototype.trim = function () {\n return this.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '')\n }\n}\n\n/**\n * Copy all properties from `props` onto `obj`.\n * @param {Object} obj\t\tObject onto which properties should be copied.\n * @param {Object} props\tObject from which to copy properties.\n * @returns obj\n * @private\n */\nexport function extend(obj, props) {\n for (let i in props) obj[i] = props[i]\n return obj\n}\n\n/** Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} [ref=null]\n * @param {any} [value]\n */\nexport function applyRef(ref, value) {\n if (ref) {\n if (typeof ref == 'function') ref(value)\n else ref.current = value\n }\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n *\n * @param {Function} callback\n */\n\nlet usePromise = typeof Promise == 'function'\n\n// for native\nif (\n typeof document !== 'object' &&\n typeof global !== 'undefined' &&\n global.__config__\n) {\n if (global.__config__.platform === 'android') {\n usePromise = true\n } else {\n let systemVersion =\n (global.__config__.systemVersion &&\n global.__config__.systemVersion.split('.')[0]) ||\n 0\n if (systemVersion > 8) {\n usePromise = true\n }\n }\n}\n\nexport const defer = usePromise\n ? Promise.resolve().then.bind(Promise.resolve())\n : setTimeout\n\nexport function isArray(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nexport function nProps(props) {\n if (!props || isArray(props)) return {}\n const result = {}\n Object.keys(props).forEach(key => {\n result[key] = props[key].value\n })\n return result\n}","import { extend } from './util'\nimport { h } from './h'\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\n * @param {Object} props\tAttributes/props to add when cloning\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\n */\nexport function cloneElement(vnode, props) {\n return h(\n vnode.nodeName,\n extend(extend({}, vnode.attributes), props),\n arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children\n )\n}\n","// render modes\n\nexport const NO_RENDER = 0\nexport const SYNC_RENDER = 1\nexport const FORCE_RENDER = 2\nexport const ASYNC_RENDER = 3\n\nexport const ATTR_KEY = '__omiattr_'\n\n// DOM properties that should NOT have \"px\" added when numeric\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i\n","import options from './options'\nimport { defer } from './util'\nimport { renderComponent } from './vdom/component'\n\n/** Managed queue of dirty components to be re-rendered */\n\nlet items = []\n\nexport function enqueueRender(component) {\n if (items.push(component) == 1) {\n ;(options.debounceRendering || defer)(rerender)\n }\n}\n\n/** Rerender all enqueued dirty components */\nexport function rerender() {\n\tlet p\n\twhile ( (p = items.pop()) ) {\n renderComponent(p)\n\t}\n}","import { extend } from '../util'\nimport options from '../options'\n\nconst mapping = options.mapping\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node\t\t\tDOM Node to compare\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\n * @private\n */\nexport function isSameNodeType(node, vnode, hydrating) {\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n return node.splitText !== undefined\n }\n if (typeof vnode.nodeName === 'string') {\n var ctor = mapping[vnode.nodeName]\n if (ctor) {\n return hydrating || node._componentConstructor === ctor\n }\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n }\n return hydrating || node._componentConstructor === vnode.nodeName\n}\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n *\n * @param {Element} node\tA DOM Element to inspect the name of.\n * @param {String} nodeName\tUnnormalized name to compare against.\n */\nexport function isNamedNode(node, nodeName) {\n return (\n node.normalizedNodeName === nodeName ||\n node.nodeName.toLowerCase() === nodeName.toLowerCase()\n )\n}\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n *\n * @param {VNode} vnode\n * @returns {Object} props\n */\nexport function getNodeProps(vnode) {\n let props = extend({}, vnode.attributes)\n props.children = vnode.children\n\n let defaultProps = vnode.nodeName.defaultProps\n if (defaultProps !== undefined) {\n for (let i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i]\n }\n }\n }\n\n return props\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\n\n/** Create an element with the given nodeName.\n *\t@param {String} nodeName\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\n *\t@returns {Element} node\n */\nexport function createNode(nodeName, isSvg) {\n let node = isSvg\n ? options.doc.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : options.doc.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\nfunction parseCSSText(cssText) {\n let cssTxt = cssText.replace(/\\/\\*(.|\\s)*?\\*\\//g, ' ').replace(/\\s+/g, ' ')\n let style = {},\n [a, b, rule] = cssTxt.match(/ ?(.*?) ?{([^}]*)}/) || [a, b, cssTxt]\n let cssToJs = s => s.replace(/\\W+\\w/g, match => match.slice(-1).toUpperCase())\n let properties = rule\n .split(';')\n .map(o => o.split(':').map(x => x && x.trim()))\n for (let [property, value] of properties) style[cssToJs(property)] = value\n return style\n}\n\n/** Remove a child node from its parent if attached.\n *\t@param {Element} node\t\tThe node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\n *\tIf `value` is `null`, the attribute/handler will be removed.\n *\t@param {Element} node\tAn element to mutate\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\n *\t@param {any} old\tThe last value that was set for this name/node pair\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\n *\t@private\n */\nexport function setAccessor(node, name, old, value, isSvg) {\n if (name === 'className') name = 'class'\n\n if (name === 'key') {\n // ignore\n } else if (name === 'ref') {\n applyRef(old, null)\n applyRef(value, node)\n } else if (name === 'class' && !isSvg) {\n node.className = value || ''\n } else if (name === 'style') {\n if (options.isWeb) {\n if (!value || typeof value === 'string' || typeof old === 'string') {\n node.style.cssText = value || ''\n }\n if (value && typeof value === 'object') {\n if (typeof old !== 'string') {\n for (let i in old) if (!(i in value)) node.style[i] = ''\n }\n for (let i in value) {\n node.style[i] =\n typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\n ? value[i] + 'px'\n : value[i]\n }\n }\n } else {\n let oldJson = old,\n currentJson = value\n if (typeof old === 'string') {\n oldJson = parseCSSText(old)\n }\n if (typeof value == 'string') {\n currentJson = parseCSSText(value)\n }\n\n let result = {},\n changed = false\n\n if (oldJson) {\n for (let key in oldJson) {\n if (typeof currentJson == 'object' && !(key in currentJson)) {\n result[key] = ''\n changed = true\n }\n }\n\n for (let ckey in currentJson) {\n if (currentJson[ckey] !== oldJson[ckey]) {\n result[ckey] = currentJson[ckey]\n changed = true\n }\n }\n\n if (changed) {\n node.setStyles(result)\n }\n } else {\n node.setStyles(currentJson)\n }\n }\n } else if (name === 'dangerouslySetInnerHTML') {\n if (value) node.innerHTML = value.__html || ''\n } else if (name[0] == 'o' && name[1] == 'n') {\n let useCapture = name !== (name = name.replace(/Capture$/, ''))\n name = name.toLowerCase().substring(2)\n if (value) {\n if (!old) {\n node.addEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.addEventListener('touchstart', touchStart, useCapture)\n node.addEventListener('touchend', touchEnd, useCapture)\n }\n }\n } else {\n node.removeEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.removeEventListener('touchstart', touchStart, useCapture)\n node.removeEventListener('touchend', touchEnd, useCapture)\n }\n }\n ;(node._listeners || (node._listeners = {}))[name] = value\n } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n setProperty(node, name, value == null ? '' : value)\n if (value == null || value === false) node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n if (value == null || value === false) {\n if (ns)\n node.removeAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase()\n )\n else node.removeAttribute(name)\n } else if (typeof value !== 'function') {\n if (ns)\n node.setAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase(),\n value\n )\n else node.setAttribute(name, value)\n }\n }\n}\n\n/** Attempt to set a DOM property to the given value.\n *\tIE & FF throw for certain property-value combinations.\n */\nfunction setProperty(node, name, value) {\n try {\n node[name] = value\n } catch (e) {}\n}\n\n/** Proxy an event to hooked event handlers\n *\t@private\n */\nfunction eventProxy(e) {\n return this._listeners[e.type]((options.event && options.event(e)) || e)\n}\n\nfunction touchStart(e) {\n this.___touchX = e.touches[0].pageX\n this.___touchY = e.touches[0].pageY\n this.___scrollTop = document.body.scrollTop\n}\n\nfunction touchEnd(e) {\n if (\n Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 &&\n Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 &&\n Math.abs(document.body.scrollTop - this.___scrollTop) < 30\n ) {\n this.dispatchEvent(new CustomEvent('tap', { detail: e }))\n }\n}","import options from './options'\n\nlet styleId = 0\n\nexport function getCtorName(ctor) {\n for (let i = 0, len = options.styleCache.length; i < len; i++) {\n let item = options.styleCache[i]\n\n if (item.ctor === ctor) {\n return item.attrName\n }\n }\n\n let attrName = 's' + styleId\n options.styleCache.push({ ctor, attrName })\n styleId++\n\n return attrName\n}\n\n// many thanks to https://github.com/thomaspark/scoper/\nexport function scoper(css, prefix) {\n prefix = '[' + prefix.toLowerCase() + ']'\n // https://www.w3.org/TR/css-syntax-3/#lexical\n css = css.replace(/\\/\\*[^*]*\\*+([^/][^*]*\\*+)*\\//g, '')\n // eslint-disable-next-line\n let re = new RegExp('([^\\r\\n,{}:]+)(:[^\\r\\n,{}]+)?(,(?=[^{}]*{)|\\s*{)', 'g')\n /**\n * Example:\n *\n * .classname::pesudo { color:red }\n *\n * g1 is normal selector `.classname`\n * g2 is pesudo class or pesudo element\n * g3 is the suffix\n */\n css = css.replace(re, (g0, g1, g2, g3) => {\n if (typeof g2 === 'undefined') {\n g2 = ''\n }\n\n /* eslint-ignore-next-line */\n if (\n g1.match(\n /^\\s*(@media|\\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/\n )\n ) {\n return g1 + g2 + g3\n }\n\n let appendClass = g1.replace(/(\\s*)$/, '') + prefix + g2\n //let prependClass = prefix + ' ' + g1.trim() + g2;\n\n return appendClass + g3\n //return appendClass + ',' + prependClass + g3;\n })\n\n return css\n}\n\nexport function addStyle(cssText, id) {\n id = id.toLowerCase()\n let ele = document.getElementById(id)\n let head = document.getElementsByTagName('head')[0]\n if (ele && ele.parentNode === head) {\n head.removeChild(ele)\n }\n\n let someThingStyles = document.createElement('style')\n head.appendChild(someThingStyles)\n someThingStyles.setAttribute('type', 'text/css')\n someThingStyles.setAttribute('id', id)\n if (window.ActiveXObject) {\n someThingStyles.styleSheet.cssText = cssText\n } else {\n someThingStyles.textContent = cssText\n }\n}\n\nexport function addStyleWithoutId(cssText) {\n let head = document.getElementsByTagName('head')[0]\n let someThingStyles = document.createElement('style')\n head.appendChild(someThingStyles)\n someThingStyles.setAttribute('type', 'text/css')\n\n if (window.ActiveXObject) {\n someThingStyles.styleSheet.cssText = cssText\n } else {\n someThingStyles.textContent = cssText\n }\n}\n\nexport function addScopedAttrStatic(vdom, attr) {\n if (options.scopedStyle) {\n scopeVdom(attr, vdom)\n } \n}\n\nexport function addStyleToHead(style, attr) {\n if (options.scopedStyle) {\n if (!options.staticStyleMapping[attr]) {\n addStyle(scoper(style, attr), attr)\n options.staticStyleMapping[attr] = true\n }\n } else if (!options.staticStyleMapping[attr]) {\n addStyleWithoutId(style)\n options.staticStyleMapping[attr] = true\n }\n}\n\nexport function scopeVdom(attr, vdom) {\n if (typeof vdom === 'object') {\n vdom.attributes = vdom.attributes || {}\n vdom.attributes[attr] = ''\n vdom.css = vdom.css || {}\n vdom.css[attr] = ''\n vdom.children.forEach(child => scopeVdom(attr, child))\n }\n}\n\nexport function scopeHost(vdom, css) {\n if (typeof vdom === 'object' && css) {\n vdom.attributes = vdom.attributes || {}\n for (let key in css) {\n vdom.attributes[key] = ''\n }\n }\n}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { buildComponentFromVNode } from './component'\nimport { createNode, setAccessor } from '../dom/index'\nimport { unmountComponent } from './component'\nimport options from '../options'\nimport { applyRef } from '../util'\nimport { removeNode } from '../dom/index'\nimport { isArray } from '../util'\nimport { addStyleToHead, getCtorName } from '../style'\n/** Queue of components that have been mounted and are awaiting componentDidMount */\nexport const mounts = []\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nexport let diffLevel = 0\n\n/** Global flag indicating if the diff is currently within an SVG */\nlet isSvgMode = false\n\n/** Global flag indicating if the diff is performing hydration */\nlet hydrating = false\n\n/** Invoke queued componentDidMount lifecycle methods */\nexport function flushMounts() {\n let c\n while ((c = mounts.pop())) {\n if (options.afterMount) options.afterMount(c)\n if (c.installed) c.installed()\n if (c.constructor.css || c.css) {\n addStyleToHead(c.constructor.css ? c.constructor.css : (typeof c.css === 'function' ? c.css() : c.css), '_s' + getCtorName(c.constructor))\n }\n }\n}\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\n *\t@returns {Element} dom\t\t\tThe created/mutated element\n *\t@private\n */\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n if (!diffLevel++) {\n // when first starting the diff, check if we're diffing an SVG or within an SVG\n isSvgMode = parent != null && parent.ownerSVGElement !== undefined\n\n // hydration is indicated by the existing element to be diffed not having a prop cache\n hydrating = dom != null && !(ATTR_KEY in dom)\n }\n let ret\n\n if (isArray(vnode)) {\n vnode = {\n nodeName: 'span',\n children: vnode\n }\n }\n\n ret = idiff(dom, vnode, context, mountAll, componentRoot)\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n\n // diffLevel being reduced to 0 means we're exiting the diff\n if (!--diffLevel) {\n hydrating = false\n // invoke queued componentDidMount lifecycle methods\n if (!componentRoot) flushMounts()\n }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n let out = dom,\n prevSvgMode = isSvgMode\n\n // empty values (null, undefined, booleans) render as empty Text nodes\n if (vnode == null || typeof vnode === 'boolean') vnode = ''\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n if (options.mapping[vnodeName]) {\n vnode.nodeName = options.mapping[vnodeName]\n return buildComponentFromVNode(dom, vnode, context, mountAll)\n }\n if (typeof vnodeName == 'function') {\n return buildComponentFromVNode(dom, vnode, context, mountAll)\n }\n\n // Fast case: Strings & Numbers create/update Text nodes.\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n // update if it's already a Text node:\n if (\n dom &&\n dom.splitText !== undefined &&\n dom.parentNode &&\n (!dom._component || componentRoot)\n ) {\n /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n if (dom.nodeValue != vnode) {\n dom.nodeValue = vnode\n }\n } else {\n // it wasn't a Text node: replace it with one and recycle the old Element\n out = document.createTextNode(vnode)\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n recollectNodeTree(dom, true)\n }\n }\n\n //ie8 error\n try {\n out[ATTR_KEY] = true\n } catch (e) {}\n\n return out\n }\n\n // Tracks entering and exiting SVG namespace when descending through the tree.\n isSvgMode =\n vnodeName === 'svg'\n ? true\n : vnodeName === 'foreignObject'\n ? false\n : isSvgMode\n\n // If there's no existing element or it's the wrong type, create a new one:\n vnodeName = String(vnodeName)\n if (!dom || !isNamedNode(dom, vnodeName)) {\n out = createNode(vnodeName, isSvgMode)\n\n if (dom) {\n // move children into the replacement node\n while (dom.firstChild) out.appendChild(dom.firstChild)\n\n // if the previous Element was mounted into the DOM, replace it inline\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\n // recycle the old element (skips non-Element node types)\n recollectNodeTree(dom, true)\n }\n }\n\n let fc = out.firstChild,\n props = out[ATTR_KEY],\n vchildren = vnode.children\n\n if (props == null) {\n props = out[ATTR_KEY] = {}\n for (let a = out.attributes, i = a.length; i--; )\n props[a[i].name] = a[i].value\n }\n\n // Optimization: fast-path for elements containing a single TextNode:\n if (\n !hydrating &&\n vchildren &&\n vchildren.length === 1 &&\n typeof vchildren[0] === 'string' &&\n fc != null &&\n fc.splitText !== undefined &&\n fc.nextSibling == null\n ) {\n if (fc.nodeValue != vchildren[0]) {\n fc.nodeValue = vchildren[0]\n }\n }\n // otherwise, if there are existing or new children, diff them:\n else if ((vchildren && vchildren.length) || fc != null) {\n innerDiffNode(\n out,\n vchildren,\n context,\n mountAll,\n hydrating || props.dangerouslySetInnerHTML != null\n )\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props)\n\n // restore previous SVG mode: (in case we're exiting an SVG namespace)\n isSvgMode = prevSvgMode\n\n return out\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\n *\t@param {Boolean} mountAll\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n let originalChildren = dom.childNodes,\n children = [],\n keyed = {},\n keyedLen = 0,\n min = 0,\n len = originalChildren.length,\n childrenLen = 0,\n vlen = vchildren ? vchildren.length : 0,\n j,\n c,\n f,\n vchild,\n child\n\n // Build up a map of keyed children and an Array of unkeyed children:\n if (len !== 0) {\n for (let i = 0; i < len; i++) {\n let child = originalChildren[i],\n props = child[ATTR_KEY],\n key =\n vlen && props\n ? child._component\n ? child._component.__key\n : props.key\n : null\n if (key != null) {\n keyedLen++\n keyed[key] = child\n } else if (\n props ||\n (child.splitText !== undefined\n ? isHydrating\n ? child.nodeValue.trim()\n : true\n : isHydrating)\n ) {\n children[childrenLen++] = child\n }\n }\n }\n\n if (vlen !== 0) {\n for (let i = 0; i < vlen; i++) {\n vchild = vchildren[i]\n child = null\n\n // attempt to find a node based on key matching\n let key = vchild.key\n if (key != null) {\n if (keyedLen && keyed[key] !== undefined) {\n child = keyed[key]\n keyed[key] = undefined\n keyedLen--\n }\n }\n // attempt to pluck a node of the same type from the existing children\n else if (!child && min < childrenLen) {\n for (j = min; j < childrenLen; j++) {\n if (\n children[j] !== undefined &&\n isSameNodeType((c = children[j]), vchild, isHydrating)\n ) {\n child = c\n children[j] = undefined\n if (j === childrenLen - 1) childrenLen--\n if (j === min) min++\n break\n }\n }\n }\n\n // morph the matched/found/created DOM child to match vchild (deep)\n child = idiff(child, vchild, context, mountAll)\n\n f = originalChildren[i]\n if (child && child !== dom && child !== f) {\n if (f == null) {\n dom.appendChild(child)\n } else if (child === f.nextSibling) {\n removeNode(f)\n } else {\n dom.insertBefore(child, f)\n }\n }\n }\n }\n\n // remove unused keyed children:\n if (keyedLen) {\n for (let i in keyed)\n if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false)\n }\n\n // remove orphaned unkeyed children:\n while (min <= childrenLen) {\n if ((child = children[childrenLen--]) !== undefined)\n recollectNodeTree(child, false)\n }\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\n let component = node._component\n if (component) {\n // if node is owned by a Component, unmount that component (ends up recursing back here)\n unmountComponent(component)\n } else {\n // If the node's VNode had a ref function, invoke it with null here.\n // (this is part of the React spec, and smart for unsetting references)\n if (node[ATTR_KEY] != null) applyRef(node[ATTR_KEY].ref, null)\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n }\n}\n\n/** Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nexport function removeChildren(node) {\n node = node.lastChild\n while (node) {\n let next = node.previousSibling\n recollectNodeTree(node, true)\n node = next\n }\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old) {\n let name\n\n // remove attributes no longer present on the vnode by setting them to undefined\n for (name in old) {\n if (!(attrs && attrs[name] != null) && old[name] != null) {\n setAccessor(dom, name, old[name], (old[name] = undefined), isSvgMode)\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n if (\n name !== 'children' &&\n name !== 'innerHTML' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\n }\n }\n}\n","import Component from '../component'\nimport options from '../options'\n/** Retains a pool of Components for re-use, keyed on component name.\n *\tNote: since component names are not unique or even necessarily available, these are primarily a form of sharding.\n *\t@private\n */\nconst components = {}\n\n/** Reclaim a component for later re-use by the recycler. */\nexport function collectComponent(component) {\n let name = component.constructor.name\n ;(components[name] || (components[name] = [])).push(component)\n}\n\n/** Create a component. Normalizes differences between PFC's and classful Components. */\nexport function createComponent(Ctor, props, context, vnode) {\n let list = components[Ctor.name],\n inst\n\n if (Ctor.prototype && Ctor.prototype.render) {\n inst = new Ctor(props, context)\n Component.call(inst, props, context)\n } else {\n inst = new Component(props, context)\n inst.constructor = Ctor\n inst.render = doRender\n }\n vnode && (inst.scopedCssAttr = vnode.css)\n\n if (list) {\n for (let i = list.length; i--; ) {\n if (list[i].constructor === Ctor) {\n inst.nextBase = list[i].nextBase\n list.splice(i, 1)\n break\n }\n }\n }\n return inst\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, data, context) {\n return this.constructor(props, context)\n}\n","/* obaa 1.0.0\n * By dntzhang\n * Github: https://github.com/Tencent/omi\n * MIT Licensed.\n */\n\nvar obaa = function(target, arr, callback) {\n var _observe = function(target, arr, callback) {\n if (!target.$observer) target.$observer = this\n var $observer = target.$observer\n var eventPropArr = []\n if (obaa.isArray(target)) {\n if (target.length === 0) {\n target.$observeProps = {}\n target.$observeProps.$observerPath = '#'\n }\n $observer.mock(target)\n }\n for (var prop in target) {\n if (target.hasOwnProperty(prop)) {\n if (callback) {\n if (obaa.isArray(arr) && obaa.isInArray(arr, prop)) {\n eventPropArr.push(prop)\n $observer.watch(target, prop)\n } else if (obaa.isString(arr) && prop == arr) {\n eventPropArr.push(prop)\n $observer.watch(target, prop)\n }\n } else {\n eventPropArr.push(prop)\n $observer.watch(target, prop)\n }\n }\n }\n $observer.target = target\n if (!$observer.propertyChangedHandler) $observer.propertyChangedHandler = []\n var propChanged = callback ? callback : arr\n $observer.propertyChangedHandler.push({\n all: !callback,\n propChanged: propChanged,\n eventPropArr: eventPropArr\n })\n }\n _observe.prototype = {\n onPropertyChanged: function(prop, value, oldValue, target, path) {\n if (value !== oldValue && this.propertyChangedHandler) {\n var rootName = obaa._getRootName(prop, path)\n for (\n var i = 0, len = this.propertyChangedHandler.length;\n i < len;\n i++\n ) {\n var handler = this.propertyChangedHandler[i]\n if (\n handler.all ||\n obaa.isInArray(handler.eventPropArr, rootName) ||\n rootName.indexOf('Array-') === 0\n ) {\n handler.propChanged.call(this.target, prop, value, oldValue, path)\n }\n }\n }\n if (prop.indexOf('Array-') !== 0 && typeof value === 'object') {\n this.watch(target, prop, target.$observeProps.$observerPath)\n }\n },\n mock: function(target) {\n var self = this\n obaa.methods.forEach(function(item) {\n target[item] = function() {\n var old = Array.prototype.slice.call(this, 0)\n var result = Array.prototype[item].apply(\n this,\n Array.prototype.slice.call(arguments)\n )\n if (new RegExp('\\\\b' + item + '\\\\b').test(obaa.triggerStr)) {\n for (var cprop in this) {\n if (this.hasOwnProperty(cprop) && !obaa.isFunction(this[cprop])) {\n self.watch(this, cprop, this.$observeProps.$observerPath)\n }\n }\n //todo\n self.onPropertyChanged(\n 'Array-' + item,\n this,\n old,\n this,\n this.$observeProps.$observerPath\n )\n }\n return result\n }\n target[\n 'pure' + item.substring(0, 1).toUpperCase() + item.substring(1)\n ] = function() {\n return Array.prototype[item].apply(\n this,\n Array.prototype.slice.call(arguments)\n )\n }\n })\n },\n watch: function(target, prop, path) {\n if (prop === '$observeProps' || prop === '$observer') return\n if (obaa.isFunction(target[prop])) return\n if (!target.$observeProps) target.$observeProps = {}\n if (path !== undefined) {\n target.$observeProps.$observerPath = path\n } else {\n target.$observeProps.$observerPath = '#'\n }\n var self = this\n var currentValue = (target.$observeProps[prop] = target[prop])\n Object.defineProperty(target, prop, {\n get: function() {\n return this.$observeProps[prop]\n },\n set: function(value) {\n var old = this.$observeProps[prop]\n this.$observeProps[prop] = value\n self.onPropertyChanged(\n prop,\n value,\n old,\n this,\n target.$observeProps.$observerPath\n )\n }\n })\n if (typeof currentValue == 'object') {\n if (obaa.isArray(currentValue)) {\n this.mock(currentValue)\n if (currentValue.length === 0) {\n if (!currentValue.$observeProps) currentValue.$observeProps = {}\n if (path !== undefined) {\n currentValue.$observeProps.$observerPath = path\n } else {\n currentValue.$observeProps.$observerPath = '#'\n }\n }\n }\n for (var cprop in currentValue) {\n if (currentValue.hasOwnProperty(cprop)) {\n this.watch(\n currentValue,\n cprop,\n target.$observeProps.$observerPath + '-' + prop\n )\n }\n }\n }\n }\n }\n return new _observe(target, arr, callback)\n}\n\nobaa.methods = [\n 'concat',\n 'copyWithin',\n 'entries',\n 'every',\n 'fill',\n 'filter',\n 'find',\n 'findIndex',\n 'forEach',\n 'includes',\n 'indexOf',\n 'join',\n 'keys',\n 'lastIndexOf',\n 'map',\n 'pop',\n 'push',\n 'reduce',\n 'reduceRight',\n 'reverse',\n 'shift',\n 'slice',\n 'some',\n 'sort',\n 'splice',\n 'toLocaleString',\n 'toString',\n 'unshift',\n 'values',\n 'size'\n]\nobaa.triggerStr = [\n 'concat',\n 'copyWithin',\n 'fill',\n 'pop',\n 'push',\n 'reverse',\n 'shift',\n 'sort',\n 'splice',\n 'unshift',\n 'size'\n].join(',')\n\nobaa.isArray = function(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nobaa.isString = function(obj) {\n return typeof obj === 'string'\n}\n\nobaa.isInArray = function(arr, item) {\n for (var i = arr.length; --i > -1; ) {\n if (item === arr[i]) return true\n }\n return false\n}\n\nobaa.isFunction = function(obj) {\n return Object.prototype.toString.call(obj) == '[object Function]'\n}\n\nobaa._getRootName = function(prop, path) {\n if (path === '#') {\n return prop\n }\n return path.split('-')[1]\n}\n\nobaa.add = function(obj, prop) {\n var $observer = obj.$observer\n $observer.watch(obj, prop)\n}\n\nobaa.set = function(obj, prop, value, exec) {\n if (!exec) {\n obj[prop] = value\n }\n var $observer = obj.$observer\n $observer.watch(obj, prop)\n if (exec) {\n obj[prop] = value\n }\n}\n\nArray.prototype.size = function(length) {\n this.length = length\n}\n\nexport default obaa\n","const callbacks = []\nconst nextTickCallback = []\n\nexport function tick(fn, scope) {\n callbacks.push({ fn, scope })\n}\n\nexport function fireTick() {\n callbacks.forEach(item => {\n item.fn.call(item.scope)\n })\n\n nextTickCallback.forEach(nextItem => {\n nextItem.fn.call(nextItem.scope)\n })\n nextTickCallback.length = 0\n}\n\nexport function nextTick(fn, scope) {\n nextTickCallback.push({ fn, scope })\n}\n","import obaa from './obaa'\nimport { fireTick } from './tick'\n\nexport function proxyUpdate(ele) {\n let timeout = null\n obaa(ele.data, () => {\n if (ele._willUpdate) {\n return\n }\n if (ele.constructor.mergeUpdate) {\n clearTimeout(timeout)\n\n timeout = setTimeout(() => {\n ele.update()\n fireTick()\n }, 0)\n } else {\n ele.update()\n fireTick()\n }\n })\n}\n","import {\n SYNC_RENDER,\n NO_RENDER,\n FORCE_RENDER,\n ASYNC_RENDER,\n ATTR_KEY\n} from '../constants'\nimport options from '../options'\nimport { extend, applyRef } from '../util'\nimport { enqueueRender } from '../render-queue'\nimport { getNodeProps } from './index'\nimport {\n diff,\n mounts,\n diffLevel,\n flushMounts,\n recollectNodeTree,\n removeChildren\n} from './diff'\nimport { createComponent, collectComponent } from './component-recycler'\nimport { removeNode } from '../dom/index'\nimport {\n addScopedAttrStatic,\n getCtorName,\n scopeHost\n} from '../style'\nimport { proxyUpdate } from '../observe'\n\n/** Set a component's `props` (generally derived from JSX attributes).\n *\t@param {Object} props\n *\t@param {Object} [opts]\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\n */\nexport function setComponentProps(component, props, opts, context, mountAll) {\n if (component._disable) return\n component._disable = true\n\n if ((component.__ref = props.ref)) delete props.ref\n if ((component.__key = props.key)) delete props.key\n\n if (!component.base || mountAll) {\n if (component.beforeInstall) component.beforeInstall()\n if (component.install) component.install()\n if (component.constructor.observe) {\n proxyUpdate(component)\n }\n } else if (component.receiveProps) {\n component.receiveProps(props, component.data, component.props)\n }\n\n if (context && context !== component.context) {\n if (!component.prevContext) component.prevContext = component.context\n component.context = context\n }\n\n if (!component.prevProps) component.prevProps = component.props\n component.props = props\n\n component._disable = false\n\n if (opts !== NO_RENDER) {\n if (\n opts === SYNC_RENDER ||\n options.syncComponentUpdates !== false ||\n !component.base\n ) {\n renderComponent(component, SYNC_RENDER, mountAll)\n } else {\n enqueueRender(component)\n }\n }\n\n applyRef(component.__ref, component)\n}\n\nfunction shallowComparison(old, attrs) {\n let name\n\n for (name in old) {\n if (attrs[name] == null && old[name] != null) {\n return true\n }\n }\n\n if (old.children.length > 0 || attrs.children.length > 0) {\n return true\n }\n\n for (name in attrs) {\n if (name != 'children') {\n let type = typeof attrs[name]\n if (type == 'function' || type == 'object') {\n return true\n } else if (attrs[name] != old[name]) {\n return true\n }\n }\n }\n}\n\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\n *\t@param {Component} component\n *\t@param {Object} [opts]\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\n *\t@private\n */\nexport function renderComponent(component, opts, mountAll, isChild) {\n if (component._disable) return\n\n let props = component.props,\n data = component.data,\n context = component.context,\n previousProps = component.prevProps || props,\n previousState = component.prevState || data,\n previousContext = component.prevContext || context,\n isUpdate = component.base,\n nextBase = component.nextBase,\n initialBase = isUpdate || nextBase,\n initialChildComponent = component._component,\n skip = false,\n rendered,\n inst,\n cbase\n\n // if updating\n if (isUpdate) {\n component.props = previousProps\n component.data = previousState\n component.context = previousContext\n if (component.store || opts == FORCE_RENDER || shallowComparison(previousProps, props)) {\n skip = false\n if (component.beforeUpdate) {\n component.beforeUpdate(props, data, context)\n }\n } else {\n skip = true\n }\n component.props = props\n component.data = data\n component.context = context\n }\n\n component.prevProps = component.prevState = component.prevContext = component.nextBase = null\n\n if (!skip) {\n component.beforeRender && component.beforeRender()\n rendered = component.render(props, data, context)\n\n //don't rerender\n if (component.constructor.css || component.css) {\n addScopedAttrStatic(\n rendered,\n '_s' + getCtorName(component.constructor)\n )\n }\n\n scopeHost(rendered, component.scopedCssAttr)\n\n // context to pass to the child, can be updated via (grand-)parent component\n if (component.getChildContext) {\n context = extend(extend({}, context), component.getChildContext())\n }\n\n let childComponent = rendered && rendered.nodeName,\n toUnmount,\n base,\n ctor = options.mapping[childComponent]\n\n if (ctor) {\n // set up high order component link\n\n let childProps = getNodeProps(rendered)\n inst = initialChildComponent\n\n if (inst && inst.constructor === ctor && childProps.key == inst.__key) {\n setComponentProps(inst, childProps, SYNC_RENDER, context, false)\n } else {\n toUnmount = inst\n\n component._component = inst = createComponent(ctor, childProps, context)\n inst.nextBase = inst.nextBase || nextBase\n inst._parentComponent = component\n setComponentProps(inst, childProps, NO_RENDER, context, false)\n renderComponent(inst, SYNC_RENDER, mountAll, true)\n }\n\n base = inst.base\n } else {\n cbase = initialBase\n\n // destroy high order component link\n toUnmount = initialChildComponent\n if (toUnmount) {\n cbase = component._component = null\n }\n\n if (initialBase || opts === SYNC_RENDER) {\n if (cbase) cbase._component = null\n base = diff(\n cbase,\n rendered,\n context,\n mountAll || !isUpdate,\n initialBase && initialBase.parentNode,\n true\n )\n }\n }\n\n if (initialBase && base !== initialBase && inst !== initialChildComponent) {\n let baseParent = initialBase.parentNode\n if (baseParent && base !== baseParent) {\n baseParent.replaceChild(base, initialBase)\n\n if (!toUnmount) {\n initialBase._component = null\n recollectNodeTree(initialBase, false)\n }\n }\n }\n\n if (toUnmount) {\n unmountComponent(toUnmount)\n }\n\n component.base = base\n if (base && !isChild) {\n let componentRef = component,\n t = component\n while ((t = t._parentComponent)) {\n ;(componentRef = t).base = base\n }\n base._component = componentRef\n base._componentConstructor = componentRef.constructor\n }\n }\n\n if (!isUpdate || mountAll) {\n mounts.unshift(component)\n } else if (!skip) {\n // Ensure that pending componentDidMount() hooks of child components\n // are called before the componentDidUpdate() hook in the parent.\n // Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\n // flushMounts();\n\n if (component.afterUpdate) {\n //deprecated\n component.afterUpdate(previousProps, previousState, previousContext)\n }\n if (component.updated) {\n component.updated(previousProps, previousState, previousContext)\n }\n if (options.afterUpdate) options.afterUpdate(component)\n }\n\n if (component._renderCallbacks != null) {\n while (component._renderCallbacks.length)\n component._renderCallbacks.pop().call(component)\n }\n\n if (!diffLevel && !isChild) flushMounts()\n}\n\n/** Apply the Component referenced by a VNode to the DOM.\n *\t@param {Element} dom\tThe DOM node to mutate\n *\t@param {VNode} vnode\tA Component-referencing VNode\n *\t@returns {Element} dom\tThe created/mutated element\n *\t@private\n */\nexport function buildComponentFromVNode(dom, vnode, context, mountAll) {\n let c = dom && dom._component,\n originalComponent = c,\n oldDom = dom,\n isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n isOwner = isDirectOwner,\n props = getNodeProps(vnode)\n while (c && !isOwner && (c = c._parentComponent)) {\n isOwner = c.constructor === vnode.nodeName\n }\n\n if (c && isOwner && (!mountAll || c._component)) {\n setComponentProps(c, props, ASYNC_RENDER, context, mountAll)\n dom = c.base\n } else {\n if (originalComponent && !isDirectOwner) {\n unmountComponent(originalComponent)\n dom = oldDom = null\n }\n\n c = createComponent(vnode.nodeName, props, context, vnode)\n if (dom && !c.nextBase) {\n c.nextBase = dom\n // passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\n oldDom = null\n }\n setComponentProps(c, props, SYNC_RENDER, context, mountAll)\n dom = c.base\n\n if (oldDom && dom !== oldDom) {\n oldDom._component = null\n recollectNodeTree(oldDom, false)\n }\n }\n\n return dom\n}\n\n/** Remove a component from the DOM and recycle it.\n *\t@param {Component} component\tThe Component instance to unmount\n *\t@private\n */\nexport function unmountComponent(component) {\n if (options.beforeUnmount) options.beforeUnmount(component)\n\n let base = component.base\n\n component._disable = true\n\n if (component.uninstall) component.uninstall()\n\n component.base = null\n\n // recursively tear down & recollect high-order component children:\n let inner = component._component\n if (inner) {\n unmountComponent(inner)\n } else if (base) {\n if (base[ATTR_KEY] != null) applyRef(base[ATTR_KEY].ref, null)\n\n component.nextBase = base\n\n removeNode(base)\n collectComponent(component)\n\n removeChildren(base)\n }\n\n applyRef(component.__ref, null)\n}\n","import { FORCE_RENDER } from './constants'\nimport { renderComponent } from './vdom/component'\nimport options from './options'\nimport { nProps, assign } from './util'\n\nlet id = 0\n\nexport default class Component {\n static is = 'WeElement'\n\n constructor(props, store) {\n this.props = assign(\n nProps(this.constructor.props),\n this.constructor.defaultProps,\n props\n )\n this.elementId = id++\n this.data = this.constructor.data || this.data || {}\n\n this._preCss = null\n\n this.store = store\n }\n\n update(callback) {\n this._willUpdate = true\n if (callback)\n (this._renderCallbacks = this._renderCallbacks || []).push(callback)\n renderComponent(this, FORCE_RENDER)\n if (options.componentChange) options.componentChange(this, this.base)\n this._willUpdate = false\n }\n\n fire(type, data) {\n Object.keys(this.props).every(key => {\n if ('on' + type.toLowerCase() === key.toLowerCase()) {\n this.props[key]({ detail: data })\n return false\n }\n return true\n })\n }\n\n render() {}\n}\n","import { diff } from './vdom/diff'\n\n/** Render JSX into a `parent` Element.\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\n *\t@param {Element} parent\t\tDOM element to render into\n *\t@param {object} [store]\n *\t@public\n */\nexport function render(vnode, parent, store, empty, merge) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n\n if (empty) {\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild)\n }\n }\n\n if (merge) {\n merge =\n typeof merge === 'string'\n ? document.querySelector(merge)\n : merge\n }\n\n return diff(merge, vnode, store, false, parent, false)\n}\n","import options from './options'\n\nexport function define(name, ctor) {\n options.mapping[name] = ctor\n}\n","export function rpx(str) {\n return str.replace(/([1-9]\\d*|0)(\\.\\d*)*rpx/g, (a, b) => {\n return (window.innerWidth * Number(b)) / 750 + 'px'\n })\n}\n","import Component from './component'\n\nexport default class ModelView extends Component {\n static observe = true\n\n static mergeUpdate = true\n\n beforeInstall() {\n this.data = this.vm.data\n }\n}\n","/**\n * classNames based on https://github.com/JedWatson/classnames\n * by Jed Watson\n * Licensed under the MIT License\n * https://github.com/JedWatson/classnames/blob/master/LICENSE\n * modified by dntzhang\n */\n\nvar hasOwn = {}.hasOwnProperty\n\nexport function classNames() {\n var classes = []\n\n for (var i = 0; i < arguments.length; i++) {\n var arg = arguments[i]\n if (!arg) continue\n\n var argType = typeof arg\n\n if (argType === 'string' || argType === 'number') {\n classes.push(arg)\n } else if (Array.isArray(arg) && arg.length) {\n var inner = classNames.apply(null, arg)\n if (inner) {\n classes.push(inner)\n }\n } else if (argType === 'object') {\n for (var key in arg) {\n if (hasOwn.call(arg, key) && arg[key]) {\n classes.push(key)\n }\n }\n }\n }\n\n return classes.join(' ')\n}\n\nexport function extractClass() {\n const [props, ...args] = Array.prototype.slice.call(arguments, 0)\n if (props) {\n if (props.class) {\n args.unshift(props.class)\n delete props.class\n } else if (props.className) {\n args.unshift(props.className)\n delete props.className\n }\n }\n if (args.length > 0) {\n return { class: classNames.apply(null, args) }\n }\n}\n","export function getHost(component) {\n let base = component.base\n if (base) {\n while (base.parentNode) {\n if (base.parentNode._component) {\n return base.parentNode._component\n } else {\n base = base.parentNode\n }\n }\n }\n}","/**\n * preact-render-to-string based on preact-render-to-string\n * by Jason Miller\n * Licensed under the MIT License\n * https://github.com/developit/preact-render-to-string\n *\n * modified by dntzhang\n */\n\nimport options from './options'\n\nimport {\n addScopedAttrStatic,\n getCtorName,\n scopeHost,\n scoper\n} from './style'\n\n\nconst encodeEntities = s => String(s)\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"');\n\nconst indent = (s, char) => String(s).replace(/(\\n+)/g, '$1' + (char || '\\t'));\n\nconst mapping = options.mapping\n\nconst VOID_ELEMENTS = /^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/;\n\nconst isLargeString = (s, length, ignoreLines) => (String(s).length > (length || 40) || (!ignoreLines && String(s).indexOf('\\n') !== -1) || String(s).indexOf('<') !== -1);\n\nconst JS_TO_CSS = {};\n\n// Convert an Object style to a CSSText string\nfunction styleObjToCss(s) {\n let str = '';\n for (let prop in s) {\n let val = s[prop];\n if (val != null) {\n if (str) str += ' ';\n // str += jsToCss(prop);\n str += JS_TO_CSS[prop] || (JS_TO_CSS[prop] = prop.replace(/([A-Z])/g, '-$1').toLowerCase());\n str += ': ';\n str += val;\n if (typeof val === 'number' && IS_NON_DIMENSIONAL.test(prop) === false) {\n str += 'px';\n }\n str += ';';\n }\n }\n return str || undefined;\n}\n\n/** The default export is an alias of `render()`. */\nexport function renderToString(vnode, opts, store, isSvgMode, css) {\n if (vnode == null || typeof vnode === 'boolean') {\n return '';\n }\n\n let nodeName = vnode.nodeName,\n attributes = vnode.attributes,\n isComponent = false;\n store = store || {};\n opts = Object.assign({\n scopedCSS: true\n },opts)\n\n let pretty = true && opts.pretty,\n indentChar = pretty && typeof pretty === 'string' ? pretty : '\\t';\n\n // #text nodes\n if (typeof vnode !== 'object' && !nodeName) {\n return encodeEntities(vnode);\n }\n\n // components\n const ctor = mapping[nodeName]\n if (ctor) {\n isComponent = true;\n\n let props = getNodeProps(vnode),\n rendered;\n // class-based components\n let c = new ctor(props, store);\n // turn off stateful re-rendering:\n c._disable = c.__x = true;\n c.props = props;\n c.store = store;\n if (c.install) c.install();\n if (c.beforeRender) c.beforeRender();\n rendered = c.render(c.props, c.data, c.store);\n let tempCss \n if(opts.scopedCSS){\n\n if (c.constructor.css || c.css) {\n\n const cssStr = c.constructor.css ? c.constructor.css : (typeof c.css === 'function' ? c.css() : c.css)\n const cssAttr = '_s' + getCtorName(c.constructor)\n\n tempCss = ``\n\n addScopedAttrStatic(\n rendered,\n '_s' + getCtorName(c.constructor)\n )\n }\n \n c.scopedCSSAttr = vnode.css\n scopeHost(rendered, c.scopedCSSAttr)\n }\n\n return renderToString(rendered, opts, store, false, tempCss);\n }\n\n\n // render JSX to HTML\n let s = '', html;\n\n if (attributes) {\n let attrs = Object.keys(attributes);\n\n // allow sorting lexicographically for more determinism (useful for tests, such as via preact-jsx-chai)\n if (opts && opts.sortAttributes === true) attrs.sort();\n\n for (let i = 0; i < attrs.length; i++) {\n let name = attrs[i],\n v = attributes[name];\n if (name === 'children') continue;\n\n if (name.match(/[\\s\\n\\\\/='\"\\0<>]/)) continue;\n\n if (!(opts && opts.allAttributes) && (name === 'key' || name === 'ref')) continue;\n\n if (name === 'className') {\n if (attributes.class) continue;\n name = 'class';\n }\n else if (isSvgMode && name.match(/^xlink:?./)) {\n name = name.toLowerCase().replace(/^xlink:?/, 'xlink:');\n }\n\n if (name === 'style' && v && typeof v === 'object') {\n v = styleObjToCss(v);\n }\n\n let hooked = opts.attributeHook && opts.attributeHook(name, v, store, opts, isComponent);\n if (hooked || hooked === '') {\n s += hooked;\n continue;\n }\n\n if (name === 'dangerouslySetInnerHTML') {\n html = v && v.__html;\n }\n else if ((v || v === 0 || v === '') && typeof v !== 'function') {\n if (v === true || v === '') {\n v = name;\n // in non-xml mode, allow boolean attributes\n if (!opts || !opts.xml) {\n s += ' ' + name;\n continue;\n }\n }\n s += ` ${name}=\"${encodeEntities(v)}\"`;\n }\n }\n }\n\n // account for >1 multiline attribute\n if (pretty) {\n let sub = s.replace(/^\\n\\s*/, ' ');\n if (sub !== s && !~sub.indexOf('\\n')) s = sub;\n else if (pretty && ~s.indexOf('\\n')) s += '\\n';\n }\n\n s = `<${nodeName}${s}>`;\n if (String(nodeName).match(/[\\s\\n\\\\/='\"\\0<>]/)) throw s;\n\n let isVoid = String(nodeName).match(VOID_ELEMENTS);\n if (isVoid) s = s.replace(/>$/, ' />');\n\n let pieces = [];\n if (html) {\n // if multiline, indent.\n if (pretty && isLargeString(html)) {\n html = '\\n' + indentChar + indent(html, indentChar);\n }\n s += html;\n }\n else if (vnode.children) {\n let hasLarge = pretty && ~s.indexOf('\\n');\n for (let i = 0; i < vnode.children.length; i++) {\n let child = vnode.children[i];\n if (child != null && child !== false) {\n let childSvgMode = nodeName === 'svg' ? true : nodeName === 'foreignObject' ? false : isSvgMode,\n ret = renderToString(child, opts, store, childSvgMode);\n if (pretty && !hasLarge && isLargeString(ret)) hasLarge = true;\n if (ret) pieces.push(ret);\n }\n }\n if (pretty && hasLarge) {\n for (let i = pieces.length; i--;) {\n pieces[i] = '\\n' + indentChar + indent(pieces[i], indentChar);\n }\n }\n }\n\n if (pieces.length) {\n s += pieces.join('');\n }\n else if (opts && opts.xml) {\n return s.substring(0, s.length - 1) + ' />';\n }\n\n if (!isVoid) {\n if (pretty && ~s.indexOf('\\n')) s += '\\n';\n s += ``;\n }\n\n if(css) return css + s;\n return s;\n}\n\nfunction assign(obj, props) {\n for (let i in props) obj[i] = props[i];\n return obj;\n}\n\nfunction getNodeProps(vnode) {\n let props = assign({}, vnode.attributes);\n props.children = vnode.children;\n\n let defaultProps = vnode.nodeName.defaultProps;\n if (defaultProps !== undefined) {\n for (let i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i];\n }\n }\n }\n\n return props;\n}","import { h, h as createElement } from './h'\nimport { cloneElement } from './clone-element'\nimport Component from './component'\nimport { render } from './render'\nimport { rerender } from './render-queue'\nimport options from './options'\nimport { define } from './define'\nimport { rpx } from './rpx'\nimport ModelView from './model-view'\nimport { classNames, extractClass } from './class'\nimport { getHost } from './get-host'\nimport { renderToString } from './render-to-string'\n\nconst WeElement = Component\nconst defineElement = define\nfunction createRef() {\n return {}\n}\n\noptions.root.Omi = {\n h,\n createElement,\n cloneElement,\n createRef,\n Component,\n render,\n rerender,\n options,\n WeElement,\n define,\n rpx,\n ModelView,\n defineElement,\n classNames,\n extractClass,\n getHost,\n renderToString\n}\noptions.root.omi = options.root.Omi\noptions.root.Omi.version = 'omio-1.3.7'\n\nexport default {\n h,\n createElement,\n cloneElement,\n createRef,\n Component,\n render,\n rerender,\n options,\n WeElement,\n define,\n rpx,\n ModelView,\n defineElement,\n classNames,\n extractClass,\n getHost,\n renderToString\n}\n\nexport {\n h,\n createElement,\n cloneElement,\n createRef,\n Component,\n render,\n rerender,\n options,\n WeElement,\n define,\n rpx,\n ModelView,\n defineElement,\n classNames,\n extractClass,\n getHost,\n renderToString\n}\n","import { define, render, Component } from '../../src/omi'\n\ndefine('my-hello', class extends Component {\n render() {\n //can get the parent's div style, can't get the h3's style\n return

{this.props.name}

\n }\n})\n\ndefine('my-app', class extends Component {\n \n static css = `div{\n font-size:20px;\n }\n `\n\n install() {\n this.name = 'Omi'\n }\n\n handleTap = e => {\n this.name = 'Hello Omi !'\n this.update()\n }\n\n installed() {\n setTimeout(() => {\n this.name = 11\n this.update()\n }, 1000)\n }\n \n\n render() {\n return (\n
\n
tap me
\n \n
\n )\n }\n})\n\nrender(, 'body')\n"],"names":["VNode","getGlobal","global","Math","Array","self","window","scopedStyle","mapping","isWeb","staticStyleMapping","doc","document","root","styleCache","stack","EMPTY_CHILDREN","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","key","options","vnode","getOwnPropertySymbols","Object","hasOwnProperty","prototype","propIsEnumerable","propertyIsEnumerable","toObject","val","TypeError","assign","target","source","from","to","symbols","s","call","Element","addEventListener","runListeners","oEvent","event","iLstId","iElId","oEvtListeners","oListeners","type","aEls","aEvts","sEventType","fListener","nElIdx","aElListeners","splice","removeEventListener","create","proto","propertiesObject","Error","F","trim","replace","extend","obj","props","applyRef","ref","value","current","usePromise","Promise","__config__","platform","systemVersion","split","defer","resolve","then","bind","setTimeout","isArray","toString","nProps","result","keys","forEach","cloneElement","slice","NO_RENDER","SYNC_RENDER","FORCE_RENDER","ASYNC_RENDER","ATTR_KEY","IS_NON_DIMENSIONAL","items","enqueueRender","component","debounceRendering","rerender","renderComponent","isSameNodeType","node","hydrating","splitText","ctor","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","getNodeProps","defaultProps","createNode","isSvg","createElementNS","createElement","parseCSSText","cssText","cssTxt","match","a","b","rule","cssToJs","toUpperCase","properties","map","o","x","property","style","removeNode","parentNode","removeChild","setAccessor","name","old","className","test","oldJson","currentJson","changed","ckey","setStyles","innerHTML","__html","useCapture","substring","eventProxy","touchStart","touchEnd","_listeners","setProperty","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","e","___touchX","touches","pageX","___touchY","pageY","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","styleId","getCtorName","len","item","attrName","scoper","css","prefix","re","RegExp","g0","g1","g2","g3","appendClass","addStyle","id","ele","getElementById","head","getElementsByTagName","someThingStyles","appendChild","ActiveXObject","styleSheet","textContent","addStyleWithoutId","addScopedAttrStatic","vdom","attr","scopeVdom","addStyleToHead","scopeHost","mounts","diffLevel","isSvgMode","flushMounts","c","afterMount","installed","constructor","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","out","prevSvgMode","vnodeName","buildComponentFromVNode","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","firstChild","fc","vchildren","nextSibling","innerDiffNode","dangerouslySetInnerHTML","diffAttributes","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","childrenLen","vlen","j","f","vchild","__key","insertBefore","unmountOnly","unmountComponent","removeChildren","lastChild","next","previousSibling","attrs","components","collectComponent","createComponent","Ctor","list","inst","render","Component","doRender","scopedCssAttr","nextBase","data","obaa","arr","callback","_observe","$observer","eventPropArr","$observeProps","$observerPath","mock","prop","isInArray","watch","isString","propertyChangedHandler","propChanged","all","onPropertyChanged","oldValue","path","rootName","_getRootName","handler","indexOf","methods","apply","triggerStr","cprop","isFunction","currentValue","defineProperty","get","set","join","add","exec","size","callbacks","nextTickCallback","fireTick","fn","scope","nextItem","proxyUpdate","timeout","_willUpdate","mergeUpdate","clearTimeout","update","setComponentProps","opts","_disable","__ref","base","beforeInstall","install","observe","receiveProps","prevContext","prevProps","syncComponentUpdates","shallowComparison","isChild","previousProps","previousState","prevState","previousContext","isUpdate","initialBase","initialChildComponent","skip","rendered","cbase","store","beforeUpdate","beforeRender","getChildContext","childComponent","toUnmount","childProps","_parentComponent","baseParent","componentRef","t","unshift","afterUpdate","updated","_renderCallbacks","originalComponent","oldDom","isDirectOwner","isOwner","beforeUnmount","uninstall","inner","elementId","_preCss","componentChange","fire","every","is","empty","merge","querySelector","define","rpx","str","innerWidth","Number","ModelView","vm","hasOwn","classNames","classes","arg","argType","extractClass","args","class","getHost","encodeEntities","indent","char","VOID_ELEMENTS","isLargeString","ignoreLines","JS_TO_CSS","styleObjToCss","renderToString","isComponent","scopedCSS","pretty","indentChar","__x","tempCss","cssStr","cssAttr","scopedCSSAttr","html","sortAttributes","sort","v","allAttributes","hooked","attributeHook","xml","sub","isVoid","pieces","hasLarge","childSvgMode","WeElement","defineElement","createRef","Omi","omi","version","handleTap"],"mappings":";;;EAAA;AACA,EAAO,SAASA,KAAT,GAAiB;;ECDxB,SAASC,SAAT,GAAqB;EACnB,MACE,OAAOC,MAAP,KAAkB,QAAlB,IACA,CAACA,MADD,IAEAA,OAAOC,IAAP,KAAgBA,IAFhB,IAGAD,OAAOE,KAAP,KAAiBA,KAJnB,EAKE;EACA,QAAI,OAAOC,IAAP,KAAgB,WAApB,EAAiC;EAC/B,aAAOA,IAAP;EACD,KAFD,MAEO,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;EACxC,aAAOA,MAAP;EACD,KAFM,MAEA,IAAI,OAAOJ,MAAP,KAAkB,WAAtB,EAAmC;EACxC,aAAOA,MAAP;EACD;EACD,WAAQ,YAAW;EACjB,aAAO,IAAP;EACD,KAFM,EAAP;EAGD;EACD,SAAOA,MAAP;EACD;;EAED;;;;AAIA,gBAAe;EACbK,eAAa,IADA;EAEbC,WAAS,EAFI;EAGbC,SAAO,IAHM;EAIbC,sBAAoB,EAJP;EAKbC,OAAK,OAAOC,QAAP,KAAoB,QAApB,GAA+BA,QAA/B,GAA0C,IALlC;EAMbC,QAAMZ,WANO;EAOb;EACAa,cAAY;EACZ;EACA;;;;;EAKA;;EAEA;;;EAGA;;EAEA;EACA;;EAEA;E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ZiB;EAajB2C,8BAbiB;EAcjBxC,wBAdiB;EAejBI,4BAfiB;EAgBjBG,kBAhBiB;EAiBjBS;EAjBiB,CAAnB;EAmBA1X,QAAQpB,IAAR,CAAaya,GAAb,GAAmBrZ,QAAQpB,IAAR,CAAawa,GAAhC;EACApZ,QAAQpB,IAAR,CAAawa,GAAb,CAAiBE,OAAjB,GAA2B,YAA3B;;;;;;;;;;ECrCApD,OAAO,UAAP;EAAA;;EAAA;EAAA;;EAAA;EAAA;;EAAA,mBACE7G,MADF,wBACW;EACP;EACA,WAAO;EAAA;EAAA;EAAM;EAAA;EAAA;EAAA;EAAM,aAAKvM,KAAL,CAAWsE;EAAjB;EAAN,KAAP;EACD,GAJH;;EAAA;EAAA,EAAiCkI,SAAjC;;EAOA4G,OAAO,QAAP;EAAA;;EAAA;EAAA;;EAAA;;EAAA;EAAA;EAAA;;EAAA,mJAWEqD,SAXF,GAWc,aAAK;EACf,aAAKnS,IAAL,GAAY,aAAZ;EACA,aAAKsL,MAAL;EACD,KAdH;EAAA;;EAAA,oBAOEO,OAPF,sBAOY;EACR,SAAK7L,IAAL,GAAY,KAAZ;EACD,GATH;;EAAA,oBAgBE4E,SAhBF,wBAgBc;EAAA;;EACVnI,eAAW,YAAM;EACf,aAAKuD,IAAL,GAAY,EAAZ;EACA,aAAKsL,MAAL;EACD,KAHD,EAGG,IAHH;EAID,GArBH;;EAAA,oBAwBErD,MAxBF,wBAwBW;EACP,WACE;EAAA;EAAA;EACE;EAAA;EAAA,UAAK,OAAO,KAAKkK,SAAjB;EAAA;EAAA,OADF;EAEE,0BAAU,MAAM,KAAKnS,IAArB;EAFF,KADF;EAMD,GA/BH;;EAAA;EAAA,EAA+BkI,SAA/B,WAESvF,GAFT;;EAkCAsF,OAAO,qBAAP,EAAmB,MAAnB;;;;"} \ No newline at end of file diff --git a/packages/omio/examples/simple/main.js b/packages/omio/examples/simple/main.js index f3692ae1e..b6bbb092c 100755 --- a/packages/omio/examples/simple/main.js +++ b/packages/omio/examples/simple/main.js @@ -3,15 +3,16 @@ import { define, render, Component } from '../../src/omi' define('my-hello', class extends Component { render() { //can get the parent's div style, can't get the h3's style - return

{this.props.name}

+ return

{this.props.name}

} }) define('my-app', class extends Component { - css = `div{ - font-size:30px; - }` + static css = `div{ + font-size:20px; + } + ` install() { this.name = 'Omi' diff --git a/packages/omio/src/render-to-string.js b/packages/omio/src/render-to-string.js index 38b9fed9b..7a446b7ad 100644 --- a/packages/omio/src/render-to-string.js +++ b/packages/omio/src/render-to-string.js @@ -94,13 +94,13 @@ export function renderToString(vnode, opts, store, isSvgMode, css) { let tempCss if(opts.scopedCSS){ - if(c.css){ - const cssStr = typeof c.css === 'function' ? c.css() : c.css + if (c.constructor.css || c.css) { + + const cssStr = c.constructor.css ? c.constructor.css : (typeof c.css === 'function' ? c.css() : c.css) const cssAttr = '_s' + getCtorName(c.constructor) tempCss = `` - } - if (c.css) { + addScopedAttrStatic( rendered, '_s' + getCtorName(c.constructor) diff --git a/packages/omio/src/vdom/component.js b/packages/omio/src/vdom/component.js index 81faa6cde..d2bb9abd8 100755 --- a/packages/omio/src/vdom/component.js +++ b/packages/omio/src/vdom/component.js @@ -148,7 +148,7 @@ export function renderComponent(component, opts, mountAll, isChild) { rendered = component.render(props, data, context) //don't rerender - if (component.css) { + if (component.constructor.css || component.css) { addScopedAttrStatic( rendered, '_s' + getCtorName(component.constructor) diff --git a/packages/omio/src/vdom/diff.js b/packages/omio/src/vdom/diff.js index cace4e46b..516a67954 100755 --- a/packages/omio/src/vdom/diff.js +++ b/packages/omio/src/vdom/diff.js @@ -26,8 +26,8 @@ export function flushMounts() { while ((c = mounts.pop())) { if (options.afterMount) options.afterMount(c) if (c.installed) c.installed() - if(c.css){ - addStyleToHead(typeof c.css === 'function' ? c.css() : c.css, '_s' + getCtorName(c.constructor)) + if (c.constructor.css || c.css) { + addStyleToHead(c.constructor.css ? c.constructor.css : (typeof c.css === 'function' ? c.css() : c.css), '_s' + getCtorName(c.constructor)) } } } diff --git a/packages/omio/test/browser/render-to-string.js b/packages/omio/test/browser/render-to-string.js index d5b58ed2b..0adb62e31 100644 --- a/packages/omio/test/browser/render-to-string.js +++ b/packages/omio/test/browser/render-to-string.js @@ -26,7 +26,7 @@ describe('render()', () => { }) define('todo-app2', class extends WeElement { - css = 'h3 { color:red; }' + static css = 'h3 { color:red; }' data = { items: [], text: '' }