Comparing version 0.0.22 to 0.0.23
@@ -1,1 +0,1 @@ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.html=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){module.exports=require("hyperx")(require("hyperx-to-snabbdom")(require("snabbdom/h").h))},{hyperx:4,"hyperx-to-snabbdom":3,"snabbdom/h":5}],2:[function(require,module,exports){function attributeToProperty(r){return function(t,o,e){for(var n in o)n in transform&&(o[transform[n]]=o[n],delete o[n]);return r(t,o,e)}}module.exports=attributeToProperty;var transform={"class":"className","for":"htmlFor","http-equiv":"httpEquiv"}},{}],3:[function(require,module,exports){module.exports=function(s){return function(r,t,o){var a={"class":{},props:{},style:{},attrs:{},hook:{},on:{}};for(var e in t)if(void 0!==e&&t.hasOwnProperty(e)){var n=t[e];if("className"===e)for(var l=n.split(" "),u=0;u<l.length;u++)a.class[l[u]]=!0;else"style"===e?a.style=n:"on"===e.substr(0,2)?a.on[e.substr(2)]=n:"data-hook-"===e.substr(0,10)?a.hook[e.substr(10)]=n:a.props[e]=a.attrs[e]="true"===n||"false"!==n&&n}return s(r,a,o?[].concat.apply([],o):o)}}},{}],4:[function(require,module,exports){function quot(T){return T===ATTR_VALUE_SQ||T===ATTR_VALUE_DQ}function has(T,e){return hasOwn.call(T,e)}function selfClosing(T){return closeRE.test(T)}var attrToProp=require("hyperscript-attribute-to-property"),VAR=0,TEXT=1,OPEN=2,CLOSE=3,ATTR=4,ATTR_KEY=5,ATTR_KEY_W=6,ATTR_VALUE_W=7,ATTR_VALUE=8,ATTR_VALUE_SQ=9,ATTR_VALUE_DQ=10,ATTR_EQ=11,ATTR_BREAK=12;module.exports=function(T,e){function A(T){return"function"==typeof T?T:"string"==typeof T?T:T&&"object"==typeof T?T:t("",T)}T=attrToProp(T),e||(e={});var t=e.concat||function(T,e){return String(T)+String(e)};return function(e){function r(T){var e=[];R===ATTR_VALUE_W&&(R=ATTR);for(var A=0;A<T.length;A++){var t=T.charAt(A);R===TEXT&&"<"===t?(n.length&&e.push([TEXT,n]),n="",R=OPEN):">"!==t||quot(R)?R===TEXT?n+=t:R===OPEN&&/\s/.test(t)?(e.push([OPEN,n]),n="",R=ATTR):R===OPEN?n+=t:R===ATTR&&/[\w-]/.test(t)?(R=ATTR_KEY,n=t):R===ATTR&&/\s/.test(t)?(n.length&&e.push([ATTR_KEY,n]),e.push([ATTR_BREAK])):R===ATTR_KEY&&/\s/.test(t)?(e.push([ATTR_KEY,n]),n="",R=ATTR_KEY_W):R===ATTR_KEY&&"="===t?(e.push([ATTR_KEY,n],[ATTR_EQ]),n="",R=ATTR_VALUE_W):R===ATTR_KEY?n+=t:R!==ATTR_KEY_W&&R!==ATTR||"="!==t?R!==ATTR_KEY_W&&R!==ATTR||/\s/.test(t)?R===ATTR_VALUE_W&&'"'===t?R=ATTR_VALUE_DQ:R===ATTR_VALUE_W&&"'"===t?R=ATTR_VALUE_SQ:R===ATTR_VALUE_DQ&&'"'===t?(e.push([ATTR_VALUE,n],[ATTR_BREAK]),n="",R=ATTR):R===ATTR_VALUE_SQ&&"'"===t?(e.push([ATTR_VALUE,n],[ATTR_BREAK]),n="",R=ATTR):R!==ATTR_VALUE_W||/\s/.test(t)?R===ATTR_VALUE&&/\s/.test(t)?(e.push([ATTR_VALUE,n],[ATTR_BREAK]),n="",R=ATTR):R!==ATTR_VALUE&&R!==ATTR_VALUE_SQ&&R!==ATTR_VALUE_DQ||(n+=t):(R=ATTR_VALUE,A--):(e.push([ATTR_BREAK]),/[\w-]/.test(t)?(n+=t,R=ATTR_KEY):R=ATTR):(e.push([ATTR_EQ]),R=ATTR_VALUE_W):(R===OPEN?e.push([OPEN,n]):R===ATTR_KEY?e.push([ATTR_KEY,n]):R===ATTR_VALUE&&n.length&&e.push([ATTR_VALUE,n]),e.push([CLOSE]),n="",R=TEXT)}return R===TEXT&&n.length?(e.push([TEXT,n]),n=""):R===ATTR_VALUE&&n.length?(e.push([ATTR_VALUE,n]),n=""):R===ATTR_VALUE_DQ&&n.length?(e.push([ATTR_VALUE,n]),n=""):R===ATTR_VALUE_SQ&&n.length?(e.push([ATTR_VALUE,n]),n=""):R===ATTR_KEY&&(e.push([ATTR_KEY,n]),n=""),e}for(var R=TEXT,n="",E=arguments.length,_=[],s=0;s<e.length;s++)if(s<E-1){var o=arguments[s+1],l=r(e[s]),h=R;h===ATTR_VALUE_DQ&&(h=ATTR_VALUE),h===ATTR_VALUE_SQ&&(h=ATTR_VALUE),h===ATTR_VALUE_W&&(h=ATTR_VALUE),h===ATTR&&(h=ATTR_KEY),l.push([VAR,h,o]),_.push.apply(_,l)}else _.push.apply(_,r(e[s]));for(var i=[null,{},[]],f=[[i,-1]],s=0;s<_.length;s++){var a=f[f.length-1][0],l=_[s],p=l[0];if(p===OPEN&&/^\//.test(l[1])){var u=f[f.length-1][1];f.length>1&&(f.pop(),f[f.length-1][0][2][u]=T(a[0],a[1],a[2].length?a[2]:void 0))}else if(p===OPEN){var g=[l[1],{},[]];a[2].push(g),f.push([g,a[2].length-1])}else if(p===ATTR_KEY||p===VAR&&l[1]===ATTR_KEY){for(var L,V="";s<_.length;s++)if(_[s][0]===ATTR_KEY)V=t(V,_[s][1]);else{if(_[s][0]!==VAR||_[s][1]!==ATTR_KEY)break;if("object"!=typeof _[s][2]||V)V=t(V,_[s][2]);else for(L in _[s][2])_[s][2].hasOwnProperty(L)&&!a[1][L]&&(a[1][L]=_[s][2][L])}_[s][0]===ATTR_EQ&&s++;for(var U=s;s<_.length;s++)if(_[s][0]===ATTR_VALUE||_[s][0]===ATTR_KEY)a[1][V]?a[1][V]=t(a[1][V],_[s][1]):a[1][V]=A(_[s][1]);else{if(_[s][0]!==VAR||_[s][1]!==ATTR_VALUE&&_[s][1]!==ATTR_KEY){!V.length||a[1][V]||s!==U||_[s][0]!==CLOSE&&_[s][0]!==ATTR_BREAK||(a[1][V]=V.toLowerCase());break}a[1][V]?a[1][V]=t(a[1][V],_[s][2]):a[1][V]=A(_[s][2])}}else if(p===ATTR_KEY)a[1][l[1]]=!0;else if(p===VAR&&l[1]===ATTR_KEY)a[1][l[2]]=!0;else if(p===CLOSE){if(selfClosing(a[0])&&f.length){var u=f[f.length-1][1];f.pop(),f[f.length-1][0][2][u]=T(a[0],a[1],a[2].length?a[2]:void 0)}}else if(p===VAR&&l[1]===TEXT)void 0===l[2]||null===l[2]?l[2]="":l[2]||(l[2]=t("",l[2])),Array.isArray(l[2][0])?a[2].push.apply(a[2],l[2]):a[2].push(l[2]);else if(p===TEXT)a[2].push(l[1]);else if(p!==ATTR_EQ&&p!==ATTR_BREAK)throw new Error("unhandled: "+p)}if(i[2].length>1&&/^\s*$/.test(i[2][0])&&i[2].shift(),i[2].length>2||2===i[2].length&&/\S/.test(i[2][1]))throw new Error("multiple root elements must be wrapped in an enclosing tag");return Array.isArray(i[2][0])&&"string"==typeof i[2][0][0]&&Array.isArray(i[2][0][2])&&(i[2][0]=T(i[2][0][0],i[2][0][1],i[2][0][2])),i[2][0]}};var hasOwn=Object.prototype.hasOwnProperty,closeRE=RegExp("^("+["area","base","basefont","bgsound","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr","animate","animateTransform","circle","cursor","desc","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","font-face-format","font-face-name","font-face-uri","glyph","glyphRef","hkern","image","line","missing-glyph","mpath","path","polygon","polyline","rect","set","stop","tref","use","view","vkern"].join("|")+")(?:[.#][a-zA-Z0-9-_:-]+)*$")},{"hyperscript-attribute-to-property":2}],5:[function(require,module,exports){"use strict";function addNS(e,i,r){if(e.ns="http://www.w3.org/2000/svg","foreignObject"!==r&&void 0!==i)for(var d=0;d<i.length;++d){var o=i[d].data;void 0!==o&&addNS(o,i[d].children,i[d].sel)}}function h(e,i,r){var d,o,v,t={};if(void 0!==r?(t=i,is.array(r)?d=r:is.primitive(r)?o=r:r&&r.sel&&(d=[r])):void 0!==i&&(is.array(i)?d=i:is.primitive(i)?o=i:i&&i.sel?d=[i]:t=i),is.array(d))for(v=0;v<d.length;++v)is.primitive(d[v])&&(d[v]=vnode_1.vnode(void 0,void 0,void 0,d[v]));return"s"!==e[0]||"v"!==e[1]||"g"!==e[2]||3!==e.length&&"."!==e[3]&&"#"!==e[3]||addNS(t,d,e),vnode_1.vnode(e,t,d,o,void 0)}var vnode_1=require("./vnode"),is=require("./is");exports.h=h,Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=h},{"./is":6,"./vnode":7}],6:[function(require,module,exports){"use strict";function primitive(r){return"string"==typeof r||"number"==typeof r}exports.array=Array.isArray,exports.primitive=primitive},{}],7:[function(require,module,exports){"use strict";function vnode(e,t,o,d,r){var n=void 0===t?void 0:t.key;return{sel:e,data:t,children:o,text:d,elm:r,key:n}}exports.vnode=vnode,Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=vnode},{}]},{},[1])(1)}); | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.html=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){function parseBool(e){return"true"===e||"false"!==e&&e}function isSVG(e){for(var r=["svg","animate","animateTransform","circle","cursor","desc","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","font-face-format","font-face-name","font-face-uri","glyph","glyphRef","hkern","image","line","missing-glyph","mpath","path","polygon","polyline","rect","set","stop","tref","use","view","vkern"],t=0;t<r.length;t++)if(e===r[t])return!0;return!1}module.exports=require("hyperx")(function(e){return function(r,t,o){var s={"class":{},props:{},style:{},attrs:{},hook:{},on:{}};for(var f in t)if(void 0!==f&&t.hasOwnProperty(f)){var n=t[f];if("className"===f)for(var i=n.split(" "),a=0;a<i.length;a++)s.class[i[a]]=!0;else if("style"===f)s.style=n;else if("on"===f.substr(0,2))s.on[f.substr(2)]=n;else if("data-hook-"===f.substr(0,10))s.hook[f.substr(10)]=n;else{if(isSVG(r)){s.attrs[f]=parseBool(n);continue}s.props[f]=s.attrs[f]=parseBool(n)}}return e(r,s,o?[].concat.apply([],o):o)}}(require("snabbdom/h").h))},{hyperx:3,"snabbdom/h":4}],2:[function(require,module,exports){function attributeToProperty(r){return function(t,o,e){for(var n in o)n in transform&&(o[transform[n]]=o[n],delete o[n]);return r(t,o,e)}}module.exports=attributeToProperty;var transform={"class":"className","for":"htmlFor","http-equiv":"httpEquiv"}},{}],3:[function(require,module,exports){function quot(T){return T===ATTR_VALUE_SQ||T===ATTR_VALUE_DQ}function has(T,e){return hasOwn.call(T,e)}function selfClosing(T){return closeRE.test(T)}var attrToProp=require("hyperscript-attribute-to-property"),VAR=0,TEXT=1,OPEN=2,CLOSE=3,ATTR=4,ATTR_KEY=5,ATTR_KEY_W=6,ATTR_VALUE_W=7,ATTR_VALUE=8,ATTR_VALUE_SQ=9,ATTR_VALUE_DQ=10,ATTR_EQ=11,ATTR_BREAK=12;module.exports=function(T,e){function A(T){return"function"==typeof T?T:"string"==typeof T?T:T&&"object"==typeof T?T:t("",T)}T=attrToProp(T),e||(e={});var t=e.concat||function(T,e){return String(T)+String(e)};return function(e){function r(T){var e=[];R===ATTR_VALUE_W&&(R=ATTR);for(var A=0;A<T.length;A++){var t=T.charAt(A);R===TEXT&&"<"===t?(n.length&&e.push([TEXT,n]),n="",R=OPEN):">"!==t||quot(R)?R===TEXT?n+=t:R===OPEN&&/\s/.test(t)?(e.push([OPEN,n]),n="",R=ATTR):R===OPEN?n+=t:R===ATTR&&/[\w-]/.test(t)?(R=ATTR_KEY,n=t):R===ATTR&&/\s/.test(t)?(n.length&&e.push([ATTR_KEY,n]),e.push([ATTR_BREAK])):R===ATTR_KEY&&/\s/.test(t)?(e.push([ATTR_KEY,n]),n="",R=ATTR_KEY_W):R===ATTR_KEY&&"="===t?(e.push([ATTR_KEY,n],[ATTR_EQ]),n="",R=ATTR_VALUE_W):R===ATTR_KEY?n+=t:R!==ATTR_KEY_W&&R!==ATTR||"="!==t?R!==ATTR_KEY_W&&R!==ATTR||/\s/.test(t)?R===ATTR_VALUE_W&&'"'===t?R=ATTR_VALUE_DQ:R===ATTR_VALUE_W&&"'"===t?R=ATTR_VALUE_SQ:R===ATTR_VALUE_DQ&&'"'===t?(e.push([ATTR_VALUE,n],[ATTR_BREAK]),n="",R=ATTR):R===ATTR_VALUE_SQ&&"'"===t?(e.push([ATTR_VALUE,n],[ATTR_BREAK]),n="",R=ATTR):R!==ATTR_VALUE_W||/\s/.test(t)?R===ATTR_VALUE&&/\s/.test(t)?(e.push([ATTR_VALUE,n],[ATTR_BREAK]),n="",R=ATTR):R!==ATTR_VALUE&&R!==ATTR_VALUE_SQ&&R!==ATTR_VALUE_DQ||(n+=t):(R=ATTR_VALUE,A--):(e.push([ATTR_BREAK]),/[\w-]/.test(t)?(n+=t,R=ATTR_KEY):R=ATTR):(e.push([ATTR_EQ]),R=ATTR_VALUE_W):(R===OPEN?e.push([OPEN,n]):R===ATTR_KEY?e.push([ATTR_KEY,n]):R===ATTR_VALUE&&n.length&&e.push([ATTR_VALUE,n]),e.push([CLOSE]),n="",R=TEXT)}return R===TEXT&&n.length?(e.push([TEXT,n]),n=""):R===ATTR_VALUE&&n.length?(e.push([ATTR_VALUE,n]),n=""):R===ATTR_VALUE_DQ&&n.length?(e.push([ATTR_VALUE,n]),n=""):R===ATTR_VALUE_SQ&&n.length?(e.push([ATTR_VALUE,n]),n=""):R===ATTR_KEY&&(e.push([ATTR_KEY,n]),n=""),e}for(var R=TEXT,n="",E=arguments.length,_=[],s=0;s<e.length;s++)if(s<E-1){var o=arguments[s+1],l=r(e[s]),h=R;h===ATTR_VALUE_DQ&&(h=ATTR_VALUE),h===ATTR_VALUE_SQ&&(h=ATTR_VALUE),h===ATTR_VALUE_W&&(h=ATTR_VALUE),h===ATTR&&(h=ATTR_KEY),l.push([VAR,h,o]),_.push.apply(_,l)}else _.push.apply(_,r(e[s]));for(var i=[null,{},[]],f=[[i,-1]],s=0;s<_.length;s++){var a=f[f.length-1][0],l=_[s],p=l[0];if(p===OPEN&&/^\//.test(l[1])){var u=f[f.length-1][1];f.length>1&&(f.pop(),f[f.length-1][0][2][u]=T(a[0],a[1],a[2].length?a[2]:void 0))}else if(p===OPEN){var g=[l[1],{},[]];a[2].push(g),f.push([g,a[2].length-1])}else if(p===ATTR_KEY||p===VAR&&l[1]===ATTR_KEY){for(var L,V="";s<_.length;s++)if(_[s][0]===ATTR_KEY)V=t(V,_[s][1]);else{if(_[s][0]!==VAR||_[s][1]!==ATTR_KEY)break;if("object"!=typeof _[s][2]||V)V=t(V,_[s][2]);else for(L in _[s][2])_[s][2].hasOwnProperty(L)&&!a[1][L]&&(a[1][L]=_[s][2][L])}_[s][0]===ATTR_EQ&&s++;for(var U=s;s<_.length;s++)if(_[s][0]===ATTR_VALUE||_[s][0]===ATTR_KEY)a[1][V]?a[1][V]=t(a[1][V],_[s][1]):a[1][V]=A(_[s][1]);else{if(_[s][0]!==VAR||_[s][1]!==ATTR_VALUE&&_[s][1]!==ATTR_KEY){!V.length||a[1][V]||s!==U||_[s][0]!==CLOSE&&_[s][0]!==ATTR_BREAK||(a[1][V]=V.toLowerCase());break}a[1][V]?a[1][V]=t(a[1][V],_[s][2]):a[1][V]=A(_[s][2])}}else if(p===ATTR_KEY)a[1][l[1]]=!0;else if(p===VAR&&l[1]===ATTR_KEY)a[1][l[2]]=!0;else if(p===CLOSE){if(selfClosing(a[0])&&f.length){var u=f[f.length-1][1];f.pop(),f[f.length-1][0][2][u]=T(a[0],a[1],a[2].length?a[2]:void 0)}}else if(p===VAR&&l[1]===TEXT)void 0===l[2]||null===l[2]?l[2]="":l[2]||(l[2]=t("",l[2])),Array.isArray(l[2][0])?a[2].push.apply(a[2],l[2]):a[2].push(l[2]);else if(p===TEXT)a[2].push(l[1]);else if(p!==ATTR_EQ&&p!==ATTR_BREAK)throw new Error("unhandled: "+p)}if(i[2].length>1&&/^\s*$/.test(i[2][0])&&i[2].shift(),i[2].length>2||2===i[2].length&&/\S/.test(i[2][1]))throw new Error("multiple root elements must be wrapped in an enclosing tag");return Array.isArray(i[2][0])&&"string"==typeof i[2][0][0]&&Array.isArray(i[2][0][2])&&(i[2][0]=T(i[2][0][0],i[2][0][1],i[2][0][2])),i[2][0]}};var hasOwn=Object.prototype.hasOwnProperty,closeRE=RegExp("^("+["area","base","basefont","bgsound","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr","animate","animateTransform","circle","cursor","desc","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","font-face-format","font-face-name","font-face-uri","glyph","glyphRef","hkern","image","line","missing-glyph","mpath","path","polygon","polyline","rect","set","stop","tref","use","view","vkern"].join("|")+")(?:[.#][a-zA-Z0-9-_:-]+)*$")},{"hyperscript-attribute-to-property":2}],4:[function(require,module,exports){"use strict";function addNS(e,i,r){if(e.ns="http://www.w3.org/2000/svg","foreignObject"!==r&&void 0!==i)for(var d=0;d<i.length;++d){var o=i[d].data;void 0!==o&&addNS(o,i[d].children,i[d].sel)}}function h(e,i,r){var d,o,v,t={};if(void 0!==r?(t=i,is.array(r)?d=r:is.primitive(r)?o=r:r&&r.sel&&(d=[r])):void 0!==i&&(is.array(i)?d=i:is.primitive(i)?o=i:i&&i.sel?d=[i]:t=i),is.array(d))for(v=0;v<d.length;++v)is.primitive(d[v])&&(d[v]=vnode_1.vnode(void 0,void 0,void 0,d[v]));return"s"!==e[0]||"v"!==e[1]||"g"!==e[2]||3!==e.length&&"."!==e[3]&&"#"!==e[3]||addNS(t,d,e),vnode_1.vnode(e,t,d,o,void 0)}var vnode_1=require("./vnode"),is=require("./is");exports.h=h,Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=h},{"./is":5,"./vnode":6}],5:[function(require,module,exports){"use strict";function primitive(r){return"string"==typeof r||"number"==typeof r}exports.array=Array.isArray,exports.primitive=primitive},{}],6:[function(require,module,exports){"use strict";function vnode(e,t,o,d,r){var n=void 0===t?void 0:t.key;return{sel:e,data:t,children:o,text:d,elm:r,key:n}}exports.vnode=vnode,Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=vnode},{}]},{},[1])(1)}); |
71
html.js
@@ -1,1 +0,70 @@ | ||
module.exports = require("hyperx")(require("hyperx-to-snabbdom")(require("snabbdom/h").h)) | ||
module.exports = require("hyperx")(function (h) { | ||
return function (tagName, attrs, children) { | ||
var data = { | ||
"class": {}, | ||
props: {}, | ||
style: {}, | ||
attrs: {}, | ||
hook: {}, | ||
on: {} | ||
} | ||
for (var key in attrs) { | ||
if (key === undefined || !attrs.hasOwnProperty(key)) { | ||
continue | ||
} | ||
var value = attrs[key] | ||
if (key === "className") { | ||
var cls = value.split(" ") | ||
for (var i = 0; i < cls.length; i++) { | ||
data["class"][cls[i]] = true | ||
} | ||
} else if (key === "style") { | ||
data.style = value | ||
} else if ("on" === key.substr(0, 2)) { | ||
data.on[key.substr(2)] = value | ||
} else if ("data-hook-" === key.substr(0, 10)) { | ||
data.hook[key.substr(10)] = value | ||
} else { | ||
if (isSVG(tagName)) { | ||
data.attrs[key] = parseBool(value) | ||
continue | ||
} | ||
data.props[key] = data.attrs[key] = parseBool(value) | ||
} | ||
} | ||
return h(tagName, data, children ? [].concat.apply([], children) : children) | ||
} | ||
}(require("snabbdom/h").h)) | ||
function parseBool(value) { | ||
return value === "true" ? true : value === "false" ? false : value | ||
} | ||
function isSVG(tagName) { | ||
var svgTags = [ | ||
"svg", "animate", "animateTransform", "circle", "cursor", "desc", "ellipse", | ||
"feBlend", "feColorMatrix", "feComposite", | ||
"feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", | ||
"feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", | ||
"feGaussianBlur", "feImage", "feMergeNode", "feMorphology", | ||
"feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", | ||
"feTurbulence", "font-face-format", "font-face-name", "font-face-uri", | ||
"glyph", "glyphRef", "hkern", "image", "line", "missing-glyph", "mpath", | ||
"path", "polygon", "polyline", "rect", "set", "stop", "tref", "use", "view", | ||
"vkern" | ||
] | ||
for (var i = 0; i < svgTags.length; i++) { | ||
if (tagName === svgTags[i]) { | ||
return true | ||
} | ||
} | ||
return false | ||
} |
{ | ||
"name": "flea", | ||
"description": "Tiny UI library based in Snabbdom and ES6 tagged template literals", | ||
"version": "0.0.22", | ||
"version": "0.0.23", | ||
"main": "index.js", | ||
@@ -23,4 +23,3 @@ "author": "Jorge Bucaran", | ||
"hyperx": "^2.0.5", | ||
"hyperx-to-snabbdom": "^0.2.4", | ||
"snabbdom": "^0.6.0" | ||
"snabbdom": "^0.6.1" | ||
}, | ||
@@ -27,0 +26,0 @@ "devDependencies": { |
@@ -1,2 +0,2 @@ | ||
# flea | ||
# [flea](https://flea.gomix.me/) | ||
@@ -3,0 +3,0 @@ flea is a tiny JavaScript UI library based in [Snabbdom] and ES6 tagged template literals. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83472
2
201
- Removedhyperx-to-snabbdom@^0.2.4
- Removedhyperx-to-snabbdom@0.2.4(transitive)
Updatedsnabbdom@^0.6.1