@vanilla-extract/css
Advanced tools
Comparing version 0.0.0-layers-20230322307 to 0.0.0-namespace-theme-tokens-20240321223951
@@ -14,3 +14,2 @@ 'use strict'; | ||
var adapterStack = [mockAdapter]; | ||
var currentAdapter = () => { | ||
@@ -20,6 +19,4 @@ if (adapterStack.length < 1) { | ||
} | ||
return adapterStack[adapterStack.length - 1]; | ||
}; | ||
var hasConfiguredAdapter = false; | ||
@@ -32,2 +29,5 @@ var setAdapterIfNotSet = newAdapter => { | ||
var setAdapter = newAdapter => { | ||
if (!newAdapter) { | ||
throw new Error('No adapter provided when calling "setAdapter"'); | ||
} | ||
hasConfiguredAdapter = true; | ||
@@ -51,2 +51,9 @@ adapterStack.push(newAdapter); | ||
}; | ||
var onBeginFileScope = function onBeginFileScope() { | ||
var _currentAdapter$onBeg, _currentAdapter; | ||
for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) { | ||
props[_key] = arguments[_key]; | ||
} | ||
return (_currentAdapter$onBeg = (_currentAdapter = currentAdapter()).onBeginFileScope) === null || _currentAdapter$onBeg === void 0 ? void 0 : _currentAdapter$onBeg.call(_currentAdapter, ...props); | ||
}; | ||
var onEndFileScope = function onEndFileScope() { | ||
@@ -56,8 +63,8 @@ return currentAdapter().onEndFileScope(...arguments); | ||
var getIdentOption = function getIdentOption() { | ||
var adapter = currentAdapter(); // Backwards compatibility with old versions of the integration package | ||
var adapter = currentAdapter(); | ||
// Backwards compatibility with old versions of the integration package | ||
if (!('getIdentOption' in adapter)) { | ||
return process.env.NODE_ENV === 'production' ? 'short' : 'debug'; | ||
} | ||
return adapter.getIdentOption(...arguments); | ||
@@ -70,2 +77,3 @@ }; | ||
exports.mockAdapter = mockAdapter; | ||
exports.onBeginFileScope = onBeginFileScope; | ||
exports.onEndFileScope = onEndFileScope; | ||
@@ -72,0 +80,0 @@ exports.registerClassName = registerClassName; |
@@ -10,3 +10,2 @@ var mockAdapter = { | ||
var adapterStack = [mockAdapter]; | ||
var currentAdapter = () => { | ||
@@ -16,6 +15,4 @@ if (adapterStack.length < 1) { | ||
} | ||
return adapterStack[adapterStack.length - 1]; | ||
}; | ||
var hasConfiguredAdapter = false; | ||
@@ -28,2 +25,5 @@ var setAdapterIfNotSet = newAdapter => { | ||
var setAdapter = newAdapter => { | ||
if (!newAdapter) { | ||
throw new Error('No adapter provided when calling "setAdapter"'); | ||
} | ||
hasConfiguredAdapter = true; | ||
@@ -47,2 +47,9 @@ adapterStack.push(newAdapter); | ||
}; | ||
var onBeginFileScope = function onBeginFileScope() { | ||
var _currentAdapter$onBeg, _currentAdapter; | ||
for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) { | ||
props[_key] = arguments[_key]; | ||
} | ||
return (_currentAdapter$onBeg = (_currentAdapter = currentAdapter()).onBeginFileScope) === null || _currentAdapter$onBeg === void 0 ? void 0 : _currentAdapter$onBeg.call(_currentAdapter, ...props); | ||
}; | ||
var onEndFileScope = function onEndFileScope() { | ||
@@ -52,11 +59,11 @@ return currentAdapter().onEndFileScope(...arguments); | ||
var getIdentOption = function getIdentOption() { | ||
var adapter = currentAdapter(); // Backwards compatibility with old versions of the integration package | ||
var adapter = currentAdapter(); | ||
// Backwards compatibility with old versions of the integration package | ||
if (!('getIdentOption' in adapter)) { | ||
return process.env.NODE_ENV === 'production' ? 'short' : 'debug'; | ||
} | ||
return adapter.getIdentOption(...arguments); | ||
}; | ||
export { appendCss, getIdentOption, markCompositionUsed, mockAdapter, onEndFileScope, registerClassName, registerComposition, removeAdapter, setAdapter, setAdapterIfNotSet }; | ||
export { appendCss, getIdentOption, markCompositionUsed, mockAdapter, onBeginFileScope, onEndFileScope, registerClassName, registerComposition, removeAdapter, setAdapter, setAdapterIfNotSet }; |
import { AtRule, Properties } from 'csstype'; | ||
declare type CSSVarFunction = `var(--${string})` | `var(--${string}, ${string | number})`; | ||
type CSSVarFunction = `var(--${string})` | `var(--${string}, ${string | number})`; | ||
@@ -15,2 +15,7 @@ declare const simplePseudoMap: { | ||
readonly ':-webkit-full-screen': true; | ||
readonly '::-moz-color-swatch': true; | ||
readonly '::-moz-list-bullet': true; | ||
readonly '::-moz-list-number': true; | ||
readonly '::-moz-page-sequence': true; | ||
readonly '::-moz-page': true; | ||
readonly '::-moz-placeholder': true; | ||
@@ -21,2 +26,3 @@ readonly '::-moz-progress-bar': true; | ||
readonly '::-moz-range-track': true; | ||
readonly '::-moz-scrolled-page-sequence': true; | ||
readonly '::-moz-selection': true; | ||
@@ -27,5 +33,5 @@ readonly '::-ms-backdrop': true; | ||
readonly '::-ms-clear': true; | ||
readonly '::-ms-fill': true; | ||
readonly '::-ms-fill-lower': true; | ||
readonly '::-ms-fill-upper': true; | ||
readonly '::-ms-fill': true; | ||
readonly '::-ms-reveal': true; | ||
@@ -39,4 +45,12 @@ readonly '::-ms-thumb': true; | ||
readonly '::-webkit-backdrop': true; | ||
readonly '::-webkit-inner-spin-button': true; | ||
readonly '::-webkit-input-placeholder': true; | ||
readonly '::-webkit-meter-bar': true; | ||
readonly '::-webkit-meter-even-less-good-value': true; | ||
readonly '::-webkit-meter-inner-element': true; | ||
readonly '::-webkit-meter-optimum-value': true; | ||
readonly '::-webkit-meter-suboptimum-value': true; | ||
readonly '::-webkit-outer-spin-button': true; | ||
readonly '::-webkit-progress-bar': true; | ||
readonly '::-webkit-progress-inner-element': true; | ||
readonly '::-webkit-progress-inner-value': true; | ||
@@ -51,2 +65,4 @@ readonly '::-webkit-progress-value': true; | ||
readonly '::-webkit-scrollbar': true; | ||
readonly '::-webkit-search-cancel-button': true; | ||
readonly '::-webkit-search-results-button': true; | ||
readonly '::-webkit-slider-runnable-track': true; | ||
@@ -58,8 +74,16 @@ readonly '::-webkit-slider-thumb': true; | ||
readonly '::cue': true; | ||
readonly '::file-selector-button': true; | ||
readonly '::first-letter': true; | ||
readonly '::first-line': true; | ||
readonly '::grammar-error': true; | ||
readonly '::marker': true; | ||
readonly '::placeholder': true; | ||
readonly '::selection': true; | ||
readonly '::spelling-error': true; | ||
readonly '::target-text': true; | ||
readonly '::view-transition-group': true; | ||
readonly '::view-transition-image-pair': true; | ||
readonly '::view-transition-new': true; | ||
readonly '::view-transition-old': true; | ||
readonly '::view-transition': true; | ||
readonly ':active': true; | ||
@@ -76,3 +100,2 @@ readonly ':after': true; | ||
readonly ':enabled': true; | ||
readonly ':first': true; | ||
readonly ':first-child': true; | ||
@@ -82,5 +105,6 @@ readonly ':first-letter': true; | ||
readonly ':first-of-type': true; | ||
readonly ':focus': true; | ||
readonly ':first': true; | ||
readonly ':focus-visible': true; | ||
readonly ':focus-within': true; | ||
readonly ':focus': true; | ||
readonly ':fullscreen': true; | ||
@@ -110,3 +134,3 @@ readonly ':hover': true; | ||
}; | ||
declare type SimplePseudos = keyof typeof simplePseudoMap; | ||
type SimplePseudos = keyof typeof simplePseudoMap; | ||
@@ -118,4 +142,4 @@ interface ContainerProperties { | ||
} | ||
declare type CSSTypeProperties = Properties<number | (string & {})> & ContainerProperties; | ||
declare type CSSProperties = { | ||
type CSSTypeProperties = Properties<number | (string & {})> & ContainerProperties; | ||
type CSSProperties = { | ||
[Property in keyof CSSTypeProperties]: CSSTypeProperties[Property] | CSSVarFunction | Array<CSSVarFunction | CSSTypeProperties[Property]>; | ||
@@ -126,3 +150,3 @@ }; | ||
} | ||
declare type CSSPropertiesWithVars = CSSProperties & { | ||
type CSSPropertiesWithVars = CSSProperties & { | ||
vars?: { | ||
@@ -132,27 +156,18 @@ [key: string]: string; | ||
}; | ||
declare type PseudoProperties = { | ||
type PseudoProperties = { | ||
[key in SimplePseudos]?: CSSPropertiesWithVars; | ||
}; | ||
declare type CSSPropertiesAndPseudos = CSSPropertiesWithVars & PseudoProperties; | ||
interface MediaQueries<StyleType> { | ||
'@media'?: { | ||
[query: string]: StyleType; | ||
type CSSPropertiesAndPseudos = CSSPropertiesWithVars & PseudoProperties; | ||
type Query<Key extends string, StyleType> = { | ||
[key in Key]?: { | ||
[query: string]: Omit<StyleType, Key>; | ||
}; | ||
}; | ||
type MediaQueries<StyleType> = Query<'@media', StyleType>; | ||
type FeatureQueries<StyleType> = Query<'@supports', StyleType>; | ||
type ContainerQueries<StyleType> = Query<'@container', StyleType>; | ||
type Layers<StyleType> = Query<'@layer', StyleType>; | ||
interface AllQueries<StyleType> extends MediaQueries<StyleType & AllQueries<StyleType>>, FeatureQueries<StyleType & AllQueries<StyleType>>, ContainerQueries<StyleType & AllQueries<StyleType>>, Layers<StyleType & AllQueries<StyleType>> { | ||
} | ||
interface FeatureQueries<StyleType> { | ||
'@supports'?: { | ||
[query: string]: StyleType; | ||
}; | ||
} | ||
interface ContainerQueries<StyleType> { | ||
'@container'?: { | ||
[query: string]: StyleType; | ||
}; | ||
} | ||
interface Layer<StyleType> { | ||
'@layer'?: { | ||
[name: string]: StyleType; | ||
}; | ||
} | ||
declare type WithQueries<StyleType> = Layer<StyleType & MediaQueries<StyleType & FeatureQueries<StyleType> & ContainerQueries<StyleType>> & FeatureQueries<StyleType & MediaQueries<StyleType>> & ContainerQueries<StyleType & FeatureQueries<StyleType>>> & MediaQueries<StyleType & FeatureQueries<StyleType & ContainerQueries<StyleType>> & ContainerQueries<StyleType & FeatureQueries<StyleType>>> & FeatureQueries<StyleType & MediaQueries<StyleType & ContainerQueries<StyleType>> & ContainerQueries<StyleType & MediaQueries<StyleType>>> & ContainerQueries<StyleType & MediaQueries<StyleType & FeatureQueries<StyleType>> & FeatureQueries<StyleType & MediaQueries<StyleType>>>; | ||
type WithQueries<StyleType> = StyleType & AllQueries<StyleType>; | ||
interface SelectorMap { | ||
@@ -164,6 +179,6 @@ [selector: string]: CSSPropertiesWithVars & WithQueries<CSSPropertiesWithVars>; | ||
} | ||
declare type StyleRule = StyleWithSelectors & WithQueries<StyleWithSelectors>; | ||
declare type GlobalStyleRule = CSSPropertiesWithVars & WithQueries<CSSPropertiesWithVars>; | ||
declare type GlobalFontFaceRule = Omit<AtRule.FontFaceFallback, 'src'> & Required<Pick<AtRule.FontFaceFallback, 'src'>>; | ||
declare type CSSStyleBlock = { | ||
type StyleRule = StyleWithSelectors & WithQueries<StyleWithSelectors>; | ||
type GlobalStyleRule = CSSPropertiesWithVars & WithQueries<CSSPropertiesWithVars>; | ||
type GlobalFontFaceRule = Omit<AtRule.FontFaceFallback, 'src'> & Required<Pick<AtRule.FontFaceFallback, 'src'>>; | ||
type CSSStyleBlock = { | ||
type: 'local'; | ||
@@ -173,7 +188,7 @@ selector: string; | ||
}; | ||
declare type CSSFontFaceBlock = { | ||
type CSSFontFaceBlock = { | ||
type: 'fontFace'; | ||
rule: GlobalFontFaceRule; | ||
}; | ||
declare type CSSKeyframesBlock = { | ||
type CSSKeyframesBlock = { | ||
type: 'keyframes'; | ||
@@ -183,3 +198,3 @@ name: string; | ||
}; | ||
declare type CSSSelectorBlock = { | ||
type CSSSelectorBlock = { | ||
type: 'selector' | 'global'; | ||
@@ -189,8 +204,8 @@ selector: string; | ||
}; | ||
declare type CSSLayerDeclaration = { | ||
type CSSLayerDeclaration = { | ||
type: 'layer'; | ||
name: string; | ||
}; | ||
declare type CSS = CSSStyleBlock | CSSFontFaceBlock | CSSKeyframesBlock | CSSSelectorBlock | CSSLayerDeclaration; | ||
declare type FileScope = { | ||
type CSS = CSSStyleBlock | CSSFontFaceBlock | CSSKeyframesBlock | CSSSelectorBlock | CSSLayerDeclaration; | ||
type FileScope = { | ||
packageName?: string; | ||
@@ -203,8 +218,15 @@ filePath: string; | ||
} | ||
declare type IdentOption = 'short' | 'debug'; | ||
type CustomIdentFunction = (params: { | ||
hash: string; | ||
filePath: string; | ||
debugId?: string; | ||
packageName?: string; | ||
}) => string; | ||
type IdentOption = 'short' | 'debug' | CustomIdentFunction; | ||
interface Adapter { | ||
appendCss: (css: CSS, fileScope: FileScope) => void; | ||
registerClassName: (className: string) => void; | ||
registerComposition: (composition: Composition) => void; | ||
registerClassName: (className: string, fileScope: FileScope) => void; | ||
registerComposition: (composition: Composition, fileScope: FileScope) => void; | ||
markCompositionUsed: (identifier: string) => void; | ||
onBeginFileScope?: (fileScope: FileScope) => void; | ||
onEndFileScope: (fileScope: FileScope) => void; | ||
@@ -222,5 +244,6 @@ getIdentOption: () => IdentOption; | ||
declare const markCompositionUsed: Adapter['markCompositionUsed']; | ||
declare const onBeginFileScope: NonNullable<Adapter['onBeginFileScope']>; | ||
declare const onEndFileScope: Adapter['onEndFileScope']; | ||
declare const getIdentOption: Adapter['getIdentOption']; | ||
export { appendCss, getIdentOption, markCompositionUsed, mockAdapter, onEndFileScope, registerClassName, registerComposition, removeAdapter, setAdapter, setAdapterIfNotSet }; | ||
export { appendCss, getIdentOption, markCompositionUsed, mockAdapter, onBeginFileScope, onEndFileScope, registerClassName, registerComposition, removeAdapter, setAdapter, setAdapterIfNotSet }; |
@@ -14,3 +14,2 @@ 'use strict'; | ||
var adapterStack = [mockAdapter]; | ||
var currentAdapter = () => { | ||
@@ -20,6 +19,4 @@ if (adapterStack.length < 1) { | ||
} | ||
return adapterStack[adapterStack.length - 1]; | ||
}; | ||
var hasConfiguredAdapter = false; | ||
@@ -32,2 +29,5 @@ var setAdapterIfNotSet = newAdapter => { | ||
var setAdapter = newAdapter => { | ||
if (!newAdapter) { | ||
throw new Error('No adapter provided when calling "setAdapter"'); | ||
} | ||
hasConfiguredAdapter = true; | ||
@@ -51,2 +51,9 @@ adapterStack.push(newAdapter); | ||
}; | ||
var onBeginFileScope = function onBeginFileScope() { | ||
var _currentAdapter$onBeg, _currentAdapter; | ||
for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) { | ||
props[_key] = arguments[_key]; | ||
} | ||
return (_currentAdapter$onBeg = (_currentAdapter = currentAdapter()).onBeginFileScope) === null || _currentAdapter$onBeg === void 0 ? void 0 : _currentAdapter$onBeg.call(_currentAdapter, ...props); | ||
}; | ||
var onEndFileScope = function onEndFileScope() { | ||
@@ -56,8 +63,8 @@ return currentAdapter().onEndFileScope(...arguments); | ||
var getIdentOption = function getIdentOption() { | ||
var adapter = currentAdapter(); // Backwards compatibility with old versions of the integration package | ||
var adapter = currentAdapter(); | ||
// Backwards compatibility with old versions of the integration package | ||
if (!('getIdentOption' in adapter)) { | ||
return process.env.NODE_ENV === 'production' ? 'short' : 'debug'; | ||
} | ||
return adapter.getIdentOption(...arguments); | ||
@@ -70,2 +77,3 @@ }; | ||
exports.mockAdapter = mockAdapter; | ||
exports.onBeginFileScope = onBeginFileScope; | ||
exports.onEndFileScope = onEndFileScope; | ||
@@ -72,0 +80,0 @@ exports.registerClassName = registerClassName; |
@@ -14,3 +14,2 @@ 'use strict'; | ||
var adapterStack = [mockAdapter]; | ||
var currentAdapter = () => { | ||
@@ -20,6 +19,4 @@ if (adapterStack.length < 1) { | ||
} | ||
return adapterStack[adapterStack.length - 1]; | ||
}; | ||
var hasConfiguredAdapter = false; | ||
@@ -32,2 +29,5 @@ var setAdapterIfNotSet = newAdapter => { | ||
var setAdapter = newAdapter => { | ||
if (!newAdapter) { | ||
throw new Error('No adapter provided when calling "setAdapter"'); | ||
} | ||
hasConfiguredAdapter = true; | ||
@@ -51,2 +51,9 @@ adapterStack.push(newAdapter); | ||
}; | ||
var onBeginFileScope = function onBeginFileScope() { | ||
var _currentAdapter$onBeg, _currentAdapter; | ||
for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) { | ||
props[_key] = arguments[_key]; | ||
} | ||
return (_currentAdapter$onBeg = (_currentAdapter = currentAdapter()).onBeginFileScope) === null || _currentAdapter$onBeg === void 0 ? void 0 : _currentAdapter$onBeg.call(_currentAdapter, ...props); | ||
}; | ||
var onEndFileScope = function onEndFileScope() { | ||
@@ -56,8 +63,8 @@ return currentAdapter().onEndFileScope(...arguments); | ||
var getIdentOption = function getIdentOption() { | ||
var adapter = currentAdapter(); // Backwards compatibility with old versions of the integration package | ||
var adapter = currentAdapter(); | ||
// Backwards compatibility with old versions of the integration package | ||
if (!('getIdentOption' in adapter)) { | ||
return 'short' ; | ||
} | ||
return adapter.getIdentOption(...arguments); | ||
@@ -70,2 +77,3 @@ }; | ||
exports.mockAdapter = mockAdapter; | ||
exports.onBeginFileScope = onBeginFileScope; | ||
exports.onEndFileScope = onEndFileScope; | ||
@@ -72,0 +80,0 @@ exports.registerClassName = registerClassName; |
@@ -10,3 +10,2 @@ var mockAdapter = { | ||
var adapterStack = [mockAdapter]; | ||
var currentAdapter = () => { | ||
@@ -16,6 +15,4 @@ if (adapterStack.length < 1) { | ||
} | ||
return adapterStack[adapterStack.length - 1]; | ||
}; | ||
var hasConfiguredAdapter = false; | ||
@@ -28,2 +25,5 @@ var setAdapterIfNotSet = newAdapter => { | ||
var setAdapter = newAdapter => { | ||
if (!newAdapter) { | ||
throw new Error('No adapter provided when calling "setAdapter"'); | ||
} | ||
hasConfiguredAdapter = true; | ||
@@ -47,2 +47,9 @@ adapterStack.push(newAdapter); | ||
}; | ||
var onBeginFileScope = function onBeginFileScope() { | ||
var _currentAdapter$onBeg, _currentAdapter; | ||
for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) { | ||
props[_key] = arguments[_key]; | ||
} | ||
return (_currentAdapter$onBeg = (_currentAdapter = currentAdapter()).onBeginFileScope) === null || _currentAdapter$onBeg === void 0 ? void 0 : _currentAdapter$onBeg.call(_currentAdapter, ...props); | ||
}; | ||
var onEndFileScope = function onEndFileScope() { | ||
@@ -52,11 +59,11 @@ return currentAdapter().onEndFileScope(...arguments); | ||
var getIdentOption = function getIdentOption() { | ||
var adapter = currentAdapter(); // Backwards compatibility with old versions of the integration package | ||
var adapter = currentAdapter(); | ||
// Backwards compatibility with old versions of the integration package | ||
if (!('getIdentOption' in adapter)) { | ||
return process.env.NODE_ENV === 'production' ? 'short' : 'debug'; | ||
} | ||
return adapter.getIdentOption(...arguments); | ||
}; | ||
export { appendCss, getIdentOption, markCompositionUsed, mockAdapter, onEndFileScope, registerClassName, registerComposition, removeAdapter, setAdapter, setAdapterIfNotSet }; | ||
export { appendCss, getIdentOption, markCompositionUsed, mockAdapter, onBeginFileScope, onEndFileScope, registerClassName, registerComposition, removeAdapter, setAdapter, setAdapterIfNotSet }; |
@@ -6,3 +6,3 @@ 'use strict'; | ||
var injectStyles_dist_vanillaExtractCssInjectStyles = require('../injectStyles/dist/vanilla-extract-css-injectStyles.browser.cjs.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('./transformCss-3e09c7cf.browser.cjs.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('./transformCss-1b35689a.browser.cjs.js'); | ||
var adapter_dist_vanillaExtractCssAdapter = require('../adapter/dist/vanilla-extract-css-adapter.browser.cjs.js'); | ||
@@ -15,6 +15,6 @@ var hash = require('@emotion/hash'); | ||
var chalk = require('chalk'); | ||
var taggedTemplateLiteral = require('./taggedTemplateLiteral-c635af00.browser.cjs.js'); | ||
var taggedTemplateLiteral = require('./taggedTemplateLiteral-00b821ff.browser.cjs.js'); | ||
var outdent = require('outdent'); | ||
var deepmerge = require('deepmerge'); | ||
require('ahocorasick'); | ||
require('modern-ahocorasick'); | ||
require('css-what'); | ||
@@ -59,3 +59,2 @@ require('media-query-parser'); | ||
}; | ||
{ | ||
@@ -77,3 +76,2 @@ adapter_dist_vanillaExtractCssAdapter.setAdapterIfNotSet(browserRuntimeAdapter); | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
@@ -93,52 +91,46 @@ constructor: { | ||
function _wrapRegExp() { | ||
_wrapRegExp = function (re, groups) { | ||
return new BabelRegExp(re, void 0, groups); | ||
_wrapRegExp = function (e, r) { | ||
return new BabelRegExp(e, void 0, r); | ||
}; | ||
var _super = RegExp.prototype, | ||
_groups = new WeakMap(); | ||
function BabelRegExp(re, flags, groups) { | ||
var _this = new RegExp(re, flags); | ||
return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype); | ||
var e = RegExp.prototype, | ||
r = new WeakMap(); | ||
function BabelRegExp(e, t, p) { | ||
var o = new RegExp(e, t); | ||
return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); | ||
} | ||
function buildGroups(result, re) { | ||
var g = _groups.get(re); | ||
return Object.keys(g).reduce(function (groups, name) { | ||
var i = g[name]; | ||
if ("number" == typeof i) groups[name] = result[i];else { | ||
for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) k++; | ||
groups[name] = result[i[k]]; | ||
function buildGroups(e, t) { | ||
var p = r.get(t); | ||
return Object.keys(p).reduce(function (r, t) { | ||
var o = p[t]; | ||
if ("number" == typeof o) r[t] = e[o];else { | ||
for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; | ||
r[t] = e[o[i]]; | ||
} | ||
return groups; | ||
return r; | ||
}, Object.create(null)); | ||
} | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { | ||
var result = _super.exec.call(this, str); | ||
return result && (result.groups = buildGroups(result, this)), result; | ||
}, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { | ||
if ("string" == typeof substitution) { | ||
var groups = _groups.get(this); | ||
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { | ||
return "$" + groups[name]; | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { | ||
var t = e.exec.call(this, r); | ||
if (t) { | ||
t.groups = buildGroups(t, this); | ||
var p = t.indices; | ||
p && (p.groups = buildGroups(p, this)); | ||
} | ||
return t; | ||
}, BabelRegExp.prototype[Symbol.replace] = function (t, p) { | ||
if ("string" == typeof p) { | ||
var o = r.get(this); | ||
return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { | ||
var t = o[r]; | ||
return "$" + (Array.isArray(t) ? t.join("$") : t); | ||
})); | ||
} | ||
if ("function" == typeof substitution) { | ||
var _this = this; | ||
return _super[Symbol.replace].call(this, str, function () { | ||
var args = arguments; | ||
return "object" != typeof args[args.length - 1] && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args); | ||
if ("function" == typeof p) { | ||
var i = this; | ||
return e[Symbol.replace].call(this, t, function () { | ||
var e = arguments; | ||
return "object" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); | ||
}); | ||
} | ||
return _super[Symbol.replace].call(this, str, substitution); | ||
return e[Symbol.replace].call(this, t, p); | ||
}, _wrapRegExp.apply(this, arguments); | ||
@@ -153,3 +145,2 @@ } | ||
var parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
if (debugFileName) { | ||
@@ -159,7 +150,6 @@ var { | ||
} = fileScope_dist_vanillaExtractCssFileScope.getFileScope(); | ||
var matches = filePath.match( /*#__PURE__*/_wrapRegExp(/((?:(?![\/\\])[\s\S])*)?[\/\\]?((?:(?![\/\\])[\s\S])*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/, { | ||
var matches = filePath.match( /*#__PURE__*/_wrapRegExp(/([^\/\\]*)?[\/\\]?([^\/\\]*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/, { | ||
dir: 1, | ||
file: 2 | ||
})); | ||
if (matches && matches.groups) { | ||
@@ -173,7 +163,9 @@ var { | ||
} | ||
return parts.join('_'); | ||
} | ||
function normalizeIdentifier(identifier) { | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
} | ||
function generateIdentifier(arg) { | ||
var identOption = adapter_dist_vanillaExtractCssAdapter.getIdentOption(); | ||
var { | ||
@@ -184,5 +176,5 @@ debugId, | ||
debugId: arg | ||
} : null), typeof arg === 'object' ? arg : null); // Convert ref count to base 36 for optimal hash lengths | ||
} : null), typeof arg === 'object' ? arg : null); | ||
// Convert ref count to base 36 for optimal hash lengths | ||
var refCount = fileScope_dist_vanillaExtractCssFileScope.getAndIncrementRefCounter().toString(36); | ||
@@ -195,4 +187,3 @@ var { | ||
var identifier = "".concat(fileScopeHash).concat(refCount); | ||
if (adapter_dist_vanillaExtractCssAdapter.getIdentOption() === 'debug') { | ||
if (identOption === 'debug') { | ||
var devPrefix = getDevPrefix({ | ||
@@ -202,13 +193,23 @@ debugId, | ||
}); | ||
if (devPrefix) { | ||
identifier = "".concat(devPrefix, "__").concat(identifier); | ||
} | ||
return normalizeIdentifier(identifier); | ||
} | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
if (typeof identOption === 'function') { | ||
identifier = identOption({ | ||
hash: identifier, | ||
debugId, | ||
filePath, | ||
packageName | ||
}); | ||
if (!identifier.match(/^[A-Z_][0-9A-Z_-]+$/i)) { | ||
throw new Error("Identifier function returned invalid indentifier: \"".concat(identifier, "\"")); | ||
} | ||
return identifier; | ||
} | ||
return normalizeIdentifier(identifier); | ||
} | ||
var normaliseObject = obj => _private.walkObject(obj, () => ''); | ||
function validateContract(contract, tokens) { | ||
@@ -222,7 +223,5 @@ var theDiff = deepObjectDiff.diff(normaliseObject(contract), normaliseObject(tokens)); | ||
} | ||
function diffLine(value, nesting, type) { | ||
var whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
var line = "".concat(type ? type : ' ').concat(whitespace).concat(value); | ||
if (process.env.NODE_ENV !== 'test') { | ||
@@ -232,3 +231,2 @@ if (type === '-') { | ||
} | ||
if (type === '+') { | ||
@@ -238,20 +236,14 @@ return chalk__default["default"].green(line); | ||
} | ||
return line; | ||
} | ||
function renderDiff(orig, diff) { | ||
var nesting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | ||
var lines = []; | ||
if (nesting === 0) { | ||
lines.push(diffLine('{', 0)); | ||
} | ||
var innerNesting = nesting + 1; | ||
var keys = Object.keys(diff).sort(); | ||
for (var key of keys) { | ||
var value = diff[key]; | ||
if (!(key in orig)) { | ||
@@ -267,7 +259,5 @@ lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '+')); | ||
} | ||
if (nesting === 0) { | ||
lines.push(diffLine('}', 0)); | ||
} | ||
return lines.join('\n'); | ||
@@ -287,7 +277,5 @@ } | ||
var finalValue = ''; | ||
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { | ||
values[_key] = arguments[_key]; | ||
} | ||
values.reverse().forEach(value => { | ||
@@ -300,3 +288,2 @@ if (finalValue === '') { | ||
} | ||
finalValue = value.replace(/\)$/, ", ".concat(finalValue, ")")); | ||
@@ -313,7 +300,5 @@ } | ||
} = validateContract(varContract, tokens); | ||
if (!valid) { | ||
throw new Error("Tokens don't match contract.\n".concat(diffString)); | ||
} | ||
_private.walkObject(tokens, (value, path) => { | ||
@@ -325,4 +310,2 @@ varSetters[_private.get(varContract, path)] = String(value); | ||
function createThemeContract(tokens) { | ||
// TS is giving type impossibly deep error here. Ignoring for now as this shouldn't affect consumers. | ||
// @ts-expect-error | ||
return _private.walkObject(tokens, (_value, path) => { | ||
@@ -336,3 +319,2 @@ return createVar(path.join('-')); | ||
var varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
if (typeof varName !== 'string' || varName !== cssesc__default["default"](varName, { | ||
@@ -343,3 +325,2 @@ isIdentifier: true | ||
} | ||
return "var(--".concat(varName, ")"); | ||
@@ -360,3 +341,2 @@ }); | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
if (shouldCreateVars) { | ||
@@ -368,3 +348,3 @@ return themeVars; | ||
var themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(themeClassName); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(themeClassName, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
var vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
@@ -375,9 +355,7 @@ return vars ? [themeClassName, vars] : themeClassName; | ||
var _templateObject; | ||
function composedStyle(rules, debugId) { | ||
var className = generateIdentifier(debugId); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
var classList = []; | ||
var styleRules = []; | ||
for (var rule of rules) { | ||
@@ -390,5 +368,3 @@ if (typeof rule === 'string') { | ||
} | ||
var result = className; | ||
if (classList.length > 0) { | ||
@@ -399,4 +375,3 @@ result = "".concat(className, " ").concat(transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList(classList)); | ||
classList: result | ||
}); | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
if (styleRules.length > 0) { | ||
@@ -408,3 +383,2 @@ // If there are styles attached to this composition then it is | ||
} | ||
if (styleRules.length > 0) { | ||
@@ -415,3 +389,2 @@ var _rule = deepmerge__default["default"].all(styleRules, { | ||
}); | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -423,6 +396,4 @@ type: 'local', | ||
} | ||
return result; | ||
} | ||
function style(rule, debugId) { | ||
@@ -432,5 +403,4 @@ if (Array.isArray(rule)) { | ||
} | ||
var className = generateIdentifier(debugId); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -443,13 +413,11 @@ type: 'local', | ||
} | ||
/** | ||
* @deprecated The same functionality is now provided by the 'style' function when you pass it an array | ||
*/ | ||
function composeStyles() { | ||
var compose = fileScope_dist_vanillaExtractCssFileScope.hasFileScope() ? composedStyle : transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList; | ||
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) { | ||
classNames[_key] = arguments[_key]; | ||
} | ||
return compose(classNames); | ||
@@ -468,13 +436,14 @@ } | ||
}), "\""); | ||
if ('fontFamily' in rule) { | ||
throw new Error(outdent__default["default"](_templateObject || (_templateObject = taggedTemplateLiteral._taggedTemplateLiteral(["\n This function creates and returns a hashed font-family name, so the \"fontFamily\" property should not be provided.\n \n If you'd like to define a globally scoped custom font, you can use the \"globalFontFace\" function instead.\n "])))); | ||
var rules = Array.isArray(rule) ? rule : [rule]; | ||
for (var singleRule of rules) { | ||
if ('fontFamily' in singleRule) { | ||
throw new Error(outdent__default["default"](_templateObject || (_templateObject = taggedTemplateLiteral._taggedTemplateLiteral(["\n This function creates and returns a hashed font-family name, so the \"fontFamily\" property should not be provided.\n \n If you'd like to define a globally scoped custom font, you can use the \"globalFontFace\" function instead.\n "])))); | ||
} | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
type: 'fontFace', | ||
rule: transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, singleRule), {}, { | ||
fontFamily | ||
}) | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
} | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
type: 'fontFace', | ||
rule: transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, rule), {}, { | ||
fontFamily | ||
}) | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
return fontFamily; | ||
@@ -511,53 +480,40 @@ } | ||
var _data = arguments.length <= 0 ? undefined : arguments[0]; | ||
var _mapData = arguments.length <= 1 ? undefined : arguments[1]; | ||
var _debugId = arguments.length <= 2 ? undefined : arguments[2]; | ||
var _classMap = {}; | ||
for (var _key2 in _data) { | ||
_classMap[_key2] = style(_mapData(_data[_key2], _key2), _debugId ? "".concat(_debugId, "_").concat(_key2) : _key2); | ||
} | ||
return _classMap; | ||
} | ||
var styleMap = arguments.length <= 0 ? undefined : arguments[0]; | ||
var debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
var classMap = {}; | ||
for (var _key3 in styleMap) { | ||
classMap[_key3] = style(styleMap[_key3], debugId ? "".concat(debugId, "_").concat(_key3) : _key3); | ||
} | ||
return classMap; | ||
} | ||
// createContainer is used for local scoping of CSS containers | ||
// For now it is mostly just an alias of generateIdentifier | ||
var createContainer = debugId => generateIdentifier(debugId); | ||
var defaultLayerOptions = {}; | ||
var merge = (obj1, obj2) => transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, obj1), obj2); | ||
var getLayerArgs = function getLayerArgs() { | ||
var options = defaultLayerOptions; | ||
var debugId = arguments.length <= 0 ? undefined : arguments[0]; | ||
if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'object') { | ||
options = deepmerge__default["default"](defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
options = merge(defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
} | ||
return [options, debugId]; | ||
}; | ||
function layer() { | ||
var [options, debugId] = getLayerArgs(...arguments); | ||
var name = generateIdentifier(debugId); | ||
if (options.parent) { | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -571,7 +527,5 @@ type: 'layer', | ||
var [options, name] = getLayerArgs(...arguments); | ||
if (options.parent) { | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -578,0 +532,0 @@ type: 'layer', |
import { injectStyles } from '../injectStyles/dist/vanilla-extract-css-injectStyles.browser.esm.js'; | ||
import { t as transformCss, _ as _objectSpread2, d as dudupeAndJoinClassList } from './transformCss-fb298e8b.browser.esm.js'; | ||
import { t as transformCss, _ as _objectSpread2, d as dudupeAndJoinClassList } from './transformCss-1f897e28.browser.esm.js'; | ||
import { setAdapterIfNotSet, getIdentOption, appendCss, registerClassName, registerComposition, markCompositionUsed } from '../adapter/dist/vanilla-extract-css-adapter.browser.esm.js'; | ||
@@ -10,6 +10,6 @@ import hash from '@emotion/hash'; | ||
import chalk from 'chalk'; | ||
import { _ as _taggedTemplateLiteral } from './taggedTemplateLiteral-2d2668f5.browser.esm.js'; | ||
import { _ as _taggedTemplateLiteral } from './taggedTemplateLiteral-8e47dbd7.browser.esm.js'; | ||
import outdent from 'outdent'; | ||
import deepmerge from 'deepmerge'; | ||
import 'ahocorasick'; | ||
import 'modern-ahocorasick'; | ||
import 'css-what'; | ||
@@ -46,3 +46,2 @@ import 'media-query-parser'; | ||
}; | ||
{ | ||
@@ -64,3 +63,2 @@ setAdapterIfNotSet(browserRuntimeAdapter); | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
@@ -80,52 +78,46 @@ constructor: { | ||
function _wrapRegExp() { | ||
_wrapRegExp = function (re, groups) { | ||
return new BabelRegExp(re, void 0, groups); | ||
_wrapRegExp = function (e, r) { | ||
return new BabelRegExp(e, void 0, r); | ||
}; | ||
var _super = RegExp.prototype, | ||
_groups = new WeakMap(); | ||
function BabelRegExp(re, flags, groups) { | ||
var _this = new RegExp(re, flags); | ||
return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype); | ||
var e = RegExp.prototype, | ||
r = new WeakMap(); | ||
function BabelRegExp(e, t, p) { | ||
var o = new RegExp(e, t); | ||
return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); | ||
} | ||
function buildGroups(result, re) { | ||
var g = _groups.get(re); | ||
return Object.keys(g).reduce(function (groups, name) { | ||
var i = g[name]; | ||
if ("number" == typeof i) groups[name] = result[i];else { | ||
for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) k++; | ||
groups[name] = result[i[k]]; | ||
function buildGroups(e, t) { | ||
var p = r.get(t); | ||
return Object.keys(p).reduce(function (r, t) { | ||
var o = p[t]; | ||
if ("number" == typeof o) r[t] = e[o];else { | ||
for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; | ||
r[t] = e[o[i]]; | ||
} | ||
return groups; | ||
return r; | ||
}, Object.create(null)); | ||
} | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { | ||
var result = _super.exec.call(this, str); | ||
return result && (result.groups = buildGroups(result, this)), result; | ||
}, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { | ||
if ("string" == typeof substitution) { | ||
var groups = _groups.get(this); | ||
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { | ||
return "$" + groups[name]; | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { | ||
var t = e.exec.call(this, r); | ||
if (t) { | ||
t.groups = buildGroups(t, this); | ||
var p = t.indices; | ||
p && (p.groups = buildGroups(p, this)); | ||
} | ||
return t; | ||
}, BabelRegExp.prototype[Symbol.replace] = function (t, p) { | ||
if ("string" == typeof p) { | ||
var o = r.get(this); | ||
return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { | ||
var t = o[r]; | ||
return "$" + (Array.isArray(t) ? t.join("$") : t); | ||
})); | ||
} | ||
if ("function" == typeof substitution) { | ||
var _this = this; | ||
return _super[Symbol.replace].call(this, str, function () { | ||
var args = arguments; | ||
return "object" != typeof args[args.length - 1] && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args); | ||
if ("function" == typeof p) { | ||
var i = this; | ||
return e[Symbol.replace].call(this, t, function () { | ||
var e = arguments; | ||
return "object" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); | ||
}); | ||
} | ||
return _super[Symbol.replace].call(this, str, substitution); | ||
return e[Symbol.replace].call(this, t, p); | ||
}, _wrapRegExp.apply(this, arguments); | ||
@@ -140,3 +132,2 @@ } | ||
var parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
if (debugFileName) { | ||
@@ -146,7 +137,6 @@ var { | ||
} = getFileScope(); | ||
var matches = filePath.match( /*#__PURE__*/_wrapRegExp(/((?:(?![\/\\])[\s\S])*)?[\/\\]?((?:(?![\/\\])[\s\S])*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/, { | ||
var matches = filePath.match( /*#__PURE__*/_wrapRegExp(/([^\/\\]*)?[\/\\]?([^\/\\]*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/, { | ||
dir: 1, | ||
file: 2 | ||
})); | ||
if (matches && matches.groups) { | ||
@@ -160,7 +150,9 @@ var { | ||
} | ||
return parts.join('_'); | ||
} | ||
function normalizeIdentifier(identifier) { | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
} | ||
function generateIdentifier(arg) { | ||
var identOption = getIdentOption(); | ||
var { | ||
@@ -171,5 +163,5 @@ debugId, | ||
debugId: arg | ||
} : null), typeof arg === 'object' ? arg : null); // Convert ref count to base 36 for optimal hash lengths | ||
} : null), typeof arg === 'object' ? arg : null); | ||
// Convert ref count to base 36 for optimal hash lengths | ||
var refCount = getAndIncrementRefCounter().toString(36); | ||
@@ -182,4 +174,3 @@ var { | ||
var identifier = "".concat(fileScopeHash).concat(refCount); | ||
if (getIdentOption() === 'debug') { | ||
if (identOption === 'debug') { | ||
var devPrefix = getDevPrefix({ | ||
@@ -189,13 +180,23 @@ debugId, | ||
}); | ||
if (devPrefix) { | ||
identifier = "".concat(devPrefix, "__").concat(identifier); | ||
} | ||
return normalizeIdentifier(identifier); | ||
} | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
if (typeof identOption === 'function') { | ||
identifier = identOption({ | ||
hash: identifier, | ||
debugId, | ||
filePath, | ||
packageName | ||
}); | ||
if (!identifier.match(/^[A-Z_][0-9A-Z_-]+$/i)) { | ||
throw new Error("Identifier function returned invalid indentifier: \"".concat(identifier, "\"")); | ||
} | ||
return identifier; | ||
} | ||
return normalizeIdentifier(identifier); | ||
} | ||
var normaliseObject = obj => walkObject(obj, () => ''); | ||
function validateContract(contract, tokens) { | ||
@@ -209,7 +210,5 @@ var theDiff = diff(normaliseObject(contract), normaliseObject(tokens)); | ||
} | ||
function diffLine(value, nesting, type) { | ||
var whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
var line = "".concat(type ? type : ' ').concat(whitespace).concat(value); | ||
if (process.env.NODE_ENV !== 'test') { | ||
@@ -219,3 +218,2 @@ if (type === '-') { | ||
} | ||
if (type === '+') { | ||
@@ -225,20 +223,14 @@ return chalk.green(line); | ||
} | ||
return line; | ||
} | ||
function renderDiff(orig, diff) { | ||
var nesting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | ||
var lines = []; | ||
if (nesting === 0) { | ||
lines.push(diffLine('{', 0)); | ||
} | ||
var innerNesting = nesting + 1; | ||
var keys = Object.keys(diff).sort(); | ||
for (var key of keys) { | ||
var value = diff[key]; | ||
if (!(key in orig)) { | ||
@@ -254,7 +246,5 @@ lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '+')); | ||
} | ||
if (nesting === 0) { | ||
lines.push(diffLine('}', 0)); | ||
} | ||
return lines.join('\n'); | ||
@@ -274,7 +264,5 @@ } | ||
var finalValue = ''; | ||
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { | ||
values[_key] = arguments[_key]; | ||
} | ||
values.reverse().forEach(value => { | ||
@@ -287,3 +275,2 @@ if (finalValue === '') { | ||
} | ||
finalValue = value.replace(/\)$/, ", ".concat(finalValue, ")")); | ||
@@ -300,7 +287,5 @@ } | ||
} = validateContract(varContract, tokens); | ||
if (!valid) { | ||
throw new Error("Tokens don't match contract.\n".concat(diffString)); | ||
} | ||
walkObject(tokens, (value, path) => { | ||
@@ -312,4 +297,2 @@ varSetters[get(varContract, path)] = String(value); | ||
function createThemeContract(tokens) { | ||
// TS is giving type impossibly deep error here. Ignoring for now as this shouldn't affect consumers. | ||
// @ts-expect-error | ||
return walkObject(tokens, (_value, path) => { | ||
@@ -323,3 +306,2 @@ return createVar(path.join('-')); | ||
var varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
if (typeof varName !== 'string' || varName !== cssesc(varName, { | ||
@@ -330,3 +312,2 @@ isIdentifier: true | ||
} | ||
return "var(--".concat(varName, ")"); | ||
@@ -347,3 +328,2 @@ }); | ||
}, getFileScope()); | ||
if (shouldCreateVars) { | ||
@@ -355,3 +335,3 @@ return themeVars; | ||
var themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
registerClassName(themeClassName); | ||
registerClassName(themeClassName, getFileScope()); | ||
var vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
@@ -362,9 +342,7 @@ return vars ? [themeClassName, vars] : themeClassName; | ||
var _templateObject; | ||
function composedStyle(rules, debugId) { | ||
var className = generateIdentifier(debugId); | ||
registerClassName(className); | ||
registerClassName(className, getFileScope()); | ||
var classList = []; | ||
var styleRules = []; | ||
for (var rule of rules) { | ||
@@ -377,5 +355,3 @@ if (typeof rule === 'string') { | ||
} | ||
var result = className; | ||
if (classList.length > 0) { | ||
@@ -386,4 +362,3 @@ result = "".concat(className, " ").concat(dudupeAndJoinClassList(classList)); | ||
classList: result | ||
}); | ||
}, getFileScope()); | ||
if (styleRules.length > 0) { | ||
@@ -395,3 +370,2 @@ // If there are styles attached to this composition then it is | ||
} | ||
if (styleRules.length > 0) { | ||
@@ -402,3 +376,2 @@ var _rule = deepmerge.all(styleRules, { | ||
}); | ||
appendCss({ | ||
@@ -410,6 +383,4 @@ type: 'local', | ||
} | ||
return result; | ||
} | ||
function style(rule, debugId) { | ||
@@ -419,5 +390,4 @@ if (Array.isArray(rule)) { | ||
} | ||
var className = generateIdentifier(debugId); | ||
registerClassName(className); | ||
registerClassName(className, getFileScope()); | ||
appendCss({ | ||
@@ -430,13 +400,11 @@ type: 'local', | ||
} | ||
/** | ||
* @deprecated The same functionality is now provided by the 'style' function when you pass it an array | ||
*/ | ||
function composeStyles() { | ||
var compose = hasFileScope() ? composedStyle : dudupeAndJoinClassList; | ||
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) { | ||
classNames[_key] = arguments[_key]; | ||
} | ||
return compose(classNames); | ||
@@ -455,13 +423,14 @@ } | ||
}), "\""); | ||
if ('fontFamily' in rule) { | ||
throw new Error(outdent(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n This function creates and returns a hashed font-family name, so the \"fontFamily\" property should not be provided.\n \n If you'd like to define a globally scoped custom font, you can use the \"globalFontFace\" function instead.\n "])))); | ||
var rules = Array.isArray(rule) ? rule : [rule]; | ||
for (var singleRule of rules) { | ||
if ('fontFamily' in singleRule) { | ||
throw new Error(outdent(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n This function creates and returns a hashed font-family name, so the \"fontFamily\" property should not be provided.\n \n If you'd like to define a globally scoped custom font, you can use the \"globalFontFace\" function instead.\n "])))); | ||
} | ||
appendCss({ | ||
type: 'fontFace', | ||
rule: _objectSpread2(_objectSpread2({}, singleRule), {}, { | ||
fontFamily | ||
}) | ||
}, getFileScope()); | ||
} | ||
appendCss({ | ||
type: 'fontFace', | ||
rule: _objectSpread2(_objectSpread2({}, rule), {}, { | ||
fontFamily | ||
}) | ||
}, getFileScope()); | ||
return fontFamily; | ||
@@ -498,53 +467,40 @@ } | ||
var _data = arguments.length <= 0 ? undefined : arguments[0]; | ||
var _mapData = arguments.length <= 1 ? undefined : arguments[1]; | ||
var _debugId = arguments.length <= 2 ? undefined : arguments[2]; | ||
var _classMap = {}; | ||
for (var _key2 in _data) { | ||
_classMap[_key2] = style(_mapData(_data[_key2], _key2), _debugId ? "".concat(_debugId, "_").concat(_key2) : _key2); | ||
} | ||
return _classMap; | ||
} | ||
var styleMap = arguments.length <= 0 ? undefined : arguments[0]; | ||
var debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
var classMap = {}; | ||
for (var _key3 in styleMap) { | ||
classMap[_key3] = style(styleMap[_key3], debugId ? "".concat(debugId, "_").concat(_key3) : _key3); | ||
} | ||
return classMap; | ||
} | ||
// createContainer is used for local scoping of CSS containers | ||
// For now it is mostly just an alias of generateIdentifier | ||
var createContainer = debugId => generateIdentifier(debugId); | ||
var defaultLayerOptions = {}; | ||
var merge = (obj1, obj2) => _objectSpread2(_objectSpread2({}, obj1), obj2); | ||
var getLayerArgs = function getLayerArgs() { | ||
var options = defaultLayerOptions; | ||
var debugId = arguments.length <= 0 ? undefined : arguments[0]; | ||
if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'object') { | ||
options = deepmerge(defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
options = merge(defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
} | ||
return [options, debugId]; | ||
}; | ||
function layer() { | ||
var [options, debugId] = getLayerArgs(...arguments); | ||
var name = generateIdentifier(debugId); | ||
if (options.parent) { | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
appendCss({ | ||
@@ -558,7 +514,5 @@ type: 'layer', | ||
var [options, name] = getLayerArgs(...arguments); | ||
if (options.parent) { | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
appendCss({ | ||
@@ -565,0 +519,0 @@ type: 'layer', |
import { Properties, AtRule } from 'csstype'; | ||
declare type CSSVarFunction = `var(--${string})` | `var(--${string}, ${string | number})`; | ||
declare type Contract = { | ||
type CSSVarFunction = `var(--${string})` | `var(--${string}, ${string | number})`; | ||
type Contract = { | ||
[key: string]: CSSVarFunction | null | Contract; | ||
}; | ||
declare type Primitive = string | boolean | number | null | undefined; | ||
declare type MapLeafNodes<Obj, LeafType> = { | ||
type Primitive = string | boolean | number | null | undefined; | ||
type MapLeafNodes<Obj, LeafType> = { | ||
[Prop in keyof Obj]: Obj[Prop] extends Primitive ? LeafType : Obj[Prop] extends Record<string | number, any> ? MapLeafNodes<Obj[Prop], LeafType> : never; | ||
@@ -22,2 +22,7 @@ }; | ||
readonly ':-webkit-full-screen': true; | ||
readonly '::-moz-color-swatch': true; | ||
readonly '::-moz-list-bullet': true; | ||
readonly '::-moz-list-number': true; | ||
readonly '::-moz-page-sequence': true; | ||
readonly '::-moz-page': true; | ||
readonly '::-moz-placeholder': true; | ||
@@ -28,2 +33,3 @@ readonly '::-moz-progress-bar': true; | ||
readonly '::-moz-range-track': true; | ||
readonly '::-moz-scrolled-page-sequence': true; | ||
readonly '::-moz-selection': true; | ||
@@ -34,5 +40,5 @@ readonly '::-ms-backdrop': true; | ||
readonly '::-ms-clear': true; | ||
readonly '::-ms-fill': true; | ||
readonly '::-ms-fill-lower': true; | ||
readonly '::-ms-fill-upper': true; | ||
readonly '::-ms-fill': true; | ||
readonly '::-ms-reveal': true; | ||
@@ -46,4 +52,12 @@ readonly '::-ms-thumb': true; | ||
readonly '::-webkit-backdrop': true; | ||
readonly '::-webkit-inner-spin-button': true; | ||
readonly '::-webkit-input-placeholder': true; | ||
readonly '::-webkit-meter-bar': true; | ||
readonly '::-webkit-meter-even-less-good-value': true; | ||
readonly '::-webkit-meter-inner-element': true; | ||
readonly '::-webkit-meter-optimum-value': true; | ||
readonly '::-webkit-meter-suboptimum-value': true; | ||
readonly '::-webkit-outer-spin-button': true; | ||
readonly '::-webkit-progress-bar': true; | ||
readonly '::-webkit-progress-inner-element': true; | ||
readonly '::-webkit-progress-inner-value': true; | ||
@@ -58,2 +72,4 @@ readonly '::-webkit-progress-value': true; | ||
readonly '::-webkit-scrollbar': true; | ||
readonly '::-webkit-search-cancel-button': true; | ||
readonly '::-webkit-search-results-button': true; | ||
readonly '::-webkit-slider-runnable-track': true; | ||
@@ -65,8 +81,16 @@ readonly '::-webkit-slider-thumb': true; | ||
readonly '::cue': true; | ||
readonly '::file-selector-button': true; | ||
readonly '::first-letter': true; | ||
readonly '::first-line': true; | ||
readonly '::grammar-error': true; | ||
readonly '::marker': true; | ||
readonly '::placeholder': true; | ||
readonly '::selection': true; | ||
readonly '::spelling-error': true; | ||
readonly '::target-text': true; | ||
readonly '::view-transition-group': true; | ||
readonly '::view-transition-image-pair': true; | ||
readonly '::view-transition-new': true; | ||
readonly '::view-transition-old': true; | ||
readonly '::view-transition': true; | ||
readonly ':active': true; | ||
@@ -83,3 +107,2 @@ readonly ':after': true; | ||
readonly ':enabled': true; | ||
readonly ':first': true; | ||
readonly ':first-child': true; | ||
@@ -89,5 +112,6 @@ readonly ':first-letter': true; | ||
readonly ':first-of-type': true; | ||
readonly ':focus': true; | ||
readonly ':first': true; | ||
readonly ':focus-visible': true; | ||
readonly ':focus-within': true; | ||
readonly ':focus': true; | ||
readonly ':fullscreen': true; | ||
@@ -117,3 +141,3 @@ readonly ':hover': true; | ||
}; | ||
declare type SimplePseudos = keyof typeof simplePseudoMap; | ||
type SimplePseudos = keyof typeof simplePseudoMap; | ||
@@ -125,4 +149,4 @@ interface ContainerProperties { | ||
} | ||
declare type CSSTypeProperties = Properties<number | (string & {})> & ContainerProperties; | ||
declare type CSSProperties = { | ||
type CSSTypeProperties = Properties<number | (string & {})> & ContainerProperties; | ||
type CSSProperties = { | ||
[Property in keyof CSSTypeProperties]: CSSTypeProperties[Property] | CSSVarFunction | Array<CSSVarFunction | CSSTypeProperties[Property]>; | ||
@@ -133,3 +157,3 @@ }; | ||
} | ||
declare type CSSPropertiesWithVars = CSSProperties & { | ||
type CSSPropertiesWithVars = CSSProperties & { | ||
vars?: { | ||
@@ -139,27 +163,18 @@ [key: string]: string; | ||
}; | ||
declare type PseudoProperties = { | ||
type PseudoProperties = { | ||
[key in SimplePseudos]?: CSSPropertiesWithVars; | ||
}; | ||
declare type CSSPropertiesAndPseudos = CSSPropertiesWithVars & PseudoProperties; | ||
interface MediaQueries<StyleType> { | ||
'@media'?: { | ||
[query: string]: StyleType; | ||
type CSSPropertiesAndPseudos = CSSPropertiesWithVars & PseudoProperties; | ||
type Query<Key extends string, StyleType> = { | ||
[key in Key]?: { | ||
[query: string]: Omit<StyleType, Key>; | ||
}; | ||
}; | ||
type MediaQueries<StyleType> = Query<'@media', StyleType>; | ||
type FeatureQueries<StyleType> = Query<'@supports', StyleType>; | ||
type ContainerQueries<StyleType> = Query<'@container', StyleType>; | ||
type Layers<StyleType> = Query<'@layer', StyleType>; | ||
interface AllQueries<StyleType> extends MediaQueries<StyleType & AllQueries<StyleType>>, FeatureQueries<StyleType & AllQueries<StyleType>>, ContainerQueries<StyleType & AllQueries<StyleType>>, Layers<StyleType & AllQueries<StyleType>> { | ||
} | ||
interface FeatureQueries<StyleType> { | ||
'@supports'?: { | ||
[query: string]: StyleType; | ||
}; | ||
} | ||
interface ContainerQueries<StyleType> { | ||
'@container'?: { | ||
[query: string]: StyleType; | ||
}; | ||
} | ||
interface Layer<StyleType> { | ||
'@layer'?: { | ||
[name: string]: StyleType; | ||
}; | ||
} | ||
declare type WithQueries<StyleType> = Layer<StyleType & MediaQueries<StyleType & FeatureQueries<StyleType> & ContainerQueries<StyleType>> & FeatureQueries<StyleType & MediaQueries<StyleType>> & ContainerQueries<StyleType & FeatureQueries<StyleType>>> & MediaQueries<StyleType & FeatureQueries<StyleType & ContainerQueries<StyleType>> & ContainerQueries<StyleType & FeatureQueries<StyleType>>> & FeatureQueries<StyleType & MediaQueries<StyleType & ContainerQueries<StyleType>> & ContainerQueries<StyleType & MediaQueries<StyleType>>> & ContainerQueries<StyleType & MediaQueries<StyleType & FeatureQueries<StyleType>> & FeatureQueries<StyleType & MediaQueries<StyleType>>>; | ||
type WithQueries<StyleType> = StyleType & AllQueries<StyleType>; | ||
interface SelectorMap { | ||
@@ -171,7 +186,7 @@ [selector: string]: CSSPropertiesWithVars & WithQueries<CSSPropertiesWithVars>; | ||
} | ||
declare type StyleRule = StyleWithSelectors & WithQueries<StyleWithSelectors>; | ||
declare type GlobalStyleRule = CSSPropertiesWithVars & WithQueries<CSSPropertiesWithVars>; | ||
declare type GlobalFontFaceRule = Omit<AtRule.FontFaceFallback, 'src'> & Required<Pick<AtRule.FontFaceFallback, 'src'>>; | ||
declare type FontFaceRule = Omit<GlobalFontFaceRule, 'fontFamily'>; | ||
declare type CSSStyleBlock = { | ||
type StyleRule = StyleWithSelectors & WithQueries<StyleWithSelectors>; | ||
type GlobalStyleRule = CSSPropertiesWithVars & WithQueries<CSSPropertiesWithVars>; | ||
type GlobalFontFaceRule = Omit<AtRule.FontFaceFallback, 'src'> & Required<Pick<AtRule.FontFaceFallback, 'src'>>; | ||
type FontFaceRule = Omit<GlobalFontFaceRule, 'fontFamily'>; | ||
type CSSStyleBlock = { | ||
type: 'local'; | ||
@@ -181,7 +196,7 @@ selector: string; | ||
}; | ||
declare type CSSFontFaceBlock = { | ||
type CSSFontFaceBlock = { | ||
type: 'fontFace'; | ||
rule: GlobalFontFaceRule; | ||
}; | ||
declare type CSSKeyframesBlock = { | ||
type CSSKeyframesBlock = { | ||
type: 'keyframes'; | ||
@@ -191,3 +206,3 @@ name: string; | ||
}; | ||
declare type CSSSelectorBlock = { | ||
type CSSSelectorBlock = { | ||
type: 'selector' | 'global'; | ||
@@ -197,8 +212,8 @@ selector: string; | ||
}; | ||
declare type CSSLayerDeclaration = { | ||
type CSSLayerDeclaration = { | ||
type: 'layer'; | ||
name: string; | ||
}; | ||
declare type CSS = CSSStyleBlock | CSSFontFaceBlock | CSSKeyframesBlock | CSSSelectorBlock | CSSLayerDeclaration; | ||
declare type FileScope = { | ||
type CSS = CSSStyleBlock | CSSFontFaceBlock | CSSKeyframesBlock | CSSSelectorBlock | CSSLayerDeclaration; | ||
type FileScope = { | ||
packageName?: string; | ||
@@ -211,20 +226,27 @@ filePath: string; | ||
} | ||
declare type IdentOption = 'short' | 'debug'; | ||
type CustomIdentFunction = (params: { | ||
hash: string; | ||
filePath: string; | ||
debugId?: string; | ||
packageName?: string; | ||
}) => string; | ||
type IdentOption = 'short' | 'debug' | CustomIdentFunction; | ||
interface Adapter { | ||
appendCss: (css: CSS, fileScope: FileScope) => void; | ||
registerClassName: (className: string) => void; | ||
registerComposition: (composition: Composition) => void; | ||
registerClassName: (className: string, fileScope: FileScope) => void; | ||
registerComposition: (composition: Composition, fileScope: FileScope) => void; | ||
markCompositionUsed: (identifier: string) => void; | ||
onBeginFileScope?: (fileScope: FileScope) => void; | ||
onEndFileScope: (fileScope: FileScope) => void; | ||
getIdentOption: () => IdentOption; | ||
} | ||
declare type NullableTokens = { | ||
type NullableTokens = { | ||
[key: string]: string | NullableTokens | null; | ||
}; | ||
declare type Tokens = { | ||
type Tokens = { | ||
[key: string]: string | Tokens; | ||
}; | ||
declare type ThemeVars<ThemeContract extends NullableTokens> = MapLeafNodes<ThemeContract, CSSVarFunction>; | ||
declare type ClassNames = string | Array<ClassNames>; | ||
declare type ComplexStyleRule = StyleRule | Array<StyleRule | ClassNames>; | ||
type ThemeVars<ThemeContract extends NullableTokens> = MapLeafNodes<ThemeContract, CSSVarFunction>; | ||
type ClassNames = string | Array<ClassNames>; | ||
type ComplexStyleRule = StyleRule | Array<StyleRule | ClassNames>; | ||
@@ -249,3 +271,3 @@ interface GenerateIdentifierOptions { | ||
declare function globalStyle(selector: string, rule: GlobalStyleRule): void; | ||
declare function fontFace(rule: FontFaceRule, debugId?: string): string; | ||
declare function fontFace(rule: FontFaceRule | FontFaceRule[], debugId?: string): string; | ||
declare function globalFontFace(fontFamily: string, rule: FontFaceRule): void; | ||
@@ -264,5 +286,5 @@ declare function keyframes(rule: CSSKeyframes, debugId?: string): string; | ||
declare const createContainer: (debugId?: string | undefined) => string; | ||
declare const createContainer: (debugId?: string) => string; | ||
declare type LayerOptions = { | ||
type LayerOptions = { | ||
parent?: string; | ||
@@ -269,0 +291,0 @@ }; |
@@ -6,3 +6,3 @@ 'use strict'; | ||
var injectStyles_dist_vanillaExtractCssInjectStyles = require('../injectStyles/dist/vanilla-extract-css-injectStyles.cjs.dev.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('./transformCss-12981ad8.cjs.dev.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('./transformCss-0eba15b2.cjs.dev.js'); | ||
var adapter_dist_vanillaExtractCssAdapter = require('../adapter/dist/vanilla-extract-css-adapter.cjs.dev.js'); | ||
@@ -15,6 +15,6 @@ var hash = require('@emotion/hash'); | ||
var chalk = require('chalk'); | ||
var taggedTemplateLiteral = require('./taggedTemplateLiteral-975613a0.cjs.dev.js'); | ||
var taggedTemplateLiteral = require('./taggedTemplateLiteral-4fcaa261.cjs.dev.js'); | ||
var outdent = require('outdent'); | ||
var deepmerge = require('deepmerge'); | ||
require('ahocorasick'); | ||
require('modern-ahocorasick'); | ||
require('css-what'); | ||
@@ -59,3 +59,2 @@ require('media-query-parser'); | ||
}; | ||
if (typeof window !== 'undefined') { | ||
@@ -77,3 +76,2 @@ adapter_dist_vanillaExtractCssAdapter.setAdapterIfNotSet(browserRuntimeAdapter); | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
@@ -93,52 +91,46 @@ constructor: { | ||
function _wrapRegExp() { | ||
_wrapRegExp = function (re, groups) { | ||
return new BabelRegExp(re, void 0, groups); | ||
_wrapRegExp = function (e, r) { | ||
return new BabelRegExp(e, void 0, r); | ||
}; | ||
var _super = RegExp.prototype, | ||
_groups = new WeakMap(); | ||
function BabelRegExp(re, flags, groups) { | ||
var _this = new RegExp(re, flags); | ||
return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype); | ||
var e = RegExp.prototype, | ||
r = new WeakMap(); | ||
function BabelRegExp(e, t, p) { | ||
var o = new RegExp(e, t); | ||
return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); | ||
} | ||
function buildGroups(result, re) { | ||
var g = _groups.get(re); | ||
return Object.keys(g).reduce(function (groups, name) { | ||
var i = g[name]; | ||
if ("number" == typeof i) groups[name] = result[i];else { | ||
for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) k++; | ||
groups[name] = result[i[k]]; | ||
function buildGroups(e, t) { | ||
var p = r.get(t); | ||
return Object.keys(p).reduce(function (r, t) { | ||
var o = p[t]; | ||
if ("number" == typeof o) r[t] = e[o];else { | ||
for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; | ||
r[t] = e[o[i]]; | ||
} | ||
return groups; | ||
return r; | ||
}, Object.create(null)); | ||
} | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { | ||
var result = _super.exec.call(this, str); | ||
return result && (result.groups = buildGroups(result, this)), result; | ||
}, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { | ||
if ("string" == typeof substitution) { | ||
var groups = _groups.get(this); | ||
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { | ||
return "$" + groups[name]; | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { | ||
var t = e.exec.call(this, r); | ||
if (t) { | ||
t.groups = buildGroups(t, this); | ||
var p = t.indices; | ||
p && (p.groups = buildGroups(p, this)); | ||
} | ||
return t; | ||
}, BabelRegExp.prototype[Symbol.replace] = function (t, p) { | ||
if ("string" == typeof p) { | ||
var o = r.get(this); | ||
return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { | ||
var t = o[r]; | ||
return "$" + (Array.isArray(t) ? t.join("$") : t); | ||
})); | ||
} | ||
if ("function" == typeof substitution) { | ||
var _this = this; | ||
return _super[Symbol.replace].call(this, str, function () { | ||
var args = arguments; | ||
return "object" != typeof args[args.length - 1] && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args); | ||
if ("function" == typeof p) { | ||
var i = this; | ||
return e[Symbol.replace].call(this, t, function () { | ||
var e = arguments; | ||
return "object" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); | ||
}); | ||
} | ||
return _super[Symbol.replace].call(this, str, substitution); | ||
return e[Symbol.replace].call(this, t, p); | ||
}, _wrapRegExp.apply(this, arguments); | ||
@@ -153,3 +145,2 @@ } | ||
var parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
if (debugFileName) { | ||
@@ -159,7 +150,6 @@ var { | ||
} = fileScope_dist_vanillaExtractCssFileScope.getFileScope(); | ||
var matches = filePath.match( /*#__PURE__*/_wrapRegExp(/((?:(?![\/\\])[\s\S])*)?[\/\\]?((?:(?![\/\\])[\s\S])*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/, { | ||
var matches = filePath.match( /*#__PURE__*/_wrapRegExp(/([^\/\\]*)?[\/\\]?([^\/\\]*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/, { | ||
dir: 1, | ||
file: 2 | ||
})); | ||
if (matches && matches.groups) { | ||
@@ -173,7 +163,9 @@ var { | ||
} | ||
return parts.join('_'); | ||
} | ||
function normalizeIdentifier(identifier) { | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
} | ||
function generateIdentifier(arg) { | ||
var identOption = adapter_dist_vanillaExtractCssAdapter.getIdentOption(); | ||
var { | ||
@@ -184,5 +176,5 @@ debugId, | ||
debugId: arg | ||
} : null), typeof arg === 'object' ? arg : null); // Convert ref count to base 36 for optimal hash lengths | ||
} : null), typeof arg === 'object' ? arg : null); | ||
// Convert ref count to base 36 for optimal hash lengths | ||
var refCount = fileScope_dist_vanillaExtractCssFileScope.getAndIncrementRefCounter().toString(36); | ||
@@ -195,4 +187,3 @@ var { | ||
var identifier = "".concat(fileScopeHash).concat(refCount); | ||
if (adapter_dist_vanillaExtractCssAdapter.getIdentOption() === 'debug') { | ||
if (identOption === 'debug') { | ||
var devPrefix = getDevPrefix({ | ||
@@ -202,13 +193,23 @@ debugId, | ||
}); | ||
if (devPrefix) { | ||
identifier = "".concat(devPrefix, "__").concat(identifier); | ||
} | ||
return normalizeIdentifier(identifier); | ||
} | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
if (typeof identOption === 'function') { | ||
identifier = identOption({ | ||
hash: identifier, | ||
debugId, | ||
filePath, | ||
packageName | ||
}); | ||
if (!identifier.match(/^[A-Z_][0-9A-Z_-]+$/i)) { | ||
throw new Error("Identifier function returned invalid indentifier: \"".concat(identifier, "\"")); | ||
} | ||
return identifier; | ||
} | ||
return normalizeIdentifier(identifier); | ||
} | ||
var normaliseObject = obj => _private.walkObject(obj, () => ''); | ||
function validateContract(contract, tokens) { | ||
@@ -222,7 +223,5 @@ var theDiff = deepObjectDiff.diff(normaliseObject(contract), normaliseObject(tokens)); | ||
} | ||
function diffLine(value, nesting, type) { | ||
var whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
var line = "".concat(type ? type : ' ').concat(whitespace).concat(value); | ||
if (process.env.NODE_ENV !== 'test') { | ||
@@ -232,3 +231,2 @@ if (type === '-') { | ||
} | ||
if (type === '+') { | ||
@@ -238,20 +236,14 @@ return chalk__default["default"].green(line); | ||
} | ||
return line; | ||
} | ||
function renderDiff(orig, diff) { | ||
var nesting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | ||
var lines = []; | ||
if (nesting === 0) { | ||
lines.push(diffLine('{', 0)); | ||
} | ||
var innerNesting = nesting + 1; | ||
var keys = Object.keys(diff).sort(); | ||
for (var key of keys) { | ||
var value = diff[key]; | ||
if (!(key in orig)) { | ||
@@ -267,7 +259,5 @@ lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '+')); | ||
} | ||
if (nesting === 0) { | ||
lines.push(diffLine('}', 0)); | ||
} | ||
return lines.join('\n'); | ||
@@ -287,7 +277,5 @@ } | ||
var finalValue = ''; | ||
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { | ||
values[_key] = arguments[_key]; | ||
} | ||
values.reverse().forEach(value => { | ||
@@ -300,3 +288,2 @@ if (finalValue === '') { | ||
} | ||
finalValue = value.replace(/\)$/, ", ".concat(finalValue, ")")); | ||
@@ -313,7 +300,5 @@ } | ||
} = validateContract(varContract, tokens); | ||
if (!valid) { | ||
throw new Error("Tokens don't match contract.\n".concat(diffString)); | ||
} | ||
_private.walkObject(tokens, (value, path) => { | ||
@@ -325,4 +310,2 @@ varSetters[_private.get(varContract, path)] = String(value); | ||
function createThemeContract(tokens) { | ||
// TS is giving type impossibly deep error here. Ignoring for now as this shouldn't affect consumers. | ||
// @ts-expect-error | ||
return _private.walkObject(tokens, (_value, path) => { | ||
@@ -336,3 +319,2 @@ return createVar(path.join('-')); | ||
var varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
if (typeof varName !== 'string' || varName !== cssesc__default["default"](varName, { | ||
@@ -343,3 +325,2 @@ isIdentifier: true | ||
} | ||
return "var(--".concat(varName, ")"); | ||
@@ -360,3 +341,2 @@ }); | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
if (shouldCreateVars) { | ||
@@ -368,3 +348,3 @@ return themeVars; | ||
var themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(themeClassName); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(themeClassName, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
var vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
@@ -375,9 +355,7 @@ return vars ? [themeClassName, vars] : themeClassName; | ||
var _templateObject; | ||
function composedStyle(rules, debugId) { | ||
var className = generateIdentifier(debugId); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
var classList = []; | ||
var styleRules = []; | ||
for (var rule of rules) { | ||
@@ -390,5 +368,3 @@ if (typeof rule === 'string') { | ||
} | ||
var result = className; | ||
if (classList.length > 0) { | ||
@@ -399,4 +375,3 @@ result = "".concat(className, " ").concat(transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList(classList)); | ||
classList: result | ||
}); | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
if (styleRules.length > 0) { | ||
@@ -408,3 +383,2 @@ // If there are styles attached to this composition then it is | ||
} | ||
if (styleRules.length > 0) { | ||
@@ -415,3 +389,2 @@ var _rule = deepmerge__default["default"].all(styleRules, { | ||
}); | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -423,6 +396,4 @@ type: 'local', | ||
} | ||
return result; | ||
} | ||
function style(rule, debugId) { | ||
@@ -432,5 +403,4 @@ if (Array.isArray(rule)) { | ||
} | ||
var className = generateIdentifier(debugId); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -443,13 +413,11 @@ type: 'local', | ||
} | ||
/** | ||
* @deprecated The same functionality is now provided by the 'style' function when you pass it an array | ||
*/ | ||
function composeStyles() { | ||
var compose = fileScope_dist_vanillaExtractCssFileScope.hasFileScope() ? composedStyle : transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList; | ||
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) { | ||
classNames[_key] = arguments[_key]; | ||
} | ||
return compose(classNames); | ||
@@ -468,13 +436,14 @@ } | ||
}), "\""); | ||
if ('fontFamily' in rule) { | ||
throw new Error(outdent__default["default"](_templateObject || (_templateObject = taggedTemplateLiteral._taggedTemplateLiteral(["\n This function creates and returns a hashed font-family name, so the \"fontFamily\" property should not be provided.\n \n If you'd like to define a globally scoped custom font, you can use the \"globalFontFace\" function instead.\n "])))); | ||
var rules = Array.isArray(rule) ? rule : [rule]; | ||
for (var singleRule of rules) { | ||
if ('fontFamily' in singleRule) { | ||
throw new Error(outdent__default["default"](_templateObject || (_templateObject = taggedTemplateLiteral._taggedTemplateLiteral(["\n This function creates and returns a hashed font-family name, so the \"fontFamily\" property should not be provided.\n \n If you'd like to define a globally scoped custom font, you can use the \"globalFontFace\" function instead.\n "])))); | ||
} | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
type: 'fontFace', | ||
rule: transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, singleRule), {}, { | ||
fontFamily | ||
}) | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
} | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
type: 'fontFace', | ||
rule: transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, rule), {}, { | ||
fontFamily | ||
}) | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
return fontFamily; | ||
@@ -511,53 +480,40 @@ } | ||
var _data = arguments.length <= 0 ? undefined : arguments[0]; | ||
var _mapData = arguments.length <= 1 ? undefined : arguments[1]; | ||
var _debugId = arguments.length <= 2 ? undefined : arguments[2]; | ||
var _classMap = {}; | ||
for (var _key2 in _data) { | ||
_classMap[_key2] = style(_mapData(_data[_key2], _key2), _debugId ? "".concat(_debugId, "_").concat(_key2) : _key2); | ||
} | ||
return _classMap; | ||
} | ||
var styleMap = arguments.length <= 0 ? undefined : arguments[0]; | ||
var debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
var classMap = {}; | ||
for (var _key3 in styleMap) { | ||
classMap[_key3] = style(styleMap[_key3], debugId ? "".concat(debugId, "_").concat(_key3) : _key3); | ||
} | ||
return classMap; | ||
} | ||
// createContainer is used for local scoping of CSS containers | ||
// For now it is mostly just an alias of generateIdentifier | ||
var createContainer = debugId => generateIdentifier(debugId); | ||
var defaultLayerOptions = {}; | ||
var merge = (obj1, obj2) => transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, obj1), obj2); | ||
var getLayerArgs = function getLayerArgs() { | ||
var options = defaultLayerOptions; | ||
var debugId = arguments.length <= 0 ? undefined : arguments[0]; | ||
if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'object') { | ||
options = deepmerge__default["default"](defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
options = merge(defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
} | ||
return [options, debugId]; | ||
}; | ||
function layer() { | ||
var [options, debugId] = getLayerArgs(...arguments); | ||
var name = generateIdentifier(debugId); | ||
if (options.parent) { | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -571,7 +527,5 @@ type: 'layer', | ||
var [options, name] = getLayerArgs(...arguments); | ||
if (options.parent) { | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -578,0 +532,0 @@ type: 'layer', |
@@ -6,3 +6,3 @@ 'use strict'; | ||
var injectStyles_dist_vanillaExtractCssInjectStyles = require('../injectStyles/dist/vanilla-extract-css-injectStyles.cjs.prod.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('./transformCss-e4a5ecbd.cjs.prod.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('./transformCss-6c6556ad.cjs.prod.js'); | ||
var adapter_dist_vanillaExtractCssAdapter = require('../adapter/dist/vanilla-extract-css-adapter.cjs.prod.js'); | ||
@@ -15,6 +15,6 @@ var hash = require('@emotion/hash'); | ||
var chalk = require('chalk'); | ||
var taggedTemplateLiteral = require('./taggedTemplateLiteral-bd61be83.cjs.prod.js'); | ||
var taggedTemplateLiteral = require('./taggedTemplateLiteral-0bfb2e96.cjs.prod.js'); | ||
var outdent = require('outdent'); | ||
var deepmerge = require('deepmerge'); | ||
require('ahocorasick'); | ||
require('modern-ahocorasick'); | ||
require('css-what'); | ||
@@ -59,3 +59,2 @@ require('media-query-parser'); | ||
}; | ||
if (typeof window !== 'undefined') { | ||
@@ -77,3 +76,2 @@ adapter_dist_vanillaExtractCssAdapter.setAdapterIfNotSet(browserRuntimeAdapter); | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
@@ -93,52 +91,46 @@ constructor: { | ||
function _wrapRegExp() { | ||
_wrapRegExp = function (re, groups) { | ||
return new BabelRegExp(re, void 0, groups); | ||
_wrapRegExp = function (e, r) { | ||
return new BabelRegExp(e, void 0, r); | ||
}; | ||
var _super = RegExp.prototype, | ||
_groups = new WeakMap(); | ||
function BabelRegExp(re, flags, groups) { | ||
var _this = new RegExp(re, flags); | ||
return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype); | ||
var e = RegExp.prototype, | ||
r = new WeakMap(); | ||
function BabelRegExp(e, t, p) { | ||
var o = new RegExp(e, t); | ||
return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); | ||
} | ||
function buildGroups(result, re) { | ||
var g = _groups.get(re); | ||
return Object.keys(g).reduce(function (groups, name) { | ||
var i = g[name]; | ||
if ("number" == typeof i) groups[name] = result[i];else { | ||
for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) k++; | ||
groups[name] = result[i[k]]; | ||
function buildGroups(e, t) { | ||
var p = r.get(t); | ||
return Object.keys(p).reduce(function (r, t) { | ||
var o = p[t]; | ||
if ("number" == typeof o) r[t] = e[o];else { | ||
for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; | ||
r[t] = e[o[i]]; | ||
} | ||
return groups; | ||
return r; | ||
}, Object.create(null)); | ||
} | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { | ||
var result = _super.exec.call(this, str); | ||
return result && (result.groups = buildGroups(result, this)), result; | ||
}, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { | ||
if ("string" == typeof substitution) { | ||
var groups = _groups.get(this); | ||
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { | ||
return "$" + groups[name]; | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { | ||
var t = e.exec.call(this, r); | ||
if (t) { | ||
t.groups = buildGroups(t, this); | ||
var p = t.indices; | ||
p && (p.groups = buildGroups(p, this)); | ||
} | ||
return t; | ||
}, BabelRegExp.prototype[Symbol.replace] = function (t, p) { | ||
if ("string" == typeof p) { | ||
var o = r.get(this); | ||
return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { | ||
var t = o[r]; | ||
return "$" + (Array.isArray(t) ? t.join("$") : t); | ||
})); | ||
} | ||
if ("function" == typeof substitution) { | ||
var _this = this; | ||
return _super[Symbol.replace].call(this, str, function () { | ||
var args = arguments; | ||
return "object" != typeof args[args.length - 1] && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args); | ||
if ("function" == typeof p) { | ||
var i = this; | ||
return e[Symbol.replace].call(this, t, function () { | ||
var e = arguments; | ||
return "object" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); | ||
}); | ||
} | ||
return _super[Symbol.replace].call(this, str, substitution); | ||
return e[Symbol.replace].call(this, t, p); | ||
}, _wrapRegExp.apply(this, arguments); | ||
@@ -153,3 +145,2 @@ } | ||
var parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
if (debugFileName) { | ||
@@ -159,7 +150,6 @@ var { | ||
} = fileScope_dist_vanillaExtractCssFileScope.getFileScope(); | ||
var matches = filePath.match( /*#__PURE__*/_wrapRegExp(/((?:(?![\/\\])[\s\S])*)?[\/\\]?((?:(?![\/\\])[\s\S])*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/, { | ||
var matches = filePath.match( /*#__PURE__*/_wrapRegExp(/([^\/\\]*)?[\/\\]?([^\/\\]*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/, { | ||
dir: 1, | ||
file: 2 | ||
})); | ||
if (matches && matches.groups) { | ||
@@ -173,7 +163,9 @@ var { | ||
} | ||
return parts.join('_'); | ||
} | ||
function normalizeIdentifier(identifier) { | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
} | ||
function generateIdentifier(arg) { | ||
var identOption = adapter_dist_vanillaExtractCssAdapter.getIdentOption(); | ||
var { | ||
@@ -184,5 +176,5 @@ debugId, | ||
debugId: arg | ||
} : null), typeof arg === 'object' ? arg : null); // Convert ref count to base 36 for optimal hash lengths | ||
} : null), typeof arg === 'object' ? arg : null); | ||
// Convert ref count to base 36 for optimal hash lengths | ||
var refCount = fileScope_dist_vanillaExtractCssFileScope.getAndIncrementRefCounter().toString(36); | ||
@@ -195,4 +187,3 @@ var { | ||
var identifier = "".concat(fileScopeHash).concat(refCount); | ||
if (adapter_dist_vanillaExtractCssAdapter.getIdentOption() === 'debug') { | ||
if (identOption === 'debug') { | ||
var devPrefix = getDevPrefix({ | ||
@@ -202,13 +193,23 @@ debugId, | ||
}); | ||
if (devPrefix) { | ||
identifier = "".concat(devPrefix, "__").concat(identifier); | ||
} | ||
return normalizeIdentifier(identifier); | ||
} | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
if (typeof identOption === 'function') { | ||
identifier = identOption({ | ||
hash: identifier, | ||
debugId, | ||
filePath, | ||
packageName | ||
}); | ||
if (!identifier.match(/^[A-Z_][0-9A-Z_-]+$/i)) { | ||
throw new Error("Identifier function returned invalid indentifier: \"".concat(identifier, "\"")); | ||
} | ||
return identifier; | ||
} | ||
return normalizeIdentifier(identifier); | ||
} | ||
var normaliseObject = obj => _private.walkObject(obj, () => ''); | ||
function validateContract(contract, tokens) { | ||
@@ -222,7 +223,5 @@ var theDiff = deepObjectDiff.diff(normaliseObject(contract), normaliseObject(tokens)); | ||
} | ||
function diffLine(value, nesting, type) { | ||
var whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
var line = "".concat(type ? type : ' ').concat(whitespace).concat(value); | ||
{ | ||
@@ -232,3 +231,2 @@ if (type === '-') { | ||
} | ||
if (type === '+') { | ||
@@ -238,20 +236,14 @@ return chalk__default["default"].green(line); | ||
} | ||
return line; | ||
} | ||
function renderDiff(orig, diff) { | ||
var nesting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | ||
var lines = []; | ||
if (nesting === 0) { | ||
lines.push(diffLine('{', 0)); | ||
} | ||
var innerNesting = nesting + 1; | ||
var keys = Object.keys(diff).sort(); | ||
for (var key of keys) { | ||
var value = diff[key]; | ||
if (!(key in orig)) { | ||
@@ -267,7 +259,5 @@ lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '+')); | ||
} | ||
if (nesting === 0) { | ||
lines.push(diffLine('}', 0)); | ||
} | ||
return lines.join('\n'); | ||
@@ -287,7 +277,5 @@ } | ||
var finalValue = ''; | ||
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { | ||
values[_key] = arguments[_key]; | ||
} | ||
values.reverse().forEach(value => { | ||
@@ -300,3 +288,2 @@ if (finalValue === '') { | ||
} | ||
finalValue = value.replace(/\)$/, ", ".concat(finalValue, ")")); | ||
@@ -313,7 +300,5 @@ } | ||
} = validateContract(varContract, tokens); | ||
if (!valid) { | ||
throw new Error("Tokens don't match contract.\n".concat(diffString)); | ||
} | ||
_private.walkObject(tokens, (value, path) => { | ||
@@ -325,4 +310,2 @@ varSetters[_private.get(varContract, path)] = String(value); | ||
function createThemeContract(tokens) { | ||
// TS is giving type impossibly deep error here. Ignoring for now as this shouldn't affect consumers. | ||
// @ts-expect-error | ||
return _private.walkObject(tokens, (_value, path) => { | ||
@@ -336,3 +319,2 @@ return createVar(path.join('-')); | ||
var varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
if (typeof varName !== 'string' || varName !== cssesc__default["default"](varName, { | ||
@@ -343,3 +325,2 @@ isIdentifier: true | ||
} | ||
return "var(--".concat(varName, ")"); | ||
@@ -360,3 +341,2 @@ }); | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
if (shouldCreateVars) { | ||
@@ -368,3 +348,3 @@ return themeVars; | ||
var themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(themeClassName); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(themeClassName, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
var vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
@@ -375,9 +355,7 @@ return vars ? [themeClassName, vars] : themeClassName; | ||
var _templateObject; | ||
function composedStyle(rules, debugId) { | ||
var className = generateIdentifier(debugId); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
var classList = []; | ||
var styleRules = []; | ||
for (var rule of rules) { | ||
@@ -390,5 +368,3 @@ if (typeof rule === 'string') { | ||
} | ||
var result = className; | ||
if (classList.length > 0) { | ||
@@ -399,4 +375,3 @@ result = "".concat(className, " ").concat(transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList(classList)); | ||
classList: result | ||
}); | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
if (styleRules.length > 0) { | ||
@@ -408,3 +383,2 @@ // If there are styles attached to this composition then it is | ||
} | ||
if (styleRules.length > 0) { | ||
@@ -415,3 +389,2 @@ var _rule = deepmerge__default["default"].all(styleRules, { | ||
}); | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -423,6 +396,4 @@ type: 'local', | ||
} | ||
return result; | ||
} | ||
function style(rule, debugId) { | ||
@@ -432,5 +403,4 @@ if (Array.isArray(rule)) { | ||
} | ||
var className = generateIdentifier(debugId); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -443,13 +413,11 @@ type: 'local', | ||
} | ||
/** | ||
* @deprecated The same functionality is now provided by the 'style' function when you pass it an array | ||
*/ | ||
function composeStyles() { | ||
var compose = fileScope_dist_vanillaExtractCssFileScope.hasFileScope() ? composedStyle : transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList; | ||
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) { | ||
classNames[_key] = arguments[_key]; | ||
} | ||
return compose(classNames); | ||
@@ -468,13 +436,14 @@ } | ||
}), "\""); | ||
if ('fontFamily' in rule) { | ||
throw new Error(outdent__default["default"](_templateObject || (_templateObject = taggedTemplateLiteral._taggedTemplateLiteral(["\n This function creates and returns a hashed font-family name, so the \"fontFamily\" property should not be provided.\n \n If you'd like to define a globally scoped custom font, you can use the \"globalFontFace\" function instead.\n "])))); | ||
var rules = Array.isArray(rule) ? rule : [rule]; | ||
for (var singleRule of rules) { | ||
if ('fontFamily' in singleRule) { | ||
throw new Error(outdent__default["default"](_templateObject || (_templateObject = taggedTemplateLiteral._taggedTemplateLiteral(["\n This function creates and returns a hashed font-family name, so the \"fontFamily\" property should not be provided.\n \n If you'd like to define a globally scoped custom font, you can use the \"globalFontFace\" function instead.\n "])))); | ||
} | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
type: 'fontFace', | ||
rule: transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, singleRule), {}, { | ||
fontFamily | ||
}) | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
} | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
type: 'fontFace', | ||
rule: transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, rule), {}, { | ||
fontFamily | ||
}) | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
return fontFamily; | ||
@@ -511,53 +480,40 @@ } | ||
var _data = arguments.length <= 0 ? undefined : arguments[0]; | ||
var _mapData = arguments.length <= 1 ? undefined : arguments[1]; | ||
var _debugId = arguments.length <= 2 ? undefined : arguments[2]; | ||
var _classMap = {}; | ||
for (var _key2 in _data) { | ||
_classMap[_key2] = style(_mapData(_data[_key2], _key2), _debugId ? "".concat(_debugId, "_").concat(_key2) : _key2); | ||
} | ||
return _classMap; | ||
} | ||
var styleMap = arguments.length <= 0 ? undefined : arguments[0]; | ||
var debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
var classMap = {}; | ||
for (var _key3 in styleMap) { | ||
classMap[_key3] = style(styleMap[_key3], debugId ? "".concat(debugId, "_").concat(_key3) : _key3); | ||
} | ||
return classMap; | ||
} | ||
// createContainer is used for local scoping of CSS containers | ||
// For now it is mostly just an alias of generateIdentifier | ||
var createContainer = debugId => generateIdentifier(debugId); | ||
var defaultLayerOptions = {}; | ||
var merge = (obj1, obj2) => transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, obj1), obj2); | ||
var getLayerArgs = function getLayerArgs() { | ||
var options = defaultLayerOptions; | ||
var debugId = arguments.length <= 0 ? undefined : arguments[0]; | ||
if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'object') { | ||
options = deepmerge__default["default"](defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
options = merge(defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
} | ||
return [options, debugId]; | ||
}; | ||
function layer() { | ||
var [options, debugId] = getLayerArgs(...arguments); | ||
var name = generateIdentifier(debugId); | ||
if (options.parent) { | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -571,7 +527,5 @@ type: 'layer', | ||
var [options, name] = getLayerArgs(...arguments); | ||
if (options.parent) { | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -578,0 +532,0 @@ type: 'layer', |
import { injectStyles } from '../injectStyles/dist/vanilla-extract-css-injectStyles.esm.js'; | ||
import { t as transformCss, _ as _objectSpread2, d as dudupeAndJoinClassList } from './transformCss-f2f59db1.esm.js'; | ||
import { t as transformCss, _ as _objectSpread2, d as dudupeAndJoinClassList } from './transformCss-f4b0f46b.esm.js'; | ||
import { setAdapterIfNotSet, getIdentOption, appendCss, registerClassName, registerComposition, markCompositionUsed } from '../adapter/dist/vanilla-extract-css-adapter.esm.js'; | ||
@@ -10,6 +10,6 @@ import hash from '@emotion/hash'; | ||
import chalk from 'chalk'; | ||
import { _ as _taggedTemplateLiteral } from './taggedTemplateLiteral-b4c22b04.esm.js'; | ||
import { _ as _taggedTemplateLiteral } from './taggedTemplateLiteral-10998315.esm.js'; | ||
import outdent from 'outdent'; | ||
import deepmerge from 'deepmerge'; | ||
import 'ahocorasick'; | ||
import 'modern-ahocorasick'; | ||
import 'css-what'; | ||
@@ -46,3 +46,2 @@ import 'media-query-parser'; | ||
}; | ||
if (typeof window !== 'undefined') { | ||
@@ -64,3 +63,2 @@ setAdapterIfNotSet(browserRuntimeAdapter); | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
@@ -80,52 +78,46 @@ constructor: { | ||
function _wrapRegExp() { | ||
_wrapRegExp = function (re, groups) { | ||
return new BabelRegExp(re, void 0, groups); | ||
_wrapRegExp = function (e, r) { | ||
return new BabelRegExp(e, void 0, r); | ||
}; | ||
var _super = RegExp.prototype, | ||
_groups = new WeakMap(); | ||
function BabelRegExp(re, flags, groups) { | ||
var _this = new RegExp(re, flags); | ||
return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype); | ||
var e = RegExp.prototype, | ||
r = new WeakMap(); | ||
function BabelRegExp(e, t, p) { | ||
var o = new RegExp(e, t); | ||
return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); | ||
} | ||
function buildGroups(result, re) { | ||
var g = _groups.get(re); | ||
return Object.keys(g).reduce(function (groups, name) { | ||
var i = g[name]; | ||
if ("number" == typeof i) groups[name] = result[i];else { | ||
for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) k++; | ||
groups[name] = result[i[k]]; | ||
function buildGroups(e, t) { | ||
var p = r.get(t); | ||
return Object.keys(p).reduce(function (r, t) { | ||
var o = p[t]; | ||
if ("number" == typeof o) r[t] = e[o];else { | ||
for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; | ||
r[t] = e[o[i]]; | ||
} | ||
return groups; | ||
return r; | ||
}, Object.create(null)); | ||
} | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { | ||
var result = _super.exec.call(this, str); | ||
return result && (result.groups = buildGroups(result, this)), result; | ||
}, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { | ||
if ("string" == typeof substitution) { | ||
var groups = _groups.get(this); | ||
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { | ||
return "$" + groups[name]; | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { | ||
var t = e.exec.call(this, r); | ||
if (t) { | ||
t.groups = buildGroups(t, this); | ||
var p = t.indices; | ||
p && (p.groups = buildGroups(p, this)); | ||
} | ||
return t; | ||
}, BabelRegExp.prototype[Symbol.replace] = function (t, p) { | ||
if ("string" == typeof p) { | ||
var o = r.get(this); | ||
return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { | ||
var t = o[r]; | ||
return "$" + (Array.isArray(t) ? t.join("$") : t); | ||
})); | ||
} | ||
if ("function" == typeof substitution) { | ||
var _this = this; | ||
return _super[Symbol.replace].call(this, str, function () { | ||
var args = arguments; | ||
return "object" != typeof args[args.length - 1] && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args); | ||
if ("function" == typeof p) { | ||
var i = this; | ||
return e[Symbol.replace].call(this, t, function () { | ||
var e = arguments; | ||
return "object" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); | ||
}); | ||
} | ||
return _super[Symbol.replace].call(this, str, substitution); | ||
return e[Symbol.replace].call(this, t, p); | ||
}, _wrapRegExp.apply(this, arguments); | ||
@@ -140,3 +132,2 @@ } | ||
var parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
if (debugFileName) { | ||
@@ -146,7 +137,6 @@ var { | ||
} = getFileScope(); | ||
var matches = filePath.match( /*#__PURE__*/_wrapRegExp(/((?:(?![\/\\])[\s\S])*)?[\/\\]?((?:(?![\/\\])[\s\S])*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/, { | ||
var matches = filePath.match( /*#__PURE__*/_wrapRegExp(/([^\/\\]*)?[\/\\]?([^\/\\]*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/, { | ||
dir: 1, | ||
file: 2 | ||
})); | ||
if (matches && matches.groups) { | ||
@@ -160,7 +150,9 @@ var { | ||
} | ||
return parts.join('_'); | ||
} | ||
function normalizeIdentifier(identifier) { | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
} | ||
function generateIdentifier(arg) { | ||
var identOption = getIdentOption(); | ||
var { | ||
@@ -171,5 +163,5 @@ debugId, | ||
debugId: arg | ||
} : null), typeof arg === 'object' ? arg : null); // Convert ref count to base 36 for optimal hash lengths | ||
} : null), typeof arg === 'object' ? arg : null); | ||
// Convert ref count to base 36 for optimal hash lengths | ||
var refCount = getAndIncrementRefCounter().toString(36); | ||
@@ -182,4 +174,3 @@ var { | ||
var identifier = "".concat(fileScopeHash).concat(refCount); | ||
if (getIdentOption() === 'debug') { | ||
if (identOption === 'debug') { | ||
var devPrefix = getDevPrefix({ | ||
@@ -189,13 +180,23 @@ debugId, | ||
}); | ||
if (devPrefix) { | ||
identifier = "".concat(devPrefix, "__").concat(identifier); | ||
} | ||
return normalizeIdentifier(identifier); | ||
} | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
if (typeof identOption === 'function') { | ||
identifier = identOption({ | ||
hash: identifier, | ||
debugId, | ||
filePath, | ||
packageName | ||
}); | ||
if (!identifier.match(/^[A-Z_][0-9A-Z_-]+$/i)) { | ||
throw new Error("Identifier function returned invalid indentifier: \"".concat(identifier, "\"")); | ||
} | ||
return identifier; | ||
} | ||
return normalizeIdentifier(identifier); | ||
} | ||
var normaliseObject = obj => walkObject(obj, () => ''); | ||
function validateContract(contract, tokens) { | ||
@@ -209,7 +210,5 @@ var theDiff = diff(normaliseObject(contract), normaliseObject(tokens)); | ||
} | ||
function diffLine(value, nesting, type) { | ||
var whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
var line = "".concat(type ? type : ' ').concat(whitespace).concat(value); | ||
if (process.env.NODE_ENV !== 'test') { | ||
@@ -219,3 +218,2 @@ if (type === '-') { | ||
} | ||
if (type === '+') { | ||
@@ -225,20 +223,14 @@ return chalk.green(line); | ||
} | ||
return line; | ||
} | ||
function renderDiff(orig, diff) { | ||
var nesting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | ||
var lines = []; | ||
if (nesting === 0) { | ||
lines.push(diffLine('{', 0)); | ||
} | ||
var innerNesting = nesting + 1; | ||
var keys = Object.keys(diff).sort(); | ||
for (var key of keys) { | ||
var value = diff[key]; | ||
if (!(key in orig)) { | ||
@@ -254,7 +246,5 @@ lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '+')); | ||
} | ||
if (nesting === 0) { | ||
lines.push(diffLine('}', 0)); | ||
} | ||
return lines.join('\n'); | ||
@@ -274,7 +264,5 @@ } | ||
var finalValue = ''; | ||
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { | ||
values[_key] = arguments[_key]; | ||
} | ||
values.reverse().forEach(value => { | ||
@@ -287,3 +275,2 @@ if (finalValue === '') { | ||
} | ||
finalValue = value.replace(/\)$/, ", ".concat(finalValue, ")")); | ||
@@ -300,7 +287,5 @@ } | ||
} = validateContract(varContract, tokens); | ||
if (!valid) { | ||
throw new Error("Tokens don't match contract.\n".concat(diffString)); | ||
} | ||
walkObject(tokens, (value, path) => { | ||
@@ -312,4 +297,2 @@ varSetters[get(varContract, path)] = String(value); | ||
function createThemeContract(tokens) { | ||
// TS is giving type impossibly deep error here. Ignoring for now as this shouldn't affect consumers. | ||
// @ts-expect-error | ||
return walkObject(tokens, (_value, path) => { | ||
@@ -323,3 +306,2 @@ return createVar(path.join('-')); | ||
var varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
if (typeof varName !== 'string' || varName !== cssesc(varName, { | ||
@@ -330,3 +312,2 @@ isIdentifier: true | ||
} | ||
return "var(--".concat(varName, ")"); | ||
@@ -347,3 +328,2 @@ }); | ||
}, getFileScope()); | ||
if (shouldCreateVars) { | ||
@@ -355,3 +335,3 @@ return themeVars; | ||
var themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
registerClassName(themeClassName); | ||
registerClassName(themeClassName, getFileScope()); | ||
var vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
@@ -362,9 +342,7 @@ return vars ? [themeClassName, vars] : themeClassName; | ||
var _templateObject; | ||
function composedStyle(rules, debugId) { | ||
var className = generateIdentifier(debugId); | ||
registerClassName(className); | ||
registerClassName(className, getFileScope()); | ||
var classList = []; | ||
var styleRules = []; | ||
for (var rule of rules) { | ||
@@ -377,5 +355,3 @@ if (typeof rule === 'string') { | ||
} | ||
var result = className; | ||
if (classList.length > 0) { | ||
@@ -386,4 +362,3 @@ result = "".concat(className, " ").concat(dudupeAndJoinClassList(classList)); | ||
classList: result | ||
}); | ||
}, getFileScope()); | ||
if (styleRules.length > 0) { | ||
@@ -395,3 +370,2 @@ // If there are styles attached to this composition then it is | ||
} | ||
if (styleRules.length > 0) { | ||
@@ -402,3 +376,2 @@ var _rule = deepmerge.all(styleRules, { | ||
}); | ||
appendCss({ | ||
@@ -410,6 +383,4 @@ type: 'local', | ||
} | ||
return result; | ||
} | ||
function style(rule, debugId) { | ||
@@ -419,5 +390,4 @@ if (Array.isArray(rule)) { | ||
} | ||
var className = generateIdentifier(debugId); | ||
registerClassName(className); | ||
registerClassName(className, getFileScope()); | ||
appendCss({ | ||
@@ -430,13 +400,11 @@ type: 'local', | ||
} | ||
/** | ||
* @deprecated The same functionality is now provided by the 'style' function when you pass it an array | ||
*/ | ||
function composeStyles() { | ||
var compose = hasFileScope() ? composedStyle : dudupeAndJoinClassList; | ||
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) { | ||
classNames[_key] = arguments[_key]; | ||
} | ||
return compose(classNames); | ||
@@ -455,13 +423,14 @@ } | ||
}), "\""); | ||
if ('fontFamily' in rule) { | ||
throw new Error(outdent(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n This function creates and returns a hashed font-family name, so the \"fontFamily\" property should not be provided.\n \n If you'd like to define a globally scoped custom font, you can use the \"globalFontFace\" function instead.\n "])))); | ||
var rules = Array.isArray(rule) ? rule : [rule]; | ||
for (var singleRule of rules) { | ||
if ('fontFamily' in singleRule) { | ||
throw new Error(outdent(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n This function creates and returns a hashed font-family name, so the \"fontFamily\" property should not be provided.\n \n If you'd like to define a globally scoped custom font, you can use the \"globalFontFace\" function instead.\n "])))); | ||
} | ||
appendCss({ | ||
type: 'fontFace', | ||
rule: _objectSpread2(_objectSpread2({}, singleRule), {}, { | ||
fontFamily | ||
}) | ||
}, getFileScope()); | ||
} | ||
appendCss({ | ||
type: 'fontFace', | ||
rule: _objectSpread2(_objectSpread2({}, rule), {}, { | ||
fontFamily | ||
}) | ||
}, getFileScope()); | ||
return fontFamily; | ||
@@ -498,53 +467,40 @@ } | ||
var _data = arguments.length <= 0 ? undefined : arguments[0]; | ||
var _mapData = arguments.length <= 1 ? undefined : arguments[1]; | ||
var _debugId = arguments.length <= 2 ? undefined : arguments[2]; | ||
var _classMap = {}; | ||
for (var _key2 in _data) { | ||
_classMap[_key2] = style(_mapData(_data[_key2], _key2), _debugId ? "".concat(_debugId, "_").concat(_key2) : _key2); | ||
} | ||
return _classMap; | ||
} | ||
var styleMap = arguments.length <= 0 ? undefined : arguments[0]; | ||
var debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
var classMap = {}; | ||
for (var _key3 in styleMap) { | ||
classMap[_key3] = style(styleMap[_key3], debugId ? "".concat(debugId, "_").concat(_key3) : _key3); | ||
} | ||
return classMap; | ||
} | ||
// createContainer is used for local scoping of CSS containers | ||
// For now it is mostly just an alias of generateIdentifier | ||
var createContainer = debugId => generateIdentifier(debugId); | ||
var defaultLayerOptions = {}; | ||
var merge = (obj1, obj2) => _objectSpread2(_objectSpread2({}, obj1), obj2); | ||
var getLayerArgs = function getLayerArgs() { | ||
var options = defaultLayerOptions; | ||
var debugId = arguments.length <= 0 ? undefined : arguments[0]; | ||
if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'object') { | ||
options = deepmerge(defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
options = merge(defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
} | ||
return [options, debugId]; | ||
}; | ||
function layer() { | ||
var [options, debugId] = getLayerArgs(...arguments); | ||
var name = generateIdentifier(debugId); | ||
if (options.parent) { | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
appendCss({ | ||
@@ -558,7 +514,5 @@ type: 'layer', | ||
var [options, name] = getLayerArgs(...arguments); | ||
if (options.parent) { | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
appendCss({ | ||
@@ -565,0 +519,0 @@ type: 'layer', |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var taggedTemplateLiteral = require('../../dist/taggedTemplateLiteral-c635af00.browser.cjs.js'); | ||
var taggedTemplateLiteral = require('../../dist/taggedTemplateLiteral-00b821ff.browser.cjs.js'); | ||
var outdent = require('outdent'); | ||
@@ -19,6 +19,8 @@ var adapter_dist_vanillaExtractCssAdapter = require('../../adapter/dist/vanilla-extract-css-adapter.browser.cjs.js'); | ||
refCounter = 0; | ||
fileScopes.unshift({ | ||
var fileScope = { | ||
filePath, | ||
packageName | ||
}); | ||
}; | ||
fileScopes.unshift(fileScope); | ||
adapter_dist_vanillaExtractCssAdapter.onBeginFileScope(fileScope); | ||
} | ||
@@ -37,3 +39,2 @@ function endFileScope() { | ||
} | ||
return fileScopes[0]; | ||
@@ -40,0 +41,0 @@ } |
@@ -1,4 +0,4 @@ | ||
import { _ as _taggedTemplateLiteral } from '../../dist/taggedTemplateLiteral-2d2668f5.browser.esm.js'; | ||
import { _ as _taggedTemplateLiteral } from '../../dist/taggedTemplateLiteral-8e47dbd7.browser.esm.js'; | ||
import outdent from 'outdent'; | ||
import { onEndFileScope } from '../../adapter/dist/vanilla-extract-css-adapter.browser.esm.js'; | ||
import { onBeginFileScope, onEndFileScope } from '../../adapter/dist/vanilla-extract-css-adapter.browser.esm.js'; | ||
@@ -10,6 +10,8 @@ var _templateObject; | ||
refCounter = 0; | ||
fileScopes.unshift({ | ||
var fileScope = { | ||
filePath, | ||
packageName | ||
}); | ||
}; | ||
fileScopes.unshift(fileScope); | ||
onBeginFileScope(fileScope); | ||
} | ||
@@ -28,3 +30,2 @@ function endFileScope() { | ||
} | ||
return fileScopes[0]; | ||
@@ -31,0 +32,0 @@ } |
@@ -1,2 +0,2 @@ | ||
declare type FileScope = { | ||
type FileScope = { | ||
packageName?: string; | ||
@@ -3,0 +3,0 @@ filePath: string; |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var taggedTemplateLiteral = require('../../dist/taggedTemplateLiteral-975613a0.cjs.dev.js'); | ||
var taggedTemplateLiteral = require('../../dist/taggedTemplateLiteral-4fcaa261.cjs.dev.js'); | ||
var outdent = require('outdent'); | ||
@@ -19,6 +19,8 @@ var adapter_dist_vanillaExtractCssAdapter = require('../../adapter/dist/vanilla-extract-css-adapter.cjs.dev.js'); | ||
refCounter = 0; | ||
fileScopes.unshift({ | ||
var fileScope = { | ||
filePath, | ||
packageName | ||
}); | ||
}; | ||
fileScopes.unshift(fileScope); | ||
adapter_dist_vanillaExtractCssAdapter.onBeginFileScope(fileScope); | ||
} | ||
@@ -37,3 +39,2 @@ function endFileScope() { | ||
} | ||
return fileScopes[0]; | ||
@@ -40,0 +41,0 @@ } |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var taggedTemplateLiteral = require('../../dist/taggedTemplateLiteral-bd61be83.cjs.prod.js'); | ||
var taggedTemplateLiteral = require('../../dist/taggedTemplateLiteral-0bfb2e96.cjs.prod.js'); | ||
var outdent = require('outdent'); | ||
@@ -19,6 +19,8 @@ var adapter_dist_vanillaExtractCssAdapter = require('../../adapter/dist/vanilla-extract-css-adapter.cjs.prod.js'); | ||
refCounter = 0; | ||
fileScopes.unshift({ | ||
var fileScope = { | ||
filePath, | ||
packageName | ||
}); | ||
}; | ||
fileScopes.unshift(fileScope); | ||
adapter_dist_vanillaExtractCssAdapter.onBeginFileScope(fileScope); | ||
} | ||
@@ -37,3 +39,2 @@ function endFileScope() { | ||
} | ||
return fileScopes[0]; | ||
@@ -40,0 +41,0 @@ } |
@@ -1,4 +0,4 @@ | ||
import { _ as _taggedTemplateLiteral } from '../../dist/taggedTemplateLiteral-b4c22b04.esm.js'; | ||
import { _ as _taggedTemplateLiteral } from '../../dist/taggedTemplateLiteral-10998315.esm.js'; | ||
import outdent from 'outdent'; | ||
import { onEndFileScope } from '../../adapter/dist/vanilla-extract-css-adapter.esm.js'; | ||
import { onBeginFileScope, onEndFileScope } from '../../adapter/dist/vanilla-extract-css-adapter.esm.js'; | ||
@@ -10,6 +10,8 @@ var _templateObject; | ||
refCounter = 0; | ||
fileScopes.unshift({ | ||
var fileScope = { | ||
filePath, | ||
packageName | ||
}); | ||
}; | ||
fileScopes.unshift(fileScope); | ||
onBeginFileScope(fileScope); | ||
} | ||
@@ -28,3 +30,2 @@ function endFileScope() { | ||
} | ||
return fileScopes[0]; | ||
@@ -31,0 +32,0 @@ } |
@@ -1,3 +0,3 @@ | ||
declare type Primitive = string | number | boolean | null | undefined; | ||
declare type Serializable = { | ||
type Primitive = string | number | boolean | null | undefined; | ||
type Serializable = { | ||
[Key in string | number]: Primitive | Serializable; | ||
@@ -4,0 +4,0 @@ } | ReadonlyArray<Primitive | Serializable>; |
@@ -13,10 +13,7 @@ 'use strict'; | ||
var stylesheet = stylesheets[fileScopeId]; | ||
if (!stylesheet) { | ||
var styleEl = document.createElement('style'); | ||
if (fileScope.packageName) { | ||
styleEl.setAttribute('data-package', fileScope.packageName); | ||
} | ||
styleEl.setAttribute('data-file', fileScope.filePath); | ||
@@ -27,3 +24,2 @@ styleEl.setAttribute('type', 'text/css'); | ||
} | ||
stylesheet.innerHTML = css; | ||
@@ -30,0 +26,0 @@ }; |
@@ -9,10 +9,7 @@ var stylesheets = {}; | ||
var stylesheet = stylesheets[fileScopeId]; | ||
if (!stylesheet) { | ||
var styleEl = document.createElement('style'); | ||
if (fileScope.packageName) { | ||
styleEl.setAttribute('data-package', fileScope.packageName); | ||
} | ||
styleEl.setAttribute('data-file', fileScope.filePath); | ||
@@ -23,3 +20,2 @@ styleEl.setAttribute('type', 'text/css'); | ||
} | ||
stylesheet.innerHTML = css; | ||
@@ -26,0 +22,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
declare type FileScope = { | ||
type FileScope = { | ||
packageName?: string; | ||
@@ -3,0 +3,0 @@ filePath: string; |
@@ -13,10 +13,7 @@ 'use strict'; | ||
var stylesheet = stylesheets[fileScopeId]; | ||
if (!stylesheet) { | ||
var styleEl = document.createElement('style'); | ||
if (fileScope.packageName) { | ||
styleEl.setAttribute('data-package', fileScope.packageName); | ||
} | ||
styleEl.setAttribute('data-file', fileScope.filePath); | ||
@@ -27,3 +24,2 @@ styleEl.setAttribute('type', 'text/css'); | ||
} | ||
stylesheet.innerHTML = css; | ||
@@ -30,0 +26,0 @@ }; |
@@ -13,10 +13,7 @@ 'use strict'; | ||
var stylesheet = stylesheets[fileScopeId]; | ||
if (!stylesheet) { | ||
var styleEl = document.createElement('style'); | ||
if (fileScope.packageName) { | ||
styleEl.setAttribute('data-package', fileScope.packageName); | ||
} | ||
styleEl.setAttribute('data-file', fileScope.filePath); | ||
@@ -27,3 +24,2 @@ styleEl.setAttribute('type', 'text/css'); | ||
} | ||
stylesheet.innerHTML = css; | ||
@@ -30,0 +26,0 @@ }; |
@@ -9,10 +9,7 @@ var stylesheets = {}; | ||
var stylesheet = stylesheets[fileScopeId]; | ||
if (!stylesheet) { | ||
var styleEl = document.createElement('style'); | ||
if (fileScope.packageName) { | ||
styleEl.setAttribute('data-package', fileScope.packageName); | ||
} | ||
styleEl.setAttribute('data-file', fileScope.filePath); | ||
@@ -23,3 +20,2 @@ styleEl.setAttribute('type', 'text/css'); | ||
} | ||
stylesheet.innerHTML = css; | ||
@@ -26,0 +22,0 @@ }; |
{ | ||
"name": "@vanilla-extract/css", | ||
"version": "0.0.0-layers-20230322307", | ||
"version": "0.0.0-namespace-theme-tokens-20240321223951", | ||
"description": "Zero-runtime Stylesheets-in-TypeScript", | ||
@@ -111,11 +111,11 @@ "sideEffects": true, | ||
"@emotion/hash": "^0.9.0", | ||
"@vanilla-extract/private": "^1.0.3", | ||
"ahocorasick": "1.0.2", | ||
"@vanilla-extract/private": "0.0.0-namespace-theme-tokens-20240321223951", | ||
"chalk": "^4.1.1", | ||
"css-what": "^5.0.1", | ||
"css-what": "^6.1.0", | ||
"cssesc": "^3.0.0", | ||
"csstype": "^3.0.7", | ||
"deep-object-diff": "^1.1.0", | ||
"deep-object-diff": "^1.1.9", | ||
"deepmerge": "^4.2.2", | ||
"media-query-parser": "^2.0.2", | ||
"modern-ahocorasick": "^1.0.0", | ||
"outdent": "^0.8.0" | ||
@@ -122,0 +122,0 @@ }, |
@@ -10,5 +10,4 @@ 'use strict'; | ||
*/ | ||
var addRecipe = functionSerializer_dist_vanillaExtractCssFunctionSerializer.addFunctionSerializer; | ||
exports.addRecipe = addRecipe; |
@@ -6,5 +6,4 @@ import { addFunctionSerializer } from '../../functionSerializer/dist/vanilla-extract-css-functionSerializer.browser.esm.js'; | ||
*/ | ||
var addRecipe = addFunctionSerializer; | ||
export { addRecipe }; |
@@ -1,3 +0,3 @@ | ||
declare type Primitive = string | number | boolean | null | undefined; | ||
declare type Serializable = { | ||
type Primitive = string | number | boolean | null | undefined; | ||
type Serializable = { | ||
[Key in string | number]: Primitive | Serializable; | ||
@@ -4,0 +4,0 @@ } | ReadonlyArray<Primitive | Serializable>; |
@@ -10,5 +10,4 @@ 'use strict'; | ||
*/ | ||
var addRecipe = functionSerializer_dist_vanillaExtractCssFunctionSerializer.addFunctionSerializer; | ||
exports.addRecipe = addRecipe; |
@@ -10,5 +10,4 @@ 'use strict'; | ||
*/ | ||
var addRecipe = functionSerializer_dist_vanillaExtractCssFunctionSerializer.addFunctionSerializer; | ||
exports.addRecipe = addRecipe; |
@@ -6,5 +6,4 @@ import { addFunctionSerializer } from '../../functionSerializer/dist/vanilla-extract-css-functionSerializer.esm.js'; | ||
*/ | ||
var addRecipe = addFunctionSerializer; | ||
export { addRecipe }; |
@@ -5,8 +5,8 @@ 'use strict'; | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('../../dist/transformCss-3e09c7cf.browser.cjs.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('../../dist/transformCss-1b35689a.browser.cjs.js'); | ||
require('@vanilla-extract/private'); | ||
require('cssesc'); | ||
require('ahocorasick'); | ||
require('modern-ahocorasick'); | ||
require('../../adapter/dist/vanilla-extract-css-adapter.browser.cjs.js'); | ||
require('../../dist/taggedTemplateLiteral-c635af00.browser.cjs.js'); | ||
require('../../dist/taggedTemplateLiteral-00b821ff.browser.cjs.js'); | ||
require('css-what'); | ||
@@ -13,0 +13,0 @@ require('outdent'); |
@@ -1,9 +0,9 @@ | ||
export { t as transformCss } from '../../dist/transformCss-fb298e8b.browser.esm.js'; | ||
export { t as transformCss } from '../../dist/transformCss-1f897e28.browser.esm.js'; | ||
import '@vanilla-extract/private'; | ||
import 'cssesc'; | ||
import 'ahocorasick'; | ||
import 'modern-ahocorasick'; | ||
import '../../adapter/dist/vanilla-extract-css-adapter.browser.esm.js'; | ||
import '../../dist/taggedTemplateLiteral-2d2668f5.browser.esm.js'; | ||
import '../../dist/taggedTemplateLiteral-8e47dbd7.browser.esm.js'; | ||
import 'css-what'; | ||
import 'outdent'; | ||
import 'media-query-parser'; |
import { AtRule, Properties } from 'csstype'; | ||
declare module 'ahocorasick' { | ||
export default class Ahocorasick { | ||
constructor(searchTerms: Array<string>); | ||
type CSSVarFunction = `var(--${string})` | `var(--${string}, ${string | number})`; | ||
search(input: string): Array<[endIndex: number, matches: Array<string>]>; | ||
} | ||
} | ||
declare type CSSVarFunction = `var(--${string})` | `var(--${string}, ${string | number})`; | ||
declare const simplePseudoMap: { | ||
@@ -23,2 +15,7 @@ readonly ':-moz-any-link': true; | ||
readonly ':-webkit-full-screen': true; | ||
readonly '::-moz-color-swatch': true; | ||
readonly '::-moz-list-bullet': true; | ||
readonly '::-moz-list-number': true; | ||
readonly '::-moz-page-sequence': true; | ||
readonly '::-moz-page': true; | ||
readonly '::-moz-placeholder': true; | ||
@@ -29,2 +26,3 @@ readonly '::-moz-progress-bar': true; | ||
readonly '::-moz-range-track': true; | ||
readonly '::-moz-scrolled-page-sequence': true; | ||
readonly '::-moz-selection': true; | ||
@@ -35,5 +33,5 @@ readonly '::-ms-backdrop': true; | ||
readonly '::-ms-clear': true; | ||
readonly '::-ms-fill': true; | ||
readonly '::-ms-fill-lower': true; | ||
readonly '::-ms-fill-upper': true; | ||
readonly '::-ms-fill': true; | ||
readonly '::-ms-reveal': true; | ||
@@ -47,4 +45,12 @@ readonly '::-ms-thumb': true; | ||
readonly '::-webkit-backdrop': true; | ||
readonly '::-webkit-inner-spin-button': true; | ||
readonly '::-webkit-input-placeholder': true; | ||
readonly '::-webkit-meter-bar': true; | ||
readonly '::-webkit-meter-even-less-good-value': true; | ||
readonly '::-webkit-meter-inner-element': true; | ||
readonly '::-webkit-meter-optimum-value': true; | ||
readonly '::-webkit-meter-suboptimum-value': true; | ||
readonly '::-webkit-outer-spin-button': true; | ||
readonly '::-webkit-progress-bar': true; | ||
readonly '::-webkit-progress-inner-element': true; | ||
readonly '::-webkit-progress-inner-value': true; | ||
@@ -59,2 +65,4 @@ readonly '::-webkit-progress-value': true; | ||
readonly '::-webkit-scrollbar': true; | ||
readonly '::-webkit-search-cancel-button': true; | ||
readonly '::-webkit-search-results-button': true; | ||
readonly '::-webkit-slider-runnable-track': true; | ||
@@ -66,8 +74,16 @@ readonly '::-webkit-slider-thumb': true; | ||
readonly '::cue': true; | ||
readonly '::file-selector-button': true; | ||
readonly '::first-letter': true; | ||
readonly '::first-line': true; | ||
readonly '::grammar-error': true; | ||
readonly '::marker': true; | ||
readonly '::placeholder': true; | ||
readonly '::selection': true; | ||
readonly '::spelling-error': true; | ||
readonly '::target-text': true; | ||
readonly '::view-transition-group': true; | ||
readonly '::view-transition-image-pair': true; | ||
readonly '::view-transition-new': true; | ||
readonly '::view-transition-old': true; | ||
readonly '::view-transition': true; | ||
readonly ':active': true; | ||
@@ -84,3 +100,2 @@ readonly ':after': true; | ||
readonly ':enabled': true; | ||
readonly ':first': true; | ||
readonly ':first-child': true; | ||
@@ -90,5 +105,6 @@ readonly ':first-letter': true; | ||
readonly ':first-of-type': true; | ||
readonly ':focus': true; | ||
readonly ':first': true; | ||
readonly ':focus-visible': true; | ||
readonly ':focus-within': true; | ||
readonly ':focus': true; | ||
readonly ':fullscreen': true; | ||
@@ -118,3 +134,3 @@ readonly ':hover': true; | ||
}; | ||
declare type SimplePseudos = keyof typeof simplePseudoMap; | ||
type SimplePseudos = keyof typeof simplePseudoMap; | ||
@@ -126,4 +142,4 @@ interface ContainerProperties { | ||
} | ||
declare type CSSTypeProperties = Properties<number | (string & {})> & ContainerProperties; | ||
declare type CSSProperties = { | ||
type CSSTypeProperties = Properties<number | (string & {})> & ContainerProperties; | ||
type CSSProperties = { | ||
[Property in keyof CSSTypeProperties]: CSSTypeProperties[Property] | CSSVarFunction | Array<CSSVarFunction | CSSTypeProperties[Property]>; | ||
@@ -134,3 +150,3 @@ }; | ||
} | ||
declare type CSSPropertiesWithVars = CSSProperties & { | ||
type CSSPropertiesWithVars = CSSProperties & { | ||
vars?: { | ||
@@ -140,27 +156,18 @@ [key: string]: string; | ||
}; | ||
declare type PseudoProperties = { | ||
type PseudoProperties = { | ||
[key in SimplePseudos]?: CSSPropertiesWithVars; | ||
}; | ||
declare type CSSPropertiesAndPseudos = CSSPropertiesWithVars & PseudoProperties; | ||
interface MediaQueries<StyleType> { | ||
'@media'?: { | ||
[query: string]: StyleType; | ||
type CSSPropertiesAndPseudos = CSSPropertiesWithVars & PseudoProperties; | ||
type Query<Key extends string, StyleType> = { | ||
[key in Key]?: { | ||
[query: string]: Omit<StyleType, Key>; | ||
}; | ||
}; | ||
type MediaQueries<StyleType> = Query<'@media', StyleType>; | ||
type FeatureQueries<StyleType> = Query<'@supports', StyleType>; | ||
type ContainerQueries<StyleType> = Query<'@container', StyleType>; | ||
type Layers<StyleType> = Query<'@layer', StyleType>; | ||
interface AllQueries<StyleType> extends MediaQueries<StyleType & AllQueries<StyleType>>, FeatureQueries<StyleType & AllQueries<StyleType>>, ContainerQueries<StyleType & AllQueries<StyleType>>, Layers<StyleType & AllQueries<StyleType>> { | ||
} | ||
interface FeatureQueries<StyleType> { | ||
'@supports'?: { | ||
[query: string]: StyleType; | ||
}; | ||
} | ||
interface ContainerQueries<StyleType> { | ||
'@container'?: { | ||
[query: string]: StyleType; | ||
}; | ||
} | ||
interface Layer<StyleType> { | ||
'@layer'?: { | ||
[name: string]: StyleType; | ||
}; | ||
} | ||
declare type WithQueries<StyleType> = Layer<StyleType & MediaQueries<StyleType & FeatureQueries<StyleType> & ContainerQueries<StyleType>> & FeatureQueries<StyleType & MediaQueries<StyleType>> & ContainerQueries<StyleType & FeatureQueries<StyleType>>> & MediaQueries<StyleType & FeatureQueries<StyleType & ContainerQueries<StyleType>> & ContainerQueries<StyleType & FeatureQueries<StyleType>>> & FeatureQueries<StyleType & MediaQueries<StyleType & ContainerQueries<StyleType>> & ContainerQueries<StyleType & MediaQueries<StyleType>>> & ContainerQueries<StyleType & MediaQueries<StyleType & FeatureQueries<StyleType>> & FeatureQueries<StyleType & MediaQueries<StyleType>>>; | ||
type WithQueries<StyleType> = StyleType & AllQueries<StyleType>; | ||
interface SelectorMap { | ||
@@ -172,6 +179,6 @@ [selector: string]: CSSPropertiesWithVars & WithQueries<CSSPropertiesWithVars>; | ||
} | ||
declare type StyleRule = StyleWithSelectors & WithQueries<StyleWithSelectors>; | ||
declare type GlobalStyleRule = CSSPropertiesWithVars & WithQueries<CSSPropertiesWithVars>; | ||
declare type GlobalFontFaceRule = Omit<AtRule.FontFaceFallback, 'src'> & Required<Pick<AtRule.FontFaceFallback, 'src'>>; | ||
declare type CSSStyleBlock = { | ||
type StyleRule = StyleWithSelectors & WithQueries<StyleWithSelectors>; | ||
type GlobalStyleRule = CSSPropertiesWithVars & WithQueries<CSSPropertiesWithVars>; | ||
type GlobalFontFaceRule = Omit<AtRule.FontFaceFallback, 'src'> & Required<Pick<AtRule.FontFaceFallback, 'src'>>; | ||
type CSSStyleBlock = { | ||
type: 'local'; | ||
@@ -181,7 +188,7 @@ selector: string; | ||
}; | ||
declare type CSSFontFaceBlock = { | ||
type CSSFontFaceBlock = { | ||
type: 'fontFace'; | ||
rule: GlobalFontFaceRule; | ||
}; | ||
declare type CSSKeyframesBlock = { | ||
type CSSKeyframesBlock = { | ||
type: 'keyframes'; | ||
@@ -191,3 +198,3 @@ name: string; | ||
}; | ||
declare type CSSSelectorBlock = { | ||
type CSSSelectorBlock = { | ||
type: 'selector' | 'global'; | ||
@@ -197,7 +204,7 @@ selector: string; | ||
}; | ||
declare type CSSLayerDeclaration = { | ||
type CSSLayerDeclaration = { | ||
type: 'layer'; | ||
name: string; | ||
}; | ||
declare type CSS = CSSStyleBlock | CSSFontFaceBlock | CSSKeyframesBlock | CSSSelectorBlock | CSSLayerDeclaration; | ||
type CSS = CSSStyleBlock | CSSFontFaceBlock | CSSKeyframesBlock | CSSSelectorBlock | CSSLayerDeclaration; | ||
interface Composition { | ||
@@ -204,0 +211,0 @@ identifier: string; |
@@ -5,8 +5,8 @@ 'use strict'; | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('../../dist/transformCss-12981ad8.cjs.dev.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('../../dist/transformCss-0eba15b2.cjs.dev.js'); | ||
require('@vanilla-extract/private'); | ||
require('cssesc'); | ||
require('ahocorasick'); | ||
require('modern-ahocorasick'); | ||
require('../../adapter/dist/vanilla-extract-css-adapter.cjs.dev.js'); | ||
require('../../dist/taggedTemplateLiteral-975613a0.cjs.dev.js'); | ||
require('../../dist/taggedTemplateLiteral-4fcaa261.cjs.dev.js'); | ||
require('css-what'); | ||
@@ -13,0 +13,0 @@ require('outdent'); |
@@ -5,8 +5,8 @@ 'use strict'; | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('../../dist/transformCss-e4a5ecbd.cjs.prod.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('../../dist/transformCss-6c6556ad.cjs.prod.js'); | ||
require('@vanilla-extract/private'); | ||
require('cssesc'); | ||
require('ahocorasick'); | ||
require('modern-ahocorasick'); | ||
require('../../adapter/dist/vanilla-extract-css-adapter.cjs.prod.js'); | ||
require('../../dist/taggedTemplateLiteral-bd61be83.cjs.prod.js'); | ||
require('../../dist/taggedTemplateLiteral-0bfb2e96.cjs.prod.js'); | ||
require('css-what'); | ||
@@ -13,0 +13,0 @@ require('outdent'); |
@@ -1,9 +0,9 @@ | ||
export { t as transformCss } from '../../dist/transformCss-f2f59db1.esm.js'; | ||
export { t as transformCss } from '../../dist/transformCss-f4b0f46b.esm.js'; | ||
import '@vanilla-extract/private'; | ||
import 'cssesc'; | ||
import 'ahocorasick'; | ||
import 'modern-ahocorasick'; | ||
import '../../adapter/dist/vanilla-extract-css-adapter.esm.js'; | ||
import '../../dist/taggedTemplateLiteral-b4c22b04.esm.js'; | ||
import '../../dist/taggedTemplateLiteral-10998315.esm.js'; | ||
import 'css-what'; | ||
import 'outdent'; | ||
import 'media-query-parser'; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
329698
84
8682
+ Addedmodern-ahocorasick@^1.0.0
+ Added@vanilla-extract/private@0.0.0-namespace-theme-tokens-20240321223951(transitive)
+ Addedcss-what@6.1.0(transitive)
+ Addedmodern-ahocorasick@1.1.0(transitive)
- Removedahocorasick@1.0.2
- Removed@vanilla-extract/private@1.0.6(transitive)
- Removedahocorasick@1.0.2(transitive)
- Removedcss-what@5.1.0(transitive)
Updated@vanilla-extract/private@0.0.0-namespace-theme-tokens-20240321223951
Updatedcss-what@^6.1.0
Updateddeep-object-diff@^1.1.9