@tamagui/core 1.126.13-1747671613486 → 1.126.13-1747874018127
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/cjs/hooks/useElementLayout.cjs +56 -63
- package/dist/cjs/hooks/useElementLayout.js +44 -61
- package/dist/cjs/hooks/useElementLayout.js.map +1 -1
- package/dist/cjs/hooks/useElementLayout.native.js +55 -94
- package/dist/cjs/hooks/useElementLayout.native.js.map +2 -2
- package/dist/cjs/index.cjs +4 -2
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/index.native.js +4 -2
- package/dist/cjs/index.native.js.map +2 -2
- package/dist/esm/hooks/useElementLayout.js +48 -62
- package/dist/esm/hooks/useElementLayout.js.map +1 -1
- package/dist/esm/hooks/useElementLayout.mjs +57 -64
- package/dist/esm/hooks/useElementLayout.mjs.map +1 -1
- package/dist/esm/hooks/useElementLayout.native.js +72 -106
- package/dist/esm/hooks/useElementLayout.native.js.map +1 -1
- package/dist/esm/index.js +5 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +2 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/native.js +85 -115
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +85 -115
- package/dist/test.native.js.map +2 -2
- package/package.json +7 -7
- package/src/hooks/useElementLayout.tsx +87 -88
- package/src/index.tsx +6 -0
- package/types/hooks/useElementLayout.d.ts +2 -2
- package/types/hooks/useElementLayout.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
|
@@ -20,37 +20,47 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
|
20
20
|
}), mod);
|
|
21
21
|
var useElementLayout_exports = {};
|
|
22
22
|
__export(useElementLayout_exports, {
|
|
23
|
-
|
|
23
|
+
getElementLayoutEvent: () => getElementLayoutEvent,
|
|
24
24
|
measureLayout: () => measureLayout,
|
|
25
25
|
useElementLayout: () => useElementLayout
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(useElementLayout_exports);
|
|
28
28
|
var import_constants = require("@tamagui/constants"),
|
|
29
|
-
|
|
29
|
+
import_web = require("@tamagui/web");
|
|
30
30
|
const LayoutHandlers = /* @__PURE__ */new WeakMap(),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
onLayout
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
31
|
+
Nodes = /* @__PURE__ */new Set(),
|
|
32
|
+
NodeRectCache = /* @__PURE__ */new WeakMap(),
|
|
33
|
+
ParentRectCache = /* @__PURE__ */new WeakMap();
|
|
34
|
+
if (import_constants.isClient && typeof requestAnimationFrame == "function") {
|
|
35
|
+
let updateLayoutIfChanged = function (node) {
|
|
36
|
+
const nodeRect = node.getBoundingClientRect(),
|
|
37
|
+
parentNode = node.parentElement,
|
|
38
|
+
parentRect = parentNode?.getBoundingClientRect(),
|
|
39
|
+
onLayout = LayoutHandlers.get(node);
|
|
40
|
+
if (typeof onLayout != "function") return;
|
|
41
|
+
const cachedRect = NodeRectCache.get(node),
|
|
42
|
+
cachedParentRect = parentNode ? NodeRectCache.get(parentNode) : null;
|
|
43
|
+
if (!cachedRect ||
|
|
44
|
+
// has changed one rect
|
|
45
|
+
!(0, import_web.isEqualShallow)(cachedRect, nodeRect) && (!cachedParentRect || !(0, import_web.isEqualShallow)(cachedParentRect, parentRect))) {
|
|
46
|
+
NodeRectCache.set(node, nodeRect), parentRect && parentNode && ParentRectCache.set(parentNode, parentRect);
|
|
47
|
+
const event = getElementLayoutEvent(node);
|
|
48
|
+
avoidUpdates ? queuedUpdates.set(node, () => onLayout(event)) : onLayout(event);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
layoutOnAnimationFrame = function () {
|
|
52
|
+
Nodes.forEach(updateLayoutIfChanged), requestAnimationFrame(layoutOnAnimationFrame);
|
|
53
|
+
},
|
|
54
|
+
avoidUpdates = !0;
|
|
55
|
+
const queuedUpdates = /* @__PURE__ */new Map();
|
|
56
|
+
(0, import_web.___onDidFinishClientRender)(() => {
|
|
57
|
+
avoidUpdates = !1, queuedUpdates && (queuedUpdates.forEach(cb => cb()), queuedUpdates.clear());
|
|
58
|
+
}), requestAnimationFrame(layoutOnAnimationFrame);
|
|
50
59
|
}
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
60
|
+
const getElementLayoutEvent = target => {
|
|
61
|
+
let res = null;
|
|
62
|
+
if (measureLayout(target, null, (x, y, width, height, left, top) => {
|
|
63
|
+
res = {
|
|
54
64
|
nativeEvent: {
|
|
55
65
|
layout: {
|
|
56
66
|
x,
|
|
@@ -63,27 +73,26 @@ const measureElement = async target => new Promise(res => {
|
|
|
63
73
|
target
|
|
64
74
|
},
|
|
65
75
|
timeStamp: Date.now()
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
};
|
|
77
|
+
}), !res) throw new Error("\u203C\uFE0F");
|
|
78
|
+
return res;
|
|
79
|
+
},
|
|
70
80
|
measureLayout = (node, relativeTo, callback) => {
|
|
71
|
-
const relativeNode = relativeTo || node?.
|
|
81
|
+
const relativeNode = relativeTo || node?.parentElement;
|
|
72
82
|
if (relativeNode instanceof HTMLElement) {
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
});
|
|
83
|
+
const nodeDim = node.getBoundingClientRect(),
|
|
84
|
+
relativeNodeDim = relativeNode.getBoundingClientRect();
|
|
85
|
+
if (relativeNodeDim && nodeDim) {
|
|
86
|
+
const {
|
|
87
|
+
x,
|
|
88
|
+
y,
|
|
89
|
+
width,
|
|
90
|
+
height,
|
|
91
|
+
left,
|
|
92
|
+
top
|
|
93
|
+
} = getRelativeDimensions(nodeDim, relativeNodeDim);
|
|
94
|
+
callback(x, y, width, height, left, top);
|
|
95
|
+
}
|
|
87
96
|
}
|
|
88
97
|
},
|
|
89
98
|
getRelativeDimensions = (a, b) => {
|
|
@@ -103,30 +112,14 @@ const measureElement = async target => new Promise(res => {
|
|
|
103
112
|
left,
|
|
104
113
|
top
|
|
105
114
|
};
|
|
106
|
-
}
|
|
107
|
-
getBoundingClientRectAsync = element => new Promise(resolve => {
|
|
108
|
-
function fallbackToSync() {
|
|
109
|
-
resolve((0, import_getBoundingClientRect.getBoundingClientRect)(element));
|
|
110
|
-
}
|
|
111
|
-
const tm = setTimeout(fallbackToSync, 10);
|
|
112
|
-
new IntersectionObserver((entries, ob) => {
|
|
113
|
-
clearTimeout(tm), ob.disconnect(), resolve(entries[0]?.boundingClientRect);
|
|
114
|
-
}, {
|
|
115
|
-
threshold: 1e-4
|
|
116
|
-
}).observe(element);
|
|
117
|
-
});
|
|
115
|
+
};
|
|
118
116
|
function useElementLayout(ref, onLayout) {
|
|
119
117
|
const node = ref.current?.host;
|
|
120
118
|
node && onLayout && LayoutHandlers.set(node, onLayout), (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
121
|
-
if (!
|
|
119
|
+
if (!onLayout) return;
|
|
122
120
|
const node2 = ref.current?.host;
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
const onResize = () => {
|
|
126
|
-
measureElement(node2).then(onLayout);
|
|
127
|
-
};
|
|
128
|
-
return resizeListeners.add(onResize), resizeObserver.observe(node2), () => {
|
|
129
|
-
LayoutHandlers.delete(node2), resizeListeners.delete(onResize), resizeObserver?.unobserve(node2);
|
|
121
|
+
if (node2) return LayoutHandlers.set(node2, onLayout), Nodes.add(node2), onLayout(getElementLayoutEvent(node2)), () => {
|
|
122
|
+
Nodes.delete(node2), LayoutHandlers.delete(node2), NodeRectCache.delete(node2);
|
|
130
123
|
};
|
|
131
124
|
}, [ref, !!onLayout]);
|
|
132
125
|
}
|
|
@@ -14,87 +14,70 @@ var __export = (target, all) => {
|
|
|
14
14
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
15
|
var useElementLayout_exports = {};
|
|
16
16
|
__export(useElementLayout_exports, {
|
|
17
|
-
|
|
17
|
+
getElementLayoutEvent: () => getElementLayoutEvent,
|
|
18
18
|
measureLayout: () => measureLayout,
|
|
19
19
|
useElementLayout: () => useElementLayout
|
|
20
20
|
});
|
|
21
21
|
module.exports = __toCommonJS(useElementLayout_exports);
|
|
22
|
-
var import_constants = require("@tamagui/constants"),
|
|
23
|
-
const LayoutHandlers = /* @__PURE__ */ new WeakMap(),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const onLayout = LayoutHandlers.get(target);
|
|
22
|
+
var import_constants = require("@tamagui/constants"), import_web = require("@tamagui/web");
|
|
23
|
+
const LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), NodeRectCache = /* @__PURE__ */ new WeakMap(), ParentRectCache = /* @__PURE__ */ new WeakMap();
|
|
24
|
+
if (import_constants.isClient && typeof requestAnimationFrame == "function") {
|
|
25
|
+
let updateLayoutIfChanged = function(node) {
|
|
26
|
+
const nodeRect = node.getBoundingClientRect(), parentNode = node.parentElement, parentRect = parentNode?.getBoundingClientRect(), onLayout = LayoutHandlers.get(node);
|
|
28
27
|
if (typeof onLayout != "function") return;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
const cachedRect = NodeRectCache.get(node), cachedParentRect = parentNode ? NodeRectCache.get(parentNode) : null;
|
|
29
|
+
if (!cachedRect || // has changed one rect
|
|
30
|
+
!(0, import_web.isEqualShallow)(cachedRect, nodeRect) && (!cachedParentRect || !(0, import_web.isEqualShallow)(cachedParentRect, parentRect))) {
|
|
31
|
+
NodeRectCache.set(node, nodeRect), parentRect && parentNode && ParentRectCache.set(parentNode, parentRect);
|
|
32
|
+
const event = getElementLayoutEvent(node);
|
|
33
|
+
avoidUpdates ? queuedUpdates.set(node, () => onLayout(event)) : onLayout(event);
|
|
34
|
+
}
|
|
35
|
+
}, layoutOnAnimationFrame = function() {
|
|
36
|
+
Nodes.forEach(updateLayoutIfChanged), requestAnimationFrame(layoutOnAnimationFrame);
|
|
37
|
+
}, avoidUpdates = !0;
|
|
38
|
+
const queuedUpdates = /* @__PURE__ */ new Map();
|
|
39
|
+
(0, import_web.___onDidFinishClientRender)(() => {
|
|
40
|
+
avoidUpdates = !1, queuedUpdates && (queuedUpdates.forEach((cb) => cb()), queuedUpdates.clear());
|
|
41
|
+
}), requestAnimationFrame(layoutOnAnimationFrame);
|
|
40
42
|
}
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
const getElementLayoutEvent = (target) => {
|
|
44
|
+
let res = null;
|
|
45
|
+
if (measureLayout(target, null, (x, y, width, height, left, top) => {
|
|
46
|
+
res = {
|
|
44
47
|
nativeEvent: {
|
|
45
48
|
layout: { x, y, width, height, left, top },
|
|
46
49
|
target
|
|
47
50
|
},
|
|
48
51
|
timeStamp: Date.now()
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
};
|
|
53
|
+
}), !res)
|
|
54
|
+
throw new Error("\u203C\uFE0F");
|
|
55
|
+
return res;
|
|
56
|
+
}, measureLayout = (node, relativeTo, callback) => {
|
|
57
|
+
const relativeNode = relativeTo || node?.parentElement;
|
|
53
58
|
if (relativeNode instanceof HTMLElement) {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
relativeNodeDim
|
|
63
|
-
);
|
|
64
|
-
callback(x, y, width, height, left, top);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
59
|
+
const nodeDim = node.getBoundingClientRect(), relativeNodeDim = relativeNode.getBoundingClientRect();
|
|
60
|
+
if (relativeNodeDim && nodeDim) {
|
|
61
|
+
const { x, y, width, height, left, top } = getRelativeDimensions(
|
|
62
|
+
nodeDim,
|
|
63
|
+
relativeNodeDim
|
|
64
|
+
);
|
|
65
|
+
callback(x, y, width, height, left, top);
|
|
66
|
+
}
|
|
67
67
|
}
|
|
68
68
|
}, getRelativeDimensions = (a, b) => {
|
|
69
69
|
const { height, left, top, width } = a, x = left - b.left, y = top - b.top;
|
|
70
70
|
return { x, y, width, height, left, top };
|
|
71
|
-
}
|
|
72
|
-
function fallbackToSync() {
|
|
73
|
-
resolve((0, import_getBoundingClientRect.getBoundingClientRect)(element));
|
|
74
|
-
}
|
|
75
|
-
const tm = setTimeout(fallbackToSync, 10);
|
|
76
|
-
new IntersectionObserver(
|
|
77
|
-
(entries, ob) => {
|
|
78
|
-
clearTimeout(tm), ob.disconnect(), resolve(entries[0]?.boundingClientRect);
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
threshold: 1e-4
|
|
82
|
-
}
|
|
83
|
-
).observe(element);
|
|
84
|
-
});
|
|
71
|
+
};
|
|
85
72
|
function useElementLayout(ref, onLayout) {
|
|
86
73
|
const node = ref.current?.host;
|
|
87
74
|
node && onLayout && LayoutHandlers.set(node, onLayout), (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
88
|
-
if (!
|
|
75
|
+
if (!onLayout) return;
|
|
89
76
|
const node2 = ref.current?.host;
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
};
|
|
95
|
-
return resizeListeners.add(onResize), resizeObserver.observe(node2), () => {
|
|
96
|
-
LayoutHandlers.delete(node2), resizeListeners.delete(onResize), resizeObserver?.unobserve(node2);
|
|
97
|
-
};
|
|
77
|
+
if (node2)
|
|
78
|
+
return LayoutHandlers.set(node2, onLayout), Nodes.add(node2), onLayout(getElementLayoutEvent(node2)), () => {
|
|
79
|
+
Nodes.delete(node2), LayoutHandlers.delete(node2), NodeRectCache.delete(node2);
|
|
80
|
+
};
|
|
98
81
|
}, [ref, !!onLayout]);
|
|
99
82
|
}
|
|
100
83
|
//# sourceMappingURL=useElementLayout.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/useElementLayout.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAoD,+BACpD,aAIO;AAGP,MAAM,iBAAiB,oBAAI,QAA+B,GACpD,QAAQ,oBAAI,IAAiB,GAmB7B,gBAAgB,oBAAI,QAA8B,GAClD,kBAAkB,oBAAI,QAA8B;AAE1D,IAAI,6BAAY,OAAO,yBAA0B,YAAY;AAa3D,MAAS,wBAAT,SAA+B,MAAmB;AAChD,UAAM,WAAW,KAAK,sBAAsB,GACtC,aAAa,KAAK,eAClB,aAAa,YAAY,sBAAsB,GAE/C,WAAW,eAAe,IAAI,IAAI;AACxC,QAAI,OAAO,YAAa,WAAY;AAEpC,UAAM,aAAa,cAAc,IAAI,IAAI,GACnC,mBAAmB,aAAa,cAAc,IAAI,UAAU,IAAI;AAEtE,QACE,CAAC;AAAA,IAEA,KAAC,2BAAe,YAAY,QAAQ,MAClC,CAAC,oBAAoB,KAAC,2BAAe,kBAAkB,UAAU,IACpE;AACA,oBAAc,IAAI,MAAM,QAAQ,GAC5B,cAAc,cAChB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MAAM,IAAI,GAC/B,IAAI,OAAO,EAAE,MACb,IAAI,MAAM,EAAE;AAClB,SAAO,EAAE,GAAG,GAAG,OAAO,QAAQ,MAAM,IAAI;AAC1C;AAEO,SAAS,iBACd,KACA,UACA;AAEA,QAAM,OAAO,IAAI,SAAS;AAC1B,EAAI,QAAQ,YACV,eAAe,IAAI,MAAM,QAAQ,OAGnC,4CAA0B,MAAM;AAC9B,QAAI,CAAC,SAAU;AACf,UAAMA,QAAO,IAAI,SAAS;AAC1B,QAAKA;AAEL,4BAAe,IAAIA,OAAM,QAAQ,GACjC,MAAM,IAAIA,KAAI,GACd,SAAS,sBAAsBA,KAAI,CAAC,GAE7B,MAAM;AACX,cAAM,OAAOA,KAAI,GACjB,eAAe,OAAOA,KAAI,GAC1B,cAAc,OAAOA,KAAI;AAAA,MAC3B;AAAA,EACF,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;AACtB;",
|
|
5
5
|
"names": ["node"]
|
|
6
6
|
}
|
|
@@ -15,85 +15,64 @@ var __export = (target, all) => {
|
|
|
15
15
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
16
|
var useElementLayout_exports = {};
|
|
17
17
|
__export(useElementLayout_exports, {
|
|
18
|
-
|
|
18
|
+
getElementLayoutEvent: () => getElementLayoutEvent,
|
|
19
19
|
measureLayout: () => measureLayout,
|
|
20
20
|
useElementLayout: () => useElementLayout
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(useElementLayout_exports);
|
|
23
|
-
var import_constants = require("@tamagui/constants"),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
measureElement(target).then(function(event) {
|
|
38
|
-
onLayout(event);
|
|
39
|
-
});
|
|
40
|
-
}, _iterator = entries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
41
|
-
var _ret = _loop();
|
|
42
|
-
if (_type_of(_ret) === "object") return _ret.v;
|
|
43
|
-
}
|
|
44
|
-
} catch (err) {
|
|
45
|
-
_didIteratorError = !0, _iteratorError = err;
|
|
46
|
-
} finally {
|
|
47
|
-
try {
|
|
48
|
-
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
49
|
-
} finally {
|
|
50
|
-
if (_didIteratorError)
|
|
51
|
-
throw _iteratorError;
|
|
23
|
+
var import_constants = require("@tamagui/constants"), import_web = require("@tamagui/web"), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), NodeRectCache = /* @__PURE__ */ new WeakMap(), ParentRectCache = /* @__PURE__ */ new WeakMap();
|
|
24
|
+
if (import_constants.isClient && typeof requestAnimationFrame == "function") {
|
|
25
|
+
let updateLayoutIfChanged = function(node) {
|
|
26
|
+
var nodeRect = node.getBoundingClientRect(), parentNode = node.parentElement, parentRect = parentNode == null ? void 0 : parentNode.getBoundingClientRect(), onLayout = LayoutHandlers.get(node);
|
|
27
|
+
if (typeof onLayout == "function") {
|
|
28
|
+
var cachedRect = NodeRectCache.get(node), cachedParentRect = parentNode ? NodeRectCache.get(parentNode) : null;
|
|
29
|
+
if (!cachedRect || // has changed one rect
|
|
30
|
+
!(0, import_web.isEqualShallow)(cachedRect, nodeRect) && (!cachedParentRect || !(0, import_web.isEqualShallow)(cachedParentRect, parentRect))) {
|
|
31
|
+
NodeRectCache.set(node, nodeRect), parentRect && parentNode && ParentRectCache.set(parentNode, parentRect);
|
|
32
|
+
var event = getElementLayoutEvent(node);
|
|
33
|
+
avoidUpdates ? queuedUpdates.set(node, function() {
|
|
34
|
+
return onLayout(event);
|
|
35
|
+
}) : onLayout(event);
|
|
36
|
+
}
|
|
52
37
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
38
|
+
}, layoutOnAnimationFrame = function() {
|
|
39
|
+
Nodes.forEach(updateLayoutIfChanged), requestAnimationFrame(layoutOnAnimationFrame);
|
|
40
|
+
};
|
|
41
|
+
var updateLayoutIfChanged2 = updateLayoutIfChanged, layoutOnAnimationFrame2 = layoutOnAnimationFrame, avoidUpdates = !0, queuedUpdates = /* @__PURE__ */ new Map();
|
|
42
|
+
(0, import_web.___onDidFinishClientRender)(function() {
|
|
43
|
+
avoidUpdates = !1, queuedUpdates && (queuedUpdates.forEach(function(cb) {
|
|
44
|
+
return cb();
|
|
45
|
+
}), queuedUpdates.clear());
|
|
46
|
+
}), requestAnimationFrame(layoutOnAnimationFrame);
|
|
63
47
|
}
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
target
|
|
48
|
+
var getElementLayoutEvent = function(target) {
|
|
49
|
+
var res = null;
|
|
50
|
+
if (measureLayout(target, null, function(x, y, width, height, left, top) {
|
|
51
|
+
res = {
|
|
52
|
+
nativeEvent: {
|
|
53
|
+
layout: {
|
|
54
|
+
x,
|
|
55
|
+
y,
|
|
56
|
+
width,
|
|
57
|
+
height,
|
|
58
|
+
left,
|
|
59
|
+
top
|
|
78
60
|
},
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
61
|
+
target
|
|
62
|
+
},
|
|
63
|
+
timeStamp: Date.now()
|
|
64
|
+
};
|
|
65
|
+
}), !res)
|
|
66
|
+
throw new Error("\u203C\uFE0F");
|
|
67
|
+
return res;
|
|
68
|
+
}, measureLayout = function(node, relativeTo, callback) {
|
|
69
|
+
var relativeNode = relativeTo || (node == null ? void 0 : node.parentElement);
|
|
85
70
|
if (relativeNode instanceof HTMLElement) {
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var [nodeDim, relativeNodeDim] = param;
|
|
92
|
-
if (relativeNodeDim && nodeDim && cache.get(node) === now) {
|
|
93
|
-
var { x, y, width, height, left, top } = getRelativeDimensions(nodeDim, relativeNodeDim);
|
|
94
|
-
callback(x, y, width, height, left, top);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
71
|
+
var nodeDim = node.getBoundingClientRect(), relativeNodeDim = relativeNode.getBoundingClientRect();
|
|
72
|
+
if (relativeNodeDim && nodeDim) {
|
|
73
|
+
var { x, y, width, height, left, top } = getRelativeDimensions(nodeDim, relativeNodeDim);
|
|
74
|
+
callback(x, y, width, height, left, top);
|
|
75
|
+
}
|
|
97
76
|
}
|
|
98
77
|
}, getRelativeDimensions = function(a, b) {
|
|
99
78
|
var { height, left, top, width } = a, x = left - b.left, y = top - b.top;
|
|
@@ -105,35 +84,17 @@ var measureElement = async function(target) {
|
|
|
105
84
|
left,
|
|
106
85
|
top
|
|
107
86
|
};
|
|
108
|
-
}, getBoundingClientRectAsync = function(element) {
|
|
109
|
-
return new Promise(function(resolve) {
|
|
110
|
-
function fallbackToSync() {
|
|
111
|
-
resolve((0, import_getBoundingClientRect.getBoundingClientRect)(element));
|
|
112
|
-
}
|
|
113
|
-
var tm = setTimeout(fallbackToSync, 10), observer = new IntersectionObserver(function(entries, ob) {
|
|
114
|
-
var _entries_;
|
|
115
|
-
clearTimeout(tm), ob.disconnect(), resolve((_entries_ = entries[0]) === null || _entries_ === void 0 ? void 0 : _entries_.boundingClientRect);
|
|
116
|
-
}, {
|
|
117
|
-
threshold: 1e-4
|
|
118
|
-
});
|
|
119
|
-
observer.observe(element);
|
|
120
|
-
});
|
|
121
87
|
};
|
|
122
88
|
function useElementLayout(ref, onLayout) {
|
|
123
89
|
var _ref_current, node = (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.host;
|
|
124
90
|
node && onLayout && LayoutHandlers.set(node, onLayout), (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
125
91
|
var _ref_current2;
|
|
126
|
-
if (
|
|
92
|
+
if (onLayout) {
|
|
127
93
|
var node2 = (_ref_current2 = ref.current) === null || _ref_current2 === void 0 ? void 0 : _ref_current2.host;
|
|
128
|
-
if (node2)
|
|
129
|
-
LayoutHandlers.set(node2, onLayout)
|
|
130
|
-
|
|
131
|
-
measureElement(node2).then(onLayout);
|
|
94
|
+
if (node2)
|
|
95
|
+
return LayoutHandlers.set(node2, onLayout), Nodes.add(node2), onLayout(getElementLayoutEvent(node2)), function() {
|
|
96
|
+
Nodes.delete(node2), LayoutHandlers.delete(node2), NodeRectCache.delete(node2);
|
|
132
97
|
};
|
|
133
|
-
return resizeListeners.add(onResize), resizeObserver.observe(node2), function() {
|
|
134
|
-
LayoutHandlers.delete(node2), resizeListeners.delete(onResize), resizeObserver == null || resizeObserver.unobserve(node2);
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
98
|
}
|
|
138
99
|
}, [
|
|
139
100
|
ref,
|
|
@@ -142,7 +103,7 @@ function useElementLayout(ref, onLayout) {
|
|
|
142
103
|
}
|
|
143
104
|
// Annotate the CommonJS export names for ESM import in node:
|
|
144
105
|
0 && (module.exports = {
|
|
145
|
-
|
|
106
|
+
getElementLayoutEvent,
|
|
146
107
|
measureLayout,
|
|
147
108
|
useElementLayout
|
|
148
109
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/useElementLayout.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["LayoutHandlers", "WeakMap", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;;;;;;;uBAAoD,+BACpD,aAIO,yBAGDA,iBAAiB,oBAA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AM0D,IAAInD,KAAAA,GACVM,SAASO,sBAAsBb,KAAAA,CAAAA,GAExB,WAAA;AACLP,gBAAM2D,OAAOpD,KAAAA,GACbT,eAAe6D,OAAOpD,KAAAA,GACtBL,cAAcyD,OAAOpD,KAAAA;QACvB;;EACF,GAAG;IAAC+C;IAAK,CAAC,CAACzC;GAAS;AACtB;",
|
|
5
|
+
"names": ["LayoutHandlers", "WeakMap", "Nodes", "Set", "NodeRectCache", "ParentRectCache", "isClient", "requestAnimationFrame", "updateLayoutIfChanged", "node", "nodeRect", "getBoundingClientRect", "parentNode", "parentElement", "parentRect", "onLayout", "get", "cachedRect", "cachedParentRect", "isEqualShallow", "set", "event", "getElementLayoutEvent", "avoidUpdates", "queuedUpdates", "layoutOnAnimationFrame", "forEach", "Map", "___onDidFinishClientRender", "cb", "clear", "target", "res", "measureLayout", "x", "y", "width", "height", "left", "top", "nativeEvent", "layout", "timeStamp", "Date", "now", "Error", "relativeTo", "callback", "relativeNode", "HTMLElement", "nodeDim", "relativeNodeDim", "getRelativeDimensions", "a", "b", "useElementLayout", "ref", "current", "host", "useIsomorphicLayoutEffect", "add", "delete"]
|
|
6
6
|
}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -24,7 +24,8 @@ __export(index_exports, {
|
|
|
24
24
|
Stack: () => Stack,
|
|
25
25
|
Text: () => Text,
|
|
26
26
|
View: () => View,
|
|
27
|
-
createTamagui: () => createTamagui
|
|
27
|
+
createTamagui: () => createTamagui,
|
|
28
|
+
getElementLayoutEvent: () => import_useElementLayout2.getElementLayoutEvent
|
|
28
29
|
});
|
|
29
30
|
module.exports = __toCommonJS(index_exports);
|
|
30
31
|
var import_react_native_media_driver = require("@tamagui/react-native-media-driver"),
|
|
@@ -36,7 +37,8 @@ var import_react_native_media_driver = require("@tamagui/react-native-media-driv
|
|
|
36
37
|
import_getRect = require("./helpers/getRect.cjs"),
|
|
37
38
|
import_useElementLayout = require("./hooks/useElementLayout.cjs"),
|
|
38
39
|
import_Pressability = require("./vendor/Pressability.cjs"),
|
|
39
|
-
import_addNativeValidStyles = require("./addNativeValidStyles.cjs")
|
|
40
|
+
import_addNativeValidStyles = require("./addNativeValidStyles.cjs"),
|
|
41
|
+
import_useElementLayout2 = require("./hooks/useElementLayout.cjs");
|
|
40
42
|
__reExport(index_exports, require("@tamagui/web"), module.exports);
|
|
41
43
|
__reExport(index_exports, require("./reactNativeTypes.cjs"), module.exports);
|
|
42
44
|
(0, import_addNativeValidStyles.addNativeValidStyles)();
|
package/dist/cjs/index.js
CHANGED
|
@@ -17,10 +17,11 @@ __export(index_exports, {
|
|
|
17
17
|
Stack: () => Stack,
|
|
18
18
|
Text: () => Text,
|
|
19
19
|
View: () => View,
|
|
20
|
-
createTamagui: () => createTamagui
|
|
20
|
+
createTamagui: () => createTamagui,
|
|
21
|
+
getElementLayoutEvent: () => import_useElementLayout2.getElementLayoutEvent
|
|
21
22
|
});
|
|
22
23
|
module.exports = __toCommonJS(index_exports);
|
|
23
|
-
var import_react_native_media_driver = require("@tamagui/react-native-media-driver"), import_react_native_use_responder_events = require("@tamagui/react-native-use-responder-events"), import_web = require("@tamagui/web"), import_react = require("react"), import_createOptimizedView = require("./createOptimizedView"), import_getBaseViews = require("./getBaseViews"), import_getRect = require("./helpers/getRect"), import_useElementLayout = require("./hooks/useElementLayout"), import_Pressability = require("./vendor/Pressability"), import_addNativeValidStyles = require("./addNativeValidStyles");
|
|
24
|
+
var import_react_native_media_driver = require("@tamagui/react-native-media-driver"), import_react_native_use_responder_events = require("@tamagui/react-native-use-responder-events"), import_web = require("@tamagui/web"), import_react = require("react"), import_createOptimizedView = require("./createOptimizedView"), import_getBaseViews = require("./getBaseViews"), import_getRect = require("./helpers/getRect"), import_useElementLayout = require("./hooks/useElementLayout"), import_Pressability = require("./vendor/Pressability"), import_addNativeValidStyles = require("./addNativeValidStyles"), import_useElementLayout2 = require("./hooks/useElementLayout");
|
|
24
25
|
__reExport(index_exports, require("@tamagui/web"), module.exports);
|
|
25
26
|
__reExport(index_exports, require("./reactNativeTypes"), module.exports);
|
|
26
27
|
(0, import_addNativeValidStyles.addNativeValidStyles)();
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uCAA4B,+CAC5B,2CAAmC,uDAYnC,aAOO,yBACP,eAAkB,kBAElB,6BAAoC,kCACpC,sBAA6B,2BAC7B,iBAAwB,8BACxB,0BAAgD,qCAEhD,sBAAgC,kCAChC,8BAAqC;
|
|
5
|
-
"names": ["createTamaguiWeb", "WebView", "WebStack", "WebText"]
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uCAA4B,+CAC5B,2CAAmC,uDAYnC,aAOO,yBACP,eAAkB,kBAElB,6BAAoC,kCACpC,sBAA6B,2BAC7B,iBAAwB,8BACxB,0BAAgD,qCAEhD,sBAAgC,kCAChC,8BAAqC,mCAGrCA,2BAGO;AAkCP,0BAAc,yBArEd;AAwEA,0BAAc,+BAxEd;AAAA,IAsCA,kDAAqB;AAqCd,MAAM,gBAAyC,CAAC,aAM9C,WAAAC,eAAiB,IAAI,GAGxB,gBAAY,kCAAa;AAAA,IAI/B,uBAAW;AAAA,EACT;AAAA,EAEA,iBAAiB,CAAC,SAAS;AAEzB,IAAI,QAAQ,CAAC,KAAK,YAEhB,KAAK,YAAY,CAAC,iBAAa,uCAAc,MAAM,MAAM,QAAQ,GAEjE,KAAK,kBAAkB,CAAC,gBAAgB,gBACtC,uCAAc,MAAqB,gBAAgB,OAAO,GAE5D,KAAK,oBAAoB,CAAC,aAAa;AACrC,iBAAW,MAAM;AACf,cAAM,EAAE,QAAQ,MAAM,KAAK,MAAM,QAAI,wBAAQ,IAAmB;AAChE,iBAAS,MAAM,KAAK,OAAO,MAAM;AAAA,MACnC,GAAG,CAAC;AAAA,IACN;AAAA,EAEJ;AAAA,EAEA,kBAAkB,aAAa,SAAS,UAAU,aAAa;AACnB;AACxC,YAAM,QAAQ,OAAO,eAAgB,UAG/B;AAAA;AAAA,QAEJ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,QAGA;AAAA,QACA;AAAA;AAAA,QAGA;AAAA,QACA;AAAA,QAEA;AAAA,QACA;AAAA,QAEA,GAAG;AAAA,MACL,IAAI;AAOJ,WALI,eAAe,eACjB,0CAAiB,UAAW,QAAqB,WAAb,MAA6B,OACjE,6DAAmB,UAAW,QAAoB,UAAZ,MAAmB,IAGvD,OAAO;AAET,YAAI,cAAc,QAAQ,WAAW;AACnC,gBAAM,EAAE,UAAU,KAAK,OAAO,IAAI;AAClC,UAAI,YAAY,SACd,cAAc,WAAW,WAEvB,QACF,cAAc,MAAM,MAElB,OAAO,UAAW,aACpB,cAAc,SAAS,OAAO,OAAO,CAAC,MAAM,MAAM,IAAI,MAAM,KAAK;AAAA,QAErE;AACA,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAAA,EAEA,UAAU,WAAW,QAAQ,EAAE,QAAQ,GAAG,iBAAiB,cAAc;AAAA,EA0DzE;AAwBF,CAAC;AAQM,MAAM,OAAO,WAAAC,MACP,QAAQ,WAAAC,OACR,OAAO,WAAAC;",
|
|
5
|
+
"names": ["import_useElementLayout", "createTamaguiWeb", "WebView", "WebStack", "WebText"]
|
|
6
6
|
}
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -25,10 +25,11 @@ __export(index_exports, {
|
|
|
25
25
|
Stack: () => Stack,
|
|
26
26
|
Text: () => Text,
|
|
27
27
|
View: () => View,
|
|
28
|
-
createTamagui: () => createTamagui
|
|
28
|
+
createTamagui: () => createTamagui,
|
|
29
|
+
getElementLayoutEvent: () => import_useElementLayout2.getElementLayoutEvent
|
|
29
30
|
});
|
|
30
31
|
module.exports = __toCommonJS(index_exports);
|
|
31
|
-
var import_react_native_media_driver = require("@tamagui/react-native-media-driver"), import_react_native_use_responder_events = require("@tamagui/react-native-use-responder-events"), import_web = require("@tamagui/web"), import_react = __toESM(require("react")), import_createOptimizedView = require("./createOptimizedView"), import_getBaseViews = require("./getBaseViews"), import_getRect = require("./helpers/getRect"), import_useElementLayout = require("./hooks/useElementLayout"), import_Pressability = require("./vendor/Pressability"), import_addNativeValidStyles = require("./addNativeValidStyles");
|
|
32
|
+
var import_react_native_media_driver = require("@tamagui/react-native-media-driver"), import_react_native_use_responder_events = require("@tamagui/react-native-use-responder-events"), import_web = require("@tamagui/web"), import_react = __toESM(require("react")), import_createOptimizedView = require("./createOptimizedView"), import_getBaseViews = require("./getBaseViews"), import_getRect = require("./helpers/getRect"), import_useElementLayout = require("./hooks/useElementLayout"), import_Pressability = require("./vendor/Pressability"), import_addNativeValidStyles = require("./addNativeValidStyles"), import_useElementLayout2 = require("./hooks/useElementLayout");
|
|
32
33
|
__reExport(index_exports, require("@tamagui/web"), module.exports);
|
|
33
34
|
__reExport(index_exports, require("./reactNativeTypes"), module.exports);
|
|
34
35
|
(0, import_addNativeValidStyles.addNativeValidStyles)();
|
|
@@ -97,6 +98,7 @@ var dontComposePressabilityKeys = {
|
|
|
97
98
|
Text,
|
|
98
99
|
View,
|
|
99
100
|
createTamagui,
|
|
101
|
+
getElementLayoutEvent,
|
|
100
102
|
...require("@tamagui/web"),
|
|
101
103
|
...require("./reactNativeTypes")
|
|
102
104
|
});
|