@tamagui/web 1.121.12 → 1.122.0
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/createComponent.cjs +9 -10
- package/dist/cjs/createComponent.js +7 -16
- package/dist/cjs/createComponent.js.map +1 -1
- package/dist/cjs/createComponent.native.js +9 -13
- package/dist/cjs/createComponent.native.js.map +2 -2
- package/dist/cjs/helpers/ThemeManager.js.map +1 -1
- package/dist/cjs/helpers/ThemeManager.native.js.map +1 -1
- package/dist/cjs/helpers/ThemeManagerContext.cjs +2 -2
- package/dist/cjs/helpers/ThemeManagerContext.js +2 -2
- package/dist/cjs/helpers/ThemeManagerContext.js.map +1 -1
- package/dist/cjs/helpers/ThemeManagerContext.native.js +3 -3
- package/dist/cjs/helpers/ThemeManagerContext.native.js.map +2 -2
- package/dist/cjs/helpers/expandStyle.cjs +3 -3
- package/dist/cjs/helpers/expandStyle.js +2 -2
- package/dist/cjs/helpers/expandStyle.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.native.js +1 -1
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +64 -93
- package/dist/cjs/helpers/getSplitStyles.js +60 -86
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.native.js +344 -372
- package/dist/cjs/helpers/getSplitStyles.native.js.map +2 -2
- package/dist/cjs/helpers/getThemeCSSRules.cjs +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +6 -6
- package/dist/cjs/helpers/insertStyleRule.js +6 -11
- package/dist/cjs/helpers/insertStyleRule.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.native.js +17 -16
- package/dist/cjs/helpers/insertStyleRule.native.js.map +2 -2
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/cjs/helpers/propMapper.cjs +21 -15
- package/dist/cjs/helpers/propMapper.js +26 -20
- package/dist/cjs/helpers/propMapper.js.map +2 -2
- package/dist/cjs/helpers/propMapper.native.js +27 -21
- package/dist/cjs/helpers/propMapper.native.js.map +2 -2
- package/dist/cjs/hooks/useTheme.cjs +148 -169
- package/dist/cjs/hooks/useTheme.js +64 -69
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/hooks/useTheme.native.js +60 -72
- package/dist/cjs/hooks/useTheme.native.js.map +2 -2
- package/dist/cjs/hooks/useThemeName.cjs +4 -5
- package/dist/cjs/hooks/useThemeName.js +2 -2
- package/dist/cjs/hooks/useThemeName.js.map +1 -1
- package/dist/cjs/hooks/useThemeName.native.js +2 -2
- package/dist/cjs/hooks/useThemeName.native.js.map +2 -2
- package/dist/cjs/views/Theme.cjs +3 -4
- package/dist/cjs/views/Theme.js +2 -3
- package/dist/cjs/views/Theme.js.map +1 -1
- package/dist/cjs/views/Theme.native.js +3 -4
- package/dist/cjs/views/Theme.native.js.map +2 -2
- package/dist/esm/createComponent.js +7 -16
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/createComponent.mjs +9 -10
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +8 -11
- package/dist/esm/createComponent.native.js.map +2 -2
- package/dist/esm/helpers/ThemeManager.js.map +1 -1
- package/dist/esm/helpers/ThemeManager.mjs.map +1 -1
- package/dist/esm/helpers/ThemeManager.native.js.map +1 -1
- package/dist/esm/helpers/ThemeManagerContext.js +2 -2
- package/dist/esm/helpers/ThemeManagerContext.js.map +1 -1
- package/dist/esm/helpers/ThemeManagerContext.mjs +2 -2
- package/dist/esm/helpers/ThemeManagerContext.mjs.map +1 -1
- package/dist/esm/helpers/ThemeManagerContext.native.js +2 -2
- package/dist/esm/helpers/ThemeManagerContext.native.js.map +2 -2
- package/dist/esm/helpers/expandStyle.js +2 -2
- package/dist/esm/helpers/expandStyle.js.map +1 -1
- package/dist/esm/helpers/expandStyle.mjs +2 -2
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +1 -1
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/expandStyles.js.map +1 -1
- package/dist/esm/helpers/expandStyles.mjs.map +1 -1
- package/dist/esm/helpers/expandStyles.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +61 -92
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +65 -94
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +347 -375
- package/dist/esm/helpers/getSplitStyles.native.js.map +2 -2
- package/dist/esm/helpers/getThemeCSSRules.js +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.js +6 -11
- package/dist/esm/helpers/insertStyleRule.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +6 -6
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +17 -16
- package/dist/esm/helpers/insertStyleRule.native.js.map +2 -2
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.js +26 -20
- package/dist/esm/helpers/propMapper.js.map +2 -2
- package/dist/esm/helpers/propMapper.mjs +22 -15
- package/dist/esm/helpers/propMapper.mjs.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +28 -21
- package/dist/esm/helpers/propMapper.native.js.map +2 -2
- package/dist/esm/hooks/useTheme.js +70 -60
- package/dist/esm/hooks/useTheme.js.map +2 -2
- package/dist/esm/hooks/useTheme.mjs +145 -154
- package/dist/esm/hooks/useTheme.mjs.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +59 -62
- package/dist/esm/hooks/useTheme.native.js.map +2 -2
- package/dist/esm/hooks/useThemeName.js +3 -4
- package/dist/esm/hooks/useThemeName.js.map +1 -1
- package/dist/esm/hooks/useThemeName.mjs +3 -4
- package/dist/esm/hooks/useThemeName.mjs.map +1 -1
- package/dist/esm/hooks/useThemeName.native.js +3 -4
- package/dist/esm/hooks/useThemeName.native.js.map +2 -2
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/views/Theme.js +3 -4
- package/dist/esm/views/Theme.js.map +1 -1
- package/dist/esm/views/Theme.mjs +4 -5
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +4 -5
- package/dist/esm/views/Theme.native.js.map +2 -2
- package/package.json +11 -11
- package/src/createComponent.tsx +7 -15
- package/src/helpers/ThemeManager.tsx +1 -0
- package/src/helpers/ThemeManagerContext.tsx +2 -1
- package/src/helpers/expandStyle.ts +3 -3
- package/src/helpers/expandStyles.ts +0 -1
- package/src/helpers/getSplitStyles.tsx +111 -127
- package/src/helpers/getThemeCSSRules.ts +7 -6
- package/src/helpers/insertStyleRule.tsx +9 -16
- package/src/helpers/normalizeValueWithProperty.ts +0 -2
- package/src/helpers/propMapper.ts +28 -36
- package/src/hooks/useTheme.tsx +143 -113
- package/src/hooks/useThemeName.tsx +3 -5
- package/src/setupHooks.ts +1 -7
- package/src/types.tsx +15 -15
- package/src/views/Theme.tsx +5 -5
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/ThemeManager.d.ts.map +1 -1
- package/types/helpers/ThemeManagerContext.d.ts +2 -1
- package/types/helpers/ThemeManagerContext.d.ts.map +1 -1
- package/types/helpers/expandStyle.d.ts.map +1 -1
- package/types/helpers/expandStyles.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
- package/types/helpers/propMapper.d.ts +0 -1
- package/types/helpers/propMapper.d.ts.map +1 -1
- package/types/hooks/useConfiguration.d.ts +30 -50
- package/types/hooks/useConfiguration.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts +3 -3
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/hooks/useThemeName.d.ts.map +1 -1
- package/types/setupHooks.d.ts +1 -1
- package/types/setupHooks.d.ts.map +1 -1
- package/types/types.d.ts +23 -13
- package/types/types.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
|
@@ -30,387 +30,372 @@ __export(getSplitStyles_exports, {
|
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(getSplitStyles_exports);
|
|
32
32
|
var import_constants = require("@tamagui/constants"), import_helpers = require("@tamagui/helpers"), import_react = __toESM(require("react")), import_config = require("../config"), import_accessibilityDirectMap = require("../constants/accessibilityDirectMap"), import_constants2 = require("../constants/constants"), import_isDevTools = require("../constants/isDevTools"), import_useMedia = require("../hooks/useMedia"), import_createMediaStyle = require("./createMediaStyle"), import_expandStyles = require("./expandStyles"), import_getGroupPropParts = require("./getGroupPropParts"), import_getStylesAtomic = require("./getStylesAtomic"), import_insertStyleRule = require("./insertStyleRule"), import_isActivePlatform = require("./isActivePlatform"), import_isActiveTheme = require("./isActiveTheme"), import_log = require("./log"), import_normalizeValueWithProperty = require("./normalizeValueWithProperty"), import_propMapper = require("./propMapper"), import_pseudoDescriptors = require("./pseudoDescriptors"), import_skipProps = require("./skipProps"), import_sortString = require("./sortString"), import_transformsToString = require("./transformsToString"), consoleGroupCollapsed = import_constants.isWeb ? console.groupCollapsed : console.info, conf, PROP_SPLIT = "-";
|
|
33
|
-
function isValidStyleKey(key,
|
|
34
|
-
|
|
35
|
-
return validStyleProps[key] || ((_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key]);
|
|
33
|
+
function isValidStyleKey(key, validStyles, accept) {
|
|
34
|
+
return key in validStyles ? !0 : accept && key in accept;
|
|
36
35
|
}
|
|
37
36
|
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
usedKeys,
|
|
49
|
-
viewProps,
|
|
50
|
-
context,
|
|
51
|
-
debug
|
|
52
|
-
};
|
|
53
|
-
process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient && (consoleGroupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
|
|
54
|
-
props,
|
|
55
|
-
staticConfig,
|
|
56
|
-
shouldDoClasses,
|
|
57
|
-
styleProps,
|
|
58
|
-
rulesToInsert,
|
|
59
|
-
componentState,
|
|
60
|
-
styleState,
|
|
61
|
-
theme: {
|
|
62
|
-
...theme
|
|
37
|
+
var _loop = function(keyOg2) {
|
|
38
|
+
var keyInit = keyOg2, valInit = props[keyInit];
|
|
39
|
+
if (keyInit === "children")
|
|
40
|
+
return viewProps[keyInit] = valInit, "continue";
|
|
41
|
+
if (process.env.NODE_ENV === "development" && debug === "profile" && time`before-prop-${keyInit}`, process.env.NODE_ENV === "test" && keyInit === "jestAnimatedStyle")
|
|
42
|
+
return "continue";
|
|
43
|
+
if (accept) {
|
|
44
|
+
var accepted = accept[keyInit];
|
|
45
|
+
if ((accepted === "style" || accepted === "textStyle") && valInit && typeof valInit == "object")
|
|
46
|
+
return viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass), "continue";
|
|
63
47
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
48
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd(), disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys) return "continue";
|
|
49
|
+
if (keyInit in import_skipProps.skipProps && !noSkip && !isHOC) {
|
|
50
|
+
if (keyInit === "group" && 0)
|
|
51
|
+
var identifier2, containerType, containerCSS;
|
|
52
|
+
return "continue";
|
|
53
|
+
}
|
|
54
|
+
var valInitType = typeof valInit, isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles, accept);
|
|
55
|
+
if (0) {
|
|
56
|
+
if (staticConfig.isReactNative && keyInit.startsWith("data-"))
|
|
57
|
+
var _viewProps2, _dataSet;
|
|
58
|
+
if (isValidStyleKeyInit && valInitType === "string" && valInit[0] === "_") {
|
|
59
|
+
var isValidClassName, isMediaOrPseudo;
|
|
60
|
+
if ((isValidClassName || isMediaOrPseudo) && !shouldDoClasses)
|
|
61
|
+
var _styleState3;
|
|
72
62
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
}
|
|
64
|
+
if (!isValidStyleKeyInit) {
|
|
65
|
+
if (!import_constants.isAndroid && keyInit === "elevationAndroid")
|
|
66
|
+
return "continue";
|
|
67
|
+
if (keyInit === "userSelect")
|
|
68
|
+
keyInit = "selectable", valInit = valInit !== "none";
|
|
69
|
+
else if (keyInit.startsWith("data-"))
|
|
70
|
+
return "continue";
|
|
71
|
+
}
|
|
72
|
+
if (keyInit === "dataSet") {
|
|
73
|
+
for (var keyInit1 in valInit)
|
|
74
|
+
viewProps[`data-${hyphenate(keyInit1)}`] = valInit[keyInit1];
|
|
75
|
+
return "continue";
|
|
76
|
+
}
|
|
77
|
+
if (0 && !noExpand)
|
|
78
|
+
var didUseKeyInit;
|
|
79
|
+
var isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isValidStyleKeyInit || isVariant, isPseudo = keyInit in import_helpers.validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit), isMediaOrPseudo1 = !!(isMedia || isPseudo);
|
|
80
|
+
if (isMediaOrPseudo1 && keyInit.startsWith("$group-")) {
|
|
81
|
+
var parts = keyInit.split("-");
|
|
82
|
+
if (
|
|
83
|
+
// check if its actually a simple group selector to avoid breaking selectors
|
|
84
|
+
parts.length === 2 || parts.length === 3 && import_pseudoDescriptors.pseudoPriorities[parts[parts.length - 1]]
|
|
85
|
+
) {
|
|
86
|
+
var name2 = parts[1];
|
|
87
|
+
context != null && context.groups.subscribe && !(context != null && context.groups.state[name2]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
|
|
77
88
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
}
|
|
90
|
+
var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo1 || isVariant && !noExpand;
|
|
91
|
+
if (isStyleProp && (asChild === "except-style" || asChild === "except-style-web"))
|
|
92
|
+
return "continue";
|
|
93
|
+
var shouldPassProp = !isStyleProp && isHOC || // is in parent variants
|
|
94
|
+
isHOC && parentVariants && keyInit in parentVariants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = parentVariants == null ? void 0 : parentVariants[keyInit], isHOCShouldPassThrough = !!(isHOC && (isValidStyleKeyInit || isMediaOrPseudo1 || parentVariant || keyInit in import_skipProps.skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
95
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupEnd(), console.groupEnd(), consoleGroupCollapsed(` \u{1F511} ${keyOg2}${keyInit !== keyOg2 ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`), (0, import_log.log)({
|
|
96
|
+
isVariant,
|
|
97
|
+
valInit,
|
|
98
|
+
shouldPassProp
|
|
99
|
+
}), import_constants.isClient && (0, import_log.log)({
|
|
100
|
+
variants,
|
|
101
|
+
variant: variants == null ? void 0 : variants[keyInit],
|
|
102
|
+
isVariant,
|
|
103
|
+
isHOCShouldPassThrough,
|
|
104
|
+
parentStaticConfig
|
|
105
|
+
})), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo1), !isVariant) || !noSkip && keyInit in import_skipProps.skipProps)
|
|
106
|
+
return "continue";
|
|
107
|
+
(isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
|
|
108
|
+
var disablePropMap = isMediaOrPseudo1 || !isStyleLikeKey;
|
|
109
|
+
if ((0, import_propMapper.propMapper)(keyInit, valInit, styleState, disablePropMap, function(key4, val2) {
|
|
110
|
+
var _parentStaticConfig_variants;
|
|
111
|
+
if (!isHOC && disablePropMap && !isMediaOrPseudo1) {
|
|
112
|
+
viewProps[key4] = val2;
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed(" \u{1F4A0} expanded", keyInit, "=>", key4), (0, import_log.log)(val2), console.groupEnd()), val2 != null && !(key4 in usedKeys)) {
|
|
116
|
+
if (key4 === "pointerEvents") {
|
|
117
|
+
viewProps[key4] = val2;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (!isHOC && isValidStyleKey(key4, validStyles, accept) || import_constants.isAndroid && key4 === "elevation") {
|
|
121
|
+
mergeStyle(styleState, key4, val2);
|
|
122
|
+
return;
|
|
95
123
|
}
|
|
96
|
-
if (
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
124
|
+
if (isPseudo = key4 in import_helpers.validPseudoKeys, isMedia = !isPseudo && (0, import_useMedia.isMediaKey)(key4), isMediaOrPseudo1 = !!(isMedia || isPseudo), isVariant = variants && key4 in variants, inlineProps != null && inlineProps.has(key4) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened != null && inlineWhenUnflattened.has(key4))) {
|
|
125
|
+
var _props_key;
|
|
126
|
+
viewProps[key4] = (_props_key = props[key4]) !== null && _props_key !== void 0 ? _props_key : val2;
|
|
127
|
+
}
|
|
128
|
+
var shouldPassThrough2 = styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo1 || (parentStaticConfig == null || (_parentStaticConfig_variants = parentStaticConfig.variants) === null || _parentStaticConfig_variants === void 0 ? void 0 : _parentStaticConfig_variants[keyInit]));
|
|
129
|
+
if (shouldPassThrough2) {
|
|
130
|
+
passDownProp(viewProps, key4, val2, isMediaOrPseudo1), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed(` - passing down prop ${key4}`), (0, import_log.log)({
|
|
131
|
+
val: val2,
|
|
132
|
+
after: {
|
|
133
|
+
...viewProps[key4]
|
|
134
|
+
}
|
|
101
135
|
}), console.groupEnd());
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (isPseudo) {
|
|
139
|
+
if (!val2) return;
|
|
140
|
+
var pseudoStyleObject = getSubStyle(styleState, key4, val2, styleProps.noClass);
|
|
141
|
+
if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
|
|
142
|
+
var _pseudos, _key;
|
|
143
|
+
if (pseudos || (pseudos = {}), (_pseudos = pseudos)[_key = key4] || (_pseudos[_key] = {}), process.env.IS_STATIC === "is_static") {
|
|
144
|
+
Object.assign(pseudos[key4], pseudoStyleObject);
|
|
145
|
+
return;
|
|
107
146
|
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
147
|
+
}
|
|
148
|
+
var descriptor = import_pseudoDescriptors.pseudoDescriptors[key4], isEnter = key4 === "enterStyle", isExit = key4 === "exitStyle";
|
|
149
|
+
if (!descriptor)
|
|
150
|
+
return;
|
|
151
|
+
if (shouldDoClasses && !isExit) {
|
|
152
|
+
var pseudoStyles = (0, import_getStylesAtomic.getStyleAtomic)(pseudoStyleObject, descriptor);
|
|
153
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo (classes)", key4), (0, import_log.log)({
|
|
154
|
+
pseudoStyleObject,
|
|
155
|
+
pseudoStyles
|
|
156
|
+
}), console.groupEnd());
|
|
157
|
+
var _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
|
|
111
158
|
try {
|
|
112
|
-
|
|
159
|
+
for (var _iterator2 = pseudoStyles[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
|
|
160
|
+
var psuedoStyle = _step2.value, fullKey = `${psuedoStyle[import_helpers.StyleObjectProperty]}${PROP_SPLIT}${descriptor.name}`;
|
|
161
|
+
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), mergeClassName(transforms, classNames, fullKey, psuedoStyle[import_helpers.StyleObjectIdentifier], isMediaOrPseudo1, !0));
|
|
162
|
+
}
|
|
163
|
+
} catch (err) {
|
|
164
|
+
_didIteratorError2 = !0, _iteratorError2 = err;
|
|
113
165
|
} finally {
|
|
114
|
-
|
|
115
|
-
|
|
166
|
+
try {
|
|
167
|
+
!_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
|
|
168
|
+
} finally {
|
|
169
|
+
if (_didIteratorError2)
|
|
170
|
+
throw _iteratorError2;
|
|
171
|
+
}
|
|
116
172
|
}
|
|
117
173
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
174
|
+
if (!shouldDoClasses || isExit || isEnter) {
|
|
175
|
+
var descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = componentState[descriptorKey] === !1;
|
|
176
|
+
isExit && (isDisabled = !styleProps.isExiting), isEnter && componentState.unmounted === !1 && (isDisabled = !0), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo", key4, {
|
|
177
|
+
isDisabled
|
|
178
|
+
}), (0, import_log.log)({
|
|
179
|
+
pseudoStyleObject,
|
|
180
|
+
isDisabled,
|
|
181
|
+
descriptor,
|
|
182
|
+
componentState
|
|
183
|
+
}), console.groupEnd());
|
|
184
|
+
var importance = descriptor.priority;
|
|
185
|
+
for (var pkey in pseudoStyleObject) {
|
|
186
|
+
var _$val = pseudoStyleObject[pkey];
|
|
187
|
+
if (isDisabled)
|
|
188
|
+
applyDefaultStyle(pkey, styleState);
|
|
189
|
+
else {
|
|
190
|
+
var curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
|
|
191
|
+
if (shouldMerge) {
|
|
192
|
+
if (process.env.IS_STATIC === "is_static") {
|
|
193
|
+
var _pseudos1, _key1;
|
|
194
|
+
pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key4] || (_pseudos1[_key1] = {}), pseudos[key4][pkey] = _$val;
|
|
195
|
+
}
|
|
196
|
+
mergeStyle(styleState, pkey, _$val);
|
|
197
|
+
}
|
|
198
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" subKey", pkey, shouldMerge, {
|
|
199
|
+
importance,
|
|
200
|
+
curImportance,
|
|
201
|
+
pkey,
|
|
202
|
+
val: _$val
|
|
203
|
+
});
|
|
139
204
|
}
|
|
140
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" subKey", pkey, shouldMerge, {
|
|
141
|
-
importance,
|
|
142
|
-
curImportance,
|
|
143
|
-
pkey,
|
|
144
|
-
val: val12
|
|
145
|
-
});
|
|
146
205
|
}
|
|
206
|
+
if (!isDisabled)
|
|
207
|
+
for (var _$key in val2) {
|
|
208
|
+
var k = shorthands[_$key] || _$key;
|
|
209
|
+
usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
|
|
210
|
+
}
|
|
147
211
|
}
|
|
148
|
-
|
|
149
|
-
for (var key12 in val) {
|
|
150
|
-
var k1 = shorthands[key12] || key12;
|
|
151
|
-
usedKeys[k1] = Math.max(importance, usedKeys[k1] || 0);
|
|
152
|
-
}
|
|
212
|
+
return;
|
|
153
213
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
var importance1 = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKeyShort, "space", usedKeys, !0);
|
|
173
|
-
importance1 && (space = val.space, usedKeys.space = importance1, process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(`Found more important space for current media ${mediaKeyShort}: ${val} (importance: ${importance1})`));
|
|
174
|
-
}
|
|
175
|
-
var mediaStyles = (0, import_getStylesAtomic.getStylesAtomic)(mediaStyle), priority = mediaStylesSeen;
|
|
176
|
-
mediaStylesSeen += 1;
|
|
177
|
-
var _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
|
|
178
|
-
try {
|
|
179
|
-
for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = !0) {
|
|
180
|
-
var style3 = _step12.value, property = style3[import_helpers.StyleObjectProperty], isSubStyle = property[0] === "$";
|
|
181
|
-
if (!(isSubStyle && !(0, import_isActivePlatform.isActivePlatform)(property))) {
|
|
182
|
-
var out = (0, import_createMediaStyle.createMediaStyle)(style3, mediaKeyShort, import_useMedia.mediaQueryConfig, isMedia, !1, priority);
|
|
183
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)("\u{1F4FA} media style:", out);
|
|
184
|
-
var subKey = isSubStyle ? style3[2] : "", fullKey1 = `${style3[import_helpers.StyleObjectProperty]}${subKey}${PROP_SPLIT}${mediaKeyShort}${style3[import_helpers.StyleObjectPseudo] || ""}`;
|
|
185
|
-
fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), mergeClassName(transforms, classNames, fullKey1, out[import_helpers.StyleObjectIdentifier], !0, !0));
|
|
186
|
-
}
|
|
214
|
+
if (isMedia) {
|
|
215
|
+
if (!val2) return;
|
|
216
|
+
var hasSpace = val2.space, mediaKeyShort = key4.slice(isMedia == "theme" ? 7 : 1);
|
|
217
|
+
if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && (typeof hasMedia != "object" && (hasMedia = {}), hasMedia[mediaKeyShort] = !0), isMedia === "platform" && !(0, import_isActivePlatform.isActivePlatform)(key4))
|
|
218
|
+
return;
|
|
219
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} ${key4}`, {
|
|
220
|
+
key: key4,
|
|
221
|
+
val: val2,
|
|
222
|
+
props,
|
|
223
|
+
shouldDoClasses,
|
|
224
|
+
acceptsClassName,
|
|
225
|
+
componentState,
|
|
226
|
+
mediaState
|
|
227
|
+
}), shouldDoClasses) {
|
|
228
|
+
var mediaStyle = getSubStyle(styleState, key4, val2, !1);
|
|
229
|
+
if (hasSpace && (delete mediaStyle.space, mediaState[mediaKeyShort])) {
|
|
230
|
+
var importance1 = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKeyShort, "space", usedKeys, !0);
|
|
231
|
+
importance1 && (space = val2.space, usedKeys.space = importance1, process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(`Found more important space for current media ${mediaKeyShort}: ${val2} (importance: ${importance1})`));
|
|
187
232
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
233
|
+
var mediaStyles = (0, import_getStylesAtomic.getStylesAtomic)(mediaStyle), priority = mediaStylesSeen;
|
|
234
|
+
mediaStylesSeen += 1;
|
|
235
|
+
var _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
|
|
191
236
|
try {
|
|
192
|
-
|
|
237
|
+
for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = !0) {
|
|
238
|
+
var style3 = _step12.value, property = style3[import_helpers.StyleObjectProperty], isSubStyle = property[0] === "$";
|
|
239
|
+
if (!(isSubStyle && !(0, import_isActivePlatform.isActivePlatform)(property))) {
|
|
240
|
+
var out = (0, import_createMediaStyle.createMediaStyle)(style3, mediaKeyShort, import_useMedia.mediaQueryConfig, isMedia, !1, priority);
|
|
241
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)("\u{1F4FA} media style:", out);
|
|
242
|
+
var subKey = isSubStyle ? style3[2] : "", fullKey1 = `${style3[import_helpers.StyleObjectProperty]}${subKey}${PROP_SPLIT}${mediaKeyShort}${style3[import_helpers.StyleObjectPseudo] || ""}`;
|
|
243
|
+
fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), mergeClassName(transforms, classNames, fullKey1, out[import_helpers.StyleObjectIdentifier], !0, !0));
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
} catch (err) {
|
|
247
|
+
_didIteratorError12 = !0, _iteratorError12 = err;
|
|
193
248
|
} finally {
|
|
194
|
-
|
|
195
|
-
|
|
249
|
+
try {
|
|
250
|
+
!_iteratorNormalCompletion12 && _iterator12.return != null && _iterator12.return();
|
|
251
|
+
} finally {
|
|
252
|
+
if (_didIteratorError12)
|
|
253
|
+
throw _iteratorError12;
|
|
254
|
+
}
|
|
196
255
|
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} \u2705 ENABLED ${mediaKeyShort}`);
|
|
210
|
-
}
|
|
211
|
-
var mediaStyle1 = getSubStyle(styleState, key, val, !0), importanceBump = 0;
|
|
212
|
-
if (isThemeMedia) {
|
|
213
|
-
if (dynamicThemeAccess = !0, !(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort)))
|
|
214
|
-
return "continue";
|
|
215
|
-
} else if (isGroupMedia) {
|
|
216
|
-
var _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
|
|
217
|
-
if (!groupContext)
|
|
218
|
-
return process.env.NODE_ENV === "development" && debug && (0, import_log.log)(`No parent with group prop, skipping styles: ${groupName}`), "continue";
|
|
219
|
-
var groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_componentState_group = componentState.group) === null || _componentState_group === void 0 ? void 0 : _componentState_group[groupName];
|
|
220
|
-
if (groupMediaKey) {
|
|
221
|
-
mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
|
|
222
|
-
var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
|
|
223
|
-
if (!mediaState1 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP media ${groupMediaKey} active? ${isActive}`), !isActive) {
|
|
224
|
-
for (var pkey1 in mediaStyle1)
|
|
225
|
-
applyDefaultStyle(pkey1, styleState);
|
|
226
|
-
return "continue";
|
|
256
|
+
} else {
|
|
257
|
+
let mergeMediaStyle2 = function(key5, val3) {
|
|
258
|
+
var _styleState4;
|
|
259
|
+
(_styleState4 = styleState).style || (_styleState4.style = {});
|
|
260
|
+
var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, usedKeys, mediaState[mediaKeyShort], importanceBump, debug);
|
|
261
|
+
didMerge && key5 === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
|
|
262
|
+
};
|
|
263
|
+
var mergeMediaStyle = mergeMediaStyle2, isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
|
|
264
|
+
if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
|
|
265
|
+
if (!mediaState[mediaKeyShort]) {
|
|
266
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} \u274C DISABLED ${mediaKeyShort}`);
|
|
267
|
+
return;
|
|
227
268
|
}
|
|
228
|
-
|
|
269
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} \u2705 ENABLED ${mediaKeyShort}`);
|
|
229
270
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
271
|
+
var mediaStyle1 = getSubStyle(styleState, key4, val2, !0), importanceBump = 0;
|
|
272
|
+
if (isThemeMedia) {
|
|
273
|
+
if (dynamicThemeAccess = !0, !(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort)))
|
|
274
|
+
return;
|
|
275
|
+
} else if (isGroupMedia) {
|
|
276
|
+
var _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
|
|
277
|
+
if (!groupContext) {
|
|
278
|
+
process.env.NODE_ENV === "development" && debug && (0, import_log.log)(`No parent with group prop, skipping styles: ${groupName}`);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
var groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_componentState_group = componentState.group) === null || _componentState_group === void 0 ? void 0 : _componentState_group[groupName];
|
|
282
|
+
if (groupMediaKey) {
|
|
283
|
+
mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
|
|
284
|
+
var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
|
|
285
|
+
if (!mediaState1 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP media ${groupMediaKey} active? ${isActive}`), !isActive) {
|
|
286
|
+
for (var pkey1 in mediaStyle1)
|
|
287
|
+
applyDefaultStyle(pkey1, styleState);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
importanceBump = 2;
|
|
291
|
+
}
|
|
292
|
+
if (groupPseudoKey) {
|
|
293
|
+
pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
|
|
294
|
+
var componentGroupPseudoState = (componentGroupState || // fallback to context initially
|
|
295
|
+
context.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
|
|
296
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}`), !isActive1) {
|
|
297
|
+
for (var pkey2 in mediaStyle1)
|
|
298
|
+
applyDefaultStyle(pkey2, styleState);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
importanceBump = priority1;
|
|
238
302
|
}
|
|
239
|
-
importanceBump = priority1;
|
|
240
303
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
304
|
+
for (var subKey1 in mediaStyle1) {
|
|
305
|
+
if (subKey1 === "space") {
|
|
306
|
+
space = valInit.space;
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
309
|
+
if (subKey1[0] === "$") {
|
|
310
|
+
if (!(0, import_isActivePlatform.isActivePlatform)(subKey1) || !(0, import_isActiveTheme.isActiveTheme)(subKey1, themeName)) continue;
|
|
311
|
+
for (var subSubKey in mediaStyle1[subKey1])
|
|
312
|
+
mergeMediaStyle2(subSubKey, mediaStyle1[subKey1][subSubKey]);
|
|
313
|
+
} else
|
|
314
|
+
mergeMediaStyle2(subKey1, mediaStyle1[subKey1]);
|
|
246
315
|
}
|
|
247
|
-
if (subKey1[0] === "$") {
|
|
248
|
-
if (!(0, import_isActivePlatform.isActivePlatform)(subKey1) || !(0, import_isActiveTheme.isActiveTheme)(subKey1, themeName)) continue;
|
|
249
|
-
for (var subSubKey in mediaStyle1[subKey1])
|
|
250
|
-
mergeMediaStyle2(subSubKey, mediaStyle1[subKey1][subSubKey]);
|
|
251
|
-
} else
|
|
252
|
-
mergeMediaStyle2(subKey1, mediaStyle1[subKey1]);
|
|
253
316
|
}
|
|
317
|
+
return;
|
|
254
318
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
if (
|
|
260
|
-
// is HOC we can just pass through the styles as props
|
|
261
|
-
// this fixes issues where style prop got merged with wrong priority
|
|
262
|
-
!isHOC && (isValidStyleKey(key, staticConfig) || import_constants.isAndroid && key === "elevation")
|
|
263
|
-
)
|
|
264
|
-
return mergeStyle(styleState, key, val), "continue";
|
|
265
|
-
if (!isVariant) {
|
|
266
|
-
if (styleProps.styledContextProps && key in styleProps.styledContextProps)
|
|
267
|
-
return "continue";
|
|
268
|
-
viewProps[key] = val;
|
|
269
|
-
}
|
|
270
|
-
}, keyInit = keyOg, valInit = props[keyInit];
|
|
271
|
-
if (!(process.env.NODE_ENV === "test" && keyInit === "jestAnimatedStyle")) {
|
|
272
|
-
if (process.env.NODE_ENV === "development" && debug === "profile" && time`prop-${keyInit}`, accept) {
|
|
273
|
-
var accepted = accept[keyInit];
|
|
274
|
-
if ((accepted === "style" || accepted === "textStyle") && valInit && typeof valInit == "object") {
|
|
275
|
-
viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass);
|
|
276
|
-
continue;
|
|
319
|
+
if (!isVariant) {
|
|
320
|
+
if (styleProps.styledContextProps && key4 in styleProps.styledContextProps)
|
|
321
|
+
return;
|
|
322
|
+
viewProps[key4] = val2;
|
|
277
323
|
}
|
|
278
324
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
if (isValidStyleKeyInit && valInitType === "string" && valInit[0] === "_") {
|
|
290
|
-
var isValidClassName, isMediaOrPseudo;
|
|
291
|
-
if ((isValidClassName || isMediaOrPseudo) && !shouldDoClasses)
|
|
292
|
-
var _styleState;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
if (!isValidStyleKeyInit) {
|
|
296
|
-
if (!import_constants.isAndroid && keyInit === "elevationAndroid")
|
|
297
|
-
continue;
|
|
298
|
-
if (keyInit === "userSelect")
|
|
299
|
-
keyInit = "selectable", valInit = valInit !== "none";
|
|
300
|
-
else if (keyInit.startsWith("data-"))
|
|
301
|
-
continue;
|
|
302
|
-
}
|
|
303
|
-
if (keyInit === "dataSet") {
|
|
304
|
-
for (var keyInit1 in valInit)
|
|
305
|
-
viewProps[`data-${hyphenate(keyInit1)}`] = valInit[keyInit1];
|
|
306
|
-
continue;
|
|
307
|
-
}
|
|
308
|
-
if (0 && !noExpand)
|
|
309
|
-
var didUseKeyInit;
|
|
310
|
-
var isShorthand = keyInit in shorthands, isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isShorthand || isValidStyleKeyInit || isVariant, isPseudo = keyInit in import_helpers.validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit), isMediaOrPseudo1 = !!(isMedia || isPseudo);
|
|
311
|
-
if (isMediaOrPseudo1 && keyInit.startsWith("$group-")) {
|
|
312
|
-
var parts = keyInit.split("-");
|
|
313
|
-
if (
|
|
314
|
-
// check if its actually a simple group selector to avoid breaking selectors
|
|
315
|
-
parts.length === 2 || parts.length === 3 && import_pseudoDescriptors.pseudoPriorities[parts[parts.length - 1]]
|
|
316
|
-
) {
|
|
317
|
-
var name = parts[1];
|
|
318
|
-
context != null && context.groups.subscribe && !(context != null && context.groups.state[name]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo1 || isVariant && !noExpand || isShorthand;
|
|
322
|
-
if (!(isStyleProp && (asChild === "except-style" || asChild === "except-style-web"))) {
|
|
323
|
-
var shouldPassProp = !isStyleProp && isHOC || // is in parent variants
|
|
324
|
-
isHOC && parentVariants && keyInit in parentVariants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = parentVariants == null ? void 0 : parentVariants[keyInit], isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo1 || parentVariant || keyInit in import_skipProps.skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
325
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupEnd(), console.groupEnd(), consoleGroupCollapsed(` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`), (0, import_log.log)({
|
|
326
|
-
isVariant,
|
|
327
|
-
valInit,
|
|
328
|
-
shouldPassProp
|
|
329
|
-
}), import_constants.isClient && (0, import_log.log)({
|
|
330
|
-
variants,
|
|
331
|
-
variant: variants == null ? void 0 : variants[keyInit],
|
|
332
|
-
isVariant,
|
|
333
|
-
isHOCShouldPassThrough,
|
|
334
|
-
parentStaticConfig
|
|
335
|
-
})), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo1), !isVariant)) {
|
|
336
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd();
|
|
337
|
-
continue;
|
|
338
|
-
}
|
|
339
|
-
if (!noSkip && keyInit in import_skipProps.skipProps) {
|
|
340
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd();
|
|
341
|
-
continue;
|
|
342
|
-
}
|
|
343
|
-
(isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
|
|
344
|
-
var avoidPropMap = isMediaOrPseudo1 || !isVariant && !isValidStyleKeyInit, expanded = avoidPropMap ? null : (0, import_propMapper.propMapper)(keyInit, valInit, styleState);
|
|
345
|
-
if (!avoidPropMap) {
|
|
346
|
-
if (!expanded) continue;
|
|
347
|
-
var next = (0, import_propMapper.getPropMappedFontFamily)(expanded);
|
|
348
|
-
next && (styleState.fontFamily = next);
|
|
349
|
-
}
|
|
350
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
351
|
-
consoleGroupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
|
|
352
|
-
try {
|
|
353
|
-
!import_constants.isServer && import_isDevTools.isDevTools && ((0, import_log.log)({
|
|
354
|
-
expanded,
|
|
355
|
-
styleProps,
|
|
356
|
-
componentState,
|
|
357
|
-
isVariant,
|
|
358
|
-
variant: variants == null ? void 0 : variants[keyInit],
|
|
359
|
-
shouldPassProp,
|
|
360
|
-
isHOCShouldPassThrough,
|
|
361
|
-
usedKeys: {
|
|
362
|
-
...usedKeys
|
|
363
|
-
}
|
|
364
|
-
}), globalThis.tamaguiAvoidTracking = !0, (0, import_log.log)("expanded", expanded, `
|
|
365
|
-
usedKeys`, {
|
|
366
|
-
...usedKeys
|
|
367
|
-
}, `
|
|
368
|
-
current`, {
|
|
369
|
-
...styleState.style
|
|
370
|
-
}), globalThis.tamaguiAvoidTracking = !1);
|
|
371
|
-
} catch {
|
|
372
|
-
}
|
|
373
|
-
console.groupEnd();
|
|
374
|
-
}
|
|
375
|
-
for (var key = keyInit, val = valInit, max = expanded ? expanded.length : 1, i = 0; i < max; i++) _loop(i);
|
|
376
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
377
|
-
try {
|
|
378
|
-
(0, import_log.log)(" \u2714\uFE0F expand complete", keyInit), (0, import_log.log)("style", {
|
|
379
|
-
...styleState.style
|
|
380
|
-
}), (0, import_log.log)("transforms", {
|
|
381
|
-
...transforms
|
|
382
|
-
}), (0, import_log.log)("viewProps", {
|
|
383
|
-
...viewProps
|
|
384
|
-
});
|
|
385
|
-
} catch {
|
|
386
|
-
}
|
|
387
|
-
console.groupEnd();
|
|
388
|
-
}
|
|
389
|
-
}
|
|
325
|
+
}), process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
326
|
+
try {
|
|
327
|
+
(0, import_log.log)(" \u2714\uFE0F expand complete", keyInit), (0, import_log.log)("style", {
|
|
328
|
+
...styleState.style
|
|
329
|
+
}), (0, import_log.log)("transforms", {
|
|
330
|
+
...transforms
|
|
331
|
+
}), (0, import_log.log)("viewProps", {
|
|
332
|
+
...viewProps
|
|
333
|
+
});
|
|
334
|
+
} catch {
|
|
390
335
|
}
|
|
336
|
+
console.groupEnd();
|
|
391
337
|
}
|
|
338
|
+
};
|
|
339
|
+
props.reddish && (debug = "verbose"), conf = conf || (0, import_config.getConfig)(), import_constants.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
340
|
+
var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClass, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, validStyles = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles);
|
|
341
|
+
process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-setup`;
|
|
342
|
+
var styleState = {
|
|
343
|
+
classNames,
|
|
344
|
+
conf,
|
|
345
|
+
props,
|
|
346
|
+
styleProps,
|
|
347
|
+
componentState,
|
|
348
|
+
staticConfig,
|
|
349
|
+
style: null,
|
|
350
|
+
theme,
|
|
351
|
+
usedKeys,
|
|
352
|
+
viewProps,
|
|
353
|
+
context,
|
|
354
|
+
debug
|
|
355
|
+
};
|
|
356
|
+
if (process.env.IS_STATIC === "is_static") {
|
|
357
|
+
var { fallbackProps } = styleProps;
|
|
358
|
+
fallbackProps && (styleState.props = new Proxy(props, {
|
|
359
|
+
get(_, key4, val2) {
|
|
360
|
+
return Reflect.has(props, key4) ? Reflect.get(props, key4) : Reflect.get(fallbackProps, key4);
|
|
361
|
+
}
|
|
362
|
+
}));
|
|
392
363
|
}
|
|
364
|
+
process.env.NODE_ENV === "development" && debug === "profile" && time`style-state`, process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient && (consoleGroupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
|
|
365
|
+
props,
|
|
366
|
+
staticConfig,
|
|
367
|
+
shouldDoClasses,
|
|
368
|
+
styleProps,
|
|
369
|
+
rulesToInsert,
|
|
370
|
+
componentState,
|
|
371
|
+
styleState,
|
|
372
|
+
theme: {
|
|
373
|
+
...theme
|
|
374
|
+
}
|
|
375
|
+
}), console.groupEnd());
|
|
376
|
+
var { asChild } = props, { accept } = staticConfig, { noSkip, disableExpandShorthands, noExpand } = styleProps, { webContainerType } = conf.settings, parentVariants = parentStaticConfig == null ? void 0 : parentStaticConfig.variants;
|
|
377
|
+
for (var keyOg in props) _loop(keyOg);
|
|
393
378
|
process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-propsend`;
|
|
394
379
|
var avoidNormalize = styleProps.noNormalize === !1;
|
|
395
380
|
if (!avoidNormalize) {
|
|
396
381
|
if (styleState.style && ((0, import_expandStyles.fixStyles)(styleState.style), import_constants.isWeb && !isReactNative && (0, import_getStylesAtomic.styleToCSS)(styleState.style)), styleState.flatTransforms) {
|
|
397
|
-
var
|
|
398
|
-
(
|
|
382
|
+
var _styleState;
|
|
383
|
+
(_styleState = styleState).style || (_styleState.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
|
|
399
384
|
var [a] = param, [b] = param1;
|
|
400
385
|
return (0, import_sortString.sortString)(a, b);
|
|
401
386
|
}).forEach(function(param) {
|
|
402
|
-
var [
|
|
403
|
-
mergeTransform(styleState.style,
|
|
387
|
+
var [key4, val2] = param;
|
|
388
|
+
mergeTransform(styleState.style, key4, val2, !0);
|
|
404
389
|
});
|
|
405
390
|
}
|
|
406
391
|
if (parentSplitStyles) {
|
|
407
392
|
if (0 && shouldDoClasses)
|
|
408
|
-
for (var
|
|
409
|
-
var
|
|
393
|
+
for (var key in parentSplitStyles.classNames)
|
|
394
|
+
var val;
|
|
410
395
|
if (!shouldDoClasses)
|
|
411
|
-
for (var
|
|
412
|
-
var
|
|
413
|
-
|
|
396
|
+
for (var key1 in parentSplitStyles.style) {
|
|
397
|
+
var _styleState1;
|
|
398
|
+
key1 in classNames || styleState.style && key1 in styleState.style || ((_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key1] = parentSplitStyles.style[key1]);
|
|
414
399
|
}
|
|
415
400
|
}
|
|
416
401
|
}
|
|
@@ -423,21 +408,21 @@ current`, {
|
|
|
423
408
|
var atomic, _iteratorNormalCompletion, _didIteratorError, _iteratorError;
|
|
424
409
|
try {
|
|
425
410
|
for (var _iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)
|
|
426
|
-
var atomicStyle, _props_animateOnly, _props_animateOnly1,
|
|
411
|
+
var atomicStyle, _props_animateOnly, _props_animateOnly1, key2, value, identifier, isAnimatedAndAnimateOnly, nonAnimatedAnimateOnly;
|
|
427
412
|
} catch (err) {
|
|
428
413
|
} finally {
|
|
429
414
|
}
|
|
430
415
|
}
|
|
431
416
|
if (transforms)
|
|
432
417
|
for (var namespace in transforms) {
|
|
433
|
-
var hash,
|
|
434
|
-
if (import_constants.isClient && !insertedTransforms[
|
|
418
|
+
var hash, val1, identifier1;
|
|
419
|
+
if (import_constants.isClient && !insertedTransforms[identifier1])
|
|
435
420
|
var rule;
|
|
436
421
|
}
|
|
437
422
|
}
|
|
438
423
|
if (isReactNative) {
|
|
439
424
|
if (viewProps.tabIndex === 0)
|
|
440
|
-
var
|
|
425
|
+
var _viewProps, _accessible;
|
|
441
426
|
} else if (viewProps.tabIndex == null)
|
|
442
427
|
var _viewProps_focusable, isFocusable, role;
|
|
443
428
|
}
|
|
@@ -446,14 +431,14 @@ current`, {
|
|
|
446
431
|
if (isHOC)
|
|
447
432
|
viewProps.style = normalizeStyle(styleProp);
|
|
448
433
|
else
|
|
449
|
-
for (var isArray = Array.isArray(styleProp), len = isArray ? styleProp.length : 1,
|
|
450
|
-
var style = isArray ? styleProp[
|
|
434
|
+
for (var isArray = Array.isArray(styleProp), len = isArray ? styleProp.length : 1, i = 0; i < len; i++) {
|
|
435
|
+
var style = isArray ? styleProp[i] : styleProp;
|
|
451
436
|
if (style)
|
|
452
437
|
if (style.$$css)
|
|
453
438
|
Object.assign(styleState.classNames, style);
|
|
454
439
|
else {
|
|
455
|
-
var
|
|
456
|
-
(
|
|
440
|
+
var _styleState2;
|
|
441
|
+
(_styleState2 = styleState).style || (_styleState2.style = {}), Object.assign(styleState.style, normalizeStyle(style));
|
|
457
442
|
}
|
|
458
443
|
}
|
|
459
444
|
var style1 = styleState.style;
|
|
@@ -489,7 +474,7 @@ current`, {
|
|
|
489
474
|
var cnStyles, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1;
|
|
490
475
|
try {
|
|
491
476
|
for (var _iterator1, _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0)
|
|
492
|
-
var
|
|
477
|
+
var name;
|
|
493
478
|
} catch (err) {
|
|
494
479
|
} finally {
|
|
495
480
|
}
|
|
@@ -511,8 +496,8 @@ current`, {
|
|
|
511
496
|
rulesToInsert,
|
|
512
497
|
parentSplitStyles
|
|
513
498
|
};
|
|
514
|
-
for (var
|
|
515
|
-
(0, import_log.log)(
|
|
499
|
+
for (var key3 in logs)
|
|
500
|
+
(0, import_log.log)(key3, logs[key3]);
|
|
516
501
|
} catch {
|
|
517
502
|
}
|
|
518
503
|
console.groupEnd();
|
|
@@ -546,30 +531,17 @@ function mergeStyle(styleState, key, val) {
|
|
|
546
531
|
}
|
|
547
532
|
}
|
|
548
533
|
var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
|
|
549
|
-
var
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
}
|
|
561
|
-
} catch (err) {
|
|
562
|
-
_didIteratorError = !0, _iteratorError = err;
|
|
563
|
-
} finally {
|
|
564
|
-
try {
|
|
565
|
-
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
566
|
-
} finally {
|
|
567
|
-
if (_didIteratorError)
|
|
568
|
-
throw _iteratorError;
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
}
|
|
534
|
+
var _loop = function(key1) {
|
|
535
|
+
var val = styleIn[key1];
|
|
536
|
+
key1 = conf2.shorthands[key1] || key1;
|
|
537
|
+
var shouldSkip = !staticConfig.isHOC && key1 in import_skipProps.skipProps && !styleProps.noSkip;
|
|
538
|
+
if (shouldSkip)
|
|
539
|
+
return key = key1, "continue";
|
|
540
|
+
(0, import_propMapper.propMapper)(key1, val, styleState, !1, function(skey, sval) {
|
|
541
|
+
skey in import_helpers.validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key1);
|
|
542
|
+
}), key = key1;
|
|
543
|
+
}, { staticConfig, conf: conf2, styleProps } = styleState, styleOut = {};
|
|
544
|
+
for (var key in styleIn) _loop(key);
|
|
573
545
|
return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
|
|
574
546
|
}, useInsertEffectCompat = import_constants.isWeb ? import_react.default.useInsertionEffect || import_constants.useIsomorphicLayoutEffect : function() {
|
|
575
547
|
}, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j) {
|