@tamagui/use-element-layout 1.129.6 → 1.129.7
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/index.cjs +45 -64
- package/dist/cjs/index.js +56 -50
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +61 -63
- package/dist/cjs/index.native.js.map +2 -2
- package/dist/esm/index.js +56 -50
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +45 -64
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +60 -69
- package/dist/esm/index.native.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +74 -65
- package/types/index.d.ts +1 -2
- package/types/index.d.ts.map +5 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -39,11 +39,9 @@ function setOnLayoutStrategy(state) {
|
|
|
39
39
|
strategy = state;
|
|
40
40
|
}
|
|
41
41
|
const NodeRectCache = /* @__PURE__ */new WeakMap(),
|
|
42
|
-
ParentRectCache = /* @__PURE__ */new WeakMap()
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
rAF = typeof window < "u" ? window.requestAnimationFrame : void 0,
|
|
46
|
-
DEBOUNCE_DELAY = 32;
|
|
42
|
+
ParentRectCache = /* @__PURE__ */new WeakMap();
|
|
43
|
+
const LastChangeTime = /* @__PURE__ */new WeakMap(),
|
|
44
|
+
rAF = typeof window < "u" ? window.requestAnimationFrame : void 0;
|
|
47
45
|
let avoidUpdates = !0;
|
|
48
46
|
const queuedUpdates = /* @__PURE__ */new Map();
|
|
49
47
|
function enable() {
|
|
@@ -53,71 +51,46 @@ if (import_constants.isClient) if (rAF) {
|
|
|
53
51
|
let layoutOnAnimationFrame = function () {
|
|
54
52
|
const now = Date.now(),
|
|
55
53
|
timeSinceLastFrame = now - lastFrameAt;
|
|
56
|
-
lastFrameAt = now, strategy !== "off" && (timeSinceLastFrame > 16.67 * numDroppedFramesUntilPause || Nodes.forEach(
|
|
54
|
+
lastFrameAt = now, strategy !== "off" && (timeSinceLastFrame > 16.67 * numDroppedFramesUntilPause || Nodes.forEach(node => {
|
|
55
|
+
updateLayoutIfChanged(node, lastFrameAt);
|
|
56
|
+
})), rAF(layoutOnAnimationFrame);
|
|
57
57
|
},
|
|
58
58
|
lastFrameAt = Date.now();
|
|
59
59
|
const numDroppedFramesUntilPause = 2;
|
|
60
|
-
async function updateLayoutIfChanged(node) {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
async function updateLayoutIfChanged(node, frameId) {
|
|
61
|
+
const parentNode = node.parentElement;
|
|
62
|
+
let nodeRect, parentRect;
|
|
63
|
+
if (strategy === "async") {
|
|
64
|
+
const [nr, pr] = await Promise.all([getBoundingClientRectAsync(node), getBoundingClientRectAsync(parentNode)]);
|
|
65
|
+
if (frameId !== lastFrameAt) return;
|
|
66
|
+
nodeRect = nr, parentRect = pr;
|
|
67
|
+
} else nodeRect = node.getBoundingClientRect(), parentRect = parentNode?.getBoundingClientRect();
|
|
68
|
+
if (!parentRect) return;
|
|
69
|
+
const onLayout = LayoutHandlers.get(node);
|
|
65
70
|
if (typeof onLayout != "function") return;
|
|
66
71
|
const cachedRect = NodeRectCache.get(node),
|
|
67
72
|
cachedParentRect = parentNode ? NodeRectCache.get(parentNode) : null;
|
|
68
73
|
if (!cachedRect ||
|
|
69
74
|
// has changed one rect
|
|
70
|
-
!(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && (!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect)))
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const timer = setTimeout(async () => {
|
|
79
|
-
const lastChange = LastChangeTime.get(node) || 0,
|
|
80
|
-
timeSinceChange = Date.now() - lastChange;
|
|
81
|
-
if (timeSinceChange >= DEBOUNCE_DELAY) {
|
|
82
|
-
const event = await getElementLayoutEventAsync(node);
|
|
83
|
-
onLayout(event), DebounceTimers.delete(node);
|
|
84
|
-
} else {
|
|
85
|
-
const remainingDelay = DEBOUNCE_DELAY - timeSinceChange,
|
|
86
|
-
newTimer = setTimeout(async () => {
|
|
87
|
-
const event = await getElementLayoutEventAsync(node);
|
|
88
|
-
onLayout(event), DebounceTimers.delete(node);
|
|
89
|
-
}, remainingDelay);
|
|
90
|
-
DebounceTimers.set(node, newTimer);
|
|
91
|
-
}
|
|
92
|
-
}, DEBOUNCE_DELAY);
|
|
93
|
-
DebounceTimers.set(node, timer);
|
|
94
|
-
} else {
|
|
95
|
-
const event = getElementLayoutEvent(node);
|
|
96
|
-
onLayout(event);
|
|
75
|
+
!(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && (!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
|
|
76
|
+
if (NodeRectCache.set(node, nodeRect), parentRect && parentNode && ParentRectCache.set(parentNode, parentRect), avoidUpdates) {
|
|
77
|
+
const event = getElementLayoutEvent(nodeRect, parentRect);
|
|
78
|
+
queuedUpdates.set(node, () => onLayout(event));
|
|
79
|
+
} else if (strategy !== "async") {
|
|
80
|
+
const event = getElementLayoutEvent(nodeRect, parentRect);
|
|
81
|
+
onLayout(event);
|
|
82
|
+
}
|
|
97
83
|
}
|
|
98
84
|
}
|
|
99
85
|
rAF(layoutOnAnimationFrame);
|
|
100
86
|
} else process.env.NODE_ENV === "development" && console.warn("No requestAnimationFrame - please polyfill for onLayout to work correctly");
|
|
101
|
-
const getElementLayoutEvent =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
y,
|
|
109
|
-
width,
|
|
110
|
-
height,
|
|
111
|
-
left,
|
|
112
|
-
top
|
|
113
|
-
},
|
|
114
|
-
target
|
|
115
|
-
},
|
|
116
|
-
timeStamp: Date.now()
|
|
117
|
-
};
|
|
118
|
-
}), !res) throw new Error("\u203C\uFE0F");
|
|
119
|
-
return res;
|
|
120
|
-
},
|
|
87
|
+
const getElementLayoutEvent = (nodeRect, parentRect) => ({
|
|
88
|
+
nativeEvent: {
|
|
89
|
+
layout: getRelativeDimensions(nodeRect, parentRect),
|
|
90
|
+
target: nodeRect
|
|
91
|
+
},
|
|
92
|
+
timeStamp: Date.now()
|
|
93
|
+
}),
|
|
121
94
|
measureLayout = (node, relativeTo, callback) => {
|
|
122
95
|
const relativeNode = relativeTo || node?.parentElement;
|
|
123
96
|
if (relativeNode instanceof HTMLElement) {
|
|
@@ -150,7 +123,7 @@ const getElementLayoutEvent = target => {
|
|
|
150
123
|
measureLayoutAsync = async (node, relativeTo) => {
|
|
151
124
|
const relativeNode = relativeTo || node?.parentElement;
|
|
152
125
|
if (relativeNode instanceof HTMLElement) {
|
|
153
|
-
const [nodeDim, relativeNodeDim] = await Promise.all([node
|
|
126
|
+
const [nodeDim, relativeNodeDim] = await Promise.all([getBoundingClientRectAsync(node), getBoundingClientRectAsync(relativeNode)]);
|
|
154
127
|
if (relativeNodeDim && nodeDim) {
|
|
155
128
|
const {
|
|
156
129
|
x,
|
|
@@ -195,17 +168,25 @@ function useElementLayout(ref, onLayout) {
|
|
|
195
168
|
node && onLayout && LayoutHandlers.set(node, onLayout), (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
196
169
|
if (!onLayout) return;
|
|
197
170
|
const node2 = ref.current?.host;
|
|
198
|
-
if (node2) return
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
171
|
+
if (!node2) return;
|
|
172
|
+
LayoutHandlers.set(node2, onLayout), Nodes.add(node2);
|
|
173
|
+
const parentNode = node2.parentNode;
|
|
174
|
+
return parentNode && onLayout(getElementLayoutEvent(node2.getBoundingClientRect(), parentNode.getBoundingClientRect())), () => {
|
|
175
|
+
Nodes.delete(node2), LayoutHandlers.delete(node2), NodeRectCache.delete(node2), LastChangeTime.delete(node2);
|
|
202
176
|
};
|
|
203
177
|
}, [ref, !!onLayout]);
|
|
204
178
|
}
|
|
205
179
|
function ensureWebElement(x) {
|
|
206
180
|
if (!(typeof HTMLElement > "u")) return x instanceof HTMLElement ? x : void 0;
|
|
207
181
|
}
|
|
208
|
-
const
|
|
182
|
+
const getBoundingClientRectAsync = node => new Promise(res => {
|
|
183
|
+
if (!node || node.nodeType !== 1) return;
|
|
184
|
+
const io = new IntersectionObserver(entries => (io.disconnect(), res(entries[0].boundingClientRect)), {
|
|
185
|
+
threshold: 0
|
|
186
|
+
});
|
|
187
|
+
io.observe(node);
|
|
188
|
+
}),
|
|
189
|
+
getBoundingClientRect = node => {
|
|
209
190
|
if (!(!node || node.nodeType !== 1)) return node.getBoundingClientRect?.();
|
|
210
191
|
},
|
|
211
192
|
getRect = node => {
|
package/dist/cjs/index.js
CHANGED
|
@@ -30,7 +30,8 @@ let strategy = "async";
|
|
|
30
30
|
function setOnLayoutStrategy(state) {
|
|
31
31
|
strategy = state;
|
|
32
32
|
}
|
|
33
|
-
const NodeRectCache = /* @__PURE__ */ new WeakMap(), ParentRectCache = /* @__PURE__ */ new WeakMap()
|
|
33
|
+
const NodeRectCache = /* @__PURE__ */ new WeakMap(), ParentRectCache = /* @__PURE__ */ new WeakMap();
|
|
34
|
+
const LastChangeTime = /* @__PURE__ */ new WeakMap(), rAF = typeof window < "u" ? window.requestAnimationFrame : void 0;
|
|
34
35
|
let avoidUpdates = !0;
|
|
35
36
|
const queuedUpdates = /* @__PURE__ */ new Map();
|
|
36
37
|
function enable() {
|
|
@@ -40,61 +41,52 @@ if (import_constants.isClient)
|
|
|
40
41
|
if (rAF) {
|
|
41
42
|
let layoutOnAnimationFrame = function() {
|
|
42
43
|
const now = Date.now(), timeSinceLastFrame = now - lastFrameAt;
|
|
43
|
-
lastFrameAt = now, strategy !== "off" && (timeSinceLastFrame > 16.67 * numDroppedFramesUntilPause || Nodes.forEach(
|
|
44
|
+
lastFrameAt = now, strategy !== "off" && (timeSinceLastFrame > 16.67 * numDroppedFramesUntilPause || Nodes.forEach((node) => {
|
|
45
|
+
updateLayoutIfChanged(node, lastFrameAt);
|
|
46
|
+
})), rAF(layoutOnAnimationFrame);
|
|
44
47
|
}, lastFrameAt = Date.now();
|
|
45
48
|
const numDroppedFramesUntilPause = 2;
|
|
46
|
-
async function updateLayoutIfChanged(node) {
|
|
47
|
-
const
|
|
49
|
+
async function updateLayoutIfChanged(node, frameId) {
|
|
50
|
+
const parentNode = node.parentElement;
|
|
51
|
+
let nodeRect, parentRect;
|
|
52
|
+
if (strategy === "async") {
|
|
53
|
+
const [nr, pr] = await Promise.all([
|
|
54
|
+
getBoundingClientRectAsync(node),
|
|
55
|
+
getBoundingClientRectAsync(parentNode)
|
|
56
|
+
]);
|
|
57
|
+
if (frameId !== lastFrameAt)
|
|
58
|
+
return;
|
|
59
|
+
nodeRect = nr, parentRect = pr;
|
|
60
|
+
} else
|
|
61
|
+
nodeRect = node.getBoundingClientRect(), parentRect = parentNode?.getBoundingClientRect();
|
|
62
|
+
if (!parentRect)
|
|
63
|
+
return;
|
|
64
|
+
const onLayout = LayoutHandlers.get(node);
|
|
48
65
|
if (typeof onLayout != "function") return;
|
|
49
66
|
const cachedRect = NodeRectCache.get(node), cachedParentRect = parentNode ? NodeRectCache.get(parentNode) : null;
|
|
50
67
|
if (!cachedRect || // has changed one rect
|
|
51
|
-
!(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && (!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect)))
|
|
68
|
+
!(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && (!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
|
|
52
69
|
if (NodeRectCache.set(node, nodeRect), parentRect && parentNode && ParentRectCache.set(parentNode, parentRect), avoidUpdates) {
|
|
53
|
-
const event = getElementLayoutEvent(
|
|
70
|
+
const event = getElementLayoutEvent(nodeRect, parentRect);
|
|
54
71
|
queuedUpdates.set(node, () => onLayout(event));
|
|
55
|
-
} else if (strategy
|
|
56
|
-
const
|
|
57
|
-
LastChangeTime.set(node, now);
|
|
58
|
-
const existingTimer = DebounceTimers.get(node);
|
|
59
|
-
existingTimer && clearTimeout(existingTimer);
|
|
60
|
-
const timer = setTimeout(async () => {
|
|
61
|
-
const lastChange = LastChangeTime.get(node) || 0, timeSinceChange = Date.now() - lastChange;
|
|
62
|
-
if (timeSinceChange >= DEBOUNCE_DELAY) {
|
|
63
|
-
const event = await getElementLayoutEventAsync(node);
|
|
64
|
-
onLayout(event), DebounceTimers.delete(node);
|
|
65
|
-
} else {
|
|
66
|
-
const remainingDelay = DEBOUNCE_DELAY - timeSinceChange, newTimer = setTimeout(async () => {
|
|
67
|
-
const event = await getElementLayoutEventAsync(node);
|
|
68
|
-
onLayout(event), DebounceTimers.delete(node);
|
|
69
|
-
}, remainingDelay);
|
|
70
|
-
DebounceTimers.set(node, newTimer);
|
|
71
|
-
}
|
|
72
|
-
}, DEBOUNCE_DELAY);
|
|
73
|
-
DebounceTimers.set(node, timer);
|
|
74
|
-
} else {
|
|
75
|
-
const event = getElementLayoutEvent(node);
|
|
72
|
+
} else if (strategy !== "async") {
|
|
73
|
+
const event = getElementLayoutEvent(nodeRect, parentRect);
|
|
76
74
|
onLayout(event);
|
|
77
75
|
}
|
|
76
|
+
}
|
|
78
77
|
}
|
|
79
78
|
rAF(layoutOnAnimationFrame);
|
|
80
79
|
} else
|
|
81
80
|
process.env.NODE_ENV === "development" && console.warn(
|
|
82
81
|
"No requestAnimationFrame - please polyfill for onLayout to work correctly"
|
|
83
82
|
);
|
|
84
|
-
const getElementLayoutEvent = (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
timeStamp: Date.now()
|
|
93
|
-
};
|
|
94
|
-
}), !res)
|
|
95
|
-
throw new Error("\u203C\uFE0F");
|
|
96
|
-
return res;
|
|
97
|
-
}, measureLayout = (node, relativeTo, callback) => {
|
|
83
|
+
const getElementLayoutEvent = (nodeRect, parentRect) => ({
|
|
84
|
+
nativeEvent: {
|
|
85
|
+
layout: getRelativeDimensions(nodeRect, parentRect),
|
|
86
|
+
target: nodeRect
|
|
87
|
+
},
|
|
88
|
+
timeStamp: Date.now()
|
|
89
|
+
}), measureLayout = (node, relativeTo, callback) => {
|
|
98
90
|
const relativeNode = relativeTo || node?.parentElement;
|
|
99
91
|
if (relativeNode instanceof HTMLElement) {
|
|
100
92
|
const nodeDim = node.getBoundingClientRect(), relativeNodeDim = relativeNode.getBoundingClientRect();
|
|
@@ -121,8 +113,8 @@ const getElementLayoutEvent = (target) => {
|
|
|
121
113
|
const relativeNode = relativeTo || node?.parentElement;
|
|
122
114
|
if (relativeNode instanceof HTMLElement) {
|
|
123
115
|
const [nodeDim, relativeNodeDim] = await Promise.all([
|
|
124
|
-
node
|
|
125
|
-
relativeNode
|
|
116
|
+
getBoundingClientRectAsync(node),
|
|
117
|
+
getBoundingClientRectAsync(relativeNode)
|
|
126
118
|
]);
|
|
127
119
|
if (relativeNodeDim && nodeDim) {
|
|
128
120
|
const { x, y, width, height, left, top } = getRelativeDimensions(
|
|
@@ -142,19 +134,33 @@ function useElementLayout(ref, onLayout) {
|
|
|
142
134
|
node && onLayout && LayoutHandlers.set(node, onLayout), (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
143
135
|
if (!onLayout) return;
|
|
144
136
|
const node2 = ref.current?.host;
|
|
145
|
-
if (node2)
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
137
|
+
if (!node2) return;
|
|
138
|
+
LayoutHandlers.set(node2, onLayout), Nodes.add(node2);
|
|
139
|
+
const parentNode = node2.parentNode;
|
|
140
|
+
return parentNode && onLayout(
|
|
141
|
+
getElementLayoutEvent(
|
|
142
|
+
node2.getBoundingClientRect(),
|
|
143
|
+
parentNode.getBoundingClientRect()
|
|
144
|
+
)
|
|
145
|
+
), () => {
|
|
146
|
+
Nodes.delete(node2), LayoutHandlers.delete(node2), NodeRectCache.delete(node2), LastChangeTime.delete(node2);
|
|
147
|
+
};
|
|
151
148
|
}, [ref, !!onLayout]);
|
|
152
149
|
}
|
|
153
150
|
function ensureWebElement(x) {
|
|
154
151
|
if (!(typeof HTMLElement > "u"))
|
|
155
152
|
return x instanceof HTMLElement ? x : void 0;
|
|
156
153
|
}
|
|
157
|
-
const
|
|
154
|
+
const getBoundingClientRectAsync = (node) => new Promise((res) => {
|
|
155
|
+
if (!node || node.nodeType !== 1) return;
|
|
156
|
+
const io = new IntersectionObserver(
|
|
157
|
+
(entries) => (io.disconnect(), res(entries[0].boundingClientRect)),
|
|
158
|
+
{
|
|
159
|
+
threshold: 0
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
io.observe(node);
|
|
163
|
+
}), getBoundingClientRect = (node) => {
|
|
158
164
|
if (!(!node || node.nodeType !== 1))
|
|
159
165
|
return node.getBoundingClientRect?.();
|
|
160
166
|
}, getRect = (node) => {
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAoD,+BACpD,0BAA+B;AAG/B,MAAM,iBAAiB,oBAAI,QAA+B,GACpD,QAAQ,oBAAI,IAAiB;AAQnC,IAAI,WAAsC;AAEnC,SAAS,oBAAoB,OAAwC;AAC1E,aAAW;AACb;AAmBA,MAAM,gBAAgB,oBAAI,QAA8B,GAClD,kBAAkB,oBAAI,QAA8B,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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OA,KAAI;AAAA,IAC5B;AAAA,EACF,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;AACtB;AAEA,SAAS,iBAAoB,GAA+B;AAC1D,MAAI,SAAO,cAAgB;AAG3B,WAAO,aAAa,cAAc,IAAI;AACxC;AAEA,MAAM,6BAA6B,CACjC,SAEO,IAAI,QAAyB,CAAC,QAAQ;AAC3C,MAAI,CAAC,QAAQ,KAAK,aAAa,EAAG;AAClC,QAAM,KAAK,IAAI;AAAA,IACb,CAAC,aACC,GAAG,WAAW,GACP,IAAI,QAAQ,CAAC,EAAE,kBAAkB;AAAA,IAE1C;AAAA,MACE,WAAW;AAAA,IACb;AAAA,EACF;AACA,KAAG,QAAQ,IAAI;AACjB,CAAC,GAGG,wBAAwB,CAAC,SAAkD;AAC/E,MAAI,GAAC,QAAQ,KAAK,aAAa;AAC/B,WAAO,KAAK,wBAAwB;AACtC,GAEa,UAAU,CAAC,SAA+C;AACrE,QAAM,OAAO,sBAAsB,IAAI;AACvC,MAAI,CAAC,KAAM;AACX,QAAM,EAAE,GAAG,GAAG,KAAK,KAAK,IAAI;AAC5B,SAAO,EAAE,GAAG,GAAG,OAAO,KAAK,aAAa,QAAQ,KAAK,cAAc,KAAK,KAAK;AAC/E;",
|
|
5
5
|
"names": ["node"]
|
|
6
6
|
}
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -29,7 +29,8 @@ var import_constants = require("@tamagui/constants"), import_is_equal_shallow =
|
|
|
29
29
|
function setOnLayoutStrategy(state) {
|
|
30
30
|
strategy = state;
|
|
31
31
|
}
|
|
32
|
-
var NodeRectCache = /* @__PURE__ */ new WeakMap(), ParentRectCache = /* @__PURE__ */ new WeakMap()
|
|
32
|
+
var NodeRectCache = /* @__PURE__ */ new WeakMap(), ParentRectCache = /* @__PURE__ */ new WeakMap();
|
|
33
|
+
var LastChangeTime = /* @__PURE__ */ new WeakMap(), rAF = typeof window < "u" ? window.requestAnimationFrame : void 0, avoidUpdates = !0, queuedUpdates = /* @__PURE__ */ new Map();
|
|
33
34
|
function enable() {
|
|
34
35
|
avoidUpdates && (avoidUpdates = !1, queuedUpdates && (queuedUpdates.forEach(function(cb) {
|
|
35
36
|
return cb();
|
|
@@ -41,70 +42,55 @@ if (import_constants.isClient)
|
|
|
41
42
|
var now = Date.now(), timeSinceLastFrame = now - lastFrameAt;
|
|
42
43
|
if (lastFrameAt = now, strategy !== "off") {
|
|
43
44
|
var expectedFrameTime = 16.67, hasRecentSyncWork = timeSinceLastFrame > expectedFrameTime * numDroppedFramesUntilPause;
|
|
44
|
-
hasRecentSyncWork || Nodes.forEach(
|
|
45
|
+
hasRecentSyncWork || Nodes.forEach(function(node) {
|
|
46
|
+
updateLayoutIfChanged(node, lastFrameAt);
|
|
47
|
+
});
|
|
45
48
|
}
|
|
46
49
|
rAF(layoutOnAnimationFrame);
|
|
47
50
|
};
|
|
48
51
|
var layoutOnAnimationFrame2 = layoutOnAnimationFrame, lastFrameAt = Date.now(), numDroppedFramesUntilPause = 2;
|
|
49
|
-
async function updateLayoutIfChanged(node) {
|
|
50
|
-
var
|
|
51
|
-
if (
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
}, DEBOUNCE_DELAY);
|
|
78
|
-
DebounceTimers.set(node, timer);
|
|
79
|
-
} else {
|
|
80
|
-
var event1 = getElementLayoutEvent(node);
|
|
81
|
-
onLayout(event1);
|
|
52
|
+
async function updateLayoutIfChanged(node, frameId) {
|
|
53
|
+
var parentNode = node.parentElement, nodeRect, parentRect;
|
|
54
|
+
if (strategy === "async") {
|
|
55
|
+
var [nr, pr] = await Promise.all([
|
|
56
|
+
getBoundingClientRectAsync(node),
|
|
57
|
+
getBoundingClientRectAsync(parentNode)
|
|
58
|
+
]);
|
|
59
|
+
if (frameId !== lastFrameAt)
|
|
60
|
+
return;
|
|
61
|
+
nodeRect = nr, parentRect = pr;
|
|
62
|
+
} else
|
|
63
|
+
nodeRect = node.getBoundingClientRect(), parentRect = parentNode == null ? void 0 : parentNode.getBoundingClientRect();
|
|
64
|
+
if (parentRect) {
|
|
65
|
+
var onLayout = LayoutHandlers.get(node);
|
|
66
|
+
if (typeof onLayout == "function") {
|
|
67
|
+
var cachedRect = NodeRectCache.get(node), cachedParentRect = parentNode ? NodeRectCache.get(parentNode) : null;
|
|
68
|
+
if (!cachedRect || // has changed one rect
|
|
69
|
+
!(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && (!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
|
|
70
|
+
if (NodeRectCache.set(node, nodeRect), parentRect && parentNode && ParentRectCache.set(parentNode, parentRect), avoidUpdates) {
|
|
71
|
+
var event = getElementLayoutEvent(nodeRect, parentRect);
|
|
72
|
+
queuedUpdates.set(node, function() {
|
|
73
|
+
return onLayout(event);
|
|
74
|
+
});
|
|
75
|
+
} else if (strategy !== "async") {
|
|
76
|
+
var event1 = getElementLayoutEvent(nodeRect, parentRect);
|
|
77
|
+
onLayout(event1);
|
|
78
|
+
}
|
|
82
79
|
}
|
|
80
|
+
}
|
|
83
81
|
}
|
|
84
82
|
}
|
|
85
83
|
rAF(layoutOnAnimationFrame);
|
|
86
84
|
} else
|
|
87
85
|
process.env.NODE_ENV === "development" && console.warn("No requestAnimationFrame - please polyfill for onLayout to work correctly");
|
|
88
|
-
var getElementLayoutEvent = function(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
width,
|
|
97
|
-
height,
|
|
98
|
-
left,
|
|
99
|
-
top
|
|
100
|
-
},
|
|
101
|
-
target
|
|
102
|
-
},
|
|
103
|
-
timeStamp: Date.now()
|
|
104
|
-
};
|
|
105
|
-
}), !res)
|
|
106
|
-
throw new Error("\u203C\uFE0F");
|
|
107
|
-
return res;
|
|
86
|
+
var getElementLayoutEvent = function(nodeRect, parentRect) {
|
|
87
|
+
return {
|
|
88
|
+
nativeEvent: {
|
|
89
|
+
layout: getRelativeDimensions(nodeRect, parentRect),
|
|
90
|
+
target: nodeRect
|
|
91
|
+
},
|
|
92
|
+
timeStamp: Date.now()
|
|
93
|
+
};
|
|
108
94
|
}, measureLayout = function(node, relativeTo, callback) {
|
|
109
95
|
var relativeNode = relativeTo || (node == null ? void 0 : node.parentElement);
|
|
110
96
|
if (relativeNode instanceof HTMLElement) {
|
|
@@ -129,8 +115,8 @@ var getElementLayoutEvent = function(target) {
|
|
|
129
115
|
var relativeNode = relativeTo || (node == null ? void 0 : node.parentElement);
|
|
130
116
|
if (relativeNode instanceof HTMLElement) {
|
|
131
117
|
var [nodeDim, relativeNodeDim] = await Promise.all([
|
|
132
|
-
node
|
|
133
|
-
relativeNode
|
|
118
|
+
getBoundingClientRectAsync(node),
|
|
119
|
+
getBoundingClientRectAsync(relativeNode)
|
|
134
120
|
]);
|
|
135
121
|
if (relativeNodeDim && nodeDim) {
|
|
136
122
|
var { x, y, width, height, left, top } = getRelativeDimensions(nodeDim, relativeNodeDim);
|
|
@@ -162,12 +148,13 @@ function useElementLayout(ref, onLayout) {
|
|
|
162
148
|
var _ref_current2;
|
|
163
149
|
if (onLayout) {
|
|
164
150
|
var node2 = (_ref_current2 = ref.current) === null || _ref_current2 === void 0 ? void 0 : _ref_current2.host;
|
|
165
|
-
if (node2)
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
151
|
+
if (node2) {
|
|
152
|
+
LayoutHandlers.set(node2, onLayout), Nodes.add(node2);
|
|
153
|
+
var parentNode = node2.parentNode;
|
|
154
|
+
return parentNode && onLayout(getElementLayoutEvent(node2.getBoundingClientRect(), parentNode.getBoundingClientRect())), function() {
|
|
155
|
+
Nodes.delete(node2), LayoutHandlers.delete(node2), NodeRectCache.delete(node2), LastChangeTime.delete(node2);
|
|
170
156
|
};
|
|
157
|
+
}
|
|
171
158
|
}
|
|
172
159
|
}, [
|
|
173
160
|
ref,
|
|
@@ -178,7 +165,18 @@ function ensureWebElement(x) {
|
|
|
178
165
|
if (!(typeof HTMLElement > "u"))
|
|
179
166
|
return x instanceof HTMLElement ? x : void 0;
|
|
180
167
|
}
|
|
181
|
-
var
|
|
168
|
+
var getBoundingClientRectAsync = function(node) {
|
|
169
|
+
return new Promise(function(res) {
|
|
170
|
+
if (!(!node || node.nodeType !== 1)) {
|
|
171
|
+
var io = new IntersectionObserver(function(entries) {
|
|
172
|
+
return io.disconnect(), res(entries[0].boundingClientRect);
|
|
173
|
+
}, {
|
|
174
|
+
threshold: 0
|
|
175
|
+
});
|
|
176
|
+
io.observe(node);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}, getBoundingClientRect = function(node) {
|
|
182
180
|
var _node_getBoundingClientRect;
|
|
183
181
|
if (!(!node || node.nodeType !== 1))
|
|
184
182
|
return (_node_getBoundingClientRect = node.getBoundingClientRect) === null || _node_getBoundingClientRect === void 0 ? void 0 : _node_getBoundingClientRect.call(node);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;uBAAoD,+BACpD,0BAA+B,sCAGzBA,iBAAiB,oBAAIC,QAAAA,GACrBC,QAAQ,oBAAIC,IAAAA,GAQdC,WAAsC;AAEnC,SAASC,oBAAoBC,OAAgC;AAClEF,aAAWE;AACb;AAmBA,IAAMC,gBAAgB,oBAAIN,QAAAA,GACpBO,kBAAkB,oBAAIP,Q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AAO1D,sBAAsBZ,IAAAA;AACnC,MAAKsE,MACL;QAAM,EAAE7B,GAAGC,GAAGI,KAAKD,KAAI,IAAKyB;AAC5B,WAAO;MAAE7B;MAAGC;MAAGC,OAAO3C,KAAKuE;MAAa3B,QAAQ5C,KAAKwE;MAAc1B;MAAKD;IAAK;;AAC/E;",
|
|
5
|
+
"names": ["LayoutHandlers", "WeakMap", "Nodes", "Set", "strategy", "setOnLayoutStrategy", "state", "NodeRectCache", "ParentRectCache", "LastChangeTime", "WeakMap", "rAF", "window", "requestAnimationFrame", "undefined", "avoidUpdates", "queuedUpdates", "Map", "enable", "forEach", "cb", "clear", "isClient", "layoutOnAnimationFrame", "now", "Date", "timeSinceLastFrame", "lastFrameAt", "strategy", "expectedFrameTime", "hasRecentSyncWork", "numDroppedFramesUntilPause", "Nodes", "node", "updateLayoutIfChanged", "frameId", "parentNode", "parentElement", "nodeRect", "parentRect", "nr", "pr", "Promise", "all", "getBoundingClientRectAsync", "getBoundingClientRect", "onLayout", "LayoutHandlers", "get", "cachedRect", "NodeRectCache", "cachedParentRect", "isEqualShallow", "set", "ParentRectCache", "event", "getElementLayoutEvent", "process", "env", "NODE_ENV", "console", "warn", "nativeEvent", "layout", "getRelativeDimensions", "target", "timeStamp", "measureLayout", "relativeTo", "callback", "relativeNode", "HTMLElement", "nodeDim", "relativeNodeDim", "x", "y", "width", "height", "left", "top", "getElementLayoutEventAsync", "measureLayoutAsync", "Error", "a", "b", "useElementLayout", "ref", "ensureWebElement", "current", "host", "useIsomorphicLayoutEffect", "add", "delete", "res", "nodeType", "io", "IntersectionObserver", "entries", "disconnect", "boundingClientRect", "threshold", "observe", "getRect", "rect", "offsetWidth", "offsetHeight"]
|
|
6
6
|
}
|