@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.
package/dist/native.js CHANGED
@@ -12095,11 +12095,49 @@ __export(index_exports, {
12095
12095
  Text: () => Text,
12096
12096
  View: () => View,
12097
12097
  createTamagui: () => createTamagui,
12098
- getElementLayoutEvent: () => getElementLayoutEvent
12098
+ getElementLayoutEvent: () => getElementLayoutEvent,
12099
+ setOnLayoutStrategy: () => setOnLayoutStrategy
12099
12100
  });
12100
12101
  module.exports = __toCommonJS(index_exports);
12101
12102
  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"));
12102
12103
 
12104
+ // src/addNativeValidStyles.native.ts
12105
+ var import_helpers = __toESM(require_index_native3());
12106
+ function getReactNativeVersion() {
12107
+ var version = process.env.REACT_NATIVE_VERSION || "";
12108
+ if (!process.env.REACT_NATIVE_VERSION)
12109
+ try {
12110
+ var ReactNativeOfficalVersion = require("react-native/Libraries/Core/ReactNativeVersion");
12111
+ if (ReactNativeOfficalVersion) {
12112
+ var { version: { major, minor, patch } } = ReactNativeOfficalVersion;
12113
+ version = `${major}.${minor}.${patch}`;
12114
+ }
12115
+ } catch {
12116
+ } finally {
12117
+ version || (version = "0.77");
12118
+ }
12119
+ var [major1, minor1, patch1] = version.split(".");
12120
+ return [
12121
+ +major1,
12122
+ +minor1,
12123
+ +patch1
12124
+ ];
12125
+ }
12126
+ function addNativeValidStyles() {
12127
+ var [major, minor] = getReactNativeVersion();
12128
+ if (major === 0 && minor >= 77) {
12129
+ var additional = {
12130
+ boxSizing: !0,
12131
+ mixBlendMode: !0,
12132
+ outlineWidth: !0,
12133
+ outlineStyle: !0,
12134
+ outlineSpread: !0,
12135
+ outlineColor: !0
12136
+ };
12137
+ Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
12138
+ }
12139
+ }
12140
+
12103
12141
  // src/createOptimizedView.native.tsx
12104
12142
  var import_react = __toESM(require("react"));
12105
12143
  function createOptimizedView(children, viewProps, baseViews2) {
@@ -12317,7 +12355,11 @@ var getRect = function(node) {
12317
12355
  };
12318
12356
 
12319
12357
  // src/hooks/useElementLayout.tsx
12320
- 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;
12358
+ var import_constants = __toESM(require_index_native2()), import_web = __toESM(require_index_native8()), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), status = "active";
12359
+ function setOnLayoutStrategy(state) {
12360
+ status = state;
12361
+ }
12362
+ var NodeRectCache = /* @__PURE__ */ new WeakMap(), ParentRectCache = /* @__PURE__ */ new WeakMap(), rAF = typeof window < "u" ? window.requestAnimationFrame : void 0;
12321
12363
  if (import_constants.isClient)
12322
12364
  if (rAF) {
12323
12365
  let updateLayoutIfChanged = function(node) {
@@ -12334,7 +12376,7 @@ if (import_constants.isClient)
12334
12376
  }
12335
12377
  }
12336
12378
  }, layoutOnAnimationFrame = function() {
12337
- Nodes.forEach(updateLayoutIfChanged), rAF(layoutOnAnimationFrame);
12379
+ status !== "inactive" && Nodes.forEach(updateLayoutIfChanged), rAF(layoutOnAnimationFrame);
12338
12380
  };
12339
12381
  updateLayoutIfChanged2 = updateLayoutIfChanged, layoutOnAnimationFrame2 = layoutOnAnimationFrame, avoidUpdates = !0, queuedUpdates = /* @__PURE__ */ new Map(), (0, import_web.___onDidFinishClientRender)(function() {
12340
12382
  avoidUpdates = !1, queuedUpdates && (queuedUpdates.forEach(function(cb) {
@@ -12387,43 +12429,6 @@ var avoidUpdates, queuedUpdates, updateLayoutIfChanged2, layoutOnAnimationFrame2
12387
12429
  // src/vendor/Pressability.native.tsx
12388
12430
  var Pressability = require_fake_react_native().default, usePressability = (init_idFn(), __toCommonJS(idFn_exports)).default;
12389
12431
 
12390
- // src/addNativeValidStyles.native.ts
12391
- var import_helpers = __toESM(require_index_native3());
12392
- function getReactNativeVersion() {
12393
- var version = process.env.REACT_NATIVE_VERSION || "";
12394
- if (!process.env.REACT_NATIVE_VERSION)
12395
- try {
12396
- var ReactNativeOfficalVersion = require("react-native/Libraries/Core/ReactNativeVersion");
12397
- if (ReactNativeOfficalVersion) {
12398
- var { version: { major, minor, patch } } = ReactNativeOfficalVersion;
12399
- version = `${major}.${minor}.${patch}`;
12400
- }
12401
- } catch {
12402
- } finally {
12403
- version || (version = "0.77");
12404
- }
12405
- var [major1, minor1, patch1] = version.split(".");
12406
- return [
12407
- +major1,
12408
- +minor1,
12409
- +patch1
12410
- ];
12411
- }
12412
- function addNativeValidStyles() {
12413
- var [major, minor] = getReactNativeVersion();
12414
- if (major === 0 && minor >= 77) {
12415
- var additional = {
12416
- boxSizing: !0,
12417
- mixBlendMode: !0,
12418
- outlineWidth: !0,
12419
- outlineStyle: !0,
12420
- outlineSpread: !0,
12421
- outlineColor: !0
12422
- };
12423
- Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
12424
- }
12425
- }
12426
-
12427
12432
  // src/index.tsx
12428
12433
  __reExport(index_exports, __toESM(require_index_native8()), module.exports);
12429
12434
  addNativeValidStyles();
@@ -12492,6 +12497,7 @@ var dontComposePressabilityKeys = {
12492
12497
  Text,
12493
12498
  View,
12494
12499
  createTamagui,
12495
- getElementLayoutEvent
12500
+ getElementLayoutEvent,
12501
+ setOnLayoutStrategy
12496
12502
  });
12497
12503
  //# sourceMappingURL=native.js.map