tamagui 1.114.1 → 1.114.3

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/native.js CHANGED
@@ -3845,7 +3845,9 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3845
3845
  if (subkey === "val") globalThis.tamaguiAvoidTracking || (process.env.NODE_ENV === "development" && debug === "verbose" && console.info(" \u{1F3A8} useTheme() tracking new key because of .val access", new Error().stack), track(keyString));
3846
3846
  else if (subkey === "get") return function(platform2) {
3847
3847
  var outVal = (0, import_createVariable.getVariable)(val);
3848
- if (platform2 !== "web" && import_constants4.isIos && !deopt && (0, import_config.getSetting)("fastSchemeChange") && !someParentIsInversed(themeManager) && scheme) {
3848
+ if (platform2 !== "web" && import_constants4.isIos && !deopt && (0, import_config.getSetting)("fastSchemeChange") && scheme) {
3849
+ var isInversed = getIsInversed(themeManager);
3850
+ isInversed && (scheme = scheme === "dark" ? "light" : "dark");
3849
3851
  var oppositeThemeName = name.replace(scheme === "dark" ? "dark" : "light", scheme === "dark" ? "light" : "dark"), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
3850
3852
  if (oppositeVal) {
3851
3853
  var dynamicVal = {
@@ -3857,17 +3859,13 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3857
3859
  return dynamicVal;
3858
3860
  }
3859
3861
  }
3860
- if (process.env.NODE_ENV === "development" && debug && (console.info(` \u{1F3A8} useTheme() tracking new key because of:
3862
+ return process.env.NODE_ENV === "development" && debug && console.info(` \u{1F3A8} useTheme() tracking new key because of:
3861
3863
  not web: ${platform2 !== "web"}
3862
3864
  isIOS: ${import_constants4.isIos}
3863
3865
  deopt: ${deopt}
3864
3866
  fastScheme: ${(0, import_config.getSetting)("fastSchemeChange")}
3865
- parent inversed: ${someParentIsInversed(themeManager)}
3866
- `), someParentIsInversed(themeManager))) {
3867
- var _themeManager_parentManager;
3868
- console.info(` some parent is inversed: ${themeManager == null ? void 0 : themeManager.state.name} => ${themeManager == null || (_themeManager_parentManager = themeManager.parentManager) === null || _themeManager_parentManager === void 0 ? void 0 : _themeManager_parentManager.state.name}`);
3869
- }
3870
- return track(keyString), outVal;
3867
+ inversed: ${getIsInversed(themeManager)}
3868
+ `), track(keyString), outVal;
3871
3869
  };
3872
3870
  return Reflect.get(val, subkey);
3873
3871
  }
@@ -3879,22 +3877,10 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3879
3877
  }
3880
3878
  });
3881
3879
  }
