@tenphi/tasty 3.9.6 → 3.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/chunks/{build-config-DB-9eGX_.js → build-config-iyzPTrZa.js} +4 -4
  2. package/dist/chunks/{build-config-DB-9eGX_.js.map → build-config-iyzPTrZa.js.map} +1 -1
  3. package/dist/chunks/{collector-mNzcxM8C.js → collector-C4ouIOgI.js} +4 -4
  4. package/dist/chunks/{collector-mNzcxM8C.js.map → collector-C4ouIOgI.js.map} +1 -1
  5. package/dist/chunks/{config-engine-B8UiiDM4.js → config-engine-BAldIMv7.js} +3 -3
  6. package/dist/chunks/{config-engine-B8UiiDM4.js.map → config-engine-BAldIMv7.js.map} +1 -1
  7. package/dist/chunks/{css-definitions-BuuRO6lZ.js → css-definitions-BIgGXRLz.js} +2 -2
  8. package/dist/chunks/{css-definitions-BuuRO6lZ.js.map → css-definitions-BIgGXRLz.js.map} +1 -1
  9. package/dist/chunks/{debug-ly4pmDts.js → debug-CUDFFYpM.js} +4 -4
  10. package/dist/chunks/{debug-ly4pmDts.js.map → debug-CUDFFYpM.js.map} +1 -1
  11. package/dist/chunks/{react-runtime-CSae5AVk.js → react-runtime-46TyXx9v.js} +4 -4
  12. package/dist/chunks/react-runtime-46TyXx9v.js.map +1 -0
  13. package/dist/chunks/{runtime-engine-W-Xescje.js → runtime-engine-B_4lx2DJ.js} +7 -37
  14. package/dist/chunks/runtime-engine-B_4lx2DJ.js.map +1 -0
  15. package/dist/chunks/{runtime-state-naRtKzmd.js → runtime-state-BMtykrat.js} +2 -2
  16. package/dist/chunks/{runtime-state-naRtKzmd.js.map → runtime-state-BMtykrat.js.map} +1 -1
  17. package/dist/chunks/{style-engine-CuWAOWn0.js → style-engine-BpgmapBp.js} +57 -12
  18. package/dist/chunks/style-engine-BpgmapBp.js.map +1 -0
  19. package/dist/chunks/{zero-engine-BHLB88ki.js → zero-engine-DcjMs3WX.js} +3 -3
  20. package/dist/chunks/{zero-engine-BHLB88ki.js.map → zero-engine-DcjMs3WX.js.map} +1 -1
  21. package/dist/core/index.d.ts +1 -1
  22. package/dist/core/index.js +6 -6
  23. package/dist/{index-CmrdZ8ay.d.ts → index-lhkF3ln5.d.ts} +6 -6
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +7 -7
  26. package/dist/ssr/astro.js +2 -2
  27. package/dist/ssr/index.js +2 -2
  28. package/dist/ssr/next-config.js +3 -3
  29. package/dist/ssr/next.js +3 -3
  30. package/dist/zero/babel.js +4 -4
  31. package/dist/zero/index.js +1 -1
  32. package/docs/ai-agents.md +2 -0
  33. package/docs/configuration.md +17 -1
  34. package/docs/dsl.md +20 -0
  35. package/docs/react-api.md +2 -0
  36. package/package.json +1 -1
  37. package/dist/chunks/react-runtime-CSae5AVk.js.map +0 -1
  38. package/dist/chunks/runtime-engine-W-Xescje.js.map +0 -1
  39. package/dist/chunks/style-engine-CuWAOWn0.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { L as DEFAULT_PROPERTIES } from "./css-definitions-BuuRO6lZ.js";
1
+ import { L as DEFAULT_PROPERTIES } from "./css-definitions-BIgGXRLz.js";
2
2
  //#region src/config-resources.ts
3
3
  let runtimeConfig = null;
4
4
  let globalFontFace = null;
