@zag-js/dismissable 2.0.0-next.2 → 2.0.0-next.4

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.
@@ -0,0 +1,4 @@
1
+ import { FocusOutsideEvent, PointerDownOutsideEvent } from "@zag-js/interact-outside";
2
+ export type DismissReason = "escape-key" | "interact-outside" | "focus-outside";
3
+ /** Why a dismissable layer was dismissed, from the event passed to `onDismiss` */
4
+ export declare function getDismissReason(event?: KeyboardEvent | PointerDownOutsideEvent | FocusOutsideEvent): DismissReason;
@@ -0,0 +1,4 @@
1
+ import { FocusOutsideEvent, PointerDownOutsideEvent } from "@zag-js/interact-outside";
2
+ export type DismissReason = "escape-key" | "interact-outside" | "focus-outside";
3
+ /** Why a dismissable layer was dismissed, from the event passed to `onDismiss` */
4
+ export declare function getDismissReason(event?: KeyboardEvent | PointerDownOutsideEvent | FocusOutsideEvent): DismissReason;
@@ -0,0 +1,12 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ // src/dismiss-reason.ts
6
+ /** Why a dismissable layer was dismissed, from the event passed to `onDismiss` */
7
+ function getDismissReason(event) {
8
+ if (event?.type === "keydown") return "escape-key";
9
+ if (event?.type === "focus.outside") return "focus-outside";
10
+ return "interact-outside";
11
+ }
12
+ exports.getDismissReason = getDismissReason;
@@ -0,0 +1,8 @@
1
+ // src/dismiss-reason.ts
2
+ /** Why a dismissable layer was dismissed, from the event passed to `onDismiss` */
3
+ function getDismissReason(event) {
4
+ if (event?.type === "keydown") return "escape-key";
5
+ if (event?.type === "focus.outside") return "focus-outside";
6
+ return "interact-outside";
7
+ }
8
+ export { getDismissReason };
@@ -1,65 +1,69 @@
1
- import { InteractOutsideHandlers } from '@zag-js/interact-outside';
2
- import { MaybeFunction, TeardownReason } from '@zag-js/utils';
3
- import { LayerDismissEvent, LayerSnapshot, LayerType } from './layer-stack.mjs';
4
-
1
+ import { LayerDismissEvent, LayerSnapshot, LayerType } from "./layer-stack.mjs";
2
+ import { FocusOutsideEvent, InteractOutsideHandlers, PointerDownOutsideEvent } from "@zag-js/interact-outside";
3
+ import { MaybeFunction, TeardownReason } from "@zag-js/utils";
5
4
  type MaybeElement = HTMLElement | null;
6
5
  type Container = MaybeElement | Array<MaybeElement>;
7
6
  type NodeOrFn = MaybeFunction<MaybeElement>;
