@tamagui/web 3.0.17 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Tamagui.cjs +2 -1
- package/dist/cjs/Tamagui.native.cjs +2 -1
- package/dist/cjs/Tamagui.native.js +2 -1
- package/dist/cjs/Tamagui.native.js.map +1 -1
- package/dist/cjs/_withStableStyle.cjs +2 -1
- package/dist/cjs/_withStableStyle.native.cjs +2 -1
- package/dist/cjs/_withStableStyle.native.js +2 -1
- package/dist/cjs/_withStableStyle.native.js.map +1 -1
- package/dist/cjs/config.cjs +8 -7
- package/dist/cjs/config.native.cjs +8 -7
- package/dist/cjs/config.native.js +8 -7
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/constants/constants.cjs +2 -1
- package/dist/cjs/constants/constants.native.cjs +2 -1
- package/dist/cjs/constants/constants.native.js +2 -1
- package/dist/cjs/constants/constants.native.js.map +1 -1
- package/dist/cjs/constants/isDevTools.cjs +2 -1
- package/dist/cjs/constants/isDevTools.native.cjs +2 -1
- package/dist/cjs/constants/isDevTools.native.js +2 -1
- package/dist/cjs/constants/isDevTools.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +40 -39
- package/dist/cjs/createComponent.native.cjs +39 -38
- package/dist/cjs/createComponent.native.js +39 -38
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createTamagui.cjs +2 -1
- package/dist/cjs/createTamagui.native.cjs +2 -1
- package/dist/cjs/createTamagui.native.js +2 -1
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/createTokens.cjs +2 -1
- package/dist/cjs/createTokens.native.cjs +2 -1
- package/dist/cjs/createTokens.native.js +2 -1
- package/dist/cjs/createTokens.native.js.map +1 -1
- package/dist/cjs/createVariable.cjs +2 -1
- package/dist/cjs/createVariable.native.cjs +2 -1
- package/dist/cjs/createVariable.native.js +2 -1
- package/dist/cjs/createVariable.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +3 -2
- package/dist/cjs/helpers/createDesignSystem.native.cjs +2 -1
- package/dist/cjs/helpers/createDesignSystem.native.js +2 -1
- package/dist/cjs/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/cjs/helpers/formatDiagnostic.cjs +2 -1
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +2 -1
- package/dist/cjs/helpers/formatDiagnostic.native.js +2 -1
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +37 -36
- package/dist/cjs/helpers/getSplitStyles.native.cjs +40 -39
- package/dist/cjs/helpers/getSplitStyles.native.js +40 -39
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.cjs +4 -3
- package/dist/cjs/helpers/insertStyleRule.cjs +4 -3
- package/dist/cjs/helpers/insertStyleRule.native.cjs +4 -3
- package/dist/cjs/helpers/insertStyleRule.native.js +4 -3
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/log.cjs +2 -1
- package/dist/cjs/helpers/log.native.cjs +2 -1
- package/dist/cjs/helpers/log.native.js +2 -1
- package/dist/cjs/helpers/log.native.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.native.cjs +3 -2
- package/dist/cjs/helpers/matchMedia.native.js +3 -2
- package/dist/cjs/helpers/matchMedia.native.js.map +1 -1
- package/dist/cjs/helpers/noteOnce.cjs +2 -1
- package/dist/cjs/helpers/noteOnce.native.cjs +2 -1
- package/dist/cjs/helpers/noteOnce.native.js +2 -1
- package/dist/cjs/helpers/noteOnce.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSafeAreaVariable.native.cjs +2 -1
- package/dist/cjs/helpers/resolveSafeAreaVariable.native.js +2 -1
- package/dist/cjs/helpers/resolveSafeAreaVariable.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSizing.cjs +2 -1
- package/dist/cjs/helpers/resolveSizing.native.cjs +2 -1
- package/dist/cjs/helpers/resolveSizing.native.js +2 -1
- package/dist/cjs/helpers/resolveSizing.native.js.map +1 -1
- package/dist/cjs/helpers/skipProps.cjs +3 -2
- package/dist/cjs/helpers/skipProps.native.cjs +3 -2
- package/dist/cjs/helpers/skipProps.native.js +3 -2
- package/dist/cjs/helpers/skipProps.native.js.map +1 -1
- package/dist/cjs/helpers/styledDynamic.cjs +2 -1
- package/dist/cjs/helpers/styledDynamic.native.cjs +2 -1
- package/dist/cjs/helpers/styledDynamic.native.js +2 -1
- package/dist/cjs/helpers/styledDynamic.native.js.map +1 -1
- package/dist/cjs/helpers/subscribeToContextGroup.cjs +2 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.cjs +2 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.js +2 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/cjs/helpers/variableValue.cjs +2 -1
- package/dist/cjs/helpers/variableValue.native.cjs +2 -1
- package/dist/cjs/helpers/variableValue.native.js +2 -1
- package/dist/cjs/helpers/variableValue.native.js.map +1 -1
- package/dist/cjs/helpers/variables.cjs +5 -4
- package/dist/cjs/helpers/variables.native.cjs +5 -4
- package/dist/cjs/helpers/variables.native.js +5 -4
- package/dist/cjs/helpers/variables.native.js.map +1 -1
- package/dist/cjs/helpers/warnOnce.cjs +4 -3
- package/dist/cjs/helpers/warnOnce.native.cjs +4 -3
- package/dist/cjs/helpers/warnOnce.native.js +4 -3
- package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
- package/dist/cjs/hooks/getThemeProxied.cjs +2 -1
- package/dist/cjs/hooks/getThemeProxied.native.cjs +5 -4
- package/dist/cjs/hooks/getThemeProxied.native.js +5 -4
- package/dist/cjs/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/cjs/hooks/useAnimationDriver.cjs +3 -2
- package/dist/cjs/hooks/useAnimationDriver.native.cjs +3 -2
- package/dist/cjs/hooks/useAnimationDriver.native.js +3 -2
- package/dist/cjs/hooks/useAnimationDriver.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +3 -2
- package/dist/cjs/hooks/useMedia.native.cjs +3 -2
- package/dist/cjs/hooks/useMedia.native.js +3 -2
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useTheme.cjs +2 -1
- package/dist/cjs/hooks/useTheme.native.cjs +2 -1
- package/dist/cjs/hooks/useTheme.native.js +2 -1
- package/dist/cjs/hooks/useTheme.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +2 -1
- package/dist/cjs/hooks/useThemeState.native.cjs +2 -1
- package/dist/cjs/hooks/useThemeState.native.js +2 -1
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/style.cjs +2 -1
- package/dist/cjs/style.native.cjs +2 -1
- package/dist/cjs/style.native.js +2 -1
- package/dist/cjs/style.native.js.map +1 -1
- package/dist/cjs/styled.cjs +3 -2
- package/dist/cjs/styled.native.cjs +2 -1
- package/dist/cjs/styled.native.js +2 -1
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.cjs +2 -1
- package/dist/cjs/views/TamaguiProvider.native.cjs +2 -1
- package/dist/cjs/views/TamaguiProvider.native.js +2 -1
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +5 -4
- package/dist/cjs/views/Theme.native.cjs +5 -4
- package/dist/cjs/views/Theme.native.js +5 -4
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.cjs +3 -2
- package/dist/esm/Tamagui.mjs +2 -1
- package/dist/esm/Tamagui.mjs.map +1 -1
- package/dist/esm/Tamagui.native.js +2 -1
- package/dist/esm/Tamagui.native.js.map +1 -1
- package/dist/esm/_withStableStyle.mjs +2 -1
- package/dist/esm/_withStableStyle.mjs.map +1 -1
- package/dist/esm/_withStableStyle.native.js +2 -1
- package/dist/esm/_withStableStyle.native.js.map +1 -1
- package/dist/esm/config.mjs +8 -7
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +8 -7
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/constants/constants.mjs +2 -1
- package/dist/esm/constants/constants.mjs.map +1 -1
- package/dist/esm/constants/constants.native.js +2 -1
- package/dist/esm/constants/constants.native.js.map +1 -1
- package/dist/esm/constants/isDevTools.mjs +2 -1
- package/dist/esm/constants/isDevTools.mjs.map +1 -1
- package/dist/esm/constants/isDevTools.native.js +2 -1
- package/dist/esm/constants/isDevTools.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +40 -39
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +39 -38
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createTamagui.mjs +2 -1
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +2 -1
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/createTokens.mjs +2 -1
- package/dist/esm/createTokens.mjs.map +1 -1
- package/dist/esm/createTokens.native.js +2 -1
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/createVariable.mjs +2 -1
- package/dist/esm/createVariable.mjs.map +1 -1
- package/dist/esm/createVariable.native.js +2 -1
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +3 -2
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createDesignSystem.native.js +2 -1
- package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.mjs +2 -1
- package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.native.js +2 -1
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +37 -36
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +40 -39
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +4 -3
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +4 -3
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +4 -3
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/log.mjs +2 -1
- package/dist/esm/helpers/log.mjs.map +1 -1
- package/dist/esm/helpers/log.native.js +2 -1
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/matchMedia.native.js +3 -2
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/noteOnce.mjs +2 -1
- package/dist/esm/helpers/noteOnce.mjs.map +1 -1
- package/dist/esm/helpers/noteOnce.native.js +2 -1
- package/dist/esm/helpers/noteOnce.native.js.map +1 -1
- package/dist/esm/helpers/resolveSafeAreaVariable.native.js +2 -1
- package/dist/esm/helpers/resolveSafeAreaVariable.native.js.map +1 -1
- package/dist/esm/helpers/resolveSizing.mjs +2 -1
- package/dist/esm/helpers/resolveSizing.mjs.map +1 -1
- package/dist/esm/helpers/resolveSizing.native.js +2 -1
- package/dist/esm/helpers/resolveSizing.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +3 -2
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +3 -2
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/styledDynamic.mjs +2 -1
- package/dist/esm/helpers/styledDynamic.mjs.map +1 -1
- package/dist/esm/helpers/styledDynamic.native.js +2 -1
- package/dist/esm/helpers/styledDynamic.native.js.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.mjs +2 -1
- package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js +2 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/esm/helpers/variableValue.mjs +2 -1
- package/dist/esm/helpers/variableValue.mjs.map +1 -1
- package/dist/esm/helpers/variableValue.native.js +2 -1
- package/dist/esm/helpers/variableValue.native.js.map +1 -1
- package/dist/esm/helpers/variables.mjs +5 -4
- package/dist/esm/helpers/variables.mjs.map +1 -1
- package/dist/esm/helpers/variables.native.js +5 -4
- package/dist/esm/helpers/variables.native.js.map +1 -1
- package/dist/esm/helpers/warnOnce.mjs +4 -3
- package/dist/esm/helpers/warnOnce.mjs.map +1 -1
- package/dist/esm/helpers/warnOnce.native.js +4 -3
- package/dist/esm/helpers/warnOnce.native.js.map +1 -1
- package/dist/esm/hooks/getThemeProxied.mjs +2 -1
- package/dist/esm/hooks/getThemeProxied.mjs.map +1 -1
- package/dist/esm/hooks/getThemeProxied.native.js +5 -4
- package/dist/esm/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.mjs +3 -2
- package/dist/esm/hooks/useAnimationDriver.mjs.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.native.js +3 -2
- package/dist/esm/hooks/useAnimationDriver.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +3 -2
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +3 -2
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useTheme.mjs +2 -1
- package/dist/esm/hooks/useTheme.mjs.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +2 -1
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +2 -1
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +2 -1
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/style.mjs +2 -1
- package/dist/esm/style.mjs.map +1 -1
- package/dist/esm/style.native.js +2 -1
- package/dist/esm/style.native.js.map +1 -1
- package/dist/esm/styled.mjs +3 -2
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +2 -1
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.mjs +2 -1
- package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +2 -1
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs +5 -4
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +5 -4
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +3 -2
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/package.json +20 -20
- package/src/Tamagui.ts +3 -1
- package/src/_withStableStyle.tsx +3 -1
- package/src/config.ts +9 -6
- package/src/constants/constants.ts +3 -1
- package/src/constants/isDevTools.ts +2 -1
- package/src/createComponent.tsx +55 -37
- package/src/createTamagui.ts +3 -1
- package/src/createTokens.ts +3 -1
- package/src/createVariable.ts +3 -1
- package/src/helpers/createDesignSystem.ts +4 -2
- package/src/helpers/formatDiagnostic.ts +2 -1
- package/src/helpers/getSplitStyles.tsx +56 -29
- package/src/helpers/getThemeCSSRules.ts +5 -3
- package/src/helpers/insertStyleRule.tsx +5 -3
- package/src/helpers/log.ts +3 -1
- package/src/helpers/matchMedia.native.ts +4 -2
- package/src/helpers/noteOnce.ts +2 -1
- package/src/helpers/resolveSafeAreaVariable.native.ts +3 -1
- package/src/helpers/resolveSizing.ts +3 -1
- package/src/helpers/skipProps.ts +4 -2
- package/src/helpers/styledDynamic.ts +3 -1
- package/src/helpers/subscribeToContextGroup.tsx +3 -1
- package/src/helpers/variableValue.ts +3 -1
- package/src/helpers/variables.ts +6 -4
- package/src/helpers/warnOnce.ts +4 -3
- package/src/hooks/getThemeProxied.ts +14 -4
- package/src/hooks/useAnimationDriver.ts +4 -2
- package/src/hooks/useMedia.tsx +4 -2
- package/src/hooks/useTheme.tsx +3 -1
- package/src/hooks/useThemeState.ts +3 -1
- package/src/index.ts +1 -0
- package/src/style.ts +3 -1
- package/src/styled.tsx +14 -26
- package/src/views/TamaguiProvider.tsx +4 -1
- package/src/views/Theme.tsx +6 -4
- package/src/views/ThemeDebug.tsx +8 -2
- package/types/Tamagui.d.ts.map +1 -1
- package/types/_withStableStyle.d.ts.map +1 -1
- package/types/config.d.ts.map +1 -1
- package/types/constants/constants.d.ts.map +1 -1
- package/types/constants/isDevTools.d.ts.map +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/createTokens.d.ts.map +1 -1
- package/types/createVariable.d.ts.map +1 -1
- package/types/helpers/createDesignSystem.d.ts.map +1 -1
- package/types/helpers/formatDiagnostic.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/log.d.ts.map +1 -1
- package/types/helpers/matchMedia.native.d.ts.map +1 -1
- package/types/helpers/noteOnce.d.ts.map +1 -1
- package/types/helpers/resolveSafeAreaVariable.native.d.ts.map +1 -1
- package/types/helpers/resolveSizing.d.ts.map +1 -1
- package/types/helpers/skipProps.d.ts.map +1 -1
- package/types/helpers/styledDynamic.d.ts.map +1 -1
- package/types/helpers/subscribeToContextGroup.d.ts.map +1 -1
- package/types/helpers/variableValue.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/hooks/getThemeProxied.d.ts.map +1 -1
- package/types/hooks/useAnimationDriver.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/style.d.ts.map +1 -1
- package/types/styled.d.ts +1 -2
- package/types/styled.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeDebug.d.ts.map +1 -1
package/dist/cjs/styled.cjs
CHANGED
|
@@ -32,6 +32,7 @@ var import_resolveVariantStyle = require("./helpers/resolveVariantStyle.cjs");
|
|
|
32
32
|
var import_styledDynamic = require("./helpers/styledDynamic.cjs");
|
|
33
33
|
var import_warnOnce = require("./helpers/warnOnce.cjs");
|
|
34
34
|
require("./setupReactNative.cjs");
|
|
35
|
+
const isProd = process.env.NODE_ENV === "production";
|
|
35
36
|
function styledFn(...args) {
|
|
36
37
|
return styledImpl(void 0, ...args);
|
|
37
38
|
}
|
|
@@ -46,10 +47,10 @@ function styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptio
|
|
|
46
47
|
const config = hasBaseClassName ? maybeConfig : configOrOptions;
|
|
47
48
|
const options = optionsIn;
|
|
48
49
|
const displayName = options?.displayName;
|
|
49
|
-
if (!ComponentIn) throw new Error(process.env.NODE_ENV === "development" ? "No component given to styled()" : "❌ Error 006");
|
|
50
|
+
if (!ComponentIn) throw new Error(!isProd && process.env.NODE_ENV === "development" ? "No component given to styled()" : "❌ Error 006");
|
|
50
51
|
const parentStaticConfig = ComponentIn["staticConfig"];
|
|
51
52
|
const requestedReactNativeInterop = Boolean(config?.isReactNative || parentStaticConfig?.isReactNative);
|
|
52
|
-
if (process.env.NODE_ENV === "development" && requestedReactNativeInterop) (0, import_warnOnce.warnOnce)("isReactNative-web-removed", "The isReactNative styled-component option is native-only in Tamagui v3. React Native Web hosts on web are no longer adapted; use a component that accepts className, data-* attributes, and DOM events.");
|
|
53
|
+
if (!isProd && process.env.NODE_ENV === "development" && requestedReactNativeInterop) (0, import_warnOnce.warnOnce)("isReactNative-web-removed", "The isReactNative styled-component option is native-only in Tamagui v3. React Native Web hosts on web are no longer adapted; use a component that accepts className, data-* attributes, and DOM events.");
|
|
53
54
|
const isReactNative = false;
|
|
54
55
|
const isPlainStyledComponent = !!parentStaticConfig && !parentStaticConfig.isHOC;
|
|
55
56
|
let Component = parentStaticConfig?.isHOC && !parentStaticConfig?.isStyledHOC || isPlainStyledComponent ? ComponentIn : parentStaticConfig?.Component || ComponentIn;
|
|
@@ -34,6 +34,7 @@ var import_resolveVariantStyle = require("./helpers/resolveVariantStyle.native.j
|
|
|
34
34
|
var import_styledDynamic = require("./helpers/styledDynamic.native.js");
|
|
35
35
|
require("./helpers/warnOnce.native.js");
|
|
36
36
|
var import_setupReactNative = require("./setupReactNative.native.js");
|
|
37
|
+
var isProd = process.env.NODE_ENV === "production";
|
|
37
38
|
function styledFn() {
|
|
38
39
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
39
40
|
return styledImpl(void 0, ...args);
|
|
@@ -51,7 +52,7 @@ function styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptio
|
|
|
51
52
|
var config = hasBaseClassName ? maybeConfig : configOrOptions;
|
|
52
53
|
var options = optionsIn;
|
|
53
54
|
var displayName = options === null || options === void 0 ? void 0 : options.displayName;
|
|
54
|
-
if (!ComponentIn) throw new Error(process.env.NODE_ENV === "development" ? "No component given to styled()" : "❌ Error 006");
|
|
55
|
+
if (!ComponentIn) throw new Error(!isProd && process.env.NODE_ENV === "development" ? "No component given to styled()" : "❌ Error 006");
|
|
55
56
|
var parentStaticConfig = ComponentIn["staticConfig"];
|
|
56
57
|
Boolean((config === null || config === void 0 ? void 0 : config.isReactNative) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isReactNative));
|
|
57
58
|
var isReactNative = Boolean((config === null || config === void 0 ? void 0 : config.isReactNative) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isReactNative));
|
|
@@ -34,6 +34,7 @@ var import_resolveVariantStyle = require("./helpers/resolveVariantStyle.native.j
|
|
|
34
34
|
var import_styledDynamic = require("./helpers/styledDynamic.native.js");
|
|
35
35
|
require("./helpers/warnOnce.native.js");
|
|
36
36
|
var import_setupReactNative = require("./setupReactNative.native.js");
|
|
37
|
+
var isProd = process.env.NODE_ENV === "production";
|
|
37
38
|
function styledFn() {
|
|
38
39
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
39
40
|
return styledImpl(void 0, ...args);
|
|
@@ -51,7 +52,7 @@ function styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptio
|
|
|
51
52
|
var config = hasBaseClassName ? maybeConfig : configOrOptions;
|
|
52
53
|
var options = optionsIn;
|
|
53
54
|
var displayName = options === null || options === void 0 ? void 0 : options.displayName;
|
|
54
|
-
if (!ComponentIn) throw new Error(process.env.NODE_ENV === "development" ? "No component given to styled()" : "❌ Error 006");
|
|
55
|
+
if (!ComponentIn) throw new Error(!isProd && process.env.NODE_ENV === "development" ? "No component given to styled()" : "❌ Error 006");
|
|
55
56
|
var parentStaticConfig = ComponentIn["staticConfig"];
|
|
56
57
|
Boolean((config === null || config === void 0 ? void 0 : config.isReactNative) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isReactNative));
|
|
57
58
|
var isReactNative = Boolean((config === null || config === void 0 ? void 0 : config.isReactNative) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isReactNative));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.native.js","names":[],"sources":["cjs/styled.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar styled_exports = {};\n__export(styled_exports, {\n\tcreateFrontendStyled: () => createFrontendStyled,\n\tstyled: () => styled\n});\nmodule.exports = __toCommonJS(styled_exports);\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_createComponent = require(\"./createComponent\");\nvar import_componentDisplayName = require(\"./helpers/componentDisplayName\");\nvar import_mergeVariants = require(\"./helpers/mergeVariants\");\nvar import_resolveVariantStyle = require(\"./helpers/resolveVariantStyle\");\nvar import_styledDynamic = require(\"./helpers/styledDynamic\");\nrequire(\"./helpers/warnOnce\");\nvar import_setupReactNative = require(\"./setupReactNative\");\nfunction styledFn() {\n\tfor (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n\treturn styledImpl(void 0, ...args);\n}\nvar styled = Object.assign(styledFn, { dynamic: import_styledDynamic.styledDynamic });\nfunction createFrontendStyled(frontend) {\n\treturn function(ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig) {\n\t\treturn styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig);\n\t};\n}\nfunction styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig) {\n\tvar hasBaseClassName = typeof optionsOrBaseClassName === \"string\";\n\tvar baseClassName = hasBaseClassName ? optionsOrBaseClassName : void 0;\n\tvar optionsIn = hasBaseClassName ? configOrOptions : optionsOrBaseClassName;\n\tvar config = hasBaseClassName ? maybeConfig : configOrOptions;\n\tvar options = optionsIn;\n\tvar displayName = options === null || options === void 0 ? void 0 : options.displayName;\n\tif (!ComponentIn) throw new Error(process.env.NODE_ENV === \"development\" ? \"No component given to styled()\" : \"❌ Error 006\");\n\tvar parentStaticConfig = ComponentIn[\"staticConfig\"];\n\tBoolean((config === null || config === void 0 ? void 0 : config.isReactNative) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isReactNative));\n\tvar isReactNative = Boolean((config === null || config === void 0 ? void 0 : config.isReactNative) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isReactNative));\n\tvar isPlainStyledComponent = !!parentStaticConfig && !(isReactNative || parentStaticConfig.isHOC);\n\tvar Component = (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isHOC) && !(parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isStyledHOC) || isPlainStyledComponent ? ComponentIn : (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.Component) || ComponentIn;\n\tvar reactNativeConfig = !parentStaticConfig ? (0, import_setupReactNative.getReactNativeConfig)(Component) : void 0;\n\tvar resolvedIsReactNative = Boolean(reactNativeConfig || isReactNative);\n\tvar staticConfigProps = (function() {\n\t\tvar _ref;\n\t\tvar { variants, displayName: _displayName, defaultVariants, context, contextProps, ...defaultProps } = options || {};\n\t\tvar parentDefaultVariants;\n\t\tvar parentDefaultProps;\n\t\tvar mergedBaseClassName = (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.baseClassName) && baseClassName ? `${parentStaticConfig.baseClassName} ${baseClassName}` : baseClassName || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.baseClassName);\n\t\tif (parentStaticConfig) {\n\t\t\tif (!(parentStaticConfig.isHOC && !parentStaticConfig.isStyledHOC)) {\n\t\t\t\tvar pdp = parentStaticConfig.defaultProps;\n\t\t\t\tfor (var key2 in pdp) {\n\t\t\t\t\tvar val = pdp[key2];\n\t\t\t\t\tif (parentStaticConfig.defaultVariants) {\n\t\t\t\t\t\tif (key2 in parentStaticConfig.defaultVariants) {\n\t\t\t\t\t\t\tif (!defaultVariants || !(key2 in defaultVariants)) {\n\t\t\t\t\t\t\t\tparentDefaultVariants || (parentDefaultVariants = {});\n\t\t\t\t\t\t\t\tparentDefaultVariants[key2] = val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!(key2 in defaultProps) && (!defaultVariants || !(key2 in defaultVariants))) {\n\t\t\t\t\t\tparentDefaultProps || (parentDefaultProps = {});\n\t\t\t\t\t\tparentDefaultProps[key2] = pdp[key2];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (parentStaticConfig.variants) variants = (0, import_mergeVariants.mergeVariants)(parentStaticConfig.variants, variants);\n\t\t\t}\n\t\t}\n\t\tvar mergedContext = context || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.context);\n\t\tvar mergedContextProps = context ? contextProps : contextProps || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.contextProps);\n\t\tif (parentDefaultProps || defaultVariants || parentDefaultVariants) defaultProps = {\n\t\t\t...parentDefaultProps,\n\t\t\t...parentDefaultVariants,\n\t\t\t...defaultProps,\n\t\t\t...defaultVariants\n\t\t};\n\t\tvar isInput = Boolean((config === null || config === void 0 ? void 0 : config.isInput) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isInput));\n\t\tvar isText = Boolean((config === null || config === void 0 ? void 0 : config.isText) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isText));\n\t\tvar validStyles = (config === null || config === void 0 ? void 0 : config.validStyles) || ((config === null || config === void 0 ? void 0 : config.isInput) ? import_helpers.stylePropsInput : (config === null || config === void 0 ? void 0 : config.isText) ? import_helpers.stylePropsText : parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.validStyles);\n\t\tvar acceptsClassName = (_ref = config === null || config === void 0 ? void 0 : config.acceptsClassName) !== null && _ref !== void 0 ? _ref : isPlainStyledComponent || resolvedIsReactNative || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isHOC) && (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.acceptsClassName);\n\t\tvar conf = {\n\t\t\t...parentStaticConfig,\n\t\t\t...config,\n\t\t\t...!isPlainStyledComponent && { Component },\n\t\t\tvariants,\n\t\t\tbaseClassName: mergedBaseClassName,\n\t\t\tdefaultProps,\n\t\t\tdefaultVariants,\n\t\t\tisReactNative: resolvedIsReactNative,\n\t\t\tisText,\n\t\t\tisInput,\n\t\t\tvalidStyles,\n\t\t\tacceptsClassName,\n\t\t\tcontext: mergedContext,\n\t\t\tcontextProps: mergedContextProps,\n\t\t\t...reactNativeConfig,\n\t\t\tisStyledHOC: Boolean(parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isHOC),\n\t\t\tparentStaticConfig,\n\t\t\tdisplayName: displayName || ComponentIn[import_componentDisplayName.componentDisplayName],\n\t\t\t...frontend && { styleFrontend: frontend }\n\t\t};\n\t\tconf.variantStyleResolver = import_resolveVariantStyle.resolveVariantStyle;\n\t\tif (defaultProps[\"children\"] || !acceptsClassName || mergedContext) conf.neverFlatten = true;\n\t\treturn conf;\n\t})();\n\tvar component = (0, import_createComponent.createComponent)(staticConfigProps || {});\n\tfor (var key in ComponentIn) {\n\t\tif (key === \"propTypes\") continue;\n\t\tif (key in component) continue;\n\t\tcomponent[key] = ComponentIn[key];\n\t}\n\treturn component;\n}\n//# sourceMappingURL=styled.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YA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9B;CACA,OAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"styled.native.js","names":[],"sources":["cjs/styled.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar styled_exports = {};\n__export(styled_exports, {\n\tcreateFrontendStyled: () => createFrontendStyled,\n\tstyled: () => styled\n});\nmodule.exports = __toCommonJS(styled_exports);\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_createComponent = require(\"./createComponent\");\nvar import_componentDisplayName = require(\"./helpers/componentDisplayName\");\nvar import_mergeVariants = require(\"./helpers/mergeVariants\");\nvar import_resolveVariantStyle = require(\"./helpers/resolveVariantStyle\");\nvar import_styledDynamic = require(\"./helpers/styledDynamic\");\nrequire(\"./helpers/warnOnce\");\nvar import_setupReactNative = require(\"./setupReactNative\");\nvar isProd = process.env.NODE_ENV === \"production\";\nfunction styledFn() {\n\tfor (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n\treturn styledImpl(void 0, ...args);\n}\nvar styled = Object.assign(styledFn, { dynamic: import_styledDynamic.styledDynamic });\nfunction createFrontendStyled(frontend) {\n\treturn function(ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig) {\n\t\treturn styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig);\n\t};\n}\nfunction styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig) {\n\tvar hasBaseClassName = typeof optionsOrBaseClassName === \"string\";\n\tvar baseClassName = hasBaseClassName ? optionsOrBaseClassName : void 0;\n\tvar optionsIn = hasBaseClassName ? configOrOptions : optionsOrBaseClassName;\n\tvar config = hasBaseClassName ? maybeConfig : configOrOptions;\n\tvar options = optionsIn;\n\tvar displayName = options === null || options === void 0 ? void 0 : options.displayName;\n\tif (!ComponentIn) throw new Error(!isProd && process.env.NODE_ENV === \"development\" ? \"No component given to styled()\" : \"❌ Error 006\");\n\tvar parentStaticConfig = ComponentIn[\"staticConfig\"];\n\tBoolean((config === null || config === void 0 ? void 0 : config.isReactNative) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isReactNative));\n\tvar isReactNative = Boolean((config === null || config === void 0 ? void 0 : config.isReactNative) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isReactNative));\n\tvar isPlainStyledComponent = !!parentStaticConfig && !(isReactNative || parentStaticConfig.isHOC);\n\tvar Component = (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isHOC) && !(parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isStyledHOC) || isPlainStyledComponent ? ComponentIn : (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.Component) || ComponentIn;\n\tvar reactNativeConfig = !parentStaticConfig ? (0, import_setupReactNative.getReactNativeConfig)(Component) : void 0;\n\tvar resolvedIsReactNative = Boolean(reactNativeConfig || isReactNative);\n\tvar staticConfigProps = (function() {\n\t\tvar _ref;\n\t\tvar { variants, displayName: _displayName, defaultVariants, context, contextProps, ...defaultProps } = options || {};\n\t\tvar parentDefaultVariants;\n\t\tvar parentDefaultProps;\n\t\tvar mergedBaseClassName = (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.baseClassName) && baseClassName ? `${parentStaticConfig.baseClassName} ${baseClassName}` : baseClassName || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.baseClassName);\n\t\tif (parentStaticConfig) {\n\t\t\tif (!(parentStaticConfig.isHOC && !parentStaticConfig.isStyledHOC)) {\n\t\t\t\tvar pdp = parentStaticConfig.defaultProps;\n\t\t\t\tfor (var key2 in pdp) {\n\t\t\t\t\tvar val = pdp[key2];\n\t\t\t\t\tif (parentStaticConfig.defaultVariants) {\n\t\t\t\t\t\tif (key2 in parentStaticConfig.defaultVariants) {\n\t\t\t\t\t\t\tif (!defaultVariants || !(key2 in defaultVariants)) {\n\t\t\t\t\t\t\t\tparentDefaultVariants || (parentDefaultVariants = {});\n\t\t\t\t\t\t\t\tparentDefaultVariants[key2] = val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!(key2 in defaultProps) && (!defaultVariants || !(key2 in defaultVariants))) {\n\t\t\t\t\t\tparentDefaultProps || (parentDefaultProps = {});\n\t\t\t\t\t\tparentDefaultProps[key2] = pdp[key2];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (parentStaticConfig.variants) variants = (0, import_mergeVariants.mergeVariants)(parentStaticConfig.variants, variants);\n\t\t\t}\n\t\t}\n\t\tvar mergedContext = context || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.context);\n\t\tvar mergedContextProps = context ? contextProps : contextProps || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.contextProps);\n\t\tif (parentDefaultProps || defaultVariants || parentDefaultVariants) defaultProps = {\n\t\t\t...parentDefaultProps,\n\t\t\t...parentDefaultVariants,\n\t\t\t...defaultProps,\n\t\t\t...defaultVariants\n\t\t};\n\t\tvar isInput = Boolean((config === null || config === void 0 ? void 0 : config.isInput) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isInput));\n\t\tvar isText = Boolean((config === null || config === void 0 ? void 0 : config.isText) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isText));\n\t\tvar validStyles = (config === null || config === void 0 ? void 0 : config.validStyles) || ((config === null || config === void 0 ? void 0 : config.isInput) ? import_helpers.stylePropsInput : (config === null || config === void 0 ? void 0 : config.isText) ? import_helpers.stylePropsText : parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.validStyles);\n\t\tvar acceptsClassName = (_ref = config === null || config === void 0 ? void 0 : config.acceptsClassName) !== null && _ref !== void 0 ? _ref : isPlainStyledComponent || resolvedIsReactNative || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isHOC) && (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.acceptsClassName);\n\t\tvar conf = {\n\t\t\t...parentStaticConfig,\n\t\t\t...config,\n\t\t\t...!isPlainStyledComponent && { Component },\n\t\t\tvariants,\n\t\t\tbaseClassName: mergedBaseClassName,\n\t\t\tdefaultProps,\n\t\t\tdefaultVariants,\n\t\t\tisReactNative: resolvedIsReactNative,\n\t\t\tisText,\n\t\t\tisInput,\n\t\t\tvalidStyles,\n\t\t\tacceptsClassName,\n\t\t\tcontext: mergedContext,\n\t\t\tcontextProps: mergedContextProps,\n\t\t\t...reactNativeConfig,\n\t\t\tisStyledHOC: Boolean(parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isHOC),\n\t\t\tparentStaticConfig,\n\t\t\tdisplayName: displayName || ComponentIn[import_componentDisplayName.componentDisplayName],\n\t\t\t...frontend && { styleFrontend: frontend }\n\t\t};\n\t\tconf.variantStyleResolver = import_resolveVariantStyle.resolveVariantStyle;\n\t\tif (defaultProps[\"children\"] || !acceptsClassName || mergedContext) conf.neverFlatten = true;\n\t\treturn conf;\n\t})();\n\tvar component = (0, import_createComponent.createComponent)(staticConfigProps || {});\n\tfor (var key in ComponentIn) {\n\t\tif (key === \"propTypes\") continue;\n\t\tif (key in component) continue;\n\t\tcomponent[key] = ComponentIn[key];\n\t}\n\treturn component;\n}\n//# sourceMappingURL=styled.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;AACR;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,iBAAiB,CAAC;AACtB,SAAS,gBAAgB;CACxB,4BAA4B;CAC5B,cAAc;AACf,CAAC;AACD,OAAO,UAAU,aAAa,cAAc;AAC5C,IAAI,iBAAiB,QAAQ,kBAAkB;AAC/C,IAAI,yBAAyB,QAAQ,6BAAmB;AACxD,IAAI,8BAA8B,QAAQ,0CAAgC;AAC1E,IAAI,uBAAuB,QAAQ,mCAAyB;AAC5D,IAAI,6BAA6B,QAAQ,yCAA+B;AACxE,IAAI,uBAAuB,QAAQ,mCAAyB;AAC5D,QAAQ,8BAAoB;AAC5B,IAAI,0BAA0B,QAAQ,8BAAoB;AAC1D,IAAI,SAA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BAAuB,QAAQ,uBAAuB,KAAK,IAAI,KAAK,IAAI,mBAAmB,KAAK;GACrH;GACA,aAAa,eAAe,YAAY,4BAA4B;GACpE,GAAG,YAAY,EAAE,eAAe,SAAS;EAC1C;EACA,KAAK,uBAAuB,2BAA2B;EACvD,IAAI,aAAa,eAAe,CAAC,oBAAoB,eAAe,KAAK,eAAe;EACxF,OAAO;CACR,EAAC,CAAE;CACH,IAAI,aAAa,GAAG,uBAAuB,gBAAe,CAAE,qBAAqB,CAAC,CAAC;CACnF,KAAK,IAAI,OAAO,aAAa;EAC5B,IAAI,QAAQ,aAAa;EACzB,IAAI,OAAO,WAAW;EACtB,UAAU,OAAO,YAAY;CAC9B;CACA,OAAO;AACR"}
|
|
@@ -39,6 +39,7 @@ var import_SafeAreaTracker = require("./SafeAreaTracker.cjs");
|
|
|
39
39
|
var import_TamaguiRoot = require("./TamaguiRoot.cjs");
|
|
40
40
|
var import_ThemeProvider = require("./ThemeProvider.cjs");
|
|
41
41
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
+
const isProd = process.env.NODE_ENV === "production";
|
|
42
43
|
let _cachedFirstKey;
|
|
43
44
|
let _cachedConfig;
|
|
44
45
|
function firstThemeKey(config) {
|
|
@@ -89,7 +90,7 @@ function TamaguiProvider({ children, disableInjectCSS, config, className, defaul
|
|
|
89
90
|
href: "tamagui-css",
|
|
90
91
|
children: config.getCSS()
|
|
91
92
|
}, "tamagui-css"),
|
|
92
|
-
process.env.NODE_ENV !== "production" && config && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ConfigRevisionCheck.ConfigRevisionCheck, { config }),
|
|
93
|
+
!isProd && process.env.NODE_ENV !== "production" && config && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ConfigRevisionCheck.ConfigRevisionCheck, { config }),
|
|
93
94
|
(0, import_SafeAreaTracker.hasSafeAreaTracker)() && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SafeAreaTracker.SafeAreaTracker, {}),
|
|
94
95
|
contents
|
|
95
96
|
] });
|
|
@@ -41,6 +41,7 @@ require("./ConfigRevisionCheck.native.js");
|
|
|
41
41
|
var import_SafeAreaTracker = require("./SafeAreaTracker.native.js");
|
|
42
42
|
var import_TamaguiRoot = require("./TamaguiRoot.native.js");
|
|
43
43
|
var import_ThemeProvider = require("./ThemeProvider.native.js");
|
|
44
|
+
var isProd = process.env.NODE_ENV === "production";
|
|
44
45
|
var _cachedFirstKey;
|
|
45
46
|
var _cachedConfig;
|
|
46
47
|
function firstThemeKey(config) {
|
|
@@ -91,7 +92,7 @@ function TamaguiProvider(param) {
|
|
|
91
92
|
});
|
|
92
93
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
93
94
|
!process.env.TAMAGUI_DID_OUTPUT_CSS && false,
|
|
94
|
-
process.env.NODE_ENV !== "production" && false,
|
|
95
|
+
!isProd && process.env.NODE_ENV !== "production" && false,
|
|
95
96
|
(0, import_SafeAreaTracker.hasSafeAreaTracker)() && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SafeAreaTracker.SafeAreaTracker, {}),
|
|
96
97
|
contents
|
|
97
98
|
] });
|
|
@@ -41,6 +41,7 @@ require("./ConfigRevisionCheck.native.js");
|
|
|
41
41
|
var import_SafeAreaTracker = require("./SafeAreaTracker.native.js");
|
|
42
42
|
var import_TamaguiRoot = require("./TamaguiRoot.native.js");
|
|
43
43
|
var import_ThemeProvider = require("./ThemeProvider.native.js");
|
|
44
|
+
var isProd = process.env.NODE_ENV === "production";
|
|
44
45
|
var _cachedFirstKey;
|
|
45
46
|
var _cachedConfig;
|
|
46
47
|
function firstThemeKey(config) {
|
|
@@ -91,7 +92,7 @@ function TamaguiProvider(param) {
|
|
|
91
92
|
});
|
|
92
93
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
93
94
|
!process.env.TAMAGUI_DID_OUTPUT_CSS && false,
|
|
94
|
-
process.env.NODE_ENV !== "production" && false,
|
|
95
|
+
!isProd && process.env.NODE_ENV !== "production" && false,
|
|
95
96
|
(0, import_SafeAreaTracker.hasSafeAreaTracker)() && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SafeAreaTracker.SafeAreaTracker, {}),
|
|
96
97
|
contents
|
|
97
98
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TamaguiProvider.native.js","names":[],"sources":["cjs/views/TamaguiProvider.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar TamaguiProvider_exports = {};\n__export(TamaguiProvider_exports, { TamaguiProvider: () => TamaguiProvider });\nmodule.exports = __toCommonJS(TamaguiProvider_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_use_did_finish_ssr = require(\"@tamagui/use-did-finish-ssr\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_config = require(\"../config\");\nvar import_ComponentContext = require(\"../contexts/ComponentContext\");\nvar import_insertStyleRule = require(\"../helpers/insertStyleRule\");\nvar import_useMedia = require(\"../hooks/useMedia\");\nrequire(\"./ConfigRevisionCheck\");\nvar import_SafeAreaTracker = require(\"./SafeAreaTracker\");\nvar import_TamaguiRoot = require(\"./TamaguiRoot\");\nvar import_ThemeProvider = require(\"./ThemeProvider\");\nvar _cachedFirstKey;\nvar _cachedConfig;\nfunction firstThemeKey(config) {\n\tif (config !== _cachedConfig) {\n\t\t_cachedConfig = config;\n\t\t_cachedFirstKey = (config === null || config === void 0 ? void 0 : config.themes) ? Object.keys(config.themes)[0] : void 0;\n\t}\n\treturn _cachedFirstKey;\n}\nfunction TamaguiProvider(param) {\n\tvar { children, disableInjectCSS, config, className, defaultTheme: defaultThemeProp, insets, isSubtreeRoot } = param;\n\tvar defaultTheme = defaultThemeProp || firstThemeKey(config) || \"light\";\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\n\t\t(0, import_useMedia.updateMediaListeners)();\n\t\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS) return (0, import_insertStyleRule.stopAccumulatingRules)();\n\t}, []);\n\tvar memoizedInsets = import_react.default.useMemo(function() {\n\t\treturn insets;\n\t}, [\n\t\tinsets === null || insets === void 0 ? void 0 : insets.top,\n\t\tinsets === null || insets === void 0 ? void 0 : insets.right,\n\t\tinsets === null || insets === void 0 ? void 0 : insets.bottom,\n\t\tinsets === null || insets === void 0 ? void 0 : insets.left\n\t]);\n\tvar configuredAnimationDriver = config === null || config === void 0 ? void 0 : config.animations;\n\tvar defaultAnimationDriver = !configuredAnimationDriver || configuredAnimationDriver.isStub ? null : configuredAnimationDriver;\n\t(0, import_react.useEffect)(function() {\n\t\tvar _defaultAnimationDriver_onMount;\n\t\tdefaultAnimationDriver === null || defaultAnimationDriver === void 0 || (_defaultAnimationDriver_onMount = defaultAnimationDriver.onMount) == null || _defaultAnimationDriver_onMount.call(defaultAnimationDriver);\n\t}, []);\n\tvar contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, {\n\t\tanimationDriver: defaultAnimationDriver,\n\t\tinsets: memoizedInsets,\n\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeProvider.ThemeProvider, {\n\t\t\tdefaultTheme,\n\t\t\tclassName,\n\t\t\tisSubtreeRoot,\n\t\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TamaguiRoot.TamaguiRoot, {\n\t\t\t\ttheme: defaultTheme,\n\t\t\t\tisRootRoot: true,\n\t\t\t\tchildren\n\t\t\t})\n\t\t})\n\t});\n\tif ((0, import_config.getSetting)(\"disableSSR\")) contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_use_did_finish_ssr.ClientOnly, {\n\t\tenabled: true,\n\t\tchildren: contents\n\t});\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [\n\t\t!process.env.TAMAGUI_DID_OUTPUT_CSS && false,\n\t\
|
|
1
|
+
{"version":3,"file":"TamaguiProvider.native.js","names":[],"sources":["cjs/views/TamaguiProvider.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar TamaguiProvider_exports = {};\n__export(TamaguiProvider_exports, { TamaguiProvider: () => TamaguiProvider });\nmodule.exports = __toCommonJS(TamaguiProvider_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_use_did_finish_ssr = require(\"@tamagui/use-did-finish-ssr\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_config = require(\"../config\");\nvar import_ComponentContext = require(\"../contexts/ComponentContext\");\nvar import_insertStyleRule = require(\"../helpers/insertStyleRule\");\nvar import_useMedia = require(\"../hooks/useMedia\");\nrequire(\"./ConfigRevisionCheck\");\nvar import_SafeAreaTracker = require(\"./SafeAreaTracker\");\nvar import_TamaguiRoot = require(\"./TamaguiRoot\");\nvar import_ThemeProvider = require(\"./ThemeProvider\");\nvar isProd = process.env.NODE_ENV === \"production\";\nvar _cachedFirstKey;\nvar _cachedConfig;\nfunction firstThemeKey(config) {\n\tif (config !== _cachedConfig) {\n\t\t_cachedConfig = config;\n\t\t_cachedFirstKey = (config === null || config === void 0 ? void 0 : config.themes) ? Object.keys(config.themes)[0] : void 0;\n\t}\n\treturn _cachedFirstKey;\n}\nfunction TamaguiProvider(param) {\n\tvar { children, disableInjectCSS, config, className, defaultTheme: defaultThemeProp, insets, isSubtreeRoot } = param;\n\tvar defaultTheme = defaultThemeProp || firstThemeKey(config) || \"light\";\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\n\t\t(0, import_useMedia.updateMediaListeners)();\n\t\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS) return (0, import_insertStyleRule.stopAccumulatingRules)();\n\t}, []);\n\tvar memoizedInsets = import_react.default.useMemo(function() {\n\t\treturn insets;\n\t}, [\n\t\tinsets === null || insets === void 0 ? void 0 : insets.top,\n\t\tinsets === null || insets === void 0 ? void 0 : insets.right,\n\t\tinsets === null || insets === void 0 ? void 0 : insets.bottom,\n\t\tinsets === null || insets === void 0 ? void 0 : insets.left\n\t]);\n\tvar configuredAnimationDriver = config === null || config === void 0 ? void 0 : config.animations;\n\tvar defaultAnimationDriver = !configuredAnimationDriver || configuredAnimationDriver.isStub ? null : configuredAnimationDriver;\n\t(0, import_react.useEffect)(function() {\n\t\tvar _defaultAnimationDriver_onMount;\n\t\tdefaultAnimationDriver === null || defaultAnimationDriver === void 0 || (_defaultAnimationDriver_onMount = defaultAnimationDriver.onMount) == null || _defaultAnimationDriver_onMount.call(defaultAnimationDriver);\n\t}, []);\n\tvar contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, {\n\t\tanimationDriver: defaultAnimationDriver,\n\t\tinsets: memoizedInsets,\n\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeProvider.ThemeProvider, {\n\t\t\tdefaultTheme,\n\t\t\tclassName,\n\t\t\tisSubtreeRoot,\n\t\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TamaguiRoot.TamaguiRoot, {\n\t\t\t\ttheme: defaultTheme,\n\t\t\t\tisRootRoot: true,\n\t\t\t\tchildren\n\t\t\t})\n\t\t})\n\t});\n\tif ((0, import_config.getSetting)(\"disableSSR\")) contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_use_did_finish_ssr.ClientOnly, {\n\t\tenabled: true,\n\t\tchildren: contents\n\t});\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [\n\t\t!process.env.TAMAGUI_DID_OUTPUT_CSS && false,\n\t\t!isProd && process.env.NODE_ENV !== \"production\" && false,\n\t\t(0, import_SafeAreaTracker.hasSafeAreaTracker)() && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SafeAreaTracker.SafeAreaTracker, {}),\n\t\tcontents\n\t] });\n}\n//# sourceMappingURL=TamaguiProvider.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;AACR;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKpG,cAAc,CAAC,OAAO,CAAC,IAAI,a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C,CAAC,UAAU,QAAQ,IAAI,aAAa,gBAAgB;GACnD,GAAG,uBAAuB,mBAAkB,CAAE,KAAqB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,uBAAuB,iBAAiB,CAAC,CAAC;EAC1I;CACD,EAAE,CAAC;AACJ"}
|
package/dist/cjs/views/Theme.cjs
CHANGED
|
@@ -36,10 +36,11 @@ var import_useTheme = require("../hooks/useTheme.cjs");
|
|
|
36
36
|
var import_useThemeState = require("../hooks/useThemeState.cjs");
|
|
37
37
|
var import_ThemeDebug = require("./ThemeDebug.cjs");
|
|
38
38
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
const isProd = process.env.NODE_ENV === "production";
|
|
39
40
|
const Theme = (0, import_compose_refs.createRefComponent)(function Theme2(props, ref) {
|
|
40
41
|
"use no memo";
|
|
41
42
|
if (props.disable) return props.children;
|
|
42
|
-
if (process.env.NODE_ENV === "development") {
|
|
43
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
43
44
|
for (const key in props) if (!import_helpers.reservedThemeProps[key] && key !== "srcloc" && !key.startsWith("data-")) (0, import_warnOnce.warnOnce)(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
|
|
44
45
|
}
|
|
45
46
|
const { passThrough } = props;
|
|
@@ -60,7 +61,7 @@ function getThemedChildren(themeState, children, props, isRoot = false, stateRef
|
|
|
60
61
|
const { shallow, forceClassName } = props;
|
|
61
62
|
const state = stateRef.current;
|
|
62
63
|
let shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || (0, import_useThemeState.hasThemeUpdatingProps)(props);
|
|
63
|
-
if (process.env.NODE_ENV === "development" && props.debug === "visualize") children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
|
|
64
|
+
if (!isProd && process.env.NODE_ENV === "development" && props.debug === "visualize") children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
|
|
64
65
|
themeState,
|
|
65
66
|
themeProps: props,
|
|
66
67
|
children
|
|
@@ -77,7 +78,7 @@ function getThemedChildren(themeState, children, props, isRoot = false, stateRef
|
|
|
77
78
|
if (requiresExtraWrapper || isFirstThemedRender && (themeState.name === "dark" || themeState.name === "light")) state.hasEverThemed = "wrapped";
|
|
78
79
|
if (shallow) if (!themeState.parentId) {} else {
|
|
79
80
|
const parentState = (0, import_useThemeState.getThemeState)(themeState.isNew ? themeState.id : themeState.parentId);
|
|
80
|
-
if (!parentState) throw new Error(process.env.NODE_ENV !== "production" ? (0, import_formatDiagnostic.formatDiagnostic)("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
|
|
81
|
+
if (!parentState) throw new Error(!isProd && process.env.NODE_ENV !== "production" ? (0, import_formatDiagnostic.formatDiagnostic)("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
|
|
81
82
|
name: themeState.name,
|
|
82
83
|
parentId: themeState.parentId
|
|
83
84
|
}) : "❌ Error 014");
|
|
@@ -88,7 +89,7 @@ function getThemedChildren(themeState, children, props, isRoot = false, stateRef
|
|
|
88
89
|
})) : child;
|
|
89
90
|
});
|
|
90
91
|
}
|
|
91
|
-
if (process.env.NODE_ENV === "development") {
|
|
92
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
92
93
|
if (!passThrough && props.debug) console.warn(` getThemedChildren`, {
|
|
93
94
|
requiresExtraWrapper,
|
|
94
95
|
forceClassName,
|
|
@@ -44,10 +44,11 @@ var import_warnOnce = require("../helpers/warnOnce.native.js");
|
|
|
44
44
|
var import_useTheme = require("../hooks/useTheme.native.js");
|
|
45
45
|
var import_useThemeState = require("../hooks/useThemeState.native.js");
|
|
46
46
|
var import_ThemeDebug = require("./ThemeDebug.native.js");
|
|
47
|
+
var isProd = process.env.NODE_ENV === "production";
|
|
47
48
|
var Theme = (0, import_compose_refs.createRefComponent)(function Theme2(props, ref) {
|
|
48
49
|
"use no memo";
|
|
49
50
|
if (props.disable) return props.children;
|
|
50
|
-
if (process.env.NODE_ENV === "development") {
|
|
51
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
51
52
|
for (var key in props) if (!import_helpers.reservedThemeProps[key] && key !== "srcloc" && !key.startsWith("data-")) (0, import_warnOnce.warnOnce)(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
|
|
52
53
|
}
|
|
53
54
|
var { passThrough } = props;
|
|
@@ -76,7 +77,7 @@ function getThemedChildren(themeState, children, props) {
|
|
|
76
77
|
var { shallow, forceClassName } = props;
|
|
77
78
|
var state = stateRef.current;
|
|
78
79
|
var shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || (0, import_useThemeState.hasThemeUpdatingProps)(props);
|
|
79
|
-
if (process.env.NODE_ENV === "development" && props.debug === "visualize") children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
|
|
80
|
+
if (!isProd && process.env.NODE_ENV === "development" && props.debug === "visualize") children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
|
|
80
81
|
themeState,
|
|
81
82
|
themeProps: props,
|
|
82
83
|
children
|
|
@@ -93,7 +94,7 @@ function getThemedChildren(themeState, children, props) {
|
|
|
93
94
|
if (requiresExtraWrapper || isFirstThemedRender && (themeState.name === "dark" || themeState.name === "light")) state.hasEverThemed = "wrapped";
|
|
94
95
|
if (shallow) if (!themeState.parentId) {} else {
|
|
95
96
|
var parentState = (0, import_useThemeState.getThemeState)(themeState.isNew ? themeState.id : themeState.parentId);
|
|
96
|
-
if (!parentState) throw new Error(process.env.NODE_ENV !== "production" ? (0, import_formatDiagnostic.formatDiagnostic)("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
|
|
97
|
+
if (!parentState) throw new Error(!isProd && process.env.NODE_ENV !== "production" ? (0, import_formatDiagnostic.formatDiagnostic)("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
|
|
97
98
|
name: themeState.name,
|
|
98
99
|
parentId: themeState.parentId
|
|
99
100
|
}) : "❌ Error 014");
|
|
@@ -104,7 +105,7 @@ function getThemedChildren(themeState, children, props) {
|
|
|
104
105
|
})) : child;
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
|
-
if (process.env.NODE_ENV === "development") {
|
|
108
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
108
109
|
if (!passThrough && props.debug) console.warn(` getThemedChildren`, {
|
|
109
110
|
requiresExtraWrapper,
|
|
110
111
|
forceClassName,
|
|
@@ -44,10 +44,11 @@ var import_warnOnce = require("../helpers/warnOnce.native.js");
|
|
|
44
44
|
var import_useTheme = require("../hooks/useTheme.native.js");
|
|
45
45
|
var import_useThemeState = require("../hooks/useThemeState.native.js");
|
|
46
46
|
var import_ThemeDebug = require("./ThemeDebug.native.js");
|
|
47
|
+
var isProd = process.env.NODE_ENV === "production";
|
|
47
48
|
var Theme = (0, import_compose_refs.createRefComponent)(function Theme2(props, ref) {
|
|
48
49
|
"use no memo";
|
|
49
50
|
if (props.disable) return props.children;
|
|
50
|
-
if (process.env.NODE_ENV === "development") {
|
|
51
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
51
52
|
for (var key in props) if (!import_helpers.reservedThemeProps[key] && key !== "srcloc" && !key.startsWith("data-")) (0, import_warnOnce.warnOnce)(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
|
|
52
53
|
}
|
|
53
54
|
var { passThrough } = props;
|
|
@@ -76,7 +77,7 @@ function getThemedChildren(themeState, children, props) {
|
|
|
76
77
|
var { shallow, forceClassName } = props;
|
|
77
78
|
var state = stateRef.current;
|
|
78
79
|
var shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || (0, import_useThemeState.hasThemeUpdatingProps)(props);
|
|
79
|
-
if (process.env.NODE_ENV === "development" && props.debug === "visualize") children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
|
|
80
|
+
if (!isProd && process.env.NODE_ENV === "development" && props.debug === "visualize") children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
|
|
80
81
|
themeState,
|
|
81
82
|
themeProps: props,
|
|
82
83
|
children
|
|
@@ -93,7 +94,7 @@ function getThemedChildren(themeState, children, props) {
|
|
|
93
94
|
if (requiresExtraWrapper || isFirstThemedRender && (themeState.name === "dark" || themeState.name === "light")) state.hasEverThemed = "wrapped";
|
|
94
95
|
if (shallow) if (!themeState.parentId) {} else {
|
|
95
96
|
var parentState = (0, import_useThemeState.getThemeState)(themeState.isNew ? themeState.id : themeState.parentId);
|
|
96
|
-
if (!parentState) throw new Error(process.env.NODE_ENV !== "production" ? (0, import_formatDiagnostic.formatDiagnostic)("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
|
|
97
|
+
if (!parentState) throw new Error(!isProd && process.env.NODE_ENV !== "production" ? (0, import_formatDiagnostic.formatDiagnostic)("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
|
|
97
98
|
name: themeState.name,
|
|
98
99
|
parentId: themeState.parentId
|
|
99
100
|
}) : "❌ Error 014");
|
|
@@ -104,7 +105,7 @@ function getThemedChildren(themeState, children, props) {
|
|
|
104
105
|
})) : child;
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
|
-
if (process.env.NODE_ENV === "development") {
|
|
108
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
108
109
|
if (!passThrough && props.debug) console.warn(` getThemedChildren`, {
|
|
109
110
|
requiresExtraWrapper,
|
|
110
111
|
forceClassName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.native.js","names":[],"sources":["cjs/views/Theme.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Theme_exports = {};\n__export(Theme_exports, {\n\tTheme: () => Theme,\n\tgetThemedChildren: () => getThemedChildren\n});\nmodule.exports = __toCommonJS(Theme_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_createVariable = require(\"../createVariable\");\nvar import_formatDiagnostic = require(\"../helpers/formatDiagnostic\");\nvar import_nativeStyleEngine = require(\"../helpers/nativeStyleEngine\");\nvar import_warnOnce = require(\"../helpers/warnOnce\");\nvar import_useTheme = require(\"../hooks/useTheme\");\nvar import_useThemeState = require(\"../hooks/useThemeState\");\nvar import_ThemeDebug = require(\"./ThemeDebug\");\nvar Theme = (0, import_compose_refs.createRefComponent)(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (var key in props) if (!import_helpers.reservedThemeProps[key] && key !== \"srcloc\" && !key.startsWith(\"data-\")) (0, import_warnOnce.warnOnce)(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tvar { passThrough } = props;\n\tvar isRoot = !!props[\"_isRoot\"];\n\tvar [_, themeState] = (0, import_useTheme.useThemeWithState)(props, isRoot, true);\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\n\t\t(0, import_nativeStyleEngine.updateNativeStyleScope)(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn (0, import_nativeStyleEngine.removeNativeStyleScope)(themeState.id);\n\t\t};\n\t}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tvar finalChildren = props[\"disable-child-theme\"] ? import_react.Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ (0, import_react.isValidElement)(child) ? child : /* @__PURE__ */ (0, import_react.cloneElement)(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref && /* @__PURE__ */ (0, import_react.isValidElement)(finalChildren)) finalChildren = /* @__PURE__ */ (0, import_react.cloneElement)(finalChildren, { ref });\n\tvar stateRef = (0, import_react.useRef)({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, stateRef = arguments.length > 4 ? arguments[4] : void 0, passThrough = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { shallow, forceClassName } = props;\n\tvar state = stateRef.current;\n\tvar shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || (0, import_useThemeState.hasThemeUpdatingProps)(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_useThemeState.ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tvar { isInverse } = themeState;\n\tvar requiresExtraWrapper = isInverse || forceClassName;\n\tvar isFirstThemedRender = !state.hasEverThemed;\n\tif (isFirstThemedRender) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || isFirstThemedRender && (themeState.name === \"dark\" || themeState.name === \"light\")) state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tvar parentState = (0, import_useThemeState.getThemeState)(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(process.env.NODE_ENV !== \"production\" ? (0, import_formatDiagnostic.formatDiagnostic)(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = import_react.Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ (0, import_react.isValidElement)(child) ? passThrough ? child : /* @__PURE__ */ (0, import_react.cloneElement)(child, void 0, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (import_constants.isWeb) {\n\t\tvar _props__themeUpdate;\n\t\tvar baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tvar { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tvar inlineClassName = passThrough ? void 0 : (_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.className;\n\t\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") {\n\t\t\tvar scheme = requiresExtraWrapper && themeState.schemeAuthored && themeState.scheme;\n\t\t\tvar className1 = scheme ? `t_${scheme} _dsp_contents` : \"_dsp_contents\";\n\t\t\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"span\", {\n\t\t\t\tclassName: className1,\n\t\t\t\tchildren\n\t\t\t});\n\t\t}\n\t\treturn children;\n\t}\n\treturn children;\n}\nvar inertStyle = { display: \"contents\" };\nvar inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nvar empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props, isRoot) {\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: (themeState === null || themeState === void 0 ? void 0 : themeState.theme) && themeState.isNew ? (0, import_createVariable.variableToString)(themeState.theme.color) : \"\",\n\t\tclassName: (0, import_helpers.getThemeClassNames)(themeState.name, isRoot, themeState.schemeAuthored)\n\t};\n}\n//# sourceMappingURL=Theme.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;AACR;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKpG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CACpE,OAAO;CACP,YAAY;AACb,CAAC,IAAI,QACL,GACD;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,g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AkB,cAAc,KAAK,KAAK,sBAAsB,MAAM,kBAAkB,QAAQ,wBAAwB,KAAK,IAAI,KAAK,IAAI,oBAAoB;EAClK,WAA2B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,QAAQ;GAC9D,WAAW,GAAG,UAAU,WAAW,kBAAkB,IAAI,oBAAoB;GAC7E,OAAO,cAAc,YAAY;IAChC;IACA,GAAG;GACJ;GACA;EACD,CAAC;EACD,IAAI,MAAM,kBAAkB,WAAW;GACtC,IAAI,SAAS,wBAAwB,WAAW,kBAAkB,WAAW;GAC7E,IAAI,aAAa,SAAS,KAAK,OAAO,kBAAkB;GACxD,WAA2B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,QAAQ;IAC9D,WAAW;IACX;GACD,CAAC;EACF;EACA,OAAO;CACR;CACA,OAAO;AACR;AACA,IAAI,aAAa,EAAE,SAAS,WAAW;AACvC,IAAI,sBAAsB;CACzB,SAAS;CACT,SAAS;AACV;AACA,IAAI,QAAQ;CACX,WAAW;CACX,OAAO,KAAK;AACb;AACA,SAAS,0BAA0B,YAAY,OAAO,QAAQ;CAC7D,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW,UAAU,WAAW,SAAS,GAAG,sBAAsB,iBAAgB,CAAE,WAAW,MAAM,KAAK,IAAI;EAC9K,YAAY,GAAG,eAAe,mBAAkB,CAAE,WAAW,MAAM,QAAQ,WAAW,cAAc;CACrG;AACD"}
|
|
1
|
+
{"version":3,"file":"Theme.native.js","names":[],"sources":["cjs/views/Theme.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Theme_exports = {};\n__export(Theme_exports, {\n\tTheme: () => Theme,\n\tgetThemedChildren: () => getThemedChildren\n});\nmodule.exports = __toCommonJS(Theme_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_createVariable = require(\"../createVariable\");\nvar import_formatDiagnostic = require(\"../helpers/formatDiagnostic\");\nvar import_nativeStyleEngine = require(\"../helpers/nativeStyleEngine\");\nvar import_warnOnce = require(\"../helpers/warnOnce\");\nvar import_useTheme = require(\"../hooks/useTheme\");\nvar import_useThemeState = require(\"../hooks/useThemeState\");\nvar import_ThemeDebug = require(\"./ThemeDebug\");\nvar isProd = process.env.NODE_ENV === \"production\";\nvar Theme = (0, import_compose_refs.createRefComponent)(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (!isProd && process.env.NODE_ENV === \"development\") {\n\t\tfor (var key in props) if (!import_helpers.reservedThemeProps[key] && key !== \"srcloc\" && !key.startsWith(\"data-\")) (0, import_warnOnce.warnOnce)(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tvar { passThrough } = props;\n\tvar isRoot = !!props[\"_isRoot\"];\n\tvar [_, themeState] = (0, import_useTheme.useThemeWithState)(props, isRoot, true);\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\n\t\t(0, import_nativeStyleEngine.updateNativeStyleScope)(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn (0, import_nativeStyleEngine.removeNativeStyleScope)(themeState.id);\n\t\t};\n\t}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tvar finalChildren = props[\"disable-child-theme\"] ? import_react.Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ (0, import_react.isValidElement)(child) ? child : /* @__PURE__ */ (0, import_react.cloneElement)(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref && /* @__PURE__ */ (0, import_react.isValidElement)(finalChildren)) finalChildren = /* @__PURE__ */ (0, import_react.cloneElement)(finalChildren, { ref });\n\tvar stateRef = (0, import_react.useRef)({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, stateRef = arguments.length > 4 ? arguments[4] : void 0, passThrough = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { shallow, forceClassName } = props;\n\tvar state = stateRef.current;\n\tvar shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || (0, import_useThemeState.hasThemeUpdatingProps)(props);\n\tif (!isProd && process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_useThemeState.ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tvar { isInverse } = themeState;\n\tvar requiresExtraWrapper = isInverse || forceClassName;\n\tvar isFirstThemedRender = !state.hasEverThemed;\n\tif (isFirstThemedRender) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || isFirstThemedRender && (themeState.name === \"dark\" || themeState.name === \"light\")) state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tvar parentState = (0, import_useThemeState.getThemeState)(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(!isProd && process.env.NODE_ENV !== \"production\" ? (0, import_formatDiagnostic.formatDiagnostic)(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = import_react.Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ (0, import_react.isValidElement)(child) ? passThrough ? child : /* @__PURE__ */ (0, import_react.cloneElement)(child, void 0, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (!isProd && process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (import_constants.isWeb) {\n\t\tvar _props__themeUpdate;\n\t\tvar baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tvar { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tvar inlineClassName = passThrough ? void 0 : (_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.className;\n\t\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") {\n\t\t\tvar scheme = requiresExtraWrapper && themeState.schemeAuthored && themeState.scheme;\n\t\t\tvar className1 = scheme ? `t_${scheme} _dsp_contents` : \"_dsp_contents\";\n\t\t\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"span\", {\n\t\t\t\tclassName: className1,\n\t\t\t\tchildren\n\t\t\t});\n\t\t}\n\t\treturn children;\n\t}\n\treturn children;\n}\nvar inertStyle = { display: \"contents\" };\nvar inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nvar empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props, isRoot) {\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: (themeState === null || themeState === void 0 ? void 0 : themeState.theme) && themeState.isNew ? (0, import_createVariable.variableToString)(themeState.theme.color) : \"\",\n\t\tclassName: (0, import_helpers.getThemeClassNames)(themeState.name, isRoot, themeState.schemeAuthored)\n\t};\n}\n//# sourceMapp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BAAoB;GAC7E,OAAO,cAAc,YAAY;IAChC;IACA,GAAG;GACJ;GACA;EACD,CAAC;EACD,IAAI,MAAM,kBAAkB,WAAW;GACtC,IAAI,SAAS,wBAAwB,WAAW,kBAAkB,WAAW;GAC7E,IAAI,aAAa,SAAS,KAAK,OAAO,kBAAkB;GACxD,WAA2B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,QAAQ;IAC9D,WAAW;IACX;GACD,CAAC;EACF;EACA,OAAO;CACR;CACA,OAAO;AACR;AACA,IAAI,aAAa,EAAE,SAAS,WAAW;AACvC,IAAI,sBAAsB;CACzB,SAAS;CACT,SAAS;AACV;AACA,IAAI,QAAQ;CACX,WAAW;CACX,OAAO,KAAK;AACb;AACA,SAAS,0BAA0B,YAAY,OAAO,QAAQ;CAC7D,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW,UAAU,WAAW,SAAS,GAAG,sBAAsB,iBAAgB,CAAE,WAAW,MAAM,KAAK,IAAI;EAC9K,YAAY,GAAG,eAAe,mBAAkB,CAAE,WAAW,MAAM,QAAQ,WAAW,cAAc;CACrG;AACD"}
|
|
@@ -26,11 +26,12 @@ var import_react = require("react");
|
|
|
26
26
|
var import_react_dom = require("react-dom");
|
|
27
27
|
var import_useThemeState = require("../hooks/useThemeState.cjs");
|
|
28
28
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
const isProd = process.env.NODE_ENV === "production";
|
|
29
30
|
let node;
|
|
30
31
|
function ThemeDebug({ themeState, themeProps, children }) {
|
|
31
|
-
if (process.env.NODE_ENV === "development") {
|
|
32
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
32
33
|
const isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)();
|
|
33
|
-
if (process.env.NODE_ENV === "development" && typeof document !== "undefined") {
|
|
34
|
+
if (!isProd && process.env.NODE_ENV === "development" && typeof document !== "undefined") {
|
|
34
35
|
if (!node) {
|
|
35
36
|
node = document.createElement("div");
|
|
36
37
|
node.style.height = "200px";
|
package/dist/esm/Tamagui.mjs
CHANGED
|
@@ -3,8 +3,9 @@ import { getConfig } from "./config.mjs";
|
|
|
3
3
|
import { getAllRules, getAllSelectors } from "./helpers/insertStyleRule.mjs";
|
|
4
4
|
import { mediaState } from "./helpers/mediaState.mjs";
|
|
5
5
|
|
|
6
|
+
const isProd = process.env.NODE_ENV === "production";
|
|
6
7
|
const Tamagui = (() => {
|
|
7
|
-
if (process.env.NODE_ENV === "development") {
|
|
8
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
8
9
|
class TamaguiManager {
|
|
9
10
|
Helpers = Helpers;
|
|
10
11
|
get mediaState() {
|
package/dist/esm/Tamagui.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tamagui.js","names":[],"sources":["esm/Tamagui.js"],"sourcesContent":["import * as Helpers from \"@tamagui/helpers\";\nimport { getConfig } from \"./config\";\nimport { getAllRules, getAllSelectors } from \"./helpers/insertStyleRule\";\nimport { mediaState } from \"./helpers/mediaState\";\nconst Tamagui = (() => {\n if (process.env.NODE_ENV === \"development\") {\n class TamaguiManager {\n Helpers = Helpers;\n get mediaState() {\n return { ...mediaState };\n }\n get config() {\n return getConfig();\n }\n get insertedRules() {\n return getAllRules();\n }\n get allSelectors() {\n return getAllSelectors();\n }\n get identifierToValue() {\n return identifierToValue;\n }\n }\n return new TamaguiManager();\n }\n})();\nconst identifierToValue = /* @__PURE__ */ new Map();\nconst getValueFromIdentifier = (identifier) => {\n return identifierToValue.get(identifier);\n};\nconst setIdentifierValue = (identifier, value) => {\n identifierToValue.set(identifier, value);\n};\nexport {\n Tamagui,\n getValueFromIdentifier,\n setIdentifierValue\n};\n//# sourceMappingURL=Tamagui.js.map\n"],"mappings":";;;;;;AAIA,MAAM,iBAAiB;CACrB,IAAI,QAAQ,IAAI,aAAa,eAAe;
|
|
1
|
+
{"version":3,"file":"Tamagui.js","names":[],"sources":["esm/Tamagui.js"],"sourcesContent":["import * as Helpers from \"@tamagui/helpers\";\nimport { getConfig } from \"./config\";\nimport { getAllRules, getAllSelectors } from \"./helpers/insertStyleRule\";\nimport { mediaState } from \"./helpers/mediaState\";\nconst isProd = process.env.NODE_ENV === \"production\";\nconst Tamagui = (() => {\n if (!isProd && process.env.NODE_ENV === \"development\") {\n class TamaguiManager {\n Helpers = Helpers;\n get mediaState() {\n return { ...mediaState };\n }\n get config() {\n return getConfig();\n }\n get insertedRules() {\n return getAllRules();\n }\n get allSelectors() {\n return getAllSelectors();\n }\n get identifierToValue() {\n return identifierToValue;\n }\n }\n return new TamaguiManager();\n }\n})();\nconst identifierToValue = /* @__PURE__ */ new Map();\nconst getValueFromIdentifier = (identifier) => {\n return identifierToValue.get(identifier);\n};\nconst setIdentifierValue = (identifier, value) => {\n identifierToValue.set(identifier, value);\n};\nexport {\n Tamagui,\n getValueFromIdentifier,\n setIdentifierValue\n};\n//# sourceMappingURL=Tamagui.js.map\n"],"mappings":";;;;;;AAIA,MAAM,SAAS,QAAQ,IAAI,aAAa;AACxC,MAAM,iBAAiB;CACrB,IAAI,CAAC,UAAU,QAAQ,IAAI,aAAa,eAAe;EACrD,MAAM,eAAe;GACnB,UAAU;GACV,IAAI,aAAa;IACf,OAAO,EAAE,GAAG,WAAW;GACzB;GACA,IAAI,SAAS;IACX,OAAO,UAAU;GACnB;GACA,IAAI,gBAAgB;IAClB,OAAO,YAAY;GACrB;GACA,IAAI,eAAe;IACjB,OAAO,gBAAgB;GACzB;GACA,IAAI,oBAAoB;IACtB,OAAO;GACT;EACF;EACA,OAAO,IAAI,eAAe;CAC5B;AACF,EAAC,CAAE;AACH,MAAM,oCAAoC,IAAI,IAAI;AAClD,MAAM,0BAA0B,eAAe;CAC7C,OAAO,kBAAkB,IAAI,UAAU;AACzC;AACA,MAAM,sBAAsB,YAAY,UAAU;CAChD,kBAAkB,IAAI,YAAY,KAAK;AACzC"}
|
|
@@ -31,8 +31,9 @@ function _define_property(obj, key, value) {
|
|
|
31
31
|
} else obj[key] = value;
|
|
32
32
|
return obj;
|
|
33
33
|
}
|
|
34
|
+
var isProd = process.env.NODE_ENV === "production";
|
|
34
35
|
var Tamagui = (function() {
|
|
35
|
-
if (process.env.NODE_ENV === "development") {
|
|
36
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
36
37
|
var TamaguiManager = /* @__PURE__ */ (function() {
|
|
37
38
|
"use strict";
|
|
38
39
|
function TamaguiManager2() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tamagui.native.js","names":[],"sources":["esm/Tamagui.native.js"],"sourcesContent":["import * as Helpers from \"@tamagui/helpers\";\nimport { getConfig } from \"./config\";\nimport { getAllRules, getAllSelectors } from \"./helpers/insertStyleRule\";\nimport { mediaState } from \"./helpers/mediaState\";\nfunction _class_call_check(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction _create_class(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\nfunction _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else obj[key] = value;\n return obj;\n}\nvar Tamagui = (function() {\n if (process.env.NODE_ENV === \"development\") {\n var TamaguiManager = /* @__PURE__ */ (function() {\n \"use strict\";\n function TamaguiManager2() {\n _class_call_check(this, TamaguiManager2);\n _define_property(this, \"Helpers\", Helpers);\n }\n _create_class(TamaguiManager2, [\n {\n key: \"mediaState\",\n get: function get() {\n return {\n ...mediaState\n };\n }\n },\n {\n key: \"config\",\n get: function get() {\n return getConfig();\n }\n },\n {\n key: \"insertedRules\",\n get: function get() {\n return getAllRules();\n }\n },\n {\n key: \"allSelectors\",\n get: function get() {\n return getAllSelectors();\n }\n },\n {\n key: \"identifierToValue\",\n get: function get() {\n return identifierToValue;\n }\n }\n ]);\n return TamaguiManager2;\n })();\n return new TamaguiManager();\n }\n})();\nvar identifierToValue = /* @__PURE__ */ new Map();\nvar getValueFromIdentifier = function getValueFromIdentifier2(identifier) {\n return identifierToValue.get(identifier);\n};\nvar setIdentifierValue = function setIdentifierValue2(identifier, value) {\n identifierToValue.set(identifier, value);\n};\nexport {\n Tamagui,\n getValueFromIdentifier,\n setIdentifierValue\n};\n//# sourceMappingURL=Tamagui.js.map\n"],"mappings":";;;;;;AAIA,SAAS,kBAAkB,UAAU,aAAa;CAChD,IAAI,EAAE,oBAAoB,cAAc,MAAM,IAAI,UAAU,mCAAmC;AACjG;AACA,SAAS,kBAAkB,QAAQ,OAAO;CACxC,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,IAAI,aAAa,MAAM;EACvB,WAAW,aAAa,WAAW,cAAc;EACjD,WAAW,eAAe;EAC1B,IAAI,WAAW,YAAY,WAAW,WAAW;EACjD,OAAO,eAAe,QAAQ,WAAW,KAAK,UAAU;CAC1D;AACF;AACA,SAAS,cAAc,aAAa,YAAY,aAAa;CAC3D,IAAI,YAAY,kBAAkB,YAAY,WAAW,UAAU;CACnE,IAAI,aAAa,kBAAkB,aAAa,WAAW;CAC3D,OAAO;AACT;AACA,SAAS,iBAAiB,KAAK,KAAK,OAAO;CACzC,IAAI,OAAO,KAAK;EACd,OAAO,eAAe,KAAK,KAAK;GAC9B;GACA,YAAY;GACZ,cAAc;GACd,UAAU;EACZ,CAAC;CACH,OAAO,IAAI,OAAO;CAClB,OAAO;AACT;AACA,IAAI,WAAW,WAAW;CACxB,IAAI,QAAQ,IAAI,aAAa,eAAe;
|
|
1
|
+
{"version":3,"file":"Tamagui.native.js","names":[],"sources":["esm/Tamagui.native.js"],"sourcesContent":["import * as Helpers from \"@tamagui/helpers\";\nimport { getConfig } from \"./config\";\nimport { getAllRules, getAllSelectors } from \"./helpers/insertStyleRule\";\nimport { mediaState } from \"./helpers/mediaState\";\nfunction _class_call_check(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction _create_class(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\nfunction _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else obj[key] = value;\n return obj;\n}\nvar isProd = process.env.NODE_ENV === \"production\";\nvar Tamagui = (function() {\n if (!isProd && process.env.NODE_ENV === \"development\") {\n var TamaguiManager = /* @__PURE__ */ (function() {\n \"use strict\";\n function TamaguiManager2() {\n _class_call_check(this, TamaguiManager2);\n _define_property(this, \"Helpers\", Helpers);\n }\n _create_class(TamaguiManager2, [\n {\n key: \"mediaState\",\n get: function get() {\n return {\n ...mediaState\n };\n }\n },\n {\n key: \"config\",\n get: function get() {\n return getConfig();\n }\n },\n {\n key: \"insertedRules\",\n get: function get() {\n return getAllRules();\n }\n },\n {\n key: \"allSelectors\",\n get: function get() {\n return getAllSelectors();\n }\n },\n {\n key: \"identifierToValue\",\n get: function get() {\n return identifierToValue;\n }\n }\n ]);\n return TamaguiManager2;\n })();\n return new TamaguiManager();\n }\n})();\nvar identifierToValue = /* @__PURE__ */ new Map();\nvar getValueFromIdentifier = function getValueFromIdentifier2(identifier) {\n return identifierToValue.get(identifier);\n};\nvar setIdentifierValue = function setIdentifierValue2(identifier, value) {\n identifierToValue.set(identifier, value);\n};\nexport {\n Tamagui,\n getValueFromIdentifier,\n setIdentifierValue\n};\n//# sourceMappingURL=Tamagui.js.map\n"],"mappings":";;;;;;AAIA,SAAS,kBAAkB,UAAU,aAAa;CAChD,IAAI,EAAE,oBAAoB,cAAc,MAAM,IAAI,UAAU,mCAAmC;AACjG;AACA,SAAS,kBAAkB,QAAQ,OAAO;CACxC,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,IAAI,aAAa,MAAM;EACvB,WAAW,aAAa,WAAW,cAAc;EACjD,WAAW,eAAe;EAC1B,IAAI,WAAW,YAAY,WAAW,WAAW;EACjD,OAAO,eAAe,QAAQ,WAAW,KAAK,UAAU;CAC1D;AACF;AACA,SAAS,cAAc,aAAa,YAAY,aAAa;CAC3D,IAAI,YAAY,kBAAkB,YAAY,WAAW,UAAU;CACnE,IAAI,aAAa,kBAAkB,aAAa,WAAW;CAC3D,OAAO;AACT;AACA,SAAS,iBAAiB,KAAK,KAAK,OAAO;CACzC,IAAI,OAAO,KAAK;EACd,OAAO,eAAe,KAAK,KAAK;GAC9B;GACA,YAAY;GACZ,cAAc;GACd,UAAU;EACZ,CAAC;CACH,OAAO,IAAI,OAAO;CAClB,OAAO;AACT;AACA,IAAI,SAAS,QAAQ,IAAI,aAAa;AACtC,IAAI,WAAW,WAAW;CACxB,IAAI,CAAC,UAAU,QAAQ,IAAI,aAAa,eAAe;EACrD,IAAI,iBAAiC,iBAAC,WAAW;GAC/C;GACA,SAAS,kBAAkB;IACzB,kBAAkB,MAAM,eAAe;IACvC,iBAAiB,MAAM,WAAW,OAAO;GAC3C;GACA,cAAc,iBAAiB;IAC7B;KACE,KAAK;KACL,KAAK,SAAS,MAAM;MAClB,OAAO,EACL,GAAG,WACL;KACF;IACF;IACA;KACE,KAAK;KACL,KAAK,SAAS,MAAM;MAClB,OAAO,UAAU;KACnB;IACF;IACA;KACE,KAAK;KACL,KAAK,SAAS,MAAM;MAClB,OAAO,YAAY;KACrB;IACF;IACA;KACE,KAAK;KACL,KAAK,SAAS,MAAM;MAClB,OAAO,gBAAgB;KACzB;IACF;IACA;KACE,KAAK;KACL,KAAK,SAAS,MAAM;MAClB,OAAO;KACT;IACF;GACF,CAAC;GACD,OAAO;EACT,EAAC,CAAE;EACH,OAAO,IAAI,eAAe;CAC5B;AACF,EAAC,CAAE;AACH,IAAI,oCAAoC,IAAI,IAAI;AAChD,IAAI,yBAAyB,SAAS,wBAAwB,YAAY;CACxE,OAAO,kBAAkB,IAAI,UAAU;AACzC;AACA,IAAI,qBAAqB,SAAS,oBAAoB,YAAY,OAAO;CACvE,kBAAkB,IAAI,YAAY,KAAK;AACzC"}
|
|
@@ -6,6 +6,7 @@ import { useTheme } from "./hooks/useTheme.mjs";
|
|
|
6
6
|
import { ThemeStateContext } from "./hooks/useThemeState.mjs";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
|
|
9
|
+
const isProd = process.env.NODE_ENV === "production";
|
|
9
10
|
const EMPTY_EXPRESSIONS = [];
|
|
10
11
|
const EMPTY_THEME = {};
|
|
11
12
|
const FALLBACK_THEME_CACHE = /* @__PURE__ */ new WeakMap();
|
|
@@ -39,7 +40,7 @@ const _withStableStyle = (Component, createStyle, hasThemeKeys, hasMediaKeys) =>
|
|
|
39
40
|
break;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
if (process.env.NODE_ENV === "development") {
|
|
43
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
43
44
|
console.warn("[@tamagui] _withStableStyle: no ThemeStateContext found. This usually means duplicate tamagui instances in a monorepo. Falling back to default theme from config.");
|
|
44
45
|
}
|
|
45
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_withStableStyle.js","names":[],"sources":["esm/_withStableStyle.js"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { getConfigMaybe } from \"./config\";\nimport { getVariable } from \"./createVariable\";\nimport { useMedia } from \"./hooks/useMedia\";\nimport { useTheme } from \"./hooks/useTheme\";\nimport { ThemeStateContext } from \"./hooks/useThemeState\";\nimport { jsx } from \"react/jsx-runtime\";\nconst EMPTY_EXPRESSIONS = [];\nconst EMPTY_THEME = {};\nconst FALLBACK_THEME_CACHE = /* @__PURE__ */ new WeakMap();\nconst _withStableStyle = (Component, createStyle, hasThemeKeys, hasMediaKeys) => React.memo(function WithStableStyle(props) {\n const { ref, ...propsWithoutRef } = props;\n const { _expressions = EMPTY_EXPRESSIONS, ...rest } = propsWithoutRef;\n const parentId = useContext(ThemeStateContext);\n const theme = hasThemeKeys && parentId ? useTheme() : null;\n const media = hasMediaKeys ? useMedia() : null;\n const resolvedExpressions = media ? _expressions.map(\n (expr) => (\n // ['gtLg', cond] needs the media query and the runtime condition\n Array.isArray(expr) ? !!(media[expr[0]] && expr[1]) : typeof expr === \"string\" ? media[expr] : expr\n )\n ) : _expressions;\n let resolvedTheme = theme || EMPTY_THEME;\n if (hasThemeKeys && !parentId) {\n const config = getConfigMaybe();\n const themes = config?.themes;\n if (themes) {\n for (const k in themes) {\n const fallbackTheme = themes.light || themes.dark || themes[k];\n let gettableTheme = FALLBACK_THEME_CACHE.get(fallbackTheme);\n if (!gettableTheme) {\n gettableTheme = {};\n for (const key in fallbackTheme) {\n const value = fallbackTheme[key];\n gettableTheme[key] = typeof value?.get === \"function\" ? value : {\n ...value && typeof value === \"object\" ? value : { val: value },\n get: () => getVariable(value)\n };\n }\n FALLBACK_THEME_CACHE.set(fallbackTheme, gettableTheme);\n }\n resolvedTheme = gettableTheme;\n break;\n }\n }\n if (process.env.NODE_ENV === \"development\") {\n console.warn(\n \"[@tamagui] _withStableStyle: no ThemeStateContext found. This usually means duplicate tamagui instances in a monorepo. Falling back to default theme from config.\"\n );\n }\n }\n return /* @__PURE__ */ jsx(\n Component,\n {\n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AI,QAAQ,IAAI,aAAa,eAAe;
|
|
1
|
+
{"version":3,"file":"_withStableStyle.js","names":[],"sources":["esm/_withStableStyle.js"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { getConfigMaybe } from \"./config\";\nimport { getVariable } from \"./createVariable\";\nimport { useMedia } from \"./hooks/useMedia\";\nimport { useTheme } from \"./hooks/useTheme\";\nimport { ThemeStateContext } from \"./hooks/useThemeState\";\nimport { jsx } from \"react/jsx-runtime\";\nconst isProd = process.env.NODE_ENV === \"production\";\nconst EMPTY_EXPRESSIONS = [];\nconst EMPTY_THEME = {};\nconst FALLBACK_THEME_CACHE = /* @__PURE__ */ new WeakMap();\nconst _withStableStyle = (Component, createStyle, hasThemeKeys, hasMediaKeys) => React.memo(function WithStableStyle(props) {\n const { ref, ...propsWithoutRef } = props;\n const { _expressions = EMPTY_EXPRESSIONS, ...rest } = propsWithoutRef;\n const parentId = useContext(ThemeStateContext);\n const theme = hasThemeKeys && parentId ? useTheme() : null;\n const media = hasMediaKeys ? useMedia() : null;\n const resolvedExpressions = media ? _expressions.map(\n (expr) => (\n // ['gtLg', cond] needs the media query and the runtime condition\n Array.isArray(expr) ? !!(media[expr[0]] && expr[1]) : typeof expr === \"string\" ? media[expr] : expr\n )\n ) : _expressions;\n let resolvedTheme = theme || EMPTY_THEME;\n if (hasThemeKeys && !parentId) {\n const config = getConfigMaybe();\n const themes = config?.themes;\n if (themes) {\n for (const k in themes) {\n const fallbackTheme = themes.light || themes.dark || themes[k];\n let gettableTheme = FALLBACK_THEME_CACHE.get(fallbackTheme);\n if (!gettableTheme) {\n gettableTheme = {};\n for (const key in fallbackTheme) {\n const value = fallbackTheme[key];\n gettableTheme[key] = typeof value?.get === \"function\" ? value : {\n ...value && typeof value === \"object\" ? value : { val: value },\n get: () => getVariable(value)\n };\n }\n FALLBACK_THEME_CACHE.set(fallbackTheme, gettableTheme);\n }\n resolvedTheme = gettableTheme;\n break;\n }\n }\n if (!isProd && process.env.NODE_ENV === \"development\") {\n console.warn(\n \"[@tamagui] _withStableStyle: no ThemeStateContext found. This usually means duplicate tamagui instances in a monorepo. Falling back to default theme from config.\"\n );\n }\n }\n return /* @__PURE__ */ jsx(\n Component,\n {\n ref,\n style: createStyle(resolvedTheme, resolvedExpressions),\n ...rest\n }\n );\n});\nexport {\n _withStableStyle\n};\n//# sourceMappingURL=_withStableStyle.js.map\n"],"mappings":";;;;;;;;;AAOA,MAAM,SAAS,QAAQ,IAAI,aAAa;AACxC,MAAM,oBAAoB,CAAC;AAC3B,MAAM,cAAc,CAAC;AACrB,MAAM,uCAAuC,IAAI,QAAQ;AACzD,MAAM,oBAAoB,WAAW,aAAa,cAAc,iBAAiB,MAAM,KAAK,SAAS,gBAAgB,OAAO;CAC1H,MAAM,EAAE,KAAK,GAAG,oBAAoB;CACpC,MAAM,EAAE,eAAe,mBAAmB,GAAG,SAAS;CACtD,MAAM,WAAW,WAAW,iBAAiB;CAC7C,MAAM,QAAQ,gBAAgB,WAAW,SAAS,IAAI;CACtD,MAAM,QAAQ,eAAe,SAAS,IAAI;CAC1C,MAAM,sBAAsB,QAAQ,aAAa,KAC9C,SAEC,MAAM,QAAQ,IAAI,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,KAAK,MAAM,OAAO,SAAS,WAAW,MAAM,QAAQ,IAEnG,IAAI;CACJ,IAAI,gBAAgB,SAAS;CAC7B,IAAI,gBAAgB,CAAC,UAAU;EAC7B,MAAM,SAAS,eAAe;EAC9B,MAAM,SAAS,QAAQ;EACvB,IAAI,QAAQ;GACV,KAAK,MAAM,KAAK,QAAQ;IACtB,MAAM,gBAAgB,OAAO,SAAS,OAAO,QAAQ,OAAO;IAC5D,IAAI,gBAAgB,qBAAqB,IAAI,aAAa;IAC1D,IAAI,CAAC,eAAe;KAClB,gBAAgB,CAAC;KACjB,KAAK,MAAM,OAAO,eAAe;MAC/B,MAAM,QAAQ,cAAc;MAC5B,cAAc,OAAO,OAAO,OAAO,QAAQ,aAAa,QAAQ;OAC9D,GAAG,SAAS,OAAO,UAAU,WAAW,QAAQ,EAAE,KAAK,MAAM;OAC7D,WAAW,YAAY,KAAK;MAC9B;KACF;KACA,qBAAqB,IAAI,eAAe,aAAa;IACvD;IACA,gBAAgB;IAChB;GACF;EACF;EACA,IAAI,CAAC,UAAU,QAAQ,IAAI,aAAa,eAAe;GACrD,QAAQ,KACN,mKACF;EACF;CACF;CACA,OAAuB,oBACrB,WACA;EACE;EACA,OAAO,YAAY,eAAe,mBAAmB;EACrD,GAAG;CACL,CACF;AACF,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { useMedia } from "./hooks/useMedia.native.js";
|
|
|
6
6
|
import { useTheme } from "./hooks/useTheme.native.js";
|
|
7
7
|
import { ThemeStateContext } from "./hooks/useThemeState.native.js";
|
|
8
8
|
|
|
9
|
+
var isProd = process.env.NODE_ENV === "production";
|
|
9
10
|
var EMPTY_EXPRESSIONS = [];
|
|
10
11
|
var EMPTY_THEME = {};
|
|
11
12
|
var FALLBACK_THEME_CACHE = /* @__PURE__ */ new WeakMap();
|
|
@@ -45,7 +46,7 @@ var _withStableStyle = function _withStableStyle2(Component, createStyle, hasThe
|
|
|
45
46
|
break;
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
if (process.env.NODE_ENV === "development") {
|
|
49
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
49
50
|
console.warn("[@tamagui] _withStableStyle: no ThemeStateContext found. This usually means duplicate tamagui instances in a monorepo. Falling back to default theme from config.");
|
|
50
51
|
}
|
|
51
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_withStableStyle.native.js","names":[],"sources":["esm/_withStableStyle.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React, { useContext } from \"react\";\nimport { getConfigMaybe } from \"./config\";\nimport { getVariable } from \"./createVariable\";\nimport { useMedia } from \"./hooks/useMedia\";\nimport { useTheme } from \"./hooks/useTheme\";\nimport { ThemeStateContext } from \"./hooks/useThemeState\";\nvar EMPTY_EXPRESSIONS = [];\nvar EMPTY_THEME = {};\nvar FALLBACK_THEME_CACHE = /* @__PURE__ */ new WeakMap();\nvar _withStableStyle = function _withStableStyle2(Component, createStyle, hasThemeKeys, hasMediaKeys) {\n return /* @__PURE__ */ React.memo(function WithStableStyle(props) {\n var { ref, ...propsWithoutRef } = props;\n var { _expressions = EMPTY_EXPRESSIONS, ...rest } = propsWithoutRef;\n var parentId = useContext(ThemeStateContext);\n var theme = hasThemeKeys && parentId ? useTheme() : null;\n var media = hasMediaKeys ? useMedia() : null;\n var resolvedExpressions = media ? _expressions.map(function(expr) {\n return (\n // ['gtLg', cond] needs the media query and the runtime condition\n Array.isArray(expr) ? !!(media[expr[0]] && expr[1]) : typeof expr === \"string\" ? media[expr] : expr\n );\n }) : _expressions;\n var resolvedTheme = theme || EMPTY_THEME;\n if (hasThemeKeys && !parentId) {\n var config = getConfigMaybe();\n var themes = config === null || config === void 0 ? void 0 : config.themes;\n if (themes) {\n for (var k in themes) {\n var fallbackTheme = themes.light || themes.dark || themes[k];\n var gettableTheme = FALLBACK_THEME_CACHE.get(fallbackTheme);\n if (!gettableTheme) {\n var _loop = function(key2) {\n var value = fallbackTheme[key2];\n gettableTheme[key2] = typeof (value === null || value === void 0 ? void 0 : value.get) === \"function\" ? value : {\n ...value && typeof value === \"object\" ? value : {\n val: value\n },\n get: function get() {\n return getVariable(value);\n }\n };\n };\n gettableTheme = {};\n for (var key in fallbackTheme) _loop(key);\n FALLBACK_THEME_CACHE.set(fallbackTheme, gettableTheme);\n }\n resolvedTheme = gettableTheme;\n break;\n }\n }\n if (process.env.NODE_ENV === \"development\") {\n console.warn(\"[@tamagui] _withStableStyle: no ThemeStateContext found. This usually means duplicate tamagui instances in a monorepo. Falling back to default theme from config.\");\n }\n }\n return /* @__PURE__ */ _jsx(Component, {\n ref,\n style: createStyle(resolvedTheme, resolvedExpressions),\n ...rest\n });\n });\n};\nexport {\n _withStableStyle\n};\n//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CAAC;MACjB,KAAK,IAAI,OAAO,eAAe,MAAM,GAAG;MACxC,qBAAqB,IAAI,eAAe,aAAa;KACvD;KACA,gBAAgB;KAChB;IACF;GACF;GACA,IAAI,QAAQ,IAAI,aAAa,eAAe;
|
|
1
|
+
{"version":3,"file":"_withStableStyle.native.js","names":[],"sources":["esm/_withStableStyle.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React, { useContext } from \"react\";\nimport { getConfigMaybe } from \"./config\";\nimport { getVariable } from \"./createVariable\";\nimport { useMedia } from \"./hooks/useMedia\";\nimport { useTheme } from \"./hooks/useTheme\";\nimport { ThemeStateContext } from \"./hooks/useThemeState\";\nvar isProd = process.env.NODE_ENV === \"production\";\nvar EMPTY_EXPRESSIONS = [];\nvar EMPTY_THEME = {};\nvar FALLBACK_THEME_CACHE = /* @__PURE__ */ new WeakMap();\nvar _withStableStyle = function _withStableStyle2(Component, createStyle, hasThemeKeys, hasMediaKeys) {\n return /* @__PURE__ */ React.memo(function WithStableStyle(props) {\n var { ref, ...propsWithoutRef } = props;\n var { _expressions = EMPTY_EXPRESSIONS, ...rest } = propsWithoutRef;\n var parentId = useContext(ThemeStateContext);\n var theme = hasThemeKeys && parentId ? useTheme() : null;\n var media = hasMediaKeys ? useMedia() : null;\n var resolvedExpressions = media ? _expressions.map(function(expr) {\n return (\n // ['gtLg', cond] needs the media query and the runtime condition\n Array.isArray(expr) ? !!(media[expr[0]] && expr[1]) : typeof expr === \"string\" ? media[expr] : expr\n );\n }) : _expressions;\n var resolvedTheme = theme || EMPTY_THEME;\n if (hasThemeKeys && !parentId) {\n var config = getConfigMaybe();\n var themes = config === null || config === void 0 ? void 0 : config.themes;\n if (themes) {\n for (var k in themes) {\n var fallbackTheme = themes.light || themes.dark || themes[k];\n var gettableTheme = FALLBACK_THEME_CACHE.get(fallbackTheme);\n if (!gettableTheme) {\n var _loop = function(key2) {\n var value = fallbackTheme[key2];\n gettableTheme[key2] = typeof (value === null || value === void 0 ? void 0 : value.get) === \"function\" ? value : {\n ...value && typeof value === \"object\" ? value : {\n val: value\n },\n get: function get() {\n return getVariable(value);\n }\n };\n };\n gettableTheme = {};\n for (var key in fallbackTheme) _loop(key);\n FALLBACK_THEME_CACHE.set(fallbackTheme, gettableTheme);\n }\n resolvedTheme = gettableTheme;\n break;\n }\n }\n if (!isProd && process.env.NODE_ENV === \"development\") {\n console.warn(\"[@tamagui] _withStableStyle: no ThemeStateContext found. This usually means duplicate tamagui instances in a monorepo. Falling back to default theme from config.\");\n }\n }\n return /* @__PURE__ */ _jsx(Component, {\n ref,\n style: createStyle(resolvedTheme, resolvedExpressions),\n ...rest\n });\n });\n};\nexport {\n _withStableStyle\n};\n//# sourceMappingURL=_withStableStyle.js.map\n"],"mappings":";;;;;;;;;AAOA,IAAI,SAAS,QAAQ,IAAI,aAAa;AACtC,IAAI,oBAAoB,CAAC;AACzB,IAAI,cAAc,CAAC;AACnB,IAAI,uCAAuC,IAAI,QAAQ;AACvD,IAAI,mBAAmB,SAAS,kBAAkB,WAAW,aAAa,cAAc,cAAc;CACpG,OAAuB,sBAAM,KAAK,SAAS,gBAAgB,OAAO;EAChE,IAAI,EAAE,KAAK,GAAG,oBAAoB;EAClC,IAAI,EAAE,eAAe,mBAAmB,GAAG,SAAS;EACpD,IAAI,WAAW,WAAW,iBAAiB;EAC3C,IAAI,QAAQ,gBAAgB,WAAW,SAAS,IAAI;EACpD,IAAI,QAAQ,eAAe,SAAS,IAAI;EACxC,IAAI,sBAAsB,QAAQ,aAAa,IAAI,SAAS,MAAM;GAChE,OAEE,MAAM,QAAQ,IAAI,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,KAAK,MAAM,OAAO,SAAS,WAAW,MAAM,QAAQ;EAEnG,CAAC,IAAI;EACL,IAAI,gBAAgB,SAAS;EAC7B,IAAI,gBAAgB,CAAC,UAAU;GAC7B,IAAI,SAAS,eAAe;GAC5B,IAAI,SAAS,WAAW,QAAQ,WAAW,KAAK,IAAI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