@@ -124,4 +124,4 @@ function getRegisteredSSRCollector() {
124
124
  //#endregion
125
125
  export { resetConfigResources as _, getGlobalConfigTokens as a, getGlobalFunctions as c, mergeGlobalConfigTokens as d, mergeGlobalCounterStyles as f, mergeGlobalStyles as g, mergeGlobalProperties as h, getEffectiveProperties as i, getGlobalStyles as l, mergeGlobalFunctions as m, registerSSRCollectorGetter as n, getGlobalCounterStyles as o, mergeGlobalFontFaces as p, registerSSRCollectorGetterGlobal as r, getGlobalFontFaces as s, getRegisteredSSRCollector as t, getRuntimeConfigState as u, setRuntimeConfigState as v };
126
126
 
127
- //# sourceMappingURL=runtime-state-naRtKzmd.js.map
127
+ //# sourceMappingURL=runtime-state-BMtykrat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-state-naRtKzmd.js","names":[],"sources":["../../src/config-resources.ts","../../src/ssr/ssr-collector-ref.ts"],"sourcesContent":["/**\n * DOM-free storage for configured CSS resources shared by the browser runtime\n * and server collectors.\n *\n * Astro can evaluate middleware and application code in separate module\n * graphs, so resources used by SSR are mirrored on globalThis. Keeping this\n * state outside config.ts lets server-only entrypoints read it without loading\n * StyleInjector and the rest of the browser runtime.\n */\n\nimport type {\n CounterStyleDescriptors,\n FontFaceInput,\n FunctionDefinition,\n PropertyDefinition,\n} from './injector/types';\nimport { DEFAULT_PROPERTIES } from './properties/defaults';\nimport type { ConfigTokens, Styles } from './styles/types';\n\ninterface RuntimeConfigState {\n namePrefix?: string;\n nonce?: string;\n}\n\nlet runtimeConfig: RuntimeConfigState | null = null;\nlet globalFontFace: Record<string, FontFaceInput> | null = null;\nlet globalCounterStyle: Record<string, CounterStyleDescriptors> | null = null;\nlet globalFunction: Record<string, FunctionDefinition> | null = null;\nlet globalProperties: Record<string, PropertyDefinition> | null = null;\nlet globalConfigTokens: ConfigTokens | null = null;\nlet globalStyles: Record<string, Styles> | null = null;\n\nconst GTKEY_TOKENS = '__tasty_cfg_tokens__';\nconst GTKEY_FONT_FACE = '__tasty_cfg_font_face__';\nconst GTKEY_COUNTER_STYLE = '__tasty_cfg_counter_style__';\nconst GTKEY_FUNCTION = '__tasty_cfg_function__';\nconst GTKEY_PROPERTIES = '__tasty_cfg_properties__';\nconst GTKEY_GLOBAL_STYLES = '__tasty_cfg_global_styles__';\n\nfunction setOnGlobalThis(key: string, value: unknown): void {\n (globalThis as Record<string, unknown>)[key] = value;\n}\n\nfunction getFromGlobalThis<T>(key: string): T | undefined {\n return (globalThis as Record<string, unknown>)[key] as T | undefined;\n}\n\nexport function getRuntimeConfigState(): RuntimeConfigState | null {\n return runtimeConfig;\n}\n\nexport function setRuntimeConfigState(config: RuntimeConfigState): void {\n runtimeConfig = config;\n}\n\nexport function getEffectiveProperties(): Record<string, PropertyDefinition> {\n const properties =\n globalProperties ??\n getFromGlobalThis<Record<string, PropertyDefinition>>(GTKEY_PROPERTIES);\n return properties\n ? { ...DEFAULT_PROPERTIES, ...properties }\n : DEFAULT_PROPERTIES;\n}\n\nexport function getGlobalFontFaces(): Record<string, FontFaceInput> | null {\n return (\n globalFontFace ??\n getFromGlobalThis<Record<string, FontFaceInput>>(GTKEY_FONT_FACE) ??\n null\n );\n}\n\nexport function getGlobalCounterStyles(): Record<\n string,\n CounterStyleDescriptors\n> | null {\n return (\n globalCounterStyle ??\n getFromGlobalThis<Record<string, CounterStyleDescriptors>>(\n GTKEY_COUNTER_STYLE,\n ) ??\n null\n );\n}\n\nexport function getGlobalFunctions(): Record<\n string,\n FunctionDefinition\n> | null {\n return (\n globalFunction ??\n getFromGlobalThis<Record<string, FunctionDefinition>>(GTKEY_FUNCTION) ??\n null\n );\n}\n\nexport function getGlobalConfigTokens(): ConfigTokens | null {\n return (\n globalConfigTokens ?? getFromGlobalThis<ConfigTokens>(GTKEY_TOKENS) ?? null\n );\n}\n\nexport function getGlobalStyles(): Record<string, Styles> | null {\n return (\n globalStyles ??\n getFromGlobalThis<Record<string, Styles>>(GTKEY_GLOBAL_STYLES) ??\n null\n );\n}\n\nexport function mergeGlobalProperties(\n properties: Record<string, PropertyDefinition>,\n): void {\n globalProperties = {\n ...(globalProperties ?? getFromGlobalThis(GTKEY_PROPERTIES) ?? {}),\n ...properties,\n };\n setOnGlobalThis(GTKEY_PROPERTIES, globalProperties);\n}\n\nexport function mergeGlobalFontFaces(\n fontFaces: Record<string, FontFaceInput>,\n): void {\n globalFontFace = { ...(getGlobalFontFaces() ?? {}), ...fontFaces };\n setOnGlobalThis(GTKEY_FONT_FACE, globalFontFace);\n}\n\nexport function mergeGlobalCounterStyles(\n counterStyles: Record<string, CounterStyleDescriptors>,\n): void {\n globalCounterStyle = {\n ...(getGlobalCounterStyles() ?? {}),\n ...counterStyles,\n };\n setOnGlobalThis(GTKEY_COUNTER_STYLE, globalCounterStyle);\n}\n\nexport function mergeGlobalFunctions(\n functions: Record<string, FunctionDefinition>,\n): void {\n globalFunction = { ...(getGlobalFunctions() ?? {}), ...functions };\n setOnGlobalThis(GTKEY_FUNCTION, globalFunction);\n}\n\nexport function mergeGlobalConfigTokens(styles: ConfigTokens): void {\n globalConfigTokens = globalConfigTokens\n ? { ...globalConfigTokens, ...styles }\n : styles;\n setOnGlobalThis(GTKEY_TOKENS, globalConfigTokens);\n}\n\nexport function mergeGlobalStyles(styles: Record<string, Styles>): void {\n if (globalStyles) {\n for (const [selector, selectorStyles] of Object.entries(styles)) {\n globalStyles[selector] = globalStyles[selector]\n ? { ...globalStyles[selector], ...selectorStyles }\n : selectorStyles;\n }\n } else {\n globalStyles = { ...styles };\n }\n setOnGlobalThis(GTKEY_GLOBAL_STYLES, globalStyles);\n}\n\nexport function resetConfigResources(): void {\n runtimeConfig = null;\n globalProperties = null;\n globalFontFace = null;\n globalCounterStyle = null;\n globalFunction = null;\n globalConfigTokens = null;\n globalStyles = null;\n\n const globalState = globalThis as Record<string, unknown>;\n delete globalState[GTKEY_TOKENS];\n delete globalState[GTKEY_FONT_FACE];\n delete globalState[GTKEY_COUNTER_STYLE];\n delete globalState[GTKEY_FUNCTION];\n delete globalState[GTKEY_PROPERTIES];\n delete globalState[GTKEY_GLOBAL_STYLES];\n}\n","/**\n * Global reference to the SSR collector getter function.\n *\n * This indirection avoids importing 'node:async_hooks' in the browser bundle.\n * The SSR entry point sets this ref when loaded on the server. The useStyles\n * hook calls it if set; on the client it stays null and is never called.\n *\n * Uses a module-level variable as the primary mechanism. In Next.js App\n * Router the RSC and SSR module graphs load separate copies of this module,\n * so the getter registered by TastyRegistry (SSR layer) is invisible to\n * server components (RSC layer) — which correctly fall through to inline\n * RSC styles.\n *\n * A globalThis fallback (`registerSSRCollectorGetterGlobal`) is provided\n * for frameworks like Astro where middleware and page components live in\n * different module graphs and must share the getter across them.\n */\n\nimport type { ServerStyleCollector } from './collector';\n\ntype SSRCollectorGetter = () => ServerStyleCollector | null;\n\nconst GETTER_KEY = '__tasty_ssr_collector_getter__';\n\nlet _getSSRCollector: SSRCollectorGetter | null = null;\n\n/**\n * Register the collector getter in the current module graph only.\n * Used by Next.js TastyRegistry.\n */\nexport function registerSSRCollectorGetter(fn: SSRCollectorGetter): void {\n _getSSRCollector = fn;\n}\n\n/**\n * Register the collector getter on globalThis so it is visible across\n * separate module graphs (e.g. Astro middleware ↔ page components).\n */\nexport function registerSSRCollectorGetterGlobal(fn: SSRCollectorGetter): void {\n (globalThis as Record<string, unknown>)[GETTER_KEY] = fn;\n}\n\n/**\n * Retrieve the SSR collector: module-level first, globalThis fallback.\n */\nexport function getRegisteredSSRCollector(): ServerStyleCollector | null {\n if (_getSSRCollector) return _getSSRCollector();\n const getter = (globalThis as Record<string, unknown>)[GETTER_KEY] as\n SSRCollectorGetter | undefined;\n return getter ? getter() : null;\n}\n"],"mappings":";;AAwBA,IAAI,gBAA2C;AAC/C,IAAI,iBAAuD;AAC3D,IAAI,qBAAqE;AACzE,IAAI,iBAA4D;AAChE,IAAI,mBAA8D;AAClE,IAAI,qBAA0C;AAC9C,IAAI,eAA8C;AAElD,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,sBAAsB;AAC5B,MAAM,iBAAiB;AACvB,MAAM,mBAAmB;AACzB,MAAM,sBAAsB;AAE5B,SAAS,gBAAgB,KAAa,OAAsB;CAC1D,WAAwC,OAAO;AACjD;AAEA,SAAS,kBAAqB,KAA4B;CACxD,OAAQ,WAAuC;AACjD;AAEA,SAAgB,wBAAmD;CACjE,OAAO;AACT;AAEA,SAAgB,sBAAsB,QAAkC;CACtE,gBAAgB;AAClB;AAEA,SAAgB,yBAA6D;CAC3E,MAAM,aACJ,oBACA,kBAAsD,gBAAgB;CACxE,OAAO,aACH;EAAE,GAAG;EAAoB,GAAG;CAAW,IACvC;AACN;AAEA,SAAgB,qBAA2D;CACzE,OACE,k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CACjB,qBAAqB;CACrB,iBAAiB;CACjB,qBAAqB;CACrB,eAAe;CAEf,MAAM,cAAc;CACpB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;AACrB;;;AC9JA,MAAM,aAAa;AAEnB,IAAI,mBAA8C;AAMlD,SAAgB,2BAA2B,IAA8B;CACvE,mBAAmB;AACrB;AAMA,SAAgB,iCAAiC,IAA8B;CAC7E,WAAwC,cAAc;AACxD;AAKA,SAAgB,4BAAyD;CACvE,IAAI,kBAAkB,OAAO,iBAAiB;CAC9C,MAAM,SAAU,WAAuC;CAEvD,OAAO,SAAS,OAAO,IAAI;AAC7B"}
1
+ {"version":3,"file":"runtime-state-BMtykrat.js","names":[],"sources":["../../src/config-resources.ts","../../src/ssr/ssr-collector-ref.ts"],"sourcesContent":["/**\n * DOM-free storage for configured CSS resources shared by the browser runtime\n * and server collectors.\n *\n * Astro can evaluate middleware and application code in separate module\n * graphs, so resources used by SSR are mirrored on globalThis. Keeping this\n * state outside config.ts lets server-only entrypoints read it without loading\n * StyleInjector and the rest of the browser runtime.\n */\n\nimport type {\n CounterStyleDescriptors,\n FontFaceInput,\n FunctionDefinition,\n PropertyDefinition,\n} from './injector/types';\nimport { DEFAULT_PROPERTIES } from './properties/defaults';\nimport type { ConfigTokens, Styles } from './styles/types';\n\ninterface RuntimeConfigState {\n namePrefix?: string;\n nonce?: string;\n}\n\nlet runtimeConfig: RuntimeConfigState | null = null;\nlet globalFontFace: Record<string, FontFaceInput> | null = null;\nlet globalCounterStyle: Record<string, CounterStyleDescriptors> | null = null;\nlet globalFunction: Record<string, FunctionDefinition> | null = null;\nlet globalProperties: Record<string, PropertyDefinition> | null = null;\nlet globalConfigTokens: ConfigTokens | null = null;\nlet globalStyles: Record<string, Styles> | null = null;\n\nconst GTKEY_TOKENS = '__tasty_cfg_tokens__';\nconst GTKEY_FONT_FACE = '__tasty_cfg_font_face__';\nconst GTKEY_COUNTER_STYLE = '__tasty_cfg_counter_style__';\nconst GTKEY_FUNCTION = '__tasty_cfg_function__';\nconst GTKEY_PROPERTIES = '__tasty_cfg_properties__';\nconst GTKEY_GLOBAL_STYLES = '__tasty_cfg_global_styles__';\n\nfunction setOnGlobalThis(key: string, value: unknown): void {\n (globalThis as Record<string, unknown>)[key] = value;\n}\n\nfunction getFromGlobalThis<T>(key: string): T | undefined {\n return (globalThis as Record<string, unknown>)[key] as T | undefined;\n}\n\nexport function getRuntimeConfigState(): RuntimeConfigState | null {\n return runtimeConfig;\n}\n\nexport function setRuntimeConfigState(config: RuntimeConfigState): void {\n runtimeConfig = config;\n}\n\nexport function getEffectiveProperties(): Record<string, PropertyDefinition> {\n const properties =\n globalProperties ??\n getFromGlobalThis<Record<string, PropertyDefinition>>(GTKEY_PROPERTIES);\n return properties\n ? { ...DEFAULT_PROPERTIES, ...properties }\n : DEFAULT_PROPERTIES;\n}\n\nexport function getGlobalFontFaces(): Record<string, FontFaceInput> | null {\n return (\n globalFontFace ??\n getFromGlobalThis<Record<string, FontFaceInput>>(GTKEY_FONT_FACE) ??\n null\n );\n}\n\nexport function getGlobalCounterStyles(): Record<\n string,\n CounterStyleDescriptors\n> | null {\n return (\n globalCounterStyle ??\n getFromGlobalThis<Record<string, CounterStyleDescriptors>>(\n GTKEY_COUNTER_STYLE,\n ) ??\n null\n );\n}\n\nexport function getGlobalFunctions(): Record<\n string,\n FunctionDefinition\n> | null {\n return (\n globalFunction ??\n getFromGlobalThis<Record<string, FunctionDefinition>>(GTKEY_FUNCTION) ??\n null\n );\n}\n\nexport function getGlobalConfigTokens(): ConfigTokens | null {\n return (\n globalConfigTokens ?? getFromGlobalThis<ConfigTokens>(GTKEY_TOKENS) ?? null\n );\n}\n\nexport function getGlobalStyles(): Record<string, Styles> | null {\n return (\n globalStyles ??\n getFromGlobalThis<Record<string, Styles>>(GTKEY_GLOBAL_STYLES) ??\n null\n );\n}\n\nexport function mergeGlobalProperties(\n properties: Record<string, PropertyDefinition>,\n): void {\n globalProperties = {\n ...(globalProperties ?? getFromGlobalThis(GTKEY_PROPERTIES) ?? {}),\n ...properties,\n };\n setOnGlobalThis(GTKEY_PROPERTIES, globalProperties);\n}\n\nexport function mergeGlobalFontFaces(\n fontFaces: Record<string, FontFaceInput>,\n): void {\n globalFontFace = { ...(getGlobalFontFaces() ?? {}), ...fontFaces };\n setOnGlobalThis(GTKEY_FONT_FACE, globalFontFace);\n}\n\nexport function mergeGlobalCounterStyles(\n counterStyles: Record<string, CounterStyleDescriptors>,\n): void {\n globalCounterStyle = {\n ...(getGlobalCounterStyles() ?? {}),\n ...counterStyles,\n };\n setOnGlobalThis(GTKEY_COUNTER_STYLE, globalCounterStyle);\n}\n\nexport function mergeGlobalFunctions(\n functions: Record<string, FunctionDefinition>,\n): void {\n globalFunction = { ...(getGlobalFunctions() ?? {}), ...functions };\n setOnGlobalThis(GTKEY_FUNCTION, globalFunction);\n}\n\nexport function mergeGlobalConfigTokens(styles: ConfigTokens): void {\n globalConfigTokens = globalConfigTokens\n ? { ...globalConfigTokens, ...styles }\n : styles;\n setOnGlobalThis(GTKEY_TOKENS, globalConfigTokens);\n}\n\nexport function mergeGlobalStyles(styles: Record<string, Styles>): void {\n if (globalStyles) {\n for (const [selector, selectorStyles] of Object.entries(styles)) {\n globalStyles[selector] = globalStyles[selector]\n ? { ...globalStyles[selector], ...selectorStyles }\n : selectorStyles;\n }\n } else {\n globalStyles = { ...styles };\n }\n setOnGlobalThis(GTKEY_GLOBAL_STYLES, globalStyles);\n}\n\nexport function resetConfigResources(): void {\n runtimeConfig = null;\n globalProperties = null;\n globalFontFace = null;\n globalCounterStyle = null;\n globalFunction = null;\n globalConfigTokens = null;\n globalStyles = null;\n\n const globalState = globalThis as Record<string, unknown>;\n delete globalState[GTKEY_TOKENS];\n delete globalState[GTKEY_FONT_FACE];\n delete globalState[GTKEY_COUNTER_STYLE];\n delete globalState[GTKEY_FUNCTION];\n delete globalState[GTKEY_PROPERTIES];\n delete globalState[GTKEY_GLOBAL_STYLES];\n}\n","/**\n * Global reference to the SSR collector getter function.\n *\n * This indirection avoids importing 'node:async_hooks' in the browser bundle.\n * The SSR entry point sets this ref when loaded on the server. The useStyles\n * hook calls it if set; on the client it stays null and is never called.\n *\n * Uses a module-level variable as the primary mechanism. In Next.js App\n * Router the RSC and SSR module graphs load separate copies of this module,\n * so the getter registered by TastyRegistry (SSR layer) is invisible to\n * server components (RSC layer) — which correctly fall through to inline\n * RSC styles.\n *\n * A globalThis fallback (`registerSSRCollectorGetterGlobal`) is provided\n * for frameworks like Astro where middleware and page components live in\n * different module graphs and must share the getter across them.\n */\n\nimport type { ServerStyleCollector } from './collector';\n\ntype SSRCollectorGetter = () => ServerStyleCollector | null;\n\nconst GETTER_KEY = '__tasty_ssr_collector_getter__';\n\nlet _getSSRCollector: SSRCollectorGetter | null = null;\n\n/**\n * Register the collector getter in the current module graph only.\n * Used by Next.js TastyRegistry.\n */\nexport function registerSSRCollectorGetter(fn: SSRCollectorGetter): void {\n _getSSRCollector = fn;\n}\n\n/**\n * Register the collector getter on globalThis so it is visible across\n * separate module graphs (e.g. Astro middleware ↔ page components).\n */\nexport function registerSSRCollectorGetterGlobal(fn: SSRCollectorGetter): void {\n (globalThis as Record<string, unknown>)[GETTER_KEY] = fn;\n}\n\n/**\n * Retrieve the SSR collector: module-level first, globalThis fallback.\n */\nexport function getRegisteredSSRCollector(): ServerStyleCollector | null {\n if (_getSSRCollector) return _getSSRCollector();\n const getter = (globalThis as Record<string, unknown>)[GETTER_KEY] as\n SSRCollectorGetter | undefined;\n return getter ? getter() : null;\n}\n"],"mappings":";;AAwBA,IAAI,gBAA2C;AAC/C,IAAI,iBAAuD;AAC3D,IAAI,qBAAqE;AACzE,IAAI,iBAA4D;AAChE,IAAI,mBAA8D;AAClE,IAAI,qBAA0C;AAC9C,IAAI,eAA8C;AAElD,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,sBAA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AEA,SAAgB,wBAAwB,QAA4B;CAClE,qBAAqB,qBACjB;EAAE,GAAG;EAAoB,GAAG;CAAO,IACnC;CACJ,gBAAgB,cAAc,kBAAkB;AAClD;AAEA,SAAgB,kBAAkB,QAAsC;CACtE,IAAI,cACF,KAAK,MAAM,CAAC,UAAU,mBAAmB,OAAO,QAAQ,MAAM,GAC5D,aAAa,YAAY,aAAa,YAClC;EAAE,GAAG,aAAa;EAAW,GAAG;CAAe,IAC/C;MAGN,eAAe,EAAE,GAAG,OAAO;CAE7B,gBAAgB,qBAAqB,YAAY;AACnD;AAEA,SAAgB,uBAA6B;CAC3C,gBAAgB;CAChB,mBAAmB;CACnB,iBAAiB;CACjB,qBAAqB;CACrB,iBAAiB;CACjB,qBAAqB;CACrB,eAAe;CAEf,MAAM,cAAc;CACpB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;AACrB;;;AC9JA,MAAM,aAAa;AAEnB,IAAI,mBAA8C;AAMlD,SAAgB,2BAA2B,IAA8B;CACvE,mBAAmB;AACrB;AAMA,SAAgB,iCAAiC,IAA8B;CAC7E,WAAwC,cAAc;AACxD;AAKA,SAAgB,4BAAyD;CACvE,IAAI,kBAAkB,OAAO,iBAAiB;CAC9C,MAAM,SAAU,WAAuC;CAEvD,OAAO,SAAS,OAAO,IAAI;AAC7B"}
@@ -1320,8 +1320,7 @@ function presetStyle({ preset, fontSize, lineHeight, textTransform, letterSpacin
1320
1320
  if (letterSpacingVal) styles["letter-spacing"] = letterSpacingVal;
1321
1321
  const fontWeightVal = toCSS(fontWeight, false);
1322
1322
  if (fontWeightVal) styles["font-weight"] = fontWeightVal;
1323
- if (fontStyle != null) if (fontStyle === true) styles["font-style"] = "italic";
1324
- else if (typeof fontStyle === "string" && CSS_WIDE_KEYWORDS.has(fontStyle)) styles["font-style"] = fontStyle;
1323
+ if (fontStyle != null) if (typeof fontStyle === "string") styles["font-style"] = resolveCustomProperties(fontStyle);
1325
1324
  else styles["font-style"] = fontStyle ? "italic" : "normal";
1326
1325
  if (textTransform) styles["text-transform"] = resolveCustomProperties(textTransform);
1327
1326
  const fontFamily_ = resolveFontFamily(font, fontFamily);
@@ -1866,6 +1865,56 @@ function defineHandler(deps, handler) {
1866
1865
  //#region src/styles/index.ts
1867
1866
  const STYLE_HANDLER_MAP = predefine();
1868
1867
  //#endregion
1868
+ //#region src/utils/selector-transform.ts
1869
+ const ELEMENT_NAME_RE = /(^|[\s>+~,(])([A-Z][a-zA-Z0-9]*)/g;
1870
+ function transformSelectorContent(content) {
1871
+ return content.replace(ELEMENT_NAME_RE, (_, prefix, name) => `${prefix}[data-element="${name}"]`);
1872
+ }
1873
+ function splitSelectorsSafely(selectorList) {
1874
+ if (!selectorList.includes(",")) {
1875
+ const selector = selectorList.trim();
1876
+ return selector ? [selector] : [];
1877
+ }
1878
+ const parts = [];
1879
+ let start = 0;
1880
+ let squareDepth = 0;
1881
+ let parenDepth = 0;
1882
+ let quote = "";
1883
+ for (let i = 0; i < selectorList.length; i++) {
1884
+ const char = selectorList[i];
1885
+ if (char === "\\") {
1886
+ i++;
1887
+ continue;
1888
+ }
1889
+ if (quote) {
1890
+ if (char === quote) quote = "";
1891
+ continue;
1892
+ }
1893
+ if (char === "\"" || char === "'") {
1894
+ quote = char;
1895
+ continue;
1896
+ }
1897
+ if (char === "/" && selectorList[i + 1] === "*") {
1898
+ const end = selectorList.indexOf("*/", i + 2);
1899
+ if (end === -1) break;
1900
+ i = end + 1;
1901
+ continue;
1902
+ }
1903
+ if (char === "[") squareDepth++;
1904
+ else if (char === "]") squareDepth = Math.max(0, squareDepth - 1);
1905
+ else if (char === "(") parenDepth++;
1906
+ else if (char === ")") parenDepth = Math.max(0, parenDepth - 1);
1907
+ if (char === "," && squareDepth === 0 && parenDepth === 0) {
1908
+ const part = selectorList.slice(start, i).trim();
1909
+ if (part) parts.push(part);
1910
+ start = i + 1;
1911
+ }
1912
+ }
1913
+ const tail = selectorList.slice(start).trim();
1914
+ if (tail) parts.push(tail);
1915
+ return parts;
1916
+ }
1917
+ //#endregion
1869
1918
  //#region src/pipeline/conditions.ts
1870
1919
  function buildDimensionCondition(dimension, lowerBound, upperBound, emptyDimension = dimension) {
1871
1920
  if (lowerBound && upperBound) {
@@ -3975,12 +4024,6 @@ function camelToKebab(str) {
3975
4024
  return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
3976
4025
  }
3977
4026
  //#endregion
3978
- //#region src/utils/selector-transform.ts
3979
- const ELEMENT_NAME_RE = /(^|[\s>+~,(])([A-Z][a-zA-Z0-9]*)/g;
3980
- function transformSelectorContent(content) {
3981
- return content.replace(ELEMENT_NAME_RE, (_, prefix, name) => `${prefix}[data-element="${name}"]`);
3982
- }
3983
- //#endregion
3984
4027
  //#region src/pipeline/parseStateKey.ts
3985
4028
  const MAX_XOR_CHAIN_LENGTH = 4;
3986
4029
  const parseCache = new Lru(5e3);
@@ -4494,8 +4537,10 @@ function invokeHandler(handler, stateSnapshots, selectorSuffix) {
4494
4537
  return computedRules;
4495
4538
  }
4496
4539
  function getAllSelectors(key, styles) {
4497
- if (key.startsWith("&")) return [key.slice(1)];
4498
- if (key.startsWith(".")) return [` ${key}`];
4540
+ if (key.startsWith("&") || key.startsWith(".")) return splitSelectorsSafely(key).map((selector) => {
4541
+ const part = selector.replace(/^(?:\/\*[\s\S]*?\*\/\s*)+/, "");
4542
+ return part.startsWith("&") ? part.slice(1) : ` ${part}`;
4543
+ });
4499
4544
  if (/^[A-Z]/.test(key)) {
4500
4545
  const affix = styles?.$;
4501
4546
  if (affix !== void 0) {
@@ -5198,6 +5243,6 @@ function renderStylesForChunk(styles, chunkName, styleKeys, pipelineCacheKey) {
5198
5243
  return renderStyles(chunkName === CHUNK_NAMES.SUBCOMPONENTS ? buildSubcomponentFilteredStyles(styles, styleKeys) : buildFilteredStyles(styles, styleKeys), void 0, void 0, pipelineCacheKey);
5199
5244
  }
5200
5245
  //#endregion
5201
- export { APPEARANCE_CHUNK_STYLES as A, getGlobalPredefinedStates as B, STYLE_HANDLER_MAP as C, resetHandlers as D, registerHandler as E, LAYOUT_CHUNK_STYLES as F, resetGlobalPolyfillsState as G, hasStylesGenerated as H, POSITION_CHUNK_STYLES as I, resetStylesGeneratedState as K, STYLE_TO_CHUNK as L, DIMENSION_CHUNK_STYLES as M, DISPLAY_CHUNK_STYLES as N, styleHandlers as O, FONT_CHUNK_STYLES as P, resetStyleChunks as R, camelToKebab as S, normalizeHandlerDefinition as T, isFunctionsPolyfillEnabled as U, setGlobalPredefinedStates as V, markStylesGeneratedState as W, POSITION_STYLES as _, registerBaseStyleProps as a, renderStyles as b, BLOCK_INNER_STYLES as c, COLOR_STYLES as d, CONTAINER_STYLES as f, OUTER_STYLES as g, INNER_STYLES as h, baseStylePropsRegistry as i, CHUNK_NAMES as j, createStyle as k, BLOCK_OUTER_STYLES as l, FLOW_STYLES as m, generateChunkCacheKey as n, resetBaseStyleProps as o, DIMENSION_STYLES as p, setGlobalPolyfillsState as q, categorizeStyleKeys as r, BASE_STYLES as s, renderStylesForChunk as t, BLOCK_STYLES as u, TEXT_STYLES as v, defineHandler as w, parseStateKey as x, clearPipelineCache as y, createStateParserContext as z };
5246
+ export { createStyle as A, createStateParserContext as B, splitSelectorsSafely as C, registerHandler as D, normalizeHandlerDefinition as E, FONT_CHUNK_STYLES as F, markStylesGeneratedState as G, setGlobalPredefinedStates as H, LAYOUT_CHUNK_STYLES as I, setGlobalPolyfillsState as J, resetGlobalPolyfillsState as K, POSITION_CHUNK_STYLES as L, CHUNK_NAMES as M, DIMENSION_CHUNK_STYLES as N, resetHandlers as O, DISPLAY_CHUNK_STYLES as P, STYLE_TO_CHUNK as R, camelToKebab as S, defineHandler as T, hasStylesGenerated as U, getGlobalPredefinedStates as V, isFunctionsPolyfillEnabled as W, POSITION_STYLES as _, registerBaseStyleProps as a, renderStyles as b, BLOCK_INNER_STYLES as c, COLOR_STYLES as d, CONTAINER_STYLES as f, OUTER_STYLES as g, INNER_STYLES as h, baseStylePropsRegistry as i, APPEARANCE_CHUNK_STYLES as j, styleHandlers as k, BLOCK_OUTER_STYLES as l, FLOW_STYLES as m, generateChunkCacheKey as n, resetBaseStyleProps as o, DIMENSION_STYLES as p, resetStylesGeneratedState as q, categorizeStyleKeys as r, BASE_STYLES as s, renderStylesForChunk as t, BLOCK_STYLES as u, TEXT_STYLES as v, STYLE_HANDLER_MAP as w, parseStateKey as x, clearPipelineCache as y, resetStyleChunks as z };
5202
5247
 
5203
- //# sourceMappingURL=style-engine-CuWAOWn0.js.map
5248
+ //# sourceMappingURL=style-engine-BpgmapBp.js.map