@hanzogui/web 7.3.2 → 8.0.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/.turbo/turbo-build.log +2 -0
- package/dist/cjs/_withStableStyle.cjs +2 -2
- package/dist/cjs/_withStableStyle.native.js +2 -2
- package/dist/cjs/_withStableStyle.native.js.map +1 -1
- package/dist/cjs/config.cjs +18 -10
- package/dist/cjs/config.native.js +19 -10
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/constants/constants.cjs +1 -1
- package/dist/cjs/constants/constants.native.js +1 -1
- package/dist/cjs/constants/constants.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +68 -28
- package/dist/cjs/createComponent.native.js +75 -30
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createGui.cjs +1 -1
- package/dist/cjs/createGui.native.js +1 -1
- package/dist/cjs/createGui.native.js.map +1 -1
- package/dist/cjs/eventHandling.cjs +2 -2
- package/dist/cjs/eventHandling.native.js +73 -54
- package/dist/cjs/eventHandling.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +2 -2
- package/dist/cjs/helpers/defaultAnimationDriver.cjs +1 -1
- package/dist/cjs/helpers/defaultAnimationDriver.native.js +1 -1
- package/dist/cjs/helpers/expandStyle.cjs +46 -5
- package/dist/cjs/helpers/expandStyle.native.js +36 -30
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/getGroupPropParts.cjs +1 -1
- package/dist/cjs/helpers/getGroupPropParts.native.js +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +76 -31
- package/dist/cjs/helpers/getSplitStyles.native.js +140 -85
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getTokenForKey.cjs +5 -5
- package/dist/cjs/helpers/getTokenForKey.native.js +5 -5
- package/dist/cjs/helpers/getTokenForKey.native.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.cjs +7 -3
- package/dist/cjs/helpers/getVariantExtras.native.js +7 -3
- package/dist/cjs/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +4 -4
- package/dist/cjs/helpers/insertStyleRule.native.js +3 -3
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/mainThreadPressEvents.native.js +32 -4
- package/dist/cjs/helpers/mainThreadPressEvents.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeStyle.cjs +22 -1
- package/dist/cjs/helpers/normalizeStyle.native.js +41 -1
- package/dist/cjs/helpers/normalizeStyle.native.js.map +1 -1
- package/dist/cjs/helpers/platformResolveValue.cjs +1 -1
- package/dist/cjs/helpers/platformResolveValue.native.js +1 -1
- package/dist/cjs/helpers/platformResolveValue.native.js.map +1 -1
- package/dist/cjs/helpers/pointerEvents.native.js +26 -20
- package/dist/cjs/helpers/pointerEvents.native.js.map +1 -1
- package/dist/cjs/helpers/propMapper.cjs +31 -7
- package/dist/cjs/helpers/propMapper.native.js +70 -20
- package/dist/cjs/helpers/propMapper.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSafeArea.native.js +1 -1
- package/dist/cjs/helpers/resolveSafeArea.native.js.map +1 -1
- package/dist/cjs/helpers/styleOriginalValues.cjs +28 -0
- package/dist/cjs/helpers/styleOriginalValues.native.js +31 -0
- package/dist/cjs/helpers/styleOriginalValues.native.js.map +1 -0
- package/dist/cjs/helpers/styleProvenance.cjs +43 -0
- package/dist/cjs/helpers/styleProvenance.native.js +46 -0
- package/dist/cjs/helpers/styleProvenance.native.js.map +1 -0
- package/dist/cjs/helpers/wrapStyleTags.cjs +35 -11
- package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/cjs/hooks/getThemeProxied.cjs +1 -1
- package/dist/cjs/hooks/getThemeProxied.native.js +4 -4
- package/dist/cjs/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.cjs +29 -3
- package/dist/cjs/hooks/useComponentState.native.js +30 -4
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +107 -42
- package/dist/cjs/hooks/useMedia.native.js +149 -60
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useTheme.cjs +18 -5
- package/dist/cjs/hooks/useTheme.native.js +19 -5
- package/dist/cjs/hooks/useTheme.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +143 -72
- package/dist/cjs/hooks/useThemeState.native.js +155 -74
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/index.cjs +3 -0
- package/dist/cjs/index.native.js +3 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/opacityModifier.test-d.cjs +36 -0
- package/dist/cjs/opacityModifier.test-d.native.js +39 -0
- package/dist/cjs/opacityModifier.test-d.native.js.map +1 -0
- package/dist/cjs/styledNonStyleProps.test-d.cjs +63 -0
- package/dist/cjs/styledNonStyleProps.test-d.native.js +66 -0
- package/dist/cjs/styledNonStyleProps.test-d.native.js.map +1 -0
- package/dist/cjs/views/GuiProvider.cjs +2 -2
- package/dist/cjs/views/Text.cjs +1 -0
- package/dist/cjs/views/Text.native.js +1 -0
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +1 -1
- package/dist/cjs/views/Theme.native.js +1 -1
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/esm/_withStableStyle.mjs +2 -2
- package/dist/esm/_withStableStyle.mjs.map +1 -1
- package/dist/esm/_withStableStyle.native.js +2 -2
- package/dist/esm/_withStableStyle.native.js.map +1 -1
- package/dist/esm/config.mjs +18 -11
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +19 -11
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/constants/constants.mjs +1 -1
- package/dist/esm/constants/constants.native.js +1 -1
- package/dist/esm/constants/constants.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +74 -35
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +90 -42
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createGui.mjs +6 -6
- package/dist/esm/createGui.mjs.map +1 -1
- package/dist/esm/createGui.native.js +6 -6
- package/dist/esm/createGui.native.js.map +1 -1
- package/dist/esm/eventHandling.mjs +2 -2
- package/dist/esm/eventHandling.mjs.map +1 -1
- package/dist/esm/eventHandling.native.js +74 -55
- package/dist/esm/eventHandling.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +2 -2
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createDesignSystem.native.js +1 -2
- package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.native.js +1 -1
- package/dist/esm/helpers/expandStyle.mjs +47 -8
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +36 -30
- package/dist/esm/helpers/expandStyle.native.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/getGroupPropParts.mjs +1 -1
- package/dist/esm/helpers/getGroupPropParts.mjs.map +1 -1
- package/dist/esm/helpers/getGroupPropParts.native.js +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +86 -45
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +146 -98
- package/dist/esm/helpers/getSplitStyles.native.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/getTokenForKey.mjs +5 -5
- package/dist/esm/helpers/getTokenForKey.mjs.map +1 -1
- package/dist/esm/helpers/getTokenForKey.native.js +5 -5
- package/dist/esm/helpers/getTokenForKey.native.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.mjs +7 -3
- package/dist/esm/helpers/getVariantExtras.mjs.map +1 -1
- package/dist/esm/helpers/getVariantExtras.native.js +7 -3
- package/dist/esm/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +4 -6
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +0 -26
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isActivePlatform.mjs.map +1 -1
- package/dist/esm/helpers/isActivePlatform.native.js.map +1 -1
- package/dist/esm/helpers/log.mjs.map +1 -1
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/mainThreadPressEvents.native.js +32 -4
- package/dist/esm/helpers/mainThreadPressEvents.native.js.map +1 -1
- package/dist/esm/helpers/normalizeStyle.mjs +22 -1
- package/dist/esm/helpers/normalizeStyle.mjs.map +1 -1
- package/dist/esm/helpers/normalizeStyle.native.js +41 -1
- package/dist/esm/helpers/normalizeStyle.native.js.map +1 -1
- package/dist/esm/helpers/platformResolveValue.mjs +1 -1
- package/dist/esm/helpers/platformResolveValue.mjs.map +1 -1
- package/dist/esm/helpers/platformResolveValue.native.js +1 -1
- package/dist/esm/helpers/platformResolveValue.native.js.map +1 -1
- package/dist/esm/helpers/pointerEvents.native.js +26 -20
- package/dist/esm/helpers/pointerEvents.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.mjs +32 -11
- package/dist/esm/helpers/propMapper.mjs.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +71 -22
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/helpers/resolveSafeArea.native.js +1 -1
- package/dist/esm/helpers/resolveSafeArea.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +0 -1
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +0 -1
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/styleOriginalValues.mjs +3 -0
- package/dist/esm/helpers/styleOriginalValues.mjs.map +1 -0
- package/dist/esm/helpers/styleOriginalValues.native.js +3 -0
- package/dist/esm/helpers/styleOriginalValues.native.js.map +1 -0
- package/dist/esm/helpers/styleProvenance.mjs +16 -0
- package/dist/esm/helpers/styleProvenance.mjs.map +1 -0
- package/dist/esm/helpers/styleProvenance.native.js +16 -0
- package/dist/esm/helpers/styleProvenance.native.js.map +1 -0
- package/dist/esm/helpers/useRenderElement.mjs.map +1 -1
- package/dist/esm/helpers/useRenderElement.native.js.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs +35 -11
- package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js +0 -2
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/esm/hooks/getThemeProxied.mjs +2 -5
- package/dist/esm/hooks/getThemeProxied.mjs.map +1 -1
- package/dist/esm/hooks/getThemeProxied.native.js +5 -5
- package/dist/esm/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.mjs +31 -5
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +32 -6
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +108 -43
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +150 -61
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useTheme.mjs +18 -5
- package/dist/esm/hooks/useTheme.mjs.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +19 -5
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +141 -70
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +154 -73
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +4 -4
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/insertFont.mjs.map +1 -1
- package/dist/esm/insertFont.native.js +0 -1
- package/dist/esm/insertFont.native.js.map +1 -1
- package/dist/esm/opacityModifier.test-d.mjs +37 -0
- package/dist/esm/opacityModifier.test-d.mjs.map +1 -0
- package/dist/esm/opacityModifier.test-d.native.js +37 -0
- package/dist/esm/opacityModifier.test-d.native.js.map +1 -0
- package/dist/esm/styledNonStyleProps.test-d.mjs +64 -0
- package/dist/esm/styledNonStyleProps.test-d.mjs.map +1 -0
- package/dist/esm/styledNonStyleProps.test-d.native.js +64 -0
- package/dist/esm/styledNonStyleProps.test-d.native.js.map +1 -0
- package/dist/esm/views/GuiProvider.mjs +2 -2
- package/dist/esm/views/GuiProvider.mjs.map +1 -1
- package/dist/esm/views/GuiProvider.native.js +6 -6
- package/dist/esm/views/GuiProvider.native.js.map +1 -1
- package/dist/esm/views/Text.mjs +1 -0
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Text.native.js +1 -0
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs +1 -1
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +1 -1
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeProvider.mjs.map +1 -1
- package/dist/esm/views/ThemeProvider.native.js +2 -4
- package/dist/esm/views/ThemeProvider.native.js.map +1 -1
- package/inject-styles/index.cjs +2 -0
- package/inject-styles/index.js +2 -0
- package/package.json +27 -40
- package/src/_withStableStyle.tsx +9 -3
- package/src/config.ts +24 -14
- package/src/constants/accessibilityDirectMap.tsx +1 -1
- package/src/constants/constants.ts +1 -1
- package/src/createComponent.tsx +161 -26
- package/src/createGui.ts +2 -2
- package/src/eventHandling.native.ts +143 -52
- package/src/eventHandling.ts +4 -2
- package/src/helpers/createDesignSystem.ts +2 -2
- package/src/helpers/createMediaStyle.ts +1 -1
- package/src/helpers/defaultAnimationDriver.tsx +1 -1
- package/src/helpers/expandStyle.ts +108 -40
- package/src/helpers/getGroupPropParts.ts +1 -1
- package/src/helpers/getSplitStyles.tsx +178 -72
- package/src/helpers/getTokenForKey.ts +5 -5
- package/src/helpers/getVariantExtras.tsx +5 -4
- package/src/helpers/insertStyleRule.tsx +7 -7
- package/src/helpers/mainThreadPressEvents.native.ts +42 -2
- package/src/helpers/mergeProps.ts +1 -1
- package/src/helpers/normalizeStyle.ts +23 -1
- package/src/helpers/platformResolveValue.native.ts +4 -1
- package/src/helpers/platformResolveValue.ts +5 -1
- package/src/helpers/pointerEvents.native.ts +26 -19
- package/src/helpers/propMapper.ts +61 -6
- package/src/helpers/resolveSafeArea.native.ts +1 -1
- package/src/helpers/styleOriginalValues.ts +2 -0
- package/src/helpers/styleProvenance.ts +49 -0
- package/src/helpers/wrapStyleTags.tsx +63 -20
- package/src/hooks/getThemeProxied.ts +14 -8
- package/src/hooks/useComponentState.ts +56 -4
- package/src/hooks/useMedia.tsx +156 -43
- package/src/hooks/useTheme.tsx +28 -6
- package/src/hooks/useThemeState.ts +284 -142
- package/src/index.ts +9 -1
- package/src/interfaces/GuiComponentPropsBaseBase.tsx +2 -2
- package/src/opacityModifier.test-d.ts +65 -0
- package/src/styled.tsx +1 -1
- package/src/styledNonStyleProps.test-d.ts +106 -0
- package/src/types.tsx +120 -22
- package/src/views/GuiProvider.tsx +2 -2
- package/src/views/Text.tsx +1 -0
- package/src/views/Theme.tsx +4 -1
- package/tsconfig.json +44 -0
- package/tsconfig.test.json +9 -0
- package/types/_withStableStyle.d.ts.map +1 -1
- package/types/config.d.ts +3 -1
- package/types/config.d.ts.map +1 -1
- package/types/constants/constants.d.ts +1 -1
- package/types/constants/constants.d.ts.map +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/eventHandling.d.ts +2 -2
- package/types/eventHandling.d.ts.map +1 -1
- package/types/eventHandling.native.d.ts +3 -3
- package/types/eventHandling.native.d.ts.map +1 -1
- package/types/helpers/expandStyle.d.ts +2 -1
- package/types/helpers/expandStyle.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +4 -2
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getVariantExtras.d.ts.map +1 -1
- package/types/helpers/mainThreadPressEvents.native.d.ts.map +1 -1
- package/types/helpers/normalizeStyle.d.ts.map +1 -1
- package/types/helpers/platformResolveValue.d.ts.map +1 -1
- package/types/helpers/platformResolveValue.native.d.ts.map +1 -1
- package/types/helpers/pointerEvents.native.d.ts.map +1 -1
- package/types/helpers/propMapper.d.ts.map +1 -1
- package/types/helpers/styleOriginalValues.d.ts +2 -0
- package/types/helpers/styleOriginalValues.d.ts.map +1 -0
- package/types/helpers/styleProvenance.d.ts +11 -0
- package/types/helpers/styleProvenance.d.ts.map +1 -0
- package/types/helpers/wrapStyleTags.d.ts +1 -1
- package/types/helpers/wrapStyleTags.d.ts.map +1 -1
- package/types/hooks/getThemeProxied.d.ts.map +1 -1
- package/types/hooks/useComponentState.d.ts +2 -1
- package/types/hooks/useComponentState.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts +1 -1
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/hooks/useThemeState.d.ts +1 -1
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +3 -3
- package/types/index.d.ts.map +1 -1
- package/types/interfaces/GuiComponentPropsBaseBase.d.ts +2 -2
- package/types/types.d.ts +33 -16
- package/types/types.d.ts.map +1 -1
- package/types/views/Configuration.d.ts +1 -1
- package/types/views/Configuration.d.ts.map +1 -1
- package/types/views/FontLanguage.d.ts +1 -1
- package/types/views/FontLanguage.native.d.ts +1 -2
- package/types/views/FontLanguage.native.d.ts.map +1 -1
- package/types/views/GuiProvider.d.ts +1 -2
- package/types/views/GuiProvider.d.ts.map +1 -1
- package/types/views/GuiRoot.d.ts +1 -1
- package/types/views/GuiRoot.d.ts.map +1 -1
- package/types/views/Slot.d.ts +1 -1
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeProvider.d.ts +1 -1
- package/types/views/ThemeProvider.d.ts.map +1 -1
- package/vitest.config.d.ts +3 -0
- package/vitest.config.d.ts.map +1 -0
- package/vitest.config.ts +14 -0
- package/LICENSE +0 -42
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import { isAndroid, isClient,
|
|
2
|
-
import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo,
|
|
1
|
+
import { getPlatformDriver, isAndroid, isClient, isWeb, supportsDynamicColorIOS } from "@hanzogui/constants";
|
|
2
|
+
import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, stylePropsText, stylePropsTransform, tokenCategories, validPseudoKeys, validStyles } from "@hanzogui/helpers";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { getConfig, getFont, getSetting } from "../config.native.js";
|
|
5
5
|
import { isDevTools } from "../constants/isDevTools.native.js";
|
|
6
6
|
import { getMediaImportanceIfMoreImportant, getMediaKey, getMediaKeyImportance, mediaKeyMatch } from "../hooks/useMedia.native.js";
|
|
7
|
-
import {
|
|
7
|
+
import { mediaQueryConfig, mediaState } from "./mediaState.native.js";
|
|
8
8
|
import { createMediaStyle } from "./createMediaStyle.native.js";
|
|
9
9
|
import { fixStyles } from "./expandStyles.native.js";
|
|
10
10
|
import { getCSSStylesAtomic, getStyleAtomic, styleToCSS } from "./getCSSStylesAtomic.native.js";
|
|
11
11
|
import { getDefaultProps } from "./getDefaultProps.native.js";
|
|
12
12
|
import { extractValueFromDynamic, getDynamicVal, getOppositeScheme, isColorStyleKey } from "./getDynamicVal.native.js";
|
|
13
13
|
import { getGroupPropParts } from "./getGroupPropParts.native.js";
|
|
14
|
-
import {
|
|
15
|
-
import { isActivePlatform, getPlatformSpecificityBump } from "./isActivePlatform.native.js";
|
|
14
|
+
import { getPlatformSpecificityBump, isActivePlatform } from "./isActivePlatform.native.js";
|
|
16
15
|
import { isActiveTheme } from "./isActiveTheme.native.js";
|
|
17
16
|
import { log } from "./log.native.js";
|
|
18
17
|
import { normalizeValueWithProperty } from "./normalizeValueWithProperty.native.js";
|
|
19
18
|
import { propMapper } from "./propMapper.native.js";
|
|
20
|
-
import { pseudoDescriptors, pseudoPriorities
|
|
19
|
+
import { defaultMediaImportance, pseudoDescriptors, pseudoPriorities } from "./pseudoDescriptors.native.js";
|
|
21
20
|
import { skipProps } from "./skipProps.native.js";
|
|
22
21
|
import { sortString } from "./sortString.native.js";
|
|
22
|
+
import { styleOriginalValues } from "./styleOriginalValues.native.js";
|
|
23
|
+
import { STYLE_TOKEN_PROVENANCE_KEY, getStyleTokenProvenance, setStyleTokenProvenance } from "./styleProvenance.native.js";
|
|
23
24
|
import { transformsToString } from "./transformsToString.native.js";
|
|
24
25
|
function _type_of(obj) {
|
|
25
26
|
"@swc/helpers - typeof";
|
|
26
27
|
|
|
27
28
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
28
29
|
}
|
|
30
|
+
var shouldTrackStyleTokenProvenance = process.env.NODE_ENV === "development" && process.env.GUI_ENABLE_STYLE_TOKEN_PROVENANCE === "1";
|
|
29
31
|
var conf;
|
|
30
|
-
var styleOriginalValues = /* @__PURE__ */new WeakMap();
|
|
31
32
|
var PROP_SPLIT = "-";
|
|
32
33
|
function normalizeGroupKey(key, groupContext) {
|
|
33
34
|
var parts = key.split("-");
|
|
@@ -41,6 +42,13 @@ function normalizeGroupKey(key, groupContext) {
|
|
|
41
42
|
function isValidStyleKey(key, validStyles, accept) {
|
|
42
43
|
return key in validStyles ? true : accept && key in accept;
|
|
43
44
|
}
|
|
45
|
+
function shouldSkipNativeHoverProp(key, isMedia) {
|
|
46
|
+
var _getPlatformDriver;
|
|
47
|
+
if ((_getPlatformDriver = getPlatformDriver()) === null || _getPlatformDriver === void 0 ? void 0 : _getPlatformDriver.pseudo) return false;
|
|
48
|
+
if (key === "hoverStyle") return true;
|
|
49
|
+
if (isMedia === "group") return getGroupPropParts(key.slice(1)).pseudo === "hover";
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
44
52
|
var getSplitStyles = function (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver) {
|
|
45
53
|
var _loop = function (keyOg2) {
|
|
46
54
|
var keyInit = keyOg2;
|
|
@@ -49,6 +57,7 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
49
57
|
viewProps[keyInit] = valInit;
|
|
50
58
|
return "continue";
|
|
51
59
|
}
|
|
60
|
+
if (keyInit[0] === "d" && keyInit.startsWith("data-")) return "continue";
|
|
52
61
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`before-prop-${keyInit}`;
|
|
53
62
|
if (process.env.NODE_ENV === "test" && keyInit === "jestAnimatedStyle") return "continue";
|
|
54
63
|
if (accept) {
|
|
@@ -71,11 +80,14 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
71
80
|
}
|
|
72
81
|
}
|
|
73
82
|
if (keyInit in skipProps && !noSkip && !isHOC) {
|
|
74
|
-
var _driver_animations;
|
|
75
83
|
if (keyInit === "group") ;
|
|
76
|
-
if (keyInit === "transition" && typeof valInit === "string"
|
|
84
|
+
if (keyInit === "transition" && typeof valInit === "string") {
|
|
85
|
+
var _driver_animations;
|
|
86
|
+
var animationConfig = driver === null || driver === void 0 ? void 0 : (_driver_animations = driver.animations) === null || _driver_animations === void 0 ? void 0 : _driver_animations[valInit];
|
|
87
|
+
if (animationConfig && (driver === null || driver === void 0 ? void 0 : driver.outputStyle) === "css" && process.env.IS_STATIC === "is_static") valInit = `all ${animationConfig}`;else if (animationConfig) return "continue";
|
|
88
|
+
} else return "continue";
|
|
77
89
|
}
|
|
78
|
-
var isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles, accept);
|
|
90
|
+
var isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles$1, accept);
|
|
79
91
|
if (!isValidStyleKeyInit) {
|
|
80
92
|
if (!isAndroid) {
|
|
81
93
|
if (keyInit === "elevationAndroid") return "continue";
|
|
@@ -92,6 +104,7 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
92
104
|
var isMediaOrPseudo = Boolean(isMedia || isPseudo);
|
|
93
105
|
if (isMediaOrPseudo && isMedia === "group") keyInit = normalizeGroupKey(keyInit, groupContext);
|
|
94
106
|
var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo || isVariant && !noExpand;
|
|
107
|
+
if (shouldSkipNativeHoverProp(keyInit, isMedia)) return "continue";
|
|
95
108
|
if (isStyleProp && (asChild === "except-style" || asChild === "except-style-web")) return "continue";
|
|
96
109
|
var shouldPassProp = !isStyleProp && isHOC || isHOC && parentVariants && keyInit in parentVariants || (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(keyInit));
|
|
97
110
|
var parentVariant = parentVariants === null || parentVariants === void 0 ? void 0 : parentVariants[keyInit];
|
|
@@ -131,44 +144,45 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
131
144
|
if (valInit && (keyInit === "fontFamily" || keyInit === shorthands["fontFamily"]) && valInit in conf.fontsParsed) styleState.fontFamily = valInit;
|
|
132
145
|
}
|
|
133
146
|
var disablePropMap = isMediaOrPseudo || !isStyleLikeKey;
|
|
134
|
-
propMapper(keyInit, valInit, styleState, disablePropMap, function (
|
|
147
|
+
propMapper(keyInit, valInit, styleState, disablePropMap, function (key6, val2, originalVal) {
|
|
135
148
|
var _parentStaticConfig_variants;
|
|
136
|
-
var isStyledContextProp = styledContext &&
|
|
149
|
+
var isStyledContextProp = styledContext && key6 in styledContext;
|
|
137
150
|
if (!isHOC && disablePropMap && !isStyledContextProp && !isMediaOrPseudo) {
|
|
138
|
-
viewProps[
|
|
151
|
+
viewProps[key6] = val2;
|
|
139
152
|
return;
|
|
140
153
|
}
|
|
141
154
|
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
142
|
-
console.groupCollapsed(" 💠 expanded", keyInit, "=>",
|
|
155
|
+
console.groupCollapsed(" 💠 expanded", keyInit, "=>", key6);
|
|
143
156
|
log(val2);
|
|
144
157
|
console.groupEnd();
|
|
145
158
|
}
|
|
146
159
|
if (val2 == null) return;
|
|
147
|
-
if (
|
|
148
|
-
viewProps[
|
|
160
|
+
if (key6 === "pointerEvents") {
|
|
161
|
+
viewProps[key6] = val2;
|
|
149
162
|
return;
|
|
150
163
|
}
|
|
151
|
-
if (!isHOC && isValidStyleKey(
|
|
152
|
-
mergeStyle(styleState,
|
|
164
|
+
if (!isHOC && isValidStyleKey(key6, validStyles$1, accept) || isAndroid && key6 === "elevation") {
|
|
165
|
+
mergeStyle(styleState, key6, val2, 1, false, originalVal);
|
|
153
166
|
return;
|
|
154
167
|
}
|
|
155
|
-
isPseudo =
|
|
156
|
-
isMedia = isPseudo ? false : getMediaKey(
|
|
168
|
+
isPseudo = key6 in validPseudoKeys;
|
|
169
|
+
isMedia = isPseudo ? false : getMediaKey(key6);
|
|
157
170
|
isMediaOrPseudo = Boolean(isMedia || isPseudo);
|
|
158
|
-
isVariant = variants &&
|
|
159
|
-
if (isMedia === "group")
|
|
160
|
-
if ((
|
|
171
|
+
isVariant = variants && key6 in variants;
|
|
172
|
+
if (isMedia === "group") key6 = normalizeGroupKey(key6, groupContext);
|
|
173
|
+
if (shouldSkipNativeHoverProp(key6, isMedia)) return;
|
|
174
|
+
if ((inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(key6)) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened === null || inlineWhenUnflattened === void 0 ? void 0 : inlineWhenUnflattened.has(key6))) {
|
|
161
175
|
var _props_key;
|
|
162
|
-
viewProps[
|
|
176
|
+
viewProps[key6] = (_props_key = props[key6]) !== null && _props_key !== void 0 ? _props_key : val2;
|
|
163
177
|
}
|
|
164
178
|
if (styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : (_parentStaticConfig_variants = parentStaticConfig.variants) === null || _parentStaticConfig_variants === void 0 ? void 0 : _parentStaticConfig_variants[keyInit]))) {
|
|
165
|
-
passDownProp(viewProps,
|
|
179
|
+
passDownProp(viewProps, key6, val2, isMediaOrPseudo);
|
|
166
180
|
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
167
|
-
console.groupCollapsed(` - passing down prop ${
|
|
181
|
+
console.groupCollapsed(` - passing down prop ${key6}`);
|
|
168
182
|
log({
|
|
169
183
|
val: val2,
|
|
170
184
|
after: {
|
|
171
|
-
...viewProps[
|
|
185
|
+
...viewProps[key6]
|
|
172
186
|
}
|
|
173
187
|
});
|
|
174
188
|
console.groupEnd();
|
|
@@ -177,31 +191,30 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
177
191
|
}
|
|
178
192
|
if (isPseudo) {
|
|
179
193
|
if (!val2) return;
|
|
180
|
-
var pseudoStyleObject = getSubStyle(styleState,
|
|
194
|
+
var pseudoStyleObject = getSubStyle(styleState, key6, val2, styleProps.noClass && !(process.env.IS_STATIC === "is_static"));
|
|
181
195
|
if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
|
|
182
196
|
var _pseudos, _key;
|
|
183
197
|
pseudos || (pseudos = {});
|
|
184
|
-
(_pseudos = pseudos)[_key =
|
|
198
|
+
(_pseudos = pseudos)[_key = key6] || (_pseudos[_key] = {});
|
|
185
199
|
if (process.env.IS_STATIC === "is_static") {
|
|
186
|
-
Object.assign(pseudos[
|
|
200
|
+
Object.assign(pseudos[key6], pseudoStyleObject);
|
|
187
201
|
return;
|
|
188
202
|
}
|
|
189
203
|
}
|
|
190
|
-
var descriptor = pseudoDescriptors[
|
|
191
|
-
var isEnter =
|
|
192
|
-
var isExit =
|
|
204
|
+
var descriptor = pseudoDescriptors[key6];
|
|
205
|
+
var isEnter = key6 === "enterStyle";
|
|
206
|
+
var isExit = key6 === "exitStyle";
|
|
193
207
|
if (!descriptor) return;
|
|
194
208
|
if (shouldDoClasses && !isExit) {
|
|
195
209
|
var pseudoStyles = getStyleAtomic(pseudoStyleObject, descriptor);
|
|
196
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") console.info("pseudo:",
|
|
210
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") console.info("pseudo:", key6, pseudoStyleObject, pseudoStyles);
|
|
197
211
|
var _iteratorNormalCompletion3 = true,
|
|
198
212
|
_didIteratorError3 = false,
|
|
199
213
|
_iteratorError3 = void 0;
|
|
200
214
|
try {
|
|
201
215
|
for (var _iterator3 = pseudoStyles[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
202
216
|
var psuedoStyle = _step3.value;
|
|
203
|
-
var fullKey = `${psuedoStyle[StyleObjectProperty]}${
|
|
204
|
-
addStyleToInsertRules(rulesToInsert, psuedoStyle);
|
|
217
|
+
var fullKey = `${psuedoStyle[StyleObjectProperty]}${"-"}${descriptor.name}`;
|
|
205
218
|
classNames[fullKey] = psuedoStyle[StyleObjectIdentifier];
|
|
206
219
|
}
|
|
207
220
|
} catch (err) {
|
|
@@ -220,7 +233,7 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
220
233
|
if (isExit) isDisabled = !styleProps.isExiting;
|
|
221
234
|
if (isEnter && componentState.unmounted === false) isDisabled = true;
|
|
222
235
|
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
223
|
-
console.groupCollapsed("pseudo",
|
|
236
|
+
console.groupCollapsed("pseudo", key6, {
|
|
224
237
|
isDisabled
|
|
225
238
|
});
|
|
226
239
|
log({
|
|
@@ -242,8 +255,8 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
242
255
|
if (process.env.IS_STATIC === "is_static") {
|
|
243
256
|
var _pseudos1, _key1;
|
|
244
257
|
pseudos || (pseudos = {});
|
|
245
|
-
(_pseudos1 = pseudos)[_key1 =
|
|
246
|
-
pseudos[
|
|
258
|
+
(_pseudos1 = pseudos)[_key1 = key6] || (_pseudos1[_key1] = {});
|
|
259
|
+
pseudos[key6][pkey] = _$val;
|
|
247
260
|
}
|
|
248
261
|
mergeStyle(styleState, pkey, _$val, importance, false, pseudoOriginalValues === null || pseudoOriginalValues === void 0 ? void 0 : pseudoOriginalValues[pkey]);
|
|
249
262
|
}
|
|
@@ -256,36 +269,36 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
256
269
|
}
|
|
257
270
|
}
|
|
258
271
|
if (!isDisabled) for (var _$key in val2) {
|
|
259
|
-
var
|
|
260
|
-
styleState.usedKeys[
|
|
272
|
+
var k2 = shorthands[_$key] || _$key;
|
|
273
|
+
styleState.usedKeys[k2] = Math.max(importance, styleState.usedKeys[k2] || 0);
|
|
261
274
|
}
|
|
262
275
|
}
|
|
263
276
|
return;
|
|
264
277
|
}
|
|
265
278
|
if (isMedia) {
|
|
266
279
|
if (!val2) return;
|
|
267
|
-
var mediaKeyShort =
|
|
280
|
+
var mediaKeyShort = key6.slice(isMedia == "theme" ? 7 : 1);
|
|
268
281
|
hasMedia || (hasMedia = true);
|
|
269
282
|
if (val2["space"] || !shouldDoClasses || styleProps.willBeAnimated) {
|
|
270
283
|
if (!hasMedia || typeof hasMedia === "boolean") hasMedia = /* @__PURE__ */new Set();
|
|
271
284
|
hasMedia.add(mediaKeyShort);
|
|
272
285
|
}
|
|
273
286
|
if (isMedia === "platform") {
|
|
274
|
-
if (!isActivePlatform(
|
|
287
|
+
if (!isActivePlatform(key6)) return;
|
|
275
288
|
}
|
|
276
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") log(` \u{1F4FA} ${
|
|
277
|
-
key:
|
|
289
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") log(` \u{1F4FA} ${key6}`, {
|
|
290
|
+
key: key6,
|
|
278
291
|
val: val2,
|
|
279
292
|
props,
|
|
280
293
|
shouldDoClasses,
|
|
281
294
|
acceptsClassName,
|
|
282
295
|
componentState,
|
|
283
|
-
mediaState
|
|
296
|
+
mediaState: mediaState$1
|
|
284
297
|
});
|
|
285
298
|
var priority = mediaStylesSeen;
|
|
286
299
|
mediaStylesSeen += 1;
|
|
287
300
|
if (shouldDoClasses) {
|
|
288
|
-
var mediaStyles = getCSSStylesAtomic(getSubStyle(styleState,
|
|
301
|
+
var mediaStyles = getCSSStylesAtomic(getSubStyle(styleState, key6, val2, false));
|
|
289
302
|
var _iteratorNormalCompletion12 = true,
|
|
290
303
|
_didIteratorError12 = false,
|
|
291
304
|
_iteratorError12 = void 0;
|
|
@@ -298,8 +311,7 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
298
311
|
var out = createMediaStyle(style3, mediaKeyShort, mediaQueryConfig, isMedia, false, priority);
|
|
299
312
|
if (process.env.NODE_ENV === "development" && debug === "verbose") log(`\u{1F4FA} media style:`, out);
|
|
300
313
|
var subKey = isSubStyle ? style3[2] : "";
|
|
301
|
-
var fullKey1 = `${style3[StyleObjectProperty]}${subKey}${
|
|
302
|
-
addStyleToInsertRules(rulesToInsert, out);
|
|
314
|
+
var fullKey1 = `${style3[StyleObjectProperty]}${subKey}${"-"}${mediaKeyShort}${style3[StyleObjectPseudo] || ""}`;
|
|
303
315
|
classNames[fullKey1] = out[StyleObjectIdentifier];
|
|
304
316
|
}
|
|
305
317
|
} catch (err) {
|
|
@@ -313,29 +325,29 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
313
325
|
}
|
|
314
326
|
}
|
|
315
327
|
} else {
|
|
316
|
-
let mergeMediaStyle2 = function (
|
|
328
|
+
let mergeMediaStyle2 = function (key7, val3, originalVal2) {
|
|
317
329
|
var _styleState4;
|
|
318
|
-
if (!isValidStyleKey(
|
|
319
|
-
viewProps[
|
|
330
|
+
if (!isValidStyleKey(key7, validStyles$1, accept)) {
|
|
331
|
+
viewProps[key7] = val3;
|
|
320
332
|
return;
|
|
321
333
|
}
|
|
322
334
|
(_styleState4 = styleState).style || (_styleState4.style = {});
|
|
323
|
-
if (mergeMediaByImportance(styleState, mediaKeyShort,
|
|
335
|
+
if (mergeMediaByImportance(styleState, mediaKeyShort, key7, val3, mediaState$1[mediaKeyShort], importanceBump, debug, originalVal2) && key7 === "fontFamily") styleState.fontFamily = mediaStyle1.fontFamily;
|
|
324
336
|
};
|
|
325
337
|
var isThemeMedia = isMedia === "theme";
|
|
326
338
|
var isGroupMedia = isMedia === "group";
|
|
327
339
|
var isPlatformMedia = isMedia === "platform";
|
|
328
340
|
if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
|
|
329
|
-
if (!mediaState[mediaKeyShort]) {
|
|
341
|
+
if (!mediaState$1[mediaKeyShort]) {
|
|
330
342
|
if (process.env.NODE_ENV === "development" && debug === "verbose") log(` \u{1F4FA} \u274C DISABLED ${mediaKeyShort}`);
|
|
331
343
|
return;
|
|
332
344
|
}
|
|
333
345
|
if (process.env.NODE_ENV === "development" && debug === "verbose") log(` \u{1F4FA} \u2705 ENABLED ${mediaKeyShort}`);
|
|
334
346
|
}
|
|
335
|
-
var mediaStyle1 = getSubStyle(styleState,
|
|
347
|
+
var mediaStyle1 = getSubStyle(styleState, key6, val2, true);
|
|
336
348
|
var importanceBump = 0;
|
|
337
349
|
if (isThemeMedia) {
|
|
338
|
-
if (
|
|
350
|
+
if (supportsDynamicColorIOS && getSetting("fastSchemeChange")) {
|
|
339
351
|
var _styleState3;
|
|
340
352
|
(_styleState3 = styleState).style || (_styleState3.style = {});
|
|
341
353
|
var scheme = mediaKeyShort;
|
|
@@ -373,6 +385,7 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
373
385
|
var groupState = groupContext === null || groupContext === void 0 ? void 0 : (_groupContext_groupName = groupContext[groupName]) === null || _groupContext_groupName === void 0 ? void 0 : _groupContext_groupName.state;
|
|
374
386
|
var groupPseudoKey = groupInfo.pseudo;
|
|
375
387
|
var groupMediaKey = groupInfo.media;
|
|
388
|
+
if (groupPseudoKey === "hover") return;
|
|
376
389
|
if (!groupState) {
|
|
377
390
|
if (process.env.NODE_ENV === "development" && debug) log(`No parent with group prop, skipping styles: ${groupName}`);
|
|
378
391
|
pseudoGroups || (pseudoGroups = /* @__PURE__ */new Set());
|
|
@@ -434,11 +447,11 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
434
447
|
} else if (subMediaType === "theme") {
|
|
435
448
|
if (!isActiveTheme(subKey2, themeName)) continue;
|
|
436
449
|
} else if (subMediaType === true) {
|
|
437
|
-
if (!mediaState[subKey2.slice(1)]) continue;
|
|
450
|
+
if (!mediaState$1[subKey2.slice(1)]) continue;
|
|
438
451
|
}
|
|
439
452
|
var nestedVal = mediaStyle1[subKey2];
|
|
440
453
|
var subOriginalValues = styleOriginalValues.get(nestedVal);
|
|
441
|
-
var outerBase = !!mediaState[mediaKeyShort] ? getMediaKeyImportance(mediaKeyShort) : defaultMediaImportance;
|
|
454
|
+
var outerBase = !!mediaState$1[mediaKeyShort] ? getMediaKeyImportance(mediaKeyShort) : defaultMediaImportance;
|
|
442
455
|
var innerBase = void 0;
|
|
443
456
|
if (subMediaType === "platform") innerBase = defaultMediaImportance + getPlatformSpecificityBump(subKey2.slice(1));else if (subMediaType === true) innerBase = getMediaKeyImportance(subKey2.slice(1));else innerBase = defaultMediaImportance;
|
|
444
457
|
var nestedImportance = outerBase + importanceBump + innerBase + 1;
|
|
@@ -460,7 +473,7 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
460
473
|
}
|
|
461
474
|
if (!isVariant) {
|
|
462
475
|
if (isStyledContextProp) return;
|
|
463
|
-
viewProps[
|
|
476
|
+
viewProps[key6] = val2;
|
|
464
477
|
}
|
|
465
478
|
});
|
|
466
479
|
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
@@ -498,7 +511,7 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
498
511
|
acceptsClassName
|
|
499
512
|
} = staticConfig;
|
|
500
513
|
var viewProps = {};
|
|
501
|
-
var mediaState = styleProps.mediaState ||
|
|
514
|
+
var mediaState$1 = styleProps.mediaState || mediaState;
|
|
502
515
|
var shouldDoClasses = acceptsClassName && isWeb && !styleProps.noClass;
|
|
503
516
|
var rulesToInsert = void 0;
|
|
504
517
|
var classNames = {};
|
|
@@ -510,7 +523,7 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
510
523
|
var mediaGroups;
|
|
511
524
|
var className = props.className || "";
|
|
512
525
|
var mediaStylesSeen = 0;
|
|
513
|
-
var validStyles = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? stylePropsText :
|
|
526
|
+
var validStyles$1 = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? stylePropsText : validStyles);
|
|
514
527
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-setup`;
|
|
515
528
|
var styleState = {
|
|
516
529
|
classNames,
|
|
@@ -532,9 +545,9 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
532
545
|
fallbackProps
|
|
533
546
|
} = styleProps;
|
|
534
547
|
if (fallbackProps) styleState.props = new Proxy(props, {
|
|
535
|
-
get(_,
|
|
536
|
-
if (!Reflect.has(props,
|
|
537
|
-
return Reflect.get(props,
|
|
548
|
+
get(_, key6, val2) {
|
|
549
|
+
if (!Reflect.has(props, key6)) return Reflect.get(fallbackProps, key6);
|
|
550
|
+
return Reflect.get(props, key6);
|
|
538
551
|
}
|
|
539
552
|
});
|
|
540
553
|
}
|
|
@@ -604,7 +617,12 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
604
617
|
if (style) if (style["$$css"]) Object.assign(styleState.classNames, style);else {
|
|
605
618
|
var _styleState2;
|
|
606
619
|
(_styleState2 = styleState).style || (_styleState2.style = {});
|
|
607
|
-
|
|
620
|
+
var normalized = normalizeStyle(style);
|
|
621
|
+
Object.assign(styleState.style, normalized);
|
|
622
|
+
if (shouldTrackStyleTokenProvenance) {
|
|
623
|
+
var styleOriginals = styleOriginalValues.get(normalized);
|
|
624
|
+
for (var k in normalized) recordStyleTokenProvenance(styleState, k, styleOriginals === null || styleOriginals === void 0 ? void 0 : styleOriginals[k]);
|
|
625
|
+
}
|
|
608
626
|
}
|
|
609
627
|
}
|
|
610
628
|
}
|
|
@@ -630,6 +648,18 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
630
648
|
if (process.env.NODE_ENV === "development" && debug && debug !== "profile") log(`Found fontFamily native: ${style1.fontFamily}`, faceInfo);
|
|
631
649
|
}
|
|
632
650
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-pre-result`;
|
|
651
|
+
if (shouldTrackStyleTokenProvenance && styleState.style && styleState.tokenProvenance) {
|
|
652
|
+
var provenance = {};
|
|
653
|
+
var hasProvenance = false;
|
|
654
|
+
for (var key4 in styleState.tokenProvenance) {
|
|
655
|
+
provenance[key4] = {
|
|
656
|
+
token: styleState.tokenProvenance[key4],
|
|
657
|
+
theme: themeName
|
|
658
|
+
};
|
|
659
|
+
hasProvenance = true;
|
|
660
|
+
}
|
|
661
|
+
if (hasProvenance) setStyleTokenProvenance(styleState.style, provenance);
|
|
662
|
+
}
|
|
633
663
|
var result = {
|
|
634
664
|
hasMedia,
|
|
635
665
|
fontFamily: styleState.fontFamily,
|
|
@@ -664,7 +694,7 @@ var getSplitStyles = function (props, staticConfig, theme, themeName, componentS
|
|
|
664
694
|
rulesToInsert,
|
|
665
695
|
parentSplitStyles
|
|
666
696
|
};
|
|
667
|
-
for (var
|
|
697
|
+
for (var key5 in logs) log(key5, logs[key5]);
|
|
668
698
|
} catch (e) {}
|
|
669
699
|
console.groupEnd();
|
|
670
700
|
}
|
|
@@ -714,38 +744,17 @@ function mergeStyle(styleState, key, val, importance) {
|
|
|
714
744
|
(_styleState2 = styleState).style || (_styleState2.style = {});
|
|
715
745
|
usedKeys[key] = importance;
|
|
716
746
|
styleState.style[key] = key === "transform" && Array.isArray(out) ? [...out] : out;
|
|
747
|
+
if (shouldTrackStyleTokenProvenance) recordStyleTokenProvenance(styleState, key, originalVal);
|
|
717
748
|
}
|
|
718
749
|
}
|
|
719
750
|
}
|
|
751
|
+
function recordStyleTokenProvenance(styleState, key, originalVal) {
|
|
752
|
+
if (typeof originalVal === "string" && originalVal[0] === "$") {
|
|
753
|
+
var _styleState;
|
|
754
|
+
((_styleState = styleState).tokenProvenance || (_styleState.tokenProvenance = {}))[key] = originalVal;
|
|
755
|
+
} else if (styleState.tokenProvenance && key in styleState.tokenProvenance) delete styleState.tokenProvenance[key];
|
|
756
|
+
}
|
|
720
757
|
var getSubStyle = function (styleState, subKey, styleIn, avoidMergeTransform) {
|
|
721
|
-
var _loop = function (key1) {
|
|
722
|
-
var val = styleIn[key1];
|
|
723
|
-
key1 = conf2.shorthands[key1] || key1;
|
|
724
|
-
if (key1 === "transition") {
|
|
725
|
-
var _driver_animations;
|
|
726
|
-
var _styleState;
|
|
727
|
-
(_styleState = styleState).pseudoTransitions || (_styleState.pseudoTransitions = {});
|
|
728
|
-
styleState.pseudoTransitions[subKey] = val;
|
|
729
|
-
var driver = styleState.animationDriver;
|
|
730
|
-
if ((driver === null || driver === void 0 ? void 0 : driver.outputStyle) === "css") {
|
|
731
|
-
var _driver_animations1;
|
|
732
|
-
var animationConfig = (_driver_animations1 = driver.animations) === null || _driver_animations1 === void 0 ? void 0 : _driver_animations1[val];
|
|
733
|
-
if (animationConfig) styleOut["transition"] = `all ${animationConfig}${subKey[0] === "$" ? " !important" : ""}`;
|
|
734
|
-
}
|
|
735
|
-
if (!styleOut["transition"] && typeof val === "string" && !(driver === null || driver === void 0 ? void 0 : (_driver_animations = driver.animations) === null || _driver_animations === void 0 ? void 0 : _driver_animations[val])) styleOut["transition"] = val;
|
|
736
|
-
return key = key1, "continue";
|
|
737
|
-
}
|
|
738
|
-
if (!staticConfig.isHOC && key1 in skipProps && !styleProps.noSkip) return key = key1, "continue";
|
|
739
|
-
propMapper(key1, val, styleState, false, function (skey, sval, originalVal) {
|
|
740
|
-
if (originalVal !== void 0) {
|
|
741
|
-
originalValues || (originalValues = {});
|
|
742
|
-
originalValues[skey] = originalVal;
|
|
743
|
-
}
|
|
744
|
-
if (skey in validPseudoKeys) sval = getSubStyle(styleState, skey, sval, avoidMergeTransform);
|
|
745
|
-
if (!avoidMergeTransform && skey in stylePropsTransform) mergeTransform(styleOut, skey, sval);else styleOut[skey] = styleProps.noNormalize ? sval : normalizeValueWithProperty(sval, key1);
|
|
746
|
-
});
|
|
747
|
-
key = key1;
|
|
748
|
-
};
|
|
749
758
|
var {
|
|
750
759
|
staticConfig,
|
|
751
760
|
conf: conf2,
|
|
@@ -753,7 +762,47 @@ var getSubStyle = function (styleState, subKey, styleIn, avoidMergeTransform) {
|
|
|
753
762
|
} = styleState;
|
|
754
763
|
var styleOut = {};
|
|
755
764
|
var originalValues;
|
|
756
|
-
|
|
765
|
+
var styleInOriginalValues = styleOriginalValues.get(styleIn);
|
|
766
|
+
var parentProps = styleState.props;
|
|
767
|
+
styleState.props = {
|
|
768
|
+
...parentProps,
|
|
769
|
+
...styleIn
|
|
770
|
+
};
|
|
771
|
+
try {
|
|
772
|
+
var _loop = function (key1) {
|
|
773
|
+
var val = styleIn[key1];
|
|
774
|
+
key1 = conf2.shorthands[key1] || key1;
|
|
775
|
+
if (key1 === "transition") {
|
|
776
|
+
var _driver_animations;
|
|
777
|
+
var _styleState;
|
|
778
|
+
(_styleState = styleState).pseudoTransitions || (_styleState.pseudoTransitions = {});
|
|
779
|
+
styleState.pseudoTransitions[subKey] = val;
|
|
780
|
+
var driver = styleState.animationDriver;
|
|
781
|
+
if ((driver === null || driver === void 0 ? void 0 : driver.outputStyle) === "css") {
|
|
782
|
+
var _driver_animations1;
|
|
783
|
+
var animationConfig = (_driver_animations1 = driver.animations) === null || _driver_animations1 === void 0 ? void 0 : _driver_animations1[val];
|
|
784
|
+
if (animationConfig) styleOut["transition"] = `all ${animationConfig}${subKey[0] === "$" ? " !important" : ""}`;
|
|
785
|
+
}
|
|
786
|
+
if (!styleOut["transition"] && typeof val === "string" && !(driver === null || driver === void 0 ? void 0 : (_driver_animations = driver.animations) === null || _driver_animations === void 0 ? void 0 : _driver_animations[val])) styleOut["transition"] = val;
|
|
787
|
+
return key = key1, "continue";
|
|
788
|
+
}
|
|
789
|
+
if (!staticConfig.isHOC && key1 in skipProps && !styleProps.noSkip) return key = key1, "continue";
|
|
790
|
+
propMapper(key1, val, styleState, false, function (skey, sval, originalVal) {
|
|
791
|
+
var _styleInOriginalValues_skey;
|
|
792
|
+
var trackedOriginalVal = (_styleInOriginalValues_skey = styleInOriginalValues === null || styleInOriginalValues === void 0 ? void 0 : styleInOriginalValues[skey]) !== null && _styleInOriginalValues_skey !== void 0 ? _styleInOriginalValues_skey : originalVal;
|
|
793
|
+
if (trackedOriginalVal !== void 0) {
|
|
794
|
+
originalValues || (originalValues = {});
|
|
795
|
+
originalValues[skey] = trackedOriginalVal;
|
|
796
|
+
}
|
|
797
|
+
if (skey in validPseudoKeys) sval = getSubStyle(styleState, skey, sval, avoidMergeTransform);
|
|
798
|
+
if (!avoidMergeTransform && skey in stylePropsTransform) mergeTransform(styleOut, skey, sval);else styleOut[skey] = styleProps.noNormalize ? sval : normalizeValueWithProperty(sval, key1);
|
|
799
|
+
});
|
|
800
|
+
key = key1;
|
|
801
|
+
};
|
|
802
|
+
for (var key in styleIn) _loop(key);
|
|
803
|
+
} finally {
|
|
804
|
+
styleState.props = parentProps;
|
|
805
|
+
}
|
|
757
806
|
if (!avoidMergeTransform) {
|
|
758
807
|
var _styleState_style;
|
|
759
808
|
var parentTransform = (_styleState_style = styleState.style) === null || _styleState_style === void 0 ? void 0 : _styleState_style.transform;
|
|
@@ -788,7 +837,7 @@ var getSubStyle = function (styleState, subKey, styleIn, avoidMergeTransform) {
|
|
|
788
837
|
} else if (flatTransforms) mergeFlatTransforms(styleOut, flatTransforms);
|
|
789
838
|
}
|
|
790
839
|
if (!styleProps.noNormalize) fixStyles(styleOut);
|
|
791
|
-
if (originalValues) styleOriginalValues.set(styleOut, originalValues);
|
|
840
|
+
if (originalValues && Object.keys(originalValues).length) styleOriginalValues.set(styleOut, originalValues);
|
|
792
841
|
return styleOut;
|
|
793
842
|
};
|
|
794
843
|
isWeb && React.useInsertionEffect;
|
|
@@ -797,7 +846,6 @@ var useSplitStyles = function (a, b, c, d, e, f, g, h, i, j, k, l, m) {
|
|
|
797
846
|
|
|
798
847
|
return getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l, m);
|
|
799
848
|
};
|
|
800
|
-
function addStyleToInsertRules(rulesToInsert, styleObject) {}
|
|
801
849
|
var defaultColor = process.env.GUI_DEFAULT_COLOR || "rgba(0,0,0,0)";
|
|
802
850
|
var animatableDefaults = {
|
|
803
851
|
...Object.fromEntries(Object.entries(tokenCategories.color).map(function (param) {
|
|
@@ -873,5 +921,5 @@ function applyDefaultStyle(pkey, styleState) {
|
|
|
873
921
|
var defaultValues = animatableDefaults[pkey];
|
|
874
922
|
if (defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style))) mergeStyle(styleState, pkey, defaultValues, 1);
|
|
875
923
|
}
|
|
876
|
-
export { PROP_SPLIT, getSplitStyles, getSubStyle, styleOriginalValues, useSplitStyles };
|
|
924
|
+
export { PROP_SPLIT, STYLE_TOKEN_PROVENANCE_KEY, getSplitStyles, getStyleTokenProvenance, getSubStyle, styleOriginalValues, useSplitStyles };
|
|
877
925
|
//# sourceMappingURL=getSplitStyles.native.js.map
|