Private
Public Access
1
0

feat: Fluent UI Outlook Lite + connections mockup

This commit is contained in:
2026-04-14 18:52:25 +00:00
parent 1199eff6c3
commit dfa4010406
34820 changed files with 1003813 additions and 205 deletions

View File

@@ -0,0 +1,73 @@
'use strict';
var hyphenateProperty = require('./utils/hyphenateProperty.cjs.js');
var normalizeNestedProperty = require('./utils/normalizeNestedProperty.cjs.js');
var compileCSSRules = require('./compileCSSRules.cjs.js');
const PSEUDO_SELECTOR_REGEX = /,( *[^ &])/g;
/**
* Normalizes pseudo selectors to always contain &, requires to work properly with comma-separated selectors.
*
* @example
* ":hover" => "&:hover"
* " :hover" => "& :hover"
* ":hover,:focus" => "&:hover,&:focus"
* " :hover, :focus" => "& :hover,& :focus"
*/
function normalizePseudoSelector(pseudoSelector) {
return '&' + normalizeNestedProperty.normalizeNestedProperty(
// Regex there replaces a comma, spaces and an ampersand if it's present with comma and an ampersand.
// This allows to normalize input, see examples in JSDoc.
pseudoSelector.replace(PSEUDO_SELECTOR_REGEX, ',&$1'));
}
function createCSSRule(classNameSelector, cssDeclaration, pseudos) {
let cssRule = cssDeclaration;
if (pseudos.length > 0) {
cssRule = pseudos.reduceRight((acc, selector) => {
return `${normalizePseudoSelector(selector)} { ${acc} }`;
}, cssDeclaration);
}
return `${classNameSelector}{${cssRule}}`;
}
function compileAtomicCSSRule(options, atRules) {
const {
className,
selectors,
property,
rtlClassName,
rtlProperty,
rtlValue,
value
} = options;
const {
container,
layer,
media,
supports
} = atRules;
const classNameSelector = `.${className}`;
const cssDeclaration = Array.isArray(value) ? `${value.map(v => `${hyphenateProperty.hyphenateProperty(property)}: ${v}`).join(';')};` : `${hyphenateProperty.hyphenateProperty(property)}: ${value};`;
let cssRule = createCSSRule(classNameSelector, cssDeclaration, selectors);
if (rtlProperty && rtlClassName) {
const rtlClassNameSelector = `.${rtlClassName}`;
const rtlCSSDeclaration = Array.isArray(rtlValue) ? `${rtlValue.map(v => `${hyphenateProperty.hyphenateProperty(rtlProperty)}: ${v}`).join(';')};` : `${hyphenateProperty.hyphenateProperty(rtlProperty)}: ${rtlValue};`;
cssRule += createCSSRule(rtlClassNameSelector, rtlCSSDeclaration, selectors);
}
if (media) {
cssRule = `@media ${media} { ${cssRule} }`;
}
if (layer) {
cssRule = `@layer ${layer} { ${cssRule} }`;
}
if (supports) {
cssRule = `@supports ${supports} { ${cssRule} }`;
}
if (container) {
cssRule = `@container ${container} { ${cssRule} }`;
}
return compileCSSRules.compileCSSRules(cssRule, true);
}
exports.compileAtomicCSSRule = compileAtomicCSSRule;
exports.normalizePseudoSelector = normalizePseudoSelector;
//# sourceMappingURL=compileAtomicCSSRule.cjs.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,70 @@
import { hyphenateProperty } from './utils/hyphenateProperty.esm.js';
import { normalizeNestedProperty } from './utils/normalizeNestedProperty.esm.js';
import { compileCSSRules } from './compileCSSRules.esm.js';
const PSEUDO_SELECTOR_REGEX = /,( *[^ &])/g;
/**
* Normalizes pseudo selectors to always contain &, requires to work properly with comma-separated selectors.
*
* @example
* ":hover" => "&:hover"
* " :hover" => "& :hover"
* ":hover,:focus" => "&:hover,&:focus"
* " :hover, :focus" => "& :hover,& :focus"
*/
function normalizePseudoSelector(pseudoSelector) {
return '&' + normalizeNestedProperty(
// Regex there replaces a comma, spaces and an ampersand if it's present with comma and an ampersand.
// This allows to normalize input, see examples in JSDoc.
pseudoSelector.replace(PSEUDO_SELECTOR_REGEX, ',&$1'));
}
function createCSSRule(classNameSelector, cssDeclaration, pseudos) {
let cssRule = cssDeclaration;
if (pseudos.length > 0) {
cssRule = pseudos.reduceRight((acc, selector) => {
return `${normalizePseudoSelector(selector)} { ${acc} }`;
}, cssDeclaration);
}
return `${classNameSelector}{${cssRule}}`;
}
function compileAtomicCSSRule(options, atRules) {
const {
className,
selectors,
property,
rtlClassName,
rtlProperty,
rtlValue,
value
} = options;
const {
container,
layer,
media,
supports
} = atRules;
const classNameSelector = `.${className}`;
const cssDeclaration = Array.isArray(value) ? `${value.map(v => `${hyphenateProperty(property)}: ${v}`).join(';')};` : `${hyphenateProperty(property)}: ${value};`;
let cssRule = createCSSRule(classNameSelector, cssDeclaration, selectors);
if (rtlProperty && rtlClassName) {
const rtlClassNameSelector = `.${rtlClassName}`;
const rtlCSSDeclaration = Array.isArray(rtlValue) ? `${rtlValue.map(v => `${hyphenateProperty(rtlProperty)}: ${v}`).join(';')};` : `${hyphenateProperty(rtlProperty)}: ${rtlValue};`;
cssRule += createCSSRule(rtlClassNameSelector, rtlCSSDeclaration, selectors);
}
if (media) {
cssRule = `@media ${media} { ${cssRule} }`;
}
if (layer) {
cssRule = `@layer ${layer} { ${cssRule} }`;
}
if (supports) {
cssRule = `@supports ${supports} { ${cssRule} }`;
}
if (container) {
cssRule = `@container ${container} { ${cssRule} }`;
}
return compileCSSRules(cssRule, true);
}
export { compileAtomicCSSRule, normalizePseudoSelector };
//# sourceMappingURL=compileAtomicCSSRule.esm.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,21 @@
'use strict';
var stylis = require('stylis');
var globalPlugin = require('./stylis/globalPlugin.cjs.js');
var prefixerPlugin = require('./stylis/prefixerPlugin.cjs.js');
var sortClassesInAtRulesPlugin = require('./stylis/sortClassesInAtRulesPlugin.cjs.js');
// eslint-disable-next-line @typescript-eslint/no-empty-function
function noop() {}
function compileCSSRules(cssRules, sortClassesInAtRules) {
const rules = [];
stylis.serialize(stylis.compile(cssRules), stylis.middleware([globalPlugin.globalPlugin, sortClassesInAtRules ? sortClassesInAtRulesPlugin.sortClassesInAtRulesPlugin : noop, prefixerPlugin.prefixerPlugin, stylis.stringify,
// 💡 we are using `.insertRule()` API for DOM operations, which does not support
// insertion of multiple CSS rules in a single call. `rulesheet` plugin extracts
// individual rules to be used with this API
stylis.rulesheet(rule => rules.push(rule))]));
return rules;
}
exports.compileCSSRules = compileCSSRules;
//# sourceMappingURL=compileCSSRules.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"compileCSSRules.cjs.js","sources":["../../../../packages/core/src/runtime/compileCSSRules.ts"],"sourcesContent":["import { compile, middleware, rulesheet, serialize, stringify } from 'stylis';\n\nimport { globalPlugin } from './stylis/globalPlugin';\nimport { prefixerPlugin } from './stylis/prefixerPlugin';\nimport { sortClassesInAtRulesPlugin } from './stylis/sortClassesInAtRulesPlugin';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction noop() {}\n\nexport function compileCSSRules(cssRules: string, sortClassesInAtRules: boolean): string[] {\n const rules: string[] = [];\n\n serialize(\n compile(cssRules),\n middleware([\n globalPlugin,\n sortClassesInAtRules ? sortClassesInAtRulesPlugin : noop,\n prefixerPlugin,\n stringify,\n\n // 💡 we are using `.insertRule()` API for DOM operations, which does not support\n // insertion of multiple CSS rules in a single call. `rulesheet` plugin extracts\n // individual rules to be used with this API\n rulesheet(rule => rules.push(rule)),\n ]),\n );\n\n return rules;\n}\n"],"names":["noop","compileCSSRules","cssRules","sortClassesInAtRules","rules","serialize","compile","middleware","globalPlugin","sortClassesInAtRulesPlugin","prefixerPlugin","stringify","rulesheet","rule","push"],"mappings":";;;;;;;AAMA;AACA,SAASA,IAAIA,IAAI;AAEX,SAAUC,eAAeA,CAACC,QAAgB,EAAEC,oBAA6B,EAAA;EAC7E,MAAMC,KAAK,GAAa,EAAE;AAE1BC,EAAAA,gBAAS,CACPC,cAAO,CAACJ,QAAQ,CAAC,EACjBK,iBAAU,CAAC,CACTC,yBAAY,EACZL,oBAAoB,GAAGM,qDAA0B,GAAGT,IAAI,EACxDU,6BAAc,EACdC,gBAAS;AAET;AACA;AACA;AACAC,EAAAA,gBAAS,CAACC,IAAI,IAAIT,KAAK,CAACU,IAAI,CAACD,IAAI,CAAC,CAAC,CACpC,CAAC,CACH;AAED,EAAA,OAAOT,KAAK;AACd;;;;"}

View File

@@ -0,0 +1,19 @@
import { serialize, compile, middleware, stringify, rulesheet } from 'stylis';
import { globalPlugin } from './stylis/globalPlugin.esm.js';
import { prefixerPlugin } from './stylis/prefixerPlugin.esm.js';
import { sortClassesInAtRulesPlugin } from './stylis/sortClassesInAtRulesPlugin.esm.js';
// eslint-disable-next-line @typescript-eslint/no-empty-function
function noop() {}
function compileCSSRules(cssRules, sortClassesInAtRules) {
const rules = [];
serialize(compile(cssRules), middleware([globalPlugin, sortClassesInAtRules ? sortClassesInAtRulesPlugin : noop, prefixerPlugin, stringify,
// 💡 we are using `.insertRule()` API for DOM operations, which does not support
// insertion of multiple CSS rules in a single call. `rulesheet` plugin extracts
// individual rules to be used with this API
rulesheet(rule => rules.push(rule))]));
return rules;
}
export { compileCSSRules };
//# sourceMappingURL=compileCSSRules.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"compileCSSRules.esm.js","sources":["../../../../packages/core/src/runtime/compileCSSRules.ts"],"sourcesContent":["import { compile, middleware, rulesheet, serialize, stringify } from 'stylis';\n\nimport { globalPlugin } from './stylis/globalPlugin';\nimport { prefixerPlugin } from './stylis/prefixerPlugin';\nimport { sortClassesInAtRulesPlugin } from './stylis/sortClassesInAtRulesPlugin';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction noop() {}\n\nexport function compileCSSRules(cssRules: string, sortClassesInAtRules: boolean): string[] {\n const rules: string[] = [];\n\n serialize(\n compile(cssRules),\n middleware([\n globalPlugin,\n sortClassesInAtRules ? sortClassesInAtRulesPlugin : noop,\n prefixerPlugin,\n stringify,\n\n // 💡 we are using `.insertRule()` API for DOM operations, which does not support\n // insertion of multiple CSS rules in a single call. `rulesheet` plugin extracts\n // individual rules to be used with this API\n rulesheet(rule => rules.push(rule)),\n ]),\n );\n\n return rules;\n}\n"],"names":["noop","compileCSSRules","cssRules","sortClassesInAtRules","rules","serialize","compile","middleware","globalPlugin","sortClassesInAtRulesPlugin","prefixerPlugin","stringify","rulesheet","rule","push"],"mappings":";;;;;AAMA;AACA,SAASA,IAAIA,IAAI;AAEX,SAAUC,eAAeA,CAACC,QAAgB,EAAEC,oBAA6B,EAAA;EAC7E,MAAMC,KAAK,GAAa,EAAE;AAE1BC,EAAAA,SAAS,CACPC,OAAO,CAACJ,QAAQ,CAAC,EACjBK,UAAU,CAAC,CACTC,YAAY,EACZL,oBAAoB,GAAGM,0BAA0B,GAAGT,IAAI,EACxDU,cAAc,EACdC,SAAS;AAET;AACA;AACA;AACAC,EAAAA,SAAS,CAACC,IAAI,IAAIT,KAAK,CAACU,IAAI,CAACD,IAAI,CAAC,CAAC,CACpC,CAAC,CACH;AAED,EAAA,OAAOT,KAAK;AACd;;;;"}

View File

@@ -0,0 +1,31 @@
'use strict';
var stylis = require('stylis');
var prefixerPlugin = require('./stylis/prefixerPlugin.cjs.js');
var cssifyObject = require('./utils/cssifyObject.cjs.js');
function compileKeyframeRule(keyframeObject) {
let css = '';
// eslint-disable-next-line guard-for-in
for (const percentage in keyframeObject) {
css += `${percentage}{${cssifyObject.cssifyObject(keyframeObject[percentage])}}`;
}
return css;
}
/**
* Creates CSS rules for insertion from passed CSS.
*/
function compileKeyframesCSS(keyframeName, keyframeCSS) {
const cssRule = `@keyframes ${keyframeName} {${keyframeCSS}}`;
const rules = [];
stylis.serialize(stylis.compile(cssRule), stylis.middleware([stylis.stringify, prefixerPlugin.prefixerPlugin,
// 💡 we are using `.insertRule()` API for DOM operations, which does not support
// insertion of multiple CSS rules in a single call. `rulesheet` plugin extracts
// individual rules to be used with this API
stylis.rulesheet(rule => rules.push(rule))]));
return rules;
}
exports.compileKeyframeRule = compileKeyframeRule;
exports.compileKeyframesCSS = compileKeyframesCSS;
//# sourceMappingURL=compileKeyframeCSS.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"compileKeyframeCSS.cjs.js","sources":["../../../../packages/core/src/runtime/compileKeyframeCSS.ts"],"sourcesContent":["import type { GriffelAnimation } from '@griffel/style-types';\nimport { compile, middleware, serialize, rulesheet, stringify } from 'stylis';\n\nimport { prefixerPlugin } from './stylis/prefixerPlugin';\nimport { cssifyObject } from './utils/cssifyObject';\n\nexport function compileKeyframeRule(keyframeObject: GriffelAnimation): string {\n let css = '';\n\n // eslint-disable-next-line guard-for-in\n for (const percentage in keyframeObject) {\n css += `${percentage}{${cssifyObject(keyframeObject[percentage])}}`;\n }\n\n return css;\n}\n\n/**\n * Creates CSS rules for insertion from passed CSS.\n */\nexport function compileKeyframesCSS(keyframeName: string, keyframeCSS: string): string[] {\n const cssRule = `@keyframes ${keyframeName} {${keyframeCSS}}`;\n const rules: string[] = [];\n\n serialize(\n compile(cssRule),\n middleware([\n stringify,\n prefixerPlugin,\n // 💡 we are using `.insertRule()` API for DOM operations, which does not support\n // insertion of multiple CSS rules in a single call. `rulesheet` plugin extracts\n // individual rules to be used with this API\n rulesheet(rule => rules.push(rule)),\n ]),\n );\n\n return rules;\n}\n"],"names":["compileKeyframeRule","keyframeObject","css","percentage","cssifyObject","compileKeyframesCSS","keyframeName","keyframeCSS","cssRule","rules","serialize","compile","middleware","stringify","prefixerPlugin","rulesheet","rule","push"],"mappings":";;;;;;AAMM,SAAUA,mBAAmBA,CAACC,cAAgC,EAAA;EAClE,IAAIC,GAAG,GAAG,EAAE;AAEZ;AACA,EAAA,KAAK,MAAMC,UAAU,IAAIF,cAAc,EAAE;IACvCC,GAAG,IAAI,CAAA,EAAGC,UAAU,CAAA,CAAA,EAAIC,yBAAY,CAACH,cAAc,CAACE,UAAU,CAAC,CAAC,CAAA,CAAA,CAAG;AACrE,EAAA;AAEA,EAAA,OAAOD,GAAG;AACZ;AAEA;;AAEG;AACG,SAAUG,mBAAmBA,CAACC,YAAoB,EAAEC,WAAmB,EAAA;AAC3E,EAAA,MAAMC,OAAO,GAAG,CAAA,WAAA,EAAcF,YAAY,CAAA,EAAA,EAAKC,WAAW,CAAA,CAAA,CAAG;EAC7D,MAAME,KAAK,GAAa,EAAE;EAE1BC,gBAAS,CACPC,cAAO,CAACH,OAAO,CAAC,EAChBI,iBAAU,CAAC,CACTC,gBAAS,EACTC,6BAAc;AACd;AACA;AACA;AACAC,EAAAA,gBAAS,CAACC,IAAI,IAAIP,KAAK,CAACQ,IAAI,CAACD,IAAI,CAAC,CAAC,CACpC,CAAC,CACH;AAED,EAAA,OAAOP,KAAK;AACd;;;;;"}

View File

@@ -0,0 +1,28 @@
import { serialize, compile, middleware, stringify, rulesheet } from 'stylis';
import { prefixerPlugin } from './stylis/prefixerPlugin.esm.js';
import { cssifyObject } from './utils/cssifyObject.esm.js';
function compileKeyframeRule(keyframeObject) {
let css = '';
// eslint-disable-next-line guard-for-in
for (const percentage in keyframeObject) {
css += `${percentage}{${cssifyObject(keyframeObject[percentage])}}`;
}
return css;
}
/**
* Creates CSS rules for insertion from passed CSS.
*/
function compileKeyframesCSS(keyframeName, keyframeCSS) {
const cssRule = `@keyframes ${keyframeName} {${keyframeCSS}}`;
const rules = [];
serialize(compile(cssRule), middleware([stringify, prefixerPlugin,
// 💡 we are using `.insertRule()` API for DOM operations, which does not support
// insertion of multiple CSS rules in a single call. `rulesheet` plugin extracts
// individual rules to be used with this API
rulesheet(rule => rules.push(rule))]));
return rules;
}
export { compileKeyframeRule, compileKeyframesCSS };
//# sourceMappingURL=compileKeyframeCSS.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"compileKeyframeCSS.esm.js","sources":["../../../../packages/core/src/runtime/compileKeyframeCSS.ts"],"sourcesContent":["import type { GriffelAnimation } from '@griffel/style-types';\nimport { compile, middleware, serialize, rulesheet, stringify } from 'stylis';\n\nimport { prefixerPlugin } from './stylis/prefixerPlugin';\nimport { cssifyObject } from './utils/cssifyObject';\n\nexport function compileKeyframeRule(keyframeObject: GriffelAnimation): string {\n let css = '';\n\n // eslint-disable-next-line guard-for-in\n for (const percentage in keyframeObject) {\n css += `${percentage}{${cssifyObject(keyframeObject[percentage])}}`;\n }\n\n return css;\n}\n\n/**\n * Creates CSS rules for insertion from passed CSS.\n */\nexport function compileKeyframesCSS(keyframeName: string, keyframeCSS: string): string[] {\n const cssRule = `@keyframes ${keyframeName} {${keyframeCSS}}`;\n const rules: string[] = [];\n\n serialize(\n compile(cssRule),\n middleware([\n stringify,\n prefixerPlugin,\n // 💡 we are using `.insertRule()` API for DOM operations, which does not support\n // insertion of multiple CSS rules in a single call. `rulesheet` plugin extracts\n // individual rules to be used with this API\n rulesheet(rule => rules.push(rule)),\n ]),\n );\n\n return rules;\n}\n"],"names":["compileKeyframeRule","keyframeObject","css","percentage","cssifyObject","compileKeyframesCSS","keyframeName","keyframeCSS","cssRule","rules","serialize","compile","middleware","stringify","prefixerPlugin","rulesheet","rule","push"],"mappings":";;;;AAMM,SAAUA,mBAAmBA,CAACC,cAAgC,EAAA;EAClE,IAAIC,GAAG,GAAG,EAAE;AAEZ;AACA,EAAA,KAAK,MAAMC,UAAU,IAAIF,cAAc,EAAE;IACvCC,GAAG,IAAI,CAAA,EAAGC,UAAU,CAAA,CAAA,EAAIC,YAAY,CAACH,cAAc,CAACE,UAAU,CAAC,CAAC,CAAA,CAAA,CAAG;AACrE,EAAA;AAEA,EAAA,OAAOD,GAAG;AACZ;AAEA;;AAEG;AACG,SAAUG,mBAAmBA,CAACC,YAAoB,EAAEC,WAAmB,EAAA;AAC3E,EAAA,MAAMC,OAAO,GAAG,CAAA,WAAA,EAAcF,YAAY,CAAA,EAAA,EAAKC,WAAW,CAAA,CAAA,CAAG;EAC7D,MAAME,KAAK,GAAa,EAAE;EAE1BC,SAAS,CACPC,OAAO,CAACH,OAAO,CAAC,EAChBI,UAAU,CAAC,CACTC,SAAS,EACTC,cAAc;AACd;AACA;AACA;AACAC,EAAAA,SAAS,CAACC,IAAI,IAAIP,KAAK,CAACQ,IAAI,CAACD,IAAI,CAAC,CAAC,CACpC,CAAC,CACH;AAED,EAAA,OAAOP,KAAK;AACd;;;;"}

View File

