@tamagui/web 3.0.0-beta.765.1 → 3.0.0-beta.804.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/createComponent.cjs +83 -86
- package/dist/cjs/createComponent.native.cjs +96 -103
- package/dist/cjs/createComponent.native.js +96 -103
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createTamagui.cjs +9 -7
- package/dist/cjs/createTamagui.native.cjs +9 -7
- package/dist/cjs/createTamagui.native.js +9 -7
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/helpers/defaultAnimationDriver.cjs +0 -1
- package/dist/cjs/helpers/defaultAnimationDriver.native.cjs +0 -1
- package/dist/cjs/helpers/defaultAnimationDriver.native.js +0 -1
- package/dist/cjs/helpers/defaultAnimationDriver.native.js.map +1 -1
- package/dist/cjs/helpers/directStyleCSS.cjs +348 -0
- package/dist/cjs/helpers/directStyleCSS.native.cjs +20 -0
- package/dist/cjs/helpers/directStyleCSS.native.js +22 -0
- package/dist/cjs/helpers/directStyleCSS.native.js.map +1 -0
- package/dist/cjs/helpers/directStyleCSSCompiled.cjs +40 -0
- package/dist/cjs/helpers/directStyleCSSCompiled.native.cjs +46 -0
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js +48 -0
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js.map +1 -0
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +92 -74
- package/dist/cjs/helpers/{getFontLanguage.native.cjs → getCSSStylesAtomicCompiled.cjs} +12 -8
- package/dist/cjs/helpers/{getFontLanguage.native.js → getCSSStylesAtomicCompiled.native.cjs} +12 -8
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js +36 -0
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -0
- package/dist/cjs/helpers/getSplitStyles.cjs +2417 -548
- package/dist/cjs/helpers/getSplitStyles.native.cjs +2758 -621
- package/dist/cjs/helpers/getSplitStyles.native.js +2758 -621
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.cjs +8 -3
- package/dist/cjs/helpers/getVariantExtras.native.cjs +8 -3
- package/dist/cjs/helpers/getVariantExtras.native.js +8 -3
- package/dist/cjs/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +2 -1
- package/dist/cjs/helpers/insertStyleRule.native.cjs +68 -5
- package/dist/cjs/helpers/insertStyleRule.native.js +68 -5
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/mediaState.cjs +12 -0
- package/dist/cjs/helpers/mediaState.native.cjs +12 -0
- package/dist/cjs/helpers/mediaState.native.js +12 -0
- package/dist/cjs/helpers/mediaState.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeStyle.cjs +16 -2
- package/dist/cjs/helpers/normalizeStyle.native.cjs +16 -2
- package/dist/cjs/helpers/normalizeStyle.native.js +16 -2
- package/dist/cjs/helpers/normalizeStyle.native.js.map +1 -1
- package/dist/cjs/helpers/resolveRem.cjs +1 -1
- package/dist/cjs/helpers/skipProps.cjs +6 -1
- package/dist/cjs/helpers/skipProps.native.cjs +6 -1
- package/dist/cjs/helpers/skipProps.native.js +6 -1
- package/dist/cjs/helpers/skipProps.native.js.map +1 -1
- package/dist/cjs/helpers/styleFrontend.cjs +2 -8
- package/dist/cjs/helpers/styleFrontend.native.cjs +2 -10
- package/dist/cjs/helpers/styleFrontend.native.js +2 -10
- package/dist/cjs/helpers/styleFrontend.native.js.map +1 -1
- package/dist/cjs/helpers/styleToCSS.cjs +59 -0
- package/dist/cjs/helpers/{normalizeStylePropKeys.cjs → styleToCSS.native.cjs} +6 -4
- package/dist/cjs/helpers/{getFontLanguage.cjs → styleToCSS.native.js} +8 -4
- package/dist/cjs/helpers/styleToCSS.native.js.map +1 -0
- package/dist/cjs/helpers/subscribeToContextGroup.cjs +28 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.cjs +45 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.js +45 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/cjs/helpers/variables.cjs +3 -2
- package/dist/cjs/helpers/variables.native.cjs +3 -2
- package/dist/cjs/helpers/variables.native.js +3 -2
- package/dist/cjs/helpers/variables.native.js.map +1 -1
- package/dist/cjs/helpers/wrapStyleTags.cjs +5 -3
- package/dist/cjs/helpers/wrapStyleTags.native.cjs +3 -1
- package/dist/cjs/helpers/wrapStyleTags.native.js +3 -1
- package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.cjs +70 -89
- package/dist/cjs/hooks/useComponentState.native.cjs +70 -88
- package/dist/cjs/hooks/useComponentState.native.js +70 -88
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +3 -15
- package/dist/cjs/hooks/useMedia.native.cjs +3 -15
- package/dist/cjs/hooks/useMedia.native.js +3 -15
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useProps.cjs +7 -5
- package/dist/cjs/hooks/useProps.native.cjs +7 -5
- package/dist/cjs/hooks/useProps.native.js +7 -5
- package/dist/cjs/hooks/useProps.native.js.map +1 -1
- package/dist/cjs/hooks/useSplitStyles.cjs +42 -0
- package/dist/cjs/hooks/useSplitStyles.native.cjs +42 -0
- package/dist/cjs/hooks/useSplitStyles.native.js +44 -0
- package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -0
- package/dist/cjs/index.cjs +184 -70
- package/dist/cjs/index.native.cjs +184 -70
- package/dist/cjs/index.native.js +184 -70
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/insertFont.cjs +1 -1
- package/dist/cjs/insertFont.native.cjs +1 -0
- package/dist/cjs/insertFont.native.js +1 -0
- package/dist/cjs/insertFont.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +33 -6
- package/dist/cjs/internal-runtime.native.cjs +33 -6
- package/dist/cjs/internal-runtime.native.js +33 -6
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/cjs/setupReactNative.cjs +1 -29
- package/dist/cjs/setupReactNative.native.cjs +1 -3
- package/dist/cjs/setupReactNative.native.js +1 -3
- package/dist/cjs/setupReactNative.native.js.map +1 -1
- package/dist/cjs/static-resolve.cjs +229 -0
- package/dist/cjs/static-resolve.native.cjs +242 -0
- package/dist/cjs/static-resolve.native.js +244 -0
- package/dist/cjs/static-resolve.native.js.map +1 -0
- package/dist/cjs/styled.cjs +23 -37
- package/dist/cjs/styled.native.cjs +22 -37
- package/dist/cjs/styled.native.js +22 -37
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.cjs +4 -8
- package/dist/cjs/views/TamaguiProvider.native.cjs +4 -8
- package/dist/cjs/views/TamaguiProvider.native.js +4 -8
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/cjs/views/ThemeUpdate.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.native.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.native.js +1 -1
- package/dist/cjs/views/ThemeUpdate.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +85 -88
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +98 -105
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createTamagui.mjs +9 -7
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +9 -7
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs +0 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.native.js +0 -1
- package/dist/esm/helpers/defaultAnimationDriver.native.js.map +1 -1
- package/dist/esm/helpers/directStyleCSS.mjs +320 -0
- package/dist/esm/helpers/directStyleCSS.mjs.map +1 -0
- package/dist/esm/helpers/directStyleCSS.native.js +1 -0
- package/dist/esm/helpers/directStyleCSSCompiled.mjs +11 -0
- package/dist/esm/helpers/directStyleCSSCompiled.mjs.map +1 -0
- package/dist/esm/helpers/directStyleCSSCompiled.native.js +15 -0
- package/dist/esm/helpers/directStyleCSSCompiled.native.js.map +1 -0
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +86 -72
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs +9 -0
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs.map +1 -0
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js +9 -0
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -0
- package/dist/esm/helpers/getSplitStyles.mjs +2406 -545
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +2751 -618
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.mjs +8 -3
- package/dist/esm/helpers/getVariantExtras.mjs.map +1 -1
- package/dist/esm/helpers/getVariantExtras.native.js +8 -3
- package/dist/esm/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +2 -1
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +69 -3
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/mediaState.mjs +12 -1
- package/dist/esm/helpers/mediaState.mjs.map +1 -1
- package/dist/esm/helpers/mediaState.native.js +12 -1
- package/dist/esm/helpers/mediaState.native.js.map +1 -1
- package/dist/esm/helpers/normalizeStyle.mjs +16 -2
- package/dist/esm/helpers/normalizeStyle.mjs.map +1 -1
- package/dist/esm/helpers/normalizeStyle.native.js +16 -2
- package/dist/esm/helpers/normalizeStyle.native.js.map +1 -1
- package/dist/esm/helpers/resolveRem.mjs +1 -1
- package/dist/esm/helpers/resolveRem.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +3 -1
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +3 -1
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/styleFrontend.mjs +2 -4
- package/dist/esm/helpers/styleFrontend.mjs.map +1 -1
- package/dist/esm/helpers/styleFrontend.native.js +2 -6
- package/dist/esm/helpers/styleFrontend.native.js.map +1 -1
- package/dist/esm/helpers/styleToCSS.mjs +40 -0
- package/dist/esm/helpers/styleToCSS.mjs.map +1 -0
- package/dist/esm/helpers/styleToCSS.native.js +4 -0
- package/dist/esm/helpers/styleToCSS.native.js.map +1 -0
- package/dist/esm/helpers/subscribeToContextGroup.mjs +25 -1
- package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js +42 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/esm/helpers/variables.mjs +2 -1
- package/dist/esm/helpers/variables.mjs.map +1 -1
- package/dist/esm/helpers/variables.native.js +2 -1
- package/dist/esm/helpers/variables.native.js.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs +5 -3
- package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js +3 -1
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.mjs +71 -90
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +71 -89
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +2 -15
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +2 -15
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useProps.mjs +7 -5
- package/dist/esm/hooks/useProps.mjs.map +1 -1
- package/dist/esm/hooks/useProps.native.js +7 -5
- package/dist/esm/hooks/useProps.native.js.map +1 -1
- package/dist/esm/hooks/useSplitStyles.mjs +17 -0
- package/dist/esm/hooks/useSplitStyles.mjs.map +1 -0
- package/dist/esm/hooks/useSplitStyles.native.js +14 -0
- package/dist/esm/hooks/useSplitStyles.native.js.map +1 -0
- package/dist/esm/index.js +57 -137
- package/dist/esm/index.mjs +57 -137
- package/dist/esm/index.native.js +57 -137
- package/dist/esm/insertFont.mjs +1 -1
- package/dist/esm/insertFont.mjs.map +1 -1
- package/dist/esm/insertFont.native.js +1 -0
- package/dist/esm/insertFont.native.js.map +1 -1
- package/dist/esm/internal-runtime.mjs +23 -4
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +23 -4
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/dist/esm/setupReactNative.mjs +1 -29
- package/dist/esm/setupReactNative.mjs.map +1 -1
- package/dist/esm/setupReactNative.native.js +1 -3
- package/dist/esm/setupReactNative.native.js.map +1 -1
- package/dist/esm/static-resolve.mjs +194 -0
- package/dist/esm/static-resolve.mjs.map +1 -0
- package/dist/esm/static-resolve.native.js +205 -0
- package/dist/esm/static-resolve.native.js.map +1 -0
- package/dist/esm/styled.mjs +24 -40
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +23 -40
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.mjs +4 -8
- package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +4 -8
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/ThemeUpdate.mjs +1 -1
- package/dist/esm/views/ThemeUpdate.mjs.map +1 -1
- package/dist/esm/views/ThemeUpdate.native.js +1 -1
- package/dist/esm/views/ThemeUpdate.native.js.map +1 -1
- package/package.json +25 -15
- package/reset.css +3 -3
- package/src/createComponent.tsx +175 -192
- package/src/createTamagui.ts +10 -9
- package/src/helpers/defaultAnimationDriver.tsx +0 -1
- package/src/helpers/directStyleCSS.native.ts +1 -0
- package/src/helpers/directStyleCSS.ts +534 -0
- package/src/helpers/directStyleCSSCompiled.ts +32 -0
- package/src/helpers/getCSSStylesAtomic.ts +168 -88
- package/src/helpers/getCSSStylesAtomicCompiled.ts +9 -0
- package/src/helpers/getSplitStyles.tsx +4653 -1003
- package/src/helpers/getVariantExtras.tsx +15 -3
- package/src/helpers/insertStyleRule.tsx +4 -2
- package/src/helpers/mediaState.ts +15 -0
- package/src/helpers/normalizeStyle.ts +27 -2
- package/src/helpers/resolveRem.ts +1 -1
- package/src/helpers/skipProps.ts +3 -0
- package/src/helpers/styleFrontend.ts +20 -27
- package/src/helpers/styleToCSS.native.ts +1 -0
- package/src/helpers/styleToCSS.ts +43 -0
- package/src/helpers/subscribeToContextGroup.tsx +30 -0
- package/src/helpers/variables.ts +2 -1
- package/src/helpers/warnOnce.ts +3 -4
- package/src/helpers/wrapStyleTags.tsx +1 -1
- package/src/hooks/useComponentState.ts +118 -158
- package/src/hooks/useMedia.tsx +2 -18
- package/src/hooks/useProps.tsx +19 -15
- package/src/hooks/useSplitStyles.tsx +26 -0
- package/src/index.ts +298 -73
- package/src/insertFont.ts +5 -1
- package/src/internal-runtime.ts +49 -24
- package/src/internalRuntimeTypes.ts +2 -7
- package/src/setupReactNative.ts +7 -30
- package/src/static-resolve.ts +396 -0
- package/src/styled.tsx +34 -11
- package/src/types.tsx +40 -30
- package/src/views/TamaguiProvider.tsx +23 -22
- package/src/views/ThemeUpdate.tsx +3 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/helpers/defaultAnimationDriver.d.ts.map +1 -1
- package/types/helpers/directStyleCSS.d.ts +28 -0
- package/types/helpers/directStyleCSS.d.ts.map +1 -0
- package/types/helpers/directStyleCSS.native.d.ts +2 -0
- package/types/helpers/directStyleCSS.native.d.ts.map +1 -0
- package/types/helpers/directStyleCSSCompiled.d.ts +10 -0
- package/types/helpers/directStyleCSSCompiled.d.ts.map +1 -0
- package/types/helpers/getCSSStylesAtomic.d.ts +22 -1
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts +4 -0
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts.map +1 -0
- package/types/helpers/getSplitStyles.d.ts +11 -4
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getVariantExtras.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/mediaState.d.ts +4 -0
- package/types/helpers/mediaState.d.ts.map +1 -1
- package/types/helpers/normalizeStyle.d.ts +1 -1
- package/types/helpers/normalizeStyle.d.ts.map +1 -1
- package/types/helpers/skipProps.d.ts +2 -0
- package/types/helpers/skipProps.d.ts.map +1 -1
- package/types/helpers/styleFrontend.d.ts +13 -17
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleToCSS.d.ts +2 -0
- package/types/helpers/styleToCSS.d.ts.map +1 -0
- package/types/helpers/styleToCSS.native.d.ts +2 -0
- package/types/helpers/styleToCSS.native.d.ts.map +1 -0
- package/types/helpers/subscribeToContextGroup.d.ts +1 -0
- package/types/helpers/subscribeToContextGroup.d.ts.map +1 -1
- package/types/helpers/variables.d.ts.map +1 -1
- package/types/helpers/warnOnce.d.ts.map +1 -1
- package/types/helpers/webPropsToSkip.native.d.ts +5 -0
- package/types/helpers/webPropsToSkip.native.d.ts.map +1 -1
- package/types/hooks/useComponentState.d.ts +3 -2
- package/types/hooks/useComponentState.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts +1 -5
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useProps.d.ts.map +1 -1
- package/types/hooks/useSplitStyles.d.ts +3 -0
- package/types/hooks/useSplitStyles.d.ts.map +1 -0
- package/types/index.d.ts +58 -72
- package/types/index.d.ts.map +1 -1
- package/types/insertFont.d.ts.map +1 -1
- package/types/internal-runtime.d.ts +24 -11
- package/types/internal-runtime.d.ts.map +1 -1
- package/types/internalRuntimeTypes.d.ts +1 -6
- package/types/internalRuntimeTypes.d.ts.map +1 -1
- package/types/setupReactNative.d.ts +2 -3
- package/types/setupReactNative.d.ts.map +1 -1
- package/types/static-resolve.d.ts +79 -0
- package/types/static-resolve.d.ts.map +1 -0
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +29 -22
- package/types/types.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
- package/types/views/ThemeUpdate.d.ts.map +1 -1
- package/dist/cjs/constants/accessibilityDirectMap.cjs +0 -34
- package/dist/cjs/constants/accessibilityDirectMap.native.cjs +0 -36
- package/dist/cjs/constants/accessibilityDirectMap.native.js +0 -38
- package/dist/cjs/constants/accessibilityDirectMap.native.js.map +0 -1
- package/dist/cjs/helpers/directStyle.cjs +0 -962
- package/dist/cjs/helpers/directStyle.native.cjs +0 -1165
- package/dist/cjs/helpers/directStyle.native.js +0 -1167
- package/dist/cjs/helpers/directStyle.native.js.map +0 -1
- package/dist/cjs/helpers/frontendProgram.cjs +0 -43
- package/dist/cjs/helpers/frontendProgram.native.cjs +0 -49
- package/dist/cjs/helpers/frontendProgram.native.js +0 -51
- package/dist/cjs/helpers/frontendProgram.native.js.map +0 -1
- package/dist/cjs/helpers/getFontLanguage.native.js.map +0 -1
- package/dist/cjs/helpers/normalizeStylePropKeys.native.cjs +0 -37
- package/dist/cjs/helpers/normalizeStylePropKeys.native.js +0 -39
- package/dist/cjs/helpers/normalizeStylePropKeys.native.js.map +0 -1
- package/dist/cjs/helpers/propMapper.cjs +0 -384
- package/dist/cjs/helpers/propMapper.native.cjs +0 -536
- package/dist/cjs/helpers/propMapper.native.js +0 -538
- package/dist/cjs/helpers/propMapper.native.js.map +0 -1
- package/dist/cjs/helpers/useRenderElement.cjs +0 -47
- package/dist/cjs/helpers/useRenderElement.native.cjs +0 -53
- package/dist/cjs/helpers/useRenderElement.native.js +0 -55
- package/dist/cjs/helpers/useRenderElement.native.js.map +0 -1
- package/dist/esm/constants/accessibilityDirectMap.mjs +0 -8
- package/dist/esm/constants/accessibilityDirectMap.mjs.map +0 -1
- package/dist/esm/constants/accessibilityDirectMap.native.js +0 -8
- package/dist/esm/constants/accessibilityDirectMap.native.js.map +0 -1
- package/dist/esm/helpers/directStyle.mjs +0 -929
- package/dist/esm/helpers/directStyle.mjs.map +0 -1
- package/dist/esm/helpers/directStyle.native.js +0 -1132
- package/dist/esm/helpers/directStyle.native.js.map +0 -1
- package/dist/esm/helpers/frontendProgram.mjs +0 -20
- package/dist/esm/helpers/frontendProgram.mjs.map +0 -1
- package/dist/esm/helpers/frontendProgram.native.js +0 -24
- package/dist/esm/helpers/frontendProgram.native.js.map +0 -1
- package/dist/esm/helpers/getFontLanguage.mjs +0 -4
- package/dist/esm/helpers/getFontLanguage.mjs.map +0 -1
- package/dist/esm/helpers/getFontLanguage.native.js +0 -6
- package/dist/esm/helpers/getFontLanguage.native.js.map +0 -1
- package/dist/esm/helpers/normalizeStylePropKeys.mjs +0 -4
- package/dist/esm/helpers/normalizeStylePropKeys.mjs.map +0 -1
- package/dist/esm/helpers/normalizeStylePropKeys.native.js +0 -15
- package/dist/esm/helpers/normalizeStylePropKeys.native.js.map +0 -1
- package/dist/esm/helpers/propMapper.mjs +0 -360
- package/dist/esm/helpers/propMapper.mjs.map +0 -1
- package/dist/esm/helpers/propMapper.native.js +0 -511
- package/dist/esm/helpers/propMapper.native.js.map +0 -1
- package/dist/esm/helpers/useRenderElement.mjs +0 -26
- package/dist/esm/helpers/useRenderElement.mjs.map +0 -1
- package/dist/esm/helpers/useRenderElement.native.js +0 -31
- package/dist/esm/helpers/useRenderElement.native.js.map +0 -1
- package/src/constants/accessibilityDirectMap.native.tsx +0 -10
- package/src/constants/accessibilityDirectMap.tsx +0 -11
- package/src/helpers/directStyle.ts +0 -2294
- package/src/helpers/frontendProgram.ts +0 -48
- package/src/helpers/getFontLanguage.ts +0 -2
- package/src/helpers/normalizeStylePropKeys.native.ts +0 -12
- package/src/helpers/normalizeStylePropKeys.ts +0 -3
- package/src/helpers/propMapper.ts +0 -721
- package/src/helpers/useRenderElement.tsx +0 -73
- package/types/constants/accessibilityDirectMap.d.ts +0 -6
- package/types/constants/accessibilityDirectMap.d.ts.map +0 -1
- package/types/constants/accessibilityDirectMap.native.d.ts +0 -6
- package/types/constants/accessibilityDirectMap.native.d.ts.map +0 -1
- package/types/helpers/directStyle.d.ts +0 -15
- package/types/helpers/directStyle.d.ts.map +0 -1
- package/types/helpers/frontendProgram.d.ts +0 -10
- package/types/helpers/frontendProgram.d.ts.map +0 -1
- package/types/helpers/getFontLanguage.d.ts +0 -2
- package/types/helpers/getFontLanguage.d.ts.map +0 -1
- package/types/helpers/normalizeStylePropKeys.d.ts +0 -2
- package/types/helpers/normalizeStylePropKeys.d.ts.map +0 -1
- package/types/helpers/normalizeStylePropKeys.native.d.ts +0 -13
- package/types/helpers/normalizeStylePropKeys.native.d.ts.map +0 -1
- package/types/helpers/propMapper.d.ts +0 -6
- package/types/helpers/propMapper.d.ts.map +0 -1
- package/types/helpers/useRenderElement.d.ts +0 -13
- package/types/helpers/useRenderElement.d.ts.map +0 -1
|
@@ -1,1167 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
-
get: () => from[key],
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
-
var directStyle_exports = {};
|
|
24
|
-
__export(directStyle_exports, {
|
|
25
|
-
clearDirectStyle: () => clearDirectStyle,
|
|
26
|
-
contributeFrontendValue: () => contributeFrontendValue,
|
|
27
|
-
contributeStyleString: () => contributeStyleString,
|
|
28
|
-
contributeStyleValue: () => contributeStyleValue,
|
|
29
|
-
contributeVariantClauseValue: () => contributeVariantClauseValue,
|
|
30
|
-
directStyleSignature: () => directStyleSignature,
|
|
31
|
-
flushDirectStyles: () => flushDirectStyles,
|
|
32
|
-
getDirectDynamicThemeAccess: () => getDirectDynamicThemeAccess,
|
|
33
|
-
isConditionalStyleObject: () => isConditionalStyleObject,
|
|
34
|
-
platformMatches: () => platformMatches,
|
|
35
|
-
resolveClauseChain: () => resolveClauseChain
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(directStyle_exports);
|
|
38
|
-
var import_constants = require("@tamagui/constants");
|
|
39
|
-
var import_helpers = require("@tamagui/helpers");
|
|
40
|
-
var import_runtime = require("@tamagui/style-grammar/runtime");
|
|
41
|
-
var import_createVariable = require("../createVariable.native.js");
|
|
42
|
-
var import_useMedia = require("../hooks/useMedia.native.js");
|
|
43
|
-
var import_warnOnce = require("./warnOnce.native.js");
|
|
44
|
-
var import_expandStyle = require("./expandStyle.native.js");
|
|
45
|
-
var import_getCSSStylesAtomic = require("./getCSSStylesAtomic.native.js");
|
|
46
|
-
var import_grammarConfig = require("./grammarConfig.native.js");
|
|
47
|
-
var import_getDynamicVal = require("./getDynamicVal.native.js");
|
|
48
|
-
var import_insertStyleRule = require("./insertStyleRule.native.js");
|
|
49
|
-
var import_normalizeColor = require("./normalizeColor.native.js");
|
|
50
|
-
var import_parseNativeStyle = require("./parseNativeStyle.native.js");
|
|
51
|
-
var import_parseNativeTransform = require("./parseNativeTransform.native.js");
|
|
52
|
-
var import_tokenCategories = require("./tokenCategories.native.js");
|
|
53
|
-
var import_resolveSafeAreaVariable = require("./resolveSafeAreaVariable.native.js");
|
|
54
|
-
var import_resolveSafeArea = require("./resolveSafeArea.native.js");
|
|
55
|
-
var import_resolveVariableValue = require("./resolveVariableValue.native.js");
|
|
56
|
-
var import_themeRef = require("./themeRef.native.js");
|
|
57
|
-
var import_transformsToString = require("./transformsToString.native.js");
|
|
58
|
-
function _type_of(obj) {
|
|
59
|
-
"@swc/helpers - typeof";
|
|
60
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
61
|
-
}
|
|
62
|
-
var directStyleHandler = {
|
|
63
|
-
segment(state, start, end, isBase, valid, source, chainStart, chainEnd, chainValid, chainCount, _result, failure, failureIndex, property, merge, originalValue, contextOnly) {
|
|
64
|
-
if (isBase) {
|
|
65
|
-
if (start === end) return;
|
|
66
|
-
if (!valid) {
|
|
67
|
-
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, source, failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : "an unterminated \"(\"");
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
var value = source.slice(start, end);
|
|
71
|
-
emitValue(state, property, value, 0, "", void 0, "", "", merge, value, contextOnly);
|
|
72
|
-
return 5;
|
|
73
|
-
}
|
|
74
|
-
if (!chainValid) {
|
|
75
|
-
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, source, failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : "an unterminated \"(\"");
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (start === end) {
|
|
79
|
-
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, source, "a conditional clause has no value");
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
if (property === "aspectRatio" && chainCount === 1) {
|
|
83
|
-
var left = Number(source.slice(chainStart, chainEnd));
|
|
84
|
-
var right = Number(source.slice(start, end));
|
|
85
|
-
if (chainStart < chainEnd && Number.isFinite(left) && left > 0 && Number.isFinite(right) && right > 0) return 12;
|
|
86
|
-
}
|
|
87
|
-
var condition = resolveClauseChain(state, source, chainStart, chainEnd, property, void 0, valid ? merge : void 0, void 0, contextOnly, start, end, 1);
|
|
88
|
-
if (!condition) return;
|
|
89
|
-
if (!valid) {
|
|
90
|
-
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, source, failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : "an unterminated \"(\"");
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
return 4 | (condition & 12 ? 2 : 0);
|
|
94
|
-
},
|
|
95
|
-
chain() {
|
|
96
|
-
return true;
|
|
97
|
-
},
|
|
98
|
-
end(state, source, result, lastPayloadStart, chainCount, property, merge, originalValue, contextOnly) {
|
|
99
|
-
var hasBase = !!(result & 1);
|
|
100
|
-
if (result & 8 && chainCount === 1) {
|
|
101
|
-
emitValue(state, property, source, 0, "", void 0, "", "", merge, originalValue !== null && originalValue !== void 0 ? originalValue : source, contextOnly);
|
|
102
|
-
hasBase = true;
|
|
103
|
-
}
|
|
104
|
-
if (process.env.NODE_ENV === "development" && !hasBase && result & 4 && (property in import_helpers.tokenCategories.color || property in import_tokenCategories.tokenCategoryByProperty) && splitComponents(source.slice(lastPayloadStart)).length > 1) (0, import_warnOnce.warnOnce)(`${property}="${source}" has multiple values after its first conditional. Write the base value before the first conditional.`);
|
|
105
|
-
if ((!import_constants.isWeb || !state.flatShouldDoClasses) && result & 2 && !hasBase) {
|
|
106
|
-
var value = implicitLifecycleBase(property);
|
|
107
|
-
if (value !== null) emitValue(state, property, value, 0, "", void 0, "", "", merge, value, contextOnly);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
function implicitLifecycleBase(property) {
|
|
112
|
-
return property === "opacity" || property === "scale" || property === "scaleX" || property === "scaleY" ? 1 : property === "rotate" ? "0deg" : property === "x" || property === "y" ? 0 : null;
|
|
113
|
-
}
|
|
114
|
-
var legacyTransformParts = /* @__PURE__ */ new Set([
|
|
115
|
-
"matrix",
|
|
116
|
-
"perspective",
|
|
117
|
-
"rotateX",
|
|
118
|
-
"rotateY",
|
|
119
|
-
"rotateZ",
|
|
120
|
-
"scaleZ",
|
|
121
|
-
"skewX",
|
|
122
|
-
"skewY"
|
|
123
|
-
]);
|
|
124
|
-
var webShadowParts = /* @__PURE__ */ new Set([
|
|
125
|
-
"shadowColor",
|
|
126
|
-
"shadowOffset",
|
|
127
|
-
"shadowOpacity",
|
|
128
|
-
"shadowRadius"
|
|
129
|
-
]);
|
|
130
|
-
var webTextShadowParts = /* @__PURE__ */ new Set([
|
|
131
|
-
"textShadowColor",
|
|
132
|
-
"textShadowOffset",
|
|
133
|
-
"textShadowRadius"
|
|
134
|
-
]);
|
|
135
|
-
var lineStyles = /* @__PURE__ */ new Set([
|
|
136
|
-
"none",
|
|
137
|
-
"hidden",
|
|
138
|
-
"dotted",
|
|
139
|
-
"dashed",
|
|
140
|
-
"solid",
|
|
141
|
-
"double",
|
|
142
|
-
"groove",
|
|
143
|
-
"ridge",
|
|
144
|
-
"inset",
|
|
145
|
-
"outset"
|
|
146
|
-
]);
|
|
147
|
-
var borderTargets = {
|
|
148
|
-
border: {
|
|
149
|
-
width: [
|
|
150
|
-
"borderTopWidth",
|
|
151
|
-
"borderRightWidth",
|
|
152
|
-
"borderBottomWidth",
|
|
153
|
-
"borderLeftWidth"
|
|
154
|
-
],
|
|
155
|
-
style: [
|
|
156
|
-
"borderTopStyle",
|
|
157
|
-
"borderRightStyle",
|
|
158
|
-
"borderBottomStyle",
|
|
159
|
-
"borderLeftStyle"
|
|
160
|
-
],
|
|
161
|
-
color: [
|
|
162
|
-
"borderTopColor",
|
|
163
|
-
"borderRightColor",
|
|
164
|
-
"borderBottomColor",
|
|
165
|
-
"borderLeftColor"
|
|
166
|
-
]
|
|
167
|
-
},
|
|
168
|
-
borderTop: {
|
|
169
|
-
width: ["borderTopWidth"],
|
|
170
|
-
style: ["borderTopStyle"],
|
|
171
|
-
color: ["borderTopColor"]
|
|
172
|
-
},
|
|
173
|
-
borderRight: {
|
|
174
|
-
width: ["borderRightWidth"],
|
|
175
|
-
style: ["borderRightStyle"],
|
|
176
|
-
color: ["borderRightColor"]
|
|
177
|
-
},
|
|
178
|
-
borderBottom: {
|
|
179
|
-
width: ["borderBottomWidth"],
|
|
180
|
-
style: ["borderBottomStyle"],
|
|
181
|
-
color: ["borderBottomColor"]
|
|
182
|
-
},
|
|
183
|
-
borderLeft: {
|
|
184
|
-
width: ["borderLeftWidth"],
|
|
185
|
-
style: ["borderLeftStyle"],
|
|
186
|
-
color: ["borderLeftColor"]
|
|
187
|
-
},
|
|
188
|
-
outline: {
|
|
189
|
-
width: ["outlineWidth"],
|
|
190
|
-
style: ["outlineStyle"],
|
|
191
|
-
color: ["outlineColor"]
|
|
192
|
-
},
|
|
193
|
-
borderBlock: {
|
|
194
|
-
width: ["borderBlockStartWidth", "borderBlockEndWidth"],
|
|
195
|
-
style: ["borderBlockStartStyle", "borderBlockEndStyle"],
|
|
196
|
-
color: ["borderBlockStartColor", "borderBlockEndColor"]
|
|
197
|
-
},
|
|
198
|
-
borderInline: {
|
|
199
|
-
width: ["borderInlineStartWidth", "borderInlineEndWidth"],
|
|
200
|
-
style: ["borderInlineStartStyle", "borderInlineEndStyle"],
|
|
201
|
-
color: ["borderInlineStartColor", "borderInlineEndColor"]
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
var borderStyleDefaults = {
|
|
205
|
-
borderWidth: "borderStyle",
|
|
206
|
-
borderTopWidth: "borderTopStyle",
|
|
207
|
-
borderRightWidth: "borderRightStyle",
|
|
208
|
-
borderBottomWidth: "borderBottomStyle",
|
|
209
|
-
borderLeftWidth: "borderLeftStyle"
|
|
210
|
-
};
|
|
211
|
-
function platformMatches(name) {
|
|
212
|
-
if (name === "web") return import_constants.isWeb;
|
|
213
|
-
if (name === "native") return !import_constants.isWeb;
|
|
214
|
-
if (name === "ios") return import_constants.isIos;
|
|
215
|
-
if (name === "android") return import_constants.isAndroid;
|
|
216
|
-
if (name === "tvos") return import_constants.isIos && import_constants.isTV;
|
|
217
|
-
if (name === "androidtv") return import_constants.isAndroid && import_constants.isTV;
|
|
218
|
-
return name === "tv" && import_constants.isTV;
|
|
219
|
-
}
|
|
220
|
-
function resolveClauseChain(state, source, start, end, property, raw, merge, originalValue) {
|
|
221
|
-
var contextOnly = arguments.length > 8 && arguments[8] !== void 0 ? arguments[8] : false, payloadStart = arguments.length > 9 && arguments[9] !== void 0 ? arguments[9] : -1, payloadEnd = arguments.length > 10 && arguments[10] !== void 0 ? arguments[10] : -1, warning = arguments.length > 11 && arguments[11] !== void 0 ? arguments[11] : 0;
|
|
222
|
-
var compiled = (0, import_grammarConfig.getConfigRevisionState)(state.conf);
|
|
223
|
-
var sourceStart = start;
|
|
224
|
-
var key = "";
|
|
225
|
-
var active = true;
|
|
226
|
-
var emit = true;
|
|
227
|
-
var selector = "";
|
|
228
|
-
var wrappers;
|
|
229
|
-
var theme = "";
|
|
230
|
-
var enter = false;
|
|
231
|
-
var exit = false;
|
|
232
|
-
var unsupportedState = "";
|
|
233
|
-
var platformRank = 0;
|
|
234
|
-
var depth = 0;
|
|
235
|
-
var categoryRank = 0;
|
|
236
|
-
var withinRank = 0;
|
|
237
|
-
var selfStateSpecificity = 0;
|
|
238
|
-
for (var index = start; index <= end; index++) {
|
|
239
|
-
if (index !== end && source.charCodeAt(index) !== 58) continue;
|
|
240
|
-
var modifier = source.slice(start, index);
|
|
241
|
-
start = index + 1;
|
|
242
|
-
var code = compiled.modifiers[modifier];
|
|
243
|
-
var kind = code & 7;
|
|
244
|
-
var rank = code >> 3;
|
|
245
|
-
var stateSelector = "";
|
|
246
|
-
var conditionStateName = "";
|
|
247
|
-
var groupName = "";
|
|
248
|
-
var containerSize = "";
|
|
249
|
-
var containerName = "";
|
|
250
|
-
var containerQuery = "";
|
|
251
|
-
if (kind === import_runtime.modifierKindState) {
|
|
252
|
-
modifier = import_runtime.canonicalStateModifierNames[rank];
|
|
253
|
-
stateSelector = import_runtime.stateModifierSelectors[rank];
|
|
254
|
-
} else if (!kind && modifier.startsWith("group-")) {
|
|
255
|
-
var slash = modifier.indexOf("/");
|
|
256
|
-
var authoredState = modifier.slice(6, slash === -1 ? void 0 : slash);
|
|
257
|
-
code = compiled.modifiers[authoredState];
|
|
258
|
-
if ((code & 7) !== import_runtime.modifierKindState) kind = 0;
|
|
259
|
-
else {
|
|
260
|
-
rank = code >> 3;
|
|
261
|
-
groupName = slash === -1 ? "true" : modifier.slice(slash + 1);
|
|
262
|
-
if (rank === 6 || rank === 7 || slash !== -1 && !(0, import_runtime.isModifierName)(groupName, 0, groupName.length)) kind = 0;
|
|
263
|
-
else {
|
|
264
|
-
kind = 5;
|
|
265
|
-
var stateName = import_runtime.canonicalStateModifierNames[rank];
|
|
266
|
-
conditionStateName = stateName;
|
|
267
|
-
stateSelector = import_runtime.stateModifierSelectors[rank];
|
|
268
|
-
modifier = `group-${stateName}${slash === -1 ? "" : modifier.slice(slash)}`;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
} else if (!kind && modifier.charCodeAt(0) === 64) {
|
|
272
|
-
var slash1 = modifier.indexOf("/");
|
|
273
|
-
containerSize = modifier.slice(1, slash1 === -1 ? void 0 : slash1);
|
|
274
|
-
containerName = slash1 === -1 ? "" : modifier.slice(slash1 + 1);
|
|
275
|
-
if ((0, import_runtime.isModifierName)(containerSize, 0, containerSize.length) && (slash1 === -1 || (0, import_runtime.isModifierName)(containerName, 0, containerName.length)) && ((code = compiled.modifiers[containerSize]) & 7) === import_runtime.modifierKindMedia && (containerQuery = compiled.mediaQueries[containerSize]) && (0, import_runtime.isContainerSizeQueryText)(containerQuery)) {
|
|
276
|
-
kind = 6;
|
|
277
|
-
rank = code >> 3;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
if (!kind) {
|
|
281
|
-
if (warning && process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, warning === 1 ? source : raw, `unknown modifier "${source.slice(sourceStart, end)}"`);
|
|
282
|
-
return 0;
|
|
283
|
-
}
|
|
284
|
-
var slotStart = 0;
|
|
285
|
-
var duplicate = false;
|
|
286
|
-
var inserted = !key;
|
|
287
|
-
if (!key) key = modifier;
|
|
288
|
-
else {
|
|
289
|
-
while (slotStart <= key.length) {
|
|
290
|
-
var slotEnd = key.indexOf(":", slotStart);
|
|
291
|
-
if (slotEnd === -1) slotEnd = key.length;
|
|
292
|
-
var order = 0;
|
|
293
|
-
var compareLength = Math.min(modifier.length, slotEnd - slotStart);
|
|
294
|
-
for (var offset = 0; offset < compareLength; offset++) {
|
|
295
|
-
order = modifier.charCodeAt(offset) - key.charCodeAt(slotStart + offset);
|
|
296
|
-
if (order) break;
|
|
297
|
-
}
|
|
298
|
-
order || (order = modifier.length - (slotEnd - slotStart));
|
|
299
|
-
if (!order) {
|
|
300
|
-
duplicate = true;
|
|
301
|
-
break;
|
|
302
|
-
}
|
|
303
|
-
if (order < 0) {
|
|
304
|
-
key = `${key.slice(0, slotStart)}${modifier}:${key.slice(slotStart)}`;
|
|
305
|
-
inserted = true;
|
|
306
|
-
break;
|
|
307
|
-
}
|
|
308
|
-
if (slotEnd === key.length) break;
|
|
309
|
-
slotStart = slotEnd + 1;
|
|
310
|
-
}
|
|
311
|
-
if (!duplicate && !inserted) key += `:${modifier}`;
|
|
312
|
-
}
|
|
313
|
-
if (duplicate) continue;
|
|
314
|
-
if (kind === import_runtime.modifierKindPlatform) {
|
|
315
|
-
if (rank > platformRank) platformRank = rank;
|
|
316
|
-
var matches = platformMatches(modifier);
|
|
317
|
-
active && (active = matches);
|
|
318
|
-
emit && (emit = matches);
|
|
319
|
-
continue;
|
|
320
|
-
}
|
|
321
|
-
depth++;
|
|
322
|
-
var nextCategory = kind === import_runtime.modifierKindMedia ? 0 : kind === 6 ? 1 : kind === import_runtime.modifierKindTheme ? 2 : kind === 5 ? 3 : 4;
|
|
323
|
-
if (nextCategory > categoryRank) {
|
|
324
|
-
categoryRank = nextCategory;
|
|
325
|
-
withinRank = rank;
|
|
326
|
-
} else if (nextCategory === categoryRank && rank > withinRank) withinRank = rank;
|
|
327
|
-
if (kind === import_runtime.modifierKindMedia) {
|
|
328
|
-
var _state_flatMediaState;
|
|
329
|
-
var _state;
|
|
330
|
-
var query = compiled.mediaQueries[modifier];
|
|
331
|
-
if (!query) return 0;
|
|
332
|
-
(wrappers || (wrappers = [])).push(`@media ${query}`);
|
|
333
|
-
active && (active = !!((_state_flatMediaState = state.flatMediaState) === null || _state_flatMediaState === void 0 ? void 0 : _state_flatMediaState[modifier]));
|
|
334
|
-
((_state = state).flatMediaKeys || (_state.flatMediaKeys = /* @__PURE__ */ new Set())).add(modifier);
|
|
335
|
-
} else if (kind === import_runtime.modifierKindTheme) {
|
|
336
|
-
var _state_flatThemeName;
|
|
337
|
-
theme = modifier;
|
|
338
|
-
selector += `:where(.t_${modifier}, .t_${modifier} *)`;
|
|
339
|
-
active && (active = state.flatThemeName === modifier || ((_state_flatThemeName = state.flatThemeName) === null || _state_flatThemeName === void 0 ? void 0 : _state_flatThemeName.startsWith(`${modifier}_`)) === true);
|
|
340
|
-
} else if (kind === 5) {
|
|
341
|
-
var _state_componentState_group, _state_flatGroupContext, _this;
|
|
342
|
-
var _state1;
|
|
343
|
-
selector += `:where(.t_group_${groupName}${stateSelector} *)`;
|
|
344
|
-
if (rank === 0) (wrappers || (wrappers = [])).push("@media (hover: hover)");
|
|
345
|
-
var component = (_state_componentState_group = state.componentState.group) === null || _state_componentState_group === void 0 ? void 0 : _state_componentState_group[groupName];
|
|
346
|
-
var context = (_state_flatGroupContext = state.flatGroupContext) === null || _state_flatGroupContext === void 0 ? void 0 : _state_flatGroupContext[groupName];
|
|
347
|
-
var _component_pseudo;
|
|
348
|
-
active && (active = !!((_this = (_component_pseudo = component === null || component === void 0 ? void 0 : component.pseudo) !== null && _component_pseudo !== void 0 ? _component_pseudo : context === null || context === void 0 ? void 0 : context.state.pseudo) === null || _this === void 0 ? void 0 : _this[conditionStateName]));
|
|
349
|
-
((_state1 = state).flatGroupKeys || (_state1.flatGroupKeys = /* @__PURE__ */ new Set())).add(groupName);
|
|
350
|
-
} else if (kind === 6) {
|
|
351
|
-
var _state_componentState_group1, _state_flatGroupContext1, _component_media;
|
|
352
|
-
var _state2, _state3;
|
|
353
|
-
var groupKey = `@${containerName}`;
|
|
354
|
-
(wrappers || (wrappers = [])).push(containerName ? `@container ${containerName} ${containerQuery}` : `@container ${containerQuery}`);
|
|
355
|
-
var component1 = (_state_componentState_group1 = state.componentState.group) === null || _state_componentState_group1 === void 0 ? void 0 : _state_componentState_group1[groupKey];
|
|
356
|
-
var context1 = (_state_flatGroupContext1 = state.flatGroupContext) === null || _state_flatGroupContext1 === void 0 ? void 0 : _state_flatGroupContext1[groupKey];
|
|
357
|
-
var match = component1 === null || component1 === void 0 ? void 0 : (_component_media = component1.media) === null || _component_media === void 0 ? void 0 : _component_media[containerSize];
|
|
358
|
-
active && (active = match === void 0 ? !!((context1 === null || context1 === void 0 ? void 0 : context1.state.layout) && (0, import_useMedia.mediaKeyMatch)(containerSize, context1.state.layout)) : !!match);
|
|
359
|
-
((_state2 = state).flatGroupKeys || (_state2.flatGroupKeys = /* @__PURE__ */ new Set())).add(groupKey);
|
|
360
|
-
((_state3 = state).flatGroupMedia || (_state3.flatGroupMedia = /* @__PURE__ */ new Set())).add(containerSize);
|
|
361
|
-
} else {
|
|
362
|
-
selfStateSpecificity++;
|
|
363
|
-
if (!import_constants.isWeb && stateSelector[0] === "[" && modifier !== "disabled") unsupportedState = modifier;
|
|
364
|
-
if (stateSelector[0] === ".") {
|
|
365
|
-
selector += `:is(${stateSelector}, ${stateSelector} *)`;
|
|
366
|
-
if (rank === 6) enter = true;
|
|
367
|
-
else exit = true;
|
|
368
|
-
} else selector += stateSelector;
|
|
369
|
-
if (rank === 0) (wrappers || (wrappers = [])).push("@media (hover: hover)");
|
|
370
|
-
var component2 = state.componentState;
|
|
371
|
-
active && (active = rank === 0 ? !!component2.hover : rank === 4 ? !!(component2.press || component2.pressIn) : rank === 2 ? !!component2.focus : rank === 3 ? !!component2.focusVisible : rank === 1 ? !!component2.focusWithin : rank === 5 ? !!(component2.disabled || state.props.disabled) : rank === 6 ? !!component2.unmounted : rank === 7 ? !!state.styleProps.isExiting : false);
|
|
372
|
-
if (stateSelector[0] === ":") {
|
|
373
|
-
var _state4;
|
|
374
|
-
((_state4 = state).flatStateKeys || (_state4.flatStateKeys = /* @__PURE__ */ new Set())).add(modifier);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
if (depth > 5) throw new Error(`a flat value clause supports at most 5 non-platform conditions; received ${depth} in "${source.slice(sourceStart, end)}:"`);
|
|
379
|
-
var condition = (platformRank << 26 | depth << 23 | categoryRank << 20 | withinRank) * 256 + selfStateSpecificity * 32 + 16 + (active ? 1 : 0) + (emit ? 2 : 0) + (enter ? 4 : 0) + (exit ? 8 : 0);
|
|
380
|
-
if (warning && unsupportedState && process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`${property}: "${unsupportedState}:" has no native component-state source; dropping the clause`);
|
|
381
|
-
if (merge && property && condition & 2 && (condition & 1 || import_constants.isWeb && state.flatShouldDoClasses || warning === 1 && !import_constants.isWeb && theme && import_constants.supportsDynamicColorIOS && (0, import_getDynamicVal.isColorStyleKey)(property))) {
|
|
382
|
-
var value = payloadStart === -1 ? raw : source.slice(payloadStart, payloadEnd);
|
|
383
|
-
emitValue(state, property, value, condition, key, wrappers, selector, theme, merge, warning === 2 ? originalValue : originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
|
|
384
|
-
}
|
|
385
|
-
return condition;
|
|
386
|
-
}
|
|
387
|
-
var tokenLookup = {
|
|
388
|
-
value: void 0,
|
|
389
|
-
fromTheme: false,
|
|
390
|
-
themeKey: ""
|
|
391
|
-
};
|
|
392
|
-
function fillTokenLookup(value, fromTheme, themeKey) {
|
|
393
|
-
tokenLookup.value = value;
|
|
394
|
-
tokenLookup.fromTheme = fromTheme;
|
|
395
|
-
tokenLookup.themeKey = themeKey;
|
|
396
|
-
return tokenLookup;
|
|
397
|
-
}
|
|
398
|
-
function tokenVariable(state, property, name) {
|
|
399
|
-
var _state_theme, _state_conf_themes_, _state_conf_themes, _state_conf_tokensParsed_space, _state_conf_tokensParsed_color;
|
|
400
|
-
var lookupName = name.charCodeAt(0) === 36 ? name.slice(1) : name;
|
|
401
|
-
if (property === "fontFamily") {
|
|
402
|
-
var _state_conf_fontsParsed_lookupName;
|
|
403
|
-
var family = (_state_conf_fontsParsed_lookupName = state.conf.fontsParsed[lookupName]) === null || _state_conf_fontsParsed_lookupName === void 0 ? void 0 : _state_conf_fontsParsed_lookupName.family;
|
|
404
|
-
return family ? fillTokenLookup(family, false, lookupName) : void 0;
|
|
405
|
-
}
|
|
406
|
-
var fontKey = property === "fontSize" ? "size" : property === "fontWeight" ? "weight" : property === "lineHeight" || property === "letterSpacing" ? property : void 0;
|
|
407
|
-
if (fontKey) {
|
|
408
|
-
var _font_fontKey;
|
|
409
|
-
var font = state.conf.fontsParsed[state.fontFamily || state.conf.defaultFontToken] || state.conf.fontsParsed[state.conf.defaultFontToken];
|
|
410
|
-
var value = font === null || font === void 0 ? void 0 : (_font_fontKey = font[fontKey]) === null || _font_fontKey === void 0 ? void 0 : _font_fontKey[lookupName];
|
|
411
|
-
return value ? fillTokenLookup(value, false, lookupName) : void 0;
|
|
412
|
-
}
|
|
413
|
-
var category = (0, import_tokenCategories.getTokenCategoryForProperty)(property);
|
|
414
|
-
var dot = lookupName.indexOf(".");
|
|
415
|
-
if (dot !== -1) {
|
|
416
|
-
var prefix = lookupName.slice(0, dot);
|
|
417
|
-
if (!category || prefix === category || prefix === "color") lookupName = lookupName.slice(dot + 1);
|
|
418
|
-
}
|
|
419
|
-
if (category) {
|
|
420
|
-
var _state_conf_tokensParsed_category;
|
|
421
|
-
var own = (_state_conf_tokensParsed_category = state.conf.tokensParsed[category]) === null || _state_conf_tokensParsed_category === void 0 ? void 0 : _state_conf_tokensParsed_category[lookupName];
|
|
422
|
-
if (own) return fillTokenLookup(own, false, lookupName);
|
|
423
|
-
for (var _i = 0, _iter = [
|
|
424
|
-
"color",
|
|
425
|
-
"space",
|
|
426
|
-
"size",
|
|
427
|
-
"radius",
|
|
428
|
-
"zIndex"
|
|
429
|
-
]; _i < _iter.length; _i++) {
|
|
430
|
-
var sibling = _iter[_i];
|
|
431
|
-
var _state_conf_tokensParsed_sibling;
|
|
432
|
-
if (sibling !== category && ((_state_conf_tokensParsed_sibling = state.conf.tokensParsed[sibling]) === null || _state_conf_tokensParsed_sibling === void 0 ? void 0 : _state_conf_tokensParsed_sibling[lookupName])) return;
|
|
433
|
-
}
|
|
434
|
-
} else {
|
|
435
|
-
var first = lookupName.charCodeAt(0);
|
|
436
|
-
if (first >= 48 && first <= 57 || first === 43 || first === 45 || first === 46) return;
|
|
437
|
-
}
|
|
438
|
-
var theme = ((_state_theme = state.theme) === null || _state_theme === void 0 ? void 0 : _state_theme[lookupName]) || ((_state_conf_themes = state.conf.themes) === null || _state_conf_themes === void 0 ? void 0 : (_state_conf_themes_ = _state_conf_themes[state.flatThemeName || ""]) === null || _state_conf_themes_ === void 0 ? void 0 : _state_conf_themes_[lookupName]);
|
|
439
|
-
if (theme) return fillTokenLookup(theme, true, lookupName);
|
|
440
|
-
if (category) return;
|
|
441
|
-
var token = ((_state_conf_tokensParsed_space = state.conf.tokensParsed.space) === null || _state_conf_tokensParsed_space === void 0 ? void 0 : _state_conf_tokensParsed_space[lookupName]) || ((_state_conf_tokensParsed_color = state.conf.tokensParsed.color) === null || _state_conf_tokensParsed_color === void 0 ? void 0 : _state_conf_tokensParsed_color[lookupName]);
|
|
442
|
-
return token ? fillTokenLookup(token, false, lookupName) : void 0;
|
|
443
|
-
}
|
|
444
|
-
function configuredValue(state, property, raw) {
|
|
445
|
-
var name = raw;
|
|
446
|
-
var opacity;
|
|
447
|
-
var slash = raw.lastIndexOf("/");
|
|
448
|
-
if (slash > 0) {
|
|
449
|
-
var amount = Number(raw.slice(slash + 1));
|
|
450
|
-
if (Number.isInteger(amount) && amount >= 0 && amount <= 100) {
|
|
451
|
-
name = raw.slice(0, slash);
|
|
452
|
-
opacity = amount;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
var safeArea = (0, import_resolveSafeAreaVariable.resolveSafeAreaVariable)(name);
|
|
456
|
-
if (safeArea !== void 0) {
|
|
457
|
-
state.flatUsesSafeArea = true;
|
|
458
|
-
return safeArea;
|
|
459
|
-
}
|
|
460
|
-
var lookup = tokenVariable(state, property, name);
|
|
461
|
-
if (!lookup || !(0, import_createVariable.isVariable)(lookup.value)) {
|
|
462
|
-
var _state_conf_tokensParsed_color;
|
|
463
|
-
if (process.env.NODE_ENV === "development" && import_tokenCategories.tokenCategoryByProperty[property] && ((_state_conf_tokensParsed_color = state.conf.tokensParsed.color) === null || _state_conf_tokensParsed_color === void 0 ? void 0 : _state_conf_tokensParsed_color[name])) (0, import_warnOnce.warnOnce)(`"${name}" contributes to "color", not "${property}"; keeping it literal`);
|
|
464
|
-
return raw;
|
|
465
|
-
}
|
|
466
|
-
var resolveValues = import_constants.isWeb && !state.flatShouldDoClasses && state.styleProps.resolveValues === "auto" ? "value" : state.styleProps.resolveValues;
|
|
467
|
-
if (resolveValues === "except-theme" && lookup.fromTheme) return `${import_themeRef.THEME_REF_PREFIX}${lookup.themeKey}${opacity !== void 0 ? `/${opacity}` : ""}`;
|
|
468
|
-
var value = (0, import_resolveVariableValue.resolveVariableValue)(property, lookup.value, resolveValues);
|
|
469
|
-
if (opacity !== void 0) value = import_constants.isWeb ? `color-mix(in srgb, ${value} ${opacity}%, transparent)` : (0, import_normalizeColor.normalizeColor)(value, opacity / 100);
|
|
470
|
-
return value;
|
|
471
|
-
}
|
|
472
|
-
var letterFreeCallPattern = /^[A-Za-z-]+\([^A-Za-z]*\)$/;
|
|
473
|
-
function resolveEmbeddedTokens(state, property, raw) {
|
|
474
|
-
if (letterFreeCallPattern.test(raw)) return raw;
|
|
475
|
-
return raw.replace(/[$A-Za-z_][\w.$-]*(?:\/\d+)?/g, function(word, index) {
|
|
476
|
-
if (word.charCodeAt(0) !== 36) {
|
|
477
|
-
var before = raw.charCodeAt(index - 1);
|
|
478
|
-
if (before >= 48 && before <= 57 || before === 35 || before === 45 && raw.charCodeAt(index - 2) === 45 || raw.charCodeAt(index + word.length) === 40) return word;
|
|
479
|
-
}
|
|
480
|
-
var value = configuredValue(state, property, word);
|
|
481
|
-
return value === word ? word : String(value);
|
|
482
|
-
});
|
|
483
|
-
}
|
|
484
|
-
function normalizeTransitionNames(state, raw) {
|
|
485
|
-
var quote = 0;
|
|
486
|
-
var depth = 0;
|
|
487
|
-
var copyFrom = 0;
|
|
488
|
-
var out = "";
|
|
489
|
-
for (var index = 0; index < raw.length; index++) {
|
|
490
|
-
var code = raw.charCodeAt(index);
|
|
491
|
-
if (quote) {
|
|
492
|
-
if (code === 92) index++;
|
|
493
|
-
else if (code === quote) quote = 0;
|
|
494
|
-
continue;
|
|
495
|
-
}
|
|
496
|
-
if (code === 34 || code === 39) {
|
|
497
|
-
quote = code;
|
|
498
|
-
continue;
|
|
499
|
-
}
|
|
500
|
-
if (code === 40) {
|
|
501
|
-
depth++;
|
|
502
|
-
continue;
|
|
503
|
-
}
|
|
504
|
-
if (code === 41) {
|
|
505
|
-
depth--;
|
|
506
|
-
continue;
|
|
507
|
-
}
|
|
508
|
-
if (depth || !(code >= 65 && code <= 90 || code >= 97 && code <= 122 || code === 95) || index > 1 && raw.charCodeAt(index - 1) === 45 && raw.charCodeAt(index - 2) === 45) continue;
|
|
509
|
-
var end = index + 1;
|
|
510
|
-
while (end < raw.length) {
|
|
511
|
-
var next = raw.charCodeAt(end);
|
|
512
|
-
if (next >= 48 && next <= 57 || next >= 65 && next <= 90 || next >= 97 && next <= 122 || next === 45 || next === 95) end++;
|
|
513
|
-
else break;
|
|
514
|
-
}
|
|
515
|
-
if (raw.charCodeAt(end) !== 40) {
|
|
516
|
-
var authored = raw.slice(index, end);
|
|
517
|
-
var property = state.conf.shorthands[authored] || authored;
|
|
518
|
-
if (property === "x" || property === "y") property = "translate";
|
|
519
|
-
else if (property === "scaleX" || property === "scaleY") property = "scale";
|
|
520
|
-
else if (legacyTransformParts.has(property)) property = "transform";
|
|
521
|
-
if (property !== authored || /[A-Z]/.test(property)) {
|
|
522
|
-
out += raw.slice(copyFrom, index);
|
|
523
|
-
out += property.replace(/[A-Z]/g, function(letter) {
|
|
524
|
-
return `-${letter.toLowerCase()}`;
|
|
525
|
-
});
|
|
526
|
-
copyFrom = end;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
index = end - 1;
|
|
530
|
-
}
|
|
531
|
-
return copyFrom ? out + raw.slice(copyFrom) : raw;
|
|
532
|
-
}
|
|
533
|
-
function directStyleSignature(property, value) {
|
|
534
|
-
return `${property}${arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ""}${String(value)}`;
|
|
535
|
-
}
|
|
536
|
-
function directAtomic(state, property, value, condition, conditionKey, conditionWrappers, conditionSelector) {
|
|
537
|
-
var isDefault = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : false;
|
|
538
|
-
var _state;
|
|
539
|
-
var atomics = (_state = state).flatAtomics || (_state.flatAtomics = {});
|
|
540
|
-
var atomicKey = property.startsWith("transition") ? "transition" : property;
|
|
541
|
-
var existing = atomics[atomicKey];
|
|
542
|
-
var contribution = directStyleSignature(property, value, conditionKey);
|
|
543
|
-
var signature = existing ? existing.signature + contribution : contribution;
|
|
544
|
-
var next = (0, import_getCSSStylesAtomic.getCSSStyleAtomic)(property, value, conditionSelector, conditionWrappers, signature, 2, atomicKey, condition ? 1 + (Math.floor(condition / 256) >>> 23 & 7) + (Math.floor(condition / 256) >>> 26) * 6 - (condition >>> 5 & 7) : void 0);
|
|
545
|
-
if (!next) return;
|
|
546
|
-
var identifier = next[import_helpers.StyleObjectIdentifier];
|
|
547
|
-
var nextRules = next[import_helpers.StyleObjectRules];
|
|
548
|
-
var slotted = condition || atomicKey === "transition";
|
|
549
|
-
if (!existing) {
|
|
550
|
-
var atomic = {
|
|
551
|
-
baseRules: slotted ? 0 : nextRules.length,
|
|
552
|
-
conditions: void 0,
|
|
553
|
-
signature,
|
|
554
|
-
styleObject: next
|
|
555
|
-
};
|
|
556
|
-
if (slotted) atomic.conditions = { [atomicKey === "transition" ? `${conditionKey}\0${property}` : conditionKey]: {
|
|
557
|
-
count: nextRules.length,
|
|
558
|
-
index: 0,
|
|
559
|
-
precedence: condition ? Math.floor(condition / 256) : 0,
|
|
560
|
-
default: isDefault
|
|
561
|
-
} };
|
|
562
|
-
atomics[atomicKey] = atomic;
|
|
563
|
-
} else {
|
|
564
|
-
var previousIdentifier = existing.styleObject[import_helpers.StyleObjectIdentifier];
|
|
565
|
-
var rules = existing.styleObject[import_helpers.StyleObjectRules].slice();
|
|
566
|
-
existing.styleObject[import_helpers.StyleObjectRules] = rules;
|
|
567
|
-
if (!condition && !isDefault && existing.conditions) for (var key in existing.conditions) {
|
|
568
|
-
var entry = existing.conditions[key];
|
|
569
|
-
if (!entry.default) continue;
|
|
570
|
-
rules.splice(entry.index, entry.count);
|
|
571
|
-
delete existing.conditions[key];
|
|
572
|
-
for (var otherKey in existing.conditions) {
|
|
573
|
-
var other = existing.conditions[otherKey];
|
|
574
|
-
if (other.index > entry.index) other.index -= entry.count;
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
if (previousIdentifier !== identifier) {
|
|
578
|
-
var oldSelector = `.${previousIdentifier}`;
|
|
579
|
-
var newSelector = `.${identifier}`;
|
|
580
|
-
for (var index = 0; index < rules.length; index++) rules[index] = rules[index].replaceAll(oldSelector, newSelector);
|
|
581
|
-
}
|
|
582
|
-
if (slotted) {
|
|
583
|
-
var _existing_conditions;
|
|
584
|
-
var _existing;
|
|
585
|
-
var slot = atomicKey === "transition" ? `${conditionKey}\0${property}` : conditionKey;
|
|
586
|
-
var previous = (_existing_conditions = existing.conditions) === null || _existing_conditions === void 0 ? void 0 : _existing_conditions[slot];
|
|
587
|
-
if (previous) {
|
|
588
|
-
rules.splice(previous.index, previous.count);
|
|
589
|
-
if (existing.conditions) for (var key1 in existing.conditions) {
|
|
590
|
-
var entry1 = existing.conditions[key1];
|
|
591
|
-
if (entry1 !== previous && entry1.index > previous.index) entry1.index -= previous.count;
|
|
592
|
-
}
|
|
593
|
-
delete existing.conditions[slot];
|
|
594
|
-
}
|
|
595
|
-
var precedence = condition ? Math.floor(condition / 256) : 0;
|
|
596
|
-
var insertionIndex = rules.length;
|
|
597
|
-
if (existing.conditions) {
|
|
598
|
-
for (var key2 in existing.conditions) {
|
|
599
|
-
var entry2 = existing.conditions[key2];
|
|
600
|
-
if (entry2.precedence > precedence && entry2.index < insertionIndex) insertionIndex = entry2.index;
|
|
601
|
-
}
|
|
602
|
-
for (var key3 in existing.conditions) {
|
|
603
|
-
var entry3 = existing.conditions[key3];
|
|
604
|
-
if (entry3.index >= insertionIndex) entry3.index += nextRules.length;
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
((_existing = existing).conditions || (_existing.conditions = {}))[slot] = {
|
|
608
|
-
count: nextRules.length,
|
|
609
|
-
index: insertionIndex,
|
|
610
|
-
precedence,
|
|
611
|
-
default: isDefault
|
|
612
|
-
};
|
|
613
|
-
rules.splice(insertionIndex, 0, ...nextRules);
|
|
614
|
-
} else {
|
|
615
|
-
var difference = nextRules.length - existing.baseRules;
|
|
616
|
-
rules.splice(0, existing.baseRules, ...nextRules);
|
|
617
|
-
if (difference && existing.conditions) for (var key4 in existing.conditions) existing.conditions[key4].index += difference;
|
|
618
|
-
existing.baseRules = nextRules.length;
|
|
619
|
-
}
|
|
620
|
-
existing.signature = signature;
|
|
621
|
-
existing.styleObject[import_helpers.StyleObjectIdentifier] = identifier;
|
|
622
|
-
existing.styleObject[1] = next[1];
|
|
623
|
-
}
|
|
624
|
-
state.classNames[atomicKey] = identifier;
|
|
625
|
-
}
|
|
626
|
-
function emitBorderStyleDefault(state, property, condition, conditionKey, conditionWrappers, conditionSelector) {
|
|
627
|
-
var _state_flatAtomics, _atomic_conditions;
|
|
628
|
-
if (!import_constants.isWeb || !state.flatShouldDoClasses || state.styleProps.noNormalize === false) return;
|
|
629
|
-
var target = borderStyleDefaults[property];
|
|
630
|
-
if (!target) return;
|
|
631
|
-
var atomic = (_state_flatAtomics = state.flatAtomics) === null || _state_flatAtomics === void 0 ? void 0 : _state_flatAtomics[target];
|
|
632
|
-
if ((atomic === null || atomic === void 0 ? void 0 : atomic.baseRules) || state.classNames[target] && !atomic || condition && (atomic === null || atomic === void 0 ? void 0 : (_atomic_conditions = atomic.conditions) === null || _atomic_conditions === void 0 ? void 0 : _atomic_conditions[conditionKey])) return;
|
|
633
|
-
directAtomic(state, target, "solid", condition, conditionKey, conditionWrappers, conditionSelector, true);
|
|
634
|
-
}
|
|
635
|
-
function flushDirectStyles(state) {
|
|
636
|
-
var clear = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
637
|
-
var direct = state;
|
|
638
|
-
var atomics = direct.flatAtomics;
|
|
639
|
-
if (!atomics) return;
|
|
640
|
-
for (var property in atomics) {
|
|
641
|
-
var styleObject = atomics[property].styleObject;
|
|
642
|
-
var identifier = styleObject[import_helpers.StyleObjectIdentifier];
|
|
643
|
-
if ((0, import_insertStyleRule.shouldInsertStyleRules)(identifier)) {
|
|
644
|
-
var rules = styleObject[import_helpers.StyleObjectRules].slice();
|
|
645
|
-
styleObject[import_helpers.StyleObjectRules] = rules;
|
|
646
|
-
(0, import_insertStyleRule.updateRules)(identifier, rules);
|
|
647
|
-
state.flatRulesToInsert[identifier] = styleObject;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
if (clear) direct.flatAtomics = void 0;
|
|
651
|
-
}
|
|
652
|
-
function getDirectDynamicThemeAccess(state) {
|
|
653
|
-
return state.flatDynamicThemeAccess;
|
|
654
|
-
}
|
|
655
|
-
function emitProperty(state, property, value, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly) {
|
|
656
|
-
var _state_animationDriver, _state_flatActiveConditions;
|
|
657
|
-
var _state, _state1;
|
|
658
|
-
var direct = state;
|
|
659
|
-
if (condition & 4) ((_state = state).flatEnterKeys || (_state.flatEnterKeys = /* @__PURE__ */ new Set())).add(property);
|
|
660
|
-
if (condition & 8) ((_state1 = state).flatExitKeys || (_state1.flatExitKeys = /* @__PURE__ */ new Set())).add(property);
|
|
661
|
-
if (!import_constants.isWeb && conditionTheme) {
|
|
662
|
-
if (import_constants.supportsDynamicColorIOS && (0, import_getDynamicVal.isColorStyleKey)(property)) {
|
|
663
|
-
var _direct, _ref, _property;
|
|
664
|
-
var schemes = (_ref = (_direct = direct).flatDynamicColors || (_direct.flatDynamicColors = {}))[_property = property] || (_ref[_property] = {});
|
|
665
|
-
schemes[conditionTheme] = typeof originalValue === "string" && /^[a-z]+$/i.test(originalValue) ? originalValue : value;
|
|
666
|
-
merge(state, property, { dynamic: { ...schemes } }, 1, false, originalValue);
|
|
667
|
-
return;
|
|
668
|
-
}
|
|
669
|
-
direct.flatDynamicThemeAccess = true;
|
|
670
|
-
}
|
|
671
|
-
if (contextOnly) {
|
|
672
|
-
if (!condition || condition & 1) {
|
|
673
|
-
var _state2;
|
|
674
|
-
((_state2 = state).overriddenContextProps || (_state2.overriddenContextProps = {}))[property] = originalValue;
|
|
675
|
-
}
|
|
676
|
-
return;
|
|
677
|
-
}
|
|
678
|
-
var shouldPromoteAnimatedStyle = import_constants.isWeb && !condition && !state.flatShouldDoClasses && !state.styleProps.noMergeStyle && state.styleProps.isAnimated && !((_state_animationDriver = state.animationDriver) === null || _state_animationDriver === void 0 ? void 0 : _state_animationDriver.isReactNative) && property in import_helpers.nonAnimatableStyleProps;
|
|
679
|
-
if (import_constants.isWeb && (state.flatShouldDoClasses || shouldPromoteAnimatedStyle)) {
|
|
680
|
-
if (!condition) {
|
|
681
|
-
if (state.style) delete state.style[property];
|
|
682
|
-
}
|
|
683
|
-
directAtomic(state, property, value, condition, conditionKey, conditionWrappers, conditionSelector);
|
|
684
|
-
return;
|
|
685
|
-
}
|
|
686
|
-
if (condition) {
|
|
687
|
-
var _direct_flatPrecedence;
|
|
688
|
-
var _direct1, _state3;
|
|
689
|
-
if (!(condition & 1)) return;
|
|
690
|
-
var precedence = Math.floor(condition / 256);
|
|
691
|
-
var previous = (_direct_flatPrecedence = direct.flatPrecedence) === null || _direct_flatPrecedence === void 0 ? void 0 : _direct_flatPrecedence[property];
|
|
692
|
-
if (previous !== void 0 && precedence < previous) return;
|
|
693
|
-
((_direct1 = direct).flatPrecedence || (_direct1.flatPrecedence = {}))[property] = precedence;
|
|
694
|
-
((_state3 = state).flatActiveConditions || (_state3.flatActiveConditions = {}))[property] = true;
|
|
695
|
-
} else if ((_state_flatActiveConditions = state.flatActiveConditions) === null || _state_flatActiveConditions === void 0 ? void 0 : _state_flatActiveConditions[property]) return;
|
|
696
|
-
merge(state, property, value, 1, true, originalValue);
|
|
697
|
-
}
|
|
698
|
-
function splitComponents(value) {
|
|
699
|
-
var parts = [];
|
|
700
|
-
var start = 0;
|
|
701
|
-
var quote = 0;
|
|
702
|
-
var depth = 0;
|
|
703
|
-
for (var index = 0; index <= value.length; index++) {
|
|
704
|
-
var code = index === value.length ? 32 : value.charCodeAt(index);
|
|
705
|
-
if (quote) {
|
|
706
|
-
if (code === 92) index++;
|
|
707
|
-
else if (code === quote) quote = 0;
|
|
708
|
-
continue;
|
|
709
|
-
}
|
|
710
|
-
if (code === 34 || code === 39) quote = code;
|
|
711
|
-
else if (code === 40) depth++;
|
|
712
|
-
else if (code === 41) depth--;
|
|
713
|
-
else if (!depth && code <= 32) {
|
|
714
|
-
if (index > start) parts.push(value.slice(start, index));
|
|
715
|
-
start = index + 1;
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
return parts;
|
|
719
|
-
}
|
|
720
|
-
function emitBorder(state, property, raw, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly) {
|
|
721
|
-
if (!import_constants.isWeb && (property === "borderBlock" || property === "borderInline")) {
|
|
722
|
-
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`RN has no logical border shorthand "${property}"; dropping it`);
|
|
723
|
-
return;
|
|
724
|
-
}
|
|
725
|
-
var targets = borderTargets[property];
|
|
726
|
-
var width;
|
|
727
|
-
var style;
|
|
728
|
-
var color;
|
|
729
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
730
|
-
try {
|
|
731
|
-
for (var _iterator = splitComponents(raw)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
732
|
-
var part = _step.value;
|
|
733
|
-
var lower = part.toLowerCase();
|
|
734
|
-
if (lineStyles.has(lower) || property === "outline" && lower === "auto") style = part;
|
|
735
|
-
else if (lower === "thin" || lower === "medium" || lower === "thick" || /^-?(?:\d+\.?\d*|\.\d+)(?:[a-z%]+)?$/i.test(part) || /^(?:calc|var|min|max|clamp)\(/i.test(part)) width = part;
|
|
736
|
-
else color = part;
|
|
737
|
-
}
|
|
738
|
-
} catch (err) {
|
|
739
|
-
_didIteratorError = true;
|
|
740
|
-
_iteratorError = err;
|
|
741
|
-
} finally {
|
|
742
|
-
try {
|
|
743
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
744
|
-
} finally {
|
|
745
|
-
if (_didIteratorError) throw _iteratorError;
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
if (style === "none" && width === void 0) width = "0";
|
|
749
|
-
if (width !== void 0) {
|
|
750
|
-
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
751
|
-
try {
|
|
752
|
-
for (var _iterator1 = targets.width[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
753
|
-
var target = _step1.value;
|
|
754
|
-
emitResolved(state, target, width, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
755
|
-
}
|
|
756
|
-
} catch (err) {
|
|
757
|
-
_didIteratorError1 = true;
|
|
758
|
-
_iteratorError1 = err;
|
|
759
|
-
} finally {
|
|
760
|
-
try {
|
|
761
|
-
if (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();
|
|
762
|
-
} finally {
|
|
763
|
-
if (_didIteratorError1) throw _iteratorError1;
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
if (style !== void 0) {
|
|
768
|
-
var styleTargets = !import_constants.isWeb && property === "border" ? ["borderStyle"] : targets.style;
|
|
769
|
-
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
770
|
-
try {
|
|
771
|
-
for (var _iterator2 = styleTargets[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
772
|
-
var target1 = _step2.value;
|
|
773
|
-
emitProperty(state, target1, style, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
774
|
-
}
|
|
775
|
-
} catch (err) {
|
|
776
|
-
_didIteratorError2 = true;
|
|
777
|
-
_iteratorError2 = err;
|
|
778
|
-
} finally {
|
|
779
|
-
try {
|
|
780
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
781
|
-
} finally {
|
|
782
|
-
if (_didIteratorError2) throw _iteratorError2;
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
if (color !== void 0) {
|
|
787
|
-
var _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = void 0;
|
|
788
|
-
try {
|
|
789
|
-
for (var _iterator3 = targets.color[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
790
|
-
var target2 = _step3.value;
|
|
791
|
-
emitResolved(state, target2, color, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
792
|
-
}
|
|
793
|
-
} catch (err) {
|
|
794
|
-
_didIteratorError3 = true;
|
|
795
|
-
_iteratorError3 = err;
|
|
796
|
-
} finally {
|
|
797
|
-
try {
|
|
798
|
-
if (!_iteratorNormalCompletion3 && _iterator3.return != null) _iterator3.return();
|
|
799
|
-
} finally {
|
|
800
|
-
if (_didIteratorError3) throw _iteratorError3;
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
function emitTextDecoration(state, raw, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly) {
|
|
806
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
807
|
-
try {
|
|
808
|
-
for (var _iterator = splitComponents(raw)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
809
|
-
var part = _step.value;
|
|
810
|
-
emitResolved(state, part === "solid" || part === "double" || part === "dotted" || part === "dashed" || part === "wavy" ? "textDecorationStyle" : part === "underline" || part === "overline" || part === "line-through" || part === "none" ? "textDecorationLine" : "textDecorationColor", part, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
811
|
-
}
|
|
812
|
-
} catch (err) {
|
|
813
|
-
_didIteratorError = true;
|
|
814
|
-
_iteratorError = err;
|
|
815
|
-
} finally {
|
|
816
|
-
try {
|
|
817
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
818
|
-
} finally {
|
|
819
|
-
if (_didIteratorError) throw _iteratorError;
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
function addComposition(state, property) {
|
|
824
|
-
if (state.classNames[property]) return;
|
|
825
|
-
var value = property === "translate" ? "var(--t-x, 0px) var(--t-y, 0px)" : "var(--t-scale-x, 1) var(--t-scale-y, 1)";
|
|
826
|
-
var defaults = property === "translate" ? "--t-x:0px;--t-y:0px" : "--t-scale-x:1;--t-scale-y:1";
|
|
827
|
-
var styleObject = (0, import_getCSSStylesAtomic.getCSSStyleAtomic)(property, value, "", void 0, void 0, true);
|
|
828
|
-
var identifier = styleObject[import_helpers.StyleObjectIdentifier];
|
|
829
|
-
styleObject[import_helpers.StyleObjectRules].unshift(`:where(.${identifier}){${defaults}}`);
|
|
830
|
-
if ((0, import_insertStyleRule.shouldInsertStyleRules)(identifier)) {
|
|
831
|
-
(0, import_insertStyleRule.updateRules)(identifier, styleObject[import_helpers.StyleObjectRules]);
|
|
832
|
-
state.flatRulesToInsert[identifier] = styleObject;
|
|
833
|
-
}
|
|
834
|
-
state.classNames[property] = identifier;
|
|
835
|
-
}
|
|
836
|
-
function emitTransform(state, property, value, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly) {
|
|
837
|
-
if (!import_constants.isWeb || !state.flatShouldDoClasses) {
|
|
838
|
-
if (!import_constants.isWeb && property === "scale") {
|
|
839
|
-
emitProperty(state, "scaleX", value, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
840
|
-
emitProperty(state, "scaleY", value, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
841
|
-
} else emitProperty(state, property, value, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
842
|
-
return;
|
|
843
|
-
}
|
|
844
|
-
var targets = property === "scale" ? ["--t-scale-x", "--t-scale-y"] : [property === "x" ? "--t-x" : property === "y" ? "--t-y" : property === "scaleX" ? "--t-scale-x" : property === "scaleY" ? "--t-scale-y" : "rotate"];
|
|
845
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
846
|
-
try {
|
|
847
|
-
for (var _iterator = targets[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
848
|
-
var target = _step.value;
|
|
849
|
-
var targetValue = value;
|
|
850
|
-
if (typeof targetValue === "number") {
|
|
851
|
-
if (target === "--t-x" || target === "--t-y") targetValue = `${targetValue}px`;
|
|
852
|
-
else if (target === "rotate") targetValue = `${targetValue}deg`;
|
|
853
|
-
}
|
|
854
|
-
emitProperty(state, target, targetValue, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
855
|
-
if (target === "--t-x" || target === "--t-y") addComposition(state, "translate");
|
|
856
|
-
else if (target.startsWith("--t-scale")) addComposition(state, "scale");
|
|
857
|
-
}
|
|
858
|
-
} catch (err) {
|
|
859
|
-
_didIteratorError = true;
|
|
860
|
-
_iteratorError = err;
|
|
861
|
-
} finally {
|
|
862
|
-
try {
|
|
863
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
864
|
-
} finally {
|
|
865
|
-
if (_didIteratorError) throw _iteratorError;
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
function emitResolved(state, property, raw, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly) {
|
|
870
|
-
var value = configuredValue(state, property, raw);
|
|
871
|
-
if (value === raw && /[\s,(]/.test(raw)) value = resolveEmbeddedTokens(state, property, raw);
|
|
872
|
-
if ((!import_constants.isWeb || !state.flatShouldDoClasses) && typeof value === "string") {
|
|
873
|
-
if (/^-?(?:\d+\.?\d*|\.\d+)(?:px|dp)$/i.test(value)) value = Number.parseFloat(value);
|
|
874
|
-
else if (value !== "" && Number.isFinite(Number(value))) value = Number(value);
|
|
875
|
-
}
|
|
876
|
-
emitProperty(state, property, value, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
877
|
-
}
|
|
878
|
-
function shadowUnit(part) {
|
|
879
|
-
return typeof part === "number" ? `${part}px` : part || "0px";
|
|
880
|
-
}
|
|
881
|
-
function emitWebShadow(state, property, value, merge, originalValue, contextOnly) {
|
|
882
|
-
var _state;
|
|
883
|
-
var shadow = (_state = state).flatWebShadow || (_state.flatWebShadow = {});
|
|
884
|
-
shadow[property] = value;
|
|
885
|
-
var offset = shadow.shadowOffset || {
|
|
886
|
-
width: 0,
|
|
887
|
-
height: 0
|
|
888
|
-
};
|
|
889
|
-
var _shadow_shadowOpacity;
|
|
890
|
-
var color = (0, import_normalizeColor.normalizeColor)(shadow.shadowColor, (_shadow_shadowOpacity = shadow.shadowOpacity) !== null && _shadow_shadowOpacity !== void 0 ? _shadow_shadowOpacity : 1);
|
|
891
|
-
if (!color) return;
|
|
892
|
-
var next = `${shadowUnit(offset.width)} ${shadowUnit(offset.height)} ${shadowUnit(shadow.shadowRadius)} ${color}`;
|
|
893
|
-
emitProperty(state, "boxShadow", state.flatBoxShadow ? `${state.flatBoxShadow}, ${next}` : next, 0, "", void 0, "", "", merge, originalValue, contextOnly);
|
|
894
|
-
}
|
|
895
|
-
function emitWebTextShadow(state, property, value, merge, originalValue, contextOnly) {
|
|
896
|
-
var _state;
|
|
897
|
-
var shadow = (_state = state).flatTextShadow || (_state.flatTextShadow = {});
|
|
898
|
-
shadow[property] = value;
|
|
899
|
-
var offset = shadow.textShadowOffset || {
|
|
900
|
-
width: 0,
|
|
901
|
-
height: 0
|
|
902
|
-
};
|
|
903
|
-
if (!shadow.textShadowColor) return;
|
|
904
|
-
emitProperty(state, "textShadow", `${shadowUnit(offset.width)} ${shadowUnit(offset.height)} ${shadowUnit(shadow.textShadowRadius)} ${shadow.textShadowColor}`, 0, "", void 0, "", "", merge, originalValue, contextOnly);
|
|
905
|
-
}
|
|
906
|
-
function emitValue(state, property, raw, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly) {
|
|
907
|
-
if (typeof raw === "string") raw = raw.trim();
|
|
908
|
-
if ((0, import_createVariable.isVariable)(raw)) raw = (0, import_resolveVariableValue.resolveVariableValue)(property, raw, import_constants.isWeb && !state.flatShouldDoClasses && state.styleProps.resolveValues === "auto" ? "value" : state.styleProps.resolveValues);
|
|
909
|
-
emitBorderStyleDefault(state, property, condition, conditionKey, conditionWrappers, conditionSelector);
|
|
910
|
-
if (typeof raw === "string" && (property === "transition" || property === "transitionProperty")) raw = normalizeTransitionNames(state, raw);
|
|
911
|
-
if (legacyTransformParts.has(property)) {
|
|
912
|
-
if (import_constants.isWeb && state.flatShouldDoClasses && state.classNames.transform) {
|
|
913
|
-
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`legacy transform part "${property}" is dropped because "transform" owns the property`);
|
|
914
|
-
return;
|
|
915
|
-
}
|
|
916
|
-
var value = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
|
|
917
|
-
if (import_constants.isWeb && state.flatShouldDoClasses && !condition) {
|
|
918
|
-
var _direct;
|
|
919
|
-
var direct = state;
|
|
920
|
-
((_direct = direct).flatLegacyTransforms || (_direct.flatLegacyTransforms = {}))[property] = value;
|
|
921
|
-
emitProperty(state, "transform", (0, import_transformsToString.transformsToString)(Object.keys(direct.flatLegacyTransforms).sort().map(function(key2) {
|
|
922
|
-
return { [key2]: direct.flatLegacyTransforms[key2] };
|
|
923
|
-
})), 0, "", void 0, "", "", merge, originalValue, contextOnly);
|
|
924
|
-
} else if (condition && import_constants.isWeb && state.flatShouldDoClasses) emitProperty(state, "transform", `${property}(${value})`, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
925
|
-
else merge(state, property, value, 1, false, originalValue);
|
|
926
|
-
return;
|
|
927
|
-
}
|
|
928
|
-
if (import_constants.isWeb && webShadowParts.has(property)) {
|
|
929
|
-
var value1 = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
|
|
930
|
-
if (state.flatShouldDoClasses) emitWebShadow(state, property, value1, merge, originalValue, contextOnly);
|
|
931
|
-
else merge(state, property, value1, 1, false, originalValue);
|
|
932
|
-
return;
|
|
933
|
-
}
|
|
934
|
-
if (import_constants.isWeb && webTextShadowParts.has(property)) {
|
|
935
|
-
var value2 = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
|
|
936
|
-
if (state.flatShouldDoClasses) emitWebTextShadow(state, property, value2, merge, originalValue, contextOnly);
|
|
937
|
-
else merge(state, property, value2, 1, false, originalValue);
|
|
938
|
-
return;
|
|
939
|
-
}
|
|
940
|
-
if (import_constants.isWeb && state.flatShouldDoClasses) {
|
|
941
|
-
if (property === "transform") {
|
|
942
|
-
var direct1 = state;
|
|
943
|
-
if (process.env.NODE_ENV === "development" && direct1.flatLegacyTransforms) for (var part in direct1.flatLegacyTransforms) (0, import_warnOnce.warnOnce)(`legacy transform part "${part}" is dropped because "transform" owns the property`);
|
|
944
|
-
direct1.flatLegacyTransforms = void 0;
|
|
945
|
-
if (state.flatTransforms) {
|
|
946
|
-
if (process.env.NODE_ENV === "development") for (var part1 in state.flatTransforms) (0, import_warnOnce.warnOnce)(`legacy transform part "${part1}" is dropped because "transform" owns the property`);
|
|
947
|
-
state.flatTransforms = void 0;
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
if (import_constants.isWeb && state.flatShouldDoClasses && property === "transform" && Array.isArray(raw)) raw = (0, import_transformsToString.transformsToString)(raw);
|
|
952
|
-
if (typeof raw === "string" && property in borderTargets) {
|
|
953
|
-
emitBorder(state, property, raw, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
954
|
-
return;
|
|
955
|
-
}
|
|
956
|
-
if (typeof raw === "string" && property === "textDecoration") {
|
|
957
|
-
emitTextDecoration(state, raw, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
958
|
-
return;
|
|
959
|
-
}
|
|
960
|
-
if (typeof raw === "string" && property === "background") {
|
|
961
|
-
var parts = splitComponents(raw);
|
|
962
|
-
if (parts.length === 1 && !/^(?:url|image-set|.*gradient)\(/i.test(parts[0])) {
|
|
963
|
-
emitResolved(state, "backgroundColor", parts[0], condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
964
|
-
return;
|
|
965
|
-
}
|
|
966
|
-
if (!import_constants.isWeb) {
|
|
967
|
-
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`native background cannot represent "${raw}"; dropping it`);
|
|
968
|
-
return;
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
if (property === "x" || property === "y" || property === "scale" || property === "scaleX" || property === "scaleY" || property === "rotate") {
|
|
972
|
-
var value3 = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
|
|
973
|
-
if ((!import_constants.isWeb || !state.flatShouldDoClasses) && typeof value3 === "string" && !value3.startsWith(import_themeRef.THEME_REF_PREFIX)) {
|
|
974
|
-
if (property === "rotate" && !/^-?(?:\d+\.?\d*|\.\d+)(?:deg|rad)$/i.test(value3)) {
|
|
975
|
-
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`native transform "${property}" cannot represent "${value3}"; dropping it`);
|
|
976
|
-
if (condition & 1 && state.flatTransforms) delete state.flatTransforms[property];
|
|
977
|
-
return;
|
|
978
|
-
}
|
|
979
|
-
if (/^-?(?:\d+\.?\d*|\.\d+)(?:px|dp)$/i.test(value3)) value3 = Number.parseFloat(value3);
|
|
980
|
-
else if (Number.isFinite(Number(value3))) value3 = Number(value3);
|
|
981
|
-
}
|
|
982
|
-
emitTransform(state, property, value3, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
983
|
-
return;
|
|
984
|
-
}
|
|
985
|
-
if (import_constants.isWeb && !state.flatShouldDoClasses && !condition && property === "borderRadius") {
|
|
986
|
-
if (typeof raw === "string") emitResolved(state, property, raw, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
987
|
-
else emitProperty(state, property, raw, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
988
|
-
return;
|
|
989
|
-
}
|
|
990
|
-
if (property === "transform" && typeof raw === "string") {
|
|
991
|
-
var transform = (0, import_parseNativeTransform.parseNativeTransform)(raw);
|
|
992
|
-
if (transform) {
|
|
993
|
-
emitProperty(state, property, transform, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
994
|
-
return;
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
var value4 = raw;
|
|
998
|
-
if (typeof raw === "string") {
|
|
999
|
-
value4 = configuredValue(state, property, raw);
|
|
1000
|
-
if (value4 === raw && /[\s,(]/.test(raw)) value4 = resolveEmbeddedTokens(state, property, raw);
|
|
1001
|
-
}
|
|
1002
|
-
if ((!import_constants.isWeb || !state.flatShouldDoClasses) && typeof value4 === "string") {
|
|
1003
|
-
if (/^-?(?:\d+\.?\d*|\.\d+)(?:px|dp)$/i.test(value4)) value4 = Number.parseFloat(value4);
|
|
1004
|
-
else if (value4 !== "" && Number.isFinite(Number(value4))) value4 = Number(value4);
|
|
1005
|
-
}
|
|
1006
|
-
if (import_constants.isWeb && state.flatShouldDoClasses && property === "boxShadow" && !condition) state.flatBoxShadow = value4;
|
|
1007
|
-
if (typeof value4 === "string" && (property === "backgroundImage" || property === "boxShadow" || property === "textShadow")) {
|
|
1008
|
-
var parsed = (0, import_parseNativeStyle.parseNativeStyle)(property, value4);
|
|
1009
|
-
if (parsed) {
|
|
1010
|
-
if (property === "textShadow") {
|
|
1011
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
1012
|
-
try {
|
|
1013
|
-
for (var _iterator = parsed[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
1014
|
-
var [key, parsedValue] = _step.value;
|
|
1015
|
-
emitProperty(state, key, parsedValue, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
1016
|
-
}
|
|
1017
|
-
} catch (err) {
|
|
1018
|
-
_didIteratorError = true;
|
|
1019
|
-
_iteratorError = err;
|
|
1020
|
-
} finally {
|
|
1021
|
-
try {
|
|
1022
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
1023
|
-
} finally {
|
|
1024
|
-
if (_didIteratorError) throw _iteratorError;
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
} else emitProperty(state, property === "backgroundImage" ? "experimental_backgroundImage" : property, parsed, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
1028
|
-
return;
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
if (!import_constants.isWeb && property === "fontVariant" && typeof value4 === "string") value4 = value4.split(/[,\s]+/).filter(Boolean);
|
|
1032
|
-
var expanded = state.styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(property, value4, state.conf.settings.styleCompat || "web");
|
|
1033
|
-
if (!expanded) {
|
|
1034
|
-
emitProperty(state, property, value4, condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
1035
|
-
return;
|
|
1036
|
-
}
|
|
1037
|
-
if (typeof raw === "string" && expanded.length > 1) {
|
|
1038
|
-
var parts1 = splitComponents(raw);
|
|
1039
|
-
if (parts1.length > 0 && parts1.length <= (expanded.length === 4 ? 4 : 2)) {
|
|
1040
|
-
for (var index = 0; index < expanded.length; index++) {
|
|
1041
|
-
var partIndex = index === 0 || parts1.length === 1 ? 0 : index === 1 || index === 3 && parts1.length < 4 ? 1 : index === 2 && parts1.length < 3 ? 0 : index;
|
|
1042
|
-
emitResolved(state, expanded[index][0], parts1[partIndex], condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
1043
|
-
}
|
|
1044
|
-
return;
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
for (var index1 = 0; index1 < expanded.length; index1++) emitProperty(state, expanded[index1][0], expanded[index1][1], condition, conditionKey, conditionWrappers, conditionSelector, conditionTheme, merge, originalValue, contextOnly);
|
|
1048
|
-
}
|
|
1049
|
-
function contributeStyleString(state, property, source, merge, originalValue) {
|
|
1050
|
-
var contextOnly = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;
|
|
1051
|
-
if (import_constants.isWeb && source.indexOf(":") !== -1 && (webShadowParts.has(property) || legacyTransformParts.has(property))) {
|
|
1052
|
-
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`conditional "${property}" needs its composite property; dropping it`);
|
|
1053
|
-
return true;
|
|
1054
|
-
}
|
|
1055
|
-
if (source.indexOf(":") === -1) {
|
|
1056
|
-
emitValue(state, property, source, 0, "", void 0, "", "", merge, originalValue !== null && originalValue !== void 0 ? originalValue : source, contextOnly);
|
|
1057
|
-
return true;
|
|
1058
|
-
}
|
|
1059
|
-
(0, import_runtime.scanFlatValue)(source, directStyleHandler, state, property, merge, originalValue, contextOnly);
|
|
1060
|
-
return true;
|
|
1061
|
-
}
|
|
1062
|
-
function contributeFrontendValue(state, property, value, merge) {
|
|
1063
|
-
var contextOnly = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
|
|
1064
|
-
if (value.base !== null) emitValue(state, property, value.base, 0, "", void 0, "", "", merge, value.base, contextOnly);
|
|
1065
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
1066
|
-
try {
|
|
1067
|
-
for (var _iterator = value.clauses[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
1068
|
-
var clause = _step.value;
|
|
1069
|
-
var source = clause.modifiers.join(":");
|
|
1070
|
-
resolveClauseChain(state, source, 0, source.length, property, clause.payload, merge, clause.payload, contextOnly);
|
|
1071
|
-
}
|
|
1072
|
-
} catch (err) {
|
|
1073
|
-
_didIteratorError = true;
|
|
1074
|
-
_iteratorError = err;
|
|
1075
|
-
} finally {
|
|
1076
|
-
try {
|
|
1077
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
1078
|
-
} finally {
|
|
1079
|
-
if (_didIteratorError) throw _iteratorError;
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
return true;
|
|
1083
|
-
}
|
|
1084
|
-
function isConditionalStyleObject(state, value) {
|
|
1085
|
-
if (Object.prototype.hasOwnProperty.call(value, "default")) return true;
|
|
1086
|
-
for (var key in value) return key.length > 0 && !!resolveClauseChain(state, key, 0, key.length);
|
|
1087
|
-
return false;
|
|
1088
|
-
}
|
|
1089
|
-
function contributeVariantClauseValue(state, property, value, conditionSource, merge, originalValue) {
|
|
1090
|
-
var contextOnly = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : false;
|
|
1091
|
-
if (value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value) && isConditionalStyleObject(state, value)) {
|
|
1092
|
-
for (var key in value) {
|
|
1093
|
-
var payload = value[key];
|
|
1094
|
-
if (payload == null) continue;
|
|
1095
|
-
var source = key === "default" ? conditionSource : `${conditionSource}:${key}`;
|
|
1096
|
-
resolveClauseChain(state, source, 0, source.length, property, payload, merge, payload, contextOnly, -1, -1, 2);
|
|
1097
|
-
}
|
|
1098
|
-
return;
|
|
1099
|
-
}
|
|
1100
|
-
resolveClauseChain(state, conditionSource, 0, conditionSource.length, property, value, merge, originalValue, contextOnly, -1, -1, 2);
|
|
1101
|
-
}
|
|
1102
|
-
function contributeStyleObject(state, property, value, merge, contextOnly) {
|
|
1103
|
-
if (!isConditionalStyleObject(state, value)) return false;
|
|
1104
|
-
if (import_constants.isWeb && (webShadowParts.has(property) || legacyTransformParts.has(property))) {
|
|
1105
|
-
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`conditional "${property}" needs its composite property; dropping it`);
|
|
1106
|
-
return true;
|
|
1107
|
-
}
|
|
1108
|
-
var hasBase = false;
|
|
1109
|
-
var base = value.default;
|
|
1110
|
-
if (base != null) {
|
|
1111
|
-
emitValue(state, property, base, 0, "", void 0, "", "", merge, base, contextOnly);
|
|
1112
|
-
hasBase = true;
|
|
1113
|
-
}
|
|
1114
|
-
var conditions = 0;
|
|
1115
|
-
for (var key in value) {
|
|
1116
|
-
if (key === "default") continue;
|
|
1117
|
-
var payload = value[key];
|
|
1118
|
-
if (payload == null) continue;
|
|
1119
|
-
conditions |= resolveClauseChain(state, key, 0, key.length, property, payload, merge, payload, contextOnly, -1, -1, 1);
|
|
1120
|
-
}
|
|
1121
|
-
if ((!import_constants.isWeb || !state.flatShouldDoClasses) && conditions & 12 && !hasBase) {
|
|
1122
|
-
var resting = implicitLifecycleBase(property);
|
|
1123
|
-
if (resting !== null) emitValue(state, property, resting, 0, "", void 0, "", "", merge, resting, contextOnly);
|
|
1124
|
-
}
|
|
1125
|
-
return true;
|
|
1126
|
-
}
|
|
1127
|
-
function contributeStyleValue(state, property, value, merge, originalValue) {
|
|
1128
|
-
var contextOnly = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;
|
|
1129
|
-
if (value === "safe" && (0, import_resolveSafeArea.isSafeAreaKey)(property)) {
|
|
1130
|
-
var expanded = (0, import_resolveSafeArea.expandSafeAreaValue)(property);
|
|
1131
|
-
if (expanded) {
|
|
1132
|
-
state.flatUsesSafeArea = true;
|
|
1133
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
1134
|
-
try {
|
|
1135
|
-
for (var _iterator = expanded[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
1136
|
-
var [key, resolved] = _step.value;
|
|
1137
|
-
emitValue(state, key, resolved, 0, "", void 0, "", "", merge, originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
|
|
1138
|
-
}
|
|
1139
|
-
} catch (err) {
|
|
1140
|
-
_didIteratorError = true;
|
|
1141
|
-
_iteratorError = err;
|
|
1142
|
-
} finally {
|
|
1143
|
-
try {
|
|
1144
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
1145
|
-
} finally {
|
|
1146
|
-
if (_didIteratorError) throw _iteratorError;
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
return true;
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
if (typeof value === "string") return contributeStyleString(state, property, value, merge, originalValue, contextOnly);
|
|
1153
|
-
if (value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value) && contributeStyleObject(state, property, value, merge, contextOnly)) return true;
|
|
1154
|
-
if (value != null) {
|
|
1155
|
-
emitValue(state, property, value, 0, "", void 0, "", "", merge, originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
|
|
1156
|
-
return true;
|
|
1157
|
-
}
|
|
1158
|
-
return false;
|
|
1159
|
-
}
|
|
1160
|
-
function clearDirectStyle(state, property) {
|
|
1161
|
-
var direct = state;
|
|
1162
|
-
var atomicKey = property.startsWith("transition") ? "transition" : webShadowParts.has(property) ? "boxShadow" : webTextShadowParts.has(property) ? "textShadow" : legacyTransformParts.has(property) ? "transform" : property;
|
|
1163
|
-
if (direct.flatAtomics) delete direct.flatAtomics[atomicKey];
|
|
1164
|
-
delete state.classNames[atomicKey];
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
//# sourceMappingURL=directStyle.native.js.map
|