@tamagui/web 3.0.0-beta.755.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 +10 -8
- package/dist/cjs/createTamagui.native.cjs +10 -8
- package/dist/cjs/createTamagui.native.js +10 -8
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/dom/htmlRuntime.native.cjs +1 -0
- package/dist/cjs/dom/htmlRuntime.native.js +1 -0
- package/dist/cjs/dom/htmlRuntime.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 +3 -2
- package/dist/cjs/helpers/insertStyleRule.native.cjs +70 -7
- package/dist/cjs/helpers/insertStyleRule.native.js +70 -7
- 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 +10 -8
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +10 -8
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/dom/htmlRuntime.native.js +1 -0
- package/dist/esm/dom/htmlRuntime.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 +3 -2
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +71 -5
- 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 +13 -10
- package/src/dom/html.native.tsx +99 -92
- package/src/dom/html.tsx +105 -98
- package/src/dom/htmlRuntime.native.tsx +1 -0
- 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 +8 -3
- 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 +41 -31
- 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/dom/html.d.ts +54 -50
- package/types/dom/html.d.ts.map +1 -1
- package/types/dom/html.native.d.ts +51 -47
- package/types/dom/html.native.d.ts.map +1 -1
- package/types/dom/htmlRuntime.native.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 +30 -23
- 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,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (
|
|
10
|
-
for (var name in all) __defProp(
|
|
7
|
+
var __export = (target2, all) => {
|
|
8
|
+
for (var name in all) __defProp(target2, name, {
|
|
11
9
|
get: all[name],
|
|
12
10
|
enumerable: true
|
|
13
11
|
});
|
|
@@ -21,396 +19,813 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
21
19
|
}
|
|
22
20
|
return to;
|
|
23
21
|
};
|
|
24
|
-
var
|
|
25
|
-
value: mod,
|
|
26
|
-
enumerable: true
|
|
27
|
-
}) : target, mod));
|
|
22
|
+
var __reExport = (target2, mod, secondTarget) => (__copyProps(target2, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
28
23
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
24
|
var getSplitStyles_exports = {};
|
|
30
25
|
__export(getSplitStyles_exports, {
|
|
31
26
|
STYLE_TOKEN_PROVENANCE_KEY: () => import_styleProvenance2.STYLE_TOKEN_PROVENANCE_KEY,
|
|
27
|
+
clearDirectStyle: () => clearDirectStyle,
|
|
28
|
+
contributeStyleString: () => contributeStyleString,
|
|
29
|
+
directStyleSignature: () => import_directStyleCSS2.directStyleSignature,
|
|
30
|
+
flushDirectStyles: () => import_directStyleCSS2.flushDirectStyles,
|
|
31
|
+
getContextPropSet: () => getContextPropSet,
|
|
32
|
+
getDirectDynamicThemeAccess: () => getDirectDynamicThemeAccess,
|
|
33
|
+
getFontFamilyFromNameOrVariable: () => getFontFamilyFromNameOrVariable,
|
|
32
34
|
getSplitStyles: () => getSplitStyles,
|
|
33
35
|
getStyleTokenProvenance: () => import_styleProvenance2.getStyleTokenProvenance,
|
|
34
|
-
getSubStyle: () => getSubStyle,
|
|
35
36
|
isValidStyleKey: () => isValidStyleKey,
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
prepareStyleStaticConfig: () => prepareStyleStaticConfig,
|
|
38
|
+
styleOriginalValues: () => import_styleOriginalValues.styleOriginalValues
|
|
38
39
|
});
|
|
39
40
|
module.exports = __toCommonJS(getSplitStyles_exports);
|
|
40
41
|
var import_constants = require("@tamagui/constants");
|
|
41
42
|
var import_helpers = require("@tamagui/helpers");
|
|
42
|
-
var import_react = __toESM(require("react"), 1);
|
|
43
|
-
var import_styleFrontend = require("./styleFrontend.native.js");
|
|
44
43
|
var import_config = require("../config.native.js");
|
|
45
44
|
var import_createVariable = require("../createVariable.native.js");
|
|
46
45
|
var import_isDevTools = require("../constants/isDevTools.native.js");
|
|
47
46
|
var import_mediaState = require("./mediaState.native.js");
|
|
47
|
+
var import_types = require("../types.native.js");
|
|
48
48
|
var import_runtime = require("@tamagui/style-grammar/runtime");
|
|
49
|
+
var import_mediaState2 = require("./mediaState.native.js");
|
|
50
|
+
var import_warnOnce = require("./warnOnce.native.js");
|
|
51
|
+
var import_expandStyle = require("./expandStyle.native.js");
|
|
49
52
|
var import_expandStyles = require("./expandStyles.native.js");
|
|
50
|
-
|
|
53
|
+
require("./styleToCSS.native.js");
|
|
54
|
+
var import_directStyleCSS = require("./directStyleCSS.native.js");
|
|
55
|
+
var import_directStyleCSS2 = require("./directStyleCSS.native.js");
|
|
56
|
+
var import_grammarConfig = require("./grammarConfig.native.js");
|
|
57
|
+
var import_getDynamicVal = require("./getDynamicVal.native.js");
|
|
51
58
|
var import_getDefaultProps = require("./getDefaultProps.native.js");
|
|
52
59
|
require("./insertStyleRule.native.js");
|
|
53
60
|
var import_isObj = require("./isObj.native.js");
|
|
61
|
+
var import_isObj2 = require("./isObj.native.js");
|
|
54
62
|
var import_log = require("./log.native.js");
|
|
63
|
+
var import_normalizeStyle = require("./normalizeStyle.native.js");
|
|
64
|
+
var import_normalizeColor = require("./normalizeColor.native.js");
|
|
55
65
|
var import_normalizeValueWithProperty = require("./normalizeValueWithProperty.native.js");
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
-
var
|
|
66
|
+
var import_parseNativeStyle = require("./parseNativeStyle.native.js");
|
|
67
|
+
var import_parseNativeTransform = require("./parseNativeTransform.native.js");
|
|
68
|
+
var import_getVariantExtras = require("./getVariantExtras.native.js");
|
|
69
|
+
var import_resolveRem = require("./resolveRem.native.js");
|
|
70
|
+
var import_resolveSafeArea = require("./resolveSafeArea.native.js");
|
|
71
|
+
var import_resolveSafeAreaVariable = require("./resolveSafeAreaVariable.native.js");
|
|
72
|
+
var import_resolveVariableValue = require("./resolveVariableValue.native.js");
|
|
73
|
+
var import_themeRef = require("./themeRef.native.js");
|
|
74
|
+
var import_tokenCategories = require("./tokenCategories.native.js");
|
|
59
75
|
var import_skipProps = require("./skipProps.native.js");
|
|
60
|
-
var import_sortString = require("./sortString.native.js");
|
|
61
76
|
var import_styleOriginalValues = require("./styleOriginalValues.native.js");
|
|
62
77
|
var import_styleProvenance = require("./styleProvenance.native.js");
|
|
63
78
|
var import_transformsToString = require("./transformsToString.native.js");
|
|
64
79
|
var import_styleProvenance2 = require("./styleProvenance.native.js");
|
|
80
|
+
__reExport(getSplitStyles_exports, require("./tokenCategories.native.js"), module.exports);
|
|
65
81
|
function _type_of(obj) {
|
|
66
82
|
"@swc/helpers - typeof";
|
|
67
83
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
68
84
|
}
|
|
85
|
+
var TAMAGUI_CLASS_PROPS = "$$tamaguiClassProps";
|
|
69
86
|
var shouldTrackStyleTokenProvenance = process.env.NODE_ENV === "development" && process.env.TAMAGUI_ENABLE_STYLE_TOKEN_PROVENANCE === "1";
|
|
70
87
|
function compoundMatcherMatches(expected, actual) {
|
|
71
|
-
if (Array.isArray(expected))
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
88
|
+
if (Array.isArray(expected)) {
|
|
89
|
+
for (var index = 0; index < expected.length; index++) if (expected[index] === actual) return true;
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
return expected === actual;
|
|
75
93
|
}
|
|
76
|
-
function compoundMatcherMatchesPayload(expected,
|
|
77
|
-
if (Array.isArray(expected))
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
94
|
+
function compoundMatcherMatchesPayload(expected, source, start, end) {
|
|
95
|
+
if (Array.isArray(expected)) {
|
|
96
|
+
for (var index = 0; index < expected.length; index++) if (compoundMatcherMatchesPayload(expected[index], source, start, end)) return true;
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
var expectedValue = typeof expected === "string" ? expected : String(expected);
|
|
100
|
+
if (expectedValue.length !== end - start) return false;
|
|
101
|
+
for (var index1 = 0; index1 < expectedValue.length; index1++) if (expectedValue.charCodeAt(index1) !== source.charCodeAt(start + index1)) return false;
|
|
102
|
+
return true;
|
|
81
103
|
}
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
104
|
+
var preparedCompoundsKey = /* @__PURE__ */ Symbol();
|
|
105
|
+
function prepareStaticConfigCompounds(staticConfig) {
|
|
106
|
+
var compoundVariants = staticConfig.compoundVariants;
|
|
107
|
+
var preparedConfig = staticConfig;
|
|
108
|
+
if (!(compoundVariants === null || compoundVariants === void 0 ? void 0 : compoundVariants.length)) {
|
|
109
|
+
preparedConfig[preparedCompoundsKey] = null;
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
var selectorCounts = [];
|
|
113
|
+
var indexesByKey = /* @__PURE__ */ Object.create(null);
|
|
114
|
+
indexesByKey[preparedCompoundsKey] = selectorCounts;
|
|
115
|
+
for (var index = 0; index < compoundVariants.length; index++) {
|
|
116
|
+
var compoundVariant = compoundVariants[index];
|
|
117
|
+
var selectorCount = 0;
|
|
118
|
+
for (var key in compoundVariant) {
|
|
119
|
+
var _indexesByKey, _key;
|
|
120
|
+
if (key === "style") continue;
|
|
121
|
+
selectorCount++;
|
|
122
|
+
((_indexesByKey = indexesByKey)[_key = key] || (_indexesByKey[_key] = [])).push(index);
|
|
123
|
+
}
|
|
124
|
+
selectorCounts[index] = selectorCount;
|
|
125
|
+
}
|
|
126
|
+
preparedConfig[preparedCompoundsKey] = indexesByKey;
|
|
127
|
+
}
|
|
128
|
+
var conditionWidth = 4;
|
|
129
|
+
var conditionValueOffset = 0;
|
|
130
|
+
var conditionFlagsOffset = 1;
|
|
131
|
+
var conditionPrecedenceOffset = 2;
|
|
132
|
+
var conditionWrapperOffset = 3;
|
|
133
|
+
var conditionActiveFlag = 1;
|
|
134
|
+
var conditionEmitFlag = 2;
|
|
135
|
+
var conditionResolvedFlag = 4;
|
|
136
|
+
var conditionEnterFlag = 8;
|
|
137
|
+
var conditionExitFlag = 16;
|
|
138
|
+
var conditionPlatformPseudoFlag = 32;
|
|
139
|
+
var conditionInitialFlags = conditionActiveFlag | conditionEmitFlag | conditionResolvedFlag;
|
|
140
|
+
var conditionTextWidth = 5;
|
|
141
|
+
var conditionKeyOffset = 0;
|
|
142
|
+
var conditionSelectorOffset = 1;
|
|
143
|
+
var conditionThemeOffset = 2;
|
|
144
|
+
var conditionUnsupportedStateOffset = 3;
|
|
145
|
+
var conditionUnresolvedNameOffset = 4;
|
|
146
|
+
var conditionNumbers = new Float64Array(2048);
|
|
147
|
+
var conditionTexts = [];
|
|
148
|
+
var conditionWrappers = [];
|
|
149
|
+
var conditionWrapperTop = 0;
|
|
150
|
+
var conditionCursorTop = conditionWidth;
|
|
151
|
+
function reserveConditionCursor(cursor) {
|
|
152
|
+
var required = cursor + conditionWidth;
|
|
153
|
+
if (required > conditionTexts.length) {
|
|
154
|
+
var previous = conditionTexts.length;
|
|
155
|
+
conditionTexts.length = required;
|
|
156
|
+
conditionTexts.fill("", previous);
|
|
157
|
+
}
|
|
158
|
+
if (required <= conditionNumbers.length) return;
|
|
159
|
+
var length = conditionNumbers.length * 2;
|
|
160
|
+
while (length < required) length *= 2;
|
|
161
|
+
var previous1 = conditionNumbers;
|
|
162
|
+
conditionNumbers = new Float64Array(length);
|
|
163
|
+
conditionNumbers.set(previous1);
|
|
164
|
+
}
|
|
165
|
+
function conditionWrapperCopy(cursor) {
|
|
166
|
+
var wrapper = conditionNumbers[cursor + conditionWrapperOffset];
|
|
167
|
+
var count = wrapper & 7;
|
|
168
|
+
if (!count) return void 0;
|
|
169
|
+
var start = wrapper >> 3;
|
|
170
|
+
var wrappers = new Array(count);
|
|
171
|
+
for (var index = 0; index < count; index++) wrappers[index] = conditionWrappers[start + index];
|
|
172
|
+
return wrappers;
|
|
173
|
+
}
|
|
174
|
+
function setConditionUnresolved(cursor) {
|
|
175
|
+
var name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
176
|
+
conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionResolvedFlag;
|
|
177
|
+
if (name) {
|
|
178
|
+
var _conditionTexts, _text;
|
|
179
|
+
var text = cursor + conditionUnresolvedNameOffset;
|
|
180
|
+
(_conditionTexts = conditionTexts)[_text = text] || (_conditionTexts[_text] = name);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function appendConditionWrapper(cursor, wrapper) {
|
|
184
|
+
conditionWrappers[conditionWrapperTop++] = wrapper;
|
|
185
|
+
conditionNumbers[cursor + conditionWrapperOffset]++;
|
|
186
|
+
}
|
|
187
|
+
function copyConditionCursor(target2, source) {
|
|
188
|
+
for (var offset = 0; offset <= conditionPrecedenceOffset; offset++) conditionNumbers[target2 + offset] = conditionNumbers[source + offset];
|
|
189
|
+
for (var offset1 = 0; offset1 < conditionTextWidth; offset1++) conditionTexts[target2 + offset1] = conditionTexts[source + offset1] || "";
|
|
190
|
+
var wrapper = conditionNumbers[source + conditionWrapperOffset];
|
|
191
|
+
var wrapperStart = wrapper >> 3;
|
|
192
|
+
var wrapperCount = wrapper & 7;
|
|
193
|
+
for (var index = 0; index < wrapperCount; index++) conditionWrappers[conditionWrapperTop++] = conditionWrappers[wrapperStart + index];
|
|
194
|
+
conditionNumbers[target2 + conditionWrapperOffset] += wrapperCount;
|
|
195
|
+
}
|
|
196
|
+
function resetConditionCursor(cursor, parent) {
|
|
197
|
+
conditionNumbers[cursor + conditionValueOffset] = 0;
|
|
198
|
+
conditionNumbers[cursor + conditionFlagsOffset] = conditionInitialFlags;
|
|
199
|
+
conditionNumbers[cursor + conditionPrecedenceOffset] = 0;
|
|
200
|
+
conditionNumbers[cursor + conditionWrapperOffset] = conditionWrapperTop << 3;
|
|
201
|
+
conditionTexts.fill("", cursor, cursor + conditionTextWidth);
|
|
202
|
+
if (parent) copyConditionCursor(cursor, parent);
|
|
203
|
+
}
|
|
204
|
+
function acquireConditionCursor() {
|
|
205
|
+
var parent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
206
|
+
var cursor = conditionCursorTop;
|
|
207
|
+
conditionCursorTop += conditionWidth;
|
|
208
|
+
reserveConditionCursor(cursor);
|
|
209
|
+
resetConditionCursor(cursor, parent);
|
|
210
|
+
return cursor;
|
|
211
|
+
}
|
|
212
|
+
function releaseConditionCursors(watermark) {
|
|
213
|
+
if (watermark >= conditionCursorTop) return;
|
|
214
|
+
conditionTexts.fill("", watermark, conditionCursorTop);
|
|
215
|
+
conditionCursorTop = watermark;
|
|
216
|
+
}
|
|
217
|
+
function releaseConditionPayloads(wrapperBase) {
|
|
218
|
+
conditionWrappers.fill("", wrapperBase, conditionWrapperTop);
|
|
219
|
+
conditionWrapperTop = wrapperBase;
|
|
220
|
+
}
|
|
221
|
+
function accumulateConditionAtom(state, cursor, kind, rank, name) {
|
|
222
|
+
var keySlot = cursor + conditionKeyOffset;
|
|
223
|
+
var key = conditionTexts[keySlot];
|
|
224
|
+
if (!key) conditionTexts[keySlot] = name;
|
|
225
|
+
else {
|
|
226
|
+
var slotStart = 0;
|
|
227
|
+
var inserted = false;
|
|
228
|
+
while (slotStart <= key.length) {
|
|
229
|
+
var slotEnd = key.indexOf(":", slotStart);
|
|
230
|
+
if (slotEnd === -1) slotEnd = key.length;
|
|
231
|
+
var order = 0;
|
|
232
|
+
var compareLength = Math.min(name.length, slotEnd - slotStart);
|
|
233
|
+
for (var offset = 0; offset < compareLength; offset++) {
|
|
234
|
+
order = name.charCodeAt(offset) - key.charCodeAt(slotStart + offset);
|
|
235
|
+
if (order) break;
|
|
236
|
+
}
|
|
237
|
+
order || (order = name.length - (slotEnd - slotStart));
|
|
238
|
+
if (!order) return;
|
|
239
|
+
if (order < 0) {
|
|
240
|
+
conditionTexts[keySlot] = `${key.slice(0, slotStart)}${name}:${key.slice(slotStart)}`;
|
|
241
|
+
inserted = true;
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
if (slotEnd === key.length) break;
|
|
245
|
+
slotStart = slotEnd + 1;
|
|
246
|
+
}
|
|
247
|
+
if (!inserted) conditionTexts[keySlot] = `${key}:${name}`;
|
|
248
|
+
}
|
|
249
|
+
if (kind === import_runtime.modifierKindPlatform) {
|
|
250
|
+
var precedence = conditionNumbers[cursor + conditionPrecedenceOffset];
|
|
251
|
+
if (rank > precedence >>> 26) conditionNumbers[cursor + conditionPrecedenceOffset] = precedence & 67108863 | rank << 26;
|
|
252
|
+
if (!(0, import_constants.platformMatches)(name)) conditionNumbers[cursor + conditionFlagsOffset] &= ~(conditionActiveFlag | conditionEmitFlag);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
var precedence1 = conditionNumbers[cursor + conditionPrecedenceOffset];
|
|
256
|
+
var depth = Math.min((precedence1 >> 23 & 7) + 1, 7);
|
|
257
|
+
var nextCategory = kind === import_runtime.modifierKindMedia ? 0 : kind === 6 ? 1 : kind === import_runtime.modifierKindTheme ? 2 : kind === 5 ? 3 : 4;
|
|
258
|
+
var categoryRank = precedence1 >> 20 & 7;
|
|
259
|
+
var withinRank = precedence1 & 1048575;
|
|
260
|
+
if (nextCategory > categoryRank) {
|
|
261
|
+
categoryRank = nextCategory;
|
|
262
|
+
withinRank = rank;
|
|
263
|
+
} else if (nextCategory === categoryRank && rank > withinRank) withinRank = rank;
|
|
264
|
+
precedence1 = precedence1 & -67108864 | depth << 23 | categoryRank << 20 | withinRank;
|
|
265
|
+
conditionNumbers[cursor + conditionPrecedenceOffset] = precedence1;
|
|
266
|
+
var buildCSS = import_directStyleCSS.canGenerateCSS && state.flatShouldDoClasses;
|
|
267
|
+
if (kind === import_runtime.modifierKindMedia) {
|
|
268
|
+
var _state_flatMediaState;
|
|
269
|
+
var _state;
|
|
270
|
+
var query = (0, import_grammarConfig.getConfigRevisionState)(state.conf).mediaQueries[name];
|
|
271
|
+
if (!query) {
|
|
272
|
+
setConditionUnresolved(cursor, name);
|
|
88
273
|
return;
|
|
89
274
|
}
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
];
|
|
108
|
-
(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
var
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
275
|
+
if (buildCSS) appendConditionWrapper(cursor, `@media ${query}`);
|
|
276
|
+
if (!((_state_flatMediaState = state.flatMediaState) === null || _state_flatMediaState === void 0 ? void 0 : _state_flatMediaState[name])) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
|
|
277
|
+
((_state = state).flatMediaKeys || (_state.flatMediaKeys = /* @__PURE__ */ new Set())).add(name);
|
|
278
|
+
} else if (kind === import_runtime.modifierKindTheme) {
|
|
279
|
+
var _state_flatThemeName;
|
|
280
|
+
conditionTexts[cursor + conditionThemeOffset] = name;
|
|
281
|
+
if (buildCSS) {
|
|
282
|
+
var selector = cursor + conditionSelectorOffset;
|
|
283
|
+
conditionTexts[selector] += `:where(.t_${name}, .t_${name} *)`;
|
|
284
|
+
}
|
|
285
|
+
if (state.flatThemeName !== name && ((_state_flatThemeName = state.flatThemeName) === null || _state_flatThemeName === void 0 ? void 0 : _state_flatThemeName.startsWith(`${name}_`)) !== true) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
|
|
286
|
+
} else if (kind === 5) {
|
|
287
|
+
var _state_componentState_group, _state_flatGroupContext, _this;
|
|
288
|
+
var _state1;
|
|
289
|
+
var slash = name.indexOf("/");
|
|
290
|
+
var groupName = slash === -1 ? "true" : name.slice(slash + 1);
|
|
291
|
+
var stateSelector = import_runtime.stateModifierSelectors[rank];
|
|
292
|
+
var conditionStateName = import_runtime.canonicalStateModifierNames[rank];
|
|
293
|
+
if (buildCSS) {
|
|
294
|
+
var selector1 = cursor + conditionSelectorOffset;
|
|
295
|
+
conditionTexts[selector1] += `:where(.t_group_${groupName}${stateSelector} *)`;
|
|
296
|
+
if (rank === 0) appendConditionWrapper(cursor, "@media (hover: hover)");
|
|
297
|
+
}
|
|
298
|
+
var component = (_state_componentState_group = state.componentState.group) === null || _state_componentState_group === void 0 ? void 0 : _state_componentState_group[groupName];
|
|
299
|
+
var context = (_state_flatGroupContext = state.flatGroupContext) === null || _state_flatGroupContext === void 0 ? void 0 : _state_flatGroupContext[groupName];
|
|
300
|
+
var _component_pseudo;
|
|
301
|
+
if (!((_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])) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
|
|
302
|
+
((_state1 = state).flatGroupKeys || (_state1.flatGroupKeys = /* @__PURE__ */ new Set())).add(groupName);
|
|
303
|
+
} else if (kind === 6) {
|
|
304
|
+
var _state_componentState_group1, _state_flatGroupContext1, _state_flatGroupContext2, _component_media;
|
|
305
|
+
var _state2, _state3;
|
|
306
|
+
var slash1 = name.indexOf("/");
|
|
307
|
+
var containerSize = name.slice(1, slash1 === -1 ? name.length : slash1);
|
|
308
|
+
var containerName = slash1 === -1 ? "" : name.slice(slash1 + 1);
|
|
309
|
+
var containerQuery = (0, import_grammarConfig.getConfigRevisionState)(state.conf).mediaQueries[containerSize];
|
|
310
|
+
var groupKey = `@${containerName}`;
|
|
311
|
+
if (buildCSS) appendConditionWrapper(cursor, containerName ? `@container ${containerName} ${containerQuery}` : `@container ${containerQuery}`);
|
|
312
|
+
var component1 = (_state_componentState_group1 = state.componentState.group) === null || _state_componentState_group1 === void 0 ? void 0 : _state_componentState_group1[groupKey];
|
|
313
|
+
var context1 = (_state_flatGroupContext1 = state.flatGroupContext) === null || _state_flatGroupContext1 === void 0 ? void 0 : _state_flatGroupContext1[groupKey];
|
|
314
|
+
if (process.env.NODE_ENV === "development" && containerName && !component1 && !context1 && ((_state_flatGroupContext2 = state.flatGroupContext) === null || _state_flatGroupContext2 === void 0 ? void 0 : _state_flatGroupContext2[containerName])) (0, import_warnOnce.warnOnce)(`group-container:${containerName}`, `@${containerSize}/${containerName}: targets group="${containerName}", but groups no longer establish query containers. Add container="${containerName}" to that group.`);
|
|
315
|
+
var match = component1 === null || component1 === void 0 ? void 0 : (_component_media = component1.media) === null || _component_media === void 0 ? void 0 : _component_media[containerSize];
|
|
316
|
+
if (!(match === void 0 ? (context1 === null || context1 === void 0 ? void 0 : context1.state.layout) && (0, import_mediaState2.mediaKeyMatch)(containerSize, context1.state.layout) : match)) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
|
|
317
|
+
((_state2 = state).flatGroupKeys || (_state2.flatGroupKeys = /* @__PURE__ */ new Set())).add(groupKey);
|
|
318
|
+
((_state3 = state).flatGroupMedia || (_state3.flatGroupMedia = /* @__PURE__ */ new Set())).add(containerSize);
|
|
319
|
+
} else {
|
|
320
|
+
var stateSelector1 = import_runtime.stateModifierSelectors[rank];
|
|
321
|
+
conditionNumbers[cursor + conditionFlagsOffset] += 64;
|
|
322
|
+
if (stateSelector1[0] === "[" && name !== "disabled") conditionTexts[cursor + conditionUnsupportedStateOffset] = name;
|
|
323
|
+
if (rank === 6) conditionNumbers[cursor + conditionFlagsOffset] |= conditionEnterFlag;
|
|
324
|
+
else if (rank === 7) conditionNumbers[cursor + conditionFlagsOffset] |= conditionExitFlag;
|
|
325
|
+
else if (rank === 0 || rank === 2 || rank === 4) conditionNumbers[cursor + conditionFlagsOffset] |= conditionPlatformPseudoFlag;
|
|
326
|
+
if (buildCSS) {
|
|
327
|
+
var selector2 = cursor + conditionSelectorOffset;
|
|
328
|
+
if (stateSelector1[0] === ".") conditionTexts[selector2] += `:is(${stateSelector1}, ${stateSelector1} *)`;
|
|
329
|
+
else conditionTexts[selector2] += stateSelector1;
|
|
330
|
+
if (rank === 0) appendConditionWrapper(cursor, "@media (hover: hover)");
|
|
331
|
+
}
|
|
332
|
+
var component2 = state.componentState;
|
|
333
|
+
if (!(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)) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
|
|
334
|
+
if (stateSelector1[0] === ":") {
|
|
335
|
+
var _state4;
|
|
336
|
+
((_state4 = state).flatStateKeys || (_state4.flatStateKeys = /* @__PURE__ */ new Set())).add(name);
|
|
117
337
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
function resolveConditionModifier(state, cursor, modifier) {
|
|
341
|
+
var compiled = (0, import_grammarConfig.getConfigRevisionState)(state.conf);
|
|
342
|
+
var code = compiled.modifiers[modifier];
|
|
343
|
+
var kind = code & 7;
|
|
344
|
+
var rank = code >> 3;
|
|
345
|
+
if (kind === import_runtime.modifierKindState) {
|
|
346
|
+
accumulateConditionAtom(state, cursor, kind, rank, import_runtime.canonicalStateModifierNames[rank]);
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
if (!kind && modifier.startsWith("group-")) {
|
|
350
|
+
var slash = modifier.indexOf("/");
|
|
351
|
+
var authoredState = modifier.slice(6, slash === -1 ? void 0 : slash);
|
|
352
|
+
code = compiled.modifiers[authoredState];
|
|
353
|
+
if ((code & 7) === import_runtime.modifierKindState) {
|
|
354
|
+
rank = code >> 3;
|
|
355
|
+
var groupName = slash === -1 ? "true" : modifier.slice(slash + 1);
|
|
356
|
+
if (rank !== 6 && rank !== 7 && (slash === -1 || (0, import_runtime.isModifierName)(groupName, 0, groupName.length))) {
|
|
357
|
+
var stateName = import_runtime.canonicalStateModifierNames[rank];
|
|
358
|
+
accumulateConditionAtom(state, cursor, 5, rank, `group-${stateName}${slash === -1 ? "" : modifier.slice(slash)}`);
|
|
359
|
+
return;
|
|
125
360
|
}
|
|
126
|
-
return chains.length ? chains : null;
|
|
127
361
|
}
|
|
362
|
+
} else if (!kind && modifier.charCodeAt(0) === 64) {
|
|
363
|
+
var slash1 = modifier.indexOf("/");
|
|
364
|
+
var containerSize = modifier.slice(1, slash1 === -1 ? void 0 : slash1);
|
|
365
|
+
var containerName = slash1 === -1 ? "" : modifier.slice(slash1 + 1);
|
|
366
|
+
var containerQuery = "";
|
|
367
|
+
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)) {
|
|
368
|
+
accumulateConditionAtom(state, cursor, 6, code >> 3, modifier);
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
} else if (kind) {
|
|
372
|
+
accumulateConditionAtom(state, cursor, kind, rank, modifier);
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
setConditionUnresolved(cursor, modifier);
|
|
376
|
+
}
|
|
377
|
+
function resolveConditionText(state, cursor, text) {
|
|
378
|
+
var start = 0;
|
|
379
|
+
for (var index = 0; index <= text.length; index++) {
|
|
380
|
+
if (index !== text.length && text.charCodeAt(index) !== 58) continue;
|
|
381
|
+
if (index === start) {
|
|
382
|
+
setConditionUnresolved(cursor);
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
if (!(conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag)) return;
|
|
386
|
+
resolveConditionModifier(state, cursor, text.slice(start, index));
|
|
387
|
+
start = index + 1;
|
|
128
388
|
}
|
|
129
|
-
return compoundMatcherMatches(expected, actual) ? [""] : null;
|
|
130
389
|
}
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
133
|
-
|
|
134
|
-
|
|
390
|
+
function commitConditionCursor(state, cursor) {
|
|
391
|
+
if (!(conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag)) {
|
|
392
|
+
conditionNumbers[cursor + conditionValueOffset] = 0;
|
|
393
|
+
return 0;
|
|
394
|
+
}
|
|
395
|
+
var key = conditionTexts[cursor + conditionKeyOffset] || "";
|
|
396
|
+
var precedence = conditionNumbers[cursor + conditionPrecedenceOffset];
|
|
397
|
+
var depth = precedence >> 23 & 7;
|
|
398
|
+
if (depth > 5) throw new Error(`a flat value clause supports at most 5 non-platform conditions; received ${depth} in "${key}:"`);
|
|
399
|
+
var flags = conditionNumbers[cursor + conditionFlagsOffset];
|
|
400
|
+
var condition = precedence * 256 + (flags >> 6) * 32 + 16 + (flags & conditionActiveFlag ? 1 : 0) + (flags & conditionEmitFlag ? 2 : 0) + (flags & conditionEnterFlag ? 4 : 0) + (flags & conditionExitFlag ? 8 : 0);
|
|
401
|
+
conditionNumbers[cursor + conditionValueOffset] = condition;
|
|
402
|
+
return condition;
|
|
135
403
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
404
|
+
function acquireConditionKeyCursor(state, key) {
|
|
405
|
+
var cursor = acquireConditionCursor();
|
|
406
|
+
if (key) {
|
|
407
|
+
resolveConditionText(state, cursor, key);
|
|
408
|
+
commitConditionCursor(state, cursor);
|
|
409
|
+
}
|
|
410
|
+
return cursor;
|
|
411
|
+
}
|
|
412
|
+
function combineConditionKeys(state, first, second) {
|
|
413
|
+
if (!first) return second;
|
|
414
|
+
if (!second || first === second) return first;
|
|
415
|
+
var watermark = conditionCursorTop;
|
|
416
|
+
var target2 = acquireConditionKeyCursor(state, first);
|
|
417
|
+
resolveConditionText(state, target2, second);
|
|
418
|
+
commitConditionCursor(state, target2);
|
|
419
|
+
var key = conditionTexts[target2 + conditionKeyOffset] || "";
|
|
420
|
+
releaseConditionCursors(watermark);
|
|
421
|
+
return key;
|
|
422
|
+
}
|
|
423
|
+
function freshCompoundState() {
|
|
424
|
+
return {
|
|
425
|
+
seen: 0,
|
|
426
|
+
failed: false,
|
|
427
|
+
matchedBase: false,
|
|
428
|
+
scanned: false,
|
|
429
|
+
pending: null,
|
|
430
|
+
combinations: null
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
function beginCompoundEdges(indexes, states) {
|
|
434
|
+
if (!indexes) return;
|
|
435
|
+
for (var index = 0; index < indexes.length; index++) {
|
|
436
|
+
var _states, _indexes_index;
|
|
437
|
+
var state = (_states = states)[_indexes_index = indexes[index]] || (_states[_indexes_index] = freshCompoundState());
|
|
438
|
+
state.pending = null;
|
|
439
|
+
state.matchedBase = false;
|
|
440
|
+
state.scanned = false;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
function feedCompoundSegment(state, source, start, end, isBase, valid, conditionKey) {
|
|
444
|
+
if (state.flatCompoundOutputDepth) return;
|
|
445
|
+
var pass = state.flatPass;
|
|
446
|
+
var indexes = pass[passCompoundIndexes];
|
|
447
|
+
var states = pass[passCompoundStates];
|
|
448
|
+
var key = pass[passCompoundKey];
|
|
449
|
+
if (!indexes || !states || !key) return;
|
|
450
|
+
var compoundVariants = state.staticConfig.compoundVariants;
|
|
451
|
+
for (var index = 0; index < indexes.length; index++) {
|
|
452
|
+
var _states, _compoundIndex;
|
|
453
|
+
var compoundIndex = indexes[index];
|
|
454
|
+
var compoundState = (_states = states)[_compoundIndex = compoundIndex] || (_states[_compoundIndex] = freshCompoundState());
|
|
455
|
+
compoundState.scanned = true;
|
|
456
|
+
if (!valid || start === end || !compoundMatcherMatchesPayload(compoundVariants[compoundIndex][key], source, start, end)) continue;
|
|
457
|
+
if (isBase) compoundState.matchedBase = true;
|
|
458
|
+
else if (!compoundState.matchedBase) {
|
|
459
|
+
var _compoundState;
|
|
460
|
+
((_compoundState = compoundState).pending || (_compoundState.pending = [])).push(conditionKey);
|
|
145
461
|
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
var compoundOnlyHandler = {
|
|
465
|
+
segment(state, start, end, isBase, valid, source, chainStart, chainEnd, chainValid) {
|
|
466
|
+
if (isBase) {
|
|
467
|
+
feedCompoundSegment(state, source, start, end, true, valid, "");
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
var cursor = state.flatScanCursor;
|
|
471
|
+
if (!chainValid || !cursor || !(conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) || !conditionNumbers[cursor + conditionValueOffset]) {
|
|
472
|
+
feedCompoundSegment(state, source, start, end, false, false, "");
|
|
473
|
+
return;
|
|
154
474
|
}
|
|
475
|
+
feedCompoundSegment(state, source, start, end, false, valid, conditionTexts[cursor + conditionKeyOffset] || "");
|
|
476
|
+
},
|
|
477
|
+
modifier(state, start, end, valid, first, source) {
|
|
478
|
+
var cursor = state.flatScanCursor;
|
|
479
|
+
if (!cursor) cursor = state.flatScanCursor = acquireConditionCursor();
|
|
480
|
+
else if (first) resetConditionCursor(cursor, 0);
|
|
481
|
+
if (!valid) {
|
|
482
|
+
setConditionUnresolved(cursor);
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) resolveConditionModifier(state, cursor, source.slice(start, end));
|
|
486
|
+
},
|
|
487
|
+
chain(state, _start, _end, valid) {
|
|
488
|
+
var cursor = state.flatScanCursor;
|
|
489
|
+
if (cursor) {
|
|
490
|
+
if (!valid) setConditionUnresolved(cursor);
|
|
491
|
+
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) commitConditionCursor(state, cursor);
|
|
492
|
+
}
|
|
493
|
+
return true;
|
|
155
494
|
}
|
|
156
|
-
return segments.join(":");
|
|
157
495
|
};
|
|
158
|
-
function
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
496
|
+
function finishCompoundEdges(pass, key, value, indexes, states) {
|
|
497
|
+
if (!indexes) return;
|
|
498
|
+
var state = pass[passStyleState];
|
|
499
|
+
pass[passCompoundIndexes] = indexes;
|
|
500
|
+
pass[passCompoundKey] = key;
|
|
501
|
+
pass[passCompoundStates] = states;
|
|
502
|
+
var needsScan = false;
|
|
503
|
+
for (var index = 0; index < indexes.length; index++) {
|
|
504
|
+
var _states, _indexes_index;
|
|
505
|
+
if (!((_states = states)[_indexes_index = indexes[index]] || (_states[_indexes_index] = freshCompoundState())).scanned) {
|
|
506
|
+
needsScan = true;
|
|
507
|
+
break;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
if (needsScan) if (typeof value === "string") {
|
|
511
|
+
var watermark = conditionCursorTop;
|
|
512
|
+
var previousCursor = state.flatScanCursor;
|
|
513
|
+
state.flatScanCursor = null;
|
|
166
514
|
try {
|
|
167
|
-
|
|
168
|
-
var a = _step.value;
|
|
169
|
-
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
170
|
-
try {
|
|
171
|
-
for (var _iterator1 = keyChains[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
172
|
-
var b = _step1.value;
|
|
173
|
-
var joined = joinChains(a, b);
|
|
174
|
-
if (!next.includes(joined)) next.push(joined);
|
|
175
|
-
}
|
|
176
|
-
} catch (err) {
|
|
177
|
-
_didIteratorError1 = true;
|
|
178
|
-
_iteratorError1 = err;
|
|
179
|
-
} finally {
|
|
180
|
-
try {
|
|
181
|
-
if (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();
|
|
182
|
-
} finally {
|
|
183
|
-
if (_didIteratorError1) throw _iteratorError1;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
} catch (err) {
|
|
188
|
-
_didIteratorError = true;
|
|
189
|
-
_iteratorError = err;
|
|
515
|
+
(0, import_runtime.scanFlatValue)(value, compoundOnlyHandler, state);
|
|
190
516
|
} finally {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
517
|
+
state.flatScanCursor = previousCursor;
|
|
518
|
+
releaseConditionCursors(watermark);
|
|
519
|
+
}
|
|
520
|
+
} else if (value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value) && Object.prototype.hasOwnProperty.call(value, "default")) for (var conditionKey in value) {
|
|
521
|
+
var payload = value[conditionKey];
|
|
522
|
+
if (conditionKey === "default") {
|
|
523
|
+
var payloadString = String(payload);
|
|
524
|
+
feedCompoundSegment(state, payloadString, 0, payloadString.length, true, true, "");
|
|
525
|
+
} else {
|
|
526
|
+
var watermark1 = conditionCursorTop;
|
|
527
|
+
var cursor = acquireConditionCursor();
|
|
528
|
+
resolveConditionText(state, cursor, conditionKey);
|
|
529
|
+
var condition = commitConditionCursor(state, cursor);
|
|
530
|
+
var payloadString1 = String(payload);
|
|
531
|
+
feedCompoundSegment(state, payloadString1, 0, payloadString1.length, false, Boolean(condition), condition ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
532
|
+
releaseConditionCursors(watermark1);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
else {
|
|
536
|
+
var variants = state.staticConfig.compoundVariants;
|
|
537
|
+
for (var index1 = 0; index1 < indexes.length; index1++) {
|
|
538
|
+
var _states1, _compoundIndex;
|
|
539
|
+
var compoundIndex = indexes[index1];
|
|
540
|
+
var compoundState1 = (_states1 = states)[_compoundIndex = compoundIndex] || (_states1[_compoundIndex] = freshCompoundState());
|
|
541
|
+
compoundState1.scanned = true;
|
|
542
|
+
if (compoundMatcherMatches(variants[compoundIndex][key], value)) compoundState1.matchedBase = true;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
var variants1 = state.staticConfig.compoundVariants;
|
|
546
|
+
var selectorCounts = state.staticConfig[preparedCompoundsKey][preparedCompoundsKey];
|
|
547
|
+
for (var index2 = 0; index2 < indexes.length; index2++) {
|
|
548
|
+
var compoundIndex1 = indexes[index2];
|
|
549
|
+
var compoundState2 = states[compoundIndex1];
|
|
550
|
+
if (compoundState2.failed) continue;
|
|
551
|
+
var branches = compoundState2.matchedBase ? [""] : compoundState2.pending;
|
|
552
|
+
if (!branches || !branches.length) {
|
|
553
|
+
compoundState2.failed = true;
|
|
554
|
+
continue;
|
|
555
|
+
}
|
|
556
|
+
if (!compoundState2.seen) compoundState2.combinations = branches;
|
|
557
|
+
else {
|
|
558
|
+
var previous = compoundState2.combinations;
|
|
559
|
+
var next = [];
|
|
560
|
+
for (var left = 0; left < previous.length; left++) for (var right = 0; right < branches.length; right++) {
|
|
561
|
+
var conditionKey1 = combineConditionKeys(state, previous[left], branches[right]);
|
|
562
|
+
if (!next.includes(conditionKey1)) next.push(conditionKey1);
|
|
195
563
|
}
|
|
564
|
+
compoundState2.combinations = next;
|
|
565
|
+
}
|
|
566
|
+
compoundState2.seen++;
|
|
567
|
+
if (compoundState2.seen !== selectorCounts[compoundIndex1]) continue;
|
|
568
|
+
var style = variants1[compoundIndex1].style;
|
|
569
|
+
if (!(0, import_isObj.isPlainObject)(style)) continue;
|
|
570
|
+
var combinations = compoundState2.combinations;
|
|
571
|
+
for (var combination = 0; combination < combinations.length; combination++) for (var styleKey in style) contributeProp(pass, styleKey, style[styleKey], void 0, states, combinations[combination]);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
function classifyConditionalObject(value, state, isChain, firstCursor) {
|
|
575
|
+
if (Object.prototype.hasOwnProperty.call(value, "default")) return -1;
|
|
576
|
+
for (var key in value) {
|
|
577
|
+
if (!key.length) return 0;
|
|
578
|
+
if (!state) return (isChain === null || isChain === void 0 ? void 0 : isChain(key)) ? 1 : 0;
|
|
579
|
+
var watermark = conditionCursorTop;
|
|
580
|
+
var cursor = firstCursor || acquireConditionCursor();
|
|
581
|
+
try {
|
|
582
|
+
resolveConditionText(state, cursor, key);
|
|
583
|
+
return commitConditionCursor(state, cursor);
|
|
584
|
+
} finally {
|
|
585
|
+
if (!firstCursor) releaseConditionCursors(watermark);
|
|
196
586
|
}
|
|
197
|
-
chains = next;
|
|
198
587
|
}
|
|
199
|
-
return
|
|
588
|
+
return 0;
|
|
200
589
|
}
|
|
590
|
+
var passStyleState = 0;
|
|
591
|
+
var passClassName = 21;
|
|
592
|
+
var passShouldDoClasses = 22;
|
|
593
|
+
var passFrontendGroup = 26;
|
|
594
|
+
var passFrontendContainer = 27;
|
|
595
|
+
var passFrontendContainerType = 28;
|
|
596
|
+
var passHocMappedProperties = 29;
|
|
597
|
+
var passHocMappedClasses = 30;
|
|
598
|
+
var passCompoundIndexes = 31;
|
|
599
|
+
var passCompoundKey = 32;
|
|
600
|
+
var passCompoundStates = 33;
|
|
601
|
+
var passParentCursor = 35;
|
|
602
|
+
var passMapSourceKey = 36;
|
|
603
|
+
var passMapFlags = 37;
|
|
604
|
+
var passNoSkipFlag = 1;
|
|
605
|
+
var passDisableShorthandsFlag = 2;
|
|
606
|
+
var passNoExpandFlag = 4;
|
|
607
|
+
var passNoMergeFlag = 8;
|
|
608
|
+
var passHocFlag = 16;
|
|
609
|
+
var passTextFlag = 32;
|
|
610
|
+
var passInputFlag = 64;
|
|
611
|
+
var passAsChildStyleFlag = 128;
|
|
201
612
|
var styledDefaultsCache = /* @__PURE__ */ new WeakMap();
|
|
202
|
-
function getStyledDefaults(staticConfig) {
|
|
203
|
-
var
|
|
204
|
-
if (
|
|
205
|
-
entries = null;
|
|
613
|
+
function getStyledDefaults(staticConfig, shorthands) {
|
|
614
|
+
var prepared = styledDefaultsCache.get(staticConfig);
|
|
615
|
+
if (prepared === void 0) {
|
|
616
|
+
var entries = null;
|
|
206
617
|
var defaults = staticConfig.defaultProps;
|
|
207
|
-
if (defaults) for (var key in defaults)
|
|
208
|
-
|
|
618
|
+
if (defaults) for (var key in defaults) {
|
|
619
|
+
if (!(key in import_helpers.stylePropsAll || key in shorthands)) continue;
|
|
620
|
+
var value = defaults[key];
|
|
621
|
+
if (maybeStyleProgram(value)) (entries || (entries = [])).push(key, value);
|
|
622
|
+
}
|
|
623
|
+
prepared = entries;
|
|
624
|
+
styledDefaultsCache.set(staticConfig, prepared);
|
|
209
625
|
}
|
|
210
|
-
return
|
|
626
|
+
return prepared;
|
|
211
627
|
}
|
|
212
628
|
var maybeStyleProgram = function(value) {
|
|
213
|
-
return typeof value === "string" ? value.
|
|
629
|
+
return typeof value === "string" ? value.indexOf(":") !== -1 : !!value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value);
|
|
214
630
|
};
|
|
215
|
-
function contributeDisplacedStyledDefaults(styledDefaults, processedProps,
|
|
631
|
+
function contributeDisplacedStyledDefaults(styledDefaults, processedProps, pass) {
|
|
216
632
|
if (!styledDefaults) return;
|
|
217
|
-
for (var
|
|
218
|
-
var key = styledDefaults[
|
|
219
|
-
var
|
|
633
|
+
for (var offset = 0; offset < styledDefaults.length; offset += 2) {
|
|
634
|
+
var key = styledDefaults[offset];
|
|
635
|
+
var value = styledDefaults[offset + 1];
|
|
220
636
|
var propValue = processedProps[key];
|
|
221
|
-
if (
|
|
222
|
-
|
|
637
|
+
if (propValue !== void 0 && propValue !== value) contributeProp(pass, key, value);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
function injectDisplacedStyledDefault(pass, key, value) {
|
|
641
|
+
var _pass__defaultProps;
|
|
642
|
+
var defaultValue = (_pass__defaultProps = pass[4].defaultProps) === null || _pass__defaultProps === void 0 ? void 0 : _pass__defaultProps[key];
|
|
643
|
+
if (defaultValue === void 0 || value === void 0 || value === defaultValue || maybeStyleProgram(defaultValue)) return;
|
|
644
|
+
var state = pass[passStyleState];
|
|
645
|
+
state.flatWeakContribution = true;
|
|
646
|
+
try {
|
|
647
|
+
contributeProp(pass, key, defaultValue);
|
|
648
|
+
} finally {
|
|
649
|
+
state.flatWeakContribution = false;
|
|
223
650
|
}
|
|
224
651
|
}
|
|
225
|
-
function forEachPropInForwardOrder(
|
|
652
|
+
function forEachPropInForwardOrder(pass) {
|
|
653
|
+
var _staticConfig_compoundVariants;
|
|
654
|
+
var styleState = pass[passStyleState];
|
|
655
|
+
var staticConfig = styleState.staticConfig;
|
|
656
|
+
var processedProps = styleState.props;
|
|
657
|
+
var shorthands = styleState.conf.shorthands;
|
|
226
658
|
var processedBaseStyle = staticConfig.baseStyle;
|
|
227
|
-
var
|
|
228
|
-
var
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
659
|
+
var styledDefaults = getStyledDefaults(staticConfig, shorthands);
|
|
660
|
+
var directState = styleState;
|
|
661
|
+
var preparedCompounds = staticConfig[preparedCompoundsKey];
|
|
662
|
+
if (preparedCompounds === void 0 && ((_staticConfig_compoundVariants = staticConfig.compoundVariants) === null || _staticConfig_compoundVariants === void 0 ? void 0 : _staticConfig_compoundVariants.length)) throw new Error("A component with compoundVariants reached style resolution before its static config was prepared.");
|
|
663
|
+
var conditionWrapperBase = conditionWrapperTop;
|
|
664
|
+
if (!preparedCompounds) {
|
|
665
|
+
try {
|
|
666
|
+
if (processedBaseStyle) for (var key in processedBaseStyle) contributeProp(pass, key, processedBaseStyle[key]);
|
|
667
|
+
contributeDisplacedStyledDefaults(styledDefaults, processedProps, pass);
|
|
668
|
+
for (var key1 in processedProps) {
|
|
669
|
+
var value = processedProps[key1];
|
|
670
|
+
directState.flatPropSawCondition = false;
|
|
671
|
+
contributeProp(pass, key1, value);
|
|
672
|
+
if (directState.flatPropSawCondition) injectDisplacedStyledDefault(pass, key1, value);
|
|
673
|
+
}
|
|
674
|
+
} finally {
|
|
675
|
+
releaseConditionPayloads(conditionWrapperBase);
|
|
676
|
+
}
|
|
233
677
|
return;
|
|
234
678
|
}
|
|
235
|
-
var
|
|
236
|
-
var
|
|
237
|
-
contributeDisplacedStyledDefaults(styledDefaults, processedProps, shorthands, function(k, v) {
|
|
238
|
-
return orderedEntries.push([k, v]);
|
|
239
|
-
});
|
|
240
|
-
var compoundsByAnchor = /* @__PURE__ */ new Map();
|
|
241
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
679
|
+
var compoundVariants = staticConfig.compoundVariants;
|
|
680
|
+
var compoundStates = new Array(compoundVariants.length);
|
|
242
681
|
try {
|
|
243
|
-
for (var
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
682
|
+
if (processedBaseStyle) for (var key2 in processedBaseStyle) contributeProp(pass, key2, processedBaseStyle[key2]);
|
|
683
|
+
contributeDisplacedStyledDefaults(styledDefaults, processedProps, pass);
|
|
684
|
+
var selectorCounts = preparedCompounds[preparedCompoundsKey];
|
|
685
|
+
for (var compoundIndex = 0; compoundIndex < compoundVariants.length; compoundIndex++) {
|
|
686
|
+
if (selectorCounts[compoundIndex]) continue;
|
|
687
|
+
var style = compoundVariants[compoundIndex].style;
|
|
248
688
|
if (!(0, import_isObj.isPlainObject)(style)) continue;
|
|
249
|
-
var
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
_didIteratorError1 = true;
|
|
282
|
-
_iteratorError1 = err;
|
|
283
|
-
} finally {
|
|
284
|
-
try {
|
|
285
|
-
if (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();
|
|
286
|
-
} finally {
|
|
287
|
-
if (_didIteratorError1) throw _iteratorError1;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
compoundsByAnchor.set(anchor, entries);
|
|
689
|
+
for (var key3 in style) contributeProp(pass, key3, style[key3]);
|
|
690
|
+
}
|
|
691
|
+
for (var key4 in processedProps) {
|
|
692
|
+
var compoundIndexes = preparedCompounds[key4];
|
|
693
|
+
var value1 = processedProps[key4];
|
|
694
|
+
beginCompoundEdges(compoundIndexes, compoundStates);
|
|
695
|
+
directState.flatPropSawCondition = false;
|
|
696
|
+
contributeProp(pass, key4, value1, compoundIndexes, compoundStates);
|
|
697
|
+
if (directState.flatPropSawCondition) injectDisplacedStyledDefault(pass, key4, value1);
|
|
698
|
+
finishCompoundEdges(pass, key4, value1, compoundIndexes, compoundStates);
|
|
699
|
+
}
|
|
700
|
+
} finally {
|
|
701
|
+
releaseConditionPayloads(conditionWrapperBase);
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
function isValidStyleKey(key, validStyles, accept) {
|
|
705
|
+
return Boolean(key in validStyles || accept && key in accept);
|
|
706
|
+
}
|
|
707
|
+
function flushForwardStylesToClasses(pass) {
|
|
708
|
+
var styleState = pass[passStyleState];
|
|
709
|
+
if (!pass[passShouldDoClasses]) return;
|
|
710
|
+
(0, import_directStyleCSS.completeStreamingCSS)(styleState);
|
|
711
|
+
(0, import_directStyleCSS.flushDirectStyles)(styleState, true);
|
|
712
|
+
}
|
|
713
|
+
function effectiveLifecycleKeys(keys) {
|
|
714
|
+
if (!keys) return;
|
|
715
|
+
var out = /* @__PURE__ */ new Set();
|
|
716
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
717
|
+
try {
|
|
718
|
+
for (var _iterator2 = keys[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
719
|
+
var key = _step2.value;
|
|
720
|
+
out.add(key === "--t-x" || key === "--t-y" ? "translate" : key === "--t-scale-x" || key === "--t-scale-y" ? "scale" : key);
|
|
292
721
|
}
|
|
293
722
|
} catch (err) {
|
|
294
|
-
|
|
295
|
-
|
|
723
|
+
_didIteratorError2 = true;
|
|
724
|
+
_iteratorError2 = err;
|
|
296
725
|
} finally {
|
|
297
726
|
try {
|
|
298
|
-
if (!
|
|
727
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
299
728
|
} finally {
|
|
300
|
-
if (
|
|
729
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
301
730
|
}
|
|
302
731
|
}
|
|
303
|
-
|
|
304
|
-
var beforeProps = compoundsByAnchor.get(-1);
|
|
305
|
-
if (beforeProps) for (var index2 = 0; index2 < beforeProps.length; index2++) contribute(beforeProps[index2][0], beforeProps[index2][1]);
|
|
306
|
-
for (var index3 = 0; index3 < propEntries.length; index3++) {
|
|
307
|
-
contribute(propEntries[index3][0], propEntries[index3][1]);
|
|
308
|
-
var compounds = compoundsByAnchor.get(index3);
|
|
309
|
-
if (compounds) for (var i = 0; i < compounds.length; i++) contribute(compounds[i][0], compounds[i][1]);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
function isValidStyleKey(key, validStyles, accept) {
|
|
313
|
-
return Boolean(key in validStyles || import_constants.isWeb && (key === "transitionProperty" || key === "transitionDuration" || key === "transitionTimingFunction" || key === "transitionDelay" || key === "transitionBehavior") || accept && key in accept);
|
|
732
|
+
return out;
|
|
314
733
|
}
|
|
315
|
-
|
|
316
|
-
var
|
|
317
|
-
var
|
|
318
|
-
|
|
319
|
-
var
|
|
320
|
-
var
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
var
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
734
|
+
function mapContributedProp(styleState, key, val, originalVal, condition) {
|
|
735
|
+
var pass = styleState.flatPass;
|
|
736
|
+
var keyInit = pass[passMapSourceKey];
|
|
737
|
+
var disablePropMap = Boolean(pass[passMapFlags]);
|
|
738
|
+
var [, conf, props, viewProps, , validStyles, accept, , variants, inlineProps, parentVariants, , styledContext, styledContextKeys, flags, debug] = pass;
|
|
739
|
+
var isHOC = Boolean(flags & passHocFlag);
|
|
740
|
+
var hocParentVariants = isHOC ? parentVariants : void 0;
|
|
741
|
+
var canResolveContextPrograms = !isHOC;
|
|
742
|
+
var isStyledContextProp = (styledContextKeys === null || styledContextKeys === void 0 ? void 0 : styledContextKeys.has(key)) || styledContext && key in styledContext;
|
|
743
|
+
if (key === "className") return;
|
|
744
|
+
if (canResolveContextPrograms && disablePropMap && !isStyledContextProp) {
|
|
745
|
+
if (key in import_helpers.stylePropsAll && !isValidStyleKey(key, validStyles, accept)) {
|
|
746
|
+
if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${key}" is a text style prop and this component is not text \u2014 it would render on neither platform. Use a Text-based component, or html.* for raw web elements.`);
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
viewProps[key] = val;
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
753
|
+
console.groupCollapsed(" 💠 expanded", keyInit, "=>", key);
|
|
754
|
+
(0, import_log.log)(val);
|
|
755
|
+
console.groupEnd();
|
|
756
|
+
}
|
|
757
|
+
if (val == null) return;
|
|
758
|
+
if (accept && key in accept) {
|
|
759
|
+
viewProps[key] = val;
|
|
760
|
+
return;
|
|
761
|
+
}
|
|
762
|
+
var isHostStyleKey = isValidStyleKey(key, validStyles, accept) || import_constants.isAndroid && key === "elevation";
|
|
763
|
+
var isContextProgramKey = canResolveContextPrograms && Boolean(isStyledContextProp);
|
|
764
|
+
if (condition !== void 0) {
|
|
765
|
+
var conditionCursor = condition;
|
|
766
|
+
if (isHostStyleKey || isContextProgramKey) contributeValue(styleState, key, val, mergeStyle, originalVal, !isHostStyleKey, conditionCursor);
|
|
767
|
+
else if (isHOC) {
|
|
768
|
+
var structured = mergeConditionTransport(styleState, viewProps[key], conditionCursor, val);
|
|
769
|
+
if (key in viewProps) delete viewProps[key];
|
|
770
|
+
viewProps[key] = structured;
|
|
771
|
+
} else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${key}" is not a valid style on this component; the conditional variant value is dropped.`);
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
if (isHostStyleKey || isContextProgramKey) {
|
|
775
|
+
contributeValue(styleState, key, val, mergeStyle, originalVal, !isHostStyleKey);
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
778
|
+
var isVariant = Boolean(variants && key in variants);
|
|
779
|
+
if (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(key)) {
|
|
780
|
+
var _props_key;
|
|
781
|
+
viewProps[key] = (_props_key = props[key]) !== null && _props_key !== void 0 ? _props_key : val;
|
|
782
|
+
}
|
|
783
|
+
if (Boolean(hocParentVariants && hocParentVariants[keyInit])) {
|
|
784
|
+
passDownProp(viewProps, key, val);
|
|
785
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
786
|
+
console.groupCollapsed(` - passing down prop ${key}`);
|
|
361
787
|
(0, import_log.log)({
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
shouldDoClasses,
|
|
365
|
-
styleProps,
|
|
366
|
-
rulesToInsert,
|
|
367
|
-
componentState,
|
|
368
|
-
styleState,
|
|
369
|
-
theme: { ...theme }
|
|
788
|
+
val,
|
|
789
|
+
after: { ...viewProps[key] }
|
|
370
790
|
});
|
|
791
|
+
console.groupEnd();
|
|
371
792
|
}
|
|
793
|
+
return;
|
|
372
794
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
var styleFrontend = staticConfig.styleFrontend;
|
|
378
|
-
if (styleFrontend && !props[import_styleFrontend.STYLE_FRONTEND_PREPROCESSED]) processedProps = styleFrontend.preprocessProps(props, conf);
|
|
379
|
-
else processedProps = props;
|
|
380
|
-
var { webContainerType } = conf.settings;
|
|
381
|
-
var parentVariants = parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.variants;
|
|
382
|
-
var mergeStylePropAtCurrentPosition = function(styleProp) {
|
|
383
|
-
if (styleProps.noMergeStyle || !styleProp) return;
|
|
384
|
-
if (isHOC) {
|
|
385
|
-
viewProps.style = normalizeStyle(styleProp);
|
|
795
|
+
if (!isVariant) {
|
|
796
|
+
if (isStyledContextProp) return;
|
|
797
|
+
if (key in import_helpers.stylePropsAll && !isValidStyleKey(key, validStyles, accept)) {
|
|
798
|
+
if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${key}" is a text style prop and this component is not text \u2014 it would render on neither platform. Use a Text-based component, or html.* for raw web elements.`);
|
|
386
799
|
return;
|
|
387
800
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
801
|
+
viewProps[key] = val;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
function contributeProp(pass, keyOg, valOg, compoundIndexes, compoundStates, parentConditionKey) {
|
|
805
|
+
var parentWatermark = conditionCursorTop;
|
|
806
|
+
if (compoundIndexes) {
|
|
807
|
+
pass[passCompoundIndexes] = compoundIndexes;
|
|
808
|
+
pass[passCompoundKey] = keyOg;
|
|
809
|
+
pass[passCompoundStates] = compoundStates;
|
|
810
|
+
} else if (pass[passCompoundIndexes]) pass[passCompoundIndexes] = void 0;
|
|
811
|
+
if (parentConditionKey) pass[passParentCursor] = acquireConditionKeyCursor(pass[passStyleState], parentConditionKey);
|
|
812
|
+
try {
|
|
813
|
+
var [styleState, conf, props, viewProps, staticConfig, validStyles, accept, neverSkipProps, variants, inlineProps, parentVariants, styleFrontend, styledContext, styledContextKeys, flags, debug, parentStaticConfig, defaultProps, driverAnimations, driverOutputStyle, elementType] = pass;
|
|
814
|
+
var noSkip = Boolean(flags & passNoSkipFlag);
|
|
815
|
+
var disableExpandShorthands = Boolean(flags & passDisableShorthandsFlag);
|
|
816
|
+
var noExpand = Boolean(flags & passNoExpandFlag);
|
|
817
|
+
var noMergeStyle = Boolean(flags & passNoMergeFlag);
|
|
818
|
+
var isHOC = Boolean(flags & passHocFlag);
|
|
819
|
+
var isText = Boolean(flags & passTextFlag);
|
|
820
|
+
var isInput = Boolean(flags & passInputFlag);
|
|
821
|
+
var shorthands = conf.shorthands;
|
|
822
|
+
var shouldSkipDirectProps = !noSkip && !isHOC;
|
|
823
|
+
var shouldCheckSkipProps = !noSkip;
|
|
824
|
+
var asChildExceptStyleLike = Boolean(flags & passAsChildStyleFlag);
|
|
825
|
+
var isTextOrInput = isText || isInput;
|
|
826
|
+
var hocParentVariants = isHOC ? parentVariants : void 0;
|
|
411
827
|
var keyInit = keyOg;
|
|
412
828
|
var valInit = valOg;
|
|
413
|
-
if (styleFrontend && keyInit.startsWith(import_styleFrontend.STYLE_FRONTEND_PASSTHROUGH_PREFIX)) keyInit = "className";
|
|
414
829
|
if (keyInit === "children") {
|
|
415
830
|
viewProps[keyInit] = valInit;
|
|
416
831
|
return;
|
|
@@ -419,11 +834,10 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
419
834
|
if (keyInit[0] === "d" && keyInit.startsWith("data-")) return;
|
|
420
835
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`before-prop-${keyInit}`;
|
|
421
836
|
if (process.env.NODE_ENV === "test" && keyInit === "jestAnimatedStyle") return;
|
|
422
|
-
if (keyInit === "transition" || keyInit === "transitionProperty" || keyInit === "transitionDuration" || keyInit === "transitionTimingFunction" || keyInit === "transitionDelay" || keyInit === "transitionBehavior") return;
|
|
423
837
|
if (accept) {
|
|
424
838
|
var accepted = accept[keyInit];
|
|
425
839
|
if ((accepted === "style" || accepted === "textStyle") && valInit && (typeof valInit === "undefined" ? "undefined" : _type_of(valInit)) === "object") {
|
|
426
|
-
viewProps[keyInit] =
|
|
840
|
+
viewProps[keyInit] = resolveAcceptedStyle(styleState, valInit);
|
|
427
841
|
return;
|
|
428
842
|
}
|
|
429
843
|
}
|
|
@@ -431,58 +845,120 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
431
845
|
if (keyInit in shorthands) keyInit = shorthands[keyInit];
|
|
432
846
|
}
|
|
433
847
|
if (keyInit === "className") {
|
|
434
|
-
if (typeof valInit === "string" && valInit) {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
848
|
+
if (typeof valInit === "string" && valInit && (styleFrontend === null || styleFrontend === void 0 ? void 0 : styleFrontend.getClassPlan)) {
|
|
849
|
+
if (noMergeStyle) {
|
|
850
|
+
viewProps.className = valInit;
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
var hocClassNames = props[import_skipProps.HOC_CLASSNAME_MARKER];
|
|
854
|
+
if (hocClassNames && (typeof hocClassNames === "undefined" ? "undefined" : _type_of(hocClassNames)) === "object") {
|
|
855
|
+
flushForwardStylesToClasses(pass);
|
|
856
|
+
for (var property in hocClassNames) {
|
|
857
|
+
var _pass, _passHocMappedProperties, _pass1, _passHocMappedClasses;
|
|
858
|
+
var generatedClass = hocClassNames[property];
|
|
859
|
+
if (typeof generatedClass !== "string") continue;
|
|
860
|
+
clearDirectStyle(styleState, property);
|
|
861
|
+
styleState.classNames[property] = generatedClass;
|
|
862
|
+
((_pass = pass)[_passHocMappedProperties = passHocMappedProperties] || (_pass[_passHocMappedProperties] = /* @__PURE__ */ new Set())).add(property);
|
|
863
|
+
((_pass1 = pass)[_passHocMappedClasses = passHocMappedClasses] || (_pass1[_passHocMappedClasses] = /* @__PURE__ */ new Set())).add(generatedClass);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
var getClassPlan = styleFrontend === null || styleFrontend === void 0 ? void 0 : styleFrontend.getClassPlan;
|
|
867
|
+
var start = 0;
|
|
868
|
+
for (var index = 0; index <= valInit.length; index++) {
|
|
869
|
+
var _pass_passHocMappedClasses;
|
|
870
|
+
if (index !== valInit.length && valInit.charCodeAt(index) > 32) continue;
|
|
871
|
+
if (index === start) {
|
|
872
|
+
start = index + 1;
|
|
873
|
+
continue;
|
|
874
|
+
}
|
|
875
|
+
var candidate = valInit.slice(start, index);
|
|
876
|
+
if ((_pass_passHocMappedClasses = pass[passHocMappedClasses]) === null || _pass_passHocMappedClasses === void 0 ? void 0 : _pass_passHocMappedClasses.has(candidate)) {
|
|
877
|
+
start = index + 1;
|
|
878
|
+
continue;
|
|
879
|
+
}
|
|
880
|
+
var plan = getClassPlan ? getClassPlan(candidate, conf) : "raw";
|
|
881
|
+
if (plan === null) {
|
|
882
|
+
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`[tamagui] frontend candidate "${candidate}" is unavailable on this platform and was dropped.`);
|
|
883
|
+
} else if (plan === "raw") {
|
|
884
|
+
pass[passClassName] = pass[passClassName] ? `${pass[passClassName]} ${candidate}` : candidate;
|
|
885
|
+
if (getClassPlan) {
|
|
886
|
+
flushForwardStylesToClasses(pass);
|
|
887
|
+
pass[passShouldDoClasses] = false;
|
|
888
|
+
styleState.flatShouldDoClasses = false;
|
|
889
|
+
}
|
|
890
|
+
} else {
|
|
891
|
+
var parentPlan = plan;
|
|
892
|
+
if (!Array.isArray(plan) && parentPlan.preserveRawClass) {
|
|
893
|
+
pass[passClassName] = pass[passClassName] ? `${pass[passClassName]} ${candidate}` : candidate;
|
|
894
|
+
flushForwardStylesToClasses(pass);
|
|
895
|
+
pass[passShouldDoClasses] = false;
|
|
896
|
+
styleState.flatShouldDoClasses = false;
|
|
897
|
+
}
|
|
898
|
+
var entries = Array.isArray(plan) ? plan : parentPlan.entries;
|
|
899
|
+
for (var entryIndex = 0; entryIndex < entries.length; entryIndex++) {
|
|
900
|
+
var entry = entries[entryIndex];
|
|
901
|
+
if (entry[2] !== void 0) {
|
|
902
|
+
if (isValidStyleKey(entry[0], validStyles, accept)) contributeValue(styleState, entry[0], entry[1], mergeStyle, void 0, false, entry[2]);
|
|
903
|
+
else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${entry[0]}" is not a valid style on this component; the frontend value is dropped.`);
|
|
904
|
+
} else {
|
|
905
|
+
if (entry[0] === "group") pass[passFrontendGroup] = entry[1];
|
|
906
|
+
else if (entry[0] === "container") pass[passFrontendContainer] = entry[1];
|
|
907
|
+
else if (entry[0] === "containerType") pass[passFrontendContainerType] = entry[1];
|
|
908
|
+
contributeProp(pass, entry[0], entry[1]);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
start = index + 1;
|
|
913
|
+
}
|
|
914
|
+
if (props[import_skipProps.HOC_CLASSNAME_MARKER] !== void 0) {
|
|
915
|
+
flushForwardStylesToClasses(pass);
|
|
916
|
+
pass[passShouldDoClasses] = false;
|
|
439
917
|
styleState.flatShouldDoClasses = false;
|
|
440
918
|
}
|
|
441
919
|
}
|
|
442
920
|
return;
|
|
443
921
|
}
|
|
444
922
|
if (keyInit === "style") {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
if (asChild) {
|
|
449
|
-
var defaults = (0, import_getDefaultProps.getDefaultProps)(staticConfig);
|
|
450
|
-
if (defaults) {
|
|
451
|
-
var _defaults_keyOg;
|
|
452
|
-
var defaultVal = (_defaults_keyOg = defaults[keyOg]) !== null && _defaults_keyOg !== void 0 ? _defaults_keyOg : defaults[keyInit];
|
|
453
|
-
if (defaultVal !== void 0 && valInit === defaultVal) return;
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
if (keyInit in import_skipProps.skipProps && !noSkip && !isHOC && !(neverSkipProps === null || neverSkipProps === void 0 ? void 0 : neverSkipProps[keyInit])) {
|
|
457
|
-
if (keyInit === "group");
|
|
458
|
-
if (keyInit === "container" && valInit) {}
|
|
459
|
-
if (keyInit === "transition" && typeof valInit === "string") {
|
|
460
|
-
var _driver_animations;
|
|
461
|
-
var animationConfig = driver === null || driver === void 0 ? void 0 : (_driver_animations = driver.animations) === null || _driver_animations === void 0 ? void 0 : _driver_animations[valInit];
|
|
462
|
-
if (animationConfig && (driver === null || driver === void 0 ? void 0 : driver.outputStyle) === "css" && process.env.IS_STATIC === "is_static") valInit = `all ${animationConfig}`;
|
|
463
|
-
else if (animationConfig) return;
|
|
464
|
-
} else return;
|
|
465
|
-
}
|
|
466
|
-
if ((0, import_frontendProgram.isFrontendProgram)(valInit)) {
|
|
467
|
-
if (isValidStyleKey(valInit.property, validStyles, accept)) (0, import_frontendProgram.contributeFrontendProgram)(styleState, valInit, mergeStyle);
|
|
468
|
-
else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${valInit.property}" is not a valid style on this component; the frontend value is dropped.`);
|
|
469
|
-
return;
|
|
470
|
-
}
|
|
471
|
-
var isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles, accept);
|
|
472
|
-
if (import_constants.isWeb) {
|
|
473
|
-
var _driver_View;
|
|
474
|
-
if ((staticConfig.isReactNative || styleProps.isAnimated && (driver === null || driver === void 0 ? void 0 : driver.isReactNative) && !((_driver_View = driver.View) === null || _driver_View === void 0 ? void 0 : _driver_View.acceptRenderProp)) && keyInit.startsWith("data-")) {
|
|
475
|
-
var _viewProps2, _dataSet;
|
|
476
|
-
keyInit = keyInit.replace("data-", "");
|
|
477
|
-
(_viewProps2 = viewProps)[_dataSet = "dataSet"] || (_viewProps2[_dataSet] = {});
|
|
478
|
-
viewProps["dataSet"][keyInit] = valInit;
|
|
923
|
+
if (!valInit) return;
|
|
924
|
+
if (noMergeStyle) {
|
|
925
|
+
viewProps.style = valInit;
|
|
479
926
|
return;
|
|
480
927
|
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
928
|
+
var isArray = Array.isArray(valInit);
|
|
929
|
+
var length = isArray ? valInit.length : 1;
|
|
930
|
+
for (var index1 = 0; index1 < length; index1++) {
|
|
931
|
+
var style = isArray ? valInit[index1] : valInit;
|
|
932
|
+
if (!style) continue;
|
|
933
|
+
var hocClassNames1 = style[TAMAGUI_CLASS_PROPS];
|
|
934
|
+
if (hocClassNames1) {
|
|
935
|
+
for (var property1 in hocClassNames1) {
|
|
936
|
+
var _pass2, _passHocMappedProperties1;
|
|
937
|
+
clearDirectStyle(styleState, property1);
|
|
938
|
+
styleState.classNames[property1] = hocClassNames1[property1];
|
|
939
|
+
((_pass2 = pass)[_passHocMappedProperties1 = passHocMappedProperties] || (_pass2[_passHocMappedProperties1] = /* @__PURE__ */ new Set())).add(property1);
|
|
940
|
+
}
|
|
941
|
+
continue;
|
|
942
|
+
}
|
|
943
|
+
var normalized = (0, import_normalizeStyle.normalizeStyle)(style, false, true);
|
|
944
|
+
var styleOriginals = shouldTrackStyleTokenProvenance ? import_styleOriginalValues.styleOriginalValues.get(style) : void 0;
|
|
945
|
+
for (var key in normalized) {
|
|
946
|
+
var _pass_passHocMappedProperties;
|
|
947
|
+
if (normalized[key] == null) continue;
|
|
948
|
+
if ((_pass_passHocMappedProperties = pass[passHocMappedProperties]) === null || _pass_passHocMappedProperties === void 0 ? void 0 : _pass_passHocMappedProperties.delete(key)) clearDirectStyle(styleState, key);
|
|
949
|
+
contributeValue(styleState, key, normalized[key], mergeStyle, styleOriginals === null || styleOriginals === void 0 ? void 0 : styleOriginals[key]);
|
|
950
|
+
}
|
|
484
951
|
}
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
if (defaultProps) {
|
|
955
|
+
var _defaultProps_keyOg;
|
|
956
|
+
var defaultVal = (_defaultProps_keyOg = defaultProps[keyOg]) !== null && _defaultProps_keyOg !== void 0 ? _defaultProps_keyOg : defaultProps[keyInit];
|
|
957
|
+
if (defaultVal !== void 0 && valInit === defaultVal) return;
|
|
485
958
|
}
|
|
959
|
+
if (keyInit in import_skipProps.skipProps && shouldSkipDirectProps && !(neverSkipProps === null || neverSkipProps === void 0 ? void 0 : neverSkipProps[keyInit])) if (keyInit === "transition" && typeof valInit === "string") return;
|
|
960
|
+
else return;
|
|
961
|
+
var isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles, accept);
|
|
486
962
|
if (!isValidStyleKeyInit) {
|
|
487
963
|
if (!import_constants.isAndroid) {
|
|
488
964
|
if (keyInit === "elevationAndroid") return;
|
|
@@ -492,11 +968,11 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
492
968
|
valInit = valInit !== "none";
|
|
493
969
|
} else if (keyInit === "textOverflow") {
|
|
494
970
|
if (isText && valInit === "ellipsis") {
|
|
495
|
-
var
|
|
971
|
+
var _viewProps, _viewProps1;
|
|
496
972
|
var _numberOfLines;
|
|
497
|
-
(_numberOfLines = (
|
|
973
|
+
(_numberOfLines = (_viewProps = viewProps).numberOfLines) !== null && _numberOfLines !== void 0 || (_viewProps.numberOfLines = 1);
|
|
498
974
|
var _ellipsizeMode;
|
|
499
|
-
(_ellipsizeMode = (
|
|
975
|
+
(_ellipsizeMode = (_viewProps1 = viewProps).ellipsizeMode) !== null && _ellipsizeMode !== void 0 || (_viewProps1.ellipsizeMode = "tail");
|
|
500
976
|
}
|
|
501
977
|
return;
|
|
502
978
|
} else if (keyInit.startsWith("data-")) return;
|
|
@@ -504,10 +980,10 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
504
980
|
var isVariant = !isValidStyleKeyInit && variants && keyInit in variants;
|
|
505
981
|
var isStyleLikeKey = isValidStyleKeyInit || isVariant;
|
|
506
982
|
var isStyleProp = isValidStyleKeyInit || isVariant && !noExpand;
|
|
507
|
-
if (isStyleProp &&
|
|
508
|
-
var shouldPassProp = !isStyleProp && isHOC ||
|
|
983
|
+
if (isStyleProp && asChildExceptStyleLike) return;
|
|
984
|
+
var shouldPassProp = !isStyleProp && isHOC || hocParentVariants && keyInit in hocParentVariants || (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(keyInit));
|
|
509
985
|
var parentVariant = parentVariants === null || parentVariants === void 0 ? void 0 : parentVariants[keyInit];
|
|
510
|
-
var isHOCShouldPassThrough = Boolean(isHOC && (
|
|
986
|
+
var isHOCShouldPassThrough = Boolean(isHOC && (parentVariant || keyInit in import_skipProps.skipProps));
|
|
511
987
|
var shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
512
988
|
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
513
989
|
console.groupCollapsed(` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`);
|
|
@@ -529,179 +1005,237 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
529
1005
|
if (process.env.NODE_ENV === "development" && debug === "verbose") console.groupEnd();
|
|
530
1006
|
if (!isVariant) return;
|
|
531
1007
|
}
|
|
532
|
-
if (
|
|
533
|
-
|
|
534
|
-
if (keyInit in import_skipProps.skipProps && !(keyInit === "transition" && typeof valInit === "string" && !(driver === null || driver === void 0 ? void 0 : (_driver_animations1 = driver.animations) === null || _driver_animations1 === void 0 ? void 0 : _driver_animations1[valInit]))) {
|
|
1008
|
+
if (shouldCheckSkipProps && !(neverSkipProps === null || neverSkipProps === void 0 ? void 0 : neverSkipProps[keyInit])) {
|
|
1009
|
+
if (keyInit in import_skipProps.skipProps && !(keyInit === "transition" && typeof valInit === "string" && !(driverAnimations === null || driverAnimations === void 0 ? void 0 : driverAnimations[valInit]))) {
|
|
535
1010
|
if (process.env.NODE_ENV === "development" && debug === "verbose") console.groupEnd();
|
|
536
1011
|
return;
|
|
537
1012
|
}
|
|
538
1013
|
}
|
|
539
|
-
if (
|
|
1014
|
+
if (isTextOrInput) {
|
|
540
1015
|
if (valInit && (keyInit === "fontFamily" || keyInit === shorthands["fontFamily"]) && valInit in conf.fontsParsed) styleState.fontFamily = valInit;
|
|
541
1016
|
}
|
|
542
1017
|
var disablePropMap = !isStyleLikeKey;
|
|
543
|
-
if (
|
|
544
|
-
(
|
|
1018
|
+
if (isValidStyleKeyInit && valInit != null && !(valInit === "unset") && !(variants && keyInit in variants) && !(accept && keyInit in accept) && !((styledContextKeys === null || styledContextKeys === void 0 ? void 0 : styledContextKeys.has(keyInit)) || styledContext && keyInit in styledContext)) {
|
|
1019
|
+
contributeValue(styleState, keyInit, valInit, mergeStyle);
|
|
545
1020
|
return;
|
|
546
1021
|
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
if (key8 === "className") {
|
|
551
|
-
if (typeof val2 === "string" && val2) className = `${className} ${val2}`.trim();
|
|
552
|
-
return;
|
|
553
|
-
}
|
|
554
|
-
if (!isHOC && disablePropMap && !isStyledContextProp) {
|
|
555
|
-
if (key8 in import_helpers.stylePropsAll && !isValidStyleKey(key8, validStyles, accept)) {
|
|
556
|
-
if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${key8}" is a text style prop and this component is not text \u2014 it would render on neither platform. Use a Text-based component, or html.* for raw web elements.`);
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
viewProps[key8] = val2;
|
|
560
|
-
return;
|
|
561
|
-
}
|
|
562
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
563
|
-
console.groupCollapsed(" 💠 expanded", keyInit, "=>", key8);
|
|
564
|
-
(0, import_log.log)(val2);
|
|
565
|
-
console.groupEnd();
|
|
566
|
-
}
|
|
567
|
-
if (val2 == null) return;
|
|
568
|
-
if (accept && key8 in accept) {
|
|
569
|
-
viewProps[key8] = val2;
|
|
570
|
-
return;
|
|
571
|
-
}
|
|
572
|
-
var isHostStyleKey = !isHOC && isValidStyleKey(key8, validStyles, accept) || import_constants.isAndroid && key8 === "elevation";
|
|
573
|
-
var isContextProgramKey = !isHOC && Boolean(isStyledContextProp);
|
|
574
|
-
if (conditionSource !== void 0) {
|
|
575
|
-
if (isHostStyleKey || isContextProgramKey) (0, import_directStyle.contributeVariantClauseValue)(styleState, key8, val2, conditionSource, mergeStyle, originalVal, !isHostStyleKey);
|
|
576
|
-
else if (isHOC) {
|
|
577
|
-
var appended = (0, import_propMapper.appendFlatClause)(styleState, viewProps[key8], conditionSource, val2);
|
|
578
|
-
if (appended !== void 0) viewProps[key8] = appended;
|
|
579
|
-
else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] conditional variant value for "${key8}" cannot join the existing clause string; dropping the clause`);
|
|
580
|
-
} else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${key8}" is not a valid style on this component; the conditional variant value is dropped.`);
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
if (isHostStyleKey || isContextProgramKey) {
|
|
584
|
-
(0, import_directStyle.contributeStyleValue)(styleState, key8, val2, mergeStyle, originalVal, !isHostStyleKey);
|
|
585
|
-
return;
|
|
586
|
-
}
|
|
587
|
-
isVariant = variants && key8 in variants;
|
|
588
|
-
if (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(key8)) {
|
|
589
|
-
var _props_key;
|
|
590
|
-
viewProps[key8] = (_props_key = props[key8]) !== null && _props_key !== void 0 ? _props_key : val2;
|
|
591
|
-
}
|
|
592
|
-
if (isHOC && Boolean(parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : (_parentStaticConfig_variants = parentStaticConfig.variants) === null || _parentStaticConfig_variants === void 0 ? void 0 : _parentStaticConfig_variants[keyInit])) {
|
|
593
|
-
passDownProp(viewProps, key8, val2);
|
|
594
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
595
|
-
console.groupCollapsed(` - passing down prop ${key8}`);
|
|
596
|
-
(0, import_log.log)({
|
|
597
|
-
val: val2,
|
|
598
|
-
after: { ...viewProps[key8] }
|
|
599
|
-
});
|
|
600
|
-
console.groupEnd();
|
|
601
|
-
}
|
|
602
|
-
return;
|
|
603
|
-
}
|
|
604
|
-
if (!isVariant) {
|
|
605
|
-
if (isStyledContextProp) return;
|
|
606
|
-
if (key8 in import_helpers.stylePropsAll && !isValidStyleKey(key8, validStyles, accept)) {
|
|
607
|
-
if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${key8}" is a text style prop and this component is not text \u2014 it would render on neither platform. Use a Text-based component, or html.* for raw web elements.`);
|
|
608
|
-
return;
|
|
609
|
-
}
|
|
610
|
-
viewProps[key8] = val2;
|
|
611
|
-
}
|
|
612
|
-
});
|
|
1022
|
+
pass[passMapSourceKey] = keyInit;
|
|
1023
|
+
pass[passMapFlags] = disablePropMap ? 1 : 0;
|
|
1024
|
+
contributeMappedValue(keyInit, valInit, styleState, disablePropMap);
|
|
613
1025
|
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
614
1026
|
try {
|
|
615
1027
|
(0, import_log.log)(` \u2714\uFE0F expand complete`, keyInit);
|
|
616
1028
|
(0, import_log.log)("style", { ...styleState.style });
|
|
617
1029
|
(0, import_log.log)("viewProps", { ...viewProps });
|
|
618
|
-
(0, import_log.log)("transforms",
|
|
1030
|
+
(0, import_log.log)("transforms", styleState.transformAccumulator);
|
|
619
1031
|
} catch (e) {}
|
|
620
1032
|
console.groupEnd();
|
|
621
1033
|
}
|
|
1034
|
+
} finally {
|
|
1035
|
+
if (parentConditionKey) pass[passParentCursor] = null;
|
|
1036
|
+
releaseConditionCursors(parentWatermark);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver) {
|
|
1040
|
+
var _staticConfig_styleFrontend, _styleState_flatMediaKeys, _styleState_flatGroupKeys, _styleState_flatGroupMedia, _styleState_style;
|
|
1041
|
+
var conf = (0, import_config.getConfig)();
|
|
1042
|
+
if ((_staticConfig_styleFrontend = staticConfig.styleFrontend) === null || _staticConfig_styleFrontend === void 0 ? void 0 : _staticConfig_styleFrontend.normalizeStaticConfig) staticConfig = staticConfig.styleFrontend.normalizeStaticConfig(staticConfig, conf);
|
|
1043
|
+
var driver = animationDriver || (componentContext === null || componentContext === void 0 ? void 0 : componentContext.animationDriver) || conf.animations;
|
|
1044
|
+
var driverAnimations = driver === null || driver === void 0 ? void 0 : driver.animations;
|
|
1045
|
+
driver === null || driver === void 0 || driver.inputStyle;
|
|
1046
|
+
var driverOutputStyle = driver === null || driver === void 0 ? void 0 : driver.outputStyle;
|
|
1047
|
+
var resolvedDriver = (driver === null || driver === void 0 ? void 0 : driver.isStub) ? null : driver;
|
|
1048
|
+
if (props.passThrough) return null;
|
|
1049
|
+
var { shorthands } = conf;
|
|
1050
|
+
var { isHOC, isText, isInput, variants, inlineProps, parentStaticConfig, acceptsClassName } = staticConfig;
|
|
1051
|
+
var viewProps = {};
|
|
1052
|
+
var mediaState = styleProps.mediaState || import_mediaState.mediaState;
|
|
1053
|
+
var shouldDoClasses = !process.env.TAMAGUI_DID_OUTPUT_CSS && acceptsClassName && false;
|
|
1054
|
+
var rulesToInsert = void 0;
|
|
1055
|
+
var classNames = {};
|
|
1056
|
+
var hasMedia = false;
|
|
1057
|
+
var pseudoGroups;
|
|
1058
|
+
var mediaGroups;
|
|
1059
|
+
var staticPassthroughClassName = "";
|
|
1060
|
+
var className = staticPassthroughClassName;
|
|
1061
|
+
if (staticPassthroughClassName) shouldDoClasses = false;
|
|
1062
|
+
var validStyles = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles);
|
|
1063
|
+
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-setup`;
|
|
1064
|
+
var styleState = {
|
|
1065
|
+
classNames,
|
|
1066
|
+
conf,
|
|
1067
|
+
props,
|
|
1068
|
+
styleProps,
|
|
1069
|
+
componentState,
|
|
1070
|
+
staticConfig,
|
|
1071
|
+
style: null,
|
|
1072
|
+
theme,
|
|
1073
|
+
viewProps,
|
|
1074
|
+
context: componentContext,
|
|
1075
|
+
debug,
|
|
1076
|
+
flatRulesToInsert: rulesToInsert,
|
|
1077
|
+
flatShouldDoClasses: shouldDoClasses,
|
|
1078
|
+
flatThemeName: themeName,
|
|
1079
|
+
flatMediaState: mediaState,
|
|
1080
|
+
flatGroupContext: groupContext,
|
|
1081
|
+
animationDriver: resolvedDriver
|
|
622
1082
|
};
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
1083
|
+
if (import_directStyleCSS.canGenerateCSS && shouldDoClasses && styleProps.canPlatformPseudo) styleState.flatDeferCSS = true;
|
|
1084
|
+
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`style-state`;
|
|
1085
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && import_constants.isClient) {
|
|
1086
|
+
if (import_isDevTools.isDevTools) {
|
|
1087
|
+
console.groupCollapsed("🔹 getSplitStyles 👇");
|
|
1088
|
+
(0, import_log.log)({
|
|
1089
|
+
props,
|
|
1090
|
+
staticConfig,
|
|
1091
|
+
shouldDoClasses,
|
|
1092
|
+
styleProps,
|
|
1093
|
+
rulesToInsert,
|
|
1094
|
+
componentState,
|
|
1095
|
+
styleState,
|
|
1096
|
+
theme: { ...theme }
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
var { asChild } = props;
|
|
1101
|
+
var { accept, neverSkipProps } = staticConfig;
|
|
1102
|
+
var { noSkip, disableExpandShorthands, noExpand, noClass, noMergeStyle, noNormalize, isAnimated, styledContext, styledContextKeys } = styleProps;
|
|
1103
|
+
var styleFrontend = staticConfig.styleFrontend;
|
|
1104
|
+
var frontendGroup;
|
|
1105
|
+
var frontendContainer;
|
|
1106
|
+
var frontendContainerType;
|
|
1107
|
+
var parentVariants = parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.variants;
|
|
1108
|
+
var defaultProps = asChild ? (0, import_getDefaultProps.getDefaultProps)(staticConfig) : void 0;
|
|
1109
|
+
var asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
|
|
1110
|
+
var containerValue;
|
|
1111
|
+
var containerName;
|
|
1112
|
+
var containerType;
|
|
1113
|
+
var hocMappedClassProperties;
|
|
1114
|
+
var hocMappedClasses;
|
|
1115
|
+
var stylePassFlags = (noSkip ? passNoSkipFlag : 0) | (disableExpandShorthands ? passDisableShorthandsFlag : 0) | (noExpand ? passNoExpandFlag : 0) | (noMergeStyle ? passNoMergeFlag : 0) | (isHOC ? passHocFlag : 0) | (isText ? passTextFlag : 0) | (isInput ? passInputFlag : 0) | (asChildExceptStyleLike ? passAsChildStyleFlag : 0);
|
|
1116
|
+
var pass = [
|
|
1117
|
+
styleState,
|
|
1118
|
+
conf,
|
|
1119
|
+
props,
|
|
1120
|
+
viewProps,
|
|
1121
|
+
staticConfig,
|
|
1122
|
+
validStyles,
|
|
1123
|
+
accept,
|
|
1124
|
+
neverSkipProps,
|
|
1125
|
+
variants,
|
|
1126
|
+
inlineProps,
|
|
1127
|
+
parentVariants,
|
|
1128
|
+
styleFrontend,
|
|
1129
|
+
styledContext,
|
|
1130
|
+
styledContextKeys,
|
|
1131
|
+
stylePassFlags,
|
|
1132
|
+
debug,
|
|
1133
|
+
parentStaticConfig,
|
|
1134
|
+
defaultProps,
|
|
1135
|
+
driverAnimations,
|
|
1136
|
+
driverOutputStyle,
|
|
1137
|
+
elementType,
|
|
1138
|
+
className,
|
|
1139
|
+
shouldDoClasses,
|
|
1140
|
+
containerValue,
|
|
1141
|
+
containerName,
|
|
1142
|
+
containerType,
|
|
1143
|
+
frontendGroup,
|
|
1144
|
+
frontendContainer,
|
|
1145
|
+
frontendContainerType,
|
|
1146
|
+
hocMappedClassProperties,
|
|
1147
|
+
hocMappedClasses
|
|
1148
|
+
];
|
|
1149
|
+
styleState.flatPass = pass;
|
|
1150
|
+
forEachPropInForwardOrder(pass);
|
|
1151
|
+
[, , , , , , , , , , , , , , , , , , , , , className, shouldDoClasses, containerValue, containerName, containerType, frontendGroup, frontendContainer, frontendContainerType, hocMappedClassProperties, hocMappedClasses] = pass;
|
|
626
1152
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-propsend`;
|
|
627
1153
|
var conditionalStates = styleState.flatStateKeys || null;
|
|
628
1154
|
var usesSafeArea = !!styleState.flatUsesSafeArea;
|
|
629
1155
|
if ((_styleState_flatMediaKeys = styleState.flatMediaKeys) === null || _styleState_flatMediaKeys === void 0 ? void 0 : _styleState_flatMediaKeys.size) {
|
|
630
1156
|
if (!hasMedia) hasMedia = /* @__PURE__ */ new Set();
|
|
631
1157
|
if (typeof hasMedia !== "boolean") {
|
|
632
|
-
var
|
|
1158
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
633
1159
|
try {
|
|
634
|
-
for (var
|
|
635
|
-
var key =
|
|
1160
|
+
for (var _iterator2 = styleState.flatMediaKeys[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
1161
|
+
var key = _step2.value;
|
|
636
1162
|
hasMedia.add(key);
|
|
637
1163
|
}
|
|
638
1164
|
} catch (err) {
|
|
639
|
-
|
|
640
|
-
|
|
1165
|
+
_didIteratorError2 = true;
|
|
1166
|
+
_iteratorError2 = err;
|
|
641
1167
|
} finally {
|
|
642
1168
|
try {
|
|
643
|
-
if (!
|
|
1169
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
644
1170
|
} finally {
|
|
645
|
-
if (
|
|
1171
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
646
1172
|
}
|
|
647
1173
|
}
|
|
648
1174
|
}
|
|
649
1175
|
}
|
|
650
1176
|
if ((_styleState_flatGroupKeys = styleState.flatGroupKeys) === null || _styleState_flatGroupKeys === void 0 ? void 0 : _styleState_flatGroupKeys.size) {
|
|
651
1177
|
pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set());
|
|
652
|
-
var
|
|
1178
|
+
var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
|
|
653
1179
|
try {
|
|
654
|
-
for (var
|
|
655
|
-
var key1 =
|
|
1180
|
+
for (var _iterator12 = styleState.flatGroupKeys[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
|
|
1181
|
+
var key1 = _step12.value;
|
|
656
1182
|
pseudoGroups.add(key1);
|
|
657
1183
|
}
|
|
658
1184
|
} catch (err) {
|
|
659
|
-
|
|
660
|
-
|
|
1185
|
+
_didIteratorError12 = true;
|
|
1186
|
+
_iteratorError12 = err;
|
|
661
1187
|
} finally {
|
|
662
1188
|
try {
|
|
663
|
-
if (!
|
|
1189
|
+
if (!_iteratorNormalCompletion12 && _iterator12.return != null) _iterator12.return();
|
|
664
1190
|
} finally {
|
|
665
|
-
if (
|
|
1191
|
+
if (_didIteratorError12) throw _iteratorError12;
|
|
666
1192
|
}
|
|
667
1193
|
}
|
|
668
1194
|
}
|
|
669
1195
|
if ((_styleState_flatGroupMedia = styleState.flatGroupMedia) === null || _styleState_flatGroupMedia === void 0 ? void 0 : _styleState_flatGroupMedia.size) {
|
|
670
1196
|
mediaGroups || (mediaGroups = /* @__PURE__ */ new Set());
|
|
671
|
-
var
|
|
1197
|
+
var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;
|
|
672
1198
|
try {
|
|
673
|
-
for (var
|
|
674
|
-
var key2 =
|
|
1199
|
+
for (var _iterator22 = styleState.flatGroupMedia[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {
|
|
1200
|
+
var key2 = _step22.value;
|
|
675
1201
|
mediaGroups.add(key2);
|
|
676
1202
|
}
|
|
677
1203
|
} catch (err) {
|
|
678
|
-
|
|
679
|
-
|
|
1204
|
+
_didIteratorError22 = true;
|
|
1205
|
+
_iteratorError22 = err;
|
|
680
1206
|
} finally {
|
|
681
1207
|
try {
|
|
682
|
-
if (!
|
|
1208
|
+
if (!_iteratorNormalCompletion22 && _iterator22.return != null) _iterator22.return();
|
|
683
1209
|
} finally {
|
|
684
|
-
if (
|
|
1210
|
+
if (_didIteratorError22) throw _iteratorError22;
|
|
685
1211
|
}
|
|
686
1212
|
}
|
|
687
1213
|
}
|
|
1214
|
+
if (styleProps.canPlatformPseudo && styleState.flatHasPlatformPseudo) {
|
|
1215
|
+
shouldDoClasses = false;
|
|
1216
|
+
styleState.flatShouldDoClasses = false;
|
|
1217
|
+
if (styleState.transformAccumulator) {
|
|
1218
|
+
mergeStyle(styleState, "transform", (0, import_runtime.finalizeTransformAccumulator)(styleState.transformAccumulator), 1, true);
|
|
1219
|
+
styleState.transformAccumulator = void 0;
|
|
1220
|
+
}
|
|
1221
|
+
convertDeferredInline(styleState, mergeStyle);
|
|
1222
|
+
}
|
|
1223
|
+
completeStreaming(styleState, mergeStyle);
|
|
688
1224
|
var effectiveTransition = (_styleState_style = styleState.style) === null || _styleState_style === void 0 ? void 0 : _styleState_style.transition;
|
|
689
1225
|
if (effectiveTransition != null && styleState.style && true) delete styleState.style.transition;
|
|
690
1226
|
if (styleState.style) {
|
|
691
1227
|
if ("containerType" in styleState.style) delete styleState.style.containerType;
|
|
692
1228
|
if ("containerName" in styleState.style) delete styleState.style.containerName;
|
|
693
1229
|
}
|
|
694
|
-
if (!(
|
|
1230
|
+
if (!(noNormalize === false)) {
|
|
695
1231
|
if (styleState.style) {
|
|
696
1232
|
(0, import_expandStyles.fixStyles)(styleState.style);
|
|
697
|
-
if (!
|
|
698
|
-
if (import_constants.isWeb && (isReactNative ? (driver === null || driver === void 0 ? void 0 : driver.inputStyle) !== "css" : true)) (0, import_getCSSStylesAtomic.styleToCSS)(styleState.style);
|
|
699
|
-
}
|
|
1233
|
+
if (!noExpand && !noMergeStyle) {}
|
|
700
1234
|
}
|
|
701
|
-
if (styleState.
|
|
1235
|
+
if (styleState.transformAccumulator && !styleState.flatShouldDoClasses) {
|
|
702
1236
|
var _styleState;
|
|
703
1237
|
(_styleState = styleState).style || (_styleState.style = {});
|
|
704
|
-
|
|
1238
|
+
styleState.style.transform = (0, import_runtime.finalizeTransformAccumulator)(styleState.transformAccumulator);
|
|
705
1239
|
}
|
|
706
1240
|
if (parentSplitStyles) {
|
|
707
1241
|
if (!shouldDoClasses) for (var key4 in parentSplitStyles.style) {
|
|
@@ -760,36 +1294,17 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
760
1294
|
if (effectiveTransition != null) result.effectiveTransition = effectiveTransition;
|
|
761
1295
|
if (conditionalStates) result.programStates = conditionalStates;
|
|
762
1296
|
if (usesSafeArea) result.usesSafeArea = true;
|
|
763
|
-
if (
|
|
764
|
-
if (styleState.flatEnterKeys || styleState.flatExitKeys) {
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
} catch (err) {
|
|
775
|
-
_didIteratorError4 = true;
|
|
776
|
-
_iteratorError4 = err;
|
|
777
|
-
} finally {
|
|
778
|
-
try {
|
|
779
|
-
if (!_iteratorNormalCompletion4 && _iterator4.return != null) _iterator4.return();
|
|
780
|
-
} finally {
|
|
781
|
-
if (_didIteratorError4) throw _iteratorError4;
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
return out;
|
|
785
|
-
};
|
|
786
|
-
result.programLifecycleStyleKeys = {
|
|
787
|
-
enter: effectiveKeys(styleState.flatEnterKeys),
|
|
788
|
-
exit: effectiveKeys(styleState.flatExitKeys)
|
|
789
|
-
};
|
|
790
|
-
}
|
|
791
|
-
var asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
|
|
792
|
-
if (!styleProps.noMergeStyle) {
|
|
1297
|
+
if (getDirectDynamicThemeAccess(styleState)) result.dynamicThemeAccess = true;
|
|
1298
|
+
if (styleState.flatEnterKeys || styleState.flatExitKeys) result.programLifecycleStyleKeys = {
|
|
1299
|
+
enter: effectiveLifecycleKeys(styleState.flatEnterKeys),
|
|
1300
|
+
exit: effectiveLifecycleKeys(styleState.flatExitKeys)
|
|
1301
|
+
};
|
|
1302
|
+
if (styleState.flatHasEnterStyle) result.hasEnterStyle = true;
|
|
1303
|
+
if (styleState.flatHasPlatformPseudo) result.platformPseudo = true;
|
|
1304
|
+
if (frontendGroup !== void 0) result.frontendGroup = frontendGroup;
|
|
1305
|
+
if (frontendContainer !== void 0) result.frontendContainer = frontendContainer;
|
|
1306
|
+
if (frontendContainerType !== void 0) result.frontendContainerType = frontendContainerType;
|
|
1307
|
+
if (!noMergeStyle) {
|
|
793
1308
|
if (!asChildExceptStyleLike) {
|
|
794
1309
|
var style1 = styleState.style;
|
|
795
1310
|
if (style1) viewProps.style = style1;
|
|
@@ -817,50 +1332,12 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
817
1332
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-done`;
|
|
818
1333
|
return result;
|
|
819
1334
|
};
|
|
820
|
-
function mergeFlatTransforms(target, flatTransforms) {
|
|
821
|
-
var transform = [];
|
|
822
|
-
if ("x" in flatTransforms) transform.push({ translateX: flatTransforms.x });
|
|
823
|
-
if ("y" in flatTransforms) transform.push({ translateY: flatTransforms.y });
|
|
824
|
-
if ("rotate" in flatTransforms) transform.push({ rotate: flatTransforms.rotate });
|
|
825
|
-
var hasScaleX = "scaleX" in flatTransforms;
|
|
826
|
-
var hasScaleY = "scaleY" in flatTransforms;
|
|
827
|
-
if (hasScaleX && hasScaleY && Object.is(flatTransforms.scaleX, flatTransforms.scaleY)) transform.push({ scale: flatTransforms.scaleX });
|
|
828
|
-
else {
|
|
829
|
-
if (hasScaleX) transform.push({ scaleX: flatTransforms.scaleX });
|
|
830
|
-
if (hasScaleY) transform.push({ scaleY: flatTransforms.scaleY });
|
|
831
|
-
if (!hasScaleX && !hasScaleY && "scale" in flatTransforms) transform.push({ scale: flatTransforms.scale });
|
|
832
|
-
}
|
|
833
|
-
var keys = [];
|
|
834
|
-
for (var key in flatTransforms) if (key !== "x" && key !== "y" && key !== "rotate" && key !== "scale" && key !== "scaleX" && key !== "scaleY") keys.push(key);
|
|
835
|
-
keys.sort(import_sortString.sortString);
|
|
836
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
837
|
-
try {
|
|
838
|
-
for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
839
|
-
var key1 = _step.value;
|
|
840
|
-
transform.push({ [mapTransformKeys[key1] || key1]: flatTransforms[key1] });
|
|
841
|
-
}
|
|
842
|
-
} catch (err) {
|
|
843
|
-
_didIteratorError = true;
|
|
844
|
-
_iteratorError = err;
|
|
845
|
-
} finally {
|
|
846
|
-
try {
|
|
847
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
848
|
-
} finally {
|
|
849
|
-
if (_didIteratorError) throw _iteratorError;
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
if (Array.isArray(target.transform)) transform.push(...target.transform);
|
|
853
|
-
target.transform = transform;
|
|
854
|
-
}
|
|
855
1335
|
function mergeStyle(styleState, key, val, _importance) {
|
|
856
|
-
|
|
857
|
-
var
|
|
1336
|
+
arguments.length > 4 && arguments[4] !== void 0 && arguments[4];
|
|
1337
|
+
var originalVal = arguments.length > 5 ? arguments[5] : void 0;
|
|
858
1338
|
var { viewProps, styleProps, staticConfig } = styleState;
|
|
859
|
-
var
|
|
860
|
-
|
|
861
|
-
var inheritedContextPropKeys = !staticConfig.context || staticConfig.context === ((_staticConfig_parentStaticConfig1 = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig1 === void 0 ? void 0 : _staticConfig_parentStaticConfig1.context) ? (_staticConfig_parentStaticConfig2 = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig2 === void 0 ? void 0 : _staticConfig_parentStaticConfig2.contextProps : void 0;
|
|
862
|
-
var contextPropKeys = staticConfig.contextProps || inheritedContextPropKeys;
|
|
863
|
-
if (contextProps && key in contextProps || (contextPropKeys === null || contextPropKeys === void 0 ? void 0 : contextPropKeys.includes(key)) || (contextConfig === null || contextConfig === void 0 ? void 0 : (_contextConfig_propKeys = contextConfig.propKeys) === null || _contextConfig_propKeys === void 0 ? void 0 : _contextConfig_propKeys.includes(key))) {
|
|
1339
|
+
var contextPropSet = getContextPropSet(staticConfig);
|
|
1340
|
+
if (contextPropSet === null || contextPropSet === void 0 ? void 0 : contextPropSet.has(key)) {
|
|
864
1341
|
var _styleState_originalContextPropValues;
|
|
865
1342
|
var _styleState;
|
|
866
1343
|
(_styleState = styleState).overriddenContextProps || (_styleState.overriddenContextProps = {});
|
|
@@ -868,17 +1345,17 @@ function mergeStyle(styleState, key, val, _importance) {
|
|
|
868
1345
|
var _ref;
|
|
869
1346
|
styleState.overriddenContextProps[key] = (_ref = originalVal !== null && originalVal !== void 0 ? originalVal : originalFromState) !== null && _ref !== void 0 ? _ref : val;
|
|
870
1347
|
}
|
|
871
|
-
if (key in import_helpers.stylePropsTransform) {
|
|
1348
|
+
if (key === "transform" || key in import_helpers.stylePropsTransform) {
|
|
872
1349
|
var _styleState1;
|
|
873
|
-
(_styleState1 = styleState).
|
|
874
|
-
styleState.
|
|
1350
|
+
(_styleState1 = styleState).transformAccumulator || (_styleState1.transformAccumulator = (0, import_runtime.createTransformAccumulator)());
|
|
1351
|
+
(0, import_runtime.addTransformValue)(styleState.transformAccumulator, key, val);
|
|
875
1352
|
} else {
|
|
876
|
-
var out =
|
|
1353
|
+
var out = val;
|
|
877
1354
|
if (staticConfig.accept && key in staticConfig.accept) viewProps[key] = out;
|
|
878
1355
|
else {
|
|
879
1356
|
var _styleState2;
|
|
880
1357
|
(_styleState2 = styleState).style || (_styleState2.style = {});
|
|
881
|
-
styleState.style[key] =
|
|
1358
|
+
styleState.style[key] = out;
|
|
882
1359
|
if (shouldTrackStyleTokenProvenance) recordStyleTokenProvenance(styleState, key, originalVal);
|
|
883
1360
|
}
|
|
884
1361
|
}
|
|
@@ -898,98 +1375,1758 @@ function recordStyleTokenProvenance(styleState, key, originalVal) {
|
|
|
898
1375
|
((_styleState = styleState).tokenProvenance || (_styleState.tokenProvenance = {}))[key] = originalVal;
|
|
899
1376
|
} else if (styleState.tokenProvenance && key in styleState.tokenProvenance) delete styleState.tokenProvenance[key];
|
|
900
1377
|
}
|
|
901
|
-
var
|
|
902
|
-
var {
|
|
1378
|
+
var resolveAcceptedStyle = function(styleState, styleIn) {
|
|
1379
|
+
var { conf, styleProps } = styleState;
|
|
903
1380
|
var styleOut = {};
|
|
904
1381
|
var originalValues;
|
|
905
1382
|
var styleInOriginalValues = import_styleOriginalValues.styleOriginalValues.get(styleIn);
|
|
906
|
-
var
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
};
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
var parentTransform = (_styleState_style = styleState.style) === null || _styleState_style === void 0 ? void 0 : _styleState_style.transform;
|
|
932
|
-
var flatTransforms = styleState.flatTransforms;
|
|
933
|
-
var styleOutTransform = styleOut.transform;
|
|
934
|
-
if (Array.isArray(styleOutTransform) && styleOutTransform.length) {
|
|
935
|
-
var len = styleOutTransform.length;
|
|
936
|
-
if (Array.isArray(parentTransform)) {
|
|
937
|
-
var merged = [];
|
|
938
|
-
outer: for (var i = 0; i < parentTransform.length; i++) {
|
|
939
|
-
var pt = parentTransform[i];
|
|
940
|
-
for (var pk in pt) {
|
|
941
|
-
for (var j = 0; j < len; j++) for (var sk in styleOutTransform[j]) {
|
|
942
|
-
if (pk === sk) continue outer;
|
|
943
|
-
break;
|
|
944
|
-
}
|
|
945
|
-
merged.push(pt);
|
|
946
|
-
break;
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
for (var i1 = 0; i1 < len; i1++) merged.push(styleOutTransform[i1]);
|
|
950
|
-
styleOut.transform = merged;
|
|
951
|
-
}
|
|
952
|
-
if (flatTransforms) outer: for (var fk in flatTransforms) {
|
|
953
|
-
var ck = fk === "x" ? "translateX" : fk === "y" ? "translateY" : fk;
|
|
954
|
-
for (var j1 = 0; j1 < len; j1++) for (var sk1 in styleOutTransform[j1]) {
|
|
955
|
-
if (ck === sk1) continue outer;
|
|
956
|
-
break;
|
|
957
|
-
}
|
|
958
|
-
mergeTransform(styleOut, fk, flatTransforms[fk]);
|
|
959
|
-
}
|
|
960
|
-
} else if (flatTransforms) mergeFlatTransforms(styleOut, flatTransforms);
|
|
1383
|
+
var childState = {
|
|
1384
|
+
...styleState,
|
|
1385
|
+
classNames: {},
|
|
1386
|
+
flatShouldDoClasses: false,
|
|
1387
|
+
props: styleIn,
|
|
1388
|
+
style: styleOut,
|
|
1389
|
+
transformAccumulator: void 0
|
|
1390
|
+
};
|
|
1391
|
+
childState.flatUsed = void 0;
|
|
1392
|
+
childState.flatTransitions = void 0;
|
|
1393
|
+
childState.flatAtomics = void 0;
|
|
1394
|
+
childState.flatSingleEntries = void 0;
|
|
1395
|
+
childState.flatSlots = void 0;
|
|
1396
|
+
childState.flatBorderDefaultRequests = void 0;
|
|
1397
|
+
var mergeAccepted = function(_state, key2, value2, _importance, disableNormalize, originalValue) {
|
|
1398
|
+
styleOut[key2] = disableNormalize || styleProps.noNormalize ? value2 : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(value2, key2);
|
|
1399
|
+
var _styleInOriginalValues_key;
|
|
1400
|
+
var trackedOriginal = (_styleInOriginalValues_key = styleInOriginalValues === null || styleInOriginalValues === void 0 ? void 0 : styleInOriginalValues[key2]) !== null && _styleInOriginalValues_key !== void 0 ? _styleInOriginalValues_key : originalValue;
|
|
1401
|
+
if (trackedOriginal !== void 0) (originalValues || (originalValues = {}))[key2] = trackedOriginal;
|
|
1402
|
+
};
|
|
1403
|
+
for (var key in styleIn) {
|
|
1404
|
+
var value = styleIn[key];
|
|
1405
|
+
key = conf.shorthands[key] || key;
|
|
1406
|
+
if (key in import_skipProps.skipProps || value == null) continue;
|
|
1407
|
+
contributeValue(childState, key, value, mergeAccepted);
|
|
961
1408
|
}
|
|
1409
|
+
completeStreaming(childState, mergeAccepted);
|
|
1410
|
+
if (childState.transformAccumulator) styleOut.transform = (0, import_runtime.finalizeTransformAccumulator)(childState.transformAccumulator);
|
|
962
1411
|
if (!styleProps.noNormalize) (0, import_expandStyles.fixStyles)(styleOut);
|
|
963
1412
|
if (originalValues) import_styleOriginalValues.styleOriginalValues.set(styleOut, originalValues);
|
|
964
1413
|
return styleOut;
|
|
965
1414
|
};
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
1415
|
+
function passDownProp(viewProps, key, val) {
|
|
1416
|
+
if (key in viewProps) delete viewProps[key];
|
|
1417
|
+
viewProps[key] = val;
|
|
1418
|
+
}
|
|
1419
|
+
var frameSequence = 0;
|
|
1420
|
+
function streamWriteCSS(state, property, value, cursor, original) {
|
|
1421
|
+
var conditionOverride = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : -1;
|
|
1422
|
+
var direct = state;
|
|
1423
|
+
var condition = conditionOverride !== -1 ? conditionOverride : cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
1424
|
+
var identity = cursor ? conditionTexts[cursor + conditionKeyOffset] || "" : "";
|
|
1425
|
+
if (property.charCodeAt(0) === 116 && property.startsWith("transition")) {
|
|
1426
|
+
var _direct;
|
|
1427
|
+
var transitions = (_direct = direct).flatTransitions || (_direct.flatTransitions = []);
|
|
1428
|
+
for (var index = 0; index < transitions.length; index++) if (transitions[index].property === property && transitions[index].identity === identity) {
|
|
1429
|
+
transitions[index].value = value;
|
|
1430
|
+
transitions[index].condition = condition;
|
|
1431
|
+
return;
|
|
1432
|
+
}
|
|
1433
|
+
transitions.push({
|
|
1434
|
+
property,
|
|
1435
|
+
value,
|
|
1436
|
+
condition,
|
|
1437
|
+
identity,
|
|
1438
|
+
selector: cursor ? conditionTexts[cursor + conditionSelectorOffset] || "" : "",
|
|
1439
|
+
wrappers: cursor ? conditionWrapperCopy(cursor) : void 0
|
|
1440
|
+
});
|
|
1441
|
+
return;
|
|
1442
|
+
}
|
|
1443
|
+
(0, import_directStyleCSS.streamAtomic)(state, property, value, condition, identity, cursor ? conditionTexts[cursor + conditionSelectorOffset] || "" : "", cursor ? conditionWrappers : void 0, cursor ? conditionNumbers[cursor + conditionWrapperOffset] >> 3 : 0, cursor ? conditionNumbers[cursor + conditionWrapperOffset] & 7 : 0, direct.flatWeakContribution === true, original);
|
|
1444
|
+
}
|
|
1445
|
+
function streamWriteInline(state, property, value, cursor, merge, original) {
|
|
1446
|
+
var normalize = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : false, conditionOverride = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : -1;
|
|
1447
|
+
var _direct;
|
|
1448
|
+
var direct = state;
|
|
1449
|
+
var condition = conditionOverride !== -1 ? conditionOverride : cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
1450
|
+
var importance = condition ? Math.floor(condition / 256) + 1 : 0;
|
|
1451
|
+
var used = (_direct = direct).flatUsed || (_direct.flatUsed = {});
|
|
1452
|
+
var previous = used[property];
|
|
1453
|
+
if (previous !== void 0) {
|
|
1454
|
+
if (previous > importance) return;
|
|
1455
|
+
if (direct.flatWeakContribution === true) return;
|
|
1456
|
+
}
|
|
1457
|
+
used[property] = importance;
|
|
1458
|
+
merge(state, property, value, 1, !normalize, original);
|
|
1459
|
+
}
|
|
1460
|
+
function streamRetractInline(state, property, cursor) {
|
|
1461
|
+
var _direct;
|
|
1462
|
+
var direct = state;
|
|
1463
|
+
var condition = cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
1464
|
+
var importance = condition ? Math.floor(condition / 256) + 1 : 0;
|
|
1465
|
+
var used = (_direct = direct).flatUsed || (_direct.flatUsed = {});
|
|
1466
|
+
var previous = used[property];
|
|
1467
|
+
if (previous !== void 0 && previous > importance) return;
|
|
1468
|
+
used[property] = importance;
|
|
1469
|
+
if (state.style) delete state.style[property];
|
|
1470
|
+
}
|
|
1471
|
+
function convertDeferredInline(state, merge) {
|
|
1472
|
+
var _direct;
|
|
1473
|
+
var direct = state;
|
|
1474
|
+
var used = (_direct = direct).flatUsed || (_direct.flatUsed = {});
|
|
1475
|
+
var consume = function(entries) {
|
|
1476
|
+
for (var index = 0; index < entries.length; index++) {
|
|
1477
|
+
var entry = entries[index];
|
|
1478
|
+
var condition = entry.condition;
|
|
1479
|
+
if (condition && !(condition & 1)) continue;
|
|
1480
|
+
var importance = condition ? Math.floor(condition / 256) + 1 : 0;
|
|
1481
|
+
var previous = used[entry.property];
|
|
1482
|
+
if (previous !== void 0 && previous > importance) continue;
|
|
1483
|
+
used[entry.property] = importance;
|
|
1484
|
+
merge(state, entry.property, entry.value, 1, true, entry.original !== void 0 ? entry.original : entry.value);
|
|
1485
|
+
}
|
|
1486
|
+
};
|
|
1487
|
+
var slots = direct.flatSlots;
|
|
1488
|
+
if (slots) {
|
|
1489
|
+
direct.flatSlots = void 0;
|
|
1490
|
+
for (var property in slots) consume(slots[property]);
|
|
1491
|
+
}
|
|
1492
|
+
var transitions = direct.flatTransitions;
|
|
1493
|
+
if (transitions) {
|
|
1494
|
+
direct.flatTransitions = void 0;
|
|
1495
|
+
consume(transitions);
|
|
1496
|
+
}
|
|
1497
|
+
direct.flatBorderDefaultRequests = void 0;
|
|
1498
|
+
}
|
|
1499
|
+
function completeStreaming(state, merge) {
|
|
1500
|
+
var direct = state;
|
|
1501
|
+
var shadow = direct.flatWebShadow;
|
|
1502
|
+
if (shadow && (direct.flatBoxShadowSequence || 0) <= shadow[4]) {
|
|
1503
|
+
var offset = shadow[1] || {
|
|
1504
|
+
width: 0,
|
|
1505
|
+
height: 0
|
|
1506
|
+
};
|
|
1507
|
+
var _shadow_;
|
|
1508
|
+
var color = (0, import_normalizeColor.normalizeColor)(shadow[0], (_shadow_ = shadow[2]) !== null && _shadow_ !== void 0 ? _shadow_ : 1);
|
|
1509
|
+
if (color) {
|
|
1510
|
+
var next = `${shadowUnit(offset.width)} ${shadowUnit(offset.height)} ${shadowUnit(shadow[3])} ${color}`;
|
|
1511
|
+
emitProperty(state, "boxShadow", direct.flatBoxShadow ? `${direct.flatBoxShadow}, ${next}` : next, null, merge, shadow[5], shadow[6]);
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
(0, import_directStyleCSS.completeStreamingCSS)(state);
|
|
1515
|
+
}
|
|
1516
|
+
function emitAtParentCondition(state, property, value, merge, originalValue, contextOnly) {
|
|
1517
|
+
var _state_flatPass;
|
|
1518
|
+
emitValue(state, property, value, ((_state_flatPass = state.flatPass) === null || _state_flatPass === void 0 ? void 0 : _state_flatPass[passParentCursor]) || null, merge, originalValue, contextOnly);
|
|
1519
|
+
}
|
|
1520
|
+
function emitUnderCondition(state, property, value, cursor, merge, originalValue, contextOnly, warnMode, warnSource) {
|
|
1521
|
+
var condition = conditionNumbers[cursor + conditionValueOffset];
|
|
1522
|
+
if (merge && property && condition) state.flatPropSawCondition = true;
|
|
1523
|
+
if (!(conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag)) {
|
|
1524
|
+
if (warnMode && process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, warnSource, `unknown modifier "${conditionTexts[cursor + conditionUnresolvedNameOffset] || ""}"`);
|
|
1525
|
+
return 0;
|
|
1526
|
+
}
|
|
1527
|
+
var unsupportedState = conditionTexts[cursor + conditionUnsupportedStateOffset] || "";
|
|
1528
|
+
if (warnMode && unsupportedState && process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`${property}: "${unsupportedState}:" has no native component-state source; dropping the clause`);
|
|
1529
|
+
if (merge && property && condition & 2 && (condition & 1 || import_directStyleCSS.canGenerateCSS && state.flatShouldDoClasses || warnMode === 1 && conditionTexts[cursor + conditionThemeOffset] && import_constants.supportsDynamicColorIOS && (0, import_getDynamicVal.isColorStyleKey)(property))) {
|
|
1530
|
+
emitValue(state, property, value, cursor, merge, warnMode === 2 ? originalValue : originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
|
|
1531
|
+
var flags = conditionNumbers[cursor + conditionFlagsOffset];
|
|
1532
|
+
if (flags & conditionEnterFlag) state.flatHasEnterStyle = true;
|
|
1533
|
+
if (flags & conditionPlatformPseudoFlag) state.flatHasPlatformPseudo = true;
|
|
1534
|
+
} else if (merge && property && condition & 2) {
|
|
1535
|
+
var flags1 = conditionNumbers[cursor + conditionFlagsOffset];
|
|
1536
|
+
if (flags1 & conditionEnterFlag) state.flatHasEnterStyle = true;
|
|
1537
|
+
if (flags1 & conditionPlatformPseudoFlag) state.flatHasPlatformPseudo = true;
|
|
1538
|
+
}
|
|
1539
|
+
return condition;
|
|
1540
|
+
}
|
|
1541
|
+
var directStyleHandler = {
|
|
1542
|
+
segment(state, start, end, isBase, valid, source, chainStart, chainEnd, chainValid, chainCount, _result, failure, failureIndex, property, merge, originalValue, contextOnly) {
|
|
1543
|
+
var _directState_flatPass;
|
|
1544
|
+
if (isBase) {
|
|
1545
|
+
if (start === end) return;
|
|
1546
|
+
feedCompoundSegment(state, source, start, end, true, valid || failure === "invalid-character" || failure === "stray-comment-close", "");
|
|
1547
|
+
if (!valid) {
|
|
1548
|
+
if (failure === "invalid-character" || failure === "stray-comment-close") return 16;
|
|
1549
|
+
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, source, failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : "an unterminated \"(\"");
|
|
1550
|
+
return;
|
|
1551
|
+
}
|
|
1552
|
+
var value = source.slice(start, end);
|
|
1553
|
+
emitAtParentCondition(state, property, value, merge, value, contextOnly);
|
|
1554
|
+
return 5;
|
|
1555
|
+
}
|
|
1556
|
+
if (!chainValid) {
|
|
1557
|
+
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 \"(\"");
|
|
1558
|
+
return;
|
|
1559
|
+
}
|
|
1560
|
+
if (start === end) {
|
|
1561
|
+
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, source, "a conditional clause has no value");
|
|
1562
|
+
return;
|
|
1563
|
+
}
|
|
1564
|
+
if (property === "aspectRatio" && chainCount === 1) {
|
|
1565
|
+
var left = Number(source.slice(chainStart, chainEnd));
|
|
1566
|
+
var right = Number(source.slice(start, end));
|
|
1567
|
+
if (chainStart < chainEnd && Number.isFinite(left) && left > 0 && Number.isFinite(right) && right > 0) return 12;
|
|
1568
|
+
}
|
|
1569
|
+
var directState = state;
|
|
1570
|
+
var cursor = directState.flatScanCursor;
|
|
1571
|
+
var condition = valid ? emitUnderCondition(state, property, source.slice(start, end), cursor, merge, void 0, contextOnly, 1, source) : conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
1572
|
+
feedCompoundSegment(directState, source, start, end, false, valid && Boolean(condition), condition && ((_directState_flatPass = directState.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passCompoundIndexes]) ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
1573
|
+
if (!condition) return;
|
|
1574
|
+
if (!valid) {
|
|
1575
|
+
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 \"(\"");
|
|
1576
|
+
return;
|
|
1577
|
+
}
|
|
1578
|
+
return 4 | (condition & 12 ? 2 : 0);
|
|
1579
|
+
},
|
|
1580
|
+
modifier(state, start, end, valid, first, source) {
|
|
1581
|
+
var directState = state;
|
|
1582
|
+
var cursor = directState.flatScanCursor;
|
|
1583
|
+
if (!cursor) {
|
|
1584
|
+
var _directState_flatPass;
|
|
1585
|
+
cursor = directState.flatScanCursor = acquireConditionCursor(((_directState_flatPass = directState.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passParentCursor]) || null);
|
|
1586
|
+
} else if (first) {
|
|
1587
|
+
var _directState_flatPass1;
|
|
1588
|
+
resetConditionCursor(cursor, ((_directState_flatPass1 = directState.flatPass) === null || _directState_flatPass1 === void 0 ? void 0 : _directState_flatPass1[passParentCursor]) || null);
|
|
1589
|
+
}
|
|
1590
|
+
if (!valid) {
|
|
1591
|
+
setConditionUnresolved(cursor);
|
|
1592
|
+
return;
|
|
1593
|
+
}
|
|
1594
|
+
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) resolveConditionModifier(state, cursor, source.slice(start, end));
|
|
1595
|
+
},
|
|
1596
|
+
chain(state, _start, _end, valid) {
|
|
1597
|
+
var cursor = state.flatScanCursor;
|
|
1598
|
+
if (cursor) {
|
|
1599
|
+
if (!valid) setConditionUnresolved(cursor);
|
|
1600
|
+
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) commitConditionCursor(state, cursor);
|
|
1601
|
+
}
|
|
1602
|
+
return true;
|
|
1603
|
+
},
|
|
1604
|
+
end(state, source, result, lastPayloadStart, chainCount, property, merge, originalValue, contextOnly, failure, failureIndex) {
|
|
1605
|
+
var hasBase = !!(result & 1);
|
|
1606
|
+
if (result & 16) {
|
|
1607
|
+
if (chainCount === 0) {
|
|
1608
|
+
emitAtParentCondition(state, property, source, merge, originalValue !== null && originalValue !== void 0 ? originalValue : source, contextOnly);
|
|
1609
|
+
hasBase = true;
|
|
1610
|
+
} else 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 \"(\"");
|
|
1611
|
+
}
|
|
1612
|
+
if (result & 8 && chainCount === 1) {
|
|
1613
|
+
emitAtParentCondition(state, property, source, merge, originalValue !== null && originalValue !== void 0 ? originalValue : source, contextOnly);
|
|
1614
|
+
hasBase = true;
|
|
1615
|
+
}
|
|
1616
|
+
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.`);
|
|
1617
|
+
if ((!import_directStyleCSS.canGenerateCSS || !state.flatShouldDoClasses) && result & 2 && !hasBase) {
|
|
1618
|
+
var value = implicitLifecycleBase(property);
|
|
1619
|
+
if (value !== null) emitAtParentCondition(state, property, value, merge, value, contextOnly);
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
};
|
|
1623
|
+
function implicitLifecycleBase(property) {
|
|
1624
|
+
return property === "opacity" || property === "scale" || property === "scaleX" || property === "scaleY" ? 1 : property === "rotate" ? "0deg" : property === "x" || property === "y" ? 0 : null;
|
|
1625
|
+
}
|
|
1626
|
+
var legacyTransformParts = /* @__PURE__ */ new Set([
|
|
1627
|
+
"matrix",
|
|
1628
|
+
"perspective",
|
|
1629
|
+
"rotateX",
|
|
1630
|
+
"rotateY",
|
|
1631
|
+
"rotateZ",
|
|
1632
|
+
"scaleZ",
|
|
1633
|
+
"skewX",
|
|
1634
|
+
"skewY"
|
|
1635
|
+
]);
|
|
1636
|
+
var webShadowParts = {
|
|
1637
|
+
shadowColor: 1,
|
|
1638
|
+
shadowOffset: 2,
|
|
1639
|
+
shadowOpacity: 3,
|
|
1640
|
+
shadowRadius: 4
|
|
970
1641
|
};
|
|
971
|
-
var
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1642
|
+
var webTextShadowParts = /* @__PURE__ */ new Set([
|
|
1643
|
+
"textShadowColor",
|
|
1644
|
+
"textShadowOffset",
|
|
1645
|
+
"textShadowRadius"
|
|
1646
|
+
]);
|
|
1647
|
+
var lineStyles = /* @__PURE__ */ new Set([
|
|
1648
|
+
"none",
|
|
1649
|
+
"hidden",
|
|
1650
|
+
"dotted",
|
|
1651
|
+
"dashed",
|
|
1652
|
+
"solid",
|
|
1653
|
+
"double",
|
|
1654
|
+
"groove",
|
|
1655
|
+
"ridge",
|
|
1656
|
+
"inset",
|
|
1657
|
+
"outset"
|
|
1658
|
+
]);
|
|
1659
|
+
var borderTargets = {
|
|
1660
|
+
border: {
|
|
1661
|
+
width: [
|
|
1662
|
+
"borderTopWidth",
|
|
1663
|
+
"borderRightWidth",
|
|
1664
|
+
"borderBottomWidth",
|
|
1665
|
+
"borderLeftWidth"
|
|
1666
|
+
],
|
|
1667
|
+
style: [
|
|
1668
|
+
"borderTopStyle",
|
|
1669
|
+
"borderRightStyle",
|
|
1670
|
+
"borderBottomStyle",
|
|
1671
|
+
"borderLeftStyle"
|
|
1672
|
+
],
|
|
1673
|
+
color: [
|
|
1674
|
+
"borderTopColor",
|
|
1675
|
+
"borderRightColor",
|
|
1676
|
+
"borderBottomColor",
|
|
1677
|
+
"borderLeftColor"
|
|
1678
|
+
]
|
|
1679
|
+
},
|
|
1680
|
+
borderTop: {
|
|
1681
|
+
width: ["borderTopWidth"],
|
|
1682
|
+
style: ["borderTopStyle"],
|
|
1683
|
+
color: ["borderTopColor"]
|
|
1684
|
+
},
|
|
1685
|
+
borderRight: {
|
|
1686
|
+
width: ["borderRightWidth"],
|
|
1687
|
+
style: ["borderRightStyle"],
|
|
1688
|
+
color: ["borderRightColor"]
|
|
1689
|
+
},
|
|
1690
|
+
borderBottom: {
|
|
1691
|
+
width: ["borderBottomWidth"],
|
|
1692
|
+
style: ["borderBottomStyle"],
|
|
1693
|
+
color: ["borderBottomColor"]
|
|
1694
|
+
},
|
|
1695
|
+
borderLeft: {
|
|
1696
|
+
width: ["borderLeftWidth"],
|
|
1697
|
+
style: ["borderLeftStyle"],
|
|
1698
|
+
color: ["borderLeftColor"]
|
|
1699
|
+
},
|
|
1700
|
+
outline: {
|
|
1701
|
+
width: ["outlineWidth"],
|
|
1702
|
+
style: ["outlineStyle"],
|
|
1703
|
+
color: ["outlineColor"]
|
|
1704
|
+
},
|
|
1705
|
+
borderBlock: {
|
|
1706
|
+
width: ["borderBlockStartWidth", "borderBlockEndWidth"],
|
|
1707
|
+
style: ["borderBlockStartStyle", "borderBlockEndStyle"],
|
|
1708
|
+
color: ["borderBlockStartColor", "borderBlockEndColor"]
|
|
1709
|
+
},
|
|
1710
|
+
borderInline: {
|
|
1711
|
+
width: ["borderInlineStartWidth", "borderInlineEndWidth"],
|
|
1712
|
+
style: ["borderInlineStartStyle", "borderInlineEndStyle"],
|
|
1713
|
+
color: ["borderInlineStartColor", "borderInlineEndColor"]
|
|
1714
|
+
}
|
|
977
1715
|
};
|
|
978
|
-
var
|
|
979
|
-
|
|
980
|
-
|
|
1716
|
+
var tokenLookup = {
|
|
1717
|
+
value: void 0,
|
|
1718
|
+
fromTheme: false,
|
|
1719
|
+
themeKey: ""
|
|
981
1720
|
};
|
|
982
|
-
function
|
|
983
|
-
|
|
1721
|
+
function fillTokenLookup(value, fromTheme, themeKey) {
|
|
1722
|
+
tokenLookup.value = value;
|
|
1723
|
+
tokenLookup.fromTheme = fromTheme;
|
|
1724
|
+
tokenLookup.themeKey = themeKey;
|
|
1725
|
+
return tokenLookup;
|
|
984
1726
|
}
|
|
985
|
-
function
|
|
986
|
-
var
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1727
|
+
function tokenVariable(state, property, name) {
|
|
1728
|
+
var _state_theme, _state_conf_themes_, _state_conf_themes, _state_conf_tokensParsed_space, _state_conf_tokensParsed_color;
|
|
1729
|
+
var lookupName = name.charCodeAt(0) === 36 ? name.slice(1) : name;
|
|
1730
|
+
if (property === "fontFamily") {
|
|
1731
|
+
var _state_conf_fontsParsed_lookupName;
|
|
1732
|
+
var family = (_state_conf_fontsParsed_lookupName = state.conf.fontsParsed[lookupName]) === null || _state_conf_fontsParsed_lookupName === void 0 ? void 0 : _state_conf_fontsParsed_lookupName.family;
|
|
1733
|
+
return family ? fillTokenLookup(family, false, lookupName) : void 0;
|
|
1734
|
+
}
|
|
1735
|
+
var fontKey = property === "fontSize" ? "size" : property === "fontWeight" ? "weight" : property === "lineHeight" || property === "letterSpacing" ? property : void 0;
|
|
1736
|
+
if (fontKey) {
|
|
1737
|
+
var _font_fontKey;
|
|
1738
|
+
var font = state.conf.fontsParsed[state.fontFamily || state.conf.defaultFontToken] || state.conf.fontsParsed[state.conf.defaultFontToken];
|
|
1739
|
+
var value = font === null || font === void 0 ? void 0 : (_font_fontKey = font[fontKey]) === null || _font_fontKey === void 0 ? void 0 : _font_fontKey[lookupName];
|
|
1740
|
+
return value ? fillTokenLookup(value, false, lookupName) : void 0;
|
|
1741
|
+
}
|
|
1742
|
+
var category = (0, import_tokenCategories.getTokenCategoryForProperty)(property);
|
|
1743
|
+
var dot = lookupName.indexOf(".");
|
|
1744
|
+
if (dot !== -1) {
|
|
1745
|
+
var prefix = lookupName.slice(0, dot);
|
|
1746
|
+
if (!category || prefix === category || prefix === "color") lookupName = lookupName.slice(dot + 1);
|
|
1747
|
+
}
|
|
1748
|
+
if (category) {
|
|
1749
|
+
var _state_conf_tokensParsed_category;
|
|
1750
|
+
var own = (_state_conf_tokensParsed_category = state.conf.tokensParsed[category]) === null || _state_conf_tokensParsed_category === void 0 ? void 0 : _state_conf_tokensParsed_category[lookupName];
|
|
1751
|
+
if (own) return fillTokenLookup(own, false, lookupName);
|
|
1752
|
+
for (var _i = 0, _iter = [
|
|
1753
|
+
"color",
|
|
1754
|
+
"space",
|
|
1755
|
+
"size",
|
|
1756
|
+
"radius",
|
|
1757
|
+
"zIndex"
|
|
1758
|
+
]; _i < _iter.length; _i++) {
|
|
1759
|
+
var sibling = _iter[_i];
|
|
1760
|
+
var _state_conf_tokensParsed_sibling;
|
|
1761
|
+
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;
|
|
1762
|
+
}
|
|
1763
|
+
} else {
|
|
1764
|
+
var first = lookupName.charCodeAt(0);
|
|
1765
|
+
if (first >= 48 && first <= 57 || first === 43 || first === 45 || first === 46) return;
|
|
1766
|
+
}
|
|
1767
|
+
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]);
|
|
1768
|
+
if (theme) return fillTokenLookup(theme, true, lookupName);
|
|
1769
|
+
if (category) return;
|
|
1770
|
+
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]);
|
|
1771
|
+
return token ? fillTokenLookup(token, false, lookupName) : void 0;
|
|
1772
|
+
}
|
|
1773
|
+
var literalMissConf = null;
|
|
1774
|
+
var literalMissRevision = -1;
|
|
1775
|
+
var literalMisses = /* @__PURE__ */ new WeakMap();
|
|
1776
|
+
var literalMissRootTheme = {};
|
|
1777
|
+
function isFontKeyedProperty(property) {
|
|
1778
|
+
return property === "fontFamily" || property === "fontSize" || property === "fontWeight" || property === "lineHeight" || property === "letterSpacing";
|
|
1779
|
+
}
|
|
1780
|
+
function literalMissSet(state) {
|
|
1781
|
+
var revision = (0, import_grammarConfig.getConfigRevisionState)(state.conf).revision;
|
|
1782
|
+
if (state.conf !== literalMissConf || revision !== literalMissRevision) {
|
|
1783
|
+
literalMissConf = state.conf;
|
|
1784
|
+
literalMissRevision = revision;
|
|
1785
|
+
literalMisses = /* @__PURE__ */ new WeakMap();
|
|
1786
|
+
}
|
|
1787
|
+
var themeKey = state.theme && _type_of(state.theme) === "object" ? state.theme : literalMissRootTheme;
|
|
1788
|
+
var set = literalMisses.get(themeKey);
|
|
1789
|
+
if (!set) {
|
|
1790
|
+
set = /* @__PURE__ */ new Set();
|
|
1791
|
+
literalMisses.set(themeKey, set);
|
|
1792
|
+
}
|
|
1793
|
+
return set;
|
|
1794
|
+
}
|
|
1795
|
+
function configuredValue(state, property, raw) {
|
|
1796
|
+
var name = raw;
|
|
1797
|
+
var opacity;
|
|
1798
|
+
var slash = raw.lastIndexOf("/");
|
|
1799
|
+
if (slash > 0) {
|
|
1800
|
+
var amount = Number(raw.slice(slash + 1));
|
|
1801
|
+
if (Number.isInteger(amount) && amount >= 0 && amount <= 100) {
|
|
1802
|
+
name = raw.slice(0, slash);
|
|
1803
|
+
opacity = amount;
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
var safeArea = (0, import_resolveSafeAreaVariable.resolveSafeAreaVariable)(name);
|
|
1807
|
+
if (safeArea !== void 0) {
|
|
1808
|
+
state.flatUsesSafeArea = true;
|
|
1809
|
+
return safeArea;
|
|
1810
|
+
}
|
|
1811
|
+
var cacheable = !isFontKeyedProperty(property);
|
|
1812
|
+
var misses;
|
|
1813
|
+
var missKey = "";
|
|
1814
|
+
if (cacheable) {
|
|
1815
|
+
misses = literalMissSet(state);
|
|
1816
|
+
missKey = `${state.flatThemeName || ""}${property}${name}`;
|
|
1817
|
+
if (misses.has(missKey)) return raw;
|
|
1818
|
+
}
|
|
1819
|
+
var lookup = tokenVariable(state, property, name);
|
|
1820
|
+
if (!lookup || !(0, import_createVariable.isVariable)(lookup.value)) {
|
|
1821
|
+
var _state_conf_tokensParsed_color;
|
|
1822
|
+
if (misses) misses.add(missKey);
|
|
1823
|
+
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`);
|
|
1824
|
+
return raw;
|
|
1825
|
+
}
|
|
1826
|
+
var resolveValues = state.styleProps.resolveValues;
|
|
1827
|
+
if (resolveValues === "except-theme" && lookup.fromTheme) return `${import_themeRef.THEME_REF_PREFIX}${lookup.themeKey}${opacity !== void 0 ? `/${opacity}` : ""}`;
|
|
1828
|
+
var value = (0, import_resolveVariableValue.resolveVariableValue)(property, lookup.value, resolveValues);
|
|
1829
|
+
if (opacity !== void 0) value = (0, import_normalizeColor.normalizeColor)(value, opacity / 100);
|
|
1830
|
+
return value;
|
|
1831
|
+
}
|
|
1832
|
+
function resolveEmbeddedTokens(state, property, raw) {
|
|
1833
|
+
var copyFrom = 0;
|
|
1834
|
+
var out = "";
|
|
1835
|
+
var quote = 0;
|
|
1836
|
+
for (var index = 0; index < raw.length; index++) {
|
|
1837
|
+
var code = raw.charCodeAt(index);
|
|
1838
|
+
if (quote) {
|
|
1839
|
+
if (code === 92) index++;
|
|
1840
|
+
else if (code === quote) quote = 0;
|
|
1841
|
+
continue;
|
|
1842
|
+
}
|
|
1843
|
+
if (code === 34 || code === 39) {
|
|
1844
|
+
quote = code;
|
|
1845
|
+
continue;
|
|
1846
|
+
}
|
|
1847
|
+
if (!(code === 36 || code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122)) continue;
|
|
1848
|
+
var end = index + 1;
|
|
1849
|
+
while (end < raw.length) {
|
|
1850
|
+
var next = raw.charCodeAt(end);
|
|
1851
|
+
if (next === 36 || next === 45 || next === 46 || next === 95 || next >= 48 && next <= 57 || next >= 65 && next <= 90 || next >= 97 && next <= 122) end++;
|
|
1852
|
+
else break;
|
|
1853
|
+
}
|
|
1854
|
+
if (raw.charCodeAt(end) === 47) {
|
|
1855
|
+
var suffix = end + 1;
|
|
1856
|
+
while (suffix < raw.length) {
|
|
1857
|
+
var next1 = raw.charCodeAt(suffix);
|
|
1858
|
+
if (next1 < 48 || next1 > 57) break;
|
|
1859
|
+
suffix++;
|
|
1860
|
+
}
|
|
1861
|
+
if (suffix > end + 1) end = suffix;
|
|
1862
|
+
}
|
|
1863
|
+
var before = raw.charCodeAt(index - 1);
|
|
1864
|
+
if (code !== 36 && (before >= 48 && before <= 57 || before === 35 || before === 45 && raw.charCodeAt(index - 2) === 45 || raw.charCodeAt(end) === 40)) {
|
|
1865
|
+
index = end - 1;
|
|
1866
|
+
continue;
|
|
1867
|
+
}
|
|
1868
|
+
var word = raw.slice(index, end);
|
|
1869
|
+
var value = configuredValue(state, property, word);
|
|
1870
|
+
if (value !== word) {
|
|
1871
|
+
out += raw.slice(copyFrom, index);
|
|
1872
|
+
out += String(value);
|
|
1873
|
+
copyFrom = end;
|
|
1874
|
+
}
|
|
1875
|
+
index = end - 1;
|
|
1876
|
+
}
|
|
1877
|
+
return copyFrom ? out + raw.slice(copyFrom) : raw;
|
|
1878
|
+
}
|
|
1879
|
+
function normalizeTransitionNames(state, raw) {
|
|
1880
|
+
var quote = 0;
|
|
1881
|
+
var depth = 0;
|
|
1882
|
+
var copyFrom = 0;
|
|
1883
|
+
var out = "";
|
|
1884
|
+
for (var index = 0; index < raw.length; index++) {
|
|
1885
|
+
var code = raw.charCodeAt(index);
|
|
1886
|
+
if (quote) {
|
|
1887
|
+
if (code === 92) index++;
|
|
1888
|
+
else if (code === quote) quote = 0;
|
|
1889
|
+
continue;
|
|
1890
|
+
}
|
|
1891
|
+
if (code === 34 || code === 39) {
|
|
1892
|
+
quote = code;
|
|
1893
|
+
continue;
|
|
1894
|
+
}
|
|
1895
|
+
if (code === 40) {
|
|
1896
|
+
depth++;
|
|
1897
|
+
continue;
|
|
1898
|
+
}
|
|
1899
|
+
if (code === 41) {
|
|
1900
|
+
depth--;
|
|
1901
|
+
continue;
|
|
1902
|
+
}
|
|
1903
|
+
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;
|
|
1904
|
+
var end = index + 1;
|
|
1905
|
+
while (end < raw.length) {
|
|
1906
|
+
var next = raw.charCodeAt(end);
|
|
1907
|
+
if (next >= 48 && next <= 57 || next >= 65 && next <= 90 || next >= 97 && next <= 122 || next === 45 || next === 95) end++;
|
|
1908
|
+
else break;
|
|
1909
|
+
}
|
|
1910
|
+
if (raw.charCodeAt(end) !== 40) {
|
|
1911
|
+
var authored = raw.slice(index, end);
|
|
1912
|
+
var property = state.conf.shorthands[authored] || authored;
|
|
1913
|
+
if (property === "x" || property === "y") property = "translate";
|
|
1914
|
+
else if (property === "scaleX" || property === "scaleY") property = "scale";
|
|
1915
|
+
else if (legacyTransformParts.has(property)) property = "transform";
|
|
1916
|
+
var hasUpper = false;
|
|
1917
|
+
for (var offset = 0; offset < property.length; offset++) {
|
|
1918
|
+
var letter = property.charCodeAt(offset);
|
|
1919
|
+
if (letter >= 65 && letter <= 90) {
|
|
1920
|
+
hasUpper = true;
|
|
1921
|
+
break;
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
if (property !== authored || hasUpper) {
|
|
1925
|
+
out += raw.slice(copyFrom, index);
|
|
1926
|
+
for (var offset1 = 0; offset1 < property.length; offset1++) {
|
|
1927
|
+
var letter1 = property.charCodeAt(offset1);
|
|
1928
|
+
out += letter1 >= 65 && letter1 <= 90 ? `-${String.fromCharCode(letter1 + 32)}` : property[offset1];
|
|
1929
|
+
}
|
|
1930
|
+
copyFrom = end;
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
index = end - 1;
|
|
1934
|
+
}
|
|
1935
|
+
return copyFrom ? out + raw.slice(copyFrom) : raw;
|
|
1936
|
+
}
|
|
1937
|
+
function getDirectDynamicThemeAccess(state) {
|
|
1938
|
+
return state.flatDynamicThemeAccess;
|
|
1939
|
+
}
|
|
1940
|
+
function emitProperty(state, property, value, cursor, merge, originalValue, contextOnly) {
|
|
1941
|
+
var _state_animationDriver;
|
|
1942
|
+
var _state, _state1;
|
|
1943
|
+
var direct = state;
|
|
1944
|
+
var condition = cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
1945
|
+
if (condition & 4) ((_state = state).flatEnterKeys || (_state.flatEnterKeys = /* @__PURE__ */ new Set())).add(property);
|
|
1946
|
+
if (condition & 8) ((_state1 = state).flatExitKeys || (_state1.flatExitKeys = /* @__PURE__ */ new Set())).add(property);
|
|
1947
|
+
var theme = cursor ? conditionTexts[cursor + conditionThemeOffset] || "" : "";
|
|
1948
|
+
if (theme) {
|
|
1949
|
+
if (import_constants.supportsDynamicColorIOS && (0, import_getDynamicVal.isColorStyleKey)(property)) {
|
|
1950
|
+
var _direct, _ref, _property;
|
|
1951
|
+
var schemes = (_ref = (_direct = direct).flatDynamicColors || (_direct.flatDynamicColors = {}))[_property = property] || (_ref[_property] = {});
|
|
1952
|
+
schemes[theme] = typeof originalValue === "string" && isAsciiLetters(originalValue) ? originalValue : value;
|
|
1953
|
+
streamWriteInline(state, property, { dynamic: { ...schemes } }, cursor, merge, originalValue, true, condition & 1 ? condition : condition + 1);
|
|
1954
|
+
return;
|
|
1955
|
+
}
|
|
1956
|
+
direct.flatDynamicThemeAccess = true;
|
|
1957
|
+
}
|
|
1958
|
+
if (contextOnly) {
|
|
1959
|
+
if (!condition || condition & 1) {
|
|
1960
|
+
var _state2;
|
|
1961
|
+
((_state2 = state).overriddenContextProps || (_state2.overriddenContextProps = {}))[property] = originalValue;
|
|
1962
|
+
}
|
|
1963
|
+
return;
|
|
1964
|
+
}
|
|
1965
|
+
if (import_directStyleCSS.canGenerateCSS && state.flatShouldDoClasses && !condition && property === "transform") {
|
|
1966
|
+
var _state3;
|
|
1967
|
+
if (process.env.NODE_ENV === "development" && state.transformAccumulator) {
|
|
1968
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
1969
|
+
try {
|
|
1970
|
+
for (var _iterator2 = (0, import_runtime.getTransformPartKeys)(state.transformAccumulator)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
1971
|
+
var part3 = _step2.value;
|
|
1972
|
+
(0, import_warnOnce.warnOnce)(`legacy transform part "${part3}" is dropped because "transform" owns the property`);
|
|
1973
|
+
}
|
|
1974
|
+
} catch (err) {
|
|
1975
|
+
_didIteratorError2 = true;
|
|
1976
|
+
_iteratorError2 = err;
|
|
1977
|
+
} finally {
|
|
1978
|
+
try {
|
|
1979
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
1980
|
+
} finally {
|
|
1981
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
(_state3 = state).transformAccumulator || (_state3.transformAccumulator = (0, import_runtime.createTransformAccumulator)());
|
|
1986
|
+
(0, import_runtime.addTransformValue)(state.transformAccumulator, property, value);
|
|
1987
|
+
return;
|
|
1988
|
+
}
|
|
1989
|
+
var shouldPromoteAnimatedStyle = import_directStyleCSS.canGenerateCSS && !condition && !state.flatShouldDoClasses && !state.styleProps.noMergeStyle && state.styleProps.isAnimated && ((_state_animationDriver = state.animationDriver) === null || _state_animationDriver === void 0 ? void 0 : _state_animationDriver.inputStyle) === "css" && property in import_helpers.nonAnimatableStyleProps;
|
|
1990
|
+
if (import_directStyleCSS.canGenerateCSS && (state.flatShouldDoClasses || shouldPromoteAnimatedStyle)) {
|
|
1991
|
+
if (!condition && state.style && direct.flatWeakContribution !== true && !(direct.flatUsed && direct.flatUsed[property])) delete state.style[property];
|
|
1992
|
+
streamWriteCSS(state, property, value, cursor, originalValue);
|
|
1993
|
+
return;
|
|
1994
|
+
}
|
|
1995
|
+
if (condition && !(condition & 1)) return;
|
|
1996
|
+
streamWriteInline(state, property, value, cursor, merge, originalValue);
|
|
1997
|
+
}
|
|
1998
|
+
function splitComponents(value) {
|
|
1999
|
+
var parts = [];
|
|
2000
|
+
var start = 0;
|
|
2001
|
+
var quote = 0;
|
|
2002
|
+
var depth = 0;
|
|
2003
|
+
for (var index = 0; index <= value.length; index++) {
|
|
2004
|
+
var code = index === value.length ? 32 : value.charCodeAt(index);
|
|
2005
|
+
if (quote) {
|
|
2006
|
+
if (code === 92) index++;
|
|
2007
|
+
else if (code === quote) quote = 0;
|
|
2008
|
+
continue;
|
|
2009
|
+
}
|
|
2010
|
+
if (code === 34 || code === 39) quote = code;
|
|
2011
|
+
else if (code === 40) depth++;
|
|
2012
|
+
else if (code === 41) depth--;
|
|
2013
|
+
else if (!depth && code <= 32) {
|
|
2014
|
+
if (index > start) parts.push(value.slice(start, index));
|
|
2015
|
+
start = index + 1;
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
return parts;
|
|
2019
|
+
}
|
|
2020
|
+
function isAsciiLetters(value) {
|
|
2021
|
+
if (!value) return false;
|
|
2022
|
+
for (var index = 0; index < value.length; index++) {
|
|
2023
|
+
var code = value.charCodeAt(index) | 32;
|
|
2024
|
+
if (code < 97 || code > 122) return false;
|
|
2025
|
+
}
|
|
2026
|
+
return true;
|
|
2027
|
+
}
|
|
2028
|
+
function numericUnitValue(value, first, second) {
|
|
2029
|
+
var unitLength = value.endsWith(first) || second !== void 0 && value.endsWith(second) ? first.length : 0;
|
|
2030
|
+
if (!unitLength || value.length === unitLength) return NaN;
|
|
2031
|
+
var numeric = Number(value.slice(0, value.length - unitLength));
|
|
2032
|
+
return Number.isFinite(numeric) ? numeric : NaN;
|
|
2033
|
+
}
|
|
2034
|
+
function isNumericCSSComponent(value) {
|
|
2035
|
+
var index = 0;
|
|
2036
|
+
if (value.charCodeAt(index) === 43 || value.charCodeAt(index) === 45) index++;
|
|
2037
|
+
var digits = 0;
|
|
2038
|
+
var dot = false;
|
|
2039
|
+
for (; index < value.length; index++) {
|
|
2040
|
+
var code = value.charCodeAt(index);
|
|
2041
|
+
if (code >= 48 && code <= 57) {
|
|
2042
|
+
digits++;
|
|
2043
|
+
continue;
|
|
2044
|
+
}
|
|
2045
|
+
if (code === 46 && !dot) {
|
|
2046
|
+
dot = true;
|
|
2047
|
+
continue;
|
|
2048
|
+
}
|
|
2049
|
+
break;
|
|
2050
|
+
}
|
|
2051
|
+
if (!digits) return false;
|
|
2052
|
+
for (; index < value.length; index++) {
|
|
2053
|
+
var code1 = value.charCodeAt(index);
|
|
2054
|
+
if (code1 !== 37 && (code1 < 97 || code1 > 122)) return false;
|
|
2055
|
+
}
|
|
2056
|
+
return true;
|
|
2057
|
+
}
|
|
2058
|
+
function startsValueFunction(value) {
|
|
2059
|
+
var index = 0;
|
|
2060
|
+
while (index < value.length) {
|
|
2061
|
+
var code = value.charCodeAt(index);
|
|
2062
|
+
if (code === 45 || code >= 97 && code <= 122) {
|
|
2063
|
+
index++;
|
|
2064
|
+
continue;
|
|
2065
|
+
}
|
|
2066
|
+
break;
|
|
2067
|
+
}
|
|
2068
|
+
return index > 0 && value.charCodeAt(index) === 40;
|
|
2069
|
+
}
|
|
2070
|
+
function emitBorder(state, property, raw, cursor, merge, originalValue, contextOnly) {
|
|
2071
|
+
if (property === "borderBlock" || property === "borderInline") {
|
|
2072
|
+
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`RN has no logical border shorthand "${property}"; dropping it`);
|
|
2073
|
+
return;
|
|
2074
|
+
}
|
|
2075
|
+
var width;
|
|
2076
|
+
var style;
|
|
2077
|
+
var color;
|
|
2078
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2079
|
+
try {
|
|
2080
|
+
for (var _iterator2 = splitComponents(raw)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2081
|
+
var part3 = _step2.value;
|
|
2082
|
+
if (lineStyles.has(part3) || property === "outline" && part3 === "auto") style = part3;
|
|
2083
|
+
else if (part3 === "thin" || part3 === "medium" || part3 === "thick" || isNumericCSSComponent(part3) || startsValueFunction(part3)) width = part3;
|
|
2084
|
+
else color = part3;
|
|
2085
|
+
}
|
|
2086
|
+
} catch (err) {
|
|
2087
|
+
_didIteratorError2 = true;
|
|
2088
|
+
_iteratorError2 = err;
|
|
2089
|
+
} finally {
|
|
2090
|
+
try {
|
|
2091
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
2092
|
+
} finally {
|
|
2093
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
if (style === "none" && width === void 0) width = "0";
|
|
2097
|
+
var targets = borderTargets[property];
|
|
2098
|
+
if (width !== void 0) {
|
|
2099
|
+
var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
|
|
2100
|
+
try {
|
|
2101
|
+
for (var _iterator12 = targets.width[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
|
|
2102
|
+
var target2 = _step12.value;
|
|
2103
|
+
emitResolved(state, target2, width, cursor, merge, originalValue, contextOnly);
|
|
2104
|
+
}
|
|
2105
|
+
} catch (err) {
|
|
2106
|
+
_didIteratorError12 = true;
|
|
2107
|
+
_iteratorError12 = err;
|
|
2108
|
+
} finally {
|
|
2109
|
+
try {
|
|
2110
|
+
if (!_iteratorNormalCompletion12 && _iterator12.return != null) _iterator12.return();
|
|
2111
|
+
} finally {
|
|
2112
|
+
if (_didIteratorError12) throw _iteratorError12;
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
if (style !== void 0) {
|
|
2117
|
+
var styleTargets = property === "border" ? ["borderStyle"] : targets.style;
|
|
2118
|
+
var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;
|
|
2119
|
+
try {
|
|
2120
|
+
for (var _iterator22 = styleTargets[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {
|
|
2121
|
+
var target1 = _step22.value;
|
|
2122
|
+
emitProperty(state, target1, style, cursor, merge, originalValue, contextOnly);
|
|
2123
|
+
}
|
|
2124
|
+
} catch (err) {
|
|
2125
|
+
_didIteratorError22 = true;
|
|
2126
|
+
_iteratorError22 = err;
|
|
2127
|
+
} finally {
|
|
2128
|
+
try {
|
|
2129
|
+
if (!_iteratorNormalCompletion22 && _iterator22.return != null) _iterator22.return();
|
|
2130
|
+
} finally {
|
|
2131
|
+
if (_didIteratorError22) throw _iteratorError22;
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
if (color !== void 0) {
|
|
2136
|
+
var _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = void 0;
|
|
2137
|
+
try {
|
|
2138
|
+
for (var _iterator3 = targets.color[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
2139
|
+
var target22 = _step3.value;
|
|
2140
|
+
emitResolved(state, target22, color, cursor, merge, originalValue, contextOnly);
|
|
2141
|
+
}
|
|
2142
|
+
} catch (err) {
|
|
2143
|
+
_didIteratorError3 = true;
|
|
2144
|
+
_iteratorError3 = err;
|
|
2145
|
+
} finally {
|
|
2146
|
+
try {
|
|
2147
|
+
if (!_iteratorNormalCompletion3 && _iterator3.return != null) _iterator3.return();
|
|
2148
|
+
} finally {
|
|
2149
|
+
if (_didIteratorError3) throw _iteratorError3;
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
function emitTextDecoration(state, raw, cursor, merge, originalValue, contextOnly) {
|
|
2155
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2156
|
+
try {
|
|
2157
|
+
for (var _iterator2 = splitComponents(raw)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2158
|
+
var part3 = _step2.value;
|
|
2159
|
+
emitResolved(state, part3 === "solid" || part3 === "double" || part3 === "dotted" || part3 === "dashed" || part3 === "wavy" ? "textDecorationStyle" : part3 === "underline" || part3 === "overline" || part3 === "line-through" || part3 === "none" ? "textDecorationLine" : "textDecorationColor", part3, cursor, merge, originalValue, contextOnly);
|
|
2160
|
+
}
|
|
2161
|
+
} catch (err) {
|
|
2162
|
+
_didIteratorError2 = true;
|
|
2163
|
+
_iteratorError2 = err;
|
|
2164
|
+
} finally {
|
|
2165
|
+
try {
|
|
2166
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
2167
|
+
} finally {
|
|
2168
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
function emitTransform(state, property, value, cursor, merge, originalValue, contextOnly) {
|
|
2173
|
+
if (!import_directStyleCSS.canGenerateCSS || !state.flatShouldDoClasses) {
|
|
2174
|
+
emitProperty(state, property, value, cursor, merge, originalValue, contextOnly);
|
|
2175
|
+
return;
|
|
2176
|
+
}
|
|
2177
|
+
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"];
|
|
2178
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2179
|
+
try {
|
|
2180
|
+
for (var _iterator2 = targets[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2181
|
+
var target2 = _step2.value;
|
|
2182
|
+
var targetValue = value;
|
|
2183
|
+
if (typeof targetValue === "number") {
|
|
2184
|
+
if (target2 === "--t-x" || target2 === "--t-y") targetValue = `${targetValue}px`;
|
|
2185
|
+
else if (target2 === "rotate") targetValue = `${targetValue}deg`;
|
|
2186
|
+
}
|
|
2187
|
+
emitProperty(state, target2, targetValue, cursor, merge, originalValue, contextOnly);
|
|
2188
|
+
if (target2 === "--t-x" || target2 === "--t-y") (0, import_directStyleCSS.addComposition)(state, "translate");
|
|
2189
|
+
else if (target2.startsWith("--t-scale")) (0, import_directStyleCSS.addComposition)(state, "scale");
|
|
2190
|
+
}
|
|
2191
|
+
} catch (err) {
|
|
2192
|
+
_didIteratorError2 = true;
|
|
2193
|
+
_iteratorError2 = err;
|
|
2194
|
+
} finally {
|
|
2195
|
+
try {
|
|
2196
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
2197
|
+
} finally {
|
|
2198
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
function emitResolved(state, property, raw, cursor, merge, originalValue, contextOnly) {
|
|
2203
|
+
var value = configuredValue(state, property, raw);
|
|
2204
|
+
if (value === raw) value = resolveEmbeddedTokens(state, property, raw);
|
|
2205
|
+
if (typeof value === "string") {
|
|
2206
|
+
var unitValue = numericUnitValue(value, "px", "dp");
|
|
2207
|
+
if (Number.isFinite(unitValue)) value = unitValue;
|
|
2208
|
+
else if (value !== "" && Number.isFinite(Number(value))) value = Number(value);
|
|
2209
|
+
}
|
|
2210
|
+
emitProperty(state, property, value, cursor, merge, originalValue, contextOnly);
|
|
2211
|
+
}
|
|
2212
|
+
var emitKindTransition = 1;
|
|
2213
|
+
var emitKindTransformPart = 2;
|
|
2214
|
+
var emitKindWebShadow = 3;
|
|
2215
|
+
var emitKindWebTextShadow = 4;
|
|
2216
|
+
var emitKindTransform = 5;
|
|
2217
|
+
var emitKindBorder = 6;
|
|
2218
|
+
var emitKindTextDecoration = 7;
|
|
2219
|
+
var emitKindBackground = 8;
|
|
2220
|
+
var emitKindAxis = 9;
|
|
2221
|
+
var emitKindBorderRadius = 10;
|
|
2222
|
+
var emitKindBorderWidth = 11;
|
|
2223
|
+
var emitValueKinds = {
|
|
2224
|
+
transition: emitKindTransition,
|
|
2225
|
+
transitionProperty: emitKindTransition,
|
|
2226
|
+
transform: emitKindTransform,
|
|
2227
|
+
textDecoration: emitKindTextDecoration,
|
|
2228
|
+
background: emitKindBackground,
|
|
2229
|
+
x: emitKindAxis,
|
|
2230
|
+
y: emitKindAxis,
|
|
2231
|
+
scale: emitKindAxis,
|
|
2232
|
+
scaleX: emitKindAxis,
|
|
2233
|
+
scaleY: emitKindAxis,
|
|
2234
|
+
rotate: emitKindAxis,
|
|
2235
|
+
borderRadius: emitKindBorderRadius,
|
|
2236
|
+
borderWidth: emitKindBorderWidth,
|
|
2237
|
+
borderTopWidth: emitKindBorderWidth,
|
|
2238
|
+
borderRightWidth: emitKindBorderWidth,
|
|
2239
|
+
borderBottomWidth: emitKindBorderWidth,
|
|
2240
|
+
borderLeftWidth: emitKindBorderWidth
|
|
2241
|
+
};
|
|
2242
|
+
var _iteratorNormalCompletion = true;
|
|
2243
|
+
var _didIteratorError = false;
|
|
2244
|
+
var _iteratorError = void 0;
|
|
2245
|
+
try {
|
|
2246
|
+
for (var _iterator = legacyTransformParts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
2247
|
+
var part = _step.value;
|
|
2248
|
+
emitValueKinds[part] = emitKindTransformPart;
|
|
2249
|
+
}
|
|
2250
|
+
} catch (err) {
|
|
2251
|
+
_didIteratorError = true;
|
|
2252
|
+
_iteratorError = err;
|
|
2253
|
+
} finally {
|
|
2254
|
+
try {
|
|
2255
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
2256
|
+
} finally {
|
|
2257
|
+
if (_didIteratorError) throw _iteratorError;
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
for (var part1 in webShadowParts) emitValueKinds[part1] = emitKindWebShadow;
|
|
2261
|
+
var _iteratorNormalCompletion1 = true;
|
|
2262
|
+
var _didIteratorError1 = false;
|
|
2263
|
+
var _iteratorError1 = void 0;
|
|
2264
|
+
try {
|
|
2265
|
+
for (var _iterator1 = webTextShadowParts[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
2266
|
+
var part2 = _step1.value;
|
|
2267
|
+
emitValueKinds[part2] = emitKindWebTextShadow;
|
|
2268
|
+
}
|
|
2269
|
+
} catch (err) {
|
|
2270
|
+
_didIteratorError1 = true;
|
|
2271
|
+
_iteratorError1 = err;
|
|
2272
|
+
} finally {
|
|
2273
|
+
try {
|
|
2274
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();
|
|
2275
|
+
} finally {
|
|
2276
|
+
if (_didIteratorError1) throw _iteratorError1;
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
for (var target in borderTargets) emitValueKinds[target] = emitKindBorder;
|
|
2280
|
+
function shadowUnit(part3) {
|
|
2281
|
+
return typeof part3 === "number" ? `${part3}px` : part3 || "0px";
|
|
2282
|
+
}
|
|
2283
|
+
function emitValue(state, property, raw, cursor, merge, originalValue, contextOnly) {
|
|
2284
|
+
var condition = cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
2285
|
+
if ((0, import_createVariable.isVariable)(raw)) raw = (0, import_resolveVariableValue.resolveVariableValue)(property, raw, state.styleProps.resolveValues);
|
|
2286
|
+
var emitKind = emitValueKinds[property];
|
|
2287
|
+
if (emitKind !== void 0) switch (emitKind) {
|
|
2288
|
+
case emitKindTransition:
|
|
2289
|
+
if (typeof raw === "string") raw = normalizeTransitionNames(state, raw);
|
|
2290
|
+
break;
|
|
2291
|
+
case emitKindBorderWidth:
|
|
2292
|
+
(0, import_directStyleCSS.requestBorderStyleDefault)(state, property, condition, cursor ? conditionTexts[cursor + conditionKeyOffset] || "" : "", cursor ? conditionTexts[cursor + conditionSelectorOffset] || "" : "", cursor ? conditionWrappers : void 0, cursor ? conditionNumbers[cursor + conditionWrapperOffset] >> 3 : 0, cursor ? conditionNumbers[cursor + conditionWrapperOffset] & 7 : 0);
|
|
2293
|
+
break;
|
|
2294
|
+
case emitKindTransformPart:
|
|
2295
|
+
var value = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
|
|
2296
|
+
if (import_directStyleCSS.canGenerateCSS && state.flatShouldDoClasses && !condition) {
|
|
2297
|
+
var _state;
|
|
2298
|
+
(_state = state).transformAccumulator || (_state.transformAccumulator = (0, import_runtime.createTransformAccumulator)());
|
|
2299
|
+
(0, import_runtime.addTransformValue)(state.transformAccumulator, property, value);
|
|
2300
|
+
} else if (condition && import_directStyleCSS.canGenerateCSS && state.flatShouldDoClasses) emitProperty(state, "transform", `${property}(${value})`, cursor, merge, originalValue, contextOnly);
|
|
2301
|
+
else streamWriteInline(state, property, value, cursor, merge, originalValue, true);
|
|
2302
|
+
return;
|
|
2303
|
+
case emitKindWebShadow: break;
|
|
2304
|
+
case emitKindWebTextShadow: break;
|
|
2305
|
+
case emitKindTransform:
|
|
2306
|
+
if (import_directStyleCSS.canGenerateCSS && state.flatShouldDoClasses && Array.isArray(raw)) raw = (0, import_transformsToString.transformsToString)(raw);
|
|
2307
|
+
if (typeof raw === "string") {
|
|
2308
|
+
var transform = (0, import_parseNativeTransform.parseNativeTransform)(raw);
|
|
2309
|
+
if (transform) {
|
|
2310
|
+
emitProperty(state, property, transform, cursor, merge, originalValue, contextOnly);
|
|
2311
|
+
return;
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
break;
|
|
2315
|
+
case emitKindBorder:
|
|
2316
|
+
if (typeof raw === "string") {
|
|
2317
|
+
emitBorder(state, property, raw, cursor, merge, originalValue, contextOnly);
|
|
2318
|
+
return;
|
|
2319
|
+
}
|
|
2320
|
+
break;
|
|
2321
|
+
case emitKindTextDecoration:
|
|
2322
|
+
if (typeof raw === "string") {
|
|
2323
|
+
emitTextDecoration(state, raw, cursor, merge, originalValue, contextOnly);
|
|
2324
|
+
return;
|
|
2325
|
+
}
|
|
2326
|
+
break;
|
|
2327
|
+
case emitKindBackground:
|
|
2328
|
+
if (typeof raw === "string") {
|
|
2329
|
+
var parts = splitComponents(raw);
|
|
2330
|
+
if (parts.length === 1 && !startsValueFunction(parts[0])) {
|
|
2331
|
+
emitResolved(state, "backgroundColor", parts[0], cursor, merge, originalValue, contextOnly);
|
|
2332
|
+
return;
|
|
2333
|
+
}
|
|
2334
|
+
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`native background cannot represent "${raw}"; dropping it`);
|
|
2335
|
+
return;
|
|
2336
|
+
}
|
|
2337
|
+
break;
|
|
2338
|
+
case emitKindAxis:
|
|
2339
|
+
var value3 = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
|
|
2340
|
+
if (typeof value3 === "string" && !value3.startsWith(import_themeRef.THEME_REF_PREFIX)) {
|
|
2341
|
+
if (property === "rotate" && !Number.isFinite(numericUnitValue(value3, "deg", "rad"))) {
|
|
2342
|
+
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`native transform "${property}" cannot represent "${value3}"; dropping it`);
|
|
2343
|
+
if (condition & 1) {
|
|
2344
|
+
(0, import_runtime.removeTransformValue)(state.transformAccumulator, property);
|
|
2345
|
+
streamRetractInline(state, property, cursor);
|
|
2346
|
+
}
|
|
2347
|
+
return;
|
|
2348
|
+
}
|
|
2349
|
+
var unitValue = numericUnitValue(value3, "px", "dp");
|
|
2350
|
+
if (Number.isFinite(unitValue)) value3 = unitValue;
|
|
2351
|
+
else if (Number.isFinite(Number(value3))) value3 = Number(value3);
|
|
2352
|
+
}
|
|
2353
|
+
emitTransform(state, property, value3, cursor, merge, originalValue, contextOnly);
|
|
2354
|
+
return;
|
|
2355
|
+
case emitKindBorderRadius: break;
|
|
2356
|
+
}
|
|
2357
|
+
var value4 = raw;
|
|
2358
|
+
if (typeof raw === "string") {
|
|
2359
|
+
value4 = configuredValue(state, property, raw);
|
|
2360
|
+
if (value4 === raw) value4 = resolveEmbeddedTokens(state, property, raw);
|
|
2361
|
+
}
|
|
2362
|
+
if (typeof value4 === "string") {
|
|
2363
|
+
var unitValue1 = numericUnitValue(value4, "px", "dp");
|
|
2364
|
+
if (Number.isFinite(unitValue1)) value4 = unitValue1;
|
|
2365
|
+
else if (value4 !== "" && Number.isFinite(Number(value4))) value4 = Number(value4);
|
|
2366
|
+
}
|
|
2367
|
+
if (import_directStyleCSS.canGenerateCSS && state.flatShouldDoClasses && property === "boxShadow" && !condition) {
|
|
2368
|
+
state.flatBoxShadow = value4;
|
|
2369
|
+
state.flatBoxShadowSequence = frameSequence + 1;
|
|
2370
|
+
}
|
|
2371
|
+
if (typeof value4 === "string" && (property === "backgroundImage" || property === "boxShadow" || property === "textShadow")) {
|
|
2372
|
+
var parsed = (0, import_parseNativeStyle.parseNativeStyle)(property, value4);
|
|
2373
|
+
if (parsed) {
|
|
2374
|
+
if (property === "textShadow") {
|
|
2375
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2376
|
+
try {
|
|
2377
|
+
for (var _iterator2 = parsed[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2378
|
+
var [key, parsedValue] = _step2.value;
|
|
2379
|
+
emitProperty(state, key, parsedValue, cursor, merge, originalValue, contextOnly);
|
|
2380
|
+
}
|
|
2381
|
+
} catch (err) {
|
|
2382
|
+
_didIteratorError2 = true;
|
|
2383
|
+
_iteratorError2 = err;
|
|
2384
|
+
} finally {
|
|
2385
|
+
try {
|
|
2386
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
2387
|
+
} finally {
|
|
2388
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
} else emitProperty(state, property === "backgroundImage" ? "experimental_backgroundImage" : property, parsed, cursor, merge, originalValue, contextOnly);
|
|
2392
|
+
return;
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
if (property === "fontVariant" && typeof value4 === "string") {
|
|
2396
|
+
var variants = [];
|
|
2397
|
+
var start = 0;
|
|
2398
|
+
for (var index = 0; index <= value4.length; index++) {
|
|
2399
|
+
var code = index === value4.length ? 32 : value4.charCodeAt(index);
|
|
2400
|
+
if (code !== 44 && code > 32) continue;
|
|
2401
|
+
if (start < index) variants.push(value4.slice(start, index));
|
|
2402
|
+
start = index + 1;
|
|
2403
|
+
}
|
|
2404
|
+
value4 = variants;
|
|
2405
|
+
}
|
|
2406
|
+
var expanded = state.styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(property, value4, state.conf.settings.styleCompat || "web");
|
|
2407
|
+
if (!expanded) {
|
|
2408
|
+
emitProperty(state, property, value4, cursor, merge, originalValue, contextOnly);
|
|
2409
|
+
return;
|
|
2410
|
+
}
|
|
2411
|
+
if (typeof raw === "string" && expanded.length > 1) {
|
|
2412
|
+
var parts1 = splitComponents(raw);
|
|
2413
|
+
if (parts1.length > 0 && parts1.length <= (expanded.length === 4 ? 4 : 2)) {
|
|
2414
|
+
for (var index1 = 0; index1 < expanded.length; index1++) {
|
|
2415
|
+
var partIndex = index1 === 0 || parts1.length === 1 ? 0 : index1 === 1 || index1 === 3 && parts1.length < 4 ? 1 : index1 === 2 && parts1.length < 3 ? 0 : index1;
|
|
2416
|
+
emitResolved(state, expanded[index1][0], parts1[partIndex], cursor, merge, originalValue, contextOnly);
|
|
2417
|
+
}
|
|
2418
|
+
return;
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
for (var index2 = 0; index2 < expanded.length; index2++) emitProperty(state, expanded[index2][0], expanded[index2][1], cursor, merge, originalValue, contextOnly);
|
|
2422
|
+
}
|
|
2423
|
+
function contributeStyleString(state, property, source, merge, originalValue) {
|
|
2424
|
+
var contextOnly = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;
|
|
2425
|
+
var directState = state;
|
|
2426
|
+
var watermark = conditionCursorTop;
|
|
2427
|
+
var previousCursor = directState.flatScanCursor;
|
|
2428
|
+
var previousExpectMulti = directState.flatExpectMulti;
|
|
2429
|
+
directState.flatScanCursor = null;
|
|
2430
|
+
directState.flatExpectMulti = source.indexOf(":") !== -1;
|
|
2431
|
+
try {
|
|
2432
|
+
(0, import_runtime.scanFlatValue)(source, directStyleHandler, state, property, merge, originalValue, contextOnly);
|
|
2433
|
+
} finally {
|
|
2434
|
+
directState.flatScanCursor = previousCursor;
|
|
2435
|
+
directState.flatExpectMulti = previousExpectMulti;
|
|
2436
|
+
releaseConditionCursors(watermark);
|
|
2437
|
+
}
|
|
2438
|
+
return true;
|
|
2439
|
+
}
|
|
2440
|
+
function contributeStyleObject(state, property, value, merge, contextOnly) {
|
|
2441
|
+
var outerState = state;
|
|
2442
|
+
var previousExpectMulti = outerState.flatExpectMulti;
|
|
2443
|
+
outerState.flatExpectMulti = true;
|
|
2444
|
+
try {
|
|
2445
|
+
return contributeStyleObjectInner(state, property, value, merge, contextOnly);
|
|
2446
|
+
} finally {
|
|
2447
|
+
outerState.flatExpectMulti = previousExpectMulti;
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
function contributeStyleObjectInner(state, property, value, merge, contextOnly) {
|
|
2451
|
+
var _directState_flatPass;
|
|
2452
|
+
var directState = state;
|
|
2453
|
+
var parent = ((_directState_flatPass = directState.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passParentCursor]) || null;
|
|
2454
|
+
var hasDefault = Object.prototype.hasOwnProperty.call(value, "default");
|
|
2455
|
+
var hasBase = false;
|
|
2456
|
+
var base = hasDefault ? value.default : void 0;
|
|
2457
|
+
if (base != null) {
|
|
2458
|
+
var baseString = String(base);
|
|
2459
|
+
feedCompoundSegment(directState, baseString, 0, baseString.length, true, true, "");
|
|
2460
|
+
emitAtParentCondition(state, property, base, merge, base, contextOnly);
|
|
2461
|
+
hasBase = true;
|
|
2462
|
+
}
|
|
2463
|
+
var conditions = 0;
|
|
2464
|
+
var firstCondition = !hasDefault;
|
|
2465
|
+
for (var key in value) {
|
|
2466
|
+
if (key === "default") continue;
|
|
2467
|
+
var payload = value[key];
|
|
2468
|
+
var watermark = conditionCursorTop;
|
|
2469
|
+
var cursor = acquireConditionCursor(parent);
|
|
2470
|
+
resolveConditionText(state, cursor, key);
|
|
2471
|
+
var condition = commitConditionCursor(state, cursor);
|
|
2472
|
+
if (firstCondition) {
|
|
2473
|
+
firstCondition = false;
|
|
2474
|
+
if (!condition) {
|
|
2475
|
+
releaseConditionCursors(watermark);
|
|
2476
|
+
return false;
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
if (payload != null) {
|
|
2480
|
+
var _directState_flatPass1;
|
|
2481
|
+
conditions |= emitUnderCondition(state, property, payload, cursor, merge, payload, contextOnly, 1, payload);
|
|
2482
|
+
var payloadString = String(payload);
|
|
2483
|
+
feedCompoundSegment(directState, payloadString, 0, payloadString.length, false, Boolean(condition), condition && ((_directState_flatPass1 = directState.flatPass) === null || _directState_flatPass1 === void 0 ? void 0 : _directState_flatPass1[passCompoundIndexes]) ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
2484
|
+
}
|
|
2485
|
+
releaseConditionCursors(watermark);
|
|
2486
|
+
}
|
|
2487
|
+
if (!hasDefault && firstCondition) return false;
|
|
2488
|
+
if ((!import_directStyleCSS.canGenerateCSS || !state.flatShouldDoClasses) && conditions & 12 && !hasBase) {
|
|
2489
|
+
var resting = implicitLifecycleBase(property);
|
|
2490
|
+
if (resting !== null) emitAtParentCondition(state, property, resting, merge, resting, contextOnly);
|
|
2491
|
+
}
|
|
2492
|
+
return true;
|
|
2493
|
+
}
|
|
2494
|
+
function contributeValue(state, property, value, merge, originalValue) {
|
|
2495
|
+
var contextOnly = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false, condition = arguments.length > 6 ? arguments[6] : void 0;
|
|
2496
|
+
if (isConditionTransport(value)) {
|
|
2497
|
+
if (value.hasBase) contributeValue(state, property, value.base, merge, value.base, contextOnly);
|
|
2498
|
+
for (var offset = 0; offset < value.entries.length;) {
|
|
2499
|
+
var entryValue = value.entries[offset];
|
|
2500
|
+
var watermark = conditionCursorTop;
|
|
2501
|
+
try {
|
|
2502
|
+
var _state_flatPass;
|
|
2503
|
+
emitUnderCondition(state, property, entryValue, acquireTransportCursor(state, value.entries, offset, ((_state_flatPass = state.flatPass) === null || _state_flatPass === void 0 ? void 0 : _state_flatPass[passParentCursor]) || null), merge, entryValue, contextOnly, 2, entryValue);
|
|
2504
|
+
} finally {
|
|
2505
|
+
releaseConditionCursors(watermark);
|
|
2506
|
+
}
|
|
2507
|
+
offset += transportEntryWidth;
|
|
2508
|
+
}
|
|
2509
|
+
return true;
|
|
2510
|
+
}
|
|
2511
|
+
if (condition !== void 0) {
|
|
2512
|
+
var _directState_flatPass;
|
|
2513
|
+
var parent = ((_directState_flatPass = state.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passParentCursor]) || null;
|
|
2514
|
+
var watermark1 = conditionCursorTop;
|
|
2515
|
+
try {
|
|
2516
|
+
var effective;
|
|
2517
|
+
if (typeof condition === "string") {
|
|
2518
|
+
effective = acquireConditionCursor(parent);
|
|
2519
|
+
resolveConditionText(state, effective, condition);
|
|
2520
|
+
commitConditionCursor(state, effective);
|
|
2521
|
+
} else if (parent) {
|
|
2522
|
+
effective = acquireConditionCursor(parent);
|
|
2523
|
+
var conditionKey = conditionTexts[condition + conditionKeyOffset] || "";
|
|
2524
|
+
if (conditionKey) resolveConditionText(state, effective, conditionKey);
|
|
2525
|
+
if (!(conditionNumbers[condition + conditionFlagsOffset] & conditionResolvedFlag)) setConditionUnresolved(effective);
|
|
2526
|
+
commitConditionCursor(state, effective);
|
|
2527
|
+
} else effective = condition;
|
|
2528
|
+
var isObjectValue = value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value);
|
|
2529
|
+
var objectHasDefault = isObjectValue && Object.prototype.hasOwnProperty.call(value, "default");
|
|
2530
|
+
var firstChild = isObjectValue && !objectHasDefault ? acquireConditionCursor(effective) : null;
|
|
2531
|
+
if (isObjectValue && classifyConditionalObject(value, state, void 0, firstChild || void 0)) {
|
|
2532
|
+
var useFirstChild = firstChild !== null;
|
|
2533
|
+
for (var key in value) {
|
|
2534
|
+
var payload = value[key];
|
|
2535
|
+
if (payload == null) continue;
|
|
2536
|
+
if (key === "default") emitUnderCondition(state, property, payload, effective, merge, payload, contextOnly, 2, payload);
|
|
2537
|
+
else {
|
|
2538
|
+
var keyWatermark = conditionCursorTop;
|
|
2539
|
+
var child = useFirstChild ? firstChild : acquireConditionCursor(effective);
|
|
2540
|
+
if (useFirstChild) useFirstChild = false;
|
|
2541
|
+
else {
|
|
2542
|
+
resolveConditionText(state, child, key);
|
|
2543
|
+
commitConditionCursor(state, child);
|
|
2544
|
+
}
|
|
2545
|
+
emitUnderCondition(state, property, payload, child, merge, payload, contextOnly, 2, payload);
|
|
2546
|
+
if (child !== firstChild) releaseConditionCursors(keyWatermark);
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
return true;
|
|
2550
|
+
}
|
|
2551
|
+
emitUnderCondition(state, property, value, effective, merge, originalValue, contextOnly, 2, value);
|
|
2552
|
+
return true;
|
|
2553
|
+
} finally {
|
|
2554
|
+
releaseConditionCursors(watermark1);
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
if (value === "safe" && (0, import_resolveSafeArea.isSafeAreaKey)(property)) {
|
|
2558
|
+
var expanded = (0, import_resolveSafeArea.expandSafeAreaValue)(property);
|
|
2559
|
+
if (expanded) {
|
|
2560
|
+
state.flatUsesSafeArea = true;
|
|
2561
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2562
|
+
try {
|
|
2563
|
+
for (var _iterator2 = expanded[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2564
|
+
var [key1, resolved] = _step2.value;
|
|
2565
|
+
emitAtParentCondition(state, key1, resolved, merge, originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
|
|
2566
|
+
}
|
|
2567
|
+
} catch (err) {
|
|
2568
|
+
_didIteratorError2 = true;
|
|
2569
|
+
_iteratorError2 = err;
|
|
2570
|
+
} finally {
|
|
2571
|
+
try {
|
|
2572
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
2573
|
+
} finally {
|
|
2574
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
return true;
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
if (typeof value === "string") return contributeStyleString(state, property, value, merge, originalValue, contextOnly);
|
|
2581
|
+
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;
|
|
2582
|
+
if (value != null) {
|
|
2583
|
+
emitAtParentCondition(state, property, value, merge, originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
|
|
2584
|
+
return true;
|
|
2585
|
+
}
|
|
2586
|
+
return false;
|
|
2587
|
+
}
|
|
2588
|
+
function clearDirectStyle(state, property) {
|
|
2589
|
+
var direct = state;
|
|
2590
|
+
var atomicKey = property.startsWith("transition") ? "transition" : webShadowParts[property] ? "boxShadow" : webTextShadowParts.has(property) ? "textShadow" : legacyTransformParts.has(property) ? "transform" : property;
|
|
2591
|
+
(0, import_directStyleCSS.clearFrameAtomic)(state, atomicKey);
|
|
2592
|
+
var used = direct.flatUsed;
|
|
2593
|
+
if (used) delete used[atomicKey];
|
|
2594
|
+
if (atomicKey === "transform") state.transformAccumulator = void 0;
|
|
2595
|
+
if (state.style) delete state.style[atomicKey];
|
|
2596
|
+
delete state.classNames[atomicKey];
|
|
2597
|
+
}
|
|
2598
|
+
var conditionTransports = /* @__PURE__ */ new WeakSet();
|
|
2599
|
+
function isConditionTransport(value) {
|
|
2600
|
+
return (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null && conditionTransports.has(value);
|
|
2601
|
+
}
|
|
2602
|
+
var transportEntryWidth = 2;
|
|
2603
|
+
function appendConditionEntry(entries, cursor, value) {
|
|
2604
|
+
entries.push(value, conditionTexts[cursor + conditionKeyOffset] || "");
|
|
2605
|
+
}
|
|
2606
|
+
function acquireTransportCursor(state, entries, offset, parent) {
|
|
2607
|
+
var cursor = acquireConditionCursor(parent);
|
|
2608
|
+
var key = entries[offset + 1];
|
|
2609
|
+
if (key) resolveConditionText(state, cursor, key);
|
|
2610
|
+
commitConditionCursor(state, cursor);
|
|
2611
|
+
return cursor;
|
|
2612
|
+
}
|
|
2613
|
+
function mergeConditionTransport(state, prev, cursor, value) {
|
|
2614
|
+
var transport;
|
|
2615
|
+
if (isConditionTransport(prev)) transport = prev;
|
|
2616
|
+
else {
|
|
2617
|
+
transport = {
|
|
2618
|
+
hasBase: false,
|
|
2619
|
+
base: void 0,
|
|
2620
|
+
entries: []
|
|
2621
|
+
};
|
|
2622
|
+
conditionTransports.add(transport);
|
|
2623
|
+
if (prev != null) {
|
|
2624
|
+
var isObjectValue = (typeof prev === "undefined" ? "undefined" : _type_of(prev)) === "object" && !Array.isArray(prev) && !(0, import_createVariable.isVariable)(prev);
|
|
2625
|
+
var objectHasDefault = isObjectValue && Object.prototype.hasOwnProperty.call(prev, "default");
|
|
2626
|
+
var authoredWatermark = conditionCursorTop;
|
|
2627
|
+
try {
|
|
2628
|
+
var firstCursor = isObjectValue && !objectHasDefault ? acquireConditionCursor() : null;
|
|
2629
|
+
if (isObjectValue && classifyConditionalObject(prev, state, void 0, firstCursor || void 0)) {
|
|
2630
|
+
var useFirstCursor = firstCursor !== null;
|
|
2631
|
+
for (var key in prev) {
|
|
2632
|
+
var payload = prev[key];
|
|
2633
|
+
if (payload == null) continue;
|
|
2634
|
+
if (key === "default") {
|
|
2635
|
+
transport.hasBase = true;
|
|
2636
|
+
transport.base = payload;
|
|
2637
|
+
continue;
|
|
2638
|
+
}
|
|
2639
|
+
var watermark = conditionCursorTop;
|
|
2640
|
+
var keyCursor = useFirstCursor ? firstCursor : acquireConditionCursor();
|
|
2641
|
+
if (useFirstCursor) useFirstCursor = false;
|
|
2642
|
+
else {
|
|
2643
|
+
resolveConditionText(state, keyCursor, key);
|
|
2644
|
+
commitConditionCursor(state, keyCursor);
|
|
2645
|
+
}
|
|
2646
|
+
appendConditionEntry(transport.entries, keyCursor, payload);
|
|
2647
|
+
if (keyCursor !== firstCursor) releaseConditionCursors(watermark);
|
|
2648
|
+
}
|
|
2649
|
+
} else {
|
|
2650
|
+
transport.hasBase = true;
|
|
2651
|
+
transport.base = prev;
|
|
2652
|
+
}
|
|
2653
|
+
} finally {
|
|
2654
|
+
releaseConditionCursors(authoredWatermark);
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
var cursorKey = conditionTexts[cursor + conditionKeyOffset] || "";
|
|
2659
|
+
for (var offset = 0; offset < transport.entries.length; offset += transportEntryWidth) if (transport.entries[offset + 1] === cursorKey) {
|
|
2660
|
+
transport.entries.splice(offset, transportEntryWidth);
|
|
2661
|
+
break;
|
|
2662
|
+
}
|
|
2663
|
+
appendConditionEntry(transport.entries, cursor, value);
|
|
2664
|
+
return transport;
|
|
2665
|
+
}
|
|
2666
|
+
var variantValueHandler = {
|
|
2667
|
+
segment(ctx, start, end, isBase, valid, source, chainStart, chainEnd, chainValid) {
|
|
2668
|
+
var _directState_flatPass;
|
|
2669
|
+
var state = ctx[0];
|
|
2670
|
+
var directState = state;
|
|
2671
|
+
if (start === end) return;
|
|
2672
|
+
if (isBase) {
|
|
2673
|
+
feedCompoundSegment(directState, source, start, end, true, valid, "");
|
|
2674
|
+
if (!valid) return;
|
|
2675
|
+
emitResolvedVariant(ctx[1], source.slice(start, end), state, ctx[2], null);
|
|
2676
|
+
return;
|
|
2677
|
+
}
|
|
2678
|
+
if (!valid || !chainValid) return;
|
|
2679
|
+
var cursor = directState.flatScanCursor;
|
|
2680
|
+
var condition = cursor && conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
2681
|
+
feedCompoundSegment(directState, source, start, end, false, Boolean(condition), condition && ((_directState_flatPass = directState.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passCompoundIndexes]) ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
2682
|
+
if (!condition) return;
|
|
2683
|
+
emitResolvedVariant(ctx[1], source.slice(start, end), state, ctx[2], cursor);
|
|
2684
|
+
},
|
|
2685
|
+
modifier(ctx, start, end, valid, first, source) {
|
|
2686
|
+
var directState = ctx[0];
|
|
2687
|
+
var cursor = directState.flatScanCursor;
|
|
2688
|
+
if (!cursor) cursor = directState.flatScanCursor = acquireConditionCursor();
|
|
2689
|
+
else if (first) resetConditionCursor(cursor, 0);
|
|
2690
|
+
if (!valid) {
|
|
2691
|
+
setConditionUnresolved(cursor);
|
|
2692
|
+
return;
|
|
2693
|
+
}
|
|
2694
|
+
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) resolveConditionModifier(ctx[0], cursor, source.slice(start, end));
|
|
2695
|
+
},
|
|
2696
|
+
chain(ctx, _start, _end, valid) {
|
|
2697
|
+
var cursor = ctx[0].flatScanCursor;
|
|
2698
|
+
if (cursor) {
|
|
2699
|
+
if (!valid) setConditionUnresolved(cursor);
|
|
2700
|
+
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) commitConditionCursor(ctx[0], cursor);
|
|
2701
|
+
}
|
|
2702
|
+
return true;
|
|
2703
|
+
}
|
|
2704
|
+
};
|
|
2705
|
+
var contextPropSets = /* @__PURE__ */ new WeakMap();
|
|
2706
|
+
function getContextPropSet(staticConfig) {
|
|
2707
|
+
var _staticConfig_parentStaticConfig, _staticConfig_parentStaticConfig1, _staticConfig_parentStaticConfig2, _staticConfig_parentStaticConfig_context, _staticConfig_parentStaticConfig3;
|
|
2708
|
+
var cached = contextPropSets.get(staticConfig);
|
|
2709
|
+
if (cached !== void 0) return cached;
|
|
2710
|
+
var contextConfig = staticConfig.context || ((_staticConfig_parentStaticConfig = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig === void 0 ? void 0 : _staticConfig_parentStaticConfig.context);
|
|
2711
|
+
var inheritedContextPropKeys = !staticConfig.context || staticConfig.context === ((_staticConfig_parentStaticConfig1 = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig1 === void 0 ? void 0 : _staticConfig_parentStaticConfig1.context) ? (_staticConfig_parentStaticConfig2 = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig2 === void 0 ? void 0 : _staticConfig_parentStaticConfig2.contextProps : void 0;
|
|
2712
|
+
var contextPropKeys = staticConfig.contextProps || inheritedContextPropKeys;
|
|
2713
|
+
var set = null;
|
|
2714
|
+
if (contextConfig === null || contextConfig === void 0 ? void 0 : contextConfig.props) {
|
|
2715
|
+
set || (set = /* @__PURE__ */ new Set());
|
|
2716
|
+
for (var key in contextConfig.props) set.add(key);
|
|
2717
|
+
}
|
|
2718
|
+
if (contextPropKeys) {
|
|
2719
|
+
set || (set = /* @__PURE__ */ new Set());
|
|
2720
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2721
|
+
try {
|
|
2722
|
+
for (var _iterator2 = contextPropKeys[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2723
|
+
var key1 = _step2.value;
|
|
2724
|
+
set.add(key1);
|
|
2725
|
+
}
|
|
2726
|
+
} catch (err) {
|
|
2727
|
+
_didIteratorError2 = true;
|
|
2728
|
+
_iteratorError2 = err;
|
|
2729
|
+
} finally {
|
|
2730
|
+
try {
|
|
2731
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
2732
|
+
} finally {
|
|
2733
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
if (contextConfig === null || contextConfig === void 0 ? void 0 : contextConfig.propKeys) {
|
|
2738
|
+
set || (set = /* @__PURE__ */ new Set());
|
|
2739
|
+
var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
|
|
2740
|
+
try {
|
|
2741
|
+
for (var _iterator12 = contextConfig.propKeys[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
|
|
2742
|
+
var key2 = _step12.value;
|
|
2743
|
+
set.add(key2);
|
|
2744
|
+
}
|
|
2745
|
+
} catch (err) {
|
|
2746
|
+
_didIteratorError12 = true;
|
|
2747
|
+
_iteratorError12 = err;
|
|
2748
|
+
} finally {
|
|
2749
|
+
try {
|
|
2750
|
+
if (!_iteratorNormalCompletion12 && _iterator12.return != null) _iterator12.return();
|
|
2751
|
+
} finally {
|
|
2752
|
+
if (_didIteratorError12) throw _iteratorError12;
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
var parentPropKeys = (_staticConfig_parentStaticConfig3 = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig3 === void 0 ? void 0 : (_staticConfig_parentStaticConfig_context = _staticConfig_parentStaticConfig3.context) === null || _staticConfig_parentStaticConfig_context === void 0 ? void 0 : _staticConfig_parentStaticConfig_context.propKeys;
|
|
2757
|
+
if (parentPropKeys) {
|
|
2758
|
+
set || (set = /* @__PURE__ */ new Set());
|
|
2759
|
+
var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;
|
|
2760
|
+
try {
|
|
2761
|
+
for (var _iterator22 = parentPropKeys[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {
|
|
2762
|
+
var key3 = _step22.value;
|
|
2763
|
+
set.add(key3);
|
|
2764
|
+
}
|
|
2765
|
+
} catch (err) {
|
|
2766
|
+
_didIteratorError22 = true;
|
|
2767
|
+
_iteratorError22 = err;
|
|
2768
|
+
} finally {
|
|
2769
|
+
try {
|
|
2770
|
+
if (!_iteratorNormalCompletion22 && _iterator22.return != null) _iterator22.return();
|
|
2771
|
+
} finally {
|
|
2772
|
+
if (_didIteratorError22) throw _iteratorError22;
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2776
|
+
contextPropSets.set(staticConfig, set);
|
|
2777
|
+
return set;
|
|
2778
|
+
}
|
|
2779
|
+
function emitMappedValue(styleState, key, value, originalValue, nestedCondition, parentCondition, fallbackOriginal) {
|
|
2780
|
+
var nested = nestedCondition;
|
|
2781
|
+
var parent = parentCondition;
|
|
2782
|
+
var resolvedCondition = nested !== null && nested !== void 0 ? nested : parent;
|
|
2783
|
+
var watermark = conditionCursorTop;
|
|
2784
|
+
if (nested && parent) {
|
|
2785
|
+
var composed = acquireConditionCursor(parent);
|
|
2786
|
+
var nestedKey = conditionTexts[nested + conditionKeyOffset] || "";
|
|
2787
|
+
if (nestedKey) resolveConditionText(styleState, composed, nestedKey);
|
|
2788
|
+
if (!(conditionNumbers[nested + conditionFlagsOffset] & conditionResolvedFlag)) setConditionUnresolved(composed);
|
|
2789
|
+
commitConditionCursor(styleState, composed);
|
|
2790
|
+
resolvedCondition = composed;
|
|
2791
|
+
}
|
|
2792
|
+
var conf = styleState.conf;
|
|
2793
|
+
if (key === "fontFamily" || key === conf.inverseShorthands.fontFamily) styleState.fontFamily = getFontFamilyFromNameOrVariable(value, conf);
|
|
2794
|
+
mapContributedProp(styleState, key, value, originalValue !== null && originalValue !== void 0 ? originalValue : fallbackOriginal, resolvedCondition);
|
|
2795
|
+
releaseConditionCursors(watermark);
|
|
2796
|
+
}
|
|
2797
|
+
var contributeMappedValue = function(key, value, styleState, disabled, parentCondition, fallbackOriginal) {
|
|
2798
|
+
if (disabled) return emitMappedValue(styleState, key, value, void 0, void 0, parentCondition, fallbackOriginal);
|
|
2799
|
+
var { conf, styleProps, staticConfig } = styleState;
|
|
2800
|
+
var { variants } = staticConfig;
|
|
2801
|
+
var { disableExpandShorthands, noExpand, resolveValues } = styleProps;
|
|
2802
|
+
var shorthands = conf.shorthands;
|
|
2803
|
+
if (value === "unset") {
|
|
2804
|
+
var expandedKey = !disableExpandShorthands && shorthands[key] || key;
|
|
2805
|
+
var expanded = noExpand ? null : (0, import_expandStyle.expandStyle)(expandedKey, value, conf.settings.styleCompat || "web");
|
|
2806
|
+
var used = styleState.flatUsed;
|
|
2807
|
+
if (expanded) {
|
|
2808
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2809
|
+
try {
|
|
2810
|
+
for (var _iterator2 = expanded[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2811
|
+
var [nkey] = _step2.value;
|
|
2812
|
+
if (used) delete used[nkey];
|
|
2813
|
+
if (styleState.style) delete styleState.style[nkey];
|
|
2814
|
+
}
|
|
2815
|
+
} catch (err) {
|
|
2816
|
+
_didIteratorError2 = true;
|
|
2817
|
+
_iteratorError2 = err;
|
|
2818
|
+
} finally {
|
|
2819
|
+
try {
|
|
2820
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
2821
|
+
} finally {
|
|
2822
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
2823
|
+
}
|
|
2824
|
+
}
|
|
2825
|
+
} else {
|
|
2826
|
+
if (used) delete used[expandedKey];
|
|
2827
|
+
if (styleState.style) delete styleState.style[expandedKey];
|
|
2828
|
+
}
|
|
2829
|
+
return;
|
|
2830
|
+
}
|
|
2831
|
+
if (!noExpand) {
|
|
2832
|
+
if (variants && key in variants) {
|
|
2833
|
+
resolveVariants(key, value, styleProps, styleState, key);
|
|
2834
|
+
return;
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2837
|
+
if (!disableExpandShorthands) {
|
|
2838
|
+
if (key in shorthands) key = shorthands[key];
|
|
2839
|
+
}
|
|
2840
|
+
var originalValue = value;
|
|
2841
|
+
if (value === "safe" && (0, import_resolveSafeArea.isSafeAreaKey)(key)) {
|
|
2842
|
+
var expanded1 = (0, import_resolveSafeArea.expandSafeAreaValue)(key);
|
|
2843
|
+
if (expanded1) {
|
|
2844
|
+
for (var i = 0; i < expanded1.length; i++) {
|
|
2845
|
+
var [nkey1, nvalue] = expanded1[i];
|
|
2846
|
+
emitMappedValue(styleState, nkey1, nvalue, originalValue, void 0, parentCondition, fallbackOriginal);
|
|
2847
|
+
}
|
|
2848
|
+
return;
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
if (value != null) {
|
|
2852
|
+
if (typeof value === "string") value = (0, import_resolveRem.isRemValue)(value) ? (0, import_resolveRem.resolveRem)(value) : value;
|
|
2853
|
+
else if ((0, import_createVariable.isVariable)(value)) value = (0, import_resolveVariableValue.resolveVariableValue)(key, value, resolveValues);
|
|
2854
|
+
else if ((0, import_resolveRem.isRemValue)(value)) value = (0, import_resolveRem.resolveRem)(value);
|
|
2855
|
+
}
|
|
2856
|
+
if (value != null) {
|
|
2857
|
+
if (key === "fontFamily" && typeof originalValue === "string") {
|
|
2858
|
+
if (originalValue in conf.fontsParsed) styleState.fontFamily = originalValue;
|
|
2859
|
+
}
|
|
2860
|
+
var expanded2 = noExpand || typeof value === "string" ? null : (0, import_expandStyle.expandStyle)(key, value, conf.settings.styleCompat || "web");
|
|
2861
|
+
if (expanded2) {
|
|
2862
|
+
var max = expanded2.length;
|
|
2863
|
+
for (var i1 = 0; i1 < max; i1++) {
|
|
2864
|
+
var [nkey2, nvalue1, noriginalValue] = expanded2[i1];
|
|
2865
|
+
emitMappedValue(styleState, nkey2, nvalue1, noriginalValue !== null && noriginalValue !== void 0 ? noriginalValue : originalValue, void 0, parentCondition, fallbackOriginal);
|
|
2866
|
+
}
|
|
2867
|
+
} else emitMappedValue(styleState, key, value, originalValue, void 0, parentCondition, fallbackOriginal);
|
|
2868
|
+
}
|
|
2869
|
+
};
|
|
2870
|
+
function resolveVariants(key, value, styleProps, styleState, parentVariantKey) {
|
|
2871
|
+
var _styleState_staticConfig_variants;
|
|
2872
|
+
var variantDefinition = (_styleState_staticConfig_variants = styleState.staticConfig.variants) === null || _styleState_staticConfig_variants === void 0 ? void 0 : _styleState_staticConfig_variants[key];
|
|
2873
|
+
if (isConditionTransport(value)) {
|
|
2874
|
+
if (value.hasBase) emitResolvedVariant(key, value.base, styleState, parentVariantKey, null);
|
|
2875
|
+
for (var offset = 0; offset < value.entries.length;) {
|
|
2876
|
+
var entryValue = value.entries[offset];
|
|
2877
|
+
var watermark = conditionCursorTop;
|
|
2878
|
+
try {
|
|
2879
|
+
emitResolvedVariant(key, entryValue, styleState, parentVariantKey, acquireTransportCursor(styleState, value.entries, offset, null));
|
|
2880
|
+
} finally {
|
|
2881
|
+
releaseConditionCursors(watermark);
|
|
2882
|
+
}
|
|
2883
|
+
offset += transportEntryWidth;
|
|
2884
|
+
}
|
|
2885
|
+
return;
|
|
2886
|
+
}
|
|
2887
|
+
if (typeof value === "string" && !(variantDefinition && (typeof variantDefinition === "undefined" ? "undefined" : _type_of(variantDefinition)) === "object" && value in variantDefinition)) {
|
|
2888
|
+
var directState = styleState;
|
|
2889
|
+
var watermark1 = conditionCursorTop;
|
|
2890
|
+
var previousCursor = directState.flatScanCursor;
|
|
2891
|
+
directState.flatScanCursor = null;
|
|
2892
|
+
try {
|
|
2893
|
+
(0, import_runtime.scanFlatValue)(value, variantValueHandler, [
|
|
2894
|
+
styleState,
|
|
2895
|
+
key,
|
|
2896
|
+
parentVariantKey
|
|
2897
|
+
]);
|
|
2898
|
+
} finally {
|
|
2899
|
+
directState.flatScanCursor = previousCursor;
|
|
2900
|
+
releaseConditionCursors(watermark1);
|
|
2901
|
+
}
|
|
2902
|
+
return;
|
|
2903
|
+
}
|
|
2904
|
+
var isObjectValue = value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value);
|
|
2905
|
+
var objectHasDefault = isObjectValue && Object.prototype.hasOwnProperty.call(value, "default");
|
|
2906
|
+
var objectWatermark = conditionCursorTop;
|
|
2907
|
+
try {
|
|
2908
|
+
var firstCursor = isObjectValue && !objectHasDefault ? acquireConditionCursor() : null;
|
|
2909
|
+
if (isObjectValue && classifyConditionalObject(value, styleState, void 0, firstCursor || void 0)) {
|
|
2910
|
+
var useFirstCursor = firstCursor !== null;
|
|
2911
|
+
for (var objKey in value) {
|
|
2912
|
+
var _directState_flatPass;
|
|
2913
|
+
var payload = value[objKey];
|
|
2914
|
+
if (payload == null) continue;
|
|
2915
|
+
var directState1 = styleState;
|
|
2916
|
+
var payloadString = String(payload);
|
|
2917
|
+
if (objKey === "default") {
|
|
2918
|
+
feedCompoundSegment(directState1, payloadString, 0, payloadString.length, true, true, "");
|
|
2919
|
+
emitResolvedVariant(key, payload, styleState, parentVariantKey, null);
|
|
2920
|
+
continue;
|
|
2921
|
+
}
|
|
2922
|
+
var watermark2 = conditionCursorTop;
|
|
2923
|
+
var cursor1 = useFirstCursor ? firstCursor : acquireConditionCursor();
|
|
2924
|
+
var condition = conditionNumbers[cursor1 + conditionValueOffset];
|
|
2925
|
+
if (useFirstCursor) useFirstCursor = false;
|
|
2926
|
+
else {
|
|
2927
|
+
resolveConditionText(styleState, cursor1, objKey);
|
|
2928
|
+
condition = commitConditionCursor(styleState, cursor1);
|
|
2929
|
+
}
|
|
2930
|
+
if ((_directState_flatPass = directState1.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passCompoundIndexes]) feedCompoundSegment(directState1, payloadString, 0, payloadString.length, false, Boolean(condition), condition ? conditionTexts[cursor1 + conditionKeyOffset] || "" : "");
|
|
2931
|
+
emitResolvedVariant(key, payload, styleState, parentVariantKey, cursor1);
|
|
2932
|
+
if (cursor1 !== firstCursor) releaseConditionCursors(watermark2);
|
|
2933
|
+
}
|
|
2934
|
+
return;
|
|
2935
|
+
}
|
|
2936
|
+
} finally {
|
|
2937
|
+
releaseConditionCursors(objectWatermark);
|
|
2938
|
+
}
|
|
2939
|
+
emitResolvedVariant(key, value, styleState, parentVariantKey, null);
|
|
2940
|
+
}
|
|
2941
|
+
function emitResolvedVariant(key, value, styleState, parentVariantKey, conditionCursor) {
|
|
2942
|
+
var { staticConfig, conf, debug } = styleState;
|
|
2943
|
+
var styleProps = styleState.styleProps;
|
|
2944
|
+
var { variants } = staticConfig;
|
|
2945
|
+
if (!variants) return;
|
|
2946
|
+
var variant = variants[key];
|
|
2947
|
+
var variantValue = getVariantDefinition(variant, value, conf, styleState);
|
|
2948
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
2949
|
+
console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`);
|
|
2950
|
+
console.info({
|
|
2951
|
+
key,
|
|
2952
|
+
value,
|
|
2953
|
+
variantValue,
|
|
2954
|
+
variants
|
|
2955
|
+
});
|
|
2956
|
+
console.groupEnd();
|
|
2957
|
+
}
|
|
2958
|
+
if (!variantValue) {
|
|
2959
|
+
if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1") {
|
|
2960
|
+
if (typeof value !== "boolean") {
|
|
2961
|
+
var name = styleState.styleProps.displayName || "[UnnamedComponent]";
|
|
2962
|
+
console.warn(`No variant found: ${name} has variant "${key}", but no matching value "${value}"`);
|
|
2963
|
+
}
|
|
2964
|
+
}
|
|
2965
|
+
return;
|
|
2966
|
+
}
|
|
2967
|
+
if (typeof variantValue === "function") {
|
|
2968
|
+
variantValue = variantValue(value, (0, import_getVariantExtras.getVariantExtras)(styleState));
|
|
2969
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && false);
|
|
2970
|
+
}
|
|
2971
|
+
if (!(0, import_isObj2.isObj)(variantValue)) return;
|
|
2972
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") console.info(` expanding styles from `, variantValue);
|
|
2973
|
+
var { noSkip } = styleProps;
|
|
2974
|
+
var originals = import_styleOriginalValues.styleOriginalValues.get(variantValue);
|
|
2975
|
+
var directState = styleState;
|
|
2976
|
+
directState.flatCompoundOutputDepth = (directState.flatCompoundOutputDepth || 0) + 1;
|
|
2977
|
+
try {
|
|
2978
|
+
for (var outputKey in variantValue) {
|
|
2979
|
+
if (!noSkip && outputKey in import_skipProps.skipProps) continue;
|
|
2980
|
+
var rawOutputValue = variantValue[outputKey];
|
|
2981
|
+
var outputValue = styleProps.noNormalize ? rawOutputValue : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(rawOutputValue, conf.shorthands[outputKey] || outputKey);
|
|
2982
|
+
var _originals_outputKey;
|
|
2983
|
+
var originalValue = (_originals_outputKey = originals === null || originals === void 0 ? void 0 : originals[outputKey]) !== null && _originals_outputKey !== void 0 ? _originals_outputKey : rawOutputValue;
|
|
2984
|
+
var contextPropSet = getContextPropSet(staticConfig);
|
|
2985
|
+
if (contextPropSet === null || contextPropSet === void 0 ? void 0 : contextPropSet.has(outputKey)) {
|
|
2986
|
+
var _styleState, _styleState1;
|
|
2987
|
+
(_styleState = styleState).overriddenContextProps || (_styleState.overriddenContextProps = {});
|
|
2988
|
+
styleState.overriddenContextProps[outputKey] = originalValue;
|
|
2989
|
+
(_styleState1 = styleState).originalContextPropValues || (_styleState1.originalContextPropValues = {});
|
|
2990
|
+
styleState.originalContextPropValues[outputKey] = originalValue;
|
|
2991
|
+
}
|
|
2992
|
+
contributeMappedValue(outputKey, outputValue, styleState, parentVariantKey === key && outputKey === key, conditionCursor || void 0, originalValue);
|
|
2993
|
+
}
|
|
2994
|
+
} finally {
|
|
2995
|
+
directState.flatCompoundOutputDepth--;
|
|
2996
|
+
}
|
|
2997
|
+
}
|
|
2998
|
+
function getFontFamilyFromNameOrVariable(input, conf) {
|
|
2999
|
+
if ((0, import_createVariable.isVariable)(input)) {
|
|
3000
|
+
var val = variableToFontNameCache.get(input);
|
|
3001
|
+
if (val) return val;
|
|
3002
|
+
for (var key in conf.fontsParsed) {
|
|
3003
|
+
var familyVariable = conf.fontsParsed[key].family;
|
|
3004
|
+
if ((0, import_createVariable.isVariable)(familyVariable)) {
|
|
3005
|
+
variableToFontNameCache.set(familyVariable, key);
|
|
3006
|
+
if (familyVariable === input) return key;
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
3009
|
+
} else if (typeof input === "string" && input in conf.fontsParsed) return input;
|
|
3010
|
+
}
|
|
3011
|
+
var variableToFontNameCache = /* @__PURE__ */ new WeakMap();
|
|
3012
|
+
function getVariantDefinition(variant, value, conf, param) {
|
|
3013
|
+
var { theme } = param;
|
|
3014
|
+
if (!variant) return;
|
|
3015
|
+
if (value === void 0) return;
|
|
3016
|
+
if (typeof variant === "function") return variant;
|
|
3017
|
+
if (Object.prototype.hasOwnProperty.call(variant, value)) return variant[value];
|
|
3018
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
3019
|
+
try {
|
|
3020
|
+
for (var _iterator2 = getCompiledVariantResolvers(variant)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
3021
|
+
var { key, parts } = _step2.value;
|
|
3022
|
+
var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
|
|
3023
|
+
try {
|
|
3024
|
+
for (var _iterator12 = parts[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
|
|
3025
|
+
var part3 = _step12.value;
|
|
3026
|
+
if (matchesVariantResolver(part3, value, conf, theme)) return variant[key];
|
|
3027
|
+
}
|
|
3028
|
+
} catch (err) {
|
|
3029
|
+
_didIteratorError12 = true;
|
|
3030
|
+
_iteratorError12 = err;
|
|
3031
|
+
} finally {
|
|
3032
|
+
try {
|
|
3033
|
+
if (!_iteratorNormalCompletion12 && _iterator12.return != null) _iterator12.return();
|
|
3034
|
+
} finally {
|
|
3035
|
+
if (_didIteratorError12) throw _iteratorError12;
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
} catch (err) {
|
|
3040
|
+
_didIteratorError2 = true;
|
|
3041
|
+
_iteratorError2 = err;
|
|
3042
|
+
} finally {
|
|
3043
|
+
try {
|
|
3044
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
3045
|
+
} finally {
|
|
3046
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
3049
|
+
}
|
|
3050
|
+
var variantResolverNameSet = new Set(import_types.variantResolverNames);
|
|
3051
|
+
var variantResolverCache = /* @__PURE__ */ new WeakMap();
|
|
3052
|
+
var preparedStyleStaticConfigs = /* @__PURE__ */ new WeakSet();
|
|
3053
|
+
function prepareStyleStaticConfig(staticConfig) {
|
|
3054
|
+
if (preparedStyleStaticConfigs.has(staticConfig)) return staticConfig;
|
|
3055
|
+
preparedStyleStaticConfigs.add(staticConfig);
|
|
3056
|
+
getContextPropSet(staticConfig);
|
|
3057
|
+
prepareStaticConfigCompounds(staticConfig);
|
|
3058
|
+
var variants = staticConfig.variants;
|
|
3059
|
+
if (variants) for (var key in variants) {
|
|
3060
|
+
var variant = variants[key];
|
|
3061
|
+
if (variant && (typeof variant === "undefined" ? "undefined" : _type_of(variant)) === "object") getCompiledVariantResolvers(variant);
|
|
3062
|
+
}
|
|
3063
|
+
return staticConfig;
|
|
3064
|
+
}
|
|
3065
|
+
function getCompiledVariantResolvers(variant) {
|
|
3066
|
+
var cached = variantResolverCache.get(variant);
|
|
3067
|
+
if (cached) return cached;
|
|
3068
|
+
var compiled = [];
|
|
3069
|
+
for (var key in variant) {
|
|
3070
|
+
var parts = parseVariantResolverKey(key);
|
|
3071
|
+
if (parts) compiled.push({
|
|
3072
|
+
key,
|
|
3073
|
+
parts
|
|
3074
|
+
});
|
|
3075
|
+
}
|
|
3076
|
+
variantResolverCache.set(variant, compiled);
|
|
3077
|
+
return compiled;
|
|
3078
|
+
}
|
|
3079
|
+
function parseVariantResolverKey(key) {
|
|
3080
|
+
if (!key) return null;
|
|
3081
|
+
var parts = [];
|
|
3082
|
+
var start = 0;
|
|
3083
|
+
for (var index = 0; index <= key.length; index++) {
|
|
3084
|
+
if (index !== key.length && key.charCodeAt(index) !== 124) continue;
|
|
3085
|
+
var partStart = start;
|
|
3086
|
+
var partEnd = index;
|
|
3087
|
+
while (partStart < partEnd && key.charCodeAt(partStart) <= 32) partStart++;
|
|
3088
|
+
while (partEnd > partStart && key.charCodeAt(partEnd - 1) <= 32) partEnd--;
|
|
3089
|
+
if (partStart === partEnd) return null;
|
|
3090
|
+
var part3 = key.slice(partStart, partEnd);
|
|
3091
|
+
if (!variantResolverNameSet.has(part3)) return null;
|
|
3092
|
+
parts.push(part3);
|
|
3093
|
+
start = index + 1;
|
|
3094
|
+
}
|
|
3095
|
+
return parts;
|
|
3096
|
+
}
|
|
3097
|
+
function hasNumericPrefix(value, suffixLength) {
|
|
3098
|
+
if (value.length <= suffixLength) return false;
|
|
3099
|
+
return Number.isFinite(Number(value.slice(0, value.length - suffixLength)));
|
|
3100
|
+
}
|
|
3101
|
+
function matchesVariantResolver(resolverName, value, conf, theme) {
|
|
3102
|
+
var string = typeof value === "string";
|
|
3103
|
+
var number = typeof value === "number";
|
|
3104
|
+
var rem = string && value.endsWith("rem") && hasNumericPrefix(value, 3);
|
|
3105
|
+
switch (resolverName) {
|
|
3106
|
+
case "Size":
|
|
3107
|
+
case "Space":
|
|
3108
|
+
case "Radius":
|
|
3109
|
+
case "ZIndex": return value === true || number || string || resolverName !== "Size" && (0, import_createVariable.isVariable)(value);
|
|
3110
|
+
case "Color": return value != null && value in conf.tokensParsed.color || string;
|
|
3111
|
+
case "Theme": return string && !!theme && value in theme;
|
|
3112
|
+
case "FontSize":
|
|
3113
|
+
var _conf_fontsParsed_body_size, _conf_fontsParsed_body;
|
|
3114
|
+
return value === true || !!((_conf_fontsParsed_body = conf.fontsParsed.body) === null || _conf_fontsParsed_body === void 0 ? void 0 : (_conf_fontsParsed_body_size = _conf_fontsParsed_body.size) === null || _conf_fontsParsed_body_size === void 0 ? void 0 : _conf_fontsParsed_body_size[value]) || number || rem;
|
|
3115
|
+
case "FontStyle":
|
|
3116
|
+
var _conf_fontsParsed_body_style, _conf_fontsParsed_body1;
|
|
3117
|
+
return !!((_conf_fontsParsed_body1 = conf.fontsParsed.body) === null || _conf_fontsParsed_body1 === void 0 ? void 0 : (_conf_fontsParsed_body_style = _conf_fontsParsed_body1.style) === null || _conf_fontsParsed_body_style === void 0 ? void 0 : _conf_fontsParsed_body_style[value]) || value === "normal" || value === "italic";
|
|
3118
|
+
case "FontTransform":
|
|
3119
|
+
var _conf_fontsParsed_body_transform, _conf_fontsParsed_body2;
|
|
3120
|
+
return !!((_conf_fontsParsed_body2 = conf.fontsParsed.body) === null || _conf_fontsParsed_body2 === void 0 ? void 0 : (_conf_fontsParsed_body_transform = _conf_fontsParsed_body2.transform) === null || _conf_fontsParsed_body_transform === void 0 ? void 0 : _conf_fontsParsed_body_transform[value]) || value === "none" || value === "capitalize" || value === "uppercase" || value === "lowercase";
|
|
3121
|
+
case "FontLineHeight":
|
|
3122
|
+
var _conf_fontsParsed_body_lineHeight, _conf_fontsParsed_body3;
|
|
3123
|
+
return !!((_conf_fontsParsed_body3 = conf.fontsParsed.body) === null || _conf_fontsParsed_body3 === void 0 ? void 0 : (_conf_fontsParsed_body_lineHeight = _conf_fontsParsed_body3.lineHeight) === null || _conf_fontsParsed_body_lineHeight === void 0 ? void 0 : _conf_fontsParsed_body_lineHeight[value]) || number || rem;
|
|
3124
|
+
case "FontLetterSpacing":
|
|
3125
|
+
var _conf_fontsParsed_body_letterSpacing, _conf_fontsParsed_body4;
|
|
3126
|
+
return !!((_conf_fontsParsed_body4 = conf.fontsParsed.body) === null || _conf_fontsParsed_body4 === void 0 ? void 0 : (_conf_fontsParsed_body_letterSpacing = _conf_fontsParsed_body4.letterSpacing) === null || _conf_fontsParsed_body_letterSpacing === void 0 ? void 0 : _conf_fontsParsed_body_letterSpacing[value]) || number || rem;
|
|
3127
|
+
case "number":
|
|
3128
|
+
case "string":
|
|
3129
|
+
case "boolean": return (typeof value === "undefined" ? "undefined" : _type_of(value)) === resolverName;
|
|
3130
|
+
case "any": return true;
|
|
991
3131
|
}
|
|
992
|
-
if (import_constants.isWeb && Array.isArray(out.transform)) out.transform = (0, import_transformsToString.transformsToString)(out.transform);
|
|
993
|
-
(0, import_expandStyles.fixStyles)(out);
|
|
994
|
-
return out;
|
|
995
3132
|
}
|