@@ -0,0 +1,27 @@
'use strict';
var stylis = require('stylis');
var globalPlugin = require('./stylis/globalPlugin.cjs.js');
var isAtRuleElement = require('./stylis/isAtRuleElement.cjs.js');
var prefixerPlugin = require('./stylis/prefixerPlugin.cjs.js');
var rulesheetPlugin = require('./stylis/rulesheetPlugin.cjs.js');
function compileResetCSSRules(cssRules) {
const rules = [];
const atRules = [];
stylis.serialize(stylis.compile(cssRules), stylis.middleware([globalPlugin.globalPlugin, prefixerPlugin.prefixerPlugin, stylis.stringify,
// 💡 we are using `.insertRule()` API for DOM operations, which does not support
// insertion of multiple CSS rules in a single call. `rulesheet` plugin extracts
// individual rules to be used with this API
rulesheetPlugin.rulesheetPlugin((element, rule) => {
if (isAtRuleElement.isAtRuleElement(element)) {
atRules.push(rule);
return;
}
rules.push(rule);
})]));
return [rules, atRules];
}
exports.compileResetCSSRules = compileResetCSSRules;
//# sourceMappingURL=compileResetCSSRules.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"compileResetCSSRules.cjs.js","sources":["../../../../packages/core/src/runtime/compileResetCSSRules.ts"],"sourcesContent":["import { compile, middleware, serialize, stringify } from 'stylis';\n\nimport { globalPlugin } from './stylis/globalPlugin';\nimport { isAtRuleElement } from './stylis/isAtRuleElement';\nimport { prefixerPlugin } from './stylis/prefixerPlugin';\nimport { rulesheetPlugin } from './stylis/rulesheetPlugin';\n\nexport function compileResetCSSRules(cssRules: string): [string[], string[]] {\n const rules: string[] = [];\n const atRules: string[] = [];\n\n serialize(\n compile(cssRules),\n middleware([\n globalPlugin,\n prefixerPlugin,\n stringify,\n\n // 💡 we are using `.insertRule()` API for DOM operations, which does not support\n // insertion of multiple CSS rules in a single call. `rulesheet` plugin extracts\n // individual rules to be used with this API\n rulesheetPlugin((element, rule) => {\n if (isAtRuleElement(element)) {\n atRules.push(rule);\n return;\n }\n\n rules.push(rule);\n }),\n ]),\n );\n\n return [rules, atRules];\n}\n"],"names":["compileResetCSSRules","cssRules","rules","atRules","serialize","compile","middleware","globalPlugin","prefixerPlugin","stringify","rulesheetPlugin","element","rule","isAtRuleElement","push"],"mappings":";;;;;;;;AAOM,SAAUA,oBAAoBA,CAACC,QAAgB,EAAA;EACnD,MAAMC,KAAK,GAAa,EAAE;EAC1B,MAAMC,OAAO,GAAa,EAAE;AAE5BC,EAAAA,gBAAS,CACPC,cAAO,CAACJ,QAAQ,CAAC,EACjBK,iBAAU,CAAC,CACTC,yBAAY,EACZC,6BAAc,EACdC,gBAAS;AAET;AACA;AACA;AACAC,EAAAA,+BAAe,CAAC,CAACC,OAAO,EAAEC,IAAI,KAAI;AAChC,IAAA,IAAIC,+BAAe,CAACF,OAAO,CAAC,EAAE;AAC5BR,MAAAA,OAAO,CAACW,IAAI,CAACF,IAAI,CAAC;AAClB,MAAA;AACF,IAAA;AAEAV,IAAAA,KAAK,CAACY,IAAI,CAACF,IAAI,CAAC;EAClB,CAAC,CAAC,CACH,CAAC,CACH;AAED,EAAA,OAAO,CAACV,KAAK,EAAEC,OAAO,CAAC;AACzB;;;;"}

View File

@@ -0,0 +1,25 @@
import { serialize, compile, middleware, stringify } from 'stylis';
import { globalPlugin } from './stylis/globalPlugin.esm.js';
import { isAtRuleElement } from './stylis/isAtRuleElement.esm.js';
import { prefixerPlugin } from './stylis/prefixerPlugin.esm.js';
import { rulesheetPlugin } from './stylis/rulesheetPlugin.esm.js';
function compileResetCSSRules(cssRules) {
const rules = [];
const atRules = [];
serialize(compile(cssRules), middleware([globalPlugin, prefixerPlugin, stringify,
// 💡 we are using `.insertRule()` API for DOM operations, which does not support
// insertion of multiple CSS rules in a single call. `rulesheet` plugin extracts
// individual rules to be used with this API
rulesheetPlugin((element, rule) => {
if (isAtRuleElement(element)) {
atRules.push(rule);
return;
}
rules.push(rule);
})]));
return [rules, atRules];
}
export { compileResetCSSRules };
//# sourceMappingURL=compileResetCSSRules.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"compileResetCSSRules.esm.js","sources":["../../../../packages/core/src/runtime/compileResetCSSRules.ts"],"sourcesContent":["import { compile, middleware, serialize, stringify } from 'stylis';\n\nimport { globalPlugin } from './stylis/globalPlugin';\nimport { isAtRuleElement } from './stylis/isAtRuleElement';\nimport { prefixerPlugin } from './stylis/prefixerPlugin';\nimport { rulesheetPlugin } from './stylis/rulesheetPlugin';\n\nexport function compileResetCSSRules(cssRules: string): [string[], string[]] {\n const rules: string[] = [];\n const atRules: string[] = [];\n\n serialize(\n compile(cssRules),\n middleware([\n globalPlugin,\n prefixerPlugin,\n stringify,\n\n // 💡 we are using `.insertRule()` API for DOM operations, which does not support\n // insertion of multiple CSS rules in a single call. `rulesheet` plugin extracts\n // individual rules to be used with this API\n rulesheetPlugin((element, rule) => {\n if (isAtRuleElement(element)) {\n atRules.push(rule);\n return;\n }\n\n rules.push(rule);\n }),\n ]),\n );\n\n return [rules, atRules];\n}\n"],"names":["compileResetCSSRules","cssRules","rules","atRules","serialize","compile","middleware","globalPlugin","prefixerPlugin","stringify","rulesheetPlugin","element","rule","isAtRuleElement","push"],"mappings":";;;;;;AAOM,SAAUA,oBAAoBA,CAACC,QAAgB,EAAA;EACnD,MAAMC,KAAK,GAAa,EAAE;EAC1B,MAAMC,OAAO,GAAa,EAAE;AAE5BC,EAAAA,SAAS,CACPC,OAAO,CAACJ,QAAQ,CAAC,EACjBK,UAAU,CAAC,CACTC,YAAY,EACZC,cAAc,EACdC,SAAS;AAET;AACA;AACA;AACAC,EAAAA,eAAe,CAAC,CAACC,OAAO,EAAEC,IAAI,KAAI;AAChC,IAAA,IAAIC,eAAe,CAACF,OAAO,CAAC,EAAE;AAC5BR,MAAAA,OAAO,CAACW,IAAI,CAACF,IAAI,CAAC;AAClB,MAAA;AACF,IAAA;AAEAV,IAAAA,KAAK,CAACY,IAAI,CAACF,IAAI,CAAC;EAClB,CAAC,CAAC,CACH,CAAC,CACH;AAED,EAAA,OAAO,CAACV,KAAK,EAAEC,OAAO,CAAC;AACzB;;;;"}

View File

@@ -0,0 +1,12 @@
'use strict';
var cssifyObject = require('./utils/cssifyObject.cjs.js');
var compileCSSRules = require('./compileCSSRules.cjs.js');
function compileStaticCSS(property, value) {
const cssRule = `${property} {${cssifyObject.cssifyObject(value)}}`;
return compileCSSRules.compileCSSRules(cssRule, false)[0];
}
exports.compileStaticCSS = compileStaticCSS;
//# sourceMappingURL=compileStaticCSS.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"compileStaticCSS.cjs.js","sources":["../../../../packages/core/src/runtime/compileStaticCSS.ts"],"sourcesContent":["import type { GriffelStaticStyle } from '@griffel/style-types';\n\nimport { cssifyObject } from './utils/cssifyObject';\nimport { compileCSSRules } from './compileCSSRules';\n\nexport function compileStaticCSS(property: string, value: GriffelStaticStyle): string {\n const cssRule = `${property} {${cssifyObject(value)}}`;\n return compileCSSRules(cssRule, false)[0];\n}\n"],"names":["compileStaticCSS","property","value","cssRule","cssifyObject","compileCSSRules"],"mappings":";;;;;AAKM,SAAUA,gBAAgBA,CAACC,QAAgB,EAAEC,KAAyB,EAAA;EAC1E,MAAMC,OAAO,GAAG,CAAA,EAAGF,QAAQ,KAAKG,yBAAY,CAACF,KAAK,CAAC,CAAA,CAAA,CAAG;EACtD,OAAOG,+BAAe,CAACF,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3C;;;;"}

View File

@@ -0,0 +1,10 @@
import { cssifyObject } from './utils/cssifyObject.esm.js';
import { compileCSSRules } from './compileCSSRules.esm.js';
function compileStaticCSS(property, value) {
const cssRule = `${property} {${cssifyObject(value)}}`;
return compileCSSRules(cssRule, false)[0];
}
export { compileStaticCSS };
//# sourceMappingURL=compileStaticCSS.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"compileStaticCSS.esm.js","sources":["../../../../packages/core/src/runtime/compileStaticCSS.ts"],"sourcesContent":["import type { GriffelStaticStyle } from '@griffel/style-types';\n\nimport { cssifyObject } from './utils/cssifyObject';\nimport { compileCSSRules } from './compileCSSRules';\n\nexport function compileStaticCSS(property: string, value: GriffelStaticStyle): string {\n const cssRule = `${property} {${cssifyObject(value)}}`;\n return compileCSSRules(cssRule, false)[0];\n}\n"],"names":["compileStaticCSS","property","value","cssRule","cssifyObject","compileCSSRules"],"mappings":";;;AAKM,SAAUA,gBAAgBA,CAACC,QAAgB,EAAEC,KAAyB,EAAA;EAC1E,MAAMC,OAAO,GAAG,CAAA,EAAGF,QAAQ,KAAKG,YAAY,CAACF,KAAK,CAAC,CAAA,CAAA,CAAG;EACtD,OAAOG,eAAe,CAACF,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3C;;;;"}

View File

@@ -0,0 +1,70 @@
'use strict';
/**
* Maps the long pseudo name to the short pseudo name. Pseudos that match here will be ordered, everything else will
* make their way to default style bucket. We reduce the pseudo name to save bundlesize.
* Thankfully there aren't any overlaps, see: https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes.
*/
const pseudosMap = {
// :focus-within
'us-w': 'w',
// :focus-visible
'us-v': 'i',
// :link
nk: 'l',
// :visited
si: 'v',
// :focus
cu: 'f',
// :hover
ve: 'h',
// :active
ti: 'a'
};
/**
* Gets the bucket depending on the pseudo.
*
* Input:
*
* ```
* ":hover"
* ":focus:hover"
* ```
*
* Output:
*
* ```
* "h"
* "f"
* ```
*
* @internal
*/
function getStyleBucketName(selectors, atRules) {
if (atRules.media) {
return 'm';
}
// We are grouping all the at-rules like @supports etc. under `t` bucket.
if (atRules.layer || atRules.supports) {
return 't';
}
if (atRules.container) {
return 'c';
}
if (selectors.length > 0) {
const normalizedPseudo = selectors[0].trim();
if (normalizedPseudo.charCodeAt(0) === 58 /* ":" */) {
// We send through a subset of the string instead of the full pseudo name.
// For example:
// - `"focus-visible"` name would instead of `"us-v"`.
// - `"focus"` name would instead of `"us"`.
// Return a mapped pseudo else default bucket.
return pseudosMap[normalizedPseudo.slice(4, 8)] /* allows to avoid collisions between "focus-visible" & "focus" */ || pseudosMap[normalizedPseudo.slice(3, 5)] || 'd';
}
}
// Return default bucket
return 'd';
}
exports.getStyleBucketName = getStyleBucketName;
//# sourceMappingURL=getStyleBucketName.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getStyleBucketName.cjs.js","sources":["../../../../packages/core/src/runtime/getStyleBucketName.ts"],"sourcesContent":["import type { StyleBucketName } from '../types';\nimport type { AtRules } from './utils/types';\n\n/**\n * Maps the long pseudo name to the short pseudo name. Pseudos that match here will be ordered, everything else will\n * make their way to default style bucket. We reduce the pseudo name to save bundlesize.\n * Thankfully there aren't any overlaps, see: https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes.\n */\nconst pseudosMap: Record<string, StyleBucketName | undefined> = {\n // :focus-within\n 'us-w': 'w',\n // :focus-visible\n 'us-v': 'i',\n\n // :link\n nk: 'l',\n // :visited\n si: 'v',\n // :focus\n cu: 'f',\n // :hover\n ve: 'h',\n // :active\n ti: 'a',\n};\n\n/**\n * Gets the bucket depending on the pseudo.\n *\n * Input:\n *\n * ```\n * \":hover\"\n * \":focus:hover\"\n * ```\n *\n * Output:\n *\n * ```\n * \"h\"\n * \"f\"\n * ```\n *\n * @internal\n */\nexport function getStyleBucketName(selectors: string[], atRules: AtRules): StyleBucketName {\n if (atRules.media) {\n return 'm';\n }\n\n // We are grouping all the at-rules like @supports etc. under `t` bucket.\n if (atRules.layer || atRules.supports) {\n return 't';\n }\n\n if (atRules.container) {\n return 'c';\n }\n\n if (selectors.length > 0) {\n const normalizedPseudo = selectors[0].trim();\n\n if (normalizedPseudo.charCodeAt(0) === 58 /* \":\" */) {\n // We send through a subset of the string instead of the full pseudo name.\n // For example:\n // - `\"focus-visible\"` name would instead of `\"us-v\"`.\n // - `\"focus\"` name would instead of `\"us\"`.\n // Return a mapped pseudo else default bucket.\n\n return (\n pseudosMap[normalizedPseudo.slice(4, 8)] /* allows to avoid collisions between \"focus-visible\" & \"focus\" */ ||\n pseudosMap[normalizedPseudo.slice(3, 5)] ||\n 'd'\n );\n }\n }\n\n // Return default bucket\n return 'd';\n}\n"],"names":["pseudosMap","nk","si","cu","ve","ti","getStyleBucketName","selectors","atRules","media","layer","supports","container","length","normalizedPseudo","trim","charCodeAt","slice"],"mappings":";;AAGA;;;;AAIG;AACH,MAAMA,UAAU,GAAgD;AAC9D;AACA,EAAA,MAAM,EAAE,GAAG;AACX;AACA,EAAA,MAAM,EAAE,GAAG;AAEX;AACAC,EAAAA,EAAE,EAAE,GAAG;AACP;AACAC,EAAAA,EAAE,EAAE,GAAG;AACP;AACAC,EAAAA,EAAE,EAAE,GAAG;AACP;AACAC,EAAAA,EAAE,EAAE,GAAG;AACP;AACAC,EAAAA,EAAE,EAAE;CACL;AAED;;;;;;;;;;;;;;;;;;AAkBG;AACG,SAAUC,kBAAkBA,CAACC,SAAmB,EAAEC,OAAgB,EAAA;EACtE,IAAIA,OAAO,CAACC,KAAK,EAAE;AACjB,IAAA,OAAO,GAAG;AACZ,EAAA;AAEA;AACA,EAAA,IAAID,OAAO,CAACE,KAAK,IAAIF,OAAO,CAACG,QAAQ,EAAE;AACrC,IAAA,OAAO,GAAG;AACZ,EAAA;EAEA,IAAIH,OAAO,CAACI,SAAS,EAAE;AACrB,IAAA,OAAO,GAAG;AACZ,EAAA;AAEA,EAAA,IAAIL,SAAS,CAACM,MAAM,GAAG,CAAC,EAAE;IACxB,MAAMC,gBAAgB,GAAGP,SAAS,CAAC,CAAC,CAAC,CAACQ,IAAI,EAAE;IAE5C,IAAID,gBAAgB,CAACE,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE,YAAY;AACnD;AACA;AACA;AACA;AACA;MAEA,OACEhB,UAAU,CAACc,gBAAgB,CAACG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,uEACxCjB,UAAU,CAACc,gBAAgB,CAACG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IACxC,GAAG;AAEP,IAAA;AACF,EAAA;AAEA;AACA,EAAA,OAAO,GAAG;AACZ;;;;"}

View File

@@ -0,0 +1,68 @@
/**
* Maps the long pseudo name to the short pseudo name. Pseudos that match here will be ordered, everything else will
* make their way to default style bucket. We reduce the pseudo name to save bundlesize.
* Thankfully there aren't any overlaps, see: https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes.
*/
const pseudosMap = {
// :focus-within
'us-w': 'w',
// :focus-visible
'us-v': 'i',
// :link
nk: 'l',
// :visited
si: 'v',
// :focus
cu: 'f',
// :hover
ve: 'h',
// :active
ti: 'a'
};
/**
* Gets the bucket depending on the pseudo.
*
* Input:
*
* ```
* ":hover"
* ":focus:hover"
* ```
*
* Output:
*
* ```
* "h"
* "f"
* ```
*
* @internal
*/
function getStyleBucketName(selectors, atRules) {
if (atRules.media) {
return 'm';
}
// We are grouping all the at-rules like @supports etc. under `t` bucket.
if (atRules.layer || atRules.supports) {
return 't';
}
if (atRules.container) {
return 'c';
}
if (selectors.length > 0) {
const normalizedPseudo = selectors[0].trim();
if (normalizedPseudo.charCodeAt(0) === 58 /* ":" */) {
// We send through a subset of the string instead of the full pseudo name.
// For example:
// - `"focus-visible"` name would instead of `"us-v"`.
// - `"focus"` name would instead of `"us"`.
// Return a mapped pseudo else default bucket.
return pseudosMap[normalizedPseudo.slice(4, 8)] /* allows to avoid collisions between "focus-visible" & "focus" */ || pseudosMap[normalizedPseudo.slice(3, 5)] || 'd';
}
}
// Return default bucket
return 'd';
}
export { getStyleBucketName };
//# sourceMappingURL=getStyleBucketName.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getStyleBucketName.esm.js","sources":["../../../../packages/core/src/runtime/getStyleBucketName.ts"],"sourcesContent":["import type { StyleBucketName } from '../types';\nimport type { AtRules } from './utils/types';\n\n/**\n * Maps the long pseudo name to the short pseudo name. Pseudos that match here will be ordered, everything else will\n * make their way to default style bucket. We reduce the pseudo name to save bundlesize.\n * Thankfully there aren't any overlaps, see: https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes.\n */\nconst pseudosMap: Record<string, StyleBucketName | undefined> = {\n // :focus-within\n 'us-w': 'w',\n // :focus-visible\n 'us-v': 'i',\n\n // :link\n nk: 'l',\n // :visited\n si: 'v',\n // :focus\n cu: 'f',\n // :hover\n ve: 'h',\n // :active\n ti: 'a',\n};\n\n/**\n * Gets the bucket depending on the pseudo.\n *\n * Input:\n *\n * ```\n * \":hover\"\n * \":focus:hover\"\n * ```\n *\n * Output:\n *\n * ```\n * \"h\"\n * \"f\"\n * ```\n *\n * @internal\n */\nexport function getStyleBucketName(selectors: string[], atRules: AtRules): StyleBucketName {\n if (atRules.media) {\n return 'm';\n }\n\n // We are grouping all the at-rules like @supports etc. under `t` bucket.\n if (atRules.layer || atRules.supports) {\n return 't';\n }\n\n if (atRules.container) {\n return 'c';\n }\n\n if (selectors.length > 0) {\n const normalizedPseudo = selectors[0].trim();\n\n if (normalizedPseudo.charCodeAt(0) === 58 /* \":\" */) {\n // We send through a subset of the string instead of the full pseudo name.\n // For example:\n // - `\"focus-visible\"` name would instead of `\"us-v\"`.\n // - `\"focus\"` name would instead of `\"us\"`.\n // Return a mapped pseudo else default bucket.\n\n return (\n pseudosMap[normalizedPseudo.slice(4, 8)] /* allows to avoid collisions between \"focus-visible\" & \"focus\" */ ||\n pseudosMap[normalizedPseudo.slice(3, 5)] ||\n 'd'\n );\n }\n }\n\n // Return default bucket\n return 'd';\n}\n"],"names":["pseudosMap","nk","si","cu","ve","ti","getStyleBucketName","selectors","atRules","media","layer","supports","container","length","normalizedPseudo","trim","charCodeAt","slice"],"mappings":"AAGA;;;;AAIG;AACH,MAAMA,UAAU,GAAgD;AAC9D;AACA,EAAA,MAAM,EAAE,GAAG;AACX;AACA,EAAA,MAAM,EAAE,GAAG;AAEX;AACAC,EAAAA,EAAE,EAAE,GAAG;AACP;AACAC,EAAAA,EAAE,EAAE,GAAG;AACP;AACAC,EAAAA,EAAE,EAAE,GAAG;AACP;AACAC,EAAAA,EAAE,EAAE,GAAG;AACP;AACAC,EAAAA,EAAE,EAAE;CACL;AAED;;;;;;;;;;;;;;;;;;AAkBG;AACG,SAAUC,kBAAkBA,CAACC,SAAmB,EAAEC,OAAgB,EAAA;EACtE,IAAIA,OAAO,CAACC,KAAK,EAAE;AACjB,IAAA,OAAO,GAAG;AACZ,EAAA;AAEA;AACA,EAAA,IAAID,OAAO,CAACE,KAAK,IAAIF,OAAO,CAACG,QAAQ,EAAE;AACrC,IAAA,OAAO,GAAG;AACZ,EAAA;EAEA,IAAIH,OAAO,CAACI,SAAS,EAAE;AACrB,IAAA,OAAO,GAAG;AACZ,EAAA;AAEA,EAAA,IAAIL,SAAS,CAACM,MAAM,GAAG,CAAC,EAAE;IACxB,MAAMC,gBAAgB,GAAGP,SAAS,CAAC,CAAC,CAAC,CAACQ,IAAI,EAAE;IAE5C,IAAID,gBAAgB,CAACE,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE,YAAY;AACnD;AACA;AACA;AACA;AACA;MAEA,OACEhB,UAAU,CAACc,gBAAgB,CAACG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,uEACxCjB,UAAU,CAACc,gBAAgB,CAACG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IACxC,GAAG;AAEP,IAAA;AACF,EAAA;AAEA;AACA,EAAA,OAAO,GAAG;AACZ;;;;"}

View File

