omio - build

This commit is contained in:
dntzhang 2019-03-04 10:27:29 +08:00
parent 962396f2bb
commit fce510499b
11 changed files with 33 additions and 31 deletions

View File

@ -98,6 +98,7 @@ declare namespace Omi {
static data: object;
static observe: boolean;
static mergeUpdate: boolean;
static css: string;
props: RenderableProps<P>;
data: D;
@ -148,6 +149,7 @@ declare namespace Omi {
static data: object;
static observe: boolean;
static mergeUpdate: boolean;
static css: string;
props: RenderableProps<P>;
data: D;

View File

@ -1,5 +1,5 @@
/**
* omi v1.3.7 http://omijs.org
* omi v1.3.8 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
@ -757,8 +757,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));
}
}
}
@ -1414,7 +1414,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;
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 = '<style type="text/css" id="' + cssAttr + '">' + scoper(cssStr, cssAttr) + '</style>';
}
if (c.css) {
addScopedAttrStatic(rendered, '_s' + getCtorName(c.constructor));
}
@ -2024,7 +2024,7 @@
renderToString: renderToString
};
options.root.omi = options.root.Omi;
options.root.Omi.version = 'omio-1.3.7';
options.root.Omi.version = 'omio-1.3.8';
var Omi = {
h: h,

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/**
* omi v1.3.7 http://omijs.org
* omi v1.3.8 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
@ -754,8 +754,8 @@ 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));
}
}
}
@ -1411,7 +1411,7 @@ 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));
}
@ -1852,13 +1852,13 @@ function renderToString(vnode, opts, store, isSvgMode, css) {
var tempCss;
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 = '<style type="text/css" id="' + cssAttr + '">' + scoper(cssStr, cssAttr) + '</style>';
}
if (c.css) {
addScopedAttrStatic(rendered, '_s' + getCtorName(c.constructor));
}
@ -2021,7 +2021,7 @@ options.root.Omi = {
renderToString: renderToString
};
options.root.omi = options.root.Omi;
options.root.Omi.version = 'omio-1.3.7';
options.root.Omi.version = 'omio-1.3.8';
var omi = {
h: h,

File diff suppressed because one or more lines are too long

View File

@ -277,7 +277,7 @@
while (c = mounts.pop()) {
if (options.afterMount) options.afterMount(c);
if (c.installed) c.installed();
if (c.css) addStyleToHead('function' == typeof c.css ? c.css() : c.css, '_s' + getCtorName(c.constructor));
if (c.constructor.css || c.css) addStyleToHead(c.constructor.css ? c.constructor.css : 'function' == typeof c.css ? c.css() : c.css, '_s' + getCtorName(c.constructor));
}
}
function diff(dom, vnode, context, mountAll, parent, componentRoot) {
@ -496,7 +496,7 @@
if (!skip) {
component.beforeRender && component.beforeRender();
rendered = component.render(props, data, context);
if (component.css) addScopedAttrStatic(rendered, '_s' + getCtorName(component.constructor));
if (component.constructor.css || component.css) addScopedAttrStatic(rendered, '_s' + getCtorName(component.constructor));
scopeHost(rendered, component.scopedCssAttr);
if (component.getChildContext) context = extend(extend({}, context), component.getChildContext());
var toUnmount, base, childComponent = rendered && rendered.nodeName, ctor = options.mapping[childComponent];
@ -694,12 +694,12 @@
rendered = c.render(c.props, c.data, c.store);
var tempCss;
if (opts.scopedCSS) {
if (c.css) {
var cssStr = 'function' == typeof c.css ? c.css() : c.css;
if (c.constructor.css || c.css) {
var cssStr = c.constructor.css ? c.constructor.css : 'function' == typeof c.css ? c.css() : c.css;
var cssAttr = '_s' + getCtorName(c.constructor);
tempCss = '<style type="text/css" id="' + cssAttr + '">' + scoper(cssStr, cssAttr) + '</style>';
addScopedAttrStatic(rendered, '_s' + getCtorName(c.constructor));
}
if (c.css) addScopedAttrStatic(rendered, '_s' + getCtorName(c.constructor));
c.scopedCSSAttr = vnode.css;
scopeHost(rendered, c.scopedCSSAttr);
}
@ -1067,7 +1067,7 @@
renderToString: renderToString
};
options.root.omi = options.root.Omi;
options.root.Omi.version = 'omio-1.3.7';
options.root.Omi.version = 'omio-1.3.8';
var Omi = {
h: h,
createElement: h,

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": "omio",
"version": "1.3.7",
"version": "1.3.8",
"description": "Omi for old browsers(IE8+ and mobile browsers).",
"main": "dist/omi.js",
"jsnext:main": "dist/omi.esm.js",

View File

@ -37,7 +37,7 @@ options.root.Omi = {
renderToString
}
options.root.omi = options.root.Omi
options.root.Omi.version = 'omio-1.3.7'
options.root.Omi.version = 'omio-1.3.8'
export default {
h,