@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
|
@@ -26,98 +26,55 @@ __export(getSplitStyles_exports, {
|
|
|
26
26
|
contributeStyleString: () => contributeStyleString,
|
|
27
27
|
directStyleSignature: () => import_directStyleCSS2.directStyleSignature,
|
|
28
28
|
flushDirectStyles: () => import_directStyleCSS2.flushDirectStyles,
|
|
29
|
-
getContextPropSet: () => getContextPropSet,
|
|
30
29
|
getDirectDynamicThemeAccess: () => getDirectDynamicThemeAccess,
|
|
31
30
|
getFontFamilyFromNameOrVariable: () => getFontFamilyFromNameOrVariable,
|
|
32
31
|
getSplitStyles: () => getSplitStyles,
|
|
32
|
+
getStyleStaticConfig: () => import_styleStaticConfig.getStyleStaticConfig,
|
|
33
33
|
getStyleTokenProvenance: () => import_styleProvenance2.getStyleTokenProvenance,
|
|
34
34
|
isValidStyleKey: () => isValidStyleKey,
|
|
35
|
-
prepareStyleStaticConfig: () => prepareStyleStaticConfig,
|
|
36
35
|
styleOriginalValues: () => import_styleOriginalValues.styleOriginalValues
|
|
37
36
|
});
|
|
38
37
|
module.exports = __toCommonJS(getSplitStyles_exports);
|
|
39
38
|
var import_constants = require("@tamagui/constants");
|
|
40
39
|
var import_helpers = require("@tamagui/helpers");
|
|
40
|
+
var import_runtime = require("@tamagui/style-grammar/runtime");
|
|
41
41
|
var import_config = require("../config.cjs");
|
|
42
|
-
var import_createVariable = require("../createVariable.cjs");
|
|
43
42
|
var import_isDevTools = require("../constants/isDevTools.cjs");
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var import_runtime = require("@tamagui/style-grammar/runtime");
|
|
47
|
-
var import_mediaState2 = require("./mediaState.cjs");
|
|
48
|
-
var import_warnOnce = require("./warnOnce.cjs");
|
|
43
|
+
var import_createVariable = require("../createVariable.cjs");
|
|
44
|
+
var import_directStyleCSS = require("./directStyleCSS.cjs");
|
|
49
45
|
var import_expandStyle = require("./expandStyle.cjs");
|
|
50
46
|
var import_expandStyles = require("./expandStyles.cjs");
|
|
47
|
+
var import_grammarConfig = require("./grammarConfig.cjs");
|
|
48
|
+
var import_mediaState = require("./mediaState.cjs");
|
|
49
|
+
var import_styleStaticConfig = require("./styleStaticConfig.cjs");
|
|
51
50
|
var import_styleToCSS = require("./styleToCSS.cjs");
|
|
52
|
-
var
|
|
51
|
+
var import_variantResolvers = require("./variantResolvers.cjs");
|
|
52
|
+
var import_warnOnce = require("./warnOnce.cjs");
|
|
53
53
|
var import_directStyleCSS2 = require("./directStyleCSS.cjs");
|
|
54
|
-
var import_grammarConfig = require("./grammarConfig.cjs");
|
|
55
54
|
require("./getDynamicVal.cjs");
|
|
56
|
-
var
|
|
55
|
+
var import_getVariantExtras = require("./getVariantExtras.cjs");
|
|
57
56
|
require("./insertStyleRule.cjs");
|
|
58
57
|
var import_isObj = require("./isObj.cjs");
|
|
59
|
-
var import_isObj2 = require("./isObj.cjs");
|
|
60
58
|
var import_log = require("./log.cjs");
|
|
61
|
-
var import_normalizeStyle = require("./normalizeStyle.cjs");
|
|
62
59
|
var import_normalizeColor = require("./normalizeColor.cjs");
|
|
60
|
+
var import_normalizeStyle = require("./normalizeStyle.cjs");
|
|
63
61
|
var import_normalizeValueWithProperty = require("./normalizeValueWithProperty.cjs");
|
|
64
62
|
require("./parseNativeStyle.native.cjs");
|
|
65
63
|
require("./parseNativeTransform.native.cjs");
|
|
66
|
-
var import_getVariantExtras = require("./getVariantExtras.cjs");
|
|
67
64
|
var import_resolveRem = require("./resolveRem.cjs");
|
|
68
65
|
var import_resolveSafeArea = require("./resolveSafeArea.cjs");
|
|
69
66
|
var import_resolveSafeAreaVariable = require("./resolveSafeAreaVariable.cjs");
|
|
70
67
|
var import_resolveVariableValue = require("./resolveVariableValue.cjs");
|
|
71
|
-
var import_themeRef = require("./themeRef.cjs");
|
|
72
|
-
var import_tokenCategories = require("./tokenCategories.cjs");
|
|
73
68
|
var import_skipProps = require("./skipProps.cjs");
|
|
74
69
|
var import_styleOriginalValues = require("./styleOriginalValues.cjs");
|
|
75
70
|
var import_styleProvenance = require("./styleProvenance.cjs");
|
|
71
|
+
var import_themeRef = require("./themeRef.cjs");
|
|
72
|
+
var import_tokenCategories = require("./tokenCategories.cjs");
|
|
76
73
|
var import_transformsToString = require("./transformsToString.cjs");
|
|
77
74
|
var import_styleProvenance2 = require("./styleProvenance.cjs");
|
|
78
75
|
__reExport(getSplitStyles_exports, require("./tokenCategories.cjs"), module.exports);
|
|
79
76
|
const TAMAGUI_CLASS_PROPS = "$$tamaguiClassProps";
|
|
80
77
|
const shouldTrackStyleTokenProvenance = process.env.NODE_ENV === "development" && process.env.TAMAGUI_ENABLE_STYLE_TOKEN_PROVENANCE === "1";
|
|
81
|
-
function compoundMatcherMatches(expected, actual) {
|
|
82
|
-
if (Array.isArray(expected)) {
|
|
83
|
-
for (let index = 0; index < expected.length; index++) if (expected[index] === actual) return true;
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
return expected === actual;
|
|
87
|
-
}
|
|
88
|
-
function compoundMatcherMatchesPayload(expected, source, start, end) {
|
|
89
|
-
if (Array.isArray(expected)) {
|
|
90
|
-
for (let index = 0; index < expected.length; index++) if (compoundMatcherMatchesPayload(expected[index], source, start, end)) return true;
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
const expectedValue = typeof expected === "string" ? expected : String(expected);
|
|
94
|
-
if (expectedValue.length !== end - start) return false;
|
|
95
|
-
for (let index = 0; index < expectedValue.length; index++) if (expectedValue.charCodeAt(index) !== source.charCodeAt(start + index)) return false;
|
|
96
|
-
return true;
|
|
97
|
-
}
|
|
98
|
-
const preparedCompoundsKey = /* @__PURE__ */ Symbol();
|
|
99
|
-
function prepareStaticConfigCompounds(staticConfig) {
|
|
100
|
-
const compoundVariants = staticConfig.compoundVariants;
|
|
101
|
-
const preparedConfig = staticConfig;
|
|
102
|
-
if (!compoundVariants?.length) {
|
|
103
|
-
preparedConfig[preparedCompoundsKey] = null;
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
const selectorCounts = [];
|
|
107
|
-
const indexesByKey = /* @__PURE__ */ Object.create(null);
|
|
108
|
-
indexesByKey[preparedCompoundsKey] = selectorCounts;
|
|
109
|
-
for (let index = 0; index < compoundVariants.length; index++) {
|
|
110
|
-
const compoundVariant = compoundVariants[index];
|
|
111
|
-
let selectorCount = 0;
|
|
112
|
-
for (const key in compoundVariant) {
|
|
113
|
-
if (key === "style") continue;
|
|
114
|
-
selectorCount++;
|
|
115
|
-
(indexesByKey[key] ||= []).push(index);
|
|
116
|
-
}
|
|
117
|
-
selectorCounts[index] = selectorCount;
|
|
118
|
-
}
|
|
119
|
-
preparedConfig[preparedCompoundsKey] = indexesByKey;
|
|
120
|
-
}
|
|
121
78
|
const conditionWidth = 4;
|
|
122
79
|
const conditionValueOffset = 0;
|
|
123
80
|
const conditionFlagsOffset = 1;
|
|
@@ -155,15 +112,6 @@ function reserveConditionCursor(cursor) {
|
|
|
155
112
|
conditionNumbers = new Float64Array(length);
|
|
156
113
|
conditionNumbers.set(previous);
|
|
157
114
|
}
|
|
158
|
-
function conditionWrapperCopy(cursor) {
|
|
159
|
-
const wrapper = conditionNumbers[cursor + conditionWrapperOffset];
|
|
160
|
-
const count = wrapper & 7;
|
|
161
|
-
if (!count) return void 0;
|
|
162
|
-
const start = wrapper >> 3;
|
|
163
|
-
const wrappers = new Array(count);
|
|
164
|
-
for (let index = 0; index < count; index++) wrappers[index] = conditionWrappers[start + index];
|
|
165
|
-
return wrappers;
|
|
166
|
-
}
|
|
167
115
|
function setConditionUnresolved(cursor, name = "") {
|
|
168
116
|
conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionResolvedFlag;
|
|
169
117
|
if (name) {
|
|
@@ -295,7 +243,7 @@ function accumulateConditionAtom(state, cursor, kind, rank, name) {
|
|
|
295
243
|
const context = state.flatGroupContext?.[groupKey];
|
|
296
244
|
if (process.env.NODE_ENV === "development" && containerName && !component && !context && state.flatGroupContext?.[containerName]) (0, import_warnOnce.warnOnce)(`group-container:${containerName}`, `@${containerSize}/${containerName}: targets group="${containerName}", but groups no longer establish query containers. Add container="${containerName}" to that group.`);
|
|
297
245
|
const match = component?.media?.[containerSize];
|
|
298
|
-
if (!(match === void 0 ? context?.state.layout && (0,
|
|
246
|
+
if (!(match === void 0 ? context?.state.layout && (0, import_mediaState.mediaKeyMatch)(containerSize, context.state.layout) : match)) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
|
|
299
247
|
(state.flatGroupKeys ||= /* @__PURE__ */ new Set()).add(groupKey);
|
|
300
248
|
(state.flatGroupMedia ||= /* @__PURE__ */ new Set()).add(containerSize);
|
|
301
249
|
} else {
|
|
@@ -387,161 +335,8 @@ function acquireConditionKeyCursor(state, key) {
|
|
|
387
335
|
}
|
|
388
336
|
return cursor;
|
|
389
337
|
}
|
|
390
|
-
function combineConditionKeys(state, first, second) {
|
|
391
|
-
if (!first) return second;
|
|
392
|
-
if (!second || first === second) return first;
|
|
393
|
-
const watermark = conditionCursorTop;
|
|
394
|
-
const target = acquireConditionKeyCursor(state, first);
|
|
395
|
-
resolveConditionText(state, target, second);
|
|
396
|
-
commitConditionCursor(state, target);
|
|
397
|
-
const key = conditionTexts[target + conditionKeyOffset] || "";
|
|
398
|
-
releaseConditionCursors(watermark);
|
|
399
|
-
return key;
|
|
400
|
-
}
|
|
401
|
-
function freshCompoundState() {
|
|
402
|
-
return {
|
|
403
|
-
seen: 0,
|
|
404
|
-
failed: false,
|
|
405
|
-
matchedBase: false,
|
|
406
|
-
scanned: false,
|
|
407
|
-
pending: null,
|
|
408
|
-
combinations: null
|
|
409
|
-
};
|
|
410
|
-
}
|
|
411
|
-
function beginCompoundEdges(indexes, states) {
|
|
412
|
-
if (!indexes) return;
|
|
413
|
-
for (let index = 0; index < indexes.length; index++) {
|
|
414
|
-
const state = states[indexes[index]] ||= freshCompoundState();
|
|
415
|
-
state.pending = null;
|
|
416
|
-
state.matchedBase = false;
|
|
417
|
-
state.scanned = false;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
function feedCompoundSegment(state, source, start, end, isBase, valid, conditionKey) {
|
|
421
|
-
if (state.flatCompoundOutputDepth) return;
|
|
422
|
-
const pass = state.flatPass;
|
|
423
|
-
const indexes = pass[passCompoundIndexes];
|
|
424
|
-
const states = pass[passCompoundStates];
|
|
425
|
-
const key = pass[passCompoundKey];
|
|
426
|
-
if (!indexes || !states || !key) return;
|
|
427
|
-
const compoundVariants = state.staticConfig.compoundVariants;
|
|
428
|
-
for (let index = 0; index < indexes.length; index++) {
|
|
429
|
-
const compoundIndex = indexes[index];
|
|
430
|
-
const compoundState = states[compoundIndex] ||= freshCompoundState();
|
|
431
|
-
compoundState.scanned = true;
|
|
432
|
-
if (!valid || start === end || !compoundMatcherMatchesPayload(compoundVariants[compoundIndex][key], source, start, end)) continue;
|
|
433
|
-
if (isBase) compoundState.matchedBase = true;
|
|
434
|
-
else if (!compoundState.matchedBase) (compoundState.pending ||= []).push(conditionKey);
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
const compoundOnlyHandler = {
|
|
438
|
-
segment(state, start, end, isBase, valid, source, chainStart, chainEnd, chainValid) {
|
|
439
|
-
if (isBase) {
|
|
440
|
-
feedCompoundSegment(state, source, start, end, true, valid, "");
|
|
441
|
-
return;
|
|
442
|
-
}
|
|
443
|
-
const cursor = state.flatScanCursor;
|
|
444
|
-
if (!chainValid || !cursor || !(conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) || !conditionNumbers[cursor + conditionValueOffset]) {
|
|
445
|
-
feedCompoundSegment(state, source, start, end, false, false, "");
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
feedCompoundSegment(state, source, start, end, false, valid, conditionTexts[cursor + conditionKeyOffset] || "");
|
|
449
|
-
},
|
|
450
|
-
modifier(state, start, end, valid, first, source) {
|
|
451
|
-
let cursor = state.flatScanCursor;
|
|
452
|
-
if (!cursor) cursor = state.flatScanCursor = acquireConditionCursor();
|
|
453
|
-
else if (first) resetConditionCursor(cursor, 0);
|
|
454
|
-
if (!valid) {
|
|
455
|
-
setConditionUnresolved(cursor);
|
|
456
|
-
return;
|
|
457
|
-
}
|
|
458
|
-
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) resolveConditionModifier(state, cursor, source.slice(start, end));
|
|
459
|
-
},
|
|
460
|
-
chain(state, _start, _end, valid) {
|
|
461
|
-
const cursor = state.flatScanCursor;
|
|
462
|
-
if (cursor) {
|
|
463
|
-
if (!valid) setConditionUnresolved(cursor);
|
|
464
|
-
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) commitConditionCursor(state, cursor);
|
|
465
|
-
}
|
|
466
|
-
return true;
|
|
467
|
-
}
|
|
468
|
-
};
|
|
469
|
-
function finishCompoundEdges(pass, key, value, indexes, states) {
|
|
470
|
-
if (!indexes) return;
|
|
471
|
-
const state = pass[passStyleState];
|
|
472
|
-
pass[passCompoundIndexes] = indexes;
|
|
473
|
-
pass[passCompoundKey] = key;
|
|
474
|
-
pass[passCompoundStates] = states;
|
|
475
|
-
let needsScan = false;
|
|
476
|
-
for (let index = 0; index < indexes.length; index++) if (!(states[indexes[index]] ||= freshCompoundState()).scanned) {
|
|
477
|
-
needsScan = true;
|
|
478
|
-
break;
|
|
479
|
-
}
|
|
480
|
-
if (needsScan) if (typeof value === "string") {
|
|
481
|
-
const watermark = conditionCursorTop;
|
|
482
|
-
const previousCursor = state.flatScanCursor;
|
|
483
|
-
state.flatScanCursor = null;
|
|
484
|
-
try {
|
|
485
|
-
(0, import_runtime.scanFlatValue)(value, compoundOnlyHandler, state);
|
|
486
|
-
} finally {
|
|
487
|
-
state.flatScanCursor = previousCursor;
|
|
488
|
-
releaseConditionCursors(watermark);
|
|
489
|
-
}
|
|
490
|
-
} else if (value && typeof value === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value) && Object.prototype.hasOwnProperty.call(value, "default")) for (const conditionKey in value) {
|
|
491
|
-
const payload = value[conditionKey];
|
|
492
|
-
if (conditionKey === "default") {
|
|
493
|
-
const payloadString = String(payload);
|
|
494
|
-
feedCompoundSegment(state, payloadString, 0, payloadString.length, true, true, "");
|
|
495
|
-
} else {
|
|
496
|
-
const watermark = conditionCursorTop;
|
|
497
|
-
const cursor = acquireConditionCursor();
|
|
498
|
-
resolveConditionText(state, cursor, conditionKey);
|
|
499
|
-
const condition = commitConditionCursor(state, cursor);
|
|
500
|
-
const payloadString = String(payload);
|
|
501
|
-
feedCompoundSegment(state, payloadString, 0, payloadString.length, false, Boolean(condition), condition ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
502
|
-
releaseConditionCursors(watermark);
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
else {
|
|
506
|
-
const variants2 = state.staticConfig.compoundVariants;
|
|
507
|
-
for (let index = 0; index < indexes.length; index++) {
|
|
508
|
-
const compoundIndex = indexes[index];
|
|
509
|
-
const compoundState = states[compoundIndex] ||= freshCompoundState();
|
|
510
|
-
compoundState.scanned = true;
|
|
511
|
-
if (compoundMatcherMatches(variants2[compoundIndex][key], value)) compoundState.matchedBase = true;
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
const variants = state.staticConfig.compoundVariants;
|
|
515
|
-
const selectorCounts = state.staticConfig[preparedCompoundsKey][preparedCompoundsKey];
|
|
516
|
-
for (let index = 0; index < indexes.length; index++) {
|
|
517
|
-
const compoundIndex = indexes[index];
|
|
518
|
-
const compoundState = states[compoundIndex];
|
|
519
|
-
if (compoundState.failed) continue;
|
|
520
|
-
const branches = compoundState.matchedBase ? [""] : compoundState.pending;
|
|
521
|
-
if (!branches || !branches.length) {
|
|
522
|
-
compoundState.failed = true;
|
|
523
|
-
continue;
|
|
524
|
-
}
|
|
525
|
-
if (!compoundState.seen) compoundState.combinations = branches;
|
|
526
|
-
else {
|
|
527
|
-
const previous = compoundState.combinations;
|
|
528
|
-
const next = [];
|
|
529
|
-
for (let left = 0; left < previous.length; left++) for (let right = 0; right < branches.length; right++) {
|
|
530
|
-
const conditionKey = combineConditionKeys(state, previous[left], branches[right]);
|
|
531
|
-
if (!next.includes(conditionKey)) next.push(conditionKey);
|
|
532
|
-
}
|
|
533
|
-
compoundState.combinations = next;
|
|
534
|
-
}
|
|
535
|
-
compoundState.seen++;
|
|
536
|
-
if (compoundState.seen !== selectorCounts[compoundIndex]) continue;
|
|
537
|
-
const style = variants[compoundIndex].style;
|
|
538
|
-
if (!(0, import_isObj.isPlainObject)(style)) continue;
|
|
539
|
-
const combinations = compoundState.combinations;
|
|
540
|
-
for (let combination = 0; combination < combinations.length; combination++) for (const styleKey in style) contributeProp(pass, styleKey, style[styleKey], void 0, states, combinations[combination]);
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
338
|
function classifyConditionalObject(value, state, isChain, firstCursor) {
|
|
544
|
-
if (
|
|
339
|
+
if ("default" in value) return -1;
|
|
545
340
|
for (const key in value) {
|
|
546
341
|
if (!key.length) return 0;
|
|
547
342
|
if (!state) return isChain?.(key) ? 1 : 0;
|
|
@@ -567,9 +362,6 @@ const passFrontendContainer = 27;
|
|
|
567
362
|
const passFrontendContainerType = 28;
|
|
568
363
|
const passHocMappedProperties = 29;
|
|
569
364
|
const passHocMappedClasses = 30;
|
|
570
|
-
const passCompoundIndexes = 31;
|
|
571
|
-
const passCompoundKey = 32;
|
|
572
|
-
const passCompoundStates = 33;
|
|
573
365
|
const passParentCursor = 35;
|
|
574
366
|
const passMapSourceKey = 36;
|
|
575
367
|
const passMapFlags = 37;
|
|
@@ -581,92 +373,23 @@ const passHocFlag = 16;
|
|
|
581
373
|
const passTextFlag = 32;
|
|
582
374
|
const passInputFlag = 64;
|
|
583
375
|
const passAsChildStyleFlag = 128;
|
|
584
|
-
const styledDefaultsCache = /* @__PURE__ */ new WeakMap();
|
|
585
|
-
function getStyledDefaults(staticConfig, shorthands) {
|
|
586
|
-
let prepared = styledDefaultsCache.get(staticConfig);
|
|
587
|
-
if (prepared === void 0) {
|
|
588
|
-
let entries = null;
|
|
589
|
-
const defaults = staticConfig.defaultProps;
|
|
590
|
-
if (defaults) for (const key in defaults) {
|
|
591
|
-
if (!(key in import_helpers.stylePropsAll || key in shorthands)) continue;
|
|
592
|
-
const value = defaults[key];
|
|
593
|
-
if (maybeStyleProgram(value)) (entries ||= []).push(key, value);
|
|
594
|
-
}
|
|
595
|
-
prepared = entries;
|
|
596
|
-
styledDefaultsCache.set(staticConfig, prepared);
|
|
597
|
-
}
|
|
598
|
-
return prepared;
|
|
599
|
-
}
|
|
600
|
-
const maybeStyleProgram = (value) => typeof value === "string" ? value.indexOf(":") !== -1 : !!value && typeof value === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value);
|
|
601
|
-
function contributeDisplacedStyledDefaults(styledDefaults, processedProps, pass) {
|
|
602
|
-
if (!styledDefaults) return;
|
|
603
|
-
for (let offset = 0; offset < styledDefaults.length; offset += 2) {
|
|
604
|
-
const key = styledDefaults[offset];
|
|
605
|
-
const value = styledDefaults[offset + 1];
|
|
606
|
-
const propValue = processedProps[key];
|
|
607
|
-
if (propValue !== void 0 && propValue !== value) contributeProp(pass, key, value);
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
function injectDisplacedStyledDefault(pass, key, value) {
|
|
611
|
-
const defaultValue = pass[4].defaultProps?.[key];
|
|
612
|
-
if (defaultValue === void 0 || value === void 0 || value === defaultValue || maybeStyleProgram(defaultValue)) return;
|
|
613
|
-
const state = pass[passStyleState];
|
|
614
|
-
state.flatWeakContribution = true;
|
|
615
|
-
try {
|
|
616
|
-
contributeProp(pass, key, defaultValue);
|
|
617
|
-
} finally {
|
|
618
|
-
state.flatWeakContribution = false;
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
376
|
function forEachPropInForwardOrder(pass) {
|
|
622
377
|
const styleState = pass[passStyleState];
|
|
623
|
-
const staticConfig = styleState.staticConfig;
|
|
624
378
|
const processedProps = styleState.props;
|
|
625
|
-
const
|
|
626
|
-
const
|
|
627
|
-
const
|
|
628
|
-
const directState = styleState;
|
|
629
|
-
const preparedCompounds = staticConfig[preparedCompoundsKey];
|
|
630
|
-
if (preparedCompounds === void 0 && staticConfig.compoundVariants?.length) throw new Error("A component with compoundVariants reached style resolution before its static config was prepared.");
|
|
379
|
+
const styleStaticConfig = styleState.flatStyleStaticConfig;
|
|
380
|
+
const baseStyle = styleStaticConfig.baseStyle;
|
|
381
|
+
const baseVariantProps = styleStaticConfig.baseVariantProps;
|
|
631
382
|
const conditionWrapperBase = conditionWrapperTop;
|
|
632
|
-
if (!preparedCompounds) {
|
|
633
|
-
try {
|
|
634
|
-
if (processedBaseStyle) for (const key in processedBaseStyle) contributeProp(pass, key, processedBaseStyle[key]);
|
|
635
|
-
contributeDisplacedStyledDefaults(styledDefaults, processedProps, pass);
|
|
636
|
-
for (const key in processedProps) {
|
|
637
|
-
const value = processedProps[key];
|
|
638
|
-
directState.flatPropSawCondition = false;
|
|
639
|
-
contributeProp(pass, key, value);
|
|
640
|
-
if (directState.flatPropSawCondition) injectDisplacedStyledDefault(pass, key, value);
|
|
641
|
-
}
|
|
642
|
-
} finally {
|
|
643
|
-
releaseConditionPayloads(conditionWrapperBase);
|
|
644
|
-
}
|
|
645
|
-
return;
|
|
646
|
-
}
|
|
647
|
-
const compoundVariants = staticConfig.compoundVariants;
|
|
648
|
-
const compoundStates = new Array(compoundVariants.length);
|
|
649
383
|
try {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
const selectorCounts = preparedCompounds[preparedCompoundsKey];
|
|
653
|
-
for (let compoundIndex = 0; compoundIndex < compoundVariants.length; compoundIndex++) {
|
|
654
|
-
if (selectorCounts[compoundIndex]) continue;
|
|
655
|
-
const style = compoundVariants[compoundIndex].style;
|
|
656
|
-
if (!(0, import_isObj.isPlainObject)(style)) continue;
|
|
657
|
-
for (const key in style) contributeProp(pass, key, style[key]);
|
|
658
|
-
}
|
|
384
|
+
const appliesBaseStyle = baseStyle && !processedProps.asChild;
|
|
385
|
+
if (appliesBaseStyle) for (const key in baseStyle) contributeProp(pass, key, baseVariantProps && Object.hasOwn(baseVariantProps, key) && Object.hasOwn(processedProps, key) ? processedProps[key] : baseStyle[key]);
|
|
659
386
|
for (const key in processedProps) {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
beginCompoundEdges(compoundIndexes, compoundStates);
|
|
663
|
-
directState.flatPropSawCondition = false;
|
|
664
|
-
contributeProp(pass, key, value, compoundIndexes, compoundStates);
|
|
665
|
-
if (directState.flatPropSawCondition) injectDisplacedStyledDefault(pass, key, value);
|
|
666
|
-
finishCompoundEdges(pass, key, value, compoundIndexes, compoundStates);
|
|
387
|
+
if (appliesBaseStyle && baseVariantProps && Object.hasOwn(baseVariantProps, key)) continue;
|
|
388
|
+
contributeProp(pass, key, processedProps[key]);
|
|
667
389
|
}
|
|
668
|
-
}
|
|
390
|
+
} catch (error) {
|
|
669
391
|
releaseConditionPayloads(conditionWrapperBase);
|
|
392
|
+
throw error;
|
|
670
393
|
}
|
|
671
394
|
}
|
|
672
395
|
function isValidStyleKey(key, validStyles, accept) {
|
|
@@ -754,13 +477,8 @@ function mapContributedProp(styleState, key, val, originalVal, condition) {
|
|
|
754
477
|
viewProps[key] = val;
|
|
755
478
|
}
|
|
756
479
|
}
|
|
757
|
-
function contributeProp(pass, keyOg, valOg,
|
|
480
|
+
function contributeProp(pass, keyOg, valOg, parentConditionKey) {
|
|
758
481
|
const parentWatermark = conditionCursorTop;
|
|
759
|
-
if (compoundIndexes) {
|
|
760
|
-
pass[passCompoundIndexes] = compoundIndexes;
|
|
761
|
-
pass[passCompoundKey] = keyOg;
|
|
762
|
-
pass[passCompoundStates] = compoundStates;
|
|
763
|
-
} else if (pass[passCompoundIndexes]) pass[passCompoundIndexes] = void 0;
|
|
764
482
|
if (parentConditionKey) pass[passParentCursor] = acquireConditionKeyCursor(pass[passStyleState], parentConditionKey);
|
|
765
483
|
try {
|
|
766
484
|
const [styleState, conf, props, viewProps, staticConfig, validStyles, accept, neverSkipProps, variants, inlineProps, parentVariants, styleFrontend, styledContext, styledContextKeys, flags, debug, parentStaticConfig, defaultProps, driverAnimations, driverOutputStyle, elementType] = pass;
|
|
@@ -894,8 +612,8 @@ function contributeProp(pass, keyOg, valOg, compoundIndexes, compoundStates, par
|
|
|
894
612
|
for (const key in normalized) {
|
|
895
613
|
if (normalized[key] == null) continue;
|
|
896
614
|
if (pass[passHocMappedProperties]?.delete(key)) clearDirectStyle(styleState, key);
|
|
897
|
-
if (key === "containerName"
|
|
898
|
-
if (key === "containerType"
|
|
615
|
+
if (key === "containerName") pass[passContainerName] = normalized[key];
|
|
616
|
+
else if (key === "containerType") pass[passContainerType] = normalized[key];
|
|
899
617
|
contributeValue(styleState, key, normalized[key], mergeStyle, styleOriginals?.[key]);
|
|
900
618
|
}
|
|
901
619
|
}
|
|
@@ -933,6 +651,11 @@ function contributeProp(pass, keyOg, valOg, compoundIndexes, compoundStates, par
|
|
|
933
651
|
return;
|
|
934
652
|
}
|
|
935
653
|
}
|
|
654
|
+
if (isValidStyleKeyInit && valInit == null && keyOg in props) {
|
|
655
|
+
clearDirectStyle(styleState, keyInit);
|
|
656
|
+
if (styledContextKeys?.has(keyInit)) (styleState.overriddenContextProps ||= {})[keyInit] = valInit;
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
936
659
|
let isVariant = !isValidStyleKeyInit && variants && keyInit in variants;
|
|
937
660
|
const isStyleLikeKey = isValidStyleKeyInit || isVariant;
|
|
938
661
|
const isStyleProp = isValidStyleKeyInit || isVariant && !noExpand;
|
|
@@ -992,9 +715,9 @@ function contributeProp(pass, keyOg, valOg, compoundIndexes, compoundStates, par
|
|
|
992
715
|
releaseConditionCursors(parentWatermark);
|
|
993
716
|
}
|
|
994
717
|
}
|
|
995
|
-
const getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver) => {
|
|
718
|
+
const getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver, styleStaticConfig) => {
|
|
996
719
|
const conf = (0, import_config.getConfig)();
|
|
997
|
-
|
|
720
|
+
styleStaticConfig ||= (0, import_styleStaticConfig.getStyleStaticConfig)(staticConfig, conf);
|
|
998
721
|
const driver = animationDriver || componentContext?.animationDriver || conf.animations;
|
|
999
722
|
const driverAnimations = driver?.animations;
|
|
1000
723
|
const driverInputStyle = driver?.inputStyle;
|
|
@@ -1002,7 +725,8 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
1002
725
|
const resolvedDriver = driver?.isStub ? null : driver;
|
|
1003
726
|
if (props.passThrough) return null;
|
|
1004
727
|
const { shorthands } = conf;
|
|
1005
|
-
const { isHOC, isText, isInput,
|
|
728
|
+
const { isHOC, isText, isInput, inlineProps, parentStaticConfig, acceptsClassName } = staticConfig;
|
|
729
|
+
const variants = styleStaticConfig.variants;
|
|
1006
730
|
const viewProps = {};
|
|
1007
731
|
const mediaState = styleProps.mediaState || import_mediaState.mediaState;
|
|
1008
732
|
let shouldDoClasses = !process.env.TAMAGUI_DID_OUTPUT_CSS && acceptsClassName && !styleProps.noClass;
|
|
@@ -1011,7 +735,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
1011
735
|
let hasMedia = false;
|
|
1012
736
|
let pseudoGroups;
|
|
1013
737
|
let mediaGroups;
|
|
1014
|
-
const staticPassthroughClassName =
|
|
738
|
+
const staticPassthroughClassName = styleStaticConfig.passthroughClassName || "";
|
|
1015
739
|
let className = staticPassthroughClassName;
|
|
1016
740
|
if (staticPassthroughClassName) shouldDoClasses = false;
|
|
1017
741
|
const validStyles = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles);
|
|
@@ -1035,6 +759,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
1035
759
|
flatGroupContext: groupContext,
|
|
1036
760
|
animationDriver: resolvedDriver
|
|
1037
761
|
};
|
|
762
|
+
styleState.flatStyleStaticConfig = styleStaticConfig;
|
|
1038
763
|
if (import_directStyleCSS.canGenerateCSS && shouldDoClasses && styleProps.canPlatformPseudo) styleState.flatDeferCSS = true;
|
|
1039
764
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`style-state`;
|
|
1040
765
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && import_constants.isClient) {
|
|
@@ -1054,27 +779,23 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
1054
779
|
}
|
|
1055
780
|
const { asChild } = props;
|
|
1056
781
|
const { accept, neverSkipProps } = staticConfig;
|
|
1057
|
-
const { noSkip, disableExpandShorthands, noExpand, noClass, noMergeStyle, noNormalize, isAnimated, styledContext
|
|
782
|
+
const { noSkip, disableExpandShorthands, noExpand, noClass, noMergeStyle, noNormalize, isAnimated, styledContext } = styleProps;
|
|
783
|
+
const styledContextKeys = styleStaticConfig.styledContextKeys;
|
|
1058
784
|
const styleFrontend = staticConfig.styleFrontend;
|
|
1059
785
|
let frontendGroup;
|
|
1060
786
|
let frontendContainer;
|
|
1061
787
|
let frontendContainerType;
|
|
1062
788
|
const processedProps = props;
|
|
1063
|
-
const parentVariants = parentStaticConfig
|
|
1064
|
-
const defaultProps = asChild ?
|
|
789
|
+
const parentVariants = parentStaticConfig ? (0, import_styleStaticConfig.getStyleStaticConfig)(parentStaticConfig, conf).variants : void 0;
|
|
790
|
+
const defaultProps = asChild ? styleStaticConfig.defaultProps : void 0;
|
|
1065
791
|
const asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
|
|
1066
792
|
let containerValue;
|
|
1067
793
|
let containerName;
|
|
1068
794
|
let containerType;
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
const authoredContainerType = processedProps.containerType;
|
|
1072
|
-
containerName = typeof authoredContainerName === "string" && authoredContainerName.indexOf(":") === -1 ? authoredContainerName : void 0;
|
|
1073
|
-
containerType = typeof authoredContainerType === "string" && authoredContainerType.indexOf(":") === -1 ? authoredContainerType : void 0;
|
|
1074
|
-
}
|
|
795
|
+
containerName = processedProps.containerName;
|
|
796
|
+
containerType = processedProps.containerType;
|
|
1075
797
|
let hocMappedClassProperties;
|
|
1076
798
|
let hocMappedClasses;
|
|
1077
|
-
const 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);
|
|
1078
799
|
const pass = [
|
|
1079
800
|
styleState,
|
|
1080
801
|
conf,
|
|
@@ -1090,7 +811,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
1090
811
|
styleFrontend,
|
|
1091
812
|
styledContext,
|
|
1092
813
|
styledContextKeys,
|
|
1093
|
-
|
|
814
|
+
(noSkip ? passNoSkipFlag : 0) | (disableExpandShorthands ? passDisableShorthandsFlag : 0) | (noExpand ? passNoExpandFlag : 0) | (noMergeStyle ? passNoMergeFlag : 0) | (isHOC ? passHocFlag : 0) | (isText ? passTextFlag : 0) | (isInput ? passInputFlag : 0) | (asChildExceptStyleLike ? passAsChildStyleFlag : 0),
|
|
1094
815
|
debug,
|
|
1095
816
|
parentStaticConfig,
|
|
1096
817
|
defaultProps,
|
|
@@ -1109,38 +830,36 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
1109
830
|
hocMappedClasses
|
|
1110
831
|
];
|
|
1111
832
|
styleState.flatPass = pass;
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
if (
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
pseudoGroups
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
}
|
|
1143
|
-
completeStreaming(styleState, mergeStyle);
|
|
833
|
+
let conditionalStates = null;
|
|
834
|
+
let usesSafeArea = false;
|
|
835
|
+
const conditionWrapperBase = conditionWrapperTop;
|
|
836
|
+
try {
|
|
837
|
+
forEachPropInForwardOrder(pass);
|
|
838
|
+
[, , , , , , , , , , , , , , , , , , , , , className, shouldDoClasses, containerValue, containerName, containerType, frontendGroup, frontendContainer, frontendContainerType, hocMappedClassProperties, hocMappedClasses] = pass;
|
|
839
|
+
if (containerValue) {
|
|
840
|
+
containerName ??= typeof containerValue === "string" ? containerValue : void 0;
|
|
841
|
+
containerType ??= "inline-size";
|
|
842
|
+
contributeValue(styleState, containerName ? "container" : "containerType", containerName ? `${containerName} / ${containerType}` : containerType, mergeStyle);
|
|
843
|
+
}
|
|
844
|
+
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-propsend`;
|
|
845
|
+
conditionalStates = styleState.flatStateKeys || null;
|
|
846
|
+
usesSafeArea = !!styleState.flatUsesSafeArea;
|
|
847
|
+
hasMedia = styleState.flatMediaKeys?.size ? styleState.flatMediaKeys : false;
|
|
848
|
+
pseudoGroups = styleState.flatGroupKeys?.size ? styleState.flatGroupKeys : void 0;
|
|
849
|
+
mediaGroups = styleState.flatGroupMedia?.size ? styleState.flatGroupMedia : void 0;
|
|
850
|
+
if (styleProps.canPlatformPseudo && styleState.flatHasPlatformPseudo) {
|
|
851
|
+
shouldDoClasses = false;
|
|
852
|
+
styleState.flatShouldDoClasses = false;
|
|
853
|
+
if (styleState.transformAccumulator) {
|
|
854
|
+
mergeStyle(styleState, "transform", (0, import_runtime.finalizeTransformAccumulator)(styleState.transformAccumulator), true);
|
|
855
|
+
styleState.transformAccumulator = void 0;
|
|
856
|
+
}
|
|
857
|
+
convertDeferredInline(styleState, mergeStyle);
|
|
858
|
+
}
|
|
859
|
+
completeStreaming(styleState, mergeStyle);
|
|
860
|
+
} finally {
|
|
861
|
+
releaseConditionPayloads(conditionWrapperBase);
|
|
862
|
+
}
|
|
1144
863
|
const effectiveTransition = styleState.style?.transition;
|
|
1145
864
|
if (effectiveTransition != null && styleState.style && driverOutputStyle !== "css") delete styleState.style.transition;
|
|
1146
865
|
if (!(noNormalize === false)) {
|
|
@@ -1263,9 +982,9 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
1263
982
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-done`;
|
|
1264
983
|
return result;
|
|
1265
984
|
};
|
|
1266
|
-
function mergeStyle(styleState, key, val,
|
|
985
|
+
function mergeStyle(styleState, key, val, disableNormalize = false, originalVal) {
|
|
1267
986
|
const { viewProps, styleProps, staticConfig } = styleState;
|
|
1268
|
-
if (
|
|
987
|
+
if (styleState.flatStyleStaticConfig.styledContextKeys?.has(key)) {
|
|
1269
988
|
styleState.overriddenContextProps ||= {};
|
|
1270
989
|
const originalFromState = styleState.originalContextPropValues?.[key];
|
|
1271
990
|
styleState.overriddenContextProps[key] = originalVal ?? originalFromState ?? val;
|
|
@@ -1290,7 +1009,7 @@ function recordStyleTokenProvenance(styleState, key, originalVal) {
|
|
|
1290
1009
|
const opacity = slash === -1 ? NaN : Number(tokenName.slice(slash + 1));
|
|
1291
1010
|
if (Number.isInteger(opacity) && opacity >= 0 && opacity <= 100) tokenName = tokenName.slice(0, slash);
|
|
1292
1011
|
}
|
|
1293
|
-
if (tokenName !== "" && (
|
|
1012
|
+
if (tokenName !== "" && (tokenName in styleState.theme || tokenName in (styleState.conf.themes?.[styleState.flatThemeName || ""] || {}) || Object.values(styleState.conf.tokensParsed).some((category) => tokenName in category))) (styleState.tokenProvenance ||= {})[key] = originalVal;
|
|
1294
1013
|
else if (styleState.tokenProvenance && key in styleState.tokenProvenance) delete styleState.tokenProvenance[key];
|
|
1295
1014
|
}
|
|
1296
1015
|
const resolveAcceptedStyle = (styleState, styleIn) => {
|
|
@@ -1312,7 +1031,7 @@ const resolveAcceptedStyle = (styleState, styleIn) => {
|
|
|
1312
1031
|
childState.flatSingleEntries = void 0;
|
|
1313
1032
|
childState.flatSlots = void 0;
|
|
1314
1033
|
childState.flatBorderDefaultRequests = void 0;
|
|
1315
|
-
const mergeAccepted = (_state, key, value,
|
|
1034
|
+
const mergeAccepted = (_state, key, value, disableNormalize, originalValue) => {
|
|
1316
1035
|
styleOut[key] = disableNormalize || styleProps.noNormalize ? value : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(value, key);
|
|
1317
1036
|
const trackedOriginal = styleInOriginalValues?.[key] ?? originalValue;
|
|
1318
1037
|
if (trackedOriginal !== void 0) (originalValues ||= {})[key] = trackedOriginal;
|
|
@@ -1340,22 +1059,24 @@ function streamWriteCSS(state, property, value, cursor, original, conditionOverr
|
|
|
1340
1059
|
const identity = cursor ? conditionTexts[cursor + conditionKeyOffset] || "" : "";
|
|
1341
1060
|
if (property.charCodeAt(0) === 116 && property.startsWith("transition")) {
|
|
1342
1061
|
const transitions = direct.flatTransitions ||= [];
|
|
1343
|
-
for (let index = 0; index < transitions.length; index++) if (transitions[index]
|
|
1344
|
-
transitions[index]
|
|
1345
|
-
transitions[index]
|
|
1062
|
+
for (let index = 0; index < transitions.length; index++) if (transitions[index][0] === property && transitions[index][3] === identity) {
|
|
1063
|
+
transitions[index][1] = value;
|
|
1064
|
+
transitions[index][2] = condition;
|
|
1346
1065
|
return;
|
|
1347
1066
|
}
|
|
1348
|
-
transitions.push(
|
|
1067
|
+
transitions.push([
|
|
1349
1068
|
property,
|
|
1350
1069
|
value,
|
|
1351
1070
|
condition,
|
|
1352
1071
|
identity,
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1072
|
+
cursor ? conditionTexts[cursor + conditionSelectorOffset] || "" : "",
|
|
1073
|
+
cursor ? conditionWrappers : void 0,
|
|
1074
|
+
cursor ? conditionNumbers[cursor + conditionWrapperOffset] >> 3 : 0,
|
|
1075
|
+
cursor ? conditionNumbers[cursor + conditionWrapperOffset] & 7 : 0
|
|
1076
|
+
]);
|
|
1356
1077
|
return;
|
|
1357
1078
|
}
|
|
1358
|
-
(0, import_directStyleCSS.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,
|
|
1079
|
+
(0, import_directStyleCSS.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);
|
|
1359
1080
|
}
|
|
1360
1081
|
function streamWriteInline(state, property, value, cursor, merge, original, normalize = false, conditionOverride = -1) {
|
|
1361
1082
|
const direct = state;
|
|
@@ -1363,12 +1084,9 @@ function streamWriteInline(state, property, value, cursor, merge, original, norm
|
|
|
1363
1084
|
const importance = condition ? Math.floor(condition / 256) + 1 : 0;
|
|
1364
1085
|
const used = direct.flatUsed ||= {};
|
|
1365
1086
|
const previous = used[property];
|
|
1366
|
-
if (previous !== void 0)
|
|
1367
|
-
if (previous > importance) return;
|
|
1368
|
-
if (direct.flatWeakContribution === true) return;
|
|
1369
|
-
}
|
|
1087
|
+
if (previous !== void 0 && previous > importance) return;
|
|
1370
1088
|
used[property] = importance;
|
|
1371
|
-
merge(state, property, value,
|
|
1089
|
+
merge(state, property, value, !normalize, original);
|
|
1372
1090
|
}
|
|
1373
1091
|
function streamRetractInline(state, property, cursor) {
|
|
1374
1092
|
const direct = state;
|
|
@@ -1382,17 +1100,12 @@ function streamRetractInline(state, property, cursor) {
|
|
|
1382
1100
|
}
|
|
1383
1101
|
function convertDeferredInline(state, merge) {
|
|
1384
1102
|
const direct = state;
|
|
1385
|
-
const used = direct.flatUsed ||= {};
|
|
1386
1103
|
const consume = (entries) => {
|
|
1387
1104
|
for (let index = 0; index < entries.length; index++) {
|
|
1388
1105
|
const entry = entries[index];
|
|
1389
|
-
const condition = entry
|
|
1106
|
+
const condition = entry[2];
|
|
1390
1107
|
if (condition && !(condition & 1)) continue;
|
|
1391
|
-
|
|
1392
|
-
const previous = used[entry.property];
|
|
1393
|
-
if (previous !== void 0 && previous > importance) continue;
|
|
1394
|
-
used[entry.property] = importance;
|
|
1395
|
-
merge(state, entry.property, entry.value, 1, true, entry.original !== void 0 ? entry.original : entry.value);
|
|
1108
|
+
streamWriteInline(state, entry[0], entry[1], null, merge, entry[8] !== void 0 ? entry[8] : entry[1], false, condition);
|
|
1396
1109
|
}
|
|
1397
1110
|
};
|
|
1398
1111
|
const slots = direct.flatSlots;
|
|
@@ -1428,7 +1141,6 @@ function emitAtParentCondition(state, property, value, merge, originalValue, con
|
|
|
1428
1141
|
}
|
|
1429
1142
|
function emitUnderCondition(state, property, value, cursor, merge, originalValue, contextOnly, warnMode, warnSource) {
|
|
1430
1143
|
const condition = conditionNumbers[cursor + conditionValueOffset];
|
|
1431
|
-
if (merge && property && condition) state.flatPropSawCondition = true;
|
|
1432
1144
|
if (!(conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag)) {
|
|
1433
1145
|
if (warnMode && process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, warnSource, `unknown modifier "${conditionTexts[cursor + conditionUnresolvedNameOffset] || ""}"`);
|
|
1434
1146
|
return 0;
|
|
@@ -1451,7 +1163,6 @@ const directStyleHandler = {
|
|
|
1451
1163
|
segment(state, start, end, isBase, valid, source, chainStart, chainEnd, chainValid, chainCount, _result, failure, failureIndex, property, merge, originalValue, contextOnly) {
|
|
1452
1164
|
if (isBase) {
|
|
1453
1165
|
if (start === end) return;
|
|
1454
|
-
feedCompoundSegment(state, source, start, end, true, valid || failure === "invalid-character" || failure === "stray-comment-close", "");
|
|
1455
1166
|
if (!valid) {
|
|
1456
1167
|
if (failure === "invalid-character" || failure === "stray-comment-close") return 16;
|
|
1457
1168
|
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, source, failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : "an unterminated \"(\"");
|
|
@@ -1474,10 +1185,8 @@ const directStyleHandler = {
|
|
|
1474
1185
|
const right = Number(source.slice(start, end));
|
|
1475
1186
|
if (chainStart < chainEnd && Number.isFinite(left) && left > 0 && Number.isFinite(right) && right > 0) return 12;
|
|
1476
1187
|
}
|
|
1477
|
-
const
|
|
1478
|
-
const cursor = directState.flatScanCursor;
|
|
1188
|
+
const cursor = state.flatScanCursor;
|
|
1479
1189
|
const condition = valid ? emitUnderCondition(state, property, source.slice(start, end), cursor, merge, void 0, contextOnly, 1, source) : conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
1480
|
-
feedCompoundSegment(directState, source, start, end, false, valid && Boolean(condition), condition && directState.flatPass?.[passCompoundIndexes] ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
1481
1190
|
if (!condition) return;
|
|
1482
1191
|
if (!valid) {
|
|
1483
1192
|
if (process.env.NODE_ENV === "development") (0, import_warnOnce.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 \"(\"");
|
|
@@ -1516,7 +1225,7 @@ const directStyleHandler = {
|
|
|
1516
1225
|
emitAtParentCondition(state, property, source, merge, originalValue ?? source, contextOnly);
|
|
1517
1226
|
hasBase = true;
|
|
1518
1227
|
}
|
|
1519
|
-
if (process.env.NODE_ENV === "development" && !hasBase && result & 4 &&
|
|
1228
|
+
if (process.env.NODE_ENV === "development" && !hasBase && result & 4 && property in import_helpers.propToTokenCategoryCode && splitComponents(source.slice(lastPayloadStart)).length > 1) (0, import_warnOnce.warnOnce)(`${property}="${source}" has multiple values after its first conditional. Write the base value before the first conditional.`);
|
|
1520
1229
|
if ((!import_directStyleCSS.canGenerateCSS || !state.flatShouldDoClasses) && result & 2 && !hasBase) {
|
|
1521
1230
|
const value = implicitLifecycleBase(property);
|
|
1522
1231
|
if (value !== null) emitAtParentCondition(state, property, value, merge, value, contextOnly);
|
|
@@ -1647,13 +1356,6 @@ function tokenVariable(state, property, name) {
|
|
|
1647
1356
|
if (category) {
|
|
1648
1357
|
const own = state.conf.tokensParsed[category]?.[lookupName];
|
|
1649
1358
|
if (own) return fillTokenLookup(own, false, lookupName);
|
|
1650
|
-
for (const sibling of [
|
|
1651
|
-
"color",
|
|
1652
|
-
"space",
|
|
1653
|
-
"size",
|
|
1654
|
-
"radius",
|
|
1655
|
-
"zIndex"
|
|
1656
|
-
]) if (sibling !== category && state.conf.tokensParsed[sibling]?.[lookupName]) return;
|
|
1657
1359
|
} else {
|
|
1658
1360
|
const first = lookupName.charCodeAt(0);
|
|
1659
1361
|
if (first >= 48 && first <= 57 || first === 43 || first === 45 || first === 46) return;
|
|
@@ -1710,10 +1412,13 @@ function configuredValue(state, property, raw) {
|
|
|
1710
1412
|
missKey = `${state.flatThemeName || ""}${property}${name}`;
|
|
1711
1413
|
if (misses.has(missKey)) return raw;
|
|
1712
1414
|
}
|
|
1415
|
+
if (process.env.NODE_ENV === "development") {
|
|
1416
|
+
const category = (0, import_tokenCategories.getTokenCategoryForProperty)(property);
|
|
1417
|
+
if (category && category !== "color" && state.conf.tokensParsed.color?.[name]) (0, import_warnOnce.warnOnce)(`"${name}" contributes to "color", not "${property}"`);
|
|
1418
|
+
}
|
|
1713
1419
|
const lookup = tokenVariable(state, property, name);
|
|
1714
1420
|
if (!lookup || !(0, import_createVariable.isVariable)(lookup.value)) {
|
|
1715
1421
|
if (misses) misses.add(missKey);
|
|
1716
|
-
if (process.env.NODE_ENV === "development" && import_tokenCategories.tokenCategoryByProperty[property] && state.conf.tokensParsed.color?.[name]) (0, import_warnOnce.warnOnce)(`"${name}" contributes to "color", not "${property}"; keeping it literal`);
|
|
1717
1422
|
return raw;
|
|
1718
1423
|
}
|
|
1719
1424
|
const resolveValues = !state.flatShouldDoClasses && state.styleProps.resolveValues === "auto" ? "value" : state.styleProps.resolveValues;
|
|
@@ -1833,6 +1538,11 @@ function getDirectDynamicThemeAccess(state) {
|
|
|
1833
1538
|
function emitProperty(state, property, value, cursor, merge, originalValue, contextOnly) {
|
|
1834
1539
|
const direct = state;
|
|
1835
1540
|
const condition = cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
1541
|
+
if (value === false && !condition) {
|
|
1542
|
+
clearDirectStyle(state, property);
|
|
1543
|
+
if (direct.flatStyleStaticConfig?.styledContextKeys?.has(property)) (state.overriddenContextProps ||= {})[property] = false;
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1836
1546
|
if (condition & 4) (state.flatEnterKeys ||= /* @__PURE__ */ new Set()).add(property);
|
|
1837
1547
|
if (condition & 8) (state.flatExitKeys ||= /* @__PURE__ */ new Set()).add(property);
|
|
1838
1548
|
cursor && conditionTexts[cursor + conditionThemeOffset];
|
|
@@ -1848,7 +1558,7 @@ function emitProperty(state, property, value, cursor, merge, originalValue, cont
|
|
|
1848
1558
|
}
|
|
1849
1559
|
const shouldPromoteAnimatedStyle = import_directStyleCSS.canGenerateCSS && !condition && !state.flatShouldDoClasses && !state.styleProps.noMergeStyle && state.styleProps.isAnimated && state.animationDriver?.inputStyle === "css" && property in import_helpers.nonAnimatableStyleProps;
|
|
1850
1560
|
if (import_directStyleCSS.canGenerateCSS && (state.flatShouldDoClasses || shouldPromoteAnimatedStyle)) {
|
|
1851
|
-
if (!condition && state.style &&
|
|
1561
|
+
if (!condition && state.style && !(direct.flatUsed && direct.flatUsed[property])) delete state.style[property];
|
|
1852
1562
|
streamWriteCSS(state, property, value, cursor, originalValue);
|
|
1853
1563
|
return;
|
|
1854
1564
|
}
|
|
@@ -2157,14 +1867,11 @@ function contributeStyleObject(state, property, value, merge, contextOnly) {
|
|
|
2157
1867
|
}
|
|
2158
1868
|
}
|
|
2159
1869
|
function contributeStyleObjectInner(state, property, value, merge, contextOnly) {
|
|
2160
|
-
const
|
|
2161
|
-
const
|
|
2162
|
-
const hasDefault = Object.prototype.hasOwnProperty.call(value, "default");
|
|
1870
|
+
const parent = state.flatPass?.[passParentCursor] || null;
|
|
1871
|
+
const hasDefault = "default" in value;
|
|
2163
1872
|
let hasBase = false;
|
|
2164
1873
|
const base = hasDefault ? value.default : void 0;
|
|
2165
1874
|
if (base != null) {
|
|
2166
|
-
const baseString = String(base);
|
|
2167
|
-
feedCompoundSegment(directState, baseString, 0, baseString.length, true, true, "");
|
|
2168
1875
|
emitAtParentCondition(state, property, base, merge, base, contextOnly);
|
|
2169
1876
|
hasBase = true;
|
|
2170
1877
|
}
|
|
@@ -2184,11 +1891,7 @@ function contributeStyleObjectInner(state, property, value, merge, contextOnly)
|
|
|
2184
1891
|
return false;
|
|
2185
1892
|
}
|
|
2186
1893
|
}
|
|
2187
|
-
if (payload != null)
|
|
2188
|
-
conditions |= emitUnderCondition(state, property, payload, cursor, merge, payload, contextOnly, 1, payload);
|
|
2189
|
-
const payloadString = String(payload);
|
|
2190
|
-
feedCompoundSegment(directState, payloadString, 0, payloadString.length, false, Boolean(condition), condition && directState.flatPass?.[passCompoundIndexes] ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
2191
|
-
}
|
|
1894
|
+
if (payload != null) conditions |= emitUnderCondition(state, property, payload, cursor, merge, payload, contextOnly, 1, payload);
|
|
2192
1895
|
releaseConditionCursors(watermark);
|
|
2193
1896
|
}
|
|
2194
1897
|
if (!hasDefault && firstCondition) return false;
|
|
@@ -2200,12 +1903,15 @@ function contributeStyleObjectInner(state, property, value, merge, contextOnly)
|
|
|
2200
1903
|
}
|
|
2201
1904
|
function contributeValue(state, property, value, merge, originalValue, contextOnly = false, condition) {
|
|
2202
1905
|
if (isConditionTransport(value)) {
|
|
2203
|
-
if (value
|
|
2204
|
-
|
|
2205
|
-
|
|
1906
|
+
if (value[transportHasBase]) {
|
|
1907
|
+
const base = value[transportBase];
|
|
1908
|
+
contributeValue(state, property, base, merge, base, contextOnly);
|
|
1909
|
+
}
|
|
1910
|
+
for (let offset = transportEntries; offset < value.length;) {
|
|
1911
|
+
const entryValue = value[offset];
|
|
2206
1912
|
const watermark = conditionCursorTop;
|
|
2207
1913
|
try {
|
|
2208
|
-
emitUnderCondition(state, property, entryValue, acquireTransportCursor(state, value
|
|
1914
|
+
emitUnderCondition(state, property, entryValue, acquireTransportCursor(state, value, offset, state.flatPass?.[passParentCursor] || null), merge, entryValue, contextOnly, 2, entryValue);
|
|
2209
1915
|
} finally {
|
|
2210
1916
|
releaseConditionCursors(watermark);
|
|
2211
1917
|
}
|
|
@@ -2230,7 +1936,7 @@ function contributeValue(state, property, value, merge, originalValue, contextOn
|
|
|
2230
1936
|
commitConditionCursor(state, effective);
|
|
2231
1937
|
} else effective = condition;
|
|
2232
1938
|
const isObjectValue = value && typeof value === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value);
|
|
2233
|
-
const objectHasDefault = isObjectValue &&
|
|
1939
|
+
const objectHasDefault = isObjectValue && "default" in value;
|
|
2234
1940
|
const firstChild = isObjectValue && !objectHasDefault ? acquireConditionCursor(effective) : null;
|
|
2235
1941
|
if (isObjectValue && classifyConditionalObject(value, state, void 0, firstChild || void 0)) {
|
|
2236
1942
|
let useFirstChild = firstChild !== null;
|
|
@@ -2288,17 +1994,20 @@ function clearDirectStyle(state, property) {
|
|
|
2288
1994
|
if (state.style) delete state.style[atomicKey];
|
|
2289
1995
|
delete state.classNames[atomicKey];
|
|
2290
1996
|
}
|
|
2291
|
-
const
|
|
1997
|
+
const conditionTransportTag = /* @__PURE__ */ Symbol();
|
|
1998
|
+
const transportHasBase = 1;
|
|
1999
|
+
const transportBase = 2;
|
|
2000
|
+
const transportEntries = 3;
|
|
2001
|
+
const transportEntryWidth = 2;
|
|
2292
2002
|
function isConditionTransport(value) {
|
|
2293
|
-
return
|
|
2003
|
+
return Array.isArray(value) && value[0] === conditionTransportTag;
|
|
2294
2004
|
}
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
entries.push(value, conditionTexts[cursor + conditionKeyOffset] || "");
|
|
2005
|
+
function appendConditionEntry(transport, cursor, value) {
|
|
2006
|
+
transport.push(value, conditionTexts[cursor + conditionKeyOffset] || "");
|
|
2298
2007
|
}
|
|
2299
|
-
function acquireTransportCursor(state,
|
|
2008
|
+
function acquireTransportCursor(state, transport, offset, parent) {
|
|
2300
2009
|
const cursor = acquireConditionCursor(parent);
|
|
2301
|
-
const key =
|
|
2010
|
+
const key = transport[offset + 1];
|
|
2302
2011
|
if (key) resolveConditionText(state, cursor, key);
|
|
2303
2012
|
commitConditionCursor(state, cursor);
|
|
2304
2013
|
return cursor;
|
|
@@ -2307,15 +2016,14 @@ function mergeConditionTransport(state, prev, cursor, value) {
|
|
|
2307
2016
|
let transport;
|
|
2308
2017
|
if (isConditionTransport(prev)) transport = prev;
|
|
2309
2018
|
else {
|
|
2310
|
-
transport =
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
conditionTransports.add(transport);
|
|
2019
|
+
transport = [
|
|
2020
|
+
conditionTransportTag,
|
|
2021
|
+
false,
|
|
2022
|
+
void 0
|
|
2023
|
+
];
|
|
2316
2024
|
if (prev != null) {
|
|
2317
2025
|
const isObjectValue = typeof prev === "object" && !Array.isArray(prev) && !(0, import_createVariable.isVariable)(prev);
|
|
2318
|
-
const objectHasDefault = isObjectValue &&
|
|
2026
|
+
const objectHasDefault = isObjectValue && "default" in prev;
|
|
2319
2027
|
const authoredWatermark = conditionCursorTop;
|
|
2320
2028
|
try {
|
|
2321
2029
|
const firstCursor = isObjectValue && !objectHasDefault ? acquireConditionCursor() : null;
|
|
@@ -2325,8 +2033,8 @@ function mergeConditionTransport(state, prev, cursor, value) {
|
|
|
2325
2033
|
const payload = prev[key];
|
|
2326
2034
|
if (payload == null) continue;
|
|
2327
2035
|
if (key === "default") {
|
|
2328
|
-
transport
|
|
2329
|
-
transport
|
|
2036
|
+
transport[transportHasBase] = true;
|
|
2037
|
+
transport[transportBase] = payload;
|
|
2330
2038
|
continue;
|
|
2331
2039
|
}
|
|
2332
2040
|
const watermark = conditionCursorTop;
|
|
@@ -2336,12 +2044,12 @@ function mergeConditionTransport(state, prev, cursor, value) {
|
|
|
2336
2044
|
resolveConditionText(state, keyCursor, key);
|
|
2337
2045
|
commitConditionCursor(state, keyCursor);
|
|
2338
2046
|
}
|
|
2339
|
-
appendConditionEntry(transport
|
|
2047
|
+
appendConditionEntry(transport, keyCursor, payload);
|
|
2340
2048
|
if (keyCursor !== firstCursor) releaseConditionCursors(watermark);
|
|
2341
2049
|
}
|
|
2342
2050
|
} else {
|
|
2343
|
-
transport
|
|
2344
|
-
transport
|
|
2051
|
+
transport[transportHasBase] = true;
|
|
2052
|
+
transport[transportBase] = prev;
|
|
2345
2053
|
}
|
|
2346
2054
|
} finally {
|
|
2347
2055
|
releaseConditionCursors(authoredWatermark);
|
|
@@ -2349,29 +2057,25 @@ function mergeConditionTransport(state, prev, cursor, value) {
|
|
|
2349
2057
|
}
|
|
2350
2058
|
}
|
|
2351
2059
|
const cursorKey = conditionTexts[cursor + conditionKeyOffset] || "";
|
|
2352
|
-
for (let offset =
|
|
2353
|
-
transport.
|
|
2060
|
+
for (let offset = transportEntries; offset < transport.length; offset += transportEntryWidth) if (transport[offset + 1] === cursorKey) {
|
|
2061
|
+
transport.splice(offset, transportEntryWidth);
|
|
2354
2062
|
break;
|
|
2355
2063
|
}
|
|
2356
|
-
appendConditionEntry(transport
|
|
2064
|
+
appendConditionEntry(transport, cursor, value);
|
|
2357
2065
|
return transport;
|
|
2358
2066
|
}
|
|
2359
2067
|
const variantValueHandler = {
|
|
2360
2068
|
segment(ctx, start, end, isBase, valid, source, chainStart, chainEnd, chainValid) {
|
|
2361
2069
|
const state = ctx[0];
|
|
2362
|
-
const directState = state;
|
|
2363
2070
|
if (start === end) return;
|
|
2364
2071
|
if (isBase) {
|
|
2365
|
-
feedCompoundSegment(directState, source, start, end, true, valid, "");
|
|
2366
2072
|
if (!valid) return;
|
|
2367
2073
|
emitResolvedVariant(ctx[1], source.slice(start, end), state, ctx[2], null);
|
|
2368
2074
|
return;
|
|
2369
2075
|
}
|
|
2370
2076
|
if (!valid || !chainValid) return;
|
|
2371
|
-
const cursor =
|
|
2372
|
-
|
|
2373
|
-
feedCompoundSegment(directState, source, start, end, false, Boolean(condition), condition && directState.flatPass?.[passCompoundIndexes] ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
2374
|
-
if (!condition) return;
|
|
2077
|
+
const cursor = state.flatScanCursor;
|
|
2078
|
+
if (!(cursor && conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag ? conditionNumbers[cursor + conditionValueOffset] : 0)) return;
|
|
2375
2079
|
emitResolvedVariant(ctx[1], source.slice(start, end), state, ctx[2], cursor);
|
|
2376
2080
|
},
|
|
2377
2081
|
modifier(ctx, start, end, valid, first, source) {
|
|
@@ -2394,34 +2098,6 @@ const variantValueHandler = {
|
|
|
2394
2098
|
return true;
|
|
2395
2099
|
}
|
|
2396
2100
|
};
|
|
2397
|
-
const contextPropSets = /* @__PURE__ */ new WeakMap();
|
|
2398
|
-
function getContextPropSet(staticConfig) {
|
|
2399
|
-
const cached = contextPropSets.get(staticConfig);
|
|
2400
|
-
if (cached !== void 0) return cached;
|
|
2401
|
-
const contextConfig = staticConfig.context || staticConfig.parentStaticConfig?.context;
|
|
2402
|
-
const inheritedContextPropKeys = !staticConfig.context || staticConfig.context === staticConfig.parentStaticConfig?.context ? staticConfig.parentStaticConfig?.contextProps : void 0;
|
|
2403
|
-
const contextPropKeys = staticConfig.contextProps || inheritedContextPropKeys;
|
|
2404
|
-
let set = null;
|
|
2405
|
-
if (contextConfig?.props) {
|
|
2406
|
-
set ||= /* @__PURE__ */ new Set();
|
|
2407
|
-
for (const key in contextConfig.props) set.add(key);
|
|
2408
|
-
}
|
|
2409
|
-
if (contextPropKeys) {
|
|
2410
|
-
set ||= /* @__PURE__ */ new Set();
|
|
2411
|
-
for (const key of contextPropKeys) set.add(key);
|
|
2412
|
-
}
|
|
2413
|
-
if (contextConfig?.propKeys) {
|
|
2414
|
-
set ||= /* @__PURE__ */ new Set();
|
|
2415
|
-
for (const key of contextConfig.propKeys) set.add(key);
|
|
2416
|
-
}
|
|
2417
|
-
const parentPropKeys = staticConfig.parentStaticConfig?.context?.propKeys;
|
|
2418
|
-
if (parentPropKeys) {
|
|
2419
|
-
set ||= /* @__PURE__ */ new Set();
|
|
2420
|
-
for (const key of parentPropKeys) set.add(key);
|
|
2421
|
-
}
|
|
2422
|
-
contextPropSets.set(staticConfig, set);
|
|
2423
|
-
return set;
|
|
2424
|
-
}
|
|
2425
2101
|
function emitMappedValue(styleState, key, value, originalValue, nestedCondition, parentCondition, fallbackOriginal) {
|
|
2426
2102
|
const nested = nestedCondition;
|
|
2427
2103
|
const parent = parentCondition;
|
|
@@ -2442,8 +2118,8 @@ function emitMappedValue(styleState, key, value, originalValue, nestedCondition,
|
|
|
2442
2118
|
}
|
|
2443
2119
|
const contributeMappedValue = (key, value, styleState, disabled, parentCondition, fallbackOriginal) => {
|
|
2444
2120
|
if (disabled) return emitMappedValue(styleState, key, value, void 0, void 0, parentCondition, fallbackOriginal);
|
|
2445
|
-
const { conf, styleProps
|
|
2446
|
-
const
|
|
2121
|
+
const { conf, styleProps } = styleState;
|
|
2122
|
+
const variants = styleState.flatStyleStaticConfig.variants;
|
|
2447
2123
|
const { disableExpandShorthands, noExpand, resolveValues } = styleProps;
|
|
2448
2124
|
const shorthands = conf.shorthands;
|
|
2449
2125
|
if (!noExpand) {
|
|
@@ -2486,14 +2162,14 @@ const contributeMappedValue = (key, value, styleState, disabled, parentCondition
|
|
|
2486
2162
|
}
|
|
2487
2163
|
};
|
|
2488
2164
|
function resolveVariants(key, value, styleProps, styleState, parentVariantKey) {
|
|
2489
|
-
const variantDefinition = styleState.
|
|
2165
|
+
const variantDefinition = styleState.flatStyleStaticConfig.variants?.[key];
|
|
2490
2166
|
if (isConditionTransport(value)) {
|
|
2491
|
-
if (value
|
|
2492
|
-
for (let offset =
|
|
2493
|
-
const entryValue = value
|
|
2167
|
+
if (value[transportHasBase]) emitResolvedVariant(key, value[transportBase], styleState, parentVariantKey, null);
|
|
2168
|
+
for (let offset = transportEntries; offset < value.length;) {
|
|
2169
|
+
const entryValue = value[offset];
|
|
2494
2170
|
const watermark = conditionCursorTop;
|
|
2495
2171
|
try {
|
|
2496
|
-
emitResolvedVariant(key, entryValue, styleState, parentVariantKey, acquireTransportCursor(styleState, value
|
|
2172
|
+
emitResolvedVariant(key, entryValue, styleState, parentVariantKey, acquireTransportCursor(styleState, value, offset, null));
|
|
2497
2173
|
} finally {
|
|
2498
2174
|
releaseConditionCursors(watermark);
|
|
2499
2175
|
}
|
|
@@ -2519,7 +2195,7 @@ function resolveVariants(key, value, styleProps, styleState, parentVariantKey) {
|
|
|
2519
2195
|
return;
|
|
2520
2196
|
}
|
|
2521
2197
|
const isObjectValue = value && typeof value === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value);
|
|
2522
|
-
const objectHasDefault = isObjectValue &&
|
|
2198
|
+
const objectHasDefault = isObjectValue && "default" in value;
|
|
2523
2199
|
const objectWatermark = conditionCursorTop;
|
|
2524
2200
|
try {
|
|
2525
2201
|
const firstCursor = isObjectValue && !objectHasDefault ? acquireConditionCursor() : null;
|
|
@@ -2528,22 +2204,18 @@ function resolveVariants(key, value, styleProps, styleState, parentVariantKey) {
|
|
|
2528
2204
|
for (const objKey in value) {
|
|
2529
2205
|
const payload = value[objKey];
|
|
2530
2206
|
if (payload == null) continue;
|
|
2531
|
-
const directState = styleState;
|
|
2532
|
-
const payloadString = String(payload);
|
|
2533
2207
|
if (objKey === "default") {
|
|
2534
|
-
feedCompoundSegment(directState, payloadString, 0, payloadString.length, true, true, "");
|
|
2535
2208
|
emitResolvedVariant(key, payload, styleState, parentVariantKey, null);
|
|
2536
2209
|
continue;
|
|
2537
2210
|
}
|
|
2538
2211
|
const watermark = conditionCursorTop;
|
|
2539
2212
|
const cursor = useFirstCursor ? firstCursor : acquireConditionCursor();
|
|
2540
|
-
|
|
2213
|
+
conditionNumbers[cursor + conditionValueOffset];
|
|
2541
2214
|
if (useFirstCursor) useFirstCursor = false;
|
|
2542
2215
|
else {
|
|
2543
2216
|
resolveConditionText(styleState, cursor, objKey);
|
|
2544
|
-
|
|
2217
|
+
commitConditionCursor(styleState, cursor);
|
|
2545
2218
|
}
|
|
2546
|
-
if (directState.flatPass?.[passCompoundIndexes]) feedCompoundSegment(directState, payloadString, 0, payloadString.length, false, Boolean(condition), condition ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
2547
2219
|
emitResolvedVariant(key, payload, styleState, parentVariantKey, cursor);
|
|
2548
2220
|
if (cursor !== firstCursor) releaseConditionCursors(watermark);
|
|
2549
2221
|
}
|
|
@@ -2555,31 +2227,13 @@ function resolveVariants(key, value, styleProps, styleState, parentVariantKey) {
|
|
|
2555
2227
|
emitResolvedVariant(key, value, styleState, parentVariantKey, null);
|
|
2556
2228
|
}
|
|
2557
2229
|
function emitResolvedVariant(key, value, styleState, parentVariantKey, conditionCursor) {
|
|
2558
|
-
const {
|
|
2230
|
+
const { conf, debug } = styleState;
|
|
2559
2231
|
const styleProps = styleState.styleProps;
|
|
2560
|
-
const
|
|
2232
|
+
const variants = styleState.flatStyleStaticConfig.variants;
|
|
2561
2233
|
if (!variants) return;
|
|
2562
2234
|
const variant = variants[key];
|
|
2563
|
-
let variantValue = getVariantDefinition(variant, value, conf, styleState);
|
|
2564
|
-
if (
|
|
2565
|
-
console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`);
|
|
2566
|
-
console.info({
|
|
2567
|
-
key,
|
|
2568
|
-
value,
|
|
2569
|
-
variantValue,
|
|
2570
|
-
variants
|
|
2571
|
-
});
|
|
2572
|
-
console.groupEnd();
|
|
2573
|
-
}
|
|
2574
|
-
if (!variantValue) {
|
|
2575
|
-
if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1") {
|
|
2576
|
-
if (typeof value !== "boolean") {
|
|
2577
|
-
const name = styleState.styleProps.displayName || "[UnnamedComponent]";
|
|
2578
|
-
console.warn(`No variant found: ${name} has variant "${key}", but no matching value "${value}"`);
|
|
2579
|
-
}
|
|
2580
|
-
}
|
|
2581
|
-
return;
|
|
2582
|
-
}
|
|
2235
|
+
let variantValue = (0, import_variantResolvers.getVariantDefinition)(variant, value, conf, styleState);
|
|
2236
|
+
if (!variantValue) return;
|
|
2583
2237
|
if (typeof variantValue === "function") {
|
|
2584
2238
|
const fn = variantValue;
|
|
2585
2239
|
const extras = (0, import_getVariantExtras.getVariantExtras)(styleState);
|
|
@@ -2594,28 +2248,22 @@ function emitResolvedVariant(key, value, styleState, parentVariantKey, condition
|
|
|
2594
2248
|
console.groupEnd();
|
|
2595
2249
|
}
|
|
2596
2250
|
}
|
|
2597
|
-
if (!(0,
|
|
2251
|
+
if (!(0, import_isObj.isObj)(variantValue)) return;
|
|
2598
2252
|
if (process.env.NODE_ENV === "development" && debug === "verbose") console.info(` expanding styles from `, variantValue);
|
|
2599
2253
|
const { noSkip } = styleProps;
|
|
2600
2254
|
const originals = import_styleOriginalValues.styleOriginalValues.get(variantValue);
|
|
2601
|
-
const
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
styleState.overriddenContextProps[outputKey] = originalValue;
|
|
2612
|
-
styleState.originalContextPropValues ||= {};
|
|
2613
|
-
styleState.originalContextPropValues[outputKey] = originalValue;
|
|
2614
|
-
}
|
|
2615
|
-
contributeMappedValue(outputKey, outputValue, styleState, parentVariantKey === key && outputKey === key, conditionCursor || void 0, originalValue);
|
|
2255
|
+
for (const outputKey in variantValue) {
|
|
2256
|
+
if (!noSkip && outputKey in import_skipProps.skipProps) continue;
|
|
2257
|
+
const rawOutputValue = variantValue[outputKey];
|
|
2258
|
+
const outputValue = styleProps.noNormalize ? rawOutputValue : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(rawOutputValue, conf.shorthands[outputKey] || outputKey);
|
|
2259
|
+
const originalValue = originals?.[outputKey] ?? rawOutputValue;
|
|
2260
|
+
if (styleState.flatStyleStaticConfig.styledContextKeys?.has(outputKey)) {
|
|
2261
|
+
styleState.overriddenContextProps ||= {};
|
|
2262
|
+
styleState.overriddenContextProps[outputKey] = originalValue;
|
|
2263
|
+
styleState.originalContextPropValues ||= {};
|
|
2264
|
+
styleState.originalContextPropValues[outputKey] = originalValue;
|
|
2616
2265
|
}
|
|
2617
|
-
|
|
2618
|
-
directState.flatCompoundOutputDepth--;
|
|
2266
|
+
contributeMappedValue(outputKey, outputValue, styleState, parentVariantKey === key && outputKey === key, conditionCursor || void 0, originalValue);
|
|
2619
2267
|
}
|
|
2620
2268
|
}
|
|
2621
2269
|
function getFontFamilyFromNameOrVariable(input, conf) {
|
|
@@ -2632,83 +2280,3 @@ function getFontFamilyFromNameOrVariable(input, conf) {
|
|
|
2632
2280
|
} else if (typeof input === "string" && input in conf.fontsParsed) return input;
|
|
2633
2281
|
}
|
|
2634
2282
|
const variableToFontNameCache = /* @__PURE__ */ new WeakMap();
|
|
2635
|
-
function getVariantDefinition(variant, value, conf, { theme }) {
|
|
2636
|
-
if (!variant) return;
|
|
2637
|
-
if (value === void 0) return;
|
|
2638
|
-
if (typeof variant === "function") return variant;
|
|
2639
|
-
if (Object.prototype.hasOwnProperty.call(variant, value)) return variant[value];
|
|
2640
|
-
for (const { key, parts } of getCompiledVariantResolvers(variant)) for (const part of parts) if (matchesVariantResolver(part, value, conf, theme)) return variant[key];
|
|
2641
|
-
}
|
|
2642
|
-
const variantResolverNameSet = new Set(import_types.variantResolverNames);
|
|
2643
|
-
const variantResolverCache = /* @__PURE__ */ new WeakMap();
|
|
2644
|
-
const preparedStyleStaticConfigs = /* @__PURE__ */ new WeakSet();
|
|
2645
|
-
function prepareStyleStaticConfig(staticConfig) {
|
|
2646
|
-
if (preparedStyleStaticConfigs.has(staticConfig)) return staticConfig;
|
|
2647
|
-
preparedStyleStaticConfigs.add(staticConfig);
|
|
2648
|
-
getContextPropSet(staticConfig);
|
|
2649
|
-
prepareStaticConfigCompounds(staticConfig);
|
|
2650
|
-
const variants = staticConfig.variants;
|
|
2651
|
-
if (variants) for (const key in variants) {
|
|
2652
|
-
const variant = variants[key];
|
|
2653
|
-
if (variant && typeof variant === "object") getCompiledVariantResolvers(variant);
|
|
2654
|
-
}
|
|
2655
|
-
return staticConfig;
|
|
2656
|
-
}
|
|
2657
|
-
function getCompiledVariantResolvers(variant) {
|
|
2658
|
-
let cached = variantResolverCache.get(variant);
|
|
2659
|
-
if (cached) return cached;
|
|
2660
|
-
const compiled = [];
|
|
2661
|
-
for (const key in variant) {
|
|
2662
|
-
const parts = parseVariantResolverKey(key);
|
|
2663
|
-
if (parts) compiled.push({
|
|
2664
|
-
key,
|
|
2665
|
-
parts
|
|
2666
|
-
});
|
|
2667
|
-
}
|
|
2668
|
-
variantResolverCache.set(variant, compiled);
|
|
2669
|
-
return compiled;
|
|
2670
|
-
}
|
|
2671
|
-
function parseVariantResolverKey(key) {
|
|
2672
|
-
if (!key) return null;
|
|
2673
|
-
const parts = [];
|
|
2674
|
-
let start = 0;
|
|
2675
|
-
for (let index = 0; index <= key.length; index++) {
|
|
2676
|
-
if (index !== key.length && key.charCodeAt(index) !== 124) continue;
|
|
2677
|
-
let partStart = start;
|
|
2678
|
-
let partEnd = index;
|
|
2679
|
-
while (partStart < partEnd && key.charCodeAt(partStart) <= 32) partStart++;
|
|
2680
|
-
while (partEnd > partStart && key.charCodeAt(partEnd - 1) <= 32) partEnd--;
|
|
2681
|
-
if (partStart === partEnd) return null;
|
|
2682
|
-
const part = key.slice(partStart, partEnd);
|
|
2683
|
-
if (!variantResolverNameSet.has(part)) return null;
|
|
2684
|
-
parts.push(part);
|
|
2685
|
-
start = index + 1;
|
|
2686
|
-
}
|
|
2687
|
-
return parts;
|
|
2688
|
-
}
|
|
2689
|
-
function hasNumericPrefix(value, suffixLength) {
|
|
2690
|
-
if (value.length <= suffixLength) return false;
|
|
2691
|
-
return Number.isFinite(Number(value.slice(0, value.length - suffixLength)));
|
|
2692
|
-
}
|
|
2693
|
-
function matchesVariantResolver(resolverName, value, conf, theme) {
|
|
2694
|
-
const string = typeof value === "string";
|
|
2695
|
-
const number = typeof value === "number";
|
|
2696
|
-
const rem = string && value.endsWith("rem") && hasNumericPrefix(value, 3);
|
|
2697
|
-
switch (resolverName) {
|
|
2698
|
-
case "Size":
|
|
2699
|
-
case "Space":
|
|
2700
|
-
case "Radius":
|
|
2701
|
-
case "ZIndex": return value === true || number || string || resolverName !== "Size" && (0, import_createVariable.isVariable)(value);
|
|
2702
|
-
case "Color": return value != null && value in conf.tokensParsed.color || string;
|
|
2703
|
-
case "Theme": return string && !!theme && value in theme;
|
|
2704
|
-
case "FontSize": return value === true || !!conf.fontsParsed.body?.size?.[value] || number || rem;
|
|
2705
|
-
case "FontStyle": return !!conf.fontsParsed.body?.style?.[value] || value === "normal" || value === "italic";
|
|
2706
|
-
case "FontTransform": return !!conf.fontsParsed.body?.transform?.[value] || value === "none" || value === "capitalize" || value === "uppercase" || value === "lowercase";
|
|
2707
|
-
case "FontLineHeight": return !!conf.fontsParsed.body?.lineHeight?.[value] || number || rem;
|
|
2708
|
-
case "FontLetterSpacing": return !!conf.fontsParsed.body?.letterSpacing?.[value] || number || rem;
|
|
2709
|
-
case "number":
|
|
2710
|
-
case "string":
|
|
2711
|
-
case "boolean": return typeof value === resolverName;
|
|
2712
|
-
case "any": return true;
|
|
2713
|
-
}
|
|
2714
|
-
}
|