@@ -0,0 +1,58 @@
'use strict';
var constants = require('../constants.cjs.js');
var hashSequence = require('./utils/hashSequence.cjs.js');
/**
* Reduces a classname map for slot to a classname string. Uses classnames according to text directions.
*
* @private
*/
function reduceToClassName(classMap, dir) {
// - `classString` is a string of classnames separated by a space, used to output classes
// - `hashString` is a string of classnames separated by a space, used to generate a hash
//
// `hashString` is needed to handle `null` values in a class map as they don't produce any classes.
let classString = '';
let hashString = '';
// eslint-disable-next-line guard-for-in
for (const propertyHash in classMap) {
const classNameMapping = classMap[propertyHash];
if (classNameMapping === 0) {
hashString += propertyHash + ' ';
continue;
}
const hasRTLClassName = Array.isArray(classNameMapping);
const className = dir === 'rtl' ? (hasRTLClassName ? classNameMapping[1] : classNameMapping) + ' ' : (hasRTLClassName ? classNameMapping[0] : classNameMapping) + ' ';
classString += className;
hashString += className;
}
return [classString.slice(0, -1), hashString.slice(0, -1)];
}
/**
* Reduces classname maps for slots to classname strings. Registers them in a definition cache to be used by
* `mergeClasses()`.
*
* @internal
*/
function reduceToClassNameForSlots(classesMapBySlot, dir) {
const classNamesForSlots = {};
// eslint-disable-next-line guard-for-in
for (const slotName in classesMapBySlot) {
const [slotClasses, slotClassesHash] = reduceToClassName(classesMapBySlot[slotName], dir);
// Handles a case when there are no classes in a set i.e. "makeStyles({ root: {} })"
if (slotClassesHash === '') {
classNamesForSlots[slotName] = '';
continue;
}
const sequenceHash = hashSequence.hashSequence(slotClassesHash, dir);
const resultSlotClasses = sequenceHash + (slotClasses === '' ? '' : ' ' + slotClasses);
constants.DEFINITION_LOOKUP_TABLE[sequenceHash] = [classesMapBySlot[slotName], dir];
classNamesForSlots[slotName] = resultSlotClasses;
}
return classNamesForSlots;
}
exports.reduceToClassName = reduceToClassName;
exports.reduceToClassNameForSlots = reduceToClassNameForSlots;
//# sourceMappingURL=reduceToClassNameForSlots.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"reduceToClassNameForSlots.cjs.js","sources":["../../../../packages/core/src/runtime/reduceToClassNameForSlots.ts"],"sourcesContent":["import { DEFINITION_LOOKUP_TABLE } from '../constants';\nimport { hashSequence } from './utils/hashSequence';\nimport type { CSSClassesMapBySlot, CSSClassesMap, CSSClasses } from '../types';\n\n/**\n * Reduces a classname map for slot to a classname string. Uses classnames according to text directions.\n *\n * @private\n */\nexport function reduceToClassName(classMap: CSSClassesMap, dir: 'ltr' | 'rtl'): [string, string] {\n // - `classString` is a string of classnames separated by a space, used to output classes\n // - `hashString` is a string of classnames separated by a space, used to generate a hash\n //\n // `hashString` is needed to handle `null` values in a class map as they don't produce any classes.\n let classString = '';\n let hashString = '';\n\n // eslint-disable-next-line guard-for-in\n for (const propertyHash in classMap) {\n const classNameMapping: CSSClasses = classMap[propertyHash];\n\n if (classNameMapping === 0) {\n hashString += propertyHash + ' ';\n continue;\n }\n\n const hasRTLClassName = Array.isArray(classNameMapping);\n const className =\n dir === 'rtl'\n ? (hasRTLClassName ? classNameMapping[1] : classNameMapping) + ' '\n : (hasRTLClassName ? classNameMapping[0] : classNameMapping) + ' ';\n\n classString += className;\n hashString += className;\n }\n\n return [classString.slice(0, -1), hashString.slice(0, -1)];\n}\n\n/**\n * Reduces classname maps for slots to classname strings. Registers them in a definition cache to be used by\n * `mergeClasses()`.\n *\n * @internal\n */\nexport function reduceToClassNameForSlots<Slots extends string | number>(\n classesMapBySlot: CSSClassesMapBySlot<Slots>,\n dir: 'ltr' | 'rtl',\n): Record<Slots, string> {\n const classNamesForSlots = {} as Record<Slots, string>;\n\n // eslint-disable-next-line guard-for-in\n for (const slotName in classesMapBySlot) {\n const [slotClasses, slotClassesHash] = reduceToClassName(classesMapBySlot[slotName], dir);\n\n // Handles a case when there are no classes in a set i.e. \"makeStyles({ root: {} })\"\n if (slotClassesHash === '') {\n classNamesForSlots[slotName] = '';\n continue;\n }\n\n const sequenceHash = hashSequence(slotClassesHash, dir);\n const resultSlotClasses = sequenceHash + (slotClasses === '' ? '' : ' ' + slotClasses);\n\n DEFINITION_LOOKUP_TABLE[sequenceHash] = [classesMapBySlot[slotName], dir];\n classNamesForSlots[slotName] = resultSlotClasses;\n }\n\n return classNamesForSlots;\n}\n"],"names":["reduceToClassName","classMap","dir","classString","hashString","propertyHash","classNameMapping","hasRTLClassName","Array","isArray","className","slice","reduceToClassNameForSlots","classesMapBySlot","classNamesForSlots","slotName","slotClasses","slotClassesHash","sequenceHash","hashSequence","resultSlotClasses","DEFINITION_LOOKUP_TABLE"],"mappings":";;;;;AAIA;;;;AAIG;AACG,SAAUA,iBAAiBA,CAACC,QAAuB,EAAEC,GAAkB,EAAA;AAC3E;AACA;AACA;AACA;EACA,IAAIC,WAAW,GAAG,EAAE;EACpB,IAAIC,UAAU,GAAG,EAAE;AAEnB;AACA,EAAA,KAAK,MAAMC,YAAY,IAAIJ,QAAQ,EAAE;AACnC,IAAA,MAAMK,gBAAgB,GAAeL,QAAQ,CAACI,YAAY,CAAC;IAE3D,IAAIC,gBAAgB,KAAK,CAAC,EAAE;MAC1BF,UAAU,IAAIC,YAAY,GAAG,GAAG;AAChC,MAAA;AACF,IAAA;AAEA,IAAA,MAAME,eAAe,GAAGC,KAAK,CAACC,OAAO,CAACH,gBAAgB,CAAC;AACvD,IAAA,MAAMI,SAAS,GACbR,GAAG,KAAK,KAAK,GACT,CAACK,eAAe,GAAGD,gBAAgB,CAAC,CAAC,CAAC,GAAGA,gBAAgB,IAAI,GAAG,GAChE,CAACC,eAAe,GAAGD,gBAAgB,CAAC,CAAC,CAAC,GAAGA,gBAAgB,IAAI,GAAG;AAEtEH,IAAAA,WAAW,IAAIO,SAAS;AACxBN,IAAAA,UAAU,IAAIM,SAAS;AACzB,EAAA;EAEA,OAAO,CAACP,WAAW,CAACQ,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAEP,UAAU,CAACO,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5D;AAEA;;;;;AAKG;AACG,SAAUC,yBAAyBA,CACvCC,gBAA4C,EAC5CX,GAAkB,EAAA;EAElB,MAAMY,kBAAkB,GAAG,EAA2B;AAEtD;AACA,EAAA,KAAK,MAAMC,QAAQ,IAAIF,gBAAgB,EAAE;AACvC,IAAA,MAAM,CAACG,WAAW,EAAEC,eAAe,CAAC,GAAGjB,iBAAiB,CAACa,gBAAgB,CAACE,QAAQ,CAAC,EAAEb,GAAG,CAAC;AAEzF;IACA,IAAIe,eAAe,KAAK,EAAE,EAAE;AAC1BH,MAAAA,kBAAkB,CAACC,QAAQ,CAAC,GAAG,EAAE;AACjC,MAAA;AACF,IAAA;AAEA,IAAA,MAAMG,YAAY,GAAGC,yBAAY,CAACF,eAAe,EAAEf,GAAG,CAAC;AACvD,IAAA,MAAMkB,iBAAiB,GAAGF,YAAY,IAAIF,WAAW,KAAK,EAAE,GAAG,EAAE,GAAG,GAAG,GAAGA,WAAW,CAAC;IAEtFK,iCAAuB,CAACH,YAAY,CAAC,GAAG,CAACL,gBAAgB,CAACE,QAAQ,CAAC,EAAEb,GAAG,CAAC;AACzEY,IAAAA,kBAAkB,CAACC,QAAQ,CAAC,GAAGK,iBAAiB;AAClD,EAAA;AAEA,EAAA,OAAON,kBAAkB;AAC3B;;;;;"}

View File

@@ -0,0 +1,55 @@
import { DEFINITION_LOOKUP_TABLE } from '../constants.esm.js';
import { hashSequence } from './utils/hashSequence.esm.js';
/**
* Reduces a classname map for slot to a classname string. Uses classnames according to text directions.
*
* @private
*/
function reduceToClassName(classMap, dir) {
// - `classString` is a string of classnames separated by a space, used to output classes
// - `hashString` is a string of classnames separated by a space, used to generate a hash
//
// `hashString` is needed to handle `null` values in a class map as they don't produce any classes.
let classString = '';
let hashString = '';
// eslint-disable-next-line guard-for-in
for (const propertyHash in classMap) {
const classNameMapping = classMap[propertyHash];
if (classNameMapping === 0) {
hashString += propertyHash + ' ';
continue;
}
const hasRTLClassName = Array.isArray(classNameMapping);
const className = dir === 'rtl' ? (hasRTLClassName ? classNameMapping[1] : classNameMapping) + ' ' : (hasRTLClassName ? classNameMapping[0] : classNameMapping) + ' ';
classString += className;
hashString += className;
}
return [classString.slice(0, -1), hashString.slice(0, -1)];
}
/**
* Reduces classname maps for slots to classname strings. Registers them in a definition cache to be used by
* `mergeClasses()`.
*
* @internal
*/
function reduceToClassNameForSlots(classesMapBySlot, dir) {
const classNamesForSlots = {};
// eslint-disable-next-line guard-for-in
for (const slotName in classesMapBySlot) {
const [slotClasses, slotClassesHash] = reduceToClassName(classesMapBySlot[slotName], dir);
// Handles a case when there are no classes in a set i.e. "makeStyles({ root: {} })"
if (slotClassesHash === '') {
classNamesForSlots[slotName] = '';
continue;
}
const sequenceHash = hashSequence(slotClassesHash, dir);
const resultSlotClasses = sequenceHash + (slotClasses === '' ? '' : ' ' + slotClasses);
DEFINITION_LOOKUP_TABLE[sequenceHash] = [classesMapBySlot[slotName], dir];
classNamesForSlots[slotName] = resultSlotClasses;
}
return classNamesForSlots;
}
export { reduceToClassName, reduceToClassNameForSlots };
//# sourceMappingURL=reduceToClassNameForSlots.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"reduceToClassNameForSlots.esm.js","sources":["../../../../packages/core/src/runtime/reduceToClassNameForSlots.ts"],"sourcesContent":["import { DEFINITION_LOOKUP_TABLE } from '../constants';\nimport { hashSequence } from './utils/hashSequence';\nimport type { CSSClassesMapBySlot, CSSClassesMap, CSSClasses } from '../types';\n\n/**\n * Reduces a classname map for slot to a classname string. Uses classnames according to text directions.\n *\n * @private\n */\nexport function reduceToClassName(classMap: CSSClassesMap, dir: 'ltr' | 'rtl'): [string, string] {\n // - `classString` is a string of classnames separated by a space, used to output classes\n // - `hashString` is a string of classnames separated by a space, used to generate a hash\n //\n // `hashString` is needed to handle `null` values in a class map as they don't produce any classes.\n let classString = '';\n let hashString = '';\n\n // eslint-disable-next-line guard-for-in\n for (const propertyHash in classMap) {\n const classNameMapping: CSSClasses = classMap[propertyHash];\n\n if (classNameMapping === 0) {\n hashString += propertyHash + ' ';\n continue;\n }\n\n const hasRTLClassName = Array.isArray(classNameMapping);\n const className =\n dir === 'rtl'\n ? (hasRTLClassName ? classNameMapping[1] : classNameMapping) + ' '\n : (hasRTLClassName ? classNameMapping[0] : classNameMapping) + ' ';\n\n classString += className;\n hashString += className;\n }\n\n return [classString.slice(0, -1), hashString.slice(0, -1)];\n}\n\n/**\n * Reduces classname maps for slots to classname strings. Registers them in a definition cache to be used by\n * `mergeClasses()`.\n *\n * @internal\n */\nexport function reduceToClassNameForSlots<Slots extends string | number>(\n classesMapBySlot: CSSClassesMapBySlot<Slots>,\n dir: 'ltr' | 'rtl',\n): Record<Slots, string> {\n const classNamesForSlots = {} as Record<Slots, string>;\n\n // eslint-disable-next-line guard-for-in\n for (const slotName in classesMapBySlot) {\n const [slotClasses, slotClassesHash] = reduceToClassName(classesMapBySlot[slotName], dir);\n\n // Handles a case when there are no classes in a set i.e. \"makeStyles({ root: {} })\"\n if (slotClassesHash === '') {\n classNamesForSlots[slotName] = '';\n continue;\n }\n\n const sequenceHash = hashSequence(slotClassesHash, dir);\n const resultSlotClasses = sequenceHash + (slotClasses === '' ? '' : ' ' + slotClasses);\n\n DEFINITION_LOOKUP_TABLE[sequenceHash] = [classesMapBySlot[slotName], dir];\n classNamesForSlots[slotName] = resultSlotClasses;\n }\n\n return classNamesForSlots;\n}\n"],"names":["reduceToClassName","classMap","dir","classString","hashString","propertyHash","classNameMapping","hasRTLClassName","Array","isArray","className","slice","reduceToClassNameForSlots","classesMapBySlot","classNamesForSlots","slotName","slotClasses","slotClassesHash","sequenceHash","hashSequence","resultSlotClasses","DEFINITION_LOOKUP_TABLE"],"mappings":";;;AAIA;;;;AAIG;AACG,SAAUA,iBAAiBA,CAACC,QAAuB,EAAEC,GAAkB,EAAA;AAC3E;AACA;AACA;AACA;EACA,IAAIC,WAAW,GAAG,EAAE;EACpB,IAAIC,UAAU,GAAG,EAAE;AAEnB;AACA,EAAA,KAAK,MAAMC,YAAY,IAAIJ,QAAQ,EAAE;AACnC,IAAA,MAAMK,gBAAgB,GAAeL,QAAQ,CAACI,YAAY,CAAC;IAE3D,IAAIC,gBAAgB,KAAK,CAAC,EAAE;MAC1BF,UAAU,IAAIC,YAAY,GAAG,GAAG;AAChC,MAAA;AACF,IAAA;AAEA,IAAA,MAAME,eAAe,GAAGC,KAAK,CAACC,OAAO,CAACH,gBAAgB,CAAC;AACvD,IAAA,MAAMI,SAAS,GACbR,GAAG,KAAK,KAAK,GACT,CAACK,eAAe,GAAGD,gBAAgB,CAAC,CAAC,CAAC,GAAGA,gBAAgB,IAAI,GAAG,GAChE,CAACC,eAAe,GAAGD,gBAAgB,CAAC,CAAC,CAAC,GAAGA,gBAAgB,IAAI,GAAG;AAEtEH,IAAAA,WAAW,IAAIO,SAAS;AACxBN,IAAAA,UAAU,IAAIM,SAAS;AACzB,EAAA;EAEA,OAAO,CAACP,WAAW,CAACQ,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAEP,UAAU,CAACO,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5D;AAEA;;;;;AAKG;AACG,SAAUC,yBAAyBA,CACvCC,gBAA4C,EAC5CX,GAAkB,EAAA;EAElB,MAAMY,kBAAkB,GAAG,EAA2B;AAEtD;AACA,EAAA,KAAK,MAAMC,QAAQ,IAAIF,gBAAgB,EAAE;AACvC,IAAA,MAAM,CAACG,WAAW,EAAEC,eAAe,CAAC,GAAGjB,iBAAiB,CAACa,gBAAgB,CAACE,QAAQ,CAAC,EAAEb,GAAG,CAAC;AAEzF;IACA,IAAIe,eAAe,KAAK,EAAE,EAAE;AAC1BH,MAAAA,kBAAkB,CAACC,QAAQ,CAAC,GAAG,EAAE;AACjC,MAAA;AACF,IAAA;AAEA,IAAA,MAAMG,YAAY,GAAGC,YAAY,CAACF,eAAe,EAAEf,GAAG,CAAC;AACvD,IAAA,MAAMkB,iBAAiB,GAAGF,YAAY,IAAIF,WAAW,KAAK,EAAE,GAAG,EAAE,GAAG,GAAG,GAAGA,WAAW,CAAC;IAEtFK,uBAAuB,CAACH,YAAY,CAAC,GAAG,CAACL,gBAAgB,CAACE,QAAQ,CAAC,EAAEb,GAAG,CAAC;AACzEY,IAAAA,kBAAkB,CAACC,QAAQ,CAAC,GAAGK,iBAAiB;AAClD,EAAA;AAEA,EAAA,OAAON,kBAAkB;AAC3B;;;;"}

View File

