@tamagui/core 1.126.0 → 1.126.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/native.js CHANGED
@@ -2823,6 +2823,73 @@ var require_getShorthandValue_native = __commonJS({
2823
2823
  }
2824
2824
  });
2825
2825
 
2826
+ // ../web/dist/cjs/helpers/getDynamicVal.native.js
2827
+ var require_getDynamicVal_native = __commonJS({
2828
+ "../web/dist/cjs/helpers/getDynamicVal.native.js"(exports2, module2) {
2829
+ "use strict";
2830
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2831
+ for (var name in all) __defProp2(target, name, {
2832
+ get: all[name],
2833
+ enumerable: !0
2834
+ });
2835
+ }, __copyProps2 = function(to, from, except, desc) {
2836
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2837
+ if (from && typeof from == "object" || typeof from == "function") try {
2838
+ for (var _loop = function() {
2839
+ var key = _step.value;
2840
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
2841
+ get: function() {
2842
+ return from[key];
2843
+ },
2844
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
2845
+ });
2846
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
2847
+ } catch (err) {
2848
+ _didIteratorError = !0, _iteratorError = err;
2849
+ } finally {
2850
+ try {
2851
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2852
+ } finally {
2853
+ if (_didIteratorError)
2854
+ throw _iteratorError;
2855
+ }
2856
+ }
2857
+ return to;
2858
+ }, __toCommonJS2 = function(mod) {
2859
+ return __copyProps2(__defProp2({}, "__esModule", {
2860
+ value: !0
2861
+ }), mod);
2862
+ }, getDynamicVal_exports = {};
2863
+ __export2(getDynamicVal_exports, {
2864
+ extractValueFromDynamic: function() {
2865
+ return extractValueFromDynamic;
2866
+ },
2867
+ getDynamicVal: function() {
2868
+ return getDynamicVal;
2869
+ },
2870
+ getOppositeScheme: function() {
2871
+ return getOppositeScheme;
2872
+ }
2873
+ });
2874
+ module2.exports = __toCommonJS2(getDynamicVal_exports);
2875
+ function getOppositeScheme(scheme) {
2876
+ return scheme === "dark" ? "light" : "dark";
2877
+ }
2878
+ function getDynamicVal(param) {
2879
+ var { scheme, val, oppositeVal } = param, oppositeScheme = getOppositeScheme(scheme);
2880
+ return {
2881
+ dynamic: {
2882
+ [scheme]: val,
2883
+ [oppositeScheme]: oppositeVal
2884
+ }
2885
+ };
2886
+ }
2887
+ function extractValueFromDynamic(val, scheme) {
2888
+ return val != null && val.dynamic ? val.dynamic[scheme] : val;
2889
+ }
2890
+ }
2891
+ });
2892
+
2826
2893
  // ../web/dist/cjs/constants/accessibilityDirectMap.native.js
