@tenphi/tasty 0.0.0-snapshot.c8bdaeb → 0.0.0-snapshot.c8c7b2a
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 +309 -159
- package/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/chunks/cacheKey.d.ts +1 -0
- package/dist/chunks/cacheKey.js +17 -10
- package/dist/chunks/cacheKey.js.map +1 -1
- package/dist/chunks/definitions.d.ts +1 -1
- package/dist/chunks/definitions.js +3 -5
- package/dist/chunks/definitions.js.map +1 -1
- package/dist/chunks/index.d.ts +1 -0
- package/dist/chunks/renderChunk.d.ts +1 -0
- package/dist/chunks/renderChunk.js +32 -34
- package/dist/chunks/renderChunk.js.map +1 -1
- package/dist/compute-styles.d.ts +31 -0
- package/dist/compute-styles.js +322 -0
- package/dist/compute-styles.js.map +1 -0
- package/dist/config.d.ts +157 -30
- package/dist/config.js +233 -45
- package/dist/config.js.map +1 -1
- package/dist/core/index.d.ts +12 -11
- package/dist/core/index.js +12 -11
- package/dist/counter-style/index.js +51 -0
- package/dist/counter-style/index.js.map +1 -0
- package/dist/debug.d.ts +26 -141
- package/dist/debug.js +359 -639
- package/dist/debug.js.map +1 -1
- package/dist/font-face/index.js +63 -0
- package/dist/font-face/index.js.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/useCounterStyle.d.ts +36 -0
- package/dist/hooks/useCounterStyle.js +65 -0
- package/dist/hooks/useCounterStyle.js.map +1 -0
- package/dist/hooks/useFontFace.d.ts +45 -0
- package/dist/hooks/useFontFace.js +66 -0
- package/dist/hooks/useFontFace.js.map +1 -0
- package/dist/hooks/useGlobalStyles.d.ts +21 -2
- package/dist/hooks/useGlobalStyles.js +60 -28
- package/dist/hooks/useGlobalStyles.js.map +1 -1
- package/dist/hooks/useKeyframes.d.ts +4 -2
- package/dist/hooks/useKeyframes.js +44 -43
- package/dist/hooks/useKeyframes.js.map +1 -1
- package/dist/hooks/useProperty.d.ts +4 -2
- package/dist/hooks/useProperty.js +36 -31
- package/dist/hooks/useProperty.js.map +1 -1
- package/dist/hooks/useRawCSS.d.ts +13 -44
- package/dist/hooks/useRawCSS.js +91 -16
- package/dist/hooks/useRawCSS.js.map +1 -1
- package/dist/hooks/useStyles.d.ts +3 -3
- package/dist/hooks/useStyles.js +8 -146
- package/dist/hooks/useStyles.js.map +1 -1
- package/dist/index.d.ts +15 -12
- package/dist/index.js +15 -12
- package/dist/injector/index.d.ts +36 -11
- package/dist/injector/index.js +43 -12
- package/dist/injector/index.js.map +1 -1
- package/dist/injector/injector.d.ts +62 -3
- package/dist/injector/injector.js +293 -46
- package/dist/injector/injector.js.map +1 -1
- package/dist/injector/sheet-manager.d.ts +22 -17
- package/dist/injector/sheet-manager.js +64 -79
- package/dist/injector/sheet-manager.js.map +1 -1
- package/dist/injector/types.d.ts +121 -21
- package/dist/keyframes/index.js +1 -1
- package/dist/parser/classify.js +6 -6
- package/dist/parser/classify.js.map +1 -1
- package/dist/parser/const.js +30 -3
- package/dist/parser/const.js.map +1 -1
- package/dist/parser/lru.js +1 -1
- package/dist/parser/lru.js.map +1 -1
- package/dist/parser/parser.js +2 -3
- package/dist/parser/parser.js.map +1 -1
- package/dist/parser/tokenizer.js +1 -1
- package/dist/parser/tokenizer.js.map +1 -1
- package/dist/parser/types.js +1 -1
- package/dist/parser/types.js.map +1 -1
- package/dist/pipeline/conditions.js +1 -1
- package/dist/pipeline/conditions.js.map +1 -1
- package/dist/pipeline/exclusive.js +58 -4
- package/dist/pipeline/exclusive.js.map +1 -1
- package/dist/pipeline/index.d.ts +3 -1
- package/dist/pipeline/index.js +82 -34
- package/dist/pipeline/index.js.map +1 -1
- package/dist/pipeline/materialize.js +436 -123
- package/dist/pipeline/materialize.js.map +1 -1
- package/dist/pipeline/parseStateKey.d.ts +1 -1
- package/dist/pipeline/parseStateKey.js +21 -13
- package/dist/pipeline/parseStateKey.js.map +1 -1
- package/dist/pipeline/simplify.js +181 -7
- package/dist/pipeline/simplify.js.map +1 -1
- package/dist/pipeline/warnings.js +1 -1
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/okhsl-plugin.js +3 -277
- package/dist/plugins/okhsl-plugin.js.map +1 -1
- package/dist/plugins/types.d.ts +20 -2
- package/dist/properties/index.js +83 -19
- package/dist/properties/index.js.map +1 -1
- package/dist/properties/property-type-resolver.d.ts +24 -0
- package/dist/properties/property-type-resolver.js +90 -0
- package/dist/properties/property-type-resolver.js.map +1 -0
- package/dist/rsc-cache.js +79 -0
- package/dist/rsc-cache.js.map +1 -0
- package/dist/ssr/astro-client.d.ts +1 -0
- package/dist/ssr/astro-client.js +19 -0
- package/dist/ssr/astro-client.js.map +1 -0
- package/dist/ssr/astro-middleware.d.ts +15 -0
- package/dist/ssr/astro-middleware.js +19 -0
- package/dist/ssr/astro-middleware.js.map +1 -0
- package/dist/ssr/astro.d.ts +108 -0
- package/dist/ssr/astro.js +149 -0
- package/dist/ssr/astro.js.map +1 -0
- package/dist/ssr/async-storage.d.ts +17 -0
- package/dist/ssr/async-storage.js +44 -0
- package/dist/ssr/async-storage.js.map +1 -0
- package/dist/ssr/collect-auto-properties.js +58 -0
- package/dist/ssr/collect-auto-properties.js.map +1 -0
- package/dist/ssr/collector.d.ts +98 -0
- package/dist/ssr/collector.js +235 -0
- package/dist/ssr/collector.js.map +1 -0
- package/dist/ssr/context.js +16 -0
- package/dist/ssr/context.js.map +1 -0
- package/dist/ssr/format-global-rules.js +22 -0
- package/dist/ssr/format-global-rules.js.map +1 -0
- package/dist/ssr/format-keyframes.js +69 -0
- package/dist/ssr/format-keyframes.js.map +1 -0
- package/dist/ssr/format-property.js +49 -0
- package/dist/ssr/format-property.js.map +1 -0
- package/dist/ssr/format-rules.js +73 -0
- package/dist/ssr/format-rules.js.map +1 -0
- package/dist/ssr/hydrate.d.ts +29 -0
- package/dist/ssr/hydrate.js +45 -0
- package/dist/ssr/hydrate.js.map +1 -0
- package/dist/ssr/index.d.ts +4 -0
- package/dist/ssr/index.js +10 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/next.d.ts +46 -0
- package/dist/ssr/next.js +75 -0
- package/dist/ssr/next.js.map +1 -0
- package/dist/ssr/ssr-collector-ref.js +29 -0
- package/dist/ssr/ssr-collector-ref.js.map +1 -0
- package/dist/states/index.js +13 -259
- package/dist/states/index.js.map +1 -1
- package/dist/static/index.js +1 -2
- package/dist/static/inject.d.ts +5 -0
- package/dist/static/inject.js +17 -0
- package/dist/static/inject.js.map +1 -0
- package/dist/static/tastyStatic.js +1 -2
- package/dist/static/tastyStatic.js.map +1 -1
- package/dist/static/types.js +1 -1
- package/dist/styles/border.d.ts +1 -1
- package/dist/styles/border.js +30 -24
- package/dist/styles/border.js.map +1 -1
- package/dist/styles/color.d.ts +1 -1
- package/dist/styles/color.js +11 -8
- package/dist/styles/color.js.map +1 -1
- package/dist/styles/const.js +17 -0
- package/dist/styles/const.js.map +1 -0
- package/dist/styles/createStyle.js +28 -26
- package/dist/styles/createStyle.js.map +1 -1
- package/dist/styles/dimension.js +15 -3
- package/dist/styles/dimension.js.map +1 -1
- package/dist/styles/directional.js +133 -0
- package/dist/styles/directional.js.map +1 -0
- package/dist/styles/display.d.ts +3 -10
- package/dist/styles/display.js +45 -39
- package/dist/styles/display.js.map +1 -1
- package/dist/styles/fade.d.ts +1 -1
- package/dist/styles/fade.js +9 -5
- package/dist/styles/fade.js.map +1 -1
- package/dist/styles/fill.d.ts +2 -2
- package/dist/styles/fill.js +9 -9
- package/dist/styles/fill.js.map +1 -1
- package/dist/styles/flow.js +1 -1
- package/dist/styles/gap.d.ts +1 -1
- package/dist/styles/gap.js +4 -3
- package/dist/styles/gap.js.map +1 -1
- package/dist/styles/height.d.ts +1 -1
- package/dist/styles/height.js +1 -2
- package/dist/styles/height.js.map +1 -1
- package/dist/styles/index.d.ts +0 -1
- package/dist/styles/index.js +3 -4
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/inset.d.ts +1 -29
- package/dist/styles/inset.js +19 -135
- package/dist/styles/inset.js.map +1 -1
- package/dist/styles/list.d.ts +5 -5
- package/dist/styles/list.js +4 -2
- package/dist/styles/list.js.map +1 -1
- package/dist/styles/margin.d.ts +1 -1
- package/dist/styles/margin.js +17 -89
- package/dist/styles/margin.js.map +1 -1
- package/dist/styles/outline.d.ts +1 -1
- package/dist/styles/outline.js +6 -16
- package/dist/styles/outline.js.map +1 -1
- package/dist/styles/padding.d.ts +1 -1
- package/dist/styles/padding.js +17 -89
- package/dist/styles/padding.js.map +1 -1
- package/dist/styles/placement.d.ts +37 -0
- package/dist/styles/placement.js +74 -0
- package/dist/styles/placement.js.map +1 -0
- package/dist/styles/predefined.d.ts +4 -6
- package/dist/styles/predefined.js +9 -13
- package/dist/styles/predefined.js.map +1 -1
- package/dist/styles/preset.d.ts +6 -1
- package/dist/styles/preset.js +54 -53
- package/dist/styles/preset.js.map +1 -1
- package/dist/styles/radius.d.ts +1 -3
- package/dist/styles/radius.js +38 -6
- package/dist/styles/radius.js.map +1 -1
- package/dist/styles/scrollMargin.d.ts +24 -0
- package/dist/styles/scrollMargin.js +32 -0
- package/dist/styles/scrollMargin.js.map +1 -0
- package/dist/styles/scrollbar.d.ts +9 -5
- package/dist/styles/scrollbar.js +31 -92
- package/dist/styles/scrollbar.js.map +1 -1
- package/dist/styles/shadow.d.ts +1 -1
- package/dist/styles/shadow.js +4 -3
- package/dist/styles/shadow.js.map +1 -1
- package/dist/styles/shared.js +17 -0
- package/dist/styles/shared.js.map +1 -0
- package/dist/styles/transition.d.ts +1 -1
- package/dist/styles/transition.js +6 -5
- package/dist/styles/transition.js.map +1 -1
- package/dist/styles/types.d.ts +94 -28
- package/dist/styles/width.d.ts +1 -1
- package/dist/styles/width.js +1 -2
- package/dist/styles/width.js.map +1 -1
- package/dist/tasty.d.ts +46 -894
- package/dist/tasty.js +101 -59
- package/dist/tasty.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/cache-wrapper.js +4 -9
- package/dist/utils/cache-wrapper.js.map +1 -1
- package/dist/utils/case-converter.js +1 -1
- package/dist/utils/color-math.d.ts +46 -0
- package/dist/utils/color-math.js +749 -0
- package/dist/utils/color-math.js.map +1 -0
- package/dist/utils/color-space.d.ts +5 -0
- package/dist/utils/color-space.js +228 -0
- package/dist/utils/color-space.js.map +1 -0
- package/dist/utils/colors.js +3 -2
- package/dist/utils/colors.js.map +1 -1
- package/dist/utils/deps-equal.js +15 -0
- package/dist/utils/deps-equal.js.map +1 -0
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/dotize.js.map +1 -1
- package/dist/utils/filter-base-props.d.ts +1 -1
- package/dist/utils/filter-base-props.js +1 -1
- package/dist/utils/filter-base-props.js.map +1 -1
- package/dist/utils/get-display-name.js +1 -1
- package/dist/utils/has-keys.js +13 -0
- package/dist/utils/has-keys.js.map +1 -0
- package/dist/utils/hash.js +14 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/is-dev-env.js.map +1 -1
- package/dist/utils/is-valid-element-type.js +1 -1
- package/dist/utils/merge-styles.js +1 -2
- package/dist/utils/merge-styles.js.map +1 -1
- package/dist/utils/mod-attrs.d.ts +0 -2
- package/dist/utils/mod-attrs.js +3 -4
- package/dist/utils/mod-attrs.js.map +1 -1
- package/dist/utils/process-tokens.d.ts +3 -17
- package/dist/utils/process-tokens.js +19 -107
- package/dist/utils/process-tokens.js.map +1 -1
- package/dist/utils/resolve-recipes.js +1 -2
- package/dist/utils/resolve-recipes.js.map +1 -1
- package/dist/utils/selector-transform.js +32 -0
- package/dist/utils/selector-transform.js.map +1 -0
- package/dist/utils/string.js +1 -1
- package/dist/utils/styles.d.ts +3 -82
- package/dist/utils/styles.js +29 -399
- package/dist/utils/styles.js.map +1 -1
- package/dist/utils/typography.d.ts +35 -13
- package/dist/utils/typography.js +16 -18
- package/dist/utils/typography.js.map +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/zero/babel.d.ts +57 -84
- package/dist/zero/babel.js +217 -37
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/css-writer.js +1 -2
- package/dist/zero/css-writer.js.map +1 -1
- package/dist/zero/extractor.js +119 -3
- package/dist/zero/extractor.js.map +1 -1
- package/dist/zero/index.js +1 -2
- package/dist/zero/next.d.ts +56 -30
- package/dist/zero/next.js +105 -40
- package/dist/zero/next.js.map +1 -1
- package/docs/README.md +31 -0
- package/docs/adoption.md +298 -0
- package/docs/comparison.md +419 -0
- package/docs/configuration.md +394 -0
- package/docs/debug.md +320 -0
- package/docs/design-system.md +436 -0
- package/docs/dsl.md +688 -0
- package/docs/getting-started.md +217 -0
- package/docs/injector.md +544 -0
- package/docs/methodology.md +616 -0
- package/docs/pipeline.md +519 -0
- package/docs/react-api.md +557 -0
- package/docs/ssr.md +442 -0
- package/docs/styles.md +596 -0
- package/docs/tasty-static.md +532 -0
- package/package.json +68 -36
- package/dist/styles/align.d.ts +0 -15
- package/dist/styles/align.js +0 -14
- package/dist/styles/align.js.map +0 -1
- package/dist/styles/justify.d.ts +0 -15
- package/dist/styles/justify.js +0 -14
- package/dist/styles/justify.js.map +0 -1
- package/dist/styles/styledScrollbar.d.ts +0 -47
- package/dist/styles/styledScrollbar.js +0 -38
- package/dist/styles/styledScrollbar.js.map +0 -1
- package/dist/tokens/typography.d.ts +0 -19
- package/dist/tokens/typography.js +0 -237
- package/dist/tokens/typography.js.map +0 -1
- package/dist/utils/hsl-to-rgb.js +0 -38
- package/dist/utils/hsl-to-rgb.js.map +0 -1
- package/dist/utils/okhsl-to-rgb.js +0 -296
- package/dist/utils/okhsl-to-rgb.js.map +0 -1
package/dist/core/index.d.ts
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import { CacheMetrics, DisposeFunction, InjectResult, KeyframesCacheEntry, KeyframesInfo, KeyframesResult, KeyframesSteps, PropertyDefinition, RawCSSResult, RootRegistry, RuleInfo, SheetInfo, StyleInjectorConfig, StyleRule } from "../injector/types.js";
|
|
1
|
+
import { CacheMetrics, CounterStyleDescriptors, DisposeFunction, FontFaceDescriptors, FontFaceInput, GCConfig, GCOptions, InjectResult, KeyframesCacheEntry, KeyframesInfo, KeyframesResult, KeyframesSteps, PropertyDefinition, RawCSSResult, RootRegistry, RuleInfo, SheetInfo, StyleInjectorConfig, StyleRule, StyleUsage } from "../injector/types.js";
|
|
2
2
|
import { CSSProperties } from "../utils/css-types.js";
|
|
3
3
|
import { Bucket, ParserOptions, ProcessedStyle, StyleDetails, StyleDetailsPart, UnitHandler } from "../parser/types.js";
|
|
4
4
|
import { StyleParser } from "../parser/parser.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { NoType, NotSelector, RecipeStyles, Selector, Styles, StylesInterface, StylesWithoutSelectors, SuffixForSelector, TastyNamedColors, TastyPresetNames } from "../styles/types.js";
|
|
5
|
+
import { getNamedColorHex, getRgbValuesFromRgbaString, hexToRgb, hslToRgbValues, strToRgb } from "../utils/color-math.js";
|
|
6
|
+
import { CSSMap, CUSTOM_UNITS, DIRECTIONS, ParsedColor, RawStyleHandler, StyleHandler, StyleHandlerDefinition, StyleHandlerResult, StyleMap, StylePropValue, StyleValue, StyleValueStateMap, customFunc, filterMods, getGlobalFuncs, getGlobalParser, getGlobalPredefinedTokens, normalizeColorTokenValue, parseColor, parseStyle, resetGlobalPredefinedTokens, setGlobalPredefinedTokens, stringifyStyles } from "../utils/styles.js";
|
|
7
|
+
import { ConfigTokenValue, ConfigTokens, NoType, NotSelector, RecipeStyles, Selector, Styles, StylesInterface, StylesWithoutSelectors, SuffixForSelector, TastyNamedColors, TastyPresetNames } from "../styles/types.js";
|
|
8
8
|
import { ConditionNode } from "../pipeline/conditions.js";
|
|
9
|
+
import { AtRuleContext, ParsedAdvancedState, StateParserContext, createStateParserContext, getGlobalPredefinedStates, setGlobalPredefinedStates } from "../states/index.js";
|
|
9
10
|
import { ParseStateKeyOptions, parseStateKey } from "../pipeline/parseStateKey.js";
|
|
10
11
|
import { RenderResult, StyleResult, isSelector, renderStyles } from "../pipeline/index.js";
|
|
11
12
|
import { SheetManager } from "../injector/sheet-manager.js";
|
|
12
13
|
import { StyleInjector } from "../injector/injector.js";
|
|
14
|
+
import { ColorSpace } from "../utils/color-space.js";
|
|
15
|
+
import { TypographyPreset, TypographyTokenValue, generateTypographyTokens } from "../utils/typography.js";
|
|
13
16
|
import { TastyPlugin, TastyPluginFactory } from "../plugins/types.js";
|
|
14
|
-
import { TastyConfig, configure, getConfig, getGlobalKeyframes, getGlobalRecipes, hasGlobalKeyframes, hasGlobalRecipes, hasStylesGenerated, isConfigLocked, isTestEnvironment, resetConfig } from "../config.js";
|
|
17
|
+
import { TastyConfig, configure, getConfig, getGlobalCounterStyle, getGlobalFontFace, getGlobalKeyframes, getGlobalRecipes, hasGlobalKeyframes, hasGlobalRecipes, hasStylesGenerated, isConfigLocked, isTestEnvironment, resetConfig } from "../config.js";
|
|
15
18
|
import { okhslFunc, okhslPlugin } from "../plugins/okhsl-plugin.js";
|
|
16
19
|
import { CHUNK_NAMES, ChunkInfo, ChunkName, STYLE_TO_CHUNK, categorizeStyleKeys } from "../chunks/definitions.js";
|
|
17
|
-
import { PropertyOptions, allocateClassName, cleanup, createInjector, destroy, getCssText, getCssTextForNode, getIsTestEnvironment, getRawCSSText, inject, injectGlobal, injectRawCSS, injector, isPropertyDefined, keyframes, property } from "../injector/index.js";
|
|
18
20
|
import { BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, COLOR_STYLES, CONTAINER_STYLES, DIMENSION_STYLES, FLOW_STYLES, INNER_STYLES, OUTER_STYLES, POSITION_STYLES, TEXT_STYLES } from "../styles/list.js";
|
|
19
21
|
import { BaseStyleProps, BlockInnerStyleProps, BlockOuterStyleProps, BlockStyleProps, ColorStyleProps, ContainerStyleProps, DimensionStyleProps, FlowStyleProps, GlobalStyledProps, InnerStyleProps, ModValue, Mods, OuterStyleProps, PositionStyleProps, Props, ShortGridStyles, TagName, TastyExtensionConfig, TastyThemeNames, TextStyleProps, TokenValue, Tokens } from "../types.js";
|
|
20
22
|
import { styleHandlers } from "../styles/predefined.js";
|
|
21
|
-
import "../styles
|
|
23
|
+
import { ComputeStylesOptions, ComputeStylesResult, computeStyles } from "../compute-styles.js";
|
|
24
|
+
import { PropertyOptions, cleanup, counterStyle, createInjector, destroy, fontFace, gc, getCssText, getCssTextForNode, getIsTestEnvironment, getRawCSSText, inject, injectGlobal, injectRawCSS, injector, isPropertyDefined, keyframes, property, touch } from "../injector/index.js";
|
|
22
25
|
import { filterBaseProps } from "../utils/filter-base-props.js";
|
|
23
26
|
import { color } from "../utils/colors.js";
|
|
24
27
|
import { _modAttrs } from "../utils/mod-attrs.js";
|
|
@@ -26,8 +29,6 @@ import { dotize } from "../utils/dotize.js";
|
|
|
26
29
|
import { mergeStyles } from "../utils/merge-styles.js";
|
|
27
30
|
import { resolveRecipes } from "../utils/resolve-recipes.js";
|
|
28
31
|
import { deprecationWarning, warn } from "../utils/warnings.js";
|
|
29
|
-
import {
|
|
30
|
-
import { TypographyPreset } from "../tokens/typography.js";
|
|
31
|
-
import { generateTypographyTokens } from "../utils/typography.js";
|
|
32
|
+
import { processTokens } from "../utils/process-tokens.js";
|
|
32
33
|
import { tastyDebug } from "../debug.js";
|
|
33
|
-
export { type AtRuleContext, BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, type BaseStyleProps, type BlockInnerStyleProps, type BlockOuterStyleProps, type BlockStyleProps, Bucket, CHUNK_NAMES, COLOR_STYLES,
|
|
34
|
+
export { type AtRuleContext, BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, type BaseStyleProps, type BlockInnerStyleProps, type BlockOuterStyleProps, type BlockStyleProps, Bucket, CHUNK_NAMES, COLOR_STYLES, CONTAINER_STYLES, CSSMap, type CSSProperties, CUSTOM_UNITS, CacheMetrics, type ChunkInfo, type ChunkName, type ColorSpace, type ColorStyleProps, type ComputeStylesOptions, type ComputeStylesResult, type ConditionNode, type ConfigTokenValue, type ConfigTokens, type ContainerStyleProps, CounterStyleDescriptors, DIMENSION_STYLES, DIRECTIONS, type DimensionStyleProps, DisposeFunction, FLOW_STYLES, type FlowStyleProps, FontFaceDescriptors, FontFaceInput, GCConfig, GCOptions, type GlobalStyledProps, INNER_STYLES, InjectResult, type InnerStyleProps, KeyframesCacheEntry, KeyframesInfo, KeyframesResult, KeyframesSteps, type ModValue, type Mods, type NoType, type NotSelector, OUTER_STYLES, type OuterStyleProps, POSITION_STYLES, type ParseStateKeyOptions, type ParsedAdvancedState, ParsedColor, type ParserOptions, type PositionStyleProps, type ProcessedStyle, PropertyDefinition, PropertyOptions, type Props, RawCSSResult, RawStyleHandler, type RecipeStyles, type RenderResult, RootRegistry, RuleInfo, STYLE_TO_CHUNK, type Selector, SheetInfo, SheetManager, type ShortGridStyles, type StateParserContext, type StyleDetails, type StyleDetailsPart, StyleHandler, StyleHandlerDefinition, StyleHandlerResult, StyleInjector, StyleInjectorConfig, StyleMap, StyleParser, StylePropValue, type StyleResult, StyleRule, StyleUsage, StyleValue, StyleValueStateMap, type Styles, type StylesInterface, type StylesWithoutSelectors, type SuffixForSelector, TEXT_STYLES, type TagName, type TastyConfig, type TastyExtensionConfig, type TastyNamedColors, type TastyPlugin, type TastyPluginFactory, type TastyPresetNames, type TastyThemeNames, type TextStyleProps, type TokenValue, type Tokens, TypographyPreset, TypographyTokenValue, type UnitHandler, categorizeStyleKeys, cleanup, color, computeStyles, configure, counterStyle, createInjector, createStateParserContext, customFunc, deprecationWarning, destroy, dotize, filterBaseProps, filterMods, fontFace, gc, generateTypographyTokens, getConfig, getCssText, getCssTextForNode, getGlobalCounterStyle, getGlobalFontFace, getGlobalFuncs, getGlobalKeyframes, getGlobalParser, getGlobalPredefinedStates, getGlobalPredefinedTokens, getGlobalRecipes, getIsTestEnvironment, getNamedColorHex, getRawCSSText, getRgbValuesFromRgbaString, hasGlobalKeyframes, hasGlobalRecipes, hasStylesGenerated, hexToRgb, hslToRgbValues, inject, injectGlobal, injectRawCSS, injector, isConfigLocked, isPropertyDefined, isSelector, isTestEnvironment, keyframes, mergeStyles, _modAttrs as modAttrs, normalizeColorTokenValue, okhslFunc, okhslPlugin, parseColor, parseStateKey, parseStyle, processTokens, property, renderStyles, resetConfig, resetGlobalPredefinedTokens, resolveRecipes, setGlobalPredefinedStates, setGlobalPredefinedTokens, strToRgb, stringifyStyles, styleHandlers, tastyDebug, touch, warn };
|
package/dist/core/index.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
+
import { getNamedColorHex, getRgbValuesFromRgbaString, hexToRgb, hslToRgbValues, strToRgb } from "../utils/color-math.js";
|
|
1
2
|
import { Bucket } from "../parser/types.js";
|
|
2
3
|
import { StyleParser } from "../parser/parser.js";
|
|
3
4
|
import { okhslFunc, okhslPlugin } from "../plugins/okhsl-plugin.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { COMPUTE_FUNC_MAP, CUSTOM_UNITS, DIRECTIONS, STATE_OPERATORS, STATE_OPERATOR_LIST, buildAtRuleContext, computeState, customFunc, extendStyles, extractStyles, filterMods, getGlobalFuncs, getGlobalParser, getGlobalPredefinedTokens, getModSelector, getRgbValuesFromRgbaString, hexToRgb, isAdvancedStateToken, normalizeColorTokenValue, parseColor, parseStateNotation, parseStyle, resetGlobalPredefinedTokens, setGlobalPredefinedTokens, strToRgb, stringifyStyles, styleStateMapToStyleStateDataList } from "../utils/styles.js";
|
|
5
|
+
import { CUSTOM_UNITS, DIRECTIONS, customFunc, filterMods, getGlobalFuncs, getGlobalParser, getGlobalPredefinedTokens, normalizeColorTokenValue, parseColor, parseStyle, resetGlobalPredefinedTokens, setGlobalPredefinedTokens, stringifyStyles } from "../utils/styles.js";
|
|
6
|
+
import { deprecationWarning, warn } from "../utils/warnings.js";
|
|
7
7
|
import { styleHandlers } from "../styles/predefined.js";
|
|
8
8
|
import { SheetManager } from "../injector/sheet-manager.js";
|
|
9
9
|
import { StyleInjector } from "../injector/injector.js";
|
|
10
|
+
import { createStateParserContext, getGlobalPredefinedStates, setGlobalPredefinedStates } from "../states/index.js";
|
|
10
11
|
import { parseStateKey } from "../pipeline/parseStateKey.js";
|
|
11
12
|
import { isSelector, renderStyles } from "../pipeline/index.js";
|
|
12
|
-
import {
|
|
13
|
+
import { generateTypographyTokens } from "../utils/typography.js";
|
|
14
|
+
import { configure, getConfig, getGlobalCounterStyle, getGlobalFontFace, getGlobalKeyframes, getGlobalRecipes, hasGlobalKeyframes, hasGlobalRecipes, hasStylesGenerated, isConfigLocked, isTestEnvironment, resetConfig } from "../config.js";
|
|
13
15
|
import { CHUNK_NAMES, STYLE_TO_CHUNK, categorizeStyleKeys } from "../chunks/definitions.js";
|
|
14
16
|
import { BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, COLOR_STYLES, CONTAINER_STYLES, DIMENSION_STYLES, FLOW_STYLES, INNER_STYLES, OUTER_STYLES, POSITION_STYLES, TEXT_STYLES } from "../styles/list.js";
|
|
15
|
-
import {
|
|
17
|
+
import { cleanup, counterStyle, createInjector, destroy, fontFace, gc, getCssText, getCssTextForNode, getIsTestEnvironment, getRawCSSText, inject, injectGlobal, injectRawCSS, injector, isPropertyDefined, keyframes, property, touch } from "../injector/index.js";
|
|
18
|
+
import { mergeStyles } from "../utils/merge-styles.js";
|
|
19
|
+
import { resolveRecipes } from "../utils/resolve-recipes.js";
|
|
20
|
+
import { computeStyles } from "../compute-styles.js";
|
|
16
21
|
import { filterBaseProps } from "../utils/filter-base-props.js";
|
|
17
22
|
import { color } from "../utils/colors.js";
|
|
18
23
|
import { _modAttrs } from "../utils/mod-attrs.js";
|
|
19
24
|
import { dotize } from "../utils/dotize.js";
|
|
20
|
-
import {
|
|
21
|
-
import { resolveRecipes } from "../utils/resolve-recipes.js";
|
|
22
|
-
import { deprecationWarning, warn } from "../utils/warnings.js";
|
|
23
|
-
import { generateTypographyTokens } from "../utils/typography.js";
|
|
25
|
+
import { processTokens } from "../utils/process-tokens.js";
|
|
24
26
|
import { tastyDebug } from "../debug.js";
|
|
25
|
-
|
|
26
|
-
export { BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, Bucket, CHUNK_NAMES, COLOR_STYLES, COMPUTE_FUNC_MAP, CONTAINER_STYLES, CUSTOM_UNITS, DIMENSION_STYLES, DIRECTIONS, FLOW_STYLES, INNER_STYLES, OUTER_STYLES, POSITION_STYLES, STATE_OPERATORS, STATE_OPERATOR_LIST, STYLE_TO_CHUNK, SheetManager, StyleInjector, StyleParser, TEXT_STYLES, allocateClassName, buildAtRuleContext, categorizeStyleKeys, cleanup, color, computeState, configure, createInjector, createStateParserContext, customFunc, deprecationWarning, destroy, dotize, extendStyles, extractStyles, filterBaseProps, filterMods, generateTypographyTokens, getConfig, getCssText, getCssTextForNode, getGlobalFuncs, getGlobalKeyframes, getGlobalParser, getGlobalPredefinedStates, getGlobalPredefinedTokens, getGlobalRecipes, getIsTestEnvironment, getModSelector, getRawCSSText, getRgbValuesFromRgbaString, hasGlobalKeyframes, hasGlobalRecipes, hasStylesGenerated, hexToRgb, hslToRgbValues, inject, injectGlobal, injectRawCSS, injector, isAdvancedStateToken, isConfigLocked, isPropertyDefined, isSelector, isTestEnvironment, keyframes, mergeStyles, _modAttrs as modAttrs, normalizeColorTokenValue, okhslFunc, okhslPlugin, parseColor, parseStateKey, parseStateNotation, parseStyle, processTokens, property, renderStyles, resetConfig, resetGlobalPredefinedTokens, resolveRecipes, setGlobalPredefinedStates, setGlobalPredefinedTokens, strToRgb, stringifyStyles, stringifyTokens, styleHandlers, styleStateMapToStyleStateDataList, tastyDebug, warn };
|
|
27
|
+
export { BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, Bucket, CHUNK_NAMES, COLOR_STYLES, CONTAINER_STYLES, CUSTOM_UNITS, DIMENSION_STYLES, DIRECTIONS, FLOW_STYLES, INNER_STYLES, OUTER_STYLES, POSITION_STYLES, STYLE_TO_CHUNK, SheetManager, StyleInjector, StyleParser, TEXT_STYLES, categorizeStyleKeys, cleanup, color, computeStyles, configure, counterStyle, createInjector, createStateParserContext, customFunc, deprecationWarning, destroy, dotize, filterBaseProps, filterMods, fontFace, gc, generateTypographyTokens, getConfig, getCssText, getCssTextForNode, getGlobalCounterStyle, getGlobalFontFace, getGlobalFuncs, getGlobalKeyframes, getGlobalParser, getGlobalPredefinedStates, getGlobalPredefinedTokens, getGlobalRecipes, getIsTestEnvironment, getNamedColorHex, getRawCSSText, getRgbValuesFromRgbaString, hasGlobalKeyframes, hasGlobalRecipes, hasStylesGenerated, hexToRgb, hslToRgbValues, inject, injectGlobal, injectRawCSS, injector, isConfigLocked, isPropertyDefined, isSelector, isTestEnvironment, keyframes, mergeStyles, _modAttrs as modAttrs, normalizeColorTokenValue, okhslFunc, okhslPlugin, parseColor, parseStateKey, parseStyle, processTokens, property, renderStyles, resetConfig, resetGlobalPredefinedTokens, resolveRecipes, setGlobalPredefinedStates, setGlobalPredefinedTokens, strToRgb, stringifyStyles, styleHandlers, tastyDebug, touch, warn };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//#region src/counter-style/index.ts
|
|
2
|
+
const COUNTER_STYLE_KEY = "@counterStyle";
|
|
3
|
+
/**
|
|
4
|
+
* Check if styles object has local @counterStyle definition.
|
|
5
|
+
*/
|
|
6
|
+
function hasLocalCounterStyle(styles) {
|
|
7
|
+
return COUNTER_STYLE_KEY in styles;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Extract local @counterStyle from styles object.
|
|
11
|
+
* Returns null if no local counter styles (fast path).
|
|
12
|
+
*/
|
|
13
|
+
function extractLocalCounterStyle(styles) {
|
|
14
|
+
const counterStyle = styles[COUNTER_STYLE_KEY];
|
|
15
|
+
if (!counterStyle || typeof counterStyle !== "object") return null;
|
|
16
|
+
return counterStyle;
|
|
17
|
+
}
|
|
18
|
+
const COUNTER_STYLE_DESCRIPTOR_MAP = {
|
|
19
|
+
system: "system",
|
|
20
|
+
symbols: "symbols",
|
|
21
|
+
additiveSymbols: "additive-symbols",
|
|
22
|
+
prefix: "prefix",
|
|
23
|
+
suffix: "suffix",
|
|
24
|
+
negative: "negative",
|
|
25
|
+
range: "range",
|
|
26
|
+
pad: "pad",
|
|
27
|
+
fallback: "fallback",
|
|
28
|
+
speakAs: "speak-as"
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Format the inner declarations of a @counter-style rule (no wrapper).
|
|
32
|
+
* Used by the injector which needs selector and declarations separately.
|
|
33
|
+
*/
|
|
34
|
+
function formatCounterStyleDeclarations(descriptors) {
|
|
35
|
+
const parts = [];
|
|
36
|
+
for (const [key, cssName] of Object.entries(COUNTER_STYLE_DESCRIPTOR_MAP)) {
|
|
37
|
+
const value = descriptors[key];
|
|
38
|
+
if (value !== void 0) parts.push(`${cssName}: ${value};`);
|
|
39
|
+
}
|
|
40
|
+
return parts.join(" ");
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Format a @counter-style rule as CSS.
|
|
44
|
+
*/
|
|
45
|
+
function formatCounterStyleRule(name, descriptors) {
|
|
46
|
+
return `@counter-style ${name} { ${formatCounterStyleDeclarations(descriptors)} }`;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { extractLocalCounterStyle, formatCounterStyleDeclarations, formatCounterStyleRule, hasLocalCounterStyle };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/counter-style/index.ts"],"sourcesContent":["/**\n * Counter Style Utilities\n *\n * Utilities for extracting and processing CSS @counter-style definitions in styles.\n * Counter-style rules are permanent once injected and do not need cleanup.\n */\n\nimport type { CounterStyleDescriptors } from '../injector/types';\nimport type { Styles } from '../styles/types';\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nconst COUNTER_STYLE_KEY = '@counterStyle';\n\n// ============================================================================\n// Extraction Functions\n// ============================================================================\n\n/**\n * Check if styles object has local @counterStyle definition.\n */\nexport function hasLocalCounterStyle(styles: Styles): boolean {\n return COUNTER_STYLE_KEY in styles;\n}\n\n/**\n * Extract local @counterStyle from styles object.\n * Returns null if no local counter styles (fast path).\n */\nexport function extractLocalCounterStyle(\n styles: Styles,\n): Record<string, CounterStyleDescriptors> | null {\n const counterStyle = styles[COUNTER_STYLE_KEY];\n if (!counterStyle || typeof counterStyle !== 'object') {\n return null;\n }\n return counterStyle as Record<string, CounterStyleDescriptors>;\n}\n\n// ============================================================================\n// CSS Formatting\n// ============================================================================\n\nconst COUNTER_STYLE_DESCRIPTOR_MAP: Record<string, string> = {\n system: 'system',\n symbols: 'symbols',\n additiveSymbols: 'additive-symbols',\n prefix: 'prefix',\n suffix: 'suffix',\n negative: 'negative',\n range: 'range',\n pad: 'pad',\n fallback: 'fallback',\n speakAs: 'speak-as',\n};\n\n/**\n * Format the inner declarations of a @counter-style rule (no wrapper).\n * Used by the injector which needs selector and declarations separately.\n */\nexport function formatCounterStyleDeclarations(\n descriptors: CounterStyleDescriptors,\n): string {\n const parts: string[] = [];\n\n for (const [key, cssName] of Object.entries(COUNTER_STYLE_DESCRIPTOR_MAP)) {\n const value = descriptors[key as keyof CounterStyleDescriptors];\n if (value !== undefined) {\n parts.push(`${cssName}: ${value};`);\n }\n }\n\n return parts.join(' ');\n}\n\n/**\n * Format a @counter-style rule as CSS.\n */\nexport function formatCounterStyleRule(\n name: string,\n descriptors: CounterStyleDescriptors,\n): string {\n return `@counter-style ${name} { ${formatCounterStyleDeclarations(descriptors)} }`;\n}\n"],"mappings":";AAcA,MAAM,oBAAoB;;;;AAS1B,SAAgB,qBAAqB,QAAyB;AAC5D,QAAO,qBAAqB;;;;;;AAO9B,SAAgB,yBACd,QACgD;CAChD,MAAM,eAAe,OAAO;AAC5B,KAAI,CAAC,gBAAgB,OAAO,iBAAiB,SAC3C,QAAO;AAET,QAAO;;AAOT,MAAM,+BAAuD;CAC3D,QAAQ;CACR,SAAS;CACT,iBAAiB;CACjB,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,OAAO;CACP,KAAK;CACL,UAAU;CACV,SAAS;CACV;;;;;AAMD,SAAgB,+BACd,aACQ;CACR,MAAM,QAAkB,EAAE;AAE1B,MAAK,MAAM,CAAC,KAAK,YAAY,OAAO,QAAQ,6BAA6B,EAAE;EACzE,MAAM,QAAQ,YAAY;AAC1B,MAAI,UAAU,KAAA,EACZ,OAAM,KAAK,GAAG,QAAQ,IAAI,MAAM,GAAG;;AAIvC,QAAO,MAAM,KAAK,IAAI;;;;;AAMxB,SAAgB,uBACd,MACA,aACQ;AACR,QAAO,kBAAkB,KAAK,KAAK,+BAA+B,YAAY,CAAC"}
|
package/dist/debug.d.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
import { CacheMetrics } from "./injector/types.js";
|
|
2
|
+
|
|
1
3
|
//#region src/debug.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Debug utilities for inspecting tasty-generated CSS at runtime
|
|
4
|
-
*/
|
|
5
4
|
declare global {
|
|
6
5
|
interface Window {
|
|
7
6
|
tastyDebug?: typeof tastyDebug;
|
|
8
7
|
}
|
|
9
8
|
}
|
|
10
9
|
type CSSTarget = 'all' | 'global' | 'active' | 'unused' | 'page' | string | string[] | Element;
|
|
11
|
-
interface
|
|
10
|
+
interface DebugOptions {
|
|
12
11
|
root?: Document | ShadowRoot;
|
|
12
|
+
/** Suppress console logging and return data only (default: false) */
|
|
13
|
+
raw?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface CssOptions extends DebugOptions {
|
|
13
16
|
prettify?: boolean;
|
|
14
|
-
|
|
17
|
+
/** Read from stored source CSS (dev-mode only) instead of live CSSOM */
|
|
18
|
+
source?: boolean;
|
|
15
19
|
}
|
|
16
20
|
interface ChunkInfo {
|
|
17
21
|
className: string;
|
|
@@ -25,22 +29,6 @@ interface InspectResult {
|
|
|
25
29
|
size: number;
|
|
26
30
|
rules: number;
|
|
27
31
|
}
|
|
28
|
-
interface CacheMetrics {
|
|
29
|
-
hits: number;
|
|
30
|
-
misses: number;
|
|
31
|
-
bulkCleanups: number;
|
|
32
|
-
totalInsertions: number;
|
|
33
|
-
totalUnused: number;
|
|
34
|
-
stylesCleanedUp: number;
|
|
35
|
-
cleanupHistory: {
|
|
36
|
-
timestamp: number;
|
|
37
|
-
classesDeleted: number;
|
|
38
|
-
cssSize: number;
|
|
39
|
-
rulesDeleted: number;
|
|
40
|
-
}[];
|
|
41
|
-
startTime: number;
|
|
42
|
-
unusedHits?: number;
|
|
43
|
-
}
|
|
44
32
|
interface CacheStatus {
|
|
45
33
|
classes: {
|
|
46
34
|
active: string[];
|
|
@@ -49,17 +37,14 @@ interface CacheStatus {
|
|
|
49
37
|
};
|
|
50
38
|
metrics: CacheMetrics | null;
|
|
51
39
|
}
|
|
52
|
-
interface
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
root?: Document | ShadowRoot;
|
|
61
|
-
log?: boolean;
|
|
62
|
-
includePageCSS?: false | true | 'all';
|
|
40
|
+
interface ChunkBreakdown {
|
|
41
|
+
byChunk: Record<string, {
|
|
42
|
+
classes: string[];
|
|
43
|
+
cssSize: number;
|
|
44
|
+
ruleCount: number;
|
|
45
|
+
}>;
|
|
46
|
+
totalChunkTypes: number;
|
|
47
|
+
totalClasses: number;
|
|
63
48
|
}
|
|
64
49
|
interface Summary {
|
|
65
50
|
activeClasses: string[];
|
|
@@ -72,132 +57,32 @@ interface Summary {
|
|
|
72
57
|
keyframesCSSSize: number;
|
|
73
58
|
propertyCSSSize: number;
|
|
74
59
|
totalCSSSize: number;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
globalCSS: string;
|
|
78
|
-
rawCSS: string;
|
|
79
|
-
keyframesCSS: string;
|
|
80
|
-
propertyCSS: string;
|
|
81
|
-
allCSS: string;
|
|
60
|
+
activeRuleCount: number;
|
|
61
|
+
unusedRuleCount: number;
|
|
82
62
|
globalRuleCount: number;
|
|
83
63
|
rawRuleCount: number;
|
|
84
64
|
keyframesRuleCount: number;
|
|
85
65
|
propertyRuleCount: number;
|
|
86
|
-
|
|
87
|
-
css?: string;
|
|
88
|
-
cssSize: number;
|
|
89
|
-
ruleCount: number;
|
|
90
|
-
stylesheetCount: number;
|
|
91
|
-
skippedStylesheets: number;
|
|
92
|
-
};
|
|
66
|
+
totalRuleCount: number;
|
|
93
67
|
metrics: CacheMetrics | null;
|
|
94
68
|
definedProperties: string[];
|
|
95
69
|
definedKeyframes: {
|
|
96
70
|
name: string;
|
|
97
71
|
refCount: number;
|
|
98
72
|
}[];
|
|
99
|
-
|
|
100
|
-
keyframeCount: number;
|
|
101
|
-
cleanupSummary: {
|
|
102
|
-
enabled: boolean;
|
|
103
|
-
totalCleanups: number;
|
|
104
|
-
totalClassesDeleted: number;
|
|
105
|
-
totalCssDeleted: number;
|
|
106
|
-
totalRulesDeleted: number;
|
|
107
|
-
averageClassesPerCleanup: number;
|
|
108
|
-
averageCssPerCleanup: number;
|
|
109
|
-
averageRulesPerCleanup: number;
|
|
110
|
-
lastCleanup?: {
|
|
111
|
-
timestamp: number;
|
|
112
|
-
date: string;
|
|
113
|
-
classesDeleted: number;
|
|
114
|
-
cssSize: number;
|
|
115
|
-
rulesDeleted: number;
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
chunkBreakdown: {
|
|
119
|
-
byChunk: Record<string, {
|
|
120
|
-
classes: string[];
|
|
121
|
-
cssSize: number;
|
|
122
|
-
ruleCount: number;
|
|
123
|
-
}>;
|
|
124
|
-
totalChunkTypes: number;
|
|
125
|
-
};
|
|
73
|
+
chunkBreakdown: ChunkBreakdown;
|
|
126
74
|
}
|
|
127
|
-
/**
|
|
128
|
-
* Concise tastyDebug API for inspecting styles at runtime
|
|
129
|
-
*/
|
|
130
75
|
declare const tastyDebug: {
|
|
131
76
|
css(target: CSSTarget, opts?: CssOptions): string;
|
|
132
|
-
inspect(target: string | Element, opts?:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
cache(opts?:
|
|
136
|
-
root?: Document | ShadowRoot;
|
|
137
|
-
includeHistory?: boolean;
|
|
138
|
-
}): CacheStatus;
|
|
77
|
+
inspect(target: string | Element, opts?: DebugOptions): InspectResult;
|
|
78
|
+
summary(opts?: DebugOptions): Summary;
|
|
79
|
+
chunks(opts?: DebugOptions): ChunkBreakdown;
|
|
80
|
+
cache(opts?: DebugOptions): CacheStatus;
|
|
139
81
|
cleanup(opts?: {
|
|
140
82
|
root?: Document | ShadowRoot;
|
|
141
83
|
}): void;
|
|
142
|
-
metrics(opts?: {
|
|
143
|
-
root?: Document | ShadowRoot;
|
|
144
|
-
}): CacheMetrics | null;
|
|
145
|
-
resetMetrics(opts?: {
|
|
146
|
-
root?: Document | ShadowRoot;
|
|
147
|
-
}): void;
|
|
148
|
-
/**
|
|
149
|
-
* Get breakdown of styles by chunk type.
|
|
150
|
-
*
|
|
151
|
-
* With style chunking enabled, styles are split into logical chunks
|
|
152
|
-
* (appearance, font, dimension, container, etc.) for better caching
|
|
153
|
-
* and CSS reuse.
|
|
154
|
-
*
|
|
155
|
-
* @param opts - Options including root document/shadow root
|
|
156
|
-
* @returns Breakdown by chunk type with class counts and CSS sizes
|
|
157
|
-
*/
|
|
158
|
-
chunks(opts?: {
|
|
159
|
-
root?: Document | ShadowRoot;
|
|
160
|
-
log?: boolean;
|
|
161
|
-
}): {
|
|
162
|
-
byChunk: Record<string, {
|
|
163
|
-
classes: string[];
|
|
164
|
-
cssSize: number;
|
|
165
|
-
ruleCount: number;
|
|
166
|
-
}>;
|
|
167
|
-
totalChunkTypes: number;
|
|
168
|
-
totalClasses: number;
|
|
169
|
-
};
|
|
170
|
-
getGlobalTypeCSS(type: "global" | "raw" | "keyframes" | "property", opts?: {
|
|
171
|
-
root?: Document | ShadowRoot;
|
|
172
|
-
}): {
|
|
173
|
-
css: string;
|
|
174
|
-
ruleCount: number;
|
|
175
|
-
size: number;
|
|
176
|
-
};
|
|
177
|
-
defs(opts?: {
|
|
178
|
-
root?: Document | ShadowRoot;
|
|
179
|
-
}): Definitions;
|
|
180
|
-
summary(opts?: SummaryOptions): Summary;
|
|
181
|
-
pageCSS(opts?: {
|
|
182
|
-
root?: Document | ShadowRoot;
|
|
183
|
-
prettify?: boolean;
|
|
184
|
-
log?: boolean;
|
|
185
|
-
includeCrossOrigin?: boolean;
|
|
186
|
-
}): string;
|
|
187
|
-
pageStats(opts?: {
|
|
188
|
-
root?: Document | ShadowRoot;
|
|
189
|
-
includeCrossOrigin?: boolean;
|
|
190
|
-
}): {
|
|
191
|
-
cssSize: number;
|
|
192
|
-
ruleCount: number;
|
|
193
|
-
stylesheetCount: number;
|
|
194
|
-
skippedStylesheets: number;
|
|
195
|
-
};
|
|
196
|
-
install(): void;
|
|
197
|
-
log(target: CSSTarget, opts?: CssOptions & {
|
|
198
|
-
title?: string;
|
|
199
|
-
}): void;
|
|
200
84
|
help(): void;
|
|
85
|
+
install(): void;
|
|
201
86
|
};
|
|
202
87
|
//#endregion
|
|
203
88
|
export { tastyDebug };
|