@tenphi/tasty 0.0.0-snapshot.b6cc3cd → 0.0.0-snapshot.b7bfdb1
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.
- package/README.md +147 -129
- package/dist/{babel-D8dm92E_.d.ts → babel-Brsw7Ax_.d.ts} +2 -2
- package/dist/{collector-BFuqdF2F.d.ts → collector-0YO-P1vW.d.ts} +2 -2
- package/dist/{collector-Di3C8btw.js → collector-DJqx7XO0.js} +3 -3
- package/dist/{collector-Di3C8btw.js.map → collector-DJqx7XO0.js.map} +1 -1
- package/dist/{config-DH7I0Ggx.d.ts → config-CscQCTAM.d.ts} +133 -40
- package/dist/{config-BrDt11hO.js → config-DsqqkmUs.js} +496 -1009
- package/dist/config-DsqqkmUs.js.map +1 -0
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +6 -6
- package/dist/{core-YWn1zgh4.js → core-KVEKOhEi.js} +145 -105
- package/dist/core-KVEKOhEi.js.map +1 -0
- package/dist/{css-writer-CQYbT4g_.js → css-writer-Cdrh5gHj.js} +3 -3
- package/dist/{css-writer-CQYbT4g_.js.map → css-writer-Cdrh5gHj.js.map} +1 -1
- package/dist/{format-rules-DdmLdntR.js → format-rules-CHNmNGhw.js} +5 -20
- package/dist/format-rules-CHNmNGhw.js.map +1 -0
- package/dist/{hydrate-D2ivfS-B.js → hydrate-DJhwbWq4.js} +3 -3
- package/dist/{hydrate-D2ivfS-B.js.map → hydrate-DJhwbWq4.js.map} +1 -1
- package/dist/{index-DljBkZhV.d.ts → index-BR9as3qn.d.ts} +52 -22
- package/dist/{index-LC3O3Jj4.d.ts → index-BmogEzTo.d.ts} +75 -16
- package/dist/index.d.ts +5 -5
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/{keyframes-CoLLjBcd.js → keyframes-CQY-i8dO.js} +110 -21
- package/dist/keyframes-CQY-i8dO.js.map +1 -0
- package/dist/{merge-styles-Cx_6ySBv.d.ts → merge-styles-BcLl1u_d.d.ts} +2 -2
- package/dist/{merge-styles-bdh7-1uh.js → merge-styles-voA8J__3.js} +2 -2
- package/dist/{merge-styles-bdh7-1uh.js.map → merge-styles-voA8J__3.js.map} +1 -1
- package/dist/{resolve-recipes-9JYSgubn.js → resolve-recipes-BP2NqOtQ.js} +3 -3
- package/dist/{resolve-recipes-9JYSgubn.js.map → resolve-recipes-BP2NqOtQ.js.map} +1 -1
- package/dist/ssr/astro-client.js +1 -1
- package/dist/ssr/astro.js +3 -3
- package/dist/ssr/index.d.ts +1 -1
- package/dist/ssr/index.js +3 -3
- package/dist/ssr/next.d.ts +1 -1
- package/dist/ssr/next.js +4 -4
- package/dist/static/index.d.ts +2 -2
- package/dist/static/index.js +1 -1
- package/dist/zero/babel.d.ts +1 -1
- package/dist/zero/babel.js +4 -4
- package/dist/zero/index.d.ts +1 -1
- package/dist/zero/index.js +1 -1
- package/dist/zero/next.d.ts +1 -1
- package/docs/README.md +13 -8
- package/docs/adoption.md +56 -31
- package/docs/ai-agents.md +78 -77
- package/docs/comparison.md +69 -40
- package/docs/configuration.md +164 -101
- package/docs/debug.md +4 -2
- package/docs/design-system.md +41 -22
- package/docs/dsl.md +263 -198
- package/docs/getting-started.md +60 -39
- package/docs/injector.md +63 -26
- package/docs/methodology.md +43 -37
- package/docs/migration-v3.md +49 -49
- package/docs/pipeline.md +1 -4
- package/docs/plugins.md +37 -33
- package/docs/react-api.md +66 -45
- package/docs/runtime-benchmarks.md +178 -0
- package/docs/ssr.md +56 -57
- package/docs/styles.md +9 -2
- package/docs/tasty-static.md +137 -104
- package/package.json +12 -7
- package/dist/config-BrDt11hO.js.map +0 -1
- package/dist/core-YWn1zgh4.js.map +0 -1
- package/dist/format-rules-DdmLdntR.js.map +0 -1
- package/dist/keyframes-CoLLjBcd.js.map +0 -1
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ParseFunction, D as PropHandlerDefinition, E as PropHandler, O as PropHandlerProps, S as FunctionsConfig, T as SheetManager, _ as TastyPluginFactory, a as getGlobalFontFaces, b as generateTypographyTokens, c as getGlobalRecipes, d as hasGlobalRecipes, f as hasStylesGenerated, g as TastyPlugin, h as resetConfig, i as getGlobalCounterStyles, l as getNamePrefix, m as isTestEnvironment, n as configure, o as getGlobalFunctions, p as isConfigLocked, r as getConfig, s as getGlobalKeyframes, t as TastyConfig, u as hasGlobalKeyframes, v as TypographyPreset, w as StyleInjector, x as ColorSpace, y as TypographyTokenValue } from "../config-
|
|
2
|
-
import { $ as StyleParser, A as ParsedColor, At as
|
|
3
|
-
import { $ as
|
|
4
|
-
import { t as mergeStyles } from "../merge-styles-
|
|
5
|
-
export { APPEARANCE_CHUNK_STYLES, type AnyStyleHandler, type AtRuleContext, BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, type BaseStyleProps, type BlockInnerStyleProps, type BlockOuterStyleProps, type BlockStyleProps, CHUNK_NAMES, COLOR_STYLES, CONTAINER_STYLES, type CSSMap, CSSOptions, type CSSProperties, CUSTOM_UNITS, type CacheMetrics, CacheStatus, ChunkBreakdown, type ChunkInfo, type ChunkName, ChunkSheetRegistry, type ColorSpace, type ColorStyleProps, type ComputeStylesOptions, type ComputeStylesResult, type ConditionNode, type ConfigTokenValue, type ConfigTokens, type ContainerStyleProps, type CounterStyleDescriptors, DEFAULT_NAME_PREFIX, DEFAULT_ZERO_NAME_PREFIX, DIMENSION_CHUNK_STYLES, DIMENSION_STYLES, DIRECTIONS, DISPLAY_CHUNK_STYLES, DebugChunkInfo, DebugOptions, type DimensionStyleProps, type DisposeFunction, type ExtraBaseStyleProps, FLOW_STYLES, FONT_CHUNK_STYLES, type FlowStyleProps, type FontFaceDescriptors, type FontFaceInput, type FunctionDefinition, type FunctionParameter, type FunctionsConfig, type GCConfig, type GCOptions, INNER_STYLES, type InjectResult, type InjectionMode, type InnerStyleProps, InspectResult, type KeyframesCacheEntry, type KeyframesInfo, type KeyframesResult, type KeyframesSteps, LAYOUT_CHUNK_STYLES, type ModValue, type Mods, type NoType, type NotSelector, OUTER_STYLES, type OuterStyleProps, POSITION_CHUNK_STYLES, POSITION_STYLES, type ParseFunction, type ParseStateKeyOptions, type ParsedAdvancedState, type ParsedColor, type ParserOptions, type PositionStyleProps, type ProcessedStyle, type PropHandler, type PropHandlerDefinition, type PropHandlerProps, type PropertyDefinition, type PropertyOptions, type QueuedWrite, type RawCSSResult, type RawStyleHandler, type RecipeStyles, type RenderResult, type ResolvedStyleValue, type RootRegistry, type RuleInfo, STYLE_TO_CHUNK, type Selector, type SheetInfo, SheetManager, type ShortGridStyles, type StateParserContext, type StyleDetails, type StyleDetailsPart, type StyleHandler, type StyleHandlerDefinition, type StyleHandlerProps, type StyleHandlerResult, StyleInjector, type StyleInjectorConfig, type StyleMap, StyleParser, type StylePropValue, type StyleResult, type StyleRule, type StyleUsage, type StyleValue, type StyleValueStateMap, type Styles, type StylesInterface, type StylesWithoutSelectors, type SuffixForSelector, Summary, TEXT_STYLES, type TagName, type TastyBaseStylePropNames, type TastyConfig, type TastyCustomProps, type TastyExtensionConfig, type TastyNamedColors, type TastyPlugin, type TastyPluginFactory, type TastyPresetNames, type TastyThemeNames, type TextStyleProps, type TokenValue, type Tokens, TypographyPreset, TypographyTokenValue, type UnitHandler, categorizeStyleKeys, chunkSheetRegistry, cleanup, color, computeStyles, configure, counterStyle, createColorFunc, createInjector, createStateParserContext, defineHandler, destroy, dotize, filterBaseProps, filterMods, flushStyles, fontFace, func, gc, generateTypographyTokens, getCSSText, getCSSTextForNode, getConfig, getGlobalCounterStyles, getGlobalFontFaces, getGlobalFunctions, getGlobalKeyframes, getGlobalParser, getGlobalPredefinedStates, getGlobalPredefinedTokens, getGlobalRecipes, getNamePrefix, getNamedColorHex, getRawCSSText, getRgbValuesFromRgbaString, hasGlobalKeyframes, hasGlobalRecipes, hasPendingStyleWrites, hasStylesGenerated, hexToRgb, hslToRgbValues, inject, injectGlobal, injectRawCSS, injector, isConfigLocked, isPropertyDefined, isSelector, isTestEnvironment, keyframes, mergeStyles, _modAttrs as modAttrs, normalizeColorTokenValue, okhslFunction, okhslPlugin, okhstFunction, okhstPlugin, parseColor, parseStateKey, parseStyle, processTokens, property, renderStyles, resetConfig, resetStyleBatch, resolveFunctionColor, resolveRecipes, setGlobalPredefinedStates, strToRgb, stringifyStyles, styleHandlers, tastyDebug, touch };
|
|
1
|
+
import { C as ParseFunction, D as PropHandlerDefinition, E as PropHandler, O as PropHandlerProps, S as FunctionsConfig, T as SheetManager, _ as TastyPluginFactory, a as getGlobalFontFaces, b as generateTypographyTokens, c as getGlobalRecipes, d as hasGlobalRecipes, f as hasStylesGenerated, g as TastyPlugin, h as resetConfig, i as getGlobalCounterStyles, l as getNamePrefix, m as isTestEnvironment, n as configure, o as getGlobalFunctions, p as isConfigLocked, r as getConfig, s as getGlobalKeyframes, t as TastyConfig, u as hasGlobalKeyframes, v as TypographyPreset, w as StyleInjector, x as ColorSpace, y as TypographyTokenValue } from "../config-CscQCTAM.js";
|
|
2
|
+
import { $ as StyleParser, A as ParsedColor, At as StyleRule, B as StyleValueStateMap, C as SuffixForSelector, Ct as PropertyDefinition, D as CSSMap, Dt as RuleInfo, E as AnyStyleHandler, Et as RootRegistry, F as StyleHandlerProps, Ft as resetStyleBatch, G as parseColor, H as getGlobalParser, I as StyleHandlerResult, J as getNamedColorHex, K as parseStyle, L as StyleMap, M as ResolvedStyleValue, Mt as QueuedWrite, N as StyleHandler, Nt as flushStyles, O as CUSTOM_UNITS, Ot as SheetInfo, P as StyleHandlerDefinition, Pt as hasPendingStyleWrites, Q as strToRgb, R as StylePropValue, S as StylesWithoutSelectors, St as KeyframesSteps, T as TastyPresetNames, Tt as RawCSSResult, U as getGlobalPredefinedTokens, V as filterMods, W as normalizeColorTokenValue, X as hexToRgb, Y as getRgbValuesFromRgbaString, Z as hslToRgbValues, _ as NotSelector, _t as InjectResult, a as ParseStateKeyOptions, at as CSSProperties, b as Styles, bt as KeyframesInfo, c as ParsedAdvancedState, ct as DisposeFunction, d as getGlobalPredefinedStates, dt as FunctionDefinition, et as ParserOptions, f as setGlobalPredefinedStates, ft as FunctionParameter, g as NoType, gt as InjectOptions, h as ConfigTokens, i as renderStyles, it as UnitHandler, j as RawStyleHandler, jt as StyleUsage, k as DIRECTIONS, kt as StyleInjectorConfig, l as StateParserContext, lt as FontFaceDescriptors, m as ConfigTokenValue, mt as GCOptions, n as StyleResult, nt as StyleDetails, o as parseStateKey, ot as CacheMetrics, p as ConditionNode, pt as GCConfig, q as stringifyStyles, r as isSelector, rt as StyleDetailsPart, s as AtRuleContext, st as CounterStyleDescriptors, t as RenderResult, tt as ProcessedStyle, u as createStateParserContext, ut as FontFaceInput, v as RecipeStyles, vt as InjectionMode, w as TastyNamedColors, wt as PropertyOptions, x as StylesInterface, xt as KeyframesResult, y as Selector, yt as KeyframesCacheEntry, z as StyleValue } from "../index-BmogEzTo.js";
|
|
3
|
+
import { $ as resolveFunctionColor, $t as Mods, A as isPropertyDefined, B as defineHandler, C as getCSSTextForNode, Cn as DEFAULT_NAME_PREFIX, D as injectGlobal, E as inject, F as ChunkSheetRegistry, G as CHUNK_NAMES, Gt as BlockStyleProps, H as ChunkInfo, Ht as BaseStyleProps, I as chunkSheetRegistry, J as DISPLAY_CHUNK_STYLES, Jt as DimensionStyleProps, K as ChunkName, Kt as ColorStyleProps, L as ComputeStylesOptions, M as ownKeyframes, N as property, O as injectRawCSS, P as touch, Q as STYLE_TO_CHUNK, Qt as ModValue, R as ComputeStylesResult, S as getCSSText, Sn as TEXT_STYLES, T as holdKeyframes, U as categorizeStyleKeys, Ut as BlockInnerStyleProps, V as styleHandlers, W as APPEARANCE_CHUNK_STYLES, Wt as BlockOuterStyleProps, X as LAYOUT_CHUNK_STYLES, Xt as FlowStyleProps, Y as FONT_CHUNK_STYLES, Yt as ExtraBaseStyleProps, Z as POSITION_CHUNK_STYLES, Zt as InnerStyleProps, _ as createInjector, _n as DIMENSION_STYLES, a as DebugOptions, an as TastyCustomProps, b as func, bn as OUTER_STYLES, c as tastyDebug, cn as TextStyleProps, d as dotize, dn as BASE_STYLES, en as OuterStyleProps, et as createColorFunc, f as _modAttrs, fn as BLOCK_INNER_STYLES, g as counterStyle, gn as CONTAINER_STYLES, h as cleanup, hn as COLOR_STYLES, i as DebugChunkInfo, in as TastyBaseStylePropNames, it as okhslPlugin, j as keyframes, k as injector, l as processTokens, ln as TokenValue, m as filterBaseProps, mn as BLOCK_STYLES, n as CacheStatus, nn as ShortGridStyles, nt as okhstPlugin, o as InspectResult, on as TastyExtensionConfig, p as color, pn as BLOCK_OUTER_STYLES, q as DIMENSION_CHUNK_STYLES, qt as ContainerStyleProps, r as ChunkBreakdown, rn as TagName, rt as okhslFunction, s as Summary, sn as TastyThemeNames, t as CSSOptions, tn as PositionStyleProps, tt as okhstFunction, u as resolveRecipes, un as Tokens, v as destroy, vn as FLOW_STYLES, w as getRawCSSText, wn as DEFAULT_ZERO_NAME_PREFIX, x as gc, xn as POSITION_STYLES, y as fontFace, yn as INNER_STYLES, z as computeStyles } from "../index-BR9as3qn.js";
|
|
4
|
+
import { t as mergeStyles } from "../merge-styles-BcLl1u_d.js";
|
|
5
|
+
export { APPEARANCE_CHUNK_STYLES, type AnyStyleHandler, type AtRuleContext, BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, type BaseStyleProps, type BlockInnerStyleProps, type BlockOuterStyleProps, type BlockStyleProps, CHUNK_NAMES, COLOR_STYLES, CONTAINER_STYLES, type CSSMap, CSSOptions, type CSSProperties, CUSTOM_UNITS, type CacheMetrics, CacheStatus, ChunkBreakdown, type ChunkInfo, type ChunkName, ChunkSheetRegistry, type ColorSpace, type ColorStyleProps, type ComputeStylesOptions, type ComputeStylesResult, type ConditionNode, type ConfigTokenValue, type ConfigTokens, type ContainerStyleProps, type CounterStyleDescriptors, DEFAULT_NAME_PREFIX, DEFAULT_ZERO_NAME_PREFIX, DIMENSION_CHUNK_STYLES, DIMENSION_STYLES, DIRECTIONS, DISPLAY_CHUNK_STYLES, DebugChunkInfo, DebugOptions, type DimensionStyleProps, type DisposeFunction, type ExtraBaseStyleProps, FLOW_STYLES, FONT_CHUNK_STYLES, type FlowStyleProps, type FontFaceDescriptors, type FontFaceInput, type FunctionDefinition, type FunctionParameter, type FunctionsConfig, type GCConfig, type GCOptions, INNER_STYLES, type InjectOptions, type InjectResult, type InjectionMode, type InnerStyleProps, InspectResult, type KeyframesCacheEntry, type KeyframesInfo, type KeyframesResult, type KeyframesSteps, LAYOUT_CHUNK_STYLES, type ModValue, type Mods, type NoType, type NotSelector, OUTER_STYLES, type OuterStyleProps, POSITION_CHUNK_STYLES, POSITION_STYLES, type ParseFunction, type ParseStateKeyOptions, type ParsedAdvancedState, type ParsedColor, type ParserOptions, type PositionStyleProps, type ProcessedStyle, type PropHandler, type PropHandlerDefinition, type PropHandlerProps, type PropertyDefinition, type PropertyOptions, type QueuedWrite, type RawCSSResult, type RawStyleHandler, type RecipeStyles, type RenderResult, type ResolvedStyleValue, type RootRegistry, type RuleInfo, STYLE_TO_CHUNK, type Selector, type SheetInfo, SheetManager, type ShortGridStyles, type StateParserContext, type StyleDetails, type StyleDetailsPart, type StyleHandler, type StyleHandlerDefinition, type StyleHandlerProps, type StyleHandlerResult, StyleInjector, type StyleInjectorConfig, type StyleMap, StyleParser, type StylePropValue, type StyleResult, type StyleRule, type StyleUsage, type StyleValue, type StyleValueStateMap, type Styles, type StylesInterface, type StylesWithoutSelectors, type SuffixForSelector, Summary, TEXT_STYLES, type TagName, type TastyBaseStylePropNames, type TastyConfig, type TastyCustomProps, type TastyExtensionConfig, type TastyNamedColors, type TastyPlugin, type TastyPluginFactory, type TastyPresetNames, type TastyThemeNames, type TextStyleProps, type TokenValue, type Tokens, TypographyPreset, TypographyTokenValue, type UnitHandler, categorizeStyleKeys, chunkSheetRegistry, cleanup, color, computeStyles, configure, counterStyle, createColorFunc, createInjector, createStateParserContext, defineHandler, destroy, dotize, filterBaseProps, filterMods, flushStyles, fontFace, func, gc, generateTypographyTokens, getCSSText, getCSSTextForNode, getConfig, getGlobalCounterStyles, getGlobalFontFaces, getGlobalFunctions, getGlobalKeyframes, getGlobalParser, getGlobalPredefinedStates, getGlobalPredefinedTokens, getGlobalRecipes, getNamePrefix, getNamedColorHex, getRawCSSText, getRgbValuesFromRgbaString, hasGlobalKeyframes, hasGlobalRecipes, hasPendingStyleWrites, hasStylesGenerated, hexToRgb, holdKeyframes, hslToRgbValues, inject, injectGlobal, injectRawCSS, injector, isConfigLocked, isPropertyDefined, isSelector, isTestEnvironment, keyframes, mergeStyles, _modAttrs as modAttrs, normalizeColorTokenValue, okhslFunction, okhslPlugin, okhstFunction, okhstPlugin, ownKeyframes, parseColor, parseStateKey, parseStyle, processTokens, property, renderStyles, resetConfig, resetStyleBatch, resolveFunctionColor, resolveRecipes, setGlobalPredefinedStates, strToRgb, stringifyStyles, styleHandlers, tastyDebug, touch };
|
package/dist/core/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as SheetManager, A as FLOW_STYLES, At as STYLE_TO_CHUNK, B as createStateParserContext,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as mergeStyles } from "../merge-styles-
|
|
5
|
-
import { t as resolveRecipes } from "../resolve-recipes-
|
|
6
|
-
export { APPEARANCE_CHUNK_STYLES, BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, CHUNK_NAMES, COLOR_STYLES, CONTAINER_STYLES, CUSTOM_UNITS, ChunkSheetRegistry, DEFAULT_NAME_PREFIX, DEFAULT_ZERO_NAME_PREFIX, DIMENSION_CHUNK_STYLES, DIMENSION_STYLES, DIRECTIONS, DISPLAY_CHUNK_STYLES, FLOW_STYLES, FONT_CHUNK_STYLES, INNER_STYLES, LAYOUT_CHUNK_STYLES, OUTER_STYLES, POSITION_CHUNK_STYLES, POSITION_STYLES, STYLE_TO_CHUNK, SheetManager, StyleInjector, StyleParser, TEXT_STYLES, categorizeStyleKeys, chunkSheetRegistry, cleanup, color, computeStyles, configure, counterStyle, createColorFunc, createInjector, createStateParserContext, defineHandler, destroy, dotize, filterBaseProps, filterMods, flushStyles, fontFace, func, gc, generateTypographyTokens, getCSSText, getCSSTextForNode, getConfig, getGlobalCounterStyles, getGlobalFontFaces, getGlobalFunctions, getGlobalKeyframes, getGlobalParser, getGlobalPredefinedStates, getGlobalPredefinedTokens, getGlobalRecipes, getNamePrefix, getNamedColorHex, getRawCSSText, getRgbValuesFromRgbaString, hasGlobalKeyframes, hasGlobalRecipes, hasPendingStyleWrites, hasStylesGenerated, hexToRgb, hslToRgbValues, inject, injectGlobal, injectRawCSS, injector, isConfigLocked, isPropertyDefined, isSelector, isTestEnvironment, keyframes, mergeStyles, _modAttrs as modAttrs, normalizeColorTokenValue, okhslFunction, okhslPlugin, okhstFunction, okhstPlugin, parseColor, parseStateKey, parseStyle, processTokens, property, renderStyles, resetConfig, resetStyleBatch, resolveFunctionColor, resolveRecipes, setGlobalPredefinedStates, strToRgb, stringifyStyles, styleHandlers, tastyDebug, touch };
|
|
1
|
+
import { $ as SheetManager, $t as StyleParser, A as FLOW_STYLES, At as STYLE_TO_CHUNK, B as createStateParserContext, C as BASE_STYLES, Ct as APPEARANCE_CHUNK_STYLES, D as COLOR_STYLES, Dt as FONT_CHUNK_STYLES, E as BLOCK_STYLES, Et as DISPLAY_CHUNK_STYLES, G as StyleInjector, Gt as parseStyle, Ht as getGlobalPredefinedTokens, I as isSelector, Jt as okhstPlugin, Kt as stringifyStyles, L as renderStyles, Lt as CUSTOM_UNITS, M as OUTER_STYLES, N as POSITION_STYLES, O as CONTAINER_STYLES, Ot as LAYOUT_CHUNK_STYLES, P as TEXT_STYLES, R as parseStateKey, Rt as DIRECTIONS, T as BLOCK_OUTER_STYLES, Tt as DIMENSION_CHUNK_STYLES, U as getGlobalPredefinedStates, Ut as normalizeColorTokenValue, Vt as getGlobalParser, W as setGlobalPredefinedStates, Wt as parseColor, Xt as okhslPlugin, Yt as okhslFunction, Zt as createColorFunc, a as getGlobalCounterStyles, an as hslToRgbValues, b as resetConfig, dt as DEFAULT_ZERO_NAME_PREFIX, f as getNamePrefix, g as isConfigLocked, h as hasStylesGenerated, in as hexToRgb, j as INNER_STYLES, k as DIMENSION_STYLES, kt as POSITION_CHUNK_STYLES, l as getGlobalKeyframes, lt as resetStyleBatch, m as hasGlobalRecipes, n as getConfig, nn as getNamedColorHex, nt as styleHandlers, o as getGlobalFontFaces, on as strToRgb, ot as flushStyles, p as hasGlobalKeyframes, qt as okhstFunction, rn as getRgbValuesFromRgbaString, s as getGlobalFunctions, st as hasPendingStyleWrites, t as configure, tt as defineHandler, u as getGlobalRecipes, ut as DEFAULT_NAME_PREFIX, v as isTestEnvironment, w as BLOCK_INNER_STYLES, wt as CHUNK_NAMES, x as generateTypographyTokens, zt as filterMods } from "../config-DsqqkmUs.js";
|
|
2
|
+
import { A as keyframes, C as getRawCSSText, D as injectRawCSS, E as injectGlobal, F as chunkSheetRegistry, I as resolveFunctionColor, M as property, N as touch, O as injector, P as ChunkSheetRegistry, S as getCSSTextForNode, T as inject, _ as destroy, a as color, b as gc, g as createInjector, h as counterStyle, i as _modAttrs, j as ownKeyframes, k as isPropertyDefined, m as cleanup, n as processTokens, o as filterBaseProps, r as dotize, s as computeStyles, t as tastyDebug, v as fontFace, w as holdKeyframes, x as getCSSText, y as func } from "../core-KVEKOhEi.js";
|
|
3
|
+
import { u as categorizeStyleKeys } from "../keyframes-CQY-i8dO.js";
|
|
4
|
+
import { t as mergeStyles } from "../merge-styles-voA8J__3.js";
|
|
5
|
+
import { t as resolveRecipes } from "../resolve-recipes-BP2NqOtQ.js";
|
|
6
|
+
export { APPEARANCE_CHUNK_STYLES, BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, CHUNK_NAMES, COLOR_STYLES, CONTAINER_STYLES, CUSTOM_UNITS, ChunkSheetRegistry, DEFAULT_NAME_PREFIX, DEFAULT_ZERO_NAME_PREFIX, DIMENSION_CHUNK_STYLES, DIMENSION_STYLES, DIRECTIONS, DISPLAY_CHUNK_STYLES, FLOW_STYLES, FONT_CHUNK_STYLES, INNER_STYLES, LAYOUT_CHUNK_STYLES, OUTER_STYLES, POSITION_CHUNK_STYLES, POSITION_STYLES, STYLE_TO_CHUNK, SheetManager, StyleInjector, StyleParser, TEXT_STYLES, categorizeStyleKeys, chunkSheetRegistry, cleanup, color, computeStyles, configure, counterStyle, createColorFunc, createInjector, createStateParserContext, defineHandler, destroy, dotize, filterBaseProps, filterMods, flushStyles, fontFace, func, gc, generateTypographyTokens, getCSSText, getCSSTextForNode, getConfig, getGlobalCounterStyles, getGlobalFontFaces, getGlobalFunctions, getGlobalKeyframes, getGlobalParser, getGlobalPredefinedStates, getGlobalPredefinedTokens, getGlobalRecipes, getNamePrefix, getNamedColorHex, getRawCSSText, getRgbValuesFromRgbaString, hasGlobalKeyframes, hasGlobalRecipes, hasPendingStyleWrites, hasStylesGenerated, hexToRgb, holdKeyframes, hslToRgbValues, inject, injectGlobal, injectRawCSS, injector, isConfigLocked, isPropertyDefined, isSelector, isTestEnvironment, keyframes, mergeStyles, _modAttrs as modAttrs, normalizeColorTokenValue, okhslFunction, okhslPlugin, okhstFunction, okhstPlugin, ownKeyframes, parseColor, parseStateKey, parseStyle, processTokens, property, renderStyles, resetConfig, resetStyleBatch, resolveFunctionColor, resolveRecipes, setGlobalPredefinedStates, strToRgb, stringifyStyles, styleHandlers, tastyDebug, touch };
|
|
@@ -1,8 +1,36 @@
|
|
|
1
|
-
import { G as StyleInjector,
|
|
2
|
-
import { a as mergeKeyframes, c as
|
|
3
|
-
import { n as formatPropertyCSS, r as getRegisteredSSRCollector, t as formatRules } from "./format-rules-
|
|
4
|
-
import { t as resolveRecipes } from "./resolve-recipes-
|
|
1
|
+
import { Bt as getGlobalParseFunctions, G as StyleInjector, Gt as parseStyle, It as registerLocalFunctionPolyfills, J as hasLocalCounterStyle, K as extractLocalCounterStyle, Mt as formatFunctionRule, Nt as hasLocalFunctions, Pt as parseFunctionName, Q as hasLocalFontFace, Qt as isDevEnv, Ut as normalizeColorTokenValue, Vt as getGlobalParser, X as fontFaceContentHash, Y as extractLocalFontFace, Z as formatFontFaceRule, _ as isFunctionsPolyfillEnabled, _t as hashString, bt as hasLocalProperties, c as getGlobalInjector, en as Lru, et as STYLE_HANDLER_MAP, f as getNamePrefix, ft as makeClassName, ht as tastyClassRegex, it as PropertyTypeResolver, jt as extractLocalFunctions, l as getGlobalKeyframes, n as getConfig, p as hasGlobalKeyframes, q as formatCounterStyleRule, rt as createStyle, sn as normalizeDslName, tn as overrideColorAlpha, v as isTestEnvironment, vt as extractLocalProperties, wt as CHUNK_NAMES, xt as parsePropertyToken, y as markStylesGenerated, z as camelToKebab } from "./config-DsqqkmUs.js";
|
|
2
|
+
import { a as mergeKeyframes, c as renderStylesForChunk, i as hasLocalKeyframes, l as generateChunkCacheKey, n as extractLocalKeyframes, o as referencesAnimation, r as filterUsedKeyframes, s as replaceAnimationNames, t as extractAnimationNamesFromStyles, u as categorizeStyleKeys } from "./keyframes-CQY-i8dO.js";
|
|
3
|
+
import { n as formatPropertyCSS, r as getRegisteredSSRCollector, t as formatRules } from "./format-rules-CHNmNGhw.js";
|
|
4
|
+
import { t as resolveRecipes } from "./resolve-recipes-BP2NqOtQ.js";
|
|
5
5
|
import { cache } from "react";
|
|
6
|
+
//#region src/utils/function-color.ts
|
|
7
|
+
const RE_FUNC_NAME = /^([a-z][a-z0-9-]*)\s*\(/i;
|
|
8
|
+
const RE_COLOR_OUT = /^(?:rgb|hsl|hwb|lab|lch|oklab|oklch|color)\(|^#|^var\(--/i;
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a `name(...)` value produced by a registered custom parse function
|
|
11
|
+
* into its concrete color output.
|
|
12
|
+
*
|
|
13
|
+
* A color function is just a `functions` entry whose output is an already
|
|
14
|
+
* supported color (`rgb`, `hsl`, `#…`, `oklch`, …). This helper delegates the
|
|
15
|
+
* value to the global parser (which already runs the registered parse function)
|
|
16
|
+
* and returns the result only when it looks like a color. Returns `null` when
|
|
17
|
+
* `str` is not a registered custom function or its output is not a color.
|
|
18
|
+
*
|
|
19
|
+
* This is the generic replacement for the previously hardcoded okhsl/okhst
|
|
20
|
+
* conversion branches scattered across `strToRgb`, `resolveToRgbaValues`, and
|
|
21
|
+
* the `#token.alpha` injection path.
|
|
22
|
+
*/
|
|
23
|
+
function resolveFunctionColor(str) {
|
|
24
|
+
const m = RE_FUNC_NAME.exec(str);
|
|
25
|
+
if (!m) return null;
|
|
26
|
+
const name = m[1].toLowerCase();
|
|
27
|
+
getGlobalParser();
|
|
28
|
+
if (!(name in getGlobalParseFunctions())) return null;
|
|
29
|
+
const out = getGlobalParser().process(str).output;
|
|
30
|
+
if (!out || !RE_COLOR_OUT.test(out)) return null;
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
6
34
|
//#region src/injector/chunk-sheet-registry.ts
|
|
7
35
|
/**
|
|
8
36
|
* Global registry mapping CSS content hashes to shared constructable
|
|
@@ -217,24 +245,43 @@ function getCSSTextForNode(node, options) {
|
|
|
217
245
|
return getGlobalInjector().getCSSTextForClasses(classSet, options);
|
|
218
246
|
}
|
|
219
247
|
/**
|
|
220
|
-
*
|
|
248
|
+
* Take a reference on local `@keyframes` and report what they ended up being
|
|
249
|
+
* called. Names must be resolved before the rules that animate them are
|
|
250
|
+
* written. Pair with `ownKeyframes()` once those rules exist.
|
|
251
|
+
*/
|
|
252
|
+
function holdKeyframes(steps, options) {
|
|
253
|
+
return getGlobalInjector().holdKeyframes(steps, options);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Record that a class animates these keyframes, so the reference is released
|
|
257
|
+
* when the last such class is collected.
|
|
258
|
+
*/
|
|
259
|
+
function ownKeyframes(key, className, options) {
|
|
260
|
+
getGlobalInjector().ownKeyframes(key, className, options);
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Remove every injected rule that is neither in the DOM nor held by an
|
|
264
|
+
* outstanding `inject()` handle. Equivalent to `gc({ force: true })`.
|
|
221
265
|
*/
|
|
222
266
|
function cleanup(root) {
|
|
223
267
|
return getGlobalInjector().cleanup(root);
|
|
224
268
|
}
|
|
225
269
|
/**
|
|
226
|
-
*
|
|
227
|
-
* Used internally by computeStyles and tasty()
|
|
228
|
-
*
|
|
270
|
+
* Count a render, so that a collection pass is scheduled every
|
|
271
|
+
* `gc.touchInterval` of them. Used internally by computeStyles and tasty().
|
|
272
|
+
*
|
|
273
|
+
* @deprecated The class name is ignored — collection asks the DOM what is
|
|
274
|
+
* rendered rather than recording usage per class. The argument is kept so
|
|
275
|
+
* existing calls still compile.
|
|
229
276
|
*/
|
|
230
277
|
function touch(className, options) {
|
|
231
278
|
if (!getConfig().gc) return;
|
|
232
279
|
getGlobalInjector().touch(className, options);
|
|
233
280
|
}
|
|
234
281
|
/**
|
|
235
|
-
* Synchronous garbage collection of unused styles
|
|
236
|
-
* Evicts the oldest
|
|
237
|
-
* With `{ force: true }`, removes
|
|
282
|
+
* Synchronous garbage collection of unused styles — those no element carries
|
|
283
|
+
* and no `inject()` handle references. Evicts the oldest ones once they exceed
|
|
284
|
+
* capacity. With `{ force: true }`, removes all of them regardless of capacity.
|
|
238
285
|
*
|
|
239
286
|
* @returns Number of styles evicted.
|
|
240
287
|
*/
|
|
@@ -374,7 +421,7 @@ function scanAndEmitAutoProperties(rules, styles, emit) {
|
|
|
374
421
|
syntax,
|
|
375
422
|
inherits: true,
|
|
376
423
|
initialValue
|
|
377
|
-
}
|
|
424
|
+
});
|
|
378
425
|
if (css) emit(name, css);
|
|
379
426
|
});
|
|
380
427
|
}
|
|
@@ -572,7 +619,7 @@ function collectAncillaryRSC(rscCache, styles) {
|
|
|
572
619
|
* Process all chunks in RSC mode: render CSS to strings, allocate classNames,
|
|
573
620
|
* and return combined { className, css }.
|
|
574
621
|
*/
|
|
575
|
-
function computeStylesRSC(styles, chunkMap) {
|
|
622
|
+
function computeStylesRSC(styles, chunkMap, stableStyles) {
|
|
576
623
|
const rscCache = getRSCCache();
|
|
577
624
|
const cssParts = [];
|
|
578
625
|
const classNames = [];
|
|
@@ -582,7 +629,7 @@ function computeStylesRSC(styles, chunkMap) {
|
|
|
582
629
|
if (internalsCSS) cssParts.push(internalsCSS);
|
|
583
630
|
for (const [chunkName, chunkStyleKeys] of chunkMap) {
|
|
584
631
|
if (chunkStyleKeys.length === 0) continue;
|
|
585
|
-
const { className, isNew } = rscAllocateClassName(rscCache, generateChunkCacheKey(styles, chunkName, chunkStyleKeys));
|
|
632
|
+
const { className, isNew } = rscAllocateClassName(rscCache, generateChunkCacheKey(styles, chunkName, chunkStyleKeys, stableStyles));
|
|
586
633
|
classNames.push(className);
|
|
587
634
|
if (isNew) {
|
|
588
635
|
const renderResult = renderStylesForChunk(styles, chunkName, chunkStyleKeys);
|
|
@@ -616,9 +663,9 @@ function getUsedKeyframes(styles) {
|
|
|
616
663
|
/**
|
|
617
664
|
* Process a chunk on the SSR path: allocate via collector, render, collect CSS.
|
|
618
665
|
*/
|
|
619
|
-
function processChunkSSR(collector, styles, chunkName, styleKeys) {
|
|
666
|
+
function processChunkSSR(collector, styles, chunkName, styleKeys, stableStyles) {
|
|
620
667
|
if (styleKeys.length === 0) return null;
|
|
621
|
-
const cacheKey = generateChunkCacheKey(styles, chunkName, styleKeys);
|
|
668
|
+
const cacheKey = generateChunkCacheKey(styles, chunkName, styleKeys, stableStyles);
|
|
622
669
|
const { className, isNewAllocation } = collector.allocateClassName(cacheKey);
|
|
623
670
|
if (isNewAllocation) {
|
|
624
671
|
const renderResult = renderStylesForChunk(styles, chunkName, styleKeys);
|
|
@@ -646,54 +693,36 @@ function processChunkSSR(collector, styles, chunkName, styleKeys) {
|
|
|
646
693
|
* Process a chunk on the client: render, allocate className, and inject
|
|
647
694
|
* CSS synchronously. The injector's cache makes this idempotent.
|
|
648
695
|
*/
|
|
649
|
-
function processChunkSync(styles, chunkName, styleKeys, root) {
|
|
696
|
+
function processChunkSync(styles, chunkName, styleKeys, stableStyles, root, keyframeNames) {
|
|
650
697
|
if (styleKeys.length === 0) return null;
|
|
651
|
-
const cacheKey = generateChunkCacheKey(styles, chunkName, styleKeys);
|
|
698
|
+
const cacheKey = generateChunkCacheKey(styles, chunkName, styleKeys, stableStyles);
|
|
652
699
|
const renderResult = renderStylesForChunk(styles, chunkName, styleKeys, cacheKey);
|
|
653
700
|
if (renderResult.rules.length === 0) return null;
|
|
654
|
-
const
|
|
655
|
-
|
|
656
|
-
|
|
701
|
+
const animations = keyframeNames ? [...keyframeNames.keys()].filter((authored) => renderResult.rules.some((rule) => referencesAnimation(rule.declarations, authored))) : [];
|
|
702
|
+
const renamed = animations.filter((authored) => keyframeNames.get(authored) !== authored);
|
|
703
|
+
const rules = renamed.length ? renderResult.rules.map((rule) => ({
|
|
704
|
+
...rule,
|
|
705
|
+
declarations: replaceAnimationNames(rule.declarations, keyframeNames)
|
|
706
|
+
})) : renderResult.rules;
|
|
707
|
+
const injectKey = renamed.length ? `${cacheKey}\u0000kf:${renamed.map((authored) => `${authored}=${keyframeNames.get(authored)}`).sort().join(",")}` : cacheKey;
|
|
708
|
+
const { className } = inject(rules, {
|
|
709
|
+
cacheKey: injectKey,
|
|
710
|
+
root,
|
|
711
|
+
pin: false
|
|
657
712
|
});
|
|
658
713
|
return {
|
|
659
714
|
name: chunkName,
|
|
660
715
|
styleKeys,
|
|
661
|
-
cacheKey,
|
|
662
|
-
renderResult
|
|
663
|
-
|
|
716
|
+
cacheKey: injectKey,
|
|
717
|
+
renderResult: {
|
|
718
|
+
...renderResult,
|
|
719
|
+
rules
|
|
720
|
+
},
|
|
721
|
+
className,
|
|
722
|
+
animations
|
|
664
723
|
};
|
|
665
724
|
}
|
|
666
725
|
/**
|
|
667
|
-
* Inject keyframes synchronously and return a name replacement map.
|
|
668
|
-
* On the client, keyframes are injected into the DOM.
|
|
669
|
-
*/
|
|
670
|
-
function injectKeyframesSync(usedKeyframes, root) {
|
|
671
|
-
let nameMap = null;
|
|
672
|
-
for (const [name, steps] of Object.entries(usedKeyframes)) {
|
|
673
|
-
const injectedName = keyframes(steps, {
|
|
674
|
-
name,
|
|
675
|
-
root
|
|
676
|
-
}).toString();
|
|
677
|
-
if (injectedName !== name) {
|
|
678
|
-
if (!nameMap) nameMap = /* @__PURE__ */ new Map();
|
|
679
|
-
nameMap.set(name, injectedName);
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
return nameMap;
|
|
683
|
-
}
|
|
684
|
-
/**
|
|
685
|
-
* Inject chunk rules synchronously, replacing animation names if needed.
|
|
686
|
-
*/
|
|
687
|
-
function injectChunkRulesSync(chunks, nameMap, root) {
|
|
688
|
-
for (const chunk of chunks) if (chunk.renderResult.rules.length > 0) inject(nameMap ? chunk.renderResult.rules.map((rule) => ({
|
|
689
|
-
...rule,
|
|
690
|
-
declarations: replaceAnimationNames(rule.declarations, nameMap)
|
|
691
|
-
})) : chunk.renderResult.rules, {
|
|
692
|
-
cacheKey: chunk.cacheKey,
|
|
693
|
-
root
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
/**
|
|
697
726
|
* Inject all ancillary rules (properties, font-faces, counter-styles) synchronously.
|
|
698
727
|
*/
|
|
699
728
|
function injectAncillarySync(styles, root) {
|
|
@@ -784,6 +813,7 @@ function collectAncillarySSR(collector, styles, chunks) {
|
|
|
784
813
|
function computeStyles(styles, options) {
|
|
785
814
|
if (!styles || !hasKeys(styles)) return EMPTY_RESULT;
|
|
786
815
|
const resolved = resolveRecipes(styles);
|
|
816
|
+
const stableStyles = options?.stableStyles === true && resolved === styles;
|
|
787
817
|
if (isFunctionsPolyfillEnabled() && hasLocalFunctions(resolved)) registerLocalFunctionPolyfills(resolved);
|
|
788
818
|
const chunkMap = categorizeStyleKeys(resolved);
|
|
789
819
|
const collector = options?.ssrCollector !== void 0 ? options.ssrCollector : getRegisteredSSRCollector();
|
|
@@ -791,21 +821,24 @@ function computeStyles(styles, options) {
|
|
|
791
821
|
if (collector) {
|
|
792
822
|
collector.collectInternals();
|
|
793
823
|
for (const [chunkName, chunkStyleKeys] of chunkMap) {
|
|
794
|
-
const chunk = processChunkSSR(collector, resolved, chunkName, chunkStyleKeys);
|
|
824
|
+
const chunk = processChunkSSR(collector, resolved, chunkName, chunkStyleKeys, stableStyles);
|
|
795
825
|
if (chunk) chunks.push(chunk);
|
|
796
826
|
}
|
|
797
827
|
collectAncillarySSR(collector, resolved, chunks);
|
|
798
|
-
} else if (typeof document === "undefined") return computeStylesRSC(resolved, chunkMap);
|
|
828
|
+
} else if (typeof document === "undefined") return computeStylesRSC(resolved, chunkMap, stableStyles);
|
|
799
829
|
else {
|
|
800
830
|
const root = options?.root;
|
|
801
831
|
injectAncillarySync(resolved, root);
|
|
802
832
|
const usedKf = getUsedKeyframes(resolved);
|
|
803
|
-
const
|
|
833
|
+
const held = usedKf ? holdKeyframes(usedKf, { root }) : null;
|
|
804
834
|
for (const [chunkName, chunkStyleKeys] of chunkMap) {
|
|
805
|
-
const chunk = processChunkSync(resolved, chunkName, chunkStyleKeys, root);
|
|
835
|
+
const chunk = processChunkSync(resolved, chunkName, chunkStyleKeys, stableStyles, root, held?.names);
|
|
806
836
|
if (chunk) chunks.push(chunk);
|
|
807
837
|
}
|
|
808
|
-
if (
|
|
838
|
+
if (held) for (const chunk of chunks) for (const authored of chunk.animations ?? []) {
|
|
839
|
+
const key = held.keys.get(authored);
|
|
840
|
+
if (key) ownKeyframes(key, chunk.className, { root });
|
|
841
|
+
}
|
|
809
842
|
for (const chunk of chunks) touch(chunk.className, { root });
|
|
810
843
|
}
|
|
811
844
|
if (chunks.length === 0) return EMPTY_RESULT;
|
|
@@ -1014,20 +1047,6 @@ const dotize = {
|
|
|
1014
1047
|
//#endregion
|
|
1015
1048
|
//#region src/utils/process-tokens.ts
|
|
1016
1049
|
/**
|
|
1017
|
-
* Extract color components in the configured color space.
|
|
1018
|
-
* Returns a CSS variable reference for token colors, or decomposed
|
|
1019
|
-
* components as a space-separated string.
|
|
1020
|
-
*/
|
|
1021
|
-
function extractColorSpaceValue(colorValue, parsedOutput) {
|
|
1022
|
-
const componentsFromParsed = getColorSpaceComponents(parsedOutput);
|
|
1023
|
-
if (componentsFromParsed !== parsedOutput) return componentsFromParsed;
|
|
1024
|
-
const components = getColorSpaceComponents(colorValue);
|
|
1025
|
-
if (components !== colorValue) return components;
|
|
1026
|
-
const chain = convertColorChainToComponentChain(parsedOutput);
|
|
1027
|
-
if (chain !== parsedOutput) return chain;
|
|
1028
|
-
return parsedOutput;
|
|
1029
|
-
}
|
|
1030
|
-
/**
|
|
1031
1050
|
* Check if a value is a valid token value (string, number, or boolean - not object).
|
|
1032
1051
|
* Returns false for `false` values (they mean "skip this token").
|
|
1033
1052
|
*/
|
|
@@ -1051,9 +1070,24 @@ function processTokenValue(value) {
|
|
|
1051
1070
|
return parseStyle(value).output;
|
|
1052
1071
|
}
|
|
1053
1072
|
/**
|
|
1073
|
+
* Resolve one `$name` / `#name` entry to the custom property it declares and
|
|
1074
|
+
* the value to declare, or `null` when the entry declares nothing.
|
|
1075
|
+
*
|
|
1076
|
+
* The two sigils differ only in the property name they build and in how `true`
|
|
1077
|
+
* is read: for a custom property it is the empty value, for a color it is
|
|
1078
|
+
* `transparent`.
|
|
1079
|
+
*/
|
|
1080
|
+
function resolveTokenEntry(key, value) {
|
|
1081
|
+
const name = `--${normalizeDslName(key.slice(1))}`;
|
|
1082
|
+
if (key[0] === "$") return [name, processTokenValue(value === true ? "" : value)];
|
|
1083
|
+
const colorValue = normalizeColorTokenValue(value);
|
|
1084
|
+
if (colorValue === null) return null;
|
|
1085
|
+
return [`${name}-color`, processTokenValue(colorValue)];
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1054
1088
|
* Process tokens object into inline style properties.
|
|
1055
|
-
* -
|
|
1056
|
-
* -
|
|
1089
|
+
* - `$name` -> `--name` with the parsed value
|
|
1090
|
+
* - `#name` -> `--name-color` with the parsed value
|
|
1057
1091
|
*
|
|
1058
1092
|
* @param tokens - The tokens object to process
|
|
1059
1093
|
* @returns CSSProperties object or undefined if no tokens to process
|
|
@@ -1066,24 +1100,11 @@ function processTokens(tokens) {
|
|
|
1066
1100
|
for (const key of keys) {
|
|
1067
1101
|
const value = tokens[key];
|
|
1068
1102
|
if (!isValidTokenValue(value)) continue;
|
|
1069
|
-
if (key
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
} else if (key.startsWith("#")) {
|
|
1075
|
-
const colorName = normalizeDslName(key.slice(1));
|
|
1076
|
-
const suffix = getColorSpaceSuffix();
|
|
1077
|
-
const effectiveValue = normalizeColorTokenValue(value);
|
|
1078
|
-
if (effectiveValue === null) continue;
|
|
1079
|
-
const originalValue = typeof effectiveValue === "number" ? String(effectiveValue) : effectiveValue;
|
|
1080
|
-
const lowerValue = originalValue.toLowerCase();
|
|
1081
|
-
const processedValue = processTokenValue(effectiveValue);
|
|
1082
|
-
if (!result) result = {};
|
|
1083
|
-
result[`--${colorName}-color`] = processedValue;
|
|
1084
|
-
if (/^#current(?:\.|$)/i.test(lowerValue)) continue;
|
|
1085
|
-
result[`--${colorName}-color-${suffix}`] = extractColorSpaceValue(originalValue, processedValue);
|
|
1086
|
-
}
|
|
1103
|
+
if (key[0] !== "$" && key[0] !== "#") continue;
|
|
1104
|
+
const entry = resolveTokenEntry(key, value);
|
|
1105
|
+
if (!entry) continue;
|
|
1106
|
+
if (!result) result = {};
|
|
1107
|
+
result[entry[0]] = entry[1];
|
|
1087
1108
|
}
|
|
1088
1109
|
return result;
|
|
1089
1110
|
}
|
|
@@ -1101,13 +1122,6 @@ function sortTastyClasses(classes) {
|
|
|
1101
1122
|
function getRegistry(root = document) {
|
|
1102
1123
|
return injector.instance._sheetManager?.getRegistry(root);
|
|
1103
1124
|
}
|
|
1104
|
-
function getUnusedClasses(root = document) {
|
|
1105
|
-
const registry = getRegistry(root);
|
|
1106
|
-
if (!registry) return [];
|
|
1107
|
-
const result = [];
|
|
1108
|
-
for (const [cls, rc] of registry.refCounts) if (rc === 0) result.push(cls);
|
|
1109
|
-
return sortTastyClasses(result);
|
|
1110
|
-
}
|
|
1111
1125
|
function findDomTastyClasses(root = document) {
|
|
1112
1126
|
const classes = /* @__PURE__ */ new Set();
|
|
1113
1127
|
const elements = root.querySelectorAll?.("[class]") || [];
|
|
@@ -1120,6 +1134,25 @@ function findDomTastyClasses(root = document) {
|
|
|
1120
1134
|
});
|
|
1121
1135
|
return sortTastyClasses(classes);
|
|
1122
1136
|
}
|
|
1137
|
+
/**
|
|
1138
|
+
* Injected classes that no element carries and nobody pinned — the exact set
|
|
1139
|
+
* `gc({ force: true })` would delete.
|
|
1140
|
+
*
|
|
1141
|
+
* Deliberately borrowed from the injector rather than recomputed here: the two
|
|
1142
|
+
* drifted apart once before, when this file still read "unused" off the pin
|
|
1143
|
+
* counts the render path had stopped maintaining.
|
|
1144
|
+
*/
|
|
1145
|
+
function getUnusedClasses(root = document) {
|
|
1146
|
+
return sortTastyClasses(injector.instance.getUnusedClasses({ root }));
|
|
1147
|
+
}
|
|
1148
|
+
/** Every class this injector holds CSS for in `root`. */
|
|
1149
|
+
function getOwnedClasses(root = document) {
|
|
1150
|
+
const registry = getRegistry(root);
|
|
1151
|
+
if (!registry) return [];
|
|
1152
|
+
const owned = [];
|
|
1153
|
+
for (const [className, info] of registry.rules) if (info.sheetIndex >= 0) owned.push(className);
|
|
1154
|
+
return sortTastyClasses(owned);
|
|
1155
|
+
}
|
|
1123
1156
|
function prettifyCSS(css) {
|
|
1124
1157
|
if (!css || !css.trim()) return "";
|
|
1125
1158
|
const out = [];
|
|
@@ -1406,7 +1439,12 @@ const tastyDebug = {
|
|
|
1406
1439
|
const { root = document, raw = false } = opts || {};
|
|
1407
1440
|
const activeClasses = findDomTastyClasses(root);
|
|
1408
1441
|
const unusedClasses = getUnusedClasses(root);
|
|
1409
|
-
const
|
|
1442
|
+
const ownedClasses = getOwnedClasses(root);
|
|
1443
|
+
const totalStyledClasses = sortTastyClasses(new Set([...activeClasses, ...ownedClasses]));
|
|
1444
|
+
const unusedSet = new Set(unusedClasses);
|
|
1445
|
+
const activeSet = new Set(activeClasses);
|
|
1446
|
+
const hotClasses = ownedClasses.filter((className) => !activeSet.has(className) && !unusedSet.has(className));
|
|
1447
|
+
const hotCSS = injector.instance.getCSSTextForClasses(hotClasses, { root });
|
|
1410
1448
|
const activeCSS = injector.instance.getCSSTextForClasses(activeClasses, { root });
|
|
1411
1449
|
const unusedCSS = injector.instance.getCSSTextForClasses(unusedClasses, { root });
|
|
1412
1450
|
const allCSS = injector.instance.getCSSText({ root });
|
|
@@ -1416,13 +1454,14 @@ const tastyDebug = {
|
|
|
1416
1454
|
const rawData = getGlobalTypeCSS("raw", root);
|
|
1417
1455
|
const kfData = getGlobalTypeCSS("keyframes", root);
|
|
1418
1456
|
const propData = getGlobalTypeCSS("property", root);
|
|
1419
|
-
const totalRuleCount = activeRuleCount + unusedRuleCount + globalData.ruleCount + rawData.ruleCount + kfData.ruleCount + propData.ruleCount;
|
|
1457
|
+
const totalRuleCount = activeRuleCount + unusedRuleCount + countRules(hotCSS) + globalData.ruleCount + rawData.ruleCount + kfData.ruleCount + propData.ruleCount;
|
|
1420
1458
|
const metrics = injector.instance.getMetrics({ root });
|
|
1421
1459
|
const defs = getDefs(root);
|
|
1422
1460
|
const chunkBreakdown = buildChunkBreakdown(root);
|
|
1423
1461
|
const summary = {
|
|
1424
1462
|
activeClasses,
|
|
1425
1463
|
unusedClasses,
|
|
1464
|
+
hotClasses,
|
|
1426
1465
|
totalStyledClasses,
|
|
1427
1466
|
activeCSSSize: activeCSS.length,
|
|
1428
1467
|
unusedCSSSize: unusedCSS.length,
|
|
@@ -1447,6 +1486,7 @@ const tastyDebug = {
|
|
|
1447
1486
|
console.group("Tasty Summary");
|
|
1448
1487
|
console.log(`Active: ${activeClasses.length} classes, ${activeRuleCount} rules, ${fmtSize(activeCSS.length)}`);
|
|
1449
1488
|
console.log(`Unused: ${unusedClasses.length} classes, ${unusedRuleCount} rules, ${fmtSize(unusedCSS.length)}`);
|
|
1489
|
+
if (hotClasses.length) console.log(`Held: ${hotClasses.length} classes, ${countRules(hotCSS)} rules, ${fmtSize(hotCSS.length)} (not rendered, not yet collectable)`);
|
|
1450
1490
|
console.log(`Global: ${globalData.ruleCount} rules, ${fmtSize(globalData.size)}`);
|
|
1451
1491
|
if (rawData.ruleCount) console.log(`Raw: ${rawData.ruleCount} rules, ${fmtSize(rawData.size)}`);
|
|
1452
1492
|
if (kfData.ruleCount) console.log(`Keyframes: ${kfData.ruleCount} rules, ${fmtSize(kfData.size)}`);
|
|
@@ -1494,7 +1534,7 @@ const tastyDebug = {
|
|
|
1494
1534
|
classes: {
|
|
1495
1535
|
active,
|
|
1496
1536
|
unused,
|
|
1497
|
-
all: [...active, ...
|
|
1537
|
+
all: sortTastyClasses(new Set([...active, ...getOwnedClasses(root)]))
|
|
1498
1538
|
},
|
|
1499
1539
|
metrics
|
|
1500
1540
|
};
|
|
@@ -1544,6 +1584,6 @@ function getPageCSS(root = document) {
|
|
|
1544
1584
|
}
|
|
1545
1585
|
if (typeof window !== "undefined" && isDevEnv()) tastyDebug.install();
|
|
1546
1586
|
//#endregion
|
|
1547
|
-
export {
|
|
1587
|
+
export { keyframes as A, getRawCSSText as C, injectRawCSS as D, injectGlobal as E, chunkSheetRegistry as F, resolveFunctionColor as I, property as M, touch as N, injector as O, ChunkSheetRegistry as P, getCSSTextForNode as S, inject as T, destroy as _, color as a, gc as b, hasKeys as c, collectAutoInferredPropertiesRSC as d, getStyleTarget as f, createInjector as g, counterStyle as h, _modAttrs as i, ownKeyframes as j, isPropertyDefined as k, formatKeyframesCSS as l, cleanup as m, processTokens as n, filterBaseProps as o, pushRSCCSS as p, dotize as r, computeStyles as s, tastyDebug as t, collectAutoInferredProperties as u, fontFace as v, holdKeyframes as w, getCSSText as x, func as y };
|
|
1548
1588
|
|
|
1549
|
-
//# sourceMappingURL=core-
|
|
1589
|
+
//# sourceMappingURL=core-KVEKOhEi.js.map
|