@tamagui/core 3.0.0-beta.1479.1 → 3.0.0-beta.1537.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/native.cjs +88 -118
- package/dist/test.native.cjs +88 -118
- package/package.json +12 -12
package/dist/native.cjs
CHANGED
|
@@ -12843,7 +12843,7 @@ var getSnapshotImpl = function(r) {
|
|
|
12843
12843
|
var isSchemeOnlyChange = !optimizeForFirstRender && supportsDynamicColorIOS && getSetting("fastSchemeChange") && local && parentState && local.scheme !== parentState.scheme && getThemeBaseName(local.name) === getThemeBaseName(parentState.name);
|
|
12844
12844
|
var allKeysSchemeOptimized = !optimizeForFirstRender && Boolean(((_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) && (schemeKeys === null || schemeKeys === void 0 ? void 0 : (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) === keys.current.size);
|
|
12845
12845
|
var canSkipForSchemeChange = Boolean(isSchemeOnlyChange && allKeysSchemeOptimized);
|
|
12846
|
-
var needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.name === "light" || props.name === "dark" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : (keys === null || keys === void 0 ? void 0 : (_keys_current1 = keys.current) === null || _keys_current1 === void 0 ? void 0 : _keys_current1.size) ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props);
|
|
12846
|
+
var needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.forceClassName || props.name === "light" || props.name === "dark" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : (keys === null || keys === void 0 ? void 0 : (_keys_current1 = keys.current) === null || _keys_current1 === void 0 ? void 0 : _keys_current1.size) ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props);
|
|
12847
12847
|
var [rerender, nextRaw] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));
|
|
12848
12848
|
var next = nextRaw;
|
|
12849
12849
|
if (props._themeUpdate && (nextRaw === null || nextRaw === void 0 ? void 0 : nextRaw.theme)) {
|
|
@@ -12870,7 +12870,7 @@ var getSnapshotImpl = function(r) {
|
|
|
12870
12870
|
var getNextState = function(lastState, props, propsKey) {
|
|
12871
12871
|
var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, id = arguments.length > 4 ? arguments[4] : void 0, parentId = arguments.length > 5 ? arguments[5] : void 0, needsUpdate = arguments.length > 6 ? arguments[6] : void 0, pendingUpdate = arguments.length > 7 ? arguments[7] : void 0;
|
|
12872
12872
|
var parentState = states.get(parentId);
|
|
12873
|
-
if (props.passThrough) return [false,
|
|
12873
|
+
if (props.passThrough) return [false, parentState || lastState || { name: "" }];
|
|
12874
12874
|
themes || (themes = getConfig().themes);
|
|
12875
12875
|
var name = !propsKey && (!lastState || !lastState.isNew) ? null : getNewThemeName(parentState === null || parentState === void 0 ? void 0 : parentState.name, props, pendingUpdate === "force" ? true : !!needsUpdate);
|
|
12876
12876
|
var authoredName = props.name;
|
|
@@ -13516,141 +13516,80 @@ var defaultComponentStateMounted = _objectSpread2(_objectSpread2({}, defaultComp
|
|
|
13516
13516
|
_objectSpread2(_objectSpread2({}, defaultComponentState), {}, { unmounted: "should-enter" });
|
|
13517
13517
|
//#endregion
|
|
13518
13518
|
//#region ../web/dist/esm/helpers/mainThreadPressEvents.native.js
|
|
13519
|
-
var DEFAULT_LONG_PRESS_DELAY = 500;
|
|
13520
|
-
var DEFAULT_MIN_PRESS_DURATION = 130;
|
|
13521
13519
|
function useMainThreadPressEvents(events, viewProps) {
|
|
13522
13520
|
var enabled = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
|
|
13523
13521
|
arguments.length > 3 && arguments[3];
|
|
13524
|
-
var
|
|
13525
|
-
|
|
13526
|
-
|
|
13527
|
-
|
|
13528
|
-
|
|
13529
|
-
|
|
13530
|
-
|
|
13531
|
-
blockedByExternalOwnership: false,
|
|
13532
|
-
pressInOutstanding: false
|
|
13533
|
-
};
|
|
13534
|
-
(0, react.useEffect)(function() {
|
|
13535
|
-
return function() {
|
|
13536
|
-
clearStartTimers();
|
|
13537
|
-
if (ref.current.pressOutTimer) {
|
|
13538
|
-
clearTimeout(ref.current.pressOutTimer);
|
|
13539
|
-
ref.current.pressOutTimer = null;
|
|
13540
|
-
}
|
|
13541
|
-
};
|
|
13542
|
-
}, []);
|
|
13543
|
-
if (!enabled || !events) return;
|
|
13544
|
-
var _events_delayPressIn;
|
|
13545
|
-
var delayPressIn = Math.max(0, (_events_delayPressIn = events.delayPressIn) !== null && _events_delayPressIn !== void 0 ? _events_delayPressIn : 0);
|
|
13546
|
-
var _events_delayPressOut;
|
|
13547
|
-
var delayPressOut = Math.max(0, (_events_delayPressOut = events.delayPressOut) !== null && _events_delayPressOut !== void 0 ? _events_delayPressOut : 0);
|
|
13548
|
-
var _events_delayLongPress;
|
|
13549
|
-
var delayLongPress = Math.max(0, (_events_delayLongPress = events.delayLongPress) !== null && _events_delayLongPress !== void 0 ? _events_delayLongPress : DEFAULT_LONG_PRESS_DELAY);
|
|
13550
|
-
var _events_minPressDuration;
|
|
13551
|
-
var minPressDuration = Math.max(0, (_events_minPressDuration = events.minPressDuration) !== null && _events_minPressDuration !== void 0 ? _events_minPressDuration : DEFAULT_MIN_PRESS_DURATION);
|
|
13552
|
-
function activate(e) {
|
|
13553
|
-
var _events_onPressIn;
|
|
13554
|
-
if (ref.current.pressInOutstanding) return;
|
|
13555
|
-
ref.current.pressInOutstanding = true;
|
|
13556
|
-
ref.current.state = "active";
|
|
13557
|
-
ref.current.activateTime = Date.now();
|
|
13558
|
-
(_events_onPressIn = events.onPressIn) === null || _events_onPressIn === void 0 || _events_onPressIn.call(events, e);
|
|
13559
|
-
}
|
|
13560
|
-
function clearStartTimers() {
|
|
13561
|
-
if (ref.current.pressInTimer) clearTimeout(ref.current.pressInTimer);
|
|
13562
|
-
if (ref.current.longPressTimer) clearTimeout(ref.current.longPressTimer);
|
|
13563
|
-
ref.current.pressInTimer = null;
|
|
13564
|
-
ref.current.longPressTimer = null;
|
|
13565
|
-
}
|
|
13566
|
-
function releasePressOut(e) {
|
|
13522
|
+
var usePressability = require("react-native/Libraries/Pressability/usePressability").default;
|
|
13523
|
+
var initialized = (0, react.useRef)(false);
|
|
13524
|
+
var ownsResponder = (0, react.useRef)(false);
|
|
13525
|
+
var pressActive = (0, react.useRef)(false);
|
|
13526
|
+
var active = enabled && Boolean(events);
|
|
13527
|
+
if (active) initialized.current = true;
|
|
13528
|
+
function endPress(e) {
|
|
13567
13529
|
var _events_onPressOut;
|
|
13568
|
-
if (
|
|
13569
|
-
|
|
13570
|
-
|
|
13571
|
-
|
|
13572
|
-
|
|
13573
|
-
|
|
13574
|
-
|
|
13575
|
-
|
|
13576
|
-
|
|
13577
|
-
|
|
13578
|
-
|
|
13579
|
-
|
|
13580
|
-
|
|
13581
|
-
|
|
13582
|
-
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
} else releasePressOut(e);
|
|
13587
|
-
}
|
|
13588
|
-
function resetPress(e) {
|
|
13589
|
-
releasePressOut(e);
|
|
13590
|
-
clearStartTimers();
|
|
13591
|
-
ref.current.blockedByExternalOwnership = false;
|
|
13592
|
-
}
|
|
13530
|
+
if (!pressActive.current) return;
|
|
13531
|
+
pressActive.current = false;
|
|
13532
|
+
events === null || events === void 0 || (_events_onPressOut = events.onPressOut) == null || _events_onPressOut.call(events, e);
|
|
13533
|
+
}
|
|
13534
|
+
var handlers = usePressability(initialized.current ? _objectSpread2(_objectSpread2({}, active ? events : {}), {}, {
|
|
13535
|
+
disabled: !active || (events === null || events === void 0 ? void 0 : events.disabled),
|
|
13536
|
+
android_disableSound: true,
|
|
13537
|
+
onPressIn: active ? function(e) {
|
|
13538
|
+
var _events_onPressIn;
|
|
13539
|
+
endPress(e);
|
|
13540
|
+
pressActive.current = true;
|
|
13541
|
+
(_events_onPressIn = events.onPressIn) === null || _events_onPressIn === void 0 || _events_onPressIn.call(events, e);
|
|
13542
|
+
} : void 0,
|
|
13543
|
+
onPressOut: active ? endPress : void 0,
|
|
13544
|
+
hitSlop: viewProps.hitSlop,
|
|
13545
|
+
pressRectOffset: viewProps.pressRetentionOffset
|
|
13546
|
+
}) : null);
|
|
13547
|
+
if (!active || !handlers) return;
|
|
13593
13548
|
var userStartShouldSet = viewProps.onStartShouldSetResponder;
|
|
13594
13549
|
var userGrant = viewProps.onResponderGrant;
|
|
13595
13550
|
var userRelease = viewProps.onResponderRelease;
|
|
13596
13551
|
var userTerminate = viewProps.onResponderTerminate;
|
|
13597
13552
|
var userTerminationRequest = viewProps.onResponderTerminationRequest;
|
|
13598
13553
|
var userMove = viewProps.onResponderMove;
|
|
13554
|
+
var userClick = viewProps.onClick;
|
|
13599
13555
|
viewProps.onStartShouldSetResponder = function(e) {
|
|
13600
|
-
|
|
13601
|
-
return !events.disabled && !hasExternalPressOwnership();
|
|
13556
|
+
return (userStartShouldSet === null || userStartShouldSet === void 0 ? void 0 : userStartShouldSet(e)) || !hasExternalPressOwnership() && handlers.onStartShouldSetResponder();
|
|
13602
13557
|
};
|
|
13603
13558
|
viewProps.onResponderGrant = function(e) {
|
|
13604
|
-
|
|
13605
|
-
|
|
13606
|
-
if (hasExternalPressOwnership()) {
|
|
13607
|
-
ref.current.state = "idle";
|
|
13608
|
-
ref.current.blockedByExternalOwnership = true;
|
|
13609
|
-
return;
|
|
13610
|
-
}
|
|
13559
|
+
endPress(e);
|
|
13560
|
+
if (hasExternalPressOwnership()) return;
|
|
13611
13561
|
userGrant === null || userGrant === void 0 || userGrant(e);
|
|
13612
|
-
|
|
13613
|
-
|
|
13614
|
-
if (delayPressIn > 0) ref.current.pressInTimer = setTimeout(function() {
|
|
13615
|
-
return activate(e);
|
|
13616
|
-
}, delayPressIn);
|
|
13617
|
-
else activate(e);
|
|
13618
|
-
if (events.onLongPress) ref.current.longPressTimer = setTimeout(function() {
|
|
13619
|
-
if (ref.current.state === "active") {
|
|
13620
|
-
var _events_onLongPress;
|
|
13621
|
-
ref.current.state = "longPressed";
|
|
13622
|
-
(_events_onLongPress = events.onLongPress) === null || _events_onLongPress === void 0 || _events_onLongPress.call(events, e);
|
|
13623
|
-
}
|
|
13624
|
-
}, delayLongPress + delayPressIn);
|
|
13562
|
+
ownsResponder.current = true;
|
|
13563
|
+
return handlers.onResponderGrant(e);
|
|
13625
13564
|
};
|
|
13626
13565
|
viewProps.onResponderRelease = function(e) {
|
|
13627
|
-
if (
|
|
13628
|
-
|
|
13566
|
+
if (!ownsResponder.current) return;
|
|
13567
|
+
ownsResponder.current = false;
|
|
13568
|
+
if (hasExternalPressOwnership()) {
|
|
13569
|
+
handlers.onResponderTerminate(e);
|
|
13570
|
+
endPress(e);
|
|
13629
13571
|
return;
|
|
13630
13572
|
}
|
|
13631
13573
|
userRelease === null || userRelease === void 0 || userRelease(e);
|
|
13632
|
-
|
|
13633
|
-
clearStartTimers();
|
|
13634
|
-
if (ref.current.state === "pressing") activate(e);
|
|
13635
|
-
if (!wasLongPressed) {
|
|
13636
|
-
var _events_onPress;
|
|
13637
|
-
(_events_onPress = events.onPress) === null || _events_onPress === void 0 || _events_onPress.call(events, e);
|
|
13638
|
-
}
|
|
13639
|
-
deactivate(e);
|
|
13640
|
-
ref.current.blockedByExternalOwnership = false;
|
|
13574
|
+
handlers.onResponderRelease(e);
|
|
13641
13575
|
};
|
|
13642
13576
|
viewProps.onResponderTerminate = function(e) {
|
|
13643
13577
|
userTerminate === null || userTerminate === void 0 || userTerminate(e);
|
|
13644
|
-
|
|
13578
|
+
if (ownsResponder.current) handlers.onResponderTerminate(e);
|
|
13579
|
+
endPress(e);
|
|
13580
|
+
ownsResponder.current = false;
|
|
13645
13581
|
};
|
|
13646
13582
|
viewProps.onResponderTerminationRequest = function(e) {
|
|
13647
|
-
|
|
13648
|
-
return
|
|
13583
|
+
var _userTerminationRequest;
|
|
13584
|
+
return (_userTerminationRequest = userTerminationRequest === null || userTerminationRequest === void 0 ? void 0 : userTerminationRequest(e)) !== null && _userTerminationRequest !== void 0 ? _userTerminationRequest : handlers.onResponderTerminationRequest();
|
|
13649
13585
|
};
|
|
13650
13586
|
viewProps.onResponderMove = function(e) {
|
|
13651
|
-
var _events_onPressMove;
|
|
13652
13587
|
userMove === null || userMove === void 0 || userMove(e);
|
|
13653
|
-
(
|
|
13588
|
+
if (ownsResponder.current) handlers.onResponderMove(e);
|
|
13589
|
+
};
|
|
13590
|
+
viewProps.onClick = function(e) {
|
|
13591
|
+
userClick === null || userClick === void 0 || userClick(e);
|
|
13592
|
+
if (!hasExternalPressOwnership()) handlers.onClick(e);
|
|
13654
13593
|
};
|
|
13655
13594
|
}
|
|
13656
13595
|
//#endregion
|
|
@@ -13729,7 +13668,7 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
|
|
|
13729
13668
|
if (firePress) (_callbacksRef_current_onPress = (_callbacksRef_current = callbacksRef.current).onPress) === null || _callbacksRef_current_onPress === void 0 || _callbacksRef_current_onPress.call(_callbacksRef_current, e !== null && e !== void 0 ? e : {});
|
|
13730
13669
|
(_callbacksRef_current_onPressOut = (_callbacksRef_current1 = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 || _callbacksRef_current_onPressOut.call(_callbacksRef_current1, e !== null && e !== void 0 ? e : {});
|
|
13731
13670
|
};
|
|
13732
|
-
useMainThreadPressEvents(events, viewProps,
|
|
13671
|
+
useMainThreadPressEvents(events, viewProps, Boolean(hasRealPressEvents || !isInsideNativeMenu && getIsAndroid() && hasPressEvents), debugName);
|
|
13733
13672
|
if (everEnabled) {
|
|
13734
13673
|
callbacksRef.current = hasPressEvents ? {
|
|
13735
13674
|
onPressIn: events.onPressIn,
|
|
@@ -13737,7 +13676,7 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
|
|
|
13737
13676
|
onPress: events.onPress,
|
|
13738
13677
|
onLongPress: events.onLongPress
|
|
13739
13678
|
} : {};
|
|
13740
|
-
if (hasRealPressEvents
|
|
13679
|
+
if (hasRealPressEvents) {
|
|
13741
13680
|
endPress();
|
|
13742
13681
|
gestureRef.current = null;
|
|
13743
13682
|
return null;
|
|
@@ -14004,6 +13943,27 @@ var nativeInlineExpansions = {
|
|
|
14004
13943
|
insetInlineStart: ["left"],
|
|
14005
13944
|
insetInlineEnd: ["right"]
|
|
14006
13945
|
};
|
|
13946
|
+
var paddingLogicals = ["paddingStart", "paddingEnd"];
|
|
13947
|
+
var marginLogicals = ["marginStart", "marginEnd"];
|
|
13948
|
+
var nativeShorthandLogicals = {
|
|
13949
|
+
padding: paddingLogicals,
|
|
13950
|
+
paddingHorizontal: paddingLogicals,
|
|
13951
|
+
margin: marginLogicals,
|
|
13952
|
+
marginHorizontal: marginLogicals,
|
|
13953
|
+
borderRadius: [
|
|
13954
|
+
"borderTopStartRadius",
|
|
13955
|
+
"borderTopEndRadius",
|
|
13956
|
+
"borderBottomStartRadius",
|
|
13957
|
+
"borderBottomEndRadius",
|
|
13958
|
+
"borderStartStartRadius",
|
|
13959
|
+
"borderStartEndRadius",
|
|
13960
|
+
"borderEndStartRadius",
|
|
13961
|
+
"borderEndEndRadius"
|
|
13962
|
+
],
|
|
13963
|
+
borderWidth: ["borderStartWidth", "borderEndWidth"],
|
|
13964
|
+
borderColor: ["borderStartColor", "borderEndColor"],
|
|
13965
|
+
gap: ["rowGap", "columnGap"]
|
|
13966
|
+
};
|
|
14007
13967
|
//#endregion
|
|
14008
13968
|
//#region ../web/dist/esm/helpers/defaultOffset.native.js
|
|
14009
13969
|
var defaultOffset = {
|
|
@@ -16367,24 +16327,34 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
16367
16327
|
}
|
|
16368
16328
|
value3 = variants;
|
|
16369
16329
|
}
|
|
16330
|
+
if (!cursor && !state.styleProps.noExpand) {
|
|
16331
|
+
var logicals = nativeShorthandLogicals[property];
|
|
16332
|
+
var slots = state.flatSlots;
|
|
16333
|
+
if (logicals && slots) for (var index1 = 0; index1 < logicals.length; index1++) {
|
|
16334
|
+
var list = slots.get(logicals[index1]);
|
|
16335
|
+
if (!list) continue;
|
|
16336
|
+
for (var entry = list.length; entry--;) if (list[entry][3] === "") list.splice(entry, 1);
|
|
16337
|
+
if (!list.length) clearDirectStyle(state, logicals[index1]);
|
|
16338
|
+
}
|
|
16339
|
+
}
|
|
16370
16340
|
var expanded = !state.styleProps.noExpand ? expandStyle(property, value3, state.conf.settings.styleCompat || "web") : null;
|
|
16371
16341
|
if (!expanded) {
|
|
16372
16342
|
emitProperty(state, property, value3, cursor, originalValue, contextOnly);
|
|
16373
16343
|
return;
|
|
16374
16344
|
}
|
|
16375
|
-
if (typeof raw === "string" && expanded.length > 1 && expanded.every(function(
|
|
16376
|
-
return
|
|
16345
|
+
if (typeof raw === "string" && expanded.length > 1 && expanded.every(function(entry2) {
|
|
16346
|
+
return entry2[1] === expanded[0][1];
|
|
16377
16347
|
})) {
|
|
16378
16348
|
var parts1 = splitComponents(raw);
|
|
16379
16349
|
if (parts1.length > 0 && parts1.length <= (expanded.length === 4 ? 4 : 2)) {
|
|
16380
|
-
for (var
|
|
16381
|
-
var partIndex =
|
|
16382
|
-
emitResolved(state, expanded[
|
|
16350
|
+
for (var index2 = 0; index2 < expanded.length; index2++) {
|
|
16351
|
+
var partIndex = index2 === 0 || parts1.length === 1 ? 0 : index2 === 1 || index2 === 3 && parts1.length < 4 ? 1 : index2 === 2 && parts1.length < 3 ? 0 : index2;
|
|
16352
|
+
emitResolved(state, expanded[index2][0], parts1[partIndex], cursor, originalValue, contextOnly);
|
|
16383
16353
|
}
|
|
16384
16354
|
return;
|
|
16385
16355
|
}
|
|
16386
16356
|
}
|
|
16387
|
-
for (var
|
|
16357
|
+
for (var index3 = 0; index3 < expanded.length; index3++) emitProperty(state, expanded[index3][0], expanded[index3][1], cursor, originalValue, contextOnly);
|
|
16388
16358
|
}
|
|
16389
16359
|
function emitConditionalValue(state, property, payload, condition, source, sink, mode, contextOnly) {
|
|
16390
16360
|
if (sink) sink(payload, condition, source);
|
package/dist/test.native.cjs
CHANGED
|
@@ -3092,7 +3092,7 @@ var getSnapshotImpl = function(r) {
|
|
|
3092
3092
|
var isSchemeOnlyChange = !optimizeForFirstRender && supportsDynamicColorIOS && getSetting("fastSchemeChange") && local && parentState && local.scheme !== parentState.scheme && getThemeBaseName(local.name) === getThemeBaseName(parentState.name);
|
|
3093
3093
|
var allKeysSchemeOptimized = !optimizeForFirstRender && Boolean(((_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) && (schemeKeys === null || schemeKeys === void 0 ? void 0 : (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) === keys.current.size);
|
|
3094
3094
|
var canSkipForSchemeChange = Boolean(isSchemeOnlyChange && allKeysSchemeOptimized);
|
|
3095
|
-
var needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.name === "light" || props.name === "dark" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : (keys === null || keys === void 0 ? void 0 : (_keys_current1 = keys.current) === null || _keys_current1 === void 0 ? void 0 : _keys_current1.size) ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props);
|
|
3095
|
+
var needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.forceClassName || props.name === "light" || props.name === "dark" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : (keys === null || keys === void 0 ? void 0 : (_keys_current1 = keys.current) === null || _keys_current1 === void 0 ? void 0 : _keys_current1.size) ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props);
|
|
3096
3096
|
var [rerender, nextRaw] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));
|
|
3097
3097
|
var next = nextRaw;
|
|
3098
3098
|
if (props._themeUpdate && (nextRaw === null || nextRaw === void 0 ? void 0 : nextRaw.theme)) {
|
|
@@ -3119,7 +3119,7 @@ var getSnapshotImpl = function(r) {
|
|
|
3119
3119
|
var getNextState = function(lastState, props, propsKey) {
|
|
3120
3120
|
var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, id = arguments.length > 4 ? arguments[4] : void 0, parentId = arguments.length > 5 ? arguments[5] : void 0, needsUpdate = arguments.length > 6 ? arguments[6] : void 0, pendingUpdate = arguments.length > 7 ? arguments[7] : void 0;
|
|
3121
3121
|
var parentState = states.get(parentId);
|
|
3122
|
-
if (props.passThrough) return [false,
|
|
3122
|
+
if (props.passThrough) return [false, parentState || lastState || { name: "" }];
|
|
3123
3123
|
themes || (themes = getConfig().themes);
|
|
3124
3124
|
var name = !propsKey && (!lastState || !lastState.isNew) ? null : getNewThemeName(parentState === null || parentState === void 0 ? void 0 : parentState.name, props, pendingUpdate === "force" ? true : !!needsUpdate);
|
|
3125
3125
|
var authoredName = props.name;
|
|
@@ -3791,141 +3791,80 @@ var defaultComponentStateMounted = _objectSpread2(_objectSpread2({}, defaultComp
|
|
|
3791
3791
|
_objectSpread2(_objectSpread2({}, defaultComponentState), {}, { unmounted: "should-enter" });
|
|
3792
3792
|
//#endregion
|
|
3793
3793
|
//#region ../web/dist/esm/helpers/mainThreadPressEvents.native.js
|
|
3794
|
-
var DEFAULT_LONG_PRESS_DELAY = 500;
|
|
3795
|
-
var DEFAULT_MIN_PRESS_DURATION = 130;
|
|
3796
3794
|
function useMainThreadPressEvents(events, viewProps) {
|
|
3797
3795
|
var enabled = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
|
|
3798
3796
|
arguments.length > 3 && arguments[3];
|
|
3799
|
-
var
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
blockedByExternalOwnership: false,
|
|
3807
|
-
pressInOutstanding: false
|
|
3808
|
-
};
|
|
3809
|
-
(0, react.useEffect)(function() {
|
|
3810
|
-
return function() {
|
|
3811
|
-
clearStartTimers();
|
|
3812
|
-
if (ref.current.pressOutTimer) {
|
|
3813
|
-
clearTimeout(ref.current.pressOutTimer);
|
|
3814
|
-
ref.current.pressOutTimer = null;
|
|
3815
|
-
}
|
|
3816
|
-
};
|
|
3817
|
-
}, []);
|
|
3818
|
-
if (!enabled || !events) return;
|
|
3819
|
-
var _events_delayPressIn;
|
|
3820
|
-
var delayPressIn = Math.max(0, (_events_delayPressIn = events.delayPressIn) !== null && _events_delayPressIn !== void 0 ? _events_delayPressIn : 0);
|
|
3821
|
-
var _events_delayPressOut;
|
|
3822
|
-
var delayPressOut = Math.max(0, (_events_delayPressOut = events.delayPressOut) !== null && _events_delayPressOut !== void 0 ? _events_delayPressOut : 0);
|
|
3823
|
-
var _events_delayLongPress;
|
|
3824
|
-
var delayLongPress = Math.max(0, (_events_delayLongPress = events.delayLongPress) !== null && _events_delayLongPress !== void 0 ? _events_delayLongPress : DEFAULT_LONG_PRESS_DELAY);
|
|
3825
|
-
var _events_minPressDuration;
|
|
3826
|
-
var minPressDuration = Math.max(0, (_events_minPressDuration = events.minPressDuration) !== null && _events_minPressDuration !== void 0 ? _events_minPressDuration : DEFAULT_MIN_PRESS_DURATION);
|
|
3827
|
-
function activate(e) {
|
|
3828
|
-
var _events_onPressIn;
|
|
3829
|
-
if (ref.current.pressInOutstanding) return;
|
|
3830
|
-
ref.current.pressInOutstanding = true;
|
|
3831
|
-
ref.current.state = "active";
|
|
3832
|
-
ref.current.activateTime = Date.now();
|
|
3833
|
-
(_events_onPressIn = events.onPressIn) === null || _events_onPressIn === void 0 || _events_onPressIn.call(events, e);
|
|
3834
|
-
}
|
|
3835
|
-
function clearStartTimers() {
|
|
3836
|
-
if (ref.current.pressInTimer) clearTimeout(ref.current.pressInTimer);
|
|
3837
|
-
if (ref.current.longPressTimer) clearTimeout(ref.current.longPressTimer);
|
|
3838
|
-
ref.current.pressInTimer = null;
|
|
3839
|
-
ref.current.longPressTimer = null;
|
|
3840
|
-
}
|
|
3841
|
-
function releasePressOut(e) {
|
|
3797
|
+
var usePressability = require("react-native/Libraries/Pressability/usePressability").default;
|
|
3798
|
+
var initialized = (0, react.useRef)(false);
|
|
3799
|
+
var ownsResponder = (0, react.useRef)(false);
|
|
3800
|
+
var pressActive = (0, react.useRef)(false);
|
|
3801
|
+
var active = enabled && Boolean(events);
|
|
3802
|
+
if (active) initialized.current = true;
|
|
3803
|
+
function endPress(e) {
|
|
3842
3804
|
var _events_onPressOut;
|
|
3843
|
-
if (
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
} else releasePressOut(e);
|
|
3862
|
-
}
|
|
3863
|
-
function resetPress(e) {
|
|
3864
|
-
releasePressOut(e);
|
|
3865
|
-
clearStartTimers();
|
|
3866
|
-
ref.current.blockedByExternalOwnership = false;
|
|
3867
|
-
}
|
|
3805
|
+
if (!pressActive.current) return;
|
|
3806
|
+
pressActive.current = false;
|
|
3807
|
+
events === null || events === void 0 || (_events_onPressOut = events.onPressOut) == null || _events_onPressOut.call(events, e);
|
|
3808
|
+
}
|
|
3809
|
+
var handlers = usePressability(initialized.current ? _objectSpread2(_objectSpread2({}, active ? events : {}), {}, {
|
|
3810
|
+
disabled: !active || (events === null || events === void 0 ? void 0 : events.disabled),
|
|
3811
|
+
android_disableSound: true,
|
|
3812
|
+
onPressIn: active ? function(e) {
|
|
3813
|
+
var _events_onPressIn;
|
|
3814
|
+
endPress(e);
|
|
3815
|
+
pressActive.current = true;
|
|
3816
|
+
(_events_onPressIn = events.onPressIn) === null || _events_onPressIn === void 0 || _events_onPressIn.call(events, e);
|
|
3817
|
+
} : void 0,
|
|
3818
|
+
onPressOut: active ? endPress : void 0,
|
|
3819
|
+
hitSlop: viewProps.hitSlop,
|
|
3820
|
+
pressRectOffset: viewProps.pressRetentionOffset
|
|
3821
|
+
}) : null);
|
|
3822
|
+
if (!active || !handlers) return;
|
|
3868
3823
|
var userStartShouldSet = viewProps.onStartShouldSetResponder;
|
|
3869
3824
|
var userGrant = viewProps.onResponderGrant;
|
|
3870
3825
|
var userRelease = viewProps.onResponderRelease;
|
|
3871
3826
|
var userTerminate = viewProps.onResponderTerminate;
|
|
3872
3827
|
var userTerminationRequest = viewProps.onResponderTerminationRequest;
|
|
3873
3828
|
var userMove = viewProps.onResponderMove;
|
|
3829
|
+
var userClick = viewProps.onClick;
|
|
3874
3830
|
viewProps.onStartShouldSetResponder = function(e) {
|
|
3875
|
-
|
|
3876
|
-
return !events.disabled && !hasExternalPressOwnership();
|
|
3831
|
+
return (userStartShouldSet === null || userStartShouldSet === void 0 ? void 0 : userStartShouldSet(e)) || !hasExternalPressOwnership() && handlers.onStartShouldSetResponder();
|
|
3877
3832
|
};
|
|
3878
3833
|
viewProps.onResponderGrant = function(e) {
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
if (hasExternalPressOwnership()) {
|
|
3882
|
-
ref.current.state = "idle";
|
|
3883
|
-
ref.current.blockedByExternalOwnership = true;
|
|
3884
|
-
return;
|
|
3885
|
-
}
|
|
3834
|
+
endPress(e);
|
|
3835
|
+
if (hasExternalPressOwnership()) return;
|
|
3886
3836
|
userGrant === null || userGrant === void 0 || userGrant(e);
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
if (delayPressIn > 0) ref.current.pressInTimer = setTimeout(function() {
|
|
3890
|
-
return activate(e);
|
|
3891
|
-
}, delayPressIn);
|
|
3892
|
-
else activate(e);
|
|
3893
|
-
if (events.onLongPress) ref.current.longPressTimer = setTimeout(function() {
|
|
3894
|
-
if (ref.current.state === "active") {
|
|
3895
|
-
var _events_onLongPress;
|
|
3896
|
-
ref.current.state = "longPressed";
|
|
3897
|
-
(_events_onLongPress = events.onLongPress) === null || _events_onLongPress === void 0 || _events_onLongPress.call(events, e);
|
|
3898
|
-
}
|
|
3899
|
-
}, delayLongPress + delayPressIn);
|
|
3837
|
+
ownsResponder.current = true;
|
|
3838
|
+
return handlers.onResponderGrant(e);
|
|
3900
3839
|
};
|
|
3901
3840
|
viewProps.onResponderRelease = function(e) {
|
|
3902
|
-
if (
|
|
3903
|
-
|
|
3841
|
+
if (!ownsResponder.current) return;
|
|
3842
|
+
ownsResponder.current = false;
|
|
3843
|
+
if (hasExternalPressOwnership()) {
|
|
3844
|
+
handlers.onResponderTerminate(e);
|
|
3845
|
+
endPress(e);
|
|
3904
3846
|
return;
|
|
3905
3847
|
}
|
|
3906
3848
|
userRelease === null || userRelease === void 0 || userRelease(e);
|
|
3907
|
-
|
|
3908
|
-
clearStartTimers();
|
|
3909
|
-
if (ref.current.state === "pressing") activate(e);
|
|
3910
|
-
if (!wasLongPressed) {
|
|
3911
|
-
var _events_onPress;
|
|
3912
|
-
(_events_onPress = events.onPress) === null || _events_onPress === void 0 || _events_onPress.call(events, e);
|
|
3913
|
-
}
|
|
3914
|
-
deactivate(e);
|
|
3915
|
-
ref.current.blockedByExternalOwnership = false;
|
|
3849
|
+
handlers.onResponderRelease(e);
|
|
3916
3850
|
};
|
|
3917
3851
|
viewProps.onResponderTerminate = function(e) {
|
|
3918
3852
|
userTerminate === null || userTerminate === void 0 || userTerminate(e);
|
|
3919
|
-
|
|
3853
|
+
if (ownsResponder.current) handlers.onResponderTerminate(e);
|
|
3854
|
+
endPress(e);
|
|
3855
|
+
ownsResponder.current = false;
|
|
3920
3856
|
};
|
|
3921
3857
|
viewProps.onResponderTerminationRequest = function(e) {
|
|
3922
|
-
|
|
3923
|
-
return
|
|
3858
|
+
var _userTerminationRequest;
|
|
3859
|
+
return (_userTerminationRequest = userTerminationRequest === null || userTerminationRequest === void 0 ? void 0 : userTerminationRequest(e)) !== null && _userTerminationRequest !== void 0 ? _userTerminationRequest : handlers.onResponderTerminationRequest();
|
|
3924
3860
|
};
|
|
3925
3861
|
viewProps.onResponderMove = function(e) {
|
|
3926
|
-
var _events_onPressMove;
|
|
3927
3862
|
userMove === null || userMove === void 0 || userMove(e);
|
|
3928
|
-
(
|
|
3863
|
+
if (ownsResponder.current) handlers.onResponderMove(e);
|
|
3864
|
+
};
|
|
3865
|
+
viewProps.onClick = function(e) {
|
|
3866
|
+
userClick === null || userClick === void 0 || userClick(e);
|
|
3867
|
+
if (!hasExternalPressOwnership()) handlers.onClick(e);
|
|
3929
3868
|
};
|
|
3930
3869
|
}
|
|
3931
3870
|
//#endregion
|
|
@@ -4004,7 +3943,7 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
|
|
|
4004
3943
|
if (firePress) (_callbacksRef_current_onPress = (_callbacksRef_current = callbacksRef.current).onPress) === null || _callbacksRef_current_onPress === void 0 || _callbacksRef_current_onPress.call(_callbacksRef_current, e !== null && e !== void 0 ? e : {});
|
|
4005
3944
|
(_callbacksRef_current_onPressOut = (_callbacksRef_current1 = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 || _callbacksRef_current_onPressOut.call(_callbacksRef_current1, e !== null && e !== void 0 ? e : {});
|
|
4006
3945
|
};
|
|
4007
|
-
useMainThreadPressEvents(events, viewProps,
|
|
3946
|
+
useMainThreadPressEvents(events, viewProps, Boolean(hasRealPressEvents || !isInsideNativeMenu && getIsAndroid() && hasPressEvents), debugName);
|
|
4008
3947
|
if (everEnabled) {
|
|
4009
3948
|
callbacksRef.current = hasPressEvents ? {
|
|
4010
3949
|
onPressIn: events.onPressIn,
|
|
@@ -4012,7 +3951,7 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
|
|
|
4012
3951
|
onPress: events.onPress,
|
|
4013
3952
|
onLongPress: events.onLongPress
|
|
4014
3953
|
} : {};
|
|
4015
|
-
if (hasRealPressEvents
|
|
3954
|
+
if (hasRealPressEvents) {
|
|
4016
3955
|
endPress();
|
|
4017
3956
|
gestureRef.current = null;
|
|
4018
3957
|
return null;
|
|
@@ -4279,6 +4218,27 @@ var nativeInlineExpansions = {
|
|
|
4279
4218
|
insetInlineStart: ["left"],
|
|
4280
4219
|
insetInlineEnd: ["right"]
|
|
4281
4220
|
};
|
|
4221
|
+
var paddingLogicals = ["paddingStart", "paddingEnd"];
|
|
4222
|
+
var marginLogicals = ["marginStart", "marginEnd"];
|
|
4223
|
+
var nativeShorthandLogicals = {
|
|
4224
|
+
padding: paddingLogicals,
|
|
4225
|
+
paddingHorizontal: paddingLogicals,
|
|
4226
|
+
margin: marginLogicals,
|
|
4227
|
+
marginHorizontal: marginLogicals,
|
|
4228
|
+
borderRadius: [
|
|
4229
|
+
"borderTopStartRadius",
|
|
4230
|
+
"borderTopEndRadius",
|
|
4231
|
+
"borderBottomStartRadius",
|
|
4232
|
+
"borderBottomEndRadius",
|
|
4233
|
+
"borderStartStartRadius",
|
|
4234
|
+
"borderStartEndRadius",
|
|
4235
|
+
"borderEndStartRadius",
|
|
4236
|
+
"borderEndEndRadius"
|
|
4237
|
+
],
|
|
4238
|
+
borderWidth: ["borderStartWidth", "borderEndWidth"],
|
|
4239
|
+
borderColor: ["borderStartColor", "borderEndColor"],
|
|
4240
|
+
gap: ["rowGap", "columnGap"]
|
|
4241
|
+
};
|
|
4282
4242
|
//#endregion
|
|
4283
4243
|
//#region ../web/dist/esm/helpers/defaultOffset.native.js
|
|
4284
4244
|
var defaultOffset = {
|
|
@@ -7262,24 +7222,34 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
7262
7222
|
}
|
|
7263
7223
|
value3 = variants;
|
|
7264
7224
|
}
|
|
7225
|
+
if (!cursor && !state.styleProps.noExpand) {
|
|
7226
|
+
var logicals = nativeShorthandLogicals[property];
|
|
7227
|
+
var slots = state.flatSlots;
|
|
7228
|
+
if (logicals && slots) for (var index1 = 0; index1 < logicals.length; index1++) {
|
|
7229
|
+
var list = slots.get(logicals[index1]);
|
|
7230
|
+
if (!list) continue;
|
|
7231
|
+
for (var entry = list.length; entry--;) if (list[entry][3] === "") list.splice(entry, 1);
|
|
7232
|
+
if (!list.length) clearDirectStyle(state, logicals[index1]);
|
|
7233
|
+
}
|
|
7234
|
+
}
|
|
7265
7235
|
var expanded = !state.styleProps.noExpand ? expandStyle(property, value3, state.conf.settings.styleCompat || "web") : null;
|
|
7266
7236
|
if (!expanded) {
|
|
7267
7237
|
emitProperty(state, property, value3, cursor, originalValue, contextOnly);
|
|
7268
7238
|
return;
|
|
7269
7239
|
}
|
|
7270
|
-
if (typeof raw === "string" && expanded.length > 1 && expanded.every(function(
|
|
7271
|
-
return
|
|
7240
|
+
if (typeof raw === "string" && expanded.length > 1 && expanded.every(function(entry2) {
|
|
7241
|
+
return entry2[1] === expanded[0][1];
|
|
7272
7242
|
})) {
|
|
7273
7243
|
var parts1 = splitComponents(raw);
|
|
7274
7244
|
if (parts1.length > 0 && parts1.length <= (expanded.length === 4 ? 4 : 2)) {
|
|
7275
|
-
for (var
|
|
7276
|
-
var partIndex =
|
|
7277
|
-
emitResolved(state, expanded[
|
|
7245
|
+
for (var index2 = 0; index2 < expanded.length; index2++) {
|
|
7246
|
+
var partIndex = index2 === 0 || parts1.length === 1 ? 0 : index2 === 1 || index2 === 3 && parts1.length < 4 ? 1 : index2 === 2 && parts1.length < 3 ? 0 : index2;
|
|
7247
|
+
emitResolved(state, expanded[index2][0], parts1[partIndex], cursor, originalValue, contextOnly);
|
|
7278
7248
|
}
|
|
7279
7249
|
return;
|
|
7280
7250
|
}
|
|
7281
7251
|
}
|
|
7282
|
-
for (var
|
|
7252
|
+
for (var index3 = 0; index3 < expanded.length; index3++) emitProperty(state, expanded[index3][0], expanded[index3][1], cursor, originalValue, contextOnly);
|
|
7283
7253
|
}
|
|
7284
7254
|
function emitConditionalValue(state, property, payload, condition, source, sink, mode, contextOnly) {
|
|
7285
7255
|
if (sink) sink(payload, condition, source);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.1537.1",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -137,19 +137,19 @@
|
|
|
137
137
|
"clean:build": "tamagui-build clean:build"
|
|
138
138
|
},
|
|
139
139
|
"dependencies": {
|
|
140
|
-
"@tamagui/compose-refs": "3.0.0-beta.
|
|
141
|
-
"@tamagui/constants": "3.0.0-beta.
|
|
142
|
-
"@tamagui/helpers": "3.0.0-beta.
|
|
143
|
-
"@tamagui/react-native-media-driver": "3.0.0-beta.
|
|
144
|
-
"@tamagui/react-native-use-pressable": "3.0.0-beta.
|
|
145
|
-
"@tamagui/use-element-layout": "3.0.0-beta.
|
|
146
|
-
"@tamagui/use-event": "3.0.0-beta.
|
|
147
|
-
"@tamagui/web": "3.0.0-beta.
|
|
140
|
+
"@tamagui/compose-refs": "3.0.0-beta.1537.1",
|
|
141
|
+
"@tamagui/constants": "3.0.0-beta.1537.1",
|
|
142
|
+
"@tamagui/helpers": "3.0.0-beta.1537.1",
|
|
143
|
+
"@tamagui/react-native-media-driver": "3.0.0-beta.1537.1",
|
|
144
|
+
"@tamagui/react-native-use-pressable": "3.0.0-beta.1537.1",
|
|
145
|
+
"@tamagui/use-element-layout": "3.0.0-beta.1537.1",
|
|
146
|
+
"@tamagui/use-event": "3.0.0-beta.1537.1",
|
|
147
|
+
"@tamagui/web": "3.0.0-beta.1537.1"
|
|
148
148
|
},
|
|
149
149
|
"devDependencies": {
|
|
150
|
-
"@tamagui/build": "3.0.0-beta.
|
|
151
|
-
"@tamagui/native-bundle": "3.0.0-beta.
|
|
152
|
-
"@tamagui/react-native-web-lite": "3.0.0-beta.
|
|
150
|
+
"@tamagui/build": "3.0.0-beta.1537.1",
|
|
151
|
+
"@tamagui/native-bundle": "3.0.0-beta.1537.1",
|
|
152
|
+
"@tamagui/react-native-web-lite": "3.0.0-beta.1537.1",
|
|
153
153
|
"@testing-library/react": "^16.1.0",
|
|
154
154
|
"csstype": "^3.0.10",
|
|
155
155
|
"react": "19.2.3",
|