@dnd-kit/dom 0.0.1

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/utilities.js ADDED
@@ -0,0 +1,626 @@
1
+ import { Rectangle } from '@dnd-kit/geometry';
2
+
3
+ // src/utilities/bounding-rectangle/getBoundingRectangle.ts
4
+ function getBoundingRectangle(element) {
5
+ const { width, height, top, left, bottom, right } = element.getBoundingClientRect();
6
+ return { width, height, top, left, bottom, right };
7
+ }
8
+
9
+ // src/utilities/execution-context/canUseDOM.ts
10
+ var canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
11
+
12
+ // src/utilities/type-guards/isWindow.ts
13
+ function isWindow(element) {
14
+ const elementString = Object.prototype.toString.call(element);
15
+ return elementString === "[object Window]" || // In Electron context the Window object serializes to [object global]
16
+ elementString === "[object global]";
17
+ }
18
+
19
+ // src/utilities/type-guards/isNode.ts
20
+ function isNode(node) {
21
+ return "nodeType" in node;
22
+ }
23
+
24
+ // src/utilities/execution-context/getWindow.ts
25
+ function getWindow(target) {
26
+ if (!target) {
27
+ return window;
28
+ }
29
+ if (isWindow(target)) {
30
+ return target;
31
+ }
32
+ if (!isNode(target)) {
33
+ return window;
34
+ }
35
+ return target.ownerDocument?.defaultView ?? window;
36
+ }
37
+
38
+ // src/utilities/type-guards/isDocument.ts
39
+ function isDocument(node) {
40
+ const { Document } = getWindow(node);
41
+ return node instanceof Document;
42
+ }
43
+
44
+ // src/utilities/type-guards/isHTMLElement.ts
45
+ function isHTMLElement(node) {
46
+ if (isWindow(node)) {
47
+ return false;
48
+ }
49
+ return node instanceof getWindow(node).HTMLElement;
50
+ }
51
+
52
+ // src/utilities/execution-context/getDocument.ts
53
+ function getDocument(target) {
54
+ if (!target) {
55
+ return document;
56
+ }
57
+ if (isWindow(target)) {
58
+ return target.document;
59
+ }
60
+ if (!isNode(target)) {
61
+ return document;
62
+ }
63
+ if (isDocument(target)) {
64
+ return target;
65
+ }
66
+ if (isHTMLElement(target)) {
67
+ return target.ownerDocument;
68
+ }
69
+ return document;
70
+ }
71
+
72
+ // src/utilities/bounding-rectangle/getViewportBoundingRectangle.ts
73
+ function getViewportBoundingRectangle(element) {
74
+ const { documentElement } = getDocument(element);
75
+ const width = documentElement.clientWidth;
76
+ const height = documentElement.clientHeight;
77
+ return {
78
+ top: 0,
79
+ left: 0,
80
+ right: width,
81
+ bottom: height,
82
+ width,
83
+ height
84
+ };
85
+ }
86
+
87
+ // src/utilities/element/cloneElement.ts
88
+ function cloneElement(element) {
89
+ const selector = "input, textarea, select, canvas, [contenteditable]";
90
+ const clonedElement = element.cloneNode(true);
91
+ const fields = Array.from(element.querySelectorAll(selector));
92
+ const clonedFields = Array.from(clonedElement.querySelectorAll(selector));
93
+ clonedFields.forEach((field, index) => {
94
+ const originalField = fields[index];
95
+ if (isField(field) && isField(originalField)) {
96
+ if (field.type !== "file") {
97
+ field.value = originalField.value;
98
+ }
99
+ if (field.type === "radio" && field.name) {
100
+ field.name = `Cloned__${field.name}`;
101
+ }
102
+ }
103
+ if (field instanceof HTMLCanvasElement && originalField instanceof HTMLCanvasElement && originalField.width > 0 && originalField.height > 0) {
104
+ const destCtx = field.getContext("2d");
105
+ destCtx?.drawImage(originalField, 0, 0);
106
+ }
107
+ });
108
+ return clonedElement;
109
+ }
110
+ function isField(element) {
111
+ return "value" in element;
112
+ }
113
+
114
+ // src/utilities/type-guards/supportsStyle.ts
115
+ function supportsStyle(element) {
116
+ return "style" in element && element.style instanceof getWindow(element).CSSStyleDeclaration;
117
+ }
118
+
119
+ // src/utilities/element/createPlaceholder.ts
120
+ function createPlaceholder(element, clone = false) {
121
+ const placeholder = cloneElement(element);
122
+ if (supportsStyle(placeholder)) {
123
+ if (!clone) {
124
+ placeholder.style.setProperty("opacity", "0");
125
+ }
126
+ }
127
+ placeholder.setAttribute("inert", "true");
128
+ placeholder.setAttribute("tab-index", "-1");
129
+ placeholder.setAttribute("aria-hidden", "true");
130
+ return placeholder;
131
+ }
132
+
133
+ // src/utilities/event-listeners/Listeners.ts
134
+ var Listeners = class {
135
+ constructor() {
136
+ this.entries = /* @__PURE__ */ new Set();
137
+ this.clear = () => {
138
+ for (const entry of this.entries) {
139
+ const [target, { type, listener, options }] = entry;
140
+ target.removeEventListener(type, listener, options);
141
+ }
142
+ this.entries.clear();
143
+ };
144
+ }
145
+ bind(target, input) {
146
+ const listeners = Array.isArray(input) ? input : [input];
147
+ const entries = [];
148
+ for (const descriptor of listeners) {
149
+ const { type, listener, options } = descriptor;
150
+ const entry = [target, descriptor];
151
+ target.addEventListener(type, listener, options);
152
+ this.entries.add(entry);
153
+ entries.push(entry);
154
+ }
155
+ return function cleanup() {
156
+ for (const [target2, { type, listener, options }] of entries) {
157
+ target2.removeEventListener(type, listener, options);
158
+ }
159
+ };
160
+ }
161
+ };
162
+
163
+ // src/utilities/popover/supportsPopover.ts
164
+ function supportsPopover(element) {
165
+ return "showPopover" in element && "hidePopover" in element && typeof element.showPopover === "function" && typeof element.hidePopover === "function";
166
+ }
167
+
168
+ // src/utilities/popover/showPopover.ts
169
+ function showPopover(element) {
170
+ if (supportsPopover(element) && element.isConnected) {
171
+ element.showPopover();
172
+ }
173
+ }
174
+
175
+ // src/utilities/scroll/documentScrollingElement.ts
176
+ function isDocumentScrollingElement(element) {
177
+ if (!canUseDOM || !element) {
178
+ return false;
179
+ }
180
+ return element === getDocument(element).scrollingElement;
181
+ }
182
+
183
+ // src/utilities/scroll/getScrollPosition.ts
184
+ function getScrollPosition(scrollableElement) {
185
+ const rect = isDocumentScrollingElement(scrollableElement) ? getViewportBoundingRectangle(scrollableElement) : getBoundingRectangle(scrollableElement);
186
+ const dimensions = isDocumentScrollingElement(scrollableElement) ? {
187
+ height: window.innerHeight,
188
+ width: window.innerWidth
189
+ } : {
190
+ height: scrollableElement.clientHeight,
191
+ width: scrollableElement.clientWidth
192
+ };
193
+ const position = {
194
+ current: {
195
+ x: scrollableElement.scrollLeft,
196
+ y: scrollableElement.scrollTop
197
+ },
198
+ max: {
199
+ x: scrollableElement.scrollWidth - dimensions.width,
200
+ y: scrollableElement.scrollHeight - dimensions.height
201
+ }
202
+ };
203
+ const isTop = position.current.y <= 0;
204
+ const isLeft = position.current.x <= 0;
205
+ const isBottom = position.current.y >= position.max.y;
206
+ const isRight = position.current.x >= position.max.x;
207
+ return {
208
+ rect,
209
+ position,
210
+ isTop,
211
+ isLeft,
212
+ isBottom,
213
+ isRight
214
+ };
215
+ }
216
+
217
+ // src/utilities/scroll/canScroll.ts
218
+ function canScroll(scrollableElement, by) {
219
+ const { isTop, isBottom, isLeft, isRight, position } = getScrollPosition(scrollableElement);
220
+ const { x, y } = by ?? { x: 0, y: 0 };
221
+ const top = !isTop && position.current.y + y > 0;
222
+ const bottom = !isBottom && position.current.y + y < position.max.y;
223
+ const left = !isLeft && position.current.x + x > 0;
224
+ const right = !isRight && position.current.x + x < position.max.x;
225
+ return {
226
+ top,
227
+ bottom,
228
+ left,
229
+ right,
230
+ x: left || right,
231
+ y: top || bottom
232
+ };
233
+ }
234
+
235
+ // src/utilities/type-guards/isSVGElement.ts
236
+ function isSVGElement(node) {
237
+ return node instanceof getWindow(node).SVGElement;
238
+ }
239
+
240
+ // src/utilities/scroll/isFixed.ts
241
+ function isFixed(node, computedStyle = getWindow(node).getComputedStyle(node)) {
242
+ return computedStyle.position === "fixed" || computedStyle.position === "sticky";
243
+ }
244
+
245
+ // src/utilities/scroll/isScrollable.ts
246
+ function isScrollable(element, computedStyle = getWindow(element).getComputedStyle(
247
+ element
248
+ )) {
249
+ const overflowRegex = /(auto|scroll|overlay)/;
250
+ const properties = ["overflow", "overflowX", "overflowY"];
251
+ return properties.find((property) => {
252
+ const value = computedStyle[property];
253
+ return typeof value === "string" ? overflowRegex.test(value) : false;
254
+ }) != null;
255
+ }
256
+
257
+ // src/utilities/scroll/getScrollableAncestors.ts
258
+ var defaultOptions = {
259
+ excludeElement: true
260
+ };
261
+ function getScrollableAncestors(element, options = defaultOptions) {
262
+ const { limit, excludeElement } = options;
263
+ const scrollParents = [];
264
+ function findScrollableAncestors(node) {
265
+ if (limit != null && scrollParents.length >= limit) {
266
+ return scrollParents;
267
+ }
268
+ if (!node) {
269
+ return scrollParents;
270
+ }
271
+ if (isDocument(node) && node.scrollingElement != null && !scrollParents.includes(node.scrollingElement)) {
272
+ scrollParents.push(node.scrollingElement);
273
+ return scrollParents;
274
+ }
275
+ if (!isHTMLElement(node)) {
276
+ if (isSVGElement(node)) {
277
+ return findScrollableAncestors(node.parentElement);
278
+ }
279
+ return scrollParents;
280
+ }
281
+ if (scrollParents.includes(node)) {
282
+ return scrollParents;
283
+ }
284
+ const { getComputedStyle } = getWindow(node);
285
+ const computedStyle = getComputedStyle(node);
286
+ if (excludeElement && node === element) ; else if (isScrollable(node, computedStyle)) {
287
+ scrollParents.push(node);
288
+ }
289
+ if (isFixed(node, computedStyle)) {
290
+ return scrollParents;
291
+ }
292
+ return findScrollableAncestors(node.parentNode);
293
+ }
294
+ if (!element) {
295
+ return scrollParents;
296
+ }
297
+ return findScrollableAncestors(element);
298
+ }
299
+ function getFirstScrollableAncestor(node) {
300
+ const [firstScrollableAncestor] = getScrollableAncestors(node, { limit: 1 });
301
+ return firstScrollableAncestor ?? null;
302
+ }
303
+
304
+ // src/utilities/scroll/detectScrollIntent.ts
305
+ var ScrollDirection = /* @__PURE__ */ ((ScrollDirection2) => {
306
+ ScrollDirection2[ScrollDirection2["Idle"] = 0] = "Idle";
307
+ ScrollDirection2[ScrollDirection2["Forward"] = 1] = "Forward";
308
+ ScrollDirection2[ScrollDirection2["Reverse"] = -1] = "Reverse";
309
+ return ScrollDirection2;
310
+ })(ScrollDirection || {});
311
+ var defaultThreshold = {
312
+ x: 0.2,
313
+ y: 0.2
314
+ };
315
+ function detectScrollIntent(scrollableElement, coordinates, intent, acceleration = 25, thresholdPercentage = defaultThreshold) {
316
+ const {
317
+ rect: scrollContainerRect,
318
+ isTop,
319
+ isBottom,
320
+ isLeft,
321
+ isRight
322
+ } = getScrollPosition(scrollableElement);
323
+ const direction = {
324
+ x: 0 /* Idle */,
325
+ y: 0 /* Idle */
326
+ };
327
+ const speed = {
328
+ x: 0,
329
+ y: 0
330
+ };
331
+ const threshold = {
332
+ height: scrollContainerRect.height * thresholdPercentage.y,
333
+ width: scrollContainerRect.width * thresholdPercentage.x
334
+ };
335
+ if (!isTop && coordinates.y <= scrollContainerRect.top + threshold.height && intent?.y !== 1 /* Forward */) {
336
+ direction.y = -1 /* Reverse */;
337
+ speed.y = acceleration * Math.abs(
338
+ (scrollContainerRect.top + threshold.height - coordinates.y) / threshold.height
339
+ );
340
+ } else if (!isBottom && coordinates.y >= scrollContainerRect.bottom - threshold.height && intent?.y !== -1 /* Reverse */) {
341
+ direction.y = 1 /* Forward */;
342
+ speed.y = acceleration * Math.abs(
343
+ (scrollContainerRect.bottom - threshold.height - coordinates.y) / threshold.height
344
+ );
345
+ }
346
+ if (!isRight && coordinates.x >= scrollContainerRect.right - threshold.width && intent?.x !== -1 /* Reverse */) {
347
+ direction.x = 1 /* Forward */;
348
+ speed.x = acceleration * Math.abs(
349
+ (scrollContainerRect.right - threshold.width - coordinates.x) / threshold.width
350
+ );
351
+ } else if (!isLeft && coordinates.x <= scrollContainerRect.left + threshold.width && intent?.x !== 1 /* Forward */) {
352
+ direction.x = -1 /* Reverse */;
353
+ speed.x = acceleration * Math.abs(
354
+ (scrollContainerRect.left + threshold.width - coordinates.x) / threshold.width
355
+ );
356
+ }
357
+ return {
358
+ direction,
359
+ speed
360
+ };
361
+ }
362
+
363
+ // src/utilities/scroll/scrollIntoViewIfNeeded.ts
364
+ function supportsScrollIntoViewIfNeeded(element) {
365
+ return "scrollIntoViewIfNeeded" in element && typeof element.scrollIntoViewIfNeeded === "function";
366
+ }
367
+ function scrollIntoViewIfNeeded(el, centerIfNeeded = false) {
368
+ if (supportsScrollIntoViewIfNeeded(el)) {
369
+ el.scrollIntoViewIfNeeded(centerIfNeeded);
370
+ return;
371
+ }
372
+ if (!(el instanceof HTMLElement)) {
373
+ return el.scrollIntoView();
374
+ }
375
+ var [parent] = getScrollableAncestors(el, { limit: 1 });
376
+ if (!(parent instanceof HTMLElement)) {
377
+ return;
378
+ }
379
+ const parentComputedStyle = getWindow(parent).getComputedStyle(parent, null), parentBorderTopWidth = parseInt(
380
+ parentComputedStyle.getPropertyValue("border-top-width")
381
+ ), parentBorderLeftWidth = parseInt(
382
+ parentComputedStyle.getPropertyValue("border-left-width")
383
+ ), overTop = el.offsetTop - parent.offsetTop < parent.scrollTop, overBottom = el.offsetTop - parent.offsetTop + el.clientHeight - parentBorderTopWidth > parent.scrollTop + parent.clientHeight, overLeft = el.offsetLeft - parent.offsetLeft < parent.scrollLeft, overRight = el.offsetLeft - parent.offsetLeft + el.clientWidth - parentBorderLeftWidth > parent.scrollLeft + parent.clientWidth, alignWithTop = overTop && !overBottom;
384
+ if ((overTop || overBottom) && centerIfNeeded) {
385
+ parent.scrollTop = el.offsetTop - parent.offsetTop - parent.clientHeight / 2 - parentBorderTopWidth + el.clientHeight / 2;
386
+ }
387
+ if ((overLeft || overRight) && centerIfNeeded) {
388
+ parent.scrollLeft = el.offsetLeft - parent.offsetLeft - parent.clientWidth / 2 - parentBorderLeftWidth + el.clientWidth / 2;
389
+ }
390
+ if ((overTop || overBottom || overLeft || overRight) && !centerIfNeeded) {
391
+ el.scrollIntoView(alignWithTop);
392
+ }
393
+ }
394
+
395
+ // src/utilities/scheduler/scheduler.ts
396
+ var Scheduler = class {
397
+ constructor() {
398
+ this.tasks = /* @__PURE__ */ new Set();
399
+ this.flush = () => {
400
+ const tasks = this.tasks;
401
+ this.animationFrame = void 0;
402
+ this.tasks = /* @__PURE__ */ new Set();
403
+ for (const task of tasks) {
404
+ task();
405
+ }
406
+ };
407
+ }
408
+ schedule(task) {
409
+ this.tasks.add(task);
410
+ if (!this.animationFrame) {
411
+ this.animationFrame = requestAnimationFrame(this.flush);
412
+ }
413
+ }
414
+ };
415
+ var scheduler = new Scheduler();
416
+
417
+ // src/utilities/transform/inverseTransform.ts
418
+ function inverseTransform(rect, parsedTransform, transformOrigin) {
419
+ const { scaleX, scaleY, x: translateX, y: translateY } = parsedTransform;
420
+ const x = rect.left - translateX - (1 - scaleX) * parseFloat(transformOrigin);
421
+ const y = rect.top - translateY - (1 - scaleY) * parseFloat(transformOrigin.slice(transformOrigin.indexOf(" ") + 1));
422
+ const w = scaleX ? rect.width / scaleX : rect.width;
423
+ const h = scaleY ? rect.height / scaleY : rect.height;
424
+ return {
425
+ width: w,
426
+ height: h,
427
+ top: y,
428
+ right: x + w,
429
+ bottom: y + h,
430
+ left: x
431
+ };
432
+ }
433
+
434
+ // src/utilities/styles/Styles.ts
435
+ var Styles = class {
436
+ constructor(element) {
437
+ this.element = element;
438
+ this.initial = /* @__PURE__ */ new Map();
439
+ }
440
+ set(properties, prefix = "") {
441
+ const { element } = this;
442
+ if (!supportsStyle(element)) {
443
+ return;
444
+ }
445
+ for (const [key, value] of Object.entries(properties)) {
446
+ const property = `${prefix}${key}`;
447
+ if (!this.initial.has(property)) {
448
+ this.initial.set(property, element.style.getPropertyValue(property));
449
+ }
450
+ element.style.setProperty(
451
+ property,
452
+ typeof value === "string" ? value : `${value}px`
453
+ );
454
+ }
455
+ }
456
+ remove(properties, prefix = "") {
457
+ const { element } = this;
458
+ if (!supportsStyle(element)) {
459
+ return;
460
+ }
461
+ for (const key of properties) {
462
+ const property = `${prefix}${key}`;
463
+ element.style.removeProperty(property);
464
+ }
465
+ }
466
+ reset() {
467
+ const { element } = this;
468
+ if (!supportsStyle(element)) {
469
+ return;
470
+ }
471
+ for (const [key, value] of this.initial) {
472
+ element.style.setProperty(key, value);
473
+ }
474
+ if (element.getAttribute("style") === "") {
475
+ element.removeAttribute("style");
476
+ }
477
+ }
478
+ };
479
+
480
+ // src/utilities/transform/animateTransform.ts
481
+ function animateTransform({
482
+ element,
483
+ keyframes,
484
+ options,
485
+ onReady,
486
+ onFinish
487
+ }) {
488
+ const styles = new Styles(element);
489
+ const { transitionProperty } = getWindow(element).getComputedStyle(element);
490
+ const properties = transitionProperty.split(", ");
491
+ styles.set({
492
+ "transition-property": properties.length ? properties.filter(
493
+ (property) => !property.includes("transform") && !property.includes("translate")
494
+ ).join(", ") : "none"
495
+ });
496
+ onReady?.();
497
+ element.animate(keyframes, options).finished.then(() => {
498
+ onFinish?.();
499
+ styles.reset();
500
+ });
501
+ }
502
+
503
+ // src/utilities/transform/parseScale.ts
504
+ function parseScale(scale) {
505
+ if (scale === "none") {
506
+ return null;
507
+ }
508
+ const values = scale.split(" ");
509
+ const x = parseFloat(values[0]);
510
+ const y = parseFloat(values[1]);
511
+ if (isNaN(x) && isNaN(y)) {
512
+ return null;
513
+ }
514
+ return {
515
+ x: isNaN(x) ? y : x,
516
+ y: isNaN(y) ? x : y
517
+ };
518
+ }
519
+
520
+ // src/utilities/transform/parseTranslate.ts
521
+ function parseTranslate(translate) {
522
+ if (translate === "none") {
523
+ return null;
524
+ }
525
+ const [x, y, z = "0"] = translate.split(" ");
526
+ const output = { x: parseFloat(x), y: parseFloat(y), z: parseInt(z, 10) };
527
+ if (isNaN(output.x) && isNaN(output.y)) {
528
+ return null;
529
+ }
530
+ return {
531
+ x: isNaN(output.x) ? 0 : output.x,
532
+ y: isNaN(output.y) ? 0 : output.y,
533
+ z: isNaN(output.z) ? 0 : output.z
534
+ };
535
+ }
536
+
537
+ // src/utilities/transform/parseTransform.ts
538
+ function parseTransform(computedStyles) {
539
+ const { scale, transform, translate } = computedStyles;
540
+ const parsedScale = parseScale(scale);
541
+ const parsedTranslate = parseTranslate(translate);
542
+ if (parsedScale && parsedTranslate) {
543
+ return {
544
+ x: parsedTranslate.x,
545
+ y: parsedTranslate.y,
546
+ z: parsedTranslate.z,
547
+ scaleX: parsedScale.x,
548
+ scaleY: parsedScale.y
549
+ };
550
+ }
551
+ const parsedMatrix = parseTransformMatrix(transform);
552
+ if (!parsedMatrix && !parsedScale && !parsedTranslate) {
553
+ return null;
554
+ }
555
+ return {
556
+ x: parsedTranslate?.x ?? parsedMatrix?.x ?? 0,
557
+ y: parsedTranslate?.y ?? parsedMatrix?.y ?? 0,
558
+ scaleX: parsedScale?.x ?? parsedMatrix?.scaleX ?? 1,
559
+ scaleY: parsedScale?.y ?? parsedMatrix?.scaleY ?? 1
560
+ };
561
+ }
562
+ function parseTransformMatrix(transform) {
563
+ if (transform.startsWith("matrix3d(")) {
564
+ const transformArray = transform.slice(9, -1).split(/, /);
565
+ return {
566
+ x: +transformArray[12],
567
+ y: +transformArray[13],
568
+ scaleX: +transformArray[0],
569
+ scaleY: +transformArray[5]
570
+ };
571
+ } else if (transform.startsWith("matrix(")) {
572
+ const transformArray = transform.slice(7, -1).split(/, /);
573
+ return {
574
+ x: +transformArray[4],
575
+ y: +transformArray[5],
576
+ scaleX: +transformArray[0],
577
+ scaleY: +transformArray[3]
578
+ };
579
+ }
580
+ return null;
581
+ }
582
+
583
+ // src/utilities/transform/stringifyTransform.ts
584
+ function stringifyTransform({ x, y, z, scaleX, scaleY }) {
585
+ return `translate3d(${x}px, ${y}px, ${z ?? 0}) scale(${scaleX}, ${scaleY})`;
586
+ }
587
+
588
+ // src/utilities/shapes/DOMRectangle.ts
589
+ var DOMRectangle = class extends Rectangle {
590
+ constructor(element, ignoreTransforms = false) {
591
+ let { top, left, right, bottom, width, height } = getBoundingRectangle(element);
592
+ const computedStyles = getWindow(element).getComputedStyle(element);
593
+ const parsedTransform = parseTransform(computedStyles);
594
+ const scale = {
595
+ x: parsedTransform?.scaleX ?? 1,
596
+ y: parsedTransform?.scaleY ?? 1
597
+ };
598
+ if (parsedTransform && ignoreTransforms) {
599
+ const updated = inverseTransform(
600
+ { top, left, right, bottom, width, height },
601
+ parsedTransform,
602
+ computedStyles.transformOrigin
603
+ );
604
+ top = updated.top;
605
+ left = updated.left;
606
+ width = updated.width;
607
+ height = updated.height;
608
+ }
609
+ super(left, top, width, height);
610
+ this.scale = scale;
611
+ }
612
+ };
613
+
614
+ // src/utilities/type-guards/isKeyboardEvent.ts
615
+ function isKeyboardEvent(event) {
616
+ return event instanceof KeyboardEvent;
617
+ }
618
+
619
+ // src/utilities/type-guards/supportsViewTransition.ts
620
+ function supportsViewTransition(document2) {
621
+ return "startViewTransition" in document2;
622
+ }
623
+
624
+ export { DOMRectangle, Listeners, Scheduler, ScrollDirection, Styles, animateTransform, canScroll, canUseDOM, cloneElement, createPlaceholder, detectScrollIntent, getBoundingRectangle, getDocument, getFirstScrollableAncestor, getScrollableAncestors, getViewportBoundingRectangle, getWindow, inverseTransform, isDocumentScrollingElement, isKeyboardEvent, parseTransform, scheduler, scrollIntoViewIfNeeded, showPopover, stringifyTransform, supportsPopover, supportsStyle, supportsViewTransition };
625
+ //# sourceMappingURL=out.js.map
626
+ //# sourceMappingURL=utilities.js.map