omi v6.3.5 - fix remove attr & add Omi.o method

This commit is contained in:
dntzhang 2019-05-08 09:05:48 +08:00
parent ee400d1f29
commit 57ab09265b
17 changed files with 69 additions and 1847 deletions

View File

@ -1,6 +1,6 @@
[English](./README.md) | 简体中文 | [한국어](./README.KR.md)
<p align="right">Omi <strong>v6.3.4</strong></p>
<p align="right">Omi <strong>v6.3.5</strong></p>
<p align="right">Omio <strong>v2.2.1</strong></p>
<p align="center"><img src="https://tencent.github.io/omi/assets/omi-logo2019.svg" alt="omi" width="300"/></p>
<h2 align="center">Omi - 下一代前端框架,去万物糟粕,合精华为一点点 JS</h2>

View File

@ -1,6 +1,6 @@
English | [简体中文](./README.CN.md) | [한국어](./README.KR.md)
<p align="right">Omi <strong>v6.3.4</strong></p>
<p align="right">Omi <strong>v6.3.5</strong></p>
<p align="right">Omio <strong>v2.2.1</strong></p>
<p align="center"><img src="https://tencent.github.io/omi/assets/omi-logo2019.svg" alt="omi" width="300"/></p>
<h2 align="center">Omi - Next front end framework using web components with omio(IE8+), omip(小程序) and any framework in tiny js.</h2>

View File

