@tamagui/core 2.3.0 → 2.3.2-1782110552417

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.
@@ -1,4 +1,4 @@
1
1
  $ tamagui-build
2
- built @tamagui/core in 1067 ms
2
+ built @tamagui/core in 1483 ms
3
3
  Running afterBuild script...
4
- afterBuild completed in 280 ms
4
+ afterBuild completed in 493 ms
package/dist/native.cjs CHANGED
@@ -1011,7 +1011,7 @@ var init_index_native$11 = __esmMin((() => {
1011
1011
  avoidUpdates = true;
1012
1012
  queuedUpdates = /* @__PURE__ */ new Map();
1013
1013
  if (ENABLE) {
1014
- let ensureRectFetchObserver = function() {
1014
+ let ensureRectFetchObserver2 = function() {
1015
1015
  if (rectFetchObserver) return rectFetchObserver;
1016
1016
  rectFetchObserver = new IntersectionObserver(function(entries) {
1017
1017
  lastCallbackDelay = Math.round(performance.now() - rectFetchStartTime);
@@ -1108,7 +1108,7 @@ var init_index_native$11 = __esmMin((() => {
1108
1108
  }
1109
1109
  }
1110
1110
  if (visibleNodes.length > 0) {
1111
- var io = ensureRectFetchObserver();
1111
+ var io = ensureRectFetchObserver2();
1112
1112
  rectFetchStartTime = performance.now();
1113
1113
  for (var i = 0; i < visibleNodes.length; i++) io.observe(visibleNodes[i]);
1114
1114
  var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
@@ -11904,6 +11904,7 @@ var init_config_native = __esmMin((() => {
11904
11904
  };
11905
11905
  updateConfig = function(key, value) {
11906
11906
  var config = getConfigFromGlobalOrLocal();
11907
+ if (!config || !Object.prototype.hasOwnProperty.call(config, key)) return;
11907
11908
  Object.assign(config[key], value);
11908
11909
  };
11909
11910
  getFont = function(name) {
@@ -14172,25 +14173,28 @@ function expandStyle(key, value) {
14172
14173
  }
14173
14174
  return;
14174
14175
  }
14175
- if (key in nativeExpansions) return nativeExpansions[key].map(function(k) {
14176
+ if (key in nativeInlineExpansions) return nativeInlineExpansions[key].map(function(k) {
14177
+ return [k, value];
14178
+ });
14179
+ if (key in universalExpansions) return universalExpansions[key].map(function(k) {
14176
14180
  return [k, value];
14177
14181
  });
14178
14182
  if (key in EXPANSIONS) return EXPANSIONS[key].map(function(k) {
14179
14183
  return [k, value];
14180
14184
  });
14181
14185
  }
14182
- var _loop, resizeModeMap, verticalAlignMap, all, horiz, vert, EXPANSIONS, nativeExpansions;
14186
+ var _loop, resizeModeMap, verticalAlignMap, all, horiz, vert, EXPANSIONS, universalExpansions, nativeInlineExpansions;
14183
14187
  var init_expandStyle_native = __esmMin((() => {
14184
14188
  init_index_native$7();
14185
14189
  init_config_native();
14186
14190
  init_parseBorderShorthand_native();
14187
14191
  init_parseOutlineShorthand_native();
14188
14192
  init_objectSpread2();
14189
- _loop = function(parent) {
14193
+ _loop = function(parent2) {
14190
14194
  var _exec;
14191
14195
  var _exec_index;
14192
- var prefix = parent.slice(0, (_exec_index = (_exec = /[A-Z]/.exec(parent)) === null || _exec === void 0 ? void 0 : _exec.index) !== null && _exec_index !== void 0 ? _exec_index : parent.length);
14193
- EXPANSIONS[parent] = EXPANSIONS[parent].map(function(k) {
14196
+ var prefix = parent2.slice(0, (_exec_index = (_exec = /[A-Z]/.exec(parent2)) === null || _exec === void 0 ? void 0 : _exec.index) !== null && _exec_index !== void 0 ? _exec_index : parent2.length);
14197
+ EXPANSIONS[parent2] = EXPANSIONS[parent2].map(function(k) {
14194
14198
  return `${prefix}${k}`;
14195
14199
  });
14196
14200
  };
@@ -14242,52 +14246,54 @@ var init_expandStyle_native = __esmMin((() => {
14242
14246
  paddingVertical: vert
14243
14247
  }, false);
14244
14248
  for (var parent in EXPANSIONS) _loop(parent);
14245
- nativeExpansions = {
14249
+ universalExpansions = {
14250
+ inset: [
14251
+ "top",
14252
+ "right",
14253
+ "bottom",
14254
+ "left"
14255
+ ],
14256
+ insetBlock: ["top", "bottom"],
14257
+ insetBlockStart: ["top"],
14258
+ insetBlockEnd: ["bottom"],
14259
+ marginBlock: ["marginTop", "marginBottom"],
14260
+ marginBlockStart: ["marginTop"],
14261
+ marginBlockEnd: ["marginBottom"],
14262
+ paddingBlock: ["paddingTop", "paddingBottom"],
14263
+ paddingBlockStart: ["paddingTop"],
14264
+ paddingBlockEnd: ["paddingBottom"],
14246
14265
  borderBlockColor: ["borderTopColor", "borderBottomColor"],
14247
- borderInlineColor: ["borderEndColor", "borderStartColor"],
14248
14266
  borderBlockWidth: ["borderTopWidth", "borderBottomWidth"],
14249
- borderInlineWidth: ["borderEndWidth", "borderStartWidth"],
14250
14267
  borderBlockStyle: ["borderTopStyle", "borderBottomStyle"],
14251
- borderInlineStyle: ["borderEndStyle", "borderStartStyle"],
14252
14268
  borderBlockStartColor: ["borderTopColor"],
14253
14269
  borderBlockEndColor: ["borderBottomColor"],
14254
- borderInlineStartColor: ["borderStartColor"],
14255
- borderInlineEndColor: ["borderEndColor"],
14256
14270
  borderBlockStartWidth: ["borderTopWidth"],
14257
14271
  borderBlockEndWidth: ["borderBottomWidth"],
14258
- borderInlineStartWidth: ["borderStartWidth"],
14259
- borderInlineEndWidth: ["borderEndWidth"],
14260
14272
  borderBlockStartStyle: ["borderTopStyle"],
14261
14273
  borderBlockEndStyle: ["borderBottomStyle"],
14274
+ minBlockSize: ["minHeight"],
14275
+ maxBlockSize: ["maxHeight"],
14276
+ minInlineSize: ["minWidth"],
14277
+ maxInlineSize: ["maxWidth"],
14278
+ blockSize: ["height"],
14279
+ inlineSize: ["width"]
14280
+ };
14281
+ nativeInlineExpansions = {
14282
+ borderInlineColor: ["borderEndColor", "borderStartColor"],
14283
+ borderInlineWidth: ["borderEndWidth", "borderStartWidth"],
14284
+ borderInlineStyle: ["borderEndStyle", "borderStartStyle"],
14285
+ borderInlineStartColor: ["borderStartColor"],
14286
+ borderInlineEndColor: ["borderEndColor"],
14287
+ borderInlineStartWidth: ["borderStartWidth"],
14288
+ borderInlineEndWidth: ["borderEndWidth"],
14262
14289
  borderInlineStartStyle: ["borderStartStyle"],
14263
14290
  borderInlineEndStyle: ["borderEndStyle"],
14264
- marginBlock: ["marginTop", "marginBottom"],
14265
14291
  marginInline: ["marginEnd", "marginStart"],
14266
- paddingBlock: ["paddingTop", "paddingBottom"],
14267
- paddingInline: ["paddingEnd", "paddingStart"],
14268
- marginBlockStart: ["marginTop"],
14269
- marginBlockEnd: ["marginBottom"],
14270
14292
  marginInlineStart: ["marginStart"],
14271
14293
  marginInlineEnd: ["marginEnd"],
14272
- paddingBlockStart: ["paddingTop"],
14273
- paddingBlockEnd: ["paddingBottom"],
14294
+ paddingInline: ["paddingEnd", "paddingStart"],
14274
14295
  paddingInlineStart: ["paddingStart"],
14275
14296
  paddingInlineEnd: ["paddingEnd"],
14276
- minBlockSize: ["minHeight"],
14277
- maxBlockSize: ["maxHeight"],
14278
- minInlineSize: ["minWidth"],
14279
- maxInlineSize: ["maxWidth"],
14280
- blockSize: ["height"],
14281
- inlineSize: ["width"],
14282
- inset: [
14283
- "top",
14284
- "right",
14285
- "bottom",
14286
- "left"
14287
- ],
14288
- insetBlock: ["top", "bottom"],
14289
- insetBlockStart: ["top"],
14290
- insetBlockEnd: ["bottom"],
14291
14297
  insetInlineStart: ["left"],
14292
14298
  insetInlineEnd: ["right"]
14293
14299
  };
@@ -16902,9 +16908,21 @@ function createComponent(staticConfig) {
16902
16908
  });
16903
16909
  function notifyGroupSubscribers(groupContext, groupEmitter, pseudo) {
16904
16910
  if (!groupContext || !groupEmitter) return;
16905
- var nextState = _objectSpread2(_objectSpread2({}, groupContext.state), {}, { pseudo });
16906
- groupEmitter.emit(nextState);
16907
- groupContext.state = nextState;
16911
+ var prevPseudo = groupContext.state.pseudo;
16912
+ var shouldReplacePseudo = !prevPseudo || "unmounted" in prevPseudo || "group" in prevPseudo || "hasDynGroupChildren" in prevPseudo || "transition" in prevPseudo;
16913
+ var nextPseudo = shouldReplacePseudo ? {} : prevPseudo;
16914
+ var didChange = shouldReplacePseudo;
16915
+ for (var i = 0; i < groupPseudoKeys.length; i++) {
16916
+ var key = groupPseudoKeys[i];
16917
+ var value = pseudo[key];
16918
+ if (nextPseudo[key] !== value) {
16919
+ nextPseudo[key] = value;
16920
+ didChange = true;
16921
+ } else if (didChange) nextPseudo[key] = value;
16922
+ }
16923
+ if (!didChange) return;
16924
+ groupContext.state.pseudo = nextPseudo;
16925
+ groupEmitter.emit(groupContext.state);
16908
16926
  }
16909
16927
  if (staticConfig.componentName) component.displayName = staticConfig.componentName;
16910
16928
  var res = component;
@@ -16936,7 +16954,7 @@ function getRenderElementForPlatform(potential) {
16936
16954
  function isHTMLElement(el) {
16937
16955
  return typeof el["type"] === "string" && el["type"][0] === el["type"][0].toLowerCase();
16938
16956
  }
16939
- var _excluded$2, _excluded2$1, componentSetStates, avoidReRenderKeys, BaseText, BaseView, hasSetupBaseViews, lastInteractionWasKeyboard, lastInteractionWasTouch, fromPx, getCustomRender;
16957
+ var _excluded$2, _excluded2$1, componentSetStates, avoidReRenderKeys, groupPseudoKeys, BaseText, BaseView, hasSetupBaseViews, lastInteractionWasKeyboard, lastInteractionWasTouch, fromPx, getCustomRender;
16940
16958
  var init_createComponent_native = __esmMin((() => {
16941
16959
  init_index_native$4();
16942
16960
  init_index_native$7();
@@ -17007,6 +17025,15 @@ var init_createComponent_native = __esmMin((() => {
17007
17025
  "media",
17008
17026
  "group"
17009
17027
  ]);
17028
+ groupPseudoKeys = [
17029
+ "disabled",
17030
+ "hover",
17031
+ "press",
17032
+ "pressIn",
17033
+ "focus",
17034
+ "focusVisible",
17035
+ "focusWithin"
17036
+ ];
17010
17037
  hasSetupBaseViews = false;
17011
17038
  lastInteractionWasKeyboard = { value: false };
17012
17039
  lastInteractionWasTouch = { value: false };
@@ -432,6 +432,7 @@ var getThemes = function() {
432
432
  };
433
433
  var updateConfig = function(key, value) {
434
434
  var config = getConfigFromGlobalOrLocal();
435
+ if (!config || !Object.prototype.hasOwnProperty.call(config, key)) return;
435
436
  Object.assign(config[key], value);
436
437
  };
437
438
  var getFont = function(name) {
@@ -2781,11 +2782,11 @@ function parseOutlineShorthand(value) {
2781
2782
  }
2782
2783
  //#endregion
2783
2784
  //#region ../web/dist/esm/helpers/expandStyle.native.js
2784
- var _loop = function(parent) {
2785
+ var _loop = function(parent2) {
2785
2786
  var _exec;
2786
2787
  var _exec_index;
2787
- var prefix = parent.slice(0, (_exec_index = (_exec = /[A-Z]/.exec(parent)) === null || _exec === void 0 ? void 0 : _exec.index) !== null && _exec_index !== void 0 ? _exec_index : parent.length);
2788
- EXPANSIONS[parent] = EXPANSIONS[parent].map(function(k) {
2788
+ var prefix = parent2.slice(0, (_exec_index = (_exec = /[A-Z]/.exec(parent2)) === null || _exec === void 0 ? void 0 : _exec.index) !== null && _exec_index !== void 0 ? _exec_index : parent2.length);
2789
+ EXPANSIONS[parent2] = EXPANSIONS[parent2].map(function(k) {
2789
2790
  return `${prefix}${k}`;
2790
2791
  });
2791
2792
  };
@@ -2812,7 +2813,10 @@ function expandStyle(key, value) {
2812
2813
  }
2813
2814
  return;
2814
2815
  }
2815
- if (key in nativeExpansions) return nativeExpansions[key].map(function(k) {
2816
+ if (key in nativeInlineExpansions) return nativeInlineExpansions[key].map(function(k) {
2817
+ return [k, value];
2818
+ });
2819
+ if (key in universalExpansions) return universalExpansions[key].map(function(k) {
2816
2820
  return [k, value];
2817
2821
  });
2818
2822
  if (key in EXPANSIONS) return EXPANSIONS[key].map(function(k) {
@@ -2867,52 +2871,54 @@ var EXPANSIONS = _objectSpread2({
2867
2871
  paddingVertical: vert
2868
2872
  }, false);
2869
2873
  for (var parent in EXPANSIONS) _loop(parent);
2870
- var nativeExpansions = {
2874
+ var universalExpansions = {
2875
+ inset: [
2876
+ "top",
2877
+ "right",
2878
+ "bottom",
2879
+ "left"
2880
+ ],
2881
+ insetBlock: ["top", "bottom"],
2882
+ insetBlockStart: ["top"],
2883
+ insetBlockEnd: ["bottom"],
2884
+ marginBlock: ["marginTop", "marginBottom"],
2885
+ marginBlockStart: ["marginTop"],
2886
+ marginBlockEnd: ["marginBottom"],
2887
+ paddingBlock: ["paddingTop", "paddingBottom"],
2888
+ paddingBlockStart: ["paddingTop"],
2889
+ paddingBlockEnd: ["paddingBottom"],
2871
2890
  borderBlockColor: ["borderTopColor", "borderBottomColor"],
2872
- borderInlineColor: ["borderEndColor", "borderStartColor"],
2873
2891
  borderBlockWidth: ["borderTopWidth", "borderBottomWidth"],
2874
- borderInlineWidth: ["borderEndWidth", "borderStartWidth"],
2875
2892
  borderBlockStyle: ["borderTopStyle", "borderBottomStyle"],
2876
- borderInlineStyle: ["borderEndStyle", "borderStartStyle"],
2877
2893
  borderBlockStartColor: ["borderTopColor"],
2878
2894
  borderBlockEndColor: ["borderBottomColor"],
2879
- borderInlineStartColor: ["borderStartColor"],
2880
- borderInlineEndColor: ["borderEndColor"],
2881
2895
  borderBlockStartWidth: ["borderTopWidth"],
2882
2896
  borderBlockEndWidth: ["borderBottomWidth"],
2883
- borderInlineStartWidth: ["borderStartWidth"],
2884
- borderInlineEndWidth: ["borderEndWidth"],
2885
2897
  borderBlockStartStyle: ["borderTopStyle"],
2886
2898
  borderBlockEndStyle: ["borderBottomStyle"],
2899
+ minBlockSize: ["minHeight"],
2900
+ maxBlockSize: ["maxHeight"],
2901
+ minInlineSize: ["minWidth"],
2902
+ maxInlineSize: ["maxWidth"],
2903
+ blockSize: ["height"],
2904
+ inlineSize: ["width"]
2905
+ };
2906
+ var nativeInlineExpansions = {
2907
+ borderInlineColor: ["borderEndColor", "borderStartColor"],
2908
+ borderInlineWidth: ["borderEndWidth", "borderStartWidth"],
2909
+ borderInlineStyle: ["borderEndStyle", "borderStartStyle"],
2910
+ borderInlineStartColor: ["borderStartColor"],
2911
+ borderInlineEndColor: ["borderEndColor"],
2912
+ borderInlineStartWidth: ["borderStartWidth"],
2913
+ borderInlineEndWidth: ["borderEndWidth"],
2887
2914
  borderInlineStartStyle: ["borderStartStyle"],
2888
2915
  borderInlineEndStyle: ["borderEndStyle"],
2889
- marginBlock: ["marginTop", "marginBottom"],
2890
2916
  marginInline: ["marginEnd", "marginStart"],
2891
- paddingBlock: ["paddingTop", "paddingBottom"],
2892
- paddingInline: ["paddingEnd", "paddingStart"],
2893
- marginBlockStart: ["marginTop"],
2894
- marginBlockEnd: ["marginBottom"],
2895
2917
  marginInlineStart: ["marginStart"],
2896
2918
  marginInlineEnd: ["marginEnd"],
2897
- paddingBlockStart: ["paddingTop"],
2898
- paddingBlockEnd: ["paddingBottom"],
2919
+ paddingInline: ["paddingEnd", "paddingStart"],
2899
2920
  paddingInlineStart: ["paddingStart"],
2900
2921
  paddingInlineEnd: ["paddingEnd"],
2901
- minBlockSize: ["minHeight"],
2902
- maxBlockSize: ["maxHeight"],
2903
- minInlineSize: ["minWidth"],
2904
- maxInlineSize: ["maxWidth"],
2905
- blockSize: ["height"],
2906
- inlineSize: ["width"],
2907
- inset: [
2908
- "top",
2909
- "right",
2910
- "bottom",
2911
- "left"
2912
- ],
2913
- insetBlock: ["top", "bottom"],
2914
- insetBlockStart: ["top"],
2915
- insetBlockEnd: ["bottom"],
2916
2922
  insetInlineStart: ["left"],
2917
2923
  insetInlineEnd: ["right"]
2918
2924
  };
@@ -4894,6 +4900,15 @@ var avoidReRenderKeys = /* @__PURE__ */ new Set([
4894
4900
  "media",
4895
4901
  "group"
4896
4902
  ]);
4903
+ var groupPseudoKeys = [
4904
+ "disabled",
4905
+ "hover",
4906
+ "press",
4907
+ "pressIn",
4908
+ "focus",
4909
+ "focusVisible",
4910
+ "focusWithin"
4911
+ ];
4897
4912
  var BaseText;
4898
4913
  var BaseView;
4899
4914
  var hasSetupBaseViews = false;
@@ -5412,9 +5427,21 @@ function createComponent(staticConfig) {
5412
5427
  });
5413
5428
  function notifyGroupSubscribers(groupContext, groupEmitter, pseudo) {
5414
5429
  if (!groupContext || !groupEmitter) return;
5415
- var nextState = _objectSpread2(_objectSpread2({}, groupContext.state), {}, { pseudo });
5416
- groupEmitter.emit(nextState);
5417
- groupContext.state = nextState;
5430
+ var prevPseudo = groupContext.state.pseudo;
5431
+ var shouldReplacePseudo = !prevPseudo || "unmounted" in prevPseudo || "group" in prevPseudo || "hasDynGroupChildren" in prevPseudo || "transition" in prevPseudo;
5432
+ var nextPseudo = shouldReplacePseudo ? {} : prevPseudo;
5433
+ var didChange = shouldReplacePseudo;
5434
+ for (var i = 0; i < groupPseudoKeys.length; i++) {
5435
+ var key = groupPseudoKeys[i];
5436
+ var value = pseudo[key];
5437
+ if (nextPseudo[key] !== value) {
5438
+ nextPseudo[key] = value;
5439
+ didChange = true;
5440
+ } else if (didChange) nextPseudo[key] = value;
5441
+ }
5442
+ if (!didChange) return;
5443
+ groupContext.state.pseudo = nextPseudo;
5444
+ groupEmitter.emit(groupContext.state);
5418
5445
  }
5419
5446
  if (staticConfig.componentName) component.displayName = staticConfig.componentName;
5420
5447
  var res = component;
@@ -6924,7 +6951,7 @@ function rectsEqual(a, b) {
6924
6951
  return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
6925
6952
  }
6926
6953
  if (ENABLE) {
6927
- let ensureRectFetchObserver = function() {
6954
+ let ensureRectFetchObserver2 = function() {
6928
6955
  if (rectFetchObserver) return rectFetchObserver;
6929
6956
  rectFetchObserver = new IntersectionObserver(function(entries) {
6930
6957
  lastCallbackDelay = Math.round(performance.now() - rectFetchStartTime);
@@ -7021,7 +7048,7 @@ if (ENABLE) {
7021
7048
  }
7022
7049
  }
7023
7050
  if (visibleNodes.length > 0) {
7024
- var io = ensureRectFetchObserver();
7051
+ var io = ensureRectFetchObserver2();
7025
7052
  rectFetchStartTime = performance.now();
7026
7053
  for (var i = 0; i < visibleNodes.length; i++) io.observe(visibleNodes[i]);
7027
7054
  var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "2.3.0",
3
+ "version": "2.3.2-1782110552417",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -79,17 +79,17 @@
79
79
  "clean:build": "tamagui-build clean:build"
80
80
  },
81
81
  "dependencies": {
82
- "@tamagui/helpers": "2.3.0",
83
- "@tamagui/react-native-media-driver": "2.3.0",
84
- "@tamagui/react-native-use-pressable": "2.3.0",
85
- "@tamagui/use-element-layout": "2.3.0",
86
- "@tamagui/use-event": "2.3.0",
87
- "@tamagui/web": "2.3.0"
82
+ "@tamagui/helpers": "2.3.2-1782110552417",
83
+ "@tamagui/react-native-media-driver": "2.3.2-1782110552417",
84
+ "@tamagui/react-native-use-pressable": "2.3.2-1782110552417",
85
+ "@tamagui/use-element-layout": "2.3.2-1782110552417",
86
+ "@tamagui/use-event": "2.3.2-1782110552417",
87
+ "@tamagui/web": "2.3.2-1782110552417"
88
88
  },
89
89
  "devDependencies": {
90
- "@tamagui/build": "2.3.0",
91
- "@tamagui/native-bundle": "2.3.0",
92
- "@tamagui/react-native-web-lite": "2.3.0",
90
+ "@tamagui/build": "2.3.2-1782110552417",
91
+ "@tamagui/native-bundle": "2.3.2-1782110552417",
92
+ "@tamagui/react-native-web-lite": "2.3.2-1782110552417",
93
93
  "@testing-library/react": "^16.1.0",
94
94
  "csstype": "^3.0.10",
95
95
  "react": ">=19",