8
- interface DismissableElementHandlers extends InteractOutsideHandlers {
9
- /**
10
- * Function called when the escape key is pressed
11
- */
12
- onEscapeKeyDown?: ((event: KeyboardEvent) => void) | undefined;
13
- /**
14
- * Function called when this layer is closed due to a parent layer being closed
15
- */
16
- onRequestDismiss?: ((event: LayerDismissEvent) => void) | undefined;
7
+ export interface DismissableElementHandlers extends InteractOutsideHandlers {
8
+ /**
9
+ * Function called when the escape key is pressed
10
+ */
11
+ onEscapeKeyDown?: ((event: KeyboardEvent) => void) | undefined;
12
+ /**
13
+ * Function called when this layer is closed due to a parent layer being closed
14
+ */
15
+ onRequestDismiss?: ((event: LayerDismissEvent) => void) | undefined;
17
16
  }
18
- interface PersistentElementOptions {
19
- /**
20
- * Returns the persistent elements that:
21
- * - should not have pointer-events disabled
22
- * - should not trigger the dismiss event
23
- */
24
- persistentElements?: Array<() => Element | null> | undefined;
17
+ export interface PersistentElementOptions {
18
+ /**
19
+ * Returns the persistent elements that:
20
+ * - should not have pointer-events disabled
21
+ * - should not trigger the dismiss event
22
+ */
23
+ persistentElements?: Array<() => Element | null> | undefined;
25
24
  }
26
- interface DismissableElementOptions extends DismissableElementHandlers, PersistentElementOptions {
27
- /**
28
- * Function called when the layer's position or nesting state changes.
29
- */
30
- onLayerChange: (snapshot: LayerSnapshot) => void;
31
- /**
32
- * Whether to log debug information
33
- */
34
- debug?: boolean | undefined;
35
- /**
36
- * Whether to block pointer events outside the dismissable element
37
- */
38
- pointerBlocking?: boolean | (() => boolean) | undefined;
39
- /**
40
- * Function called when the dismissable element is dismissed
41
- */
42
- onDismiss: VoidFunction;
43
- /**
44
- * Exclude containers from the interact outside event
45
- */
46
- exclude?: MaybeFunction<Container> | undefined;
47
- /**
48
- * Defer the interact outside event to the next frame
49
- */
50
- defer?: boolean | undefined;
51
- /**
52
- * Whether to warn when the node is `null` or `undefined`
53
- */
54
- warnOnMissingNode?: boolean | undefined;
55
- /**
56
- * The type of layer being tracked
57
- */
58
- type?: LayerType | undefined;
25
+ export interface DismissableElementOptions extends DismissableElementHandlers, PersistentElementOptions {
26
+ /**
27
+ * Function called when the layer's position or nesting state changes.
28
+ */
29
+ onLayerChange: (snapshot: LayerSnapshot) => void;
30
+ /**
31
+ * Whether to log debug information
32
+ */
33
+ debug?: boolean | undefined;
34
+ /**
35
+ * Whether to block pointer events outside the dismissable element
36
+ */
37
+ pointerBlocking?: boolean | (() => boolean) | undefined;
38
+ /**
39
+ * Function called when the dismissable element is dismissed, with the event that caused it
40
+ */
41
+ onDismiss: (event?: KeyboardEvent | PointerDownOutsideEvent | FocusOutsideEvent) => void;
42
+ /**
43
+ * Exclude containers from the interact outside event
44
+ */
45
+ exclude?: MaybeFunction<Container> | undefined;
46
+ /**
47
+ * Defer the interact outside event to the next frame
48
+ */
49
+ defer?: boolean | undefined;
50
+ /**
51
+ * The root the node is queried from, observed while the node is deferred
52
+ */
53
+ getRootNode?: (() => Node) | undefined;
54
+ /**
55
+ * Whether to warn when the node is `null` or `undefined`
56
+ */
57
+ warnOnMissingNode?: boolean | undefined;
58
+ /**
59
+ * The type of layer being tracked
60
+ */
61
+ type?: LayerType | undefined;
62
+ /** Groups this layer with its peers, so closing one does not dismiss the other. */
63
+ group?: string | undefined;
59
64
  }
60
- declare function trackDismissableElement(nodeOrFn: NodeOrFn, options: DismissableElementOptions): (args_0?: TeardownReason | undefined) => void;
61
- declare function trackDismissableBranch(nodeOrFn: NodeOrFn, options?: {
62
- defer?: boolean | undefined;
63
- }): () => void;
64
-
65
- export { type DismissableElementHandlers, type DismissableElementOptions, type PersistentElementOptions, trackDismissableBranch, trackDismissableElement };
65
+ export declare function trackDismissableElement(nodeOrFn: NodeOrFn, options: DismissableElementOptions): (args_0?: TeardownReason | undefined) => void;
66
+ /** Whether `target` is inside a layer opened from within `node`, such as a menu opened from a popover */
67
+ export declare function isInNestedLayer(node: HTMLElement | null | undefined, target: EventTarget | null): boolean;
68
+ export declare function trackDismissableBranch(nodeOrFn: NodeOrFn, options?: Pick<DismissableElementOptions, "defer" | "getRootNode">): () => void;
69
+ export {};
@@ -1,65 +1,69 @@
1
- import { InteractOutsideHandlers } from '@zag-js/interact-outside';
2
- import { MaybeFunction, TeardownReason } from '@zag-js/utils';
3
- import { LayerDismissEvent, LayerSnapshot, LayerType } from './layer-stack.js';
4
-
1
+ import { LayerDismissEvent, LayerSnapshot, LayerType } from "./layer-stack.js";
2
+ import { FocusOutsideEvent, InteractOutsideHandlers, PointerDownOutsideEvent } from "@zag-js/interact-outside";
3
+ import { MaybeFunction, TeardownReason } from "@zag-js/utils";
5
4
  type MaybeElement = HTMLElement | null;
6
5
  type Container = MaybeElement | Array<MaybeElement>;
7
6
  type NodeOrFn = MaybeFunction<MaybeElement>;
8
- interface DismissableElementHandlers extends InteractOutsideHandlers {
9
- /**
10
- * Function called when the escape key is pressed
11
- */
12
- onEscapeKeyDown?: ((event: KeyboardEvent) => void) | undefined;
13
- /**
14
- * Function called when this layer is closed due to a parent layer being closed
15
- */
16
- onRequestDismiss?: ((event: LayerDismissEvent) => void) | undefined;
7
+ export interface DismissableElementHandlers extends InteractOutsideHandlers {
8
+ /**
9
+ * Function called when the escape key is pressed
10
+ */
11
+ onEscapeKeyDown?: ((event: KeyboardEvent) => void) | undefined;
12
+ /**
13
+ * Function called when this layer is closed due to a parent layer being closed
14
+ */
15
+ onRequestDismiss?: ((event: LayerDismissEvent) => void) | undefined;
17
16
  }
18
- interface PersistentElementOptions {
19
- /**
20
- * Returns the persistent elements that:
21
- * - should not have pointer-events disabled
22
- * - should not trigger the dismiss event
23
- */
24
- persistentElements?: Array<() => Element | null> | undefined;
17
+ export interface PersistentElementOptions {
18
+ /**
19
+ * Returns the persistent elements that:
20
+ * - should not have pointer-events disabled
21
+ * - should not trigger the dismiss event
22
+ */
23
+ persistentElements?: Array<() => Element | null> | undefined;
25
24
  }
26
- interface DismissableElementOptions extends DismissableElementHandlers, PersistentElementOptions {
27
- /**
28
- * Function called when the layer's position or nesting state changes.
29
- */
30
- onLayerChange: (snapshot: LayerSnapshot) => void;
31
- /**
32
- * Whether to log debug information
33
- */
34
- debug?: boolean | undefined;
35
- /**
36
- * Whether to block pointer events outside the dismissable element
37
- */
38
- pointerBlocking?: boolean | (() => boolean) | undefined;
39
- /**
40
- * Function called when the dismissable element is dismissed
41
- */
42
- onDismiss: VoidFunction;
43
- /**
44
- * Exclude containers from the interact outside event
45
- */
46
- exclude?: MaybeFunction<Container> | undefined;
47
- /**
48
- * Defer the interact outside event to the next frame
49
- */
50
- defer?: boolean | undefined;
51
- /**
52
- * Whether to warn when the node is `null` or `undefined`
53
- */
54
- warnOnMissingNode?: boolean | undefined;
55
- /**
56
- * The type of layer being tracked
57
- */
58
- type?: LayerType | undefined;
25
+ export interface DismissableElementOptions extends DismissableElementHandlers, PersistentElementOptions {
26
+ /**
27
+ * Function called when the layer's position or nesting state changes.
28
+ */
29
+ onLayerChange: (snapshot: LayerSnapshot) => void;
30
+ /**
31
+ * Whether to log debug information
32
+ */
33
+ debug?: boolean | undefined;
34
+ /**
35
+ * Whether to block pointer events outside the dismissable element
36
+ */
37
+ pointerBlocking?: boolean | (() => boolean) | undefined;
38
+ /**
39
+ * Function called when the dismissable element is dismissed, with the event that caused it
40
+ */
41
+ onDismiss: (event?: KeyboardEvent | PointerDownOutsideEvent | FocusOutsideEvent) => void;
42
+ /**
43
+ * Exclude containers from the interact outside event
44
+ */
45
+ exclude?: MaybeFunction<Container> | undefined;
46
+ /**
47
+ * Defer the interact outside event to the next frame
48
+ */
49
+ defer?: boolean | undefined;
50
+ /**
51
+ * The root the node is queried from, observed while the node is deferred
52
+ */
53
+ getRootNode?: (() => Node) | undefined;
54
+ /**
55
+ * Whether to warn when the node is `null` or `undefined`
56
+ */
57
+ warnOnMissingNode?: boolean | undefined;
58
+ /**
59
+ * The type of layer being tracked
60
+ */
61
+ type?: LayerType | undefined;
62
+ /** Groups this layer with its peers, so closing one does not dismiss the other. */
63
+ group?: string | undefined;
59
64
  }
60
- declare function trackDismissableElement(nodeOrFn: NodeOrFn, options: DismissableElementOptions): (args_0?: TeardownReason | undefined) => void;
61
- declare function trackDismissableBranch(nodeOrFn: NodeOrFn, options?: {
62
- defer?: boolean | undefined;
63
- }): () => void;
64
-
65
- export { type DismissableElementHandlers, type DismissableElementOptions, type PersistentElementOptions, trackDismissableBranch, trackDismissableElement };
65
+ export declare function trackDismissableElement(nodeOrFn: NodeOrFn, options: DismissableElementOptions): (args_0?: TeardownReason | undefined) => void;
66
+ /** Whether `target` is inside a layer opened from within `node`, such as a menu opened from a popover */
67
+ export declare function isInNestedLayer(node: HTMLElement | null | undefined, target: EventTarget | null): boolean;
68
+ export declare function trackDismissableBranch(nodeOrFn: NodeOrFn, options?: Pick<DismissableElementOptions, "defer" | "getRootNode">): () => void;
69
+ export {};
@@ -1,125 +1,103 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/dismissable-layer.ts
21
- var dismissable_layer_exports = {};
22
- __export(dismissable_layer_exports, {
23
- trackDismissableBranch: () => trackDismissableBranch,
24
- trackDismissableElement: () => trackDismissableElement
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
25
4
  });
26
- module.exports = __toCommonJS(dismissable_layer_exports);
27
- var import_dom_query = require("@zag-js/dom-query");
28
- var import_interact_outside = require("@zag-js/interact-outside");
29
- var import_utils = require("@zag-js/utils");
30
- var import_escape_keydown = require("./escape-keydown.js");
31
- var import_layer_stack = require("./layer-stack.js");
32
- var import_pointer_event_outside = require("./pointer-event-outside.js");
5
+ const require_escape_keydown = require("./escape-keydown.js");
6
+ const require_layer_stack = require("./layer-stack.js");
7
+ const require_pointer_event_outside = require("./pointer-event-outside.js");
8
+ let _zag_js_dom_query = require("@zag-js/dom-query");
9
+ let _zag_js_interact_outside = require("@zag-js/interact-outside");
10
+ let _zag_js_utils = require("@zag-js/utils");
11
+ // src/dismissable-layer.ts
33
12
  function trackDismissableElementImpl(node, options) {
34
- const {
35
- onDismiss,
36
- onRequestDismiss,
37
- pointerBlocking,
38
- exclude: excludeContainers,
39
- debug,
40
- type = "dialog",
41
- onLayerChange
42
- } = options;
43
- const layer = {
44
- dismiss: onDismiss,
45
- node,
46
- type,
47
- pointerBlocking,
48
- requestDismiss: onRequestDismiss,
49
- onLayerChange
50
- };
51
- import_layer_stack.layerStack.add(layer);
52
- function onPointerDownOutside(event) {
53
- const target = (0, import_dom_query.getEventTarget)(event.detail.originalEvent);
54
- if (import_layer_stack.layerStack.isBelowPointerBlockingLayer(node) || import_layer_stack.layerStack.isInBranch(target)) return;
55
- options.onPointerDownOutside?.(event);
56
- options.onInteractOutside?.(event);
57
- if (event.defaultPrevented) return;
58
- if (debug) {
59
- console.log("onPointerDownOutside:", event.detail.originalEvent);
60
- }
61
- onDismiss?.();
62
- }
63
- function onFocusOutside(event) {
64
- const target = (0, import_dom_query.getEventTarget)(event.detail.originalEvent);
65
- if (import_layer_stack.layerStack.isInBranch(target)) return;
66
- options.onFocusOutside?.(event);
67
- options.onInteractOutside?.(event);
68
- if (event.defaultPrevented) return;
69
- if (debug) {
70
- console.log("onFocusOutside:", event.detail.originalEvent);
71
- }
72
- onDismiss?.();
73
- }
74
- function onEscapeKeyDown(event) {
75
- if (!import_layer_stack.layerStack.isTopMost(node)) return;
76
- options.onEscapeKeyDown?.(event);
77
- if (!event.defaultPrevented && onDismiss) {
78
- event.preventDefault();
79
- onDismiss();
80
- }
81
- }
82
- function exclude(target) {
83
- const containers = typeof excludeContainers === "function" ? excludeContainers() : excludeContainers;
84
- const _containers = Array.isArray(containers) ? containers : [containers];
85
- const persistentElements = options.persistentElements?.map((fn) => fn()).filter(import_dom_query.isHTMLElement);
86
- if (persistentElements) _containers.push(...persistentElements);
87
- return _containers.some((node2) => (0, import_dom_query.contains)(node2, target)) || import_layer_stack.layerStack.isInNestedLayer(node, target);
88
- }
89
- const cleanups = [
90
- (0, import_layer_stack.isPointerBlocking)(layer) ? (0, import_pointer_event_outside.disablePointerEventsOutside)(node, options.persistentElements) : void 0,
91
- (0, import_escape_keydown.trackEscapeKeydown)(node, onEscapeKeyDown),
92
- (0, import_interact_outside.trackInteractOutside)(node, { exclude, onFocusOutside, onPointerDownOutside, defer: options.defer })
93
- ];
94
- return (reason) => {
95
- import_layer_stack.layerStack.remove(node, { reattach: reason === "restart" });
96
- cleanups.forEach((fn) => fn?.());
97
- };
13
+ const { onDismiss, onRequestDismiss, pointerBlocking, exclude: excludeContainers, debug, type = "dialog", group, onLayerChange } = options;
14
+ const resolveExcluded = () => {
15
+ const containers = typeof excludeContainers === "function" ? excludeContainers() : excludeContainers;
16
+ return Array.isArray(containers) ? containers : [containers];
17
+ };
18
+ const triggers = resolveExcluded().filter(Boolean);
19
+ const layer = {
20
+ dismiss: onDismiss,
21
+ node,
22
+ type,
23
+ group,
24
+ pointerBlocking,
25
+ requestDismiss: onRequestDismiss,
26
+ onLayerChange,
27
+ origins: triggers.length ? [node, ...triggers] : void 0
28
+ };
29
+ require_layer_stack.layerStack.add(layer);
30
+ function onPointerDownOutside(event) {
31
+ const target = (0, _zag_js_dom_query.getEventTarget)(event.detail.originalEvent);
32
+ if (require_layer_stack.layerStack.isBelowPointerBlockingLayer(node) || require_layer_stack.layerStack.isInBranch(target)) return;
33
+ options.onPointerDownOutside?.(event);
34
+ options.onInteractOutside?.(event);
35
+ if (event.defaultPrevented) return;
36
+ if (debug) console.log("onPointerDownOutside:", event.detail.originalEvent);
37
+ onDismiss?.(event);
38
+ }
39
+ function onFocusOutside(event) {
40
+ const target = (0, _zag_js_dom_query.getEventTarget)(event.detail.originalEvent);
41
+ if (require_layer_stack.layerStack.isInBranch(target) || require_layer_stack.layerStack.isClosingAncestor(node)) return;
42
+ options.onFocusOutside?.(event);
43
+ options.onInteractOutside?.(event);
44
+ if (event.defaultPrevented) return;
45
+ if (debug) console.log("onFocusOutside:", event.detail.originalEvent);
46
+ onDismiss?.(event);
47
+ }
48
+ function onEscapeKeyDown(event) {
49
+ if (!require_layer_stack.layerStack.isTopMost(node)) return;
50
+ options.onEscapeKeyDown?.(event);
51
+ if (!event.defaultPrevented && onDismiss) {
52
+ event.preventDefault();
53
+ onDismiss(event);
54
+ }
55
+ }
56
+ function exclude(target) {
57
+ const _containers = resolveExcluded();
58
+ const persistentElements = options.persistentElements?.map((fn) => fn()).filter(_zag_js_dom_query.isHTMLElement);
59
+ if (persistentElements) _containers.push(...persistentElements);
60
+ return _containers.some((node) => (0, _zag_js_dom_query.contains)(node, target)) || require_layer_stack.layerStack.isInNestedLayer(node, target);
61
+ }
62
+ const cleanups = [
63
+ require_layer_stack.isPointerBlocking(layer) ? require_pointer_event_outside.disablePointerEventsOutside(node, options.persistentElements) : void 0,
64
+ require_escape_keydown.trackEscapeKeydown(node, onEscapeKeyDown),
65
+ (0, _zag_js_interact_outside.trackInteractOutside)(node, {
66
+ exclude,
67
+ onFocusOutside,
68
+ onPointerDownOutside,
69
+ defer: options.defer
70
+ })
71
+ ];
72
+ return (reason) => {
73
+ require_layer_stack.layerStack.remove(node, { reattach: reason === "restart" });
74
+ cleanups.forEach((fn) => fn?.());
75
+ };
98
76
  }
99
77
  function trackDismissableElement(nodeOrFn, options) {
100
- const { warnOnMissingNode = true } = options;
101
- return (0, import_dom_query.whenNode)(nodeOrFn, (node) => trackDismissableElementImpl(node, options), {
102
- defer: options.defer,
103
- onMissing: warnOnMissingNode ? () => (0, import_utils.warn)("[@zag-js/dismissable] node is `null` or `undefined`") : void 0
104
- });
78
+ const { warnOnMissingNode = true } = options;
79
+ return (0, _zag_js_dom_query.whenNode)(nodeOrFn, (node) => trackDismissableElementImpl(node, options), {
80
+ defer: options.defer,
81
+ getRootNode: options.getRootNode,
82
+ onMissing: warnOnMissingNode ? () => (0, _zag_js_utils.warn)("[@zag-js/dismissable] node is `null` or `undefined`") : void 0
83
+ });
84
+ }
85
+ /** Whether `target` is inside a layer opened from within `node`, such as a menu opened from a popover */
86
+ function isInNestedLayer(node, target) {
87
+ return !!node && require_layer_stack.layerStack.isInNestedLayer(node, target);
105
88
  }
106
89
  function trackDismissableBranch(nodeOrFn, options = {}) {
107
- return (0, import_dom_query.whenNode)(
108
- nodeOrFn,
109
- (node) => {
110
- import_layer_stack.layerStack.addBranch(node);
111
- return () => {
112
- import_layer_stack.layerStack.removeBranch(node);
113
- };
114
- },
115
- {
116
- defer: options.defer,
117
- onMissing: () => (0, import_utils.warn)("[@zag-js/dismissable] branch node is `null` or `undefined`")
118
- }
119
- );
90
+ return (0, _zag_js_dom_query.whenNode)(nodeOrFn, (node) => {
91
+ require_layer_stack.layerStack.addBranch(node);
92
+ return () => {
93
+ require_layer_stack.layerStack.removeBranch(node);
94
+ };
95
+ }, {
96
+ defer: options.defer,
97
+ getRootNode: options.getRootNode,
98
+ onMissing: () => (0, _zag_js_utils.warn)("[@zag-js/dismissable] branch node is `null` or `undefined`")
99
+ });
120
100
  }
121
- // Annotate the CommonJS export names for ESM import in node:
122
- 0 && (module.exports = {
123
- trackDismissableBranch,
124
- trackDismissableElement
125
- });
101
+ exports.isInNestedLayer = isInNestedLayer;
102
+ exports.trackDismissableBranch = trackDismissableBranch;
103
+ exports.trackDismissableElement = trackDismissableElement;