@tamagui/web 3.0.0-beta.807.1 → 3.0.0-beta.831.1
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/dist/cjs/config.cjs +1 -1
- package/dist/cjs/config.native.cjs +1 -1
- package/dist/cjs/config.native.js +1 -1
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +28 -18
- package/dist/cjs/createComponent.native.cjs +30 -20
- package/dist/cjs/createComponent.native.js +30 -20
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createStyledHOC.cjs +54 -4
- package/dist/cjs/createStyledHOC.native.cjs +55 -4
- package/dist/cjs/createStyledHOC.native.js +55 -4
- package/dist/cjs/createStyledHOC.native.js.map +1 -1
- package/dist/cjs/createTokens.cjs +1 -1
- package/dist/cjs/createTokens.native.cjs +1 -1
- package/dist/cjs/createTokens.native.js +1 -1
- package/dist/cjs/createTokens.native.js.map +1 -1
- package/dist/cjs/dom/html.cjs +147 -99
- package/dist/cjs/dom/htmlRuntime.native.cjs +6 -2
- package/dist/cjs/dom/htmlRuntime.native.js +6 -2
- package/dist/cjs/dom/htmlRuntime.native.js.map +1 -1
- package/dist/cjs/dom/primitives.native.cjs +16 -13
- package/dist/cjs/dom/primitives.native.js +16 -13
- package/dist/cjs/dom/primitives.native.js.map +1 -1
- package/dist/cjs/helpers/componentDisplayName.cjs +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.cjs +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.js +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.js.map +1 -1
- package/dist/cjs/helpers/directStyleCSS.cjs +101 -104
- package/dist/cjs/helpers/formatDiagnostic.cjs +2 -4
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +2 -4
- package/dist/cjs/helpers/formatDiagnostic.native.js +2 -4
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +10 -10
- package/dist/cjs/helpers/getSplitStyles.cjs +168 -600
- package/dist/cjs/helpers/getSplitStyles.native.cjs +168 -762
- package/dist/cjs/helpers/getSplitStyles.native.js +168 -762
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/splitStyleProps.cjs +46 -0
- package/dist/cjs/helpers/splitStyleProps.native.cjs +49 -0
- package/dist/cjs/helpers/splitStyleProps.native.js +51 -0
- package/dist/cjs/helpers/splitStyleProps.native.js.map +1 -0
- package/dist/cjs/helpers/styleStaticConfig.cjs +76 -0
- package/dist/cjs/helpers/styleStaticConfig.native.cjs +79 -0
- package/dist/cjs/helpers/styleStaticConfig.native.js +81 -0
- package/dist/cjs/helpers/styleStaticConfig.native.js.map +1 -0
- package/dist/cjs/helpers/tokenCategories.cjs +32 -71
- package/dist/cjs/helpers/tokenCategories.native.cjs +34 -73
- package/dist/cjs/helpers/tokenCategories.native.js +34 -73
- package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
- package/dist/cjs/helpers/variantResolvers.cjs +87 -0
- package/dist/cjs/helpers/variantResolvers.native.cjs +140 -0
- package/dist/cjs/helpers/variantResolvers.native.js +142 -0
- package/dist/cjs/helpers/variantResolvers.native.js.map +1 -0
- package/dist/cjs/hooks/useSplitStyles.cjs +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.cjs +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.js +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/cjs/index.cjs +3 -9
- package/dist/cjs/index.native.cjs +3 -9
- package/dist/cjs/index.native.js +3 -9
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +8 -7
- package/dist/cjs/internal-runtime.native.cjs +8 -7
- package/dist/cjs/internal-runtime.native.js +8 -7
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/cjs/static-resolve.cjs +6 -5
- package/dist/cjs/static-resolve.native.cjs +6 -5
- package/dist/cjs/static-resolve.native.js +6 -5
- package/dist/cjs/static-resolve.native.js.map +1 -1
- package/dist/cjs/styled.cjs +4 -56
- package/dist/cjs/styled.native.cjs +4 -58
- package/dist/cjs/styled.native.js +4 -58
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/types.cjs +1 -21
- package/dist/cjs/types.native.cjs +1 -21
- package/dist/cjs/types.native.js +1 -21
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/views/Text.cjs +4 -2
- package/dist/cjs/views/Text.native.cjs +4 -2
- package/dist/cjs/views/Text.native.js +4 -2
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/View.cjs +4 -2
- package/dist/cjs/views/View.native.cjs +4 -2
- package/dist/cjs/views/View.native.js +4 -2
- package/dist/cjs/views/View.native.js.map +1 -1
- package/dist/esm/config.mjs +1 -1
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +1 -1
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +29 -19
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +31 -21
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createStyledHOC.mjs +55 -5
- package/dist/esm/createStyledHOC.mjs.map +1 -1
- package/dist/esm/createStyledHOC.native.js +56 -5
- package/dist/esm/createStyledHOC.native.js.map +1 -1
- package/dist/esm/createTokens.mjs +1 -1
- package/dist/esm/createTokens.mjs.map +1 -1
- package/dist/esm/createTokens.native.js +1 -1
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/dom/html.mjs +147 -99
- package/dist/esm/dom/html.mjs.map +1 -1
- package/dist/esm/dom/htmlRuntime.native.js +7 -3
- package/dist/esm/dom/htmlRuntime.native.js.map +1 -1
- package/dist/esm/dom/primitives.native.js +16 -13
- package/dist/esm/dom/primitives.native.js.map +1 -1
- package/dist/esm/helpers/componentDisplayName.mjs +1 -8
- package/dist/esm/helpers/componentDisplayName.mjs.map +1 -1
- package/dist/esm/helpers/componentDisplayName.native.js +1 -8
- package/dist/esm/helpers/componentDisplayName.native.js.map +1 -1
- package/dist/esm/helpers/directStyleCSS.mjs +101 -104
- package/dist/esm/helpers/directStyleCSS.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.mjs +2 -4
- package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.native.js +2 -4
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +10 -10
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +166 -594
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +166 -757
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/splitStyleProps.mjs +27 -0
- package/dist/esm/helpers/splitStyleProps.mjs.map +1 -0
- package/dist/esm/helpers/splitStyleProps.native.js +28 -0
- package/dist/esm/helpers/splitStyleProps.native.js.map +1 -0
- package/dist/esm/helpers/styleStaticConfig.mjs +57 -0
- package/dist/esm/helpers/styleStaticConfig.mjs.map +1 -0
- package/dist/esm/helpers/styleStaticConfig.native.js +58 -0
- package/dist/esm/helpers/styleStaticConfig.native.js.map +1 -0
- package/dist/esm/helpers/tokenCategories.mjs +33 -72
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
- package/dist/esm/helpers/tokenCategories.native.js +35 -74
- package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
- package/dist/esm/helpers/variantResolvers.mjs +65 -0
- package/dist/esm/helpers/variantResolvers.mjs.map +1 -0
- package/dist/esm/helpers/variantResolvers.native.js +116 -0
- package/dist/esm/helpers/variantResolvers.native.js.map +1 -0
- package/dist/esm/hooks/useSplitStyles.mjs +2 -2
- package/dist/esm/hooks/useSplitStyles.mjs.map +1 -1
- package/dist/esm/hooks/useSplitStyles.native.js +2 -2
- package/dist/esm/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/esm/index.js +3 -5
- package/dist/esm/index.mjs +3 -5
- package/dist/esm/index.native.js +3 -5
- package/dist/esm/internal-runtime.mjs +8 -7
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +8 -7
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/dist/esm/static-resolve.mjs +8 -6
- package/dist/esm/static-resolve.mjs.map +1 -1
- package/dist/esm/static-resolve.native.js +8 -6
- package/dist/esm/static-resolve.native.js.map +1 -1
- package/dist/esm/styled.mjs +6 -57
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +6 -59
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/types.mjs +1 -18
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js +1 -18
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/views/Text.mjs +4 -2
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Text.native.js +4 -2
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/View.mjs +4 -2
- package/dist/esm/views/View.mjs.map +1 -1
- package/dist/esm/views/View.native.js +4 -2
- package/dist/esm/views/View.native.js.map +1 -1
- package/package.json +15 -15
- package/src/config.ts +1 -1
- package/src/createComponent.tsx +41 -30
- package/src/createStyledHOC.tsx +56 -9
- package/src/createTokens.ts +1 -1
- package/src/dom/html.tsx +778 -877
- package/src/dom/htmlRuntime.native.tsx +7 -3
- package/src/dom/primitives.native.tsx +30 -39
- package/src/helpers/componentDisplayName.ts +0 -11
- package/src/helpers/directStyleCSS.ts +91 -112
- package/src/helpers/formatDiagnostic.ts +2 -4
- package/src/helpers/getCSSStylesAtomic.ts +32 -26
- package/src/helpers/getSplitStyles.tsx +315 -1119
- package/src/helpers/getVariantExtras.tsx +3 -3
- package/src/helpers/splitStyleProps.ts +166 -0
- package/src/helpers/styleFrontend.ts +8 -4
- package/src/helpers/styleStaticConfig.ts +88 -0
- package/src/helpers/tokenCategories.ts +62 -93
- package/src/helpers/variantResolvers.ts +121 -0
- package/src/hooks/useSplitStyles.tsx +17 -2
- package/src/hooks/useTheme.tsx +1 -1
- package/src/index.ts +8 -4
- package/src/internal-runtime.ts +10 -9
- package/src/static-resolve.ts +18 -14
- package/src/styled.tsx +7 -264
- package/src/types.tsx +19 -40
- package/src/views/Text.tsx +6 -7
- package/src/views/View.tsx +6 -7
- package/types/createComponent.d.ts.map +1 -1
- package/types/createStyledHOC.d.ts.map +1 -1
- package/types/dom/html.d.ts.map +1 -1
- package/types/dom/htmlRuntime.native.d.ts.map +1 -1
- package/types/dom/primitives.native.d.ts.map +1 -1
- package/types/helpers/componentDisplayName.d.ts +0 -3
- package/types/helpers/componentDisplayName.d.ts.map +1 -1
- package/types/helpers/directStyleCSS.d.ts.map +1 -1
- package/types/helpers/formatDiagnostic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.d.ts +17 -15
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +6 -6
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/splitStyleProps.d.ts +44 -0
- package/types/helpers/splitStyleProps.d.ts.map +1 -0
- package/types/helpers/styleFrontend.d.ts +4 -4
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleStaticConfig.d.ts +19 -0
- package/types/helpers/styleStaticConfig.d.ts.map +1 -0
- package/types/helpers/tokenCategories.d.ts +1 -1
- package/types/helpers/tokenCategories.d.ts.map +1 -1
- package/types/helpers/variantResolvers.d.ts +9 -0
- package/types/helpers/variantResolvers.d.ts.map +1 -0
- package/types/hooks/useSplitStyles.d.ts.map +1 -1
- package/types/index.d.ts +2 -4
- package/types/index.d.ts.map +1 -1
- package/types/internal-runtime.d.ts.map +1 -1
- package/types/static-resolve.d.ts +2 -2
- package/types/static-resolve.d.ts.map +1 -1
- package/types/styled.d.ts +3 -39
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +2 -12
- package/types/types.d.ts.map +1 -1
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/View.d.ts.map +1 -1
- package/dist/cjs/helpers/getDefaultProps.cjs +0 -24
- package/dist/cjs/helpers/getDefaultProps.native.cjs +0 -28
- package/dist/cjs/helpers/getDefaultProps.native.js +0 -30
- package/dist/cjs/helpers/getDefaultProps.native.js.map +0 -1
- package/dist/cjs/helpers/themeable.cjs +0 -92
- package/dist/cjs/helpers/themeable.native.cjs +0 -95
- package/dist/cjs/helpers/themeable.native.js +0 -97
- package/dist/cjs/helpers/themeable.native.js.map +0 -1
- package/dist/cjs/hooks/useProps.cjs +0 -129
- package/dist/cjs/hooks/useProps.native.cjs +0 -135
- package/dist/cjs/hooks/useProps.native.js +0 -137
- package/dist/cjs/hooks/useProps.native.js.map +0 -1
- package/dist/esm/helpers/getDefaultProps.mjs +0 -4
- package/dist/esm/helpers/getDefaultProps.mjs.map +0 -1
- package/dist/esm/helpers/getDefaultProps.native.js +0 -6
- package/dist/esm/helpers/getDefaultProps.native.js.map +0 -1
- package/dist/esm/helpers/themeable.mjs +0 -67
- package/dist/esm/helpers/themeable.mjs.map +0 -1
- package/dist/esm/helpers/themeable.native.js +0 -68
- package/dist/esm/helpers/themeable.native.js.map +0 -1
- package/dist/esm/hooks/useProps.mjs +0 -100
- package/dist/esm/hooks/useProps.mjs.map +0 -1
- package/dist/esm/hooks/useProps.native.js +0 -104
- package/dist/esm/hooks/useProps.native.js.map +0 -1
- package/src/helpers/getDefaultProps.ts +0 -3
- package/src/helpers/themeable.tsx +0 -96
- package/src/hooks/useProps.tsx +0 -186
- package/types/helpers/getDefaultProps.d.ts +0 -3
- package/types/helpers/getDefaultProps.d.ts.map +0 -1
- package/types/helpers/themeable.d.ts +0 -3
- package/types/helpers/themeable.d.ts.map +0 -1
- package/types/hooks/useProps.d.ts +0 -39
- package/types/hooks/useProps.d.ts.map +0 -1
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { isAndroid, isClient, platformMatches, supportsDynamicColorIOS } from "@tamagui/constants";
|
|
2
|
-
import { nonAnimatableStyleProps, stylePropsAll, stylePropsText, stylePropsTransform,
|
|
2
|
+
import { nonAnimatableStyleProps, propToTokenCategoryCode, stylePropsAll, stylePropsText, stylePropsTransform, validStyles } from "@tamagui/helpers";
|
|
3
|
+
import { addTransformValue, canonicalStateModifierNames, createTransformAccumulator, finalizeTransformAccumulator, getTransformPartKeys, isContainerSizeQueryText, isModifierName, modifierKindMedia, modifierKindPlatform, modifierKindState, modifierKindTheme, removeTransformValue, scanFlatValue, stateModifierSelectors } from "@tamagui/style-grammar/runtime";
|
|
3
4
|
import { getConfig, getFont } from "../config.native.js";
|
|
4
|
-
import { isVariable } from "../createVariable.native.js";
|
|
5
5
|
import { isDevTools } from "../constants/isDevTools.native.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { addTransformValue, canonicalStateModifierNames, createTransformAccumulator, finalizeTransformAccumulator, getTransformPartKeys, isContainerSizeQueryText, isModifierName, modifierKindMedia, modifierKindPlatform, modifierKindState, modifierKindTheme, removeTransformValue, scanFlatValue, stateModifierSelectors } from "@tamagui/style-grammar/runtime";
|
|
9
|
-
import { warnOnce, warnRefusedValue } from "./warnOnce.native.js";
|
|
6
|
+
import { isVariable } from "../createVariable.native.js";
|
|
7
|
+
import { addComposition, canGenerateCSS, clearFrameAtomic, completeStreamingCSS, directStyleSignature, flushDirectStyles, flushDirectStyles as flushDirectStyles2, requestBorderStyleDefault, streamAtomic } from "./directStyleCSS.native.js";
|
|
10
8
|
import { expandStyle } from "./expandStyle.native.js";
|
|
11
9
|
import { fixStyles } from "./expandStyles.native.js";
|
|
12
|
-
import { addComposition, canGenerateCSS, clearFrameAtomic, completeStreamingCSS, directStyleSignature, flushDirectStyles, flushDirectStyles as flushDirectStyles2, requestBorderStyleDefault, streamAtomic } from "./directStyleCSS.native.js";
|
|
13
10
|
import { getConfigRevisionState } from "./grammarConfig.native.js";
|
|
11
|
+
import { mediaKeyMatch, mediaState } from "./mediaState.native.js";
|
|
12
|
+
import { getStyleStaticConfig } from "./styleStaticConfig.native.js";
|
|
13
|
+
import { getVariantDefinition } from "./variantResolvers.native.js";
|
|
14
|
+
import { warnOnce, warnRefusedValue } from "./warnOnce.native.js";
|
|
14
15
|
import { isColorStyleKey } from "./getDynamicVal.native.js";
|
|
15
|
-
import {
|
|
16
|
-
import { isObj
|
|
16
|
+
import { getVariantExtras } from "./getVariantExtras.native.js";
|
|
17
|
+
import { isObj } from "./isObj.native.js";
|
|
17
18
|
import { log } from "./log.native.js";
|
|
18
|
-
import { normalizeStyle } from "./normalizeStyle.native.js";
|
|
19
19
|
import { normalizeColor } from "./normalizeColor.native.js";
|
|
20
|
+
import { normalizeStyle } from "./normalizeStyle.native.js";
|
|
20
21
|
import { normalizeValueWithProperty } from "./normalizeValueWithProperty.native.js";
|
|
21
22
|
import { parseNativeStyle } from "./parseNativeStyle.native.js";
|
|
22
23
|
import { parseNativeTransform } from "./parseNativeTransform.native.js";
|
|
23
|
-
import { getVariantExtras } from "./getVariantExtras.native.js";
|
|
24
24
|
import { isRemValue, resolveRem } from "./resolveRem.native.js";
|
|
25
25
|
import { expandSafeAreaValue, isSafeAreaKey } from "./resolveSafeArea.native.js";
|
|
26
26
|
import { resolveSafeAreaVariable } from "./resolveSafeAreaVariable.native.js";
|
|
27
27
|
import { resolveVariableValue } from "./resolveVariableValue.native.js";
|
|
28
|
-
import { THEME_REF_PREFIX } from "./themeRef.native.js";
|
|
29
|
-
import { getTokenCategoryForProperty, tokenCategoryByProperty } from "./tokenCategories.native.js";
|
|
30
28
|
import { HOC_CLASSNAME_MARKER, skipProps } from "./skipProps.native.js";
|
|
31
29
|
import { styleOriginalValues } from "./styleOriginalValues.native.js";
|
|
32
30
|
import { STYLE_TOKEN_PROVENANCE_KEY, getStyleTokenProvenance, setStyleTokenProvenance } from "./styleProvenance.native.js";
|
|
31
|
+
import { THEME_REF_PREFIX } from "./themeRef.native.js";
|
|
32
|
+
import { getTokenCategoryForProperty } from "./tokenCategories.native.js";
|
|
33
33
|
import { transformsToString } from "./transformsToString.native.js";
|
|
34
34
|
|
|
35
35
|
export * from "./tokenCategories.native.js"
|
|
@@ -40,47 +40,6 @@ function _type_of(obj) {
|
|
|
40
40
|
}
|
|
41
41
|
var TAMAGUI_CLASS_PROPS = "$$tamaguiClassProps";
|
|
42
42
|
var shouldTrackStyleTokenProvenance = process.env.NODE_ENV === "development" && process.env.TAMAGUI_ENABLE_STYLE_TOKEN_PROVENANCE === "1";
|
|
43
|
-
function compoundMatcherMatches(expected, actual) {
|
|
44
|
-
if (Array.isArray(expected)) {
|
|
45
|
-
for (var index = 0; index < expected.length; index++) if (expected[index] === actual) return true;
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
return expected === actual;
|
|
49
|
-
}
|
|
50
|
-
function compoundMatcherMatchesPayload(expected, source, start, end) {
|
|
51
|
-
if (Array.isArray(expected)) {
|
|
52
|
-
for (var index = 0; index < expected.length; index++) if (compoundMatcherMatchesPayload(expected[index], source, start, end)) return true;
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
var expectedValue = typeof expected === "string" ? expected : String(expected);
|
|
56
|
-
if (expectedValue.length !== end - start) return false;
|
|
57
|
-
for (var index1 = 0; index1 < expectedValue.length; index1++) if (expectedValue.charCodeAt(index1) !== source.charCodeAt(start + index1)) return false;
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
var preparedCompoundsKey = /* @__PURE__ */ Symbol();
|
|
61
|
-
function prepareStaticConfigCompounds(staticConfig) {
|
|
62
|
-
var compoundVariants = staticConfig.compoundVariants;
|
|
63
|
-
var preparedConfig = staticConfig;
|
|
64
|
-
if (!(compoundVariants === null || compoundVariants === void 0 ? void 0 : compoundVariants.length)) {
|
|
65
|
-
preparedConfig[preparedCompoundsKey] = null;
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
var selectorCounts = [];
|
|
69
|
-
var indexesByKey = /* @__PURE__ */ Object.create(null);
|
|
70
|
-
indexesByKey[preparedCompoundsKey] = selectorCounts;
|
|
71
|
-
for (var index = 0; index < compoundVariants.length; index++) {
|
|
72
|
-
var compoundVariant = compoundVariants[index];
|
|
73
|
-
var selectorCount = 0;
|
|
74
|
-
for (var key in compoundVariant) {
|
|
75
|
-
var _indexesByKey, _key;
|
|
76
|
-
if (key === "style") continue;
|
|
77
|
-
selectorCount++;
|
|
78
|
-
((_indexesByKey = indexesByKey)[_key = key] || (_indexesByKey[_key] = [])).push(index);
|
|
79
|
-
}
|
|
80
|
-
selectorCounts[index] = selectorCount;
|
|
81
|
-
}
|
|
82
|
-
preparedConfig[preparedCompoundsKey] = indexesByKey;
|
|
83
|
-
}
|
|
84
43
|
var conditionWidth = 4;
|
|
85
44
|
var conditionValueOffset = 0;
|
|
86
45
|
var conditionFlagsOffset = 1;
|
|
@@ -118,15 +77,6 @@ function reserveConditionCursor(cursor) {
|
|
|
118
77
|
conditionNumbers = new Float64Array(length);
|
|
119
78
|
conditionNumbers.set(previous1);
|
|
120
79
|
}
|
|
121
|
-
function conditionWrapperCopy(cursor) {
|
|
122
|
-
var wrapper = conditionNumbers[cursor + conditionWrapperOffset];
|
|
123
|
-
var count = wrapper & 7;
|
|
124
|
-
if (!count) return void 0;
|
|
125
|
-
var start = wrapper >> 3;
|
|
126
|
-
var wrappers = new Array(count);
|
|
127
|
-
for (var index = 0; index < count; index++) wrappers[index] = conditionWrappers[start + index];
|
|
128
|
-
return wrappers;
|
|
129
|
-
}
|
|
130
80
|
function setConditionUnresolved(cursor) {
|
|
131
81
|
var name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
132
82
|
conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionResolvedFlag;
|
|
@@ -365,170 +315,8 @@ function acquireConditionKeyCursor(state, key) {
|
|
|
365
315
|
}
|
|
366
316
|
return cursor;
|
|
367
317
|
}
|
|
368
|
-
function combineConditionKeys(state, first, second) {
|
|
369
|
-
if (!first) return second;
|
|
370
|
-
if (!second || first === second) return first;
|
|
371
|
-
var watermark = conditionCursorTop;
|
|
372
|
-
var target2 = acquireConditionKeyCursor(state, first);
|
|
373
|
-
resolveConditionText(state, target2, second);
|
|
374
|
-
commitConditionCursor(state, target2);
|
|
375
|
-
var key = conditionTexts[target2 + conditionKeyOffset] || "";
|
|
376
|
-
releaseConditionCursors(watermark);
|
|
377
|
-
return key;
|
|
378
|
-
}
|
|
379
|
-
function freshCompoundState() {
|
|
380
|
-
return {
|
|
381
|
-
seen: 0,
|
|
382
|
-
failed: false,
|
|
383
|
-
matchedBase: false,
|
|
384
|
-
scanned: false,
|
|
385
|
-
pending: null,
|
|
386
|
-
combinations: null
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
function beginCompoundEdges(indexes, states) {
|
|
390
|
-
if (!indexes) return;
|
|
391
|
-
for (var index = 0; index < indexes.length; index++) {
|
|
392
|
-
var _states, _indexes_index;
|
|
393
|
-
var state = (_states = states)[_indexes_index = indexes[index]] || (_states[_indexes_index] = freshCompoundState());
|
|
394
|
-
state.pending = null;
|
|
395
|
-
state.matchedBase = false;
|
|
396
|
-
state.scanned = false;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
function feedCompoundSegment(state, source, start, end, isBase, valid, conditionKey) {
|
|
400
|
-
if (state.flatCompoundOutputDepth) return;
|
|
401
|
-
var pass = state.flatPass;
|
|
402
|
-
var indexes = pass[passCompoundIndexes];
|
|
403
|
-
var states = pass[passCompoundStates];
|
|
404
|
-
var key = pass[passCompoundKey];
|
|
405
|
-
if (!indexes || !states || !key) return;
|
|
406
|
-
var compoundVariants = state.staticConfig.compoundVariants;
|
|
407
|
-
for (var index = 0; index < indexes.length; index++) {
|
|
408
|
-
var _states, _compoundIndex;
|
|
409
|
-
var compoundIndex = indexes[index];
|
|
410
|
-
var compoundState = (_states = states)[_compoundIndex = compoundIndex] || (_states[_compoundIndex] = freshCompoundState());
|
|
411
|
-
compoundState.scanned = true;
|
|
412
|
-
if (!valid || start === end || !compoundMatcherMatchesPayload(compoundVariants[compoundIndex][key], source, start, end)) continue;
|
|
413
|
-
if (isBase) compoundState.matchedBase = true;
|
|
414
|
-
else if (!compoundState.matchedBase) {
|
|
415
|
-
var _compoundState;
|
|
416
|
-
((_compoundState = compoundState).pending || (_compoundState.pending = [])).push(conditionKey);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
var compoundOnlyHandler = {
|
|
421
|
-
segment(state, start, end, isBase, valid, source, chainStart, chainEnd, chainValid) {
|
|
422
|
-
if (isBase) {
|
|
423
|
-
feedCompoundSegment(state, source, start, end, true, valid, "");
|
|
424
|
-
return;
|
|
425
|
-
}
|
|
426
|
-
var cursor = state.flatScanCursor;
|
|
427
|
-
if (!chainValid || !cursor || !(conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) || !conditionNumbers[cursor + conditionValueOffset]) {
|
|
428
|
-
feedCompoundSegment(state, source, start, end, false, false, "");
|
|
429
|
-
return;
|
|
430
|
-
}
|
|
431
|
-
feedCompoundSegment(state, source, start, end, false, valid, conditionTexts[cursor + conditionKeyOffset] || "");
|
|
432
|
-
},
|
|
433
|
-
modifier(state, start, end, valid, first, source) {
|
|
434
|
-
var cursor = state.flatScanCursor;
|
|
435
|
-
if (!cursor) cursor = state.flatScanCursor = acquireConditionCursor();
|
|
436
|
-
else if (first) resetConditionCursor(cursor, 0);
|
|
437
|
-
if (!valid) {
|
|
438
|
-
setConditionUnresolved(cursor);
|
|
439
|
-
return;
|
|
440
|
-
}
|
|
441
|
-
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) resolveConditionModifier(state, cursor, source.slice(start, end));
|
|
442
|
-
},
|
|
443
|
-
chain(state, _start, _end, valid) {
|
|
444
|
-
var cursor = state.flatScanCursor;
|
|
445
|
-
if (cursor) {
|
|
446
|
-
if (!valid) setConditionUnresolved(cursor);
|
|
447
|
-
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) commitConditionCursor(state, cursor);
|
|
448
|
-
}
|
|
449
|
-
return true;
|
|
450
|
-
}
|
|
451
|
-
};
|
|
452
|
-
function finishCompoundEdges(pass, key, value, indexes, states) {
|
|
453
|
-
if (!indexes) return;
|
|
454
|
-
var state = pass[passStyleState];
|
|
455
|
-
pass[passCompoundIndexes] = indexes;
|
|
456
|
-
pass[passCompoundKey] = key;
|
|
457
|
-
pass[passCompoundStates] = states;
|
|
458
|
-
var needsScan = false;
|
|
459
|
-
for (var index = 0; index < indexes.length; index++) {
|
|
460
|
-
var _states, _indexes_index;
|
|
461
|
-
if (!((_states = states)[_indexes_index = indexes[index]] || (_states[_indexes_index] = freshCompoundState())).scanned) {
|
|
462
|
-
needsScan = true;
|
|
463
|
-
break;
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
if (needsScan) if (typeof value === "string") {
|
|
467
|
-
var watermark = conditionCursorTop;
|
|
468
|
-
var previousCursor = state.flatScanCursor;
|
|
469
|
-
state.flatScanCursor = null;
|
|
470
|
-
try {
|
|
471
|
-
scanFlatValue(value, compoundOnlyHandler, state);
|
|
472
|
-
} finally {
|
|
473
|
-
state.flatScanCursor = previousCursor;
|
|
474
|
-
releaseConditionCursors(watermark);
|
|
475
|
-
}
|
|
476
|
-
} else if (value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !isVariable(value) && Object.prototype.hasOwnProperty.call(value, "default")) for (var conditionKey in value) {
|
|
477
|
-
var payload = value[conditionKey];
|
|
478
|
-
if (conditionKey === "default") {
|
|
479
|
-
var payloadString = String(payload);
|
|
480
|
-
feedCompoundSegment(state, payloadString, 0, payloadString.length, true, true, "");
|
|
481
|
-
} else {
|
|
482
|
-
var watermark1 = conditionCursorTop;
|
|
483
|
-
var cursor = acquireConditionCursor();
|
|
484
|
-
resolveConditionText(state, cursor, conditionKey);
|
|
485
|
-
var condition = commitConditionCursor(state, cursor);
|
|
486
|
-
var payloadString1 = String(payload);
|
|
487
|
-
feedCompoundSegment(state, payloadString1, 0, payloadString1.length, false, Boolean(condition), condition ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
488
|
-
releaseConditionCursors(watermark1);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
else {
|
|
492
|
-
var variants = state.staticConfig.compoundVariants;
|
|
493
|
-
for (var index1 = 0; index1 < indexes.length; index1++) {
|
|
494
|
-
var _states1, _compoundIndex;
|
|
495
|
-
var compoundIndex = indexes[index1];
|
|
496
|
-
var compoundState1 = (_states1 = states)[_compoundIndex = compoundIndex] || (_states1[_compoundIndex] = freshCompoundState());
|
|
497
|
-
compoundState1.scanned = true;
|
|
498
|
-
if (compoundMatcherMatches(variants[compoundIndex][key], value)) compoundState1.matchedBase = true;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
var variants1 = state.staticConfig.compoundVariants;
|
|
502
|
-
var selectorCounts = state.staticConfig[preparedCompoundsKey][preparedCompoundsKey];
|
|
503
|
-
for (var index2 = 0; index2 < indexes.length; index2++) {
|
|
504
|
-
var compoundIndex1 = indexes[index2];
|
|
505
|
-
var compoundState2 = states[compoundIndex1];
|
|
506
|
-
if (compoundState2.failed) continue;
|
|
507
|
-
var branches = compoundState2.matchedBase ? [""] : compoundState2.pending;
|
|
508
|
-
if (!branches || !branches.length) {
|
|
509
|
-
compoundState2.failed = true;
|
|
510
|
-
continue;
|
|
511
|
-
}
|
|
512
|
-
if (!compoundState2.seen) compoundState2.combinations = branches;
|
|
513
|
-
else {
|
|
514
|
-
var previous = compoundState2.combinations;
|
|
515
|
-
var next = [];
|
|
516
|
-
for (var left = 0; left < previous.length; left++) for (var right = 0; right < branches.length; right++) {
|
|
517
|
-
var conditionKey1 = combineConditionKeys(state, previous[left], branches[right]);
|
|
518
|
-
if (!next.includes(conditionKey1)) next.push(conditionKey1);
|
|
519
|
-
}
|
|
520
|
-
compoundState2.combinations = next;
|
|
521
|
-
}
|
|
522
|
-
compoundState2.seen++;
|
|
523
|
-
if (compoundState2.seen !== selectorCounts[compoundIndex1]) continue;
|
|
524
|
-
var style = variants1[compoundIndex1].style;
|
|
525
|
-
if (!isPlainObject(style)) continue;
|
|
526
|
-
var combinations = compoundState2.combinations;
|
|
527
|
-
for (var combination = 0; combination < combinations.length; combination++) for (var styleKey in style) contributeProp(pass, styleKey, style[styleKey], void 0, states, combinations[combination]);
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
318
|
function classifyConditionalObject(value, state, isChain, firstCursor) {
|
|
531
|
-
if (
|
|
319
|
+
if ("default" in value) return -1;
|
|
532
320
|
for (var key in value) {
|
|
533
321
|
if (!key.length) return 0;
|
|
534
322
|
if (!state) return (isChain === null || isChain === void 0 ? void 0 : isChain(key)) ? 1 : 0;
|
|
@@ -551,9 +339,6 @@ var passFrontendContainer = 27;
|
|
|
551
339
|
var passFrontendContainerType = 28;
|
|
552
340
|
var passHocMappedProperties = 29;
|
|
553
341
|
var passHocMappedClasses = 30;
|
|
554
|
-
var passCompoundIndexes = 31;
|
|
555
|
-
var passCompoundKey = 32;
|
|
556
|
-
var passCompoundStates = 33;
|
|
557
342
|
var passParentCursor = 35;
|
|
558
343
|
var passMapSourceKey = 36;
|
|
559
344
|
var passMapFlags = 37;
|
|
@@ -565,96 +350,23 @@ var passHocFlag = 16;
|
|
|
565
350
|
var passTextFlag = 32;
|
|
566
351
|
var passInputFlag = 64;
|
|
567
352
|
var passAsChildStyleFlag = 128;
|
|
568
|
-
var styledDefaultsCache = /* @__PURE__ */ new WeakMap();
|
|
569
|
-
function getStyledDefaults(staticConfig, shorthands) {
|
|
570
|
-
var prepared = styledDefaultsCache.get(staticConfig);
|
|
571
|
-
if (prepared === void 0) {
|
|
572
|
-
var entries = null;
|
|
573
|
-
var defaults = staticConfig.defaultProps;
|
|
574
|
-
if (defaults) for (var key in defaults) {
|
|
575
|
-
if (!(key in stylePropsAll || key in shorthands)) continue;
|
|
576
|
-
var value = defaults[key];
|
|
577
|
-
if (maybeStyleProgram(value)) (entries || (entries = [])).push(key, value);
|
|
578
|
-
}
|
|
579
|
-
prepared = entries;
|
|
580
|
-
styledDefaultsCache.set(staticConfig, prepared);
|
|
581
|
-
}
|
|
582
|
-
return prepared;
|
|
583
|
-
}
|
|
584
|
-
var maybeStyleProgram = function(value) {
|
|
585
|
-
return typeof value === "string" ? value.indexOf(":") !== -1 : !!value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !isVariable(value);
|
|
586
|
-
};
|
|
587
|
-
function contributeDisplacedStyledDefaults(styledDefaults, processedProps, pass) {
|
|
588
|
-
if (!styledDefaults) return;
|
|
589
|
-
for (var offset = 0; offset < styledDefaults.length; offset += 2) {
|
|
590
|
-
var key = styledDefaults[offset];
|
|
591
|
-
var value = styledDefaults[offset + 1];
|
|
592
|
-
var propValue = processedProps[key];
|
|
593
|
-
if (propValue !== void 0 && propValue !== value) contributeProp(pass, key, value);
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
function injectDisplacedStyledDefault(pass, key, value) {
|
|
597
|
-
var _pass__defaultProps;
|
|
598
|
-
var defaultValue = (_pass__defaultProps = pass[4].defaultProps) === null || _pass__defaultProps === void 0 ? void 0 : _pass__defaultProps[key];
|
|
599
|
-
if (defaultValue === void 0 || value === void 0 || value === defaultValue || maybeStyleProgram(defaultValue)) return;
|
|
600
|
-
var state = pass[passStyleState];
|
|
601
|
-
state.flatWeakContribution = true;
|
|
602
|
-
try {
|
|
603
|
-
contributeProp(pass, key, defaultValue);
|
|
604
|
-
} finally {
|
|
605
|
-
state.flatWeakContribution = false;
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
353
|
function forEachPropInForwardOrder(pass) {
|
|
609
|
-
var _staticConfig_compoundVariants;
|
|
610
354
|
var styleState = pass[passStyleState];
|
|
611
|
-
var staticConfig = styleState.staticConfig;
|
|
612
355
|
var processedProps = styleState.props;
|
|
613
|
-
var
|
|
614
|
-
var
|
|
615
|
-
var
|
|
616
|
-
var directState = styleState;
|
|
617
|
-
var preparedCompounds = staticConfig[preparedCompoundsKey];
|
|
618
|
-
if (preparedCompounds === void 0 && ((_staticConfig_compoundVariants = staticConfig.compoundVariants) === null || _staticConfig_compoundVariants === void 0 ? void 0 : _staticConfig_compoundVariants.length)) throw new Error("A component with compoundVariants reached style resolution before its static config was prepared.");
|
|
356
|
+
var styleStaticConfig = styleState.flatStyleStaticConfig;
|
|
357
|
+
var baseStyle = styleStaticConfig.baseStyle;
|
|
358
|
+
var baseVariantProps = styleStaticConfig.baseVariantProps;
|
|
619
359
|
var conditionWrapperBase = conditionWrapperTop;
|
|
620
|
-
if (!preparedCompounds) {
|
|
621
|
-
try {
|
|
622
|
-
if (processedBaseStyle) for (var key in processedBaseStyle) contributeProp(pass, key, processedBaseStyle[key]);
|
|
623
|
-
contributeDisplacedStyledDefaults(styledDefaults, processedProps, pass);
|
|
624
|
-
for (var key1 in processedProps) {
|
|
625
|
-
var value = processedProps[key1];
|
|
626
|
-
directState.flatPropSawCondition = false;
|
|
627
|
-
contributeProp(pass, key1, value);
|
|
628
|
-
if (directState.flatPropSawCondition) injectDisplacedStyledDefault(pass, key1, value);
|
|
629
|
-
}
|
|
630
|
-
} finally {
|
|
631
|
-
releaseConditionPayloads(conditionWrapperBase);
|
|
632
|
-
}
|
|
633
|
-
return;
|
|
634
|
-
}
|
|
635
|
-
var compoundVariants = staticConfig.compoundVariants;
|
|
636
|
-
var compoundStates = new Array(compoundVariants.length);
|
|
637
360
|
try {
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
var
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
var style = compoundVariants[compoundIndex].style;
|
|
644
|
-
if (!isPlainObject(style)) continue;
|
|
645
|
-
for (var key3 in style) contributeProp(pass, key3, style[key3]);
|
|
646
|
-
}
|
|
647
|
-
for (var key4 in processedProps) {
|
|
648
|
-
var compoundIndexes = preparedCompounds[key4];
|
|
649
|
-
var value1 = processedProps[key4];
|
|
650
|
-
beginCompoundEdges(compoundIndexes, compoundStates);
|
|
651
|
-
directState.flatPropSawCondition = false;
|
|
652
|
-
contributeProp(pass, key4, value1, compoundIndexes, compoundStates);
|
|
653
|
-
if (directState.flatPropSawCondition) injectDisplacedStyledDefault(pass, key4, value1);
|
|
654
|
-
finishCompoundEdges(pass, key4, value1, compoundIndexes, compoundStates);
|
|
361
|
+
var appliesBaseStyle = baseStyle && !processedProps.asChild;
|
|
362
|
+
if (appliesBaseStyle) for (var key in baseStyle) contributeProp(pass, key, baseVariantProps && Object.hasOwn(baseVariantProps, key) && Object.hasOwn(processedProps, key) ? processedProps[key] : baseStyle[key]);
|
|
363
|
+
for (var key1 in processedProps) {
|
|
364
|
+
if (appliesBaseStyle && baseVariantProps && Object.hasOwn(baseVariantProps, key1)) continue;
|
|
365
|
+
contributeProp(pass, key1, processedProps[key1]);
|
|
655
366
|
}
|
|
656
|
-
}
|
|
367
|
+
} catch (error) {
|
|
657
368
|
releaseConditionPayloads(conditionWrapperBase);
|
|
369
|
+
throw error;
|
|
658
370
|
}
|
|
659
371
|
}
|
|
660
372
|
function isValidStyleKey(key, validStyles, accept) {
|
|
@@ -757,13 +469,8 @@ function mapContributedProp(styleState, key, val, originalVal, condition) {
|
|
|
757
469
|
viewProps[key] = val;
|
|
758
470
|
}
|
|
759
471
|
}
|
|
760
|
-
function contributeProp(pass, keyOg, valOg,
|
|
472
|
+
function contributeProp(pass, keyOg, valOg, parentConditionKey) {
|
|
761
473
|
var parentWatermark = conditionCursorTop;
|
|
762
|
-
if (compoundIndexes) {
|
|
763
|
-
pass[passCompoundIndexes] = compoundIndexes;
|
|
764
|
-
pass[passCompoundKey] = keyOg;
|
|
765
|
-
pass[passCompoundStates] = compoundStates;
|
|
766
|
-
} else if (pass[passCompoundIndexes]) pass[passCompoundIndexes] = void 0;
|
|
767
474
|
if (parentConditionKey) pass[passParentCursor] = acquireConditionKeyCursor(pass[passStyleState], parentConditionKey);
|
|
768
475
|
try {
|
|
769
476
|
var [styleState, conf, props, viewProps, staticConfig, validStyles, accept, neverSkipProps, variants, inlineProps, parentVariants, styleFrontend, styledContext, styledContextKeys, flags, debug, parentStaticConfig, defaultProps, driverAnimations, driverOutputStyle, elementType] = pass;
|
|
@@ -992,10 +699,10 @@ function contributeProp(pass, keyOg, valOg, compoundIndexes, compoundStates, par
|
|
|
992
699
|
releaseConditionCursors(parentWatermark);
|
|
993
700
|
}
|
|
994
701
|
}
|
|
995
|
-
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver) {
|
|
996
|
-
var
|
|
702
|
+
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver, styleStaticConfig) {
|
|
703
|
+
var _styleState_style;
|
|
997
704
|
var conf = getConfig();
|
|
998
|
-
|
|
705
|
+
styleStaticConfig || (styleStaticConfig = getStyleStaticConfig(staticConfig, conf));
|
|
999
706
|
var driver = animationDriver || (componentContext === null || componentContext === void 0 ? void 0 : componentContext.animationDriver) || conf.animations;
|
|
1000
707
|
var driverAnimations = driver === null || driver === void 0 ? void 0 : driver.animations;
|
|
1001
708
|
driver === null || driver === void 0 || driver.inputStyle;
|
|
@@ -1003,7 +710,8 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1003
710
|
var resolvedDriver = (driver === null || driver === void 0 ? void 0 : driver.isStub) ? null : driver;
|
|
1004
711
|
if (props.passThrough) return null;
|
|
1005
712
|
var { shorthands } = conf;
|
|
1006
|
-
var { isHOC, isText, isInput,
|
|
713
|
+
var { isHOC, isText, isInput, inlineProps, parentStaticConfig, acceptsClassName } = staticConfig;
|
|
714
|
+
var variants = styleStaticConfig.variants;
|
|
1007
715
|
var viewProps = {};
|
|
1008
716
|
var mediaState$1 = styleProps.mediaState || mediaState;
|
|
1009
717
|
var shouldDoClasses = !process.env.TAMAGUI_DID_OUTPUT_CSS && acceptsClassName && false;
|
|
@@ -1036,6 +744,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1036
744
|
flatGroupContext: groupContext,
|
|
1037
745
|
animationDriver: resolvedDriver
|
|
1038
746
|
};
|
|
747
|
+
styleState.flatStyleStaticConfig = styleStaticConfig;
|
|
1039
748
|
if (canGenerateCSS && shouldDoClasses && styleProps.canPlatformPseudo) styleState.flatDeferCSS = true;
|
|
1040
749
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`style-state`;
|
|
1041
750
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && isClient) {
|
|
@@ -1055,20 +764,20 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1055
764
|
}
|
|
1056
765
|
var { asChild } = props;
|
|
1057
766
|
var { accept, neverSkipProps } = staticConfig;
|
|
1058
|
-
var { noSkip, disableExpandShorthands, noExpand, noClass, noMergeStyle, noNormalize, isAnimated, styledContext
|
|
767
|
+
var { noSkip, disableExpandShorthands, noExpand, noClass, noMergeStyle, noNormalize, isAnimated, styledContext } = styleProps;
|
|
768
|
+
var styledContextKeys = styleStaticConfig.styledContextKeys;
|
|
1059
769
|
var styleFrontend = staticConfig.styleFrontend;
|
|
1060
770
|
var frontendGroup;
|
|
1061
771
|
var frontendContainer;
|
|
1062
772
|
var frontendContainerType;
|
|
1063
|
-
var parentVariants = parentStaticConfig
|
|
1064
|
-
var defaultProps = asChild ?
|
|
773
|
+
var parentVariants = parentStaticConfig ? getStyleStaticConfig(parentStaticConfig, conf).variants : void 0;
|
|
774
|
+
var defaultProps = asChild ? styleStaticConfig.defaultProps : void 0;
|
|
1065
775
|
var asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
|
|
1066
776
|
var containerValue;
|
|
1067
777
|
var containerName;
|
|
1068
778
|
var containerType;
|
|
1069
779
|
var hocMappedClassProperties;
|
|
1070
780
|
var hocMappedClasses;
|
|
1071
|
-
var stylePassFlags = (noSkip ? passNoSkipFlag : 0) | (disableExpandShorthands ? passDisableShorthandsFlag : 0) | (noExpand ? passNoExpandFlag : 0) | (noMergeStyle ? passNoMergeFlag : 0) | (isHOC ? passHocFlag : 0) | (isText ? passTextFlag : 0) | (isInput ? passInputFlag : 0) | (asChildExceptStyleLike ? passAsChildStyleFlag : 0);
|
|
1072
781
|
var pass = [
|
|
1073
782
|
styleState,
|
|
1074
783
|
conf,
|
|
@@ -1084,7 +793,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1084
793
|
styleFrontend,
|
|
1085
794
|
styledContext,
|
|
1086
795
|
styledContextKeys,
|
|
1087
|
-
|
|
796
|
+
(noSkip ? passNoSkipFlag : 0) | (disableExpandShorthands ? passDisableShorthandsFlag : 0) | (noExpand ? passNoExpandFlag : 0) | (noMergeStyle ? passNoMergeFlag : 0) | (isHOC ? passHocFlag : 0) | (isText ? passTextFlag : 0) | (isInput ? passInputFlag : 0) | (asChildExceptStyleLike ? passAsChildStyleFlag : 0),
|
|
1088
797
|
debug,
|
|
1089
798
|
parentStaticConfig,
|
|
1090
799
|
defaultProps,
|
|
@@ -1103,80 +812,32 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1103
812
|
hocMappedClasses
|
|
1104
813
|
];
|
|
1105
814
|
styleState.flatPass = pass;
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
if (
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
1126
|
-
} finally {
|
|
1127
|
-
if (_didIteratorError2) throw _iteratorError2;
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
if ((_styleState_flatGroupKeys = styleState.flatGroupKeys) === null || _styleState_flatGroupKeys === void 0 ? void 0 : _styleState_flatGroupKeys.size) {
|
|
1133
|
-
pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set());
|
|
1134
|
-
var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
|
|
1135
|
-
try {
|
|
1136
|
-
for (var _iterator12 = styleState.flatGroupKeys[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
|
|
1137
|
-
var key1 = _step12.value;
|
|
1138
|
-
pseudoGroups.add(key1);
|
|
1139
|
-
}
|
|
1140
|
-
} catch (err) {
|
|
1141
|
-
_didIteratorError12 = true;
|
|
1142
|
-
_iteratorError12 = err;
|
|
1143
|
-
} finally {
|
|
1144
|
-
try {
|
|
1145
|
-
if (!_iteratorNormalCompletion12 && _iterator12.return != null) _iterator12.return();
|
|
1146
|
-
} finally {
|
|
1147
|
-
if (_didIteratorError12) throw _iteratorError12;
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
if ((_styleState_flatGroupMedia = styleState.flatGroupMedia) === null || _styleState_flatGroupMedia === void 0 ? void 0 : _styleState_flatGroupMedia.size) {
|
|
1152
|
-
mediaGroups || (mediaGroups = /* @__PURE__ */ new Set());
|
|
1153
|
-
var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;
|
|
1154
|
-
try {
|
|
1155
|
-
for (var _iterator22 = styleState.flatGroupMedia[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {
|
|
1156
|
-
var key2 = _step22.value;
|
|
1157
|
-
mediaGroups.add(key2);
|
|
1158
|
-
}
|
|
1159
|
-
} catch (err) {
|
|
1160
|
-
_didIteratorError22 = true;
|
|
1161
|
-
_iteratorError22 = err;
|
|
1162
|
-
} finally {
|
|
1163
|
-
try {
|
|
1164
|
-
if (!_iteratorNormalCompletion22 && _iterator22.return != null) _iterator22.return();
|
|
1165
|
-
} finally {
|
|
1166
|
-
if (_didIteratorError22) throw _iteratorError22;
|
|
815
|
+
var conditionalStates = null;
|
|
816
|
+
var usesSafeArea = false;
|
|
817
|
+
var conditionWrapperBase = conditionWrapperTop;
|
|
818
|
+
try {
|
|
819
|
+
var _styleState_flatMediaKeys, _styleState_flatGroupKeys, _styleState_flatGroupMedia;
|
|
820
|
+
forEachPropInForwardOrder(pass);
|
|
821
|
+
[, , , , , , , , , , , , , , , , , , , , , className, shouldDoClasses, containerValue, containerName, containerType, frontendGroup, frontendContainer, frontendContainerType, hocMappedClassProperties, hocMappedClasses] = pass;
|
|
822
|
+
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-propsend`;
|
|
823
|
+
conditionalStates = styleState.flatStateKeys || null;
|
|
824
|
+
usesSafeArea = !!styleState.flatUsesSafeArea;
|
|
825
|
+
hasMedia = ((_styleState_flatMediaKeys = styleState.flatMediaKeys) === null || _styleState_flatMediaKeys === void 0 ? void 0 : _styleState_flatMediaKeys.size) ? styleState.flatMediaKeys : false;
|
|
826
|
+
pseudoGroups = ((_styleState_flatGroupKeys = styleState.flatGroupKeys) === null || _styleState_flatGroupKeys === void 0 ? void 0 : _styleState_flatGroupKeys.size) ? styleState.flatGroupKeys : void 0;
|
|
827
|
+
mediaGroups = ((_styleState_flatGroupMedia = styleState.flatGroupMedia) === null || _styleState_flatGroupMedia === void 0 ? void 0 : _styleState_flatGroupMedia.size) ? styleState.flatGroupMedia : void 0;
|
|
828
|
+
if (styleProps.canPlatformPseudo && styleState.flatHasPlatformPseudo) {
|
|
829
|
+
shouldDoClasses = false;
|
|
830
|
+
styleState.flatShouldDoClasses = false;
|
|
831
|
+
if (styleState.transformAccumulator) {
|
|
832
|
+
mergeStyle(styleState, "transform", finalizeTransformAccumulator(styleState.transformAccumulator), true);
|
|
833
|
+
styleState.transformAccumulator = void 0;
|
|
1167
834
|
}
|
|
835
|
+
convertDeferredInline(styleState, mergeStyle);
|
|
1168
836
|
}
|
|
837
|
+
completeStreaming(styleState, mergeStyle);
|
|
838
|
+
} finally {
|
|
839
|
+
releaseConditionPayloads(conditionWrapperBase);
|
|
1169
840
|
}
|
|
1170
|
-
if (styleProps.canPlatformPseudo && styleState.flatHasPlatformPseudo) {
|
|
1171
|
-
shouldDoClasses = false;
|
|
1172
|
-
styleState.flatShouldDoClasses = false;
|
|
1173
|
-
if (styleState.transformAccumulator) {
|
|
1174
|
-
mergeStyle(styleState, "transform", finalizeTransformAccumulator(styleState.transformAccumulator), 1, true);
|
|
1175
|
-
styleState.transformAccumulator = void 0;
|
|
1176
|
-
}
|
|
1177
|
-
convertDeferredInline(styleState, mergeStyle);
|
|
1178
|
-
}
|
|
1179
|
-
completeStreaming(styleState, mergeStyle);
|
|
1180
841
|
var effectiveTransition = (_styleState_style = styleState.style) === null || _styleState_style === void 0 ? void 0 : _styleState_style.transition;
|
|
1181
842
|
if (effectiveTransition != null && styleState.style && true) delete styleState.style.transition;
|
|
1182
843
|
if (styleState.style) {
|
|
@@ -1194,11 +855,11 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1194
855
|
styleState.style.transform = finalizeTransformAccumulator(styleState.transformAccumulator);
|
|
1195
856
|
}
|
|
1196
857
|
if (parentSplitStyles) {
|
|
1197
|
-
if (!shouldDoClasses) for (var
|
|
858
|
+
if (!shouldDoClasses) for (var key1 in parentSplitStyles.style) {
|
|
1198
859
|
var _styleState1;
|
|
1199
|
-
if (
|
|
860
|
+
if (key1 in classNames || styleState.style && key1 in styleState.style) continue;
|
|
1200
861
|
(_styleState1 = styleState).style || (_styleState1.style = {});
|
|
1201
|
-
styleState.style[
|
|
862
|
+
styleState.style[key1] = parentSplitStyles.style[key1];
|
|
1202
863
|
}
|
|
1203
864
|
}
|
|
1204
865
|
}
|
|
@@ -1227,9 +888,9 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1227
888
|
if (shouldTrackStyleTokenProvenance && styleState.style && styleState.tokenProvenance) {
|
|
1228
889
|
var provenance = {};
|
|
1229
890
|
var hasProvenance = false;
|
|
1230
|
-
for (var
|
|
1231
|
-
provenance[
|
|
1232
|
-
token: styleState.tokenProvenance[
|
|
891
|
+
for (var key2 in styleState.tokenProvenance) {
|
|
892
|
+
provenance[key2] = {
|
|
893
|
+
token: styleState.tokenProvenance[key2],
|
|
1233
894
|
theme: themeName
|
|
1234
895
|
};
|
|
1235
896
|
hasProvenance = true;
|
|
@@ -1280,7 +941,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1280
941
|
rulesToInsert,
|
|
1281
942
|
parentSplitStyles
|
|
1282
943
|
};
|
|
1283
|
-
for (var
|
|
944
|
+
for (var key4 in logs) log(key4, logs[key4]);
|
|
1284
945
|
} catch (e) {}
|
|
1285
946
|
console.groupEnd();
|
|
1286
947
|
}
|
|
@@ -1288,11 +949,11 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1288
949
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-done`;
|
|
1289
950
|
return result;
|
|
1290
951
|
};
|
|
1291
|
-
function mergeStyle(styleState, key, val
|
|
1292
|
-
arguments.length >
|
|
1293
|
-
var originalVal = arguments.length >
|
|
952
|
+
function mergeStyle(styleState, key, val) {
|
|
953
|
+
arguments.length > 3 && arguments[3] !== void 0 && arguments[3];
|
|
954
|
+
var originalVal = arguments.length > 4 ? arguments[4] : void 0;
|
|
1294
955
|
var { viewProps, styleProps, staticConfig } = styleState;
|
|
1295
|
-
var contextPropSet =
|
|
956
|
+
var contextPropSet = styleState.flatStyleStaticConfig.styledContextKeys;
|
|
1296
957
|
if (contextPropSet === null || contextPropSet === void 0 ? void 0 : contextPropSet.has(key)) {
|
|
1297
958
|
var _styleState_originalContextPropValues;
|
|
1298
959
|
var _styleState;
|
|
@@ -1324,8 +985,8 @@ function recordStyleTokenProvenance(styleState, key, originalVal) {
|
|
|
1324
985
|
var opacity = slash === -1 ? NaN : Number(tokenName.slice(slash + 1));
|
|
1325
986
|
if (Number.isInteger(opacity) && opacity >= 0 && opacity <= 100) tokenName = tokenName.slice(0, slash);
|
|
1326
987
|
}
|
|
1327
|
-
if (tokenName !== "" && (
|
|
1328
|
-
return
|
|
988
|
+
if (tokenName !== "" && (tokenName in styleState.theme || tokenName in (((_styleState_conf_themes = styleState.conf.themes) === null || _styleState_conf_themes === void 0 ? void 0 : _styleState_conf_themes[styleState.flatThemeName || ""]) || {}) || Object.values(styleState.conf.tokensParsed).some(function(category) {
|
|
989
|
+
return tokenName in category;
|
|
1329
990
|
}))) {
|
|
1330
991
|
var _styleState;
|
|
1331
992
|
((_styleState = styleState).tokenProvenance || (_styleState.tokenProvenance = {}))[key] = originalVal;
|
|
@@ -1350,7 +1011,7 @@ var resolveAcceptedStyle = function(styleState, styleIn) {
|
|
|
1350
1011
|
childState.flatSingleEntries = void 0;
|
|
1351
1012
|
childState.flatSlots = void 0;
|
|
1352
1013
|
childState.flatBorderDefaultRequests = void 0;
|
|
1353
|
-
var mergeAccepted = function(_state, key2, value2,
|
|
1014
|
+
var mergeAccepted = function(_state, key2, value2, disableNormalize, originalValue) {
|
|
1354
1015
|
styleOut[key2] = disableNormalize || styleProps.noNormalize ? value2 : normalizeValueWithProperty(value2, key2);
|
|
1355
1016
|
var _styleInOriginalValues_key;
|
|
1356
1017
|
var trackedOriginal = (_styleInOriginalValues_key = styleInOriginalValues === null || styleInOriginalValues === void 0 ? void 0 : styleInOriginalValues[key2]) !== null && _styleInOriginalValues_key !== void 0 ? _styleInOriginalValues_key : originalValue;
|
|
@@ -1381,22 +1042,24 @@ function streamWriteCSS(state, property, value, cursor, original) {
|
|
|
1381
1042
|
if (property.charCodeAt(0) === 116 && property.startsWith("transition")) {
|
|
1382
1043
|
var _direct;
|
|
1383
1044
|
var transitions = (_direct = direct).flatTransitions || (_direct.flatTransitions = []);
|
|
1384
|
-
for (var index = 0; index < transitions.length; index++) if (transitions[index]
|
|
1385
|
-
transitions[index]
|
|
1386
|
-
transitions[index]
|
|
1045
|
+
for (var index = 0; index < transitions.length; index++) if (transitions[index][0] === property && transitions[index][3] === identity) {
|
|
1046
|
+
transitions[index][1] = value;
|
|
1047
|
+
transitions[index][2] = condition;
|
|
1387
1048
|
return;
|
|
1388
1049
|
}
|
|
1389
|
-
transitions.push(
|
|
1050
|
+
transitions.push([
|
|
1390
1051
|
property,
|
|
1391
1052
|
value,
|
|
1392
1053
|
condition,
|
|
1393
1054
|
identity,
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1055
|
+
cursor ? conditionTexts[cursor + conditionSelectorOffset] || "" : "",
|
|
1056
|
+
cursor ? conditionWrappers : void 0,
|
|
1057
|
+
cursor ? conditionNumbers[cursor + conditionWrapperOffset] >> 3 : 0,
|
|
1058
|
+
cursor ? conditionNumbers[cursor + conditionWrapperOffset] & 7 : 0
|
|
1059
|
+
]);
|
|
1397
1060
|
return;
|
|
1398
1061
|
}
|
|
1399
|
-
streamAtomic(state, property, value, condition, identity, cursor ? conditionTexts[cursor + conditionSelectorOffset] || "" : "", cursor ? conditionWrappers : void 0, cursor ? conditionNumbers[cursor + conditionWrapperOffset] >> 3 : 0, cursor ? conditionNumbers[cursor + conditionWrapperOffset] & 7 : 0,
|
|
1062
|
+
streamAtomic(state, property, value, condition, identity, cursor ? conditionTexts[cursor + conditionSelectorOffset] || "" : "", cursor ? conditionWrappers : void 0, cursor ? conditionNumbers[cursor + conditionWrapperOffset] >> 3 : 0, cursor ? conditionNumbers[cursor + conditionWrapperOffset] & 7 : 0, false, original);
|
|
1400
1063
|
}
|
|
1401
1064
|
function streamWriteInline(state, property, value, cursor, merge, original) {
|
|
1402
1065
|
var normalize = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : false, conditionOverride = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : -1;
|
|
@@ -1406,12 +1069,9 @@ function streamWriteInline(state, property, value, cursor, merge, original) {
|
|
|
1406
1069
|
var importance = condition ? Math.floor(condition / 256) + 1 : 0;
|
|
1407
1070
|
var used = (_direct = direct).flatUsed || (_direct.flatUsed = {});
|
|
1408
1071
|
var previous = used[property];
|
|
1409
|
-
if (previous !== void 0)
|
|
1410
|
-
if (previous > importance) return;
|
|
1411
|
-
if (direct.flatWeakContribution === true) return;
|
|
1412
|
-
}
|
|
1072
|
+
if (previous !== void 0 && previous > importance) return;
|
|
1413
1073
|
used[property] = importance;
|
|
1414
|
-
merge(state, property, value,
|
|
1074
|
+
merge(state, property, value, !normalize, original);
|
|
1415
1075
|
}
|
|
1416
1076
|
function streamRetractInline(state, property, cursor) {
|
|
1417
1077
|
var _direct;
|
|
@@ -1425,19 +1085,13 @@ function streamRetractInline(state, property, cursor) {
|
|
|
1425
1085
|
if (state.style) delete state.style[property];
|
|
1426
1086
|
}
|
|
1427
1087
|
function convertDeferredInline(state, merge) {
|
|
1428
|
-
var _direct;
|
|
1429
1088
|
var direct = state;
|
|
1430
|
-
var used = (_direct = direct).flatUsed || (_direct.flatUsed = {});
|
|
1431
1089
|
var consume = function(entries) {
|
|
1432
1090
|
for (var index = 0; index < entries.length; index++) {
|
|
1433
1091
|
var entry = entries[index];
|
|
1434
|
-
var condition = entry
|
|
1092
|
+
var condition = entry[2];
|
|
1435
1093
|
if (condition && !(condition & 1)) continue;
|
|
1436
|
-
|
|
1437
|
-
var previous = used[entry.property];
|
|
1438
|
-
if (previous !== void 0 && previous > importance) continue;
|
|
1439
|
-
used[entry.property] = importance;
|
|
1440
|
-
merge(state, entry.property, entry.value, 1, true, entry.original !== void 0 ? entry.original : entry.value);
|
|
1094
|
+
streamWriteInline(state, entry[0], entry[1], null, merge, entry[8] !== void 0 ? entry[8] : entry[1], false, condition);
|
|
1441
1095
|
}
|
|
1442
1096
|
};
|
|
1443
1097
|
var slots = direct.flatSlots;
|
|
@@ -1475,7 +1129,6 @@ function emitAtParentCondition(state, property, value, merge, originalValue, con
|
|
|
1475
1129
|
}
|
|
1476
1130
|
function emitUnderCondition(state, property, value, cursor, merge, originalValue, contextOnly, warnMode, warnSource) {
|
|
1477
1131
|
var condition = conditionNumbers[cursor + conditionValueOffset];
|
|
1478
|
-
if (merge && property && condition) state.flatPropSawCondition = true;
|
|
1479
1132
|
if (!(conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag)) {
|
|
1480
1133
|
if (warnMode && process.env.NODE_ENV === "development") warnRefusedValue(property, warnSource, `unknown modifier "${conditionTexts[cursor + conditionUnresolvedNameOffset] || ""}"`);
|
|
1481
1134
|
return 0;
|
|
@@ -1496,10 +1149,8 @@ function emitUnderCondition(state, property, value, cursor, merge, originalValue
|
|
|
1496
1149
|
}
|
|
1497
1150
|
var directStyleHandler = {
|
|
1498
1151
|
segment(state, start, end, isBase, valid, source, chainStart, chainEnd, chainValid, chainCount, _result, failure, failureIndex, property, merge, originalValue, contextOnly) {
|
|
1499
|
-
var _directState_flatPass;
|
|
1500
1152
|
if (isBase) {
|
|
1501
1153
|
if (start === end) return;
|
|
1502
|
-
feedCompoundSegment(state, source, start, end, true, valid || failure === "invalid-character" || failure === "stray-comment-close", "");
|
|
1503
1154
|
if (!valid) {
|
|
1504
1155
|
if (failure === "invalid-character" || failure === "stray-comment-close") return 16;
|
|
1505
1156
|
if (process.env.NODE_ENV === "development") warnRefusedValue(property, source, failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : "an unterminated \"(\"");
|
|
@@ -1522,10 +1173,8 @@ var directStyleHandler = {
|
|
|
1522
1173
|
var right = Number(source.slice(start, end));
|
|
1523
1174
|
if (chainStart < chainEnd && Number.isFinite(left) && left > 0 && Number.isFinite(right) && right > 0) return 12;
|
|
1524
1175
|
}
|
|
1525
|
-
var
|
|
1526
|
-
var cursor = directState.flatScanCursor;
|
|
1176
|
+
var cursor = state.flatScanCursor;
|
|
1527
1177
|
var condition = valid ? emitUnderCondition(state, property, source.slice(start, end), cursor, merge, void 0, contextOnly, 1, source) : conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
1528
|
-
feedCompoundSegment(directState, source, start, end, false, valid && Boolean(condition), condition && ((_directState_flatPass = directState.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passCompoundIndexes]) ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
1529
1178
|
if (!condition) return;
|
|
1530
1179
|
if (!valid) {
|
|
1531
1180
|
if (process.env.NODE_ENV === "development") warnRefusedValue(property, source, failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : "an unterminated \"(\"");
|
|
@@ -1569,7 +1218,7 @@ var directStyleHandler = {
|
|
|
1569
1218
|
emitAtParentCondition(state, property, source, merge, originalValue !== null && originalValue !== void 0 ? originalValue : source, contextOnly);
|
|
1570
1219
|
hasBase = true;
|
|
1571
1220
|
}
|
|
1572
|
-
if (process.env.NODE_ENV === "development" && !hasBase && result & 4 &&
|
|
1221
|
+
if (process.env.NODE_ENV === "development" && !hasBase && result & 4 && property in propToTokenCategoryCode && splitComponents(source.slice(lastPayloadStart)).length > 1) warnOnce(`${property}="${source}" has multiple values after its first conditional. Write the base value before the first conditional.`);
|
|
1573
1222
|
if ((!canGenerateCSS || !state.flatShouldDoClasses) && result & 2 && !hasBase) {
|
|
1574
1223
|
var value = implicitLifecycleBase(property);
|
|
1575
1224
|
if (value !== null) emitAtParentCondition(state, property, value, merge, value, contextOnly);
|
|
@@ -1705,17 +1354,6 @@ function tokenVariable(state, property, name) {
|
|
|
1705
1354
|
var _state_conf_tokensParsed_category;
|
|
1706
1355
|
var own = (_state_conf_tokensParsed_category = state.conf.tokensParsed[category]) === null || _state_conf_tokensParsed_category === void 0 ? void 0 : _state_conf_tokensParsed_category[lookupName];
|
|
1707
1356
|
if (own) return fillTokenLookup(own, false, lookupName);
|
|
1708
|
-
for (var _i = 0, _iter = [
|
|
1709
|
-
"color",
|
|
1710
|
-
"space",
|
|
1711
|
-
"size",
|
|
1712
|
-
"radius",
|
|
1713
|
-
"zIndex"
|
|
1714
|
-
]; _i < _iter.length; _i++) {
|
|
1715
|
-
var sibling = _iter[_i];
|
|
1716
|
-
var _state_conf_tokensParsed_sibling;
|
|
1717
|
-
if (sibling !== category && ((_state_conf_tokensParsed_sibling = state.conf.tokensParsed[sibling]) === null || _state_conf_tokensParsed_sibling === void 0 ? void 0 : _state_conf_tokensParsed_sibling[lookupName])) return;
|
|
1718
|
-
}
|
|
1719
1357
|
} else {
|
|
1720
1358
|
var first = lookupName.charCodeAt(0);
|
|
1721
1359
|
if (first >= 48 && first <= 57 || first === 43 || first === 45 || first === 46) return;
|
|
@@ -1772,11 +1410,14 @@ function configuredValue(state, property, raw) {
|
|
|
1772
1410
|
missKey = `${state.flatThemeName || ""}${property}${name}`;
|
|
1773
1411
|
if (misses.has(missKey)) return raw;
|
|
1774
1412
|
}
|
|
1413
|
+
if (process.env.NODE_ENV === "development") {
|
|
1414
|
+
var _state_conf_tokensParsed_color;
|
|
1415
|
+
var category = getTokenCategoryForProperty(property);
|
|
1416
|
+
if (category && category !== "color" && ((_state_conf_tokensParsed_color = state.conf.tokensParsed.color) === null || _state_conf_tokensParsed_color === void 0 ? void 0 : _state_conf_tokensParsed_color[name])) warnOnce(`"${name}" contributes to "color", not "${property}"`);
|
|
1417
|
+
}
|
|
1775
1418
|
var lookup = tokenVariable(state, property, name);
|
|
1776
1419
|
if (!lookup || !isVariable(lookup.value)) {
|
|
1777
|
-
var _state_conf_tokensParsed_color;
|
|
1778
1420
|
if (misses) misses.add(missKey);
|
|
1779
|
-
if (process.env.NODE_ENV === "development" && tokenCategoryByProperty[property] && ((_state_conf_tokensParsed_color = state.conf.tokensParsed.color) === null || _state_conf_tokensParsed_color === void 0 ? void 0 : _state_conf_tokensParsed_color[name])) warnOnce(`"${name}" contributes to "color", not "${property}"; keeping it literal`);
|
|
1780
1421
|
return raw;
|
|
1781
1422
|
}
|
|
1782
1423
|
var resolveValues = state.styleProps.resolveValues;
|
|
@@ -1913,13 +1554,13 @@ function emitProperty(state, property, value, cursor, merge, originalValue, cont
|
|
|
1913
1554
|
}
|
|
1914
1555
|
if (contextOnly) {
|
|
1915
1556
|
if (!condition || condition & 1) {
|
|
1916
|
-
var
|
|
1917
|
-
((
|
|
1557
|
+
var _state3;
|
|
1558
|
+
((_state3 = state).overriddenContextProps || (_state3.overriddenContextProps = {}))[property] = originalValue;
|
|
1918
1559
|
}
|
|
1919
1560
|
return;
|
|
1920
1561
|
}
|
|
1921
1562
|
if (canGenerateCSS && state.flatShouldDoClasses && !condition && property === "transform") {
|
|
1922
|
-
var
|
|
1563
|
+
var _state4;
|
|
1923
1564
|
if (process.env.NODE_ENV === "development" && state.transformAccumulator) {
|
|
1924
1565
|
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
1925
1566
|
try {
|
|
@@ -1938,13 +1579,13 @@ function emitProperty(state, property, value, cursor, merge, originalValue, cont
|
|
|
1938
1579
|
}
|
|
1939
1580
|
}
|
|
1940
1581
|
}
|
|
1941
|
-
(
|
|
1582
|
+
(_state4 = state).transformAccumulator || (_state4.transformAccumulator = createTransformAccumulator());
|
|
1942
1583
|
addTransformValue(state.transformAccumulator, property, value);
|
|
1943
1584
|
return;
|
|
1944
1585
|
}
|
|
1945
1586
|
var shouldPromoteAnimatedStyle = canGenerateCSS && !condition && !state.flatShouldDoClasses && !state.styleProps.noMergeStyle && state.styleProps.isAnimated && ((_state_animationDriver = state.animationDriver) === null || _state_animationDriver === void 0 ? void 0 : _state_animationDriver.inputStyle) === "css" && property in nonAnimatableStyleProps;
|
|
1946
1587
|
if (canGenerateCSS && (state.flatShouldDoClasses || shouldPromoteAnimatedStyle)) {
|
|
1947
|
-
if (!condition && state.style &&
|
|
1588
|
+
if (!condition && state.style && !(direct.flatUsed && direct.flatUsed[property])) delete state.style[property];
|
|
1948
1589
|
streamWriteCSS(state, property, value, cursor, originalValue);
|
|
1949
1590
|
return;
|
|
1950
1591
|
}
|
|
@@ -2405,14 +2046,11 @@ function contributeStyleObject(state, property, value, merge, contextOnly) {
|
|
|
2405
2046
|
}
|
|
2406
2047
|
function contributeStyleObjectInner(state, property, value, merge, contextOnly) {
|
|
2407
2048
|
var _directState_flatPass;
|
|
2408
|
-
var
|
|
2409
|
-
var
|
|
2410
|
-
var hasDefault = Object.prototype.hasOwnProperty.call(value, "default");
|
|
2049
|
+
var parent = ((_directState_flatPass = state.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passParentCursor]) || null;
|
|
2050
|
+
var hasDefault = "default" in value;
|
|
2411
2051
|
var hasBase = false;
|
|
2412
2052
|
var base = hasDefault ? value.default : void 0;
|
|
2413
2053
|
if (base != null) {
|
|
2414
|
-
var baseString = String(base);
|
|
2415
|
-
feedCompoundSegment(directState, baseString, 0, baseString.length, true, true, "");
|
|
2416
2054
|
emitAtParentCondition(state, property, base, merge, base, contextOnly);
|
|
2417
2055
|
hasBase = true;
|
|
2418
2056
|
}
|
|
@@ -2432,12 +2070,7 @@ function contributeStyleObjectInner(state, property, value, merge, contextOnly)
|
|
|
2432
2070
|
return false;
|
|
2433
2071
|
}
|
|
2434
2072
|
}
|
|
2435
|
-
if (payload != null)
|
|
2436
|
-
var _directState_flatPass1;
|
|
2437
|
-
conditions |= emitUnderCondition(state, property, payload, cursor, merge, payload, contextOnly, 1, payload);
|
|
2438
|
-
var payloadString = String(payload);
|
|
2439
|
-
feedCompoundSegment(directState, payloadString, 0, payloadString.length, false, Boolean(condition), condition && ((_directState_flatPass1 = directState.flatPass) === null || _directState_flatPass1 === void 0 ? void 0 : _directState_flatPass1[passCompoundIndexes]) ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
2440
|
-
}
|
|
2073
|
+
if (payload != null) conditions |= emitUnderCondition(state, property, payload, cursor, merge, payload, contextOnly, 1, payload);
|
|
2441
2074
|
releaseConditionCursors(watermark);
|
|
2442
2075
|
}
|
|
2443
2076
|
if (!hasDefault && firstCondition) return false;
|
|
@@ -2450,13 +2083,16 @@ function contributeStyleObjectInner(state, property, value, merge, contextOnly)
|
|
|
2450
2083
|
function contributeValue(state, property, value, merge, originalValue) {
|
|
2451
2084
|
var contextOnly = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false, condition = arguments.length > 6 ? arguments[6] : void 0;
|
|
2452
2085
|
if (isConditionTransport(value)) {
|
|
2453
|
-
if (value
|
|
2454
|
-
|
|
2455
|
-
|
|
2086
|
+
if (value[transportHasBase]) {
|
|
2087
|
+
var base = value[transportBase];
|
|
2088
|
+
contributeValue(state, property, base, merge, base, contextOnly);
|
|
2089
|
+
}
|
|
2090
|
+
for (var offset = transportEntries; offset < value.length;) {
|
|
2091
|
+
var entryValue = value[offset];
|
|
2456
2092
|
var watermark = conditionCursorTop;
|
|
2457
2093
|
try {
|
|
2458
2094
|
var _state_flatPass;
|
|
2459
|
-
emitUnderCondition(state, property, entryValue, acquireTransportCursor(state, value
|
|
2095
|
+
emitUnderCondition(state, property, entryValue, acquireTransportCursor(state, value, offset, ((_state_flatPass = state.flatPass) === null || _state_flatPass === void 0 ? void 0 : _state_flatPass[passParentCursor]) || null), merge, entryValue, contextOnly, 2, entryValue);
|
|
2460
2096
|
} finally {
|
|
2461
2097
|
releaseConditionCursors(watermark);
|
|
2462
2098
|
}
|
|
@@ -2482,7 +2118,7 @@ function contributeValue(state, property, value, merge, originalValue) {
|
|
|
2482
2118
|
commitConditionCursor(state, effective);
|
|
2483
2119
|
} else effective = condition;
|
|
2484
2120
|
var isObjectValue = value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !isVariable(value);
|
|
2485
|
-
var objectHasDefault = isObjectValue &&
|
|
2121
|
+
var objectHasDefault = isObjectValue && "default" in value;
|
|
2486
2122
|
var firstChild = isObjectValue && !objectHasDefault ? acquireConditionCursor(effective) : null;
|
|
2487
2123
|
if (isObjectValue && classifyConditionalObject(value, state, void 0, firstChild || void 0)) {
|
|
2488
2124
|
var useFirstChild = firstChild !== null;
|
|
@@ -2551,17 +2187,20 @@ function clearDirectStyle(state, property) {
|
|
|
2551
2187
|
if (state.style) delete state.style[atomicKey];
|
|
2552
2188
|
delete state.classNames[atomicKey];
|
|
2553
2189
|
}
|
|
2554
|
-
var
|
|
2190
|
+
var conditionTransportTag = /* @__PURE__ */ Symbol();
|
|
2191
|
+
var transportHasBase = 1;
|
|
2192
|
+
var transportBase = 2;
|
|
2193
|
+
var transportEntries = 3;
|
|
2194
|
+
var transportEntryWidth = 2;
|
|
2555
2195
|
function isConditionTransport(value) {
|
|
2556
|
-
return (
|
|
2196
|
+
return Array.isArray(value) && value[0] === conditionTransportTag;
|
|
2557
2197
|
}
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
entries.push(value, conditionTexts[cursor + conditionKeyOffset] || "");
|
|
2198
|
+
function appendConditionEntry(transport, cursor, value) {
|
|
2199
|
+
transport.push(value, conditionTexts[cursor + conditionKeyOffset] || "");
|
|
2561
2200
|
}
|
|
2562
|
-
function acquireTransportCursor(state,
|
|
2201
|
+
function acquireTransportCursor(state, transport, offset, parent) {
|
|
2563
2202
|
var cursor = acquireConditionCursor(parent);
|
|
2564
|
-
var key =
|
|
2203
|
+
var key = transport[offset + 1];
|
|
2565
2204
|
if (key) resolveConditionText(state, cursor, key);
|
|
2566
2205
|
commitConditionCursor(state, cursor);
|
|
2567
2206
|
return cursor;
|
|
@@ -2570,15 +2209,14 @@ function mergeConditionTransport(state, prev, cursor, value) {
|
|
|
2570
2209
|
var transport;
|
|
2571
2210
|
if (isConditionTransport(prev)) transport = prev;
|
|
2572
2211
|
else {
|
|
2573
|
-
transport =
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
conditionTransports.add(transport);
|
|
2212
|
+
transport = [
|
|
2213
|
+
conditionTransportTag,
|
|
2214
|
+
false,
|
|
2215
|
+
void 0
|
|
2216
|
+
];
|
|
2579
2217
|
if (prev != null) {
|
|
2580
2218
|
var isObjectValue = (typeof prev === "undefined" ? "undefined" : _type_of(prev)) === "object" && !Array.isArray(prev) && !isVariable(prev);
|
|
2581
|
-
var objectHasDefault = isObjectValue &&
|
|
2219
|
+
var objectHasDefault = isObjectValue && "default" in prev;
|
|
2582
2220
|
var authoredWatermark = conditionCursorTop;
|
|
2583
2221
|
try {
|
|
2584
2222
|
var firstCursor = isObjectValue && !objectHasDefault ? acquireConditionCursor() : null;
|
|
@@ -2588,8 +2226,8 @@ function mergeConditionTransport(state, prev, cursor, value) {
|
|
|
2588
2226
|
var payload = prev[key];
|
|
2589
2227
|
if (payload == null) continue;
|
|
2590
2228
|
if (key === "default") {
|
|
2591
|
-
transport
|
|
2592
|
-
transport
|
|
2229
|
+
transport[transportHasBase] = true;
|
|
2230
|
+
transport[transportBase] = payload;
|
|
2593
2231
|
continue;
|
|
2594
2232
|
}
|
|
2595
2233
|
var watermark = conditionCursorTop;
|
|
@@ -2599,12 +2237,12 @@ function mergeConditionTransport(state, prev, cursor, value) {
|
|
|
2599
2237
|
resolveConditionText(state, keyCursor, key);
|
|
2600
2238
|
commitConditionCursor(state, keyCursor);
|
|
2601
2239
|
}
|
|
2602
|
-
appendConditionEntry(transport
|
|
2240
|
+
appendConditionEntry(transport, keyCursor, payload);
|
|
2603
2241
|
if (keyCursor !== firstCursor) releaseConditionCursors(watermark);
|
|
2604
2242
|
}
|
|
2605
2243
|
} else {
|
|
2606
|
-
transport
|
|
2607
|
-
transport
|
|
2244
|
+
transport[transportHasBase] = true;
|
|
2245
|
+
transport[transportBase] = prev;
|
|
2608
2246
|
}
|
|
2609
2247
|
} finally {
|
|
2610
2248
|
releaseConditionCursors(authoredWatermark);
|
|
@@ -2612,30 +2250,25 @@ function mergeConditionTransport(state, prev, cursor, value) {
|
|
|
2612
2250
|
}
|
|
2613
2251
|
}
|
|
2614
2252
|
var cursorKey = conditionTexts[cursor + conditionKeyOffset] || "";
|
|
2615
|
-
for (var offset =
|
|
2616
|
-
transport.
|
|
2253
|
+
for (var offset = transportEntries; offset < transport.length; offset += transportEntryWidth) if (transport[offset + 1] === cursorKey) {
|
|
2254
|
+
transport.splice(offset, transportEntryWidth);
|
|
2617
2255
|
break;
|
|
2618
2256
|
}
|
|
2619
|
-
appendConditionEntry(transport
|
|
2257
|
+
appendConditionEntry(transport, cursor, value);
|
|
2620
2258
|
return transport;
|
|
2621
2259
|
}
|
|
2622
2260
|
var variantValueHandler = {
|
|
2623
2261
|
segment(ctx, start, end, isBase, valid, source, chainStart, chainEnd, chainValid) {
|
|
2624
|
-
var _directState_flatPass;
|
|
2625
2262
|
var state = ctx[0];
|
|
2626
|
-
var directState = state;
|
|
2627
2263
|
if (start === end) return;
|
|
2628
2264
|
if (isBase) {
|
|
2629
|
-
feedCompoundSegment(directState, source, start, end, true, valid, "");
|
|
2630
2265
|
if (!valid) return;
|
|
2631
2266
|
emitResolvedVariant(ctx[1], source.slice(start, end), state, ctx[2], null);
|
|
2632
2267
|
return;
|
|
2633
2268
|
}
|
|
2634
2269
|
if (!valid || !chainValid) return;
|
|
2635
|
-
var cursor =
|
|
2636
|
-
|
|
2637
|
-
feedCompoundSegment(directState, source, start, end, false, Boolean(condition), condition && ((_directState_flatPass = directState.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passCompoundIndexes]) ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
2638
|
-
if (!condition) return;
|
|
2270
|
+
var cursor = state.flatScanCursor;
|
|
2271
|
+
if (!(cursor && conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag ? conditionNumbers[cursor + conditionValueOffset] : 0)) return;
|
|
2639
2272
|
emitResolvedVariant(ctx[1], source.slice(start, end), state, ctx[2], cursor);
|
|
2640
2273
|
},
|
|
2641
2274
|
modifier(ctx, start, end, valid, first, source) {
|
|
@@ -2658,80 +2291,6 @@ var variantValueHandler = {
|
|
|
2658
2291
|
return true;
|
|
2659
2292
|
}
|
|
2660
2293
|
};
|
|
2661
|
-
var contextPropSets = /* @__PURE__ */ new WeakMap();
|
|
2662
|
-
function getContextPropSet(staticConfig) {
|
|
2663
|
-
var _staticConfig_parentStaticConfig, _staticConfig_parentStaticConfig1, _staticConfig_parentStaticConfig2, _staticConfig_parentStaticConfig_context, _staticConfig_parentStaticConfig3;
|
|
2664
|
-
var cached = contextPropSets.get(staticConfig);
|
|
2665
|
-
if (cached !== void 0) return cached;
|
|
2666
|
-
var contextConfig = staticConfig.context || ((_staticConfig_parentStaticConfig = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig === void 0 ? void 0 : _staticConfig_parentStaticConfig.context);
|
|
2667
|
-
var inheritedContextPropKeys = !staticConfig.context || staticConfig.context === ((_staticConfig_parentStaticConfig1 = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig1 === void 0 ? void 0 : _staticConfig_parentStaticConfig1.context) ? (_staticConfig_parentStaticConfig2 = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig2 === void 0 ? void 0 : _staticConfig_parentStaticConfig2.contextProps : void 0;
|
|
2668
|
-
var contextPropKeys = staticConfig.contextProps || inheritedContextPropKeys;
|
|
2669
|
-
var set = null;
|
|
2670
|
-
if (contextConfig === null || contextConfig === void 0 ? void 0 : contextConfig.props) {
|
|
2671
|
-
set || (set = /* @__PURE__ */ new Set());
|
|
2672
|
-
for (var key in contextConfig.props) set.add(key);
|
|
2673
|
-
}
|
|
2674
|
-
if (contextPropKeys) {
|
|
2675
|
-
set || (set = /* @__PURE__ */ new Set());
|
|
2676
|
-
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2677
|
-
try {
|
|
2678
|
-
for (var _iterator2 = contextPropKeys[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2679
|
-
var key1 = _step2.value;
|
|
2680
|
-
set.add(key1);
|
|
2681
|
-
}
|
|
2682
|
-
} catch (err) {
|
|
2683
|
-
_didIteratorError2 = true;
|
|
2684
|
-
_iteratorError2 = err;
|
|
2685
|
-
} finally {
|
|
2686
|
-
try {
|
|
2687
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
2688
|
-
} finally {
|
|
2689
|
-
if (_didIteratorError2) throw _iteratorError2;
|
|
2690
|
-
}
|
|
2691
|
-
}
|
|
2692
|
-
}
|
|
2693
|
-
if (contextConfig === null || contextConfig === void 0 ? void 0 : contextConfig.propKeys) {
|
|
2694
|
-
set || (set = /* @__PURE__ */ new Set());
|
|
2695
|
-
var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
|
|
2696
|
-
try {
|
|
2697
|
-
for (var _iterator12 = contextConfig.propKeys[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
|
|
2698
|
-
var key2 = _step12.value;
|
|
2699
|
-
set.add(key2);
|
|
2700
|
-
}
|
|
2701
|
-
} catch (err) {
|
|
2702
|
-
_didIteratorError12 = true;
|
|
2703
|
-
_iteratorError12 = err;
|
|
2704
|
-
} finally {
|
|
2705
|
-
try {
|
|
2706
|
-
if (!_iteratorNormalCompletion12 && _iterator12.return != null) _iterator12.return();
|
|
2707
|
-
} finally {
|
|
2708
|
-
if (_didIteratorError12) throw _iteratorError12;
|
|
2709
|
-
}
|
|
2710
|
-
}
|
|
2711
|
-
}
|
|
2712
|
-
var parentPropKeys = (_staticConfig_parentStaticConfig3 = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig3 === void 0 ? void 0 : (_staticConfig_parentStaticConfig_context = _staticConfig_parentStaticConfig3.context) === null || _staticConfig_parentStaticConfig_context === void 0 ? void 0 : _staticConfig_parentStaticConfig_context.propKeys;
|
|
2713
|
-
if (parentPropKeys) {
|
|
2714
|
-
set || (set = /* @__PURE__ */ new Set());
|
|
2715
|
-
var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;
|
|
2716
|
-
try {
|
|
2717
|
-
for (var _iterator22 = parentPropKeys[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {
|
|
2718
|
-
var key3 = _step22.value;
|
|
2719
|
-
set.add(key3);
|
|
2720
|
-
}
|
|
2721
|
-
} catch (err) {
|
|
2722
|
-
_didIteratorError22 = true;
|
|
2723
|
-
_iteratorError22 = err;
|
|
2724
|
-
} finally {
|
|
2725
|
-
try {
|
|
2726
|
-
if (!_iteratorNormalCompletion22 && _iterator22.return != null) _iterator22.return();
|
|
2727
|
-
} finally {
|
|
2728
|
-
if (_didIteratorError22) throw _iteratorError22;
|
|
2729
|
-
}
|
|
2730
|
-
}
|
|
2731
|
-
}
|
|
2732
|
-
contextPropSets.set(staticConfig, set);
|
|
2733
|
-
return set;
|
|
2734
|
-
}
|
|
2735
2294
|
function emitMappedValue(styleState, key, value, originalValue, nestedCondition, parentCondition, fallbackOriginal) {
|
|
2736
2295
|
var nested = nestedCondition;
|
|
2737
2296
|
var parent = parentCondition;
|
|
@@ -2752,8 +2311,8 @@ function emitMappedValue(styleState, key, value, originalValue, nestedCondition,
|
|
|
2752
2311
|
}
|
|
2753
2312
|
var contributeMappedValue = function(key, value, styleState, disabled, parentCondition, fallbackOriginal) {
|
|
2754
2313
|
if (disabled) return emitMappedValue(styleState, key, value, void 0, void 0, parentCondition, fallbackOriginal);
|
|
2755
|
-
var { conf, styleProps
|
|
2756
|
-
var
|
|
2314
|
+
var { conf, styleProps } = styleState;
|
|
2315
|
+
var variants = styleState.flatStyleStaticConfig.variants;
|
|
2757
2316
|
var { disableExpandShorthands, noExpand, resolveValues } = styleProps;
|
|
2758
2317
|
var shorthands = conf.shorthands;
|
|
2759
2318
|
if (value === "unset") {
|
|
@@ -2824,15 +2383,15 @@ var contributeMappedValue = function(key, value, styleState, disabled, parentCon
|
|
|
2824
2383
|
}
|
|
2825
2384
|
};
|
|
2826
2385
|
function resolveVariants(key, value, styleProps, styleState, parentVariantKey) {
|
|
2827
|
-
var
|
|
2828
|
-
var variantDefinition = (
|
|
2386
|
+
var _styleState_flatStyleStaticConfig_variants;
|
|
2387
|
+
var variantDefinition = (_styleState_flatStyleStaticConfig_variants = styleState.flatStyleStaticConfig.variants) === null || _styleState_flatStyleStaticConfig_variants === void 0 ? void 0 : _styleState_flatStyleStaticConfig_variants[key];
|
|
2829
2388
|
if (isConditionTransport(value)) {
|
|
2830
|
-
if (value
|
|
2831
|
-
for (var offset =
|
|
2832
|
-
var entryValue = value
|
|
2389
|
+
if (value[transportHasBase]) emitResolvedVariant(key, value[transportBase], styleState, parentVariantKey, null);
|
|
2390
|
+
for (var offset = transportEntries; offset < value.length;) {
|
|
2391
|
+
var entryValue = value[offset];
|
|
2833
2392
|
var watermark = conditionCursorTop;
|
|
2834
2393
|
try {
|
|
2835
|
-
emitResolvedVariant(key, entryValue, styleState, parentVariantKey, acquireTransportCursor(styleState, value
|
|
2394
|
+
emitResolvedVariant(key, entryValue, styleState, parentVariantKey, acquireTransportCursor(styleState, value, offset, null));
|
|
2836
2395
|
} finally {
|
|
2837
2396
|
releaseConditionCursors(watermark);
|
|
2838
2397
|
}
|
|
@@ -2858,32 +2417,27 @@ function resolveVariants(key, value, styleProps, styleState, parentVariantKey) {
|
|
|
2858
2417
|
return;
|
|
2859
2418
|
}
|
|
2860
2419
|
var isObjectValue = value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !isVariable(value);
|
|
2861
|
-
var objectHasDefault = isObjectValue &&
|
|
2420
|
+
var objectHasDefault = isObjectValue && "default" in value;
|
|
2862
2421
|
var objectWatermark = conditionCursorTop;
|
|
2863
2422
|
try {
|
|
2864
2423
|
var firstCursor = isObjectValue && !objectHasDefault ? acquireConditionCursor() : null;
|
|
2865
2424
|
if (isObjectValue && classifyConditionalObject(value, styleState, void 0, firstCursor || void 0)) {
|
|
2866
2425
|
var useFirstCursor = firstCursor !== null;
|
|
2867
2426
|
for (var objKey in value) {
|
|
2868
|
-
var _directState_flatPass;
|
|
2869
2427
|
var payload = value[objKey];
|
|
2870
2428
|
if (payload == null) continue;
|
|
2871
|
-
var directState1 = styleState;
|
|
2872
|
-
var payloadString = String(payload);
|
|
2873
2429
|
if (objKey === "default") {
|
|
2874
|
-
feedCompoundSegment(directState1, payloadString, 0, payloadString.length, true, true, "");
|
|
2875
2430
|
emitResolvedVariant(key, payload, styleState, parentVariantKey, null);
|
|
2876
2431
|
continue;
|
|
2877
2432
|
}
|
|
2878
2433
|
var watermark2 = conditionCursorTop;
|
|
2879
2434
|
var cursor1 = useFirstCursor ? firstCursor : acquireConditionCursor();
|
|
2880
|
-
|
|
2435
|
+
conditionNumbers[cursor1 + conditionValueOffset];
|
|
2881
2436
|
if (useFirstCursor) useFirstCursor = false;
|
|
2882
2437
|
else {
|
|
2883
2438
|
resolveConditionText(styleState, cursor1, objKey);
|
|
2884
|
-
|
|
2439
|
+
commitConditionCursor(styleState, cursor1);
|
|
2885
2440
|
}
|
|
2886
|
-
if ((_directState_flatPass = directState1.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passCompoundIndexes]) feedCompoundSegment(directState1, payloadString, 0, payloadString.length, false, Boolean(condition), condition ? conditionTexts[cursor1 + conditionKeyOffset] || "" : "");
|
|
2887
2441
|
emitResolvedVariant(key, payload, styleState, parentVariantKey, cursor1);
|
|
2888
2442
|
if (cursor1 !== firstCursor) releaseConditionCursors(watermark2);
|
|
2889
2443
|
}
|
|
@@ -2895,31 +2449,13 @@ function resolveVariants(key, value, styleProps, styleState, parentVariantKey) {
|
|
|
2895
2449
|
emitResolvedVariant(key, value, styleState, parentVariantKey, null);
|
|
2896
2450
|
}
|
|
2897
2451
|
function emitResolvedVariant(key, value, styleState, parentVariantKey, conditionCursor) {
|
|
2898
|
-
var {
|
|
2452
|
+
var { conf, debug } = styleState;
|
|
2899
2453
|
var styleProps = styleState.styleProps;
|
|
2900
|
-
var
|
|
2454
|
+
var variants = styleState.flatStyleStaticConfig.variants;
|
|
2901
2455
|
if (!variants) return;
|
|
2902
2456
|
var variant = variants[key];
|
|
2903
2457
|
var variantValue = getVariantDefinition(variant, value, conf, styleState);
|
|
2904
|
-
if (
|
|
2905
|
-
console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`);
|
|
2906
|
-
console.info({
|
|
2907
|
-
key,
|
|
2908
|
-
value,
|
|
2909
|
-
variantValue,
|
|
2910
|
-
variants
|
|
2911
|
-
});
|
|
2912
|
-
console.groupEnd();
|
|
2913
|
-
}
|
|
2914
|
-
if (!variantValue) {
|
|
2915
|
-
if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1") {
|
|
2916
|
-
if (typeof value !== "boolean") {
|
|
2917
|
-
var name = styleState.styleProps.displayName || "[UnnamedComponent]";
|
|
2918
|
-
console.warn(`No variant found: ${name} has variant "${key}", but no matching value "${value}"`);
|
|
2919
|
-
}
|
|
2920
|
-
}
|
|
2921
|
-
return;
|
|
2922
|
-
}
|
|
2458
|
+
if (!variantValue) return;
|
|
2923
2459
|
if (typeof variantValue === "function") {
|
|
2924
2460
|
variantValue = variantValue(value, getVariantExtras(styleState));
|
|
2925
2461
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && false);
|
|
@@ -2928,27 +2464,21 @@ function emitResolvedVariant(key, value, styleState, parentVariantKey, condition
|
|
|
2928
2464
|
if (process.env.NODE_ENV === "development" && debug === "verbose") console.info(` expanding styles from `, variantValue);
|
|
2929
2465
|
var { noSkip } = styleProps;
|
|
2930
2466
|
var originals = styleOriginalValues.get(variantValue);
|
|
2931
|
-
var
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
var
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
styleState.originalContextPropValues[outputKey] = originalValue;
|
|
2947
|
-
}
|
|
2948
|
-
contributeMappedValue(outputKey, outputValue, styleState, parentVariantKey === key && outputKey === key, conditionCursor || void 0, originalValue);
|
|
2949
|
-
}
|
|
2950
|
-
} finally {
|
|
2951
|
-
directState.flatCompoundOutputDepth--;
|
|
2467
|
+
for (var outputKey in variantValue) {
|
|
2468
|
+
if (!noSkip && outputKey in skipProps) continue;
|
|
2469
|
+
var rawOutputValue = variantValue[outputKey];
|
|
2470
|
+
var outputValue = styleProps.noNormalize ? rawOutputValue : normalizeValueWithProperty(rawOutputValue, conf.shorthands[outputKey] || outputKey);
|
|
2471
|
+
var _originals_outputKey;
|
|
2472
|
+
var originalValue = (_originals_outputKey = originals === null || originals === void 0 ? void 0 : originals[outputKey]) !== null && _originals_outputKey !== void 0 ? _originals_outputKey : rawOutputValue;
|
|
2473
|
+
var contextPropSet = styleState.flatStyleStaticConfig.styledContextKeys;
|
|
2474
|
+
if (contextPropSet === null || contextPropSet === void 0 ? void 0 : contextPropSet.has(outputKey)) {
|
|
2475
|
+
var _styleState, _styleState1;
|
|
2476
|
+
(_styleState = styleState).overriddenContextProps || (_styleState.overriddenContextProps = {});
|
|
2477
|
+
styleState.overriddenContextProps[outputKey] = originalValue;
|
|
2478
|
+
(_styleState1 = styleState).originalContextPropValues || (_styleState1.originalContextPropValues = {});
|
|
2479
|
+
styleState.originalContextPropValues[outputKey] = originalValue;
|
|
2480
|
+
}
|
|
2481
|
+
contributeMappedValue(outputKey, outputValue, styleState, parentVariantKey === key && outputKey === key, conditionCursor || void 0, originalValue);
|
|
2952
2482
|
}
|
|
2953
2483
|
}
|
|
2954
2484
|
function getFontFamilyFromNameOrVariable(input, conf) {
|
|
@@ -2965,127 +2495,6 @@ function getFontFamilyFromNameOrVariable(input, conf) {
|
|
|
2965
2495
|
} else if (typeof input === "string" && input in conf.fontsParsed) return input;
|
|
2966
2496
|
}
|
|
2967
2497
|
var variableToFontNameCache = /* @__PURE__ */ new WeakMap();
|
|
2968
|
-
function getVariantDefinition(variant, value, conf, param) {
|
|
2969
|
-
var { theme } = param;
|
|
2970
|
-
if (!variant) return;
|
|
2971
|
-
if (value === void 0) return;
|
|
2972
|
-
if (typeof variant === "function") return variant;
|
|
2973
|
-
if (Object.prototype.hasOwnProperty.call(variant, value)) return variant[value];
|
|
2974
|
-
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2975
|
-
try {
|
|
2976
|
-
for (var _iterator2 = getCompiledVariantResolvers(variant)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2977
|
-
var { key, parts } = _step2.value;
|
|
2978
|
-
var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
|
|
2979
|
-
try {
|
|
2980
|
-
for (var _iterator12 = parts[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
|
|
2981
|
-
var part3 = _step12.value;
|
|
2982
|
-
if (matchesVariantResolver(part3, value, conf, theme)) return variant[key];
|
|
2983
|
-
}
|
|
2984
|
-
} catch (err) {
|
|
2985
|
-
_didIteratorError12 = true;
|
|
2986
|
-
_iteratorError12 = err;
|
|
2987
|
-
} finally {
|
|
2988
|
-
try {
|
|
2989
|
-
if (!_iteratorNormalCompletion12 && _iterator12.return != null) _iterator12.return();
|
|
2990
|
-
} finally {
|
|
2991
|
-
if (_didIteratorError12) throw _iteratorError12;
|
|
2992
|
-
}
|
|
2993
|
-
}
|
|
2994
|
-
}
|
|
2995
|
-
} catch (err) {
|
|
2996
|
-
_didIteratorError2 = true;
|
|
2997
|
-
_iteratorError2 = err;
|
|
2998
|
-
} finally {
|
|
2999
|
-
try {
|
|
3000
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
3001
|
-
} finally {
|
|
3002
|
-
if (_didIteratorError2) throw _iteratorError2;
|
|
3003
|
-
}
|
|
3004
|
-
}
|
|
3005
|
-
}
|
|
3006
|
-
var variantResolverNameSet = new Set(variantResolverNames);
|
|
3007
|
-
var variantResolverCache = /* @__PURE__ */ new WeakMap();
|
|
3008
|
-
var preparedStyleStaticConfigs = /* @__PURE__ */ new WeakSet();
|
|
3009
|
-
function prepareStyleStaticConfig(staticConfig) {
|
|
3010
|
-
if (preparedStyleStaticConfigs.has(staticConfig)) return staticConfig;
|
|
3011
|
-
preparedStyleStaticConfigs.add(staticConfig);
|
|
3012
|
-
getContextPropSet(staticConfig);
|
|
3013
|
-
prepareStaticConfigCompounds(staticConfig);
|
|
3014
|
-
var variants = staticConfig.variants;
|
|
3015
|
-
if (variants) for (var key in variants) {
|
|
3016
|
-
var variant = variants[key];
|
|
3017
|
-
if (variant && (typeof variant === "undefined" ? "undefined" : _type_of(variant)) === "object") getCompiledVariantResolvers(variant);
|
|
3018
|
-
}
|
|
3019
|
-
return staticConfig;
|
|
3020
|
-
}
|
|
3021
|
-
function getCompiledVariantResolvers(variant) {
|
|
3022
|
-
var cached = variantResolverCache.get(variant);
|
|
3023
|
-
if (cached) return cached;
|
|
3024
|
-
var compiled = [];
|
|
3025
|
-
for (var key in variant) {
|
|
3026
|
-
var parts = parseVariantResolverKey(key);
|
|
3027
|
-
if (parts) compiled.push({
|
|
3028
|
-
key,
|
|
3029
|
-
parts
|
|
3030
|
-
});
|
|
3031
|
-
}
|
|
3032
|
-
variantResolverCache.set(variant, compiled);
|
|
3033
|
-
return compiled;
|
|
3034
|
-
}
|
|
3035
|
-
function parseVariantResolverKey(key) {
|
|
3036
|
-
if (!key) return null;
|
|
3037
|
-
var parts = [];
|
|
3038
|
-
var start = 0;
|
|
3039
|
-
for (var index = 0; index <= key.length; index++) {
|
|
3040
|
-
if (index !== key.length && key.charCodeAt(index) !== 124) continue;
|
|
3041
|
-
var partStart = start;
|
|
3042
|
-
var partEnd = index;
|
|
3043
|
-
while (partStart < partEnd && key.charCodeAt(partStart) <= 32) partStart++;
|
|
3044
|
-
while (partEnd > partStart && key.charCodeAt(partEnd - 1) <= 32) partEnd--;
|
|
3045
|
-
if (partStart === partEnd) return null;
|
|
3046
|
-
var part3 = key.slice(partStart, partEnd);
|
|
3047
|
-
if (!variantResolverNameSet.has(part3)) return null;
|
|
3048
|
-
parts.push(part3);
|
|
3049
|
-
start = index + 1;
|
|
3050
|
-
}
|
|
3051
|
-
return parts;
|
|
3052
|
-
}
|
|
3053
|
-
function hasNumericPrefix(value, suffixLength) {
|
|
3054
|
-
if (value.length <= suffixLength) return false;
|
|
3055
|
-
return Number.isFinite(Number(value.slice(0, value.length - suffixLength)));
|
|
3056
|
-
}
|
|
3057
|
-
function matchesVariantResolver(resolverName, value, conf, theme) {
|
|
3058
|
-
var string = typeof value === "string";
|
|
3059
|
-
var number = typeof value === "number";
|
|
3060
|
-
var rem = string && value.endsWith("rem") && hasNumericPrefix(value, 3);
|
|
3061
|
-
switch (resolverName) {
|
|
3062
|
-
case "Size":
|
|
3063
|
-
case "Space":
|
|
3064
|
-
case "Radius":
|
|
3065
|
-
case "ZIndex": return value === true || number || string || resolverName !== "Size" && isVariable(value);
|
|
3066
|
-
case "Color": return value != null && value in conf.tokensParsed.color || string;
|
|
3067
|
-
case "Theme": return string && !!theme && value in theme;
|
|
3068
|
-
case "FontSize":
|
|
3069
|
-
var _conf_fontsParsed_body_size, _conf_fontsParsed_body;
|
|
3070
|
-
return value === true || !!((_conf_fontsParsed_body = conf.fontsParsed.body) === null || _conf_fontsParsed_body === void 0 ? void 0 : (_conf_fontsParsed_body_size = _conf_fontsParsed_body.size) === null || _conf_fontsParsed_body_size === void 0 ? void 0 : _conf_fontsParsed_body_size[value]) || number || rem;
|
|
3071
|
-
case "FontStyle":
|
|
3072
|
-
var _conf_fontsParsed_body_style, _conf_fontsParsed_body1;
|
|
3073
|
-
return !!((_conf_fontsParsed_body1 = conf.fontsParsed.body) === null || _conf_fontsParsed_body1 === void 0 ? void 0 : (_conf_fontsParsed_body_style = _conf_fontsParsed_body1.style) === null || _conf_fontsParsed_body_style === void 0 ? void 0 : _conf_fontsParsed_body_style[value]) || value === "normal" || value === "italic";
|
|
3074
|
-
case "FontTransform":
|
|
3075
|
-
var _conf_fontsParsed_body_transform, _conf_fontsParsed_body2;
|
|
3076
|
-
return !!((_conf_fontsParsed_body2 = conf.fontsParsed.body) === null || _conf_fontsParsed_body2 === void 0 ? void 0 : (_conf_fontsParsed_body_transform = _conf_fontsParsed_body2.transform) === null || _conf_fontsParsed_body_transform === void 0 ? void 0 : _conf_fontsParsed_body_transform[value]) || value === "none" || value === "capitalize" || value === "uppercase" || value === "lowercase";
|
|
3077
|
-
case "FontLineHeight":
|
|
3078
|
-
var _conf_fontsParsed_body_lineHeight, _conf_fontsParsed_body3;
|
|
3079
|
-
return !!((_conf_fontsParsed_body3 = conf.fontsParsed.body) === null || _conf_fontsParsed_body3 === void 0 ? void 0 : (_conf_fontsParsed_body_lineHeight = _conf_fontsParsed_body3.lineHeight) === null || _conf_fontsParsed_body_lineHeight === void 0 ? void 0 : _conf_fontsParsed_body_lineHeight[value]) || number || rem;
|
|
3080
|
-
case "FontLetterSpacing":
|
|
3081
|
-
var _conf_fontsParsed_body_letterSpacing, _conf_fontsParsed_body4;
|
|
3082
|
-
return !!((_conf_fontsParsed_body4 = conf.fontsParsed.body) === null || _conf_fontsParsed_body4 === void 0 ? void 0 : (_conf_fontsParsed_body_letterSpacing = _conf_fontsParsed_body4.letterSpacing) === null || _conf_fontsParsed_body_letterSpacing === void 0 ? void 0 : _conf_fontsParsed_body_letterSpacing[value]) || number || rem;
|
|
3083
|
-
case "number":
|
|
3084
|
-
case "string":
|
|
3085
|
-
case "boolean": return (typeof value === "undefined" ? "undefined" : _type_of(value)) === resolverName;
|
|
3086
|
-
case "any": return true;
|
|
3087
|
-
}
|
|
3088
|
-
}
|
|
3089
2498
|
|
|
3090
|
-
export { STYLE_TOKEN_PROVENANCE_KEY, clearDirectStyle, contributeStyleString, directStyleSignature, flushDirectStyles2 as flushDirectStyles,
|
|
2499
|
+
export { STYLE_TOKEN_PROVENANCE_KEY, clearDirectStyle, contributeStyleString, directStyleSignature, flushDirectStyles2 as flushDirectStyles, getDirectDynamicThemeAccess, getFontFamilyFromNameOrVariable, getSplitStyles, getStyleStaticConfig, getStyleTokenProvenance, isValidStyleKey, styleOriginalValues };
|
|
3091
2500
|
//# sourceMappingURL=getSplitStyles.native.js.map
|