@@ -0,0 +1,127 @@
'use strict';
var hashString = require('@emotion/hash');
var core = require('rtl-css-js/core');
var constants = require('../constants.cjs.js');
var isMediaQuerySelector = require('./utils/isMediaQuerySelector.cjs.js');
var isLayerSelector = require('./utils/isLayerSelector.cjs.js');
var isNestedSelector = require('./utils/isNestedSelector.cjs.js');
var isSupportQuerySelector = require('./utils/isSupportQuerySelector.cjs.js');
var isObject = require('./utils/isObject.cjs.js');
var hyphenateProperty = require('./utils/hyphenateProperty.cjs.js');
var compileAtomicCSSRule = require('./compileAtomicCSSRule.cjs.js');
var compileResetCSSRules = require('./compileResetCSSRules.cjs.js');
var compileKeyframeCSS = require('./compileKeyframeCSS.cjs.js');
var isContainerQuerySelector = require('./utils/isContainerQuerySelector.cjs.js');
var warnAboutUnresolvedRule = require('./warnings/warnAboutUnresolvedRule.cjs.js');
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
var hashString__default = /*#__PURE__*/_interopDefaultCompat(hashString);
/**
* @internal
*/
function createStringFromStyles(styles) {
let ltrCSS = '';
let rtlCSS = '';
// eslint-disable-next-line guard-for-in
for (const property in styles) {
const value = styles[property];
// eslint-disable-next-line eqeqeq
if (value == null) {
continue;
}
if (typeof value === 'string' || typeof value === 'number') {
const {
key: rtlProperty,
value: rtlValue
} = core.convertProperty(property, value);
ltrCSS += `${hyphenateProperty.hyphenateProperty(property)}:${value};`;
rtlCSS += `${hyphenateProperty.hyphenateProperty(rtlProperty)}:${rtlValue};`;
continue;
}
if (property === 'animationName' && typeof value === 'object') {
const values = Array.isArray(value) ? value : [value];
const ltrAnimationNames = [];
const rtlAnimationNames = [];
for (const keyframeObject of values) {
const ltrKeyframeRule = compileKeyframeCSS.compileKeyframeRule(keyframeObject);
const rtlKeyframeRule = compileKeyframeCSS.compileKeyframeRule(core.convert(keyframeObject));
const ltrAnimationName = constants.RESET_HASH_PREFIX + hashString__default.default(ltrKeyframeRule);
const rtlAnimationName = constants.RESET_HASH_PREFIX + hashString__default.default(rtlKeyframeRule);
ltrAnimationNames.push(ltrAnimationName);
rtlAnimationNames.push(rtlAnimationName);
ltrCSS += compileKeyframeCSS.compileKeyframesCSS(ltrAnimationName, ltrKeyframeRule).join('');
if (ltrAnimationName !== rtlAnimationName) {
rtlCSS += compileKeyframeCSS.compileKeyframesCSS(rtlAnimationName, rtlKeyframeRule).join('');
}
}
ltrCSS += `animation-name:${ltrAnimationNames.join(',')};`;
rtlCSS += `animation-name:${rtlAnimationNames.join(',')};`;
continue;
}
if (Array.isArray(value)) {
// not animationName property but array in the value => fallback values
if (value.length === 0) {
if (process.env.NODE_ENV !== 'production') {
console.warn(`makeResetStyles(): An empty array was passed as input to "${property}", the property will be omitted in the styles.`);
}
continue;
}
const rtlDefinitions = value.map(v => core.convertProperty(property, v));
const rtlPropertyConsistent = !rtlDefinitions.some(v => v.key !== rtlDefinitions[0].key);
if (!rtlPropertyConsistent) {
if (process.env.NODE_ENV !== 'production') {
console.error('makeStyles(): mixing CSS fallback values which result in multiple CSS properties in RTL is not supported.');
}
continue;
}
const rtlProperty = rtlDefinitions[0].key;
ltrCSS += value.map(v => `${hyphenateProperty.hyphenateProperty(property)}:${v};`).join('');
rtlCSS += rtlDefinitions.map(definition => `${hyphenateProperty.hyphenateProperty(rtlProperty)}:${definition.value};`).join('');
continue;
}
if (isObject.isObject(value)) {
if (isNestedSelector.isNestedSelector(property)) {
const nestedSelector = compileAtomicCSSRule.normalizePseudoSelector(property);
const [ltrNested, rtlNested] = createStringFromStyles(value);
ltrCSS += `${nestedSelector}{${ltrNested}}`;
rtlCSS += `${nestedSelector}{${rtlNested}}`;
continue;
}
if (isMediaQuerySelector.isMediaQuerySelector(property) || isLayerSelector.isLayerSelector(property) || isSupportQuerySelector.isSupportQuerySelector(property) || isContainerQuerySelector.isContainerQuerySelector(property)) {
const [ltrNested, rtlNested] = createStringFromStyles(value);
ltrCSS += `${property}{${ltrNested}}`;
rtlCSS += `${property}{${rtlNested}}`;
continue;
}
}
warnAboutUnresolvedRule.warnAboutUnresolvedRule(property, value);
}
return [ltrCSS, rtlCSS];
}
/**
* @internal
*/
function resolveResetStyleRules(styles, classNameHashSalt = '') {
const [ltrRule, rtlRule] = createStringFromStyles(styles);
const ltrClassName = constants.RESET_HASH_PREFIX + hashString__default.default(classNameHashSalt + ltrRule);
const [ltrCSS, ltrCSSAtRules] = compileResetCSSRules.compileResetCSSRules(`.${ltrClassName}{${ltrRule}}`);
const hasAtRules = ltrCSSAtRules.length > 0;
if (ltrRule === rtlRule) {
return [ltrClassName, null, hasAtRules ? {
r: ltrCSS,
s: ltrCSSAtRules
} : ltrCSS];
}
const rtlClassName = constants.RESET_HASH_PREFIX + hashString__default.default(classNameHashSalt + rtlRule);
const [rtlCSS, rtlCSSAtRules] = compileResetCSSRules.compileResetCSSRules(`.${rtlClassName}{${rtlRule}}`);
return [ltrClassName, rtlClassName, hasAtRules ? {
r: ltrCSS.concat(rtlCSS),
s: ltrCSSAtRules.concat(rtlCSSAtRules)
} : ltrCSS.concat(rtlCSS)];
}
exports.resolveResetStyleRules = resolveResetStyleRules;
//# sourceMappingURL=resolveResetStyleRules.cjs.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,121 @@
import hashString from '@emotion/hash';
import { convertProperty, convert } from 'rtl-css-js/core';
import { RESET_HASH_PREFIX } from '../constants.esm.js';
import { isMediaQuerySelector } from './utils/isMediaQuerySelector.esm.js';
import { isLayerSelector } from './utils/isLayerSelector.esm.js';
import { isNestedSelector } from './utils/isNestedSelector.esm.js';
import { isSupportQuerySelector } from './utils/isSupportQuerySelector.esm.js';
import { isObject } from './utils/isObject.esm.js';
import { hyphenateProperty } from './utils/hyphenateProperty.esm.js';
import { normalizePseudoSelector } from './compileAtomicCSSRule.esm.js';
import { compileResetCSSRules } from './compileResetCSSRules.esm.js';
import { compileKeyframeRule, compileKeyframesCSS } from './compileKeyframeCSS.esm.js';
import { isContainerQuerySelector } from './utils/isContainerQuerySelector.esm.js';
import { warnAboutUnresolvedRule } from './warnings/warnAboutUnresolvedRule.esm.js';
/**
* @internal
*/
function createStringFromStyles(styles) {
let ltrCSS = '';
let rtlCSS = '';
// eslint-disable-next-line guard-for-in
for (const property in styles) {
const value = styles[property];
// eslint-disable-next-line eqeqeq
if (value == null) {
continue;
}
if (typeof value === 'string' || typeof value === 'number') {
const {
key: rtlProperty,
value: rtlValue
} = convertProperty(property, value);
ltrCSS += `${hyphenateProperty(property)}:${value};`;
rtlCSS += `${hyphenateProperty(rtlProperty)}:${rtlValue};`;
continue;
}
if (property === 'animationName' && typeof value === 'object') {
const values = Array.isArray(value) ? value : [value];
const ltrAnimationNames = [];
const rtlAnimationNames = [];
for (const keyframeObject of values) {
const ltrKeyframeRule = compileKeyframeRule(keyframeObject);
const rtlKeyframeRule = compileKeyframeRule(convert(keyframeObject));
const ltrAnimationName = RESET_HASH_PREFIX + hashString(ltrKeyframeRule);
const rtlAnimationName = RESET_HASH_PREFIX + hashString(rtlKeyframeRule);
ltrAnimationNames.push(ltrAnimationName);
rtlAnimationNames.push(rtlAnimationName);
ltrCSS += compileKeyframesCSS(ltrAnimationName, ltrKeyframeRule).join('');
if (ltrAnimationName !== rtlAnimationName) {
rtlCSS += compileKeyframesCSS(rtlAnimationName, rtlKeyframeRule).join('');
}
}
ltrCSS += `animation-name:${ltrAnimationNames.join(',')};`;
rtlCSS += `animation-name:${rtlAnimationNames.join(',')};`;
continue;
}
if (Array.isArray(value)) {
// not animationName property but array in the value => fallback values
if (value.length === 0) {
if (process.env.NODE_ENV !== 'production') {
console.warn(`makeResetStyles(): An empty array was passed as input to "${property}", the property will be omitted in the styles.`);
}
continue;
}
const rtlDefinitions = value.map(v => convertProperty(property, v));
const rtlPropertyConsistent = !rtlDefinitions.some(v => v.key !== rtlDefinitions[0].key);
if (!rtlPropertyConsistent) {
if (process.env.NODE_ENV !== 'production') {
console.error('makeStyles(): mixing CSS fallback values which result in multiple CSS properties in RTL is not supported.');
}
continue;
}
const rtlProperty = rtlDefinitions[0].key;
ltrCSS += value.map(v => `${hyphenateProperty(property)}:${v};`).join('');
rtlCSS += rtlDefinitions.map(definition => `${hyphenateProperty(rtlProperty)}:${definition.value};`).join('');
continue;
}
if (isObject(value)) {
if (isNestedSelector(property)) {
const nestedSelector = normalizePseudoSelector(property);
const [ltrNested, rtlNested] = createStringFromStyles(value);
ltrCSS += `${nestedSelector}{${ltrNested}}`;
rtlCSS += `${nestedSelector}{${rtlNested}}`;
continue;
}
if (isMediaQuerySelector(property) || isLayerSelector(property) || isSupportQuerySelector(property) || isContainerQuerySelector(property)) {
const [ltrNested, rtlNested] = createStringFromStyles(value);
ltrCSS += `${property}{${ltrNested}}`;
rtlCSS += `${property}{${rtlNested}}`;
continue;
}
}
warnAboutUnresolvedRule(property, value);
}
return [ltrCSS, rtlCSS];
}
/**
* @internal
*/
function resolveResetStyleRules(styles, classNameHashSalt = '') {
const [ltrRule, rtlRule] = createStringFromStyles(styles);
const ltrClassName = RESET_HASH_PREFIX + hashString(classNameHashSalt + ltrRule);
const [ltrCSS, ltrCSSAtRules] = compileResetCSSRules(`.${ltrClassName}{${ltrRule}}`);
const hasAtRules = ltrCSSAtRules.length > 0;
if (ltrRule === rtlRule) {
return [ltrClassName, null, hasAtRules ? {
r: ltrCSS,
s: ltrCSSAtRules
} : ltrCSS];
}
const rtlClassName = RESET_HASH_PREFIX + hashString(classNameHashSalt + rtlRule);
const [rtlCSS, rtlCSSAtRules] = compileResetCSSRules(`.${rtlClassName}{${rtlRule}}`);
return [ltrClassName, rtlClassName, hasAtRules ? {
r: ltrCSS.concat(rtlCSS),
s: ltrCSSAtRules.concat(rtlCSSAtRules)
} : ltrCSS.concat(rtlCSS)];
}
export { resolveResetStyleRules };
//# sourceMappingURL=resolveResetStyleRules.esm.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,26 @@
'use strict';
var compileCSSRules = require('./compileCSSRules.cjs.js');
var compileStaticCSS = require('./compileStaticCSS.cjs.js');
function resolveStaticStyleRules(stylesSet) {
return stylesSet.reduce((acc, styles) => {
if (typeof styles === 'string') {
const cssRules = compileCSSRules.compileCSSRules(styles, false);
for (const rule of cssRules) {
acc.push(rule);
}
return acc;
}
// eslint-disable-next-line guard-for-in
for (const property in styles) {
const value = styles[property];
const staticCSS = compileStaticCSS.compileStaticCSS(property, value);
acc.push(staticCSS);
}
return acc;
}, []);
}
exports.resolveStaticStyleRules = resolveStaticStyleRules;
//# sourceMappingURL=resolveStaticStyleRules.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"resolveStaticStyleRules.cjs.js","sources":["../../../../packages/core/src/runtime/resolveStaticStyleRules.ts"],"sourcesContent":["import type { GriffelStaticStyles } from '@griffel/style-types';\n\nimport type { CSSBucketEntry } from '../types';\nimport { compileCSSRules } from './compileCSSRules';\nimport { compileStaticCSS } from './compileStaticCSS';\n\nexport function resolveStaticStyleRules(stylesSet: GriffelStaticStyles[]): CSSBucketEntry[] {\n return stylesSet.reduce((acc, styles) => {\n if (typeof styles === 'string') {\n const cssRules = compileCSSRules(styles, false);\n\n for (const rule of cssRules) {\n acc.push(rule);\n }\n\n return acc;\n }\n\n // eslint-disable-next-line guard-for-in\n for (const property in styles) {\n const value = styles[property];\n const staticCSS = compileStaticCSS(property, value);\n\n acc.push(staticCSS);\n }\n\n return acc;\n }, [] as CSSBucketEntry[]);\n}\n"],"names":["resolveStaticStyleRules","stylesSet","reduce","acc","styles","cssRules","compileCSSRules","rule","push","property","value","staticCSS","compileStaticCSS"],"mappings":";;;;;AAMM,SAAUA,uBAAuBA,CAACC,SAAgC,EAAA;EACtE,OAAOA,SAAS,CAACC,MAAM,CAAC,CAACC,GAAG,EAAEC,MAAM,KAAI;AACtC,IAAA,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;AAC9B,MAAA,MAAMC,QAAQ,GAAGC,+BAAe,CAACF,MAAM,EAAE,KAAK,CAAC;AAE/C,MAAA,KAAK,MAAMG,IAAI,IAAIF,QAAQ,EAAE;AAC3BF,QAAAA,GAAG,CAACK,IAAI,CAACD,IAAI,CAAC;AAChB,MAAA;AAEA,MAAA,OAAOJ,GAAG;AACZ,IAAA;AAEA;AACA,IAAA,KAAK,MAAMM,QAAQ,IAAIL,MAAM,EAAE;AAC7B,MAAA,MAAMM,KAAK,GAAGN,MAAM,CAACK,QAAQ,CAAC;AAC9B,MAAA,MAAME,SAAS,GAAGC,iCAAgB,CAACH,QAAQ,EAAEC,KAAK,CAAC;AAEnDP,MAAAA,GAAG,CAACK,IAAI,CAACG,SAAS,CAAC;AACrB,IAAA;AAEA,IAAA,OAAOR,GAAG;EACZ,CAAC,EAAE,EAAsB,CAAC;AAC5B;;;;"}

View File

@@ -0,0 +1,24 @@
import { compileCSSRules } from './compileCSSRules.esm.js';
import { compileStaticCSS } from './compileStaticCSS.esm.js';
function resolveStaticStyleRules(stylesSet) {
return stylesSet.reduce((acc, styles) => {
if (typeof styles === 'string') {
const cssRules = compileCSSRules(styles, false);
for (const rule of cssRules) {
acc.push(rule);
}
return acc;
}
// eslint-disable-next-line guard-for-in
for (const property in styles) {
const value = styles[property];
const staticCSS = compileStaticCSS(property, value);
acc.push(staticCSS);
}
return acc;
}, []);
}
export { resolveStaticStyleRules };
//# sourceMappingURL=resolveStaticStyleRules.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"resolveStaticStyleRules.esm.js","sources":["../../../../packages/core/src/runtime/resolveStaticStyleRules.ts"],"sourcesContent":["import type { GriffelStaticStyles } from '@griffel/style-types';\n\nimport type { CSSBucketEntry } from '../types';\nimport { compileCSSRules } from './compileCSSRules';\nimport { compileStaticCSS } from './compileStaticCSS';\n\nexport function resolveStaticStyleRules(stylesSet: GriffelStaticStyles[]): CSSBucketEntry[] {\n return stylesSet.reduce((acc, styles) => {\n if (typeof styles === 'string') {\n const cssRules = compileCSSRules(styles, false);\n\n for (const rule of cssRules) {\n acc.push(rule);\n }\n\n return acc;\n }\n\n // eslint-disable-next-line guard-for-in\n for (const property in styles) {\n const value = styles[property];\n const staticCSS = compileStaticCSS(property, value);\n\n acc.push(staticCSS);\n }\n\n return acc;\n }, [] as CSSBucketEntry[]);\n}\n"],"names":["resolveStaticStyleRules","stylesSet","reduce","acc","styles","cssRules","compileCSSRules","rule","push","property","value","staticCSS","compileStaticCSS"],"mappings":";;;AAMM,SAAUA,uBAAuBA,CAACC,SAAgC,EAAA;EACtE,OAAOA,SAAS,CAACC,MAAM,CAAC,CAACC,GAAG,EAAEC,MAAM,KAAI;AACtC,IAAA,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;AAC9B,MAAA,MAAMC,QAAQ,GAAGC,eAAe,CAACF,MAAM,EAAE,KAAK,CAAC;AAE/C,MAAA,KAAK,MAAMG,IAAI,IAAIF,QAAQ,EAAE;AAC3BF,QAAAA,GAAG,CAACK,IAAI,CAACD,IAAI,CAAC;AAChB,MAAA;AAEA,MAAA,OAAOJ,GAAG;AACZ,IAAA;AAEA;AACA,IAAA,KAAK,MAAMM,QAAQ,IAAIL,MAAM,EAAE;AAC7B,MAAA,MAAMM,KAAK,GAAGN,MAAM,CAACK,QAAQ,CAAC;AAC9B,MAAA,MAAME,SAAS,GAAGC,gBAAgB,CAACH,QAAQ,EAAEC,KAAK,CAAC;AAEnDP,MAAAA,GAAG,CAACK,IAAI,CAACG,SAAS,CAAC;AACrB,IAAA;AAEA,IAAA,OAAOR,GAAG;EACZ,CAAC,EAAE,EAAsB,CAAC;AAC5B;;;;"}

View File

