@tamagui/core 1.112.1 → 1.112.2
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 +282 -153
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +277 -146
- package/dist/test.native.js.map +3 -3
- package/package.json +7 -7
package/dist/native.js
CHANGED
|
@@ -6694,6 +6694,55 @@ var require_isActivePlatform_native = __commonJS({
|
|
|
6694
6694
|
}
|
|
6695
6695
|
});
|
|
6696
6696
|
|
|
6697
|
+
// ../web/dist/cjs/helpers/sortString.native.js
|
|
6698
|
+
var require_sortString_native = __commonJS({
|
|
6699
|
+
"../web/dist/cjs/helpers/sortString.native.js"(exports2, module2) {
|
|
6700
|
+
"use strict";
|
|
6701
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
6702
|
+
for (var name in all) __defProp2(target, name, {
|
|
6703
|
+
get: all[name],
|
|
6704
|
+
enumerable: !0
|
|
6705
|
+
});
|
|
6706
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
6707
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
6708
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
6709
|
+
for (var _loop = function() {
|
|
6710
|
+
var key = _step.value;
|
|
6711
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
6712
|
+
get: function() {
|
|
6713
|
+
return from[key];
|
|
6714
|
+
},
|
|
6715
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
6716
|
+
});
|
|
6717
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
6718
|
+
} catch (err) {
|
|
6719
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
6720
|
+
} finally {
|
|
6721
|
+
try {
|
|
6722
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
6723
|
+
} finally {
|
|
6724
|
+
if (_didIteratorError)
|
|
6725
|
+
throw _iteratorError;
|
|
6726
|
+
}
|
|
6727
|
+
}
|
|
6728
|
+
return to;
|
|
6729
|
+
}, __toCommonJS2 = function(mod) {
|
|
6730
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
6731
|
+
value: !0
|
|
6732
|
+
}), mod);
|
|
6733
|
+
}, sortString_exports = {};
|
|
6734
|
+
__export2(sortString_exports, {
|
|
6735
|
+
sortString: function() {
|
|
6736
|
+
return sortString;
|
|
6737
|
+
}
|
|
6738
|
+
});
|
|
6739
|
+
module2.exports = __toCommonJS2(sortString_exports);
|
|
6740
|
+
var sortString = function(a, b) {
|
|
6741
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
6742
|
+
};
|
|
6743
|
+
}
|
|
6744
|
+
});
|
|
6745
|
+
|
|
6697
6746
|
// ../web/dist/cjs/helpers/getSplitStyles.native.js
|
|
6698
6747
|
var require_getSplitStyles_native = __commonJS({
|
|
6699
6748
|
"../web/dist/cjs/helpers/getSplitStyles.native.js"(exports2, module2) {
|
|
@@ -6758,7 +6807,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6758
6807
|
}
|
|
6759
6808
|
});
|
|
6760
6809
|
module2.exports = __toCommonJS2(getSplitStyles_exports);
|
|
6761
|
-
var import_react3 = __toESM2(require("react")), import_constants = require_index_native3(), import_helpers = require_index_native4(), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_skipProps = require_skipProps_native(), import_transformsToString = require_transformsToString_native(), import_isActivePlatform = require_isActivePlatform_native(), consoleGroupCollapsed = import_constants.isWeb ? console.groupCollapsed : console.info, conf, PROP_SPLIT = "-";
|
|
6810
|
+
var import_react3 = __toESM2(require("react")), import_constants = require_index_native3(), import_helpers = require_index_native4(), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_skipProps = require_skipProps_native(), import_transformsToString = require_transformsToString_native(), import_isActivePlatform = require_isActivePlatform_native(), import_sortString = require_sortString_native(), consoleGroupCollapsed = import_constants.isWeb ? console.groupCollapsed : console.info, conf, PROP_SPLIT = "-";
|
|
6762
6811
|
function isValidStyleKey(key, staticConfig) {
|
|
6763
6812
|
var _staticConfig_accept, validStyleProps = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles);
|
|
6764
6813
|
return validStyleProps[key] || ((_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key]);
|
|
@@ -7093,7 +7142,7 @@ current`, {
|
|
|
7093
7142
|
var _styleState1;
|
|
7094
7143
|
(_styleState1 = styleState).style || (_styleState1.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
|
|
7095
7144
|
var [a] = param, [b] = param1;
|
|
7096
|
-
return
|
|
7145
|
+
return (0, import_sortString.sortString)(a, b);
|
|
7097
7146
|
}).forEach(function(param) {
|
|
7098
7147
|
var [key5, val3] = param;
|
|
7099
7148
|
mergeTransform(styleState.style, key5, val3, !0);
|
|
@@ -7435,6 +7484,78 @@ var require_setElementProps_native = __commonJS({
|
|
|
7435
7484
|
}
|
|
7436
7485
|
});
|
|
7437
7486
|
|
|
7487
|
+
// ../web/dist/cjs/helpers/subscribeToContextGroup.native.js
|
|
7488
|
+
var require_subscribeToContextGroup_native = __commonJS({
|
|
7489
|
+
"../web/dist/cjs/helpers/subscribeToContextGroup.native.js"(exports2, module2) {
|
|
7490
|
+
"use strict";
|
|
7491
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
7492
|
+
for (var name in all) __defProp2(target, name, {
|
|
7493
|
+
get: all[name],
|
|
7494
|
+
enumerable: !0
|
|
7495
|
+
});
|
|
7496
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
7497
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
7498
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
7499
|
+
for (var _loop = function() {
|
|
7500
|
+
var key = _step.value;
|
|
7501
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
7502
|
+
get: function() {
|
|
7503
|
+
return from[key];
|
|
7504
|
+
},
|
|
7505
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
7506
|
+
});
|
|
7507
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
7508
|
+
} catch (err) {
|
|
7509
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
7510
|
+
} finally {
|
|
7511
|
+
try {
|
|
7512
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
7513
|
+
} finally {
|
|
7514
|
+
if (_didIteratorError)
|
|
7515
|
+
throw _iteratorError;
|
|
7516
|
+
}
|
|
7517
|
+
}
|
|
7518
|
+
return to;
|
|
7519
|
+
}, __toCommonJS2 = function(mod) {
|
|
7520
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
7521
|
+
value: !0
|
|
7522
|
+
}), mod);
|
|
7523
|
+
}, subscribeToContextGroup_exports = {};
|
|
7524
|
+
__export2(subscribeToContextGroup_exports, {
|
|
7525
|
+
subscribeToContextGroup: function() {
|
|
7526
|
+
return subscribeToContextGroup;
|
|
7527
|
+
}
|
|
7528
|
+
});
|
|
7529
|
+
module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
|
|
7530
|
+
var import_createShallowSetState = require_createShallowSetState_native(), import_useMedia = require_useMedia_native(), subscribeToContextGroup = function(param) {
|
|
7531
|
+
var { disabled = !1, setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
|
|
7532
|
+
if (pseudoGroups || mediaGroups) {
|
|
7533
|
+
var _componentContext_groups_subscribe, _componentContext_groups, current = {
|
|
7534
|
+
pseudo: {},
|
|
7535
|
+
media: {}
|
|
7536
|
+
};
|
|
7537
|
+
return process.env.NODE_ENV === "development" && !componentContext.groups && console.debug("No context group found"), (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 || (_componentContext_groups_subscribe = _componentContext_groups.subscribe) === null || _componentContext_groups_subscribe === void 0 ? void 0 : _componentContext_groups_subscribe.call(_componentContext_groups, function(name, param2) {
|
|
7538
|
+
var { layout, pseudo } = param2;
|
|
7539
|
+
if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
|
|
7540
|
+
else if (layout && mediaGroups) {
|
|
7541
|
+
var mediaState2 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState2);
|
|
7542
|
+
next !== current.media && (Object.assign(current.media, next), persist());
|
|
7543
|
+
}
|
|
7544
|
+
function persist() {
|
|
7545
|
+
var group = {
|
|
7546
|
+
...state.group,
|
|
7547
|
+
[name]: current
|
|
7548
|
+
};
|
|
7549
|
+
setStateShallow({
|
|
7550
|
+
group
|
|
7551
|
+
});
|
|
7552
|
+
}
|
|
7553
|
+
});
|
|
7554
|
+
}
|
|
7555
|
+
};
|
|
7556
|
+
}
|
|
7557
|
+
});
|
|
7558
|
+
|
|
7438
7559
|
// ../web/dist/cjs/views/ThemeDebug.native.js
|
|
7439
7560
|
var require_ThemeDebug_native = __commonJS({
|
|
7440
7561
|
"../web/dist/cjs/views/ThemeDebug.native.js"(exports2, module2) {
|
|
@@ -7779,6 +7900,154 @@ var require_useDidHydrateOnce_native = __commonJS({
|
|
|
7779
7900
|
}
|
|
7780
7901
|
});
|
|
7781
7902
|
|
|
7903
|
+
// ../web/dist/cjs/hooks/useComponentState.native.js
|
|
7904
|
+
var require_useComponentState_native = __commonJS({
|
|
7905
|
+
"../web/dist/cjs/hooks/useComponentState.native.js"(exports2, module2) {
|
|
7906
|
+
"use strict";
|
|
7907
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
7908
|
+
for (var name in all) __defProp2(target, name, {
|
|
7909
|
+
get: all[name],
|
|
7910
|
+
enumerable: !0
|
|
7911
|
+
});
|
|
7912
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
7913
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
7914
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
7915
|
+
for (var _loop = function() {
|
|
7916
|
+
var key = _step.value;
|
|
7917
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
7918
|
+
get: function() {
|
|
7919
|
+
return from[key];
|
|
7920
|
+
},
|
|
7921
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
7922
|
+
});
|
|
7923
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
7924
|
+
} catch (err) {
|
|
7925
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
7926
|
+
} finally {
|
|
7927
|
+
try {
|
|
7928
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
7929
|
+
} finally {
|
|
7930
|
+
if (_didIteratorError)
|
|
7931
|
+
throw _iteratorError;
|
|
7932
|
+
}
|
|
7933
|
+
}
|
|
7934
|
+
return to;
|
|
7935
|
+
}, __toCommonJS2 = function(mod) {
|
|
7936
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
7937
|
+
value: !0
|
|
7938
|
+
}), mod);
|
|
7939
|
+
}, useComponentState_exports = {};
|
|
7940
|
+
__export2(useComponentState_exports, {
|
|
7941
|
+
useComponentState: function() {
|
|
7942
|
+
return useComponentState;
|
|
7943
|
+
}
|
|
7944
|
+
});
|
|
7945
|
+
module2.exports = __toCommonJS2(useComponentState_exports);
|
|
7946
|
+
var import_defaultComponentState = require_defaultComponentState_native(), import_useDidHydrateOnce = require_useDidHydrateOnce_native(), import_react3 = require("react"), import_constants = require_index_native3(), import_createShallowSetState = require_createShallowSetState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, param, staticConfig, config) {
|
|
7947
|
+
var { animationDriver, groups } = param, _animationDriver_usePresence, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
|
|
7948
|
+
stateRef.current || (stateRef.current = {});
|
|
7949
|
+
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
|
|
7950
|
+
var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
|
|
7951
|
+
return !!(next || curStateRef.hasAnimated);
|
|
7952
|
+
}(), willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
|
|
7953
|
+
willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
|
|
7954
|
+
var 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), hasEnterState = hasEnterStyle || isEntering, didHydrateOnce = willBeAnimated ? (0, import_useDidHydrateOnce.useDidHydrateOnce)() : !0, shouldEnter = hasEnterState || !didHydrateOnce && hasRNAnimation, shouldEnterFromUnhydrated = import_constants.isWeb && !didHydrateOnce, initialState = shouldEnter ? (
|
|
7955
|
+
// on the very first render we switch all spring animation drivers to css rendering
|
|
7956
|
+
// this is because we need to use css variables, which they don't support to do proper SSR
|
|
7957
|
+
// without flickers of the wrong colors.
|
|
7958
|
+
// but once we do that initial hydration and we are in client side rendering mode,
|
|
7959
|
+
// we can avoid the extra re-render on mount
|
|
7960
|
+
shouldEnterFromUnhydrated ? import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateShouldEnter
|
|
7961
|
+
) : import_defaultComponentState.defaultComponentStateMounted, disabled = isDisabled(props);
|
|
7962
|
+
disabled != null && (initialState.disabled = disabled);
|
|
7963
|
+
var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? {
|
|
7964
|
+
...states[0],
|
|
7965
|
+
[props.forceStyle]: !0
|
|
7966
|
+
} : states[0], setState = states[1], isHydrated = state.unmounted === !1 || state.unmounted === "should-enter", isAnimated = willBeAnimated;
|
|
7967
|
+
import_constants.isWeb && hasRNAnimation && !staticConfig.isHOC && state.unmounted === !0 && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
|
|
7968
|
+
...state
|
|
7969
|
+
}));
|
|
7970
|
+
var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug);
|
|
7971
|
+
if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
7972
|
+
process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`has presenceState ${JSON.stringify(presenceState)}`);
|
|
7973
|
+
var { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
|
|
7974
|
+
(0, import_isObj.isObj)(custom) && Object.assign(props, custom);
|
|
7975
|
+
var exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
|
|
7976
|
+
state.unmounted && env && staticConfig.variants[env] ? (process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`Animating presence ENTER "${env}"`), props[env] = !0) : isExiting && exv && (process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`Animating presence EXIT "${exv}"`), props[exv] = exitVariant !== enterExitVariant);
|
|
7977
|
+
}
|
|
7978
|
+
var shouldAvoidClasses = !import_constants.isWeb;
|
|
7979
|
+
if (import_constants.isWeb) {
|
|
7980
|
+
var { disableClassName } = props, isAnimatedAndHydrated = isAnimated && !supportsCSSVars && didHydrateOnce && !import_constants.isServer, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || didHydrateOnce), isDisabledManually = disableClassName && !import_constants.isServer && didHydrateOnce && state.unmounted === !0;
|
|
7981
|
+
(isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (shouldAvoidClasses = !0, process.env.NODE_ENV === "development" && props.debug && (0, import_log.log)("avoiding className", {
|
|
7982
|
+
isAnimatedAndHydrated,
|
|
7983
|
+
isDisabledManually,
|
|
7984
|
+
isClassNameDisabled
|
|
7985
|
+
}));
|
|
7986
|
+
}
|
|
7987
|
+
var groupName = props.group;
|
|
7988
|
+
if (groupName && !curStateRef.group) {
|
|
7989
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
7990
|
+
curStateRef.group = {
|
|
7991
|
+
listeners,
|
|
7992
|
+
emit(name, state2) {
|
|
7993
|
+
listeners.forEach(function(l) {
|
|
7994
|
+
return l(name, state2);
|
|
7995
|
+
});
|
|
7996
|
+
},
|
|
7997
|
+
subscribe(cb) {
|
|
7998
|
+
return listeners.add(cb), function() {
|
|
7999
|
+
listeners.delete(cb);
|
|
8000
|
+
};
|
|
8001
|
+
}
|
|
8002
|
+
};
|
|
8003
|
+
}
|
|
8004
|
+
if (groupName) {
|
|
8005
|
+
var groupContextState = groups.state, og = setStateShallow;
|
|
8006
|
+
setStateShallow = function(state2) {
|
|
8007
|
+
og(state2), curStateRef.group.emit(groupName, {
|
|
8008
|
+
pseudo: state2
|
|
8009
|
+
});
|
|
8010
|
+
var next = {
|
|
8011
|
+
...groupContextState[groupName],
|
|
8012
|
+
...state2
|
|
8013
|
+
};
|
|
8014
|
+
groupContextState[groupName] = next;
|
|
8015
|
+
};
|
|
8016
|
+
}
|
|
8017
|
+
return {
|
|
8018
|
+
curStateRef,
|
|
8019
|
+
disabled,
|
|
8020
|
+
groupName,
|
|
8021
|
+
hasAnimationProp,
|
|
8022
|
+
hasEnterStyle,
|
|
8023
|
+
isAnimated,
|
|
8024
|
+
isExiting,
|
|
8025
|
+
isHydrated,
|
|
8026
|
+
presence,
|
|
8027
|
+
presenceState,
|
|
8028
|
+
setState,
|
|
8029
|
+
setStateShallow,
|
|
8030
|
+
shouldAvoidClasses,
|
|
8031
|
+
state,
|
|
8032
|
+
stateRef,
|
|
8033
|
+
supportsCSSVars,
|
|
8034
|
+
willBeAnimated,
|
|
8035
|
+
willBeAnimatedClient
|
|
8036
|
+
};
|
|
8037
|
+
};
|
|
8038
|
+
function hasAnimatedStyleValue(style) {
|
|
8039
|
+
return Object.keys(style).some(function(k) {
|
|
8040
|
+
var val = style[k];
|
|
8041
|
+
return val && typeof val == "object" && "_animation" in val;
|
|
8042
|
+
});
|
|
8043
|
+
}
|
|
8044
|
+
var isDisabled = function(props) {
|
|
8045
|
+
var _props_accessibilityState;
|
|
8046
|
+
return props.disabled || ((_props_accessibilityState = props.accessibilityState) === null || _props_accessibilityState === void 0 ? void 0 : _props_accessibilityState.disabled) || props["aria-disabled"] || props.accessibilityDisabled || !1;
|
|
8047
|
+
};
|
|
8048
|
+
}
|
|
8049
|
+
});
|
|
8050
|
+
|
|
7782
8051
|
// ../web/dist/cjs/setupHooks.native.js
|
|
7783
8052
|
var require_setupHooks_native = __commonJS({
|
|
7784
8053
|
"../web/dist/cjs/setupHooks.native.js"(exports2, module2) {
|
|
@@ -7988,21 +8257,12 @@ var require_createComponent_native = __commonJS({
|
|
|
7988
8257
|
createComponent: function() {
|
|
7989
8258
|
return createComponent;
|
|
7990
8259
|
},
|
|
7991
|
-
isDisabled: function() {
|
|
7992
|
-
return isDisabled;
|
|
7993
|
-
},
|
|
7994
8260
|
spacedChildren: function() {
|
|
7995
8261
|
return spacedChildren;
|
|
7996
|
-
},
|
|
7997
|
-
subscribeToContextGroup: function() {
|
|
7998
|
-
return subscribeToContextGroup;
|
|
7999
|
-
},
|
|
8000
|
-
useComponentState: function() {
|
|
8001
|
-
return useComponentState;
|
|
8002
8262
|
}
|
|
8003
8263
|
});
|
|
8004
8264
|
module2.exports = __toCommonJS2(createComponent_exports);
|
|
8005
|
-
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
8265
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_compose_refs = require_index_native5(), import_constants = require_index_native3(), import_helpers = require_index_native4(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), tamaguiConfig, time, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set();
|
|
8006
8266
|
typeof document < "u" && (cancelTouches = function() {
|
|
8007
8267
|
componentSetStates.forEach(function(setState) {
|
|
8008
8268
|
return setState(function(prev) {
|
|
@@ -8039,100 +8299,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8039
8299
|
});
|
|
8040
8300
|
}
|
|
8041
8301
|
}));
|
|
8042
|
-
var cancelTouches,
|
|
8043
|
-
var { animationDriver, groups } = param, _animationDriver_usePresence, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = import_react3.default.useRef(void 0);
|
|
8044
|
-
stateRef.current || (stateRef.current = {});
|
|
8045
|
-
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
|
|
8046
|
-
var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
|
|
8047
|
-
return !!(next || curStateRef.hasAnimated);
|
|
8048
|
-
}(), willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
|
|
8049
|
-
willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
|
|
8050
|
-
var 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);
|
|
8051
|
-
process.env.NODE_ENV === "development" && time && time`pre-use-state`;
|
|
8052
|
-
var hasEnterState = hasEnterStyle || isEntering, didHydrateOnce = willBeAnimated ? (0, import_useDidHydrateOnce.useDidHydrateOnce)() : !0, shouldEnter = hasEnterState || !didHydrateOnce && hasRNAnimation, shouldEnterFromUnhydrated = import_constants.isWeb && !didHydrateOnce, initialState = shouldEnter ? (
|
|
8053
|
-
// on the very first render we switch all spring animation drivers to css rendering
|
|
8054
|
-
// this is because we need to use css variables, which they don't support to do proper SSR
|
|
8055
|
-
// without flickers of the wrong colors.
|
|
8056
|
-
// but once we do that initial hydration and we are in client side rendering mode,
|
|
8057
|
-
// we can avoid the extra re-render on mount
|
|
8058
|
-
shouldEnterFromUnhydrated ? import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateShouldEnter
|
|
8059
|
-
) : import_defaultComponentState.defaultComponentStateMounted, disabled = isDisabled(props);
|
|
8060
|
-
disabled != null && (initialState.disabled = disabled);
|
|
8061
|
-
var states = import_react3.default.useState(initialState), state = props.forceStyle ? {
|
|
8062
|
-
...states[0],
|
|
8063
|
-
[props.forceStyle]: !0
|
|
8064
|
-
} : states[0], setState = states[1], isHydrated = state.unmounted === !1 || state.unmounted === "should-enter", isAnimated = willBeAnimated;
|
|
8065
|
-
import_constants.isWeb && hasRNAnimation && !staticConfig.isHOC && state.unmounted === !0 && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
|
|
8066
|
-
...state
|
|
8067
|
-
}));
|
|
8068
|
-
var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug);
|
|
8069
|
-
if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
8070
|
-
process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`has presenceState ${JSON.stringify(presenceState)}`);
|
|
8071
|
-
var { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
|
|
8072
|
-
(0, import_isObj.isObj)(custom) && Object.assign(props, custom);
|
|
8073
|
-
var exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
|
|
8074
|
-
state.unmounted && env && staticConfig.variants[env] ? (process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`Animating presence ENTER "${env}"`), props[env] = !0) : isExiting && exv && (process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`Animating presence EXIT "${exv}"`), props[exv] = exitVariant !== enterExitVariant);
|
|
8075
|
-
}
|
|
8076
|
-
var shouldAvoidClasses = !import_constants.isWeb;
|
|
8077
|
-
if (import_constants.isWeb) {
|
|
8078
|
-
var { disableClassName } = props, isAnimatedAndHydrated = isAnimated && !supportsCSSVars && didHydrateOnce && !import_constants.isServer, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || didHydrateOnce), isDisabledManually = disableClassName && !import_constants.isServer && didHydrateOnce && state.unmounted === !0;
|
|
8079
|
-
(isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (shouldAvoidClasses = !0, process.env.NODE_ENV === "development" && props.debug && (0, import_log.log)("avoiding className", {
|
|
8080
|
-
isAnimatedAndHydrated,
|
|
8081
|
-
isDisabledManually,
|
|
8082
|
-
isClassNameDisabled
|
|
8083
|
-
}));
|
|
8084
|
-
}
|
|
8085
|
-
var groupName = props.group;
|
|
8086
|
-
if (groupName && !curStateRef.group) {
|
|
8087
|
-
var listeners = /* @__PURE__ */ new Set();
|
|
8088
|
-
curStateRef.group = {
|
|
8089
|
-
listeners,
|
|
8090
|
-
emit(name, state2) {
|
|
8091
|
-
listeners.forEach(function(l) {
|
|
8092
|
-
return l(name, state2);
|
|
8093
|
-
});
|
|
8094
|
-
},
|
|
8095
|
-
subscribe(cb) {
|
|
8096
|
-
return listeners.add(cb), function() {
|
|
8097
|
-
listeners.delete(cb);
|
|
8098
|
-
};
|
|
8099
|
-
}
|
|
8100
|
-
};
|
|
8101
|
-
}
|
|
8102
|
-
if (groupName) {
|
|
8103
|
-
var groupContextState = groups.state, og = setStateShallow;
|
|
8104
|
-
setStateShallow = function(state2) {
|
|
8105
|
-
og(state2), curStateRef.group.emit(groupName, {
|
|
8106
|
-
pseudo: state2
|
|
8107
|
-
});
|
|
8108
|
-
var next = {
|
|
8109
|
-
...groupContextState[groupName],
|
|
8110
|
-
...state2
|
|
8111
|
-
};
|
|
8112
|
-
groupContextState[groupName] = next;
|
|
8113
|
-
};
|
|
8114
|
-
}
|
|
8115
|
-
return {
|
|
8116
|
-
curStateRef,
|
|
8117
|
-
disabled,
|
|
8118
|
-
groupName,
|
|
8119
|
-
hasAnimationProp,
|
|
8120
|
-
hasEnterStyle,
|
|
8121
|
-
isAnimated,
|
|
8122
|
-
isExiting,
|
|
8123
|
-
isHydrated,
|
|
8124
|
-
presence,
|
|
8125
|
-
presenceState,
|
|
8126
|
-
setState,
|
|
8127
|
-
setStateShallow,
|
|
8128
|
-
shouldAvoidClasses,
|
|
8129
|
-
state,
|
|
8130
|
-
stateRef,
|
|
8131
|
-
supportsCSSVars,
|
|
8132
|
-
willBeAnimated,
|
|
8133
|
-
willBeAnimatedClient
|
|
8134
|
-
};
|
|
8135
|
-
}, BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
|
|
8302
|
+
var cancelTouches, BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
|
|
8136
8303
|
value: !1
|
|
8137
8304
|
};
|
|
8138
8305
|
import_constants.isWeb && globalThis.document && (document.addEventListener("keydown", function() {
|
|
@@ -8153,7 +8320,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8153
8320
|
});
|
|
8154
8321
|
}
|
|
8155
8322
|
});
|
|
8156
|
-
var { Component, isText, isZStack, isHOC
|
|
8323
|
+
var { Component, isText, isZStack, isHOC } = staticConfig;
|
|
8157
8324
|
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} [${componentName || "Component"}]`, {
|
|
8158
8325
|
staticConfig,
|
|
8159
8326
|
defaultProps,
|
|
@@ -8206,7 +8373,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8206
8373
|
]), !1)
|
|
8207
8374
|
var timer;
|
|
8208
8375
|
process.env.NODE_ENV === "development" && time && time`start (ignore)`, process.env.NODE_ENV === "development" && time && time`did-finish-ssr`, process.env.NODE_ENV === "development" && time && time`stateref`;
|
|
8209
|
-
var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, shouldAvoidClasses, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient } = useComponentState(props, componentContext, staticConfig, config), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo;
|
|
8376
|
+
var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, shouldAvoidClasses, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo;
|
|
8210
8377
|
process.env.NODE_ENV === "development" && time && time`use-state`;
|
|
8211
8378
|
var hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText);
|
|
8212
8379
|
process.env.NODE_ENV === "development" && time && time`use-context`;
|
|
@@ -8377,7 +8544,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
8377
8544
|
});
|
|
8378
8545
|
return;
|
|
8379
8546
|
}
|
|
8380
|
-
var dispose = subscribeToContextGroup({
|
|
8547
|
+
var dispose = (0, import_subscribeToContextGroup.subscribeToContextGroup)({
|
|
8381
8548
|
disabled,
|
|
8382
8549
|
componentContext,
|
|
8383
8550
|
setStateShallow,
|
|
@@ -8741,43 +8908,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
8741
8908
|
left: 0,
|
|
8742
8909
|
pointerEvents: "box-none"
|
|
8743
8910
|
}
|
|
8744
|
-
})
|
|
8745
|
-
function hasAnimatedStyleValue(style) {
|
|
8746
|
-
return Object.keys(style).some(function(k) {
|
|
8747
|
-
var val = style[k];
|
|
8748
|
-
return val && typeof val == "object" && "_animation" in val;
|
|
8749
|
-
});
|
|
8750
|
-
}
|
|
8751
|
-
var fromPx = function(val) {
|
|
8911
|
+
}), fromPx = function(val) {
|
|
8752
8912
|
return typeof val != "string" ? val : +val.replace("px", "");
|
|
8753
|
-
}, isDisabled = function(props) {
|
|
8754
|
-
var _props_accessibilityState;
|
|
8755
|
-
return props.disabled || ((_props_accessibilityState = props.accessibilityState) === null || _props_accessibilityState === void 0 ? void 0 : _props_accessibilityState.disabled) || props["aria-disabled"] || props.accessibilityDisabled || !1;
|
|
8756
|
-
}, subscribeToContextGroup = function(param) {
|
|
8757
|
-
var { disabled = !1, setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
|
|
8758
|
-
if (pseudoGroups || mediaGroups) {
|
|
8759
|
-
var _componentContext_groups_subscribe, _componentContext_groups, current = {
|
|
8760
|
-
pseudo: {},
|
|
8761
|
-
media: {}
|
|
8762
|
-
};
|
|
8763
|
-
return process.env.NODE_ENV === "development" && !componentContext.groups && console.debug("No context group found"), (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 || (_componentContext_groups_subscribe = _componentContext_groups.subscribe) === null || _componentContext_groups_subscribe === void 0 ? void 0 : _componentContext_groups_subscribe.call(_componentContext_groups, function(name, param2) {
|
|
8764
|
-
var { layout, pseudo } = param2;
|
|
8765
|
-
if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
|
|
8766
|
-
else if (layout && mediaGroups) {
|
|
8767
|
-
var mediaState2 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState2);
|
|
8768
|
-
next !== current.media && (Object.assign(current.media, next), persist());
|
|
8769
|
-
}
|
|
8770
|
-
function persist() {
|
|
8771
|
-
var group = {
|
|
8772
|
-
...state.group,
|
|
8773
|
-
[name]: current
|
|
8774
|
-
};
|
|
8775
|
-
setStateShallow({
|
|
8776
|
-
group
|
|
8777
|
-
});
|
|
8778
|
-
}
|
|
8779
|
-
});
|
|
8780
|
-
}
|
|
8781
8913
|
};
|
|
8782
8914
|
}
|
|
8783
8915
|
});
|
|
@@ -9480,9 +9612,8 @@ var require_createTamagui_native = __commonJS({
|
|
|
9480
9612
|
var foundThemes;
|
|
9481
9613
|
if (configIn.themes) {
|
|
9482
9614
|
var noThemes = Object.keys(configIn.themes).length === 0;
|
|
9483
|
-
foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed);
|
|
9615
|
+
noThemes && (foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed)), process.env.TAMAGUI_REACT_19 && process.env.TAMAGUI_SKIP_THEME_OPTIMIZATION || noThemes && (0, import_insertStyleRule.listenForSheetChanges)();
|
|
9484
9616
|
}
|
|
9485
|
-
(0, import_insertStyleRule.listenForSheetChanges)();
|
|
9486
9617
|
var fontSizeTokens = null, fontsParsed;
|
|
9487
9618
|
if (configIn.fonts) {
|
|
9488
9619
|
var fontTokens = Object.fromEntries(Object.entries(configIn.fonts).map(function(param) {
|
|
@@ -9532,9 +9663,7 @@ ${JSON.stringify(variable, null, 2)}`);
|
|
|
9532
9663
|
cssRuleSets.push(specificRuleSet);
|
|
9533
9664
|
}
|
|
9534
9665
|
}
|
|
9535
|
-
var themesIn =
|
|
9536
|
-
...configIn.themes
|
|
9537
|
-
}, dedupedThemes = foundThemes ?? getThemesDeduped(themesIn), themes = (0, import_proxyThemeToParents.proxyThemesToParents)(dedupedThemes);
|
|
9666
|
+
var themesIn = configIn.themes, dedupedThemes = foundThemes ?? getThemesDeduped(themesIn), themes = (0, import_proxyThemeToParents.proxyThemesToParents)(dedupedThemes);
|
|
9538
9667
|
return {
|
|
9539
9668
|
themes,
|
|
9540
9669
|
cssRuleSets,
|
|
@@ -10663,7 +10792,7 @@ var require_useProps_native = __commonJS({
|
|
|
10663
10792
|
}
|
|
10664
10793
|
});
|
|
10665
10794
|
module2.exports = __toCommonJS2(useProps_exports);
|
|
10666
|
-
var import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(),
|
|
10795
|
+
var import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_getSplitStyles = require_getSplitStyles_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_Stack = require_Stack_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native();
|
|
10667
10796
|
function useProps(props, opts) {
|
|
10668
10797
|
var [propsOut, styleOut] = usePropsAndStyle(props, {
|
|
10669
10798
|
...opts,
|
|
@@ -10684,7 +10813,7 @@ var require_useProps_native = __commonJS({
|
|
|
10684
10813
|
componentName: staticConfig.componentName,
|
|
10685
10814
|
name: "theme" in props ? props.theme : void 0,
|
|
10686
10815
|
inverse: "themeInverse" in props ? props.themeInverse : void 0
|
|
10687
|
-
}), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), { state, disabled, setStateShallow } = (0,
|
|
10816
|
+
}), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), { state, disabled, setStateShallow } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, (0, import_config.getConfig)()), 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, {
|
|
10688
10817
|
isAnimated: !1,
|
|
10689
10818
|
mediaState: media,
|
|
10690
10819
|
noSkip: !0,
|
|
@@ -10701,7 +10830,7 @@ var require_useProps_native = __commonJS({
|
|
|
10701
10830
|
});
|
|
10702
10831
|
return;
|
|
10703
10832
|
}
|
|
10704
|
-
return (0,
|
|
10833
|
+
return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
|
|
10705
10834
|
disabled,
|
|
10706
10835
|
componentContext,
|
|
10707
10836
|
setStateShallow,
|