2827
2894
  var require_accessibilityDirectMap_native = __commonJS({
2828
2895
  "../web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports2, module2) {
@@ -5237,7 +5304,7 @@ var require_getSplitStyles_native = __commonJS({
5237
5304
  }
5238
5305
  });
5239
5306
  module2.exports = __toCommonJS2(getSplitStyles_exports);
5240
- var import_constants2 = require_index_native2(), import_helpers2 = require_index_native3(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_consoleLog = require_consoleLog_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getCSSStylesAtomic = require_getCSSStylesAtomic_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_insertStyleRule = require_insertStyleRule_native(), import_isActivePlatform = require_isActivePlatform_native(), import_isActiveTheme = require_isActiveTheme_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_skipProps = require_skipProps_native(), import_sortString = require_sortString_native(), import_transformsToString = require_transformsToString_native(), conf, PROP_SPLIT = "-";
5307
+ var import_constants2 = require_index_native2(), import_helpers2 = require_index_native3(), import_react3 = __toESM2(require("react")), import_getDynamicVal = require_getDynamicVal_native(), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_consoleLog = require_consoleLog_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getCSSStylesAtomic = require_getCSSStylesAtomic_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_insertStyleRule = require_insertStyleRule_native(), import_isActivePlatform = require_isActivePlatform_native(), import_isActiveTheme = require_isActiveTheme_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_skipProps = require_skipProps_native(), import_sortString = require_sortString_native(), import_transformsToString = require_transformsToString_native(), conf, PROP_SPLIT = "-";
5241
5308
  function isValidStyleKey(key, validStyles2, accept) {
5242
5309
  return key in validStyles2 ? !0 : accept && key in accept;
5243
5310
  }
@@ -5435,8 +5502,8 @@ var require_getSplitStyles_native = __commonJS({
5435
5502
  }
5436
5503
  } else {
5437
5504
  var mergeMediaStyle2 = function(key5, val3) {
5438
- var _styleState3;
5439
- (_styleState3 = styleState).style || (_styleState3.style = {});
5505
+ var _styleState4;
5506
+ (_styleState4 = styleState).style || (_styleState4.style = {});
5440
5507
  var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, usedKeys, mediaState2[mediaKeyShort], importanceBump, debug);
5441
5508
  didMerge && key5 === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
5442
5509
  }, mergeMediaStyle = mergeMediaStyle2, isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
@@ -5449,7 +5516,19 @@ var require_getSplitStyles_native = __commonJS({
5449
5516
  }
5450
5517
  var mediaStyle1 = getSubStyle(styleState, key4, val2, !0), importanceBump = 0;
5451
5518
  if (isThemeMedia) {
5452
- if (dynamicThemeAccess = !0, !(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort))) return;
5519
+ if (dynamicThemeAccess = !0, import_constants2.isIos && (0, import_config.getSetting)("fastSchemeChange")) {
5520
+ var _styleState3;
5521
+ (_styleState3 = styleState).style || (_styleState3.style = {});
5522
+ var scheme = mediaKeyShort, oppositeScheme = (0, import_getDynamicVal.getOppositeScheme)(mediaKeyShort);
5523
+ for (var subKey1 in mediaStyle1) {
5524
+ var _$val1 = (0, import_getDynamicVal.extractValueFromDynamic)(mediaStyle1[subKey1], scheme), oppositeVal = (0, import_getDynamicVal.extractValueFromDynamic)(styleState.style[subKey1], oppositeScheme);
5525
+ mediaStyle1[subKey1] = (0, import_getDynamicVal.getDynamicVal)({
5526
+ scheme,
5527
+ val: _$val1,
5528
+ oppositeVal
5529
+ }), mergeStyle(styleState, subKey1, mediaStyle1[subKey1]);
5530
+ }
5531
+ } else if (!(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort))) return;
5453
5532
  } else if (isGroupMedia) {
5454
5533
  var _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
5455
5534
  if (!groupContext) {
@@ -5477,15 +5556,15 @@ var require_getSplitStyles_native = __commonJS({
5477
5556
  importanceBump = priority1;
5478
5557
  }
5479
5558
  }
5480
- for (var subKey1 in mediaStyle1) {
5481
- if (subKey1 === "space") {
5559
+ for (var subKey2 in mediaStyle1) {
5560
+ if (subKey2 === "space") {
5482
5561
  space = valInit.space;
5483
5562
  continue;
5484
5563
  }
5485
- if (subKey1[0] === "$") {
5486
- if (!(0, import_isActivePlatform.isActivePlatform)(subKey1) || !(0, import_isActiveTheme.isActiveTheme)(subKey1, themeName)) continue;
5487
- for (var subSubKey in mediaStyle1[subKey1]) mergeMediaStyle2(subSubKey, mediaStyle1[subKey1][subSubKey]);
5488
- } else mergeMediaStyle2(subKey1, mediaStyle1[subKey1]);
5564
+ if (subKey2[0] === "$") {
5565
+ if (!(0, import_isActivePlatform.isActivePlatform)(subKey2) || !(0, import_isActiveTheme.isActiveTheme)(subKey2, themeName)) continue;
5566
+ for (var subSubKey in mediaStyle1[subKey2]) mergeMediaStyle2(subSubKey, mediaStyle1[subKey2][subSubKey]);
5567
+ } else mergeMediaStyle2(subKey2, mediaStyle1[subKey2]);
5489
5568
  }
5490
5569
  }
5491
5570
  return;
@@ -6406,7 +6485,7 @@ var require_getThemeProxied_native = __commonJS({
6406
6485
  }
6407
6486
  });
6408
6487
  module2.exports = __toCommonJS2(getThemeProxied_exports);
6409
- var import_constants2 = require_index_native2(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_doesRootSchemeMatchSystem = require_doesRootSchemeMatchSystem_native(), cache2 = /* @__PURE__ */ new Map(), curKeys, curProps, curState, emptyObject = {};
6488
+ var import_constants2 = require_index_native2(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_doesRootSchemeMatchSystem = require_doesRootSchemeMatchSystem_native(), import_getDynamicVal = require_getDynamicVal_native(), cache2 = /* @__PURE__ */ new Map(), curKeys, curProps, curState, emptyObject = {};
6410
6489
  function getThemeProxied(_props, _state, _keys) {
6411
6490
  if (!(_state != null && _state.theme)) return emptyObject;
6412
6491
  if (curKeys = _keys, curProps = _props, curState = _state, cache2.has(curState.theme)) {
@@ -6427,12 +6506,11 @@ var require_getThemeProxied_native = __commonJS({
6427
6506
  if (curState) {
6428
6507
  var outVal = (0, import_createVariable.getVariable)(value), { name, scheme, inverses } = curState, shouldOptimize = scheme && platform !== "web" && import_constants2.isIos && !curProps.deopt && (0, import_config.getSetting)("fastSchemeChange") && inverses === 0 && (0, import_doesRootSchemeMatchSystem.doesRootSchemeMatchSystem)();
6429
6508
  if (shouldOptimize) {
6430
- var _config_themes_name, _config_themes_oppositeName, oppositeScheme = scheme === "dark" ? "light" : "dark", oppositeName = name.replace(scheme, oppositeScheme), color = (0, import_createVariable.getVariable)((_config_themes_name = config.themes[name]) === null || _config_themes_name === void 0 ? void 0 : _config_themes_name[key]), oppositeColor = (0, import_createVariable.getVariable)((_config_themes_oppositeName = config.themes[oppositeName]) === null || _config_themes_oppositeName === void 0 ? void 0 : _config_themes_oppositeName[key]), dynamicVal = {
6431
- dynamic: {
6432
- [scheme]: color,
6433
- [oppositeScheme]: oppositeColor
6434
- }
6435
- };
6509
+ var _config_themes_name, _config_themes_oppositeName, oppositeScheme = scheme === "dark" ? "light" : "dark", oppositeName = name.replace(scheme, oppositeScheme), color = (0, import_createVariable.getVariable)((_config_themes_name = config.themes[name]) === null || _config_themes_name === void 0 ? void 0 : _config_themes_name[key]), oppositeColor = (0, import_createVariable.getVariable)((_config_themes_oppositeName = config.themes[oppositeName]) === null || _config_themes_oppositeName === void 0 ? void 0 : _config_themes_oppositeName[key]), dynamicVal = (0, import_getDynamicVal.getDynamicVal)({
6510
+ scheme,
6511
+ val: color,
6512
+ oppositeVal: oppositeColor
6513
+ });
6436
6514
  return dynamicVal;
6437
6515
  }
6438
6516
  return process.env.NODE_ENV === "development" && curProps.debug && console.info(` \u{1F3A8} useTheme() tracking new key because of:
@@ -6994,7 +7072,7 @@ var require_useComponentState_native = __commonJS({
6994
7072
  ...states[0],
6995
7073
  [props.forceStyle]: !0
6996
7074
  } : states[0], setState = states[1], isAnimated = willBeAnimated;
6997
- import_constants2.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
7075
+ import_constants2.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), state.disabled = disabled, setState({
6998
7076
  ...state
6999
7077
  }));
7000
7078
  var groupName = props.group, setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled ? [