Comparing version 11.4.0 to 11.5.0-rc.0
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"); } }; }(); | ||
import { RULE_TYPE, generateDeclarationReference } from 'fela-utils'; | ||
import { camelCaseProperty } from 'css-in-js-utils'; | ||
@@ -35,3 +36,3 @@ import generateCacheEntry from './generateCacheEntry'; | ||
var declarationReference = generateDeclarationReference(property, value, pseudo, media, support); | ||
var declarationReference = generateDeclarationReference(camelCaseProperty(property), value, pseudo, media, support); | ||
@@ -38,0 +39,0 @@ cache[declarationReference] = generateCacheEntry(RULE_TYPE, className, property, value, pseudo, media, support, specificityPrefix); |
@@ -13,2 +13,4 @@ 'use strict'; | ||
var _cssInJsUtils = require('css-in-js-utils'); | ||
var _generateCacheEntry = require('./generateCacheEntry'); | ||
@@ -48,3 +50,3 @@ | ||
var declarationReference = (0, _felaUtils.generateDeclarationReference)(property, value, pseudo, media, support); | ||
var declarationReference = (0, _felaUtils.generateDeclarationReference)((0, _cssInJsUtils.camelCaseProperty)(property), value, pseudo, media, support); | ||
@@ -51,0 +53,0 @@ cache[declarationReference] = (0, _generateCacheEntry2.default)(_felaUtils.RULE_TYPE, className, property, value, pseudo, media, support, specificityPrefix); |
{ | ||
"name": "fela-dom", | ||
"version": "11.4.0", | ||
"version": "11.5.0-rc.0", | ||
"description": "Fela package for working with the DOM", | ||
@@ -33,11 +33,11 @@ "main": "lib/index.js", | ||
"fast-loops": "^1.0.1", | ||
"fela-utils": "^11.4.0", | ||
"fela-utils": "^11.5.0-rc.0", | ||
"sort-css-media-queries": "^1.4.3" | ||
}, | ||
"devDependencies": { | ||
"fela": "^11.4.0", | ||
"fela-preset-web": "^11.4.0", | ||
"fela-tools": "^11.4.0" | ||
"fela": "^11.5.0-rc.0", | ||
"fela-preset-web": "^11.5.0-rc.0", | ||
"fela-tools": "^11.5.0-rc.0" | ||
}, | ||
"gitHead": "94e23ad2fda221aea52ccb939d90f81eb400b5fb" | ||
"gitHead": "6d457d39e69e1471bddaea8591c50745f95070d9" | ||
} |
@@ -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 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}))}])})); | ||
!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=5)}([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";r.r(t),r.d(t,"render",(function(){return E})),r.d(t,"rehydrate",(function(){return q})),r.d(t,"renderToMarkup",(function(){return Y})),r.d(t,"renderToSheetList",(function(){return M}));var n=r(3),o=r.n(n);function u(e,t){return e+"{"+t+"}"}function s(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 i(){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 a(e,t){return"@supports "+e+"{"+t+"}"}var c,l=r(2),d=r.n(l),f=r(0),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=p()(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 d()(r,(function(t,r){return t[r]=e[r],t}),{})}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b=(h(c={},"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})),h(c,"FONT",(function(e,t){var r=t.fontFace;e.fontFaces+=r})),h(c,"KEYFRAME",(function(e,t){var r=t.keyframe;e.keyframes+=r})),h(c,"STATIC",(function(e,t){var r=t.css,n=t.selector;e.statics+=n?u(n,r):r})),c);function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=m(e,(function(e){return i(t,e.pseudo)}));return p()(r,(function(e,t){var r=b[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 p()(e,(function(e,t,r){return t.length>0&&(e+=a(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=p()(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 d()(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,c){const l=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,c);else try{const n=i(s.ruleOrder,o),{cssRules:d}=c.sheet;let f=d.length;if(0===n)f=void 0===s.scoreIndex[l]?0:s.scoreIndex[l]+1;else{for(let e=s.scoreIndex[l]||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=a(r,p);c.sheet.insertRule(e,f)}else c.sheet.insertRule(p,f);0===n&&(s.scoreIndex[l]=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=s(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),C=r.n(F);function _(e){return e.split("{")[0].slice(9).trim()}function T(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+e+t}var k=/-([a-z])/g,j=/^Ms/g,w={};function N(e){return e[1].toUpperCase()}function S(e){if(w.hasOwnProperty(e))return w[e];var t=e.replace(k,N).replace(j,"ms");return w[e]=t,t}function L(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 I(e,t,r,n,o="",u="",s="",i=""){return{type:e,className:t,selector:L(t,o,i),declaration:r+":"+n,pseudo:o,media:u,support:s}}function P(e,t="",r="",n={},o=""){let u;const s=new RegExp(o.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")+"[.]([0-9a-z_-]+)([^{]+)?{([^:]+):([^}]+)}","gi");for(;u=s.exec(e);){const[e,s,i,a,c]=u;n[T(S(a),c,i,t,r)]=I("RULE",s,a,c,i,t,r,o)}return n}const U=/@supports[^{]+\{([\s\S]+?})\s*}/gi;const $=/@(-webkit-|-moz-)?keyframes ([a-z_][a-z0-9-_]*)(\{.*?(?=}})}})/gi;const z=/[.][a-z0-9_-]*/gi;function q(e,t=document){E(e,t),C()(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 a=r+o+u;if(e.nodes[a]=t,"RULE"===r){if(u?function(e,t="",r={},n=""){let o;for(;o=U.exec(e);){const[e,u]=o;P(u,t,_(e),r,n)}}(s,o,e.cache,e.specificityPrefix):P(s,o,"",e.cache,e.specificityPrefix),t.sheet&&t.sheet.cssRules){const r=o+u;C()(t.sheet.cssRules,(t,n)=>{const o=t.conditionText?t.cssRules[0].selectorText:t.selectorText,u=i(e.ruleOrder,o.split(z)[1]);0===u&&(e.scoreIndex[r]=n),t.score=u})}}else"KEYFRAME"===r&&function(e,t={}){let r;for(;r=$.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 K(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}"`:""}${p()(u,(e,t,r)=>e+" "+r+'="'+t+'"',"")}>${e}</style>`}function Y(e){const t=R(e.cache,e.ruleOrder),r=x(e);let n=p()(g,(n,o,u)=>(t[u].length>0&&(n+=K(t[u],o,"",r,!1,e.styleNodeAttributes)),n),"");const o=v(t.supportRules);o&&(n+=K(o,"RULE","",r,!0,e.styleNodeAttributes));const u=Object.keys({...t.supportMediaRules,...t.mediaRules}).sort(e.sortMediaQuery);return d()(u,(n,o)=>{if(t.mediaRules[o]&&t.mediaRules[o].length>0&&(n+=K(t.mediaRules[o],"RULE",o,r,!1,e.styleNodeAttributes)),t.supportMediaRules[o]){const u=v(t.supportMediaRules[o]);u.length>0&&(n+=K(u,"RULE",o,r,!0,e.styleNodeAttributes))}return n},n)}}])})); |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
71799
48
1251
2
Updatedfela-utils@^11.5.0-rc.0