tamagui 1.129.6 → 1.129.8
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 +77 -77
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +76 -76
- package/dist/test.native.js.map +2 -2
- package/package.json +55 -55
package/dist/test.native.js
CHANGED
|
@@ -2525,7 +2525,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2525
2525
|
return getAllTransforms;
|
|
2526
2526
|
},
|
|
2527
2527
|
insertStyleRules: function() {
|
|
2528
|
-
return
|
|
2528
|
+
return insertStyleRules2;
|
|
2529
2529
|
},
|
|
2530
2530
|
insertedTransforms: function() {
|
|
2531
2531
|
return insertedTransforms;
|
|
@@ -2624,7 +2624,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2624
2624
|
function setNonce2(_) {
|
|
2625
2625
|
nonce = _;
|
|
2626
2626
|
}
|
|
2627
|
-
function
|
|
2627
|
+
function insertStyleRules2(rulesToInsert) {
|
|
2628
2628
|
if (!sheet && import_constants4.isClient && document.head) {
|
|
2629
2629
|
var styleTag = document.createElement("style");
|
|
2630
2630
|
nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
|
|
@@ -6200,7 +6200,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6200
6200
|
try {
|
|
6201
6201
|
for (var _iterator2 = pseudoStyles[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
|
|
6202
6202
|
var psuedoStyle = _step2.value, fullKey = `${psuedoStyle[import_helpers.StyleObjectProperty]}${PROP_SPLIT}${descriptor.name}`;
|
|
6203
|
-
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), classNames[fullKey] = psuedoStyle[import_helpers.StyleObjectIdentifier]);
|
|
6203
|
+
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle, startedUnhydrated), classNames[fullKey] = psuedoStyle[import_helpers.StyleObjectIdentifier]);
|
|
6204
6204
|
}
|
|
6205
6205
|
} catch (err) {
|
|
6206
6206
|
_didIteratorError2 = !0, _iteratorError2 = err;
|
|
@@ -6255,7 +6255,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6255
6255
|
var style3 = _step12.value, property = style3[import_helpers.StyleObjectProperty], isSubStyle = property[0] === "$";
|
|
6256
6256
|
if (!(isSubStyle && !(0, import_isActivePlatform.isActivePlatform)(property))) {
|
|
6257
6257
|
var out = (0, import_createMediaStyle.createMediaStyle)(style3, mediaKeyShort, import_useMedia.mediaQueryConfig, isMedia, !1, priority), subKey = isSubStyle ? style3[2] : "", fullKey1 = `${style3[import_helpers.StyleObjectProperty]}${subKey}${PROP_SPLIT}${mediaKeyShort}${style3[import_helpers.StyleObjectPseudo] || ""}`;
|
|
6258
|
-
fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), classNames[fullKey1] = out[import_helpers.StyleObjectIdentifier]);
|
|
6258
|
+
fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out, startedUnhydrated), classNames[fullKey1] = out[import_helpers.StyleObjectIdentifier]);
|
|
6259
6259
|
}
|
|
6260
6260
|
}
|
|
6261
6261
|
} catch (err) {
|
|
@@ -7597,14 +7597,14 @@ var require_wrapStyleTags_native = __commonJS({
|
|
|
7597
7597
|
}), mod);
|
|
7598
7598
|
}, wrapStyleTags_exports = {};
|
|
7599
7599
|
__export2(wrapStyleTags_exports, {
|
|
7600
|
-
|
|
7601
|
-
return
|
|
7600
|
+
getStyleTags: function() {
|
|
7601
|
+
return getStyleTags;
|
|
7602
7602
|
}
|
|
7603
7603
|
});
|
|
7604
7604
|
module2.exports = __toCommonJS2(wrapStyleTags_exports);
|
|
7605
|
-
var import_jsx_runtime6 = require("react/jsx-runtime"),
|
|
7606
|
-
function
|
|
7607
|
-
|
|
7605
|
+
var import_jsx_runtime6 = require("react/jsx-runtime"), import_constants4 = require_index_native6(), import_helpers = require_index_native7();
|
|
7606
|
+
function getStyleTags(styles, content) {
|
|
7607
|
+
import_constants4.IS_REACT_19;
|
|
7608
7608
|
}
|
|
7609
7609
|
}
|
|
7610
7610
|
});
|
|
@@ -7789,8 +7789,8 @@ var require_useComponentState_native = __commonJS({
|
|
|
7789
7789
|
}
|
|
7790
7790
|
});
|
|
7791
7791
|
module2.exports = __toCommonJS2(useComponentState_exports);
|
|
7792
|
-
var import_constants4 = require_index_native6(), import_use_did_finish_ssr = require_index_native14(), import_react3 = require("react"), import_defaultComponentState = require_defaultComponentState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(),
|
|
7793
|
-
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)(
|
|
7792
|
+
var import_constants4 = require_index_native6(), import_is_equal_shallow = require_index_native13(), import_use_did_finish_ssr = require_index_native14(), 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) {
|
|
7793
|
+
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);
|
|
7794
7794
|
stateRef.current || (stateRef.current = {});
|
|
7795
7795
|
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current;
|
|
7796
7796
|
!needsHydration && hasAnimationProp && (curStateRef.hasAnimated = !0);
|
|
@@ -8231,7 +8231,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8231
8231
|
]), canAvoidReRender = Object.keys(next).every(function(key3) {
|
|
8232
8232
|
return avoidReRenderKeys.has(key3);
|
|
8233
8233
|
});
|
|
8234
|
-
if (canAvoidReRender) {
|
|
8234
|
+
if (canAvoidReRender && styleListener) {
|
|
8235
8235
|
var updatedState = {
|
|
8236
8236
|
...state,
|
|
8237
8237
|
...next
|
|
@@ -8506,6 +8506,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8506
8506
|
children: content
|
|
8507
8507
|
});
|
|
8508
8508
|
}
|
|
8509
|
+
if (0) var styleTags;
|
|
8509
8510
|
if (0) {
|
|
8510
8511
|
var element1, title;
|
|
8511
8512
|
if (!import_constants4.isWeb)
|
|
@@ -11038,6 +11039,9 @@ var require_index_native15 = __commonJS({
|
|
|
11038
11039
|
getTokens: function() {
|
|
11039
11040
|
return import_config.getTokens;
|
|
11040
11041
|
},
|
|
11042
|
+
insertStyleRules: function() {
|
|
11043
|
+
return import_insertStyleRule2.insertStyleRules;
|
|
11044
|
+
},
|
|
11041
11045
|
mediaKeyMatch: function() {
|
|
11042
11046
|
return import_useMedia.mediaKeyMatch;
|
|
11043
11047
|
},
|
|
@@ -11087,6 +11091,7 @@ var require_index_native15 = __commonJS({
|
|
|
11087
11091
|
__reExport2(index_exports2, require_createMediaStyle_native(), module2.exports);
|
|
11088
11092
|
__reExport2(index_exports2, require_getShorthandValue_native(), module2.exports);
|
|
11089
11093
|
__reExport2(index_exports2, require_index_native13(), module2.exports);
|
|
11094
|
+
var import_insertStyleRule2 = require_insertStyleRule_native();
|
|
11090
11095
|
__reExport2(index_exports2, require_createStyledContext_native(), module2.exports);
|
|
11091
11096
|
__reExport2(index_exports2, require_expandStyles_native(), module2.exports);
|
|
11092
11097
|
__reExport2(index_exports2, require_getExpandedShorthands_native(), module2.exports);
|
|
@@ -12740,7 +12745,7 @@ var require_index_native19 = __commonJS({
|
|
|
12740
12745
|
return enable;
|
|
12741
12746
|
},
|
|
12742
12747
|
getElementLayoutEvent: function() {
|
|
12743
|
-
return
|
|
12748
|
+
return getElementLayoutEvent;
|
|
12744
12749
|
},
|
|
12745
12750
|
getElementLayoutEventAsync: function() {
|
|
12746
12751
|
return getElementLayoutEventAsync;
|
|
@@ -12766,7 +12771,7 @@ var require_index_native19 = __commonJS({
|
|
|
12766
12771
|
function setOnLayoutStrategy3(state) {
|
|
12767
12772
|
strategy = state;
|
|
12768
12773
|
}
|
|
12769
|
-
var NodeRectCache = /* @__PURE__ */ new WeakMap(), ParentRectCache = /* @__PURE__ */ new WeakMap(),
|
|
12774
|
+
var NodeRectCache = /* @__PURE__ */ new WeakMap(), ParentRectCache = /* @__PURE__ */ new WeakMap(), LastChangeTime = /* @__PURE__ */ new WeakMap(), rAF = typeof window < "u" ? window.requestAnimationFrame : void 0, avoidUpdates = !0, queuedUpdates = /* @__PURE__ */ new Map();
|
|
12770
12775
|
function enable() {
|
|
12771
12776
|
avoidUpdates && (avoidUpdates = !1, queuedUpdates && (queuedUpdates.forEach(function(cb) {
|
|
12772
12777
|
return cb();
|
|
@@ -12777,66 +12782,51 @@ var require_index_native19 = __commonJS({
|
|
|
12777
12782
|
var now = Date.now(), timeSinceLastFrame = now - lastFrameAt;
|
|
12778
12783
|
if (lastFrameAt = now, strategy !== "off") {
|
|
12779
12784
|
var expectedFrameTime = 16.67, hasRecentSyncWork = timeSinceLastFrame > expectedFrameTime * numDroppedFramesUntilPause;
|
|
12780
|
-
hasRecentSyncWork || Nodes.forEach(
|
|
12785
|
+
hasRecentSyncWork || Nodes.forEach(function(node) {
|
|
12786
|
+
updateLayoutIfChanged(node, lastFrameAt);
|
|
12787
|
+
});
|
|
12781
12788
|
}
|
|
12782
12789
|
rAF(layoutOnAnimationFrame);
|
|
12783
12790
|
}, layoutOnAnimationFrame2 = layoutOnAnimationFrame, lastFrameAt = Date.now(), numDroppedFramesUntilPause = 2;
|
|
12784
|
-
async function updateLayoutIfChanged(node) {
|
|
12785
|
-
var
|
|
12786
|
-
if (
|
|
12787
|
-
var
|
|
12788
|
-
|
|
12789
|
-
|
|
12790
|
-
|
|
12791
|
-
|
|
12792
|
-
|
|
12793
|
-
|
|
12794
|
-
|
|
12795
|
-
|
|
12796
|
-
|
|
12797
|
-
var
|
|
12798
|
-
|
|
12799
|
-
|
|
12800
|
-
|
|
12801
|
-
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
|
|
12806
|
-
|
|
12807
|
-
|
|
12808
|
-
}, remainingDelay);
|
|
12809
|
-
DebounceTimers.set(node, newTimer);
|
|
12791
|
+
async function updateLayoutIfChanged(node, frameId) {
|
|
12792
|
+
var parentNode = node.parentElement, nodeRect, parentRect;
|
|
12793
|
+
if (strategy === "async") {
|
|
12794
|
+
var [nr, pr] = await Promise.all([
|
|
12795
|
+
getBoundingClientRectAsync(node),
|
|
12796
|
+
getBoundingClientRectAsync(parentNode)
|
|
12797
|
+
]);
|
|
12798
|
+
if (frameId !== lastFrameAt) return;
|
|
12799
|
+
nodeRect = nr, parentRect = pr;
|
|
12800
|
+
} else nodeRect = node.getBoundingClientRect(), parentRect = parentNode == null ? void 0 : parentNode.getBoundingClientRect();
|
|
12801
|
+
if (parentRect) {
|
|
12802
|
+
var onLayout = LayoutHandlers.get(node);
|
|
12803
|
+
if (typeof onLayout == "function") {
|
|
12804
|
+
var cachedRect = NodeRectCache.get(node), cachedParentRect = parentNode ? NodeRectCache.get(parentNode) : null;
|
|
12805
|
+
if (!cachedRect || // has changed one rect
|
|
12806
|
+
!(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && (!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
|
|
12807
|
+
if (NodeRectCache.set(node, nodeRect), parentRect && parentNode && ParentRectCache.set(parentNode, parentRect), avoidUpdates) {
|
|
12808
|
+
var event = getElementLayoutEvent(nodeRect, parentRect);
|
|
12809
|
+
queuedUpdates.set(node, function() {
|
|
12810
|
+
return onLayout(event);
|
|
12811
|
+
});
|
|
12812
|
+
} else if (strategy !== "async") {
|
|
12813
|
+
var event1 = getElementLayoutEvent(nodeRect, parentRect);
|
|
12814
|
+
onLayout(event1);
|
|
12810
12815
|
}
|
|
12811
|
-
}
|
|
12812
|
-
DebounceTimers.set(node, timer);
|
|
12813
|
-
} else {
|
|
12814
|
-
var event1 = getElementLayoutEvent2(node);
|
|
12815
|
-
onLayout(event1);
|
|
12816
|
+
}
|
|
12816
12817
|
}
|
|
12817
12818
|
}
|
|
12818
12819
|
}
|
|
12819
12820
|
rAF(layoutOnAnimationFrame);
|
|
12820
12821
|
}
|
|
12821
|
-
var layoutOnAnimationFrame, layoutOnAnimationFrame2, lastFrameAt, numDroppedFramesUntilPause,
|
|
12822
|
-
|
|
12823
|
-
|
|
12824
|
-
|
|
12825
|
-
|
|
12826
|
-
|
|
12827
|
-
|
|
12828
|
-
|
|
12829
|
-
width,
|
|
12830
|
-
height,
|
|
12831
|
-
left,
|
|
12832
|
-
top
|
|
12833
|
-
},
|
|
12834
|
-
target
|
|
12835
|
-
},
|
|
12836
|
-
timeStamp: Date.now()
|
|
12837
|
-
};
|
|
12838
|
-
}), !res) throw new Error("\u203C\uFE0F");
|
|
12839
|
-
return res;
|
|
12822
|
+
var layoutOnAnimationFrame, layoutOnAnimationFrame2, lastFrameAt, numDroppedFramesUntilPause, getElementLayoutEvent = function(nodeRect, parentRect) {
|
|
12823
|
+
return {
|
|
12824
|
+
nativeEvent: {
|
|
12825
|
+
layout: getRelativeDimensions(nodeRect, parentRect),
|
|
12826
|
+
target: nodeRect
|
|
12827
|
+
},
|
|
12828
|
+
timeStamp: Date.now()
|
|
12829
|
+
};
|
|
12840
12830
|
}, measureLayout = function(node, relativeTo, callback) {
|
|
12841
12831
|
var relativeNode = relativeTo || (node == null ? void 0 : node.parentElement);
|
|
12842
12832
|
if (relativeNode instanceof HTMLElement) {
|
|
@@ -12860,8 +12850,8 @@ var require_index_native19 = __commonJS({
|
|
|
12860
12850
|
var relativeNode = relativeTo || (node == null ? void 0 : node.parentElement);
|
|
12861
12851
|
if (relativeNode instanceof HTMLElement) {
|
|
12862
12852
|
var [nodeDim, relativeNodeDim] = await Promise.all([
|
|
12863
|
-
node
|
|
12864
|
-
relativeNode
|
|
12853
|
+
getBoundingClientRectAsync(node),
|
|
12854
|
+
getBoundingClientRectAsync(relativeNode)
|
|
12865
12855
|
]);
|
|
12866
12856
|
if (relativeNodeDim && nodeDim) {
|
|
12867
12857
|
var { x, y, width, height, left, top } = getRelativeDimensions(nodeDim, relativeNodeDim);
|
|
@@ -12893,11 +12883,13 @@ var require_index_native19 = __commonJS({
|
|
|
12893
12883
|
var _ref_current2;
|
|
12894
12884
|
if (onLayout) {
|
|
12895
12885
|
var node2 = (_ref_current2 = ref.current) === null || _ref_current2 === void 0 ? void 0 : _ref_current2.host;
|
|
12896
|
-
if (node2)
|
|
12897
|
-
|
|
12898
|
-
var
|
|
12899
|
-
|
|
12900
|
-
|
|
12886
|
+
if (node2) {
|
|
12887
|
+
LayoutHandlers.set(node2, onLayout), Nodes.add(node2);
|
|
12888
|
+
var parentNode = node2.parentNode;
|
|
12889
|
+
return parentNode && onLayout(getElementLayoutEvent(node2.getBoundingClientRect(), parentNode.getBoundingClientRect())), function() {
|
|
12890
|
+
Nodes.delete(node2), LayoutHandlers.delete(node2), NodeRectCache.delete(node2), LastChangeTime.delete(node2);
|
|
12891
|
+
};
|
|
12892
|
+
}
|
|
12901
12893
|
}
|
|
12902
12894
|
}, [
|
|
12903
12895
|
ref,
|
|
@@ -12907,7 +12899,18 @@ var require_index_native19 = __commonJS({
|
|
|
12907
12899
|
function ensureWebElement(x) {
|
|
12908
12900
|
if (!(typeof HTMLElement > "u")) return x instanceof HTMLElement ? x : void 0;
|
|
12909
12901
|
}
|
|
12910
|
-
var
|
|
12902
|
+
var getBoundingClientRectAsync = function(node) {
|
|
12903
|
+
return new Promise(function(res) {
|
|
12904
|
+
if (!(!node || node.nodeType !== 1)) {
|
|
12905
|
+
var io = new IntersectionObserver(function(entries) {
|
|
12906
|
+
return io.disconnect(), res(entries[0].boundingClientRect);
|
|
12907
|
+
}, {
|
|
12908
|
+
threshold: 0
|
|
12909
|
+
});
|
|
12910
|
+
io.observe(node);
|
|
12911
|
+
}
|
|
12912
|
+
});
|
|
12913
|
+
}, getBoundingClientRect = function(node) {
|
|
12911
12914
|
var _node_getBoundingClientRect;
|
|
12912
12915
|
if (!(!node || node.nodeType !== 1)) return (_node_getBoundingClientRect = node.getBoundingClientRect) === null || _node_getBoundingClientRect === void 0 ? void 0 : _node_getBoundingClientRect.call(node);
|
|
12913
12916
|
}, getRect = function(node) {
|
|
@@ -13465,9 +13468,6 @@ var require_index_native20 = __commonJS({
|
|
|
13465
13468
|
createTamagui: function() {
|
|
13466
13469
|
return createTamagui2;
|
|
13467
13470
|
},
|
|
13468
|
-
getElementLayoutEvent: function() {
|
|
13469
|
-
return import_use_element_layout2.getElementLayoutEvent;
|
|
13470
|
-
},
|
|
13471
13471
|
setOnLayoutStrategy: function() {
|
|
13472
13472
|
return import_use_element_layout2.setOnLayoutStrategy;
|
|
13473
13473
|
}
|