@@ -0,0 +1,253 @@
'use strict';
var hashString = require('@emotion/hash');
var core = require('rtl-css-js/core');
var constants = require('../constants.cjs.js');
var compileAtomicCSSRule = require('./compileAtomicCSSRule.cjs.js');
var compileKeyframeCSS = require('./compileKeyframeCSS.cjs.js');
var shorthands = require('./shorthands.cjs.js');
var generateCombinedMediaQuery = require('./utils/generateCombinedMediaQuery.cjs.js');
var isMediaQuerySelector = require('./utils/isMediaQuerySelector.cjs.js');
var isLayerSelector = require('./utils/isLayerSelector.cjs.js');
var isNestedSelector = require('./utils/isNestedSelector.cjs.js');
var isSupportQuerySelector = require('./utils/isSupportQuerySelector.cjs.js');
var isContainerQuerySelector = require('./utils/isContainerQuerySelector.cjs.js');
var normalizeNestedProperty = require('./utils/normalizeNestedProperty.cjs.js');
var isObject = require('./utils/isObject.cjs.js');
var getStyleBucketName = require('./getStyleBucketName.cjs.js');
var hashClassName = require('./utils/hashClassName.cjs.js');
var hashPropertyKey = require('./utils/hashPropertyKey.cjs.js');
var isResetValue = require('./utils/isResetValue.cjs.js');
var trimSelector = require('./utils/trimSelector.cjs.js');
var warnAboutUnresolvedRule = require('./warnings/warnAboutUnresolvedRule.cjs.js');
var warnAboutUnsupportedProperties = require('./warnings/warnAboutUnsupportedProperties.cjs.js');
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
var hashString__default = /*#__PURE__*/_interopDefaultCompat(hashString);
function getShorthandDefinition(property) {
return shorthands.shorthands[property];
}
function computePropertyPriority(shorthand) {
var _a;
return (_a = shorthand === null || shorthand === void 0 ? void 0 : shorthand[0]) !== null && _a !== void 0 ? _a : 0;
}
function pushToClassesMap(classesMap, propertyKey, ltrClassname, rtlClassname) {
classesMap[propertyKey] = rtlClassname ? [ltrClassname, rtlClassname] : ltrClassname;
}
function createBucketEntry(cssRule, metadata) {
if (metadata.length > 0) {
return [cssRule, Object.fromEntries(metadata)];
}
return cssRule;
}
function pushToCSSRules(cssRulesByBucket, styleBucketName, ltrCSS, rtlCSS, media, priority) {
var _a;
const metadata = [];
if (priority !== 0) {
metadata.push(['p', priority]);
}
if (styleBucketName === 'm' && media) {
metadata.push(['m', media]);
}
(_a = cssRulesByBucket[styleBucketName]) !== null && _a !== void 0 ? _a : cssRulesByBucket[styleBucketName] = [];
if (ltrCSS) {
cssRulesByBucket[styleBucketName].push(createBucketEntry(ltrCSS, metadata));
}
if (rtlCSS) {
cssRulesByBucket[styleBucketName].push(createBucketEntry(rtlCSS, metadata));
}
}
/**
* Transforms input styles to classes maps & CSS rules.
*
* @internal
*/
function resolveStyleRules(styles, classNameHashSalt = '', selectors = [], atRules = {
container: '',
layer: '',
media: '',
supports: ''
}, cssClassesMap = {}, cssRulesByBucket = {}, rtlValue) {
// eslint-disable-next-line guard-for-in
for (const property in styles) {
// eslint-disable-next-line no-prototype-builtins
if (constants.UNSUPPORTED_CSS_PROPERTIES.hasOwnProperty(property)) {
warnAboutUnsupportedProperties.warnAboutUnsupportedProperties(property, styles[property]);
continue;
}
const value = styles[property];
// eslint-disable-next-line eqeqeq
if (value == null) {
continue;
}
if (isResetValue.isResetValue(value)) {
const selector = trimSelector.trimSelector(selectors.join(''));
// uniq key based on a hash of property & selector, used for merging later
const key = hashPropertyKey.hashPropertyKey(selector, property, atRules);
pushToClassesMap(cssClassesMap, key, 0, undefined);
continue;
}
if (typeof value === 'string' || typeof value === 'number') {
const selector = trimSelector.trimSelector(selectors.join(''));
const shorthand = getShorthandDefinition(property);
if (shorthand) {
const shorthandProperties = shorthand[1];
const shorthandResetStyles = Object.fromEntries(shorthandProperties.map(property => [property, constants.RESET]));
resolveStyleRules(shorthandResetStyles, classNameHashSalt, selectors, atRules, cssClassesMap, cssRulesByBucket);
}
// uniq key based on a hash of property & selector, used for merging later
const key = hashPropertyKey.hashPropertyKey(selector, property, atRules);
const className = hashClassName.hashClassName({
value: value.toString(),
salt: classNameHashSalt,
selector,
property
}, atRules);
const rtlDefinition = rtlValue && {
key: property,
value: rtlValue
} || core.convertProperty(property, value);
const flippedInRtl = rtlDefinition.key !== property || rtlDefinition.value !== value;
const rtlClassName = flippedInRtl ? hashClassName.hashClassName({
value: rtlDefinition.value.toString(),
property: rtlDefinition.key,
salt: classNameHashSalt,
selector
}, atRules) : undefined;
const rtlCompileOptions = flippedInRtl ? {
rtlClassName,
rtlProperty: rtlDefinition.key,
rtlValue: rtlDefinition.value
} : undefined;
const styleBucketName = getStyleBucketName.getStyleBucketName(selectors, atRules);
const [ltrCSS, rtlCSS] = compileAtomicCSSRule.compileAtomicCSSRule(Object.assign({
className,
selectors,
property,
value
}, rtlCompileOptions), atRules);
pushToClassesMap(cssClassesMap, key, className, rtlClassName);
pushToCSSRules(cssRulesByBucket, styleBucketName, ltrCSS, rtlCSS, atRules.media, computePropertyPriority(shorthand));
} else if (property === 'animationName') {
const animationNameValue = Array.isArray(value) ? value : [value];
const animationNames = [];
const rtlAnimationNames = [];
for (const keyframeObject of animationNameValue) {
const keyframeCSS = compileKeyframeCSS.compileKeyframeRule(keyframeObject);
const rtlKeyframeCSS = compileKeyframeCSS.compileKeyframeRule(core.convert(keyframeObject));
const animationName = constants.HASH_PREFIX + hashString__default.default(keyframeCSS);
let rtlAnimationName;
const keyframeRules = compileKeyframeCSS.compileKeyframesCSS(animationName, keyframeCSS);
let rtlKeyframeRules = [];
if (keyframeCSS === rtlKeyframeCSS) {
// If CSS for LTR & RTL are same we will re-use animationName from LTR to avoid duplication of rules in output
rtlAnimationName = animationName;
} else {
rtlAnimationName = constants.HASH_PREFIX + hashString__default.default(rtlKeyframeCSS);
rtlKeyframeRules = compileKeyframeCSS.compileKeyframesCSS(rtlAnimationName, rtlKeyframeCSS);
}
for (let i = 0; i < keyframeRules.length; i++) {
pushToCSSRules(cssRulesByBucket,
// keyframes styles should be inserted into own bucket
'k', keyframeRules[i], rtlKeyframeRules[i], atRules.media,
// keyframes always have default priority
0);
}
animationNames.push(animationName);
rtlAnimationNames.push(rtlAnimationName);
}
resolveStyleRules({
animationName: animationNames.join(', ')
}, classNameHashSalt, selectors, atRules, cssClassesMap, cssRulesByBucket, rtlAnimationNames.join(', '));
} else if (Array.isArray(value)) {
// not animationName property but array in the value => fallback values
if (value.length === 0) {
if (process.env.NODE_ENV !== 'production') {
console.warn(`makeStyles(): An empty array was passed as input to "${property}", the property will be omitted in the styles.`);
}
continue;
}
const selector = trimSelector.trimSelector(selectors.join(''));
const shorthand = getShorthandDefinition(property);
if (shorthand) {
const shorthandProperties = shorthand[1];
const shorthandResetStyles = Object.fromEntries(shorthandProperties.map(property => [property, constants.RESET]));
resolveStyleRules(shorthandResetStyles, classNameHashSalt, selectors, atRules, cssClassesMap, cssRulesByBucket);
}
const key = hashPropertyKey.hashPropertyKey(selector, property, atRules);
const className = hashClassName.hashClassName({
value: value.map(v => (v !== null && v !== void 0 ? v : '').toString()).join(';'),
salt: classNameHashSalt,
selector,
property
}, atRules);
const rtlDefinitions = value.map(v => core.convertProperty(property, v));
const rtlPropertyConsistent = !rtlDefinitions.some(v => v.key !== rtlDefinitions[0].key);
if (!rtlPropertyConsistent) {
if (process.env.NODE_ENV !== 'production') {
console.error('makeStyles(): mixing CSS fallback values which result in multiple CSS properties in RTL is not supported.');
}
continue;
}
const flippedInRtl = rtlDefinitions[0].key !== property || rtlDefinitions.some((v, i) => v.value !== value[i]);
const rtlClassName = flippedInRtl ? hashClassName.hashClassName({
value: rtlDefinitions.map(v => {
var _a;
return ((_a = v === null || v === void 0 ? void 0 : v.value) !== null && _a !== void 0 ? _a : '').toString();
}).join(';'),
salt: classNameHashSalt,
property: rtlDefinitions[0].key,
selector
}, atRules) : undefined;
const rtlCompileOptions = flippedInRtl ? {
rtlClassName,
rtlProperty: rtlDefinitions[0].key,
rtlValue: rtlDefinitions.map(d => d.value)
} : undefined;
const styleBucketName = getStyleBucketName.getStyleBucketName(selectors, atRules);
const [ltrCSS, rtlCSS] = compileAtomicCSSRule.compileAtomicCSSRule(Object.assign({
className,
selectors,
property,
value: value
}, rtlCompileOptions), atRules);
pushToClassesMap(cssClassesMap, key, className, rtlClassName);
pushToCSSRules(cssRulesByBucket, styleBucketName, ltrCSS, rtlCSS, atRules.media, computePropertyPriority(shorthand));
} else if (isObject.isObject(value)) {
if (isNestedSelector.isNestedSelector(property)) {
resolveStyleRules(value, classNameHashSalt, selectors.concat(normalizeNestedProperty.normalizeNestedProperty(property)), atRules, cssClassesMap, cssRulesByBucket);
} else if (isMediaQuerySelector.isMediaQuerySelector(property)) {
const combinedMediaQuery = generateCombinedMediaQuery.generateCombinedQuery(atRules.media, property.slice(6).trim());
resolveStyleRules(value, classNameHashSalt, selectors, Object.assign({}, atRules, {
media: combinedMediaQuery
}), cssClassesMap, cssRulesByBucket);
} else if (isLayerSelector.isLayerSelector(property)) {
const combinedLayerQuery = (atRules.layer ? `${atRules.layer}.` : '') + property.slice(6).trim();
resolveStyleRules(value, classNameHashSalt, selectors, Object.assign({}, atRules, {
layer: combinedLayerQuery
}), cssClassesMap, cssRulesByBucket);
} else if (isSupportQuerySelector.isSupportQuerySelector(property)) {
const combinedSupportQuery = generateCombinedMediaQuery.generateCombinedQuery(atRules.supports, property.slice(9).trim());
resolveStyleRules(value, classNameHashSalt, selectors, Object.assign({}, atRules, {
supports: combinedSupportQuery
}), cssClassesMap, cssRulesByBucket);
} else if (isContainerQuerySelector.isContainerQuerySelector(property)) {
// TODO implement nested container queries if needed
// The only way to target multiple containers is to nest container queries
// https://developer.mozilla.org/en-US/docs/Web/CSS/@container#nested_container_queries
const containerQuery = property.slice(10).trim();
resolveStyleRules(value, classNameHashSalt, selectors, Object.assign({}, atRules, {
container: containerQuery
}), cssClassesMap, cssRulesByBucket);
} else {
warnAboutUnresolvedRule.warnAboutUnresolvedRule(property, value);
}
}
}
return [cssClassesMap, cssRulesByBucket];
}
exports.resolveStyleRules = resolveStyleRules;
//# sourceMappingURL=resolveStyleRules.cjs.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,247 @@
import hashString from '@emotion/hash';
import { convertProperty, convert } from 'rtl-css-js/core';
import { UNSUPPORTED_CSS_PROPERTIES, RESET, HASH_PREFIX } from '../constants.esm.js';
import { compileAtomicCSSRule } from './compileAtomicCSSRule.esm.js';
import { compileKeyframeRule, compileKeyframesCSS } from './compileKeyframeCSS.esm.js';
import { shorthands } from './shorthands.esm.js';
import { generateCombinedQuery } from './utils/generateCombinedMediaQuery.esm.js';
import { isMediaQuerySelector } from './utils/isMediaQuerySelector.esm.js';
import { isLayerSelector } from './utils/isLayerSelector.esm.js';
import { isNestedSelector } from './utils/isNestedSelector.esm.js';
import { isSupportQuerySelector } from './utils/isSupportQuerySelector.esm.js';
import { isContainerQuerySelector } from './utils/isContainerQuerySelector.esm.js';
import { normalizeNestedProperty } from './utils/normalizeNestedProperty.esm.js';
import { isObject } from './utils/isObject.esm.js';
import { getStyleBucketName } from './getStyleBucketName.esm.js';
import { hashClassName } from './utils/hashClassName.esm.js';
import { hashPropertyKey } from './utils/hashPropertyKey.esm.js';
import { isResetValue } from './utils/isResetValue.esm.js';
import { trimSelector } from './utils/trimSelector.esm.js';
import { warnAboutUnresolvedRule } from './warnings/warnAboutUnresolvedRule.esm.js';
import { warnAboutUnsupportedProperties } from './warnings/warnAboutUnsupportedProperties.esm.js';
function getShorthandDefinition(property) {
return shorthands[property];
}
function computePropertyPriority(shorthand) {
var _a;
return (_a = shorthand === null || shorthand === void 0 ? void 0 : shorthand[0]) !== null && _a !== void 0 ? _a : 0;
}
function pushToClassesMap(classesMap, propertyKey, ltrClassname, rtlClassname) {
classesMap[propertyKey] = rtlClassname ? [ltrClassname, rtlClassname] : ltrClassname;
}
function createBucketEntry(cssRule, metadata) {
if (metadata.length > 0) {
return [cssRule, Object.fromEntries(metadata)];
}
return cssRule;
}
function pushToCSSRules(cssRulesByBucket, styleBucketName, ltrCSS, rtlCSS, media, priority) {
var _a;
const metadata = [];
if (priority !== 0) {
metadata.push(['p', priority]);
}
if (styleBucketName === 'm' && media) {
metadata.push(['m', media]);
}
(_a = cssRulesByBucket[styleBucketName]) !== null && _a !== void 0 ? _a : cssRulesByBucket[styleBucketName] = [];
if (ltrCSS) {
cssRulesByBucket[styleBucketName].push(createBucketEntry(ltrCSS, metadata));
}
if (rtlCSS) {
cssRulesByBucket[styleBucketName].push(createBucketEntry(rtlCSS, metadata));
}
}
/**
* Transforms input styles to classes maps & CSS rules.
*
* @internal
*/
function resolveStyleRules(styles, classNameHashSalt = '', selectors = [], atRules = {
container: '',
layer: '',
media: '',
supports: ''
}, cssClassesMap = {}, cssRulesByBucket = {}, rtlValue) {
// eslint-disable-next-line guard-for-in
for (const property in styles) {
// eslint-disable-next-line no-prototype-builtins
if (UNSUPPORTED_CSS_PROPERTIES.hasOwnProperty(property)) {
warnAboutUnsupportedProperties(property, styles[property]);
continue;
}
const value = styles[property];
// eslint-disable-next-line eqeqeq
if (value == null) {
continue;
}
if (isResetValue(value)) {
const selector = trimSelector(selectors.join(''));
// uniq key based on a hash of property & selector, used for merging later
const key = hashPropertyKey(selector, property, atRules);
pushToClassesMap(cssClassesMap, key, 0, undefined);
continue;
}
if (typeof value === 'string' || typeof value === 'number') {
const selector = trimSelector(selectors.join(''));
const shorthand = getShorthandDefinition(property);
if (shorthand) {
const shorthandProperties = shorthand[1];
const shorthandResetStyles = Object.fromEntries(shorthandProperties.map(property => [property, RESET]));
resolveStyleRules(shorthandResetStyles, classNameHashSalt, selectors, atRules, cssClassesMap, cssRulesByBucket);
}
// uniq key based on a hash of property & selector, used for merging later
const key = hashPropertyKey(selector, property, atRules);
const className = hashClassName({
value: value.toString(),
salt: classNameHashSalt,
selector,
property
}, atRules);
const rtlDefinition = rtlValue && {
key: property,
value: rtlValue
} || convertProperty(property, value);
const flippedInRtl = rtlDefinition.key !== property || rtlDefinition.value !== value;
const rtlClassName = flippedInRtl ? hashClassName({
value: rtlDefinition.value.toString(),
property: rtlDefinition.key,
salt: classNameHashSalt,
selector
}, atRules) : undefined;
const rtlCompileOptions = flippedInRtl ? {
rtlClassName,
rtlProperty: rtlDefinition.key,
rtlValue: rtlDefinition.value
} : undefined;
const styleBucketName = getStyleBucketName(selectors, atRules);
const [ltrCSS, rtlCSS] = compileAtomicCSSRule(Object.assign({
className,
selectors,
property,
value
}, rtlCompileOptions), atRules);
pushToClassesMap(cssClassesMap, key, className, rtlClassName);
pushToCSSRules(cssRulesByBucket, styleBucketName, ltrCSS, rtlCSS, atRules.media, computePropertyPriority(shorthand));
} else if (property === 'animationName') {
const animationNameValue = Array.isArray(value) ? value : [value];
const animationNames = [];
const rtlAnimationNames = [];
for (const keyframeObject of animationNameValue) {
const keyframeCSS = compileKeyframeRule(keyframeObject);
const rtlKeyframeCSS = compileKeyframeRule(convert(keyframeObject));
const animationName = HASH_PREFIX + hashString(keyframeCSS);
let rtlAnimationName;
const keyframeRules = compileKeyframesCSS(animationName, keyframeCSS);
let rtlKeyframeRules = [];
if (keyframeCSS === rtlKeyframeCSS) {
// If CSS for LTR & RTL are same we will re-use animationName from LTR to avoid duplication of rules in output
rtlAnimationName = animationName;
} else {
rtlAnimationName = HASH_PREFIX + hashString(rtlKeyframeCSS);
rtlKeyframeRules = compileKeyframesCSS(rtlAnimationName, rtlKeyframeCSS);
}
for (let i = 0; i < keyframeRules.length; i++) {
pushToCSSRules(cssRulesByBucket,
// keyframes styles should be inserted into own bucket
'k', keyframeRules[i], rtlKeyframeRules[i], atRules.media,
// keyframes always have default priority
0);
}
animationNames.push(animationName);
rtlAnimationNames.push(rtlAnimationName);
}
resolveStyleRules({
animationName: animationNames.join(', ')
}, classNameHashSalt, selectors, atRules, cssClassesMap, cssRulesByBucket, rtlAnimationNames.join(', '));
} else if (Array.isArray(value)) {
// not animationName property but array in the value => fallback values
if (value.length === 0) {
if (process.env.NODE_ENV !== 'production') {
console.warn(`makeStyles(): An empty array was passed as input to "${property}", the property will be omitted in the styles.`);
}
continue;
}
const selector = trimSelector(selectors.join(''));
const shorthand = getShorthandDefinition(property);
if (shorthand) {
const shorthandProperties = shorthand[1];
const shorthandResetStyles = Object.fromEntries(shorthandProperties.map(property => [property, RESET]));
resolveStyleRules(shorthandResetStyles, classNameHashSalt, selectors, atRules, cssClassesMap, cssRulesByBucket);
}
const key = hashPropertyKey(selector, property, atRules);
const className = hashClassName({
value: value.map(v => (v !== null && v !== void 0 ? v : '').toString()).join(';'),
salt: classNameHashSalt,
selector,
property
}, atRules);
const rtlDefinitions = value.map(v => convertProperty(property, v));
const rtlPropertyConsistent = !rtlDefinitions.some(v => v.key !== rtlDefinitions[0].key);
if (!rtlPropertyConsistent) {
if (process.env.NODE_ENV !== 'production') {
console.error('makeStyles(): mixing CSS fallback values which result in multiple CSS properties in RTL is not supported.');
}
continue;
}
const flippedInRtl = rtlDefinitions[0].key !== property || rtlDefinitions.some((v, i) => v.value !== value[i]);
const rtlClassName = flippedInRtl ? hashClassName({
value: rtlDefinitions.map(v => {
var _a;
return ((_a = v === null || v === void 0 ? void 0 : v.value) !== null && _a !== void 0 ? _a : '').toString();
}).join(';'),
salt: classNameHashSalt,
property: rtlDefinitions[0].key,
selector
}, atRules) : undefined;
const rtlCompileOptions = flippedInRtl ? {
rtlClassName,
rtlProperty: rtlDefinitions[0].key,
rtlValue: rtlDefinitions.map(d => d.value)
} : undefined;
const styleBucketName = getStyleBucketName(selectors, atRules);
const [ltrCSS, rtlCSS] = compileAtomicCSSRule(Object.assign({
className,
selectors,
property,
value: value
}, rtlCompileOptions), atRules);
pushToClassesMap(cssClassesMap, key, className, rtlClassName);
pushToCSSRules(cssRulesByBucket, styleBucketName, ltrCSS, rtlCSS, atRules.media, computePropertyPriority(shorthand));
} else if (isObject(value)) {
if (isNestedSelector(property)) {
resolveStyleRules(value, classNameHashSalt, selectors.concat(normalizeNestedProperty(property)), atRules, cssClassesMap, cssRulesByBucket);
} else if (isMediaQuerySelector(property)) {
const combinedMediaQuery = generateCombinedQuery(atRules.media, property.slice(6).trim());
resolveStyleRules(value, classNameHashSalt, selectors, Object.assign({}, atRules, {
media: combinedMediaQuery
}), cssClassesMap, cssRulesByBucket);
} else if (isLayerSelector(property)) {
const combinedLayerQuery = (atRules.layer ? `${atRules.layer}.` : '') + property.slice(6).trim();
resolveStyleRules(value, classNameHashSalt, selectors, Object.assign({}, atRules, {
layer: combinedLayerQuery
}), cssClassesMap, cssRulesByBucket);
} else if (isSupportQuerySelector(property)) {
const combinedSupportQuery = generateCombinedQuery(atRules.supports, property.slice(9).trim());
resolveStyleRules(value, classNameHashSalt, selectors, Object.assign({}, atRules, {
supports: combinedSupportQuery
}), cssClassesMap, cssRulesByBucket);
} else if (isContainerQuerySelector(property)) {
// TODO implement nested container queries if needed
// The only way to target multiple containers is to nest container queries
// https://developer.mozilla.org/en-US/docs/Web/CSS/@container#nested_container_queries
const containerQuery = property.slice(10).trim();
resolveStyleRules(value, classNameHashSalt, selectors, Object.assign({}, atRules, {
container: containerQuery
}), cssClassesMap, cssRulesByBucket);
} else {
warnAboutUnresolvedRule(property, value);
}
}
}
return [cssClassesMap, cssRulesByBucket];
}
export { resolveStyleRules };
//# sourceMappingURL=resolveStyleRules.esm.js.map

File diff suppressed because one or more lines are too long

62
node_modules/@griffel/core/runtime/shorthands.cjs.js generated vendored Normal file
View File

