@hanzogui/use-element-layout 8.3.1 → 8.3.3
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.js +444 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/index.js +381 -278
- package/dist/esm/index.js.map +1 -1
- package/package.json +20 -15
- package/types/index.d.ts +21 -22
- package/types/index.d.ts.map +1 -11
- package/dist/cjs/index.cjs +0 -362
- package/dist/cjs/index.native.js +0 -435
- package/dist/cjs/index.native.js.map +0 -1
- package/dist/esm/index.mjs +0 -324
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js +0 -394
- package/dist/esm/index.native.js.map +0 -1
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.measureLayout = exports.createMeasureInWindow = exports.measureInWindow = exports.measure = exports.measureNode = exports.getBoundingClientRectAsync = exports.getElementLayoutEvent = exports.LayoutMeasurementController = void 0;
|
|
4
|
+
exports.setOnLayoutStrategy = setOnLayoutStrategy;
|
|
5
|
+
exports.enable = enable;
|
|
6
|
+
exports.registerLayoutNode = registerLayoutNode;
|
|
7
|
+
exports.useElementLayout = useElementLayout;
|
|
8
|
+
exports.createMeasure = createMeasure;
|
|
9
|
+
exports.createMeasureLayout = createMeasureLayout;
|
|
10
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
11
|
+
const constants_1 = require("@hanzogui/constants");
|
|
12
|
+
const react_1 = require("react");
|
|
13
|
+
const LayoutHandlers = new WeakMap();
|
|
14
|
+
const LayoutDisableKey = new WeakMap();
|
|
15
|
+
const Nodes = new Set();
|
|
16
|
+
const IntersectionState = new WeakMap();
|
|
17
|
+
// feature flag to enable pre-transform dimension reporting (matches RN behavior)
|
|
18
|
+
// can be set via env var at build time or runtime global for testing
|
|
19
|
+
// see: https://github.com/hanzoai/gui/pull/2329
|
|
20
|
+
const usePretransformDimensions = () => globalThis.__GUI_ONLAYOUT_PRETRANSFORM === true ||
|
|
21
|
+
process.env.GUI_ONLAYOUT_PRETRANSFORM === '1';
|
|
22
|
+
let _debugLayout;
|
|
23
|
+
function isDebugLayout() {
|
|
24
|
+
if (_debugLayout === undefined) {
|
|
25
|
+
_debugLayout =
|
|
26
|
+
typeof window !== 'undefined' &&
|
|
27
|
+
new URLSearchParams(window.location.search).has('__tamaDebugLayout');
|
|
28
|
+
}
|
|
29
|
+
return _debugLayout;
|
|
30
|
+
}
|
|
31
|
+
// separating to avoid all re-rendering
|
|
32
|
+
const DisableLayoutContextValues = {};
|
|
33
|
+
const DisableLayoutContextKey = (0, react_1.createContext)('');
|
|
34
|
+
const ENABLE = "web" === 'web' && typeof IntersectionObserver !== 'undefined';
|
|
35
|
+
// internal testing - advanced helper to turn off layout measurement for extra performance
|
|
36
|
+
// TODO document!
|
|
37
|
+
// TODO could add frame skip control here
|
|
38
|
+
const LayoutMeasurementController = ({ disable, children, }) => {
|
|
39
|
+
const id = (0, react_1.useId)();
|
|
40
|
+
(0, constants_1.useIsomorphicLayoutEffect)(() => {
|
|
41
|
+
DisableLayoutContextValues[id] = disable;
|
|
42
|
+
}, [disable, id]);
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)(DisableLayoutContextKey.Provider, { value: id, children: children }));
|
|
44
|
+
};
|
|
45
|
+
exports.LayoutMeasurementController = LayoutMeasurementController;
|
|
46
|
+
// Single persistent IntersectionObserver for visibility tracking
|
|
47
|
+
let globalIntersectionObserver = null;
|
|
48
|
+
let strategy = 'async';
|
|
49
|
+
function setOnLayoutStrategy(state) {
|
|
50
|
+
strategy = state;
|
|
51
|
+
}
|
|
52
|
+
const NodeRectCache = new WeakMap();
|
|
53
|
+
// prevent thrashing during first hydration (somewhat, streaming gets trickier)
|
|
54
|
+
let avoidUpdates = true;
|
|
55
|
+
const queuedUpdates = new Map();
|
|
56
|
+
function enable() {
|
|
57
|
+
if (avoidUpdates) {
|
|
58
|
+
avoidUpdates = false;
|
|
59
|
+
if (queuedUpdates) {
|
|
60
|
+
queuedUpdates.forEach((cb) => cb());
|
|
61
|
+
queuedUpdates.clear();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function startGlobalObservers() {
|
|
66
|
+
if (!ENABLE || globalIntersectionObserver)
|
|
67
|
+
return;
|
|
68
|
+
globalIntersectionObserver = new IntersectionObserver((entries) => {
|
|
69
|
+
for (let i = 0; i < entries.length; i++) {
|
|
70
|
+
const entry = entries[i];
|
|
71
|
+
const node = entry.target;
|
|
72
|
+
if (IntersectionState.get(node) !== entry.isIntersecting) {
|
|
73
|
+
IntersectionState.set(node, entry.isIntersecting);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
threshold: 0,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
// optimization: inline rect comparison to avoid function call overhead on hot path
|
|
81
|
+
function rectsEqual(a, b) {
|
|
82
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
83
|
+
}
|
|
84
|
+
if (ENABLE) {
|
|
85
|
+
const BoundingRects = new WeakMap();
|
|
86
|
+
// optimization: persistent IO for rect fetching, reused across cycles
|
|
87
|
+
let rectFetchObserver = null;
|
|
88
|
+
let rectFetchResolve = null;
|
|
89
|
+
let rectFetchStartTime = 0;
|
|
90
|
+
let lastCallbackDelay = 0;
|
|
91
|
+
function ensureRectFetchObserver() {
|
|
92
|
+
if (rectFetchObserver)
|
|
93
|
+
return rectFetchObserver;
|
|
94
|
+
rectFetchObserver = new IntersectionObserver((entries) => {
|
|
95
|
+
lastCallbackDelay = Math.round(performance.now() - rectFetchStartTime);
|
|
96
|
+
// store all rects
|
|
97
|
+
for (let i = 0; i < entries.length; i++) {
|
|
98
|
+
BoundingRects.set(entries[i].target, entries[i].boundingClientRect);
|
|
99
|
+
}
|
|
100
|
+
if (process.env.NODE_ENV === 'development' &&
|
|
101
|
+
isDebugLayout() &&
|
|
102
|
+
lastCallbackDelay > 50) {
|
|
103
|
+
console.warn('[onLayout-io-delay]', lastCallbackDelay + 'ms', entries.length, 'entries');
|
|
104
|
+
}
|
|
105
|
+
if (rectFetchResolve) {
|
|
106
|
+
rectFetchResolve(true);
|
|
107
|
+
rectFetchResolve = null;
|
|
108
|
+
}
|
|
109
|
+
}, {
|
|
110
|
+
threshold: 0,
|
|
111
|
+
});
|
|
112
|
+
return rectFetchObserver;
|
|
113
|
+
}
|
|
114
|
+
async function updateLayoutIfChanged(node) {
|
|
115
|
+
const onLayout = LayoutHandlers.get(node);
|
|
116
|
+
if (typeof onLayout !== 'function')
|
|
117
|
+
return;
|
|
118
|
+
const parentNode = node.parentElement;
|
|
119
|
+
if (!parentNode)
|
|
120
|
+
return;
|
|
121
|
+
let nodeRect;
|
|
122
|
+
let parentRect;
|
|
123
|
+
// respect the strategy contract
|
|
124
|
+
if (strategy === 'async') {
|
|
125
|
+
nodeRect = BoundingRects.get(node);
|
|
126
|
+
parentRect = BoundingRects.get(parentNode);
|
|
127
|
+
if (!nodeRect || !parentRect) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
nodeRect = node.getBoundingClientRect();
|
|
133
|
+
parentRect = parentNode.getBoundingClientRect();
|
|
134
|
+
}
|
|
135
|
+
emitLayoutIfChanged(node, parentNode, nodeRect, parentRect);
|
|
136
|
+
}
|
|
137
|
+
const rAF = typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame : undefined;
|
|
138
|
+
// adaptive frame skipping with backoff
|
|
139
|
+
const userSkipVal = process.env.GUI_LAYOUT_FRAME_SKIP;
|
|
140
|
+
const BASE_SKIP_FRAMES = userSkipVal ? +userSkipVal : 10;
|
|
141
|
+
const MAX_SKIP_FRAMES = 20;
|
|
142
|
+
let skipFrames = BASE_SKIP_FRAMES;
|
|
143
|
+
let frameCount = 0;
|
|
144
|
+
async function layoutOnAnimationFrame() {
|
|
145
|
+
// skip frames based on adaptive rate
|
|
146
|
+
if (frameCount++ % skipFrames !== 0) {
|
|
147
|
+
rAF ? rAF(layoutOnAnimationFrame) : setTimeout(layoutOnAnimationFrame, 16);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
// reset frame count to avoid overflow
|
|
151
|
+
if (frameCount >= Number.MAX_SAFE_INTEGER) {
|
|
152
|
+
frameCount = 0;
|
|
153
|
+
}
|
|
154
|
+
if (strategy !== 'off') {
|
|
155
|
+
const visibleNodes = [];
|
|
156
|
+
// optimization: deduplicate parent observations
|
|
157
|
+
const parentsToObserve = new Set();
|
|
158
|
+
// collect visible nodes and their unique parents
|
|
159
|
+
for (const node of Nodes) {
|
|
160
|
+
const parentElement = node.parentElement;
|
|
161
|
+
if (!(parentElement instanceof HTMLElement)) {
|
|
162
|
+
cleanupNode(node);
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
const disableKey = LayoutDisableKey.get(node);
|
|
166
|
+
if (disableKey && DisableLayoutContextValues[disableKey] === true)
|
|
167
|
+
continue;
|
|
168
|
+
if (IntersectionState.get(node) === false)
|
|
169
|
+
continue;
|
|
170
|
+
visibleNodes.push(node);
|
|
171
|
+
parentsToObserve.add(parentElement);
|
|
172
|
+
}
|
|
173
|
+
if (visibleNodes.length > 0) {
|
|
174
|
+
const io = ensureRectFetchObserver();
|
|
175
|
+
rectFetchStartTime = performance.now();
|
|
176
|
+
// observe all nodes
|
|
177
|
+
for (let i = 0; i < visibleNodes.length; i++) {
|
|
178
|
+
io.observe(visibleNodes[i]);
|
|
179
|
+
}
|
|
180
|
+
// optimization: observe unique parents only (not N times for N children)
|
|
181
|
+
for (const parent of parentsToObserve) {
|
|
182
|
+
io.observe(parent);
|
|
183
|
+
}
|
|
184
|
+
// wait for callback
|
|
185
|
+
await new Promise((res) => {
|
|
186
|
+
rectFetchResolve = res;
|
|
187
|
+
});
|
|
188
|
+
// unobserve all to reset for next cycle
|
|
189
|
+
for (let i = 0; i < visibleNodes.length; i++) {
|
|
190
|
+
io.unobserve(visibleNodes[i]);
|
|
191
|
+
}
|
|
192
|
+
for (const parent of parentsToObserve) {
|
|
193
|
+
io.unobserve(parent);
|
|
194
|
+
}
|
|
195
|
+
// adaptive backoff: if IO was slow, skip more frames next cycle
|
|
196
|
+
if (lastCallbackDelay > 50) {
|
|
197
|
+
skipFrames = Math.min(skipFrames + 2, MAX_SKIP_FRAMES);
|
|
198
|
+
}
|
|
199
|
+
else if (lastCallbackDelay < 20) {
|
|
200
|
+
// recover back to base rate when things are fast
|
|
201
|
+
skipFrames = Math.max(skipFrames - 1, BASE_SKIP_FRAMES);
|
|
202
|
+
}
|
|
203
|
+
// process updates
|
|
204
|
+
for (let i = 0; i < visibleNodes.length; i++) {
|
|
205
|
+
updateLayoutIfChanged(visibleNodes[i]);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// schedule next frame
|
|
210
|
+
rAF ? rAF(layoutOnAnimationFrame) : setTimeout(layoutOnAnimationFrame, 16);
|
|
211
|
+
}
|
|
212
|
+
layoutOnAnimationFrame();
|
|
213
|
+
}
|
|
214
|
+
const getElementLayoutEvent = (nodeRect, parentRect, node) => {
|
|
215
|
+
return {
|
|
216
|
+
nativeEvent: {
|
|
217
|
+
layout: getRelativeDimensions(nodeRect, parentRect, node),
|
|
218
|
+
target: nodeRect,
|
|
219
|
+
},
|
|
220
|
+
timeStamp: Date.now(),
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
exports.getElementLayoutEvent = getElementLayoutEvent;
|
|
224
|
+
/**
|
|
225
|
+
* get pre-transform dimensions for a node.
|
|
226
|
+
* uses offsetWidth/offsetHeight which report CSS layout dimensions
|
|
227
|
+
* unaffected by transforms - this matches React Native's onLayout behavior.
|
|
228
|
+
*
|
|
229
|
+
* see: https://github.com/hanzoai/gui/pull/2329
|
|
230
|
+
*/
|
|
231
|
+
const getPreTransformDimensions = (node) => {
|
|
232
|
+
return {
|
|
233
|
+
width: node.offsetWidth,
|
|
234
|
+
height: node.offsetHeight,
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
const getRelativeDimensions = (a, b, aNode) => {
|
|
238
|
+
const { left, top } = a;
|
|
239
|
+
const x = left - b.left;
|
|
240
|
+
const y = top - b.top;
|
|
241
|
+
// get pre-transform dimensions when flag is enabled and node is available
|
|
242
|
+
const { width, height } = usePretransformDimensions() && aNode
|
|
243
|
+
? getPreTransformDimensions(aNode)
|
|
244
|
+
: { width: a.width, height: a.height };
|
|
245
|
+
return { x, y, width, height, pageX: a.left, pageY: a.top };
|
|
246
|
+
};
|
|
247
|
+
function emitLayoutIfChanged(node, parentNode, nodeRect, parentRect) {
|
|
248
|
+
const onLayout = LayoutHandlers.get(node);
|
|
249
|
+
if (typeof onLayout !== 'function')
|
|
250
|
+
return;
|
|
251
|
+
const cachedRect = NodeRectCache.get(node);
|
|
252
|
+
const cachedParentRect = NodeRectCache.get(parentNode);
|
|
253
|
+
const nodeChanged = !cachedRect || !rectsEqual(cachedRect, nodeRect);
|
|
254
|
+
const parentChanged = !cachedParentRect || !rectsEqual(cachedParentRect, parentRect);
|
|
255
|
+
if (!nodeChanged && !parentChanged)
|
|
256
|
+
return;
|
|
257
|
+
NodeRectCache.set(node, nodeRect);
|
|
258
|
+
NodeRectCache.set(parentNode, parentRect);
|
|
259
|
+
const event = (0, exports.getElementLayoutEvent)(nodeRect, parentRect, node);
|
|
260
|
+
if (process.env.NODE_ENV === 'development' && isDebugLayout()) {
|
|
261
|
+
console.log('[useElementLayout] change', {
|
|
262
|
+
tag: node.tagName,
|
|
263
|
+
id: node.id || undefined,
|
|
264
|
+
className: (node.className || '').slice(0, 60) || undefined,
|
|
265
|
+
layout: event.nativeEvent.layout,
|
|
266
|
+
first: !cachedRect,
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
if (avoidUpdates) {
|
|
270
|
+
queuedUpdates.set(node, () => onLayout(event));
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
onLayout(event);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function observeLayoutNode(node, disableKey) {
|
|
277
|
+
Nodes.add(node);
|
|
278
|
+
if (disableKey) {
|
|
279
|
+
LayoutDisableKey.set(node, disableKey);
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
LayoutDisableKey.delete(node);
|
|
283
|
+
}
|
|
284
|
+
startGlobalObservers();
|
|
285
|
+
if (globalIntersectionObserver) {
|
|
286
|
+
globalIntersectionObserver.observe(node);
|
|
287
|
+
IntersectionState.set(node, true);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
// register an arbitrary DOM element into the measurement loop without React lifecycle
|
|
291
|
+
function registerLayoutNode(node, onChange, disableKey) {
|
|
292
|
+
LayoutHandlers.set(node, onChange);
|
|
293
|
+
observeLayoutNode(node, disableKey);
|
|
294
|
+
return () => cleanupNode(node);
|
|
295
|
+
}
|
|
296
|
+
function cleanupNode(node) {
|
|
297
|
+
Nodes.delete(node);
|
|
298
|
+
LayoutHandlers.delete(node);
|
|
299
|
+
LayoutDisableKey.delete(node);
|
|
300
|
+
NodeRectCache.delete(node);
|
|
301
|
+
IntersectionState.delete(node);
|
|
302
|
+
if (globalIntersectionObserver) {
|
|
303
|
+
globalIntersectionObserver.unobserve(node);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
const PrevHostNode = new WeakMap();
|
|
307
|
+
// spec: onLayout fires one synchronous initial event on mount and on host swap
|
|
308
|
+
// (RN parity, and before-paint so consumers can position without flicker).
|
|
309
|
+
// bypasses the avoidUpdates queue on purpose; seeds the rect cache so the
|
|
310
|
+
// measurement loop doesn't re-emit an identical event a frame later.
|
|
311
|
+
function emitLayoutSync(node) {
|
|
312
|
+
const onLayout = LayoutHandlers.get(node);
|
|
313
|
+
if (typeof onLayout !== 'function')
|
|
314
|
+
return;
|
|
315
|
+
const parentNode = node.parentElement;
|
|
316
|
+
if (!parentNode)
|
|
317
|
+
return;
|
|
318
|
+
const nodeRect = node.getBoundingClientRect();
|
|
319
|
+
const parentRect = parentNode.getBoundingClientRect();
|
|
320
|
+
NodeRectCache.set(node, nodeRect);
|
|
321
|
+
NodeRectCache.set(parentNode, parentRect);
|
|
322
|
+
onLayout((0, exports.getElementLayoutEvent)(nodeRect, parentRect, node));
|
|
323
|
+
}
|
|
324
|
+
function useElementLayout(ref, onLayout) {
|
|
325
|
+
const disableKey = (0, react_1.useContext)(DisableLayoutContextKey);
|
|
326
|
+
// keep handlers up to date so polling always calls the latest callback
|
|
327
|
+
const node = ensureWebElement(ref.current?.host);
|
|
328
|
+
if (node && onLayout) {
|
|
329
|
+
LayoutHandlers.set(node, onLayout);
|
|
330
|
+
LayoutDisableKey.set(node, disableKey);
|
|
331
|
+
}
|
|
332
|
+
// detect mounts + host swaps after commit and fire the immediate sync layout event
|
|
333
|
+
(0, constants_1.useIsomorphicLayoutEffect)(() => {
|
|
334
|
+
if (!onLayout)
|
|
335
|
+
return;
|
|
336
|
+
const nextNode = ensureWebElement(ref.current?.host);
|
|
337
|
+
const prevNode = PrevHostNode.get(ref);
|
|
338
|
+
if (nextNode === prevNode)
|
|
339
|
+
return;
|
|
340
|
+
if (prevNode)
|
|
341
|
+
cleanupNode(prevNode);
|
|
342
|
+
PrevHostNode.set(ref, nextNode);
|
|
343
|
+
if (!nextNode)
|
|
344
|
+
return;
|
|
345
|
+
LayoutHandlers.set(nextNode, onLayout);
|
|
346
|
+
observeLayoutNode(nextNode, disableKey);
|
|
347
|
+
emitLayoutSync(nextNode);
|
|
348
|
+
});
|
|
349
|
+
(0, constants_1.useIsomorphicLayoutEffect)(() => {
|
|
350
|
+
if (!onLayout)
|
|
351
|
+
return;
|
|
352
|
+
const node = ref.current?.host;
|
|
353
|
+
if (!node)
|
|
354
|
+
return;
|
|
355
|
+
LayoutHandlers.set(node, onLayout);
|
|
356
|
+
observeLayoutNode(node, disableKey);
|
|
357
|
+
if (process.env.NODE_ENV === 'development' && isDebugLayout()) {
|
|
358
|
+
console.log('[useElementLayout] register', {
|
|
359
|
+
tag: node.tagName,
|
|
360
|
+
id: node.id || undefined,
|
|
361
|
+
className: (node.className || '').slice(0, 60) || undefined,
|
|
362
|
+
totalNodes: Nodes.size,
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
return () => {
|
|
366
|
+
cleanupNode(node);
|
|
367
|
+
// also clean up any node from a mid-lifecycle host swap
|
|
368
|
+
const swappedNode = PrevHostNode.get(ref);
|
|
369
|
+
if (swappedNode && swappedNode !== node) {
|
|
370
|
+
cleanupNode(swappedNode);
|
|
371
|
+
}
|
|
372
|
+
PrevHostNode.delete(ref);
|
|
373
|
+
};
|
|
374
|
+
}, [ref, !!onLayout]);
|
|
375
|
+
}
|
|
376
|
+
function ensureWebElement(x) {
|
|
377
|
+
if (typeof HTMLElement === 'undefined') {
|
|
378
|
+
return undefined;
|
|
379
|
+
}
|
|
380
|
+
return x instanceof HTMLElement ? x : undefined;
|
|
381
|
+
}
|
|
382
|
+
const getBoundingClientRectAsync = (node) => {
|
|
383
|
+
return new Promise((res) => {
|
|
384
|
+
if (!node || node.nodeType !== 1)
|
|
385
|
+
return res(false);
|
|
386
|
+
const io = new IntersectionObserver((entries) => {
|
|
387
|
+
io.disconnect();
|
|
388
|
+
return res(entries[0].boundingClientRect);
|
|
389
|
+
}, {
|
|
390
|
+
threshold: 0,
|
|
391
|
+
});
|
|
392
|
+
io.observe(node);
|
|
393
|
+
});
|
|
394
|
+
};
|
|
395
|
+
exports.getBoundingClientRectAsync = getBoundingClientRectAsync;
|
|
396
|
+
const measureNode = async (node, relativeTo) => {
|
|
397
|
+
const relativeNode = relativeTo || node?.parentElement;
|
|
398
|
+
if (relativeNode instanceof HTMLElement) {
|
|
399
|
+
const [nodeDim, relativeNodeDim] = await Promise.all([
|
|
400
|
+
(0, exports.getBoundingClientRectAsync)(node),
|
|
401
|
+
(0, exports.getBoundingClientRectAsync)(relativeNode),
|
|
402
|
+
]);
|
|
403
|
+
if (relativeNodeDim && nodeDim) {
|
|
404
|
+
return getRelativeDimensions(nodeDim, relativeNodeDim, node);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return null;
|
|
408
|
+
};
|
|
409
|
+
exports.measureNode = measureNode;
|
|
410
|
+
const measure = async (node, callback) => {
|
|
411
|
+
const out = await (0, exports.measureNode)(node, node.parentNode instanceof HTMLElement ? node.parentNode : null);
|
|
412
|
+
if (out) {
|
|
413
|
+
callback?.(out.x, out.y, out.width, out.height, out.pageX, out.pageY);
|
|
414
|
+
}
|
|
415
|
+
return out;
|
|
416
|
+
};
|
|
417
|
+
exports.measure = measure;
|
|
418
|
+
function createMeasure(node) {
|
|
419
|
+
return (callback) => (0, exports.measure)(node, callback);
|
|
420
|
+
}
|
|
421
|
+
const measureInWindow = async (node, callback) => {
|
|
422
|
+
const out = await (0, exports.measureNode)(node, null);
|
|
423
|
+
if (out) {
|
|
424
|
+
callback?.(out.pageX, out.pageY, out.width, out.height);
|
|
425
|
+
}
|
|
426
|
+
return out;
|
|
427
|
+
};
|
|
428
|
+
exports.measureInWindow = measureInWindow;
|
|
429
|
+
const createMeasureInWindow = (node) => {
|
|
430
|
+
return (callback) => (0, exports.measureInWindow)(node, callback);
|
|
431
|
+
};
|
|
432
|
+
exports.createMeasureInWindow = createMeasureInWindow;
|
|
433
|
+
const measureLayout = async (node, relativeNode, callback) => {
|
|
434
|
+
const out = await (0, exports.measureNode)(node, relativeNode);
|
|
435
|
+
if (out) {
|
|
436
|
+
callback?.(out.x, out.y, out.width, out.height, out.pageX, out.pageY);
|
|
437
|
+
}
|
|
438
|
+
return out;
|
|
439
|
+
};
|
|
440
|
+
exports.measureLayout = measureLayout;
|
|
441
|
+
function createMeasureLayout(node) {
|
|
442
|
+
return (relativeTo, callback) => (0, exports.measureLayout)(node, relativeTo, callback);
|
|
443
|
+
}
|
|
444
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 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