@tamagui/core 1.126.13-1747874018127 → 1.126.14

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.
@@ -9620,13 +9620,25 @@ var require_TamaguiProvider_native = __commonJS({
9620
9620
  __export2(TamaguiProvider_exports, {
9621
9621
  TamaguiProvider: function() {
9622
9622
  return TamaguiProvider;
9623
+ },
9624
+ ___onDidFinishClientRender: function() {
9625
+ return ___onDidFinishClientRender2;
9623
9626
  }
9624
9627
  });
9625
9628
  module2.exports = __toCommonJS2(TamaguiProvider_exports);
9626
- var import_jsx_runtime = require("react/jsx-runtime"), import_constants2 = require_index_native2(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_ThemeProvider = require_ThemeProvider_native(), import_useMedia = require_useMedia_native();
9629
+ var import_jsx_runtime = require("react/jsx-runtime"), import_constants2 = require_index_native2(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_ThemeProvider = require_ThemeProvider_native(), import_useMedia = require_useMedia_native(), listeners = /* @__PURE__ */ new Set(), didRender = !1;
9630
+ function ___onDidFinishClientRender2(cb) {
9631
+ didRender ? cb() : listeners.add(cb);
9632
+ }
9627
9633
  function TamaguiProvider(param) {
9628
9634
  var { children, disableInjectCSS, config, className, defaultTheme, disableRootThemeClass, reset, themeClassNameOnRoot } = param;
9629
- return process.env.TAMAGUI_REACT_19 || import_constants2.isClient && (0, import_constants2.useIsomorphicLayoutEffect)(function() {
9635
+ return (0, import_react3.useEffect)(function() {
9636
+ return listeners.forEach(function(cb) {
9637
+ return cb();
9638
+ }), didRender = !0, function() {
9639
+ didRender = !1;
9640
+ };
9641
+ }, []), process.env.TAMAGUI_REACT_19 || import_constants2.isClient && (0, import_constants2.useIsomorphicLayoutEffect)(function() {
9630
9642
  if (config && !disableInjectCSS) {
9631
9643
  var style = document.createElement("style");
9632
9644
  return style.appendChild(document.createTextNode(config.getCSS())), document.head.appendChild(style), function() {
@@ -11723,8 +11735,8 @@ var getRect = function(node) {
11723
11735
  };
11724
11736
 
11725
11737
  // src/hooks/useElementLayout.tsx
11726
- var import_constants = __toESM(require_index_native2()), import_web = __toESM(require_index_native8()), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), NodeRectCache = /* @__PURE__ */ new WeakMap(), ParentRectCache = /* @__PURE__ */ new WeakMap();
11727
- if (import_constants.isClient && typeof requestAnimationFrame == "function") {
11738
+ var import_constants = __toESM(require_index_native2()), import_web = __toESM(require_index_native8()), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), NodeRectCache = /* @__PURE__ */ new WeakMap(), ParentRectCache = /* @__PURE__ */ new WeakMap(), rAF = typeof window < "u" ? window.requestAnimationFrame : void 0;
11739
+ if (import_constants.isClient && rAF) {
11728
11740
  let updateLayoutIfChanged = function(node) {
11729
11741
  var nodeRect = node.getBoundingClientRect(), parentNode = node.parentElement, parentRect = parentNode == null ? void 0 : parentNode.getBoundingClientRect(), onLayout = LayoutHandlers.get(node);
11730
11742
  if (typeof onLayout == "function") {
@@ -11739,13 +11751,13 @@ if (import_constants.isClient && typeof requestAnimationFrame == "function") {
11739
11751
  }
11740
11752
  }
11741
11753
  }, layoutOnAnimationFrame = function() {
11742
- Nodes.forEach(updateLayoutIfChanged), requestAnimationFrame(layoutOnAnimationFrame);
11754
+ Nodes.forEach(updateLayoutIfChanged), rAF(layoutOnAnimationFrame);
11743
11755
  };
11744
11756
  updateLayoutIfChanged2 = updateLayoutIfChanged, layoutOnAnimationFrame2 = layoutOnAnimationFrame, avoidUpdates = !0, queuedUpdates = /* @__PURE__ */ new Map(), (0, import_web.___onDidFinishClientRender)(function() {
11745
11757
  avoidUpdates = !1, queuedUpdates && (queuedUpdates.forEach(function(cb) {
11746
11758
  return cb();
11747
11759
  }), queuedUpdates.clear());
11748
- }), requestAnimationFrame(layoutOnAnimationFrame);
11760
+ }), rAF(layoutOnAnimationFrame);
11749
11761
  }
11750
11762
  var avoidUpdates, queuedUpdates, updateLayoutIfChanged2, layoutOnAnimationFrame2, getElementLayoutEvent = function(target) {
11751
11763
  var res = null;