3882
- function someParentIsInversed(manager) {
3883
- for (var cur = manager; cur; ) {
3880
+ function getIsInversed(manager) {
3881
+ for (var isInversed = !1, cur = manager; cur; ) {
3884
3882
  if (!cur.parentManager) return !1;
3885
- if (cur.parentManager.state.scheme !== cur.state.scheme) return process.env.NODE_ENV === "development" && !globalThis.TAMAGUI_DITW && !process.env.TAMAGUI_DISABLE_INVERSE_THEME_WARNING && console.info(` \u203C\uFE0F De-opted a theme value access due to an inversed parent.
3886
-
3887
- This means you've accessed a theme value without .get() in a child of an inversed theme.
3888
-
3889
- This isn't necessarily a bug, but can often be due to a mistaken inverse (for example,
3890
- you may have a Theme inside your TamaguiProvider with mis-matched theme values for light/dark).
3891
-
3892
- For this reason we've added this warning. If this is intentional, you can disable it with:
3893
-
3894
- process.env.TAMAGUI_DISABLE_INVERSE_THEME_WARNING === 1
3895
- or globalThis.TAMAGUI_DITW = true
3896
- `), !0;
3897
- cur = cur.parentManager;
3883
+ cur.parentManager.state.scheme !== cur.state.scheme && (isInversed = !isInversed), cur = cur.parentManager;
3898
3884
  }
3899
3885
  return !1;
3900
3886
  }
@@ -8055,6 +8041,56 @@ var require_themeable_native = __commonJS({
8055
8041
  }
8056
8042
  });
8057
8043
 
8044
+ // ../../core/web/dist/cjs/helpers/wrapStyleTags.native.js
8045
+ var require_wrapStyleTags_native = __commonJS({
8046
+ "../../core/web/dist/cjs/helpers/wrapStyleTags.native.js"(exports2, module2) {
8047
+ "use strict";
8048
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
8049
+ for (var name in all) __defProp2(target, name, {
8050
+ get: all[name],
8051
+ enumerable: !0
8052
+ });
8053
+ }, __copyProps2 = function(to, from, except, desc) {
8054
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
8055
+ if (from && typeof from == "object" || typeof from == "function") try {
8056
+ for (var _loop = function() {
8057
+ var key = _step.value;
8058
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
8059
+ get: function() {
8060
+ return from[key];
8061
+ },
8062
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
8063
+ });
8064
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
8065
+ } catch (err) {
8066
+ _didIteratorError = !0, _iteratorError = err;
8067
+ } finally {
8068
+ try {
8069
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
8070
+ } finally {
8071
+ if (_didIteratorError)
8072
+ throw _iteratorError;
8073
+ }
8074
+ }
8075
+ return to;
8076
+ }, __toCommonJS2 = function(mod) {
8077
+ return __copyProps2(__defProp2({}, "__esModule", {
8078
+ value: !0
8079
+ }), mod);
8080
+ }, wrapStyleTags_exports = {};
8081
+ __export2(wrapStyleTags_exports, {
8082
+ wrapStyleTags: function() {
8083
+ return wrapStyleTags;
8084
+ }
8085
+ });
8086
+ module2.exports = __toCommonJS2(wrapStyleTags_exports);
8087
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_helpers = require_index_native7();
8088
+ function wrapStyleTags(styles, content) {
8089
+ return process.env.TAMAGUI_REACT_19, content;
8090
+ }
8091
+ }
8092
+ });
8093
+
8058
8094
  // ../../core/web/dist/cjs/hooks/useDidHydrateOnce.native.js
