@bemto/core
Advanced tools
Comparing version 0.1.0-alpha.4 to 0.1.0-alpha.5
@@ -121,3 +121,3 @@ 'use strict'; | ||
var normalizeElementOption = function normalizeElementOption(input) { | ||
if (_typeof(input) === 'object') { | ||
if (_typeof(input) === 'object' && !input.$$typeof) { | ||
return input; | ||
@@ -124,0 +124,0 @@ } |
@@ -117,3 +117,3 @@ function _typeof(obj) { | ||
var normalizeElementOption = function normalizeElementOption(input) { | ||
if (_typeof(input) === 'object') { | ||
if (_typeof(input) === 'object' && !input.$$typeof) { | ||
return input; | ||
@@ -120,0 +120,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).bemto={})}(this,function(e){"use strict";function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{},t=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),t.forEach(function(e){var t,n,o;t=r,o=i[n=e],n in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o})}return r}var i={rootElem:"__Root",omitTrueModValue:!0,getters:{modifier:function(e){return 0===e.indexOf("_")?e.substring(1):e},element:function(e){return 0===e.indexOf("__")?e.substring(2):e}},templates:{modifier:function(e,t){return"".concat(e,"_").concat(t)},modifierValue:function(e,t){return"".concat(e,"_").concat(t)},element:function(e,t){return"".concat(e,"__").concat(t)}}},s=function(e){var c=e.omitTrueModValue,l=e.getters,u=e.templates,s=e.rootElem;return{getModifiers:function(e,s){return Object.keys(s).reduce(function(r,i){return s[i]&&e.map(function(e){return r.push((t=e,o=s[n=i],u.modifier(t,"boolean"==typeof o&&c?l.modifier(n):u.modifierValue(l.modifier(n),o))));var t,n,o}),r},[])},getElement:function(e,o){return e.map(function(e){return t=e,n=o,u.element(t,l.element(n));var t,n})},filterProps:function(r){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=f({className:""},r[s]),e={blockNames:(o.block||r.className||"").split(/\s+/),elements:Object.keys(o).reduce(function(e,t){var n;return 0===t.indexOf("__")&&null!==r[t]&&!1!==r[t]&&(e[t]="object"===m(n=o[t])?n:{component:n}),e},{}),modifiers:{}};return Object.keys(r).reduce(function(e,t){var n,o;return 0===t.indexOf("__")?t!==s&&null!=(o=r[t])&&!1!==o&&(e.elements[t]||(e.elements[t]={}),e.elements[t].props="object"!==m(n=r[t])||n instanceof Array||n.props?{children:n}:n):0===t.indexOf("_")?e.modifiers[t]=r[t]:i[t]=r[t],e},e),e.elements[s]=f({},e.elements[s],{props:i}),e}}},t=function t(e){var l=e.rootElem,n=s(e),o=n.getModifiers,u=n.getElement,r=n.filterProps;return{withSettings:function(e){return t(f({},i,e,{getters:f({},i.getters,e.getters),templates:f({},i.templates,e.templates)}))},bemto:function s(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c=r(e,t);return c.elements[l].props.className=[c.elements[l].props.className,o(c.blockNames,c.modifiers).join(" ")].join(" ").trim(),c.getProps=function(e,t){var n,o;if(e&&e!==l?(o=u(c.blockNames,e).join(" "),(n=f({},c.elements[e]&&c.elements[e].props)).className=[o,n.className].join(" ").trim()):(o=c.blockNames.join(" "),n=f({},c.elements[l].props)),t){var r=s(t,{block:o}).elements[l].props,i=n.className;(n=f({},n,r)).className=[i,r.className].join(" ").trim()}return n},c}}}(i),n=t.withSettings,o=t.bemto;e.bemto=o,e.withSettings=n,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).bemto={})}(this,function(e){"use strict";function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{},t=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),t.forEach(function(e){var t,n,o;t=r,o=i[n=e],n in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o})}return r}var i={rootElem:"__Root",omitTrueModValue:!0,getters:{modifier:function(e){return 0===e.indexOf("_")?e.substring(1):e},element:function(e){return 0===e.indexOf("__")?e.substring(2):e}},templates:{modifier:function(e,t){return"".concat(e,"_").concat(t)},modifierValue:function(e,t){return"".concat(e,"_").concat(t)},element:function(e,t){return"".concat(e,"__").concat(t)}}},s=function(e){var c=e.omitTrueModValue,l=e.getters,u=e.templates,s=e.rootElem;return{getModifiers:function(e,s){return Object.keys(s).reduce(function(r,i){return s[i]&&e.map(function(e){return r.push((t=e,o=s[n=i],u.modifier(t,"boolean"==typeof o&&c?l.modifier(n):u.modifierValue(l.modifier(n),o))));var t,n,o}),r},[])},getElement:function(e,o){return e.map(function(e){return t=e,n=o,u.element(t,l.element(n));var t,n})},filterProps:function(r){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=f({className:""},r[s]),e={blockNames:(o.block||r.className||"").split(/\s+/),elements:Object.keys(o).reduce(function(e,t){var n;return 0===t.indexOf("__")&&null!==r[t]&&!1!==r[t]&&(e[t]="object"!==m(n=o[t])||n.$$typeof?{component:n}:n),e},{}),modifiers:{}};return Object.keys(r).reduce(function(e,t){var n,o;return 0===t.indexOf("__")?t!==s&&null!=(o=r[t])&&!1!==o&&(e.elements[t]||(e.elements[t]={}),e.elements[t].props="object"!==m(n=r[t])||n instanceof Array||n.props?{children:n}:n):0===t.indexOf("_")?e.modifiers[t]=r[t]:i[t]=r[t],e},e),e.elements[s]=f({},e.elements[s],{props:i}),e}}},t=function t(e){var l=e.rootElem,n=s(e),o=n.getModifiers,u=n.getElement,r=n.filterProps;return{withSettings:function(e){return t(f({},i,e,{getters:f({},i.getters,e.getters),templates:f({},i.templates,e.templates)}))},bemto:function s(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c=r(e,t);return c.elements[l].props.className=[c.elements[l].props.className,o(c.blockNames,c.modifiers).join(" ")].join(" ").trim(),c.getProps=function(e,t){var n,o;if(e&&e!==l?(o=u(c.blockNames,e).join(" "),(n=f({},c.elements[e]&&c.elements[e].props)).className=[o,n.className].join(" ").trim()):(o=c.blockNames.join(" "),n=f({},c.elements[l].props)),t){var r=s(t,{block:o}).elements[l].props,i=n.className;(n=f({},n,r)).className=[i,r.className].join(" ").trim()}return n},c}}}(i),n=t.withSettings,o=t.bemto;e.bemto=o,e.withSettings=n,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "@bemto/core", | ||
"version": "0.1.0-alpha.4", | ||
"version": "0.1.0-alpha.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "author": "Roman Komarov <kizu@kizu.ru>", |
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
20736