This commit is contained in:
dntzhang 2018-11-06 10:04:59 +08:00
parent b99cba5e62
commit 36b006a001
10 changed files with 50 additions and 19 deletions

View File

@ -1,5 +1,5 @@
/**
* omi v4.0.19 http://omijs.org
* omi v4.0.20 http://omijs.org
* Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript.
* By dntzhang https://github.com/dntzhang
* Github: https://github.com/Tencent/omi
@ -454,7 +454,9 @@
}
// otherwise, if there are existing or new children, diff them:
else if (vchildren && vchildren.length || fc != null) {
innerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);
if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {
innerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);
}
}
// Apply attributes/props from VNode to the DOM Element:
@ -1044,7 +1046,18 @@
}
this.install();
var shadowRoot = this.attachShadow({ mode: 'open' });
var shadowRoot;
if (!this.shadowRoot) {
shadowRoot = this.attachShadow({
mode: 'open'
});
} else {
shadowRoot = this.shadowRoot;
var fc;
while (fc = shadowRoot.firstChild) {
shadowRoot.removeChild(fc);
}
}
this.css && shadowRoot.appendChild(cssToDom(this.css()));
this.beforeRender();
@ -1409,7 +1422,7 @@
};
options.root.Omi = omi;
options.root.Omi.version = '4.0.19';
options.root.Omi.version = '4.0.20';
if (typeof module != 'undefined') module.exports = omi;else self.Omi = omi;
}());

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/**
* omi v4.0.19 http://omijs.org
* omi v4.0.20 http://omijs.org
* Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript.
* By dntzhang https://github.com/dntzhang
* Github: https://github.com/Tencent/omi
@ -451,7 +451,9 @@ function idiff(dom, vnode, context, mountAll, componentRoot) {
}
// otherwise, if there are existing or new children, diff them:
else if (vchildren && vchildren.length || fc != null) {
innerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);
if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {
innerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);
}
}
// Apply attributes/props from VNode to the DOM Element:
@ -1041,7 +1043,18 @@ var WeElement = function (_HTMLElement) {
}
this.install();
var shadowRoot = this.attachShadow({ mode: 'open' });
var shadowRoot;
if (!this.shadowRoot) {
shadowRoot = this.attachShadow({
mode: 'open'
});
} else {
shadowRoot = this.shadowRoot;
var fc;
while (fc = shadowRoot.firstChild) {
shadowRoot.removeChild(fc);
}
}
this.css && shadowRoot.appendChild(cssToDom(this.css()));
this.beforeRender();
@ -1406,7 +1419,7 @@ var omi = {
};
options.root.Omi = omi;
options.root.Omi.version = '4.0.19';
options.root.Omi.version = '4.0.20';
export default omi;
export { tag, WeElement, Component, render, h, h as createElement, options, define, observe, cloneElement, getHost };

File diff suppressed because one or more lines are too long

View File

@ -163,7 +163,7 @@
}
if (!hydrating && vchildren && 1 === vchildren.length && 'string' == typeof vchildren[0] && null != fc && void 0 !== fc.splitText && null == fc.nextSibling) {
if (fc.nodeValue != vchildren[0]) fc.nodeValue = vchildren[0];
} else if (vchildren && vchildren.length || null != fc) innerDiffNode(out, vchildren, context, mountAll, hydrating || null != props.dangerouslySetInnerHTML);
} else if (vchildren && vchildren.length || null != fc) if ('WeElement' != out.constructor.is || !out.constructor.noSlot) innerDiffNode(out, vchildren, context, mountAll, hydrating || null != props.dangerouslySetInnerHTML);
diffAttributes(out, vnode.attributes, props);
if (out.props) out.props.children = vnode.children;
isSvgMode = prevSvgMode;
@ -723,9 +723,14 @@
if (this.store) this.store.instances.push(this);
}
this.install();
var shadowRoot = this.attachShadow({
var shadowRoot;
if (!this.shadowRoot) shadowRoot = this.attachShadow({
mode: 'open'
});
}); else {
shadowRoot = this.shadowRoot;
var fc;
while (fc = shadowRoot.firstChild) shadowRoot.removeChild(fc);
}
this.css && shadowRoot.appendChild(cssToDom(this.css()));
this.beforeRender();
options.afterInstall && options.afterInstall(this);
@ -779,7 +784,7 @@
getHost: getHost
};
options.root.Omi = omi;
options.root.Omi.version = '4.0.19';
options.root.Omi.version = '4.0.20';
if ('undefined' != typeof module) module.exports = omi; else self.Omi = omi;
}();
//# sourceMappingURL=omi.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "omi",
"version": "4.0.19",
"version": "4.0.20",
"description": "Next generation web framework.",
"main": "dist/omi.js",
"jsnext:main": "dist/omi.esm.js",

View File

@ -25,7 +25,7 @@ const omi = {
}
options.root.Omi = omi
options.root.Omi.version = '4.0.19'
options.root.Omi.version = '4.0.20'
export default omi