8059
8095
  var require_useDidHydrateOnce_native = __commonJS({
8060
8096
  "../../core/web/dist/cjs/hooks/useDidHydrateOnce.native.js"(exports2, module2) {
@@ -8486,7 +8522,7 @@ var require_createComponent_native = __commonJS({
8486
8522
  }
8487
8523
  });
8488
8524
  module2.exports = __toCommonJS2(createComponent_exports);
8489
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), tamaguiConfig, time, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set();
8525
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), tamaguiConfig, time, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set();
8490
8526
  typeof document < "u" && (cancelTouches = function() {
8491
8527
  componentSetStates.forEach(function(setState) {
8492
8528
  return setState(function(prev) {
@@ -8936,7 +8972,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8936
8972
  children: content
8937
8973
  });
8938
8974
  }
8939
- if (process.env.TAMAGUI_REACT_19 && !1) var rulesToInsert, keys;
8975
+ var { rulesToInsert } = splitStyles;
8940
8976
  if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
8941
8977
  var element1 = typeof elementType == "string" ? elementType : "Component", title = `render <${element1} /> (${internalID}) with props`;
8942
8978
  if (import_constants4.isWeb) {
@@ -10263,46 +10299,44 @@ var require_styled_native = __commonJS({
10263
10299
  function styled8(ComponentIn, options, staticExtractionOptions) {
10264
10300
  if (process.env.NODE_ENV !== "production" && !ComponentIn) throw new Error("No component given to styled()");
10265
10301
  var parentStaticConfig = ComponentIn.staticConfig, isPlainStyledComponent = !!parentStaticConfig && !(parentStaticConfig.isReactNative || parentStaticConfig.isHOC), isNonStyledHOC = (parentStaticConfig == null ? void 0 : parentStaticConfig.isHOC) && !(parentStaticConfig != null && parentStaticConfig.isStyledHOC), Component = isNonStyledHOC || isPlainStyledComponent ? ComponentIn : (parentStaticConfig == null ? void 0 : parentStaticConfig.Component) || ComponentIn, reactNativeConfig = parentStaticConfig ? void 0 : (0, import_setupReactNative.getReactNativeConfig)(Component), isReactNative = !!(reactNativeConfig || staticExtractionOptions != null && staticExtractionOptions.isReactNative || parentStaticConfig != null && parentStaticConfig.isReactNative), staticConfigProps = function() {
10266
- if (options) {
10267
- var { variants, name, defaultVariants, acceptsClassName: acceptsClassNameProp, context, ...defaultProps } = options, parentDefaultVariants, parentDefaultProps;
10268
- if (parentStaticConfig) {
10269
- var avoid = parentStaticConfig.isHOC && !parentStaticConfig.isStyledHOC;
10270
- if (!avoid) {
10271
- var pdp = parentStaticConfig.defaultProps;
10272
- for (var key2 in pdp) {
10273
- var val = pdp[key2];
10274
- parentStaticConfig.defaultVariants && key2 in parentStaticConfig.defaultVariants && (!defaultVariants || !(key2 in defaultVariants)) && (parentDefaultVariants || (parentDefaultVariants = {}), parentDefaultVariants[key2] = val), key2 in defaultProps || (parentDefaultProps || (parentDefaultProps = {}), parentDefaultProps[key2] = pdp[key2]);
10275
- }
10276
- parentStaticConfig.variants && (variants = (0, import_mergeVariants.mergeVariants)(parentStaticConfig.variants, variants));
10302
+ var { variants, name, defaultVariants, acceptsClassName: acceptsClassNameProp, context, ...defaultProps } = options || {}, parentDefaultVariants, parentDefaultProps;
10303
+ if (parentStaticConfig) {
10304
+ var avoid = parentStaticConfig.isHOC && !parentStaticConfig.isStyledHOC;
10305
+ if (!avoid) {
10306
+ var pdp = parentStaticConfig.defaultProps;
10307
+ for (var key2 in pdp) {
10308
+ var val = pdp[key2];
10309
+ parentStaticConfig.defaultVariants && key2 in parentStaticConfig.defaultVariants && (!defaultVariants || !(key2 in defaultVariants)) && (parentDefaultVariants || (parentDefaultVariants = {}), parentDefaultVariants[key2] = val), key2 in defaultProps || (parentDefaultProps || (parentDefaultProps = {}), parentDefaultProps[key2] = pdp[key2]);
10277
10310
  }
10311
+ parentStaticConfig.variants && (variants = (0, import_mergeVariants.mergeVariants)(parentStaticConfig.variants, variants));
10278
10312
  }
10279
- (parentDefaultProps || defaultVariants || parentDefaultVariants) && (defaultProps = {
10280
- ...parentDefaultProps,
10281
- ...parentDefaultVariants,
10282
- ...defaultProps,
10283
- ...defaultVariants
10284
- }), parentStaticConfig != null && parentStaticConfig.isHOC && name && (defaultProps.componentName = name);
10285
- var isText = !!(staticExtractionOptions != null && staticExtractionOptions.isText || parentStaticConfig != null && parentStaticConfig.isText), _staticExtractionOptions_acceptsClassName, _ref, acceptsClassName = (_ref = (_staticExtractionOptions_acceptsClassName = staticExtractionOptions == null ? void 0 : staticExtractionOptions.acceptsClassName) !== null && _staticExtractionOptions_acceptsClassName !== void 0 ? _staticExtractionOptions_acceptsClassName : acceptsClassNameProp) !== null && _ref !== void 0 ? _ref : isPlainStyledComponent || isReactNative || (parentStaticConfig == null ? void 0 : parentStaticConfig.isHOC) && (parentStaticConfig == null ? void 0 : parentStaticConfig.acceptsClassName), conf = {
10286
- ...parentStaticConfig,
10287
- ...staticExtractionOptions,
10288
- ...!isPlainStyledComponent && {
10289
- Component
10290
- },
10291
- // @ts-expect-error
10292
- variants,
10293
- defaultProps,
10294
- defaultVariants,
10295
- componentName: name || (parentStaticConfig == null ? void 0 : parentStaticConfig.componentName),
10296
- isReactNative,
10297
- isText,
10298
- acceptsClassName,
10299
- context,
10300
- ...reactNativeConfig,
10301
- isStyledHOC: !!(parentStaticConfig != null && parentStaticConfig.isHOC),
10302
- parentStaticConfig
10303
- };
10304
- return (defaultProps.children || !acceptsClassName || context) && (conf.neverFlatten = !0), conf;
10305
10313
  }
10314
+ (parentDefaultProps || defaultVariants || parentDefaultVariants) && (defaultProps = {
10315
+ ...parentDefaultProps,
10316
+ ...parentDefaultVariants,
10317
+ ...defaultProps,
10318
+ ...defaultVariants
10319
+ }), parentStaticConfig != null && parentStaticConfig.isHOC && name && (defaultProps.componentName = name);
10320
+ var isText = !!(staticExtractionOptions != null && staticExtractionOptions.isText || parentStaticConfig != null && parentStaticConfig.isText), _staticExtractionOptions_acceptsClassName, _ref, acceptsClassName = (_ref = (_staticExtractionOptions_acceptsClassName = staticExtractionOptions == null ? void 0 : staticExtractionOptions.acceptsClassName) !== null && _staticExtractionOptions_acceptsClassName !== void 0 ? _staticExtractionOptions_acceptsClassName : acceptsClassNameProp) !== null && _ref !== void 0 ? _ref : isPlainStyledComponent || isReactNative || (parentStaticConfig == null ? void 0 : parentStaticConfig.isHOC) && (parentStaticConfig == null ? void 0 : parentStaticConfig.acceptsClassName), conf = {
10321
+ ...parentStaticConfig,
10322
+ ...staticExtractionOptions,
10323
+ ...!isPlainStyledComponent && {
10324
+ Component
10325
+ },
10326
+ // @ts-expect-error
10327
+ variants,
10328
+ defaultProps,
10329
+ defaultVariants,
10330
+ componentName: name || (parentStaticConfig == null ? void 0 : parentStaticConfig.componentName),
10331
+ isReactNative,
10332
+ isText,
10333
+ acceptsClassName,
10334
+ context,
10335
+ ...reactNativeConfig,
10336
+ isStyledHOC: !!(parentStaticConfig != null && parentStaticConfig.isHOC),
10337
+ parentStaticConfig
10338
+ };
10339
+ return (defaultProps.children || !acceptsClassName || context) && (conf.neverFlatten = !0), conf;
10306
10340
  }(), component = (0, import_createComponent.createComponent)(staticConfigProps || {});
10307
10341
  for (var key in ComponentIn) key !== "propTypes" && (key in component || (component[key] = ComponentIn[key]));
10308
10342
  return component;
@@ -11663,6 +11697,7 @@ var require_index_native14 = __commonJS({
11663
11697
  __reExport2(src_exports2, require_themeable_native(), module2.exports);
11664
11698
  __reExport2(src_exports2, require_themes_native(), module2.exports);
11665
11699
  __reExport2(src_exports2, require_transformsToString_native(), module2.exports);
11700
+ __reExport2(src_exports2, require_wrapStyleTags_native(), module2.exports);
11666
11701
  var import_useMedia = require_useMedia_native();
11667
11702
  __reExport2(src_exports2, require_useTheme_native(), module2.exports);
11668
11703
  __reExport2(src_exports2, require_useThemeName_native(), module2.exports);
@@ -15613,7 +15648,7 @@ var require_Adapt_native = __commonJS({
15613
15648
  var { platform: platform2, when, children } = param, context = import_react3.default.useContext(AdaptParentContext), media = (0, import_core12.useMedia)(), enabled = !1;
15614
15649
  return typeof when == "function" ? enabled = when({
15615
15650
  media
15616
- }) : (platform2 === "touch" ? enabled = import_constants4.isTouchable : platform2 === "native" ? enabled = !import_constants4.isWeb : platform2 === "web" ? enabled = import_constants4.isWeb : platform2 === "ios" ? enabled = import_constants4.isIos : platform2 === "android" && (enabled = import_constants4.isAndroid), when && !media[when] && (enabled = !1)), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
15651
+ }) : (enabled = !platform2, platform2 === "touch" && (enabled = import_constants4.isTouchable), platform2 === "native" && (enabled = !import_constants4.isWeb), platform2 === "web" && (enabled = import_constants4.isWeb), platform2 === "ios" && (enabled = import_constants4.isIos), platform2 === "android" && (enabled = import_constants4.isAndroid), when && !media[when] && (enabled = !1)), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
15617
15652
  if (enabled) return context == null || context.setWhen(when || enabled), function() {
15618
15653
  context == null || context.setWhen(null);
15619
15654
  };