@ -190,7 +190,8 @@ declare namespace Omi {
function getHost(element: WeElement): WeElement;
function classNames(...args: any[]): string;
function extractClass(...args: any[]): object;
function o(obj: any): string;
var options: {
vnode?: (vnode: VNode<any>) => void;
event?: (event: Event) => Event;

View File

@ -1,5 +1,5 @@
/**
* omi v6.3.4 http://omijs.org
* omi v6.3.5 http://omijs.org
* Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript.
* By dntzhang https://github.com/dntzhang
* Github: https://github.com/Tencent/omi
@ -1430,6 +1430,8 @@
ele.props[key] = JSON.parse(val.replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:([^\/])/g, '"$2":$4').replace(/'([\s\S]*?)'/g, '"$1"'));
break;
}
} else {
ele.props[key] = null;
}
});
};
@ -1726,6 +1728,10 @@
}
}
function o(obj) {
return JSON.stringify(obj);
}
var n=function(t,r,u,e){for(var p=1;p<r.length;p++){var s=r[p++],a="number"==typeof s?u[s]:s;1===r[p]?e[0]=a:2===r[p]?(e[1]=e[1]||{})[r[++p]]=a:3===r[p]?e[1]=Object.assign(e[1]||{},a):e.push(r[p]?t.apply(null,n(t,a,u,["",null])):a);}return e},t=function(n){for(var t,r,u=1,e="",p="",s=[0],a=function(n){1===u&&(n||(e=e.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?s.push(n||e,0):3===u&&(n||e)?(s.push(n||e,1), u=2):2===u&&"..."===e&&n?s.push(n,3):2===u&&e&&!n?s.push(!0,2,e):4===u&&r&&(s.push(n||e,2,r), r=""), e="";},f=0;f<n.length;f++){f&&(1===u&&a(), a(f));for(var h=0;h<n[f].length;h++)t=n[f][h], 1===u?"<"===t?(a(), s=[s], u=3):e+=t:p?t===p?p="":e+=t:'"'===t||"'"===t?p=t:">"===t?(a(), u=1):u&&("="===t?(u=4, r=e, e=""):"/"===t?(a(), 3===u&&(s=s[0]), u=s, (s=s[0]).push(u,4), u=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(), u=2):e+=t);}return a(), s},r="function"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)), r}:function(n){for(var r="",e=0;e<n.length;e++)r+=n[e].length+"-"+n[e];return u[r]||(u[r]=t(n))};function htm(t){var r=n(this,e(t),arguments,[]);return r.length>1?r:r[0]}
var html = htm.bind(h);
@ -1758,12 +1764,13 @@
extractClass: extractClass,
createRef: createRef,
html: html,
htm: htm
htm: htm,
o: o
};
options.root.Omi = omi;
options.root.omi = omi;
options.root.Omi.version = '6.3.4';
options.root.Omi.version = '6.3.5';
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 v6.3.4 http://omijs.org
* omi v6.3.5 http://omijs.org
* Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript.
* By dntzhang https://github.com/dntzhang
* Github: https://github.com/Tencent/omi
@ -1427,6 +1427,8 @@ var WeElement = function (_HTMLElement) {
ele.props[key] = JSON.parse(val.replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:([^\/])/g, '"$2":$4').replace(/'([\s\S]*?)'/g, '"$1"'));
break;
}
} else {
ele.props[key] = null;
}
});
};
@ -1723,6 +1725,10 @@ function extractClass() {
}
}
function o(obj) {
return JSON.stringify(obj);
}
var n=function(t,r,u,e){for(var p=1;p<r.length;p++){var s=r[p++],a="number"==typeof s?u[s]:s;1===r[p]?e[0]=a:2===r[p]?(e[1]=e[1]||{})[r[++p]]=a:3===r[p]?e[1]=Object.assign(e[1]||{},a):e.push(r[p]?t.apply(null,n(t,a,u,["",null])):a);}return e},t=function(n){for(var t,r,u=1,e="",p="",s=[0],a=function(n){1===u&&(n||(e=e.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?s.push(n||e,0):3===u&&(n||e)?(s.push(n||e,1), u=2):2===u&&"..."===e&&n?s.push(n,3):2===u&&e&&!n?s.push(!0,2,e):4===u&&r&&(s.push(n||e,2,r), r=""), e="";},f=0;f<n.length;f++){f&&(1===u&&a(), a(f));for(var h=0;h<n[f].length;h++)t=n[f][h], 1===u?"<"===t?(a(), s=[s], u=3):e+=t:p?t===p?p="":e+=t:'"'===t||"'"===t?p=t:">"===t?(a(), u=1):u&&("="===t?(u=4, r=e, e=""):"/"===t?(a(), 3===u&&(s=s[0]), u=s, (s=s[0]).push(u,4), u=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(), u=2):e+=t);}return a(), s},r="function"==typeof Map,u=r?new Map:{},e=r?function(n){var r=u.get(n);return r||u.set(n,r=t(n)), r}:function(n){for(var r="",e=0;e<n.length;e++)r+=n[e].length+"-"+n[e];return u[r]||(u[r]=t(n))};function htm(t){var r=n(this,e(t),arguments,[]);return r.length>1?r:r[0]}
var html = htm.bind(h);
@ -1755,13 +1761,14 @@ var omi = {
extractClass: extractClass,
createRef: createRef,
html: html,
htm: htm
htm: htm,
o: o
};
options.root.Omi = omi;
options.root.omi = omi;
options.root.Omi.version = '6.3.4';
options.root.Omi.version = '6.3.5';
export default omi;
export { tag, WeElement, Component, render, h, h as createElement, options, define, observe, cloneElement, getHost, rpx, tick, nextTick, ModelView, defineElement, classNames, extractClass, createRef, html, htm };
export { tag, WeElement, Component, render, h, h as createElement, options, define, observe, cloneElement, getHost, rpx, tick, nextTick, ModelView, defineElement, classNames, extractClass, createRef, html, htm, o };
//# sourceMappingURL=omi.esm.js.map

File diff suppressed because one or more lines are too long

View File

@ -641,6 +641,9 @@
class: classNames.apply(null, args)
};
}
function o(obj) {
return JSON.stringify(obj);
}
function htm(t) {
var r = n(this, e(t), arguments, []);
return r.length > 1 ? r : r[0];
@ -987,7 +990,7 @@
case Object:
ele.props[key] = JSON.parse(val.replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:([^\/])/g, '"$2":$4').replace(/'([\s\S]*?)'/g, '"$1"'));
}
} else ele.props[key] = null;
});
}
};
@ -1077,11 +1080,12 @@
extractClass: extractClass,
createRef: createRef,
html: html,
htm: htm
htm: htm,
o: o
};
options.root.Omi = omi;
options.root.omi = omi;
options.root.Omi.version = '6.3.4';
options.root.Omi.version = '6.3.5';
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": "6.3.4",
"version": "6.3.5",
"description": "Next generation web framework.",
"main": "dist/omi.js",
"jsnext:main": "dist/omi.esm.js",

3
packages/omi/src/o.js Normal file
View File

@ -0,0 +1,3 @@
export function o(obj){
return JSON.stringify(obj)
}

View File

@ -23,15 +23,4 @@ export function proxyUpdate(ele) {
fireTick()
}
})
}
export function proxyProps(ele) {
ele.props = new JSONProxy(ele.props).observe(false, (patch) => {
if(patch.path!== '/children'){
ele.pureSetAttribute(patch.path.replace('/',''), patch.value)
if (!ele._willUpdate) {
ele.update()
}
}
})
}
}

View File

@ -190,7 +190,8 @@ declare namespace Omi {
function getHost(element: WeElement): WeElement;
function classNames(...args: any[]): string;
function extractClass(...args: any[]): object;
function o(obj: any): string;
var options: {
vnode?: (vnode: VNode<any>) => void;
event?: (event: Event) => Event;

View File

@ -11,6 +11,7 @@ import { rpx } from './rpx'
import { tick, nextTick } from './tick'
import ModelView from './model-view'
import { classNames, extractClass } from './class'
import { o } from './o'
import htm from 'htm'
const html = htm.bind(h)
@ -43,12 +44,13 @@ const omi = {
extractClass,
createRef,
html,
htm
htm,
o
}
options.root.Omi = omi
options.root.omi = omi
options.root.Omi.version = '6.3.4'
options.root.Omi.version = '6.3.5'
export default omi
@ -73,5 +75,6 @@ export {
extractClass,
createRef,
html,
htm
htm,
o
}

File diff suppressed because it is too large Load Diff