@tamagui/use-element-layout 3.0.0-beta.922.1 → 3.0.0

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.
@@ -40,10 +40,6 @@ module.exports = __toCommonJS(index_exports);
40
40
  var import_jsx_runtime = require("react/jsx-runtime");
41
41
  var import_constants = require("@tamagui/constants");
42
42
  var import_react = require("react");
43
- function _instanceof(left, right) {
44
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);
45
- else return left instanceof right;
46
- }
47
43
  var LayoutHandlers = /* @__PURE__ */ new WeakMap();
48
44
  var LayoutDisableKey = /* @__PURE__ */ new WeakMap();
49
45
  var Nodes = /* @__PURE__ */ new Set();
@@ -151,7 +147,7 @@ if (ENABLE) {
151
147
  for (var _iterator = Nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
152
148
  var node = _step.value;
153
149
  var parentElement = node.parentElement;
154
- if (!_instanceof(parentElement, HTMLElement)) {
150
+ if (!(parentElement instanceof HTMLElement)) {
155
151
  cleanupNode(node);
156
152
  continue;
157
153
  }
@@ -337,7 +333,7 @@ function useElementLayout(ref, onLayout) {
337
333
  }
338
334
  function ensureWebElement(x) {
339
335
  if (typeof HTMLElement === "undefined") return void 0;
340
- return _instanceof(x, HTMLElement) ? x : void 0;
336
+ return x instanceof HTMLElement ? x : void 0;
341
337
  }
342
338
  var getBoundingClientRectAsync = function(node) {
343
339
  return new Promise(function(res) {
@@ -351,7 +347,7 @@ var getBoundingClientRectAsync = function(node) {
351
347
  };
352
348
  var measureNode = async function(node, relativeTo) {
353
349
  var relativeNode = relativeTo || (node === null || node === void 0 ? void 0 : node.parentElement);
354
- if (_instanceof(relativeNode, HTMLElement)) {
350
+ if (relativeNode instanceof HTMLElement) {
355
351
  var [nodeDim, relativeNodeDim] = await Promise.all([getBoundingClientRectAsync(node), getBoundingClientRectAsync(relativeNode)]);
356
352
  if (relativeNodeDim && nodeDim) return getRelativeDimensions(nodeDim, relativeNodeDim, node);
357
353
  }
@@ -40,10 +40,6 @@ module.exports = __toCommonJS(index_exports);
40
40
  var import_jsx_runtime = require("react/jsx-runtime");
41
41
  var import_constants = require("@tamagui/constants");
42
42
  var import_react = require("react");
43
- function _instanceof(left, right) {
44
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);
45
- else return left instanceof right;
46
- }
47
43
  var LayoutHandlers = /* @__PURE__ */ new WeakMap();
48
44
  var LayoutDisableKey = /* @__PURE__ */ new WeakMap();
49
45
  var Nodes = /* @__PURE__ */ new Set();
@@ -151,7 +147,7 @@ if (ENABLE) {
151
147
  for (var _iterator = Nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
152
148
  var node = _step.value;
153
149
  var parentElement = node.parentElement;
154
- if (!_instanceof(parentElement, HTMLElement)) {
150
+ if (!(parentElement instanceof HTMLElement)) {
155
151
  cleanupNode(node);
156
152
  continue;
157
153
  }
@@ -337,7 +333,7 @@ function useElementLayout(ref, onLayout) {
337
333
  }
338
334
  function ensureWebElement(x) {
339
335
  if (typeof HTMLElement === "undefined") return void 0;
340
- return _instanceof(x, HTMLElement) ? x : void 0;
336
+ return x instanceof HTMLElement ? x : void 0;
341
337
  }
342
338
  var getBoundingClientRectAsync = function(node) {
343
339
  return new Promise(function(res) {
@@ -351,7 +347,7 @@ var getBoundingClientRectAsync = function(node) {
351
347
  };
352
348
  var measureNode = async function(node, relativeTo) {
353
349
  var relativeNode = relativeTo || (node === null || node === void 0 ? void 0 : node.parentElement);
354
- if (_instanceof(relativeNode, HTMLElement)) {
350
+ if (relativeNode instanceof HTMLElement) {
355
351
  var [nodeDim, relativeNodeDim] = await Promise.all([getBoundingClientRectAsync(node), getBoundingClientRectAsync(relativeNode)]);
356
352
  if (relativeNodeDim && nodeDim) return getRelativeDimensions(nodeDim, relativeNodeDim, node);
357
353
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n\tLayoutMeasurementController: () => LayoutMeasurementController,\n\tcreateMeasure: () => createMeasure,\n\tcreateMeasureInWindow: () => createMeasureInWindow,\n\tcreateMeasureLayout: () => createMeasureLayout,\n\tenable: () => enable,\n\tgetBoundingClientRectAsync: () => getBoundingClientRectAsync,\n\tgetElementLayoutEvent: () => getElementLayoutEvent,\n\tmeasure: () => measure,\n\tmeasureInWindow: () => measureInWindow,\n\tmeasureLayout: () => measureLayout,\n\tmeasureNode: () => measureNode,\n\tregisterLayoutNode: () => registerLayoutNode,\n\tuseElementLayout: () => useElementLayout\n});\nmodule.exports = __toCommonJS(index_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_react = require(\"react\");\nfunction _instanceof(left, right) {\n\tif (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);\n\telse return left instanceof right;\n}\nvar LayoutHandlers = /* @__PURE__ */ new WeakMap();\nvar LayoutDisableKey = /* @__PURE__ */ new WeakMap();\nvar Nodes = /* @__PURE__ */ new Set();\nvar NodeRectCache = /* @__PURE__ */ new WeakMap();\nvar PrevHostNode = /* @__PURE__ */ new WeakMap();\nvar usePretransformDimensions = function() {\n\treturn globalThis.__TAMAGUI_ONLAYOUT_PRETRANSFORM === true || process.env.TAMAGUI_ONLAYOUT_PRETRANSFORM === \"1\";\n};\nvar isDebugLayout = function() {\n\tvar _window_location_search, _window_location;\n\treturn typeof window !== \"undefined\" && ((_window_location = window.location) === null || _window_location === void 0 ? void 0 : (_window_location_search = _window_location.search) === null || _window_location_search === void 0 ? void 0 : _window_location_search.includes(\"__tamaDebugLayout\"));\n};\nvar DisableLayoutContextValues = {};\nvar DisableLayoutContextKey = /* @__PURE__ */ (0, import_react.createContext)(\"\");\nvar ENABLE = false;\nvar LayoutMeasurementController = function(param) {\n\tvar { disable, children } = param;\n\tvar id = (0, import_react.useId)();\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\n\t\tvar wasDisabled = DisableLayoutContextValues[id] === true;\n\t\tDisableLayoutContextValues[id] = disable;\n\t\tif (wasDisabled && !disable) measureOnNextFrame === null || measureOnNextFrame === void 0 || measureOnNextFrame();\n\t}, [disable, id]);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DisableLayoutContextKey.Provider, {\n\t\tvalue: id,\n\t\tchildren\n\t});\n};\nvar strategy = \"async\";\nvar resumeLayoutLoop;\nvar measureOnNextFrame;\nvar avoidUpdates = true;\nvar queuedUpdates = /* @__PURE__ */ new Map();\nfunction enable() {\n\tif (avoidUpdates) {\n\t\tavoidUpdates = false;\n\t\tif (queuedUpdates) {\n\t\t\tqueuedUpdates.forEach(function(cb) {\n\t\t\t\treturn cb();\n\t\t\t});\n\t\t\tqueuedUpdates.clear();\n\t\t}\n\t}\n}\nfunction rectsEqual(a, b) {\n\treturn a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\nif (ENABLE) {\n\tlet ensureRectFetchObserver2 = function() {\n\t\tif (rectFetchObserver) return rectFetchObserver;\n\t\trectFetchObserver = new IntersectionObserver(function(entries) {\n\t\t\tlastCallbackDelay = Math.round(performance.now() - rectFetchStartTime);\n\t\t\tfor (var i = 0; i < entries.length; i++) BoundingRects.set(entries[i].target, entries[i].boundingClientRect);\n\t\t\tif (process.env.NODE_ENV === \"development\" && isDebugLayout() && lastCallbackDelay > 50) console.warn(\"[onLayout-io-delay]\", lastCallbackDelay + \"ms\", entries.length, \"entries\");\n\t\t\tif (rectFetchResolve) {\n\t\t\t\trectFetchResolve(true);\n\t\t\t\trectFetchResolve = null;\n\t\t\t}\n\t\t}, { threshold: 0 });\n\t\treturn rectFetchObserver;\n\t}, updateLayoutIfChanged2 = function(node) {\n\t\tif (typeof LayoutHandlers.get(node) !== \"function\") return;\n\t\tvar parentNode = node.parentElement;\n\t\tif (!parentNode) return;\n\t\tvar nodeRect;\n\t\tvar parentRect;\n\t\tif (strategy === \"async\") {\n\t\t\tnodeRect = BoundingRects.get(node);\n\t\t\tparentRect = BoundingRects.get(parentNode);\n\t\t\tif (!nodeRect || !parentRect) return;\n\t\t} else {\n\t\t\tnodeRect = node.getBoundingClientRect();\n\t\t\tparentRect = parentNode.getBoundingClientRect();\n\t\t}\n\t\temitLayoutIfChanged(node, parentNode, nodeRect, parentRect);\n\t}, scheduleLayoutFrame2 = function() {\n\t\tif (frameScheduled || strategy === \"off\" || Nodes.size === 0 || document.hidden) return;\n\t\tframeScheduled = true;\n\t\trAF ? rAF(layoutOnAnimationFrame) : setTimeout(layoutOnAnimationFrame, 16);\n\t};\n\tvar BoundingRects = /* @__PURE__ */ new WeakMap();\n\tvar rectFetchObserver = null;\n\tvar rectFetchResolve = null;\n\tvar rectFetchStartTime = 0;\n\tvar lastCallbackDelay = 0;\n\tvar rAF = typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : void 0;\n\tvar userSkipVal = process.env.TAMAGUI_LAYOUT_FRAME_SKIP;\n\tvar BASE_SKIP_FRAMES = userSkipVal ? +userSkipVal : 10;\n\tvar MAX_SKIP_FRAMES = 20;\n\tvar skipFrames = BASE_SKIP_FRAMES;\n\tvar frameCount = 0;\n\tvar frameScheduled = false;\n\tasync function layoutOnAnimationFrame() {\n\t\tif (frameCount++ % skipFrames !== 0) {\n\t\t\tframeScheduled = false;\n\t\t\tscheduleLayoutFrame2();\n\t\t\treturn;\n\t\t}\n\t\tif (frameCount >= Number.MAX_SAFE_INTEGER) frameCount = 0;\n\t\tif (strategy !== \"off\") {\n\t\t\tvar activeNodes = [];\n\t\t\tvar parentsToObserve = /* @__PURE__ */ new Set();\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = Nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar node = _step.value;\n\t\t\t\t\tvar parentElement = node.parentElement;\n\t\t\t\t\tif (!_instanceof(parentElement, HTMLElement)) {\n\t\t\t\t\t\tcleanupNode(node);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar disableKey = LayoutDisableKey.get(node);\n\t\t\t\t\tif (disableKey && DisableLayoutContextValues[disableKey] === true) continue;\n\t\t\t\t\tactiveNodes.push(node);\n\t\t\t\t\tparentsToObserve.add(parentElement);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (activeNodes.length > 0) {\n\t\t\t\tvar io = ensureRectFetchObserver2();\n\t\t\t\trectFetchStartTime = performance.now();\n\t\t\t\tfor (var i = 0; i < activeNodes.length; i++) io.observe(activeNodes[i]);\n\t\t\t\tvar _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator1 = parentsToObserve[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n\t\t\t\t\t\tvar parent = _step1.value;\n\t\t\t\t\t\tio.observe(parent);\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError1 = true;\n\t\t\t\t\t_iteratorError1 = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError1) throw _iteratorError1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tawait new Promise(function(res) {\n\t\t\t\t\trectFetchResolve = res;\n\t\t\t\t});\n\t\t\t\tfor (var i1 = 0; i1 < activeNodes.length; i1++) io.unobserve(activeNodes[i1]);\n\t\t\t\tvar _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator2 = parentsToObserve[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\t\t\tvar parent1 = _step2.value;\n\t\t\t\t\t\tio.unobserve(parent1);\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError2 = true;\n\t\t\t\t\t_iteratorError2 = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError2) throw _iteratorError2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (lastCallbackDelay > 50) skipFrames = Math.min(skipFrames + 2, MAX_SKIP_FRAMES);\n\t\t\t\telse if (lastCallbackDelay < 20) skipFrames = Math.max(skipFrames - 1, BASE_SKIP_FRAMES);\n\t\t\t\tfor (var i2 = 0; i2 < activeNodes.length; i2++) updateLayoutIfChanged2(activeNodes[i2]);\n\t\t\t}\n\t\t}\n\t\tframeScheduled = false;\n\t\tscheduleLayoutFrame2();\n\t}\n\tresumeLayoutLoop = scheduleLayoutFrame2;\n\tmeasureOnNextFrame = function() {\n\t\tframeCount = 0;\n\t\tscheduleLayoutFrame2();\n\t};\n\tdocument.addEventListener(\"visibilitychange\", scheduleLayoutFrame2);\n\tscheduleLayoutFrame2();\n}\nvar getElementLayoutEvent = function(nodeRect, parentRect, node) {\n\treturn {\n\t\tnativeEvent: {\n\t\t\tlayout: getRelativeDimensions(nodeRect, parentRect, node),\n\t\t\ttarget: nodeRect\n\t\t},\n\t\ttimeStamp: Date.now()\n\t};\n};\nvar getPreTransformDimensions = function(node) {\n\treturn {\n\t\twidth: node.offsetWidth,\n\t\theight: node.offsetHeight\n\t};\n};\nvar getRelativeDimensions = function(a, b, aNode) {\n\tvar left = a.left - b.left;\n\tvar top = a.top - b.top;\n\tvar { width, height } = usePretransformDimensions() && aNode ? getPreTransformDimensions(aNode) : {\n\t\twidth: a.width,\n\t\theight: a.height\n\t};\n\treturn {\n\t\tx: left,\n\t\ty: top,\n\t\twidth,\n\t\theight,\n\t\tpageX: a.left,\n\t\tpageY: a.top\n\t};\n};\nfunction emitLayoutIfChanged(node, parentNode, nodeRect, parentRect) {\n\tvar onLayout = LayoutHandlers.get(node);\n\tif (typeof onLayout !== \"function\") return;\n\tvar cachedRect = NodeRectCache.get(node);\n\tvar cachedParentRect = NodeRectCache.get(parentNode);\n\tvar nodeChanged = !cachedRect || !rectsEqual(cachedRect, nodeRect);\n\tvar parentChanged = !cachedParentRect || !rectsEqual(cachedParentRect, parentRect);\n\tif (!nodeChanged && !parentChanged) return;\n\tNodeRectCache.set(node, nodeRect);\n\tNodeRectCache.set(parentNode, parentRect);\n\tvar event = getElementLayoutEvent(nodeRect, parentRect, node);\n\tif (avoidUpdates) queuedUpdates.set(node, function() {\n\t\treturn onLayout(event);\n\t});\n\telse onLayout(event);\n}\nfunction observeLayoutNode(node, disableKey) {\n\tNodes.add(node);\n\tif (disableKey) LayoutDisableKey.set(node, disableKey);\n\telse LayoutDisableKey.delete(node);\n\tresumeLayoutLoop === null || resumeLayoutLoop === void 0 || resumeLayoutLoop();\n}\nfunction registerLayoutNode(node, onChange, disableKey) {\n\tLayoutHandlers.set(node, onChange);\n\tobserveLayoutNode(node, disableKey);\n\treturn function() {\n\t\treturn cleanupNode(node);\n\t};\n}\nfunction cleanupNode(node) {\n\tNodes.delete(node);\n\tLayoutHandlers.delete(node);\n\tLayoutDisableKey.delete(node);\n\tNodeRectCache.delete(node);\n}\nfunction emitLayoutSync(node) {\n\tvar onLayout = LayoutHandlers.get(node);\n\tif (typeof onLayout !== \"function\") return;\n\tvar parentNode = node.parentElement;\n\tif (!parentNode) return;\n\tvar nodeRect = node.getBoundingClientRect();\n\tvar parentRect = parentNode.getBoundingClientRect();\n\tNodeRectCache.set(node, nodeRect);\n\tNodeRectCache.set(parentNode, parentRect);\n\tonLayout(getElementLayoutEvent(nodeRect, parentRect, node));\n}\nfunction useElementLayout(ref, onLayout) {\n\tvar _ref_current;\n\tvar disableKey = (0, import_react.useContext)(DisableLayoutContextKey);\n\tvar node = ensureWebElement((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.host);\n\tif (node && onLayout) {\n\t\tLayoutHandlers.set(node, onLayout);\n\t\tLayoutDisableKey.set(node, disableKey);\n\t}\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\n\t\tvar _ref_current2;\n\t\tif (!onLayout) return;\n\t\tvar nextNode = ensureWebElement((_ref_current2 = ref.current) === null || _ref_current2 === void 0 ? void 0 : _ref_current2.host);\n\t\tvar prevNode = PrevHostNode.get(ref);\n\t\tif (nextNode !== prevNode) {\n\t\t\tif (prevNode) cleanupNode(prevNode);\n\t\t\tPrevHostNode.set(ref, nextNode);\n\t\t\tif (nextNode) {\n\t\t\t\tLayoutHandlers.set(nextNode, onLayout);\n\t\t\t\tobserveLayoutNode(nextNode, disableKey);\n\t\t\t\temitLayoutSync(nextNode);\n\t\t\t}\n\t\t}\n\t\treturn function() {\n\t\t\tvar _ref_current3;\n\t\t\tvar activeNode = ensureWebElement((_ref_current3 = ref.current) === null || _ref_current3 === void 0 ? void 0 : _ref_current3.host);\n\t\t\tif (activeNode) cleanupNode(activeNode);\n\t\t\tvar swapped = PrevHostNode.get(ref);\n\t\t\tif (swapped && swapped !== activeNode) cleanupNode(swapped);\n\t\t\tPrevHostNode.delete(ref);\n\t\t};\n\t}, [ref, !!onLayout]);\n}\nfunction ensureWebElement(x) {\n\tif (typeof HTMLElement === \"undefined\") return void 0;\n\treturn _instanceof(x, HTMLElement) ? x : void 0;\n}\nvar getBoundingClientRectAsync = function(node) {\n\treturn new Promise(function(res) {\n\t\tif (!node || node.nodeType !== 1) return res(false);\n\t\tvar io = new IntersectionObserver(function(entries) {\n\t\t\tio.disconnect();\n\t\t\tres(entries[0].boundingClientRect);\n\t\t});\n\t\tio.observe(node);\n\t});\n};\nvar measureNode = async function(node, relativeTo) {\n\tvar relativeNode = relativeTo || (node === null || node === void 0 ? void 0 : node.parentElement);\n\tif (_instanceof(relativeNode, HTMLElement)) {\n\t\tvar [nodeDim, relativeNodeDim] = await Promise.all([getBoundingClientRectAsync(node), getBoundingClientRectAsync(relativeNode)]);\n\t\tif (relativeNodeDim && nodeDim) return getRelativeDimensions(nodeDim, relativeNodeDim, node);\n\t}\n\treturn null;\n};\nvar measure = async function(node, callback) {\n\tvar out = await measureNode(node, node.parentElement);\n\tif (out) callback === null || callback === void 0 || callback(out.x, out.y, out.width, out.height, out.pageX, out.pageY);\n\treturn out;\n};\nvar createMeasure = function(node) {\n\treturn function(callback) {\n\t\treturn measure(node, callback);\n\t};\n};\nvar measureInWindow = async function(node, callback) {\n\tvar out = await measureNode(node, null);\n\tif (out) callback === null || callback === void 0 || callback(out.pageX, out.pageY, out.width, out.height);\n\treturn out;\n};\nvar createMeasureInWindow = function(node) {\n\treturn function(callback) {\n\t\treturn measureInWindow(node, callback);\n\t};\n};\nvar measureLayout = async function(node, relativeNode, callback) {\n\tvar out = await measureNode(node, relativeNode);\n\tif (out) callback === null || callback === void 0 || callback(out.x, out.y, out.width, out.height, out.pageX, out.pageY);\n\treturn out;\n};\nvar createMeasureLayout = function(node) {\n\treturn function(relativeTo, callback) {\n\t\treturn measureLayout(node, relativeTo, callback);\n\t};\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;AACR;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,SAAS,eAAe;CACvB,mCAAmC;CACnC,qBAAqB;CACrB,6BAA6B;CAC7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CACtC;AACD;AACA,IAAI,gBAAgB,eAAe,MAAM,cAAc,UAAU;CAChE,IAAI,MAAM,MAAM,YAAY,MAAM,YAAY;CAC9C,IAAI,KAAK,aAAa,QAAQ,aAAa,KAAK,KAAK,SAAS,IAAI,GAAG,IAAI,GAAG,IAAI,OAAO,IAAI,QAAQ,IAAI,OAAO,IAAI,KAAK;CACvH,OAAO;AACR;AACA,IAAI,sBAAsB,SAAS,MAAM;CACxC,OAAO,SAAS,YAAY,UAAU;EACrC,OAAO,cAAc,MAAM,YAAY,QAAQ;CAChD;AACD"}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n\tLayoutMeasurementController: () => LayoutMeasurementController,\n\tcreateMeasure: () => createMeasure,\n\tcreateMeasureInWindow: () => createMeasureInWindow,\n\tcreateMeasureLayout: () => createMeasureLayout,\n\tenable: () => enable,\n\tgetBoundingClientRectAsync: () => getBoundingClientRectAsync,\n\tgetElementLayoutEvent: () => getElementLayoutEvent,\n\tmeasure: () => measure,\n\tmeasureInWindow: () => measureInWindow,\n\tmeasureLayout: () => measureLayout,\n\tmeasureNode: () => measureNode,\n\tregisterLayoutNode: () => registerLayoutNode,\n\tuseElementLayout: () => useElementLayout\n});\nmodule.exports = __toCommonJS(index_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_react = require(\"react\");\nvar LayoutHandlers = /* @__PURE__ */ new WeakMap();\nvar LayoutDisableKey = /* @__PURE__ */ new WeakMap();\nvar Nodes = /* @__PURE__ */ new Set();\nvar NodeRectCache = /* @__PURE__ */ new WeakMap();\nvar PrevHostNode = /* @__PURE__ */ new WeakMap();\nvar usePretransformDimensions = function() {\n\treturn globalThis.__TAMAGUI_ONLAYOUT_PRETRANSFORM === true || process.env.TAMAGUI_ONLAYOUT_PRETRANSFORM === \"1\";\n};\nvar isDebugLayout = function() {\n\tvar _window_location_search, _window_location;\n\treturn typeof window !== \"undefined\" && ((_window_location = window.location) === null || _window_location === void 0 ? void 0 : (_window_location_search = _window_location.search) === null || _window_location_search === void 0 ? void 0 : _window_location_search.includes(\"__tamaDebugLayout\"));\n};\nvar DisableLayoutContextValues = {};\nvar DisableLayoutContextKey = /* @__PURE__ */ (0, import_react.createContext)(\"\");\nvar ENABLE = false;\nvar LayoutMeasurementController = function(param) {\n\tvar { disable, children } = param;\n\tvar id = (0, import_react.useId)();\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\n\t\tvar wasDisabled = DisableLayoutContextValues[id] === true;\n\t\tDisableLayoutContextValues[id] = disable;\n\t\tif (wasDisabled && !disable) measureOnNextFrame === null || measureOnNextFrame === void 0 || measureOnNextFrame();\n\t}, [disable, id]);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DisableLayoutContextKey.Provider, {\n\t\tvalue: id,\n\t\tchildren\n\t});\n};\nvar strategy = \"async\";\nvar resumeLayoutLoop;\nvar measureOnNextFrame;\nvar avoidUpdates = true;\nvar queuedUpdates = /* @__PURE__ */ new Map();\nfunction enable() {\n\tif (avoidUpdates) {\n\t\tavoidUpdates = false;\n\t\tif (queuedUpdates) {\n\t\t\tqueuedUpdates.forEach(function(cb) {\n\t\t\t\treturn cb();\n\t\t\t});\n\t\t\tqueuedUpdates.clear();\n\t\t}\n\t}\n}\nfunction rectsEqual(a, b) {\n\treturn a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\nif (ENABLE) {\n\tlet ensureRectFetchObserver2 = function() {\n\t\tif (rectFetchObserver) return rectFetchObserver;\n\t\trectFetchObserver = new IntersectionObserver(function(entries) {\n\t\t\tlastCallbackDelay = Math.round(performance.now() - rectFetchStartTime);\n\t\t\tfor (var i = 0; i < entries.length; i++) BoundingRects.set(entries[i].target, entries[i].boundingClientRect);\n\t\t\tif (process.env.NODE_ENV === \"development\" && isDebugLayout() && lastCallbackDelay > 50) console.warn(\"[onLayout-io-delay]\", lastCallbackDelay + \"ms\", entries.length, \"entries\");\n\t\t\tif (rectFetchResolve) {\n\t\t\t\trectFetchResolve(true);\n\t\t\t\trectFetchResolve = null;\n\t\t\t}\n\t\t}, { threshold: 0 });\n\t\treturn rectFetchObserver;\n\t}, updateLayoutIfChanged2 = function(node) {\n\t\tif (typeof LayoutHandlers.get(node) !== \"function\") return;\n\t\tvar parentNode = node.parentElement;\n\t\tif (!parentNode) return;\n\t\tvar nodeRect;\n\t\tvar parentRect;\n\t\tif (strategy === \"async\") {\n\t\t\tnodeRect = BoundingRects.get(node);\n\t\t\tparentRect = BoundingRects.get(parentNode);\n\t\t\tif (!nodeRect || !parentRect) return;\n\t\t} else {\n\t\t\tnodeRect = node.getBoundingClientRect();\n\t\t\tparentRect = parentNode.getBoundingClientRect();\n\t\t}\n\t\temitLayoutIfChanged(node, parentNode, nodeRect, parentRect);\n\t}, scheduleLayoutFrame2 = function() {\n\t\tif (frameScheduled || strategy === \"off\" || Nodes.size === 0 || document.hidden) return;\n\t\tframeScheduled = true;\n\t\trAF ? rAF(layoutOnAnimationFrame) : setTimeout(layoutOnAnimationFrame, 16);\n\t};\n\tvar BoundingRects = /* @__PURE__ */ new WeakMap();\n\tvar rectFetchObserver = null;\n\tvar rectFetchResolve = null;\n\tvar rectFetchStartTime = 0;\n\tvar lastCallbackDelay = 0;\n\tvar rAF = typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : void 0;\n\tvar userSkipVal = process.env.TAMAGUI_LAYOUT_FRAME_SKIP;\n\tvar BASE_SKIP_FRAMES = userSkipVal ? +userSkipVal : 10;\n\tvar MAX_SKIP_FRAMES = 20;\n\tvar skipFrames = BASE_SKIP_FRAMES;\n\tvar frameCount = 0;\n\tvar frameScheduled = false;\n\tasync function layoutOnAnimationFrame() {\n\t\tif (frameCount++ % skipFrames !== 0) {\n\t\t\tframeScheduled = false;\n\t\t\tscheduleLayoutFrame2();\n\t\t\treturn;\n\t\t}\n\t\tif (frameCount >= Number.MAX_SAFE_INTEGER) frameCount = 0;\n\t\tif (strategy !== \"off\") {\n\t\t\tvar activeNodes = [];\n\t\t\tvar parentsToObserve = /* @__PURE__ */ new Set();\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = Nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar node = _step.value;\n\t\t\t\t\tvar parentElement = node.parentElement;\n\t\t\t\t\tif (!(parentElement instanceof HTMLElement)) {\n\t\t\t\t\t\tcleanupNode(node);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar disableKey = LayoutDisableKey.get(node);\n\t\t\t\t\tif (disableKey && DisableLayoutContextValues[disableKey] === true) continue;\n\t\t\t\t\tactiveNodes.push(node);\n\t\t\t\t\tparentsToObserve.add(parentElement);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (activeNodes.length > 0) {\n\t\t\t\tvar io = ensureRectFetchObserver2();\n\t\t\t\trectFetchStartTime = performance.now();\n\t\t\t\tfor (var i = 0; i < activeNodes.length; i++) io.observe(activeNodes[i]);\n\t\t\t\tvar _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator1 = parentsToObserve[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n\t\t\t\t\t\tvar parent = _step1.value;\n\t\t\t\t\t\tio.observe(parent);\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError1 = true;\n\t\t\t\t\t_iteratorError1 = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError1) throw _iteratorError1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tawait new Promise(function(res) {\n\t\t\t\t\trectFetchResolve = res;\n\t\t\t\t});\n\t\t\t\tfor (var i1 = 0; i1 < activeNodes.length; i1++) io.unobserve(activeNodes[i1]);\n\t\t\t\tvar _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator2 = parentsToObserve[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\t\t\tvar parent1 = _step2.value;\n\t\t\t\t\t\tio.unobserve(parent1);\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError2 = true;\n\t\t\t\t\t_iteratorError2 = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError2) throw _iteratorError2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (lastCallbackDelay > 50) skipFrames = Math.min(skipFrames + 2, MAX_SKIP_FRAMES);\n\t\t\t\telse if (lastCallbackDelay < 20) skipFrames = Math.max(skipFrames - 1, BASE_SKIP_FRAMES);\n\t\t\t\tfor (var i2 = 0; i2 < activeNodes.length; i2++) updateLayoutIfChanged2(activeNodes[i2]);\n\t\t\t}\n\t\t}\n\t\tframeScheduled = false;\n\t\tscheduleLayoutFrame2();\n\t}\n\tresumeLayoutLoop = scheduleLayoutFrame2;\n\tmeasureOnNextFrame = function() {\n\t\tframeCount = 0;\n\t\tscheduleLayoutFrame2();\n\t};\n\tdocument.addEventListener(\"visibilitychange\", scheduleLayoutFrame2);\n\tscheduleLayoutFrame2();\n}\nvar getElementLayoutEvent = function(nodeRect, parentRect, node) {\n\treturn {\n\t\tnativeEvent: {\n\t\t\tlayout: getRelativeDimensions(nodeRect, parentRect, node),\n\t\t\ttarget: nodeRect\n\t\t},\n\t\ttimeStamp: Date.now()\n\t};\n};\nvar getPreTransformDimensions = function(node) {\n\treturn {\n\t\twidth: node.offsetWidth,\n\t\theight: node.offsetHeight\n\t};\n};\nvar getRelativeDimensions = function(a, b, aNode) {\n\tvar left = a.left - b.left;\n\tvar top = a.top - b.top;\n\tvar { width, height } = usePretransformDimensions() && aNode ? getPreTransformDimensions(aNode) : {\n\t\twidth: a.width,\n\t\theight: a.height\n\t};\n\treturn {\n\t\tx: left,\n\t\ty: top,\n\t\twidth,\n\t\theight,\n\t\tpageX: a.left,\n\t\tpageY: a.top\n\t};\n};\nfunction emitLayoutIfChanged(node, parentNode, nodeRect, parentRect) {\n\tvar onLayout = LayoutHandlers.get(node);\n\tif (typeof onLayout !== \"function\") return;\n\tvar cachedRect = NodeRectCache.get(node);\n\tvar cachedParentRect = NodeRectCache.get(parentNode);\n\tvar nodeChanged = !cachedRect || !rectsEqual(cachedRect, nodeRect);\n\tvar parentChanged = !cachedParentRect || !rectsEqual(cachedParentRect, parentRect);\n\tif (!nodeChanged && !parentChanged) return;\n\tNodeRectCache.set(node, nodeRect);\n\tNodeRectCache.set(parentNode, parentRect);\n\tvar event = getElementLayoutEvent(nodeRect, parentRect, node);\n\tif (avoidUpdates) queuedUpdates.set(node, function() {\n\t\treturn onLayout(event);\n\t});\n\telse onLayout(event);\n}\nfunction observeLayoutNode(node, disableKey) {\n\tNodes.add(node);\n\tif (disableKey) LayoutDisableKey.set(node, disableKey);\n\telse LayoutDisableKey.delete(node);\n\tresumeLayoutLoop === null || resumeLayoutLoop === void 0 || resumeLayoutLoop();\n}\nfunction registerLayoutNode(node, onChange, disableKey) {\n\tLayoutHandlers.set(node, onChange);\n\tobserveLayoutNode(node, disableKey);\n\treturn function() {\n\t\treturn cleanupNode(node);\n\t};\n}\nfunction cleanupNode(node) {\n\tNodes.delete(node);\n\tLayoutHandlers.delete(node);\n\tLayoutDisableKey.delete(node);\n\tNodeRectCache.delete(node);\n}\nfunction emitLayoutSync(node) {\n\tvar onLayout = LayoutHandlers.get(node);\n\tif (typeof onLayout !== \"function\") return;\n\tvar parentNode = node.parentElement;\n\tif (!parentNode) return;\n\tvar nodeRect = node.getBoundingClientRect();\n\tvar parentRect = parentNode.getBoundingClientRect();\n\tNodeRectCache.set(node, nodeRect);\n\tNodeRectCache.set(parentNode, parentRect);\n\tonLayout(getElementLayoutEvent(nodeRect, parentRect, node));\n}\nfunction useElementLayout(ref, onLayout) {\n\tvar _ref_current;\n\tvar disableKey = (0, import_react.useContext)(DisableLayoutContextKey);\n\tvar node = ensureWebElement((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.host);\n\tif (node && onLayout) {\n\t\tLayoutHandlers.set(node, onLayout);\n\t\tLayoutDisableKey.set(node, disableKey);\n\t}\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\n\t\tvar _ref_current2;\n\t\tif (!onLayout) return;\n\t\tvar nextNode = ensureWebElement((_ref_current2 = ref.current) === null || _ref_current2 === void 0 ? void 0 : _ref_current2.host);\n\t\tvar prevNode = PrevHostNode.get(ref);\n\t\tif (nextNode !== prevNode) {\n\t\t\tif (prevNode) cleanupNode(prevNode);\n\t\t\tPrevHostNode.set(ref, nextNode);\n\t\t\tif (nextNode) {\n\t\t\t\tLayoutHandlers.set(nextNode, onLayout);\n\t\t\t\tobserveLayoutNode(nextNode, disableKey);\n\t\t\t\temitLayoutSync(nextNode);\n\t\t\t}\n\t\t}\n\t\treturn function() {\n\t\t\tvar _ref_current3;\n\t\t\tvar activeNode = ensureWebElement((_ref_current3 = ref.current) === null || _ref_current3 === void 0 ? void 0 : _ref_current3.host);\n\t\t\tif (activeNode) cleanupNode(activeNode);\n\t\t\tvar swapped = PrevHostNode.get(ref);\n\t\t\tif (swapped && swapped !== activeNode) cleanupNode(swapped);\n\t\t\tPrevHostNode.delete(ref);\n\t\t};\n\t}, [ref, !!onLayout]);\n}\nfunction ensureWebElement(x) {\n\tif (typeof HTMLElement === \"undefined\") return void 0;\n\treturn x instanceof HTMLElement ? x : void 0;\n}\nvar getBoundingClientRectAsync = function(node) {\n\treturn new Promise(function(res) {\n\t\tif (!node || node.nodeType !== 1) return res(false);\n\t\tvar io = new IntersectionObserver(function(entries) {\n\t\t\tio.disconnect();\n\t\t\tres(entries[0].boundingClientRect);\n\t\t});\n\t\tio.observe(node);\n\t});\n};\nvar measureNode = async function(node, relativeTo) {\n\tvar relativeNode = relativeTo || (node === null || node === void 0 ? void 0 : node.parentElement);\n\tif (relativeNode instanceof HTMLElement) {\n\t\tvar [nodeDim, relativeNodeDim] = await Promise.all([getBoundingClientRectAsync(node), getBoundingClientRectAsync(relativeNode)]);\n\t\tif (relativeNodeDim && nodeDim) return getRelativeDimensions(nodeDim, relativeNodeDim, node);\n\t}\n\treturn null;\n};\nvar measure = async function(node, callback) {\n\tvar out = await measureNode(node, node.parentElement);\n\tif (out) callback === null || callback === void 0 || callback(out.x, out.y, out.width, out.height, out.pageX, out.pageY);\n\treturn out;\n};\nvar createMeasure = function(node) {\n\treturn function(callback) {\n\t\treturn measure(node, callback);\n\t};\n};\nvar measureInWindow = async function(node, callback) {\n\tvar out = await measureNode(node, null);\n\tif (out) callback === null || callback === void 0 || callback(out.pageX, out.pageY, out.width, out.height);\n\treturn out;\n};\nvar createMeasureInWindow = function(node) {\n\treturn function(callback) {\n\t\treturn measureInWindow(node, callback);\n\t};\n};\nvar measureLayout = async function(node, relativeNode, callback) {\n\tvar out = await measureNode(node, relativeNode);\n\tif (out) callback === null || callback === void 0 || callback(out.x, out.y, out.width, out.height, out.pageX, out.pageY);\n\treturn out;\n};\nvar createMeasureLayout = function(node) {\n\treturn function(relativeTo, callback) {\n\t\treturn measureLayout(node, relativeTo, callback);\n\t};\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;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D;AACA,IAAI,gBAAgB,eAAe,MAAM,cAAc,UAAU;CAChE,IAAI,MAAM,MAAM,YAAY,MAAM,YAAY;CAC9C,IAAI,KAAK,aAAa,QAAQ,aAAa,KAAK,KAAK,SAAS,IAAI,GAAG,IAAI,GAAG,IAAI,OAAO,IAAI,QAAQ,IAAI,OAAO,IAAI,KAAK;CACvH,OAAO;AACR;AACA,IAAI,sBAAsB,SAAS,MAAM;CACxC,OAAO,SAAS,YAAY,UAAU;EACrC,OAAO,cAAc,MAAM,YAAY,QAAQ;CAChD;AACD"}
@@ -2,10 +2,6 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useIsomorphicLayoutEffect } from "@tamagui/constants";
3
3
  import { createContext, useContext, useId } from "react";
4
4
 
5
- function _instanceof(left, right) {
6
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);
7
- else return left instanceof right;
8
- }
9
5
  var LayoutHandlers = /* @__PURE__ */ new WeakMap();
10
6
  var LayoutDisableKey = /* @__PURE__ */ new WeakMap();
11
7
  var Nodes = /* @__PURE__ */ new Set();
@@ -113,7 +109,7 @@ if (ENABLE) {
113
109
  for (var _iterator = Nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
114
110
  var node = _step.value;
115
111
  var parentElement = node.parentElement;
116
- if (!_instanceof(parentElement, HTMLElement)) {
112
+ if (!(parentElement instanceof HTMLElement)) {
117
113
  cleanupNode(node);
118
114
  continue;
119
115
  }
@@ -299,7 +295,7 @@ function useElementLayout(ref, onLayout) {
299
295
  }
300
296
  function ensureWebElement(x) {
301
297
  if (typeof HTMLElement === "undefined") return void 0;
302
- return _instanceof(x, HTMLElement) ? x : void 0;
298
+ return x instanceof HTMLElement ? x : void 0;
303
299
  }
304
300
  var getBoundingClientRectAsync = function(node) {
305
301
  return new Promise(function(res) {
@@ -313,7 +309,7 @@ var getBoundingClientRectAsync = function(node) {
313
309
  };
314
310
  var measureNode = async function(node, relativeTo) {
315
311
  var relativeNode = relativeTo || (node === null || node === void 0 ? void 0 : node.parentElement);
316
- if (_instanceof(relativeNode, HTMLElement)) {
312
+ if (relativeNode instanceof HTMLElement) {
317
313
  var [nodeDim, relativeNodeDim] = await Promise.all([getBoundingClientRectAsync(node), getBoundingClientRectAsync(relativeNode)]);
318
314
  if (relativeNodeDim && nodeDim) return getRelativeDimensions(nodeDim, relativeNodeDim, node);
319
315
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":[],"sources":["esm/index.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext, useContext, useId } from \"react\";\n\nfunction _instanceof(left, right) {\n\tif (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);\n\telse return left instanceof right;\n}\nvar LayoutHandlers = /* @__PURE__ */ new WeakMap();\nvar LayoutDisableKey = /* @__PURE__ */ new WeakMap();\nvar Nodes = /* @__PURE__ */ new Set();\nvar NodeRectCache = /* @__PURE__ */ new WeakMap();\nvar PrevHostNode = /* @__PURE__ */ new WeakMap();\nvar usePretransformDimensions = function() {\n\treturn globalThis.__TAMAGUI_ONLAYOUT_PRETRANSFORM === true || process.env.TAMAGUI_ONLAYOUT_PRETRANSFORM === \"1\";\n};\nvar isDebugLayout = function() {\n\tvar _window_location_search, _window_location;\n\treturn typeof window !== \"undefined\" && ((_window_location = window.location) === null || _window_location === void 0 ? void 0 : (_window_location_search = _window_location.search) === null || _window_location_search === void 0 ? void 0 : _window_location_search.includes(\"__tamaDebugLayout\"));\n};\nvar DisableLayoutContextValues = {};\nvar DisableLayoutContextKey = /* @__PURE__ */ createContext(\"\");\nvar ENABLE = false;\nvar LayoutMeasurementController = function(param) {\n\tvar { disable, children } = param;\n\tvar id = useId();\n\tuseIsomorphicLayoutEffect(function() {\n\t\tvar wasDisabled = DisableLayoutContextValues[id] === true;\n\t\tDisableLayoutContextValues[id] = disable;\n\t\tif (wasDisabled && !disable) measureOnNextFrame === null || measureOnNextFrame === void 0 || measureOnNextFrame();\n\t}, [disable, id]);\n\treturn /* @__PURE__ */ jsx(DisableLayoutContextKey.Provider, {\n\t\tvalue: id,\n\t\tchildren\n\t});\n};\nvar strategy = \"async\";\nvar resumeLayoutLoop;\nvar measureOnNextFrame;\nvar avoidUpdates = true;\nvar queuedUpdates = /* @__PURE__ */ new Map();\nfunction enable() {\n\tif (avoidUpdates) {\n\t\tavoidUpdates = false;\n\t\tif (queuedUpdates) {\n\t\t\tqueuedUpdates.forEach(function(cb) {\n\t\t\t\treturn cb();\n\t\t\t});\n\t\t\tqueuedUpdates.clear();\n\t\t}\n\t}\n}\nfunction rectsEqual(a, b) {\n\treturn a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\nif (ENABLE) {\n\tlet ensureRectFetchObserver2 = function() {\n\t\tif (rectFetchObserver) return rectFetchObserver;\n\t\trectFetchObserver = new IntersectionObserver(function(entries) {\n\t\t\tlastCallbackDelay = Math.round(performance.now() - rectFetchStartTime);\n\t\t\tfor (var i = 0; i < entries.length; i++) BoundingRects.set(entries[i].target, entries[i].boundingClientRect);\n\t\t\tif (process.env.NODE_ENV === \"development\" && isDebugLayout() && lastCallbackDelay > 50) console.warn(\"[onLayout-io-delay]\", lastCallbackDelay + \"ms\", entries.length, \"entries\");\n\t\t\tif (rectFetchResolve) {\n\t\t\t\trectFetchResolve(true);\n\t\t\t\trectFetchResolve = null;\n\t\t\t}\n\t\t}, { threshold: 0 });\n\t\treturn rectFetchObserver;\n\t}, updateLayoutIfChanged2 = function(node) {\n\t\tif (typeof LayoutHandlers.get(node) !== \"function\") return;\n\t\tvar parentNode = node.parentElement;\n\t\tif (!parentNode) return;\n\t\tvar nodeRect;\n\t\tvar parentRect;\n\t\tif (strategy === \"async\") {\n\t\t\tnodeRect = BoundingRects.get(node);\n\t\t\tparentRect = BoundingRects.get(parentNode);\n\t\t\tif (!nodeRect || !parentRect) return;\n\t\t} else {\n\t\t\tnodeRect = node.getBoundingClientRect();\n\t\t\tparentRect = parentNode.getBoundingClientRect();\n\t\t}\n\t\temitLayoutIfChanged(node, parentNode, nodeRect, parentRect);\n\t}, scheduleLayoutFrame2 = function() {\n\t\tif (frameScheduled || strategy === \"off\" || Nodes.size === 0 || document.hidden) return;\n\t\tframeScheduled = true;\n\t\trAF ? rAF(layoutOnAnimationFrame) : setTimeout(layoutOnAnimationFrame, 16);\n\t};\n\tvar BoundingRects = /* @__PURE__ */ new WeakMap();\n\tvar rectFetchObserver = null;\n\tvar rectFetchResolve = null;\n\tvar rectFetchStartTime = 0;\n\tvar lastCallbackDelay = 0;\n\tvar rAF = typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : void 0;\n\tvar userSkipVal = process.env.TAMAGUI_LAYOUT_FRAME_SKIP;\n\tvar BASE_SKIP_FRAMES = userSkipVal ? +userSkipVal : 10;\n\tvar MAX_SKIP_FRAMES = 20;\n\tvar skipFrames = BASE_SKIP_FRAMES;\n\tvar frameCount = 0;\n\tvar frameScheduled = false;\n\tasync function layoutOnAnimationFrame() {\n\t\tif (frameCount++ % skipFrames !== 0) {\n\t\t\tframeScheduled = false;\n\t\t\tscheduleLayoutFrame2();\n\t\t\treturn;\n\t\t}\n\t\tif (frameCount >= Number.MAX_SAFE_INTEGER) frameCount = 0;\n\t\tif (strategy !== \"off\") {\n\t\t\tvar activeNodes = [];\n\t\t\tvar parentsToObserve = /* @__PURE__ */ new Set();\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = Nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar node = _step.value;\n\t\t\t\t\tvar parentElement = node.parentElement;\n\t\t\t\t\tif (!_instanceof(parentElement, HTMLElement)) {\n\t\t\t\t\t\tcleanupNode(node);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar disableKey = LayoutDisableKey.get(node);\n\t\t\t\t\tif (disableKey && DisableLayoutContextValues[disableKey] === true) continue;\n\t\t\t\t\tactiveNodes.push(node);\n\t\t\t\t\tparentsToObserve.add(parentElement);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (activeNodes.length > 0) {\n\t\t\t\tvar io = ensureRectFetchObserver2();\n\t\t\t\trectFetchStartTime = performance.now();\n\t\t\t\tfor (var i = 0; i < activeNodes.length; i++) io.observe(activeNodes[i]);\n\t\t\t\tvar _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator1 = parentsToObserve[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n\t\t\t\t\t\tvar parent = _step1.value;\n\t\t\t\t\t\tio.observe(parent);\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError1 = true;\n\t\t\t\t\t_iteratorError1 = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError1) throw _iteratorError1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tawait new Promise(function(res) {\n\t\t\t\t\trectFetchResolve = res;\n\t\t\t\t});\n\t\t\t\tfor (var i1 = 0; i1 < activeNodes.length; i1++) io.unobserve(activeNodes[i1]);\n\t\t\t\tvar _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator2 = parentsToObserve[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\t\t\tvar parent1 = _step2.value;\n\t\t\t\t\t\tio.unobserve(parent1);\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError2 = true;\n\t\t\t\t\t_iteratorError2 = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError2) throw _iteratorError2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (lastCallbackDelay > 50) skipFrames = Math.min(skipFrames + 2, MAX_SKIP_FRAMES);\n\t\t\t\telse if (lastCallbackDelay < 20) skipFrames = Math.max(skipFrames - 1, BASE_SKIP_FRAMES);\n\t\t\t\tfor (var i2 = 0; i2 < activeNodes.length; i2++) updateLayoutIfChanged2(activeNodes[i2]);\n\t\t\t}\n\t\t}\n\t\tframeScheduled = false;\n\t\tscheduleLayoutFrame2();\n\t}\n\tresumeLayoutLoop = scheduleLayoutFrame2;\n\tmeasureOnNextFrame = function() {\n\t\tframeCount = 0;\n\t\tscheduleLayoutFrame2();\n\t};\n\tdocument.addEventListener(\"visibilitychange\", scheduleLayoutFrame2);\n\tscheduleLayoutFrame2();\n}\nvar getElementLayoutEvent = function(nodeRect, parentRect, node) {\n\treturn {\n\t\tnativeEvent: {\n\t\t\tlayout: getRelativeDimensions(nodeRect, parentRect, node),\n\t\t\ttarget: nodeRect\n\t\t},\n\t\ttimeStamp: Date.now()\n\t};\n};\nvar getPreTransformDimensions = function(node) {\n\treturn {\n\t\twidth: node.offsetWidth,\n\t\theight: node.offsetHeight\n\t};\n};\nvar getRelativeDimensions = function(a, b, aNode) {\n\tvar left = a.left - b.left;\n\tvar top = a.top - b.top;\n\tvar { width, height } = usePretransformDimensions() && aNode ? getPreTransformDimensions(aNode) : {\n\t\twidth: a.width,\n\t\theight: a.height\n\t};\n\treturn {\n\t\tx: left,\n\t\ty: top,\n\t\twidth,\n\t\theight,\n\t\tpageX: a.left,\n\t\tpageY: a.top\n\t};\n};\nfunction emitLayoutIfChanged(node, parentNode, nodeRect, parentRect) {\n\tvar onLayout = LayoutHandlers.get(node);\n\tif (typeof onLayout !== \"function\") return;\n\tvar cachedRect = NodeRectCache.get(node);\n\tvar cachedParentRect = NodeRectCache.get(parentNode);\n\tvar nodeChanged = !cachedRect || !rectsEqual(cachedRect, nodeRect);\n\tvar parentChanged = !cachedParentRect || !rectsEqual(cachedParentRect, parentRect);\n\tif (!nodeChanged && !parentChanged) return;\n\tNodeRectCache.set(node, nodeRect);\n\tNodeRectCache.set(parentNode, parentRect);\n\tvar event = getElementLayoutEvent(nodeRect, parentRect, node);\n\tif (avoidUpdates) queuedUpdates.set(node, function() {\n\t\treturn onLayout(event);\n\t});\n\telse onLayout(event);\n}\nfunction observeLayoutNode(node, disableKey) {\n\tNodes.add(node);\n\tif (disableKey) LayoutDisableKey.set(node, disableKey);\n\telse LayoutDisableKey.delete(node);\n\tresumeLayoutLoop === null || resumeLayoutLoop === void 0 || resumeLayoutLoop();\n}\nfunction registerLayoutNode(node, onChange, disableKey) {\n\tLayoutHandlers.set(node, onChange);\n\tobserveLayoutNode(node, disableKey);\n\treturn function() {\n\t\treturn cleanupNode(node);\n\t};\n}\nfunction cleanupNode(node) {\n\tNodes.delete(node);\n\tLayoutHandlers.delete(node);\n\tLayoutDisableKey.delete(node);\n\tNodeRectCache.delete(node);\n}\nfunction emitLayoutSync(node) {\n\tvar onLayout = LayoutHandlers.get(node);\n\tif (typeof onLayout !== \"function\") return;\n\tvar parentNode = node.parentElement;\n\tif (!parentNode) return;\n\tvar nodeRect = node.getBoundingClientRect();\n\tvar parentRect = parentNode.getBoundingClientRect();\n\tNodeRectCache.set(node, nodeRect);\n\tNodeRectCache.set(parentNode, parentRect);\n\tonLayout(getElementLayoutEvent(nodeRect, parentRect, node));\n}\nfunction useElementLayout(ref, onLayout) {\n\tvar _ref_current;\n\tvar disableKey = useContext(DisableLayoutContextKey);\n\tvar node = ensureWebElement((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.host);\n\tif (node && onLayout) {\n\t\tLayoutHandlers.set(node, onLayout);\n\t\tLayoutDisableKey.set(node, disableKey);\n\t}\n\tuseIsomorphicLayoutEffect(function() {\n\t\tvar _ref_current2;\n\t\tif (!onLayout) return;\n\t\tvar nextNode = ensureWebElement((_ref_current2 = ref.current) === null || _ref_current2 === void 0 ? void 0 : _ref_current2.host);\n\t\tvar prevNode = PrevHostNode.get(ref);\n\t\tif (nextNode !== prevNode) {\n\t\t\tif (prevNode) cleanupNode(prevNode);\n\t\t\tPrevHostNode.set(ref, nextNode);\n\t\t\tif (nextNode) {\n\t\t\t\tLayoutHandlers.set(nextNode, onLayout);\n\t\t\t\tobserveLayoutNode(nextNode, disableKey);\n\t\t\t\temitLayoutSync(nextNode);\n\t\t\t}\n\t\t}\n\t\treturn function() {\n\t\t\tvar _ref_current3;\n\t\t\tvar activeNode = ensureWebElement((_ref_current3 = ref.current) === null || _ref_current3 === void 0 ? void 0 : _ref_current3.host);\n\t\t\tif (activeNode) cleanupNode(activeNode);\n\t\t\tvar swapped = PrevHostNode.get(ref);\n\t\t\tif (swapped && swapped !== activeNode) cleanupNode(swapped);\n\t\t\tPrevHostNode.delete(ref);\n\t\t};\n\t}, [ref, !!onLayout]);\n}\nfunction ensureWebElement(x) {\n\tif (typeof HTMLElement === \"undefined\") return void 0;\n\treturn _instanceof(x, HTMLElement) ? x : void 0;\n}\nvar getBoundingClientRectAsync = function(node) {\n\treturn new Promise(function(res) {\n\t\tif (!node || node.nodeType !== 1) return res(false);\n\t\tvar io = new IntersectionObserver(function(entries) {\n\t\t\tio.disconnect();\n\t\t\tres(entries[0].boundingClientRect);\n\t\t});\n\t\tio.observe(node);\n\t});\n};\nvar measureNode = async function(node, relativeTo) {\n\tvar relativeNode = relativeTo || (node === null || node === void 0 ? void 0 : node.parentElement);\n\tif (_instanceof(relativeNode, HTMLElement)) {\n\t\tvar [nodeDim, relativeNodeDim] = await Promise.all([getBoundingClientRectAsync(node), getBoundingClientRectAsync(relativeNode)]);\n\t\tif (relativeNodeDim && nodeDim) return getRelativeDimensions(nodeDim, relativeNodeDim, node);\n\t}\n\treturn null;\n};\nvar measure = async function(node, callback) {\n\tvar out = await measureNode(node, node.parentElement);\n\tif (out) callback === null || callback === void 0 || callback(out.x, out.y, out.width, out.height, out.pageX, out.pageY);\n\treturn out;\n};\nvar createMeasure = function(node) {\n\treturn function(callback) {\n\t\treturn measure(node, callback);\n\t};\n};\nvar measureInWindow = async function(node, callback) {\n\tvar out = await measureNode(node, null);\n\tif (out) callback === null || callback === void 0 || callback(out.pageX, out.pageY, out.width, out.height);\n\treturn out;\n};\nvar createMeasureInWindow = function(node) {\n\treturn function(callback) {\n\t\treturn measureInWindow(node, callback);\n\t};\n};\nvar measureLayout = async function(node, relativeNode, callback) {\n\tvar out = await measureNode(node, relativeNode);\n\tif (out) callback === null || callback === void 0 || callback(out.x, out.y, out.width, out.height, out.pageX, out.pageY);\n\treturn out;\n};\nvar createMeasureLayout = function(node) {\n\treturn function(relativeTo, callback) {\n\t\treturn measureLayout(node, relativeTo, callback);\n\t};\n};\n\nexport { LayoutMeasurementController, createMeasure, createMeasureInWindow, createMeasureLayout, enable, getBoundingClientRectAsync, getElementLayoutEvent, measure, measureInWindow, measureLayout, measureNode, registerLayoutNode, useElementLayout };"],"mappings":";;;;;AAIA,SAAS,YAAY,MAAM,OAAO;CACjC,IAAI,SAAS,QAAQ,OAAO,WAAW,eAAe,MAAM,OAAO,cAAc,OAAO,CAAC,CAAC,MAAM,OAA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AAmB,SAAS,OAAO,sBAAsB,SAAS,iBAAiB,IAAI;CAC5F;CACA,OAAO;AACR;AACA,IAAI,UAAU,eAAe,MAAM,UAAU;CAC5C,IAAI,MAAM,MAAM,YAAY,MAAM,KAAK,aAAa;CACpD,IAAI,KAAK,aAAa,QAAQ,aAAa,KAAK,KAAK,SAAS,IAAI,GAAG,IAAI,GAAG,IAAI,OAAO,IAAI,QAAQ,IAAI,OAAO,IAAI,KAAK;CACvH,OAAO;AACR;AACA,IAAI,gBAAgB,SAAS,MAAM;CAClC,OAAO,SAAS,UAAU;EACzB,OAAO,QAAQ,MAAM,QAAQ;CAC9B;AACD;AACA,IAAI,kBAAkB,eAAe,MAAM,UAAU;CACpD,IAAI,MAAM,MAAM,YAAY,MAAM,IAAI;CACtC,IAAI,KAAK,aAAa,QAAQ,aAAa,KAAK,KAAK,SAAS,IAAI,OAAO,IAAI,OAAO,IAAI,OAAO,IAAI,MAAM;CACzG,OAAO;AACR;AACA,IAAI,wBAAwB,SAAS,MAAM;CAC1C,OAAO,SAAS,UAAU;EACzB,OAAO,gBAAgB,MAAM,QAAQ;CACtC;AACD;AACA,IAAI,gBAAgB,eAAe,MAAM,cAAc,UAAU;CAChE,IAAI,MAAM,MAAM,YAAY,MAAM,YAAY;CAC9C,IAAI,KAAK,aAAa,QAAQ,aAAa,KAAK,KAAK,SAAS,IAAI,GAAG,IAAI,GAAG,IAAI,OAAO,IAAI,QAAQ,IAAI,OAAO,IAAI,KAAK;CACvH,OAAO;AACR;AACA,IAAI,sBAAsB,SAAS,MAAM;CACxC,OAAO,SAAS,YAAY,UAAU;EACrC,OAAO,cAAc,MAAM,YAAY,QAAQ;CAChD;AACD"}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["esm/index.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext, useContext, useId } from \"react\";\n\nvar LayoutHandlers = /* @__PURE__ */ new WeakMap();\nvar LayoutDisableKey = /* @__PURE__ */ new WeakMap();\nvar Nodes = /* @__PURE__ */ new Set();\nvar NodeRectCache = /* @__PURE__ */ new WeakMap();\nvar PrevHostNode = /* @__PURE__ */ new WeakMap();\nvar usePretransformDimensions = function() {\n\treturn globalThis.__TAMAGUI_ONLAYOUT_PRETRANSFORM === true || process.env.TAMAGUI_ONLAYOUT_PRETRANSFORM === \"1\";\n};\nvar isDebugLayout = function() {\n\tvar _window_location_search, _window_location;\n\treturn typeof window !== \"undefined\" && ((_window_location = window.location) === null || _window_location === void 0 ? void 0 : (_window_location_search = _window_location.search) === null || _window_location_search === void 0 ? void 0 : _window_location_search.includes(\"__tamaDebugLayout\"));\n};\nvar DisableLayoutContextValues = {};\nvar DisableLayoutContextKey = /* @__PURE__ */ createContext(\"\");\nvar ENABLE = false;\nvar LayoutMeasurementController = function(param) {\n\tvar { disable, children } = param;\n\tvar id = useId();\n\tuseIsomorphicLayoutEffect(function() {\n\t\tvar wasDisabled = DisableLayoutContextValues[id] === true;\n\t\tDisableLayoutContextValues[id] = disable;\n\t\tif (wasDisabled && !disable) measureOnNextFrame === null || measureOnNextFrame === void 0 || measureOnNextFrame();\n\t}, [disable, id]);\n\treturn /* @__PURE__ */ jsx(DisableLayoutContextKey.Provider, {\n\t\tvalue: id,\n\t\tchildren\n\t});\n};\nvar strategy = \"async\";\nvar resumeLayoutLoop;\nvar measureOnNextFrame;\nvar avoidUpdates = true;\nvar queuedUpdates = /* @__PURE__ */ new Map();\nfunction enable() {\n\tif (avoidUpdates) {\n\t\tavoidUpdates = false;\n\t\tif (queuedUpdates) {\n\t\t\tqueuedUpdates.forEach(function(cb) {\n\t\t\t\treturn cb();\n\t\t\t});\n\t\t\tqueuedUpdates.clear();\n\t\t}\n\t}\n}\nfunction rectsEqual(a, b) {\n\treturn a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\nif (ENABLE) {\n\tlet ensureRectFetchObserver2 = function() {\n\t\tif (rectFetchObserver) return rectFetchObserver;\n\t\trectFetchObserver = new IntersectionObserver(function(entries) {\n\t\t\tlastCallbackDelay = Math.round(performance.now() - rectFetchStartTime);\n\t\t\tfor (var i = 0; i < entries.length; i++) BoundingRects.set(entries[i].target, entries[i].boundingClientRect);\n\t\t\tif (process.env.NODE_ENV === \"development\" && isDebugLayout() && lastCallbackDelay > 50) console.warn(\"[onLayout-io-delay]\", lastCallbackDelay + \"ms\", entries.length, \"entries\");\n\t\t\tif (rectFetchResolve) {\n\t\t\t\trectFetchResolve(true);\n\t\t\t\trectFetchResolve = null;\n\t\t\t}\n\t\t}, { threshold: 0 });\n\t\treturn rectFetchObserver;\n\t}, updateLayoutIfChanged2 = function(node) {\n\t\tif (typeof LayoutHandlers.get(node) !== \"function\") return;\n\t\tvar parentNode = node.parentElement;\n\t\tif (!parentNode) return;\n\t\tvar nodeRect;\n\t\tvar parentRect;\n\t\tif (strategy === \"async\") {\n\t\t\tnodeRect = BoundingRects.get(node);\n\t\t\tparentRect = BoundingRects.get(parentNode);\n\t\t\tif (!nodeRect || !parentRect) return;\n\t\t} else {\n\t\t\tnodeRect = node.getBoundingClientRect();\n\t\t\tparentRect = parentNode.getBoundingClientRect();\n\t\t}\n\t\temitLayoutIfChanged(node, parentNode, nodeRect, parentRect);\n\t}, scheduleLayoutFrame2 = function() {\n\t\tif (frameScheduled || strategy === \"off\" || Nodes.size === 0 || document.hidden) return;\n\t\tframeScheduled = true;\n\t\trAF ? rAF(layoutOnAnimationFrame) : setTimeout(layoutOnAnimationFrame, 16);\n\t};\n\tvar BoundingRects = /* @__PURE__ */ new WeakMap();\n\tvar rectFetchObserver = null;\n\tvar rectFetchResolve = null;\n\tvar rectFetchStartTime = 0;\n\tvar lastCallbackDelay = 0;\n\tvar rAF = typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : void 0;\n\tvar userSkipVal = process.env.TAMAGUI_LAYOUT_FRAME_SKIP;\n\tvar BASE_SKIP_FRAMES = userSkipVal ? +userSkipVal : 10;\n\tvar MAX_SKIP_FRAMES = 20;\n\tvar skipFrames = BASE_SKIP_FRAMES;\n\tvar frameCount = 0;\n\tvar frameScheduled = false;\n\tasync function layoutOnAnimationFrame() {\n\t\tif (frameCount++ % skipFrames !== 0) {\n\t\t\tframeScheduled = false;\n\t\t\tscheduleLayoutFrame2();\n\t\t\treturn;\n\t\t}\n\t\tif (frameCount >= Number.MAX_SAFE_INTEGER) frameCount = 0;\n\t\tif (strategy !== \"off\") {\n\t\t\tvar activeNodes = [];\n\t\t\tvar parentsToObserve = /* @__PURE__ */ new Set();\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = Nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar node = _step.value;\n\t\t\t\t\tvar parentElement = node.parentElement;\n\t\t\t\t\tif (!(parentElement instanceof HTMLElement)) {\n\t\t\t\t\t\tcleanupNode(node);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar disableKey = LayoutDisableKey.get(node);\n\t\t\t\t\tif (disableKey && DisableLayoutContextValues[disableKey] === true) continue;\n\t\t\t\t\tactiveNodes.push(node);\n\t\t\t\t\tparentsToObserve.add(parentElement);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (activeNodes.length > 0) {\n\t\t\t\tvar io = ensureRectFetchObserver2();\n\t\t\t\trectFetchStartTime = performance.now();\n\t\t\t\tfor (var i = 0; i < activeNodes.length; i++) io.observe(activeNodes[i]);\n\t\t\t\tvar _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator1 = parentsToObserve[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n\t\t\t\t\t\tvar parent = _step1.value;\n\t\t\t\t\t\tio.observe(parent);\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError1 = true;\n\t\t\t\t\t_iteratorError1 = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError1) throw _iteratorError1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tawait new Promise(function(res) {\n\t\t\t\t\trectFetchResolve = res;\n\t\t\t\t});\n\t\t\t\tfor (var i1 = 0; i1 < activeNodes.length; i1++) io.unobserve(activeNodes[i1]);\n\t\t\t\tvar _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator2 = parentsToObserve[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\t\t\tvar parent1 = _step2.value;\n\t\t\t\t\t\tio.unobserve(parent1);\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError2 = true;\n\t\t\t\t\t_iteratorError2 = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError2) throw _iteratorError2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (lastCallbackDelay > 50) skipFrames = Math.min(skipFrames + 2, MAX_SKIP_FRAMES);\n\t\t\t\telse if (lastCallbackDelay < 20) skipFrames = Math.max(skipFrames - 1, BASE_SKIP_FRAMES);\n\t\t\t\tfor (var i2 = 0; i2 < activeNodes.length; i2++) updateLayoutIfChanged2(activeNodes[i2]);\n\t\t\t}\n\t\t}\n\t\tframeScheduled = false;\n\t\tscheduleLayoutFrame2();\n\t}\n\tresumeLayoutLoop = scheduleLayoutFrame2;\n\tmeasureOnNextFrame = function() {\n\t\tframeCount = 0;\n\t\tscheduleLayoutFrame2();\n\t};\n\tdocument.addEventListener(\"visibilitychange\", scheduleLayoutFrame2);\n\tscheduleLayoutFrame2();\n}\nvar getElementLayoutEvent = function(nodeRect, parentRect, node) {\n\treturn {\n\t\tnativeEvent: {\n\t\t\tlayout: getRelativeDimensions(nodeRect, parentRect, node),\n\t\t\ttarget: nodeRect\n\t\t},\n\t\ttimeStamp: Date.now()\n\t};\n};\nvar getPreTransformDimensions = function(node) {\n\treturn {\n\t\twidth: node.offsetWidth,\n\t\theight: node.offsetHeight\n\t};\n};\nvar getRelativeDimensions = function(a, b, aNode) {\n\tvar left = a.left - b.left;\n\tvar top = a.top - b.top;\n\tvar { width, height } = usePretransformDimensions() && aNode ? getPreTransformDimensions(aNode) : {\n\t\twidth: a.width,\n\t\theight: a.height\n\t};\n\treturn {\n\t\tx: left,\n\t\ty: top,\n\t\twidth,\n\t\theight,\n\t\tpageX: a.left,\n\t\tpageY: a.top\n\t};\n};\nfunction emitLayoutIfChanged(node, parentNode, nodeRect, parentRect) {\n\tvar onLayout = LayoutHandlers.get(node);\n\tif (typeof onLayout !== \"function\") return;\n\tvar cachedRect = NodeRectCache.get(node);\n\tvar cachedParentRect = NodeRectCache.get(parentNode);\n\tvar nodeChanged = !cachedRect || !rectsEqual(cachedRect, nodeRect);\n\tvar parentChanged = !cachedParentRect || !rectsEqual(cachedParentRect, parentRect);\n\tif (!nodeChanged && !parentChanged) return;\n\tNodeRectCache.set(node, nodeRect);\n\tNodeRectCache.set(parentNode, parentRect);\n\tvar event = getElementLayoutEvent(nodeRect, parentRect, node);\n\tif (avoidUpdates) queuedUpdates.set(node, function() {\n\t\treturn onLayout(event);\n\t});\n\telse onLayout(event);\n}\nfunction observeLayoutNode(node, disableKey) {\n\tNodes.add(node);\n\tif (disableKey) LayoutDisableKey.set(node, disableKey);\n\telse LayoutDisableKey.delete(node);\n\tresumeLayoutLoop === null || resumeLayoutLoop === void 0 || resumeLayoutLoop();\n}\nfunction registerLayoutNode(node, onChange, disableKey) {\n\tLayoutHandlers.set(node, onChange);\n\tobserveLayoutNode(node, disableKey);\n\treturn function() {\n\t\treturn cleanupNode(node);\n\t};\n}\nfunction cleanupNode(node) {\n\tNodes.delete(node);\n\tLayoutHandlers.delete(node);\n\tLayoutDisableKey.delete(node);\n\tNodeRectCache.delete(node);\n}\nfunction emitLayoutSync(node) {\n\tvar onLayout = LayoutHandlers.get(node);\n\tif (typeof onLayout !== \"function\") return;\n\tvar parentNode = node.parentElement;\n\tif (!parentNode) return;\n\tvar nodeRect = node.getBoundingClientRect();\n\tvar parentRect = parentNode.getBoundingClientRect();\n\tNodeRectCache.set(node, nodeRect);\n\tNodeRectCache.set(parentNode, parentRect);\n\tonLayout(getElementLayoutEvent(nodeRect, parentRect, node));\n}\nfunction useElementLayout(ref, onLayout) {\n\tvar _ref_current;\n\tvar disableKey = useContext(DisableLayoutContextKey);\n\tvar node = ensureWebElement((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.host);\n\tif (node && onLayout) {\n\t\tLayoutHandlers.set(node, onLayout);\n\t\tLayoutDisableKey.set(node, disableKey);\n\t}\n\tuseIsomorphicLayoutEffect(function() {\n\t\tvar _ref_current2;\n\t\tif (!onLayout) return;\n\t\tvar nextNode = ensureWebElement((_ref_current2 = ref.current) === null || _ref_current2 === void 0 ? void 0 : _ref_current2.host);\n\t\tvar prevNode = PrevHostNode.get(ref);\n\t\tif (nextNode !== prevNode) {\n\t\t\tif (prevNode) cleanupNode(prevNode);\n\t\t\tPrevHostNode.set(ref, nextNode);\n\t\t\tif (nextNode) {\n\t\t\t\tLayoutHandlers.set(nextNode, onLayout);\n\t\t\t\tobserveLayoutNode(nextNode, disableKey);\n\t\t\t\temitLayoutSync(nextNode);\n\t\t\t}\n\t\t}\n\t\treturn function() {\n\t\t\tvar _ref_current3;\n\t\t\tvar activeNode = ensureWebElement((_ref_current3 = ref.current) === null || _ref_current3 === void 0 ? void 0 : _ref_current3.host);\n\t\t\tif (activeNode) cleanupNode(activeNode);\n\t\t\tvar swapped = PrevHostNode.get(ref);\n\t\t\tif (swapped && swapped !== activeNode) cleanupNode(swapped);\n\t\t\tPrevHostNode.delete(ref);\n\t\t};\n\t}, [ref, !!onLayout]);\n}\nfunction ensureWebElement(x) {\n\tif (typeof HTMLElement === \"undefined\") return void 0;\n\treturn x instanceof HTMLElement ? x : void 0;\n}\nvar getBoundingClientRectAsync = function(node) {\n\treturn new Promise(function(res) {\n\t\tif (!node || node.nodeType !== 1) return res(false);\n\t\tvar io = new IntersectionObserver(function(entries) {\n\t\t\tio.disconnect();\n\t\t\tres(entries[0].boundingClientRect);\n\t\t});\n\t\tio.observe(node);\n\t});\n};\nvar measureNode = async function(node, relativeTo) {\n\tvar relativeNode = relativeTo || (node === null || node === void 0 ? void 0 : node.parentElement);\n\tif (relativeNode instanceof HTMLElement) {\n\t\tvar [nodeDim, relativeNodeDim] = await Promise.all([getBoundingClientRectAsync(node), getBoundingClientRectAsync(relativeNode)]);\n\t\tif (relativeNodeDim && nodeDim) return getRelativeDimensions(nodeDim, relativeNodeDim, node);\n\t}\n\treturn null;\n};\nvar measure = async function(node, callback) {\n\tvar out = await measureNode(node, node.parentElement);\n\tif (out) callback === null || callback === void 0 || callback(out.x, out.y, out.width, out.height, out.pageX, out.pageY);\n\treturn out;\n};\nvar createMeasure = function(node) {\n\treturn function(callback) {\n\t\treturn measure(node, callback);\n\t};\n};\nvar measureInWindow = async function(node, callback) {\n\tvar out = await measureNode(node, null);\n\tif (out) callback === null || callback === void 0 || callback(out.pageX, out.pageY, out.width, out.height);\n\treturn out;\n};\nvar createMeasureInWindow = function(node) {\n\treturn function(callback) {\n\t\treturn measureInWindow(node, callback);\n\t};\n};\nvar measureLayout = async function(node, relativeNode, callback) {\n\tvar out = await measureNode(node, relativeNode);\n\tif (out) callback === null || callback === void 0 || callback(out.x, out.y, out.width, out.height, out.pageX, out.pageY);\n\treturn out;\n};\nvar createMeasureLayout = function(node) {\n\treturn function(relativeTo, callback) {\n\t\treturn measureLayout(node, relativeTo, callback);\n\t};\n};\n\nexport { LayoutMeasurementController, createMeasure, createMeasureInWindow, createMeasureLayout, enable, getBoundingClientRectAsync, getElementLayoutEvent, measure, measureInWindow, measureLayout, measureNode, registerLayoutNode, useElementLayout };"],"mappings":";;;;;AAIA,IAAI,iCAAiC,IAAI,QAAQ;AACjD,IAAI,mCAAmC,IAAI,QAAQ;AACnD,IAAI,wBAAwB,IAAI,IAAI;AACpC,IAAI,gCAAgC,IAAI,QAAQ;AAChD,IAAI,+BAA+B,IAAI,QAAQ;AAC/C,IAAI,4BAA4B,WAAW;CAC1C,OAAO,WAAW,oCAAoC,QAAQ,QAAQ,IAAI,kCAAkC;AAC7G;AACA,IAAI,gBAAgB,WAAW;CAC9B,IAAI,yBAAyB;CAC7B,OAAO,OAAO,WAAW,iBAAiB,mBAAmB,OAAO,cAAc,QAAQ,qBAAqB,KAAK,IAAI,KAAK,KAAK,0BAA0B,iBAAiB,YAAY,QAAQ,4BAA4B,KAAK,IAAI,KAAK,IAAI,wBAAwB,SAAS,mBAAmB;AACpS;AACA,IAAI,6BAA6B,CAAC;AAClC,IAAI,0BAA0C,8BAAc,EAAE;AAC9D,IAAI,SAAS;AACb,IAAI,8BAA8B,SAAS,OAAO;CACjD,IAAI,EAAE,SAAS,aAAa;CAC5B,IAAI,KAAK,MAAM;CACf,0BAA0B,WAAW;EACpC,IAAI,cAAc,2BAA2B,QAAQ;EACrD,2BAA2B,MAAM;EACjC,I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,aAAa,KAAK,KAAK,SAAS,IAAI,GAAG,IAAI,GAAG,IAAI,OAAO,IAAI,QAAQ,IAAI,OAAO,IAAI,KAAK;CACvH,OAAO;AACR;AACA,IAAI,sBAAsB,SAAS,MAAM;CACxC,OAAO,SAAS,YAAY,UAAU;EACrC,OAAO,cAAc,MAAM,YAAY,QAAQ;CAChD;AACD"}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@tamagui/use-element-layout",
3
- "version": "3.0.0-beta.922.1",
3
+ "version": "3.0.0",
4
+ "license": "MIT",
4
5
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
6
  "files": [
6
7
  "src",
@@ -34,11 +35,11 @@
34
35
  "clean:build": "tamagui-build clean:build"
35
36
  },
36
37
  "dependencies": {
37
- "@tamagui/constants": "3.0.0-beta.922.1",
38
- "@tamagui/is-equal-shallow": "3.0.0-beta.922.1"
38
+ "@tamagui/constants": "3.0.0",
39
+ "@tamagui/is-equal-shallow": "3.0.0"
39
40
  },
40
41
  "devDependencies": {
41
- "@tamagui/build": "3.0.0-beta.922.1",
42
+ "@tamagui/build": "3.0.0",
42
43
  "react": "19.2.3"
43
44
  },
44
45
  "peerDependencies": {
@@ -48,5 +49,6 @@
48
49
  "type": "git",
49
50
  "url": "git+https://github.com/tamagui/tamagui.git",
50
51
  "directory": "code/core/use-element-layout"
51
- }
52
+ },
53
+ "releaseSourceCommit": "15fbca480b143f876f6975601e23a17d3f90d2ee"
52
54
  }