@tamagui/core 1.126.14 → 1.126.15

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.
@@ -11516,11 +11516,49 @@ __export(index_exports, {
11516
11516
  Text: () => Text,
11517
11517
  View: () => View,
11518
11518
  createTamagui: () => createTamagui,
11519
- getElementLayoutEvent: () => getElementLayoutEvent
11519
+ getElementLayoutEvent: () => getElementLayoutEvent,
11520
+ setOnLayoutStrategy: () => setOnLayoutStrategy
11520
11521
  });
11521
11522
  module.exports = __toCommonJS(index_exports);
11522
11523
  var import_react_native_media_driver = __toESM(require_index_native9()), import_react_native_use_responder_events = __toESM(require_index_native10()), import_web2 = __toESM(require_index_native8()), import_react2 = __toESM(require("react"));
11523
11524
 
11525
+ // src/addNativeValidStyles.native.ts
11526
+ var import_helpers = __toESM(require_index_native3());
11527
+ function getReactNativeVersion() {
11528
+ var version = process.env.REACT_NATIVE_VERSION || "";
11529
+ if (!process.env.REACT_NATIVE_VERSION)
11530
+ try {
11531
+ var ReactNativeOfficalVersion = require("react-native/Libraries/Core/ReactNativeVersion");
11532
+ if (ReactNativeOfficalVersion) {
11533
+ var { version: { major, minor, patch } } = ReactNativeOfficalVersion;
11534
+ version = `${major}.${minor}.${patch}`;
11535
+ }
11536
+ } catch {
11537
+ } finally {
11538
+ version || (version = "0.77");
11539
+ }
11540
+ var [major1, minor1, patch1] = version.split(".");
11541
+ return [
11542
+ +major1,
11543
+ +minor1,
11544
+ +patch1
11545
+ ];
11546
+ }
11547
+ function addNativeValidStyles() {
11548
+ var [major, minor] = getReactNativeVersion();
11549
+ if (major === 0 && minor >= 77) {
11550
+ var additional = {
11551
+ boxSizing: !0,
11552
+ mixBlendMode: !0,
11553
+ outlineWidth: !0,
11554
+ outlineStyle: !0,
11555
+ outlineSpread: !0,
11556
+ outlineColor: !0
11557
+ };
11558
+ Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
11559
+ }
11560
+ }
11561
+
11524
11562
  // src/createOptimizedView.native.tsx
11525
11563
  var import_react = __toESM(require("react"));
11526
11564
  function createOptimizedView(children, viewProps, baseViews2) {
@@ -11735,7 +11773,11 @@ var getRect = function(node) {
11735
11773
  };
11736
11774
 
11737
11775
  // src/hooks/useElementLayout.tsx
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;
11776
+ var import_constants = __toESM(require_index_native2()), import_web = __toESM(require_index_native8()), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), status = "active";
11777
+ function setOnLayoutStrategy(state) {
11778
+ status = state;
11779
+ }
11780
+ var NodeRectCache = /* @__PURE__ */ new WeakMap(), ParentRectCache = /* @__PURE__ */ new WeakMap(), rAF = typeof window < "u" ? window.requestAnimationFrame : void 0;
11739
11781
  if (import_constants.isClient && rAF) {
11740
11782
  let updateLayoutIfChanged = function(node) {
11741
11783
  var nodeRect = node.getBoundingClientRect(), parentNode = node.parentElement, parentRect = parentNode == null ? void 0 : parentNode.getBoundingClientRect(), onLayout = LayoutHandlers.get(node);
@@ -11751,7 +11793,7 @@ if (import_constants.isClient && rAF) {
11751
11793
  }
11752
11794
  }
11753
11795
  }, layoutOnAnimationFrame = function() {
11754
- Nodes.forEach(updateLayoutIfChanged), rAF(layoutOnAnimationFrame);
11796
+ status !== "inactive" && Nodes.forEach(updateLayoutIfChanged), rAF(layoutOnAnimationFrame);
11755
11797
  };
11756
11798
  updateLayoutIfChanged2 = updateLayoutIfChanged, layoutOnAnimationFrame2 = layoutOnAnimationFrame, avoidUpdates = !0, queuedUpdates = /* @__PURE__ */ new Map(), (0, import_web.___onDidFinishClientRender)(function() {
11757
11799
  avoidUpdates = !1, queuedUpdates && (queuedUpdates.forEach(function(cb) {
@@ -11803,43 +11845,6 @@ var avoidUpdates, queuedUpdates, updateLayoutIfChanged2, layoutOnAnimationFrame2
11803
11845
  // src/vendor/Pressability.native.tsx
11804
11846
  var Pressability = require_fake_react_native().default, usePressability = (init_idFn(), __toCommonJS(idFn_exports)).default;
11805
11847
 
11806
- // src/addNativeValidStyles.native.ts
11807
- var import_helpers = __toESM(require_index_native3());
11808
- function getReactNativeVersion() {
11809
- var version = process.env.REACT_NATIVE_VERSION || "";
11810
- if (!process.env.REACT_NATIVE_VERSION)
11811
- try {
11812
- var ReactNativeOfficalVersion = require("react-native/Libraries/Core/ReactNativeVersion");
11813
- if (ReactNativeOfficalVersion) {
11814
- var { version: { major, minor, patch } } = ReactNativeOfficalVersion;
11815
- version = `${major}.${minor}.${patch}`;
11816
- }
11817
- } catch {
11818
- } finally {
11819
- version || (version = "0.77");
11820
- }
11821
- var [major1, minor1, patch1] = version.split(".");
11822
- return [
11823
- +major1,
11824
- +minor1,
11825
- +patch1
11826
- ];
11827
- }
11828
- function addNativeValidStyles() {
11829
- var [major, minor] = getReactNativeVersion();
11830
- if (major === 0 && minor >= 77) {
11831
- var additional = {
11832
- boxSizing: !0,
11833
- mixBlendMode: !0,
11834
- outlineWidth: !0,
11835
- outlineStyle: !0,
11836
- outlineSpread: !0,
11837
- outlineColor: !0
11838
- };
11839
- Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
11840
- }
11841
- }
11842
-
11843
11848
  // src/index.tsx
11844
11849
  __reExport(index_exports, __toESM(require_index_native8()), module.exports);
11845
11850
  addNativeValidStyles();
@@ -11902,6 +11907,7 @@ var dontComposePressabilityKeys = {
11902
11907
  Text,
11903
11908
  View,
11904
11909
  createTamagui,
11905
- getElementLayoutEvent
11910
+ getElementLayoutEvent,
11911
+ setOnLayoutStrategy
11906
11912
  });
11907
11913
  //# sourceMappingURL=test.js.map