tamagui 1.92.1 → 1.93.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.js +372 -159
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +362 -149
- package/dist/test.native.js.map +2 -2
- package/package.json +58 -55
package/dist/native.js
CHANGED
|
@@ -2428,12 +2428,16 @@ var require_createVariable_native = __commonJS({
|
|
|
2428
2428
|
writable: !0
|
|
2429
2429
|
}) : obj[key] = value, obj;
|
|
2430
2430
|
}
|
|
2431
|
-
var IS_VAR = "isVar"
|
|
2431
|
+
var IS_VAR = "isVar";
|
|
2432
|
+
function constructCSSVariableName(name) {
|
|
2433
|
+
return "var(--".concat(process.env.TAMAGUI_CSS_VARIABLE_PREFIX || "").concat(name, ")");
|
|
2434
|
+
}
|
|
2435
|
+
var createVariable2 = function(props) {
|
|
2432
2436
|
var skipHash = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
2433
2437
|
if (!skipHash && isVariable2(props))
|
|
2434
2438
|
return props;
|
|
2435
2439
|
var key = props.key, name = props.name, val = props.val, _obj;
|
|
2436
|
-
return _obj = {}, _define_property9(_obj, IS_VAR, !0), _define_property9(_obj, "key", key), _define_property9(_obj, "name", skipHash ? "" : (0, import_helpers.simpleHash)(name, 40)), _define_property9(_obj, "val", val), _define_property9(_obj, "variable", import_constants4.isWeb ? skipHash ?
|
|
2440
|
+
return _obj = {}, _define_property9(_obj, IS_VAR, !0), _define_property9(_obj, "key", key), _define_property9(_obj, "name", skipHash ? "" : (0, import_helpers.simpleHash)(name, 40)), _define_property9(_obj, "val", val), _define_property9(_obj, "variable", import_constants4.isWeb ? skipHash ? constructCSSVariableName(name) : createCSSVariable(name) : ""), _obj;
|
|
2437
2441
|
};
|
|
2438
2442
|
function variableToString3(vrble) {
|
|
2439
2443
|
var getValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
@@ -2467,7 +2471,7 @@ var require_createVariable_native = __commonJS({
|
|
|
2467
2471
|
if (process.env.NODE_ENV === "development" && (!nameProp || typeof nameProp != "string"))
|
|
2468
2472
|
throw new Error("createCSSVariable expected string, got: ".concat(nameProp));
|
|
2469
2473
|
var name = (0, import_helpers.simpleHash)(nameProp, 60);
|
|
2470
|
-
return includeVar ?
|
|
2474
|
+
return includeVar ? constructCSSVariableName(name) : name;
|
|
2471
2475
|
};
|
|
2472
2476
|
}
|
|
2473
2477
|
});
|
|
@@ -2753,7 +2757,9 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2753
2757
|
for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
2754
2758
|
var rule = _step.value, sepI = rule.indexOf(":");
|
|
2755
2759
|
if (sepI !== -1) {
|
|
2756
|
-
var varIndex = rule.indexOf("--"), key1 = rule.slice(varIndex === -1 ? 0 : varIndex + 2, sepI)
|
|
2760
|
+
var varIndex = rule.indexOf("--"), key1 = rule.slice(varIndex === -1 ? 0 : varIndex + 2, sepI);
|
|
2761
|
+
process.env.TAMAGUI_CSS_VARIABLE_PREFIX && (key1 = key1.replace(process.env.TAMAGUI_CSS_VARIABLE_PREFIX, ""));
|
|
2762
|
+
var val = rule.slice(sepI + 2), value = void 0;
|
|
2757
2763
|
if (val.startsWith("var(")) {
|
|
2758
2764
|
var varName = val.slice(6, -1), tokenVal = colorVarToVal[varName];
|
|
2759
2765
|
tokenVal ? value = tokenVal : (rootComputedStyle || (rootComputedStyle = getComputedStyle(document.body)), value = rootComputedStyle.getPropertyValue("--" + varName));
|
|
@@ -6691,11 +6697,6 @@ var require_expandStyle_native = __commonJS({
|
|
|
6691
6697
|
});
|
|
6692
6698
|
};
|
|
6693
6699
|
function expandStyle(key, value) {
|
|
6694
|
-
if (0)
|
|
6695
|
-
switch (key) {
|
|
6696
|
-
case "textAlignVertical":
|
|
6697
|
-
case "writingDirection":
|
|
6698
|
-
}
|
|
6699
6700
|
if (import_constants4.isAndroid && key === "elevationAndroid")
|
|
6700
6701
|
return [
|
|
6701
6702
|
[
|
|
@@ -7809,22 +7810,8 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
7809
7810
|
viewProps["data-".concat(hyphenate(keyInit1))] = valInit[keyInit1];
|
|
7810
7811
|
continue;
|
|
7811
7812
|
}
|
|
7812
|
-
if (0)
|
|
7813
|
+
if (0)
|
|
7813
7814
|
var didUseKeyInit;
|
|
7814
|
-
if (!isReactNative)
|
|
7815
|
-
switch (keyInit) {
|
|
7816
|
-
case "accessibilityRole":
|
|
7817
|
-
case "accessibilityLabelledBy":
|
|
7818
|
-
case "accessibilityFlowTo":
|
|
7819
|
-
case "accessibilityControls":
|
|
7820
|
-
case "accessibilityDescribedBy":
|
|
7821
|
-
case "accessibilityKeyShortcuts":
|
|
7822
|
-
case "accessibilityLiveRegion":
|
|
7823
|
-
case "accessibilityReadOnly":
|
|
7824
|
-
case "accessibilityRequired":
|
|
7825
|
-
default:
|
|
7826
|
-
}
|
|
7827
|
-
}
|
|
7828
7815
|
var isShorthand = keyInit in shorthands, isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isShorthand || isValidStyleKeyInit || isVariant, isPseudo = keyInit in import_helpers.validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit), isMediaOrPseudo1 = !!(isMedia || isPseudo), isStyleProp = isValidStyleKeyInit || isMediaOrPseudo1 || isVariant && !styleProps.noExpand || isShorthand;
|
|
7829
7816
|
if (!(isStyleProp && (props.asChild === "except-style" || props.asChild === "except-style-web"))) {
|
|
7830
7817
|
var shouldPassProp = !isStyleProp || // is in parent variants
|
|
@@ -9033,11 +9020,20 @@ var require_createComponent_native = __commonJS({
|
|
|
9033
9020
|
createComponent: function() {
|
|
9034
9021
|
return createComponent2;
|
|
9035
9022
|
},
|
|
9023
|
+
isDisabled: function() {
|
|
9024
|
+
return isDisabled;
|
|
9025
|
+
},
|
|
9036
9026
|
mouseUps: function() {
|
|
9037
9027
|
return mouseUps;
|
|
9038
9028
|
},
|
|
9039
9029
|
spacedChildren: function() {
|
|
9040
9030
|
return spacedChildren2;
|
|
9031
|
+
},
|
|
9032
|
+
subscribeToContextGroup: function() {
|
|
9033
|
+
return subscribeToContextGroup;
|
|
9034
|
+
},
|
|
9035
|
+
useComponentState: function() {
|
|
9036
|
+
return useComponentState;
|
|
9041
9037
|
}
|
|
9042
9038
|
});
|
|
9043
9039
|
module2.exports = __toCommonJS2(createComponent_exports);
|
|
@@ -9165,7 +9161,7 @@ var require_createComponent_native = __commonJS({
|
|
|
9165
9161
|
}
|
|
9166
9162
|
function _templateObject() {
|
|
9167
9163
|
var data = _tagged_template_literal([
|
|
9168
|
-
"
|
|
9164
|
+
"pre-use-state"
|
|
9169
9165
|
]);
|
|
9170
9166
|
return _templateObject = function() {
|
|
9171
9167
|
return data;
|
|
@@ -9173,7 +9169,7 @@ var require_createComponent_native = __commonJS({
|
|
|
9173
9169
|
}
|
|
9174
9170
|
function _templateObject1() {
|
|
9175
9171
|
var data = _tagged_template_literal([
|
|
9176
|
-
"
|
|
9172
|
+
"start (ignore)"
|
|
9177
9173
|
]);
|
|
9178
9174
|
return _templateObject1 = function() {
|
|
9179
9175
|
return data;
|
|
@@ -9181,7 +9177,7 @@ var require_createComponent_native = __commonJS({
|
|
|
9181
9177
|
}
|
|
9182
9178
|
function _templateObject2() {
|
|
9183
9179
|
var data = _tagged_template_literal([
|
|
9184
|
-
"
|
|
9180
|
+
"did-finish-ssr"
|
|
9185
9181
|
]);
|
|
9186
9182
|
return _templateObject2 = function() {
|
|
9187
9183
|
return data;
|
|
@@ -9189,7 +9185,7 @@ var require_createComponent_native = __commonJS({
|
|
|
9189
9185
|
}
|
|
9190
9186
|
function _templateObject3() {
|
|
9191
9187
|
var data = _tagged_template_literal([
|
|
9192
|
-
"
|
|
9188
|
+
"stateref"
|
|
9193
9189
|
]);
|
|
9194
9190
|
return _templateObject3 = function() {
|
|
9195
9191
|
return data;
|
|
@@ -9369,7 +9365,81 @@ var require_createComponent_native = __commonJS({
|
|
|
9369
9365
|
});
|
|
9370
9366
|
}
|
|
9371
9367
|
}));
|
|
9372
|
-
var cancelTouches,
|
|
9368
|
+
var cancelTouches, useComponentState = function(props, param, staticConfig, config) {
|
|
9369
|
+
var animationDriver = param.animationDriver, groups = param.groups, _animationDriver_usePresence, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react4.useRef)({}), hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
|
|
9370
|
+
var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
|
|
9371
|
+
return !!(next || curStateRef.hasAnimated);
|
|
9372
|
+
}(), willBeAnimated = !import_constants4.isServer && willBeAnimatedClient;
|
|
9373
|
+
willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
|
|
9374
|
+
var isHydrated = config != null && config.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)(), presence = willBeAnimated && props.animatePresence !== !1 && (animationDriver == null || (_animationDriver_usePresence = animationDriver.usePresence) === null || _animationDriver_usePresence === void 0 ? void 0 : _animationDriver_usePresence.call(animationDriver)) || 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 && (animationDriver == null ? void 0 : animationDriver.isReactNative), isReactNative = staticConfig.isReactNative, isAnimated = willBeAnimated;
|
|
9375
|
+
!isReactNative && hasRNAnimation && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), process.env.NODE_ENV === "development" && time && time(_templateObject());
|
|
9376
|
+
var hasEnterState = hasEnterStyle || isEntering, needsToMount = !isHydrated || !curStateRef.host, initialState = hasEnterState ? needsToMount ? import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateMounted, disabled = isDisabled(props);
|
|
9377
|
+
disabled != null && (initialState.disabled = disabled);
|
|
9378
|
+
var states = (0, import_react4.useState)(initialState), state = props.forceStyle ? _object_spread_props8(_object_spread9({}, states[0]), _define_property9({}, props.forceStyle, !0)) : states[0], setState = states[1];
|
|
9379
|
+
disabled !== state.disabled && setState(_object_spread_props8(_object_spread9({}, state, import_defaultComponentState.defaultComponentState), {
|
|
9380
|
+
// removes any stale press state etc
|
|
9381
|
+
disabled
|
|
9382
|
+
}));
|
|
9383
|
+
var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, props.debug);
|
|
9384
|
+
if (isHydrated && state.unmounted === "should-enter" && (state.unmounted = !0), presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
9385
|
+
process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn("has presenceState ".concat(JSON.stringify(presenceState)));
|
|
9386
|
+
var enterVariant = presenceState.enterVariant, exitVariant = presenceState.exitVariant, enterExitVariant = presenceState.enterExitVariant, custom = presenceState.custom;
|
|
9387
|
+
(0, import_isObj.isObj)(custom) && Object.assign(props, custom);
|
|
9388
|
+
var exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
|
|
9389
|
+
state.unmounted && env && staticConfig.variants[env] ? (process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn('Animating presence ENTER "'.concat(env, '"')), props[env] = !0) : isExiting && exv && (process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn('Animating presence EXIT "'.concat(exv, '"')), props[exv] = exitVariant !== enterExitVariant);
|
|
9390
|
+
}
|
|
9391
|
+
var shouldAvoidClasses = !!(!import_constants4.isWeb || isAnimated && !supportsCSSVars || !staticConfig.acceptsClassName || // on server for SSR and animation compat added the && isHydrated but perhaps we want
|
|
9392
|
+
// disableClassName="until-hydrated" to be more straightforward
|
|
9393
|
+
// see issue if not, Button sets disableClassName to true <Button animation="" /> with
|
|
9394
|
+
// the react-native driver errors because it tries to animate var(--color) to rbga(..)
|
|
9395
|
+
props.disableClassName && isHydrated), groupName = props.group;
|
|
9396
|
+
if (groupName && !curStateRef.group) {
|
|
9397
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
9398
|
+
curStateRef.group = {
|
|
9399
|
+
listeners,
|
|
9400
|
+
emit: function(name, state2) {
|
|
9401
|
+
listeners.forEach(function(l) {
|
|
9402
|
+
return l(name, state2);
|
|
9403
|
+
});
|
|
9404
|
+
},
|
|
9405
|
+
subscribe: function(cb) {
|
|
9406
|
+
return listeners.add(cb), function() {
|
|
9407
|
+
listeners.delete(cb);
|
|
9408
|
+
};
|
|
9409
|
+
}
|
|
9410
|
+
};
|
|
9411
|
+
}
|
|
9412
|
+
if (groupName) {
|
|
9413
|
+
var groupContextState = groups.state, og = setStateShallow;
|
|
9414
|
+
setStateShallow = function(state2) {
|
|
9415
|
+
og(state2), curStateRef.group.emit(groupName, {
|
|
9416
|
+
pseudo: state2
|
|
9417
|
+
});
|
|
9418
|
+
var next = _object_spread9({}, groupContextState[groupName], state2);
|
|
9419
|
+
groupContextState[groupName] = next;
|
|
9420
|
+
};
|
|
9421
|
+
}
|
|
9422
|
+
return {
|
|
9423
|
+
curStateRef,
|
|
9424
|
+
disabled,
|
|
9425
|
+
groupName,
|
|
9426
|
+
hasAnimationProp,
|
|
9427
|
+
hasEnterStyle,
|
|
9428
|
+
isAnimated,
|
|
9429
|
+
isExiting,
|
|
9430
|
+
isHydrated,
|
|
9431
|
+
presence,
|
|
9432
|
+
presenceState,
|
|
9433
|
+
setState,
|
|
9434
|
+
setStateShallow,
|
|
9435
|
+
shouldAvoidClasses,
|
|
9436
|
+
state,
|
|
9437
|
+
stateRef,
|
|
9438
|
+
supportsCSSVars,
|
|
9439
|
+
willBeAnimated,
|
|
9440
|
+
willBeAnimatedClient
|
|
9441
|
+
};
|
|
9442
|
+
}, BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
|
|
9373
9443
|
value: !1
|
|
9374
9444
|
};
|
|
9375
9445
|
import_constants4.isWeb && globalThis.document && (document.addEventListener("keydown", function() {
|
|
@@ -9387,14 +9457,14 @@ var require_createComponent_native = __commonJS({
|
|
|
9387
9457
|
defaultForComponent && (defaultProps = _object_spread9({}, defaultForComponent, defaultProps));
|
|
9388
9458
|
}
|
|
9389
9459
|
});
|
|
9390
|
-
var Component = staticConfig.Component, isText = staticConfig.isText,
|
|
9460
|
+
var Component = staticConfig.Component, isText = staticConfig.isText, isZStack = staticConfig.isZStack, isHOC = staticConfig.isHOC, _staticConfig_validStyles = staticConfig.validStyles, _$validStyles = _staticConfig_validStyles === void 0 ? {} : _staticConfig_validStyles, _staticConfig_variants = staticConfig.variants, variants = _staticConfig_variants === void 0 ? {} : _staticConfig_variants;
|
|
9391
9461
|
process.env.NODE_ENV === "development" && !((_staticConfig_defaultProps = staticConfig.defaultProps) === null || _staticConfig_defaultProps === void 0) && _staticConfig_defaultProps.debug && process.env.IS_STATIC !== "is_static" && (0, import_log.log)("\u{1F41B} [".concat(componentName || "Component", "]"), {
|
|
9392
9462
|
staticConfig,
|
|
9393
9463
|
defaultProps,
|
|
9394
9464
|
defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
|
|
9395
9465
|
});
|
|
9396
9466
|
var component = /* @__PURE__ */ (0, import_react4.forwardRef)(function(propsIn, forwardedRef) {
|
|
9397
|
-
var
|
|
9467
|
+
var _themeState_state, _hooks_usePropsTransform, _hooks_useEvents, _config_animations, internalID = process.env.NODE_ENV === "development" ? (0, import_react4.useId)() : "";
|
|
9398
9468
|
if (process.env.NODE_ENV === "development" && startVisualizer && (startVisualizer(), startVisualizer = void 0), !hasSetupBaseViews) {
|
|
9399
9469
|
var _hooks_getBaseViews;
|
|
9400
9470
|
hasSetupBaseViews = !0;
|
|
@@ -9405,7 +9475,7 @@ var require_createComponent_native = __commonJS({
|
|
|
9405
9475
|
var _propsIn_datatestrenders, _current, _;
|
|
9406
9476
|
(_ = (_propsIn_datatestrenders = propsIn["data-test-renders"])[_current = "current"]) !== null && _ !== void 0 || (_propsIn_datatestrenders[_current] = 0), propsIn["data-test-renders"].current += 1;
|
|
9407
9477
|
}
|
|
9408
|
-
var componentContext = (0, import_react4.useContext)(import_ComponentContext.ComponentContext), styledContextProps, overriddenContextProps, contextValue, context = staticConfig.context;
|
|
9478
|
+
var componentContext = (0, import_react4.useContext)(import_ComponentContext.ComponentContext), styledContextProps, overriddenContextProps, contextValue, context = staticConfig.context, isReactNative = staticConfig.isReactNative;
|
|
9409
9479
|
if (context) {
|
|
9410
9480
|
contextValue = (0, import_react4.useContext)(context);
|
|
9411
9481
|
var inverseShorthands = (0, import_config.getConfig)().inverseShorthands;
|
|
@@ -9425,7 +9495,7 @@ var require_createComponent_native = __commonJS({
|
|
|
9425
9495
|
var debugProp = props.debug, componentName2 = props.componentName || staticConfig.componentName;
|
|
9426
9496
|
if (process.env.NODE_ENV === "development" && import_constants4.isClient && (0, import_react4.useEffect)(function() {
|
|
9427
9497
|
var overlay = null, debugVisualizerHandler = function() {
|
|
9428
|
-
var show = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, node =
|
|
9498
|
+
var show = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, node = curStateRef.host;
|
|
9429
9499
|
if (node)
|
|
9430
9500
|
if (show) {
|
|
9431
9501
|
overlay = document.createElement("span"), overlay.style.inset = "0px", overlay.style.zIndex = "1000000", overlay.style.position = "absolute", overlay.style.borderColor = "red", overlay.style.borderWidth = "1px", overlay.style.borderStyle = "dotted";
|
|
@@ -9441,79 +9511,24 @@ var require_createComponent_native = __commonJS({
|
|
|
9441
9511
|
componentName2
|
|
9442
9512
|
]), !1)
|
|
9443
9513
|
var timer;
|
|
9444
|
-
process.env.NODE_ENV === "development" && time && time(
|
|
9445
|
-
var
|
|
9446
|
-
process.env.NODE_ENV === "development" && time && time(_templateObject2());
|
|
9447
|
-
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() {
|
|
9448
|
-
var next = !!(hasAnimationProp && !isHOC && useAnimations);
|
|
9449
|
-
return !!(next || curState.hasAnimated);
|
|
9450
|
-
}(), willBeAnimated = !import_constants4.isServer && willBeAnimatedClient;
|
|
9451
|
-
willBeAnimated && !curState.hasAnimated && (curState.hasAnimated = !0);
|
|
9452
|
-
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;
|
|
9453
|
-
!isReactNative && hasRNAnimation && !isHOC && !isHydrated && (isAnimated = !1, curState.willHydrate = !0), process.env.NODE_ENV === "development" && time && time(_templateObject3());
|
|
9454
|
-
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)
|
|
9455
|
-
props.accessibilityDisabled || !1;
|
|
9456
|
-
disabled != null && (initialState.disabled = disabled);
|
|
9457
|
-
var states = (0, import_react4.useState)(initialState), state = props.forceStyle ? _object_spread_props8(_object_spread9({}, states[0]), _define_property9({}, props.forceStyle, !0)) : states[0], setState = states[1];
|
|
9458
|
-
disabled !== state.disabled && setState(_object_spread_props8(_object_spread9({}, state, import_defaultComponentState.defaultComponentState), {
|
|
9459
|
-
// removes any stale press state etc
|
|
9460
|
-
disabled
|
|
9461
|
-
}));
|
|
9462
|
-
var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, debugProp);
|
|
9463
|
-
if (isHydrated && state.unmounted === "should-enter" && (state.unmounted = !0), presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
9464
|
-
process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn("has presenceState ".concat(JSON.stringify(presenceState)));
|
|
9465
|
-
var enterVariant = presenceState.enterVariant, exitVariant = presenceState.exitVariant, enterExitVariant = presenceState.enterExitVariant, custom = presenceState.custom;
|
|
9466
|
-
(0, import_isObj.isObj)(custom) && Object.assign(props, custom);
|
|
9467
|
-
var exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
|
|
9468
|
-
state.unmounted && env && staticConfig.variants[env] ? (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn('Animating presence ENTER "'.concat(env, '"')), props[env] = !0) : isExiting && exv && (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn('Animating presence EXIT "'.concat(exv, '"')), props[exv] = exitVariant !== enterExitVariant);
|
|
9469
|
-
}
|
|
9470
|
-
var shouldAvoidClasses = !!(!import_constants4.isWeb || isAnimated && !supportsCSSVars || !staticConfig.acceptsClassName || // on server for SSR and animation compat added the && isHydrated but perhaps we want
|
|
9471
|
-
// disableClassName="until-hydrated" to be more straightforward
|
|
9472
|
-
// see issue if not, Button sets disableClassName to true <Button animation="" /> with
|
|
9473
|
-
// the react-native driver errors because it tries to animate var(--color) to rbga(..)
|
|
9474
|
-
propsIn.disableClassName && isHydrated), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group;
|
|
9475
|
-
if (groupName && !curState.group) {
|
|
9476
|
-
var listeners = /* @__PURE__ */ new Set();
|
|
9477
|
-
curState.group = {
|
|
9478
|
-
listeners,
|
|
9479
|
-
emit: function(name2, state2) {
|
|
9480
|
-
listeners.forEach(function(l) {
|
|
9481
|
-
return l(name2, state2);
|
|
9482
|
-
});
|
|
9483
|
-
},
|
|
9484
|
-
subscribe: function(cb) {
|
|
9485
|
-
return listeners.add(cb), function() {
|
|
9486
|
-
listeners.delete(cb);
|
|
9487
|
-
};
|
|
9488
|
-
}
|
|
9489
|
-
};
|
|
9490
|
-
}
|
|
9491
|
-
if (groupName) {
|
|
9492
|
-
var groupContextState = componentContext.groups.state, og = setStateShallow;
|
|
9493
|
-
setStateShallow = function(state2) {
|
|
9494
|
-
og(state2), curState.group.emit(groupName, {
|
|
9495
|
-
pseudo: state2
|
|
9496
|
-
});
|
|
9497
|
-
var next = _object_spread9({}, groupContextState[groupName], state2);
|
|
9498
|
-
groupContextState[groupName] = next;
|
|
9499
|
-
};
|
|
9500
|
-
}
|
|
9514
|
+
process.env.NODE_ENV === "development" && time && time(_templateObject1()), process.env.NODE_ENV === "development" && time && time(_templateObject2()), process.env.NODE_ENV === "development" && time && time(_templateObject3());
|
|
9515
|
+
var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, _useComponentState = useComponentState(props, componentContext, staticConfig, config), curStateRef = _useComponentState.curStateRef, disabled = _useComponentState.disabled, groupName = _useComponentState.groupName, hasAnimationProp = _useComponentState.hasAnimationProp, hasEnterStyle = _useComponentState.hasEnterStyle, isAnimated = _useComponentState.isAnimated, isExiting = _useComponentState.isExiting, isHydrated = _useComponentState.isHydrated, presence = _useComponentState.presence, presenceState = _useComponentState.presenceState, setState = _useComponentState.setState, setStateShallow = _useComponentState.setStateShallow, shouldAvoidClasses = _useComponentState.shouldAvoidClasses, state = _useComponentState.state, stateRef = _useComponentState.stateRef, supportsCSSVars = _useComponentState.supportsCSSVars, willBeAnimated = _useComponentState.willBeAnimated, willBeAnimatedClient = _useComponentState.willBeAnimatedClient, shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo;
|
|
9501
9516
|
process.env.NODE_ENV === "development" && time && time(_templateObject4());
|
|
9502
9517
|
var hasTextAncestor = !!(import_constants4.isWeb && isText && componentContext.inText);
|
|
9503
9518
|
process.env.NODE_ENV === "development" && time && time(_templateObject5());
|
|
9504
9519
|
var isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants4.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
|
|
9505
|
-
|
|
9520
|
+
animationDriver && isAnimated && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
|
|
9506
9521
|
var disableThemeProp = !1, disableTheme = disableThemeProp || isHOC;
|
|
9507
|
-
process.env.NODE_ENV === "development" && time && time(_templateObject6()), props.themeShallow && (
|
|
9522
|
+
process.env.NODE_ENV === "development" && time && time(_templateObject6()), props.themeShallow && (curStateRef.themeShallow = !0);
|
|
9508
9523
|
var themeStateProps = {
|
|
9509
9524
|
name: props.theme,
|
|
9510
9525
|
componentName: componentName2,
|
|
9511
9526
|
disable: disableTheme,
|
|
9512
|
-
shallow:
|
|
9527
|
+
shallow: curStateRef.themeShallow,
|
|
9513
9528
|
inverse: props.themeInverse,
|
|
9514
9529
|
debug: debugProp
|
|
9515
9530
|
};
|
|
9516
|
-
if (typeof
|
|
9531
|
+
if (typeof curStateRef.isListeningToTheme == "boolean" && (themeStateProps.shouldUpdate = function() {
|
|
9517
9532
|
return stateRef.current.isListeningToTheme;
|
|
9518
9533
|
}), themeStateProps.deopt = willBeAnimated, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
9519
9534
|
var name = "".concat(componentName2 || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"), type = (hasEnterStyle ? "(hasEnter)" : "") + (isAnimated ? "(animated)" : "") + (isReactNative ? "(rnw)" : "") + ((presenceState == null ? void 0 : presenceState.isPresent) === !1 ? "(EXIT)" : ""), dataIs = propsIn["data-is"] || "", banner = "".concat(internalID, " ").concat(name).concat(dataIs ? " ".concat(dataIs) : "", " ").concat(type);
|
|
@@ -9562,11 +9577,11 @@ var require_createComponent_native = __commonJS({
|
|
|
9562
9577
|
isExiting,
|
|
9563
9578
|
isAnimated
|
|
9564
9579
|
}, splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, (themeState == null || (_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "", state, styleProps, null, componentContext, elementType, debugProp);
|
|
9565
|
-
if (props.group && props.untilMeasured === "hide" && !
|
|
9580
|
+
if (props.group && props.untilMeasured === "hide" && !curStateRef.hasMeasured) {
|
|
9566
9581
|
var _splitStyles;
|
|
9567
9582
|
(_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
|
|
9568
9583
|
}
|
|
9569
|
-
process.env.NODE_ENV === "development" && time && time(_templateObject10()),
|
|
9584
|
+
process.env.NODE_ENV === "development" && time && time(_templateObject10()), curStateRef.isListeningToTheme = splitStyles.dynamicThemeAccess;
|
|
9570
9585
|
var isMediaArray = splitStyles.hasMedia && Array.isArray(splitStyles.hasMedia), shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || isMediaArray || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = isMediaArray ? splitStyles.hasMedia : null;
|
|
9571
9586
|
(0, import_useMedia.setMediaShouldUpdate)(stateRef, {
|
|
9572
9587
|
enabled: shouldListenForMedia,
|
|
@@ -9623,56 +9638,42 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
9623
9638
|
}), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
|
|
9624
9639
|
return _object_spread9({}, prev);
|
|
9625
9640
|
}), stateRef.current.hasMeasured = !0;
|
|
9626
|
-
})), viewProps = ((_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef,
|
|
9641
|
+
})), viewProps = ((_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef, curStateRef.willHydrate)) || nonTamaguiProps, curStateRef.composedRef || (curStateRef.composedRef = (0, import_compose_refs.composeRefs)(function(x) {
|
|
9627
9642
|
return stateRef.current.host = x;
|
|
9628
|
-
}, forwardedRef)), viewProps.ref =
|
|
9643
|
+
}, forwardedRef)), viewProps.ref = curStateRef.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants4.isWeb && !isHOC && import_react4.Children.toArray(props.children).forEach(function(item) {
|
|
9629
9644
|
typeof item == "string" && item !== `
|
|
9630
9645
|
` && console.error("Unexpected text node: ".concat(item, ". A text node cannot be a child of a <View>."));
|
|
9631
9646
|
}), process.env.NODE_ENV === "development" && time && time(_templateObject13());
|
|
9632
9647
|
var pseudoGroups = splitStyles.pseudoGroups, mediaGroups = splitStyles.mediaGroups;
|
|
9633
|
-
|
|
9648
|
+
curStateRef.unPress || (curStateRef.unPress = function() {
|
|
9634
9649
|
return setStateShallow({
|
|
9635
9650
|
press: !1,
|
|
9636
9651
|
pressIn: !1
|
|
9637
9652
|
});
|
|
9638
9653
|
});
|
|
9639
|
-
var unPress =
|
|
9654
|
+
var unPress = curStateRef.unPress;
|
|
9640
9655
|
(0, import_react4.useEffect)(function() {
|
|
9641
9656
|
if (!disabled) {
|
|
9642
|
-
if (
|
|
9657
|
+
if (state.unmounted) {
|
|
9643
9658
|
setStateShallow({
|
|
9644
9659
|
unmounted: !1
|
|
9645
9660
|
});
|
|
9646
9661
|
return;
|
|
9647
9662
|
}
|
|
9648
|
-
var
|
|
9649
|
-
|
|
9650
|
-
|
|
9651
|
-
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9655
|
-
|
|
9656
|
-
var group = _object_spread_props8(_object_spread9({}, state.group), _define_property9({}, name2, current));
|
|
9657
|
-
setStateShallow({
|
|
9658
|
-
group
|
|
9659
|
-
});
|
|
9660
|
-
};
|
|
9661
|
-
if (pseudo && pseudoGroups != null && pseudoGroups.has(name2))
|
|
9662
|
-
Object.assign(current.pseudo, pseudo), persist();
|
|
9663
|
-
else if (layout && mediaGroups) {
|
|
9664
|
-
var mediaState22 = getMediaState(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState22);
|
|
9665
|
-
next !== current.media && (Object.assign(current.media, next), persist());
|
|
9666
|
-
}
|
|
9667
|
-
});
|
|
9668
|
-
}
|
|
9663
|
+
var dispose = subscribeToContextGroup({
|
|
9664
|
+
disabled,
|
|
9665
|
+
componentContext,
|
|
9666
|
+
setStateShallow,
|
|
9667
|
+
state,
|
|
9668
|
+
mediaGroups,
|
|
9669
|
+
pseudoGroups
|
|
9670
|
+
});
|
|
9669
9671
|
return function() {
|
|
9670
|
-
|
|
9672
|
+
dispose == null || dispose(), mouseUps.delete(unPress);
|
|
9671
9673
|
};
|
|
9672
9674
|
}
|
|
9673
9675
|
}, [
|
|
9674
9676
|
disabled,
|
|
9675
|
-
shouldEnter,
|
|
9676
9677
|
pseudoGroups ? Object.keys(_to_consumable_array2(pseudoGroups)).join("") : 0,
|
|
9677
9678
|
mediaGroups ? Object.keys(_to_consumable_array2(mediaGroups)).join("") : 0
|
|
9678
9679
|
]);
|
|
@@ -9767,7 +9768,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
9767
9768
|
ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResetPresence, {
|
|
9768
9769
|
children: content
|
|
9769
9770
|
})), process.env.NODE_ENV === "development" && time && time(_templateObject18());
|
|
9770
|
-
var groupState =
|
|
9771
|
+
var groupState = curStateRef.group, subGroupContext = (0, import_react4.useMemo)(function() {
|
|
9771
9772
|
var _splitStyles_style, _splitStyles_style1;
|
|
9772
9773
|
if (!(!groupState || !groupName))
|
|
9773
9774
|
return groupState.listeners.clear(), _object_spread_props8(_object_spread9({}, componentContext.groups), {
|
|
@@ -9822,7 +9823,6 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
9822
9823
|
defaultProps,
|
|
9823
9824
|
elementType,
|
|
9824
9825
|
events,
|
|
9825
|
-
initialState,
|
|
9826
9826
|
isAnimated,
|
|
9827
9827
|
isMediaArray,
|
|
9828
9828
|
isStringElement,
|
|
@@ -10019,6 +10019,31 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
10019
10019
|
}
|
|
10020
10020
|
var fromPx = function(val) {
|
|
10021
10021
|
return typeof val != "string" ? val : +val.replace("px", "");
|
|
10022
|
+
}, isDisabled = function(props) {
|
|
10023
|
+
var _props_accessibilityState;
|
|
10024
|
+
return props.disabled || ((_props_accessibilityState = props.accessibilityState) === null || _props_accessibilityState === void 0 ? void 0 : _props_accessibilityState.disabled) || props["aria-disabled"] || props.accessibilityDisabled || !1;
|
|
10025
|
+
}, subscribeToContextGroup = function(param) {
|
|
10026
|
+
var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? !1 : _param_disabled, setStateShallow = param.setStateShallow, pseudoGroups = param.pseudoGroups, mediaGroups = param.mediaGroups, componentContext = param.componentContext, state = param.state;
|
|
10027
|
+
if (pseudoGroups || mediaGroups) {
|
|
10028
|
+
var _componentContext_groups, current = {
|
|
10029
|
+
pseudo: {},
|
|
10030
|
+
media: {}
|
|
10031
|
+
};
|
|
10032
|
+
return process.env.NODE_ENV === "development" && !componentContext.groups && console.debug("No context group found"), (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 ? void 0 : _componentContext_groups.subscribe(function(name, param2) {
|
|
10033
|
+
var layout = param2.layout, pseudo = param2.pseudo, persist = function() {
|
|
10034
|
+
var group = _object_spread_props8(_object_spread9({}, state.group), _define_property9({}, name, current));
|
|
10035
|
+
setStateShallow({
|
|
10036
|
+
group
|
|
10037
|
+
});
|
|
10038
|
+
};
|
|
10039
|
+
if (pseudo && pseudoGroups != null && pseudoGroups.has(name))
|
|
10040
|
+
Object.assign(current.pseudo, pseudo), persist();
|
|
10041
|
+
else if (layout && mediaGroups) {
|
|
10042
|
+
var mediaState3 = getMediaState(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState3);
|
|
10043
|
+
next !== current.media && (Object.assign(current.media, next), persist());
|
|
10044
|
+
}
|
|
10045
|
+
});
|
|
10046
|
+
}
|
|
10022
10047
|
};
|
|
10023
10048
|
}
|
|
10024
10049
|
});
|
|
@@ -10445,7 +10470,7 @@ var require_registerCSSVariable_native = __commonJS({
|
|
|
10445
10470
|
tokensValueToVariable.set((0, import_createVariable.getVariableValue)(v), v);
|
|
10446
10471
|
}, variableToCSS = function(v) {
|
|
10447
10472
|
var unitless = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
10448
|
-
return "--".concat((0, import_createVariable.createCSSVariable)(v.name, !1), ":").concat(!unitless && typeof v.val == "number" ? "".concat(v.val, "px") : v.val);
|
|
10473
|
+
return "--".concat(process.env.TAMAGUI_CSS_VARIABLE_PREFIX || "").concat((0, import_createVariable.createCSSVariable)(v.name, !1), ":").concat(!unitless && typeof v.val == "number" ? "".concat(v.val, "px") : v.val);
|
|
10449
10474
|
}, tokensValueToVariable = /* @__PURE__ */ new Map();
|
|
10450
10475
|
}
|
|
10451
10476
|
});
|
|
@@ -12209,7 +12234,7 @@ var require_useProps_native = __commonJS({
|
|
|
12209
12234
|
}
|
|
12210
12235
|
});
|
|
12211
12236
|
module2.exports = __toCommonJS2(useProps_exports);
|
|
12212
|
-
var import_react4 = require("react"), import_ComponentContext = require_ComponentContext_native(),
|
|
12237
|
+
var import_react4 = require("react"), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_createComponent = require_createComponent_native(), import_getSplitStyles = require_getSplitStyles_native(), import_Stack = require_Stack_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native();
|
|
12213
12238
|
function _array_like_to_array2(arr, len) {
|
|
12214
12239
|
(len == null || len > arr.length) && (len = arr.length);
|
|
12215
12240
|
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
@@ -12220,6 +12245,10 @@ var require_useProps_native = __commonJS({
|
|
|
12220
12245
|
if (Array.isArray(arr))
|
|
12221
12246
|
return arr;
|
|
12222
12247
|
}
|
|
12248
|
+
function _array_without_holes2(arr) {
|
|
12249
|
+
if (Array.isArray(arr))
|
|
12250
|
+
return _array_like_to_array2(arr);
|
|
12251
|
+
}
|
|
12223
12252
|
function _define_property9(obj, key, value) {
|
|
12224
12253
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
12225
12254
|
value,
|
|
@@ -12228,6 +12257,10 @@ var require_useProps_native = __commonJS({
|
|
|
12228
12257
|
writable: !0
|
|
12229
12258
|
}) : obj[key] = value, obj;
|
|
12230
12259
|
}
|
|
12260
|
+
function _iterable_to_array2(iter) {
|
|
12261
|
+
if ((typeof Symbol > "u" ? "undefined" : _type_of(Symbol)) < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
12262
|
+
return Array.from(iter);
|
|
12263
|
+
}
|
|
12231
12264
|
function _iterable_to_array_limit(arr, i) {
|
|
12232
12265
|
var _i = arr == null ? null : (typeof Symbol > "u" ? "undefined" : _type_of(Symbol)) < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
12233
12266
|
if (_i != null) {
|
|
@@ -12251,6 +12284,9 @@ var require_useProps_native = __commonJS({
|
|
|
12251
12284
|
function _non_iterable_rest() {
|
|
12252
12285
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
12253
12286
|
}
|
|
12287
|
+
function _non_iterable_spread2() {
|
|
12288
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
12289
|
+
}
|
|
12254
12290
|
function _object_spread9(target) {
|
|
12255
12291
|
for (var i = 1; i < arguments.length; i++) {
|
|
12256
12292
|
var source = arguments[i] != null ? arguments[i] : {}, ownKeys22 = Object.keys(source);
|
|
@@ -12280,6 +12316,9 @@ var require_useProps_native = __commonJS({
|
|
|
12280
12316
|
function _sliced_to_array(arr, i) {
|
|
12281
12317
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array2(arr, i) || _non_iterable_rest();
|
|
12282
12318
|
}
|
|
12319
|
+
function _to_consumable_array2(arr) {
|
|
12320
|
+
return _array_without_holes2(arr) || _iterable_to_array2(arr) || _unsupported_iterable_to_array2(arr) || _non_iterable_spread2();
|
|
12321
|
+
}
|
|
12283
12322
|
function _unsupported_iterable_to_array2(o, minLen) {
|
|
12284
12323
|
if (o) {
|
|
12285
12324
|
if (typeof o == "string")
|
|
@@ -12305,15 +12344,36 @@ var require_useProps_native = __commonJS({
|
|
|
12305
12344
|
function usePropsAndStyle2(props, opts) {
|
|
12306
12345
|
var _opts_forComponent, _themeState_state, _opts_forComponent_staticConfig, staticConfig = (_opts_forComponent_staticConfig = opts == null || (_opts_forComponent = opts.forComponent) === null || _opts_forComponent === void 0 ? void 0 : _opts_forComponent.staticConfig) !== null && _opts_forComponent_staticConfig !== void 0 ? _opts_forComponent_staticConfig : import_Stack.Stack.staticConfig, _useThemeWithState = _sliced_to_array((0, import_useTheme.useThemeWithState)({
|
|
12307
12346
|
componentName: staticConfig.componentName
|
|
12308
|
-
}), 2), themeState = _useThemeWithState[0], theme = _useThemeWithState[1], componentContext = (0, import_react4.useContext)(import_ComponentContext.ComponentContext), media = (0, import_useMedia.useMedia)(), splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, ((_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "",
|
|
12347
|
+
}), 2), themeState = _useThemeWithState[0], theme = _useThemeWithState[1], componentContext = (0, import_react4.useContext)(import_ComponentContext.ComponentContext), _useComponentState = (0, import_createComponent.useComponentState)(props, componentContext, staticConfig, (0, import_config.getConfig)()), state = _useComponentState.state, disabled = _useComponentState.disabled, setStateShallow = _useComponentState.setStateShallow, media = (0, import_useMedia.useMedia)(), splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, ((_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "", state, _object_spread9({
|
|
12309
12348
|
isAnimated: !1,
|
|
12310
12349
|
mediaState: media,
|
|
12311
12350
|
noSkip: !0,
|
|
12312
12351
|
noMergeStyle: !0,
|
|
12313
12352
|
noClassNames: !0,
|
|
12314
12353
|
resolveValues: "auto"
|
|
12315
|
-
}, opts), null, componentContext);
|
|
12316
|
-
return
|
|
12354
|
+
}, opts), null, componentContext), mediaGroups = splitStyles.mediaGroups, pseudoGroups = splitStyles.pseudoGroups;
|
|
12355
|
+
return (0, import_react4.useEffect)(function() {
|
|
12356
|
+
if (!disabled) {
|
|
12357
|
+
if (state.unmounted) {
|
|
12358
|
+
setStateShallow({
|
|
12359
|
+
unmounted: !1
|
|
12360
|
+
});
|
|
12361
|
+
return;
|
|
12362
|
+
}
|
|
12363
|
+
return (0, import_createComponent.subscribeToContextGroup)({
|
|
12364
|
+
disabled,
|
|
12365
|
+
componentContext,
|
|
12366
|
+
setStateShallow,
|
|
12367
|
+
state,
|
|
12368
|
+
mediaGroups,
|
|
12369
|
+
pseudoGroups
|
|
12370
|
+
});
|
|
12371
|
+
}
|
|
12372
|
+
}, [
|
|
12373
|
+
disabled,
|
|
12374
|
+
pseudoGroups ? Object.keys(_to_consumable_array2(pseudoGroups)).join("") : 0,
|
|
12375
|
+
mediaGroups ? Object.keys(_to_consumable_array2(mediaGroups)).join("") : 0
|
|
12376
|
+
]), [
|
|
12317
12377
|
splitStyles.viewProps,
|
|
12318
12378
|
splitStyles.style || {},
|
|
12319
12379
|
theme,
|
|
@@ -12973,6 +13033,7 @@ var require_index_native13 = __commonJS({
|
|
|
12973
13033
|
__reExport2(src_exports2, require_getExpandedShorthands_native(), module2.exports);
|
|
12974
13034
|
__reExport2(src_exports2, require_getSplitStyles_native(), module2.exports);
|
|
12975
13035
|
__reExport2(src_exports2, require_getStylesAtomic_native(), module2.exports);
|
|
13036
|
+
__reExport2(src_exports2, require_createComponent_native(), module2.exports);
|
|
12976
13037
|
__reExport2(src_exports2, require_getThemeCSSRules_native(), module2.exports);
|
|
12977
13038
|
__reExport2(src_exports2, require_getVariantExtras_native(), module2.exports);
|
|
12978
13039
|
__reExport2(src_exports2, require_isTamaguiComponent_native(), module2.exports);
|
|
@@ -14688,6 +14749,9 @@ var require_useElementLayout_native = __commonJS({
|
|
|
14688
14749
|
}), mod);
|
|
14689
14750
|
}, useElementLayout_exports = {};
|
|
14690
14751
|
__export2(useElementLayout_exports, {
|
|
14752
|
+
measureElement: function() {
|
|
14753
|
+
return measureElement;
|
|
14754
|
+
},
|
|
14691
14755
|
measureLayout: function() {
|
|
14692
14756
|
return measureLayout;
|
|
14693
14757
|
},
|
|
@@ -14707,6 +14771,30 @@ var require_useElementLayout_native = __commonJS({
|
|
|
14707
14771
|
if (Array.isArray(arr))
|
|
14708
14772
|
return arr;
|
|
14709
14773
|
}
|
|
14774
|
+
function asyncGeneratorStep2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
14775
|
+
try {
|
|
14776
|
+
var info = gen[key](arg), value = info.value;
|
|
14777
|
+
} catch (error) {
|
|
14778
|
+
reject(error);
|
|
14779
|
+
return;
|
|
14780
|
+
}
|
|
14781
|
+
info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw);
|
|
14782
|
+
}
|
|
14783
|
+
function _async_to_generator2(fn) {
|
|
14784
|
+
return function() {
|
|
14785
|
+
var self = this, args = arguments;
|
|
14786
|
+
return new Promise(function(resolve, reject) {
|
|
14787
|
+
var gen = fn.apply(self, args);
|
|
14788
|
+
function _next(value) {
|
|
14789
|
+
asyncGeneratorStep2(gen, resolve, reject, _next, _throw, "next", value);
|
|
14790
|
+
}
|
|
14791
|
+
function _throw(err) {
|
|
14792
|
+
asyncGeneratorStep2(gen, resolve, reject, _next, _throw, "throw", err);
|
|
14793
|
+
}
|
|
14794
|
+
_next(void 0);
|
|
14795
|
+
});
|
|
14796
|
+
};
|
|
14797
|
+
}
|
|
14710
14798
|
function _instanceof1(left, right) {
|
|
14711
14799
|
return right != null && (typeof Symbol > "u" ? "undefined" : _type_of(Symbol)) < "u" && right[Symbol.hasInstance] ? !!right[Symbol.hasInstance](left) : _instanceof(left, right);
|
|
14712
14800
|
}
|
|
@@ -14751,7 +14839,98 @@ var require_useElementLayout_native = __commonJS({
|
|
|
14751
14839
|
return _array_like_to_array2(o, minLen);
|
|
14752
14840
|
}
|
|
14753
14841
|
}
|
|
14754
|
-
|
|
14842
|
+
function _ts_generator2(thisArg, body) {
|
|
14843
|
+
var f, y, t, g, _ = {
|
|
14844
|
+
label: 0,
|
|
14845
|
+
sent: function() {
|
|
14846
|
+
if (t[0] & 1)
|
|
14847
|
+
throw t[1];
|
|
14848
|
+
return t[1];
|
|
14849
|
+
},
|
|
14850
|
+
trys: [],
|
|
14851
|
+
ops: []
|
|
14852
|
+
};
|
|
14853
|
+
return g = {
|
|
14854
|
+
next: verb(0),
|
|
14855
|
+
throw: verb(1),
|
|
14856
|
+
return: verb(2)
|
|
14857
|
+
}, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
|
|
14858
|
+
return this;
|
|
14859
|
+
}), g;
|
|
14860
|
+
function verb(n) {
|
|
14861
|
+
return function(v) {
|
|
14862
|
+
return step([
|
|
14863
|
+
n,
|
|
14864
|
+
v
|
|
14865
|
+
]);
|
|
14866
|
+
};
|
|
14867
|
+
}
|
|
14868
|
+
function step(op) {
|
|
14869
|
+
if (f)
|
|
14870
|
+
throw new TypeError("Generator is already executing.");
|
|
14871
|
+
for (; _; )
|
|
14872
|
+
try {
|
|
14873
|
+
if (f = 1, y && (t = op[0] & 2 ? y.return : op[0] ? y.throw || ((t = y.return) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
14874
|
+
return t;
|
|
14875
|
+
switch (y = 0, t && (op = [
|
|
14876
|
+
op[0] & 2,
|
|
14877
|
+
t.value
|
|
14878
|
+
]), op[0]) {
|
|
14879
|
+
case 0:
|
|
14880
|
+
case 1:
|
|
14881
|
+
t = op;
|
|
14882
|
+
break;
|
|
14883
|
+
case 4:
|
|
14884
|
+
return _.label++, {
|
|
14885
|
+
value: op[1],
|
|
14886
|
+
done: !1
|
|
14887
|
+
};
|
|
14888
|
+
case 5:
|
|
14889
|
+
_.label++, y = op[1], op = [
|
|
14890
|
+
0
|
|
14891
|
+
];
|
|
14892
|
+
continue;
|
|
14893
|
+
case 7:
|
|
14894
|
+
op = _.ops.pop(), _.trys.pop();
|
|
14895
|
+
continue;
|
|
14896
|
+
default:
|
|
14897
|
+
if (t = _.trys, !(t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
14898
|
+
_ = 0;
|
|
14899
|
+
continue;
|
|
14900
|
+
}
|
|
14901
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
14902
|
+
_.label = op[1];
|
|
14903
|
+
break;
|
|
14904
|
+
}
|
|
14905
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
14906
|
+
_.label = t[1], t = op;
|
|
14907
|
+
break;
|
|
14908
|
+
}
|
|
14909
|
+
if (t && _.label < t[2]) {
|
|
14910
|
+
_.label = t[2], _.ops.push(op);
|
|
14911
|
+
break;
|
|
14912
|
+
}
|
|
14913
|
+
t[2] && _.ops.pop(), _.trys.pop();
|
|
14914
|
+
continue;
|
|
14915
|
+
}
|
|
14916
|
+
op = body.call(thisArg, _);
|
|
14917
|
+
} catch (e) {
|
|
14918
|
+
op = [
|
|
14919
|
+
6,
|
|
14920
|
+
e
|
|
14921
|
+
], y = 0;
|
|
14922
|
+
} finally {
|
|
14923
|
+
f = t = 0;
|
|
14924
|
+
}
|
|
14925
|
+
if (op[0] & 5)
|
|
14926
|
+
throw op[1];
|
|
14927
|
+
return {
|
|
14928
|
+
value: op[0] ? op[1] : void 0,
|
|
14929
|
+
done: !0
|
|
14930
|
+
};
|
|
14931
|
+
}
|
|
14932
|
+
}
|
|
14933
|
+
var LayoutHandlers = /* @__PURE__ */ new WeakMap(), resizeListeners = /* @__PURE__ */ new Set(), resizeObserver = null;
|
|
14755
14934
|
(typeof window > "u" ? "undefined" : _type_of(window)) < "u" && "ResizeObserver" in window && (resizeObserver = new ResizeObserver(function(entries) {
|
|
14756
14935
|
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
14757
14936
|
try {
|
|
@@ -14761,21 +14940,8 @@ var require_useElementLayout_native = __commonJS({
|
|
|
14761
14940
|
return {
|
|
14762
14941
|
v: void 0
|
|
14763
14942
|
};
|
|
14764
|
-
|
|
14765
|
-
onLayout(
|
|
14766
|
-
nativeEvent: {
|
|
14767
|
-
layout: {
|
|
14768
|
-
x,
|
|
14769
|
-
y,
|
|
14770
|
-
width,
|
|
14771
|
-
height,
|
|
14772
|
-
left,
|
|
14773
|
-
top
|
|
14774
|
-
},
|
|
14775
|
-
target
|
|
14776
|
-
},
|
|
14777
|
-
timeStamp: Date.now()
|
|
14778
|
-
});
|
|
14943
|
+
measureElement(target).then(function(event) {
|
|
14944
|
+
onLayout(event);
|
|
14779
14945
|
});
|
|
14780
14946
|
}, _iterator = entries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
14781
14947
|
var _ret = _loop();
|
|
@@ -14792,8 +14958,43 @@ var require_useElementLayout_native = __commonJS({
|
|
|
14792
14958
|
throw _iteratorError;
|
|
14793
14959
|
}
|
|
14794
14960
|
}
|
|
14795
|
-
}))
|
|
14796
|
-
|
|
14961
|
+
}), typeof window.addEventListener == "function") && window.addEventListener("resize", function() {
|
|
14962
|
+
clearTimeout(tm), tm = setTimeout(function() {
|
|
14963
|
+
resizeListeners.forEach(function(cb) {
|
|
14964
|
+
return cb();
|
|
14965
|
+
});
|
|
14966
|
+
}, 4);
|
|
14967
|
+
});
|
|
14968
|
+
var tm, measureElement = function() {
|
|
14969
|
+
var _ref = _async_to_generator2(function(target) {
|
|
14970
|
+
return _ts_generator2(this, function(_state) {
|
|
14971
|
+
return [
|
|
14972
|
+
2,
|
|
14973
|
+
new Promise(function(res) {
|
|
14974
|
+
measureLayout(target, null, function(x, y, width, height, left, top) {
|
|
14975
|
+
res({
|
|
14976
|
+
nativeEvent: {
|
|
14977
|
+
layout: {
|
|
14978
|
+
x,
|
|
14979
|
+
y,
|
|
14980
|
+
width,
|
|
14981
|
+
height,
|
|
14982
|
+
left,
|
|
14983
|
+
top
|
|
14984
|
+
},
|
|
14985
|
+
target
|
|
14986
|
+
},
|
|
14987
|
+
timeStamp: Date.now()
|
|
14988
|
+
});
|
|
14989
|
+
});
|
|
14990
|
+
})
|
|
14991
|
+
];
|
|
14992
|
+
});
|
|
14993
|
+
});
|
|
14994
|
+
return function(target) {
|
|
14995
|
+
return _ref.apply(this, arguments);
|
|
14996
|
+
};
|
|
14997
|
+
}(), cache = /* @__PURE__ */ new WeakMap(), measureLayout = function(node, relativeTo, callback) {
|
|
14797
14998
|
var relativeNode = relativeTo || (node == null ? void 0 : node.parentNode);
|
|
14798
14999
|
if (_instanceof1(relativeNode, HTMLElement)) {
|
|
14799
15000
|
var now = Date.now();
|
|
@@ -14822,9 +15023,9 @@ var require_useElementLayout_native = __commonJS({
|
|
|
14822
15023
|
return new Promise(function(resolve) {
|
|
14823
15024
|
var fallbackToSync = function() {
|
|
14824
15025
|
resolve((0, import_getBoundingClientRect.getBoundingClientRect)(element));
|
|
14825
|
-
},
|
|
15026
|
+
}, tm2 = setTimeout(fallbackToSync, 10), observer = new IntersectionObserver(function(entries, ob) {
|
|
14826
15027
|
var _entries_;
|
|
14827
|
-
clearTimeout(
|
|
15028
|
+
clearTimeout(tm2), ob.disconnect(), resolve((_entries_ = entries[0]) === null || _entries_ === void 0 ? void 0 : _entries_.boundingClientRect);
|
|
14828
15029
|
}, {
|
|
14829
15030
|
threshold: 1e-4
|
|
14830
15031
|
});
|
|
@@ -14833,16 +15034,27 @@ var require_useElementLayout_native = __commonJS({
|
|
|
14833
15034
|
};
|
|
14834
15035
|
function useElementLayout(ref, onLayout) {
|
|
14835
15036
|
(0, import_constants4.useIsomorphicLayoutEffect)(function() {
|
|
14836
|
-
if (
|
|
15037
|
+
if (onLayout) {
|
|
14837
15038
|
var node = ref.current;
|
|
14838
|
-
|
|
14839
|
-
return LayoutHandlers.set(node, onLayout), resizeObserver.observe(node), function() {
|
|
14840
|
-
resizeObserver == null || resizeObserver.unobserve(node);
|
|
14841
|
-
};
|
|
15039
|
+
node && LayoutHandlers.set(node, onLayout);
|
|
14842
15040
|
}
|
|
14843
15041
|
}, [
|
|
14844
15042
|
ref,
|
|
14845
15043
|
onLayout
|
|
15044
|
+
]), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
|
|
15045
|
+
if (resizeObserver) {
|
|
15046
|
+
var node = ref.current;
|
|
15047
|
+
if (node && LayoutHandlers.has(node)) {
|
|
15048
|
+
var onResize = function() {
|
|
15049
|
+
measureElement(node).then(onLayout);
|
|
15050
|
+
};
|
|
15051
|
+
return resizeListeners.add(onResize), resizeObserver.observe(node), function() {
|
|
15052
|
+
resizeListeners.delete(onResize), resizeObserver == null || resizeObserver.unobserve(node);
|
|
15053
|
+
};
|
|
15054
|
+
}
|
|
15055
|
+
}
|
|
15056
|
+
}, [
|
|
15057
|
+
ref
|
|
14846
15058
|
]);
|
|
14847
15059
|
}
|
|
14848
15060
|
}
|
|
@@ -16541,7 +16753,8 @@ var require_Paragraph_native = __commonJS({
|
|
|
16541
16753
|
tag: "p",
|
|
16542
16754
|
userSelect: "auto",
|
|
16543
16755
|
color: "$color",
|
|
16544
|
-
size: "$true"
|
|
16756
|
+
size: "$true",
|
|
16757
|
+
whiteSpace: "normal"
|
|
16545
16758
|
});
|
|
16546
16759
|
}
|
|
16547
16760
|
});
|
|
@@ -17571,7 +17784,7 @@ var require_Adapt_native = __commonJS({
|
|
|
17571
17784
|
var AdaptParentContext = /* @__PURE__ */ (0, import_react4.createContext)(null), AdaptContents = function(props) {
|
|
17572
17785
|
var context = (0, import_react4.useContext)(AdaptParentContext);
|
|
17573
17786
|
if (!(context != null && context.Contents))
|
|
17574
|
-
throw new Error("Adapt
|
|
17787
|
+
throw new Error(process.env.NODE_ENV === "production" ? "tamagui.dev/docs/intro/errors#warning-002" : "You're rendering a Tamagui <Adapt /> component without nesting it inside a parent that is able to adapt.");
|
|
17575
17788
|
return /* @__PURE__ */ (0, import_react4.createElement)(context.Contents, props);
|
|
17576
17789
|
};
|
|
17577
17790
|
AdaptContents.shouldForwardSpace = !0;
|
|
@@ -17596,7 +17809,7 @@ var require_Adapt_native = __commonJS({
|
|
|
17596
17809
|
};
|
|
17597
17810
|
}, Adapt = (0, import_helpers.withStaticProperties)(function(param) {
|
|
17598
17811
|
var platform = param.platform, when = param.when, children = param.children, context = (0, import_react4.useContext)(AdaptParentContext), media = (0, import_core12.useMedia)(), enabled = !platform;
|
|
17599
|
-
return platform === "touch" && (enabled = import_constants22.isTouchable), platform === "native" && (enabled = !import_constants4.isWeb), platform === "web" && (enabled = import_constants4.isWeb), when && !media[when] && (enabled = !1), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
|
|
17812
|
+
return platform === "touch" && (enabled = import_constants22.isTouchable), platform === "native" && (enabled = !import_constants4.isWeb), platform === "web" && (enabled = import_constants4.isWeb), platform === "ios" && (enabled = import_constants4.isIos), platform === "android" && (enabled = import_constants4.isAndroid), when && !media[when] && (enabled = !1), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
|
|
17600
17813
|
enabled && (context == null || context.setWhen(when || enabled));
|
|
17601
17814
|
}, [
|
|
17602
17815
|
when,
|