@tamagui/core 1.90.15 → 1.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/native.js +129 -94
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +122 -90
- package/dist/test.native.js.map +2 -2
- package/package.json +6 -6
- package/src/index.tsx +1 -1
package/dist/native.js
CHANGED
|
@@ -1335,7 +1335,9 @@ var require_concatClassName_native = __commonJS({
|
|
|
1335
1335
|
var pseudoInvert = {
|
|
1336
1336
|
hover: "hoverStyle",
|
|
1337
1337
|
focus: "focusStyle",
|
|
1338
|
-
press: "pressStyle"
|
|
1338
|
+
press: "pressStyle",
|
|
1339
|
+
focusVisible: "focusVisibleStyle",
|
|
1340
|
+
disabled: "disabledStyle"
|
|
1339
1341
|
};
|
|
1340
1342
|
}
|
|
1341
1343
|
});
|
|
@@ -1885,13 +1887,18 @@ var require_validStyleProps_native = __commonJS({
|
|
|
1885
1887
|
}),
|
|
1886
1888
|
// allow some web only ones
|
|
1887
1889
|
!1
|
|
1888
|
-
), stylePropsText = _object_spread2({}, stylePropsView, stylePropsTextOnly), stylePropsAll = stylePropsText, validPseudoKeys =
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1890
|
+
), stylePropsText = _object_spread2({}, stylePropsView, stylePropsTextOnly), stylePropsAll = stylePropsText, validPseudoKeys = _object_spread2(
|
|
1891
|
+
{
|
|
1892
|
+
enterStyle: !0,
|
|
1893
|
+
exitStyle: !0,
|
|
1894
|
+
hoverStyle: !0,
|
|
1895
|
+
pressStyle: !0,
|
|
1896
|
+
focusStyle: !0,
|
|
1897
|
+
disabledStyle: !0
|
|
1898
|
+
},
|
|
1899
|
+
// allow some web only ones
|
|
1900
|
+
!1
|
|
1901
|
+
), validStyles = _object_spread2({}, validPseudoKeys, stylePropsView);
|
|
1895
1902
|
}
|
|
1896
1903
|
});
|
|
1897
1904
|
|
|
@@ -2221,7 +2228,8 @@ var require_config_native = __commonJS({
|
|
|
2221
2228
|
var useVariable = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_constants.isWeb, token = getTokenObject(value, group);
|
|
2222
2229
|
return useVariable ? token == null ? void 0 : token.variable : token == null ? void 0 : token.val;
|
|
2223
2230
|
}, getTokenValue2 = function(value, group) {
|
|
2224
|
-
|
|
2231
|
+
if (!(value === "unset" || value === "auto"))
|
|
2232
|
+
return getToken2(value, group, !1);
|
|
2225
2233
|
}, useTokens = getTokens2, getThemes2 = function() {
|
|
2226
2234
|
return conf.themes;
|
|
2227
2235
|
}, configListeners = /* @__PURE__ */ new Set(), onConfiguredOnce = function(cb) {
|
|
@@ -2984,14 +2992,26 @@ var require_pseudoDescriptors_native = __commonJS({
|
|
|
2984
2992
|
stateKey: "press",
|
|
2985
2993
|
priority: 2
|
|
2986
2994
|
},
|
|
2995
|
+
focusVisibleStyle: {
|
|
2996
|
+
name: "focus-visible",
|
|
2997
|
+
priority: 3,
|
|
2998
|
+
stateKey: "focusVisible"
|
|
2999
|
+
},
|
|
2987
3000
|
focusStyle: {
|
|
2988
3001
|
name: "focus",
|
|
2989
3002
|
priority: 3
|
|
3003
|
+
},
|
|
3004
|
+
disabledStyle: {
|
|
3005
|
+
name: "disabled",
|
|
3006
|
+
priority: 4,
|
|
3007
|
+
stateKey: "disabled"
|
|
2990
3008
|
}
|
|
2991
3009
|
}, pseudoPriorities = {
|
|
2992
3010
|
hover: 1,
|
|
2993
3011
|
press: 2,
|
|
2994
|
-
focus: 3
|
|
3012
|
+
focus: 3,
|
|
3013
|
+
focusVisible: 3,
|
|
3014
|
+
disabled: 4
|
|
2995
3015
|
}, pseudoDescriptors = _object_spread_props(_object_spread2({}, pseudoDescriptorsBase), {
|
|
2996
3016
|
enterStyle: {
|
|
2997
3017
|
name: "enter",
|
|
@@ -3911,18 +3931,22 @@ var require_createShallowSetState_native = __commonJS({
|
|
|
3911
3931
|
}
|
|
3912
3932
|
return target;
|
|
3913
3933
|
}
|
|
3914
|
-
function createShallowSetState(setter, debug) {
|
|
3934
|
+
function createShallowSetState(setter, isDisabled, debug) {
|
|
3915
3935
|
return function(next) {
|
|
3916
3936
|
return setter(function(prev) {
|
|
3917
|
-
return mergeIfNotShallowEqual(prev, next, debug);
|
|
3937
|
+
return mergeIfNotShallowEqual(prev, next, isDisabled, debug);
|
|
3918
3938
|
});
|
|
3919
3939
|
};
|
|
3920
3940
|
}
|
|
3921
|
-
function mergeIfNotShallowEqual(prev, next, debug) {
|
|
3922
|
-
|
|
3941
|
+
function mergeIfNotShallowEqual(prev, next, isDisabled, debug) {
|
|
3942
|
+
if (isDisabled || !prev || !next || isEqualShallow(prev, next))
|
|
3943
|
+
return prev;
|
|
3944
|
+
if (process.env.NODE_ENV === "development" && debug && (console.warn("setStateShallow CHANGE", {
|
|
3923
3945
|
prev,
|
|
3924
3946
|
next
|
|
3925
|
-
}),
|
|
3947
|
+
}), debug === "break"))
|
|
3948
|
+
debugger;
|
|
3949
|
+
return _object_spread2({}, prev, next);
|
|
3926
3950
|
}
|
|
3927
3951
|
function isEqualShallow(prev, next) {
|
|
3928
3952
|
for (var key in next)
|
|
@@ -5065,7 +5089,9 @@ var require_defaultComponentState_native = __commonJS({
|
|
|
5065
5089
|
press: !1,
|
|
5066
5090
|
pressIn: !1,
|
|
5067
5091
|
focus: !1,
|
|
5068
|
-
|
|
5092
|
+
focusVisible: !1,
|
|
5093
|
+
unmounted: !0,
|
|
5094
|
+
disabled: !1
|
|
5069
5095
|
}, defaultComponentStateMounted = _object_spread_props(_object_spread2({}, defaultComponentState), {
|
|
5070
5096
|
unmounted: !1
|
|
5071
5097
|
}), defaultComponentStateShouldEnter = _object_spread_props(_object_spread2({}, defaultComponentState), {
|
|
@@ -7331,10 +7357,10 @@ var require_propMapper_native = __commonJS({
|
|
|
7331
7357
|
fontSize: "size",
|
|
7332
7358
|
fontWeight: "weight"
|
|
7333
7359
|
}, lastFontFamilyToken = null, getTokenForKey = function(key, value) {
|
|
7334
|
-
var resolveAs = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "none", styleState = arguments.length > 3 ? arguments[3] : void 0,
|
|
7360
|
+
var resolveAs = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "none", styleState = arguments.length > 3 ? arguments[3] : void 0, _staticConfig_accept;
|
|
7335
7361
|
if (resolveAs === "none")
|
|
7336
7362
|
return value;
|
|
7337
|
-
var theme = styleState.theme, _styleState_conf = styleState.conf, conf = _styleState_conf === void 0 ? (0, import_config.getConfig)() : _styleState_conf, context = styleState.context, fontFamily = styleState.fontFamily, staticConfig = styleState.staticConfig, tokensParsed = conf.tokensParsed, valOrVar, hasSet = !1, customTokenAccept = staticConfig == null || (
|
|
7363
|
+
var theme = styleState.theme, _styleState_conf = styleState.conf, conf = _styleState_conf === void 0 ? (0, import_config.getConfig)() : _styleState_conf, context = styleState.context, fontFamily = styleState.fontFamily, staticConfig = styleState.staticConfig, tokensParsed = conf.tokensParsed, valOrVar, hasSet = !1, customTokenAccept = staticConfig == null || (_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key];
|
|
7338
7364
|
if (customTokenAccept) {
|
|
7339
7365
|
var _theme_value, val = (_theme_value = theme == null ? void 0 : theme[value]) !== null && _theme_value !== void 0 ? _theme_value : tokensParsed[customTokenAccept][value];
|
|
7340
7366
|
val != null && (resolveAs = "value", valOrVar = val, hasSet = !0);
|
|
@@ -7602,8 +7628,8 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
7602
7628
|
}
|
|
7603
7629
|
var IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-";
|
|
7604
7630
|
function isValidStyleKey(key, staticConfig) {
|
|
7605
|
-
var
|
|
7606
|
-
return validStyleProps[key] || ((
|
|
7631
|
+
var _staticConfig_accept, validStyleProps = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles);
|
|
7632
|
+
return validStyleProps[key] || ((_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key]);
|
|
7607
7633
|
}
|
|
7608
7634
|
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) {
|
|
7609
7635
|
conf = conf || (0, import_config.getConfig)(), import_constants.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
@@ -7633,6 +7659,11 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
7633
7659
|
}), console.groupEnd());
|
|
7634
7660
|
for (var keyOg in props) {
|
|
7635
7661
|
var _parentStaticConfig_variants, keyInit = keyOg, valInit = props[keyOg];
|
|
7662
|
+
if (staticConfig.accept && (staticConfig.accept[keyInit] === "style" || staticConfig.accept[keyInit] === "textStyle") && typeof valInit == "object") {
|
|
7663
|
+
var styleObject = getSubStyle(styleState, keyInit, valInit, styleProps.noClassNames);
|
|
7664
|
+
viewProps[keyInit] = styleObject;
|
|
7665
|
+
continue;
|
|
7666
|
+
}
|
|
7636
7667
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd(), styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit !== "className" && !(keyInit in usedKeys)) {
|
|
7637
7668
|
if (keyInit in import_skipProps.skipProps && !styleProps.noSkip && !isHOC) {
|
|
7638
7669
|
if (keyInit === "group" && !1)
|
|
@@ -8005,33 +8036,21 @@ current`, _object_spread2({}, styleState.style)));
|
|
|
8005
8036
|
if (!isReactNative && viewProps.tabIndex == null)
|
|
8006
8037
|
var _viewProps_focusable, isFocusable, role;
|
|
8007
8038
|
}
|
|
8008
|
-
|
|
8039
|
+
var styleProp = props.style;
|
|
8040
|
+
if (styleProp)
|
|
8009
8041
|
if (isHOC)
|
|
8010
|
-
viewProps.style = normalizeStyle(
|
|
8011
|
-
else
|
|
8012
|
-
var
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
8021
|
-
(_styleState4 = styleState).style || (_styleState4.style = {}), Object.assign(styleState.style, normalizeStyle(style1));
|
|
8022
|
-
}
|
|
8023
|
-
}
|
|
8024
|
-
} catch (err) {
|
|
8025
|
-
_didIteratorError3 = !0, _iteratorError3 = err;
|
|
8026
|
-
} finally {
|
|
8027
|
-
try {
|
|
8028
|
-
!_iteratorNormalCompletion3 && _iterator3.return != null && _iterator3.return();
|
|
8029
|
-
} finally {
|
|
8030
|
-
if (_didIteratorError3)
|
|
8031
|
-
throw _iteratorError3;
|
|
8032
|
-
}
|
|
8042
|
+
viewProps.style = normalizeStyle(styleProp);
|
|
8043
|
+
else
|
|
8044
|
+
for (var isArray = Array.isArray(styleProp), len = isArray ? props.length : 1, i1 = 0; i1 < len; i1++) {
|
|
8045
|
+
var style1 = isArray ? styleProp[i1] : styleProp;
|
|
8046
|
+
if (style1)
|
|
8047
|
+
if (style1.$$css)
|
|
8048
|
+
Object.assign(styleState.classNames, style1);
|
|
8049
|
+
else {
|
|
8050
|
+
var _styleState4;
|
|
8051
|
+
(_styleState4 = styleState).style || (_styleState4.style = {}), Object.assign(styleState.style, normalizeStyle(style1));
|
|
8052
|
+
}
|
|
8033
8053
|
}
|
|
8034
|
-
}
|
|
8035
8054
|
var result = {
|
|
8036
8055
|
space,
|
|
8037
8056
|
hasMedia,
|
|
@@ -8059,9 +8078,9 @@ current`, _object_spread2({}, styleState.style)));
|
|
|
8059
8078
|
if (0) {
|
|
8060
8079
|
var _staticConfig_defaultProps, fontFamily, fontFamilyClassName, groupClassName, componentNameFinal, componentClassName, classList, finalClassName;
|
|
8061
8080
|
if (!styleProps.noMergeStyle && !(styleProps.isAnimated && !conf.animations.supportsCSSVars && isReactNative) && isReactNative) {
|
|
8062
|
-
var cnStyles,
|
|
8081
|
+
var cnStyles, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3;
|
|
8063
8082
|
try {
|
|
8064
|
-
for (var
|
|
8083
|
+
for (var _iterator3, _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = !0)
|
|
8065
8084
|
var name;
|
|
8066
8085
|
} catch (err) {
|
|
8067
8086
|
} finally {
|
|
@@ -8108,8 +8127,8 @@ current`, _object_spread2({}, styleState.style)));
|
|
|
8108
8127
|
} else {
|
|
8109
8128
|
var shouldNormalize = import_constants.isWeb && !disableNormalize && !styleProps.noNormalize, out = shouldNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
|
|
8110
8129
|
if (
|
|
8111
|
-
//
|
|
8112
|
-
staticConfig.
|
|
8130
|
+
// accept is for props not styles
|
|
8131
|
+
staticConfig.accept && key in staticConfig.accept
|
|
8113
8132
|
)
|
|
8114
8133
|
viewProps[key] = out;
|
|
8115
8134
|
else {
|
|
@@ -9263,7 +9282,7 @@ var require_createComponent_native = __commonJS({
|
|
|
9263
9282
|
defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
|
|
9264
9283
|
});
|
|
9265
9284
|
var component = /* @__PURE__ */ (0, import_react3.forwardRef)(function(propsIn, forwardedRef) {
|
|
9266
|
-
var _animationsConfig_usePresence, _props_accessibilityState, _themeState_state,
|
|
9285
|
+
var _animationsConfig_usePresence, _props_accessibilityState, _themeState_state, _hooks_usePropsTransform, _hooks_useEvents, _config_animations, internalID = process.env.NODE_ENV === "development" ? (0, import_react3.useId)() : "";
|
|
9267
9286
|
if (process.env.NODE_ENV === "development" && startVisualizer && (startVisualizer(), startVisualizer = void 0), !hasSetupBaseViews) {
|
|
9268
9287
|
var _hooks_getBaseViews;
|
|
9269
9288
|
hasSetupBaseViews = !0;
|
|
@@ -9311,7 +9330,9 @@ var require_createComponent_native = __commonJS({
|
|
|
9311
9330
|
]), !1)
|
|
9312
9331
|
var timer;
|
|
9313
9332
|
process.env.NODE_ENV === "development" && time && time(_templateObject()), process.env.NODE_ENV === "development" && time && time(_templateObject1());
|
|
9314
|
-
var stateRef = (0, import_react3.useRef)({
|
|
9333
|
+
var stateRef = (0, import_react3.useRef)({
|
|
9334
|
+
handleFocusVisible: !0
|
|
9335
|
+
});
|
|
9315
9336
|
process.env.NODE_ENV === "development" && time && time(_templateObject2());
|
|
9316
9337
|
var animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations, hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationsConfig == null ? void 0 : animationsConfig.supportsCSSVars, curState = stateRef.current, willBeAnimatedClient = function() {
|
|
9317
9338
|
var next = !!(hasAnimationProp && !isHOC && useAnimations);
|
|
@@ -9320,7 +9341,14 @@ var require_createComponent_native = __commonJS({
|
|
|
9320
9341
|
willBeAnimated && !curState.hasAnimated && (curState.hasAnimated = !0);
|
|
9321
9342
|
var isHydrated = config != null && config.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)(), presence = willBeAnimated && props.animatePresence !== !1 && (animationsConfig == null || (_animationsConfig_usePresence = animationsConfig.usePresence) === null || _animationsConfig_usePresence === void 0 ? void 0 : _animationsConfig_usePresence.call(animationsConfig)) || null, presenceState = presence == null ? void 0 : presence[2], isExiting = (presenceState == null ? void 0 : presenceState.isPresent) === !1, isEntering = (presenceState == null ? void 0 : presenceState.isPresent) === !0 && presenceState.initial !== !1, hasEnterStyle = !!props.enterStyle, hasRNAnimation = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = staticConfig.isReactNative, isAnimated = willBeAnimated;
|
|
9322
9343
|
!isReactNative && hasRNAnimation && !isHOC && !isHydrated && (isAnimated = !1, curState.willHydrate = !0), process.env.NODE_ENV === "development" && time && time(_templateObject3());
|
|
9323
|
-
var hasEnterState = hasEnterStyle || isEntering, needsToMount = !isHydrated || !curState.host, initialState = hasEnterState ? needsToMount ? import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateMounted,
|
|
9344
|
+
var hasEnterState = hasEnterStyle || isEntering, needsToMount = !isHydrated || !curState.host, initialState = hasEnterState ? needsToMount ? import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateMounted, disabled = props.disabled || ((_props_accessibilityState = props.accessibilityState) === null || _props_accessibilityState === void 0 ? void 0 : _props_accessibilityState.disabled) || props["aria-disabled"] || // @ts-expect-error (comes from core)
|
|
9345
|
+
props.accessibilityDisabled || !1;
|
|
9346
|
+
disabled != null && (initialState.disabled = disabled);
|
|
9347
|
+
var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? _object_spread_props(_object_spread2({}, states[0]), _define_property2({}, props.forceStyle, !0)) : states[0], setState = states[1];
|
|
9348
|
+
disabled !== state.disabled && setState(_object_spread_props(_object_spread2({}, state), {
|
|
9349
|
+
disabled
|
|
9350
|
+
}));
|
|
9351
|
+
var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, debugProp);
|
|
9324
9352
|
if (isHydrated && state.unmounted === "should-enter" && (state.unmounted = !0), presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
9325
9353
|
process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn("has presenceState ".concat(JSON.stringify(presenceState)));
|
|
9326
9354
|
var enterVariant = presenceState.enterVariant, exitVariant = presenceState.exitVariant, enterExitVariant = presenceState.enterExitVariant, custom = presenceState.custom;
|
|
@@ -9360,7 +9388,7 @@ var require_createComponent_native = __commonJS({
|
|
|
9360
9388
|
};
|
|
9361
9389
|
}
|
|
9362
9390
|
process.env.NODE_ENV === "development" && time && time(_templateObject4());
|
|
9363
|
-
var hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText)
|
|
9391
|
+
var hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText);
|
|
9364
9392
|
process.env.NODE_ENV === "development" && time && time(_templateObject5());
|
|
9365
9393
|
var isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
|
|
9366
9394
|
animationsConfig && isAnimated && (elementType = animationsConfig[isText ? "Text" : "View"] || elementType);
|
|
@@ -9479,10 +9507,7 @@ var require_createComponent_native = __commonJS({
|
|
|
9479
9507
|
}
|
|
9480
9508
|
process.env.NODE_ENV === "development" && props.untilMeasured && !props.group && console.warn(`You set the untilMeasured prop without setting group. This doesn't work, be sure to set untilMeasured on the parent that sets group, not the children that use the $group- prop.
|
|
9481
9509
|
|
|
9482
|
-
If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`), process.env.NODE_ENV === "development" && time && time(_templateObject12())
|
|
9483
|
-
var disabled = ((_props_accessibilityState1 = props.accessibilityState) === null || _props_accessibilityState1 === void 0 ? void 0 : _props_accessibilityState1.disabled) || // @ts-expect-error (comes from core)
|
|
9484
|
-
props.accessibilityDisabled;
|
|
9485
|
-
groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
|
|
9510
|
+
If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`), process.env.NODE_ENV === "development" && time && time(_templateObject12()), groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
|
|
9486
9511
|
stateRef.current.group.emit(groupName, {
|
|
9487
9512
|
layout: e.nativeEvent.layout
|
|
9488
9513
|
}), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
|
|
@@ -9503,46 +9528,49 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
9503
9528
|
});
|
|
9504
9529
|
var unPress = curState.unPress, shouldEnter = state.unmounted;
|
|
9505
9530
|
(0, import_react3.useEffect)(function() {
|
|
9506
|
-
if (
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
disposeGroupsListener = componentContext.groups.subscribe(function(name2, param) {
|
|
9519
|
-
var layout = param.layout, pseudo = param.pseudo, persist = function() {
|
|
9520
|
-
var group = _object_spread_props(_object_spread2({}, state.group), _define_property2({}, name2, current));
|
|
9521
|
-
setStateShallow({
|
|
9522
|
-
group
|
|
9523
|
-
});
|
|
9531
|
+
if (!disabled) {
|
|
9532
|
+
if (shouldEnter) {
|
|
9533
|
+
setStateShallow({
|
|
9534
|
+
unmounted: !1
|
|
9535
|
+
});
|
|
9536
|
+
return;
|
|
9537
|
+
}
|
|
9538
|
+
var disposeGroupsListener;
|
|
9539
|
+
if (pseudoGroups || mediaGroups) {
|
|
9540
|
+
var current = {
|
|
9541
|
+
pseudo: {},
|
|
9542
|
+
media: {}
|
|
9524
9543
|
};
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9544
|
+
disposeGroupsListener = componentContext.groups.subscribe(function(name2, param) {
|
|
9545
|
+
var layout = param.layout, pseudo = param.pseudo, persist = function() {
|
|
9546
|
+
var group = _object_spread_props(_object_spread2({}, state.group), _define_property2({}, name2, current));
|
|
9547
|
+
setStateShallow({
|
|
9548
|
+
group
|
|
9549
|
+
});
|
|
9550
|
+
};
|
|
9551
|
+
if (pseudo && pseudoGroups != null && pseudoGroups.has(name2))
|
|
9552
|
+
Object.assign(current.pseudo, pseudo), persist();
|
|
9553
|
+
else if (layout && mediaGroups) {
|
|
9554
|
+
var mediaState22 = getMediaState(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState22);
|
|
9555
|
+
next !== current.media && (Object.assign(current.media, next), persist());
|
|
9556
|
+
}
|
|
9557
|
+
});
|
|
9558
|
+
}
|
|
9559
|
+
return function() {
|
|
9560
|
+
disposeGroupsListener == null || disposeGroupsListener(), mouseUps.delete(unPress);
|
|
9561
|
+
};
|
|
9532
9562
|
}
|
|
9533
|
-
return function() {
|
|
9534
|
-
disposeGroupsListener == null || disposeGroupsListener(), mouseUps.delete(unPress);
|
|
9535
|
-
};
|
|
9536
9563
|
}, [
|
|
9564
|
+
disabled,
|
|
9537
9565
|
shouldEnter,
|
|
9538
9566
|
pseudoGroups ? Object.keys(_to_consumable_array(pseudoGroups)).join("") : 0,
|
|
9539
9567
|
mediaGroups ? Object.keys(_to_consumable_array(mediaGroups)).join("") : 0
|
|
9540
9568
|
]);
|
|
9541
|
-
var runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut), attachHover = import_constants.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(groupName || runtimeHoverStyle);
|
|
9569
|
+
var runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos != null && pseudos.focusVisibleStyle), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut), attachHover = import_constants.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(groupName || runtimeHoverStyle);
|
|
9542
9570
|
process.env.NODE_ENV === "development" && time && time(_templateObject14());
|
|
9543
|
-
var events = shouldAttach
|
|
9571
|
+
var events = shouldAttach ? _object_spread2(_object_spread_props(_object_spread2({
|
|
9544
9572
|
onPressOut: attachPress ? function(e) {
|
|
9545
|
-
unPress(), onPressOut == null || onPressOut(e), onMouseUp == null || onMouseUp(e);
|
|
9573
|
+
stateRef.current.handleFocusVisible = !0, unPress(), onPressOut == null || onPressOut(e), onMouseUp == null || onMouseUp(e);
|
|
9546
9574
|
} : void 0
|
|
9547
9575
|
}, (attachHover || attachPress) && {
|
|
9548
9576
|
onMouseEnter: function(e) {
|
|
@@ -9555,7 +9583,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
9555
9583
|
}
|
|
9556
9584
|
}), {
|
|
9557
9585
|
onPressIn: attachPress ? function(e) {
|
|
9558
|
-
runtimePressStyle && setStateShallow({
|
|
9586
|
+
stateRef.current.handleFocusVisible = !1, runtimePressStyle && setStateShallow({
|
|
9559
9587
|
press: !0,
|
|
9560
9588
|
pressIn: !0
|
|
9561
9589
|
}), onPressIn == null || onPressIn(e), onMouseDown == null || onMouseDown(e), import_constants.isWeb && mouseUps.add(unPress);
|
|
@@ -9569,13 +9597,20 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
9569
9597
|
}
|
|
9570
9598
|
}, attachFocus && {
|
|
9571
9599
|
onFocus: function(e) {
|
|
9572
|
-
|
|
9573
|
-
|
|
9600
|
+
pseudos != null && pseudos.focusVisibleStyle ? setTimeout(function() {
|
|
9601
|
+
setStateShallow({
|
|
9602
|
+
focus: !0,
|
|
9603
|
+
focusVisible: !!stateRef.current.handleFocusVisible
|
|
9604
|
+
});
|
|
9605
|
+
}, 0) : setStateShallow({
|
|
9606
|
+
focus: !0,
|
|
9607
|
+
focusVisible: !1
|
|
9574
9608
|
}), onFocus == null || onFocus(e);
|
|
9575
9609
|
},
|
|
9576
9610
|
onBlur: function(e) {
|
|
9577
|
-
setStateShallow({
|
|
9578
|
-
focus: !1
|
|
9611
|
+
stateRef.current.handleFocusVisible = !0, setStateShallow({
|
|
9612
|
+
focus: !1,
|
|
9613
|
+
focusVisible: !1
|
|
9579
9614
|
}), onBlur == null || onBlur(e);
|
|
9580
9615
|
}
|
|
9581
9616
|
}) : null;
|
|
@@ -9583,7 +9618,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
9583
9618
|
var _viewProps_focusable;
|
|
9584
9619
|
Object.assign(events, {
|
|
9585
9620
|
cancelable: !viewProps.rejectResponderTermination,
|
|
9586
|
-
disabled
|
|
9621
|
+
disabled,
|
|
9587
9622
|
hitSlop: viewProps.hitSlop,
|
|
9588
9623
|
delayLongPress: viewProps.delayLongPress,
|
|
9589
9624
|
delayPressIn: viewProps.delayPressIn,
|