@tamagui/web 1.125.6 → 1.125.8
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/helpers/consoleLog.cjs +0 -1
- package/dist/cjs/helpers/consoleLog.js +0 -1
- package/dist/cjs/helpers/consoleLog.js.map +1 -1
- package/dist/cjs/helpers/consoleLog.native.js +6 -7
- package/dist/cjs/helpers/consoleLog.native.js.map +3 -3
- package/dist/cjs/helpers/insertStyleRule.cjs +4 -2
- package/dist/cjs/helpers/insertStyleRule.js +5 -2
- package/dist/cjs/helpers/insertStyleRule.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.native.js +5 -2
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/Tamagui.native.js +38 -46
- package/dist/esm/Tamagui.native.js.map +1 -6
- package/dist/esm/_withStableStyle.native.js +11 -9
- package/dist/esm/_withStableStyle.native.js.map +1 -6
- package/dist/esm/config.native.js +75 -74
- package/dist/esm/config.native.js.map +1 -6
- package/dist/esm/constants/accessibilityDirectMap.native.js +6 -8
- package/dist/esm/constants/accessibilityDirectMap.native.js.map +1 -6
- package/dist/esm/constants/constants.native.js +17 -19
- package/dist/esm/constants/constants.native.js.map +1 -6
- package/dist/esm/constants/isDevTools.native.js +6 -10
- package/dist/esm/constants/isDevTools.native.js.map +1 -6
- package/dist/esm/constants/webToNativeProps.native.js +84 -162
- package/dist/esm/constants/webToNativeProps.native.js.map +1 -6
- package/dist/esm/contexts/ComponentContext.native.js +3 -5
- package/dist/esm/contexts/ComponentContext.native.js.map +1 -6
- package/dist/esm/createComponent.native.js +382 -282
- package/dist/esm/createComponent.native.js.map +1 -6
- package/dist/esm/createFont.native.js +24 -41
- package/dist/esm/createFont.native.js.map +1 -6
- package/dist/esm/createShorthands.native.js +2 -4
- package/dist/esm/createShorthands.native.js.map +1 -6
- package/dist/esm/createTamagui.native.js +109 -105
- package/dist/esm/createTamagui.native.js.map +1 -6
- package/dist/esm/createTheme.native.js +3 -5
- package/dist/esm/createTheme.native.js.map +1 -6
- package/dist/esm/createTokens.native.js +3 -5
- package/dist/esm/createTokens.native.js.map +1 -6
- package/dist/esm/createVariable.native.js +29 -35
- package/dist/esm/createVariable.native.js.map +1 -6
- package/dist/esm/createVariables.native.js +34 -29
- package/dist/esm/createVariables.native.js.map +1 -6
- package/dist/esm/defaultComponentState.native.js +19 -21
- package/dist/esm/defaultComponentState.native.js.map +1 -6
- package/dist/esm/helpers/consoleLog.js +0 -1
- package/dist/esm/helpers/consoleLog.js.map +1 -1
- package/dist/esm/helpers/consoleLog.mjs +1 -1
- package/dist/esm/helpers/consoleLog.mjs.map +1 -1
- package/dist/esm/helpers/consoleLog.native.js +4 -8
- package/dist/esm/helpers/consoleLog.native.js.map +1 -6
- package/dist/esm/helpers/createMediaStyle.native.js +67 -51
- package/dist/esm/helpers/createMediaStyle.native.js.map +1 -6
- package/dist/esm/helpers/createShallowSetState.native.js +11 -25
- package/dist/esm/helpers/createShallowSetState.native.js.map +1 -6
- package/dist/esm/helpers/createStyledContext.native.js +30 -24
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -6
- package/dist/esm/helpers/defaultOffset.native.js +2 -4
- package/dist/esm/helpers/defaultOffset.native.js.map +1 -6
- package/dist/esm/helpers/expandStyle.native.js +39 -84
- package/dist/esm/helpers/expandStyle.native.js.map +1 -6
- package/dist/esm/helpers/expandStyles.native.js +15 -17
- package/dist/esm/helpers/expandStyles.native.js.map +1 -6
- package/dist/esm/helpers/getCSSStylesAtomic.native.js +7 -8
- package/dist/esm/helpers/getCSSStylesAtomic.native.js.map +1 -6
- package/dist/esm/helpers/getExpandedShorthands.native.js +4 -7
- package/dist/esm/helpers/getExpandedShorthands.native.js.map +1 -6
- package/dist/esm/helpers/getFontLanguage.native.js +3 -5
- package/dist/esm/helpers/getFontLanguage.native.js.map +1 -6
- package/dist/esm/helpers/getGroupPropParts.native.js +7 -6
- package/dist/esm/helpers/getGroupPropParts.native.js.map +1 -6
- package/dist/esm/helpers/getShorthandValue.native.js +9 -10
- package/dist/esm/helpers/getShorthandValue.native.js.map +1 -6
- package/dist/esm/helpers/getSplitStyles.native.js +295 -258
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -6
- package/dist/esm/helpers/getThemeCSSRules.native.js +1 -3
- package/dist/esm/helpers/getThemeCSSRules.native.js.map +1 -6
- package/dist/esm/helpers/getVariantExtras.native.js +33 -34
- package/dist/esm/helpers/getVariantExtras.native.js.map +1 -6
- package/dist/esm/helpers/insertStyleRule.js +5 -2
- package/dist/esm/helpers/insertStyleRule.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +4 -2
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +123 -109
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -6
- package/dist/esm/helpers/isActivePlatform.native.js +5 -7
- package/dist/esm/helpers/isActivePlatform.native.js.map +1 -6
- package/dist/esm/helpers/isActiveTheme.native.js +3 -6
- package/dist/esm/helpers/isActiveTheme.native.js.map +1 -6
- package/dist/esm/helpers/isObj.native.js +3 -5
- package/dist/esm/helpers/isObj.native.js.map +1 -6
- package/dist/esm/helpers/isTamaguiComponent.native.js +2 -4
- package/dist/esm/helpers/isTamaguiComponent.native.js.map +1 -6
- package/dist/esm/helpers/isTamaguiElement.native.js +5 -7
- package/dist/esm/helpers/isTamaguiElement.native.js.map +1 -6
- package/dist/esm/helpers/log.native.js +4 -7
- package/dist/esm/helpers/log.native.js.map +1 -6
- package/dist/esm/helpers/matchMedia.native.js +9 -14
- package/dist/esm/helpers/matchMedia.native.js.map +1 -6
- package/dist/esm/helpers/mergeProps.native.js +9 -13
- package/dist/esm/helpers/mergeProps.native.js.map +1 -6
- package/dist/esm/helpers/mergeVariants.native.js +7 -7
- package/dist/esm/helpers/mergeVariants.native.js.map +1 -6
- package/dist/esm/helpers/normalizeColor.native.js +20 -24
- package/dist/esm/helpers/normalizeColor.native.js.map +1 -6
- package/dist/esm/helpers/normalizeShadow.native.js +15 -7
- package/dist/esm/helpers/normalizeShadow.native.js.map +1 -6
- package/dist/esm/helpers/normalizeStyle.native.js +13 -12
- package/dist/esm/helpers/normalizeStyle.native.js.map +1 -6
- package/dist/esm/helpers/normalizeStylePropKeys.native.js +1 -3
- package/dist/esm/helpers/normalizeStylePropKeys.native.js.map +1 -6
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +3 -6
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -6
- package/dist/esm/helpers/objectIdentityKey.native.js +6 -11
- package/dist/esm/helpers/objectIdentityKey.native.js.map +1 -6
- package/dist/esm/helpers/propMapper.native.js +232 -212
- package/dist/esm/helpers/propMapper.native.js.map +1 -6
- package/dist/esm/helpers/proxyThemeToParents.native.js +38 -23
- package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -6
- package/dist/esm/helpers/proxyThemeVariables.native.js +3 -5
- package/dist/esm/helpers/proxyThemeVariables.native.js.map +1 -6
- package/dist/esm/helpers/pseudoDescriptors.native.js +50 -52
- package/dist/esm/helpers/pseudoDescriptors.native.js.map +1 -6
- package/dist/esm/helpers/registerCSSVariable.native.js +11 -13
- package/dist/esm/helpers/registerCSSVariable.native.js.map +1 -6
- package/dist/esm/helpers/setElementProps.native.js +3 -6
- package/dist/esm/helpers/setElementProps.native.js.map +1 -6
- package/dist/esm/helpers/skipProps.native.js +3 -5
- package/dist/esm/helpers/skipProps.native.js.map +1 -6
- package/dist/esm/helpers/sortString.native.js +3 -5
- package/dist/esm/helpers/sortString.native.js.map +1 -6
- package/dist/esm/helpers/subscribeToContextGroup.native.js +26 -18
- package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -6
- package/dist/esm/helpers/themeable.native.js +42 -33
- package/dist/esm/helpers/themeable.native.js.map +1 -6
- package/dist/esm/helpers/themes.native.js +3 -5
- package/dist/esm/helpers/themes.native.js.map +1 -6
- package/dist/esm/helpers/timer.native.js +3 -5
- package/dist/esm/helpers/timer.native.js.map +1 -6
- package/dist/esm/helpers/transformsToString.native.js +12 -14
- package/dist/esm/helpers/transformsToString.native.js.map +1 -6
- package/dist/esm/helpers/webPropsToSkip.native.js +1 -3
- package/dist/esm/helpers/webPropsToSkip.native.js.map +1 -6
- package/dist/esm/helpers/wrapStyleTags.native.js +2 -4
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -6
- package/dist/esm/hooks/doesRootSchemeMatchSystem.native.js +2 -4
- package/dist/esm/hooks/doesRootSchemeMatchSystem.native.js.map +1 -6
- package/dist/esm/hooks/getThemeProxied.native.js +50 -44
- package/dist/esm/hooks/getThemeProxied.native.js.map +1 -6
- package/dist/esm/hooks/useComponentState.native.js +67 -36
- package/dist/esm/hooks/useComponentState.native.js.map +1 -6
- package/dist/esm/hooks/useConfiguration.native.js +14 -8
- package/dist/esm/hooks/useConfiguration.native.js.map +1 -6
- package/dist/esm/hooks/useDisableSSR.native.js +3 -5
- package/dist/esm/hooks/useDisableSSR.native.js.map +1 -6
- package/dist/esm/hooks/useIsTouchDevice.native.js +3 -5
- package/dist/esm/hooks/useIsTouchDevice.native.js.map +1 -6
- package/dist/esm/hooks/useMedia.native.js +96 -100
- package/dist/esm/hooks/useMedia.native.js.map +1 -6
- package/dist/esm/hooks/useProps.native.js +44 -47
- package/dist/esm/hooks/useProps.native.js.map +1 -6
- package/dist/esm/hooks/useTheme.native.js +18 -19
- package/dist/esm/hooks/useTheme.native.js.map +1 -6
- package/dist/esm/hooks/useThemeName.native.js +12 -15
- package/dist/esm/hooks/useThemeName.native.js.map +1 -6
- package/dist/esm/hooks/useThemeState.native.js +181 -158
- package/dist/esm/hooks/useThemeState.native.js.map +1 -6
- package/dist/esm/index.native.js +64 -84
- package/dist/esm/index.native.js.map +1 -6
- package/dist/esm/inject-styles.native.js +15 -12
- package/dist/esm/inject-styles.native.js.map +1 -6
- package/dist/esm/insertFont.native.js +24 -32
- package/dist/esm/insertFont.native.js.map +1 -6
- package/dist/esm/interfaces/CSSColorNames.native.js +2 -1
- package/dist/esm/interfaces/CSSColorNames.native.js.map +1 -6
- package/dist/esm/interfaces/GetRef.native.js +2 -1
- package/dist/esm/interfaces/GetRef.native.js.map +1 -6
- package/dist/esm/interfaces/KeyTypes.native.js +2 -1
- package/dist/esm/interfaces/KeyTypes.native.js.map +1 -6
- package/dist/esm/interfaces/RNExclusiveTypes.native.js +2 -1
- package/dist/esm/interfaces/RNExclusiveTypes.native.js.map +1 -6
- package/dist/esm/interfaces/Role.native.js +2 -1
- package/dist/esm/interfaces/Role.native.js.map +1 -6
- package/dist/esm/interfaces/TamaguiComponentEvents.native.js +2 -1
- package/dist/esm/interfaces/TamaguiComponentEvents.native.js.map +1 -6
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.native.js +2 -1
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.native.js.map +1 -6
- package/dist/esm/interfaces/TamaguiComponentState.native.js +2 -1
- package/dist/esm/interfaces/TamaguiComponentState.native.js.map +1 -6
- package/dist/esm/interfaces/WebOnlyPressEvents.native.js +2 -1
- package/dist/esm/interfaces/WebOnlyPressEvents.native.js.map +1 -6
- package/dist/esm/setupHooks.native.js +2 -5
- package/dist/esm/setupHooks.native.js.map +1 -6
- package/dist/esm/setupReactNative.native.js +5 -13
- package/dist/esm/setupReactNative.native.js.map +1 -6
- package/dist/esm/styled.native.js +65 -49
- package/dist/esm/styled.native.js.map +1 -6
- package/dist/esm/type-utils.native.js +2 -1
- package/dist/esm/type-utils.native.js.map +1 -6
- package/dist/esm/types.native.js +3 -3
- package/dist/esm/types.native.js.map +1 -6
- package/dist/esm/views/Configuration.native.js +5 -7
- package/dist/esm/views/Configuration.native.js.map +1 -6
- package/dist/esm/views/FontLanguage.native.js +11 -11
- package/dist/esm/views/FontLanguage.native.js.map +1 -6
- package/dist/esm/views/FontLanguage.types.native.js +2 -1
- package/dist/esm/views/FontLanguage.types.native.js.map +1 -6
- package/dist/esm/views/Slot.native.js +33 -31
- package/dist/esm/views/Slot.native.js.map +1 -6
- package/dist/esm/views/Stack.native.js +4 -6
- package/dist/esm/views/Stack.native.js.map +1 -6
- package/dist/esm/views/TamaguiProvider.native.js +34 -33
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -6
- package/dist/esm/views/Text.native.js +27 -30
- package/dist/esm/views/Text.native.js.map +1 -6
- package/dist/esm/views/Theme.native.js +65 -50
- package/dist/esm/views/Theme.native.js.map +1 -6
- package/dist/esm/views/ThemeDebug.native.js +6 -4
- package/dist/esm/views/ThemeDebug.native.js.map +1 -6
- package/dist/esm/views/ThemeProvider.native.js +15 -17
- package/dist/esm/views/ThemeProvider.native.js.map +1 -6
- package/dist/esm/views/View.native.js +4 -6
- package/dist/esm/views/View.native.js.map +1 -6
- package/package.json +11 -11
- package/src/helpers/consoleLog.native.ts +2 -0
- package/src/helpers/consoleLog.ts +1 -1
- package/src/helpers/insertStyleRule.tsx +5 -2
|
@@ -1,82 +1,80 @@
|
|
|
1
1
|
import { isAndroid, isClient, isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
2
2
|
import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, stylePropsText, stylePropsTransform, tokenCategories, validPseudoKeys, validStyles as validStylesView } from "@tamagui/helpers";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { getConfig, getFont } from "../config";
|
|
5
|
-
import "../constants/accessibilityDirectMap";
|
|
6
|
-
import "../constants/constants";
|
|
7
|
-
import { isDevTools } from "../constants/isDevTools";
|
|
8
|
-
import { getMediaImportanceIfMoreImportant, mediaState as globalMediaState, isMediaKey, mediaKeyMatch, mediaQueryConfig } from "../hooks/useMedia";
|
|
9
|
-
import { groupCollapsed, groupEnd } from "./consoleLog";
|
|
10
|
-
import { createMediaStyle } from "./createMediaStyle";
|
|
11
|
-
import { fixStyles } from "./expandStyles";
|
|
12
|
-
import { getCSSStylesAtomic, getStyleAtomic, styleToCSS } from "./getCSSStylesAtomic";
|
|
13
|
-
import { getGroupPropParts } from "./getGroupPropParts";
|
|
14
|
-
import "./insertStyleRule";
|
|
15
|
-
import { isActivePlatform } from "./isActivePlatform";
|
|
16
|
-
import { isActiveTheme } from "./isActiveTheme";
|
|
17
|
-
import { log } from "./log";
|
|
18
|
-
import { normalizeValueWithProperty } from "./normalizeValueWithProperty";
|
|
19
|
-
import { propMapper } from "./propMapper";
|
|
20
|
-
import { pseudoDescriptors, pseudoPriorities } from "./pseudoDescriptors";
|
|
21
|
-
import { skipProps } from "./skipProps";
|
|
22
|
-
import { sortString } from "./sortString";
|
|
23
|
-
import { transformsToString } from "./transformsToString";
|
|
24
|
-
var conf,
|
|
4
|
+
import { getConfig, getFont } from "../config.native.js";
|
|
5
|
+
import "../constants/accessibilityDirectMap.native.js";
|
|
6
|
+
import "../constants/constants.native.js";
|
|
7
|
+
import { isDevTools } from "../constants/isDevTools.native.js";
|
|
8
|
+
import { getMediaImportanceIfMoreImportant, mediaState as globalMediaState, isMediaKey, mediaKeyMatch, mediaQueryConfig } from "../hooks/useMedia.native.js";
|
|
9
|
+
import { groupCollapsed, groupEnd } from "./consoleLog.native.js";
|
|
10
|
+
import { createMediaStyle } from "./createMediaStyle.native.js";
|
|
11
|
+
import { fixStyles } from "./expandStyles.native.js";
|
|
12
|
+
import { getCSSStylesAtomic, getStyleAtomic, styleToCSS } from "./getCSSStylesAtomic.native.js";
|
|
13
|
+
import { getGroupPropParts } from "./getGroupPropParts.native.js";
|
|
14
|
+
import "./insertStyleRule.native.js";
|
|
15
|
+
import { isActivePlatform } from "./isActivePlatform.native.js";
|
|
16
|
+
import { isActiveTheme } from "./isActiveTheme.native.js";
|
|
17
|
+
import { log } from "./log.native.js";
|
|
18
|
+
import { normalizeValueWithProperty } from "./normalizeValueWithProperty.native.js";
|
|
19
|
+
import { propMapper } from "./propMapper.native.js";
|
|
20
|
+
import { pseudoDescriptors, pseudoPriorities } from "./pseudoDescriptors.native.js";
|
|
21
|
+
import { skipProps } from "./skipProps.native.js";
|
|
22
|
+
import { sortString } from "./sortString.native.js";
|
|
23
|
+
import { transformsToString } from "./transformsToString.native.js";
|
|
24
|
+
var conf,
|
|
25
|
+
PROP_SPLIT = "-";
|
|
25
26
|
function isValidStyleKey(key, validStyles, accept) {
|
|
26
27
|
return key in validStyles ? !0 : accept && key in accept;
|
|
27
28
|
}
|
|
28
|
-
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) {
|
|
29
|
-
var _loop = function(keyOg2) {
|
|
30
|
-
var keyInit = keyOg2,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (process.env.NODE_ENV === "development" && debug === "profile" && time`before-prop-${keyInit}`, process.env.NODE_ENV === "test" && keyInit === "jestAnimatedStyle")
|
|
34
|
-
return "continue";
|
|
29
|
+
var getSplitStyles = function (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) {
|
|
30
|
+
var _loop = function (keyOg2) {
|
|
31
|
+
var keyInit = keyOg2,
|
|
32
|
+
valInit = props[keyInit];
|
|
33
|
+
if (keyInit === "children") return viewProps[keyInit] = valInit, "continue";
|
|
34
|
+
if (process.env.NODE_ENV === "development" && debug === "profile" && time`before-prop-${keyInit}`, process.env.NODE_ENV === "test" && keyInit === "jestAnimatedStyle") return "continue";
|
|
35
35
|
if (accept) {
|
|
36
36
|
var accepted = accept[keyInit];
|
|
37
|
-
if ((accepted === "style" || accepted === "textStyle") && valInit && typeof valInit == "object")
|
|
38
|
-
return viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass), "continue";
|
|
37
|
+
if ((accepted === "style" || accepted === "textStyle") && valInit && typeof valInit == "object") return viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass), "continue";
|
|
39
38
|
}
|
|
40
39
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && groupEnd(), disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys) return "continue";
|
|
41
40
|
if (keyInit in skipProps && !noSkip && !isHOC) {
|
|
42
|
-
if (keyInit === "group" && 0)
|
|
43
|
-
var identifier2, containerType, containerCSS;
|
|
41
|
+
if (keyInit === "group" && 0) var identifier2, containerType, containerCSS;
|
|
44
42
|
return "continue";
|
|
45
43
|
}
|
|
46
|
-
var valInitType = typeof valInit,
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
var valInitType = typeof valInit,
|
|
45
|
+
isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles, accept);
|
|
46
|
+
if (0 && staticConfig.isReactNative && keyInit.startsWith("data-")) var _viewProps2, _dataSet;
|
|
49
47
|
if (!isValidStyleKeyInit) {
|
|
50
|
-
if (!isAndroid && keyInit === "elevationAndroid")
|
|
51
|
-
|
|
52
|
-
if (keyInit === "userSelect")
|
|
53
|
-
keyInit = "selectable", valInit = valInit !== "none";
|
|
54
|
-
else if (keyInit.startsWith("data-"))
|
|
55
|
-
return "continue";
|
|
48
|
+
if (!isAndroid && keyInit === "elevationAndroid") return "continue";
|
|
49
|
+
if (keyInit === "userSelect") keyInit = "selectable", valInit = valInit !== "none";else if (keyInit.startsWith("data-")) return "continue";
|
|
56
50
|
}
|
|
57
51
|
if (keyInit === "dataSet") {
|
|
58
|
-
for (var keyInit1 in valInit)
|
|
59
|
-
viewProps[`data-${hyphenate(keyInit1)}`] = valInit[keyInit1];
|
|
52
|
+
for (var keyInit1 in valInit) viewProps[`data-${hyphenate(keyInit1)}`] = valInit[keyInit1];
|
|
60
53
|
return "continue";
|
|
61
54
|
}
|
|
62
|
-
if (0 && !noExpand)
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
if (0 && !noExpand) var didUseKeyInit;
|
|
56
|
+
var isVariant = !isValidStyleKeyInit && variants && keyInit in variants,
|
|
57
|
+
isStyleLikeKey = isValidStyleKeyInit || isVariant,
|
|
58
|
+
isPseudo = keyInit in validPseudoKeys,
|
|
59
|
+
isMedia = !isStyleLikeKey && !isPseudo && isMediaKey(keyInit),
|
|
60
|
+
isMediaOrPseudo = !!(isMedia || isPseudo);
|
|
65
61
|
if (isMediaOrPseudo && keyInit.startsWith("$group-")) {
|
|
66
62
|
var parts = keyInit.split("-");
|
|
67
63
|
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
) {
|
|
64
|
+
// check if its actually a simple group selector to avoid breaking selectors
|
|
65
|
+
parts.length === 2 || parts.length === 3 && pseudoPriorities[parts[parts.length - 1]]) {
|
|
71
66
|
var name2 = parts[1];
|
|
72
67
|
context?.groups.subscribe && !context?.groups.state[name2] && (keyInit = keyInit.replace("$group-", "$group-true-"));
|
|
73
68
|
}
|
|
74
69
|
}
|
|
75
70
|
var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo || isVariant && !noExpand;
|
|
76
|
-
if (isStyleProp && (asChild === "except-style" || asChild === "except-style-web"))
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
if (isStyleProp && (asChild === "except-style" || asChild === "except-style-web")) return "continue";
|
|
72
|
+
var shouldPassProp = !isStyleProp && isHOC ||
|
|
73
|
+
// is in parent variants
|
|
74
|
+
isHOC && parentVariants && keyInit in parentVariants || inlineProps?.has(keyInit),
|
|
75
|
+
parentVariant = parentVariants?.[keyInit],
|
|
76
|
+
isHOCShouldPassThrough = !!(isHOC && (isValidStyleKeyInit || isMediaOrPseudo || parentVariant || keyInit in skipProps)),
|
|
77
|
+
shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
80
78
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && (groupEnd(), groupEnd(), groupCollapsed(` \u{1F511} ${keyOg2}${keyInit !== keyOg2 ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`), log({
|
|
81
79
|
isVariant,
|
|
82
80
|
valInit,
|
|
@@ -87,11 +85,10 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
87
85
|
isVariant,
|
|
88
86
|
isHOCShouldPassThrough,
|
|
89
87
|
parentStaticConfig
|
|
90
|
-
})), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo), !isVariant) || !noSkip && keyInit in skipProps)
|
|
91
|
-
return "continue";
|
|
88
|
+
})), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo), !isVariant) || !noSkip && keyInit in skipProps) return "continue";
|
|
92
89
|
(isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
|
|
93
90
|
var disablePropMap = isMediaOrPseudo || !isStyleLikeKey;
|
|
94
|
-
if (propMapper(keyInit, valInit, styleState, disablePropMap, function(key4, val2) {
|
|
91
|
+
if (propMapper(keyInit, valInit, styleState, disablePropMap, function (key4, val2) {
|
|
95
92
|
var _parentStaticConfig_variants;
|
|
96
93
|
if (!isHOC && disablePropMap && !isMediaOrPseudo) {
|
|
97
94
|
viewProps[key4] = val2;
|
|
@@ -130,16 +127,20 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
130
127
|
return;
|
|
131
128
|
}
|
|
132
129
|
}
|
|
133
|
-
var descriptor = pseudoDescriptors[key4],
|
|
134
|
-
|
|
135
|
-
|
|
130
|
+
var descriptor = pseudoDescriptors[key4],
|
|
131
|
+
isEnter = key4 === "enterStyle",
|
|
132
|
+
isExit = key4 === "exitStyle";
|
|
133
|
+
if (!descriptor) return;
|
|
136
134
|
if (shouldDoClasses && !isExit) {
|
|
137
135
|
var pseudoStyles = getStyleAtomic(pseudoStyleObject, descriptor);
|
|
138
136
|
process.env.NODE_ENV === "development" && debug === "verbose" && console.info("pseudo:", key4, pseudoStyleObject, pseudoStyles);
|
|
139
|
-
var _iteratorNormalCompletion2 = !0,
|
|
137
|
+
var _iteratorNormalCompletion2 = !0,
|
|
138
|
+
_didIteratorError2 = !1,
|
|
139
|
+
_iteratorError2 = void 0;
|
|
140
140
|
try {
|
|
141
141
|
for (var _iterator2 = pseudoStyles[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
|
|
142
|
-
var psuedoStyle = _step2.value,
|
|
142
|
+
var psuedoStyle = _step2.value,
|
|
143
|
+
fullKey = `${psuedoStyle[StyleObjectProperty]}${PROP_SPLIT}${descriptor.name}`;
|
|
143
144
|
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), classNames[fullKey] = psuedoStyle[StyleObjectIdentifier]);
|
|
144
145
|
}
|
|
145
146
|
} catch (err) {
|
|
@@ -148,13 +149,13 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
148
149
|
try {
|
|
149
150
|
!_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
|
|
150
151
|
} finally {
|
|
151
|
-
if (_didIteratorError2)
|
|
152
|
-
throw _iteratorError2;
|
|
152
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
if (!shouldDoClasses || isExit || isEnter) {
|
|
157
|
-
var descriptorKey = descriptor.stateKey || descriptor.name,
|
|
157
|
+
var descriptorKey = descriptor.stateKey || descriptor.name,
|
|
158
|
+
isDisabled = componentState[descriptorKey] === !1;
|
|
158
159
|
isExit && (isDisabled = !styleProps.isExiting), isEnter && componentState.unmounted === !1 && (isDisabled = !0), process.env.NODE_ENV === "development" && debug === "verbose" && (groupCollapsed("pseudo", key4, {
|
|
159
160
|
isDisabled
|
|
160
161
|
}), log({
|
|
@@ -166,10 +167,9 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
166
167
|
var importance = descriptor.priority;
|
|
167
168
|
for (var pkey in pseudoStyleObject) {
|
|
168
169
|
var _$val = pseudoStyleObject[pkey];
|
|
169
|
-
if (isDisabled)
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
var curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
|
|
170
|
+
if (isDisabled) applyDefaultStyle(pkey, styleState);else {
|
|
171
|
+
var curImportance = usedKeys[pkey] || 0,
|
|
172
|
+
shouldMerge = importance >= curImportance;
|
|
173
173
|
if (shouldMerge) {
|
|
174
174
|
if (process.env.IS_STATIC === "is_static") {
|
|
175
175
|
var _pseudos1, _key1;
|
|
@@ -185,19 +185,18 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
if (!isDisabled)
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
188
|
+
if (!isDisabled) for (var _$key in val2) {
|
|
189
|
+
var k = shorthands[_$key] || _$key;
|
|
190
|
+
usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
|
|
191
|
+
}
|
|
193
192
|
}
|
|
194
193
|
return;
|
|
195
194
|
}
|
|
196
195
|
if (isMedia) {
|
|
197
196
|
if (!val2) return;
|
|
198
|
-
var hasSpace = val2.space,
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
var hasSpace = val2.space,
|
|
198
|
+
mediaKeyShort = key4.slice(isMedia == "theme" ? 7 : 1);
|
|
199
|
+
if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && ((!hasMedia || typeof hasMedia == "boolean") && (hasMedia = /* @__PURE__ */new Set()), hasMedia.add(mediaKeyShort)), isMedia === "platform" && !isActivePlatform(key4)) return;
|
|
201
200
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && log(` \u{1F4FA} ${key4}`, {
|
|
202
201
|
key: key4,
|
|
203
202
|
val: val2,
|
|
@@ -212,16 +211,22 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
212
211
|
var importance1 = getMediaImportanceIfMoreImportant(mediaKeyShort, "space", usedKeys, !0);
|
|
213
212
|
importance1 && (space = val2.space, usedKeys.space = importance1, process.env.NODE_ENV === "development" && debug === "verbose" && log(`Found more important space for current media ${mediaKeyShort}: ${val2} (importance: ${importance1})`));
|
|
214
213
|
}
|
|
215
|
-
var mediaStyles = getCSSStylesAtomic(mediaStyle),
|
|
214
|
+
var mediaStyles = getCSSStylesAtomic(mediaStyle),
|
|
215
|
+
priority = mediaStylesSeen;
|
|
216
216
|
mediaStylesSeen += 1;
|
|
217
|
-
var _iteratorNormalCompletion12 = !0,
|
|
217
|
+
var _iteratorNormalCompletion12 = !0,
|
|
218
|
+
_didIteratorError12 = !1,
|
|
219
|
+
_iteratorError12 = void 0;
|
|
218
220
|
try {
|
|
219
221
|
for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = !0) {
|
|
220
|
-
var style3 = _step12.value,
|
|
222
|
+
var style3 = _step12.value,
|
|
223
|
+
property = style3[StyleObjectProperty],
|
|
224
|
+
isSubStyle = property[0] === "$";
|
|
221
225
|
if (!(isSubStyle && !isActivePlatform(property))) {
|
|
222
226
|
var out = createMediaStyle(style3, mediaKeyShort, mediaQueryConfig, isMedia, !1, priority);
|
|
223
227
|
process.env.NODE_ENV === "development" && debug === "verbose" && log("\u{1F4FA} media style:", out);
|
|
224
|
-
var subKey = isSubStyle ? style3[2] : "",
|
|
228
|
+
var subKey = isSubStyle ? style3[2] : "",
|
|
229
|
+
fullKey1 = `${style3[StyleObjectProperty]}${subKey}${PROP_SPLIT}${mediaKeyShort}${style3[StyleObjectPseudo] || ""}`;
|
|
225
230
|
fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), classNames[fullKey1] = out[StyleObjectIdentifier]);
|
|
226
231
|
}
|
|
227
232
|
}
|
|
@@ -231,18 +236,20 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
231
236
|
try {
|
|
232
237
|
!_iteratorNormalCompletion12 && _iterator12.return != null && _iterator12.return();
|
|
233
238
|
} finally {
|
|
234
|
-
if (_didIteratorError12)
|
|
235
|
-
throw _iteratorError12;
|
|
239
|
+
if (_didIteratorError12) throw _iteratorError12;
|
|
236
240
|
}
|
|
237
241
|
}
|
|
238
242
|
} else {
|
|
239
|
-
let mergeMediaStyle2 = function(key5, val3) {
|
|
243
|
+
let mergeMediaStyle2 = function (key5, val3) {
|
|
240
244
|
var _styleState3;
|
|
241
245
|
(_styleState3 = styleState).style || (_styleState3.style = {});
|
|
242
246
|
var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, usedKeys, mediaState[mediaKeyShort], importanceBump, debug);
|
|
243
247
|
didMerge && key5 === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
|
|
244
248
|
};
|
|
245
|
-
var mergeMediaStyle = mergeMediaStyle2,
|
|
249
|
+
var mergeMediaStyle = mergeMediaStyle2,
|
|
250
|
+
isThemeMedia = isMedia === "theme",
|
|
251
|
+
isGroupMedia = isMedia === "group",
|
|
252
|
+
isPlatformMedia = isMedia === "platform";
|
|
246
253
|
if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
|
|
247
254
|
if (!mediaState[mediaKeyShort]) {
|
|
248
255
|
process.env.NODE_ENV === "development" && debug === "verbose" && log(` \u{1F4FA} \u274C DISABLED ${mediaKeyShort}`);
|
|
@@ -250,34 +257,41 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
250
257
|
}
|
|
251
258
|
process.env.NODE_ENV === "development" && debug === "verbose" && log(` \u{1F4FA} \u2705 ENABLED ${mediaKeyShort}`);
|
|
252
259
|
}
|
|
253
|
-
var mediaStyle1 = getSubStyle(styleState, key4, val2, !0),
|
|
260
|
+
var mediaStyle1 = getSubStyle(styleState, key4, val2, !0),
|
|
261
|
+
importanceBump = 0;
|
|
254
262
|
if (isThemeMedia) {
|
|
255
|
-
if (dynamicThemeAccess = !0, !(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort)))
|
|
256
|
-
return;
|
|
263
|
+
if (dynamicThemeAccess = !0, !(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort))) return;
|
|
257
264
|
} else if (isGroupMedia) {
|
|
258
|
-
var _componentState_group,
|
|
265
|
+
var _componentState_group,
|
|
266
|
+
groupInfo = getGroupPropParts(mediaKeyShort),
|
|
267
|
+
groupName = groupInfo.name,
|
|
268
|
+
groupContext = context?.groups.state[groupName];
|
|
259
269
|
if (!groupContext) {
|
|
260
270
|
process.env.NODE_ENV === "development" && debug && log(`No parent with group prop, skipping styles: ${groupName}`);
|
|
261
271
|
return;
|
|
262
272
|
}
|
|
263
|
-
var groupPseudoKey = groupInfo.pseudo,
|
|
273
|
+
var groupPseudoKey = groupInfo.pseudo,
|
|
274
|
+
groupMediaKey = groupInfo.media,
|
|
275
|
+
componentGroupState = (_componentState_group = componentState.group) === null || _componentState_group === void 0 ? void 0 : _componentState_group[groupName];
|
|
264
276
|
if (groupMediaKey) {
|
|
265
|
-
mediaGroups || (mediaGroups = /* @__PURE__ */
|
|
266
|
-
var mediaState1 = componentGroupState?.media,
|
|
277
|
+
mediaGroups || (mediaGroups = /* @__PURE__ */new Set()), mediaGroups.add(groupMediaKey);
|
|
278
|
+
var mediaState1 = componentGroupState?.media,
|
|
279
|
+
isActive = mediaState1?.[groupMediaKey];
|
|
267
280
|
if (!mediaState1 && groupContext.layout && (isActive = mediaKeyMatch(groupMediaKey, groupContext.layout)), process.env.NODE_ENV === "development" && debug === "verbose" && log(` \u{1F3D8}\uFE0F GROUP media ${groupMediaKey} active? ${isActive}`), !isActive) {
|
|
268
|
-
for (var pkey1 in mediaStyle1)
|
|
269
|
-
applyDefaultStyle(pkey1, styleState);
|
|
281
|
+
for (var pkey1 in mediaStyle1) applyDefaultStyle(pkey1, styleState);
|
|
270
282
|
return;
|
|
271
283
|
}
|
|
272
284
|
importanceBump = 2;
|
|
273
285
|
}
|
|
274
286
|
if (groupPseudoKey) {
|
|
275
|
-
pseudoGroups || (pseudoGroups = /* @__PURE__ */
|
|
276
|
-
var componentGroupPseudoState = (componentGroupState ||
|
|
277
|
-
|
|
287
|
+
pseudoGroups || (pseudoGroups = /* @__PURE__ */new Set()), pseudoGroups.add(groupName);
|
|
288
|
+
var componentGroupPseudoState = (componentGroupState ||
|
|
289
|
+
// fallback to context initially
|
|
290
|
+
context.groups.state[groupName]).pseudo,
|
|
291
|
+
isActive1 = componentGroupPseudoState?.[groupPseudoKey],
|
|
292
|
+
priority1 = pseudoPriorities[groupPseudoKey];
|
|
278
293
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && log(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}`), !isActive1) {
|
|
279
|
-
for (var pkey2 in mediaStyle1)
|
|
280
|
-
applyDefaultStyle(pkey2, styleState);
|
|
294
|
+
for (var pkey2 in mediaStyle1) applyDefaultStyle(pkey2, styleState);
|
|
281
295
|
return;
|
|
282
296
|
}
|
|
283
297
|
importanceBump = priority1;
|
|
@@ -290,17 +304,14 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
290
304
|
}
|
|
291
305
|
if (subKey1[0] === "$") {
|
|
292
306
|
if (!isActivePlatform(subKey1) || !isActiveTheme(subKey1, themeName)) continue;
|
|
293
|
-
for (var subSubKey in mediaStyle1[subKey1])
|
|
294
|
-
|
|
295
|
-
} else
|
|
296
|
-
mergeMediaStyle2(subKey1, mediaStyle1[subKey1]);
|
|
307
|
+
for (var subSubKey in mediaStyle1[subKey1]) mergeMediaStyle2(subSubKey, mediaStyle1[subKey1][subSubKey]);
|
|
308
|
+
} else mergeMediaStyle2(subKey1, mediaStyle1[subKey1]);
|
|
297
309
|
}
|
|
298
310
|
}
|
|
299
311
|
return;
|
|
300
312
|
}
|
|
301
313
|
if (!isVariant) {
|
|
302
|
-
if (styleProps.styledContextProps && key4 in styleProps.styledContextProps)
|
|
303
|
-
return;
|
|
314
|
+
if (styleProps.styledContextProps && key4 in styleProps.styledContextProps) return;
|
|
304
315
|
viewProps[key4] = val2;
|
|
305
316
|
}
|
|
306
317
|
}
|
|
@@ -311,13 +322,40 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
311
322
|
}), log("viewProps", {
|
|
312
323
|
...viewProps
|
|
313
324
|
});
|
|
314
|
-
} catch {
|
|
315
|
-
}
|
|
325
|
+
} catch {}
|
|
316
326
|
groupEnd();
|
|
317
327
|
}
|
|
318
328
|
};
|
|
319
329
|
conf = conf || getConfig(), isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
320
|
-
var {
|
|
330
|
+
var {
|
|
331
|
+
shorthands
|
|
332
|
+
} = conf,
|
|
333
|
+
{
|
|
334
|
+
isHOC,
|
|
335
|
+
isText,
|
|
336
|
+
isInput,
|
|
337
|
+
variants,
|
|
338
|
+
isReactNative,
|
|
339
|
+
inlineProps,
|
|
340
|
+
inlineWhenUnflattened,
|
|
341
|
+
parentStaticConfig,
|
|
342
|
+
acceptsClassName
|
|
343
|
+
} = staticConfig,
|
|
344
|
+
viewProps = {},
|
|
345
|
+
mediaState = styleProps.mediaState || globalMediaState,
|
|
346
|
+
usedKeys = {},
|
|
347
|
+
shouldDoClasses = acceptsClassName && isWeb && !styleProps.noClass,
|
|
348
|
+
rulesToInsert = void 0,
|
|
349
|
+
classNames = {},
|
|
350
|
+
pseudos = null,
|
|
351
|
+
space = props.space,
|
|
352
|
+
hasMedia = !1,
|
|
353
|
+
dynamicThemeAccess,
|
|
354
|
+
pseudoGroups,
|
|
355
|
+
mediaGroups,
|
|
356
|
+
className = props.className || "",
|
|
357
|
+
mediaStylesSeen = 0,
|
|
358
|
+
validStyles = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? stylePropsText : validStylesView);
|
|
321
359
|
process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-setup`;
|
|
322
360
|
var styleState = {
|
|
323
361
|
classNames,
|
|
@@ -334,7 +372,9 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
334
372
|
debug
|
|
335
373
|
};
|
|
336
374
|
if (process.env.IS_STATIC === "is_static") {
|
|
337
|
-
var {
|
|
375
|
+
var {
|
|
376
|
+
fallbackProps
|
|
377
|
+
} = styleProps;
|
|
338
378
|
fallbackProps && (styleState.props = new Proxy(props, {
|
|
339
379
|
get(_, key4, val2) {
|
|
340
380
|
return Reflect.has(props, key4) ? Reflect.get(props, key4) : Reflect.get(fallbackProps, key4);
|
|
@@ -353,7 +393,21 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
353
393
|
...theme
|
|
354
394
|
}
|
|
355
395
|
}), groupEnd());
|
|
356
|
-
var {
|
|
396
|
+
var {
|
|
397
|
+
asChild
|
|
398
|
+
} = props,
|
|
399
|
+
{
|
|
400
|
+
accept
|
|
401
|
+
} = staticConfig,
|
|
402
|
+
{
|
|
403
|
+
noSkip,
|
|
404
|
+
disableExpandShorthands,
|
|
405
|
+
noExpand
|
|
406
|
+
} = styleProps,
|
|
407
|
+
{
|
|
408
|
+
webContainerType
|
|
409
|
+
} = conf.settings,
|
|
410
|
+
parentVariants = parentStaticConfig?.variants;
|
|
357
411
|
for (var keyOg in props) _loop(keyOg);
|
|
358
412
|
process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-propsend`;
|
|
359
413
|
var avoidNormalize = styleProps.noNormalize === !1;
|
|
@@ -363,75 +417,63 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
363
417
|
(_styleState = styleState).style || (_styleState.style = {}), mergeFlatTransforms(styleState.style, styleState.flatTransforms);
|
|
364
418
|
}
|
|
365
419
|
if (parentSplitStyles) {
|
|
366
|
-
if (0 && shouldDoClasses)
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
var _styleState1;
|
|
372
|
-
key1 in classNames || styleState.style && key1 in styleState.style || ((_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key1] = parentSplitStyles.style[key1]);
|
|
373
|
-
}
|
|
420
|
+
if (0 && shouldDoClasses) for (var key in parentSplitStyles.classNames) var val;
|
|
421
|
+
if (!shouldDoClasses) for (var key1 in parentSplitStyles.style) {
|
|
422
|
+
var _styleState1;
|
|
423
|
+
key1 in classNames || styleState.style && key1 in styleState.style || ((_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key1] = parentSplitStyles.style[key1]);
|
|
424
|
+
}
|
|
374
425
|
}
|
|
375
426
|
}
|
|
376
|
-
if (0)
|
|
377
|
-
var _styleState_style, shouldStringifyTransforms;
|
|
427
|
+
if (0) var _styleState_style, shouldStringifyTransforms;
|
|
378
428
|
if (0) {
|
|
379
429
|
if (!styleProps.noMergeStyle && styleState.style && shouldDoClasses) {
|
|
380
430
|
var retainedStyles, shouldRetain;
|
|
381
431
|
if (!styleState.style.$$css) {
|
|
382
432
|
var atomic, _iteratorNormalCompletion, _didIteratorError, _iteratorError;
|
|
383
433
|
try {
|
|
384
|
-
for (var _iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)
|
|
385
|
-
|
|
386
|
-
} catch (err) {
|
|
387
|
-
} finally {
|
|
388
|
-
}
|
|
434
|
+
for (var _iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) var atomicStyle, _props_animateOnly, _props_animateOnly1, key2, value, identifier, isAnimatedAndAnimateOnly, nonAnimatedAnimateOnly;
|
|
435
|
+
} catch (err) {} finally {}
|
|
389
436
|
}
|
|
390
437
|
}
|
|
391
438
|
if (isReactNative) {
|
|
392
|
-
if (viewProps.tabIndex === 0)
|
|
393
|
-
|
|
394
|
-
} else if (viewProps.tabIndex == null)
|
|
395
|
-
var _viewProps_focusable, isFocusable, role;
|
|
439
|
+
if (viewProps.tabIndex === 0) var _viewProps, _accessible;
|
|
440
|
+
} else if (viewProps.tabIndex == null) var _viewProps_focusable, isFocusable, role;
|
|
396
441
|
}
|
|
397
442
|
var styleProp = props.style;
|
|
398
|
-
if (!styleProps.noMergeStyle && styleProp)
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
if (style.$$css)
|
|
406
|
-
Object.assign(styleState.classNames, style);
|
|
407
|
-
else {
|
|
408
|
-
var _styleState2;
|
|
409
|
-
(_styleState2 = styleState).style || (_styleState2.style = {}), Object.assign(styleState.style, normalizeStyle(style));
|
|
410
|
-
}
|
|
411
|
-
}
|
|
443
|
+
if (!styleProps.noMergeStyle && styleProp) if (isHOC) viewProps.style = normalizeStyle(styleProp);else for (var isArray = Array.isArray(styleProp), len = isArray ? styleProp.length : 1, i = 0; i < len; i++) {
|
|
444
|
+
var style = isArray ? styleProp[i] : styleProp;
|
|
445
|
+
if (style) if (style.$$css) Object.assign(styleState.classNames, style);else {
|
|
446
|
+
var _styleState2;
|
|
447
|
+
(_styleState2 = styleState).style || (_styleState2.style = {}), Object.assign(styleState.style, normalizeStyle(style));
|
|
448
|
+
}
|
|
449
|
+
}
|
|
412
450
|
var style1 = styleState.style;
|
|
413
451
|
if (style1?.fontFamily) {
|
|
414
|
-
var _getFont,
|
|
452
|
+
var _getFont,
|
|
453
|
+
faceInfo = (_getFont = getFont(style1.fontFamily)) === null || _getFont === void 0 ? void 0 : _getFont.face;
|
|
415
454
|
if (faceInfo) {
|
|
416
|
-
var _faceInfo_style_fontWeight_,
|
|
455
|
+
var _faceInfo_style_fontWeight_,
|
|
456
|
+
_faceInfo_style_fontWeight,
|
|
457
|
+
overrideFace = (_faceInfo_style_fontWeight = faceInfo[style1.fontWeight]) === null || _faceInfo_style_fontWeight === void 0 || (_faceInfo_style_fontWeight_ = _faceInfo_style_fontWeight[style1.fontStyle || "normal"]) === null || _faceInfo_style_fontWeight_ === void 0 ? void 0 : _faceInfo_style_fontWeight_.val;
|
|
417
458
|
overrideFace && (style1.fontFamily = overrideFace, styleState.fontFamily = overrideFace, delete style1.fontWeight, delete style1.fontStyle);
|
|
418
459
|
}
|
|
419
460
|
process.env.NODE_ENV === "development" && debug && debug !== "profile" && log(`Found fontFamily native: ${style1.fontFamily}`, faceInfo);
|
|
420
461
|
}
|
|
421
462
|
process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-pre-result`;
|
|
422
463
|
var result = {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
464
|
+
space,
|
|
465
|
+
hasMedia,
|
|
466
|
+
fontFamily: styleState.fontFamily,
|
|
467
|
+
viewProps,
|
|
468
|
+
style: styleState.style,
|
|
469
|
+
pseudos,
|
|
470
|
+
classNames,
|
|
471
|
+
rulesToInsert,
|
|
472
|
+
dynamicThemeAccess,
|
|
473
|
+
pseudoGroups,
|
|
474
|
+
mediaGroups
|
|
475
|
+
},
|
|
476
|
+
asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
|
|
435
477
|
if (!styleProps.noMergeStyle && !asChildExceptStyleLike) {
|
|
436
478
|
var style2 = styleState.style;
|
|
437
479
|
if (0) {
|
|
@@ -440,15 +482,11 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
440
482
|
if (isReactNative) {
|
|
441
483
|
var cnStyles, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1;
|
|
442
484
|
try {
|
|
443
|
-
for (var _iterator1, _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0)
|
|
444
|
-
|
|
445
|
-
} catch (err) {
|
|
446
|
-
} finally {
|
|
447
|
-
}
|
|
485
|
+
for (var _iterator1, _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) var name;
|
|
486
|
+
} catch (err) {} finally {}
|
|
448
487
|
}
|
|
449
488
|
}
|
|
450
|
-
} else
|
|
451
|
-
style2 && (viewProps.style = style2);
|
|
489
|
+
} else style2 && (viewProps.style = style2);
|
|
452
490
|
}
|
|
453
491
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && isDevTools) {
|
|
454
492
|
groupCollapsed("\u{1F539} getSplitStyles ===>");
|
|
@@ -461,107 +499,114 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
461
499
|
rulesToInsert,
|
|
462
500
|
parentSplitStyles
|
|
463
501
|
};
|
|
464
|
-
for (var key3 in logs)
|
|
465
|
-
|
|
466
|
-
} catch {
|
|
467
|
-
}
|
|
502
|
+
for (var key3 in logs) log(key3, logs[key3]);
|
|
503
|
+
} catch {}
|
|
468
504
|
groupEnd();
|
|
469
505
|
}
|
|
470
506
|
return process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-done`, result;
|
|
471
507
|
};
|
|
472
508
|
function mergeFlatTransforms(target, flatTransforms) {
|
|
473
|
-
Object.entries(flatTransforms).sort(function(param, param1) {
|
|
474
|
-
var [a] = param,
|
|
509
|
+
Object.entries(flatTransforms).sort(function (param, param1) {
|
|
510
|
+
var [a] = param,
|
|
511
|
+
[b] = param1;
|
|
475
512
|
return sortString(a, b);
|
|
476
|
-
}).forEach(function(param) {
|
|
513
|
+
}).forEach(function (param) {
|
|
477
514
|
var [key, val] = param;
|
|
478
515
|
mergeTransform(target, key, val, !0);
|
|
479
516
|
});
|
|
480
517
|
}
|
|
481
518
|
function mergeStyle(styleState, key, val) {
|
|
482
|
-
var disableNormalize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1,
|
|
519
|
+
var disableNormalize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1,
|
|
520
|
+
{
|
|
521
|
+
viewProps,
|
|
522
|
+
styleProps,
|
|
523
|
+
staticConfig
|
|
524
|
+
} = styleState;
|
|
483
525
|
if (key in stylePropsTransform) {
|
|
484
526
|
var _styleState;
|
|
485
527
|
(_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), styleState.flatTransforms[key] = val;
|
|
486
528
|
} else {
|
|
487
|
-
var shouldNormalize = isWeb && !disableNormalize && !styleProps.noNormalize,
|
|
529
|
+
var shouldNormalize = isWeb && !disableNormalize && !styleProps.noNormalize,
|
|
530
|
+
out = shouldNormalize ? normalizeValueWithProperty(val, key) : val;
|
|
488
531
|
if (
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
)
|
|
492
|
-
viewProps[key] = out;
|
|
493
|
-
else {
|
|
532
|
+
// accept is for props not styles
|
|
533
|
+
staticConfig.accept && key in staticConfig.accept) viewProps[key] = out;else {
|
|
494
534
|
var _styleState1;
|
|
495
|
-
(_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key] =
|
|
535
|
+
(_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key] =
|
|
536
|
+
// if you dont do this you'll be passing props.transform arrays directly here and then mutating them
|
|
496
537
|
// if theres any flatTransforms later, causing issues (mutating props is bad, in strict mode styles get borked)
|
|
497
|
-
key === "transform" && Array.isArray(out) ? [
|
|
498
|
-
...out
|
|
499
|
-
] : out;
|
|
538
|
+
key === "transform" && Array.isArray(out) ? [...out] : out;
|
|
500
539
|
}
|
|
501
540
|
}
|
|
502
541
|
}
|
|
503
|
-
var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
542
|
+
var getSubStyle = function (styleState, subKey, styleIn, avoidMergeTransform) {
|
|
543
|
+
var _loop = function (key1) {
|
|
544
|
+
var val = styleIn[key1];
|
|
545
|
+
key1 = conf2.shorthands[key1] || key1;
|
|
546
|
+
var shouldSkip = !staticConfig.isHOC && key1 in skipProps && !styleProps.noSkip;
|
|
547
|
+
if (shouldSkip) return key = key1, "continue";
|
|
548
|
+
propMapper(key1, val, styleState, !1, function (skey, sval) {
|
|
549
|
+
skey in validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : normalizeValueWithProperty(sval, key1);
|
|
550
|
+
}), key = key1;
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
staticConfig,
|
|
554
|
+
conf: conf2,
|
|
555
|
+
styleProps
|
|
556
|
+
} = styleState,
|
|
557
|
+
styleOut = {};
|
|
558
|
+
for (var key in styleIn) _loop(key);
|
|
559
|
+
if (!avoidMergeTransform) {
|
|
560
|
+
if (Array.isArray(styleOut.transform)) {
|
|
561
|
+
var _styleState_style,
|
|
562
|
+
parentTransform = (_styleState_style = styleState.style) === null || _styleState_style === void 0 ? void 0 : _styleState_style.transform;
|
|
563
|
+
parentTransform && (styleOut.transform = [...parentTransform, ...styleOut.transform]);
|
|
564
|
+
}
|
|
565
|
+
styleState.flatTransforms && mergeFlatTransforms(styleOut, styleState.flatTransforms);
|
|
522
566
|
}
|
|
523
|
-
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
};
|
|
567
|
+
return styleProps.noNormalize || fixStyles(styleOut), styleOut;
|
|
568
|
+
},
|
|
569
|
+
useInsertEffectCompat = isWeb ? React.useInsertionEffect || useIsomorphicLayoutEffect : function () {},
|
|
570
|
+
useSplitStyles = function (a, b, c, d, e, f, g, h, i, j) {
|
|
571
|
+
conf = conf || getConfig();
|
|
572
|
+
var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j);
|
|
573
|
+
return res;
|
|
574
|
+
};
|
|
532
575
|
function addStyleToInsertRules(rulesToInsert, styleObject) {
|
|
533
|
-
if (0)
|
|
534
|
-
var identifier;
|
|
576
|
+
if (0) var identifier;
|
|
535
577
|
}
|
|
536
|
-
var defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)",
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
k,
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
},
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
578
|
+
var defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)",
|
|
579
|
+
animatableDefaults = {
|
|
580
|
+
...Object.fromEntries(Object.entries(tokenCategories.color).map(function (param) {
|
|
581
|
+
var [k, v] = param;
|
|
582
|
+
return [k, defaultColor];
|
|
583
|
+
})),
|
|
584
|
+
opacity: 1,
|
|
585
|
+
scale: 1,
|
|
586
|
+
rotate: "0deg",
|
|
587
|
+
rotateY: "0deg",
|
|
588
|
+
rotateX: "0deg",
|
|
589
|
+
x: 0,
|
|
590
|
+
y: 0,
|
|
591
|
+
borderRadius: 0
|
|
592
|
+
},
|
|
593
|
+
lowercaseHyphenate = function (match) {
|
|
594
|
+
return `-${match.toLowerCase()}`;
|
|
595
|
+
},
|
|
596
|
+
hyphenate = function (str) {
|
|
597
|
+
return str.replace(/[A-Z]/g, lowercaseHyphenate);
|
|
598
|
+
},
|
|
599
|
+
mergeTransform = function (obj, key, val) {
|
|
600
|
+
var backwards = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1,
|
|
601
|
+
_obj;
|
|
602
|
+
typeof obj.transform != "string" && ((_obj = obj).transform || (_obj.transform = []), obj.transform[backwards ? "unshift" : "push"]({
|
|
603
|
+
[mapTransformKeys[key] || key]: val
|
|
604
|
+
}));
|
|
605
|
+
},
|
|
606
|
+
mapTransformKeys = {
|
|
607
|
+
x: "translateX",
|
|
608
|
+
y: "translateY"
|
|
609
|
+
};
|
|
565
610
|
function passDownProp(viewProps, key, val) {
|
|
566
611
|
var shouldMergeObject = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
|
|
567
612
|
if (shouldMergeObject) {
|
|
@@ -570,21 +615,18 @@ function passDownProp(viewProps, key, val) {
|
|
|
570
615
|
...val
|
|
571
616
|
};
|
|
572
617
|
delete viewProps[key], viewProps[key] = next;
|
|
573
|
-
} else
|
|
574
|
-
viewProps[key] = val;
|
|
618
|
+
} else viewProps[key] = val;
|
|
575
619
|
}
|
|
576
620
|
function mergeMediaByImportance(styleState, mediaKey, key, value, importancesUsed, isSizeMedia, importanceBump, debugProp) {
|
|
577
621
|
var importance = getMediaImportanceIfMoreImportant(mediaKey, key, importancesUsed, isSizeMedia);
|
|
578
|
-
if (importanceBump && (importance = (importance || 0) + importanceBump), process.env.NODE_ENV === "development" && debugProp === "verbose" && log(`mergeMediaByImportance ${key} importance existing ${importancesUsed[key]} next ${importance}`), importance === null)
|
|
579
|
-
return !1;
|
|
622
|
+
if (importanceBump && (importance = (importance || 0) + importanceBump), process.env.NODE_ENV === "development" && debugProp === "verbose" && log(`mergeMediaByImportance ${key} importance existing ${importancesUsed[key]} next ${importance}`), importance === null) return !1;
|
|
580
623
|
if (importancesUsed[key] = importance, key in pseudoDescriptors) {
|
|
581
|
-
var descriptor = pseudoDescriptors[key],
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
} else
|
|
587
|
-
mergeStyle(styleState, key, value);
|
|
624
|
+
var descriptor = pseudoDescriptors[key],
|
|
625
|
+
descriptorKey = descriptor.stateKey || descriptor.name,
|
|
626
|
+
isDisabled = styleState.componentState[descriptorKey] === !1;
|
|
627
|
+
if (isDisabled) return !1;
|
|
628
|
+
for (var subKey in value) mergeStyle(styleState, subKey, value[subKey]);
|
|
629
|
+
} else mergeStyle(styleState, key, value);
|
|
588
630
|
return !0;
|
|
589
631
|
}
|
|
590
632
|
function normalizeStyle(style) {
|
|
@@ -599,10 +641,5 @@ function applyDefaultStyle(pkey, styleState) {
|
|
|
599
641
|
var defaultValues = animatableDefaults[pkey];
|
|
600
642
|
defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
|
|
601
643
|
}
|
|
602
|
-
export {
|
|
603
|
-
|
|
604
|
-
getSplitStyles,
|
|
605
|
-
getSubStyle,
|
|
606
|
-
useSplitStyles
|
|
607
|
-
};
|
|
608
|
-
//# sourceMappingURL=getSplitStyles.js.map
|
|
644
|
+
export { PROP_SPLIT, getSplitStyles, getSubStyle, useSplitStyles };
|
|
645
|
+
//# sourceMappingURL=getSplitStyles.native.js.map
|