@tamagui/core 1.141.3 → 1.141.4

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.
@@ -4883,19 +4883,19 @@ function toPx(length) {
4883
4883
  return value;
4884
4884
  }
4885
4885
  }
4886
- function _class_call_check$1(instance, Constructor) {
4886
+ function _class_call_check(instance, Constructor) {
4887
4887
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
4888
4888
  }
4889
- function _defineProperties$1(target, props) {
4889
+ function _defineProperties(target, props) {
4890
4890
  for (var i = 0; i < props.length; i++) {
4891
4891
  var descriptor = props[i];
4892
4892
  descriptor.enumerable = descriptor.enumerable || false, descriptor.configurable = true, "value" in descriptor && (descriptor.writable = true), Object.defineProperty(target, descriptor.key, descriptor);
4893
4893
  }
4894
4894
  }
4895
- function _create_class$1(Constructor, protoProps, staticProps) {
4896
- return protoProps && _defineProperties$1(Constructor.prototype, protoProps), Constructor;
4895
+ function _create_class(Constructor, protoProps, staticProps) {
4896
+ return protoProps && _defineProperties(Constructor.prototype, protoProps), Constructor;
4897
4897
  }
4898
- function _define_property$1(obj, key, value) {
4898
+ function _define_property(obj, key, value) {
4899
4899
  return key in obj ? Object.defineProperty(obj, key, {
4900
4900
  value,
4901
4901
  enumerable: true,
@@ -4906,11 +4906,11 @@ function _define_property$1(obj, key, value) {
4906
4906
  var NativeMediaQueryList = /* @__PURE__ */ (function() {
4907
4907
  function NativeMediaQueryList2(query) {
4908
4908
  var _this = this;
4909
- _class_call_check$1(this, NativeMediaQueryList2), _define_property$1(this, "query", void 0), _define_property$1(this, "listeners", void 0), this.query = query, this.listeners = [], this.notify(), reactNative.Dimensions.addEventListener("change", function() {
4909
+ _class_call_check(this, NativeMediaQueryList2), _define_property(this, "query", void 0), _define_property(this, "listeners", void 0), this.query = query, this.listeners = [], this.notify(), reactNative.Dimensions.addEventListener("change", function() {
4910
4910
  _this.notify();
4911
4911
  });
4912
4912
  }
4913
- return _create_class$1(NativeMediaQueryList2, [{
4913
+ return _create_class(NativeMediaQueryList2, [{
4914
4914
  key: "orientation",
4915
4915
  get: function() {
4916
4916
  var windowDimensions = reactNative.Dimensions.get("window");
@@ -4969,140 +4969,6 @@ var matchMedia = function(query) {
4969
4969
  function createMedia(media) {
4970
4970
  return setupMatchMedia(matchMedia), media;
4971
4971
  }
4972
- var MOUSE_DOWN = "mousedown", MOUSE_MOVE = "mousemove", MOUSE_UP = "mouseup", MOUSE_CANCEL = "dragstart", TOUCH_START = "touchstart", TOUCH_MOVE = "touchmove", TOUCH_END = "touchend", TOUCH_CANCEL = "touchcancel";
4973
- function isStartish(eventType) {
4974
- return eventType === TOUCH_START || eventType === MOUSE_DOWN;
4975
- }
4976
- function isMoveish(eventType) {
4977
- return eventType === TOUCH_MOVE || eventType === MOUSE_MOVE;
4978
- }
4979
- function isEndish(eventType) {
4980
- return eventType === TOUCH_END || eventType === MOUSE_UP || isCancelish(eventType);
4981
- }
4982
- function isCancelish(eventType) {
4983
- return eventType === TOUCH_CANCEL || eventType === MOUSE_CANCEL;
4984
- }
4985
- function _class_call_check(instance, Constructor) {
4986
- if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
4987
- }
4988
- function _defineProperties(target, props) {
4989
- for (var i = 0; i < props.length; i++) {
4990
- var descriptor = props[i];
4991
- descriptor.enumerable = descriptor.enumerable || false, descriptor.configurable = true, "value" in descriptor && (descriptor.writable = true), Object.defineProperty(target, descriptor.key, descriptor);
4992
- }
4993
- }
4994
- function _create_class(Constructor, protoProps, staticProps) {
4995
- return protoProps && _defineProperties(Constructor.prototype, protoProps), Constructor;
4996
- }
4997
- function _define_property(obj, key, value) {
4998
- return key in obj ? Object.defineProperty(obj, key, {
4999
- value,
5000
- enumerable: true,
5001
- configurable: true,
5002
- writable: true
5003
- }) : obj[key] = value, obj;
5004
- }
5005
- var ResponderTouchHistoryStore = /* @__PURE__ */ (function() {
5006
- function ResponderTouchHistoryStore2() {
5007
- _class_call_check(this, ResponderTouchHistoryStore2), _define_property(this, "_touchHistory", {
5008
- touchBank: [],
5009
- //Array<TouchRecord>
5010
- numberActiveTouches: 0,
5011
- // If there is only one active touch, we remember its location. This prevents
5012
- // us having to loop through all of the touches all the time in the most
5013
- // common case.
5014
- indexOfSingleActiveTouch: -1,
5015
- mostRecentTimeStamp: 0
5016
- });
5017
- }
5018
- return _create_class(ResponderTouchHistoryStore2, [{
5019
- key: "recordTouchTrack",
5020
- value: function(topLevelType, nativeEvent) {
5021
- var touchHistory = this._touchHistory;
5022
- if (isMoveish(topLevelType)) nativeEvent.changedTouches.forEach(function(touch) {
5023
- return recordTouchMove(touch, touchHistory);
5024
- });
5025
- else if (isStartish(topLevelType)) nativeEvent.changedTouches.forEach(function(touch) {
5026
- return recordTouchStart(touch, touchHistory);
5027
- }), touchHistory.numberActiveTouches = nativeEvent.touches.length, touchHistory.numberActiveTouches === 1 && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier);
5028
- else if (isEndish(topLevelType) && (nativeEvent.changedTouches.forEach(function(touch) {
5029
- return recordTouchEnd(touch, touchHistory);
5030
- }), touchHistory.numberActiveTouches = nativeEvent.touches.length, touchHistory.numberActiveTouches === 1)) {
5031
- for (var {
5032
- touchBank
5033
- } = touchHistory, i = 0; i < touchBank.length; i++) {
5034
- var touchTrackToCheck = touchBank[i];
5035
- if (touchTrackToCheck == null ? void 0 : touchTrackToCheck.touchActive) {
5036
- touchHistory.indexOfSingleActiveTouch = i;
5037
- break;
5038
- }
5039
- }
5040
- }
5041
- }
5042
- }, {
5043
- key: "touchHistory",
5044
- get: function() {
5045
- return this._touchHistory;
5046
- }
5047
- }]), ResponderTouchHistoryStore2;
5048
- })(), MAX_TOUCH_BANK = 20;
5049
- function timestampForTouch(touch) {
5050
- return touch.timeStamp || touch.timestamp;
5051
- }
5052
- function createTouchRecord(touch) {
5053
- return {
5054
- touchActive: true,
5055
- startPageX: touch.pageX,
5056
- startPageY: touch.pageY,
5057
- startTimeStamp: timestampForTouch(touch),
5058
- currentPageX: touch.pageX,
5059
- currentPageY: touch.pageY,
5060
- currentTimeStamp: timestampForTouch(touch),
5061
- previousPageX: touch.pageX,
5062
- previousPageY: touch.pageY,
5063
- previousTimeStamp: timestampForTouch(touch)
5064
- };
5065
- }
5066
- function resetTouchRecord(touchRecord, touch) {
5067
- touchRecord.touchActive = true, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, touchRecord.previousTimeStamp = timestampForTouch(touch);
5068
- }
5069
- function getTouchIdentifier(param) {
5070
- var {
5071
- identifier
5072
- } = param;
5073
- return identifier == null && console.error("Touch object is missing identifier."), identifier;
5074
- }
5075
- function recordTouchStart(touch, touchHistory) {
5076
- var identifier = getTouchIdentifier(touch), touchRecord = touchHistory.touchBank[identifier];
5077
- touchRecord ? resetTouchRecord(touchRecord, touch) : touchHistory.touchBank[identifier] = createTouchRecord(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
5078
- }
5079
- function recordTouchMove(touch, touchHistory) {
5080
- var touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
5081
- touchRecord ? (touchRecord.touchActive = true, touchRecord.previousPageX = touchRecord.currentPageX, touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.warn(`Cannot record touch move without a touch start.
5082
- `, `Touch Move: ${printTouch(touch)}
5083
- `, `Touch Bank: ${printTouchBank(touchHistory)}`);
5084
- }
5085
- function recordTouchEnd(touch, touchHistory) {
5086
- var touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
5087
- touchRecord ? (touchRecord.touchActive = false, touchRecord.previousPageX = touchRecord.currentPageX, touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.warn(`Cannot record touch end without a touch start.
5088
- `, `Touch End: ${printTouch(touch)}
5089
- `, `Touch Bank: ${printTouchBank(touchHistory)}`);
5090
- }
5091
- function printTouch(touch) {
5092
- return JSON.stringify({
5093
- identifier: touch.identifier,
5094
- pageX: touch.pageX,
5095
- pageY: touch.pageY,
5096
- timestamp: timestampForTouch(touch)
5097
- });
5098
- }
5099
- function printTouchBank(touchHistory) {
5100
- var {
5101
- touchBank
5102
- } = touchHistory, printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK));
5103
- return touchBank.length > MAX_TOUCH_BANK && (printed += ` (original size: ${touchBank.length})`), printed;
5104
- }
5105
- new ResponderTouchHistoryStore();
5106
4972
  var DisableLayoutContextKey = /* @__PURE__ */ React.createContext(""), LayoutMeasurementController = function(param) {
5107
4973
  var {
5108
4974
  disable,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "1.141.3",
3
+ "version": "1.141.4",
4
4
  "type": "module",
5
5
  "source": "src/index.tsx",
6
6
  "main": "dist/cjs",
@@ -33,18 +33,18 @@
33
33
  "native-test.d.ts"
34
34
  ],
35
35
  "dependencies": {
36
- "@tamagui/helpers": "1.141.3",
37
- "@tamagui/react-native-media-driver": "1.141.3",
38
- "@tamagui/react-native-use-pressable": "1.141.3",
39
- "@tamagui/react-native-use-responder-events": "1.141.3",
40
- "@tamagui/use-element-layout": "1.141.3",
41
- "@tamagui/use-event": "1.141.3",
42
- "@tamagui/web": "1.141.3"
36
+ "@tamagui/helpers": "1.141.4",
37
+ "@tamagui/react-native-media-driver": "1.141.4",
38
+ "@tamagui/react-native-use-pressable": "1.141.4",
39
+ "@tamagui/react-native-use-responder-events": "1.141.4",
40
+ "@tamagui/use-element-layout": "1.141.4",
41
+ "@tamagui/use-event": "1.141.4",
42
+ "@tamagui/web": "1.141.4"
43
43
  },
44
44
  "devDependencies": {
45
- "@tamagui/build": "1.141.3",
46
- "@tamagui/native-bundle": "1.141.3",
47
- "@tamagui/react-native-web-lite": "1.141.3",
45
+ "@tamagui/build": "1.141.4",
46
+ "@tamagui/native-bundle": "1.141.4",
47
+ "@tamagui/react-native-web-lite": "1.141.4",
48
48
  "@testing-library/react": "^16.1.0",
49
49
  "csstype": "^3.0.10",
50
50
  "react": "*",