Comparing version 11.3.3 to 11.4.0
@@ -38,5 +38,5 @@ import arrayEach from 'fast-loops/lib/arrayEach'; | ||
if (support) { | ||
rehydrateSupportRules(css, media, renderer.cache); | ||
rehydrateSupportRules(css, media, renderer.cache, renderer.specificityPrefix); | ||
} else { | ||
rehydrateRules(css, media, '', renderer.cache); | ||
rehydrateRules(css, media, '', renderer.cache, renderer.specificityPrefix); | ||
} | ||
@@ -43,0 +43,0 @@ |
@@ -7,2 +7,3 @@ import { generateCSSSelector } from 'fela-utils'; | ||
var support = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : ''; | ||
var specificityPrefix = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : ''; | ||
@@ -12,3 +13,3 @@ return { | ||
className: className, | ||
selector: generateCSSSelector(className, pseudo), | ||
selector: generateCSSSelector(className, pseudo, specificityPrefix), | ||
declaration: property + ':' + value, | ||
@@ -15,0 +16,0 @@ pseudo: pseudo, |
@@ -7,3 +7,6 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
var DECL_REGEX = /[.]([0-9a-z_-]+)([^{]+)?{([^:]+):([^}]+)}/gi; | ||
// Escaping for RegExp taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Escaping | ||
function escapeRegExp(string) { | ||
return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); | ||
} | ||
@@ -14,4 +17,6 @@ export default function rehydrateRules(css) { | ||
var cache = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | ||
var specificityPrefix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ''; | ||
var decl = void 0; | ||
var DECL_REGEX = new RegExp(escapeRegExp(specificityPrefix) + '[.]([0-9a-z_-]+)([^{]+)?{([^:]+):([^}]+)}', 'gi'); | ||
@@ -34,3 +39,3 @@ // This excellent parsing implementation was originally taken from Styletron and modified to fit Fela | ||
cache[declarationReference] = generateCacheEntry(RULE_TYPE, className, property, value, pseudo, media, support); | ||
cache[declarationReference] = generateCacheEntry(RULE_TYPE, className, property, value, pseudo, media, support, specificityPrefix); | ||
} | ||
@@ -37,0 +42,0 @@ |
@@ -11,2 +11,3 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
var cache = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | ||
var specificityPrefix = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ''; | ||
@@ -23,3 +24,3 @@ var decl = void 0; | ||
var supportQuery = extractSupportQuery(ruleSet); | ||
rehydrateRules(cssRules, media, supportQuery, cache); | ||
rehydrateRules(cssRules, media, supportQuery, cache, specificityPrefix); | ||
} | ||
@@ -26,0 +27,0 @@ |
@@ -59,5 +59,5 @@ 'use strict'; | ||
if (support) { | ||
(0, _rehydrateSupportRules2.default)(css, media, renderer.cache); | ||
(0, _rehydrateSupportRules2.default)(css, media, renderer.cache, renderer.specificityPrefix); | ||
} else { | ||
(0, _rehydrateRules2.default)(css, media, '', renderer.cache); | ||
(0, _rehydrateRules2.default)(css, media, '', renderer.cache, renderer.specificityPrefix); | ||
} | ||
@@ -64,0 +64,0 @@ |
@@ -14,2 +14,3 @@ 'use strict'; | ||
var support = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : ''; | ||
var specificityPrefix = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : ''; | ||
@@ -19,3 +20,3 @@ return { | ||
className: className, | ||
selector: (0, _felaUtils.generateCSSSelector)(className, pseudo), | ||
selector: (0, _felaUtils.generateCSSSelector)(className, pseudo, specificityPrefix), | ||
declaration: property + ':' + value, | ||
@@ -22,0 +23,0 @@ pseudo: pseudo, |
@@ -19,3 +19,6 @@ 'use strict'; | ||
var DECL_REGEX = /[.]([0-9a-z_-]+)([^{]+)?{([^:]+):([^}]+)}/gi; | ||
// Escaping for RegExp taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Escaping | ||
function escapeRegExp(string) { | ||
return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); | ||
} | ||
@@ -26,4 +29,6 @@ function rehydrateRules(css) { | ||
var cache = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | ||
var specificityPrefix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ''; | ||
var decl = void 0; | ||
var DECL_REGEX = new RegExp(escapeRegExp(specificityPrefix) + '[.]([0-9a-z_-]+)([^{]+)?{([^:]+):([^}]+)}', 'gi'); | ||
@@ -46,3 +51,3 @@ // This excellent parsing implementation was originally taken from Styletron and modified to fit Fela | ||
cache[declarationReference] = (0, _generateCacheEntry2.default)(_felaUtils.RULE_TYPE, className, property, value, pseudo, media, support); | ||
cache[declarationReference] = (0, _generateCacheEntry2.default)(_felaUtils.RULE_TYPE, className, property, value, pseudo, media, support, specificityPrefix); | ||
} | ||
@@ -49,0 +54,0 @@ |
@@ -26,2 +26,3 @@ 'use strict'; | ||
var cache = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | ||
var specificityPrefix = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ''; | ||
@@ -38,3 +39,3 @@ var decl = void 0; | ||
var supportQuery = (0, _extractSupportQuery2.default)(ruleSet); | ||
(0, _rehydrateRules2.default)(cssRules, media, supportQuery, cache); | ||
(0, _rehydrateRules2.default)(cssRules, media, supportQuery, cache, specificityPrefix); | ||
} | ||
@@ -41,0 +42,0 @@ |
{ | ||
"name": "fela-dom", | ||
"version": "11.3.3", | ||
"version": "11.4.0", | ||
"description": "Fela package for working with the DOM", | ||
@@ -28,3 +28,3 @@ "main": "lib/index.js", | ||
], | ||
"author": "Robin Frischmann", | ||
"author": "Robin Weser", | ||
"license": "MIT", | ||
@@ -34,11 +34,11 @@ "dependencies": { | ||
"fast-loops": "^1.0.1", | ||
"fela-utils": "^11.3.3", | ||
"fela-utils": "^11.4.0", | ||
"sort-css-media-queries": "^1.4.3" | ||
}, | ||
"devDependencies": { | ||
"fela": "^11.3.3", | ||
"fela-preset-web": "^11.3.3", | ||
"fela-tools": "^11.3.3" | ||
"fela": "^11.4.0", | ||
"fela-preset-web": "^11.4.0", | ||
"fela-tools": "^11.4.0" | ||
}, | ||
"gitHead": "4cc4686d9e16877251ac5c73e161076ec7c113a1" | ||
"gitHead": "94e23ad2fda221aea52ccb939d90f81eb400b5fb" | ||
} |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("FelaDom",[],t):"object"==typeof exports?exports.FelaDom=t():e.FelaDom=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=6)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){for(var n in e)r=t(r,e[n],n,e);return r}},,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){for(var n=0,o=e.length;n<o;++n)r=t(r,e[n],n,o,e);return r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){for(var r in e)t(e[r],r,e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){for(var r=0,n=e.length;r<n;++r)t(e[r],r,n,e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(n,(function(e){return e[1].toUpperCase()})).replace(o,"ms")};var n=/-([a-z])/g,o=/^Ms/g;e.exports=t.default},function(e,t,r){"use strict";r.r(t);var n=r(3),o=r.n(n);function u(e,t){return e+"{"+t+"}"}var s=r(0),i=r.n(s);function a(e,t,r=document){const n=function({type:e,media:t="",support:r=""}){return e+t+r}(e);if(!t.nodes[n]){const o=function({type:e,media:t,support:r},n=document){const o=t?`[media="${t}"]`:":not([media])",u=r?'[data-fela-support="true"]':':not([data-fela-support="true"])';return n.querySelector(`[data-fela-type="${e}"]${u}${o}`)}(e,r)||function(e,t=document,r,n){const o=t.head||{},{type:u,media:s,support:i}=e,a=t.createElement("style");a.setAttribute("data-fela-type",u),a.type="text/css",i&&a.setAttribute("data-fela-support","true"),s&&(a.media=s);for(let e in n)a.setAttribute(e,n[e]);if(void 0!==typeof window&&window.FelaConfig)for(let e in window.FelaConfig.styleNodeAttributes)a.setAttribute(e,window.FelaConfig.styleNodeAttributes[e]);const c=function(e,{type:t,media:r,support:n},o){switch(t){case"FONT":case"STATIC":case"KEYFRAME":return e[0];case"RULE":const t=e.map(e=>e.media).filter(e=>0!==e.length);if(r){const u=[...t,r].sort(o),s=u.indexOf(r)+1,i=u[s];if(i)return i===r&&n?e.find(e=>e.media===u[u.indexOf(r)+2]):e.find(e=>e.media===i)}else{const r=t.sort(o)[0];if(!n){const t=e.find(e=>void 0!==e.getAttribute("data-fela-support")&&""===e.media&&"RULE"===e.getAttribute("data-fela-type"));if(t)return t}if(r)return e.find(e=>e.media===r)}}}([...o.querySelectorAll("[data-fela-type]")],e,r);return c?o.insertBefore(a,c):o.appendChild(a),a}(e,r,t.sortMediaQuery,t.styleNodeAttributes);t.nodes[n]=o}return t.nodes[n]}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return 0===e.length||0===t.length?0:e.indexOf(e.find((function(e){return null!==t.match(e)})))+1}function l(e,t){return"@supports "+e+"{"+t+"}"}var d,f=r(2),p=r.n(f);function y(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function m(e,t){var r=i()(e,(function(r,n,o){var u=function(e,t){for(var r=-1,n=0;n<e.length;n++)if(t(e[n])){r=n;break}return r}(r,(function(r){return t(e[r],r)>t(n,o)}));return-1!==u?function(e,t,r){return[].concat(y(e.slice(0,r)),[t],y(e.slice(r,e.length)))}(r,o,u):[].concat(function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(r),[o])}),[]);return p()(r,(function(t,r){return t[r]=e[r],t}),{})}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var h=(b(d={},"RULE",(function(e,t){var r=t.selector,n=t.declaration,o=t.support,s=t.media,i=u(r,n);o?s?(e.supportMediaRules[s]||(e.supportMediaRules[s]={}),e.supportMediaRules[s][o]||(e.supportMediaRules[s][o]=""),e.supportMediaRules[s][o]+=i):(e.supportRules[o]||(e.supportRules[o]=""),e.supportRules[o]+=i):s?(e.mediaRules[s]||(e.mediaRules[s]=""),e.mediaRules[s]+=i):e.rules+=i})),b(d,"FONT",(function(e,t){var r=t.fontFace;e.fontFaces+=r})),b(d,"KEYFRAME",(function(e,t){var r=t.keyframe;e.keyframes+=r})),b(d,"STATIC",(function(e,t){var r=t.css,n=t.selector;e.statics+=n?u(n,r):r})),d);function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=m(e,(function(e){return c(t,e.pseudo)}));return i()(r,(function(e,t){var r=h[t.type];return r&&r(e,t),e}),{mediaRules:{},supportRules:{},supportMediaRules:{},fontFaces:"",statics:"",keyframes:"",rules:""})}var g={fontFaces:"FONT",statics:"STATIC",keyframes:"KEYFRAME",rules:"RULE"};function v(e){return i()(e,(function(e,t,r){return t.length>0&&(e+=l(r,t)),e}),"")}const A=/^[a-z0-9_-]*$/gi;function x(e){return 0===e.selectorPrefix.length||null!==e.selectorPrefix.match(A)?e.uniqueRuleIdentifier:-1}function M(e){const t=R(e.cache,e.ruleOrder),r=x(e),n=i()(g,(n,o,u)=>(t[u].length>0&&n.push({css:t[u],rehydration:r,attributes:e.styleNodeAttributes,type:o}),n),[]),o=v(t.supportRules);o&&n.push({css:o,type:"RULE",rehydration:r,attributes:e.styleNodeAttributes,support:!0});const u=Object.keys({...t.supportMediaRules,...t.mediaRules}).sort(e.sortMediaQuery);return p()(u,(n,o)=>{if(t.mediaRules[o]&&t.mediaRules[o].length>0&&n.push({css:t.mediaRules[o],type:"RULE",rehydration:r,attributes:e.styleNodeAttributes,media:o}),t.supportMediaRules[o]){const u=v(t.supportMediaRules[o]);u.length>0&&n.push({css:u,type:"RULE",rehydration:r,attributes:e.styleNodeAttributes,support:!0,media:o})}return n},n)}function O({selector:e,declaration:t,support:r,media:n,pseudo:o},s,i){const a=n+r;if(s.devMode)!function(e,t){const r=M(e),n=t.getAttribute("media")||void 0,o=!!t.getAttribute("data-fela-support")||void 0,u=r.find(e=>"RULE"===e.type&&e.media===n&&e.support===o);u&&(t.textContent=u.css)}(s,i);else try{const n=c(s.ruleOrder,o),{cssRules:d}=i.sheet;let f=d.length;if(0===n)f=void 0===s.scoreIndex[a]?0:s.scoreIndex[a]+1;else{for(let e=s.scoreIndex[a]||0,t=d.length;e<t;++e)if(d[e].score>n){f=e;break}}const p=u(e,t);if(r.length>0){const e=l(r,p);i.sheet.insertRule(e,f)}else i.sheet.insertRule(p,f);0===n&&(s.scoreIndex[a]=f),d[f].score=n}catch(e){}}function E(e,t){e.updateSubscription||(e.scoreIndex={},e.nodes={},e.updateSubscription=function(e,t=document){return r=>{if("CLEAR"===r.type)return o()(e.nodes,e=>e.parentNode.removeChild(e)),e.nodes={},void(e.scoreIndex={});const n=a(r,e,t);switch(r.type){case"KEYFRAME":-1===n.textContent.indexOf(r.keyframe)&&(n.textContent+=r.keyframe);break;case"FONT":-1===n.textContent.indexOf(r.fontFace)&&(n.textContent+=r.fontFace);break;case"STATIC":let t=r.selector?u(r.selector,r.css):r.css;-1===n.textContent.indexOf(t)&&(n.textContent+=t);break;case"RULE":O(r,e,n)}}}(e,t),e.subscribe(e.updateSubscription),o()(e.cache,e._emitChange))}var F=r(4),_=r.n(F);function C(e){return e.split("{")[0].slice(9).trim()}var T=r(5),j=r.n(T);function k(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";return o+n+r+j()(e)+t}function N(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"."+e+t}function S(e,t,r,n,o="",u="",s=""){return{type:e,className:t,selector:N(t,o),declaration:r+":"+n,pseudo:o,media:u,support:s}}const L=/[.]([0-9a-z_-]+)([^{]+)?{([^:]+):([^}]+)}/gi;function w(e,t="",r="",n={}){let o;for(;o=L.exec(e);){const[e,u,s,i,a]=o;n[k(i,a,s,t,r)]=S("RULE",u,i,a,s,t,r)}return n}const I=/@supports[^{]+\{([\s\S]+?})\s*}/gi;const U=/@(-webkit-|-moz-)?keyframes ([a-z_][a-z0-9-_]*)(\{.*?(?=}})}})/gi;const P=/[.][a-z0-9_-]*/gi;function $(e,t=document){E(e,t),_()(t.querySelectorAll("[data-fela-type]"),t=>{const r=t.getAttribute("data-fela-rehydration")||-1,n=e.uniqueRuleIdentifier||parseInt(r,10);if(-1!==n){const r=t.getAttribute("data-fela-type")||"",o=t.getAttribute("media")||"",u=t.getAttribute("data-fela-support")||"",s=t.textContent;e.uniqueRuleIdentifier=n;const i=r+o+u;if(e.nodes[i]=t,"RULE"===r){if(u?function(e,t="",r={}){let n;for(;n=I.exec(e);){const[e,o]=n;w(o,t,C(e),r)}}(s,o,e.cache):w(s,o,"",e.cache),t.sheet&&t.sheet.cssRules){const r=o+u;_()(t.sheet.cssRules,(t,n)=>{const o=t.conditionText?t.cssRules[0].selectorText:t.selectorText,u=c(e.ruleOrder,o.split(P)[1]);0===u&&(e.scoreIndex[r]=n),t.score=u})}}else"KEYFRAME"===r&&function(e,t={}){let r;for(;r=U.exec(e);){const[e,n,o,u]=r;t[u]?t[u].keyframe+=e:t[u]={type:"KEYFRAME",keyframe:e,name:o}}}(s,e.cache)}})}function z(e,t,r="",n=-1,o=!1,u={}){return`<style type="text/css" data-fela-rehydration="${n}" data-fela-type="${t}"${o?' data-fela-support="true"':""}${r.length>0?` media="${r}"`:""}${i()(u,(e,t,r)=>e+" "+r+'="'+t+'"',"")}>${e}</style>`}function q(e){const t=R(e.cache,e.ruleOrder),r=x(e);let n=i()(g,(n,o,u)=>(t[u].length>0&&(n+=z(t[u],o,"",r,!1,e.styleNodeAttributes)),n),"");const o=v(t.supportRules);o&&(n+=z(o,"RULE","",r,!0,e.styleNodeAttributes));const u=Object.keys({...t.supportMediaRules,...t.mediaRules}).sort(e.sortMediaQuery);return p()(u,(n,o)=>{if(t.mediaRules[o]&&t.mediaRules[o].length>0&&(n+=z(t.mediaRules[o],"RULE",o,r,!1,e.styleNodeAttributes)),t.supportMediaRules[o]){const u=v(t.supportMediaRules[o]);u.length>0&&(n+=z(u,"RULE",o,r,!0,e.styleNodeAttributes))}return n},n)}r.d(t,"render",(function(){return E})),r.d(t,"rehydrate",(function(){return $})),r.d(t,"renderToMarkup",(function(){return q})),r.d(t,"renderToSheetList",(function(){return M}))}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("FelaDOM",[],t):"object"==typeof exports?exports.FelaDOM=t():e.FelaDOM=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=6)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){for(var n in e)r=t(r,e[n],n,e);return r}},,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){for(var n=0,o=e.length;n<o;++n)r=t(r,e[n],n,o,e);return r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){for(var r in e)t(e[r],r,e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){for(var r=0,n=e.length;r<n;++r)t(e[r],r,n,e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(n,(function(e){return e[1].toUpperCase()})).replace(o,"ms")};var n=/-([a-z])/g,o=/^Ms/g;e.exports=t.default},function(e,t,r){"use strict";r.r(t);var n=r(3),o=r.n(n);function u(e,t){return e+"{"+t+"}"}var s=r(0),i=r.n(s);function a(e,t,r=document){const n=function({type:e,media:t="",support:r=""}){return e+t+r}(e);if(!t.nodes[n]){const o=function({type:e,media:t,support:r},n=document){const o=t?`[media="${t}"]`:":not([media])",u=r?'[data-fela-support="true"]':':not([data-fela-support="true"])';return n.querySelector(`[data-fela-type="${e}"]${u}${o}`)}(e,r)||function(e,t=document,r,n){const o=t.head||{},{type:u,media:s,support:i}=e,a=t.createElement("style");a.setAttribute("data-fela-type",u),a.type="text/css",i&&a.setAttribute("data-fela-support","true"),s&&(a.media=s);for(let e in n)a.setAttribute(e,n[e]);if(void 0!==typeof window&&window.FelaConfig)for(let e in window.FelaConfig.styleNodeAttributes)a.setAttribute(e,window.FelaConfig.styleNodeAttributes[e]);const c=function(e,{type:t,media:r,support:n},o){switch(t){case"FONT":case"STATIC":case"KEYFRAME":return e[0];case"RULE":const t=e.map(e=>e.media).filter(e=>0!==e.length);if(r){const u=[...t,r].sort(o),s=u.indexOf(r)+1,i=u[s];if(i)return i===r&&n?e.find(e=>e.media===u[u.indexOf(r)+2]):e.find(e=>e.media===i)}else{const r=t.sort(o)[0];if(!n){const t=e.find(e=>void 0!==e.getAttribute("data-fela-support")&&""===e.media&&"RULE"===e.getAttribute("data-fela-type"));if(t)return t}if(r)return e.find(e=>e.media===r)}}}([...o.querySelectorAll("[data-fela-type]")],e,r);return c?o.insertBefore(a,c):o.appendChild(a),a}(e,r,t.sortMediaQuery,t.styleNodeAttributes);t.nodes[n]=o}return t.nodes[n]}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return 0===e.length||0===t.length?0:e.indexOf(e.find((function(e){return null!==t.match(e)})))+1}function l(e,t){return"@supports "+e+"{"+t+"}"}var d,f=r(2),p=r.n(f);function y(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function m(e,t){var r=i()(e,(function(r,n,o){var u=function(e,t){for(var r=-1,n=0;n<e.length;n++)if(t(e[n])){r=n;break}return r}(r,(function(r){return t(e[r],r)>t(n,o)}));return-1!==u?function(e,t,r){return[].concat(y(e.slice(0,r)),[t],y(e.slice(r,e.length)))}(r,o,u):[].concat(function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(r),[o])}),[]);return p()(r,(function(t,r){return t[r]=e[r],t}),{})}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var h=(b(d={},"RULE",(function(e,t){var r=t.selector,n=t.declaration,o=t.support,s=t.media,i=u(r,n);o?s?(e.supportMediaRules[s]||(e.supportMediaRules[s]={}),e.supportMediaRules[s][o]||(e.supportMediaRules[s][o]=""),e.supportMediaRules[s][o]+=i):(e.supportRules[o]||(e.supportRules[o]=""),e.supportRules[o]+=i):s?(e.mediaRules[s]||(e.mediaRules[s]=""),e.mediaRules[s]+=i):e.rules+=i})),b(d,"FONT",(function(e,t){var r=t.fontFace;e.fontFaces+=r})),b(d,"KEYFRAME",(function(e,t){var r=t.keyframe;e.keyframes+=r})),b(d,"STATIC",(function(e,t){var r=t.css,n=t.selector;e.statics+=n?u(n,r):r})),d);function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=m(e,(function(e){return c(t,e.pseudo)}));return i()(r,(function(e,t){var r=h[t.type];return r&&r(e,t),e}),{mediaRules:{},supportRules:{},supportMediaRules:{},fontFaces:"",statics:"",keyframes:"",rules:""})}var g={fontFaces:"FONT",statics:"STATIC",keyframes:"KEYFRAME",rules:"RULE"};function v(e){return i()(e,(function(e,t,r){return t.length>0&&(e+=l(r,t)),e}),"")}const x=/^[a-z0-9_-]*$/gi;function A(e){return 0===e.selectorPrefix.length||null!==e.selectorPrefix.match(x)?e.uniqueRuleIdentifier:-1}function M(e){const t=R(e.cache,e.ruleOrder),r=A(e),n=i()(g,(n,o,u)=>(t[u].length>0&&n.push({css:t[u],rehydration:r,attributes:e.styleNodeAttributes,type:o}),n),[]),o=v(t.supportRules);o&&n.push({css:o,type:"RULE",rehydration:r,attributes:e.styleNodeAttributes,support:!0});const u=Object.keys({...t.supportMediaRules,...t.mediaRules}).sort(e.sortMediaQuery);return p()(u,(n,o)=>{if(t.mediaRules[o]&&t.mediaRules[o].length>0&&n.push({css:t.mediaRules[o],type:"RULE",rehydration:r,attributes:e.styleNodeAttributes,media:o}),t.supportMediaRules[o]){const u=v(t.supportMediaRules[o]);u.length>0&&n.push({css:u,type:"RULE",rehydration:r,attributes:e.styleNodeAttributes,support:!0,media:o})}return n},n)}function O({selector:e,declaration:t,support:r,media:n,pseudo:o},s,i){const a=n+r;if(s.devMode)!function(e,t){const r=M(e),n=t.getAttribute("media")||void 0,o=!!t.getAttribute("data-fela-support")||void 0,u=r.find(e=>"RULE"===e.type&&e.media===n&&e.support===o);u&&(t.textContent=u.css)}(s,i);else try{const n=c(s.ruleOrder,o),{cssRules:d}=i.sheet;let f=d.length;if(0===n)f=void 0===s.scoreIndex[a]?0:s.scoreIndex[a]+1;else{for(let e=s.scoreIndex[a]||0,t=d.length;e<t;++e)if(d[e].score>n){f=e;break}}const p=u(e,t);if(r.length>0){const e=l(r,p);i.sheet.insertRule(e,f)}else i.sheet.insertRule(p,f);0===n&&(s.scoreIndex[a]=f),d[f].score=n}catch(e){}}function E(e,t){e.updateSubscription||(e.scoreIndex={},e.nodes={},e.updateSubscription=function(e,t=document){return r=>{if("CLEAR"===r.type)return o()(e.nodes,e=>e.parentNode.removeChild(e)),e.nodes={},void(e.scoreIndex={});const n=a(r,e,t);switch(r.type){case"KEYFRAME":-1===n.textContent.indexOf(r.keyframe)&&(n.textContent+=r.keyframe);break;case"FONT":-1===n.textContent.indexOf(r.fontFace)&&(n.textContent+=r.fontFace);break;case"STATIC":let t=r.selector?u(r.selector,r.css):r.css;-1===n.textContent.indexOf(t)&&(n.textContent+=t);break;case"RULE":O(r,e,n)}}}(e,t),e.subscribe(e.updateSubscription),o()(e.cache,e._emitChange))}var F=r(4),_=r.n(F);function C(e){return e.split("{")[0].slice(9).trim()}var T=r(5),j=r.n(T);function k(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";return o+n+r+j()(e)+t}function N(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return r+"."+e+t}function S(e,t,r,n,o="",u="",s="",i=""){return{type:e,className:t,selector:N(t,o,i),declaration:r+":"+n,pseudo:o,media:u,support:s}}function w(e,t="",r="",n={},o=""){let u;const s=new RegExp(`${i=o,i.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}[.]([0-9a-z_-]+)([^{]+)?{([^:]+):([^}]+)}`,"gi");for(var i;u=s.exec(e);){const[e,s,i,a,c]=u;n[k(a,c,i,t,r)]=S("RULE",s,a,c,i,t,r,o)}return n}const L=/@supports[^{]+\{([\s\S]+?})\s*}/gi;const I=/@(-webkit-|-moz-)?keyframes ([a-z_][a-z0-9-_]*)(\{.*?(?=}})}})/gi;const P=/[.][a-z0-9_-]*/gi;function U(e,t=document){E(e,t),_()(t.querySelectorAll("[data-fela-type]"),t=>{const r=t.getAttribute("data-fela-rehydration")||-1,n=e.uniqueRuleIdentifier||parseInt(r,10);if(-1!==n){const r=t.getAttribute("data-fela-type")||"",o=t.getAttribute("media")||"",u=t.getAttribute("data-fela-support")||"",s=t.textContent;e.uniqueRuleIdentifier=n;const i=r+o+u;if(e.nodes[i]=t,"RULE"===r){if(u?function(e,t="",r={},n=""){let o;for(;o=L.exec(e);){const[e,u]=o;w(u,t,C(e),r,n)}}(s,o,e.cache,e.specificityPrefix):w(s,o,"",e.cache,e.specificityPrefix),t.sheet&&t.sheet.cssRules){const r=o+u;_()(t.sheet.cssRules,(t,n)=>{const o=t.conditionText?t.cssRules[0].selectorText:t.selectorText,u=c(e.ruleOrder,o.split(P)[1]);0===u&&(e.scoreIndex[r]=n),t.score=u})}}else"KEYFRAME"===r&&function(e,t={}){let r;for(;r=I.exec(e);){const[e,n,o,u]=r;t[u]?t[u].keyframe+=e:t[u]={type:"KEYFRAME",keyframe:e,name:o}}}(s,e.cache)}})}function $(e,t,r="",n=-1,o=!1,u={}){return`<style type="text/css" data-fela-rehydration="${n}" data-fela-type="${t}"${o?' data-fela-support="true"':""}${r.length>0?` media="${r}"`:""}${i()(u,(e,t,r)=>e+" "+r+'="'+t+'"',"")}>${e}</style>`}function z(e){const t=R(e.cache,e.ruleOrder),r=A(e);let n=i()(g,(n,o,u)=>(t[u].length>0&&(n+=$(t[u],o,"",r,!1,e.styleNodeAttributes)),n),"");const o=v(t.supportRules);o&&(n+=$(o,"RULE","",r,!0,e.styleNodeAttributes));const u=Object.keys({...t.supportMediaRules,...t.mediaRules}).sort(e.sortMediaQuery);return p()(u,(n,o)=>{if(t.mediaRules[o]&&t.mediaRules[o].length>0&&(n+=$(t.mediaRules[o],"RULE",o,r,!1,e.styleNodeAttributes)),t.supportMediaRules[o]){const u=v(t.supportMediaRules[o]);u.length>0&&(n+=$(u,"RULE",o,r,!0,e.styleNodeAttributes))}return n},n)}r.d(t,"render",(function(){return E})),r.d(t,"rehydrate",(function(){return U})),r.d(t,"renderToMarkup",(function(){return z})),r.d(t,"renderToSheetList",(function(){return M}))}])})); |
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
76629
1395
Updatedfela-utils@^11.4.0