@emotion/utils
Advanced tools
Comparing version 0.11.3 to 1.0.0-next.0
# @emotion/utils | ||
## 1.0.0-next.0 | ||
### Major Changes | ||
- [`9e998e37`](https://github.com/emotion-js/emotion/commit/9e998e3755c217027ad1be0af4c64644fe14c6bf) [#1817](https://github.com/emotion-js/emotion/pull/1817) Thanks [@Andarist](https://github.com/Andarist)! - `insertStyles` no longer calls `cache.insert` with a scoped class name as a selector when inserting keyframes. The change is internal and has no effect on Emotion users. | ||
## 0.11.3 | ||
@@ -4,0 +10,0 @@ |
@@ -10,3 +10,3 @@ 'use strict'; | ||
if (registered[className] !== undefined) { | ||
registeredStyles.push(registered[className]); | ||
registeredStyles.push(registered[className] + ";"); | ||
} else { | ||
@@ -38,3 +38,3 @@ rawClassName += className + " "; | ||
do { | ||
var maybeStyles = cache.insert("." + className, current, cache.sheet, true); | ||
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true); | ||
@@ -41,0 +41,0 @@ current = current.next; |
@@ -6,3 +6,3 @@ var isBrowser = "object" !== 'undefined'; | ||
if (registered[className] !== undefined) { | ||
registeredStyles.push(registered[className]); | ||
registeredStyles.push(registered[className] + ";"); | ||
} else { | ||
@@ -34,3 +34,3 @@ rawClassName += className + " "; | ||
do { | ||
var maybeStyles = cache.insert("." + className, current, cache.sheet, true); | ||
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true); | ||
@@ -37,0 +37,0 @@ current = current.next; |
@@ -10,3 +10,3 @@ 'use strict'; | ||
if (registered[className] !== undefined) { | ||
registeredStyles.push(registered[className]); | ||
registeredStyles.push(registered[className] + ";"); | ||
} else { | ||
@@ -39,3 +39,3 @@ rawClassName += className + " "; | ||
do { | ||
var maybeStyles = cache.insert("." + className, current, cache.sheet, true); | ||
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true); | ||
@@ -42,0 +42,0 @@ if (!isBrowser && maybeStyles !== undefined) { |
@@ -11,5 +11,5 @@ "use strict"; | ||
var rawClassName = ""; | ||
return classNames.split(" ").forEach(function(className) { | ||
void 0 !== registered[className] ? registeredStyles.push(registered[className]) : rawClassName += className + " "; | ||
}), rawClassName; | ||
return classNames.split(" ").forEach((function(className) { | ||
void 0 !== registered[className] ? registeredStyles.push(registered[className] + ";") : rawClassName += className + " "; | ||
})), rawClassName; | ||
} | ||
@@ -23,3 +23,3 @@ | ||
do { | ||
var maybeStyles = cache.insert("." + className, current, cache.sheet, !0); | ||
var maybeStyles = cache.insert(serialized === current ? "." + className : "", current, cache.sheet, !0); | ||
isBrowser || void 0 === maybeStyles || (stylesForSSR += maybeStyles), current = current.next; | ||
@@ -26,0 +26,0 @@ } while (void 0 !== current); |
@@ -6,3 +6,3 @@ var isBrowser = typeof document !== 'undefined'; | ||
if (registered[className] !== undefined) { | ||
registeredStyles.push(registered[className]); | ||
registeredStyles.push(registered[className] + ";"); | ||
} else { | ||
@@ -35,3 +35,3 @@ rawClassName += className + " "; | ||
do { | ||
var maybeStyles = cache.insert("." + className, current, cache.sheet, true); | ||
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true); | ||
@@ -38,0 +38,0 @@ if (!isBrowser && maybeStyles !== undefined) { |
{ | ||
"name": "@emotion/utils", | ||
"version": "0.11.3", | ||
"version": "1.0.0-next.0", | ||
"description": "internal utils for emotion", | ||
@@ -16,3 +16,3 @@ "main": "dist/utils.cjs.js", | ||
}, | ||
"repository": "https://github.com/emotion-js/emotion/tree/master/packages/serialize", | ||
"repository": "https://github.com/emotion-js/emotion/tree/master/packages/utils", | ||
"publishConfig": { | ||
@@ -24,3 +24,3 @@ "access": "public" | ||
"dist", | ||
"types" | ||
"types/*.d.ts" | ||
], | ||
@@ -27,0 +27,0 @@ "devDependencies": { |
// @flow | ||
import type { RegisteredCache, EmotionCache, SerializedStyles } from './types' | ||
let isBrowser = typeof document !== 'undefined' | ||
const isBrowser = typeof document !== 'undefined' | ||
@@ -15,3 +15,3 @@ export function getRegisteredStyles( | ||
if (registered[className] !== undefined) { | ||
registeredStyles.push(registered[className]) | ||
registeredStyles.push(`${registered[className]};`) | ||
} else { | ||
@@ -51,3 +51,3 @@ rawClassName += `${className} ` | ||
let maybeStyles = cache.insert( | ||
`.${className}`, | ||
serialized === current ? `.${className}` : '', | ||
current, | ||
@@ -54,0 +54,0 @@ cache.sheet, |
// @flow | ||
/*:: | ||
import { StyleSheet } from '@emotion/sheet' | ||
import type { StyleSheet } from '@emotion/sheet' | ||
*/ | ||
export type RegisteredCache = { [string]: string } | ||
@@ -8,0 +5,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
14822
13
316