@emotion/cache
Advanced tools
Comparing version 0.4.1 to 0.5.0
@@ -73,2 +73,24 @@ 'use strict'; | ||
var createCache = function createCache() { | ||
var inserted = {}; | ||
function _ref(id) { | ||
inserted[id] = true; | ||
} | ||
function _ref2(node) { | ||
var attrib = node.getAttribute('data-emotion-ssr'); // $FlowFixMe | ||
attrib.split(' ').forEach(_ref); | ||
if (node.parentNode !== document.head) { | ||
// $FlowFixMe | ||
document.head.appendChild(node); | ||
} | ||
} | ||
if (utils.isBrowser) { | ||
var nodes = document.querySelectorAll('style[data-emotion-ssr]'); | ||
Array.prototype.forEach.call(nodes, _ref2); | ||
} | ||
var context = { | ||
@@ -79,3 +101,3 @@ stylis: stylis, | ||
}), | ||
inserted: {}, | ||
inserted: inserted, | ||
registered: {}, | ||
@@ -82,0 +104,0 @@ theme: {} |
@@ -71,2 +71,24 @@ import { Stylis } from 'emotion-utils'; | ||
var createCache = function createCache() { | ||
var inserted = {}; | ||
function _ref(id) { | ||
inserted[id] = true; | ||
} | ||
function _ref2(node) { | ||
var attrib = node.getAttribute('data-emotion-ssr'); // $FlowFixMe | ||
attrib.split(' ').forEach(_ref); | ||
if (node.parentNode !== document.head) { | ||
// $FlowFixMe | ||
document.head.appendChild(node); | ||
} | ||
} | ||
if (isBrowser) { | ||
var nodes = document.querySelectorAll('style[data-emotion-ssr]'); | ||
Array.prototype.forEach.call(nodes, _ref2); | ||
} | ||
var context = { | ||
@@ -77,3 +99,3 @@ stylis: stylis, | ||
}), | ||
inserted: {}, | ||
inserted: inserted, | ||
registered: {}, | ||
@@ -80,0 +102,0 @@ theme: {} |
{ | ||
"name": "@emotion/cache", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "emotion's cache", | ||
@@ -11,5 +11,5 @@ "main": "dist/index.cjs.js", | ||
"@emotion/sheet": "^0.2.0", | ||
"@emotion/types": "^0.2.3", | ||
"@emotion/utils": "^0.4.1", | ||
"emotion-utils": "^9.0.1" | ||
"@emotion/types": "^0.5.0", | ||
"@emotion/utils": "^0.5.0", | ||
"emotion-utils": "^9.1.0" | ||
}, | ||
@@ -16,0 +16,0 @@ "publishConfig": { |
@@ -8,6 +8,23 @@ // @flow | ||
const createCache = () => { | ||
let inserted = {} | ||
if (isBrowser) { | ||
const nodes = document.querySelectorAll('style[data-emotion-ssr]') | ||
Array.prototype.forEach.call(nodes, (node: HTMLStyleElement) => { | ||
const attrib = node.getAttribute('data-emotion-ssr') | ||
// $FlowFixMe | ||
attrib.split(' ').forEach(id => { | ||
inserted[id] = true | ||
}) | ||
if (node.parentNode !== document.head) { | ||
// $FlowFixMe | ||
document.head.appendChild(node) | ||
} | ||
}) | ||
} | ||
const context: CSSContextType = { | ||
stylis, | ||
sheet: new StyleSheet({ key: '' }), | ||
inserted: {}, | ||
inserted, | ||
registered: {}, | ||
@@ -14,0 +31,0 @@ theme: {} |
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
16941
286
+ Added@emotion/types@0.5.0(transitive)
+ Added@emotion/utils@0.5.0(transitive)
- Removed@emotion/types@0.2.3(transitive)
- Removed@emotion/utils@0.4.1(transitive)
Updated@emotion/types@^0.5.0
Updated@emotion/utils@^0.5.0
Updatedemotion-utils@^9.1.0