@tamagui/core 1.129.11 → 1.129.12-1751386794649
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 +124 -158
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +107 -115
- package/dist/test.native.js.map +2 -2
- package/package.json +9 -9
package/dist/native.js
CHANGED
|
@@ -1460,6 +1460,9 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1460
1460
|
shouldInsertStyleRules: function() {
|
|
1461
1461
|
return shouldInsertStyleRules;
|
|
1462
1462
|
},
|
|
1463
|
+
stopAccumulatingRules: function() {
|
|
1464
|
+
return stopAccumulatingRules;
|
|
1465
|
+
},
|
|
1463
1466
|
updateRules: function() {
|
|
1464
1467
|
return updateRules;
|
|
1465
1468
|
}
|
|
@@ -1550,7 +1553,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1550
1553
|
return themes;
|
|
1551
1554
|
}
|
|
1552
1555
|
}
|
|
1553
|
-
function
|
|
1556
|
+
function trackInsertedStyle(id) {
|
|
1554
1557
|
var remove = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, next = (totalSelectorsInserted.get(id) || 0) + (remove ? -1 : 1);
|
|
1555
1558
|
return totalSelectorsInserted.set(id, next), next;
|
|
1556
1559
|
}
|
|
@@ -1598,7 +1601,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1598
1601
|
}
|
|
1599
1602
|
continue;
|
|
1600
1603
|
}
|
|
1601
|
-
var total =
|
|
1604
|
+
var total = trackInsertedStyle(identifier, remove);
|
|
1602
1605
|
if (remove) total === 0 && delete allSelectors[identifier];
|
|
1603
1606
|
else if (!(identifier in allSelectors)) {
|
|
1604
1607
|
var isTransform = identifier.startsWith("_transform-"), shouldInsert = isTransform ? addTransform(identifier, cssRule.cssText, cssRule) : !0;
|
|
@@ -1698,53 +1701,62 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1698
1701
|
var getIdentifierFromTamaguiSelector = function(selector) {
|
|
1699
1702
|
var dotIndex = selector.indexOf(":");
|
|
1700
1703
|
return dotIndex > -1 ? selector.slice(7, dotIndex) : selector.slice(7);
|
|
1701
|
-
}, sheet = null;
|
|
1704
|
+
}, sheet = null, trackAllRules = !0;
|
|
1705
|
+
function stopAccumulatingRules() {
|
|
1706
|
+
trackAllRules = !0;
|
|
1707
|
+
}
|
|
1702
1708
|
function updateRules(identifier, rules) {
|
|
1703
|
-
return
|
|
1709
|
+
return trackAllRules && (allRules[identifier] = rules.join(" ")), identifier.startsWith("_transform-") ? addTransform(identifier, rules[0]) : !0;
|
|
1704
1710
|
}
|
|
1705
1711
|
var nonce = "";
|
|
1706
1712
|
function setNonce2(_) {
|
|
1707
1713
|
nonce = _;
|
|
1708
1714
|
}
|
|
1709
1715
|
function insertStyleRules2(rulesToInsert) {
|
|
1710
|
-
if (
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
var
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
} catch (err) {
|
|
1727
|
-
console.error("Error inserting CSS", err);
|
|
1728
|
-
}
|
|
1729
|
-
else sheet.insertRule(rule, sheet.cssRules.length);
|
|
1730
|
-
}
|
|
1731
|
-
} catch (err) {
|
|
1732
|
-
_didIteratorError = !0, _iteratorError = err;
|
|
1733
|
-
} finally {
|
|
1716
|
+
if (import_constants.isClient) {
|
|
1717
|
+
if (!sheet && document.head) {
|
|
1718
|
+
var styleTag = document.createElement("style");
|
|
1719
|
+
nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
|
|
1720
|
+
}
|
|
1721
|
+
if (!sheet) {
|
|
1722
|
+
console.warn("[tamagui] no sheet");
|
|
1723
|
+
return;
|
|
1724
|
+
}
|
|
1725
|
+
for (var key in rulesToInsert) {
|
|
1726
|
+
var styleObject = rulesToInsert[key], identifier = styleObject[import_helpers2.StyleObjectIdentifier];
|
|
1727
|
+
if (shouldInsertStyleRules(identifier)) {
|
|
1728
|
+
var rules = styleObject[import_helpers2.StyleObjectRules];
|
|
1729
|
+
allSelectors[identifier] = rules.join(`
|
|
1730
|
+
`), updateRules(identifier, rules), trackInsertedStyle(identifier);
|
|
1731
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
1734
1732
|
try {
|
|
1735
|
-
|
|
1733
|
+
for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
1734
|
+
var rule = _step.value;
|
|
1735
|
+
if (process.env.NODE_ENV === "production") try {
|
|
1736
|
+
sheet.insertRule(rule, sheet.cssRules.length);
|
|
1737
|
+
} catch (err) {
|
|
1738
|
+
console.error("Error inserting CSS", err);
|
|
1739
|
+
}
|
|
1740
|
+
else sheet.insertRule(rule, sheet.cssRules.length);
|
|
1741
|
+
}
|
|
1742
|
+
} catch (err) {
|
|
1743
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
1736
1744
|
} finally {
|
|
1737
|
-
|
|
1745
|
+
try {
|
|
1746
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
1747
|
+
} finally {
|
|
1748
|
+
if (_didIteratorError) throw _iteratorError;
|
|
1749
|
+
}
|
|
1738
1750
|
}
|
|
1739
1751
|
}
|
|
1740
1752
|
}
|
|
1741
1753
|
}
|
|
1742
1754
|
}
|
|
1743
|
-
var
|
|
1755
|
+
var maxToInsert = process.env.TAMAGUI_INSERT_SELECTOR_TRIES ? +process.env.TAMAGUI_INSERT_SELECTOR_TRIES : 1;
|
|
1744
1756
|
function shouldInsertStyleRules(identifier) {
|
|
1745
1757
|
if (process.env.IS_STATIC === "is_static") return !0;
|
|
1746
|
-
var total = totalSelectorsInserted.get(identifier);
|
|
1747
|
-
return process.env.NODE_ENV === "development" &&
|
|
1758
|
+
var total = totalSelectorsInserted.get(identifier) || 0;
|
|
1759
|
+
return process.env.NODE_ENV === "development" && total > +(process.env.TAMAGUI_STYLE_INSERTION_WARNING_LIMIT || 10) && console.warn('Warning: inserting many CSS rules, you may be animating something and generating many CSS insertions, which can degrade performance. Instead, try using the "disableClassName" property on elements that change styles often. To disable this warning set TAMAGUI_STYLE_INSERTION_WARNING_LIMIT from 50000 to something higher'), total < maxToInsert;
|
|
1748
1760
|
}
|
|
1749
1761
|
}
|
|
1750
1762
|
});
|
|
@@ -5401,7 +5413,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5401
5413
|
try {
|
|
5402
5414
|
for (var _iterator2 = pseudoStyles[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
|
|
5403
5415
|
var psuedoStyle = _step2.value, fullKey = `${psuedoStyle[import_helpers2.StyleObjectProperty]}${PROP_SPLIT}${descriptor.name}`;
|
|
5404
|
-
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle
|
|
5416
|
+
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), classNames[fullKey] = psuedoStyle[import_helpers2.StyleObjectIdentifier]);
|
|
5405
5417
|
}
|
|
5406
5418
|
} catch (err) {
|
|
5407
5419
|
_didIteratorError2 = !0, _iteratorError2 = err;
|
|
@@ -5479,7 +5491,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5479
5491
|
var out = (0, import_createMediaStyle.createMediaStyle)(style3, mediaKeyShort, import_useMedia.mediaQueryConfig, isMedia, !1, priority);
|
|
5480
5492
|
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)("\u{1F4FA} media style:", out);
|
|
5481
5493
|
var subKey = isSubStyle ? style3[2] : "", fullKey1 = `${style3[import_helpers2.StyleObjectProperty]}${subKey}${PROP_SPLIT}${mediaKeyShort}${style3[import_helpers2.StyleObjectPseudo] || ""}`;
|
|
5482
|
-
fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out
|
|
5494
|
+
fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), classNames[fullKey1] = out[import_helpers2.StyleObjectIdentifier]);
|
|
5483
5495
|
}
|
|
5484
5496
|
}
|
|
5485
5497
|
} catch (err) {
|
|
@@ -5530,7 +5542,9 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5530
5542
|
if (groupMediaKey) {
|
|
5531
5543
|
mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
|
|
5532
5544
|
var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
|
|
5533
|
-
if (!mediaState1 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP media ${groupMediaKey} active? ${isActive}
|
|
5545
|
+
if (!mediaState1 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP media ${groupMediaKey} active? ${isActive}`, {
|
|
5546
|
+
...mediaState1
|
|
5547
|
+
}), !isActive) {
|
|
5534
5548
|
for (var pkey1 in mediaStyle1) applyDefaultStyle(pkey1, styleState);
|
|
5535
5549
|
return;
|
|
5536
5550
|
}
|
|
@@ -5540,7 +5554,9 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5540
5554
|
pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
|
|
5541
5555
|
var componentGroupPseudoState = (componentGroupState || // fallback to context initially
|
|
5542
5556
|
componentContext.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
|
|
5543
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}
|
|
5557
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}`, {
|
|
5558
|
+
...componentGroupPseudoState
|
|
5559
|
+
}), !isActive1) {
|
|
5544
5560
|
for (var pkey2 in mediaStyle1) applyDefaultStyle(pkey2, styleState);
|
|
5545
5561
|
return;
|
|
5546
5562
|
}
|
|
@@ -5773,7 +5789,6 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5773
5789
|
return res;
|
|
5774
5790
|
};
|
|
5775
5791
|
function addStyleToInsertRules(rulesToInsert, styleObject) {
|
|
5776
|
-
var startedUnhydrated = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
|
|
5777
5792
|
if (0) var identifier;
|
|
5778
5793
|
}
|
|
5779
5794
|
var defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", animatableDefaults = {
|
|
@@ -6006,23 +6021,20 @@ var require_index_native6 = __commonJS({
|
|
|
6006
6021
|
});
|
|
6007
6022
|
module2.exports = __toCommonJS2(index_exports2);
|
|
6008
6023
|
var import_react3 = require("react");
|
|
6009
|
-
function useCreateShallowSetState(setter,
|
|
6024
|
+
function useCreateShallowSetState(setter, debug) {
|
|
6010
6025
|
return (0, import_react3.useCallback)(function(next) {
|
|
6011
6026
|
setter(function(prev) {
|
|
6012
|
-
|
|
6027
|
+
var update = mergeIfNotShallowEqual(prev, next);
|
|
6028
|
+
if (process.env.NODE_ENV === "development" && debug && update !== prev && (console.groupCollapsed("setStateShallow CHANGE", prev, "=>", update), console.trace(), console.groupEnd(), debug === "break")) debugger;
|
|
6029
|
+
return update;
|
|
6013
6030
|
});
|
|
6014
6031
|
}, [
|
|
6015
6032
|
setter,
|
|
6016
|
-
|
|
6033
|
+
debug
|
|
6017
6034
|
]);
|
|
6018
6035
|
}
|
|
6019
|
-
function mergeIfNotShallowEqual(prev, next
|
|
6020
|
-
|
|
6021
|
-
if (process.env.NODE_ENV === "development" && debug && (console.info("setStateShallow CHANGE", {
|
|
6022
|
-
prev,
|
|
6023
|
-
next
|
|
6024
|
-
}), debug === "break")) debugger;
|
|
6025
|
-
return {
|
|
6036
|
+
function mergeIfNotShallowEqual(prev, next) {
|
|
6037
|
+
return !prev || !next || isEqualShallow(prev, next) ? prev || next : {
|
|
6026
6038
|
...prev,
|
|
6027
6039
|
...next
|
|
6028
6040
|
};
|
|
@@ -6195,7 +6207,7 @@ var require_useThemeState_native = __commonJS({
|
|
|
6195
6207
|
var _keys_current, _props_needsUpdate, local = localStates.get(id), needsUpdate = isRoot || props.name === "light" || props.name === "dark" || props.name === null ? !0 : HasRenderedOnce.get(keys) ? !(keys == null || (_keys_current = keys.current) === null || _keys_current === void 0) && _keys_current.size ? !0 : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props) : !0, [rerender, next] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));
|
|
6196
6208
|
return PendingUpdate.delete(id), (!local || rerender) && (local = {
|
|
6197
6209
|
...next
|
|
6198
|
-
}, localStates.set(id, local)), process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && (console.groupCollapsed(` ${id}
|
|
6210
|
+
}, localStates.set(id, local)), process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && (console.groupCollapsed(` ${id} getSnapshot ${rerender}`, local.name, ">", next.name), console.info({
|
|
6199
6211
|
props,
|
|
6200
6212
|
propsKey,
|
|
6201
6213
|
isRoot,
|
|
@@ -6230,7 +6242,7 @@ var require_useThemeState_native = __commonJS({
|
|
|
6230
6242
|
themes || (themes = (0, import_config.getConfig)().themes);
|
|
6231
6243
|
var name = !propsKey && (!lastState || !(lastState != null && lastState.isNew)) ? null : getNewThemeName(parentState == null ? void 0 : parentState.name, props, pendingUpdate === "force" ? !0 : !!needsUpdate), isSameAsParent = parentState && (!name || name === parentState.name), shouldRerender = !!(needsUpdate && (pendingUpdate || (lastState == null ? void 0 : lastState.name) !== (parentState == null ? void 0 : parentState.name)));
|
|
6232
6244
|
if (process.env.NODE_ENV === "development" && debug && debug !== "profile") {
|
|
6233
|
-
var message = ` \xB7 useTheme(${id}) => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;
|
|
6245
|
+
var message = ` \xB7 useTheme(${id}) getNextState => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;
|
|
6234
6246
|
console.info(message);
|
|
6235
6247
|
}
|
|
6236
6248
|
if (isSameAsParent) return [
|
|
@@ -6914,7 +6926,7 @@ var require_wrapStyleTags_native = __commonJS({
|
|
|
6914
6926
|
});
|
|
6915
6927
|
module2.exports = __toCommonJS2(wrapStyleTags_exports);
|
|
6916
6928
|
var import_jsx_runtime2 = require("react/jsx-runtime"), import_constants = require_index_native2(), import_helpers2 = require_index_native3();
|
|
6917
|
-
function getStyleTags(styles
|
|
6929
|
+
function getStyleTags(styles) {
|
|
6918
6930
|
import_constants.IS_REACT_19;
|
|
6919
6931
|
}
|
|
6920
6932
|
}
|
|
@@ -7103,14 +7115,14 @@ var require_useComponentState_native = __commonJS({
|
|
|
7103
7115
|
var import_constants = require_index_native2(), import_is_equal_shallow = require_index_native6(), import_use_did_finish_ssr = require_index_native7(), import_react3 = require("react"), import_defaultComponentState = require_defaultComponentState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, param, staticConfig, config) {
|
|
7104
7116
|
var { animationDriver } = param, _animationDriver_usePresence, isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), needsHydration = !(0, import_use_did_finish_ssr.useIsClientOnly)(), [startedUnhydrated] = (0, import_react3.useState)(needsHydration && !isHydrated), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
|
|
7105
7117
|
stateRef.current || (stateRef.current = {});
|
|
7106
|
-
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)),
|
|
7118
|
+
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSS = animationDriver == null ? void 0 : animationDriver.supportsCSS, curStateRef = stateRef.current;
|
|
7107
7119
|
!needsHydration && hasAnimationProp && (curStateRef.hasAnimated = !0);
|
|
7108
7120
|
var willBeAnimatedClient = function() {
|
|
7109
7121
|
var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
|
|
7110
7122
|
return !!(next || curStateRef.hasAnimated);
|
|
7111
7123
|
}(), willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
|
|
7112
7124
|
willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
|
|
7113
|
-
var { disableClassName } = props, 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, hasAnimationThatNeedsHydrate = hasAnimationProp && !isHydrated && ((animationDriver == null ? void 0 : animationDriver.isReactNative) || !
|
|
7125
|
+
var { disableClassName } = props, 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, hasAnimationThatNeedsHydrate = hasAnimationProp && !isHydrated && ((animationDriver == null ? void 0 : animationDriver.isReactNative) || !supportsCSS), hasEnterState = hasEnterStyle || isEntering, shouldEnter = hasEnterState || hasAnimationThatNeedsHydrate || // disableClassName doesnt work server side, only client, so needs hydrate
|
|
7114
7126
|
// this is just for a better ux, supports css variables for light/dark, media queries, etc
|
|
7115
7127
|
disableClassName, initialState = shouldEnter ? (
|
|
7116
7128
|
// on the very first render we switch all spring animation drivers to css rendering
|
|
@@ -7124,7 +7136,9 @@ var require_useComponentState_native = __commonJS({
|
|
|
7124
7136
|
var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? {
|
|
7125
7137
|
...states[0],
|
|
7126
7138
|
[props.forceStyle]: !0
|
|
7127
|
-
} : states[0], setState = states[1]
|
|
7139
|
+
} : states[0], setState = states[1];
|
|
7140
|
+
stateRef.current.nextComponentState && Object.assign(state, stateRef.current.nextComponentState);
|
|
7141
|
+
var isAnimated = willBeAnimated;
|
|
7128
7142
|
import_constants.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), state.disabled = disabled, setState(function(_) {
|
|
7129
7143
|
return {
|
|
7130
7144
|
...state
|
|
@@ -7140,7 +7154,7 @@ var require_useComponentState_native = __commonJS({
|
|
|
7140
7154
|
}
|
|
7141
7155
|
var noClass = !import_constants.isWeb || !!props.forceStyle || isAnimated && (animationDriver == null ? void 0 : animationDriver.needsWebStyles);
|
|
7142
7156
|
if (import_constants.isWeb && (!import_constants.isServer || isHydrated)) {
|
|
7143
|
-
var isAnimatedAndHydrated = isAnimated && !
|
|
7157
|
+
var isAnimatedAndHydrated = isAnimated && !supportsCSS, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || !state.unmounted), isDisabledManually = disableClassName && !state.unmounted;
|
|
7144
7158
|
(isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (noClass = !0, process.env.NODE_ENV === "development" && props.debug && (0, import_log.log)("avoiding className", {
|
|
7145
7159
|
isAnimatedAndHydrated,
|
|
7146
7160
|
isDisabledManually,
|
|
@@ -7167,26 +7181,6 @@ var require_useComponentState_native = __commonJS({
|
|
|
7167
7181
|
}
|
|
7168
7182
|
};
|
|
7169
7183
|
}
|
|
7170
|
-
if (!curStateRef.stateEmitter && hasAnimationProp) {
|
|
7171
|
-
var listeners1 = /* @__PURE__ */ new Set();
|
|
7172
|
-
curStateRef.stateEmitter = {
|
|
7173
|
-
listeners: listeners1,
|
|
7174
|
-
emit(state2) {
|
|
7175
|
-
listeners1.forEach(function(l) {
|
|
7176
|
-
return l(state2);
|
|
7177
|
-
});
|
|
7178
|
-
},
|
|
7179
|
-
subscribe(cb) {
|
|
7180
|
-
return listeners1.add(cb), setStateShallow({
|
|
7181
|
-
hasDynGroupChildren: !0
|
|
7182
|
-
}), function() {
|
|
7183
|
-
listeners1.delete(cb), listeners1.size === 0 && setStateShallow({
|
|
7184
|
-
hasDynGroupChildren: !1
|
|
7185
|
-
});
|
|
7186
|
-
};
|
|
7187
|
-
}
|
|
7188
|
-
};
|
|
7189
|
-
}
|
|
7190
7184
|
return {
|
|
7191
7185
|
startedUnhydrated,
|
|
7192
7186
|
curStateRef,
|
|
@@ -7204,7 +7198,7 @@ var require_useComponentState_native = __commonJS({
|
|
|
7204
7198
|
noClass,
|
|
7205
7199
|
state,
|
|
7206
7200
|
stateRef,
|
|
7207
|
-
|
|
7201
|
+
supportsCSS,
|
|
7208
7202
|
willBeAnimated,
|
|
7209
7203
|
willBeAnimatedClient
|
|
7210
7204
|
};
|
|
@@ -7436,45 +7430,15 @@ var require_createComponent_native = __commonJS({
|
|
|
7436
7430
|
}
|
|
7437
7431
|
});
|
|
7438
7432
|
module2.exports = __toCommonJS2(createComponent_exports);
|
|
7439
|
-
var import_jsx_runtime2 = require("react/jsx-runtime"), import_compose_refs = require_index_native4(), import_constants = require_index_native2(), import_helpers2 = require_index_native3(), 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_getShorthandValue = require_getShorthandValue_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_wrapStyleTags = require_wrapStyleTags_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(), time2, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set()
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
});
|
|
7449
|
-
}), componentSetStates.clear();
|
|
7450
|
-
}, addEventListener("mouseup", cancelTouches), addEventListener("touchend", cancelTouches), addEventListener("touchcancel", cancelTouches), process.env.NODE_ENV === "development" && (startVisualizer = function() {
|
|
7451
|
-
var devVisualizerConfig = import_config.devConfig === null || import_config.devConfig === void 0 ? void 0 : import_config.devConfig.visualizer;
|
|
7452
|
-
if (devVisualizerConfig) {
|
|
7453
|
-
var show2 = function(val) {
|
|
7454
|
-
clearTimeout(tm), isShowing = val, debugKeyListeners == null || debugKeyListeners.forEach(function(l) {
|
|
7455
|
-
return l(val);
|
|
7456
|
-
});
|
|
7457
|
-
}, show = show2;
|
|
7458
|
-
debugKeyListeners = /* @__PURE__ */ new Set();
|
|
7459
|
-
var tm, isShowing = !1, options = {
|
|
7460
|
-
key: "Alt",
|
|
7461
|
-
delay: 800,
|
|
7462
|
-
...typeof devVisualizerConfig == "object" ? devVisualizerConfig : {}
|
|
7463
|
-
};
|
|
7464
|
-
window.addEventListener("blur", function() {
|
|
7465
|
-
show2(!1);
|
|
7466
|
-
}), window.addEventListener("keydown", function(param) {
|
|
7467
|
-
var { key, defaultPrevented } = param;
|
|
7468
|
-
defaultPrevented || (clearTimeout(tm), key === options.key && (tm = setTimeout(function() {
|
|
7469
|
-
show2(!0);
|
|
7470
|
-
}, options.delay)));
|
|
7471
|
-
}), window.addEventListener("keyup", function(param) {
|
|
7472
|
-
var { key, defaultPrevented } = param;
|
|
7473
|
-
defaultPrevented || key === options.key && isShowing && show2(!1);
|
|
7474
|
-
});
|
|
7475
|
-
}
|
|
7476
|
-
}));
|
|
7477
|
-
var cancelTouches, BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
|
|
7433
|
+
var import_jsx_runtime2 = require("react/jsx-runtime"), import_compose_refs = require_index_native4(), import_constants = require_index_native2(), import_helpers2 = require_index_native3(), 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_getShorthandValue = require_getShorthandValue_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_wrapStyleTags = require_wrapStyleTags_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(), time2, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set(), avoidReRenderKeys = /* @__PURE__ */ new Set([
|
|
7434
|
+
"hover",
|
|
7435
|
+
"press",
|
|
7436
|
+
"pressIn",
|
|
7437
|
+
"group",
|
|
7438
|
+
"media"
|
|
7439
|
+
]);
|
|
7440
|
+
if (0) var cancelTouches;
|
|
7441
|
+
var BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
|
|
7478
7442
|
value: !1
|
|
7479
7443
|
};
|
|
7480
7444
|
import_constants.isWeb && globalThis.document && (document.addEventListener("keydown", function() {
|
|
@@ -7551,7 +7515,7 @@ var require_createComponent_native = __commonJS({
|
|
|
7551
7515
|
}, [
|
|
7552
7516
|
componentName2
|
|
7553
7517
|
]);
|
|
7554
|
-
var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config), { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, noClass, state, stateRef,
|
|
7518
|
+
var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config), { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, noClass, state, stateRef, supportsCSS, willBeAnimated, willBeAnimatedClient, startedUnhydrated } = componentState, setStateShallow = componentState.setStateShallow;
|
|
7555
7519
|
process.env.NODE_ENV === "development" && time2 && time2`use-state`;
|
|
7556
7520
|
var hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
|
|
7557
7521
|
animationDriver && isAnimated && // this should really be behind another prop as it's not really related to
|
|
@@ -7575,7 +7539,7 @@ var require_createComponent_native = __commonJS({
|
|
|
7575
7539
|
noClass,
|
|
7576
7540
|
isAnimated,
|
|
7577
7541
|
isWeb: import_constants.isWeb,
|
|
7578
|
-
|
|
7542
|
+
supportsCSS
|
|
7579
7543
|
});
|
|
7580
7544
|
else {
|
|
7581
7545
|
console.groupEnd();
|
|
@@ -7604,7 +7568,7 @@ var require_createComponent_native = __commonJS({
|
|
|
7604
7568
|
(0, import_createVariable.setDidGetVariableValue)(!1), process.env.NODE_ENV === "development" && time2 && time2`media`;
|
|
7605
7569
|
var resolveValues = (
|
|
7606
7570
|
// if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
|
|
7607
|
-
isAnimated && !
|
|
7571
|
+
isAnimated && !supportsCSS || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
|
|
7608
7572
|
), styleProps = {
|
|
7609
7573
|
mediaState: mediaState2,
|
|
7610
7574
|
noClass,
|
|
@@ -7620,18 +7584,19 @@ var require_createComponent_native = __commonJS({
|
|
|
7620
7584
|
if (hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders) {
|
|
7621
7585
|
var styleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
|
|
7622
7586
|
setStateShallow = function(next) {
|
|
7623
|
-
var
|
|
7624
|
-
"hover",
|
|
7625
|
-
"press",
|
|
7626
|
-
"pressIn"
|
|
7627
|
-
]), canAvoidReRender = Object.keys(next).every(function(key3) {
|
|
7587
|
+
var canAvoidReRender = Object.keys(next).every(function(key3) {
|
|
7628
7588
|
return avoidReRenderKeys.has(key3);
|
|
7629
7589
|
});
|
|
7630
7590
|
if (canAvoidReRender && styleListener) {
|
|
7631
|
-
var updatedState = {
|
|
7591
|
+
var _curStateRef_group, _curStateRef_group1, updatedState = {
|
|
7632
7592
|
...state,
|
|
7633
7593
|
...next
|
|
7634
|
-
}
|
|
7594
|
+
};
|
|
7595
|
+
(_curStateRef_group1 = curStateRef.group) === null || _curStateRef_group1 === void 0 || _curStateRef_group1.emit(groupName, {
|
|
7596
|
+
pseudo: updatedState,
|
|
7597
|
+
layout: (_curStateRef_group = curStateRef.group) === null || _curStateRef_group === void 0 ? void 0 : _curStateRef_group.layout
|
|
7598
|
+
}), stateRef.current.nextComponentState = updatedState;
|
|
7599
|
+
var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
|
|
7635
7600
|
styleListener(nextStyles.style);
|
|
7636
7601
|
} else ogSetStateShallow(next);
|
|
7637
7602
|
};
|
|
@@ -7671,7 +7636,7 @@ var require_createComponent_native = __commonJS({
|
|
|
7671
7636
|
!isTaggable && props.forceStyle && (viewProps.forceStyle = props.forceStyle), isHOC && _themeProp && (viewProps.theme = _themeProp), tagProp && elementType.acceptTagProp && (viewProps.tag = tagProp);
|
|
7672
7637
|
var animationStyles, shouldUseAnimation = (
|
|
7673
7638
|
// if it supports css vars we run it on server too to get matching initial style
|
|
7674
|
-
(
|
|
7639
|
+
(supportsCSS ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
|
|
7675
7640
|
), animatedRef;
|
|
7676
7641
|
if (shouldUseAnimation) {
|
|
7677
7642
|
var useStyleEmitter = animationDriver != null && animationDriver.avoidReRenders ? function(listener) {
|
|
@@ -7728,7 +7693,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
7728
7693
|
console.groupCollapsed(`Rendered > (opacity: ${computed.opacity})`), console.warn(stateRef.current.host), console.warn(computed), console.groupEnd();
|
|
7729
7694
|
}
|
|
7730
7695
|
}), (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
7731
|
-
if (state.unmounted === !0 && hasEnterStyle) {
|
|
7696
|
+
if (stateRef.current.nextComponentState = void 0, state.unmounted === !0 && hasEnterStyle) {
|
|
7732
7697
|
setStateShallow({
|
|
7733
7698
|
unmounted: "should-enter"
|
|
7734
7699
|
});
|
|
@@ -7736,8 +7701,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
7736
7701
|
}
|
|
7737
7702
|
var tm;
|
|
7738
7703
|
if (state.unmounted) {
|
|
7739
|
-
|
|
7740
|
-
if (((_animationDriver_supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars) !== null && _animationDriver_supportsCSSVars !== void 0 ? _animationDriver_supportsCSSVars : !(config == null || (_config_animations2 = config.animations) === null || _config_animations2 === void 0) && _config_animations2.supportsCSSVars) || import_constants.isAndroid) return tm = setTimeout(function() {
|
|
7704
|
+
if (animationDriver != null && animationDriver.supportsCSS || import_constants.isAndroid) return tm = setTimeout(function() {
|
|
7741
7705
|
setStateShallow({
|
|
7742
7706
|
unmounted: !1
|
|
7743
7707
|
});
|
|
@@ -10322,7 +10286,7 @@ var require_TamaguiProvider_native = __commonJS({
|
|
|
10322
10286
|
}
|
|
10323
10287
|
});
|
|
10324
10288
|
module2.exports = __toCommonJS2(TamaguiProvider_exports);
|
|
10325
|
-
var import_jsx_runtime2 = require("react/jsx-runtime"), import_constants = require_index_native2(), import_use_did_finish_ssr = require_index_native7(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_useMedia = require_useMedia_native(), import_ThemeProvider = require_ThemeProvider_native();
|
|
10289
|
+
var import_jsx_runtime2 = require("react/jsx-runtime"), import_constants = require_index_native2(), import_use_did_finish_ssr = require_index_native7(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_useMedia = require_useMedia_native(), import_ThemeProvider = require_ThemeProvider_native(), import_insertStyleRule = require_insertStyleRule_native();
|
|
10326
10290
|
function TamaguiProvider2(param) {
|
|
10327
10291
|
var { children, disableInjectCSS, config, className, defaultTheme, disableRootThemeClass, reset, themeClassNameOnRoot } = param;
|
|
10328
10292
|
import_constants.IS_REACT_19 || import_constants.isClient && (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
@@ -10336,7 +10300,7 @@ var require_TamaguiProvider_native = __commonJS({
|
|
|
10336
10300
|
config,
|
|
10337
10301
|
disableInjectCSS
|
|
10338
10302
|
]), (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
10339
|
-
(0, import_useMedia.updateMediaListeners)();
|
|
10303
|
+
(0, import_insertStyleRule.stopAccumulatingRules)(), (0, import_useMedia.updateMediaListeners)();
|
|
10340
10304
|
}, []);
|
|
10341
10305
|
var contents = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(UnmountedClassName, {
|
|
10342
10306
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ComponentContext.ComponentContext.Provider, {
|
|
@@ -12235,49 +12199,51 @@ var require_index_native12 = __commonJS({
|
|
|
12235
12199
|
return cb();
|
|
12236
12200
|
}), queuedUpdates.clear()));
|
|
12237
12201
|
}
|
|
12202
|
+
var expectedFrameTime = 16.67, numDroppedFramesUntilPause = 10;
|
|
12238
12203
|
if (import_constants.isClient) if (rAF) {
|
|
12239
12204
|
layoutOnAnimationFrame = function() {
|
|
12240
12205
|
var now = Date.now(), timeSinceLastFrame = now - lastFrameAt;
|
|
12241
|
-
if (lastFrameAt = now,
|
|
12242
|
-
|
|
12206
|
+
if (lastFrameAt = now, frameCount < runEveryXFrames) {
|
|
12207
|
+
frameCount++, rAF(layoutOnAnimationFrame);
|
|
12208
|
+
return;
|
|
12209
|
+
}
|
|
12210
|
+
if (frameCount = 0, strategy !== "off") {
|
|
12211
|
+
var hasRecentSyncWork = timeSinceLastFrame > expectedFrameTime * numDroppedFramesUntilPause;
|
|
12243
12212
|
hasRecentSyncWork || Nodes.forEach(function(node) {
|
|
12244
12213
|
updateLayoutIfChanged(node, lastFrameAt);
|
|
12245
12214
|
});
|
|
12246
12215
|
}
|
|
12247
12216
|
rAF(layoutOnAnimationFrame);
|
|
12248
|
-
}, layoutOnAnimationFrame2 = layoutOnAnimationFrame, lastFrameAt = Date.now()
|
|
12217
|
+
}, layoutOnAnimationFrame2 = layoutOnAnimationFrame, lastFrameAt = Date.now();
|
|
12249
12218
|
async function updateLayoutIfChanged(node, frameId) {
|
|
12250
|
-
var
|
|
12251
|
-
if (
|
|
12252
|
-
var
|
|
12253
|
-
|
|
12254
|
-
|
|
12255
|
-
|
|
12256
|
-
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
|
|
12262
|
-
|
|
12219
|
+
var onLayout = LayoutHandlers.get(node);
|
|
12220
|
+
if (typeof onLayout == "function") {
|
|
12221
|
+
var parentNode = node.parentElement;
|
|
12222
|
+
if (parentNode) {
|
|
12223
|
+
var nodeRect, parentRect;
|
|
12224
|
+
if (strategy === "async") {
|
|
12225
|
+
var [nr, pr] = await Promise.all([
|
|
12226
|
+
getBoundingClientRectAsync(node),
|
|
12227
|
+
getBoundingClientRectAsync(parentNode)
|
|
12228
|
+
]);
|
|
12229
|
+
if (frameId !== lastFrameAt) return;
|
|
12230
|
+
nodeRect = nr, parentRect = pr;
|
|
12231
|
+
} else nodeRect = node.getBoundingClientRect(), parentRect = parentNode.getBoundingClientRect();
|
|
12232
|
+
var cachedRect = NodeRectCache.get(node), cachedParentRect = NodeRectCache.get(parentNode);
|
|
12263
12233
|
if (!cachedRect || // has changed one rect
|
|
12264
12234
|
!(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && (!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
|
|
12265
|
-
|
|
12266
|
-
|
|
12267
|
-
|
|
12268
|
-
|
|
12269
|
-
|
|
12270
|
-
} else if (strategy !== "async") {
|
|
12271
|
-
var event1 = getElementLayoutEvent(nodeRect, parentRect);
|
|
12272
|
-
onLayout(event1);
|
|
12273
|
-
}
|
|
12235
|
+
NodeRectCache.set(node, nodeRect), ParentRectCache.set(parentNode, parentRect);
|
|
12236
|
+
var event = getElementLayoutEvent(nodeRect, parentRect);
|
|
12237
|
+
avoidUpdates ? queuedUpdates.set(node, function() {
|
|
12238
|
+
return onLayout(event);
|
|
12239
|
+
}) : onLayout(event);
|
|
12274
12240
|
}
|
|
12275
12241
|
}
|
|
12276
12242
|
}
|
|
12277
12243
|
}
|
|
12278
|
-
rAF(layoutOnAnimationFrame);
|
|
12244
|
+
rAF(layoutOnAnimationFrame), frameCount = 0, runEveryXFrames = 6;
|
|
12279
12245
|
} else process.env.NODE_ENV === "development" && console.warn("No requestAnimationFrame - please polyfill for onLayout to work correctly");
|
|
12280
|
-
var layoutOnAnimationFrame, layoutOnAnimationFrame2, lastFrameAt,
|
|
12246
|
+
var layoutOnAnimationFrame, layoutOnAnimationFrame2, lastFrameAt, frameCount, runEveryXFrames, getElementLayoutEvent = function(nodeRect, parentRect) {
|
|
12281
12247
|
return {
|
|
12282
12248
|
nativeEvent: {
|
|
12283
12249
|
layout: getRelativeDimensions(nodeRect, parentRect),
|