@tamagui/popover 2.7.7 → 3.0.0-beta.1091.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.
Files changed (50) hide show
  1. package/dist/cjs/Popover.cjs +522 -665
  2. package/dist/cjs/Popover.native.cjs +615 -0
  3. package/dist/cjs/Popover.native.js +549 -692
  4. package/dist/cjs/Popover.native.js.map +1 -1
  5. package/dist/cjs/index.cjs +9 -11
  6. package/dist/cjs/index.native.cjs +21 -0
  7. package/dist/cjs/index.native.js +9 -10
  8. package/dist/cjs/index.native.js.map +1 -1
  9. package/dist/cjs/useFloatingContext.cjs +213 -234
  10. package/dist/cjs/useFloatingContext.native.cjs +35 -0
  11. package/dist/cjs/useFloatingContext.native.js +19 -27
  12. package/dist/cjs/useFloatingContext.native.js.map +1 -1
  13. package/dist/esm/Popover.mjs +487 -618
  14. package/dist/esm/Popover.mjs.map +1 -1
  15. package/dist/esm/Popover.native.js +513 -645
  16. package/dist/esm/Popover.native.js.map +1 -1
  17. package/dist/esm/index.js +3 -3
  18. package/dist/esm/index.mjs +3 -3
  19. package/dist/esm/index.native.js +3 -3
  20. package/dist/esm/useFloatingContext.mjs +198 -208
  21. package/dist/esm/useFloatingContext.mjs.map +1 -1
  22. package/dist/esm/useFloatingContext.native.js +4 -2
  23. package/dist/esm/useFloatingContext.native.js.map +1 -1
  24. package/dist/jsx/Popover.mjs +487 -618
  25. package/dist/jsx/Popover.mjs.map +1 -1
  26. package/dist/jsx/Popover.native.cjs +615 -0
  27. package/dist/jsx/Popover.native.js +549 -692
  28. package/dist/jsx/Popover.native.js.map +1 -1
  29. package/dist/jsx/index.js +3 -3
  30. package/dist/jsx/index.mjs +3 -3
  31. package/dist/jsx/index.native.cjs +21 -0
  32. package/dist/jsx/index.native.js +9 -10
  33. package/dist/jsx/index.native.js.map +1 -1
  34. package/dist/jsx/useFloatingContext.mjs +198 -208
  35. package/dist/jsx/useFloatingContext.mjs.map +1 -1
  36. package/dist/jsx/useFloatingContext.native.cjs +35 -0
  37. package/dist/jsx/useFloatingContext.native.js +19 -27
  38. package/dist/jsx/useFloatingContext.native.js.map +1 -1
  39. package/package.json +24 -23
  40. package/src/Popover.tsx +157 -154
  41. package/src/useFloatingContext.tsx +15 -7
  42. package/types/Popover.d.ts +40 -112
  43. package/types/Popover.d.ts.map +1 -1
  44. package/types/useFloatingContext.d.ts +5 -2
  45. package/types/useFloatingContext.d.ts.map +1 -1
  46. package/dist/esm/index.js.map +0 -1
  47. package/dist/esm/index.mjs.map +0 -1
  48. package/dist/esm/index.native.js.map +0 -1
  49. package/dist/jsx/index.js.map +0 -1
  50. package/dist/jsx/index.mjs.map +0 -1
@@ -1,213 +1,203 @@
1
1
  import React from "react";
