tamagui 1.86.4 → 1.86.5

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.
@@ -4674,7 +4674,7 @@ var require_createComponent_native = __commonJS({
4674
4674
  staticConfig
4675
4675
  )), useChildrenResult ? content = useChildrenResult : content = (0, import_react2.createElement)(elementType, viewProps, content);
4676
4676
  let ResetPresence = (_m = config == null ? void 0 : config.animations) == null ? void 0 : _m.ResetPresence;
4677
- willBeAnimated && hasEnterStyle && ResetPresence && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResetPresence, { children: content }));
4677
+ ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResetPresence, { children: content }));
4678
4678
  let groupState = curState.group, subGroupContext = (0, import_react2.useMemo)(() => {
4679
4679
  if (!(!groupState || !groupName))
4680
4680
  return groupState.listeners.clear(), {
@@ -7260,33 +7260,6 @@ var require_getBoundingClientRect_native = __commonJS({
7260
7260
  }
7261
7261
  });
7262
7262
 
7263
- // ../core/dist/cjs/helpers/getRect.native.js
7264
- var require_getRect_native = __commonJS({
7265
- "../core/dist/cjs/helpers/getRect.native.js"(exports2, module2) {
7266
- "use strict";
7267
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
7268
- for (var name in all)
7269
- __defProp2(target, name, { get: all[name], enumerable: !0 });
7270
- }, __copyProps2 = (to, from, except, desc) => {
7271
- if (from && typeof from == "object" || typeof from == "function")
7272
- for (let key of __getOwnPropNames2(from))
7273
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
7274
- return to;
7275
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getRect_exports = {};
7276
- __export2(getRect_exports, {
7277
- getRect: () => getRect
7278
- });
7279
- module2.exports = __toCommonJS2(getRect_exports);
7280
- var import_getBoundingClientRect = require_getBoundingClientRect_native(), getRect = (node) => {
7281
- let rect = (0, import_getBoundingClientRect.getBoundingClientRect)(node);
7282
- if (!rect)
7283
- return;
7284
- let { x, y, top, left } = rect;
7285
- return { x, y, width: node.offsetWidth, height: node.offsetHeight, top, left };
7286
- };
7287
- }
7288
- });
7289
-
7290
7263
  // ../core/dist/cjs/hooks/useElementLayout.native.js
7291
7264
  var require_useElementLayout_native = __commonJS({
7292
7265
  "../core/dist/cjs/hooks/useElementLayout.native.js"(exports2, module2) {
@@ -7305,7 +7278,7 @@ var require_useElementLayout_native = __commonJS({
7305
7278
  useElementLayout: () => useElementLayout
7306
7279
  });
7307
7280
  module2.exports = __toCommonJS2(useElementLayout_exports);
7308
- var import_constants4 = require_index_native(), import_getBoundingClientRect = require_getBoundingClientRect_native(), import_getRect = require_getRect_native(), LayoutHandlers = /* @__PURE__ */ new WeakMap(), LayoutTimeouts = /* @__PURE__ */ new WeakMap(), resizeObserver = null;
7281
+ var import_constants4 = require_index_native(), import_getBoundingClientRect = require_getBoundingClientRect_native(), LayoutHandlers = /* @__PURE__ */ new WeakMap(), resizeObserver = null;
7309
7282
  typeof window < "u" && "ResizeObserver" in window && (resizeObserver = new ResizeObserver((entries) => {
7310
7283
  for (let { target } of entries) {
7311
7284
  let onLayout = LayoutHandlers.get(target);
@@ -7322,17 +7295,41 @@ var require_useElementLayout_native = __commonJS({
7322
7295
  });
7323
7296
  }
7324
7297
  }));
7325
- var measureLayout = (node, relativeTo, callback) => {
7298
+ var cache = /* @__PURE__ */ new WeakMap(), measureLayout = (node, relativeTo, callback) => {
7326
7299
  let relativeNode = relativeTo || (node == null ? void 0 : node.parentNode);
7327
7300
  if (relativeNode instanceof HTMLElement) {
7328
- clearTimeout(LayoutTimeouts.get(relativeNode));
7329
- let tm = setTimeout(() => {
7330
- let relativeRect = (0, import_getBoundingClientRect.getBoundingClientRect)(relativeNode), { height, left, top, width } = (0, import_getRect.getRect)(node), x = left - relativeRect.left, y = top - relativeRect.top;
7331
- callback(x, y, width, height, left, top), LayoutTimeouts.delete(relativeNode);
7332
- }, 0);
7333
- LayoutTimeouts.set(relativeNode, tm);
7301
+ let now = Date.now();
7302
+ cache.set(node, now), Promise.all([
7303
+ getBoundingClientRectAsync(node),
7304
+ getBoundingClientRectAsync(relativeNode)
7305
+ ]).then(([nodeDim, relativeNodeDim]) => {
7306
+ if (relativeNodeDim && nodeDim && cache.get(node) === now) {
7307
+ let { x, y, width, height, left, top } = getRelativeDimensions(
7308
+ nodeDim,
7309
+ relativeNodeDim
7310
+ );
7311
+ callback(x, y, width, height, left, top);
7312
+ }
7313
+ });
7334
7314
  }
7335
- };
7315
+ }, getRelativeDimensions = (a, b) => {
7316
+ let { height, left, top, width } = a, x = left - b.left, y = top - b.top;
7317
+ return { x, y, width, height, left, top };
7318
+ }, getBoundingClientRectAsync = (element) => new Promise((resolve) => {
7319
+ function fallbackToSync() {
7320
+ resolve((0, import_getBoundingClientRect.getBoundingClientRect)(element));
7321
+ }
7322
+ let tm = setTimeout(fallbackToSync, 10);
7323
+ new IntersectionObserver(
7324
+ (entries, ob) => {
7325
+ var _a;
7326
+ clearTimeout(tm), ob.disconnect(), resolve((_a = entries[0]) == null ? void 0 : _a.boundingClientRect);
7327
+ },
7328
+ {
7329
+ threshold: 1e-4
7330
+ }
7331
+ ).observe(element);
7332
+ });
7336
7333
  function useElementLayout(ref, onLayout) {
7337
7334
  (0, import_constants4.useIsomorphicLayoutEffect)(() => {
7338
7335
  if (!resizeObserver || !onLayout)
@@ -7347,6 +7344,33 @@ var require_useElementLayout_native = __commonJS({
7347
7344
  }
7348
7345
  });
7349
7346
 
7347
+ // ../core/dist/cjs/helpers/getRect.native.js
7348
+ var require_getRect_native = __commonJS({
7349
+ "../core/dist/cjs/helpers/getRect.native.js"(exports2, module2) {
7350
+ "use strict";
7351
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
7352
+ for (var name in all)
7353
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
7354
+ }, __copyProps2 = (to, from, except, desc) => {
7355
+ if (from && typeof from == "object" || typeof from == "function")
7356
+ for (let key of __getOwnPropNames2(from))
7357
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
7358
+ return to;
7359
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), getRect_exports = {};
7360
+ __export2(getRect_exports, {
7361
+ getRect: () => getRect
7362
+ });
7363
+ module2.exports = __toCommonJS2(getRect_exports);
7364
+ var import_getBoundingClientRect = require_getBoundingClientRect_native(), getRect = (node) => {
7365
+ let rect = (0, import_getBoundingClientRect.getBoundingClientRect)(node);
7366
+ if (!rect)
7367
+ return;
7368
+ let { x, y, top, left } = rect;
7369
+ return { x, y, width: node.offsetWidth, height: node.offsetHeight, top, left };
7370
+ };
7371
+ }
7372
+ });
7373
+
7350
7374
  // ../core/dist/cjs/hooks/usePlatformMethods.native.js
7351
7375
  var require_usePlatformMethods_native = __commonJS({
7352
7376
  "../core/dist/cjs/hooks/usePlatformMethods.native.js"(exports2, module2) {