@@ -0,0 +1,62 @@
'use strict';
const shorthands = {
animation: [-1, ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimeline', 'animationTimingFunction']],
animationRange: [-1, ['animationRangeEnd', 'animationRangeStart']],
background: [-2, ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPosition', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize']],
backgroundPosition: [-1, ['backgroundPositionX', 'backgroundPositionY']],
border: [-2, ['borderBottom', 'borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderLeft', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRight', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTop', 'borderTopColor', 'borderTopStyle', 'borderTopWidth']],
borderBottom: [-1, ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth']],
borderImage: [-1, ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth']],
borderLeft: [-1, ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth']],
borderRadius: [-1, ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius']],
borderRight: [-1, ['borderRightColor', 'borderRightStyle', 'borderRightWidth']],
borderTop: [-1, ['borderTopColor', 'borderTopStyle', 'borderTopWidth']],
caret: [-1, ['caretColor', 'caretShape']],
columnRule: [-1, ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth']],
columns: [-1, ['columnCount', 'columnWidth']],
containIntrinsicSize: [-1, ['containIntrinsicHeight', 'containIntrinsicWidth']],
container: [-1, ['containerName', 'containerType']],
flex: [-1, ['flexBasis', 'flexGrow', 'flexShrink']],
flexFlow: [-1, ['flexDirection', 'flexWrap']],
font: [-1, ['fontFamily', 'fontSize', 'fontStretch', 'fontStyle', 'fontVariant', 'fontWeight', 'lineHeight']],
gap: [-1, ['columnGap', 'rowGap']],
grid: [-1, ['columnGap', 'gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridColumnGap', 'gridRowGap', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows', 'rowGap']],
gridArea: [-1, ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart']],
gridColumn: [-1, ['gridColumnEnd', 'gridColumnStart']],
gridRow: [-1, ['gridRowEnd', 'gridRowStart']],
gridTemplate: [-1, ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows']],
inset: [-1, ['bottom', 'left', 'right', 'top']],
insetBlock: [-1, ['insetBlockEnd', 'insetBlockStart']],
insetInline: [-1, ['insetInlineEnd', 'insetInlineStart']],
listStyle: [-1, ['listStyleImage', 'listStylePosition', 'listStyleType']],
margin: [-1, ['marginBottom', 'marginLeft', 'marginRight', 'marginTop']],
marginBlock: [-1, ['marginBlockEnd', 'marginBlockStart']],
marginInline: [-1, ['marginInlineEnd', 'marginInlineStart']],
mask: [-1, ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPosition', 'maskRepeat', 'maskSize']],
maskBorder: [-1, ['maskBorderMode', 'maskBorderOutset', 'maskBorderRepeat', 'maskBorderSlice', 'maskBorderSource', 'maskBorderWidth']],
offset: [-1, ['offsetAnchor', 'offsetDistance', 'offsetPath', 'offsetPosition', 'offsetRotate']],
outline: [-1, ['outlineColor', 'outlineStyle', 'outlineWidth']],
overflow: [-1, ['overflowX', 'overflowY']],
overscrollBehavior: [-1, ['overscrollBehaviorX', 'overscrollBehaviorY']],
padding: [-1, ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop']],
paddingBlock: [-1, ['paddingBlockEnd', 'paddingBlockStart']],
paddingInline: [-1, ['paddingInlineEnd', 'paddingInlineStart']],
placeContent: [-1, ['alignContent', 'justifyContent']],
placeItems: [-1, ['alignItems', 'justifyItems']],
placeSelf: [-1, ['alignSelf', 'justifySelf']],
scrollMargin: [-1, ['scrollMarginBottom', 'scrollMarginLeft', 'scrollMarginRight', 'scrollMarginTop']],
scrollMarginBlock: [-1, ['scrollMarginBlockEnd', 'scrollMarginBlockStart']],
scrollMarginInline: [-1, ['scrollMarginInlineEnd', 'scrollMarginInlineStart']],
scrollPadding: [-1, ['scrollPaddingBottom', 'scrollPaddingLeft', 'scrollPaddingRight', 'scrollPaddingTop']],
scrollPaddingBlock: [-1, ['scrollPaddingBlockEnd', 'scrollPaddingBlockStart']],
scrollPaddingInline: [-1, ['scrollPaddingInlineEnd', 'scrollPaddingInlineStart']],
scrollTimeline: [-1, ['scrollTimelineAxis', 'scrollTimelineName']],
textDecoration: [-1, ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle', 'textDecorationThickness']],
textEmphasis: [-1, ['textEmphasisColor', 'textEmphasisStyle']],
transition: [-1, ['transitionBehavior', 'transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction']],
viewTimeline: [-1, ['viewTimelineAxis', 'viewTimelineName']]
};
exports.shorthands = shorthands;
//# sourceMappingURL=shorthands.cjs.js.map

File diff suppressed because one or more lines are too long

60
node_modules/@griffel/core/runtime/shorthands.esm.js generated vendored Normal file
View File

@@ -0,0 +1,60 @@
const shorthands = {
animation: [-1, ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimeline', 'animationTimingFunction']],
animationRange: [-1, ['animationRangeEnd', 'animationRangeStart']],
background: [-2, ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPosition', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize']],
backgroundPosition: [-1, ['backgroundPositionX', 'backgroundPositionY']],
border: [-2, ['borderBottom', 'borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderLeft', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRight', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTop', 'borderTopColor', 'borderTopStyle', 'borderTopWidth']],
borderBottom: [-1, ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth']],
borderImage: [-1, ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth']],
borderLeft: [-1, ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth']],
borderRadius: [-1, ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius']],
borderRight: [-1, ['borderRightColor', 'borderRightStyle', 'borderRightWidth']],
borderTop: [-1, ['borderTopColor', 'borderTopStyle', 'borderTopWidth']],
caret: [-1, ['caretColor', 'caretShape']],
columnRule: [-1, ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth']],
columns: [-1, ['columnCount', 'columnWidth']],
containIntrinsicSize: [-1, ['containIntrinsicHeight', 'containIntrinsicWidth']],
container: [-1, ['containerName', 'containerType']],
flex: [-1, ['flexBasis', 'flexGrow', 'flexShrink']],
flexFlow: [-1, ['flexDirection', 'flexWrap']],
font: [-1, ['fontFamily', 'fontSize', 'fontStretch', 'fontStyle', 'fontVariant', 'fontWeight', 'lineHeight']],
gap: [-1, ['columnGap', 'rowGap']],
grid: [-1, ['columnGap', 'gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridColumnGap', 'gridRowGap', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows', 'rowGap']],
gridArea: [-1, ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart']],
gridColumn: [-1, ['gridColumnEnd', 'gridColumnStart']],
gridRow: [-1, ['gridRowEnd', 'gridRowStart']],
gridTemplate: [-1, ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows']],
inset: [-1, ['bottom', 'left', 'right', 'top']],
insetBlock: [-1, ['insetBlockEnd', 'insetBlockStart']],
insetInline: [-1, ['insetInlineEnd', 'insetInlineStart']],
listStyle: [-1, ['listStyleImage', 'listStylePosition', 'listStyleType']],
margin: [-1, ['marginBottom', 'marginLeft', 'marginRight', 'marginTop']],
marginBlock: [-1, ['marginBlockEnd', 'marginBlockStart']],
marginInline: [-1, ['marginInlineEnd', 'marginInlineStart']],
mask: [-1, ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPosition', 'maskRepeat', 'maskSize']],
maskBorder: [-1, ['maskBorderMode', 'maskBorderOutset', 'maskBorderRepeat', 'maskBorderSlice', 'maskBorderSource', 'maskBorderWidth']],
offset: [-1, ['offsetAnchor', 'offsetDistance', 'offsetPath', 'offsetPosition', 'offsetRotate']],
outline: [-1, ['outlineColor', 'outlineStyle', 'outlineWidth']],
overflow: [-1, ['overflowX', 'overflowY']],
overscrollBehavior: [-1, ['overscrollBehaviorX', 'overscrollBehaviorY']],
padding: [-1, ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop']],
paddingBlock: [-1, ['paddingBlockEnd', 'paddingBlockStart']],
paddingInline: [-1, ['paddingInlineEnd', 'paddingInlineStart']],
placeContent: [-1, ['alignContent', 'justifyContent']],
placeItems: [-1, ['alignItems', 'justifyItems']],
placeSelf: [-1, ['alignSelf', 'justifySelf']],
scrollMargin: [-1, ['scrollMarginBottom', 'scrollMarginLeft', 'scrollMarginRight', 'scrollMarginTop']],
scrollMarginBlock: [-1, ['scrollMarginBlockEnd', 'scrollMarginBlockStart']],
scrollMarginInline: [-1, ['scrollMarginInlineEnd', 'scrollMarginInlineStart']],
scrollPadding: [-1, ['scrollPaddingBottom', 'scrollPaddingLeft', 'scrollPaddingRight', 'scrollPaddingTop']],
scrollPaddingBlock: [-1, ['scrollPaddingBlockEnd', 'scrollPaddingBlockStart']],
scrollPaddingInline: [-1, ['scrollPaddingInlineEnd', 'scrollPaddingInlineStart']],
scrollTimeline: [-1, ['scrollTimelineAxis', 'scrollTimelineName']],
textDecoration: [-1, ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle', 'textDecorationThickness']],
textEmphasis: [-1, ['textEmphasisColor', 'textEmphasisStyle']],
transition: [-1, ['transitionBehavior', 'transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction']],
viewTimeline: [-1, ['viewTimelineAxis', 'viewTimelineName']]
};
export { shorthands };
//# sourceMappingURL=shorthands.esm.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,42 @@
'use strict';
var stylis = require('stylis');
const globalPlugin = element => {
switch (element.type) {
case stylis.RULESET:
if (typeof element.props === 'string') {
if (process.env.NODE_ENV !== 'production') {
throw new Error(`"element.props" has type "string" (${JSON.stringify(element.props, null, 2)}), it's not expected. Please report a bug if it happens.`);
}
return;
}
element.props = element.props.map(value => {
// Avoids calling tokenize() on every string
if (value.indexOf(':global(') === -1) {
return value;
}
return stylis.tokenize(value).reduce((acc, value, index, children) => {
if (value === '') {
return acc;
}
if (value === ':' && children[index + 1] === 'global') {
const selector =
// An inner part of ":global()"
children[index + 2].slice(1, -1) +
// A separator between selectors i.e. "body .class"
' ';
acc.unshift(selector);
children[index + 1] = '';
children[index + 2] = '';
return acc;
}
acc.push(value);
return acc;
}, []).join('');
});
}
};
exports.globalPlugin = globalPlugin;
//# sourceMappingURL=globalPlugin.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"globalPlugin.cjs.js","sources":["../../../../../packages/core/src/runtime/stylis/globalPlugin.ts"],"sourcesContent":["import { RULESET, tokenize } from 'stylis';\nimport type { Middleware } from 'stylis';\n\nexport const globalPlugin: Middleware = element => {\n switch (element.type) {\n case RULESET:\n if (typeof element.props === 'string') {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `\"element.props\" has type \"string\" (${JSON.stringify(\n element.props,\n null,\n 2,\n )}), it's not expected. Please report a bug if it happens.`,\n );\n }\n\n return;\n }\n\n element.props = element.props.map(value => {\n // Avoids calling tokenize() on every string\n if (value.indexOf(':global(') === -1) {\n return value;\n }\n\n return tokenize(value)\n .reduce<string[]>((acc, value, index, children) => {\n if (value === '') {\n return acc;\n }\n\n if (value === ':' && children[index + 1] === 'global') {\n const selector =\n // An inner part of \":global()\"\n children[index + 2].slice(1, -1) +\n // A separator between selectors i.e. \"body .class\"\n ' ';\n\n acc.unshift(selector);\n\n children[index + 1] = '';\n children[index + 2] = '';\n\n return acc;\n }\n\n acc.push(value);\n return acc;\n }, [])\n .join('');\n });\n }\n};\n"],"names":["globalPlugin","element","type","RULESET","props","process","env","NODE_ENV","Error","JSON","stringify","map","value","indexOf","tokenize","reduce","acc","index","children","selector","slice","unshift","push","join"],"mappings":";;;;AAGO,MAAMA,YAAY,GAAeC,OAAO,IAAG;EAChD,QAAQA,OAAO,CAACC,IAAI;AAClB,IAAA,KAAKC,cAAO;AACV,MAAA,IAAI,OAAOF,OAAO,CAACG,KAAK,KAAK,QAAQ,EAAE;AACrC,QAAA,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;AACzC,UAAA,MAAM,IAAIC,KAAK,CACb,CAAA,mCAAA,EAAsCC,IAAI,CAACC,SAAS,CAClDT,OAAO,CAACG,KAAK,EACb,IAAI,EACJ,CAAC,CACF,0DAA0D,CAC5D;AACH,QAAA;AAEA,QAAA;AACF,MAAA;MAEAH,OAAO,CAACG,KAAK,GAAGH,OAAO,CAACG,KAAK,CAACO,GAAG,CAACC,KAAK,IAAG;AACxC;QACA,IAAIA,KAAK,CAACC,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE;AACpC,UAAA,OAAOD,KAAK;AACd,QAAA;AAEA,QAAA,OAAOE,eAAQ,CAACF,KAAK,CAAC,CACnBG,MAAM,CAAW,CAACC,GAAG,EAAEJ,KAAK,EAAEK,KAAK,EAAEC,QAAQ,KAAI;UAChD,IAAIN,KAAK,KAAK,EAAE,EAAE;AAChB,YAAA,OAAOI,GAAG;AACZ,UAAA;AAEA,UAAA,IAAIJ,KAAK,KAAK,GAAG,IAAIM,QAAQ,CAACD,KAAK,GAAG,CAAC,CAAC,KAAK,QAAQ,EAAE;AACrD,YAAA,MAAME,QAAQ;AACZ;AACAD,YAAAA,QAAQ,CAACD,KAAK,GAAG,CAAC,CAAC,CAACG,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;AAChC;YACA,GAAG;AAELJ,YAAAA,GAAG,CAACK,OAAO,CAACF,QAAQ,CAAC;AAErBD,YAAAA,QAAQ,CAACD,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE;AACxBC,YAAAA,QAAQ,CAACD,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE;AAExB,YAAA,OAAOD,GAAG;AACZ,UAAA;AAEAA,UAAAA,GAAG,CAACM,IAAI,CAACV,KAAK,CAAC;AACf,UAAA,OAAOI,GAAG;AACZ,QAAA,CAAC,EAAE,EAAE,CAAC,CACLO,IAAI,CAAC,EAAE,CAAC;AACb,MAAA,CAAC,CAAC;AACN;AACF;;;;"}

View File

@@ -0,0 +1,40 @@
import { RULESET, tokenize } from 'stylis';
const globalPlugin = element => {
switch (element.type) {
case RULESET:
if (typeof element.props === 'string') {
if (process.env.NODE_ENV !== 'production') {
throw new Error(`"element.props" has type "string" (${JSON.stringify(element.props, null, 2)}), it's not expected. Please report a bug if it happens.`);
}
return;
}
element.props = element.props.map(value => {
// Avoids calling tokenize() on every string
if (value.indexOf(':global(') === -1) {
return value;
}
return tokenize(value).reduce((acc, value, index, children) => {
if (value === '') {
return acc;
}
if (value === ':' && children[index + 1] === 'global') {
const selector =
// An inner part of ":global()"
children[index + 2].slice(1, -1) +
// A separator between selectors i.e. "body .class"
' ';
acc.unshift(selector);
children[index + 1] = '';
children[index + 2] = '';
return acc;
}
acc.push(value);
return acc;
}, []).join('');
});
}
};
export { globalPlugin };
//# sourceMappingURL=globalPlugin.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"globalPlugin.esm.js","sources":["../../../../../packages/core/src/runtime/stylis/globalPlugin.ts"],"sourcesContent":["import { RULESET, tokenize } from 'stylis';\nimport type { Middleware } from 'stylis';\n\nexport const globalPlugin: Middleware = element => {\n switch (element.type) {\n case RULESET:\n if (typeof element.props === 'string') {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `\"element.props\" has type \"string\" (${JSON.stringify(\n element.props,\n null,\n 2,\n )}), it's not expected. Please report a bug if it happens.`,\n );\n }\n\n return;\n }\n\n element.props = element.props.map(value => {\n // Avoids calling tokenize() on every string\n if (value.indexOf(':global(') === -1) {\n return value;\n }\n\n return tokenize(value)\n .reduce<string[]>((acc, value, index, children) => {\n if (value === '') {\n return acc;\n }\n\n if (value === ':' && children[index + 1] === 'global') {\n const selector =\n // An inner part of \":global()\"\n children[index + 2].slice(1, -1) +\n // A separator between selectors i.e. \"body .class\"\n ' ';\n\n acc.unshift(selector);\n\n children[index + 1] = '';\n children[index + 2] = '';\n\n return acc;\n }\n\n acc.push(value);\n return acc;\n }, [])\n .join('');\n });\n }\n};\n"],"names":["globalPlugin","element","type","RULESET","props","process","env","NODE_ENV","Error","JSON","stringify","map","value","indexOf","tokenize","reduce","acc","index","children","selector","slice","unshift","push","join"],"mappings":";;AAGO,MAAMA,YAAY,GAAeC,OAAO,IAAG;EAChD,QAAQA,OAAO,CAACC,IAAI;AAClB,IAAA,KAAKC,OAAO;AACV,MAAA,IAAI,OAAOF,OAAO,CAACG,KAAK,KAAK,QAAQ,EAAE;AACrC,QAAA,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;AACzC,UAAA,MAAM,IAAIC,KAAK,CACb,CAAA,mCAAA,EAAsCC,IAAI,CAACC,SAAS,CAClDT,OAAO,CAACG,KAAK,EACb,IAAI,EACJ,CAAC,CACF,0DAA0D,CAC5D;AACH,QAAA;AAEA,QAAA;AACF,MAAA;MAEAH,OAAO,CAACG,KAAK,GAAGH,OAAO,CAACG,KAAK,CAACO,GAAG,CAACC,KAAK,IAAG;AACxC;QACA,IAAIA,KAAK,CAACC,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE;AACpC,UAAA,OAAOD,KAAK;AACd,QAAA;AAEA,QAAA,OAAOE,QAAQ,CAACF,KAAK,CAAC,CACnBG,MAAM,CAAW,CAACC,GAAG,EAAEJ,KAAK,EAAEK,KAAK,EAAEC,QAAQ,KAAI;UAChD,IAAIN,KAAK,KAAK,EAAE,EAAE;AAChB,YAAA,OAAOI,GAAG;AACZ,UAAA;AAEA,UAAA,IAAIJ,KAAK,KAAK,GAAG,IAAIM,QAAQ,CAACD,KAAK,GAAG,CAAC,CAAC,KAAK,QAAQ,EAAE;AACrD,YAAA,MAAME,QAAQ;AACZ;AACAD,YAAAA,QAAQ,CAACD,KAAK,GAAG,CAAC,CAAC,CAACG,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;AAChC;YACA,GAAG;AAELJ,YAAAA,GAAG,CAACK,OAAO,CAACF,QAAQ,CAAC;AAErBD,YAAAA,QAAQ,CAACD,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE;AACxBC,YAAAA,QAAQ,CAACD,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE;AAExB,YAAA,OAAOD,GAAG;AACZ,UAAA;AAEAA,UAAAA,GAAG,CAACM,IAAI,CAACV,KAAK,CAAC;AACf,UAAA,OAAOI,GAAG;AACZ,QAAA,CAAC,EAAE,EAAE,CAAC,CACLO,IAAI,CAAC,EAAE,CAAC;AACb,MAAA,CAAC,CAAC;AACN;AACF;;;;"}

View File

@@ -0,0 +1,17 @@
'use strict';
var stylis = require('stylis');
function isAtRuleElement(element) {
switch (element.type) {
case '@container':
case stylis.MEDIA:
case stylis.SUPPORTS:
case stylis.LAYER:
return true;
}
return false;
}
exports.isAtRuleElement = isAtRuleElement;
//# sourceMappingURL=isAtRuleElement.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isAtRuleElement.cjs.js","sources":["../../../../../packages/core/src/runtime/stylis/isAtRuleElement.ts"],"sourcesContent":["import { LAYER, MEDIA, SUPPORTS } from 'stylis';\nimport type { Element } from 'stylis';\n\nexport function isAtRuleElement(element: Element): boolean {\n switch (element.type) {\n case '@container':\n case MEDIA:\n case SUPPORTS:\n case LAYER:\n return true;\n }\n\n return false;\n}\n"],"names":["isAtRuleElement","element","type","MEDIA","SUPPORTS","LAYER"],"mappings":";;;;AAGM,SAAUA,eAAeA,CAACC,OAAgB,EAAA;EAC9C,QAAQA,OAAO,CAACC,IAAI;AAClB,IAAA,KAAK,YAAY;AACjB,IAAA,KAAKC,YAAK;AACV,IAAA,KAAKC,eAAQ;AACb,IAAA,KAAKC,YAAK;AACR,MAAA,OAAO,IAAI;AACf;AAEA,EAAA,OAAO,KAAK;AACd;;;;"}

View File

@@ -0,0 +1,15 @@
import { LAYER, SUPPORTS, MEDIA } from 'stylis';
function isAtRuleElement(element) {
switch (element.type) {
case '@container':
case MEDIA:
case SUPPORTS:
case LAYER:
return true;
}
return false;
}
export { isAtRuleElement };
//# sourceMappingURL=isAtRuleElement.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isAtRuleElement.esm.js","sources":["../../../../../packages/core/src/runtime/stylis/isAtRuleElement.ts"],"sourcesContent":["import { LAYER, MEDIA, SUPPORTS } from 'stylis';\nimport type { Element } from 'stylis';\n\nexport function isAtRuleElement(element: Element): boolean {\n switch (element.type) {\n case '@container':\n case MEDIA:\n case SUPPORTS:\n case LAYER:\n return true;\n }\n\n return false;\n}\n"],"names":["isAtRuleElement","element","type","MEDIA","SUPPORTS","LAYER"],"mappings":";;AAGM,SAAUA,eAAeA,CAACC,OAAgB,EAAA;EAC9C,QAAQA,OAAO,CAACC,IAAI;AAClB,IAAA,KAAK,YAAY;AACjB,IAAA,KAAKC,KAAK;AACV,IAAA,KAAKC,QAAQ;AACb,IAAA,KAAKC,KAAK;AACR,MAAA,OAAO,IAAI;AACf;AAEA,EAAA,OAAO,KAAK;AACd;;;;"}

View File

@@ -0,0 +1,139 @@
'use strict';
var stylis = require('stylis');
/* eslint-disable no-fallthrough */
function prefix(value, length, children) {
switch (stylis.hash(value, length)) {
// color-adjust
case 5103:
return stylis.WEBKIT + 'print-' + value + value;
// backface-visibility, column, box-decoration-break
case 3191:
case 6645:
case 3005:
// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite
case 6391:
case 5879:
case 5623:
case 6135:
case 4599:
case 4855:
return stylis.WEBKIT + value + value;
// backdrop-filter, background-clip: text
case 4215:
// Additional check on "backdrop-(f)ilter" to prevent conflict with "background-clip"
// https://github.com/thysultan/stylis/issues/292
if (stylis.charat(value, 9) === 102) {
return stylis.WEBKIT + value + value;
}
// background-clip: text
if (stylis.charat(value, length + 1) === 116) {
return stylis.WEBKIT + value + value;
}
break;
// tab-size
case 4789:
return stylis.MOZ + value + value;
// appearance, user-select, hyphens
case 5349:
case 4246:
case 6968:
return stylis.WEBKIT + value + stylis.MOZ + value + value;
// cursor
// @ts-expect-error fall through is intentional here
case 6187:
if (!stylis.match(value, /grab/)) {
return stylis.replace(stylis.replace(stylis.replace(value, /(zoom-|grab)/, stylis.WEBKIT + '$1'), /(image-set)/, stylis.WEBKIT + '$1'), value, '') + value;
}
// background, background-image
case 5495:
case 3959:
// eslint-disable-next-line no-useless-concat
return stylis.replace(value, /(image-set\([^]*)/, stylis.WEBKIT + '$1' + '$`$1');
// (margin|padding)-inline-(start|end)
case 4095:
case 3583:
case 4068:
case 2532:
return stylis.replace(value, /(.+)-inline(.+)/, stylis.WEBKIT + '$1$2') + value;
// (min|max)?(width|height|inline-size|block-size)
case 8116:
case 7059:
case 5753:
case 5535:
case 5445:
case 5701:
case 4933:
case 4677:
case 5533:
case 5789:
case 5021:
case 4765:
// stretch fill-available
if (stylis.strlen(value) - 1 - length > 6) switch (stylis.charat(value, length + 1)) {
// (f)ill-available
// @ts-expect-error fall through is intentional here
case 102:
if (stylis.charat(value, length + 3) === 108) {
return stylis.replace(value, /(.+:)(.+)-([^]+)/,
// eslint-disable-next-line no-useless-concat, eqeqeq
'$1' + stylis.WEBKIT + '$2-$3' + '$1' + stylis.MOZ + (stylis.charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
}
// (s)tretch
case 115:
return ~stylis.indexof(value, 'stretch') ? prefix(stylis.replace(value, 'stretch', 'fill-available'), length) + value : value;
}
break;
}
return value;
}
/**
* @param {object} element
* @param {number} index
* @param {object[]} children
* @param {function} callback
*/
function prefixerPlugin(element, index, children, callback) {
if (element.length > -1) if (!element.return) switch (element.type) {
case stylis.DECLARATION:
element.return = prefix(element.value, element.length);
return;
case stylis.RULESET:
if (element.length)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return stylis.combine(element.props, function (value) {
switch (stylis.match(value, /(::plac\w+|:read-\w+)/)) {
// :read-(only|write)
case ':read-only':
case ':read-write':
return stylis.serialize(
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
[stylis.copy(element, {
props: [stylis.replace(value, /:(read-\w+)/, ':' + stylis.MOZ + '$1')]
})], callback);
// :placeholder
case '::placeholder':
return stylis.serialize([
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
stylis.copy(element, {
props: [stylis.replace(value, /:(plac\w+)/, ':' + stylis.WEBKIT + 'input-$1')]
}),
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
stylis.copy(element, {
props: [stylis.replace(value, /:(plac\w+)/, ':' + stylis.MOZ + '$1')]
})], callback);
}
return '';
});
}
return undefined;
}
exports.prefix = prefix;
exports.prefixerPlugin = prefixerPlugin;
//# sourceMappingURL=prefixerPlugin.cjs.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,136 @@
import { RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, DECLARATION, hash, strlen, charat, indexof } from 'stylis';
/* eslint-disable no-fallthrough */
function prefix(value, length, children) {
switch (hash(value, length)) {
// color-adjust
case 5103:
return WEBKIT + 'print-' + value + value;
// backface-visibility, column, box-decoration-break
case 3191:
case 6645:
case 3005:
// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite
case 6391:
case 5879:
case 5623:
case 6135:
case 4599:
case 4855:
return WEBKIT + value + value;
// backdrop-filter, background-clip: text
case 4215:
// Additional check on "backdrop-(f)ilter" to prevent conflict with "background-clip"
// https://github.com/thysultan/stylis/issues/292
if (charat(value, 9) === 102) {
return WEBKIT + value + value;
}
// background-clip: text
if (charat(value, length + 1) === 116) {
return WEBKIT + value + value;
}
break;
// tab-size
case 4789:
return MOZ + value + value;
// appearance, user-select, hyphens
case 5349:
case 4246:
case 6968:
return WEBKIT + value + MOZ + value + value;
// cursor
// @ts-expect-error fall through is intentional here
case 6187:
if (!match(value, /grab/)) {
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;
}
// background, background-image
case 5495:
case 3959:
// eslint-disable-next-line no-useless-concat
return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1');
// (margin|padding)-inline-(start|end)
case 4095:
case 3583:
case 4068:
case 2532:
return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;
// (min|max)?(width|height|inline-size|block-size)
case 8116:
case 7059:
case 5753:
case 5535:
case 5445:
case 5701:
case 4933:
case 4677:
case 5533:
case 5789:
case 5021:
case 4765:
// stretch fill-available
if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
// (f)ill-available
// @ts-expect-error fall through is intentional here
case 102:
if (charat(value, length + 3) === 108) {
return replace(value, /(.+:)(.+)-([^]+)/,
// eslint-disable-next-line no-useless-concat, eqeqeq
'$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
}
// (s)tretch
case 115:
return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;
}
break;
}
return value;
}
/**
* @param {object} element
* @param {number} index
* @param {object[]} children
* @param {function} callback
*/
function prefixerPlugin(element, index, children, callback) {
if (element.length > -1) if (!element.return) switch (element.type) {
case DECLARATION:
element.return = prefix(element.value, element.length);
return;
case RULESET:
if (element.length)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return combine(element.props, function (value) {
switch (match(value, /(::plac\w+|:read-\w+)/)) {
// :read-(only|write)
case ':read-only':
case ':read-write':
return serialize(
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
[copy(element, {
props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]
})], callback);
// :placeholder
case '::placeholder':
return serialize([
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
copy(element, {
props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]
}),
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
copy(element, {
props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]
})], callback);
}
return '';
});
}
return undefined;
}
export { prefix, prefixerPlugin };
//# sourceMappingURL=prefixerPlugin.esm.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,17 @@
'use strict';
/**
* The same plugin as in stylis, but this version also has "element" argument.
*/
function rulesheetPlugin(callback) {
return function (element) {
if (!element.root) {
if (element.return) {
callback(element, element.return);
}
}
};
}
exports.rulesheetPlugin = rulesheetPlugin;
//# sourceMappingURL=rulesheetPlugin.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"rulesheetPlugin.cjs.js","sources":["../../../../../packages/core/src/runtime/stylis/rulesheetPlugin.ts"],"sourcesContent":["import type { Element, Middleware } from 'stylis';\n\nexport type RulesheetPluginCallback = (type: Element, rule: string) => void;\n\n/**\n * The same plugin as in stylis, but this version also has \"element\" argument.\n */\nexport function rulesheetPlugin(callback: RulesheetPluginCallback): Middleware {\n return function (element) {\n if (!element.root) {\n if (element.return) {\n callback(element, element.return);\n }\n }\n };\n}\n"],"names":["rulesheetPlugin","callback","element","root","return"],"mappings":";;AAIA;;AAEG;AACG,SAAUA,eAAeA,CAACC,QAAiC,EAAA;EAC/D,OAAO,UAAUC,OAAO,EAAA;AACtB,IAAA,IAAI,CAACA,OAAO,CAACC,IAAI,EAAE;MACjB,IAAID,OAAO,CAACE,MAAM,EAAE;AAClBH,QAAAA,QAAQ,CAACC,OAAO,EAAEA,OAAO,CAACE,MAAM,CAAC;AACnC,MAAA;AACF,IAAA;EACF,CAAC;AACH;;;;"}

View File

@@ -0,0 +1,15 @@
/**
* The same plugin as in stylis, but this version also has "element" argument.
*/
function rulesheetPlugin(callback) {
return function (element) {
if (!element.root) {
if (element.return) {
callback(element, element.return);
}
}
};
}
export { rulesheetPlugin };
//# sourceMappingURL=rulesheetPlugin.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"rulesheetPlugin.esm.js","sources":["../../../../../packages/core/src/runtime/stylis/rulesheetPlugin.ts"],"sourcesContent":["import type { Element, Middleware } from 'stylis';\n\nexport type RulesheetPluginCallback = (type: Element, rule: string) => void;\n\n/**\n * The same plugin as in stylis, but this version also has \"element\" argument.\n */\nexport function rulesheetPlugin(callback: RulesheetPluginCallback): Middleware {\n return function (element) {\n if (!element.root) {\n if (element.return) {\n callback(element, element.return);\n }\n }\n };\n}\n"],"names":["rulesheetPlugin","callback","element","root","return"],"mappings":"AAIA;;AAEG;AACG,SAAUA,eAAeA,CAACC,QAAiC,EAAA;EAC/D,OAAO,UAAUC,OAAO,EAAA;AACtB,IAAA,IAAI,CAACA,OAAO,CAACC,IAAI,EAAE;MACjB,IAAID,OAAO,CAACE,MAAM,EAAE;AAClBH,QAAAA,QAAQ,CAACC,OAAO,EAAEA,OAAO,CAACE,MAAM,CAAC;AACnC,MAAA;AACF,IAAA;EACF,CAAC;AACH;;;;"}

View File

@@ -0,0 +1,12 @@
'use strict';
var isAtRuleElement = require('./isAtRuleElement.cjs.js');
const sortClassesInAtRulesPlugin = element => {
if (isAtRuleElement.isAtRuleElement(element) && Array.isArray(element.children)) {
element.children.sort((a, b) => a.props[0] > b.props[0] ? 1 : -1);
}
};
exports.sortClassesInAtRulesPlugin = sortClassesInAtRulesPlugin;
//# sourceMappingURL=sortClassesInAtRulesPlugin.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"sortClassesInAtRulesPlugin.cjs.js","sources":["../../../../../packages/core/src/runtime/stylis/sortClassesInAtRulesPlugin.ts"],"sourcesContent":["import type { Middleware } from 'stylis';\nimport { isAtRuleElement } from './isAtRuleElement';\n\nexport const sortClassesInAtRulesPlugin: Middleware = element => {\n if (isAtRuleElement(element) && Array.isArray(element.children)) {\n element.children.sort((a, b) => (a.props[0] > b.props[0] ? 1 : -1));\n }\n};\n"],"names":["sortClassesInAtRulesPlugin","element","isAtRuleElement","Array","isArray","children","sort","a","b","props"],"mappings":";;;;AAGO,MAAMA,0BAA0B,GAAeC,OAAO,IAAG;AAC9D,EAAA,IAAIC,+BAAe,CAACD,OAAO,CAAC,IAAIE,KAAK,CAACC,OAAO,CAACH,OAAO,CAACI,QAAQ,CAAC,EAAE;AAC/DJ,IAAAA,OAAO,CAACI,QAAQ,CAACC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAMD,CAAC,CAACE,KAAK,CAAC,CAAC,CAAC,GAAGD,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAG,CAAC;AACrE,EAAA;AACF;;;;"}

View File

@@ -0,0 +1,10 @@
import { isAtRuleElement } from './isAtRuleElement.esm.js';
const sortClassesInAtRulesPlugin = element => {
if (isAtRuleElement(element) && Array.isArray(element.children)) {
element.children.sort((a, b) => a.props[0] > b.props[0] ? 1 : -1);
}
};
export { sortClassesInAtRulesPlugin };
//# sourceMappingURL=sortClassesInAtRulesPlugin.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"sortClassesInAtRulesPlugin.esm.js","sources":["../../../../../packages/core/src/runtime/stylis/sortClassesInAtRulesPlugin.ts"],"sourcesContent":["import type { Middleware } from 'stylis';\nimport { isAtRuleElement } from './isAtRuleElement';\n\nexport const sortClassesInAtRulesPlugin: Middleware = element => {\n if (isAtRuleElement(element) && Array.isArray(element.children)) {\n element.children.sort((a, b) => (a.props[0] > b.props[0] ? 1 : -1));\n }\n};\n"],"names":["sortClassesInAtRulesPlugin","element","isAtRuleElement","Array","isArray","children","sort","a","b","props"],"mappings":";;AAGO,MAAMA,0BAA0B,GAAeC,OAAO,IAAG;AAC9D,EAAA,IAAIC,eAAe,CAACD,OAAO,CAAC,IAAIE,KAAK,CAACC,OAAO,CAACH,OAAO,CAACI,QAAQ,CAAC,EAAE;AAC/DJ,IAAAA,OAAO,CAACI,QAAQ,CAACC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAMD,CAAC,CAACE,KAAK,CAAC,CAAC,CAAC,GAAGD,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAG,CAAC;AACrE,EAAA;AACF;;;;"}

View File

@@ -0,0 +1,24 @@
'use strict';
var hyphenateProperty = require('./hyphenateProperty.cjs.js');
function cssifyObject(style) {
let css = '';
// eslint-disable-next-line guard-for-in
for (const property in style) {
const value = style[property];
if (typeof value === 'string' || typeof value === 'number') {
css += hyphenateProperty.hyphenateProperty(property) + ':' + value + ';';
continue;
}
if (Array.isArray(value)) {
for (const arrValue of value) {
css += hyphenateProperty.hyphenateProperty(property) + ':' + arrValue + ';';
}
}
}
return css;
}
exports.cssifyObject = cssifyObject;
//# sourceMappingURL=cssifyObject.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"cssifyObject.cjs.js","sources":["../../../../../packages/core/src/runtime/utils/cssifyObject.ts"],"sourcesContent":["import type { GriffelStaticStyle, GriffelStyle } from '@griffel/style-types';\nimport { hyphenateProperty } from './hyphenateProperty';\n\nexport function cssifyObject(style: GriffelStyle | GriffelStaticStyle) {\n let css = '';\n\n // eslint-disable-next-line guard-for-in\n for (const property in style) {\n const value = style[property as keyof GriffelStyle];\n if (typeof value === 'string' || typeof value === 'number') {\n css += hyphenateProperty(property) + ':' + value + ';';\n continue;\n }\n if (Array.isArray(value)) {\n for (const arrValue of value) {\n css += hyphenateProperty(property) + ':' + arrValue + ';';\n }\n }\n }\n\n return css;\n}\n"],"names":["cssifyObject","style","css","property","value","hyphenateProperty","Array","isArray","arrValue"],"mappings":";;;;AAGM,SAAUA,YAAYA,CAACC,KAAwC,EAAA;EACnE,IAAIC,GAAG,GAAG,EAAE;AAEZ;AACA,EAAA,KAAK,MAAMC,QAAQ,IAAIF,KAAK,EAAE;AAC5B,IAAA,MAAMG,KAAK,GAAGH,KAAK,CAACE,QAA8B,CAAC;IACnD,IAAI,OAAOC,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;MAC1DF,GAAG,IAAIG,mCAAiB,CAACF,QAAQ,CAAC,GAAG,GAAG,GAAGC,KAAK,GAAG,GAAG;AACtD,MAAA;AACF,IAAA;AACA,IAAA,IAAIE,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,EAAE;AACxB,MAAA,KAAK,MAAMI,QAAQ,IAAIJ,KAAK,EAAE;QAC5BF,GAAG,IAAIG,mCAAiB,CAACF,QAAQ,CAAC,GAAG,GAAG,GAAGK,QAAQ,GAAG,GAAG;AAC3D,MAAA;AACF,IAAA;AACF,EAAA;AAEA,EAAA,OAAON,GAAG;AACZ;;;;"}

View File

@@ -0,0 +1,22 @@
import { hyphenateProperty } from './hyphenateProperty.esm.js';
function cssifyObject(style) {
let css = '';
// eslint-disable-next-line guard-for-in
for (const property in style) {
const value = style[property];
if (typeof value === 'string' || typeof value === 'number') {
css += hyphenateProperty(property) + ':' + value + ';';
continue;
}
if (Array.isArray(value)) {
for (const arrValue of value) {
css += hyphenateProperty(property) + ':' + arrValue + ';';
}
}
}
return css;
}
export { cssifyObject };
//# sourceMappingURL=cssifyObject.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"cssifyObject.esm.js","sources":["../../../../../packages/core/src/runtime/utils/cssifyObject.ts"],"sourcesContent":["import type { GriffelStaticStyle, GriffelStyle } from '@griffel/style-types';\nimport { hyphenateProperty } from './hyphenateProperty';\n\nexport function cssifyObject(style: GriffelStyle | GriffelStaticStyle) {\n let css = '';\n\n // eslint-disable-next-line guard-for-in\n for (const property in style) {\n const value = style[property as keyof GriffelStyle];\n if (typeof value === 'string' || typeof value === 'number') {\n css += hyphenateProperty(property) + ':' + value + ';';\n continue;\n }\n if (Array.isArray(value)) {\n for (const arrValue of value) {\n css += hyphenateProperty(property) + ':' + arrValue + ';';\n }\n }\n }\n\n return css;\n}\n"],"names":["cssifyObject","style","css","property","value","hyphenateProperty","Array","isArray","arrValue"],"mappings":";;AAGM,SAAUA,YAAYA,CAACC,KAAwC,EAAA;EACnE,IAAIC,GAAG,GAAG,EAAE;AAEZ;AACA,EAAA,KAAK,MAAMC,QAAQ,IAAIF,KAAK,EAAE;AAC5B,IAAA,MAAMG,KAAK,GAAGH,KAAK,CAACE,QAA8B,CAAC;IACnD,IAAI,OAAOC,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;MAC1DF,GAAG,IAAIG,iBAAiB,CAACF,QAAQ,CAAC,GAAG,GAAG,GAAGC,KAAK,GAAG,GAAG;AACtD,MAAA;AACF,IAAA;AACA,IAAA,IAAIE,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,EAAE;AACxB,MAAA,KAAK,MAAMI,QAAQ,IAAIJ,KAAK,EAAE;QAC5BF,GAAG,IAAIG,iBAAiB,CAACF,QAAQ,CAAC,GAAG,GAAG,GAAGK,QAAQ,GAAG,GAAG;AAC3D,MAAA;AACF,IAAA;AACF,EAAA;AAEA,EAAA,OAAON,GAAG;AACZ;;;;"}

View File

@@ -0,0 +1,11 @@
'use strict';
function generateCombinedQuery(currentMediaQuery, nestedMediaQuery) {
if (currentMediaQuery.length === 0) {
return nestedMediaQuery;
}
return `${currentMediaQuery} and ${nestedMediaQuery}`;
}
exports.generateCombinedQuery = generateCombinedQuery;
//# sourceMappingURL=generateCombinedMediaQuery.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"generateCombinedMediaQuery.cjs.js","sources":["../../../../../packages/core/src/runtime/utils/generateCombinedMediaQuery.ts"],"sourcesContent":["export function generateCombinedQuery(currentMediaQuery: string, nestedMediaQuery: string): string {\n if (currentMediaQuery.length === 0) {\n return nestedMediaQuery;\n }\n\n return `${currentMediaQuery} and ${nestedMediaQuery}`;\n}\n"],"names":["generateCombinedQuery","currentMediaQuery","nestedMediaQuery","length"],"mappings":";;AAAM,SAAUA,qBAAqBA,CAACC,iBAAyB,EAAEC,gBAAwB,EAAA;AACvF,EAAA,IAAID,iBAAiB,CAACE,MAAM,KAAK,CAAC,EAAE;AAClC,IAAA,OAAOD,gBAAgB;AACzB,EAAA;AAEA,EAAA,OAAO,CAAA,EAAGD,iBAAiB,CAAA,KAAA,EAAQC,gBAAgB,CAAA,CAAE;AACvD;;;;"}

View File

@@ -0,0 +1,9 @@
function generateCombinedQuery(currentMediaQuery, nestedMediaQuery) {
if (currentMediaQuery.length === 0) {
return nestedMediaQuery;
}
return `${currentMediaQuery} and ${nestedMediaQuery}`;
}
export { generateCombinedQuery };
//# sourceMappingURL=generateCombinedMediaQuery.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"generateCombinedMediaQuery.esm.js","sources":["../../../../../packages/core/src/runtime/utils/generateCombinedMediaQuery.ts"],"sourcesContent":["export function generateCombinedQuery(currentMediaQuery: string, nestedMediaQuery: string): string {\n if (currentMediaQuery.length === 0) {\n return nestedMediaQuery;\n }\n\n return `${currentMediaQuery} and ${nestedMediaQuery}`;\n}\n"],"names":["generateCombinedQuery","currentMediaQuery","nestedMediaQuery","length"],"mappings":"AAAM,SAAUA,qBAAqBA,CAACC,iBAAyB,EAAEC,gBAAwB,EAAA;AACvF,EAAA,IAAID,iBAAiB,CAACE,MAAM,KAAK,CAAC,EAAE;AAClC,IAAA,OAAOD,gBAAgB;AACzB,EAAA;AAEA,EAAA,OAAO,CAAA,EAAGD,iBAAiB,CAAA,KAAA,EAAQC,gBAAgB,CAAA,CAAE;AACvD;;;;"}

View File

@@ -0,0 +1,23 @@
'use strict';
var hashString = require('@emotion/hash');
var constants = require('../../constants.cjs.js');
var hashPropertyKey = require('./hashPropertyKey.cjs.js');
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
var hashString__default = /*#__PURE__*/_interopDefaultCompat(hashString);
function hashClassName({
property,
selector,
salt,
value
}, atRules) {
return constants.HASH_PREFIX + hashString__default.default(salt + selector + hashPropertyKey.atRulesToString(atRules) + property +
// Trimming of value is required to generate consistent hashes
value.trim());
}
exports.hashClassName = hashClassName;
//# sourceMappingURL=hashClassName.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hashClassName.cjs.js","sources":["../../../../../packages/core/src/runtime/utils/hashClassName.ts"],"sourcesContent":["import hashString from '@emotion/hash';\n\nimport { HASH_PREFIX } from '../../constants';\nimport { atRulesToString } from './hashPropertyKey';\nimport type { AtRules } from './types';\n\ninterface HashedClassNameParts {\n property: string;\n value: string;\n salt: string;\n selector: string;\n}\n\nexport function hashClassName({ property, selector, salt, value }: HashedClassNameParts, atRules: AtRules): string {\n return (\n HASH_PREFIX +\n hashString(\n salt +\n selector +\n atRulesToString(atRules) +\n property +\n // Trimming of value is required to generate consistent hashes\n value.trim(),\n )\n );\n}\n"],"names":["hashClassName","property","selector","salt","value","atRules","HASH_PREFIX","hashString","atRulesToString","trim"],"mappings":";;;;;;;;;;AAaM,SAAUA,aAAaA,CAAC;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC,IAAI;AAAEC,EAAAA;AAAK,CAAwB,EAAEC,OAAgB,EAAA;AACvG,EAAA,OACEC,qBAAW,GACXC,2BAAU,CACRJ,IAAI,GACFD,QAAQ,GACRM,+BAAe,CAACH,OAAO,CAAC,GACxBJ,QAAQ;AACR;AACAG,EAAAA,KAAK,CAACK,IAAI,EAAE,CACf;AAEL;;;;"}

View File

@@ -0,0 +1,17 @@
import hashString from '@emotion/hash';
import { HASH_PREFIX } from '../../constants.esm.js';
import { atRulesToString } from './hashPropertyKey.esm.js';
function hashClassName({
property,
selector,
salt,
value
}, atRules) {
return HASH_PREFIX + hashString(salt + selector + atRulesToString(atRules) + property +
// Trimming of value is required to generate consistent hashes
value.trim());
}
export { hashClassName };
//# sourceMappingURL=hashClassName.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hashClassName.esm.js","sources":["../../../../../packages/core/src/runtime/utils/hashClassName.ts"],"sourcesContent":["import hashString from '@emotion/hash';\n\nimport { HASH_PREFIX } from '../../constants';\nimport { atRulesToString } from './hashPropertyKey';\nimport type { AtRules } from './types';\n\ninterface HashedClassNameParts {\n property: string;\n value: string;\n salt: string;\n selector: string;\n}\n\nexport function hashClassName({ property, selector, salt, value }: HashedClassNameParts, atRules: AtRules): string {\n return (\n HASH_PREFIX +\n hashString(\n salt +\n selector +\n atRulesToString(atRules) +\n property +\n // Trimming of value is required to generate consistent hashes\n value.trim(),\n )\n );\n}\n"],"names":["hashClassName","property","selector","salt","value","atRules","HASH_PREFIX","hashString","atRulesToString","trim"],"mappings":";;;;AAaM,SAAUA,aAAaA,CAAC;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC,IAAI;AAAEC,EAAAA;AAAK,CAAwB,EAAEC,OAAgB,EAAA;AACvG,EAAA,OACEC,WAAW,GACXC,UAAU,CACRJ,IAAI,GACFD,QAAQ,GACRM,eAAe,CAACH,OAAO,CAAC,GACxBJ,QAAQ;AACR;AACAG,EAAAA,KAAK,CAACK,IAAI,EAAE,CACf;AAEL;;;;"}

View File

@@ -0,0 +1,37 @@
'use strict';
var hashString = require('@emotion/hash');
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
var hashString__default = /*#__PURE__*/_interopDefaultCompat(hashString);
function addAtRulePrefix(atRule, prefix) {
return atRule ? prefix + atRule : atRule;
}
function atRulesToString(atRules) {
return addAtRulePrefix(atRules.container, 'c') + addAtRulePrefix(atRules.media, 'm') + addAtRulePrefix(atRules.layer, 'l') + addAtRulePrefix(atRules.supports, 's');
}
function hashPropertyKey(selector, property, atRules) {
// uniq key based on property & selector, used for merging later
const computedKey = selector + atRulesToString(atRules) + property;
// "key" can be really long as it includes selectors, we use hashes to reduce sizes of keys
// ".foo :hover" => "abcd"
const hashedKey = hashString__default.default(computedKey);
// As these hashes are used as object keys in build output we should avoid having numbers as a first character to
// avoid having quotes:
// {
// "1abc": {}, // we don't want this
// Aabc: {}, // no quotes
// }
const firstCharCode = hashedKey.charCodeAt(0);
const startsWithNumber = firstCharCode >= 48 && firstCharCode <= 57;
if (startsWithNumber) {
return String.fromCharCode(firstCharCode + 17) + hashedKey.slice(1);
}
return hashedKey;
}
exports.atRulesToString = atRulesToString;
exports.hashPropertyKey = hashPropertyKey;
//# sourceMappingURL=hashPropertyKey.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hashPropertyKey.cjs.js","sources":["../../../../../packages/core/src/runtime/utils/hashPropertyKey.ts"],"sourcesContent":["import hash from '@emotion/hash';\n\nimport type { PropertyHash } from '../../types';\nimport type { AtRules } from './types';\n\nfunction addAtRulePrefix(atRule: string, prefix: string): string {\n return atRule ? prefix + atRule : atRule;\n}\n\nexport function atRulesToString(atRules: AtRules): string {\n return (\n addAtRulePrefix(atRules.container, 'c') +\n addAtRulePrefix(atRules.media, 'm') +\n addAtRulePrefix(atRules.layer, 'l') +\n addAtRulePrefix(atRules.supports, 's')\n );\n}\n\nexport function hashPropertyKey(selector: string, property: string, atRules: AtRules): PropertyHash {\n // uniq key based on property & selector, used for merging later\n const computedKey = selector + atRulesToString(atRules) + property;\n\n // \"key\" can be really long as it includes selectors, we use hashes to reduce sizes of keys\n // \".foo :hover\" => \"abcd\"\n const hashedKey = hash(computedKey);\n\n // As these hashes are used as object keys in build output we should avoid having numbers as a first character to\n // avoid having quotes:\n // {\n // \"1abc\": {}, // we don't want this\n // Aabc: {}, // no quotes\n // }\n const firstCharCode = hashedKey.charCodeAt(0);\n const startsWithNumber = firstCharCode >= 48 && firstCharCode <= 57;\n\n if (startsWithNumber) {\n return String.fromCharCode(firstCharCode + 17) + hashedKey.slice(1);\n }\n\n return hashedKey;\n}\n"],"names":["addAtRulePrefix","atRule","prefix","atRulesToString","atRules","container","media","layer","supports","hashPropertyKey","selector","property","computedKey","hashedKey","hash","firstCharCode","charCodeAt","startsWithNumber","String","fromCharCode","slice"],"mappings":";;;;;;;;AAKA,SAASA,eAAeA,CAACC,MAAc,EAAEC,MAAc,EAAA;AACrD,EAAA,OAAOD,MAAM,GAAGC,MAAM,GAAGD,MAAM,GAAGA,MAAM;AAC1C;AAEM,SAAUE,eAAeA,CAACC,OAAgB,EAAA;AAC9C,EAAA,OACEJ,eAAe,CAACI,OAAO,CAACC,SAAS,EAAE,GAAG,CAAC,GACvCL,eAAe,CAACI,OAAO,CAACE,KAAK,EAAE,GAAG,CAAC,GACnCN,eAAe,CAACI,OAAO,CAACG,KAAK,EAAE,GAAG,CAAC,GACnCP,eAAe,CAACI,OAAO,CAACI,QAAQ,EAAE,GAAG,CAAC;AAE1C;SAEgBC,eAAeA,CAACC,QAAgB,EAAEC,QAAgB,EAAEP,OAAgB,EAAA;AAClF;EACA,MAAMQ,WAAW,GAAGF,QAAQ,GAAGP,eAAe,CAACC,OAAO,CAAC,GAAGO,QAAQ;AAElE;AACA;AACA,EAAA,MAAME,SAAS,GAAGC,2BAAI,CAACF,WAAW,CAAC;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,MAAMG,aAAa,GAAGF,SAAS,CAACG,UAAU,CAAC,CAAC,CAAC;EAC7C,MAAMC,gBAAgB,GAAGF,aAAa,IAAI,EAAE,IAAIA,aAAa,IAAI,EAAE;AAEnE,EAAA,IAAIE,gBAAgB,EAAE;AACpB,IAAA,OAAOC,MAAM,CAACC,YAAY,CAACJ,aAAa,GAAG,EAAE,CAAC,GAAGF,SAAS,CAACO,KAAK,CAAC,CAAC,CAAC;AACrE,EAAA;AAEA,EAAA,OAAOP,SAAS;AAClB;;;;;"}

View File

@@ -0,0 +1,30 @@
import hashString from '@emotion/hash';
function addAtRulePrefix(atRule, prefix) {
return atRule ? prefix + atRule : atRule;
}
function atRulesToString(atRules) {
return addAtRulePrefix(atRules.container, 'c') + addAtRulePrefix(atRules.media, 'm') + addAtRulePrefix(atRules.layer, 'l') + addAtRulePrefix(atRules.supports, 's');
}
function hashPropertyKey(selector, property, atRules) {
// uniq key based on property & selector, used for merging later
const computedKey = selector + atRulesToString(atRules) + property;
// "key" can be really long as it includes selectors, we use hashes to reduce sizes of keys
// ".foo :hover" => "abcd"
const hashedKey = hashString(computedKey);
// As these hashes are used as object keys in build output we should avoid having numbers as a first character to
// avoid having quotes:
// {
// "1abc": {}, // we don't want this
// Aabc: {}, // no quotes
// }
const firstCharCode = hashedKey.charCodeAt(0);
const startsWithNumber = firstCharCode >= 48 && firstCharCode <= 57;
if (startsWithNumber) {
return String.fromCharCode(firstCharCode + 17) + hashedKey.slice(1);
}
return hashedKey;
}
export { atRulesToString, hashPropertyKey };
//# sourceMappingURL=hashPropertyKey.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hashPropertyKey.esm.js","sources":["../../../../../packages/core/src/runtime/utils/hashPropertyKey.ts"],"sourcesContent":["import hash from '@emotion/hash';\n\nimport type { PropertyHash } from '../../types';\nimport type { AtRules } from './types';\n\nfunction addAtRulePrefix(atRule: string, prefix: string): string {\n return atRule ? prefix + atRule : atRule;\n}\n\nexport function atRulesToString(atRules: AtRules): string {\n return (\n addAtRulePrefix(atRules.container, 'c') +\n addAtRulePrefix(atRules.media, 'm') +\n addAtRulePrefix(atRules.layer, 'l') +\n addAtRulePrefix(atRules.supports, 's')\n );\n}\n\nexport function hashPropertyKey(selector: string, property: string, atRules: AtRules): PropertyHash {\n // uniq key based on property & selector, used for merging later\n const computedKey = selector + atRulesToString(atRules) + property;\n\n // \"key\" can be really long as it includes selectors, we use hashes to reduce sizes of keys\n // \".foo :hover\" => \"abcd\"\n const hashedKey = hash(computedKey);\n\n // As these hashes are used as object keys in build output we should avoid having numbers as a first character to\n // avoid having quotes:\n // {\n // \"1abc\": {}, // we don't want this\n // Aabc: {}, // no quotes\n // }\n const firstCharCode = hashedKey.charCodeAt(0);\n const startsWithNumber = firstCharCode >= 48 && firstCharCode <= 57;\n\n if (startsWithNumber) {\n return String.fromCharCode(firstCharCode + 17) + hashedKey.slice(1);\n }\n\n return hashedKey;\n}\n"],"names":["addAtRulePrefix","atRule","prefix","atRulesToString","atRules","container","media","layer","supports","hashPropertyKey","selector","property","computedKey","hashedKey","hash","firstCharCode","charCodeAt","startsWithNumber","String","fromCharCode","slice"],"mappings":";;AAKA,SAASA,eAAeA,CAACC,MAAc,EAAEC,MAAc,EAAA;AACrD,EAAA,OAAOD,MAAM,GAAGC,MAAM,GAAGD,MAAM,GAAGA,MAAM;AAC1C;AAEM,SAAUE,eAAeA,CAACC,OAAgB,EAAA;AAC9C,EAAA,OACEJ,eAAe,CAACI,OAAO,CAACC,SAAS,EAAE,GAAG,CAAC,GACvCL,eAAe,CAACI,OAAO,CAACE,KAAK,EAAE,GAAG,CAAC,GACnCN,eAAe,CAACI,OAAO,CAACG,KAAK,EAAE,GAAG,CAAC,GACnCP,eAAe,CAACI,OAAO,CAACI,QAAQ,EAAE,GAAG,CAAC;AAE1C;SAEgBC,eAAeA,CAACC,QAAgB,EAAEC,QAAgB,EAAEP,OAAgB,EAAA;AAClF;EACA,MAAMQ,WAAW,GAAGF,QAAQ,GAAGP,eAAe,CAACC,OAAO,CAAC,GAAGO,QAAQ;AAElE;AACA;AACA,EAAA,MAAME,SAAS,GAAGC,UAAI,CAACF,WAAW,CAAC;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,MAAMG,aAAa,GAAGF,SAAS,CAACG,UAAU,CAAC,CAAC,CAAC;EAC7C,MAAMC,gBAAgB,GAAGF,aAAa,IAAI,EAAE,IAAIA,aAAa,IAAI,EAAE;AAEnE,EAAA,IAAIE,gBAAgB,EAAE;AACpB,IAAA,OAAOC,MAAM,CAACC,YAAY,CAACJ,aAAa,GAAG,EAAE,CAAC,GAAGF,SAAS,CAACO,KAAK,CAAC,CAAC,CAAC;AACrE,EAAA;AAEA,EAAA,OAAOP,SAAS;AAClB;;;;"}

View File

@@ -0,0 +1,28 @@
'use strict';
var hashString = require('@emotion/hash');
var constants = require('../../constants.cjs.js');
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
var hashString__default = /*#__PURE__*/_interopDefaultCompat(hashString);
function padEndHash(value) {
const hashLength = value.length;
if (hashLength === constants.SEQUENCE_HASH_LENGTH) {
return value;
}
for (let i = hashLength; i < constants.SEQUENCE_HASH_LENGTH; i++) {
value += '0';
}
return value;
}
function hashSequence(classes, dir, sequenceIds = []) {
if (process.env.NODE_ENV === 'production') {
return constants.SEQUENCE_PREFIX + padEndHash(hashString__default.default(classes + dir));
}
return constants.SEQUENCE_PREFIX + padEndHash(hashString__default.default(classes + dir)) + constants.DEBUG_SEQUENCE_SEPARATOR + padEndHash(hashString__default.default(sequenceIds.join('')));
}
exports.hashSequence = hashSequence;
//# sourceMappingURL=hashSequence.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hashSequence.cjs.js","sources":["../../../../../packages/core/src/runtime/utils/hashSequence.ts"],"sourcesContent":["import hash from '@emotion/hash';\n\nimport { DEBUG_SEQUENCE_SEPARATOR, SEQUENCE_HASH_LENGTH, SEQUENCE_PREFIX } from '../../constants';\nimport type { SequenceHash } from '../../types';\n\nfunction padEndHash(value: string): string {\n const hashLength = value.length;\n\n if (hashLength === SEQUENCE_HASH_LENGTH) {\n return value;\n }\n\n for (let i = hashLength; i < SEQUENCE_HASH_LENGTH; i++) {\n value += '0';\n }\n\n return value;\n}\n\nexport function hashSequence(\n classes: string,\n dir: 'ltr' | 'rtl',\n sequenceIds: (SequenceHash | undefined)[] = [],\n): SequenceHash {\n if (process.env.NODE_ENV === 'production') {\n return SEQUENCE_PREFIX + padEndHash(hash(classes + dir));\n }\n\n return (\n SEQUENCE_PREFIX +\n padEndHash(hash(classes + dir)) +\n DEBUG_SEQUENCE_SEPARATOR +\n padEndHash(hash(sequenceIds.join('')))\n );\n}\n"],"names":["padEndHash","value","hashLength","length","SEQUENCE_HASH_LENGTH","i","hashSequence","classes","dir","sequenceIds","process","env","NODE_ENV","SEQUENCE_PREFIX","hash","DEBUG_SEQUENCE_SEPARATOR","join"],"mappings":";;;;;;;;;AAKA,SAASA,UAAUA,CAACC,KAAa,EAAA;AAC/B,EAAA,MAAMC,UAAU,GAAGD,KAAK,CAACE,MAAM;EAE/B,IAAID,UAAU,KAAKE,8BAAoB,EAAE;AACvC,IAAA,OAAOH,KAAK;AACd,EAAA;EAEA,KAAK,IAAII,CAAC,GAAGH,UAAU,EAAEG,CAAC,GAAGD,8BAAoB,EAAEC,CAAC,EAAE,EAAE;AACtDJ,IAAAA,KAAK,IAAI,GAAG;AACd,EAAA;AAEA,EAAA,OAAOA,KAAK;AACd;AAEM,SAAUK,YAAYA,CAC1BC,OAAe,EACfC,GAAkB,EAClBC,cAA4C,EAAE,EAAA;AAE9C,EAAA,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC,OAAOC,yBAAe,GAAGb,UAAU,CAACc,2BAAI,CAACP,OAAO,GAAGC,GAAG,CAAC,CAAC;AAC1D,EAAA;EAEA,OACEK,yBAAe,GACfb,UAAU,CAACc,2BAAI,CAACP,OAAO,GAAGC,GAAG,CAAC,CAAC,GAC/BO,kCAAwB,GACxBf,UAAU,CAACc,2BAAI,CAACL,WAAW,CAACO,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAE1C;;;;"}

View File

@@ -0,0 +1,22 @@
import hashString from '@emotion/hash';
import { SEQUENCE_PREFIX, DEBUG_SEQUENCE_SEPARATOR, SEQUENCE_HASH_LENGTH } from '../../constants.esm.js';
function padEndHash(value) {
const hashLength = value.length;
if (hashLength === SEQUENCE_HASH_LENGTH) {
return value;
}
for (let i = hashLength; i < SEQUENCE_HASH_LENGTH; i++) {
value += '0';
}
return value;
}
function hashSequence(classes, dir, sequenceIds = []) {
if (process.env.NODE_ENV === 'production') {
return SEQUENCE_PREFIX + padEndHash(hashString(classes + dir));
}
return SEQUENCE_PREFIX + padEndHash(hashString(classes + dir)) + DEBUG_SEQUENCE_SEPARATOR + padEndHash(hashString(sequenceIds.join('')));
}
export { hashSequence };
//# sourceMappingURL=hashSequence.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hashSequence.esm.js","sources":["../../../../../packages/core/src/runtime/utils/hashSequence.ts"],"sourcesContent":["import hash from '@emotion/hash';\n\nimport { DEBUG_SEQUENCE_SEPARATOR, SEQUENCE_HASH_LENGTH, SEQUENCE_PREFIX } from '../../constants';\nimport type { SequenceHash } from '../../types';\n\nfunction padEndHash(value: string): string {\n const hashLength = value.length;\n\n if (hashLength === SEQUENCE_HASH_LENGTH) {\n return value;\n }\n\n for (let i = hashLength; i < SEQUENCE_HASH_LENGTH; i++) {\n value += '0';\n }\n\n return value;\n}\n\nexport function hashSequence(\n classes: string,\n dir: 'ltr' | 'rtl',\n sequenceIds: (SequenceHash | undefined)[] = [],\n): SequenceHash {\n if (process.env.NODE_ENV === 'production') {\n return SEQUENCE_PREFIX + padEndHash(hash(classes + dir));\n }\n\n return (\n SEQUENCE_PREFIX +\n padEndHash(hash(classes + dir)) +\n DEBUG_SEQUENCE_SEPARATOR +\n padEndHash(hash(sequenceIds.join('')))\n );\n}\n"],"names":["padEndHash","value","hashLength","length","SEQUENCE_HASH_LENGTH","i","hashSequence","classes","dir","sequenceIds","process","env","NODE_ENV","SEQUENCE_PREFIX","hash","DEBUG_SEQUENCE_SEPARATOR","join"],"mappings":";;;AAKA,SAASA,UAAUA,CAACC,KAAa,EAAA;AAC/B,EAAA,MAAMC,UAAU,GAAGD,KAAK,CAACE,MAAM;EAE/B,IAAID,UAAU,KAAKE,oBAAoB,EAAE;AACvC,IAAA,OAAOH,KAAK;AACd,EAAA;EAEA,KAAK,IAAII,CAAC,GAAGH,UAAU,EAAEG,CAAC,GAAGD,oBAAoB,EAAEC,CAAC,EAAE,EAAE;AACtDJ,IAAAA,KAAK,IAAI,GAAG;AACd,EAAA;AAEA,EAAA,OAAOA,KAAK;AACd;AAEM,SAAUK,YAAYA,CAC1BC,OAAe,EACfC,GAAkB,EAClBC,cAA4C,EAAE,EAAA;AAE9C,EAAA,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC,OAAOC,eAAe,GAAGb,UAAU,CAACc,UAAI,CAACP,OAAO,GAAGC,GAAG,CAAC,CAAC;AAC1D,EAAA;EAEA,OACEK,eAAe,GACfb,UAAU,CAACc,UAAI,CAACP,OAAO,GAAGC,GAAG,CAAC,CAAC,GAC/BO,wBAAwB,GACxBf,UAAU,CAACc,UAAI,CAACL,WAAW,CAACO,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAE1C;;;;"}

View File

@@ -0,0 +1,21 @@
'use strict';
const uppercasePattern = /[A-Z]/g;
const msPattern = /^ms-/;
const cache = {};
function toHyphenLower(match) {
return '-' + match.toLowerCase();
}
function hyphenateProperty(name) {
if (Object.prototype.hasOwnProperty.call(cache, name)) {
return cache[name];
}
if (name.substr(0, 2) === '--') {
return name;
}
const hName = name.replace(uppercasePattern, toHyphenLower);
return cache[name] = msPattern.test(hName) ? '-' + hName : hName;
}
exports.hyphenateProperty = hyphenateProperty;
//# sourceMappingURL=hyphenateProperty.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hyphenateProperty.cjs.js","sources":["../../../../../packages/core/src/runtime/utils/hyphenateProperty.ts"],"sourcesContent":["const uppercasePattern = /[A-Z]/g;\nconst msPattern = /^ms-/;\nconst cache: Record<string, string> = {};\n\nfunction toHyphenLower(match: string): string {\n return '-' + match.toLowerCase();\n}\n\nexport function hyphenateProperty(name: string): string {\n if (Object.prototype.hasOwnProperty.call(cache, name)) {\n return cache[name];\n }\n\n if (name.substr(0, 2) === '--') {\n return name;\n }\n\n const hName = name.replace(uppercasePattern, toHyphenLower);\n return (cache[name] = msPattern.test(hName) ? '-' + hName : hName);\n}\n"],"names":["uppercasePattern","msPattern","cache","toHyphenLower","match","toLowerCase","hyphenateProperty","name","Object","prototype","hasOwnProperty","call","substr","hName","replace","test"],"mappings":";;AAAA,MAAMA,gBAAgB,GAAG,QAAQ;AACjC,MAAMC,SAAS,GAAG,MAAM;AACxB,MAAMC,KAAK,GAA2B,EAAE;AAExC,SAASC,aAAaA,CAACC,KAAa,EAAA;AAClC,EAAA,OAAO,GAAG,GAAGA,KAAK,CAACC,WAAW,EAAE;AAClC;AAEM,SAAUC,iBAAiBA,CAACC,IAAY,EAAA;AAC5C,EAAA,IAAIC,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACT,KAAK,EAAEK,IAAI,CAAC,EAAE;IACrD,OAAOL,KAAK,CAACK,IAAI,CAAC;AACpB,EAAA;EAEA,IAAIA,IAAI,CAACK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE;AAC9B,IAAA,OAAOL,IAAI;AACb,EAAA;EAEA,MAAMM,KAAK,GAAGN,IAAI,CAACO,OAAO,CAACd,gBAAgB,EAAEG,aAAa,CAAC;AAC3D,EAAA,OAAQD,KAAK,CAACK,IAAI,CAAC,GAAGN,SAAS,CAACc,IAAI,CAACF,KAAK,CAAC,GAAG,GAAG,GAAGA,KAAK,GAAGA,KAAK;AACnE;;;;"}

View File

@@ -0,0 +1,19 @@
const uppercasePattern = /[A-Z]/g;
const msPattern = /^ms-/;
const cache = {};
function toHyphenLower(match) {
return '-' + match.toLowerCase();
}
function hyphenateProperty(name) {
if (Object.prototype.hasOwnProperty.call(cache, name)) {
return cache[name];
}
if (name.substr(0, 2) === '--') {
return name;
}
const hName = name.replace(uppercasePattern, toHyphenLower);
return cache[name] = msPattern.test(hName) ? '-' + hName : hName;
}
export { hyphenateProperty };
//# sourceMappingURL=hyphenateProperty.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hyphenateProperty.esm.js","sources":["../../../../../packages/core/src/runtime/utils/hyphenateProperty.ts"],"sourcesContent":["const uppercasePattern = /[A-Z]/g;\nconst msPattern = /^ms-/;\nconst cache: Record<string, string> = {};\n\nfunction toHyphenLower(match: string): string {\n return '-' + match.toLowerCase();\n}\n\nexport function hyphenateProperty(name: string): string {\n if (Object.prototype.hasOwnProperty.call(cache, name)) {\n return cache[name];\n }\n\n if (name.substr(0, 2) === '--') {\n return name;\n }\n\n const hName = name.replace(uppercasePattern, toHyphenLower);\n return (cache[name] = msPattern.test(hName) ? '-' + hName : hName);\n}\n"],"names":["uppercasePattern","msPattern","cache","toHyphenLower","match","toLowerCase","hyphenateProperty","name","Object","prototype","hasOwnProperty","call","substr","hName","replace","test"],"mappings":"AAAA,MAAMA,gBAAgB,GAAG,QAAQ;AACjC,MAAMC,SAAS,GAAG,MAAM;AACxB,MAAMC,KAAK,GAA2B,EAAE;AAExC,SAASC,aAAaA,CAACC,KAAa,EAAA;AAClC,EAAA,OAAO,GAAG,GAAGA,KAAK,CAACC,WAAW,EAAE;AAClC;AAEM,SAAUC,iBAAiBA,CAACC,IAAY,EAAA;AAC5C,EAAA,IAAIC,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACT,KAAK,EAAEK,IAAI,CAAC,EAAE;IACrD,OAAOL,KAAK,CAACK,IAAI,CAAC;AACpB,EAAA;EAEA,IAAIA,IAAI,CAACK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE;AAC9B,IAAA,OAAOL,IAAI;AACb,EAAA;EAEA,MAAMM,KAAK,GAAGN,IAAI,CAACO,OAAO,CAACd,gBAAgB,EAAEG,aAAa,CAAC;AAC3D,EAAA,OAAQD,KAAK,CAACK,IAAI,CAAC,GAAGN,SAAS,CAACc,IAAI,CAACF,KAAK,CAAC,GAAG,GAAG,GAAGA,KAAK,GAAGA,KAAK;AACnE;;;;"}

View File

@@ -0,0 +1,8 @@
'use strict';
function isContainerQuerySelector(property) {
return property.substring(0, 10) === '@container';
}
exports.isContainerQuerySelector = isContainerQuerySelector;
//# sourceMappingURL=isContainerQuerySelector.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isContainerQuerySelector.cjs.js","sources":["../../../../../packages/core/src/runtime/utils/isContainerQuerySelector.ts"],"sourcesContent":["export function isContainerQuerySelector(property: string): boolean {\n return property.substring(0, 10) === '@container';\n}\n"],"names":["isContainerQuerySelector","property","substring"],"mappings":";;AAAM,SAAUA,wBAAwBA,CAACC,QAAgB,EAAA;EACvD,OAAOA,QAAQ,CAACC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,YAAY;AACnD;;;;"}

View File

@@ -0,0 +1,6 @@
function isContainerQuerySelector(property) {
return property.substring(0, 10) === '@container';
}
export { isContainerQuerySelector };
//# sourceMappingURL=isContainerQuerySelector.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isContainerQuerySelector.esm.js","sources":["../../../../../packages/core/src/runtime/utils/isContainerQuerySelector.ts"],"sourcesContent":["export function isContainerQuerySelector(property: string): boolean {\n return property.substring(0, 10) === '@container';\n}\n"],"names":["isContainerQuerySelector","property","substring"],"mappings":"AAAM,SAAUA,wBAAwBA,CAACC,QAAgB,EAAA;EACvD,OAAOA,QAAQ,CAACC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,YAAY;AACnD;;;;"}

View File

@@ -0,0 +1,8 @@
'use strict';
function isLayerSelector(property) {
return property.substr(0, 6) === '@layer';
}
exports.isLayerSelector = isLayerSelector;
//# sourceMappingURL=isLayerSelector.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isLayerSelector.cjs.js","sources":["../../../../../packages/core/src/runtime/utils/isLayerSelector.ts"],"sourcesContent":["export function isLayerSelector(property: string): boolean {\n return property.substr(0, 6) === '@layer';\n}\n"],"names":["isLayerSelector","property","substr"],"mappings":";;AAAM,SAAUA,eAAeA,CAACC,QAAgB,EAAA;EAC9C,OAAOA,QAAQ,CAACC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,QAAQ;AAC3C;;;;"}

View File

@@ -0,0 +1,6 @@
function isLayerSelector(property) {
return property.substr(0, 6) === '@layer';
}
export { isLayerSelector };
//# sourceMappingURL=isLayerSelector.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isLayerSelector.esm.js","sources":["../../../../../packages/core/src/runtime/utils/isLayerSelector.ts"],"sourcesContent":["export function isLayerSelector(property: string): boolean {\n return property.substr(0, 6) === '@layer';\n}\n"],"names":["isLayerSelector","property","substr"],"mappings":"AAAM,SAAUA,eAAeA,CAACC,QAAgB,EAAA;EAC9C,OAAOA,QAAQ,CAACC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,QAAQ;AAC3C;;;;"}

View File

@@ -0,0 +1,8 @@
'use strict';
function isMediaQuerySelector(property) {
return property.substr(0, 6) === '@media';
}
exports.isMediaQuerySelector = isMediaQuerySelector;
//# sourceMappingURL=isMediaQuerySelector.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isMediaQuerySelector.cjs.js","sources":["../../../../../packages/core/src/runtime/utils/isMediaQuerySelector.ts"],"sourcesContent":["export function isMediaQuerySelector(property: string): boolean {\n return property.substr(0, 6) === '@media';\n}\n"],"names":["isMediaQuerySelector","property","substr"],"mappings":";;AAAM,SAAUA,oBAAoBA,CAACC,QAAgB,EAAA;EACnD,OAAOA,QAAQ,CAACC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,QAAQ;AAC3C;;;;"}

View File

@@ -0,0 +1,6 @@
function isMediaQuerySelector(property) {
return property.substr(0, 6) === '@media';
}
export { isMediaQuerySelector };
//# sourceMappingURL=isMediaQuerySelector.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isMediaQuerySelector.esm.js","sources":["../../../../../packages/core/src/runtime/utils/isMediaQuerySelector.ts"],"sourcesContent":["export function isMediaQuerySelector(property: string): boolean {\n return property.substr(0, 6) === '@media';\n}\n"],"names":["isMediaQuerySelector","property","substr"],"mappings":"AAAM,SAAUA,oBAAoBA,CAACC,QAAgB,EAAA;EACnD,OAAOA,QAAQ,CAACC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,QAAQ;AAC3C;;;;"}

Some files were not shown because too many files have changed in this diff Show More