2
- import { createFloatingEvents, safePolygon, useDelayGroup, useFloatingRaw, useFocus, useHover, useInteractions, useRole, PopupTriggerMap } from "@tamagui/floating";
3
- const useFloatingContext = ({
4
- open,
5
- setOpen,
6
- disable,
7
- disableFocus,
8
- hoverable,
9
- role: roleProp = "dialog",
10
- focus: focusProp,
11
- groupId,
12
- delay: delayProp,
13
- restMs: restMsProp
14
- }) => {
15
- "use no memo";
2
+ import { PopupTriggerMap, createFloatingEvents, safePolygon, useDelayGroup, useFloatingRaw, useFocus, useHover, useInteractions, useRole } from "@tamagui/floating";
16
3
 
17
- const openRef = React.useRef(open);
18
- openRef.current = open;
19
- const hoverableRef = React.useRef(hoverable);
20
- hoverableRef.current = hoverable;
21
- const disableRef = React.useRef(disable);
22
- disableRef.current = disable;
23
- const disableFocusRef = React.useRef(disableFocus);
24
- disableFocusRef.current = disableFocus;
25
- const roleRef = React.useRef(roleProp);
26
- roleRef.current = roleProp;
27
- const focusRef = React.useRef(focusProp);
28
- focusRef.current = focusProp;
29
- const groupIdRef = React.useRef(groupId);
30
- groupIdRef.current = groupId;
31
- const delayRef = React.useRef(delayProp);
32
- delayRef.current = delayProp;
33
- const restMsRef = React.useRef(restMsProp);
34
- restMsRef.current = restMsProp;
35
- const events = React.useMemo(() => createFloatingEvents(), []);
36
- const triggerElements = React.useMemo(() => new PopupTriggerMap(), []);
37
- React.useEffect(() => {
38
- events.emit("openchange", {
39
- open
40
- });
41
- }, [open, events]);
42
- return React.useCallback(props => {
43
- const onTriggerRef = React.useRef(false);
44
- const restTimerRef = React.useRef(void 0);
45
- const graceRef = React.useRef(void 0);
46
- const pendingCloseRef = React.useRef(false);
47
- const isOverFloatingRef = React.useRef(false);
48
- const handleCloseActiveRef = React.useRef(false);
49
- React.useEffect(() => {
50
- return () => {
51
- clearTimeout(restTimerRef.current);
52
- clearTimeout(graceRef.current);
53
- };
54
- }, []);
55
- const onOpenChange = (val, event) => {
56
- if (val && event?.type === "mouseenter") {
57
- return;
58
- }
59
- if (!val && onTriggerRef.current && (event?.type === "mousemove" || event?.type === "mouseleave")) {
60
- pendingCloseRef.current = true;
61
- return;
62
- }
63
- const type = event?.type === "mousemove" || event?.type === "mouseenter" || event?.type === "mouseleave" ? "hover" : "press";
64
- setOpen(val, type);
65
- };
66
- const floating = useFloatingRaw({
67
- ...props,
68
- open: openRef.current
69
- });
70
- const currentHoverable = hoverableRef.current;
71
- const dataRef = React.useRef({});
72
- dataRef.current.placement = floating.placement;
73
- const floatingRefs = floating.refs;
74
- const nullRef = {
75
- current: null
76
- };
77
- const interactionContext = {
78
- open: openRef.current,
79
- onOpenChange,
80
- refs: {
81
- reference: floatingRefs?.reference || nullRef,
82
- floating: floatingRefs?.floating || nullRef,
83
- domReference: floatingRefs?.reference || nullRef
84
- },
85
- elements: {
86
- get reference() {
87
- return floatingRefs?.reference?.current || null;
88
- },
89
- get floating() {
90
- return floatingRefs?.floating?.current || null;
91
- },
92
- get domReference() {
93
- return floatingRefs?.reference?.current || null;
94
- }
95
- },
96
- dataRef,
97
- events,
98
- triggerElements,
99
- handleCloseActiveRef
100
- };
101
- const {
102
- delay: groupDelay,
103
- currentId: groupCurrentId
104
- } = useDelayGroup(interactionContext, {
105
- id: groupIdRef.current
106
- });
107
- const isInActiveGroup = groupIdRef.current && groupCurrentId != null && typeof groupDelay === "object";
108
- let delay;
109
- let restMs;
110
- if (isInActiveGroup) {
111
- delay = groupDelay;
112
- restMs = 0;
113
- } else if (delayRef.current !== void 0) {
114
- delay = delayRef.current;
115
- restMs = restMsRef.current ?? 0;
116
- } else {
117
- delay = currentHoverable && typeof currentHoverable === "object" ? currentHoverable.delay ?? 0 : 0;
118
- restMs = currentHoverable && typeof currentHoverable === "object" ? currentHoverable.restMs ?? 0 : 0;
119
- }
120
- const currentRole = roleRef.current;
121
- const currentFocus = focusRef.current;
122
- const {
123
- getReferenceProps,
124
- getFloatingProps: getFloatingPropsInner
125
- } = useInteractions([currentHoverable ? useHover(interactionContext, {
126
- enabled: !disableRef.current && !!currentHoverable,
127
- delay,
128
- restMs,
129
- handleClose: safePolygon({
130
- requireIntent: true,
131
- buffer: 1,
132
- __debug: typeof window !== "undefined" && new URLSearchParams(window.location.search).get("debug") === "safePolygon"
133
- }),
134
- ...(typeof currentHoverable === "object" && currentHoverable)
135
- }) : useHover(interactionContext, {
136
- enabled: false
137
- }), useFocus(interactionContext, {
138
- enabled: !disableRef.current && !disableFocusRef.current,
139
- visibleOnly: true,
140
- ...currentFocus
141
- }), useRole(interactionContext, {
142
- role: currentRole
143
- })]);
144
- const getFloatingProps = currentHoverable ? userProps => {
145
- const merged = getFloatingPropsInner(userProps);
146
- const origEnter = merged.onMouseEnter;
147
- const origLeave = merged.onMouseLeave;
148
- return {
149
- ...merged,
150
- onMouseEnter: e => {
151
- isOverFloatingRef.current = true;
152
- origEnter?.(e);
153
- },
154
- onMouseLeave: e => {
155
- isOverFloatingRef.current = false;
156
- origLeave?.(e);
157
- }
158
- };
159
- } : getFloatingPropsInner;
160
- const openDelay = typeof delay === "number" ? delay : delay?.open ?? 0;
161
- const closeDelay = typeof delay === "number" ? delay : delay?.close ?? 0;
162
- const setOpenWithDelay = () => {
163
- clearTimeout(restTimerRef.current);
164
- if (restMs && !openDelay) {
165
- restTimerRef.current = setTimeout(() => {
166
- setOpen(true, "hover");
167
- }, restMs);
168
- } else if (openDelay) {
169
- restTimerRef.current = setTimeout(() => {
170
- setOpen(true, "hover");
171
- }, openDelay);
172
- } else {
173
- setOpen(true, "hover");
174
- }
175
- };
176
- return {
177
- ...floating,
178
- open: openRef.current,
179
- triggerElements,
180
- getReferenceProps,
181
- getFloatingProps,
182
- onHoverReference: currentHoverable ? _event => {
183
- clearTimeout(graceRef.current);
184
- onTriggerRef.current = true;
185
- pendingCloseRef.current = false;
186
- clearTimeout(restTimerRef.current);
187
- if (openRef.current) return;
188
- setOpenWithDelay();
189
- } : void 0,
190
- onLeaveReference: currentHoverable ? () => {
191
- clearTimeout(restTimerRef.current);
192
- clearTimeout(graceRef.current);
193
- graceRef.current = setTimeout(() => {
194
- onTriggerRef.current = false;
195
- if (pendingCloseRef.current) {
196
- pendingCloseRef.current = false;
197
- setOpen(false, "hover");
198
- return;
199
- }
200
- if (openRef.current) {
201
- graceRef.current = setTimeout(() => {
202
- if (openRef.current && !isOverFloatingRef.current && !handleCloseActiveRef.current) {
203
- setOpen(false, "hover");
204
- }
205
- }, Math.max(250, closeDelay));
206
- }
207
- }, 40);
208
- } : void 0
209
- };
210
- }, [setOpen]);
4
+ const useFloatingContext = ({ open, setOpen, disable, disableFocus, hoverable, role: roleProp = "dialog", focus: focusProp, groupId, delay: delayProp, restMs: restMsProp, closeReasonRef }) => {
5
+ "use no memo";
6
+ const openRef = React.useRef(open);
7
+ openRef.current = open;
8
+ const hoverableRef = React.useRef(hoverable);
9
+ hoverableRef.current = hoverable;
10
+ const disableRef = React.useRef(disable);
11
+ disableRef.current = disable;
12
+ const disableFocusRef = React.useRef(disableFocus);
13
+ disableFocusRef.current = disableFocus;
14
+ const roleRef = React.useRef(roleProp);
15
+ roleRef.current = roleProp;
16
+ const focusRef = React.useRef(focusProp);
17
+ focusRef.current = focusProp;
18
+ const groupIdRef = React.useRef(groupId);
19
+ groupIdRef.current = groupId;
20
+ const delayRef = React.useRef(delayProp);
21
+ delayRef.current = delayProp;
22
+ const restMsRef = React.useRef(restMsProp);
23
+ restMsRef.current = restMsProp;
24
+ const events = React.useMemo(() => createFloatingEvents(), []);
25
+ const triggerElements = React.useMemo(() => new PopupTriggerMap(), []);
26
+ React.useEffect(() => {
27
+ const reason = closeReasonRef?.current;
28
+ if (closeReasonRef) {
29
+ closeReasonRef.current = void 0;
30
+ }
31
+ events.emit("openchange", {
32
+ open,
33
+ reason: open ? void 0 : reason
34
+ });
35
+ }, [
36
+ open,
37
+ events,
38
+ closeReasonRef
39
+ ]);
40
+ return React.useCallback((props) => {
41
+ const onTriggerRef = React.useRef(false);
42
+ const restTimerRef = React.useRef(void 0);
43
+ const graceRef = React.useRef(void 0);
44
+ const pendingCloseRef = React.useRef(false);
45
+ const isOverFloatingRef = React.useRef(false);
46
+ const handleCloseActiveRef = React.useRef(false);
47
+ React.useEffect(() => {
48
+ return () => {
49
+ clearTimeout(restTimerRef.current);
50
+ clearTimeout(graceRef.current);
51
+ };
52
+ }, []);
53
+ const onOpenChange = (val, event, reason) => {
54
+ if (val && event?.type === "mouseenter") {
55
+ return;
56
+ }
57
+ if (!val && onTriggerRef.current && (event?.type === "mousemove" || event?.type === "mouseleave")) {
58
+ pendingCloseRef.current = true;
59
+ return;
60
+ }
61
+ const type = event?.type === "mousemove" || event?.type === "mouseenter" || event?.type === "mouseleave" ? "hover" : "press";
62
+ if (closeReasonRef) closeReasonRef.current = reason;
63
+ setOpen(val, type);
64
+ };
65
+ const floating = useFloatingRaw({
66
+ ...props,
67
+ open: openRef.current
68
+ });
69
+ const currentHoverable = hoverableRef.current;
70
+ const dataRef = React.useRef({});
71
+ dataRef.current.placement = floating.placement;
72
+ const floatingRefs = floating.refs;
73
+ const nullRef = { current: null };
74
+ const interactionContext = {
75
+ open: openRef.current,
76
+ onOpenChange,
77
+ refs: {
78
+ reference: floatingRefs?.reference || nullRef,
79
+ floating: floatingRefs?.floating || nullRef,
80
+ domReference: floatingRefs?.reference || nullRef
81
+ },
82
+ elements: {
83
+ get reference() {
84
+ return floatingRefs?.reference?.current || null;
85
+ },
86
+ get floating() {
87
+ return floatingRefs?.floating?.current || null;
88
+ },
89
+ get domReference() {
90
+ return floatingRefs?.reference?.current || null;
91
+ }
92
+ },
93
+ dataRef,
94
+ events,
95
+ triggerElements,
96
+ handleCloseActiveRef
97
+ };
98
+ const { delay: groupDelay, currentId: groupCurrentId } = useDelayGroup(interactionContext, { id: groupIdRef.current });
99
+ const isInActiveGroup = groupIdRef.current && groupCurrentId != null && typeof groupDelay === "object";
100
+ let delay;
101
+ let restMs;
102
+ if (isInActiveGroup) {
103
+ delay = groupDelay;
104
+ restMs = 0;
105
+ } else if (delayRef.current !== void 0) {
106
+ delay = delayRef.current;
107
+ restMs = restMsRef.current ?? 0;
108
+ } else {
109
+ delay = currentHoverable && typeof currentHoverable === "object" ? currentHoverable.delay ?? 0 : 0;
110
+ restMs = currentHoverable && typeof currentHoverable === "object" ? currentHoverable.restMs ?? 0 : 0;
111
+ }
112
+ const currentRole = roleRef.current;
113
+ const currentFocus = focusRef.current;
114
+ const { getReferenceProps, getFloatingProps: getFloatingPropsInner } = useInteractions([
115
+ currentHoverable ? useHover(interactionContext, {
116
+ enabled: !disableRef.current && !!currentHoverable,
117
+ delay,
118
+ restMs,
119
+ handleClose: safePolygon({
120
+ requireIntent: true,
121
+ buffer: 1,
122
+ __debug: typeof window !== "undefined" && new URLSearchParams(window.location.search).get("debug") === "safePolygon"
123
+ }),
124
+ ...typeof currentHoverable === "object" && currentHoverable
125
+ }) : useHover(interactionContext, { enabled: false }),
126
+ useFocus(interactionContext, {
127
+ enabled: !disableRef.current && !disableFocusRef.current,
128
+ visibleOnly: true,
129
+ ...currentFocus
130
+ }),
131
+ useRole(interactionContext, { role: currentRole })
132
+ ]);
133
+ const getFloatingProps = currentHoverable ? (userProps) => {
134
+ const merged = getFloatingPropsInner(userProps);
135
+ const origEnter = merged.onMouseEnter;
136
+ const origLeave = merged.onMouseLeave;
137
+ return {
138
+ ...merged,
139
+ onMouseEnter: (e) => {
140
+ isOverFloatingRef.current = true;
141
+ origEnter?.(e);
142
+ },
143
+ onMouseLeave: (e) => {
144
+ isOverFloatingRef.current = false;
145
+ origLeave?.(e);
146
+ }
147
+ };
148
+ } : getFloatingPropsInner;
149
+ const openDelay = typeof delay === "number" ? delay : delay?.open ?? 0;
150
+ const closeDelay = typeof delay === "number" ? delay : delay?.close ?? 0;
151
+ const setOpenWithDelay = () => {
152
+ clearTimeout(restTimerRef.current);
153
+ if (restMs && !openDelay) {
154
+ restTimerRef.current = setTimeout(() => {
155
+ setOpen(true, "hover");
156
+ }, restMs);
157
+ } else if (openDelay) {
158
+ restTimerRef.current = setTimeout(() => {
159
+ setOpen(true, "hover");
160
+ }, openDelay);
161
+ } else {
162
+ setOpen(true, "hover");
163
+ }
164
+ };
165
+ return {
166
+ ...floating,
167
+ open: openRef.current,
168
+ triggerElements,
169
+ getReferenceProps,
170
+ getFloatingProps,
171
+ onHoverReference: currentHoverable ? (_event) => {
172
+ clearTimeout(graceRef.current);
173
+ onTriggerRef.current = true;
174
+ pendingCloseRef.current = false;
175
+ clearTimeout(restTimerRef.current);
176
+ if (openRef.current) return;
177
+ setOpenWithDelay();
178
+ } : void 0,
179
+ onLeaveReference: currentHoverable ? () => {
180
+ clearTimeout(restTimerRef.current);
181
+ clearTimeout(graceRef.current);
182
+ graceRef.current = setTimeout(() => {
183
+ onTriggerRef.current = false;
184
+ if (pendingCloseRef.current) {
185
+ pendingCloseRef.current = false;
186
+ setOpen(false, "hover");
187
+ return;
188
+ }
189
+ if (openRef.current) {
190
+ graceRef.current = setTimeout(() => {
191
+ if (openRef.current && !isOverFloatingRef.current && !handleCloseActiveRef.current) {
192
+ setOpen(false, "hover");
193
+ }
194
+ }, Math.max(250, closeDelay));
195
+ }
196
+ }, 40);
197
+ } : void 0
198
+ };
199
+ }, [setOpen, closeReasonRef]);
211
200
  };
201
+
212
202
  export { useFloatingContext };
213
203
  //# sourceMappingURL=useFloatingContext.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","createFloatingEvents","safePolygon","useDelayGroup","useFloatingRaw","useFocus","useHover","useInteractions","useRole","PopupTriggerMap","useFloatingContext","open","setOpen","disable","disableFocus","hoverable","role","roleProp","focus","focusProp","groupId","delay","delayProp","restMs","restMsProp","openRef","useRef","current","hoverableRef","disableRef","disableFocusRef","roleRef","focusRef","groupIdRef","delayRef","restMsRef","events","useMemo","triggerElements","useEffect","emit","useCallback","props","onTriggerRef","restTimerRef","graceRef","pendingCloseRef","isOverFloatingRef","handleCloseActiveRef","clearTimeout","onOpenChange","val","event","type","floating","currentHoverable","dataRef","placement","floatingRefs","refs","nullRef","interactionContext","reference","domReference","elements","groupDelay","currentId","groupCurrentId","id","isInActiveGroup","currentRole","currentFocus","getReferenceProps","getFloatingProps","getFloatingPropsInner","enabled","handleClose","requireIntent","buffer","__debug","window","URLSearchParams","location","search","get","visibleOnly","userProps","merged","origEnter","onMouseEnter","origLeave","onMouseLeave","e","openDelay","closeDelay","close","setOpenWithDelay","setTimeout","onHoverReference","_event","onLeaveReference","Math","max"],"sources":["../../src/useFloatingContext.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAElB,SACEC,oBAAA,EACAC,WAAA,EACAC,aAAA,EACAC,cAAA,EACAC,QAAA,EACAC,QAAA,EACAC,eAAA,EACAC,OAAA,EACAC,eAAA,QAEK;AAoCA,MAAMC,kBAAA,GAAqBA,CAAC;EACjCC,IAAA;EACAC,OAAA;EACAC,OAAA;EACAC,YAAA;EACAC,SAAA;EACAC,IAAA,EAAMC,QAAA,GAAW;EACjBC,KAAA,EAAOC,SAAA;EACPC,OAAA;EACAC,KAAA,EAAOC,SAAA;EACPC,MAAA,EAAQC;AACV,MAAiC;EAC/B;;EAEA,MAAMC,OAAA,GAAUzB,KAAA,CAAM0B,MAAA,CAAOf,IAAI;EACjCc,OAAA,CAAQE,OAAA,GAAUhB,I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,OAAA,GAAU;QAC1BsB,YAAA,CAAaL,YAAA,CAAajB,OAAO;QAEjC,IAAIF,OAAA,CAAQE,OAAA,EAAS;QACrBqE,gBAAA,CAAiB;MACnB,IACA;MAEJI,gBAAA,EAAkB7C,gBAAA,GACd,MAAM;QACJN,YAAA,CAAaL,YAAA,CAAajB,OAAO;QACjCsB,YAAA,CAAaJ,QAAA,CAASlB,OAAO;QAC7BkB,QAAA,CAASlB,OAAA,GAAUsE,UAAA,CAAW,MAAM;UAClCtD,YAAA,CAAahB,OAAA,GAAU;UACvB,IAAImB,eAAA,CAAgBnB,OAAA,EAAS;YAC3BmB,eAAA,CAAgBnB,OAAA,GAAU;YAC1Bf,OAAA,CAAQ,OAAO,OAAO;YACtB;UACF;UAMA,IAAIa,OAAA,CAAQE,OAAA,EAAS;YACnBkB,QAAA,CAASlB,OAAA,GAAUsE,UAAA,CACjB,MAAM;cAKJ,IACExE,OAAA,CAAQE,OAAA,IACR,CAACoB,iBAAA,CAAkBpB,OAAA,IACnB,CAACqB,oBAAA,CAAqBrB,OAAA,EACtB;gBACAf,OAAA,CAAQ,OAAO,OAAO;cACxB;YACF,GACAyF,IAAA,CAAKC,GAAA,CAAI,KAAKR,UAAU,CAC1B;UACF;QACF,GAAG,EAAE;MACP,IACA;IACN;EACF,GACA,CAAClF,OAAO,CACV;AACF","ignoreList":[]}
1
+ {"version":3,"file":"useFloatingContext.js","names":[],"sources":["esm/useFloatingContext.js"],"sourcesContent":["import React from \"react\";\nimport {\n createFloatingEvents,\n safePolygon,\n useDelayGroup,\n useFloatingRaw,\n useFocus,\n useHover,\n useInteractions,\n useRole,\n PopupTriggerMap\n} from \"@tamagui/floating\";\nconst useFloatingContext = ({\n open,\n setOpen,\n disable,\n disableFocus,\n hoverable,\n role: roleProp = \"dialog\",\n focus: focusProp,\n groupId,\n delay: delayProp,\n restMs: restMsProp,\n closeReasonRef\n}) => {\n \"use no memo\";\n const openRef = React.useRef(open);\n openRef.current = open;\n const hoverableRef = React.useRef(hoverable);\n hoverableRef.current = hoverable;\n const disableRef = React.useRef(disable);\n disableRef.current = disable;\n const disableFocusRef = React.useRef(disableFocus);\n disableFocusRef.current = disableFocus;\n const roleRef = React.useRef(roleProp);\n roleRef.current = roleProp;\n const focusRef = React.useRef(focusProp);\n focusRef.current = focusProp;\n const groupIdRef = React.useRef(groupId);\n groupIdRef.current = groupId;\n const delayRef = React.useRef(delayProp);\n delayRef.current = delayProp;\n const restMsRef = React.useRef(restMsProp);\n restMsRef.current = restMsProp;\n const events = React.useMemo(() => createFloatingEvents(), []);\n const triggerElements = React.useMemo(() => new PopupTriggerMap(), []);\n React.useEffect(() => {\n const reason = closeReasonRef?.current;\n if (closeReasonRef) {\n closeReasonRef.current = void 0;\n }\n events.emit(\"openchange\", { open, reason: open ? void 0 : reason });\n }, [open, events, closeReasonRef]);\n return React.useCallback(\n (props) => {\n const onTriggerRef = React.useRef(false);\n const restTimerRef = React.useRef(void 0);\n const graceRef = React.useRef(void 0);\n const pendingCloseRef = React.useRef(false);\n const isOverFloatingRef = React.useRef(false);\n const handleCloseActiveRef = React.useRef(false);\n React.useEffect(() => {\n return () => {\n clearTimeout(restTimerRef.current);\n clearTimeout(graceRef.current);\n };\n }, []);\n const onOpenChange = (val, event, reason) => {\n if (val && event?.type === \"mouseenter\") {\n return;\n }\n if (!val && onTriggerRef.current && (event?.type === \"mousemove\" || event?.type === \"mouseleave\")) {\n pendingCloseRef.current = true;\n return;\n }\n const type = event?.type === \"mousemove\" || event?.type === \"mouseenter\" || event?.type === \"mouseleave\" ? \"hover\" : \"press\";\n if (closeReasonRef) closeReasonRef.current = reason;\n setOpen(val, type);\n };\n const floating = useFloatingRaw({ ...props, open: openRef.current });\n const currentHoverable = hoverableRef.current;\n const dataRef = React.useRef({});\n dataRef.current.placement = floating.placement;\n const floatingRefs = floating.refs;\n const nullRef = { current: null };\n const interactionContext = {\n open: openRef.current,\n onOpenChange,\n refs: {\n reference: floatingRefs?.reference || nullRef,\n floating: floatingRefs?.floating || nullRef,\n domReference: floatingRefs?.reference || nullRef\n },\n elements: {\n get reference() {\n return floatingRefs?.reference?.current || null;\n },\n get floating() {\n return floatingRefs?.floating?.current || null;\n },\n get domReference() {\n return floatingRefs?.reference?.current || null;\n }\n },\n dataRef,\n events,\n triggerElements,\n handleCloseActiveRef\n };\n const { delay: groupDelay, currentId: groupCurrentId } = useDelayGroup(\n interactionContext,\n { id: groupIdRef.current }\n );\n const isInActiveGroup = groupIdRef.current && groupCurrentId != null && typeof groupDelay === \"object\";\n let delay;\n let restMs;\n if (isInActiveGroup) {\n delay = groupDelay;\n restMs = 0;\n } else if (delayRef.current !== void 0) {\n delay = delayRef.current;\n restMs = restMsRef.current ?? 0;\n } else {\n delay = currentHoverable && typeof currentHoverable === \"object\" ? currentHoverable.delay ?? 0 : 0;\n restMs = currentHoverable && typeof currentHoverable === \"object\" ? currentHoverable.restMs ?? 0 : 0;\n }\n const currentRole = roleRef.current;\n const currentFocus = focusRef.current;\n const { getReferenceProps, getFloatingProps: getFloatingPropsInner } = useInteractions([\n currentHoverable ? useHover(interactionContext, {\n enabled: !disableRef.current && !!currentHoverable,\n delay,\n restMs,\n handleClose: safePolygon({\n requireIntent: true,\n buffer: 1,\n __debug: typeof window !== \"undefined\" && new URLSearchParams(window.location.search).get(\"debug\") === \"safePolygon\"\n }),\n ...typeof currentHoverable === \"object\" && currentHoverable\n }) : useHover(interactionContext, {\n enabled: false\n }),\n useFocus(interactionContext, {\n enabled: !disableRef.current && !disableFocusRef.current,\n visibleOnly: true,\n ...currentFocus\n }),\n useRole(interactionContext, { role: currentRole })\n ]);\n const getFloatingProps = currentHoverable ? (userProps) => {\n const merged = getFloatingPropsInner(userProps);\n const origEnter = merged.onMouseEnter;\n const origLeave = merged.onMouseLeave;\n return {\n ...merged,\n onMouseEnter: (e) => {\n isOverFloatingRef.current = true;\n origEnter?.(e);\n },\n onMouseLeave: (e) => {\n isOverFloatingRef.current = false;\n origLeave?.(e);\n }\n };\n } : getFloatingPropsInner;\n const openDelay = typeof delay === \"number\" ? delay : delay?.open ?? 0;\n const closeDelay = typeof delay === \"number\" ? delay : delay?.close ?? 0;\n const setOpenWithDelay = () => {\n clearTimeout(restTimerRef.current);\n if (restMs && !openDelay) {\n restTimerRef.current = setTimeout(() => {\n setOpen(true, \"hover\");\n }, restMs);\n } else if (openDelay) {\n restTimerRef.current = setTimeout(() => {\n setOpen(true, \"hover\");\n }, openDelay);\n } else {\n setOpen(true, \"hover\");\n }\n };\n return {\n ...floating,\n open: openRef.current,\n triggerElements,\n getReferenceProps,\n getFloatingProps,\n onHoverReference: currentHoverable ? (_event) => {\n clearTimeout(graceRef.current);\n onTriggerRef.current = true;\n pendingCloseRef.current = false;\n clearTimeout(restTimerRef.current);\n if (openRef.current) return;\n setOpenWithDelay();\n } : void 0,\n onLeaveReference: currentHoverable ? () => {\n clearTimeout(restTimerRef.current);\n clearTimeout(graceRef.current);\n graceRef.current = setTimeout(() => {\n onTriggerRef.current = false;\n if (pendingCloseRef.current) {\n pendingCloseRef.current = false;\n setOpen(false, \"hover\");\n return;\n }\n if (openRef.current) {\n graceRef.current = setTimeout(\n () => {\n if (openRef.current && !isOverFloatingRef.current && !handleCloseActiveRef.current) {\n setOpen(false, \"hover\");\n }\n },\n Math.max(250, closeDelay)\n );\n }\n }, 40);\n } : void 0\n };\n },\n [setOpen, closeReasonRef]\n );\n};\nexport {\n useFloatingContext\n};\n//# sourceMappingURL=useFloatingContext.js.map\n"],"mappings":";;;;AAYA,MAAM,sBAAsB,EAC1B,MACA,SACA,SACA,cACA,WACA,MAAM,WAAW,UACjB,OAAO,WACP,SACA,OAAO,WACP,QAAQ,YACR,qBACI;CACJ;CACA,MAAM,UAAU,MAAM,OAAO,IAAI;CACjC,QAAQ,UAAU;CAClB,MAAM,eAAe,MAAM,OAAO,SAAS;CAC3C,aAAa,UAAU;CACvB,MAAM,aAAa,MAAM,OAAO,OAAO;CACvC,WAAW,UAAU;CACrB,MAAM,kBAAkB,MA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C,aAAa,SAAS,OAAO;IAC7B,aAAa,UAAU;IACvB,gBAAgB,UAAU;IAC1B,aAAa,aAAa,OAAO;IACjC,IAAI,QAAQ,SAAS;IACrB,iBAAiB;GACnB,IAAI,KAAK;GACT,kBAAkB,yBAAyB;IACzC,aAAa,aAAa,OAAO;IACjC,aAAa,SAAS,OAAO;IAC7B,SAAS,UAAU,iBAAiB;KAClC,aAAa,UAAU;KACvB,IAAI,gBAAgB,SAAS;MAC3B,gBAAgB,UAAU;MAC1B,QAAQ,OAAO,OAAO;MACtB;KACF;KACA,IAAI,QAAQ,SAAS;MACnB,SAAS,UAAU,iBACX;OACJ,IAAI,QAAQ,WAAW,CAAC,kBAAkB,WAAW,CAAC,qBAAqB,SAAS;QAClF,QAAQ,OAAO,OAAO;OACxB;MACF,GACA,KAAK,IAAI,KAAK,UAAU,CAC1B;KACF;IACF,GAAG,EAAE;GACP,IAAI,KAAK;EACX;CACF,GACA,CAAC,SAAS,cAAc,CAC1B;AACF"}
@@ -1,6 +1,8 @@
1
1
  import React from "react";
2
- var useFloatingContext = function () {
3
- return React.useCallback(function () {}, []);
2
+
3
+ var useFloatingContext = function() {
4
+ return React.useCallback(function() {}, []);
4
5
  };
6
+
5
7
  export { useFloatingContext };
6
8
  //# sourceMappingURL=useFloatingContext.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useFloatingContext","useCallback"],"sources":["../../src/useFloatingContext.native.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAEX,IAAIC,kBAAA,GAAqB,SAAAA,CAAA,EAAW;EACvC,OAAOD,KAAA,CAAME,WAAA,CAAY,YAAW,CAAC,GAAG,EAAE;AAC9C","ignoreList":[]}
1
+ {"version":3,"file":"useFloatingContext.native.js","names":[],"sources":["esm/useFloatingContext.native.js"],"sourcesContent":["import React from \"react\";\nvar useFloatingContext = function() {\n return React.useCallback(function() {\n }, []);\n};\nexport {\n useFloatingContext\n};\n//# sourceMappingURL=useFloatingContext.native.js.map\n"],"mappings":";;;AACA,IAAI,qBAAqB,WAAW;CAClC,OAAO,MAAM,YAAY,WAAW,CACpC,GAAG,CAAC,CAAC;AACP"}