tamagui 1.126.15 → 1.126.17
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 +53 -52
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +42 -39
- package/dist/test.native.js.map +2 -2
- package/package.json +55 -55
package/dist/native.js
CHANGED
|
@@ -2650,13 +2650,11 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2650
2650
|
}
|
|
2651
2651
|
continue;
|
|
2652
2652
|
}
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
shouldInsert && (allSelectors[identifier] = cssRule.cssText);
|
|
2659
|
-
}
|
|
2653
|
+
var total = track(identifier, remove);
|
|
2654
|
+
if (remove) total === 0 && delete allSelectors[identifier];
|
|
2655
|
+
else if (!(identifier in allSelectors)) {
|
|
2656
|
+
var isTransform = identifier.startsWith("_transform-"), shouldInsert = isTransform ? addTransform(identifier, cssRule.cssText, cssRule) : !0;
|
|
2657
|
+
shouldInsert && (allSelectors[identifier] = cssRule.cssText);
|
|
2660
2658
|
}
|
|
2661
2659
|
}
|
|
2662
2660
|
}
|
|
@@ -2754,44 +2752,41 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2754
2752
|
return dotIndex > -1 ? selector.slice(7, dotIndex) : selector.slice(7);
|
|
2755
2753
|
}, sheet = null;
|
|
2756
2754
|
function updateRules(identifier, rules) {
|
|
2757
|
-
|
|
2755
|
+
return identifier in allRules ? !1 : (allRules[identifier] = rules.join(" "), identifier.startsWith("_transform-") ? addTransform(identifier, rules[0]) : !0);
|
|
2758
2756
|
}
|
|
2759
2757
|
var nonce = "";
|
|
2760
2758
|
function setNonce2(_) {
|
|
2761
2759
|
nonce = _;
|
|
2762
2760
|
}
|
|
2763
2761
|
function insertStyleRules(rulesToInsert) {
|
|
2764
|
-
if (!
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
var
|
|
2772
|
-
|
|
2773
|
-
var rules = styleObject[import_helpers.StyleObjectRules];
|
|
2774
|
-
allSelectors[identifier] = rules.join(`
|
|
2762
|
+
if (!sheet && import_constants4.isClient && document.head) {
|
|
2763
|
+
var styleTag = document.createElement("style");
|
|
2764
|
+
nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
|
|
2765
|
+
}
|
|
2766
|
+
if (sheet) for (var key in rulesToInsert) {
|
|
2767
|
+
var styleObject = rulesToInsert[key], identifier = styleObject[import_helpers.StyleObjectIdentifier];
|
|
2768
|
+
if (shouldInsertStyleRules(identifier)) {
|
|
2769
|
+
var rules = styleObject[import_helpers.StyleObjectRules];
|
|
2770
|
+
allSelectors[identifier] = rules.join(`
|
|
2775
2771
|
`), track(identifier), updateRules(identifier, rules);
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
}
|
|
2785
|
-
else sheet.insertRule(rule, sheet.cssRules.length);
|
|
2772
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
2773
|
+
try {
|
|
2774
|
+
for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
2775
|
+
var rule = _step.value;
|
|
2776
|
+
if (process.env.NODE_ENV === "production") try {
|
|
2777
|
+
sheet.insertRule(rule, sheet.cssRules.length);
|
|
2778
|
+
} catch (err) {
|
|
2779
|
+
console.error("Error inserting CSS", err);
|
|
2786
2780
|
}
|
|
2787
|
-
|
|
2788
|
-
|
|
2781
|
+
else sheet.insertRule(rule, sheet.cssRules.length);
|
|
2782
|
+
}
|
|
2783
|
+
} catch (err) {
|
|
2784
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
2785
|
+
} finally {
|
|
2786
|
+
try {
|
|
2787
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
2789
2788
|
} finally {
|
|
2790
|
-
|
|
2791
|
-
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
2792
|
-
} finally {
|
|
2793
|
-
if (_didIteratorError) throw _iteratorError;
|
|
2794
|
-
}
|
|
2789
|
+
if (_didIteratorError) throw _iteratorError;
|
|
2795
2790
|
}
|
|
2796
2791
|
}
|
|
2797
2792
|
}
|
|
@@ -2799,7 +2794,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2799
2794
|
}
|
|
2800
2795
|
var minInsertAmt = process.env.TAMAGUI_INSERT_SELECTOR_TRIES ? +process.env.TAMAGUI_INSERT_SELECTOR_TRIES : 1;
|
|
2801
2796
|
function shouldInsertStyleRules(identifier) {
|
|
2802
|
-
if (process.env.
|
|
2797
|
+
if (process.env.IS_STATIC === "is_static") return !0;
|
|
2803
2798
|
var total = totalSelectorsInserted.get(identifier);
|
|
2804
2799
|
return process.env.NODE_ENV === "development" && totalSelectorsInserted.size > +(process.env.TAMAGUI_STYLE_INSERTION_WARNING_LIMIT || 1e4) && 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 === void 0 || total < minInsertAmt;
|
|
2805
2800
|
}
|
|
@@ -6407,7 +6402,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6407
6402
|
function isValidStyleKey(key, validStyles, accept) {
|
|
6408
6403
|
return key in validStyles ? !0 : accept && key in accept;
|
|
6409
6404
|
}
|
|
6410
|
-
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) {
|
|
6405
|
+
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, startedUnhydrated, debug) {
|
|
6411
6406
|
var _loop = function(keyOg2) {
|
|
6412
6407
|
var keyInit = keyOg2, valInit = props[keyInit];
|
|
6413
6408
|
if (keyInit === "children") return viewProps[keyInit] = valInit, "continue";
|
|
@@ -6874,12 +6869,13 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6874
6869
|
}
|
|
6875
6870
|
return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
|
|
6876
6871
|
}, useInsertEffectCompat = import_constants4.isWeb ? import_react3.default.useInsertionEffect || import_constants4.useIsomorphicLayoutEffect : function() {
|
|
6877
|
-
}, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j) {
|
|
6872
|
+
}, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k) {
|
|
6878
6873
|
conf = conf || (0, import_config.getConfig)();
|
|
6879
|
-
var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j);
|
|
6874
|
+
var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k);
|
|
6880
6875
|
return res;
|
|
6881
6876
|
};
|
|
6882
6877
|
function addStyleToInsertRules(rulesToInsert, styleObject) {
|
|
6878
|
+
var startedUnhydrated = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
|
|
6883
6879
|
if (0) var identifier;
|
|
6884
6880
|
}
|
|
6885
6881
|
var defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", animatableDefaults = {
|
|
@@ -8031,9 +8027,9 @@ var require_wrapStyleTags_native = __commonJS({
|
|
|
8031
8027
|
}
|
|
8032
8028
|
});
|
|
8033
8029
|
module2.exports = __toCommonJS2(wrapStyleTags_exports);
|
|
8034
|
-
var import_jsx_runtime6 = require("react/jsx-runtime"), import_helpers = require_index_native7();
|
|
8030
|
+
var import_jsx_runtime6 = require("react/jsx-runtime"), import_helpers = require_index_native7(), import_constants4 = require_index_native6();
|
|
8035
8031
|
function wrapStyleTags(styles, content) {
|
|
8036
|
-
return
|
|
8032
|
+
return import_constants4.IS_REACT_19, content;
|
|
8037
8033
|
}
|
|
8038
8034
|
}
|
|
8039
8035
|
});
|
|
@@ -8151,7 +8147,7 @@ var require_useComponentState_native = __commonJS({
|
|
|
8151
8147
|
});
|
|
8152
8148
|
module2.exports = __toCommonJS2(useComponentState_exports);
|
|
8153
8149
|
var import_constants4 = require_index_native6(), import_use_did_finish_ssr = require_index_native13(), import_react3 = require("react"), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, param, staticConfig, config) {
|
|
8154
|
-
var { animationDriver } = param, _animationDriver_usePresence, isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
|
|
8150
|
+
var { animationDriver } = param, _animationDriver_usePresence, isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), [startedUnhydrated] = (0, import_react3.useState)(import_constants4.IS_REACT_19 ? !isHydrated : !1), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
|
|
8155
8151
|
stateRef.current || (stateRef.current = {});
|
|
8156
8152
|
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
|
|
8157
8153
|
var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
|
|
@@ -8216,6 +8212,7 @@ var require_useComponentState_native = __commonJS({
|
|
|
8216
8212
|
};
|
|
8217
8213
|
}
|
|
8218
8214
|
return {
|
|
8215
|
+
startedUnhydrated,
|
|
8219
8216
|
curStateRef,
|
|
8220
8217
|
disabled,
|
|
8221
8218
|
groupName,
|
|
@@ -8577,7 +8574,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8577
8574
|
}, [
|
|
8578
8575
|
componentName2
|
|
8579
8576
|
]);
|
|
8580
|
-
var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, noClass, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config);
|
|
8577
|
+
var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, noClass, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient, startedUnhydrated } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config);
|
|
8581
8578
|
process.env.NODE_ENV === "development" && time2 && time2`use-state`;
|
|
8582
8579
|
var hasTextAncestor = !!(import_constants4.isWeb && isText && componentContext.inText), 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;
|
|
8583
8580
|
animationDriver && isAnimated && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
|
|
@@ -8637,7 +8634,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8637
8634
|
styledContextProps
|
|
8638
8635
|
}, themeName = (themeState == null ? void 0 : themeState.name) || "";
|
|
8639
8636
|
process.env.NODE_ENV === "development" && time2 && time2`split-styles-prepare`;
|
|
8640
|
-
var splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, debugProp);
|
|
8637
|
+
var splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
|
|
8641
8638
|
if (process.env.NODE_ENV === "development" && time2 && time2`split-styles`, props.group && props.untilMeasured === "hide" && !curStateRef.hasMeasured) {
|
|
8642
8639
|
var _splitStyles;
|
|
8643
8640
|
(_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
|
|
@@ -8935,8 +8932,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
8935
8932
|
children: content
|
|
8936
8933
|
});
|
|
8937
8934
|
}
|
|
8938
|
-
|
|
8939
|
-
if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
8935
|
+
if (process.env.NODE_ENV === "development" && time2 && time2`context-override`, process.env.NODE_ENV === "development" && time2 && time2`style-tags`, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
8940
8936
|
var element1 = typeof elementType == "string" ? elementType : "Component", title = `render <${element1} /> (${internalID}) with props`;
|
|
8941
8937
|
if (import_constants4.isWeb) {
|
|
8942
8938
|
(0, import_consoleLog.groupCollapsed)(title);
|
|
@@ -9835,7 +9831,7 @@ var require_createTamagui_native = __commonJS({
|
|
|
9835
9831
|
var foundThemes;
|
|
9836
9832
|
if (configIn.themes) {
|
|
9837
9833
|
var noThemes = Object.keys(configIn.themes).length === 0;
|
|
9838
|
-
noThemes && (foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed)),
|
|
9834
|
+
noThemes && (foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed)), import_constants4.IS_REACT_19 && process.env.TAMAGUI_SKIP_THEME_OPTIMIZATION || noThemes && (0, import_insertStyleRule.listenForSheetChanges)();
|
|
9839
9835
|
}
|
|
9840
9836
|
var fontSizeTokens = null, fontsParsed;
|
|
9841
9837
|
if (configIn.fonts) {
|
|
@@ -11312,7 +11308,7 @@ var require_TamaguiProvider_native = __commonJS({
|
|
|
11312
11308
|
}), didRender = !0, function() {
|
|
11313
11309
|
didRender = !1;
|
|
11314
11310
|
};
|
|
11315
|
-
}, []),
|
|
11311
|
+
}, []), import_constants4.IS_REACT_19 || import_constants4.isClient && (0, import_constants4.useIsomorphicLayoutEffect)(function() {
|
|
11316
11312
|
if (config && !disableInjectCSS) {
|
|
11317
11313
|
var style = document.createElement("style");
|
|
11318
11314
|
return style.appendChild(document.createTextNode(config.getCSS())), document.head.appendChild(style), function() {
|
|
@@ -13715,13 +13711,18 @@ var require_useElementLayout_native = __commonJS({
|
|
|
13715
13711
|
}
|
|
13716
13712
|
}
|
|
13717
13713
|
}, layoutOnAnimationFrame = function() {
|
|
13718
|
-
|
|
13719
|
-
|
|
13714
|
+
var now = Date.now(), timeSinceLastFrame = now - lastFrameAt;
|
|
13715
|
+
if (lastFrameAt = now, status !== "inactive") {
|
|
13716
|
+
var expectedFrameTime = 16.67, hasRecentSyncWork = timeSinceLastFrame > expectedFrameTime * numDroppedFramesUntilPause;
|
|
13717
|
+
hasRecentSyncWork || Nodes.forEach(updateLayoutIfChanged);
|
|
13718
|
+
}
|
|
13719
|
+
rAF(layoutOnAnimationFrame);
|
|
13720
|
+
}, updateLayoutIfChanged2 = updateLayoutIfChanged, layoutOnAnimationFrame2 = layoutOnAnimationFrame, avoidUpdates = !0, queuedUpdates = /* @__PURE__ */ new Map(), lastFrameAt = Date.now(), numDroppedFramesUntilPause = 2, (0, import_web.___onDidFinishClientRender)(function() {
|
|
13720
13721
|
avoidUpdates = !1, queuedUpdates && (queuedUpdates.forEach(function(cb) {
|
|
13721
13722
|
return cb();
|
|
13722
13723
|
}), queuedUpdates.clear());
|
|
13723
13724
|
}), rAF(layoutOnAnimationFrame)) : process.env.NODE_ENV === "development" && console.warn("No requestAnimationFrame - please polyfill for onLayout to work correctly"));
|
|
13724
|
-
var updateLayoutIfChanged, layoutOnAnimationFrame, updateLayoutIfChanged2, layoutOnAnimationFrame2, avoidUpdates, queuedUpdates, getElementLayoutEvent2 = function(target) {
|
|
13725
|
+
var updateLayoutIfChanged, layoutOnAnimationFrame, updateLayoutIfChanged2, layoutOnAnimationFrame2, avoidUpdates, queuedUpdates, lastFrameAt, numDroppedFramesUntilPause, getElementLayoutEvent2 = function(target) {
|
|
13725
13726
|
var res = null;
|
|
13726
13727
|
if (measureLayout(target, null, function(x, y, width, height, left, top) {
|
|
13727
13728
|
res = {
|