@bumbag/create-emotion
Advanced tools
Comparing version 10.0.27-0 to 10.0.27-1
@@ -1,15 +0,152 @@ | ||
// 👋 hey!! | ||
// you might be reading this and seeing .esm in the filename | ||
// and being confused why there is commonjs below this filename | ||
// DON'T WORRY! | ||
// this is intentional | ||
// it's only commonjs with `preconstruct dev` | ||
// when you run `preconstruct build`, it will be ESM | ||
// why is it commonjs? | ||
// we need to re-export every export from the source file | ||
// but we can't do that with ESM without knowing what the exports are (because default exports aren't included in export/import *) | ||
// and they could change after running `preconstruct dev` so we can't look at the file without forcing people to | ||
// run preconstruct dev again which wouldn't be ideal | ||
// this solution could change but for now, it's working | ||
'use strict'; | ||
module.exports = require("../src/index.js") | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var createCache = require('@emotion/cache'); | ||
var serialize = require('@emotion/serialize'); | ||
var utils = require('@emotion/utils'); | ||
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } | ||
var createCache__default = /*#__PURE__*/_interopDefault(createCache); | ||
function insertWithoutScoping(cache, serialized) { | ||
if (cache.inserted[serialized.name] === undefined) { | ||
return cache.insert('', serialized, cache.sheet, true); | ||
} | ||
} | ||
function merge(registered, css, className) { | ||
var registeredStyles = []; | ||
var rawClassName = utils.getRegisteredStyles(registered, registeredStyles, className); | ||
if (registeredStyles.length < 2) { | ||
return className; | ||
} | ||
return rawClassName + css(registeredStyles); | ||
} | ||
var createEmotion = function createEmotion(options) { | ||
var cache = createCache__default['default'](options); // $FlowFixMe | ||
cache.sheet.speedy = function (value) { | ||
if (process.env.NODE_ENV !== 'production' && this.ctr !== 0) { | ||
throw new Error('speedy must be changed before any rules are inserted'); | ||
} | ||
this.isSpeedy = value; | ||
}; | ||
cache.compat = true; | ||
var css = function css() { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
var serialized = serialize.serializeStyles(args, cache.registered, undefined); | ||
utils.insertStyles(cache, serialized, false); | ||
return cache.key + "-" + serialized.name; | ||
}; | ||
var keyframes = function keyframes() { | ||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
var serialized = serialize.serializeStyles(args, cache.registered); | ||
var animation = "animation-" + serialized.name; | ||
insertWithoutScoping(cache, { | ||
name: serialized.name, | ||
styles: "@keyframes " + animation + "{" + serialized.styles + "}" | ||
}); | ||
return animation; | ||
}; | ||
var injectGlobal = function injectGlobal() { | ||
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | ||
args[_key3] = arguments[_key3]; | ||
} | ||
var serialized = serialize.serializeStyles(args, cache.registered); | ||
insertWithoutScoping(cache, serialized); | ||
}; | ||
var cx = function cx() { | ||
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { | ||
args[_key4] = arguments[_key4]; | ||
} | ||
return merge(cache.registered, css, classnames(args)); | ||
}; | ||
return { | ||
css: css, | ||
cx: cx, | ||
injectGlobal: injectGlobal, | ||
keyframes: keyframes, | ||
hydrate: function hydrate(ids) { | ||
ids.forEach(function (key) { | ||
cache.inserted[key] = true; | ||
}); | ||
}, | ||
flush: function flush() { | ||
cache.registered = {}; | ||
cache.inserted = {}; | ||
cache.sheet.flush(); | ||
}, | ||
// $FlowFixMe | ||
sheet: cache.sheet, | ||
cache: cache, | ||
getRegisteredStyles: utils.getRegisteredStyles.bind(null, cache.registered), | ||
merge: merge.bind(null, cache.registered, css) | ||
}; | ||
}; | ||
var classnames = function classnames(args) { | ||
var cls = ''; | ||
for (var i = 0; i < args.length; i++) { | ||
var arg = args[i]; | ||
if (arg == null) continue; | ||
var toAdd = void 0; | ||
switch (typeof arg) { | ||
case 'boolean': | ||
break; | ||
case 'object': | ||
{ | ||
if (Array.isArray(arg)) { | ||
toAdd = classnames(arg); | ||
} else { | ||
toAdd = ''; | ||
for (var k in arg) { | ||
if (arg[k] && k) { | ||
toAdd && (toAdd += ' '); | ||
toAdd += k; | ||
} | ||
} | ||
} | ||
break; | ||
} | ||
default: | ||
{ | ||
toAdd = arg; | ||
} | ||
} | ||
if (toAdd) { | ||
cls && (cls += ' '); | ||
cls += toAdd; | ||
} | ||
} | ||
return cls; | ||
}; | ||
exports.default = createEmotion; |
@@ -1,15 +0,144 @@ | ||
// 👋 hey!! | ||
// you might be reading this and seeing .esm in the filename | ||
// and being confused why there is commonjs below this filename | ||
// DON'T WORRY! | ||
// this is intentional | ||
// it's only commonjs with `preconstruct dev` | ||
// when you run `preconstruct build`, it will be ESM | ||
// why is it commonjs? | ||
// we need to re-export every export from the source file | ||
// but we can't do that with ESM without knowing what the exports are (because default exports aren't included in export/import *) | ||
// and they could change after running `preconstruct dev` so we can't look at the file without forcing people to | ||
// run preconstruct dev again which wouldn't be ideal | ||
// this solution could change but for now, it's working | ||
import createCache from '@emotion/cache'; | ||
import { serializeStyles } from '@emotion/serialize'; | ||
import { getRegisteredStyles, insertStyles } from '@emotion/utils'; | ||
module.exports = require("../src/index.js") | ||
function insertWithoutScoping(cache, serialized) { | ||
if (cache.inserted[serialized.name] === undefined) { | ||
return cache.insert('', serialized, cache.sheet, true); | ||
} | ||
} | ||
function merge(registered, css, className) { | ||
var registeredStyles = []; | ||
var rawClassName = getRegisteredStyles(registered, registeredStyles, className); | ||
if (registeredStyles.length < 2) { | ||
return className; | ||
} | ||
return rawClassName + css(registeredStyles); | ||
} | ||
var createEmotion = function createEmotion(options) { | ||
var cache = createCache(options); // $FlowFixMe | ||
cache.sheet.speedy = function (value) { | ||
if (process.env.NODE_ENV !== 'production' && this.ctr !== 0) { | ||
throw new Error('speedy must be changed before any rules are inserted'); | ||
} | ||
this.isSpeedy = value; | ||
}; | ||
cache.compat = true; | ||
var css = function css() { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
var serialized = serializeStyles(args, cache.registered, undefined); | ||
insertStyles(cache, serialized, false); | ||
return cache.key + "-" + serialized.name; | ||
}; | ||
var keyframes = function keyframes() { | ||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
var serialized = serializeStyles(args, cache.registered); | ||
var animation = "animation-" + serialized.name; | ||
insertWithoutScoping(cache, { | ||
name: serialized.name, | ||
styles: "@keyframes " + animation + "{" + serialized.styles + "}" | ||
}); | ||
return animation; | ||
}; | ||
var injectGlobal = function injectGlobal() { | ||
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | ||
args[_key3] = arguments[_key3]; | ||
} | ||
var serialized = serializeStyles(args, cache.registered); | ||
insertWithoutScoping(cache, serialized); | ||
}; | ||
var cx = function cx() { | ||
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { | ||
args[_key4] = arguments[_key4]; | ||
} | ||
return merge(cache.registered, css, classnames(args)); | ||
}; | ||
return { | ||
css: css, | ||
cx: cx, | ||
injectGlobal: injectGlobal, | ||
keyframes: keyframes, | ||
hydrate: function hydrate(ids) { | ||
ids.forEach(function (key) { | ||
cache.inserted[key] = true; | ||
}); | ||
}, | ||
flush: function flush() { | ||
cache.registered = {}; | ||
cache.inserted = {}; | ||
cache.sheet.flush(); | ||
}, | ||
// $FlowFixMe | ||
sheet: cache.sheet, | ||
cache: cache, | ||
getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered), | ||
merge: merge.bind(null, cache.registered, css) | ||
}; | ||
}; | ||
var classnames = function classnames(args) { | ||
var cls = ''; | ||
for (var i = 0; i < args.length; i++) { | ||
var arg = args[i]; | ||
if (arg == null) continue; | ||
var toAdd = void 0; | ||
switch (typeof arg) { | ||
case 'boolean': | ||
break; | ||
case 'object': | ||
{ | ||
if (Array.isArray(arg)) { | ||
toAdd = classnames(arg); | ||
} else { | ||
toAdd = ''; | ||
for (var k in arg) { | ||
if (arg[k] && k) { | ||
toAdd && (toAdd += ' '); | ||
toAdd += k; | ||
} | ||
} | ||
} | ||
break; | ||
} | ||
default: | ||
{ | ||
toAdd = arg; | ||
} | ||
} | ||
if (toAdd) { | ||
cls && (cls += ' '); | ||
cls += toAdd; | ||
} | ||
} | ||
return cls; | ||
}; | ||
export default createEmotion; |
@@ -1,21 +0,7 @@ | ||
"use strict"; | ||
// this file might look strange and you might be wondering what it's for | ||
// it's lets you import your source files by importing this entrypoint | ||
// as you would import it if it was built with preconstruct build | ||
// this file is slightly different to some others though | ||
// it has a require hook which compiles your code with Babel | ||
// this means that you don't have to set up @babel/register or anything like that | ||
// but you can still require this module and it'll be compiled | ||
'use strict'; | ||
const path = require("path"); | ||
// this bit of code imports the require hook and registers it | ||
let unregister = require("../../../node_modules/@preconstruct/hook/dist/hook.cjs.js").___internalHook(path.resolve(__dirname, "../../.."), path.resolve(__dirname, "..")); | ||
// this re-exports the source file | ||
module.exports = require("../src/index.js"); | ||
// this unregisters the require hook so that any modules required after this one | ||
// aren't compiled with the require hook in case you have some other require hook | ||
// or something that should be used on other modules | ||
unregister(); | ||
if (process.env.NODE_ENV === "production") { | ||
module.exports = require("./create-emotion.cjs.prod.js"); | ||
} else { | ||
module.exports = require("./create-emotion.cjs.dev.js"); | ||
} |
@@ -1,15 +0,144 @@ | ||
// 👋 hey!! | ||
// you might be reading this and seeing .esm in the filename | ||
// and being confused why there is commonjs below this filename | ||
// DON'T WORRY! | ||
// this is intentional | ||
// it's only commonjs with `preconstruct dev` | ||
// when you run `preconstruct build`, it will be ESM | ||
// why is it commonjs? | ||
// we need to re-export every export from the source file | ||
// but we can't do that with ESM without knowing what the exports are (because default exports aren't included in export/import *) | ||
// and they could change after running `preconstruct dev` so we can't look at the file without forcing people to | ||
// run preconstruct dev again which wouldn't be ideal | ||
// this solution could change but for now, it's working | ||
import createCache from '@emotion/cache'; | ||
import { serializeStyles } from '@emotion/serialize'; | ||
import { getRegisteredStyles, insertStyles } from '@emotion/utils'; | ||
module.exports = require("../src/index.js") | ||
function insertWithoutScoping(cache, serialized) { | ||
if (cache.inserted[serialized.name] === undefined) { | ||
return cache.insert('', serialized, cache.sheet, true); | ||
} | ||
} | ||
function merge(registered, css, className) { | ||
var registeredStyles = []; | ||
var rawClassName = getRegisteredStyles(registered, registeredStyles, className); | ||
if (registeredStyles.length < 2) { | ||
return className; | ||
} | ||
return rawClassName + css(registeredStyles); | ||
} | ||
var createEmotion = function createEmotion(options) { | ||
var cache = createCache(options); // $FlowFixMe | ||
cache.sheet.speedy = function (value) { | ||
if (process.env.NODE_ENV !== 'production' && this.ctr !== 0) { | ||
throw new Error('speedy must be changed before any rules are inserted'); | ||
} | ||
this.isSpeedy = value; | ||
}; | ||
cache.compat = true; | ||
var css = function css() { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
var serialized = serializeStyles(args, cache.registered, undefined); | ||
insertStyles(cache, serialized, false); | ||
return cache.key + "-" + serialized.name; | ||
}; | ||
var keyframes = function keyframes() { | ||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
var serialized = serializeStyles(args, cache.registered); | ||
var animation = "animation-" + serialized.name; | ||
insertWithoutScoping(cache, { | ||
name: serialized.name, | ||
styles: "@keyframes " + animation + "{" + serialized.styles + "}" | ||
}); | ||
return animation; | ||
}; | ||
var injectGlobal = function injectGlobal() { | ||
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | ||
args[_key3] = arguments[_key3]; | ||
} | ||
var serialized = serializeStyles(args, cache.registered); | ||
insertWithoutScoping(cache, serialized); | ||
}; | ||
var cx = function cx() { | ||
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { | ||
args[_key4] = arguments[_key4]; | ||
} | ||
return merge(cache.registered, css, classnames(args)); | ||
}; | ||
return { | ||
css: css, | ||
cx: cx, | ||
injectGlobal: injectGlobal, | ||
keyframes: keyframes, | ||
hydrate: function hydrate(ids) { | ||
ids.forEach(function (key) { | ||
cache.inserted[key] = true; | ||
}); | ||
}, | ||
flush: function flush() { | ||
cache.registered = {}; | ||
cache.inserted = {}; | ||
cache.sheet.flush(); | ||
}, | ||
// $FlowFixMe | ||
sheet: cache.sheet, | ||
cache: cache, | ||
getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered), | ||
merge: merge.bind(null, cache.registered, css) | ||
}; | ||
}; | ||
var classnames = function classnames(args) { | ||
var cls = ''; | ||
for (var i = 0; i < args.length; i++) { | ||
var arg = args[i]; | ||
if (arg == null) continue; | ||
var toAdd = void 0; | ||
switch (typeof arg) { | ||
case 'boolean': | ||
break; | ||
case 'object': | ||
{ | ||
if (Array.isArray(arg)) { | ||
toAdd = classnames(arg); | ||
} else { | ||
toAdd = ''; | ||
for (var k in arg) { | ||
if (arg[k] && k) { | ||
toAdd && (toAdd += ' '); | ||
toAdd += k; | ||
} | ||
} | ||
} | ||
break; | ||
} | ||
default: | ||
{ | ||
toAdd = arg; | ||
} | ||
} | ||
if (toAdd) { | ||
cls && (cls += ' '); | ||
cls += toAdd; | ||
} | ||
} | ||
return cls; | ||
}; | ||
export default createEmotion; |
{ | ||
"name": "@bumbag/create-emotion", | ||
"version": "10.0.27-0", | ||
"version": "10.0.27-1", | ||
"description": "The Next Generation of CSS-in-JS.", | ||
@@ -17,3 +17,3 @@ "main": "dist/create-emotion.cjs.js", | ||
"dependencies": { | ||
"@emotion/cache": "npm:@bumbag/emotion-cache@10.0.29-0", | ||
"@emotion/cache": "npm:@bumbag/emotion-cache@10.0.29-1", | ||
"@emotion/serialize": "^0.11.15", | ||
@@ -20,0 +20,0 @@ "@emotion/sheet": "0.9.4", |
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
31635
16
953
7
+ Added@bumbag/emotion-cache@10.0.29-1(transitive)
- Removed@bumbag/emotion-cache@10.0.29-0(transitive)