@vanilla-extract/css
Advanced tools
Comparing version 0.0.0-vite-plugin-new-20240115025310 to 0.0.0-vite-plugin-new-20240115050437
@@ -5,3 +5,3 @@ 'use strict'; | ||
const mockAdapter = { | ||
var mockAdapter = { | ||
appendCss: () => {}, | ||
@@ -14,4 +14,4 @@ registerClassName: () => {}, | ||
}; | ||
const adapterStack = [mockAdapter]; | ||
const currentAdapter = () => { | ||
var adapterStack = [mockAdapter]; | ||
var currentAdapter = () => { | ||
if (adapterStack.length < 1) { | ||
@@ -22,4 +22,4 @@ throw new Error('No adapter configured'); | ||
}; | ||
let hasConfiguredAdapter = false; | ||
const setAdapterIfNotSet = newAdapter => { | ||
var hasConfiguredAdapter = false; | ||
var setAdapterIfNotSet = newAdapter => { | ||
if (!hasConfiguredAdapter) { | ||
@@ -29,3 +29,3 @@ setAdapter(newAdapter); | ||
}; | ||
const setAdapter = newAdapter => { | ||
var setAdapter = newAdapter => { | ||
if (!newAdapter) { | ||
@@ -37,25 +37,29 @@ throw new Error('No adapter provided when calling "setAdapter"'); | ||
}; | ||
const removeAdapter = () => { | ||
var removeAdapter = () => { | ||
adapterStack.pop(); | ||
}; | ||
const appendCss = (...props) => { | ||
return currentAdapter().appendCss(...props); | ||
var appendCss = function appendCss() { | ||
return currentAdapter().appendCss(...arguments); | ||
}; | ||
const registerClassName = (...props) => { | ||
return currentAdapter().registerClassName(...props); | ||
var registerClassName = function registerClassName() { | ||
return currentAdapter().registerClassName(...arguments); | ||
}; | ||
const registerComposition = (...props) => { | ||
return currentAdapter().registerComposition(...props); | ||
var registerComposition = function registerComposition() { | ||
return currentAdapter().registerComposition(...arguments); | ||
}; | ||
const markCompositionUsed = (...props) => { | ||
return currentAdapter().markCompositionUsed(...props); | ||
var markCompositionUsed = function markCompositionUsed() { | ||
return currentAdapter().markCompositionUsed(...arguments); | ||
}; | ||
const onBeginFileScope = (...props) => { | ||
return currentAdapter().onBeginFileScope?.(...props); | ||
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); | ||
}; | ||
const onEndFileScope = (...props) => { | ||
return currentAdapter().onEndFileScope(...props); | ||
var onEndFileScope = function onEndFileScope() { | ||
return currentAdapter().onEndFileScope(...arguments); | ||
}; | ||
const getIdentOption = (...props) => { | ||
const adapter = currentAdapter(); | ||
var getIdentOption = function getIdentOption() { | ||
var adapter = currentAdapter(); | ||
@@ -66,3 +70,3 @@ // Backwards compatibility with old versions of the integration package | ||
} | ||
return adapter.getIdentOption(...props); | ||
return adapter.getIdentOption(...arguments); | ||
}; | ||
@@ -69,0 +73,0 @@ |
@@ -1,2 +0,2 @@ | ||
const mockAdapter = { | ||
var mockAdapter = { | ||
appendCss: () => {}, | ||
@@ -9,4 +9,4 @@ registerClassName: () => {}, | ||
}; | ||
const adapterStack = [mockAdapter]; | ||
const currentAdapter = () => { | ||
var adapterStack = [mockAdapter]; | ||
var currentAdapter = () => { | ||
if (adapterStack.length < 1) { | ||
@@ -17,4 +17,4 @@ throw new Error('No adapter configured'); | ||
}; | ||
let hasConfiguredAdapter = false; | ||
const setAdapterIfNotSet = newAdapter => { | ||
var hasConfiguredAdapter = false; | ||
var setAdapterIfNotSet = newAdapter => { | ||
if (!hasConfiguredAdapter) { | ||
@@ -24,3 +24,3 @@ setAdapter(newAdapter); | ||
}; | ||
const setAdapter = newAdapter => { | ||
var setAdapter = newAdapter => { | ||
if (!newAdapter) { | ||
@@ -32,25 +32,29 @@ throw new Error('No adapter provided when calling "setAdapter"'); | ||
}; | ||
const removeAdapter = () => { | ||
var removeAdapter = () => { | ||
adapterStack.pop(); | ||
}; | ||
const appendCss = (...props) => { | ||
return currentAdapter().appendCss(...props); | ||
var appendCss = function appendCss() { | ||
return currentAdapter().appendCss(...arguments); | ||
}; | ||
const registerClassName = (...props) => { | ||
return currentAdapter().registerClassName(...props); | ||
var registerClassName = function registerClassName() { | ||
return currentAdapter().registerClassName(...arguments); | ||
}; | ||
const registerComposition = (...props) => { | ||
return currentAdapter().registerComposition(...props); | ||
var registerComposition = function registerComposition() { | ||
return currentAdapter().registerComposition(...arguments); | ||
}; | ||
const markCompositionUsed = (...props) => { | ||
return currentAdapter().markCompositionUsed(...props); | ||
var markCompositionUsed = function markCompositionUsed() { | ||
return currentAdapter().markCompositionUsed(...arguments); | ||
}; | ||
const onBeginFileScope = (...props) => { | ||
return currentAdapter().onBeginFileScope?.(...props); | ||
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); | ||
}; | ||
const onEndFileScope = (...props) => { | ||
return currentAdapter().onEndFileScope(...props); | ||
var onEndFileScope = function onEndFileScope() { | ||
return currentAdapter().onEndFileScope(...arguments); | ||
}; | ||
const getIdentOption = (...props) => { | ||
const adapter = currentAdapter(); | ||
var getIdentOption = function getIdentOption() { | ||
var adapter = currentAdapter(); | ||
@@ -61,5 +65,5 @@ // Backwards compatibility with old versions of the integration package | ||
} | ||
return adapter.getIdentOption(...props); | ||
return adapter.getIdentOption(...arguments); | ||
}; | ||
export { appendCss, getIdentOption, markCompositionUsed, mockAdapter, onBeginFileScope, onEndFileScope, registerClassName, registerComposition, removeAdapter, setAdapter, setAdapterIfNotSet }; |
@@ -5,3 +5,3 @@ 'use strict'; | ||
const mockAdapter = { | ||
var mockAdapter = { | ||
appendCss: () => {}, | ||
@@ -14,4 +14,4 @@ registerClassName: () => {}, | ||
}; | ||
const adapterStack = [mockAdapter]; | ||
const currentAdapter = () => { | ||
var adapterStack = [mockAdapter]; | ||
var currentAdapter = () => { | ||
if (adapterStack.length < 1) { | ||
@@ -22,4 +22,4 @@ throw new Error('No adapter configured'); | ||
}; | ||
let hasConfiguredAdapter = false; | ||
const setAdapterIfNotSet = newAdapter => { | ||
var hasConfiguredAdapter = false; | ||
var setAdapterIfNotSet = newAdapter => { | ||
if (!hasConfiguredAdapter) { | ||
@@ -29,3 +29,3 @@ setAdapter(newAdapter); | ||
}; | ||
const setAdapter = newAdapter => { | ||
var setAdapter = newAdapter => { | ||
if (!newAdapter) { | ||
@@ -37,25 +37,29 @@ throw new Error('No adapter provided when calling "setAdapter"'); | ||
}; | ||
const removeAdapter = () => { | ||
var removeAdapter = () => { | ||
adapterStack.pop(); | ||
}; | ||
const appendCss = (...props) => { | ||
return currentAdapter().appendCss(...props); | ||
var appendCss = function appendCss() { | ||
return currentAdapter().appendCss(...arguments); | ||
}; | ||
const registerClassName = (...props) => { | ||
return currentAdapter().registerClassName(...props); | ||
var registerClassName = function registerClassName() { | ||
return currentAdapter().registerClassName(...arguments); | ||
}; | ||
const registerComposition = (...props) => { | ||
return currentAdapter().registerComposition(...props); | ||
var registerComposition = function registerComposition() { | ||
return currentAdapter().registerComposition(...arguments); | ||
}; | ||
const markCompositionUsed = (...props) => { | ||
return currentAdapter().markCompositionUsed(...props); | ||
var markCompositionUsed = function markCompositionUsed() { | ||
return currentAdapter().markCompositionUsed(...arguments); | ||
}; | ||
const onBeginFileScope = (...props) => { | ||
return currentAdapter().onBeginFileScope?.(...props); | ||
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); | ||
}; | ||
const onEndFileScope = (...props) => { | ||
return currentAdapter().onEndFileScope(...props); | ||
var onEndFileScope = function onEndFileScope() { | ||
return currentAdapter().onEndFileScope(...arguments); | ||
}; | ||
const getIdentOption = (...props) => { | ||
const adapter = currentAdapter(); | ||
var getIdentOption = function getIdentOption() { | ||
var adapter = currentAdapter(); | ||
@@ -66,3 +70,3 @@ // Backwards compatibility with old versions of the integration package | ||
} | ||
return adapter.getIdentOption(...props); | ||
return adapter.getIdentOption(...arguments); | ||
}; | ||
@@ -69,0 +73,0 @@ |
@@ -5,3 +5,3 @@ 'use strict'; | ||
const mockAdapter = { | ||
var mockAdapter = { | ||
appendCss: () => {}, | ||
@@ -14,4 +14,4 @@ registerClassName: () => {}, | ||
}; | ||
const adapterStack = [mockAdapter]; | ||
const currentAdapter = () => { | ||
var adapterStack = [mockAdapter]; | ||
var currentAdapter = () => { | ||
if (adapterStack.length < 1) { | ||
@@ -22,4 +22,4 @@ throw new Error('No adapter configured'); | ||
}; | ||
let hasConfiguredAdapter = false; | ||
const setAdapterIfNotSet = newAdapter => { | ||
var hasConfiguredAdapter = false; | ||
var setAdapterIfNotSet = newAdapter => { | ||
if (!hasConfiguredAdapter) { | ||
@@ -29,3 +29,3 @@ setAdapter(newAdapter); | ||
}; | ||
const setAdapter = newAdapter => { | ||
var setAdapter = newAdapter => { | ||
if (!newAdapter) { | ||
@@ -37,25 +37,29 @@ throw new Error('No adapter provided when calling "setAdapter"'); | ||
}; | ||
const removeAdapter = () => { | ||
var removeAdapter = () => { | ||
adapterStack.pop(); | ||
}; | ||
const appendCss = (...props) => { | ||
return currentAdapter().appendCss(...props); | ||
var appendCss = function appendCss() { | ||
return currentAdapter().appendCss(...arguments); | ||
}; | ||
const registerClassName = (...props) => { | ||
return currentAdapter().registerClassName(...props); | ||
var registerClassName = function registerClassName() { | ||
return currentAdapter().registerClassName(...arguments); | ||
}; | ||
const registerComposition = (...props) => { | ||
return currentAdapter().registerComposition(...props); | ||
var registerComposition = function registerComposition() { | ||
return currentAdapter().registerComposition(...arguments); | ||
}; | ||
const markCompositionUsed = (...props) => { | ||
return currentAdapter().markCompositionUsed(...props); | ||
var markCompositionUsed = function markCompositionUsed() { | ||
return currentAdapter().markCompositionUsed(...arguments); | ||
}; | ||
const onBeginFileScope = (...props) => { | ||
return currentAdapter().onBeginFileScope?.(...props); | ||
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); | ||
}; | ||
const onEndFileScope = (...props) => { | ||
return currentAdapter().onEndFileScope(...props); | ||
var onEndFileScope = function onEndFileScope() { | ||
return currentAdapter().onEndFileScope(...arguments); | ||
}; | ||
const getIdentOption = (...props) => { | ||
const adapter = currentAdapter(); | ||
var getIdentOption = function getIdentOption() { | ||
var adapter = currentAdapter(); | ||
@@ -66,3 +70,3 @@ // Backwards compatibility with old versions of the integration package | ||
} | ||
return adapter.getIdentOption(...props); | ||
return adapter.getIdentOption(...arguments); | ||
}; | ||
@@ -69,0 +73,0 @@ |
@@ -1,2 +0,2 @@ | ||
const mockAdapter = { | ||
var mockAdapter = { | ||
appendCss: () => {}, | ||
@@ -9,4 +9,4 @@ registerClassName: () => {}, | ||
}; | ||
const adapterStack = [mockAdapter]; | ||
const currentAdapter = () => { | ||
var adapterStack = [mockAdapter]; | ||
var currentAdapter = () => { | ||
if (adapterStack.length < 1) { | ||
@@ -17,4 +17,4 @@ throw new Error('No adapter configured'); | ||
}; | ||
let hasConfiguredAdapter = false; | ||
const setAdapterIfNotSet = newAdapter => { | ||
var hasConfiguredAdapter = false; | ||
var setAdapterIfNotSet = newAdapter => { | ||
if (!hasConfiguredAdapter) { | ||
@@ -24,3 +24,3 @@ setAdapter(newAdapter); | ||
}; | ||
const setAdapter = newAdapter => { | ||
var setAdapter = newAdapter => { | ||
if (!newAdapter) { | ||
@@ -32,25 +32,29 @@ throw new Error('No adapter provided when calling "setAdapter"'); | ||
}; | ||
const removeAdapter = () => { | ||
var removeAdapter = () => { | ||
adapterStack.pop(); | ||
}; | ||
const appendCss = (...props) => { | ||
return currentAdapter().appendCss(...props); | ||
var appendCss = function appendCss() { | ||
return currentAdapter().appendCss(...arguments); | ||
}; | ||
const registerClassName = (...props) => { | ||
return currentAdapter().registerClassName(...props); | ||
var registerClassName = function registerClassName() { | ||
return currentAdapter().registerClassName(...arguments); | ||
}; | ||
const registerComposition = (...props) => { | ||
return currentAdapter().registerComposition(...props); | ||
var registerComposition = function registerComposition() { | ||
return currentAdapter().registerComposition(...arguments); | ||
}; | ||
const markCompositionUsed = (...props) => { | ||
return currentAdapter().markCompositionUsed(...props); | ||
var markCompositionUsed = function markCompositionUsed() { | ||
return currentAdapter().markCompositionUsed(...arguments); | ||
}; | ||
const onBeginFileScope = (...props) => { | ||
return currentAdapter().onBeginFileScope?.(...props); | ||
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); | ||
}; | ||
const onEndFileScope = (...props) => { | ||
return currentAdapter().onEndFileScope(...props); | ||
var onEndFileScope = function onEndFileScope() { | ||
return currentAdapter().onEndFileScope(...arguments); | ||
}; | ||
const getIdentOption = (...props) => { | ||
const adapter = currentAdapter(); | ||
var getIdentOption = function getIdentOption() { | ||
var adapter = currentAdapter(); | ||
@@ -61,5 +65,5 @@ // Backwards compatibility with old versions of the integration package | ||
} | ||
return adapter.getIdentOption(...props); | ||
return adapter.getIdentOption(...arguments); | ||
}; | ||
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-97c9e882.browser.cjs.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('./transformCss-31e8d994.browser.cjs.js'); | ||
var adapter_dist_vanillaExtractCssAdapter = require('../adapter/dist/vanilla-extract-css-adapter.browser.cjs.js'); | ||
@@ -15,2 +15,3 @@ var hash = require('@emotion/hash'); | ||
var chalk = require('chalk'); | ||
var taggedTemplateLiteral = require('./taggedTemplateLiteral-00b821ff.browser.cjs.js'); | ||
var outdent = require('outdent'); | ||
@@ -30,6 +31,6 @@ var deepmerge = require('deepmerge'); | ||
const localClassNames = new Set(); | ||
const composedClassLists = []; | ||
let bufferedCSSObjs = []; | ||
const browserRuntimeAdapter = { | ||
var localClassNames = new Set(); | ||
var composedClassLists = []; | ||
var bufferedCSSObjs = []; | ||
var browserRuntimeAdapter = { | ||
appendCss: cssObj => { | ||
@@ -46,3 +47,3 @@ bufferedCSSObjs.push(cssObj); | ||
onEndFileScope: fileScope => { | ||
const css = transformCss_dist_vanillaExtractCssTransformCss.transformCss({ | ||
var css = transformCss_dist_vanillaExtractCssTransformCss.transformCss({ | ||
localClassNames: Array.from(localClassNames), | ||
@@ -64,14 +65,91 @@ composedClassLists, | ||
function getDevPrefix({ | ||
debugId, | ||
debugFileName | ||
}) { | ||
const parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
} | ||
function _inherits(subClass, superClass) { | ||
if (typeof superClass !== "function" && superClass !== null) { | ||
throw new TypeError("Super expression must either be null or a function"); | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
constructor: { | ||
value: subClass, | ||
writable: true, | ||
configurable: true | ||
} | ||
}); | ||
Object.defineProperty(subClass, "prototype", { | ||
writable: false | ||
}); | ||
if (superClass) _setPrototypeOf(subClass, superClass); | ||
} | ||
function _wrapRegExp() { | ||
_wrapRegExp = function (re, groups) { | ||
return new BabelRegExp(re, void 0, groups); | ||
}; | ||
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); | ||
} | ||
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]]; | ||
} | ||
return groups; | ||
}, Object.create(null)); | ||
} | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { | ||
var result = _super.exec.call(this, str); | ||
if (result) { | ||
result.groups = buildGroups(result, this); | ||
var indices = result.indices; | ||
indices && (indices.groups = buildGroups(indices, this)); | ||
} | ||
return 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) { | ||
var group = groups[name]; | ||
return "$" + (Array.isArray(group) ? group.join("$") : group); | ||
})); | ||
} | ||
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); | ||
}); | ||
} | ||
return _super[Symbol.replace].call(this, str, substitution); | ||
}, _wrapRegExp.apply(this, arguments); | ||
} | ||
function getDevPrefix(_ref) { | ||
var { | ||
debugId, | ||
debugFileName | ||
} = _ref; | ||
var parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
if (debugFileName) { | ||
const { | ||
var { | ||
filePath | ||
} = fileScope_dist_vanillaExtractCssFileScope.getFileScope(); | ||
const matches = filePath.match(/(?<dir>[^\/\\]*)?[\/\\]?(?<file>[^\/\\]*)\.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) { | ||
const { | ||
var { | ||
dir, | ||
@@ -86,26 +164,23 @@ file | ||
function normalizeIdentifier(identifier) { | ||
return identifier.match(/^[0-9]/) ? `_${identifier}` : identifier; | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
} | ||
function generateIdentifier(arg) { | ||
const identOption = adapter_dist_vanillaExtractCssAdapter.getIdentOption(); | ||
const { | ||
var identOption = adapter_dist_vanillaExtractCssAdapter.getIdentOption(); | ||
var { | ||
debugId, | ||
debugFileName = true | ||
} = { | ||
...(typeof arg === 'string' ? { | ||
debugId: arg | ||
} : null), | ||
...(typeof arg === 'object' ? arg : null) | ||
}; | ||
} = transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, typeof arg === 'string' ? { | ||
debugId: arg | ||
} : null), typeof arg === 'object' ? arg : null); | ||
// Convert ref count to base 36 for optimal hash lengths | ||
const refCount = fileScope_dist_vanillaExtractCssFileScope.getAndIncrementRefCounter().toString(36); | ||
const { | ||
var refCount = fileScope_dist_vanillaExtractCssFileScope.getAndIncrementRefCounter().toString(36); | ||
var { | ||
filePath, | ||
packageName | ||
} = fileScope_dist_vanillaExtractCssFileScope.getFileScope(); | ||
const fileScopeHash = hash__default["default"](packageName ? `${packageName}${filePath}` : filePath); | ||
let identifier = `${fileScopeHash}${refCount}`; | ||
var fileScopeHash = hash__default["default"](packageName ? "".concat(packageName).concat(filePath) : filePath); | ||
var identifier = "".concat(fileScopeHash).concat(refCount); | ||
if (identOption === 'debug') { | ||
const devPrefix = getDevPrefix({ | ||
var devPrefix = getDevPrefix({ | ||
debugId, | ||
@@ -115,3 +190,3 @@ debugFileName | ||
if (devPrefix) { | ||
identifier = `${devPrefix}__${identifier}`; | ||
identifier = "".concat(devPrefix, "__").concat(identifier); | ||
} | ||
@@ -128,3 +203,3 @@ return normalizeIdentifier(identifier); | ||
if (!identifier.match(/^[A-Z_][0-9A-Z_]+$/i)) { | ||
throw new Error(`Identifier function returned invalid indentifier: "${identifier}"`); | ||
throw new Error("Identifier function returned invalid indentifier: \"".concat(identifier, "\"")); | ||
} | ||
@@ -136,6 +211,6 @@ return identifier; | ||
const normaliseObject = obj => _private.walkObject(obj, () => ''); | ||
var normaliseObject = obj => _private.walkObject(obj, () => ''); | ||
function validateContract(contract, tokens) { | ||
const theDiff = deepObjectDiff.diff(normaliseObject(contract), normaliseObject(tokens)); | ||
const valid = Object.keys(theDiff).length === 0; | ||
var theDiff = deepObjectDiff.diff(normaliseObject(contract), normaliseObject(tokens)); | ||
var valid = Object.keys(theDiff).length === 0; | ||
return { | ||
@@ -147,4 +222,4 @@ valid, | ||
function diffLine(value, nesting, type) { | ||
const whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
const line = `${type ? type : ' '}${whitespace}${value}`; | ||
var whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
var line = "".concat(type ? type : ' ').concat(whitespace).concat(value); | ||
if (process.env.NODE_ENV !== 'test') { | ||
@@ -160,19 +235,20 @@ if (type === '-') { | ||
} | ||
function renderDiff(orig, diff, nesting = 0) { | ||
const lines = []; | ||
function renderDiff(orig, diff) { | ||
var nesting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | ||
var lines = []; | ||
if (nesting === 0) { | ||
lines.push(diffLine('{', 0)); | ||
} | ||
const innerNesting = nesting + 1; | ||
const keys = Object.keys(diff).sort(); | ||
for (const key of keys) { | ||
const value = diff[key]; | ||
var innerNesting = nesting + 1; | ||
var keys = Object.keys(diff).sort(); | ||
for (var key of keys) { | ||
var value = diff[key]; | ||
if (!(key in orig)) { | ||
lines.push(diffLine(`${key}: ...,`, innerNesting, '+')); | ||
lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '+')); | ||
} else if (typeof value === 'object') { | ||
lines.push(diffLine(`${key}: {`, innerNesting)); | ||
lines.push(diffLine("".concat(key, ": {"), innerNesting)); | ||
lines.push(renderDiff(orig[key], diff[key], innerNesting)); | ||
lines.push(diffLine('}', innerNesting)); | ||
} else { | ||
lines.push(diffLine(`${key}: ...,`, innerNesting, '-')); | ||
lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '-')); | ||
} | ||
@@ -187,3 +263,3 @@ } | ||
function createVar(debugId) { | ||
const cssVarName = cssesc__default["default"](generateIdentifier({ | ||
var cssVarName = cssesc__default["default"](generateIdentifier({ | ||
debugId, | ||
@@ -194,6 +270,9 @@ debugFileName: false | ||
}); | ||
return `var(--${cssVarName})`; | ||
return "var(--".concat(cssVarName, ")"); | ||
} | ||
function fallbackVar(...values) { | ||
let finalValue = ''; | ||
function fallbackVar() { | ||
var finalValue = ''; | ||
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { | ||
values[_key] = arguments[_key]; | ||
} | ||
values.reverse().forEach(value => { | ||
@@ -204,5 +283,5 @@ if (finalValue === '') { | ||
if (typeof value !== 'string' || !/^var\(--.*\)$/.test(value)) { | ||
throw new Error(`Invalid variable name: ${value}`); | ||
throw new Error("Invalid variable name: ".concat(value)); | ||
} | ||
finalValue = value.replace(/\)$/, `, ${finalValue})`); | ||
finalValue = value.replace(/\)$/, ", ".concat(finalValue, ")")); | ||
} | ||
@@ -213,4 +292,4 @@ }); | ||
function assignVars(varContract, tokens) { | ||
const varSetters = {}; | ||
const { | ||
var varSetters = {}; | ||
var { | ||
valid, | ||
@@ -220,3 +299,3 @@ diffString | ||
if (!valid) { | ||
throw new Error(`Tokens don't match contract.\n${diffString}`); | ||
throw new Error("Tokens don't match contract.\n".concat(diffString)); | ||
} | ||
@@ -235,10 +314,10 @@ _private.walkObject(tokens, (value, path) => { | ||
return _private.walkObject(tokens, (value, path) => { | ||
const rawVarName = typeof mapFn === 'function' ? mapFn(value, path) : value; | ||
const varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
var rawVarName = typeof mapFn === 'function' ? mapFn(value, path) : value; | ||
var varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
if (typeof varName !== 'string' || varName !== cssesc__default["default"](varName, { | ||
isIdentifier: true | ||
})) { | ||
throw new Error(`Invalid variable name for "${path.join('.')}": ${varName}`); | ||
throw new Error("Invalid variable name for \"".concat(path.join('.'), "\": ").concat(varName)); | ||
} | ||
return `var(--${varName})`; | ||
return "var(--".concat(varName, ")"); | ||
}); | ||
@@ -248,5 +327,5 @@ } | ||
function createGlobalTheme(selector, arg2, arg3) { | ||
const shouldCreateVars = Boolean(!arg3); | ||
const themeVars = shouldCreateVars ? createThemeContract(arg2) : arg2; | ||
const tokens = shouldCreateVars ? arg2 : arg3; | ||
var shouldCreateVars = Boolean(!arg3); | ||
var themeVars = shouldCreateVars ? createThemeContract(arg2) : arg2; | ||
var tokens = shouldCreateVars ? arg2 : arg3; | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -264,14 +343,15 @@ type: 'global', | ||
function createTheme(arg1, arg2, arg3) { | ||
const themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
var themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(themeClassName, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
const vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
var vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
return vars ? [themeClassName, vars] : themeClassName; | ||
} | ||
var _templateObject; | ||
function composedStyle(rules, debugId) { | ||
const className = generateIdentifier(debugId); | ||
var className = generateIdentifier(debugId); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
const classList = []; | ||
const styleRules = []; | ||
for (const rule of rules) { | ||
var classList = []; | ||
var styleRules = []; | ||
for (var rule of rules) { | ||
if (typeof rule === 'string') { | ||
@@ -283,5 +363,5 @@ classList.push(rule); | ||
} | ||
let result = className; | ||
var result = className; | ||
if (classList.length > 0) { | ||
result = `${className} ${transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList(classList)}`; | ||
result = "".concat(className, " ").concat(transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList(classList)); | ||
adapter_dist_vanillaExtractCssAdapter.registerComposition({ | ||
@@ -298,3 +378,3 @@ identifier: className, | ||
if (styleRules.length > 0) { | ||
const rule = deepmerge__default["default"].all(styleRules, { | ||
var _rule = deepmerge__default["default"].all(styleRules, { | ||
// Replace arrays rather than merging | ||
@@ -306,3 +386,3 @@ arrayMerge: (_, sourceArray) => sourceArray | ||
selector: className, | ||
rule | ||
rule: _rule | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
@@ -316,3 +396,3 @@ } | ||
} | ||
const className = generateIdentifier(debugId); | ||
var className = generateIdentifier(debugId); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
@@ -330,4 +410,7 @@ adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
*/ | ||
function composeStyles(...classNames) { | ||
const compose = fileScope_dist_vanillaExtractCssFileScope.hasFileScope() ? composedStyle : transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList; | ||
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); | ||
@@ -343,20 +426,15 @@ } | ||
function fontFace(rule, debugId) { | ||
const fontFamily = `"${cssesc__default["default"](generateIdentifier(debugId), { | ||
var fontFamily = "\"".concat(cssesc__default["default"](generateIdentifier(debugId), { | ||
quotes: 'double' | ||
})}"`; | ||
const rules = Array.isArray(rule) ? rule : [rule]; | ||
for (const singleRule of rules) { | ||
}), "\""); | ||
var rules = Array.isArray(rule) ? rule : [rule]; | ||
for (var singleRule of rules) { | ||
if ('fontFamily' in singleRule) { | ||
throw new Error(outdent__default["default"]` | ||
This function creates and returns a hashed font-family name, so the "fontFamily" property should not be provided. | ||
If you'd like to define a globally scoped custom font, you can use the "globalFontFace" function instead. | ||
`); | ||
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: { | ||
...singleRule, | ||
rule: transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, singleRule), {}, { | ||
fontFamily | ||
} | ||
}) | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
@@ -369,10 +447,9 @@ } | ||
type: 'fontFace', | ||
rule: { | ||
...rule, | ||
rule: transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, rule), {}, { | ||
fontFamily | ||
} | ||
}) | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
} | ||
function keyframes(rule, debugId) { | ||
const name = cssesc__default["default"](generateIdentifier(debugId), { | ||
var name = cssesc__default["default"](generateIdentifier(debugId), { | ||
isIdentifier: true | ||
@@ -394,18 +471,18 @@ }); | ||
} | ||
function styleVariants(...args) { | ||
if (typeof args[1] === 'function') { | ||
const data = args[0]; | ||
const mapData = args[1]; | ||
const debugId = args[2]; | ||
const classMap = {}; | ||
for (const key in data) { | ||
classMap[key] = style(mapData(data[key], key), debugId ? `${debugId}_${key}` : key); | ||
function styleVariants() { | ||
if (typeof (arguments.length <= 1 ? undefined : arguments[1]) === 'function') { | ||
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; | ||
return _classMap; | ||
} | ||
const styleMap = args[0]; | ||
const debugId = args[1]; | ||
const classMap = {}; | ||
for (const key in styleMap) { | ||
classMap[key] = style(styleMap[key], debugId ? `${debugId}_${key}` : key); | ||
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); | ||
} | ||
@@ -417,23 +494,20 @@ return classMap; | ||
// For now it is mostly just an alias of generateIdentifier | ||
const createContainer = debugId => generateIdentifier(debugId); | ||
var createContainer = debugId => generateIdentifier(debugId); | ||
const defaultLayerOptions = {}; | ||
const merge = (obj1, obj2) => ({ | ||
...obj1, | ||
...obj2 | ||
}); | ||
const getLayerArgs = (...args) => { | ||
let options = defaultLayerOptions; | ||
let debugId = args[0]; | ||
if (typeof args[0] === 'object') { | ||
options = merge(defaultLayerOptions, args[0]); | ||
debugId = args[1]; | ||
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 = merge(defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
} | ||
return [options, debugId]; | ||
}; | ||
function layer(...args) { | ||
const [options, debugId] = getLayerArgs(...args); | ||
let name = generateIdentifier(debugId); | ||
function layer() { | ||
var [options, debugId] = getLayerArgs(...arguments); | ||
var name = generateIdentifier(debugId); | ||
if (options.parent) { | ||
name = `${options.parent}.${name}`; | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
@@ -446,6 +520,6 @@ adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
} | ||
function globalLayer(...args) { | ||
let [options, name] = getLayerArgs(...args); | ||
function globalLayer() { | ||
var [options, name] = getLayerArgs(...arguments); | ||
if (options.parent) { | ||
name = `${options.parent}.${name}`; | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
@@ -452,0 +526,0 @@ adapter_dist_vanillaExtractCssAdapter.appendCss({ |
import { injectStyles } from '../injectStyles/dist/vanilla-extract-css-injectStyles.browser.esm.js'; | ||
import { t as transformCss, d as dudupeAndJoinClassList } from './transformCss-35fbcc6e.browser.esm.js'; | ||
import { t as transformCss, _ as _objectSpread2, d as dudupeAndJoinClassList } from './transformCss-c4f994b8.browser.esm.js'; | ||
import { setAdapterIfNotSet, getIdentOption, appendCss, registerClassName, registerComposition, markCompositionUsed } from '../adapter/dist/vanilla-extract-css-adapter.browser.esm.js'; | ||
@@ -10,2 +10,3 @@ import hash from '@emotion/hash'; | ||
import chalk from 'chalk'; | ||
import { _ as _taggedTemplateLiteral } from './taggedTemplateLiteral-8e47dbd7.browser.esm.js'; | ||
import outdent from 'outdent'; | ||
@@ -17,6 +18,6 @@ import deepmerge from 'deepmerge'; | ||
const localClassNames = new Set(); | ||
const composedClassLists = []; | ||
let bufferedCSSObjs = []; | ||
const browserRuntimeAdapter = { | ||
var localClassNames = new Set(); | ||
var composedClassLists = []; | ||
var bufferedCSSObjs = []; | ||
var browserRuntimeAdapter = { | ||
appendCss: cssObj => { | ||
@@ -33,3 +34,3 @@ bufferedCSSObjs.push(cssObj); | ||
onEndFileScope: fileScope => { | ||
const css = transformCss({ | ||
var css = transformCss({ | ||
localClassNames: Array.from(localClassNames), | ||
@@ -51,14 +52,91 @@ composedClassLists, | ||
function getDevPrefix({ | ||
debugId, | ||
debugFileName | ||
}) { | ||
const parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
} | ||
function _inherits(subClass, superClass) { | ||
if (typeof superClass !== "function" && superClass !== null) { | ||
throw new TypeError("Super expression must either be null or a function"); | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
constructor: { | ||
value: subClass, | ||
writable: true, | ||
configurable: true | ||
} | ||
}); | ||
Object.defineProperty(subClass, "prototype", { | ||
writable: false | ||
}); | ||
if (superClass) _setPrototypeOf(subClass, superClass); | ||
} | ||
function _wrapRegExp() { | ||
_wrapRegExp = function (re, groups) { | ||
return new BabelRegExp(re, void 0, groups); | ||
}; | ||
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); | ||
} | ||
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]]; | ||
} | ||
return groups; | ||
}, Object.create(null)); | ||
} | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { | ||
var result = _super.exec.call(this, str); | ||
if (result) { | ||
result.groups = buildGroups(result, this); | ||
var indices = result.indices; | ||
indices && (indices.groups = buildGroups(indices, this)); | ||
} | ||
return 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) { | ||
var group = groups[name]; | ||
return "$" + (Array.isArray(group) ? group.join("$") : group); | ||
})); | ||
} | ||
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); | ||
}); | ||
} | ||
return _super[Symbol.replace].call(this, str, substitution); | ||
}, _wrapRegExp.apply(this, arguments); | ||
} | ||
function getDevPrefix(_ref) { | ||
var { | ||
debugId, | ||
debugFileName | ||
} = _ref; | ||
var parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
if (debugFileName) { | ||
const { | ||
var { | ||
filePath | ||
} = getFileScope(); | ||
const matches = filePath.match(/(?<dir>[^\/\\]*)?[\/\\]?(?<file>[^\/\\]*)\.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) { | ||
const { | ||
var { | ||
dir, | ||
@@ -73,26 +151,23 @@ file | ||
function normalizeIdentifier(identifier) { | ||
return identifier.match(/^[0-9]/) ? `_${identifier}` : identifier; | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
} | ||
function generateIdentifier(arg) { | ||
const identOption = getIdentOption(); | ||
const { | ||
var identOption = getIdentOption(); | ||
var { | ||
debugId, | ||
debugFileName = true | ||
} = { | ||
...(typeof arg === 'string' ? { | ||
debugId: arg | ||
} : null), | ||
...(typeof arg === 'object' ? arg : null) | ||
}; | ||
} = _objectSpread2(_objectSpread2({}, typeof arg === 'string' ? { | ||
debugId: arg | ||
} : null), typeof arg === 'object' ? arg : null); | ||
// Convert ref count to base 36 for optimal hash lengths | ||
const refCount = getAndIncrementRefCounter().toString(36); | ||
const { | ||
var refCount = getAndIncrementRefCounter().toString(36); | ||
var { | ||
filePath, | ||
packageName | ||
} = getFileScope(); | ||
const fileScopeHash = hash(packageName ? `${packageName}${filePath}` : filePath); | ||
let identifier = `${fileScopeHash}${refCount}`; | ||
var fileScopeHash = hash(packageName ? "".concat(packageName).concat(filePath) : filePath); | ||
var identifier = "".concat(fileScopeHash).concat(refCount); | ||
if (identOption === 'debug') { | ||
const devPrefix = getDevPrefix({ | ||
var devPrefix = getDevPrefix({ | ||
debugId, | ||
@@ -102,3 +177,3 @@ debugFileName | ||
if (devPrefix) { | ||
identifier = `${devPrefix}__${identifier}`; | ||
identifier = "".concat(devPrefix, "__").concat(identifier); | ||
} | ||
@@ -115,3 +190,3 @@ return normalizeIdentifier(identifier); | ||
if (!identifier.match(/^[A-Z_][0-9A-Z_]+$/i)) { | ||
throw new Error(`Identifier function returned invalid indentifier: "${identifier}"`); | ||
throw new Error("Identifier function returned invalid indentifier: \"".concat(identifier, "\"")); | ||
} | ||
@@ -123,6 +198,6 @@ return identifier; | ||
const normaliseObject = obj => walkObject(obj, () => ''); | ||
var normaliseObject = obj => walkObject(obj, () => ''); | ||
function validateContract(contract, tokens) { | ||
const theDiff = diff(normaliseObject(contract), normaliseObject(tokens)); | ||
const valid = Object.keys(theDiff).length === 0; | ||
var theDiff = diff(normaliseObject(contract), normaliseObject(tokens)); | ||
var valid = Object.keys(theDiff).length === 0; | ||
return { | ||
@@ -134,4 +209,4 @@ valid, | ||
function diffLine(value, nesting, type) { | ||
const whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
const line = `${type ? type : ' '}${whitespace}${value}`; | ||
var whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
var line = "".concat(type ? type : ' ').concat(whitespace).concat(value); | ||
if (process.env.NODE_ENV !== 'test') { | ||
@@ -147,19 +222,20 @@ if (type === '-') { | ||
} | ||
function renderDiff(orig, diff, nesting = 0) { | ||
const lines = []; | ||
function renderDiff(orig, diff) { | ||
var nesting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | ||
var lines = []; | ||
if (nesting === 0) { | ||
lines.push(diffLine('{', 0)); | ||
} | ||
const innerNesting = nesting + 1; | ||
const keys = Object.keys(diff).sort(); | ||
for (const key of keys) { | ||
const value = diff[key]; | ||
var innerNesting = nesting + 1; | ||
var keys = Object.keys(diff).sort(); | ||
for (var key of keys) { | ||
var value = diff[key]; | ||
if (!(key in orig)) { | ||
lines.push(diffLine(`${key}: ...,`, innerNesting, '+')); | ||
lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '+')); | ||
} else if (typeof value === 'object') { | ||
lines.push(diffLine(`${key}: {`, innerNesting)); | ||
lines.push(diffLine("".concat(key, ": {"), innerNesting)); | ||
lines.push(renderDiff(orig[key], diff[key], innerNesting)); | ||
lines.push(diffLine('}', innerNesting)); | ||
} else { | ||
lines.push(diffLine(`${key}: ...,`, innerNesting, '-')); | ||
lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '-')); | ||
} | ||
@@ -174,3 +250,3 @@ } | ||
function createVar(debugId) { | ||
const cssVarName = cssesc(generateIdentifier({ | ||
var cssVarName = cssesc(generateIdentifier({ | ||
debugId, | ||
@@ -181,6 +257,9 @@ debugFileName: false | ||
}); | ||
return `var(--${cssVarName})`; | ||
return "var(--".concat(cssVarName, ")"); | ||
} | ||
function fallbackVar(...values) { | ||
let finalValue = ''; | ||
function fallbackVar() { | ||
var finalValue = ''; | ||
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { | ||
values[_key] = arguments[_key]; | ||
} | ||
values.reverse().forEach(value => { | ||
@@ -191,5 +270,5 @@ if (finalValue === '') { | ||
if (typeof value !== 'string' || !/^var\(--.*\)$/.test(value)) { | ||
throw new Error(`Invalid variable name: ${value}`); | ||
throw new Error("Invalid variable name: ".concat(value)); | ||
} | ||
finalValue = value.replace(/\)$/, `, ${finalValue})`); | ||
finalValue = value.replace(/\)$/, ", ".concat(finalValue, ")")); | ||
} | ||
@@ -200,4 +279,4 @@ }); | ||
function assignVars(varContract, tokens) { | ||
const varSetters = {}; | ||
const { | ||
var varSetters = {}; | ||
var { | ||
valid, | ||
@@ -207,3 +286,3 @@ diffString | ||
if (!valid) { | ||
throw new Error(`Tokens don't match contract.\n${diffString}`); | ||
throw new Error("Tokens don't match contract.\n".concat(diffString)); | ||
} | ||
@@ -222,10 +301,10 @@ walkObject(tokens, (value, path) => { | ||
return walkObject(tokens, (value, path) => { | ||
const rawVarName = typeof mapFn === 'function' ? mapFn(value, path) : value; | ||
const varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
var rawVarName = typeof mapFn === 'function' ? mapFn(value, path) : value; | ||
var varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
if (typeof varName !== 'string' || varName !== cssesc(varName, { | ||
isIdentifier: true | ||
})) { | ||
throw new Error(`Invalid variable name for "${path.join('.')}": ${varName}`); | ||
throw new Error("Invalid variable name for \"".concat(path.join('.'), "\": ").concat(varName)); | ||
} | ||
return `var(--${varName})`; | ||
return "var(--".concat(varName, ")"); | ||
}); | ||
@@ -235,5 +314,5 @@ } | ||
function createGlobalTheme(selector, arg2, arg3) { | ||
const shouldCreateVars = Boolean(!arg3); | ||
const themeVars = shouldCreateVars ? createThemeContract(arg2) : arg2; | ||
const tokens = shouldCreateVars ? arg2 : arg3; | ||
var shouldCreateVars = Boolean(!arg3); | ||
var themeVars = shouldCreateVars ? createThemeContract(arg2) : arg2; | ||
var tokens = shouldCreateVars ? arg2 : arg3; | ||
appendCss({ | ||
@@ -251,14 +330,15 @@ type: 'global', | ||
function createTheme(arg1, arg2, arg3) { | ||
const themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
var themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
registerClassName(themeClassName, getFileScope()); | ||
const vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
var vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
return vars ? [themeClassName, vars] : themeClassName; | ||
} | ||
var _templateObject; | ||
function composedStyle(rules, debugId) { | ||
const className = generateIdentifier(debugId); | ||
var className = generateIdentifier(debugId); | ||
registerClassName(className, getFileScope()); | ||
const classList = []; | ||
const styleRules = []; | ||
for (const rule of rules) { | ||
var classList = []; | ||
var styleRules = []; | ||
for (var rule of rules) { | ||
if (typeof rule === 'string') { | ||
@@ -270,5 +350,5 @@ classList.push(rule); | ||
} | ||
let result = className; | ||
var result = className; | ||
if (classList.length > 0) { | ||
result = `${className} ${dudupeAndJoinClassList(classList)}`; | ||
result = "".concat(className, " ").concat(dudupeAndJoinClassList(classList)); | ||
registerComposition({ | ||
@@ -285,3 +365,3 @@ identifier: className, | ||
if (styleRules.length > 0) { | ||
const rule = deepmerge.all(styleRules, { | ||
var _rule = deepmerge.all(styleRules, { | ||
// Replace arrays rather than merging | ||
@@ -293,3 +373,3 @@ arrayMerge: (_, sourceArray) => sourceArray | ||
selector: className, | ||
rule | ||
rule: _rule | ||
}, getFileScope()); | ||
@@ -303,3 +383,3 @@ } | ||
} | ||
const className = generateIdentifier(debugId); | ||
var className = generateIdentifier(debugId); | ||
registerClassName(className, getFileScope()); | ||
@@ -317,4 +397,7 @@ appendCss({ | ||
*/ | ||
function composeStyles(...classNames) { | ||
const compose = hasFileScope() ? composedStyle : dudupeAndJoinClassList; | ||
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); | ||
@@ -330,20 +413,15 @@ } | ||
function fontFace(rule, debugId) { | ||
const fontFamily = `"${cssesc(generateIdentifier(debugId), { | ||
var fontFamily = "\"".concat(cssesc(generateIdentifier(debugId), { | ||
quotes: 'double' | ||
})}"`; | ||
const rules = Array.isArray(rule) ? rule : [rule]; | ||
for (const singleRule of rules) { | ||
}), "\""); | ||
var rules = Array.isArray(rule) ? rule : [rule]; | ||
for (var singleRule of rules) { | ||
if ('fontFamily' in singleRule) { | ||
throw new Error(outdent` | ||
This function creates and returns a hashed font-family name, so the "fontFamily" property should not be provided. | ||
If you'd like to define a globally scoped custom font, you can use the "globalFontFace" function instead. | ||
`); | ||
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: { | ||
...singleRule, | ||
rule: _objectSpread2(_objectSpread2({}, singleRule), {}, { | ||
fontFamily | ||
} | ||
}) | ||
}, getFileScope()); | ||
@@ -356,10 +434,9 @@ } | ||
type: 'fontFace', | ||
rule: { | ||
...rule, | ||
rule: _objectSpread2(_objectSpread2({}, rule), {}, { | ||
fontFamily | ||
} | ||
}) | ||
}, getFileScope()); | ||
} | ||
function keyframes(rule, debugId) { | ||
const name = cssesc(generateIdentifier(debugId), { | ||
var name = cssesc(generateIdentifier(debugId), { | ||
isIdentifier: true | ||
@@ -381,18 +458,18 @@ }); | ||
} | ||
function styleVariants(...args) { | ||
if (typeof args[1] === 'function') { | ||
const data = args[0]; | ||
const mapData = args[1]; | ||
const debugId = args[2]; | ||
const classMap = {}; | ||
for (const key in data) { | ||
classMap[key] = style(mapData(data[key], key), debugId ? `${debugId}_${key}` : key); | ||
function styleVariants() { | ||
if (typeof (arguments.length <= 1 ? undefined : arguments[1]) === 'function') { | ||
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; | ||
return _classMap; | ||
} | ||
const styleMap = args[0]; | ||
const debugId = args[1]; | ||
const classMap = {}; | ||
for (const key in styleMap) { | ||
classMap[key] = style(styleMap[key], debugId ? `${debugId}_${key}` : key); | ||
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); | ||
} | ||
@@ -404,23 +481,20 @@ return classMap; | ||
// For now it is mostly just an alias of generateIdentifier | ||
const createContainer = debugId => generateIdentifier(debugId); | ||
var createContainer = debugId => generateIdentifier(debugId); | ||
const defaultLayerOptions = {}; | ||
const merge = (obj1, obj2) => ({ | ||
...obj1, | ||
...obj2 | ||
}); | ||
const getLayerArgs = (...args) => { | ||
let options = defaultLayerOptions; | ||
let debugId = args[0]; | ||
if (typeof args[0] === 'object') { | ||
options = merge(defaultLayerOptions, args[0]); | ||
debugId = args[1]; | ||
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 = merge(defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
} | ||
return [options, debugId]; | ||
}; | ||
function layer(...args) { | ||
const [options, debugId] = getLayerArgs(...args); | ||
let name = generateIdentifier(debugId); | ||
function layer() { | ||
var [options, debugId] = getLayerArgs(...arguments); | ||
var name = generateIdentifier(debugId); | ||
if (options.parent) { | ||
name = `${options.parent}.${name}`; | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
@@ -433,6 +507,6 @@ appendCss({ | ||
} | ||
function globalLayer(...args) { | ||
let [options, name] = getLayerArgs(...args); | ||
function globalLayer() { | ||
var [options, name] = getLayerArgs(...arguments); | ||
if (options.parent) { | ||
name = `${options.parent}.${name}`; | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
@@ -439,0 +513,0 @@ appendCss({ |
@@ -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-15eca288.cjs.dev.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('./transformCss-55fec1c7.cjs.dev.js'); | ||
var adapter_dist_vanillaExtractCssAdapter = require('../adapter/dist/vanilla-extract-css-adapter.cjs.dev.js'); | ||
@@ -15,2 +15,3 @@ var hash = require('@emotion/hash'); | ||
var chalk = require('chalk'); | ||
var taggedTemplateLiteral = require('./taggedTemplateLiteral-4fcaa261.cjs.dev.js'); | ||
var outdent = require('outdent'); | ||
@@ -30,6 +31,6 @@ var deepmerge = require('deepmerge'); | ||
const localClassNames = new Set(); | ||
const composedClassLists = []; | ||
let bufferedCSSObjs = []; | ||
const browserRuntimeAdapter = { | ||
var localClassNames = new Set(); | ||
var composedClassLists = []; | ||
var bufferedCSSObjs = []; | ||
var browserRuntimeAdapter = { | ||
appendCss: cssObj => { | ||
@@ -46,3 +47,3 @@ bufferedCSSObjs.push(cssObj); | ||
onEndFileScope: fileScope => { | ||
const css = transformCss_dist_vanillaExtractCssTransformCss.transformCss({ | ||
var css = transformCss_dist_vanillaExtractCssTransformCss.transformCss({ | ||
localClassNames: Array.from(localClassNames), | ||
@@ -64,14 +65,91 @@ composedClassLists, | ||
function getDevPrefix({ | ||
debugId, | ||
debugFileName | ||
}) { | ||
const parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
} | ||
function _inherits(subClass, superClass) { | ||
if (typeof superClass !== "function" && superClass !== null) { | ||
throw new TypeError("Super expression must either be null or a function"); | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
constructor: { | ||
value: subClass, | ||
writable: true, | ||
configurable: true | ||
} | ||
}); | ||
Object.defineProperty(subClass, "prototype", { | ||
writable: false | ||
}); | ||
if (superClass) _setPrototypeOf(subClass, superClass); | ||
} | ||
function _wrapRegExp() { | ||
_wrapRegExp = function (re, groups) { | ||
return new BabelRegExp(re, void 0, groups); | ||
}; | ||
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); | ||
} | ||
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]]; | ||
} | ||
return groups; | ||
}, Object.create(null)); | ||
} | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { | ||
var result = _super.exec.call(this, str); | ||
if (result) { | ||
result.groups = buildGroups(result, this); | ||
var indices = result.indices; | ||
indices && (indices.groups = buildGroups(indices, this)); | ||
} | ||
return 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) { | ||
var group = groups[name]; | ||
return "$" + (Array.isArray(group) ? group.join("$") : group); | ||
})); | ||
} | ||
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); | ||
}); | ||
} | ||
return _super[Symbol.replace].call(this, str, substitution); | ||
}, _wrapRegExp.apply(this, arguments); | ||
} | ||
function getDevPrefix(_ref) { | ||
var { | ||
debugId, | ||
debugFileName | ||
} = _ref; | ||
var parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
if (debugFileName) { | ||
const { | ||
var { | ||
filePath | ||
} = fileScope_dist_vanillaExtractCssFileScope.getFileScope(); | ||
const matches = filePath.match(/(?<dir>[^\/\\]*)?[\/\\]?(?<file>[^\/\\]*)\.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) { | ||
const { | ||
var { | ||
dir, | ||
@@ -86,26 +164,23 @@ file | ||
function normalizeIdentifier(identifier) { | ||
return identifier.match(/^[0-9]/) ? `_${identifier}` : identifier; | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
} | ||
function generateIdentifier(arg) { | ||
const identOption = adapter_dist_vanillaExtractCssAdapter.getIdentOption(); | ||
const { | ||
var identOption = adapter_dist_vanillaExtractCssAdapter.getIdentOption(); | ||
var { | ||
debugId, | ||
debugFileName = true | ||
} = { | ||
...(typeof arg === 'string' ? { | ||
debugId: arg | ||
} : null), | ||
...(typeof arg === 'object' ? arg : null) | ||
}; | ||
} = transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, typeof arg === 'string' ? { | ||
debugId: arg | ||
} : null), typeof arg === 'object' ? arg : null); | ||
// Convert ref count to base 36 for optimal hash lengths | ||
const refCount = fileScope_dist_vanillaExtractCssFileScope.getAndIncrementRefCounter().toString(36); | ||
const { | ||
var refCount = fileScope_dist_vanillaExtractCssFileScope.getAndIncrementRefCounter().toString(36); | ||
var { | ||
filePath, | ||
packageName | ||
} = fileScope_dist_vanillaExtractCssFileScope.getFileScope(); | ||
const fileScopeHash = hash__default["default"](packageName ? `${packageName}${filePath}` : filePath); | ||
let identifier = `${fileScopeHash}${refCount}`; | ||
var fileScopeHash = hash__default["default"](packageName ? "".concat(packageName).concat(filePath) : filePath); | ||
var identifier = "".concat(fileScopeHash).concat(refCount); | ||
if (identOption === 'debug') { | ||
const devPrefix = getDevPrefix({ | ||
var devPrefix = getDevPrefix({ | ||
debugId, | ||
@@ -115,3 +190,3 @@ debugFileName | ||
if (devPrefix) { | ||
identifier = `${devPrefix}__${identifier}`; | ||
identifier = "".concat(devPrefix, "__").concat(identifier); | ||
} | ||
@@ -128,3 +203,3 @@ return normalizeIdentifier(identifier); | ||
if (!identifier.match(/^[A-Z_][0-9A-Z_]+$/i)) { | ||
throw new Error(`Identifier function returned invalid indentifier: "${identifier}"`); | ||
throw new Error("Identifier function returned invalid indentifier: \"".concat(identifier, "\"")); | ||
} | ||
@@ -136,6 +211,6 @@ return identifier; | ||
const normaliseObject = obj => _private.walkObject(obj, () => ''); | ||
var normaliseObject = obj => _private.walkObject(obj, () => ''); | ||
function validateContract(contract, tokens) { | ||
const theDiff = deepObjectDiff.diff(normaliseObject(contract), normaliseObject(tokens)); | ||
const valid = Object.keys(theDiff).length === 0; | ||
var theDiff = deepObjectDiff.diff(normaliseObject(contract), normaliseObject(tokens)); | ||
var valid = Object.keys(theDiff).length === 0; | ||
return { | ||
@@ -147,4 +222,4 @@ valid, | ||
function diffLine(value, nesting, type) { | ||
const whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
const line = `${type ? type : ' '}${whitespace}${value}`; | ||
var whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
var line = "".concat(type ? type : ' ').concat(whitespace).concat(value); | ||
if (process.env.NODE_ENV !== 'test') { | ||
@@ -160,19 +235,20 @@ if (type === '-') { | ||
} | ||
function renderDiff(orig, diff, nesting = 0) { | ||
const lines = []; | ||
function renderDiff(orig, diff) { | ||
var nesting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | ||
var lines = []; | ||
if (nesting === 0) { | ||
lines.push(diffLine('{', 0)); | ||
} | ||
const innerNesting = nesting + 1; | ||
const keys = Object.keys(diff).sort(); | ||
for (const key of keys) { | ||
const value = diff[key]; | ||
var innerNesting = nesting + 1; | ||
var keys = Object.keys(diff).sort(); | ||
for (var key of keys) { | ||
var value = diff[key]; | ||
if (!(key in orig)) { | ||
lines.push(diffLine(`${key}: ...,`, innerNesting, '+')); | ||
lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '+')); | ||
} else if (typeof value === 'object') { | ||
lines.push(diffLine(`${key}: {`, innerNesting)); | ||
lines.push(diffLine("".concat(key, ": {"), innerNesting)); | ||
lines.push(renderDiff(orig[key], diff[key], innerNesting)); | ||
lines.push(diffLine('}', innerNesting)); | ||
} else { | ||
lines.push(diffLine(`${key}: ...,`, innerNesting, '-')); | ||
lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '-')); | ||
} | ||
@@ -187,3 +263,3 @@ } | ||
function createVar(debugId) { | ||
const cssVarName = cssesc__default["default"](generateIdentifier({ | ||
var cssVarName = cssesc__default["default"](generateIdentifier({ | ||
debugId, | ||
@@ -194,6 +270,9 @@ debugFileName: false | ||
}); | ||
return `var(--${cssVarName})`; | ||
return "var(--".concat(cssVarName, ")"); | ||
} | ||
function fallbackVar(...values) { | ||
let finalValue = ''; | ||
function fallbackVar() { | ||
var finalValue = ''; | ||
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { | ||
values[_key] = arguments[_key]; | ||
} | ||
values.reverse().forEach(value => { | ||
@@ -204,5 +283,5 @@ if (finalValue === '') { | ||
if (typeof value !== 'string' || !/^var\(--.*\)$/.test(value)) { | ||
throw new Error(`Invalid variable name: ${value}`); | ||
throw new Error("Invalid variable name: ".concat(value)); | ||
} | ||
finalValue = value.replace(/\)$/, `, ${finalValue})`); | ||
finalValue = value.replace(/\)$/, ", ".concat(finalValue, ")")); | ||
} | ||
@@ -213,4 +292,4 @@ }); | ||
function assignVars(varContract, tokens) { | ||
const varSetters = {}; | ||
const { | ||
var varSetters = {}; | ||
var { | ||
valid, | ||
@@ -220,3 +299,3 @@ diffString | ||
if (!valid) { | ||
throw new Error(`Tokens don't match contract.\n${diffString}`); | ||
throw new Error("Tokens don't match contract.\n".concat(diffString)); | ||
} | ||
@@ -235,10 +314,10 @@ _private.walkObject(tokens, (value, path) => { | ||
return _private.walkObject(tokens, (value, path) => { | ||
const rawVarName = typeof mapFn === 'function' ? mapFn(value, path) : value; | ||
const varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
var rawVarName = typeof mapFn === 'function' ? mapFn(value, path) : value; | ||
var varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
if (typeof varName !== 'string' || varName !== cssesc__default["default"](varName, { | ||
isIdentifier: true | ||
})) { | ||
throw new Error(`Invalid variable name for "${path.join('.')}": ${varName}`); | ||
throw new Error("Invalid variable name for \"".concat(path.join('.'), "\": ").concat(varName)); | ||
} | ||
return `var(--${varName})`; | ||
return "var(--".concat(varName, ")"); | ||
}); | ||
@@ -248,5 +327,5 @@ } | ||
function createGlobalTheme(selector, arg2, arg3) { | ||
const shouldCreateVars = Boolean(!arg3); | ||
const themeVars = shouldCreateVars ? createThemeContract(arg2) : arg2; | ||
const tokens = shouldCreateVars ? arg2 : arg3; | ||
var shouldCreateVars = Boolean(!arg3); | ||
var themeVars = shouldCreateVars ? createThemeContract(arg2) : arg2; | ||
var tokens = shouldCreateVars ? arg2 : arg3; | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -264,14 +343,15 @@ type: 'global', | ||
function createTheme(arg1, arg2, arg3) { | ||
const themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
var themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(themeClassName, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
const vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
var vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
return vars ? [themeClassName, vars] : themeClassName; | ||
} | ||
var _templateObject; | ||
function composedStyle(rules, debugId) { | ||
const className = generateIdentifier(debugId); | ||
var className = generateIdentifier(debugId); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
const classList = []; | ||
const styleRules = []; | ||
for (const rule of rules) { | ||
var classList = []; | ||
var styleRules = []; | ||
for (var rule of rules) { | ||
if (typeof rule === 'string') { | ||
@@ -283,5 +363,5 @@ classList.push(rule); | ||
} | ||
let result = className; | ||
var result = className; | ||
if (classList.length > 0) { | ||
result = `${className} ${transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList(classList)}`; | ||
result = "".concat(className, " ").concat(transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList(classList)); | ||
adapter_dist_vanillaExtractCssAdapter.registerComposition({ | ||
@@ -298,3 +378,3 @@ identifier: className, | ||
if (styleRules.length > 0) { | ||
const rule = deepmerge__default["default"].all(styleRules, { | ||
var _rule = deepmerge__default["default"].all(styleRules, { | ||
// Replace arrays rather than merging | ||
@@ -306,3 +386,3 @@ arrayMerge: (_, sourceArray) => sourceArray | ||
selector: className, | ||
rule | ||
rule: _rule | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
@@ -316,3 +396,3 @@ } | ||
} | ||
const className = generateIdentifier(debugId); | ||
var className = generateIdentifier(debugId); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
@@ -330,4 +410,7 @@ adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
*/ | ||
function composeStyles(...classNames) { | ||
const compose = fileScope_dist_vanillaExtractCssFileScope.hasFileScope() ? composedStyle : transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList; | ||
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); | ||
@@ -343,20 +426,15 @@ } | ||
function fontFace(rule, debugId) { | ||
const fontFamily = `"${cssesc__default["default"](generateIdentifier(debugId), { | ||
var fontFamily = "\"".concat(cssesc__default["default"](generateIdentifier(debugId), { | ||
quotes: 'double' | ||
})}"`; | ||
const rules = Array.isArray(rule) ? rule : [rule]; | ||
for (const singleRule of rules) { | ||
}), "\""); | ||
var rules = Array.isArray(rule) ? rule : [rule]; | ||
for (var singleRule of rules) { | ||
if ('fontFamily' in singleRule) { | ||
throw new Error(outdent__default["default"]` | ||
This function creates and returns a hashed font-family name, so the "fontFamily" property should not be provided. | ||
If you'd like to define a globally scoped custom font, you can use the "globalFontFace" function instead. | ||
`); | ||
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: { | ||
...singleRule, | ||
rule: transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, singleRule), {}, { | ||
fontFamily | ||
} | ||
}) | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
@@ -369,10 +447,9 @@ } | ||
type: 'fontFace', | ||
rule: { | ||
...rule, | ||
rule: transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, rule), {}, { | ||
fontFamily | ||
} | ||
}) | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
} | ||
function keyframes(rule, debugId) { | ||
const name = cssesc__default["default"](generateIdentifier(debugId), { | ||
var name = cssesc__default["default"](generateIdentifier(debugId), { | ||
isIdentifier: true | ||
@@ -394,18 +471,18 @@ }); | ||
} | ||
function styleVariants(...args) { | ||
if (typeof args[1] === 'function') { | ||
const data = args[0]; | ||
const mapData = args[1]; | ||
const debugId = args[2]; | ||
const classMap = {}; | ||
for (const key in data) { | ||
classMap[key] = style(mapData(data[key], key), debugId ? `${debugId}_${key}` : key); | ||
function styleVariants() { | ||
if (typeof (arguments.length <= 1 ? undefined : arguments[1]) === 'function') { | ||
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; | ||
return _classMap; | ||
} | ||
const styleMap = args[0]; | ||
const debugId = args[1]; | ||
const classMap = {}; | ||
for (const key in styleMap) { | ||
classMap[key] = style(styleMap[key], debugId ? `${debugId}_${key}` : key); | ||
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); | ||
} | ||
@@ -417,23 +494,20 @@ return classMap; | ||
// For now it is mostly just an alias of generateIdentifier | ||
const createContainer = debugId => generateIdentifier(debugId); | ||
var createContainer = debugId => generateIdentifier(debugId); | ||
const defaultLayerOptions = {}; | ||
const merge = (obj1, obj2) => ({ | ||
...obj1, | ||
...obj2 | ||
}); | ||
const getLayerArgs = (...args) => { | ||
let options = defaultLayerOptions; | ||
let debugId = args[0]; | ||
if (typeof args[0] === 'object') { | ||
options = merge(defaultLayerOptions, args[0]); | ||
debugId = args[1]; | ||
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 = merge(defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
} | ||
return [options, debugId]; | ||
}; | ||
function layer(...args) { | ||
const [options, debugId] = getLayerArgs(...args); | ||
let name = generateIdentifier(debugId); | ||
function layer() { | ||
var [options, debugId] = getLayerArgs(...arguments); | ||
var name = generateIdentifier(debugId); | ||
if (options.parent) { | ||
name = `${options.parent}.${name}`; | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
@@ -446,6 +520,6 @@ adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
} | ||
function globalLayer(...args) { | ||
let [options, name] = getLayerArgs(...args); | ||
function globalLayer() { | ||
var [options, name] = getLayerArgs(...arguments); | ||
if (options.parent) { | ||
name = `${options.parent}.${name}`; | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
@@ -452,0 +526,0 @@ adapter_dist_vanillaExtractCssAdapter.appendCss({ |
@@ -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-f0d00910.cjs.prod.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('./transformCss-549fbfa4.cjs.prod.js'); | ||
var adapter_dist_vanillaExtractCssAdapter = require('../adapter/dist/vanilla-extract-css-adapter.cjs.prod.js'); | ||
@@ -15,2 +15,3 @@ var hash = require('@emotion/hash'); | ||
var chalk = require('chalk'); | ||
var taggedTemplateLiteral = require('./taggedTemplateLiteral-0bfb2e96.cjs.prod.js'); | ||
var outdent = require('outdent'); | ||
@@ -30,6 +31,6 @@ var deepmerge = require('deepmerge'); | ||
const localClassNames = new Set(); | ||
const composedClassLists = []; | ||
let bufferedCSSObjs = []; | ||
const browserRuntimeAdapter = { | ||
var localClassNames = new Set(); | ||
var composedClassLists = []; | ||
var bufferedCSSObjs = []; | ||
var browserRuntimeAdapter = { | ||
appendCss: cssObj => { | ||
@@ -46,3 +47,3 @@ bufferedCSSObjs.push(cssObj); | ||
onEndFileScope: fileScope => { | ||
const css = transformCss_dist_vanillaExtractCssTransformCss.transformCss({ | ||
var css = transformCss_dist_vanillaExtractCssTransformCss.transformCss({ | ||
localClassNames: Array.from(localClassNames), | ||
@@ -64,14 +65,91 @@ composedClassLists, | ||
function getDevPrefix({ | ||
debugId, | ||
debugFileName | ||
}) { | ||
const parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
} | ||
function _inherits(subClass, superClass) { | ||
if (typeof superClass !== "function" && superClass !== null) { | ||
throw new TypeError("Super expression must either be null or a function"); | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
constructor: { | ||
value: subClass, | ||
writable: true, | ||
configurable: true | ||
} | ||
}); | ||
Object.defineProperty(subClass, "prototype", { | ||
writable: false | ||
}); | ||
if (superClass) _setPrototypeOf(subClass, superClass); | ||
} | ||
function _wrapRegExp() { | ||
_wrapRegExp = function (re, groups) { | ||
return new BabelRegExp(re, void 0, groups); | ||
}; | ||
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); | ||
} | ||
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]]; | ||
} | ||
return groups; | ||
}, Object.create(null)); | ||
} | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { | ||
var result = _super.exec.call(this, str); | ||
if (result) { | ||
result.groups = buildGroups(result, this); | ||
var indices = result.indices; | ||
indices && (indices.groups = buildGroups(indices, this)); | ||
} | ||
return 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) { | ||
var group = groups[name]; | ||
return "$" + (Array.isArray(group) ? group.join("$") : group); | ||
})); | ||
} | ||
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); | ||
}); | ||
} | ||
return _super[Symbol.replace].call(this, str, substitution); | ||
}, _wrapRegExp.apply(this, arguments); | ||
} | ||
function getDevPrefix(_ref) { | ||
var { | ||
debugId, | ||
debugFileName | ||
} = _ref; | ||
var parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
if (debugFileName) { | ||
const { | ||
var { | ||
filePath | ||
} = fileScope_dist_vanillaExtractCssFileScope.getFileScope(); | ||
const matches = filePath.match(/(?<dir>[^\/\\]*)?[\/\\]?(?<file>[^\/\\]*)\.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) { | ||
const { | ||
var { | ||
dir, | ||
@@ -86,26 +164,23 @@ file | ||
function normalizeIdentifier(identifier) { | ||
return identifier.match(/^[0-9]/) ? `_${identifier}` : identifier; | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
} | ||
function generateIdentifier(arg) { | ||
const identOption = adapter_dist_vanillaExtractCssAdapter.getIdentOption(); | ||
const { | ||
var identOption = adapter_dist_vanillaExtractCssAdapter.getIdentOption(); | ||
var { | ||
debugId, | ||
debugFileName = true | ||
} = { | ||
...(typeof arg === 'string' ? { | ||
debugId: arg | ||
} : null), | ||
...(typeof arg === 'object' ? arg : null) | ||
}; | ||
} = transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, typeof arg === 'string' ? { | ||
debugId: arg | ||
} : null), typeof arg === 'object' ? arg : null); | ||
// Convert ref count to base 36 for optimal hash lengths | ||
const refCount = fileScope_dist_vanillaExtractCssFileScope.getAndIncrementRefCounter().toString(36); | ||
const { | ||
var refCount = fileScope_dist_vanillaExtractCssFileScope.getAndIncrementRefCounter().toString(36); | ||
var { | ||
filePath, | ||
packageName | ||
} = fileScope_dist_vanillaExtractCssFileScope.getFileScope(); | ||
const fileScopeHash = hash__default["default"](packageName ? `${packageName}${filePath}` : filePath); | ||
let identifier = `${fileScopeHash}${refCount}`; | ||
var fileScopeHash = hash__default["default"](packageName ? "".concat(packageName).concat(filePath) : filePath); | ||
var identifier = "".concat(fileScopeHash).concat(refCount); | ||
if (identOption === 'debug') { | ||
const devPrefix = getDevPrefix({ | ||
var devPrefix = getDevPrefix({ | ||
debugId, | ||
@@ -115,3 +190,3 @@ debugFileName | ||
if (devPrefix) { | ||
identifier = `${devPrefix}__${identifier}`; | ||
identifier = "".concat(devPrefix, "__").concat(identifier); | ||
} | ||
@@ -128,3 +203,3 @@ return normalizeIdentifier(identifier); | ||
if (!identifier.match(/^[A-Z_][0-9A-Z_]+$/i)) { | ||
throw new Error(`Identifier function returned invalid indentifier: "${identifier}"`); | ||
throw new Error("Identifier function returned invalid indentifier: \"".concat(identifier, "\"")); | ||
} | ||
@@ -136,6 +211,6 @@ return identifier; | ||
const normaliseObject = obj => _private.walkObject(obj, () => ''); | ||
var normaliseObject = obj => _private.walkObject(obj, () => ''); | ||
function validateContract(contract, tokens) { | ||
const theDiff = deepObjectDiff.diff(normaliseObject(contract), normaliseObject(tokens)); | ||
const valid = Object.keys(theDiff).length === 0; | ||
var theDiff = deepObjectDiff.diff(normaliseObject(contract), normaliseObject(tokens)); | ||
var valid = Object.keys(theDiff).length === 0; | ||
return { | ||
@@ -147,4 +222,4 @@ valid, | ||
function diffLine(value, nesting, type) { | ||
const whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
const line = `${type ? type : ' '}${whitespace}${value}`; | ||
var whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
var line = "".concat(type ? type : ' ').concat(whitespace).concat(value); | ||
{ | ||
@@ -160,19 +235,20 @@ if (type === '-') { | ||
} | ||
function renderDiff(orig, diff, nesting = 0) { | ||
const lines = []; | ||
function renderDiff(orig, diff) { | ||
var nesting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | ||
var lines = []; | ||
if (nesting === 0) { | ||
lines.push(diffLine('{', 0)); | ||
} | ||
const innerNesting = nesting + 1; | ||
const keys = Object.keys(diff).sort(); | ||
for (const key of keys) { | ||
const value = diff[key]; | ||
var innerNesting = nesting + 1; | ||
var keys = Object.keys(diff).sort(); | ||
for (var key of keys) { | ||
var value = diff[key]; | ||
if (!(key in orig)) { | ||
lines.push(diffLine(`${key}: ...,`, innerNesting, '+')); | ||
lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '+')); | ||
} else if (typeof value === 'object') { | ||
lines.push(diffLine(`${key}: {`, innerNesting)); | ||
lines.push(diffLine("".concat(key, ": {"), innerNesting)); | ||
lines.push(renderDiff(orig[key], diff[key], innerNesting)); | ||
lines.push(diffLine('}', innerNesting)); | ||
} else { | ||
lines.push(diffLine(`${key}: ...,`, innerNesting, '-')); | ||
lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '-')); | ||
} | ||
@@ -187,3 +263,3 @@ } | ||
function createVar(debugId) { | ||
const cssVarName = cssesc__default["default"](generateIdentifier({ | ||
var cssVarName = cssesc__default["default"](generateIdentifier({ | ||
debugId, | ||
@@ -194,6 +270,9 @@ debugFileName: false | ||
}); | ||
return `var(--${cssVarName})`; | ||
return "var(--".concat(cssVarName, ")"); | ||
} | ||
function fallbackVar(...values) { | ||
let finalValue = ''; | ||
function fallbackVar() { | ||
var finalValue = ''; | ||
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { | ||
values[_key] = arguments[_key]; | ||
} | ||
values.reverse().forEach(value => { | ||
@@ -204,5 +283,5 @@ if (finalValue === '') { | ||
if (typeof value !== 'string' || !/^var\(--.*\)$/.test(value)) { | ||
throw new Error(`Invalid variable name: ${value}`); | ||
throw new Error("Invalid variable name: ".concat(value)); | ||
} | ||
finalValue = value.replace(/\)$/, `, ${finalValue})`); | ||
finalValue = value.replace(/\)$/, ", ".concat(finalValue, ")")); | ||
} | ||
@@ -213,4 +292,4 @@ }); | ||
function assignVars(varContract, tokens) { | ||
const varSetters = {}; | ||
const { | ||
var varSetters = {}; | ||
var { | ||
valid, | ||
@@ -220,3 +299,3 @@ diffString | ||
if (!valid) { | ||
throw new Error(`Tokens don't match contract.\n${diffString}`); | ||
throw new Error("Tokens don't match contract.\n".concat(diffString)); | ||
} | ||
@@ -235,10 +314,10 @@ _private.walkObject(tokens, (value, path) => { | ||
return _private.walkObject(tokens, (value, path) => { | ||
const rawVarName = typeof mapFn === 'function' ? mapFn(value, path) : value; | ||
const varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
var rawVarName = typeof mapFn === 'function' ? mapFn(value, path) : value; | ||
var varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
if (typeof varName !== 'string' || varName !== cssesc__default["default"](varName, { | ||
isIdentifier: true | ||
})) { | ||
throw new Error(`Invalid variable name for "${path.join('.')}": ${varName}`); | ||
throw new Error("Invalid variable name for \"".concat(path.join('.'), "\": ").concat(varName)); | ||
} | ||
return `var(--${varName})`; | ||
return "var(--".concat(varName, ")"); | ||
}); | ||
@@ -248,5 +327,5 @@ } | ||
function createGlobalTheme(selector, arg2, arg3) { | ||
const shouldCreateVars = Boolean(!arg3); | ||
const themeVars = shouldCreateVars ? createThemeContract(arg2) : arg2; | ||
const tokens = shouldCreateVars ? arg2 : arg3; | ||
var shouldCreateVars = Boolean(!arg3); | ||
var themeVars = shouldCreateVars ? createThemeContract(arg2) : arg2; | ||
var tokens = shouldCreateVars ? arg2 : arg3; | ||
adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
@@ -264,14 +343,15 @@ type: 'global', | ||
function createTheme(arg1, arg2, arg3) { | ||
const themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
var themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(themeClassName, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
const vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
var vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
return vars ? [themeClassName, vars] : themeClassName; | ||
} | ||
var _templateObject; | ||
function composedStyle(rules, debugId) { | ||
const className = generateIdentifier(debugId); | ||
var className = generateIdentifier(debugId); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
const classList = []; | ||
const styleRules = []; | ||
for (const rule of rules) { | ||
var classList = []; | ||
var styleRules = []; | ||
for (var rule of rules) { | ||
if (typeof rule === 'string') { | ||
@@ -283,5 +363,5 @@ classList.push(rule); | ||
} | ||
let result = className; | ||
var result = className; | ||
if (classList.length > 0) { | ||
result = `${className} ${transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList(classList)}`; | ||
result = "".concat(className, " ").concat(transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList(classList)); | ||
adapter_dist_vanillaExtractCssAdapter.registerComposition({ | ||
@@ -298,3 +378,3 @@ identifier: className, | ||
if (styleRules.length > 0) { | ||
const rule = deepmerge__default["default"].all(styleRules, { | ||
var _rule = deepmerge__default["default"].all(styleRules, { | ||
// Replace arrays rather than merging | ||
@@ -306,3 +386,3 @@ arrayMerge: (_, sourceArray) => sourceArray | ||
selector: className, | ||
rule | ||
rule: _rule | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
@@ -316,3 +396,3 @@ } | ||
} | ||
const className = generateIdentifier(debugId); | ||
var className = generateIdentifier(debugId); | ||
adapter_dist_vanillaExtractCssAdapter.registerClassName(className, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
@@ -330,4 +410,7 @@ adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
*/ | ||
function composeStyles(...classNames) { | ||
const compose = fileScope_dist_vanillaExtractCssFileScope.hasFileScope() ? composedStyle : transformCss_dist_vanillaExtractCssTransformCss.dudupeAndJoinClassList; | ||
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); | ||
@@ -343,20 +426,15 @@ } | ||
function fontFace(rule, debugId) { | ||
const fontFamily = `"${cssesc__default["default"](generateIdentifier(debugId), { | ||
var fontFamily = "\"".concat(cssesc__default["default"](generateIdentifier(debugId), { | ||
quotes: 'double' | ||
})}"`; | ||
const rules = Array.isArray(rule) ? rule : [rule]; | ||
for (const singleRule of rules) { | ||
}), "\""); | ||
var rules = Array.isArray(rule) ? rule : [rule]; | ||
for (var singleRule of rules) { | ||
if ('fontFamily' in singleRule) { | ||
throw new Error(outdent__default["default"]` | ||
This function creates and returns a hashed font-family name, so the "fontFamily" property should not be provided. | ||
If you'd like to define a globally scoped custom font, you can use the "globalFontFace" function instead. | ||
`); | ||
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: { | ||
...singleRule, | ||
rule: transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, singleRule), {}, { | ||
fontFamily | ||
} | ||
}) | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
@@ -369,10 +447,9 @@ } | ||
type: 'fontFace', | ||
rule: { | ||
...rule, | ||
rule: transformCss_dist_vanillaExtractCssTransformCss._objectSpread2(transformCss_dist_vanillaExtractCssTransformCss._objectSpread2({}, rule), {}, { | ||
fontFamily | ||
} | ||
}) | ||
}, fileScope_dist_vanillaExtractCssFileScope.getFileScope()); | ||
} | ||
function keyframes(rule, debugId) { | ||
const name = cssesc__default["default"](generateIdentifier(debugId), { | ||
var name = cssesc__default["default"](generateIdentifier(debugId), { | ||
isIdentifier: true | ||
@@ -394,18 +471,18 @@ }); | ||
} | ||
function styleVariants(...args) { | ||
if (typeof args[1] === 'function') { | ||
const data = args[0]; | ||
const mapData = args[1]; | ||
const debugId = args[2]; | ||
const classMap = {}; | ||
for (const key in data) { | ||
classMap[key] = style(mapData(data[key], key), debugId ? `${debugId}_${key}` : key); | ||
function styleVariants() { | ||
if (typeof (arguments.length <= 1 ? undefined : arguments[1]) === 'function') { | ||
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; | ||
return _classMap; | ||
} | ||
const styleMap = args[0]; | ||
const debugId = args[1]; | ||
const classMap = {}; | ||
for (const key in styleMap) { | ||
classMap[key] = style(styleMap[key], debugId ? `${debugId}_${key}` : key); | ||
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); | ||
} | ||
@@ -417,23 +494,20 @@ return classMap; | ||
// For now it is mostly just an alias of generateIdentifier | ||
const createContainer = debugId => generateIdentifier(debugId); | ||
var createContainer = debugId => generateIdentifier(debugId); | ||
const defaultLayerOptions = {}; | ||
const merge = (obj1, obj2) => ({ | ||
...obj1, | ||
...obj2 | ||
}); | ||
const getLayerArgs = (...args) => { | ||
let options = defaultLayerOptions; | ||
let debugId = args[0]; | ||
if (typeof args[0] === 'object') { | ||
options = merge(defaultLayerOptions, args[0]); | ||
debugId = args[1]; | ||
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 = merge(defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
} | ||
return [options, debugId]; | ||
}; | ||
function layer(...args) { | ||
const [options, debugId] = getLayerArgs(...args); | ||
let name = generateIdentifier(debugId); | ||
function layer() { | ||
var [options, debugId] = getLayerArgs(...arguments); | ||
var name = generateIdentifier(debugId); | ||
if (options.parent) { | ||
name = `${options.parent}.${name}`; | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
@@ -446,6 +520,6 @@ adapter_dist_vanillaExtractCssAdapter.appendCss({ | ||
} | ||
function globalLayer(...args) { | ||
let [options, name] = getLayerArgs(...args); | ||
function globalLayer() { | ||
var [options, name] = getLayerArgs(...arguments); | ||
if (options.parent) { | ||
name = `${options.parent}.${name}`; | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
@@ -452,0 +526,0 @@ adapter_dist_vanillaExtractCssAdapter.appendCss({ |
import { injectStyles } from '../injectStyles/dist/vanilla-extract-css-injectStyles.esm.js'; | ||
import { t as transformCss, d as dudupeAndJoinClassList } from './transformCss-4ff5fbc3.esm.js'; | ||
import { t as transformCss, _ as _objectSpread2, d as dudupeAndJoinClassList } from './transformCss-810a10c3.esm.js'; | ||
import { setAdapterIfNotSet, getIdentOption, appendCss, registerClassName, registerComposition, markCompositionUsed } from '../adapter/dist/vanilla-extract-css-adapter.esm.js'; | ||
@@ -10,2 +10,3 @@ import hash from '@emotion/hash'; | ||
import chalk from 'chalk'; | ||
import { _ as _taggedTemplateLiteral } from './taggedTemplateLiteral-10998315.esm.js'; | ||
import outdent from 'outdent'; | ||
@@ -17,6 +18,6 @@ import deepmerge from 'deepmerge'; | ||
const localClassNames = new Set(); | ||
const composedClassLists = []; | ||
let bufferedCSSObjs = []; | ||
const browserRuntimeAdapter = { | ||
var localClassNames = new Set(); | ||
var composedClassLists = []; | ||
var bufferedCSSObjs = []; | ||
var browserRuntimeAdapter = { | ||
appendCss: cssObj => { | ||
@@ -33,3 +34,3 @@ bufferedCSSObjs.push(cssObj); | ||
onEndFileScope: fileScope => { | ||
const css = transformCss({ | ||
var css = transformCss({ | ||
localClassNames: Array.from(localClassNames), | ||
@@ -51,14 +52,91 @@ composedClassLists, | ||
function getDevPrefix({ | ||
debugId, | ||
debugFileName | ||
}) { | ||
const parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
} | ||
function _inherits(subClass, superClass) { | ||
if (typeof superClass !== "function" && superClass !== null) { | ||
throw new TypeError("Super expression must either be null or a function"); | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
constructor: { | ||
value: subClass, | ||
writable: true, | ||
configurable: true | ||
} | ||
}); | ||
Object.defineProperty(subClass, "prototype", { | ||
writable: false | ||
}); | ||
if (superClass) _setPrototypeOf(subClass, superClass); | ||
} | ||
function _wrapRegExp() { | ||
_wrapRegExp = function (re, groups) { | ||
return new BabelRegExp(re, void 0, groups); | ||
}; | ||
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); | ||
} | ||
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]]; | ||
} | ||
return groups; | ||
}, Object.create(null)); | ||
} | ||
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { | ||
var result = _super.exec.call(this, str); | ||
if (result) { | ||
result.groups = buildGroups(result, this); | ||
var indices = result.indices; | ||
indices && (indices.groups = buildGroups(indices, this)); | ||
} | ||
return 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) { | ||
var group = groups[name]; | ||
return "$" + (Array.isArray(group) ? group.join("$") : group); | ||
})); | ||
} | ||
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); | ||
}); | ||
} | ||
return _super[Symbol.replace].call(this, str, substitution); | ||
}, _wrapRegExp.apply(this, arguments); | ||
} | ||
function getDevPrefix(_ref) { | ||
var { | ||
debugId, | ||
debugFileName | ||
} = _ref; | ||
var parts = debugId ? [debugId.replace(/\s/g, '_')] : []; | ||
if (debugFileName) { | ||
const { | ||
var { | ||
filePath | ||
} = getFileScope(); | ||
const matches = filePath.match(/(?<dir>[^\/\\]*)?[\/\\]?(?<file>[^\/\\]*)\.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) { | ||
const { | ||
var { | ||
dir, | ||
@@ -73,26 +151,23 @@ file | ||
function normalizeIdentifier(identifier) { | ||
return identifier.match(/^[0-9]/) ? `_${identifier}` : identifier; | ||
return identifier.match(/^[0-9]/) ? "_".concat(identifier) : identifier; | ||
} | ||
function generateIdentifier(arg) { | ||
const identOption = getIdentOption(); | ||
const { | ||
var identOption = getIdentOption(); | ||
var { | ||
debugId, | ||
debugFileName = true | ||
} = { | ||
...(typeof arg === 'string' ? { | ||
debugId: arg | ||
} : null), | ||
...(typeof arg === 'object' ? arg : null) | ||
}; | ||
} = _objectSpread2(_objectSpread2({}, typeof arg === 'string' ? { | ||
debugId: arg | ||
} : null), typeof arg === 'object' ? arg : null); | ||
// Convert ref count to base 36 for optimal hash lengths | ||
const refCount = getAndIncrementRefCounter().toString(36); | ||
const { | ||
var refCount = getAndIncrementRefCounter().toString(36); | ||
var { | ||
filePath, | ||
packageName | ||
} = getFileScope(); | ||
const fileScopeHash = hash(packageName ? `${packageName}${filePath}` : filePath); | ||
let identifier = `${fileScopeHash}${refCount}`; | ||
var fileScopeHash = hash(packageName ? "".concat(packageName).concat(filePath) : filePath); | ||
var identifier = "".concat(fileScopeHash).concat(refCount); | ||
if (identOption === 'debug') { | ||
const devPrefix = getDevPrefix({ | ||
var devPrefix = getDevPrefix({ | ||
debugId, | ||
@@ -102,3 +177,3 @@ debugFileName | ||
if (devPrefix) { | ||
identifier = `${devPrefix}__${identifier}`; | ||
identifier = "".concat(devPrefix, "__").concat(identifier); | ||
} | ||
@@ -115,3 +190,3 @@ return normalizeIdentifier(identifier); | ||
if (!identifier.match(/^[A-Z_][0-9A-Z_]+$/i)) { | ||
throw new Error(`Identifier function returned invalid indentifier: "${identifier}"`); | ||
throw new Error("Identifier function returned invalid indentifier: \"".concat(identifier, "\"")); | ||
} | ||
@@ -123,6 +198,6 @@ return identifier; | ||
const normaliseObject = obj => walkObject(obj, () => ''); | ||
var normaliseObject = obj => walkObject(obj, () => ''); | ||
function validateContract(contract, tokens) { | ||
const theDiff = diff(normaliseObject(contract), normaliseObject(tokens)); | ||
const valid = Object.keys(theDiff).length === 0; | ||
var theDiff = diff(normaliseObject(contract), normaliseObject(tokens)); | ||
var valid = Object.keys(theDiff).length === 0; | ||
return { | ||
@@ -134,4 +209,4 @@ valid, | ||
function diffLine(value, nesting, type) { | ||
const whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
const line = `${type ? type : ' '}${whitespace}${value}`; | ||
var whitespace = [...Array(nesting).keys()].map(() => ' ').join(''); | ||
var line = "".concat(type ? type : ' ').concat(whitespace).concat(value); | ||
if (process.env.NODE_ENV !== 'test') { | ||
@@ -147,19 +222,20 @@ if (type === '-') { | ||
} | ||
function renderDiff(orig, diff, nesting = 0) { | ||
const lines = []; | ||
function renderDiff(orig, diff) { | ||
var nesting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | ||
var lines = []; | ||
if (nesting === 0) { | ||
lines.push(diffLine('{', 0)); | ||
} | ||
const innerNesting = nesting + 1; | ||
const keys = Object.keys(diff).sort(); | ||
for (const key of keys) { | ||
const value = diff[key]; | ||
var innerNesting = nesting + 1; | ||
var keys = Object.keys(diff).sort(); | ||
for (var key of keys) { | ||
var value = diff[key]; | ||
if (!(key in orig)) { | ||
lines.push(diffLine(`${key}: ...,`, innerNesting, '+')); | ||
lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '+')); | ||
} else if (typeof value === 'object') { | ||
lines.push(diffLine(`${key}: {`, innerNesting)); | ||
lines.push(diffLine("".concat(key, ": {"), innerNesting)); | ||
lines.push(renderDiff(orig[key], diff[key], innerNesting)); | ||
lines.push(diffLine('}', innerNesting)); | ||
} else { | ||
lines.push(diffLine(`${key}: ...,`, innerNesting, '-')); | ||
lines.push(diffLine("".concat(key, ": ...,"), innerNesting, '-')); | ||
} | ||
@@ -174,3 +250,3 @@ } | ||
function createVar(debugId) { | ||
const cssVarName = cssesc(generateIdentifier({ | ||
var cssVarName = cssesc(generateIdentifier({ | ||
debugId, | ||
@@ -181,6 +257,9 @@ debugFileName: false | ||
}); | ||
return `var(--${cssVarName})`; | ||
return "var(--".concat(cssVarName, ")"); | ||
} | ||
function fallbackVar(...values) { | ||
let finalValue = ''; | ||
function fallbackVar() { | ||
var finalValue = ''; | ||
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { | ||
values[_key] = arguments[_key]; | ||
} | ||
values.reverse().forEach(value => { | ||
@@ -191,5 +270,5 @@ if (finalValue === '') { | ||
if (typeof value !== 'string' || !/^var\(--.*\)$/.test(value)) { | ||
throw new Error(`Invalid variable name: ${value}`); | ||
throw new Error("Invalid variable name: ".concat(value)); | ||
} | ||
finalValue = value.replace(/\)$/, `, ${finalValue})`); | ||
finalValue = value.replace(/\)$/, ", ".concat(finalValue, ")")); | ||
} | ||
@@ -200,4 +279,4 @@ }); | ||
function assignVars(varContract, tokens) { | ||
const varSetters = {}; | ||
const { | ||
var varSetters = {}; | ||
var { | ||
valid, | ||
@@ -207,3 +286,3 @@ diffString | ||
if (!valid) { | ||
throw new Error(`Tokens don't match contract.\n${diffString}`); | ||
throw new Error("Tokens don't match contract.\n".concat(diffString)); | ||
} | ||
@@ -222,10 +301,10 @@ walkObject(tokens, (value, path) => { | ||
return walkObject(tokens, (value, path) => { | ||
const rawVarName = typeof mapFn === 'function' ? mapFn(value, path) : value; | ||
const varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
var rawVarName = typeof mapFn === 'function' ? mapFn(value, path) : value; | ||
var varName = typeof rawVarName === 'string' ? rawVarName.replace(/^\-\-/, '') : null; | ||
if (typeof varName !== 'string' || varName !== cssesc(varName, { | ||
isIdentifier: true | ||
})) { | ||
throw new Error(`Invalid variable name for "${path.join('.')}": ${varName}`); | ||
throw new Error("Invalid variable name for \"".concat(path.join('.'), "\": ").concat(varName)); | ||
} | ||
return `var(--${varName})`; | ||
return "var(--".concat(varName, ")"); | ||
}); | ||
@@ -235,5 +314,5 @@ } | ||
function createGlobalTheme(selector, arg2, arg3) { | ||
const shouldCreateVars = Boolean(!arg3); | ||
const themeVars = shouldCreateVars ? createThemeContract(arg2) : arg2; | ||
const tokens = shouldCreateVars ? arg2 : arg3; | ||
var shouldCreateVars = Boolean(!arg3); | ||
var themeVars = shouldCreateVars ? createThemeContract(arg2) : arg2; | ||
var tokens = shouldCreateVars ? arg2 : arg3; | ||
appendCss({ | ||
@@ -251,14 +330,15 @@ type: 'global', | ||
function createTheme(arg1, arg2, arg3) { | ||
const themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
var themeClassName = generateIdentifier(typeof arg2 === 'object' ? arg3 : arg2); | ||
registerClassName(themeClassName, getFileScope()); | ||
const vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
var vars = typeof arg2 === 'object' ? createGlobalTheme(themeClassName, arg1, arg2) : createGlobalTheme(themeClassName, arg1); | ||
return vars ? [themeClassName, vars] : themeClassName; | ||
} | ||
var _templateObject; | ||
function composedStyle(rules, debugId) { | ||
const className = generateIdentifier(debugId); | ||
var className = generateIdentifier(debugId); | ||
registerClassName(className, getFileScope()); | ||
const classList = []; | ||
const styleRules = []; | ||
for (const rule of rules) { | ||
var classList = []; | ||
var styleRules = []; | ||
for (var rule of rules) { | ||
if (typeof rule === 'string') { | ||
@@ -270,5 +350,5 @@ classList.push(rule); | ||
} | ||
let result = className; | ||
var result = className; | ||
if (classList.length > 0) { | ||
result = `${className} ${dudupeAndJoinClassList(classList)}`; | ||
result = "".concat(className, " ").concat(dudupeAndJoinClassList(classList)); | ||
registerComposition({ | ||
@@ -285,3 +365,3 @@ identifier: className, | ||
if (styleRules.length > 0) { | ||
const rule = deepmerge.all(styleRules, { | ||
var _rule = deepmerge.all(styleRules, { | ||
// Replace arrays rather than merging | ||
@@ -293,3 +373,3 @@ arrayMerge: (_, sourceArray) => sourceArray | ||
selector: className, | ||
rule | ||
rule: _rule | ||
}, getFileScope()); | ||
@@ -303,3 +383,3 @@ } | ||
} | ||
const className = generateIdentifier(debugId); | ||
var className = generateIdentifier(debugId); | ||
registerClassName(className, getFileScope()); | ||
@@ -317,4 +397,7 @@ appendCss({ | ||
*/ | ||
function composeStyles(...classNames) { | ||
const compose = hasFileScope() ? composedStyle : dudupeAndJoinClassList; | ||
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); | ||
@@ -330,20 +413,15 @@ } | ||
function fontFace(rule, debugId) { | ||
const fontFamily = `"${cssesc(generateIdentifier(debugId), { | ||
var fontFamily = "\"".concat(cssesc(generateIdentifier(debugId), { | ||
quotes: 'double' | ||
})}"`; | ||
const rules = Array.isArray(rule) ? rule : [rule]; | ||
for (const singleRule of rules) { | ||
}), "\""); | ||
var rules = Array.isArray(rule) ? rule : [rule]; | ||
for (var singleRule of rules) { | ||
if ('fontFamily' in singleRule) { | ||
throw new Error(outdent` | ||
This function creates and returns a hashed font-family name, so the "fontFamily" property should not be provided. | ||
If you'd like to define a globally scoped custom font, you can use the "globalFontFace" function instead. | ||
`); | ||
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: { | ||
...singleRule, | ||
rule: _objectSpread2(_objectSpread2({}, singleRule), {}, { | ||
fontFamily | ||
} | ||
}) | ||
}, getFileScope()); | ||
@@ -356,10 +434,9 @@ } | ||
type: 'fontFace', | ||
rule: { | ||
...rule, | ||
rule: _objectSpread2(_objectSpread2({}, rule), {}, { | ||
fontFamily | ||
} | ||
}) | ||
}, getFileScope()); | ||
} | ||
function keyframes(rule, debugId) { | ||
const name = cssesc(generateIdentifier(debugId), { | ||
var name = cssesc(generateIdentifier(debugId), { | ||
isIdentifier: true | ||
@@ -381,18 +458,18 @@ }); | ||
} | ||
function styleVariants(...args) { | ||
if (typeof args[1] === 'function') { | ||
const data = args[0]; | ||
const mapData = args[1]; | ||
const debugId = args[2]; | ||
const classMap = {}; | ||
for (const key in data) { | ||
classMap[key] = style(mapData(data[key], key), debugId ? `${debugId}_${key}` : key); | ||
function styleVariants() { | ||
if (typeof (arguments.length <= 1 ? undefined : arguments[1]) === 'function') { | ||
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; | ||
return _classMap; | ||
} | ||
const styleMap = args[0]; | ||
const debugId = args[1]; | ||
const classMap = {}; | ||
for (const key in styleMap) { | ||
classMap[key] = style(styleMap[key], debugId ? `${debugId}_${key}` : key); | ||
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); | ||
} | ||
@@ -404,23 +481,20 @@ return classMap; | ||
// For now it is mostly just an alias of generateIdentifier | ||
const createContainer = debugId => generateIdentifier(debugId); | ||
var createContainer = debugId => generateIdentifier(debugId); | ||
const defaultLayerOptions = {}; | ||
const merge = (obj1, obj2) => ({ | ||
...obj1, | ||
...obj2 | ||
}); | ||
const getLayerArgs = (...args) => { | ||
let options = defaultLayerOptions; | ||
let debugId = args[0]; | ||
if (typeof args[0] === 'object') { | ||
options = merge(defaultLayerOptions, args[0]); | ||
debugId = args[1]; | ||
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 = merge(defaultLayerOptions, arguments.length <= 0 ? undefined : arguments[0]); | ||
debugId = arguments.length <= 1 ? undefined : arguments[1]; | ||
} | ||
return [options, debugId]; | ||
}; | ||
function layer(...args) { | ||
const [options, debugId] = getLayerArgs(...args); | ||
let name = generateIdentifier(debugId); | ||
function layer() { | ||
var [options, debugId] = getLayerArgs(...arguments); | ||
var name = generateIdentifier(debugId); | ||
if (options.parent) { | ||
name = `${options.parent}.${name}`; | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
@@ -433,6 +507,6 @@ appendCss({ | ||
} | ||
function globalLayer(...args) { | ||
let [options, name] = getLayerArgs(...args); | ||
function globalLayer() { | ||
var [options, name] = getLayerArgs(...arguments); | ||
if (options.parent) { | ||
name = `${options.parent}.${name}`; | ||
name = "".concat(options.parent, ".").concat(name); | ||
} | ||
@@ -439,0 +513,0 @@ appendCss({ |
@@ -5,2 +5,3 @@ 'use strict'; | ||
var taggedTemplateLiteral = require('../../dist/taggedTemplateLiteral-00b821ff.browser.cjs.js'); | ||
var outdent = require('outdent'); | ||
@@ -13,7 +14,8 @@ var adapter_dist_vanillaExtractCssAdapter = require('../../adapter/dist/vanilla-extract-css-adapter.browser.cjs.js'); | ||
let refCounter = 0; | ||
const fileScopes = []; | ||
var _templateObject; | ||
var refCounter = 0; | ||
var fileScopes = []; | ||
function setFileScope(filePath, packageName) { | ||
refCounter = 0; | ||
const fileScope = { | ||
var fileScope = { | ||
filePath, | ||
@@ -35,8 +37,3 @@ packageName | ||
if (fileScopes.length === 0) { | ||
throw new Error(outdent__default["default"]` | ||
Styles were unable to be assigned to a file. This is generally caused by one of the following: | ||
- You may have created styles outside of a '.css.ts' context | ||
- You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started | ||
`); | ||
throw new Error(outdent__default["default"](_templateObject || (_templateObject = taggedTemplateLiteral._taggedTemplateLiteral(["\n Styles were unable to be assigned to a file. This is generally caused by one of the following:\n\n - You may have created styles outside of a '.css.ts' context\n - You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started\n "])))); | ||
} | ||
@@ -43,0 +40,0 @@ return fileScopes[0]; |
@@ -0,9 +1,11 @@ | ||
import { _ as _taggedTemplateLiteral } from '../../dist/taggedTemplateLiteral-8e47dbd7.browser.esm.js'; | ||
import outdent from 'outdent'; | ||
import { onBeginFileScope, onEndFileScope } from '../../adapter/dist/vanilla-extract-css-adapter.browser.esm.js'; | ||
let refCounter = 0; | ||
const fileScopes = []; | ||
var _templateObject; | ||
var refCounter = 0; | ||
var fileScopes = []; | ||
function setFileScope(filePath, packageName) { | ||
refCounter = 0; | ||
const fileScope = { | ||
var fileScope = { | ||
filePath, | ||
@@ -25,8 +27,3 @@ packageName | ||
if (fileScopes.length === 0) { | ||
throw new Error(outdent` | ||
Styles were unable to be assigned to a file. This is generally caused by one of the following: | ||
- You may have created styles outside of a '.css.ts' context | ||
- You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started | ||
`); | ||
throw new Error(outdent(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n Styles were unable to be assigned to a file. This is generally caused by one of the following:\n\n - You may have created styles outside of a '.css.ts' context\n - You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started\n "])))); | ||
} | ||
@@ -33,0 +30,0 @@ return fileScopes[0]; |
@@ -5,2 +5,3 @@ 'use strict'; | ||
var taggedTemplateLiteral = require('../../dist/taggedTemplateLiteral-4fcaa261.cjs.dev.js'); | ||
var outdent = require('outdent'); | ||
@@ -13,7 +14,8 @@ var adapter_dist_vanillaExtractCssAdapter = require('../../adapter/dist/vanilla-extract-css-adapter.cjs.dev.js'); | ||
let refCounter = 0; | ||
const fileScopes = []; | ||
var _templateObject; | ||
var refCounter = 0; | ||
var fileScopes = []; | ||
function setFileScope(filePath, packageName) { | ||
refCounter = 0; | ||
const fileScope = { | ||
var fileScope = { | ||
filePath, | ||
@@ -35,8 +37,3 @@ packageName | ||
if (fileScopes.length === 0) { | ||
throw new Error(outdent__default["default"]` | ||
Styles were unable to be assigned to a file. This is generally caused by one of the following: | ||
- You may have created styles outside of a '.css.ts' context | ||
- You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started | ||
`); | ||
throw new Error(outdent__default["default"](_templateObject || (_templateObject = taggedTemplateLiteral._taggedTemplateLiteral(["\n Styles were unable to be assigned to a file. This is generally caused by one of the following:\n\n - You may have created styles outside of a '.css.ts' context\n - You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started\n "])))); | ||
} | ||
@@ -43,0 +40,0 @@ return fileScopes[0]; |
@@ -5,2 +5,3 @@ 'use strict'; | ||
var taggedTemplateLiteral = require('../../dist/taggedTemplateLiteral-0bfb2e96.cjs.prod.js'); | ||
var outdent = require('outdent'); | ||
@@ -13,7 +14,8 @@ var adapter_dist_vanillaExtractCssAdapter = require('../../adapter/dist/vanilla-extract-css-adapter.cjs.prod.js'); | ||
let refCounter = 0; | ||
const fileScopes = []; | ||
var _templateObject; | ||
var refCounter = 0; | ||
var fileScopes = []; | ||
function setFileScope(filePath, packageName) { | ||
refCounter = 0; | ||
const fileScope = { | ||
var fileScope = { | ||
filePath, | ||
@@ -35,8 +37,3 @@ packageName | ||
if (fileScopes.length === 0) { | ||
throw new Error(outdent__default["default"]` | ||
Styles were unable to be assigned to a file. This is generally caused by one of the following: | ||
- You may have created styles outside of a '.css.ts' context | ||
- You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started | ||
`); | ||
throw new Error(outdent__default["default"](_templateObject || (_templateObject = taggedTemplateLiteral._taggedTemplateLiteral(["\n Styles were unable to be assigned to a file. This is generally caused by one of the following:\n\n - You may have created styles outside of a '.css.ts' context\n - You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started\n "])))); | ||
} | ||
@@ -43,0 +40,0 @@ return fileScopes[0]; |
@@ -0,9 +1,11 @@ | ||
import { _ as _taggedTemplateLiteral } from '../../dist/taggedTemplateLiteral-10998315.esm.js'; | ||
import outdent from 'outdent'; | ||
import { onBeginFileScope, onEndFileScope } from '../../adapter/dist/vanilla-extract-css-adapter.esm.js'; | ||
let refCounter = 0; | ||
const fileScopes = []; | ||
var _templateObject; | ||
var refCounter = 0; | ||
var fileScopes = []; | ||
function setFileScope(filePath, packageName) { | ||
refCounter = 0; | ||
const fileScope = { | ||
var fileScope = { | ||
filePath, | ||
@@ -25,8 +27,3 @@ packageName | ||
if (fileScopes.length === 0) { | ||
throw new Error(outdent` | ||
Styles were unable to be assigned to a file. This is generally caused by one of the following: | ||
- You may have created styles outside of a '.css.ts' context | ||
- You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started | ||
`); | ||
throw new Error(outdent(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n Styles were unable to be assigned to a file. This is generally caused by one of the following:\n\n - You may have created styles outside of a '.css.ts' context\n - You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started\n "])))); | ||
} | ||
@@ -33,0 +30,0 @@ return fileScopes[0]; |
@@ -5,11 +5,12 @@ 'use strict'; | ||
const stylesheets = {}; | ||
const injectStyles = ({ | ||
fileScope, | ||
css | ||
}) => { | ||
const fileScopeId = fileScope.packageName ? [fileScope.packageName, fileScope.filePath].join('/') : fileScope.filePath; | ||
let stylesheet = stylesheets[fileScopeId]; | ||
var stylesheets = {}; | ||
var injectStyles = _ref => { | ||
var { | ||
fileScope, | ||
css | ||
} = _ref; | ||
var fileScopeId = fileScope.packageName ? [fileScope.packageName, fileScope.filePath].join('/') : fileScope.filePath; | ||
var stylesheet = stylesheets[fileScopeId]; | ||
if (!stylesheet) { | ||
const styleEl = document.createElement('style'); | ||
var styleEl = document.createElement('style'); | ||
if (fileScope.packageName) { | ||
@@ -16,0 +17,0 @@ styleEl.setAttribute('data-package', fileScope.packageName); |
@@ -1,10 +0,11 @@ | ||
const stylesheets = {}; | ||
const injectStyles = ({ | ||
fileScope, | ||
css | ||
}) => { | ||
const fileScopeId = fileScope.packageName ? [fileScope.packageName, fileScope.filePath].join('/') : fileScope.filePath; | ||
let stylesheet = stylesheets[fileScopeId]; | ||
var stylesheets = {}; | ||
var injectStyles = _ref => { | ||
var { | ||
fileScope, | ||
css | ||
} = _ref; | ||
var fileScopeId = fileScope.packageName ? [fileScope.packageName, fileScope.filePath].join('/') : fileScope.filePath; | ||
var stylesheet = stylesheets[fileScopeId]; | ||
if (!stylesheet) { | ||
const styleEl = document.createElement('style'); | ||
var styleEl = document.createElement('style'); | ||
if (fileScope.packageName) { | ||
@@ -11,0 +12,0 @@ styleEl.setAttribute('data-package', fileScope.packageName); |
@@ -5,11 +5,12 @@ 'use strict'; | ||
const stylesheets = {}; | ||
const injectStyles = ({ | ||
fileScope, | ||
css | ||
}) => { | ||
const fileScopeId = fileScope.packageName ? [fileScope.packageName, fileScope.filePath].join('/') : fileScope.filePath; | ||
let stylesheet = stylesheets[fileScopeId]; | ||
var stylesheets = {}; | ||
var injectStyles = _ref => { | ||
var { | ||
fileScope, | ||
css | ||
} = _ref; | ||
var fileScopeId = fileScope.packageName ? [fileScope.packageName, fileScope.filePath].join('/') : fileScope.filePath; | ||
var stylesheet = stylesheets[fileScopeId]; | ||
if (!stylesheet) { | ||
const styleEl = document.createElement('style'); | ||
var styleEl = document.createElement('style'); | ||
if (fileScope.packageName) { | ||
@@ -16,0 +17,0 @@ styleEl.setAttribute('data-package', fileScope.packageName); |
@@ -5,11 +5,12 @@ 'use strict'; | ||
const stylesheets = {}; | ||
const injectStyles = ({ | ||
fileScope, | ||
css | ||
}) => { | ||
const fileScopeId = fileScope.packageName ? [fileScope.packageName, fileScope.filePath].join('/') : fileScope.filePath; | ||
let stylesheet = stylesheets[fileScopeId]; | ||
var stylesheets = {}; | ||
var injectStyles = _ref => { | ||
var { | ||
fileScope, | ||
css | ||
} = _ref; | ||
var fileScopeId = fileScope.packageName ? [fileScope.packageName, fileScope.filePath].join('/') : fileScope.filePath; | ||
var stylesheet = stylesheets[fileScopeId]; | ||
if (!stylesheet) { | ||
const styleEl = document.createElement('style'); | ||
var styleEl = document.createElement('style'); | ||
if (fileScope.packageName) { | ||
@@ -16,0 +17,0 @@ styleEl.setAttribute('data-package', fileScope.packageName); |
@@ -1,10 +0,11 @@ | ||
const stylesheets = {}; | ||
const injectStyles = ({ | ||
fileScope, | ||
css | ||
}) => { | ||
const fileScopeId = fileScope.packageName ? [fileScope.packageName, fileScope.filePath].join('/') : fileScope.filePath; | ||
let stylesheet = stylesheets[fileScopeId]; | ||
var stylesheets = {}; | ||
var injectStyles = _ref => { | ||
var { | ||
fileScope, | ||
css | ||
} = _ref; | ||
var fileScopeId = fileScope.packageName ? [fileScope.packageName, fileScope.filePath].join('/') : fileScope.filePath; | ||
var stylesheet = stylesheets[fileScopeId]; | ||
if (!stylesheet) { | ||
const styleEl = document.createElement('style'); | ||
var styleEl = document.createElement('style'); | ||
if (fileScope.packageName) { | ||
@@ -11,0 +12,0 @@ styleEl.setAttribute('data-package', fileScope.packageName); |
{ | ||
"name": "@vanilla-extract/css", | ||
"version": "0.0.0-vite-plugin-new-20240115025310", | ||
"version": "0.0.0-vite-plugin-new-20240115050437", | ||
"description": "Zero-runtime Stylesheets-in-TypeScript", | ||
@@ -111,3 +111,3 @@ "sideEffects": true, | ||
"@emotion/hash": "^0.9.0", | ||
"@vanilla-extract/private": "0.0.0-vite-plugin-new-20240115025310", | ||
"@vanilla-extract/private": "0.0.0-vite-plugin-new-20240115050437", | ||
"chalk": "^4.1.1", | ||
@@ -114,0 +114,0 @@ "css-what": "^6.1.0", |
@@ -10,4 +10,4 @@ 'use strict'; | ||
*/ | ||
const addRecipe = functionSerializer_dist_vanillaExtractCssFunctionSerializer.addFunctionSerializer; | ||
var addRecipe = functionSerializer_dist_vanillaExtractCssFunctionSerializer.addFunctionSerializer; | ||
exports.addRecipe = addRecipe; |
@@ -6,4 +6,4 @@ import { addFunctionSerializer } from '../../functionSerializer/dist/vanilla-extract-css-functionSerializer.browser.esm.js'; | ||
*/ | ||
const addRecipe = addFunctionSerializer; | ||
var addRecipe = addFunctionSerializer; | ||
export { addRecipe }; |
@@ -10,4 +10,4 @@ 'use strict'; | ||
*/ | ||
const addRecipe = functionSerializer_dist_vanillaExtractCssFunctionSerializer.addFunctionSerializer; | ||
var addRecipe = functionSerializer_dist_vanillaExtractCssFunctionSerializer.addFunctionSerializer; | ||
exports.addRecipe = addRecipe; |
@@ -10,4 +10,4 @@ 'use strict'; | ||
*/ | ||
const addRecipe = functionSerializer_dist_vanillaExtractCssFunctionSerializer.addFunctionSerializer; | ||
var addRecipe = functionSerializer_dist_vanillaExtractCssFunctionSerializer.addFunctionSerializer; | ||
exports.addRecipe = addRecipe; |
@@ -6,4 +6,4 @@ import { addFunctionSerializer } from '../../functionSerializer/dist/vanilla-extract-css-functionSerializer.esm.js'; | ||
*/ | ||
const addRecipe = addFunctionSerializer; | ||
var addRecipe = addFunctionSerializer; | ||
export { addRecipe }; |
@@ -5,2 +5,3 @@ 'use strict'; | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('../../dist/transformCss-31e8d994.browser.cjs.js'); | ||
require('@vanilla-extract/private'); | ||
@@ -10,3 +11,3 @@ require('cssesc'); | ||
require('../../adapter/dist/vanilla-extract-css-adapter.browser.cjs.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('../../dist/transformCss-97c9e882.browser.cjs.js'); | ||
require('../../dist/taggedTemplateLiteral-00b821ff.browser.cjs.js'); | ||
require('css-what'); | ||
@@ -13,0 +14,0 @@ require('outdent'); |
@@ -0,1 +1,2 @@ | ||
export { t as transformCss } from '../../dist/transformCss-c4f994b8.browser.esm.js'; | ||
import '@vanilla-extract/private'; | ||
@@ -5,5 +6,5 @@ import 'cssesc'; | ||
import '../../adapter/dist/vanilla-extract-css-adapter.browser.esm.js'; | ||
export { t as transformCss } from '../../dist/transformCss-35fbcc6e.browser.esm.js'; | ||
import '../../dist/taggedTemplateLiteral-8e47dbd7.browser.esm.js'; | ||
import 'css-what'; | ||
import 'outdent'; | ||
import 'media-query-parser'; |
@@ -5,2 +5,3 @@ 'use strict'; | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('../../dist/transformCss-55fec1c7.cjs.dev.js'); | ||
require('@vanilla-extract/private'); | ||
@@ -10,3 +11,3 @@ require('cssesc'); | ||
require('../../adapter/dist/vanilla-extract-css-adapter.cjs.dev.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('../../dist/transformCss-15eca288.cjs.dev.js'); | ||
require('../../dist/taggedTemplateLiteral-4fcaa261.cjs.dev.js'); | ||
require('css-what'); | ||
@@ -13,0 +14,0 @@ require('outdent'); |
@@ -5,2 +5,3 @@ 'use strict'; | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('../../dist/transformCss-549fbfa4.cjs.prod.js'); | ||
require('@vanilla-extract/private'); | ||
@@ -10,3 +11,3 @@ require('cssesc'); | ||
require('../../adapter/dist/vanilla-extract-css-adapter.cjs.prod.js'); | ||
var transformCss_dist_vanillaExtractCssTransformCss = require('../../dist/transformCss-f0d00910.cjs.prod.js'); | ||
require('../../dist/taggedTemplateLiteral-0bfb2e96.cjs.prod.js'); | ||
require('css-what'); | ||
@@ -13,0 +14,0 @@ require('outdent'); |
@@ -0,1 +1,2 @@ | ||
export { t as transformCss } from '../../dist/transformCss-810a10c3.esm.js'; | ||
import '@vanilla-extract/private'; | ||
@@ -5,5 +6,5 @@ import 'cssesc'; | ||
import '../../adapter/dist/vanilla-extract-css-adapter.esm.js'; | ||
export { t as transformCss } from '../../dist/transformCss-4ff5fbc3.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
332749
84
8682
1
+ Added@vanilla-extract/private@0.0.0-vite-plugin-new-20240115050437(transitive)
- Removed@vanilla-extract/private@0.0.0-vite-plugin-new-20240115025310(transitive)
Updated@vanilla-extract/private@0.0.0-vite-plugin-new-20240115050437