tamagui 2.4.0 → 2.4.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/.turbo/turbo-build.log +2 -2
- package/dist/native.cjs +153 -110
- package/dist/test.cjs +158 -114
- package/package.json +65 -65
package/.turbo/turbo-build.log
CHANGED
package/dist/native.cjs
CHANGED
|
@@ -42,8 +42,8 @@ let react_native_safe_area_context = require("react-native-safe-area-context");
|
|
|
42
42
|
if (typeof globalThis["__DEV__"] === "undefined") globalThis["__DEV__"] = false;
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/setup.ts
|
|
45
|
-
var _globalThis;
|
|
46
|
-
(_globalThis = globalThis)["React"] || (_globalThis["React"] = react$1);
|
|
45
|
+
var _globalThis$1;
|
|
46
|
+
(_globalThis$1 = globalThis)["React"] || (_globalThis$1["React"] = react$1);
|
|
47
47
|
if (typeof requestAnimationFrame === "undefined") globalThis["requestAnimationFrame"] = typeof setImmediate === "undefined" ? setTimeout : setImmediate;
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region \0@oxc-project+runtime@0.130.0/helpers/typeof.js
|
|
@@ -901,15 +901,35 @@ function startGlobalObservers() {
|
|
|
901
901
|
function rectsEqual(a, b) {
|
|
902
902
|
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function emitLayoutIfChanged(node, parentNode, nodeRect, parentRect) {
|
|
905
|
+
var onLayout = LayoutHandlers.get(node);
|
|
906
|
+
if (typeof onLayout !== "function") return;
|
|
907
|
+
var cachedRect = NodeRectCache.get(node);
|
|
908
|
+
var cachedParentRect = NodeRectCache.get(parentNode);
|
|
909
|
+
var nodeChanged = !cachedRect || !rectsEqual(cachedRect, nodeRect);
|
|
910
|
+
var parentChanged = !cachedParentRect || !rectsEqual(cachedParentRect, parentRect);
|
|
911
|
+
if (!nodeChanged && !parentChanged) return;
|
|
912
|
+
NodeRectCache.set(node, nodeRect);
|
|
913
|
+
NodeRectCache.set(parentNode, parentRect);
|
|
914
|
+
var event = getElementLayoutEvent(nodeRect, parentRect, node);
|
|
915
|
+
if (avoidUpdates) queuedUpdates.set(node, function() {
|
|
916
|
+
return onLayout(event);
|
|
917
|
+
});
|
|
918
|
+
else onLayout(event);
|
|
919
|
+
}
|
|
920
|
+
function observeLayoutNode(node, disableKey) {
|
|
905
921
|
Nodes.add(node);
|
|
906
|
-
LayoutHandlers.set(node, onChange);
|
|
907
922
|
if (disableKey) LayoutDisableKey.set(node, disableKey);
|
|
923
|
+
else LayoutDisableKey.delete(node);
|
|
908
924
|
startGlobalObservers();
|
|
909
925
|
if (globalIntersectionObserver) {
|
|
910
926
|
globalIntersectionObserver.observe(node);
|
|
911
927
|
IntersectionState.set(node, true);
|
|
912
928
|
}
|
|
929
|
+
}
|
|
930
|
+
function registerLayoutNode(node, onChange, disableKey) {
|
|
931
|
+
LayoutHandlers.set(node, onChange);
|
|
932
|
+
observeLayoutNode(node, disableKey);
|
|
913
933
|
return function() {
|
|
914
934
|
return cleanupNode(node);
|
|
915
935
|
};
|
|
@@ -922,6 +942,17 @@ function cleanupNode(node) {
|
|
|
922
942
|
IntersectionState.delete(node);
|
|
923
943
|
if (globalIntersectionObserver) globalIntersectionObserver.unobserve(node);
|
|
924
944
|
}
|
|
945
|
+
function emitLayoutSync(node) {
|
|
946
|
+
var onLayout = LayoutHandlers.get(node);
|
|
947
|
+
if (typeof onLayout !== "function") return;
|
|
948
|
+
var parentNode = node.parentElement;
|
|
949
|
+
if (!parentNode) return;
|
|
950
|
+
var nodeRect = node.getBoundingClientRect();
|
|
951
|
+
var parentRect = parentNode.getBoundingClientRect();
|
|
952
|
+
NodeRectCache.set(node, nodeRect);
|
|
953
|
+
NodeRectCache.set(parentNode, parentRect);
|
|
954
|
+
onLayout(getElementLayoutEvent(nodeRect, parentRect, node));
|
|
955
|
+
}
|
|
925
956
|
function useElementLayout$1(ref, onLayout) {
|
|
926
957
|
var _ref_current;
|
|
927
958
|
var disableKey = (0, react$1.useContext)(DisableLayoutContextKey);
|
|
@@ -939,35 +970,17 @@ function useElementLayout$1(ref, onLayout) {
|
|
|
939
970
|
if (prevNode) cleanupNode(prevNode);
|
|
940
971
|
PrevHostNode.set(ref, nextNode);
|
|
941
972
|
if (!nextNode) return;
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
globalIntersectionObserver.observe(nextNode);
|
|
946
|
-
IntersectionState.set(nextNode, true);
|
|
947
|
-
}
|
|
948
|
-
var handler = LayoutHandlers.get(nextNode);
|
|
949
|
-
if (typeof handler !== "function") return;
|
|
950
|
-
var parentNode = nextNode.parentElement;
|
|
951
|
-
if (!parentNode) return;
|
|
952
|
-
var nodeRect = nextNode.getBoundingClientRect();
|
|
953
|
-
var parentRect = parentNode.getBoundingClientRect();
|
|
954
|
-
NodeRectCache.set(nextNode, nodeRect);
|
|
955
|
-
NodeRectCache.set(parentNode, parentRect);
|
|
956
|
-
handler(getElementLayoutEvent(nodeRect, parentRect, nextNode));
|
|
973
|
+
LayoutHandlers.set(nextNode, onLayout);
|
|
974
|
+
observeLayoutNode(nextNode, disableKey);
|
|
975
|
+
emitLayoutSync(nextNode);
|
|
957
976
|
});
|
|
958
977
|
useIsomorphicLayoutEffect(function() {
|
|
959
978
|
var _ref_current2;
|
|
960
979
|
if (!onLayout) return;
|
|
961
980
|
var node2 = (_ref_current2 = ref.current) === null || _ref_current2 === void 0 ? void 0 : _ref_current2.host;
|
|
962
981
|
if (!node2) return;
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
if (globalIntersectionObserver) {
|
|
966
|
-
globalIntersectionObserver.observe(node2);
|
|
967
|
-
IntersectionState.set(node2, true);
|
|
968
|
-
}
|
|
969
|
-
var parentNode = node2.parentNode;
|
|
970
|
-
if (parentNode) onLayout(getElementLayoutEvent(node2.getBoundingClientRect(), parentNode.getBoundingClientRect(), node2));
|
|
982
|
+
LayoutHandlers.set(node2, onLayout);
|
|
983
|
+
observeLayoutNode(node2, disableKey);
|
|
971
984
|
return function() {
|
|
972
985
|
cleanupNode(node2);
|
|
973
986
|
var swappedNode = PrevHostNode.get(ref);
|
|
@@ -1043,8 +1056,7 @@ var init_index_native$11 = __esmMin((() => {
|
|
|
1043
1056
|
}
|
|
1044
1057
|
function _updateLayoutIfChanged() {
|
|
1045
1058
|
_updateLayoutIfChanged = _asyncToGenerator(function* (node) {
|
|
1046
|
-
|
|
1047
|
-
if (typeof onLayout !== "function") return;
|
|
1059
|
+
if (typeof LayoutHandlers.get(node) !== "function") return;
|
|
1048
1060
|
var parentNode = node.parentElement;
|
|
1049
1061
|
if (!parentNode) return;
|
|
1050
1062
|
var nodeRect;
|
|
@@ -1057,19 +1069,7 @@ var init_index_native$11 = __esmMin((() => {
|
|
|
1057
1069
|
nodeRect = node.getBoundingClientRect();
|
|
1058
1070
|
parentRect = parentNode.getBoundingClientRect();
|
|
1059
1071
|
}
|
|
1060
|
-
|
|
1061
|
-
var cachedParentRect = NodeRectCache.get(parentNode);
|
|
1062
|
-
var nodeChanged = !cachedRect || !rectsEqual(cachedRect, nodeRect);
|
|
1063
|
-
var parentChanged = !cachedParentRect || !rectsEqual(cachedParentRect, parentRect);
|
|
1064
|
-
if (nodeChanged || parentChanged) {
|
|
1065
|
-
NodeRectCache.set(node, nodeRect);
|
|
1066
|
-
NodeRectCache.set(parentNode, parentRect);
|
|
1067
|
-
var event = getElementLayoutEvent(nodeRect, parentRect, node);
|
|
1068
|
-
if (avoidUpdates) queuedUpdates.set(node, function() {
|
|
1069
|
-
return onLayout(event);
|
|
1070
|
-
});
|
|
1071
|
-
else onLayout(event);
|
|
1072
|
-
}
|
|
1072
|
+
emitLayoutIfChanged(node, parentNode, nodeRect, parentRect);
|
|
1073
1073
|
});
|
|
1074
1074
|
return _updateLayoutIfChanged.apply(this, arguments);
|
|
1075
1075
|
}
|
|
@@ -13665,6 +13665,10 @@ function releaseExternalPressOwnership(token, debugName) {
|
|
|
13665
13665
|
if (!token || pressState.owner !== token) return;
|
|
13666
13666
|
resetPressOwner();
|
|
13667
13667
|
}
|
|
13668
|
+
function hasExternalPressOwnership() {
|
|
13669
|
+
resetStaleOwner(Date.now());
|
|
13670
|
+
return pressState.ownerSource === "external";
|
|
13671
|
+
}
|
|
13668
13672
|
function getGestureHandler() {
|
|
13669
13673
|
return {
|
|
13670
13674
|
get isEnabled() {
|
|
@@ -13795,7 +13799,7 @@ function getGestureHandler() {
|
|
|
13795
13799
|
}
|
|
13796
13800
|
};
|
|
13797
13801
|
}
|
|
13798
|
-
var state$6, GESTURE_ENABLED_FREEZE_KEY$1, pressGestureDebugId, externalPressDebugId, PRESS_MOVE_CANCEL_DISTANCE, PRESS_MOVE_CANCEL_DISTANCE_SQ, pressState;
|
|
13802
|
+
var _globalThis, _PRESS_STATE_KEY, state$6, GESTURE_ENABLED_FREEZE_KEY$1, pressGestureDebugId, externalPressDebugId, PRESS_MOVE_CANCEL_DISTANCE, PRESS_MOVE_CANCEL_DISTANCE_SQ, PRESS_STATE_KEY, _$1, pressState;
|
|
13799
13803
|
var init_gestureState_native = __esmMin((() => {
|
|
13800
13804
|
init_globalState_native();
|
|
13801
13805
|
state$6 = createGlobalState(`gesture`, {
|
|
@@ -13810,7 +13814,8 @@ var init_gestureState_native = __esmMin((() => {
|
|
|
13810
13814
|
externalPressDebugId = 0;
|
|
13811
13815
|
PRESS_MOVE_CANCEL_DISTANCE = 12;
|
|
13812
13816
|
PRESS_MOVE_CANCEL_DISTANCE_SQ = PRESS_MOVE_CANCEL_DISTANCE * PRESS_MOVE_CANCEL_DISTANCE;
|
|
13813
|
-
|
|
13817
|
+
PRESS_STATE_KEY = "__tamagui_press_state__";
|
|
13818
|
+
pressState = (_$1 = (_globalThis = globalThis)[_PRESS_STATE_KEY = PRESS_STATE_KEY]) !== null && _$1 !== void 0 ? _$1 : _globalThis[_PRESS_STATE_KEY] = {
|
|
13814
13819
|
owner: null,
|
|
13815
13820
|
ownerId: null,
|
|
13816
13821
|
ownerSource: null,
|
|
@@ -14037,6 +14042,7 @@ var index_native_exports = /* @__PURE__ */ __exportAll({
|
|
|
14037
14042
|
isKeyboardControllerEnabled: () => isKeyboardControllerEnabled$1,
|
|
14038
14043
|
setKeyboardControllerState: () => setKeyboardControllerState,
|
|
14039
14044
|
unstable_claimExternalPressOwnership: () => claimExternalPressOwnership,
|
|
14045
|
+
unstable_hasExternalPressOwnership: () => hasExternalPressOwnership,
|
|
14040
14046
|
unstable_releaseExternalPressOwnership: () => releaseExternalPressOwnership
|
|
14041
14047
|
});
|
|
14042
14048
|
var init_index_native$3 = __esmMin((() => {
|
|
@@ -14080,7 +14086,8 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
14080
14086
|
pressInTimer: null,
|
|
14081
14087
|
pressOutTimer: null,
|
|
14082
14088
|
longPressTimer: null,
|
|
14083
|
-
activateTime: 0
|
|
14089
|
+
activateTime: 0,
|
|
14090
|
+
blockedByExternalOwnership: false
|
|
14084
14091
|
};
|
|
14085
14092
|
if (!enabled || !events) return;
|
|
14086
14093
|
var _events_delayPressIn;
|
|
@@ -14124,11 +14131,18 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
14124
14131
|
var userTerminationRequest = viewProps.onResponderTerminationRequest;
|
|
14125
14132
|
var userMove = viewProps.onResponderMove;
|
|
14126
14133
|
viewProps.onStartShouldSetResponder = function(e) {
|
|
14127
|
-
|
|
14134
|
+
if (userStartShouldSet === null || userStartShouldSet === void 0 ? void 0 : userStartShouldSet(e)) return true;
|
|
14135
|
+
return !events.disabled && !hasExternalPressOwnership();
|
|
14128
14136
|
};
|
|
14129
14137
|
viewProps.onResponderGrant = function(e) {
|
|
14130
|
-
userGrant === null || userGrant === void 0 || userGrant(e);
|
|
14131
14138
|
cleanup();
|
|
14139
|
+
if (hasExternalPressOwnership()) {
|
|
14140
|
+
ref.current.state = "idle";
|
|
14141
|
+
ref.current.blockedByExternalOwnership = true;
|
|
14142
|
+
return;
|
|
14143
|
+
}
|
|
14144
|
+
userGrant === null || userGrant === void 0 || userGrant(e);
|
|
14145
|
+
ref.current.blockedByExternalOwnership = false;
|
|
14132
14146
|
ref.current.state = "pressing";
|
|
14133
14147
|
if (delayPressIn > 0) ref.current.pressInTimer = setTimeout(function() {
|
|
14134
14148
|
return activate(e);
|
|
@@ -14143,6 +14157,12 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
14143
14157
|
}, delayLongPress + delayPressIn);
|
|
14144
14158
|
};
|
|
14145
14159
|
viewProps.onResponderRelease = function(e) {
|
|
14160
|
+
if (ref.current.blockedByExternalOwnership || hasExternalPressOwnership()) {
|
|
14161
|
+
cleanup();
|
|
14162
|
+
ref.current.blockedByExternalOwnership = false;
|
|
14163
|
+
ref.current.state = "idle";
|
|
14164
|
+
return;
|
|
14165
|
+
}
|
|
14146
14166
|
userRelease === null || userRelease === void 0 || userRelease(e);
|
|
14147
14167
|
var wasLongPressed = ref.current.state === "longPressed";
|
|
14148
14168
|
cleanup();
|
|
@@ -14153,12 +14173,14 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
14153
14173
|
}
|
|
14154
14174
|
deactivate(e);
|
|
14155
14175
|
ref.current.state = "idle";
|
|
14176
|
+
ref.current.blockedByExternalOwnership = false;
|
|
14156
14177
|
};
|
|
14157
14178
|
viewProps.onResponderTerminate = function(e) {
|
|
14158
14179
|
userTerminate === null || userTerminate === void 0 || userTerminate(e);
|
|
14159
14180
|
cleanup();
|
|
14160
14181
|
if (ref.current.state === "active" || ref.current.state === "longPressed") deactivate(e);
|
|
14161
14182
|
ref.current.state = "idle";
|
|
14183
|
+
ref.current.blockedByExternalOwnership = false;
|
|
14162
14184
|
};
|
|
14163
14185
|
viewProps.onResponderTerminationRequest = function(e) {
|
|
14164
14186
|
if (userTerminationRequest) return userTerminationRequest(e);
|
|
@@ -14172,6 +14194,7 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
14172
14194
|
}
|
|
14173
14195
|
var DEFAULT_LONG_PRESS_DELAY, DEFAULT_MIN_PRESS_DURATION;
|
|
14174
14196
|
var init_mainThreadPressEvents_native = __esmMin((() => {
|
|
14197
|
+
init_index_native$3();
|
|
14175
14198
|
DEFAULT_LONG_PRESS_DELAY = 500;
|
|
14176
14199
|
DEFAULT_MIN_PRESS_DURATION = 130;
|
|
14177
14200
|
}));
|
|
@@ -14221,7 +14244,7 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
|
|
|
14221
14244
|
if (isUsingRNGH) {
|
|
14222
14245
|
var callbacksRef = (0, react$1.useRef)(isUsingRNGH ? {} : null);
|
|
14223
14246
|
var gestureRef = (0, react$1.useRef)(null);
|
|
14224
|
-
useMainThreadPressEvents(events, viewProps,
|
|
14247
|
+
useMainThreadPressEvents(events, viewProps, !isInsideNativeMenu && Boolean(hasRealPressEvents || getIsAndroid() && hasPressEvents), debugName);
|
|
14225
14248
|
if (everEnabled) {
|
|
14226
14249
|
callbacksRef.current = hasPressEvents ? {
|
|
14227
14250
|
onPressIn: events.onPressIn,
|
|
@@ -14229,6 +14252,10 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
|
|
|
14229
14252
|
onPress: events.onPress,
|
|
14230
14253
|
onLongPress: events.onLongPress
|
|
14231
14254
|
} : {};
|
|
14255
|
+
if (hasRealPressEvents && !isInsideNativeMenu) {
|
|
14256
|
+
gestureRef.current = null;
|
|
14257
|
+
return null;
|
|
14258
|
+
}
|
|
14232
14259
|
if (!gestureRef.current) {
|
|
14233
14260
|
var { Gesture } = gh.state;
|
|
14234
14261
|
if (isInsideNativeMenu) gestureRef.current = Gesture.Manual().runOnJS(true).manualActivation(true).onTouchesDown(function() {
|
|
@@ -14242,27 +14269,6 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
|
|
|
14242
14269
|
var _callbacksRef_current_onPressOut, _callbacksRef_current;
|
|
14243
14270
|
(_callbacksRef_current_onPressOut = (_callbacksRef_current = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 || _callbacksRef_current_onPressOut.call(_callbacksRef_current, {});
|
|
14244
14271
|
});
|
|
14245
|
-
else if (hasRealPressEvents || stateRef.current.hasRealPressEvents) gestureRef.current = gh.createPressGesture({
|
|
14246
|
-
debugName,
|
|
14247
|
-
onPressIn: function(e) {
|
|
14248
|
-
var _callbacksRef_current_onPressIn, _callbacksRef_current;
|
|
14249
|
-
return (_callbacksRef_current_onPressIn = (_callbacksRef_current = callbacksRef.current).onPressIn) === null || _callbacksRef_current_onPressIn === void 0 ? void 0 : _callbacksRef_current_onPressIn.call(_callbacksRef_current, e);
|
|
14250
|
-
},
|
|
14251
|
-
onPressOut: function(e) {
|
|
14252
|
-
var _callbacksRef_current_onPressOut, _callbacksRef_current;
|
|
14253
|
-
return (_callbacksRef_current_onPressOut = (_callbacksRef_current = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 ? void 0 : _callbacksRef_current_onPressOut.call(_callbacksRef_current, e);
|
|
14254
|
-
},
|
|
14255
|
-
onPress: function(e) {
|
|
14256
|
-
var _callbacksRef_current_onPress, _callbacksRef_current;
|
|
14257
|
-
return (_callbacksRef_current_onPress = (_callbacksRef_current = callbacksRef.current).onPress) === null || _callbacksRef_current_onPress === void 0 ? void 0 : _callbacksRef_current_onPress.call(_callbacksRef_current, e);
|
|
14258
|
-
},
|
|
14259
|
-
onLongPress: function(e) {
|
|
14260
|
-
var _callbacksRef_current_onLongPress, _callbacksRef_current;
|
|
14261
|
-
return (_callbacksRef_current_onLongPress = (_callbacksRef_current = callbacksRef.current).onLongPress) === null || _callbacksRef_current_onLongPress === void 0 ? void 0 : _callbacksRef_current_onLongPress.call(_callbacksRef_current, e);
|
|
14262
|
-
},
|
|
14263
|
-
delayLongPress: events === null || events === void 0 ? void 0 : events.delayLongPress,
|
|
14264
|
-
hitSlop: viewProps.hitSlop
|
|
14265
|
-
});
|
|
14266
14272
|
else if (!getIsAndroid()) gestureRef.current = Gesture.Manual().runOnJS(true).manualActivation(true).onTouchesDown(function(e) {
|
|
14267
14273
|
var _callbacksRef_current_onPressIn, _callbacksRef_current;
|
|
14268
14274
|
return (_callbacksRef_current_onPressIn = (_callbacksRef_current = callbacksRef.current).onPressIn) === null || _callbacksRef_current_onPressIn === void 0 ? void 0 : _callbacksRef_current_onPressIn.call(_callbacksRef_current, e);
|
|
@@ -14282,23 +14288,20 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
|
|
|
14282
14288
|
useMainThreadPressEvents(events, viewProps, hasPressEvents, debugName);
|
|
14283
14289
|
return null;
|
|
14284
14290
|
}
|
|
14285
|
-
function wrapWithGestureDetector(content, gesture,
|
|
14291
|
+
function wrapWithGestureDetector(content, gesture, _stateRef, isHOC, isCompositeComponent, hasRealPressEvents) {
|
|
14286
14292
|
if (isHOC || isCompositeComponent) return content;
|
|
14287
|
-
var { GestureDetector
|
|
14288
|
-
|
|
14289
|
-
if (!GestureDetector
|
|
14290
|
-
var gestureToUse = gesture || (Gesture === null || Gesture === void 0 ? void 0 : Gesture.Manual());
|
|
14291
|
-
if (!gestureToUse) return content;
|
|
14292
|
-
if (!stateRef.current.hasRealPressEvents) return react$1.default.createElement(GestureDetector, { gesture: gestureToUse }, content);
|
|
14293
|
+
var { GestureDetector } = getGestureHandler().state;
|
|
14294
|
+
if (!GestureDetector || !gesture) return content;
|
|
14295
|
+
if (!hasRealPressEvents) return react$1.default.createElement(GestureDetector, { gesture }, content);
|
|
14293
14296
|
if (isFabric) {
|
|
14294
14297
|
var claimed = react$1.default.cloneElement(content, { onStartShouldSetResponder: responderClaim });
|
|
14295
|
-
return react$1.default.createElement(GestureDetector, { gesture
|
|
14298
|
+
return react$1.default.createElement(GestureDetector, { gesture }, claimed);
|
|
14296
14299
|
}
|
|
14297
14300
|
return react$1.default.createElement(View$2, {
|
|
14298
14301
|
collapsable: false,
|
|
14299
14302
|
style: responderWrapperStyle,
|
|
14300
14303
|
onStartShouldSetResponder: responderClaim
|
|
14301
|
-
}, react$1.default.createElement(GestureDetector, { gesture
|
|
14304
|
+
}, react$1.default.createElement(GestureDetector, { gesture }, content));
|
|
14302
14305
|
}
|
|
14303
14306
|
var isFabric, isAndroidCache, getIsAndroid, isNativeDesktopCache, getIsNativeDesktop, responderClaim, responderWrapperStyle;
|
|
14304
14307
|
var init_eventHandling_native = __esmMin((() => {
|
|
@@ -15353,6 +15356,29 @@ var init_propMapper_native = __esmMin((() => {
|
|
|
15353
15356
|
}
|
|
15354
15357
|
var { conf, styleProps, staticConfig } = styleState;
|
|
15355
15358
|
var { variants } = staticConfig;
|
|
15359
|
+
if (value === "unset") {
|
|
15360
|
+
var expandedKey = !styleProps.disableExpandShorthands && conf.shorthands[key] || key;
|
|
15361
|
+
var expanded = styleProps.noExpand ? null : expandStyle(expandedKey, value, conf.settings.styleCompat || "web");
|
|
15362
|
+
if (styleState.style) if (expanded) {
|
|
15363
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
15364
|
+
try {
|
|
15365
|
+
for (var _iterator = expanded[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
15366
|
+
var [nkey] = _step.value;
|
|
15367
|
+
delete styleState.style[nkey];
|
|
15368
|
+
}
|
|
15369
|
+
} catch (err) {
|
|
15370
|
+
_didIteratorError = true;
|
|
15371
|
+
_iteratorError = err;
|
|
15372
|
+
} finally {
|
|
15373
|
+
try {
|
|
15374
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
15375
|
+
} finally {
|
|
15376
|
+
if (_didIteratorError) throw _iteratorError;
|
|
15377
|
+
}
|
|
15378
|
+
}
|
|
15379
|
+
} else delete styleState.style[expandedKey];
|
|
15380
|
+
return;
|
|
15381
|
+
}
|
|
15356
15382
|
if (!styleProps.noExpand) {
|
|
15357
15383
|
if (variants && key in variants) {
|
|
15358
15384
|
var variantValue = resolveVariants(key, value, styleProps, styleState, "");
|
|
@@ -15382,20 +15408,20 @@ var init_propMapper_native = __esmMin((() => {
|
|
|
15382
15408
|
var parsed = parseNativeStyle(key, value);
|
|
15383
15409
|
if (parsed) {
|
|
15384
15410
|
if (key === "textShadow" && Array.isArray(parsed) && Array.isArray(parsed[0])) {
|
|
15385
|
-
var
|
|
15411
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
15386
15412
|
try {
|
|
15387
|
-
for (var
|
|
15388
|
-
var [
|
|
15389
|
-
map(
|
|
15413
|
+
for (var _iterator1 = parsed[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
15414
|
+
var [nkey1, nvalue] = _step1.value;
|
|
15415
|
+
map(nkey1, nvalue, originalValue);
|
|
15390
15416
|
}
|
|
15391
15417
|
} catch (err) {
|
|
15392
|
-
|
|
15393
|
-
|
|
15418
|
+
_didIteratorError1 = true;
|
|
15419
|
+
_iteratorError1 = err;
|
|
15394
15420
|
} finally {
|
|
15395
15421
|
try {
|
|
15396
|
-
if (!
|
|
15422
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();
|
|
15397
15423
|
} finally {
|
|
15398
|
-
if (
|
|
15424
|
+
if (_didIteratorError1) throw _iteratorError1;
|
|
15399
15425
|
}
|
|
15400
15426
|
}
|
|
15401
15427
|
return;
|
|
@@ -15406,12 +15432,12 @@ var init_propMapper_native = __esmMin((() => {
|
|
|
15406
15432
|
if (value != null) {
|
|
15407
15433
|
var fontToken = getLastFontFamilyToken();
|
|
15408
15434
|
if (key === "fontFamily" && fontToken) styleState.fontFamily = fontToken;
|
|
15409
|
-
var
|
|
15410
|
-
if (
|
|
15411
|
-
var max =
|
|
15435
|
+
var expanded1 = styleProps.noExpand ? null : expandStyle(key, value, conf.settings.styleCompat || "web");
|
|
15436
|
+
if (expanded1) {
|
|
15437
|
+
var max = expanded1.length;
|
|
15412
15438
|
for (var i = 0; i < max; i++) {
|
|
15413
|
-
var [
|
|
15414
|
-
map(
|
|
15439
|
+
var [nkey2, nvalue1, noriginalValue] = expanded1[i];
|
|
15440
|
+
map(nkey2, nvalue1, noriginalValue !== null && noriginalValue !== void 0 ? noriginalValue : originalValue);
|
|
15415
15441
|
}
|
|
15416
15442
|
} else map(key, value, originalValue);
|
|
15417
15443
|
}
|
|
@@ -17299,7 +17325,8 @@ function createComponent(staticConfig) {
|
|
|
17299
17325
|
var propsInWithHref = propsIn;
|
|
17300
17326
|
var _props_testID, _ref, _ref1, _ref2, _ref3;
|
|
17301
17327
|
var pressDebugName = [componentName, (_ref3 = (_ref2 = (_ref1 = (_ref = (_props_testID = props.testID) !== null && _props_testID !== void 0 ? _props_testID : propsIn.testID) !== null && _ref !== void 0 ? _ref : props.accessibilityLabel) !== null && _ref1 !== void 0 ? _ref1 : propsIn.accessibilityLabel) !== null && _ref2 !== void 0 ? _ref2 : typeof propsWithHref.href === "string" ? propsWithHref.href : null) !== null && _ref3 !== void 0 ? _ref3 : typeof propsInWithHref.href === "string" ? propsInWithHref.href : null].filter(Boolean).join(":") || null;
|
|
17302
|
-
var
|
|
17328
|
+
var hasRealPressEvents = !!(onPress || onPressIn || onPressOut || onLongPress);
|
|
17329
|
+
var pressGesture = useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNativeMenu, pressDebugName, hasRealPressEvents);
|
|
17303
17330
|
if (asChild) {
|
|
17304
17331
|
elementType = Slot;
|
|
17305
17332
|
Object.assign(viewProps, {
|
|
@@ -17324,7 +17351,7 @@ function createComponent(staticConfig) {
|
|
|
17324
17351
|
content = /* @__PURE__ */ react$1.default.createElement(elementType, viewProps, content || children);
|
|
17325
17352
|
}
|
|
17326
17353
|
}
|
|
17327
|
-
content = wrapWithGestureDetector(content, pressGesture, stateRef, isHOC, !isHOC && Component && typeof Component !== "string");
|
|
17354
|
+
content = wrapWithGestureDetector(content, pressGesture, stateRef, isHOC, !isHOC && Component && typeof Component !== "string", hasRealPressEvents);
|
|
17328
17355
|
var ResetPresence = animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.ResetPresence;
|
|
17329
17356
|
var needsReset = Boolean(!asChild && splitStyles && !isHOC && ResetPresence && willBeAnimated && (hasEnterStyle || presenceState));
|
|
17330
17357
|
var hasEverReset = stateRef.current.hasEverResetPresence;
|
|
@@ -20055,6 +20082,13 @@ var getFontSized = function() {
|
|
|
20055
20082
|
if (!font) return { fontSize: sizeTokenIn };
|
|
20056
20083
|
var sizeToken = sizeTokenIn === "$true" ? getDefaultSizeToken(font) : sizeTokenIn;
|
|
20057
20084
|
var style = {};
|
|
20085
|
+
if (typeof sizeToken === "number") {
|
|
20086
|
+
style.fontSize = sizeToken;
|
|
20087
|
+
if (fontFamily) style.fontFamily = fontFamily;
|
|
20088
|
+
if (props.fontStyle) style.fontStyle = props.fontStyle;
|
|
20089
|
+
if (props.color) style.color = props.color;
|
|
20090
|
+
return style;
|
|
20091
|
+
}
|
|
20058
20092
|
var fontSize = font.size[sizeToken];
|
|
20059
20093
|
var lineHeight = (_font_lineHeight = font.lineHeight) === null || _font_lineHeight === void 0 ? void 0 : _font_lineHeight[sizeToken];
|
|
20060
20094
|
var fontWeight = (_font_weight = font.weight) === null || _font_weight === void 0 ? void 0 : _font_weight[sizeToken];
|
|
@@ -20732,7 +20766,7 @@ function PortalHostNonNative(props) {
|
|
|
20732
20766
|
return next;
|
|
20733
20767
|
}));
|
|
20734
20768
|
return render(state.map(function(item) {
|
|
20735
|
-
return item.node;
|
|
20769
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react$1.default.Fragment, { children: item.node }, item.name);
|
|
20736
20770
|
}));
|
|
20737
20771
|
}
|
|
20738
20772
|
//#endregion
|
|
@@ -22053,11 +22087,9 @@ var [createAvatarContext, createAvatarScope] = createContextScope(AVATAR_NAME);
|
|
|
22053
22087
|
var [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME);
|
|
22054
22088
|
var IMAGE_NAME = "AvatarImage";
|
|
22055
22089
|
var AvatarImage = /* @__PURE__ */ react$1.forwardRef(function(props, forwardedRef) {
|
|
22056
|
-
var _getShapeSize;
|
|
22057
22090
|
var { __scopeAvatar, src, source, onLoadingStatusChange = function() {} } = props, imageProps = _objectWithoutProperties(props, _excluded$40);
|
|
22058
22091
|
var context = useAvatarContext(IMAGE_NAME, __scopeAvatar);
|
|
22059
22092
|
var [status, setStatus] = react$1.useState("idle");
|
|
22060
|
-
var shapeSize = getVariableValue((_getShapeSize = getShapeSize(context.size, { tokens: getTokens() })) === null || _getShapeSize === void 0 ? void 0 : _getShapeSize.width);
|
|
22061
22093
|
var resolvedSrc = src || (source && (typeof source === "undefined" ? "undefined" : _type_of$3(source)) === "object" && "uri" in source ? source.uri : source);
|
|
22062
22094
|
react$1.useEffect(function() {
|
|
22063
22095
|
if (!resolvedSrc) setStatus("error");
|
|
@@ -22071,17 +22103,16 @@ var AvatarImage = /* @__PURE__ */ react$1.forwardRef(function(props, forwardedRe
|
|
|
22071
22103
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(YStack, {
|
|
22072
22104
|
fullscreen: true,
|
|
22073
22105
|
zIndex: 1,
|
|
22074
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Image, _objectSpread2(_objectSpread2(
|
|
22106
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Image, _objectSpread2(_objectSpread2({
|
|
22075
22107
|
position: "absolute",
|
|
22076
22108
|
top: 0,
|
|
22077
22109
|
left: 0,
|
|
22078
22110
|
right: 0,
|
|
22079
22111
|
bottom: 0,
|
|
22080
|
-
objectFit: "cover"
|
|
22081
|
-
|
|
22082
|
-
|
|
22083
|
-
|
|
22084
|
-
}), imageProps), {}, {
|
|
22112
|
+
objectFit: "cover",
|
|
22113
|
+
width: "100%",
|
|
22114
|
+
height: "100%"
|
|
22115
|
+
}, imageProps), {}, {
|
|
22085
22116
|
ref: forwardedRef,
|
|
22086
22117
|
src: resolvedSrc,
|
|
22087
22118
|
onError: function() {
|
|
@@ -28680,11 +28711,17 @@ var SheetInsideSheetContext = react$1.default.createContext(null);
|
|
|
28680
28711
|
//#endregion
|
|
28681
28712
|
//#region ../sheet/dist/esm/gestureState.native.js
|
|
28682
28713
|
init_index_native$3();
|
|
28714
|
+
var SHEET_GESTURE_STATE_KEY = "__tamagui_sheet_gesture_state__";
|
|
28715
|
+
function getSheetGestureHandlerState() {
|
|
28716
|
+
var g = globalThis;
|
|
28717
|
+
var _g_SHEET_GESTURE_STATE_KEY;
|
|
28718
|
+
return (_g_SHEET_GESTURE_STATE_KEY = g[SHEET_GESTURE_STATE_KEY]) !== null && _g_SHEET_GESTURE_STATE_KEY !== void 0 ? _g_SHEET_GESTURE_STATE_KEY : getGestureHandler().state;
|
|
28719
|
+
}
|
|
28683
28720
|
function isGestureHandlerEnabled() {
|
|
28684
|
-
return
|
|
28721
|
+
return getSheetGestureHandlerState().enabled;
|
|
28685
28722
|
}
|
|
28686
28723
|
function getGestureHandlerState() {
|
|
28687
|
-
return
|
|
28724
|
+
return getSheetGestureHandlerState();
|
|
28688
28725
|
}
|
|
28689
28726
|
//#endregion
|
|
28690
28727
|
//#region ../sheet/dist/esm/GestureDetectorWrapper.native.js
|
|
@@ -30047,13 +30084,17 @@ function createSheet(param) {
|
|
|
30047
30084
|
var { __scopeSheet } = propsIn, props = _objectWithoutProperties(propsIn, _excluded2$7);
|
|
30048
30085
|
var context = useSheetContext(SHEET_OVERLAY_NAME, __scopeSheet);
|
|
30049
30086
|
var element = (0, react$1.useMemo)(function() {
|
|
30050
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Overlay, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
30051
|
-
|
|
30052
|
-
|
|
30087
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Overlay, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
30088
|
+
ref,
|
|
30089
|
+
onPress: composeEventHandlers(props.onPress, context.dismissOnOverlayPress ? function() {
|
|
30090
|
+
context.setOpen(false);
|
|
30091
|
+
} : void 0)
|
|
30092
|
+
}));
|
|
30053
30093
|
}, [
|
|
30054
|
-
props
|
|
30055
|
-
|
|
30056
|
-
context.dismissOnOverlayPress
|
|
30094
|
+
props,
|
|
30095
|
+
ref,
|
|
30096
|
+
context.dismissOnOverlayPress,
|
|
30097
|
+
context.setOpen
|
|
30057
30098
|
]);
|
|
30058
30099
|
useIsomorphicLayoutEffect(function() {
|
|
30059
30100
|
var _context_onOverlayComponent;
|
|
@@ -33280,6 +33321,8 @@ exports.textAreaSizeVariant = textAreaSizeVariant;
|
|
|
33280
33321
|
exports.themeable = themeable;
|
|
33281
33322
|
exports.themeableVariants = themeableVariants;
|
|
33282
33323
|
exports.tokenCategories = tokenCategories;
|
|
33324
|
+
exports.unstable_getSheetGestureHandlerState = getGestureHandlerState;
|
|
33325
|
+
exports.unstable_isSheetGestureHandlerEnabled = isGestureHandlerEnabled;
|
|
33283
33326
|
exports.updateTheme = updateTheme;
|
|
33284
33327
|
exports.useAdaptContext = useAdaptContext;
|
|
33285
33328
|
exports.useAdaptIsActive = useAdaptIsActive;
|
package/dist/test.cjs
CHANGED
|
@@ -42,8 +42,8 @@ let react_native_safe_area_context = require("react-native-safe-area-context");
|
|
|
42
42
|
if (typeof globalThis["__DEV__"] === "undefined") globalThis["__DEV__"] = false;
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/setup.ts
|
|
45
|
-
var _globalThis;
|
|
46
|
-
(_globalThis = globalThis)["React"] || (_globalThis["React"] = react$1);
|
|
45
|
+
var _globalThis$1;
|
|
46
|
+
(_globalThis$1 = globalThis)["React"] || (_globalThis$1["React"] = react$1);
|
|
47
47
|
if (typeof requestAnimationFrame === "undefined") globalThis["requestAnimationFrame"] = typeof setImmediate === "undefined" ? setTimeout : setImmediate;
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region \0@oxc-project+runtime@0.130.0/helpers/typeof.js
|
|
@@ -901,15 +901,35 @@ function startGlobalObservers() {
|
|
|
901
901
|
function rectsEqual(a, b) {
|
|
902
902
|
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function emitLayoutIfChanged(node, parentNode, nodeRect, parentRect) {
|
|
905
|
+
var onLayout = LayoutHandlers.get(node);
|
|
906
|
+
if (typeof onLayout !== "function") return;
|
|
907
|
+
var cachedRect = NodeRectCache.get(node);
|
|
908
|
+
var cachedParentRect = NodeRectCache.get(parentNode);
|
|
909
|
+
var nodeChanged = !cachedRect || !rectsEqual(cachedRect, nodeRect);
|
|
910
|
+
var parentChanged = !cachedParentRect || !rectsEqual(cachedParentRect, parentRect);
|
|
911
|
+
if (!nodeChanged && !parentChanged) return;
|
|
912
|
+
NodeRectCache.set(node, nodeRect);
|
|
913
|
+
NodeRectCache.set(parentNode, parentRect);
|
|
914
|
+
var event = getElementLayoutEvent(nodeRect, parentRect, node);
|
|
915
|
+
if (avoidUpdates) queuedUpdates.set(node, function() {
|
|
916
|
+
return onLayout(event);
|
|
917
|
+
});
|
|
918
|
+
else onLayout(event);
|
|
919
|
+
}
|
|
920
|
+
function observeLayoutNode(node, disableKey) {
|
|
905
921
|
Nodes.add(node);
|
|
906
|
-
LayoutHandlers.set(node, onChange);
|
|
907
922
|
if (disableKey) LayoutDisableKey.set(node, disableKey);
|
|
923
|
+
else LayoutDisableKey.delete(node);
|
|
908
924
|
startGlobalObservers();
|
|
909
925
|
if (globalIntersectionObserver) {
|
|
910
926
|
globalIntersectionObserver.observe(node);
|
|
911
927
|
IntersectionState.set(node, true);
|
|
912
928
|
}
|
|
929
|
+
}
|
|
930
|
+
function registerLayoutNode(node, onChange, disableKey) {
|
|
931
|
+
LayoutHandlers.set(node, onChange);
|
|
932
|
+
observeLayoutNode(node, disableKey);
|
|
913
933
|
return function() {
|
|
914
934
|
return cleanupNode(node);
|
|
915
935
|
};
|
|
@@ -922,6 +942,17 @@ function cleanupNode(node) {
|
|
|
922
942
|
IntersectionState.delete(node);
|
|
923
943
|
if (globalIntersectionObserver) globalIntersectionObserver.unobserve(node);
|
|
924
944
|
}
|
|
945
|
+
function emitLayoutSync(node) {
|
|
946
|
+
var onLayout = LayoutHandlers.get(node);
|
|
947
|
+
if (typeof onLayout !== "function") return;
|
|
948
|
+
var parentNode = node.parentElement;
|
|
949
|
+
if (!parentNode) return;
|
|
950
|
+
var nodeRect = node.getBoundingClientRect();
|
|
951
|
+
var parentRect = parentNode.getBoundingClientRect();
|
|
952
|
+
NodeRectCache.set(node, nodeRect);
|
|
953
|
+
NodeRectCache.set(parentNode, parentRect);
|
|
954
|
+
onLayout(getElementLayoutEvent(nodeRect, parentRect, node));
|
|
955
|
+
}
|
|
925
956
|
function useElementLayout$1(ref, onLayout) {
|
|
926
957
|
var _ref_current;
|
|
927
958
|
var disableKey = (0, react$1.useContext)(DisableLayoutContextKey);
|
|
@@ -939,35 +970,17 @@ function useElementLayout$1(ref, onLayout) {
|
|
|
939
970
|
if (prevNode) cleanupNode(prevNode);
|
|
940
971
|
PrevHostNode.set(ref, nextNode);
|
|
941
972
|
if (!nextNode) return;
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
globalIntersectionObserver.observe(nextNode);
|
|
946
|
-
IntersectionState.set(nextNode, true);
|
|
947
|
-
}
|
|
948
|
-
var handler = LayoutHandlers.get(nextNode);
|
|
949
|
-
if (typeof handler !== "function") return;
|
|
950
|
-
var parentNode = nextNode.parentElement;
|
|
951
|
-
if (!parentNode) return;
|
|
952
|
-
var nodeRect = nextNode.getBoundingClientRect();
|
|
953
|
-
var parentRect = parentNode.getBoundingClientRect();
|
|
954
|
-
NodeRectCache.set(nextNode, nodeRect);
|
|
955
|
-
NodeRectCache.set(parentNode, parentRect);
|
|
956
|
-
handler(getElementLayoutEvent(nodeRect, parentRect, nextNode));
|
|
973
|
+
LayoutHandlers.set(nextNode, onLayout);
|
|
974
|
+
observeLayoutNode(nextNode, disableKey);
|
|
975
|
+
emitLayoutSync(nextNode);
|
|
957
976
|
});
|
|
958
977
|
useIsomorphicLayoutEffect(function() {
|
|
959
978
|
var _ref_current2;
|
|
960
979
|
if (!onLayout) return;
|
|
961
980
|
var node2 = (_ref_current2 = ref.current) === null || _ref_current2 === void 0 ? void 0 : _ref_current2.host;
|
|
962
981
|
if (!node2) return;
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
if (globalIntersectionObserver) {
|
|
966
|
-
globalIntersectionObserver.observe(node2);
|
|
967
|
-
IntersectionState.set(node2, true);
|
|
968
|
-
}
|
|
969
|
-
var parentNode = node2.parentNode;
|
|
970
|
-
if (parentNode) onLayout(getElementLayoutEvent(node2.getBoundingClientRect(), parentNode.getBoundingClientRect(), node2));
|
|
982
|
+
LayoutHandlers.set(node2, onLayout);
|
|
983
|
+
observeLayoutNode(node2, disableKey);
|
|
971
984
|
return function() {
|
|
972
985
|
cleanupNode(node2);
|
|
973
986
|
var swappedNode = PrevHostNode.get(ref);
|
|
@@ -1043,8 +1056,7 @@ var init_index_native$11 = __esmMin((() => {
|
|
|
1043
1056
|
}
|
|
1044
1057
|
function _updateLayoutIfChanged() {
|
|
1045
1058
|
_updateLayoutIfChanged = _asyncToGenerator(function* (node) {
|
|
1046
|
-
|
|
1047
|
-
if (typeof onLayout !== "function") return;
|
|
1059
|
+
if (typeof LayoutHandlers.get(node) !== "function") return;
|
|
1048
1060
|
var parentNode = node.parentElement;
|
|
1049
1061
|
if (!parentNode) return;
|
|
1050
1062
|
var nodeRect;
|
|
@@ -1057,19 +1069,7 @@ var init_index_native$11 = __esmMin((() => {
|
|
|
1057
1069
|
nodeRect = node.getBoundingClientRect();
|
|
1058
1070
|
parentRect = parentNode.getBoundingClientRect();
|
|
1059
1071
|
}
|
|
1060
|
-
|
|
1061
|
-
var cachedParentRect = NodeRectCache.get(parentNode);
|
|
1062
|
-
var nodeChanged = !cachedRect || !rectsEqual(cachedRect, nodeRect);
|
|
1063
|
-
var parentChanged = !cachedParentRect || !rectsEqual(cachedParentRect, parentRect);
|
|
1064
|
-
if (nodeChanged || parentChanged) {
|
|
1065
|
-
NodeRectCache.set(node, nodeRect);
|
|
1066
|
-
NodeRectCache.set(parentNode, parentRect);
|
|
1067
|
-
var event = getElementLayoutEvent(nodeRect, parentRect, node);
|
|
1068
|
-
if (avoidUpdates) queuedUpdates.set(node, function() {
|
|
1069
|
-
return onLayout(event);
|
|
1070
|
-
});
|
|
1071
|
-
else onLayout(event);
|
|
1072
|
-
}
|
|
1072
|
+
emitLayoutIfChanged(node, parentNode, nodeRect, parentRect);
|
|
1073
1073
|
});
|
|
1074
1074
|
return _updateLayoutIfChanged.apply(this, arguments);
|
|
1075
1075
|
}
|
|
@@ -13843,6 +13843,10 @@ function releaseExternalPressOwnership(token, debugName) {
|
|
|
13843
13843
|
if (!token || pressState.owner !== token) return;
|
|
13844
13844
|
resetPressOwner();
|
|
13845
13845
|
}
|
|
13846
|
+
function hasExternalPressOwnership() {
|
|
13847
|
+
resetStaleOwner(Date.now());
|
|
13848
|
+
return pressState.ownerSource === "external";
|
|
13849
|
+
}
|
|
13846
13850
|
function getGestureHandler() {
|
|
13847
13851
|
return {
|
|
13848
13852
|
get isEnabled() {
|
|
@@ -13973,7 +13977,7 @@ function getGestureHandler() {
|
|
|
13973
13977
|
}
|
|
13974
13978
|
};
|
|
13975
13979
|
}
|
|
13976
|
-
var state$6, GESTURE_ENABLED_FREEZE_KEY$1, pressGestureDebugId, externalPressDebugId, PRESS_MOVE_CANCEL_DISTANCE, PRESS_MOVE_CANCEL_DISTANCE_SQ, pressState;
|
|
13980
|
+
var _globalThis, _PRESS_STATE_KEY, state$6, GESTURE_ENABLED_FREEZE_KEY$1, pressGestureDebugId, externalPressDebugId, PRESS_MOVE_CANCEL_DISTANCE, PRESS_MOVE_CANCEL_DISTANCE_SQ, PRESS_STATE_KEY, _$1, pressState;
|
|
13977
13981
|
var init_gestureState_native = __esmMin((() => {
|
|
13978
13982
|
init_globalState_native();
|
|
13979
13983
|
state$6 = createGlobalState(`gesture`, {
|
|
@@ -13988,7 +13992,8 @@ var init_gestureState_native = __esmMin((() => {
|
|
|
13988
13992
|
externalPressDebugId = 0;
|
|
13989
13993
|
PRESS_MOVE_CANCEL_DISTANCE = 12;
|
|
13990
13994
|
PRESS_MOVE_CANCEL_DISTANCE_SQ = PRESS_MOVE_CANCEL_DISTANCE * PRESS_MOVE_CANCEL_DISTANCE;
|
|
13991
|
-
|
|
13995
|
+
PRESS_STATE_KEY = "__tamagui_press_state__";
|
|
13996
|
+
pressState = (_$1 = (_globalThis = globalThis)[_PRESS_STATE_KEY = PRESS_STATE_KEY]) !== null && _$1 !== void 0 ? _$1 : _globalThis[_PRESS_STATE_KEY] = {
|
|
13992
13997
|
owner: null,
|
|
13993
13998
|
ownerId: null,
|
|
13994
13999
|
ownerSource: null,
|
|
@@ -14215,6 +14220,7 @@ var index_native_exports = /* @__PURE__ */ __exportAll({
|
|
|
14215
14220
|
isKeyboardControllerEnabled: () => isKeyboardControllerEnabled$1,
|
|
14216
14221
|
setKeyboardControllerState: () => setKeyboardControllerState,
|
|
14217
14222
|
unstable_claimExternalPressOwnership: () => claimExternalPressOwnership,
|
|
14223
|
+
unstable_hasExternalPressOwnership: () => hasExternalPressOwnership,
|
|
14218
14224
|
unstable_releaseExternalPressOwnership: () => releaseExternalPressOwnership
|
|
14219
14225
|
});
|
|
14220
14226
|
var init_index_native$3 = __esmMin((() => {
|
|
@@ -14258,7 +14264,8 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
14258
14264
|
pressInTimer: null,
|
|
14259
14265
|
pressOutTimer: null,
|
|
14260
14266
|
longPressTimer: null,
|
|
14261
|
-
activateTime: 0
|
|
14267
|
+
activateTime: 0,
|
|
14268
|
+
blockedByExternalOwnership: false
|
|
14262
14269
|
};
|
|
14263
14270
|
if (!enabled || !events) return;
|
|
14264
14271
|
var _events_delayPressIn;
|
|
@@ -14302,11 +14309,18 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
14302
14309
|
var userTerminationRequest = viewProps.onResponderTerminationRequest;
|
|
14303
14310
|
var userMove = viewProps.onResponderMove;
|
|
14304
14311
|
viewProps.onStartShouldSetResponder = function(e) {
|
|
14305
|
-
|
|
14312
|
+
if (userStartShouldSet === null || userStartShouldSet === void 0 ? void 0 : userStartShouldSet(e)) return true;
|
|
14313
|
+
return !events.disabled && !hasExternalPressOwnership();
|
|
14306
14314
|
};
|
|
14307
14315
|
viewProps.onResponderGrant = function(e) {
|
|
14308
|
-
userGrant === null || userGrant === void 0 || userGrant(e);
|
|
14309
14316
|
cleanup();
|
|
14317
|
+
if (hasExternalPressOwnership()) {
|
|
14318
|
+
ref.current.state = "idle";
|
|
14319
|
+
ref.current.blockedByExternalOwnership = true;
|
|
14320
|
+
return;
|
|
14321
|
+
}
|
|
14322
|
+
userGrant === null || userGrant === void 0 || userGrant(e);
|
|
14323
|
+
ref.current.blockedByExternalOwnership = false;
|
|
14310
14324
|
ref.current.state = "pressing";
|
|
14311
14325
|
if (delayPressIn > 0) ref.current.pressInTimer = setTimeout(function() {
|
|
14312
14326
|
return activate(e);
|
|
@@ -14321,6 +14335,12 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
14321
14335
|
}, delayLongPress + delayPressIn);
|
|
14322
14336
|
};
|
|
14323
14337
|
viewProps.onResponderRelease = function(e) {
|
|
14338
|
+
if (ref.current.blockedByExternalOwnership || hasExternalPressOwnership()) {
|
|
14339
|
+
cleanup();
|
|
14340
|
+
ref.current.blockedByExternalOwnership = false;
|
|
14341
|
+
ref.current.state = "idle";
|
|
14342
|
+
return;
|
|
14343
|
+
}
|
|
14324
14344
|
userRelease === null || userRelease === void 0 || userRelease(e);
|
|
14325
14345
|
var wasLongPressed = ref.current.state === "longPressed";
|
|
14326
14346
|
cleanup();
|
|
@@ -14331,12 +14351,14 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
14331
14351
|
}
|
|
14332
14352
|
deactivate(e);
|
|
14333
14353
|
ref.current.state = "idle";
|
|
14354
|
+
ref.current.blockedByExternalOwnership = false;
|
|
14334
14355
|
};
|
|
14335
14356
|
viewProps.onResponderTerminate = function(e) {
|
|
14336
14357
|
userTerminate === null || userTerminate === void 0 || userTerminate(e);
|
|
14337
14358
|
cleanup();
|
|
14338
14359
|
if (ref.current.state === "active" || ref.current.state === "longPressed") deactivate(e);
|
|
14339
14360
|
ref.current.state = "idle";
|
|
14361
|
+
ref.current.blockedByExternalOwnership = false;
|
|
14340
14362
|
};
|
|
14341
14363
|
viewProps.onResponderTerminationRequest = function(e) {
|
|
14342
14364
|
if (userTerminationRequest) return userTerminationRequest(e);
|
|
@@ -14350,6 +14372,7 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
14350
14372
|
}
|
|
14351
14373
|
var DEFAULT_LONG_PRESS_DELAY, DEFAULT_MIN_PRESS_DURATION;
|
|
14352
14374
|
var init_mainThreadPressEvents_native = __esmMin((() => {
|
|
14375
|
+
init_index_native$3();
|
|
14353
14376
|
DEFAULT_LONG_PRESS_DELAY = 500;
|
|
14354
14377
|
DEFAULT_MIN_PRESS_DURATION = 130;
|
|
14355
14378
|
}));
|
|
@@ -14399,7 +14422,7 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
|
|
|
14399
14422
|
if (isUsingRNGH) {
|
|
14400
14423
|
var callbacksRef = (0, react$1.useRef)(isUsingRNGH ? {} : null);
|
|
14401
14424
|
var gestureRef = (0, react$1.useRef)(null);
|
|
14402
|
-
useMainThreadPressEvents(events, viewProps,
|
|
14425
|
+
useMainThreadPressEvents(events, viewProps, !isInsideNativeMenu && Boolean(hasRealPressEvents || getIsAndroid() && hasPressEvents), debugName);
|
|
14403
14426
|
if (everEnabled) {
|
|
14404
14427
|
callbacksRef.current = hasPressEvents ? {
|
|
14405
14428
|
onPressIn: events.onPressIn,
|
|
@@ -14407,6 +14430,10 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
|
|
|
14407
14430
|
onPress: events.onPress,
|
|
14408
14431
|
onLongPress: events.onLongPress
|
|
14409
14432
|
} : {};
|
|
14433
|
+
if (hasRealPressEvents && !isInsideNativeMenu) {
|
|
14434
|
+
gestureRef.current = null;
|
|
14435
|
+
return null;
|
|
14436
|
+
}
|
|
14410
14437
|
if (!gestureRef.current) {
|
|
14411
14438
|
var { Gesture } = gh.state;
|
|
14412
14439
|
if (isInsideNativeMenu) gestureRef.current = Gesture.Manual().runOnJS(true).manualActivation(true).onTouchesDown(function() {
|
|
@@ -14420,27 +14447,6 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
|
|
|
14420
14447
|
var _callbacksRef_current_onPressOut, _callbacksRef_current;
|
|
14421
14448
|
(_callbacksRef_current_onPressOut = (_callbacksRef_current = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 || _callbacksRef_current_onPressOut.call(_callbacksRef_current, {});
|
|
14422
14449
|
});
|
|
14423
|
-
else if (hasRealPressEvents || stateRef.current.hasRealPressEvents) gestureRef.current = gh.createPressGesture({
|
|
14424
|
-
debugName,
|
|
14425
|
-
onPressIn: function(e) {
|
|
14426
|
-
var _callbacksRef_current_onPressIn, _callbacksRef_current;
|
|
14427
|
-
return (_callbacksRef_current_onPressIn = (_callbacksRef_current = callbacksRef.current).onPressIn) === null || _callbacksRef_current_onPressIn === void 0 ? void 0 : _callbacksRef_current_onPressIn.call(_callbacksRef_current, e);
|
|
14428
|
-
},
|
|
14429
|
-
onPressOut: function(e) {
|
|
14430
|
-
var _callbacksRef_current_onPressOut, _callbacksRef_current;
|
|
14431
|
-
return (_callbacksRef_current_onPressOut = (_callbacksRef_current = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 ? void 0 : _callbacksRef_current_onPressOut.call(_callbacksRef_current, e);
|
|
14432
|
-
},
|
|
14433
|
-
onPress: function(e) {
|
|
14434
|
-
var _callbacksRef_current_onPress, _callbacksRef_current;
|
|
14435
|
-
return (_callbacksRef_current_onPress = (_callbacksRef_current = callbacksRef.current).onPress) === null || _callbacksRef_current_onPress === void 0 ? void 0 : _callbacksRef_current_onPress.call(_callbacksRef_current, e);
|
|
14436
|
-
},
|
|
14437
|
-
onLongPress: function(e) {
|
|
14438
|
-
var _callbacksRef_current_onLongPress, _callbacksRef_current;
|
|
14439
|
-
return (_callbacksRef_current_onLongPress = (_callbacksRef_current = callbacksRef.current).onLongPress) === null || _callbacksRef_current_onLongPress === void 0 ? void 0 : _callbacksRef_current_onLongPress.call(_callbacksRef_current, e);
|
|
14440
|
-
},
|
|
14441
|
-
delayLongPress: events === null || events === void 0 ? void 0 : events.delayLongPress,
|
|
14442
|
-
hitSlop: viewProps.hitSlop
|
|
14443
|
-
});
|
|
14444
14450
|
else if (!getIsAndroid()) gestureRef.current = Gesture.Manual().runOnJS(true).manualActivation(true).onTouchesDown(function(e) {
|
|
14445
14451
|
var _callbacksRef_current_onPressIn, _callbacksRef_current;
|
|
14446
14452
|
return (_callbacksRef_current_onPressIn = (_callbacksRef_current = callbacksRef.current).onPressIn) === null || _callbacksRef_current_onPressIn === void 0 ? void 0 : _callbacksRef_current_onPressIn.call(_callbacksRef_current, e);
|
|
@@ -14460,23 +14466,20 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
|
|
|
14460
14466
|
useMainThreadPressEvents(events, viewProps, hasPressEvents, debugName);
|
|
14461
14467
|
return null;
|
|
14462
14468
|
}
|
|
14463
|
-
function wrapWithGestureDetector(content, gesture,
|
|
14469
|
+
function wrapWithGestureDetector(content, gesture, _stateRef, isHOC, isCompositeComponent, hasRealPressEvents) {
|
|
14464
14470
|
if (isHOC || isCompositeComponent) return content;
|
|
14465
|
-
var { GestureDetector
|
|
14466
|
-
|
|
14467
|
-
if (!GestureDetector
|
|
14468
|
-
var gestureToUse = gesture || (Gesture === null || Gesture === void 0 ? void 0 : Gesture.Manual());
|
|
14469
|
-
if (!gestureToUse) return content;
|
|
14470
|
-
if (!stateRef.current.hasRealPressEvents) return react$1.default.createElement(GestureDetector, { gesture: gestureToUse }, content);
|
|
14471
|
+
var { GestureDetector } = getGestureHandler().state;
|
|
14472
|
+
if (!GestureDetector || !gesture) return content;
|
|
14473
|
+
if (!hasRealPressEvents) return react$1.default.createElement(GestureDetector, { gesture }, content);
|
|
14471
14474
|
if (isFabric) {
|
|
14472
14475
|
var claimed = react$1.default.cloneElement(content, { onStartShouldSetResponder: responderClaim });
|
|
14473
|
-
return react$1.default.createElement(GestureDetector, { gesture
|
|
14476
|
+
return react$1.default.createElement(GestureDetector, { gesture }, claimed);
|
|
14474
14477
|
}
|
|
14475
14478
|
return react$1.default.createElement(View$2, {
|
|
14476
14479
|
collapsable: false,
|
|
14477
14480
|
style: responderWrapperStyle,
|
|
14478
14481
|
onStartShouldSetResponder: responderClaim
|
|
14479
|
-
}, react$1.default.createElement(GestureDetector, { gesture
|
|
14482
|
+
}, react$1.default.createElement(GestureDetector, { gesture }, content));
|
|
14480
14483
|
}
|
|
14481
14484
|
var isFabric, isAndroidCache, getIsAndroid, isNativeDesktopCache, getIsNativeDesktop, responderClaim, responderWrapperStyle;
|
|
14482
14485
|
var init_eventHandling_native = __esmMin((() => {
|
|
@@ -15532,6 +15535,29 @@ var init_propMapper_native = __esmMin((() => {
|
|
|
15532
15535
|
}
|
|
15533
15536
|
var { conf, styleProps, staticConfig } = styleState;
|
|
15534
15537
|
var { variants } = staticConfig;
|
|
15538
|
+
if (value === "unset") {
|
|
15539
|
+
var expandedKey = !styleProps.disableExpandShorthands && conf.shorthands[key] || key;
|
|
15540
|
+
var expanded = styleProps.noExpand ? null : expandStyle(expandedKey, value, conf.settings.styleCompat || "web");
|
|
15541
|
+
if (styleState.style) if (expanded) {
|
|
15542
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
15543
|
+
try {
|
|
15544
|
+
for (var _iterator = expanded[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
15545
|
+
var [nkey] = _step.value;
|
|
15546
|
+
delete styleState.style[nkey];
|
|
15547
|
+
}
|
|
15548
|
+
} catch (err) {
|
|
15549
|
+
_didIteratorError = true;
|
|
15550
|
+
_iteratorError = err;
|
|
15551
|
+
} finally {
|
|
15552
|
+
try {
|
|
15553
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
15554
|
+
} finally {
|
|
15555
|
+
if (_didIteratorError) throw _iteratorError;
|
|
15556
|
+
}
|
|
15557
|
+
}
|
|
15558
|
+
} else delete styleState.style[expandedKey];
|
|
15559
|
+
return;
|
|
15560
|
+
}
|
|
15535
15561
|
if (!styleProps.noExpand) {
|
|
15536
15562
|
if (variants && key in variants) {
|
|
15537
15563
|
var variantValue = resolveVariants(key, value, styleProps, styleState, "");
|
|
@@ -15561,20 +15587,20 @@ var init_propMapper_native = __esmMin((() => {
|
|
|
15561
15587
|
var parsed = parseNativeStyle(key, value);
|
|
15562
15588
|
if (parsed) {
|
|
15563
15589
|
if (key === "textShadow" && Array.isArray(parsed) && Array.isArray(parsed[0])) {
|
|
15564
|
-
var
|
|
15590
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
15565
15591
|
try {
|
|
15566
|
-
for (var
|
|
15567
|
-
var [
|
|
15568
|
-
map(
|
|
15592
|
+
for (var _iterator1 = parsed[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
15593
|
+
var [nkey1, nvalue] = _step1.value;
|
|
15594
|
+
map(nkey1, nvalue, originalValue);
|
|
15569
15595
|
}
|
|
15570
15596
|
} catch (err) {
|
|
15571
|
-
|
|
15572
|
-
|
|
15597
|
+
_didIteratorError1 = true;
|
|
15598
|
+
_iteratorError1 = err;
|
|
15573
15599
|
} finally {
|
|
15574
15600
|
try {
|
|
15575
|
-
if (!
|
|
15601
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();
|
|
15576
15602
|
} finally {
|
|
15577
|
-
if (
|
|
15603
|
+
if (_didIteratorError1) throw _iteratorError1;
|
|
15578
15604
|
}
|
|
15579
15605
|
}
|
|
15580
15606
|
return;
|
|
@@ -15585,12 +15611,12 @@ var init_propMapper_native = __esmMin((() => {
|
|
|
15585
15611
|
if (value != null) {
|
|
15586
15612
|
var fontToken = getLastFontFamilyToken();
|
|
15587
15613
|
if (key === "fontFamily" && fontToken) styleState.fontFamily = fontToken;
|
|
15588
|
-
var
|
|
15589
|
-
if (
|
|
15590
|
-
var max =
|
|
15614
|
+
var expanded1 = styleProps.noExpand ? null : expandStyle(key, value, conf.settings.styleCompat || "web");
|
|
15615
|
+
if (expanded1) {
|
|
15616
|
+
var max = expanded1.length;
|
|
15591
15617
|
for (var i = 0; i < max; i++) {
|
|
15592
|
-
var [
|
|
15593
|
-
map(
|
|
15618
|
+
var [nkey2, nvalue1, noriginalValue] = expanded1[i];
|
|
15619
|
+
map(nkey2, nvalue1, noriginalValue !== null && noriginalValue !== void 0 ? noriginalValue : originalValue);
|
|
15594
15620
|
}
|
|
15595
15621
|
} else map(key, value, originalValue);
|
|
15596
15622
|
}
|
|
@@ -17039,10 +17065,11 @@ function createComponent(staticConfig) {
|
|
|
17039
17065
|
BaseView = baseViews.View;
|
|
17040
17066
|
}
|
|
17041
17067
|
}
|
|
17042
|
-
|
|
17043
|
-
|
|
17044
|
-
|
|
17045
|
-
|
|
17068
|
+
var testRenderCount = propsIn["data-test-renders"];
|
|
17069
|
+
if (testRenderCount && (typeof testRenderCount === "undefined" ? "undefined" : _type_of$7(testRenderCount)) === "object" && !Object.isFrozen(testRenderCount)) {
|
|
17070
|
+
var _testRenderCount_current;
|
|
17071
|
+
testRenderCount.current = (_testRenderCount_current = testRenderCount.current) !== null && _testRenderCount_current !== void 0 ? _testRenderCount_current : 0;
|
|
17072
|
+
testRenderCount.current += 1;
|
|
17046
17073
|
}
|
|
17047
17074
|
var { context, isReactNative } = staticConfig;
|
|
17048
17075
|
var debugProp = propsIn["debug"];
|
|
@@ -17484,7 +17511,8 @@ function createComponent(staticConfig) {
|
|
|
17484
17511
|
var propsInWithHref = propsIn;
|
|
17485
17512
|
var _props_testID, _ref, _ref1, _ref2, _ref3;
|
|
17486
17513
|
var pressDebugName = [componentName, (_ref3 = (_ref2 = (_ref1 = (_ref = (_props_testID = props.testID) !== null && _props_testID !== void 0 ? _props_testID : propsIn.testID) !== null && _ref !== void 0 ? _ref : props.accessibilityLabel) !== null && _ref1 !== void 0 ? _ref1 : propsIn.accessibilityLabel) !== null && _ref2 !== void 0 ? _ref2 : typeof propsWithHref.href === "string" ? propsWithHref.href : null) !== null && _ref3 !== void 0 ? _ref3 : typeof propsInWithHref.href === "string" ? propsInWithHref.href : null].filter(Boolean).join(":") || null;
|
|
17487
|
-
var
|
|
17514
|
+
var hasRealPressEvents = !!(onPress || onPressIn || onPressOut || onLongPress);
|
|
17515
|
+
var pressGesture = useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNativeMenu, pressDebugName, hasRealPressEvents);
|
|
17488
17516
|
if (asChild) {
|
|
17489
17517
|
elementType = Slot;
|
|
17490
17518
|
Object.assign(viewProps, {
|
|
@@ -17509,7 +17537,7 @@ function createComponent(staticConfig) {
|
|
|
17509
17537
|
content = /* @__PURE__ */ react$1.default.createElement(elementType, viewProps, content || children);
|
|
17510
17538
|
}
|
|
17511
17539
|
}
|
|
17512
|
-
content = wrapWithGestureDetector(content, pressGesture, stateRef, isHOC, !isHOC && Component && typeof Component !== "string");
|
|
17540
|
+
content = wrapWithGestureDetector(content, pressGesture, stateRef, isHOC, !isHOC && Component && typeof Component !== "string", hasRealPressEvents);
|
|
17513
17541
|
var ResetPresence = animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.ResetPresence;
|
|
17514
17542
|
var needsReset = Boolean(!asChild && splitStyles && !isHOC && ResetPresence && willBeAnimated && (hasEnterStyle || presenceState));
|
|
17515
17543
|
var hasEverReset = stateRef.current.hasEverResetPresence;
|
|
@@ -20121,6 +20149,13 @@ var getFontSized = function() {
|
|
|
20121
20149
|
if (!font) return { fontSize: sizeTokenIn };
|
|
20122
20150
|
var sizeToken = sizeTokenIn === "$true" ? getDefaultSizeToken(font) : sizeTokenIn;
|
|
20123
20151
|
var style = {};
|
|
20152
|
+
if (typeof sizeToken === "number") {
|
|
20153
|
+
style.fontSize = sizeToken;
|
|
20154
|
+
if (fontFamily) style.fontFamily = fontFamily;
|
|
20155
|
+
if (props.fontStyle) style.fontStyle = props.fontStyle;
|
|
20156
|
+
if (props.color) style.color = props.color;
|
|
20157
|
+
return style;
|
|
20158
|
+
}
|
|
20124
20159
|
var fontSize = font.size[sizeToken];
|
|
20125
20160
|
var lineHeight = (_font_lineHeight = font.lineHeight) === null || _font_lineHeight === void 0 ? void 0 : _font_lineHeight[sizeToken];
|
|
20126
20161
|
var fontWeight = (_font_weight = font.weight) === null || _font_weight === void 0 ? void 0 : _font_weight[sizeToken];
|
|
@@ -20798,7 +20833,7 @@ function PortalHostNonNative(props) {
|
|
|
20798
20833
|
return next;
|
|
20799
20834
|
}));
|
|
20800
20835
|
return render(state.map(function(item) {
|
|
20801
|
-
return item.node;
|
|
20836
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react$1.default.Fragment, { children: item.node }, item.name);
|
|
20802
20837
|
}));
|
|
20803
20838
|
}
|
|
20804
20839
|
//#endregion
|
|
@@ -22119,11 +22154,9 @@ var [createAvatarContext, createAvatarScope] = createContextScope(AVATAR_NAME);
|
|
|
22119
22154
|
var [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME);
|
|
22120
22155
|
var IMAGE_NAME = "AvatarImage";
|
|
22121
22156
|
var AvatarImage = /* @__PURE__ */ react$1.forwardRef(function(props, forwardedRef) {
|
|
22122
|
-
var _getShapeSize;
|
|
22123
22157
|
var { __scopeAvatar, src, source, onLoadingStatusChange = function() {} } = props, imageProps = _objectWithoutProperties(props, _excluded$40);
|
|
22124
22158
|
var context = useAvatarContext(IMAGE_NAME, __scopeAvatar);
|
|
22125
22159
|
var [status, setStatus] = react$1.useState("idle");
|
|
22126
|
-
var shapeSize = getVariableValue((_getShapeSize = getShapeSize(context.size, { tokens: getTokens() })) === null || _getShapeSize === void 0 ? void 0 : _getShapeSize.width);
|
|
22127
22160
|
var resolvedSrc = src || (source && (typeof source === "undefined" ? "undefined" : _type_of$3(source)) === "object" && "uri" in source ? source.uri : source);
|
|
22128
22161
|
react$1.useEffect(function() {
|
|
22129
22162
|
if (!resolvedSrc) setStatus("error");
|
|
@@ -22137,17 +22170,16 @@ var AvatarImage = /* @__PURE__ */ react$1.forwardRef(function(props, forwardedRe
|
|
|
22137
22170
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(YStack, {
|
|
22138
22171
|
fullscreen: true,
|
|
22139
22172
|
zIndex: 1,
|
|
22140
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Image, _objectSpread2(_objectSpread2(
|
|
22173
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Image, _objectSpread2(_objectSpread2({
|
|
22141
22174
|
position: "absolute",
|
|
22142
22175
|
top: 0,
|
|
22143
22176
|
left: 0,
|
|
22144
22177
|
right: 0,
|
|
22145
22178
|
bottom: 0,
|
|
22146
|
-
objectFit: "cover"
|
|
22147
|
-
|
|
22148
|
-
|
|
22149
|
-
|
|
22150
|
-
}), imageProps), {}, {
|
|
22179
|
+
objectFit: "cover",
|
|
22180
|
+
width: "100%",
|
|
22181
|
+
height: "100%"
|
|
22182
|
+
}, imageProps), {}, {
|
|
22151
22183
|
ref: forwardedRef,
|
|
22152
22184
|
src: resolvedSrc,
|
|
22153
22185
|
onError: function() {
|
|
@@ -28746,11 +28778,17 @@ var SheetInsideSheetContext = react$1.default.createContext(null);
|
|
|
28746
28778
|
//#endregion
|
|
28747
28779
|
//#region ../sheet/dist/esm/gestureState.native.js
|
|
28748
28780
|
init_index_native$3();
|
|
28781
|
+
var SHEET_GESTURE_STATE_KEY = "__tamagui_sheet_gesture_state__";
|
|
28782
|
+
function getSheetGestureHandlerState() {
|
|
28783
|
+
var g = globalThis;
|
|
28784
|
+
var _g_SHEET_GESTURE_STATE_KEY;
|
|
28785
|
+
return (_g_SHEET_GESTURE_STATE_KEY = g[SHEET_GESTURE_STATE_KEY]) !== null && _g_SHEET_GESTURE_STATE_KEY !== void 0 ? _g_SHEET_GESTURE_STATE_KEY : getGestureHandler().state;
|
|
28786
|
+
}
|
|
28749
28787
|
function isGestureHandlerEnabled() {
|
|
28750
|
-
return
|
|
28788
|
+
return getSheetGestureHandlerState().enabled;
|
|
28751
28789
|
}
|
|
28752
28790
|
function getGestureHandlerState() {
|
|
28753
|
-
return
|
|
28791
|
+
return getSheetGestureHandlerState();
|
|
28754
28792
|
}
|
|
28755
28793
|
//#endregion
|
|
28756
28794
|
//#region ../sheet/dist/esm/GestureDetectorWrapper.native.js
|
|
@@ -30113,13 +30151,17 @@ function createSheet(param) {
|
|
|
30113
30151
|
var { __scopeSheet } = propsIn, props = _objectWithoutProperties(propsIn, _excluded2$7);
|
|
30114
30152
|
var context = useSheetContext(SHEET_OVERLAY_NAME, __scopeSheet);
|
|
30115
30153
|
var element = (0, react$1.useMemo)(function() {
|
|
30116
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Overlay, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
30117
|
-
|
|
30118
|
-
|
|
30154
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Overlay, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
30155
|
+
ref,
|
|
30156
|
+
onPress: composeEventHandlers(props.onPress, context.dismissOnOverlayPress ? function() {
|
|
30157
|
+
context.setOpen(false);
|
|
30158
|
+
} : void 0)
|
|
30159
|
+
}));
|
|
30119
30160
|
}, [
|
|
30120
|
-
props
|
|
30121
|
-
|
|
30122
|
-
context.dismissOnOverlayPress
|
|
30161
|
+
props,
|
|
30162
|
+
ref,
|
|
30163
|
+
context.dismissOnOverlayPress,
|
|
30164
|
+
context.setOpen
|
|
30123
30165
|
]);
|
|
30124
30166
|
useIsomorphicLayoutEffect(function() {
|
|
30125
30167
|
var _context_onOverlayComponent;
|
|
@@ -33346,6 +33388,8 @@ exports.textAreaSizeVariant = textAreaSizeVariant;
|
|
|
33346
33388
|
exports.themeable = themeable;
|
|
33347
33389
|
exports.themeableVariants = themeableVariants;
|
|
33348
33390
|
exports.tokenCategories = tokenCategories;
|
|
33391
|
+
exports.unstable_getSheetGestureHandlerState = getGestureHandlerState;
|
|
33392
|
+
exports.unstable_isSheetGestureHandlerEnabled = isGestureHandlerEnabled;
|
|
33349
33393
|
exports.updateTheme = updateTheme;
|
|
33350
33394
|
exports.useAdaptContext = useAdaptContext;
|
|
33351
33395
|
exports.useAdaptIsActive = useAdaptIsActive;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamagui",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"description": "Style and UI for React (web and native) meet an optimizing compiler",
|
|
6
6
|
"repository": {
|
|
@@ -77,72 +77,72 @@
|
|
|
77
77
|
"check-circular-deps": "npx madge --circular ./src/index.ts"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@tamagui/accordion": "2.4.
|
|
81
|
-
"@tamagui/adapt": "2.4.
|
|
82
|
-
"@tamagui/alert-dialog": "2.4.
|
|
83
|
-
"@tamagui/animate": "2.4.
|
|
84
|
-
"@tamagui/animate-presence": "2.4.
|
|
85
|
-
"@tamagui/avatar": "2.4.
|
|
86
|
-
"@tamagui/button": "2.4.
|
|
87
|
-
"@tamagui/card": "2.4.
|
|
88
|
-
"@tamagui/checkbox": "2.4.
|
|
89
|
-
"@tamagui/collapsible": "2.4.
|
|
90
|
-
"@tamagui/compose-refs": "2.4.
|
|
91
|
-
"@tamagui/constants": "2.4.
|
|
92
|
-
"@tamagui/context-menu": "2.4.
|
|
93
|
-
"@tamagui/core": "2.4.
|
|
94
|
-
"@tamagui/create-context": "2.4.
|
|
95
|
-
"@tamagui/create-menu": "2.4.
|
|
96
|
-
"@tamagui/dialog": "2.4.
|
|
97
|
-
"@tamagui/element": "2.4.
|
|
98
|
-
"@tamagui/elements": "2.4.
|
|
99
|
-
"@tamagui/fake-react-native": "2.4.
|
|
100
|
-
"@tamagui/focusable": "2.4.
|
|
101
|
-
"@tamagui/form": "2.4.
|
|
102
|
-
"@tamagui/get-button-sized": "2.4.
|
|
103
|
-
"@tamagui/get-font-sized": "2.4.
|
|
104
|
-
"@tamagui/get-token": "2.4.
|
|
105
|
-
"@tamagui/group": "2.4.
|
|
106
|
-
"@tamagui/helpers-tamagui": "2.4.
|
|
107
|
-
"@tamagui/image": "2.4.
|
|
108
|
-
"@tamagui/input": "2.4.
|
|
109
|
-
"@tamagui/label": "2.4.
|
|
110
|
-
"@tamagui/linear-gradient": "2.4.
|
|
111
|
-
"@tamagui/list-item": "2.4.
|
|
112
|
-
"@tamagui/menu": "2.4.
|
|
113
|
-
"@tamagui/polyfill-dev": "2.4.
|
|
114
|
-
"@tamagui/popover": "2.4.
|
|
115
|
-
"@tamagui/popper": "2.4.
|
|
116
|
-
"@tamagui/portal": "2.4.
|
|
117
|
-
"@tamagui/progress": "2.4.
|
|
118
|
-
"@tamagui/radio-group": "2.4.
|
|
119
|
-
"@tamagui/react-native-media-driver": "2.4.
|
|
120
|
-
"@tamagui/scroll-view": "2.4.
|
|
121
|
-
"@tamagui/select": "2.4.
|
|
122
|
-
"@tamagui/separator": "2.4.
|
|
123
|
-
"@tamagui/shapes": "2.4.
|
|
124
|
-
"@tamagui/sheet": "2.4.
|
|
125
|
-
"@tamagui/slider": "2.4.
|
|
126
|
-
"@tamagui/spacer": "2.4.
|
|
127
|
-
"@tamagui/spinner": "2.4.
|
|
128
|
-
"@tamagui/stacks": "2.4.
|
|
129
|
-
"@tamagui/switch": "2.4.
|
|
130
|
-
"@tamagui/tabs": "2.4.
|
|
131
|
-
"@tamagui/text": "2.4.
|
|
132
|
-
"@tamagui/theme": "2.4.
|
|
133
|
-
"@tamagui/toast": "2.4.
|
|
134
|
-
"@tamagui/toggle-group": "2.4.
|
|
135
|
-
"@tamagui/tooltip": "2.4.
|
|
136
|
-
"@tamagui/use-controllable-state": "2.4.
|
|
137
|
-
"@tamagui/use-debounce": "2.4.
|
|
138
|
-
"@tamagui/use-force-update": "2.4.
|
|
139
|
-
"@tamagui/use-window-dimensions": "2.4.
|
|
140
|
-
"@tamagui/visually-hidden": "2.4.
|
|
141
|
-
"@tamagui/font-size": "2.4.
|
|
142
|
-
"@tamagui/z-index-stack": "2.4.
|
|
80
|
+
"@tamagui/accordion": "2.4.1",
|
|
81
|
+
"@tamagui/adapt": "2.4.1",
|
|
82
|
+
"@tamagui/alert-dialog": "2.4.1",
|
|
83
|
+
"@tamagui/animate": "2.4.1",
|
|
84
|
+
"@tamagui/animate-presence": "2.4.1",
|
|
85
|
+
"@tamagui/avatar": "2.4.1",
|
|
86
|
+
"@tamagui/button": "2.4.1",
|
|
87
|
+
"@tamagui/card": "2.4.1",
|
|
88
|
+
"@tamagui/checkbox": "2.4.1",
|
|
89
|
+
"@tamagui/collapsible": "2.4.1",
|
|
90
|
+
"@tamagui/compose-refs": "2.4.1",
|
|
91
|
+
"@tamagui/constants": "2.4.1",
|
|
92
|
+
"@tamagui/context-menu": "2.4.1",
|
|
93
|
+
"@tamagui/core": "2.4.1",
|
|
94
|
+
"@tamagui/create-context": "2.4.1",
|
|
95
|
+
"@tamagui/create-menu": "2.4.1",
|
|
96
|
+
"@tamagui/dialog": "2.4.1",
|
|
97
|
+
"@tamagui/element": "2.4.1",
|
|
98
|
+
"@tamagui/elements": "2.4.1",
|
|
99
|
+
"@tamagui/fake-react-native": "2.4.1",
|
|
100
|
+
"@tamagui/focusable": "2.4.1",
|
|
101
|
+
"@tamagui/form": "2.4.1",
|
|
102
|
+
"@tamagui/get-button-sized": "2.4.1",
|
|
103
|
+
"@tamagui/get-font-sized": "2.4.1",
|
|
104
|
+
"@tamagui/get-token": "2.4.1",
|
|
105
|
+
"@tamagui/group": "2.4.1",
|
|
106
|
+
"@tamagui/helpers-tamagui": "2.4.1",
|
|
107
|
+
"@tamagui/image": "2.4.1",
|
|
108
|
+
"@tamagui/input": "2.4.1",
|
|
109
|
+
"@tamagui/label": "2.4.1",
|
|
110
|
+
"@tamagui/linear-gradient": "2.4.1",
|
|
111
|
+
"@tamagui/list-item": "2.4.1",
|
|
112
|
+
"@tamagui/menu": "2.4.1",
|
|
113
|
+
"@tamagui/polyfill-dev": "2.4.1",
|
|
114
|
+
"@tamagui/popover": "2.4.1",
|
|
115
|
+
"@tamagui/popper": "2.4.1",
|
|
116
|
+
"@tamagui/portal": "2.4.1",
|
|
117
|
+
"@tamagui/progress": "2.4.1",
|
|
118
|
+
"@tamagui/radio-group": "2.4.1",
|
|
119
|
+
"@tamagui/react-native-media-driver": "2.4.1",
|
|
120
|
+
"@tamagui/scroll-view": "2.4.1",
|
|
121
|
+
"@tamagui/select": "2.4.1",
|
|
122
|
+
"@tamagui/separator": "2.4.1",
|
|
123
|
+
"@tamagui/shapes": "2.4.1",
|
|
124
|
+
"@tamagui/sheet": "2.4.1",
|
|
125
|
+
"@tamagui/slider": "2.4.1",
|
|
126
|
+
"@tamagui/spacer": "2.4.1",
|
|
127
|
+
"@tamagui/spinner": "2.4.1",
|
|
128
|
+
"@tamagui/stacks": "2.4.1",
|
|
129
|
+
"@tamagui/switch": "2.4.1",
|
|
130
|
+
"@tamagui/tabs": "2.4.1",
|
|
131
|
+
"@tamagui/text": "2.4.1",
|
|
132
|
+
"@tamagui/theme": "2.4.1",
|
|
133
|
+
"@tamagui/toast": "2.4.1",
|
|
134
|
+
"@tamagui/toggle-group": "2.4.1",
|
|
135
|
+
"@tamagui/tooltip": "2.4.1",
|
|
136
|
+
"@tamagui/use-controllable-state": "2.4.1",
|
|
137
|
+
"@tamagui/use-debounce": "2.4.1",
|
|
138
|
+
"@tamagui/use-force-update": "2.4.1",
|
|
139
|
+
"@tamagui/use-window-dimensions": "2.4.1",
|
|
140
|
+
"@tamagui/visually-hidden": "2.4.1",
|
|
141
|
+
"@tamagui/font-size": "2.4.1",
|
|
142
|
+
"@tamagui/z-index-stack": "2.4.1"
|
|
143
143
|
},
|
|
144
144
|
"devDependencies": {
|
|
145
|
-
"@tamagui/build": "2.4.
|
|
145
|
+
"@tamagui/build": "2.4.1",
|
|
146
146
|
"react": ">=19",
|
|
147
147
|
"react-native": "0.83.2",
|
|
148
148
|
"react-native-web": "^0.21.0"
|