@tamagui/popover 2.7.7 → 3.0.0-beta.643.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/dist/cjs/Popover.cjs +509 -664
- package/dist/cjs/Popover.native.cjs +603 -0
- package/dist/cjs/Popover.native.js +536 -691
- package/dist/cjs/Popover.native.js.map +1 -1
- package/dist/cjs/index.cjs +10 -11
- package/dist/cjs/index.native.cjs +22 -0
- package/dist/cjs/index.native.js +10 -10
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/useFloatingContext.cjs +202 -234
- package/dist/cjs/useFloatingContext.native.cjs +36 -0
- package/dist/cjs/useFloatingContext.native.js +20 -27
- package/dist/cjs/useFloatingContext.native.js.map +1 -1
- package/dist/esm/Popover.mjs +473 -617
- package/dist/esm/Popover.mjs.map +1 -1
- package/dist/esm/Popover.native.js +499 -644
- package/dist/esm/Popover.native.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/index.native.js +3 -3
- package/dist/esm/useFloatingContext.mjs +186 -208
- package/dist/esm/useFloatingContext.mjs.map +1 -1
- package/dist/esm/useFloatingContext.native.js +4 -2
- package/dist/esm/useFloatingContext.native.js.map +1 -1
- package/dist/jsx/Popover.mjs +473 -617
- package/dist/jsx/Popover.mjs.map +1 -1
- package/dist/jsx/Popover.native.cjs +603 -0
- package/dist/jsx/Popover.native.js +536 -691
- package/dist/jsx/Popover.native.js.map +1 -1
- package/dist/jsx/index.js +3 -3
- package/dist/jsx/index.mjs +3 -3
- package/dist/jsx/index.native.cjs +22 -0
- package/dist/jsx/index.native.js +10 -10
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/useFloatingContext.mjs +186 -208
- package/dist/jsx/useFloatingContext.mjs.map +1 -1
- package/dist/jsx/useFloatingContext.native.cjs +36 -0
- package/dist/jsx/useFloatingContext.native.js +20 -27
- package/dist/jsx/useFloatingContext.native.js.map +1 -1
- package/package.json +22 -22
- package/src/Popover.tsx +115 -147
- package/types/Popover.d.ts +33 -109
- package/types/Popover.d.ts.map +1 -1
- package/types/useFloatingContext.d.ts.map +1 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
|
@@ -1,213 +1,191 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { createFloatingEvents, safePolygon, useDelayGroup, useFloatingRaw, useFocus, useHover, useInteractions, useRole
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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 }) => {
|
|
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
|
+
events.emit("openchange", { open });
|
|
28
|
+
}, [open, events]);
|
|
29
|
+
return React.useCallback((props) => {
|
|
30
|
+
const onTriggerRef = React.useRef(false);
|
|
31
|
+
const restTimerRef = React.useRef(void 0);
|
|
32
|
+
const graceRef = React.useRef(void 0);
|
|
33
|
+
const pendingCloseRef = React.useRef(false);
|
|
34
|
+
const isOverFloatingRef = React.useRef(false);
|
|
35
|
+
const handleCloseActiveRef = React.useRef(false);
|
|
36
|
+
React.useEffect(() => {
|
|
37
|
+
return () => {
|
|
38
|
+
clearTimeout(restTimerRef.current);
|
|
39
|
+
clearTimeout(graceRef.current);
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
42
|
+
const onOpenChange = (val, event) => {
|
|
43
|
+
if (val && event?.type === "mouseenter") {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (!val && onTriggerRef.current && (event?.type === "mousemove" || event?.type === "mouseleave")) {
|
|
47
|
+
pendingCloseRef.current = true;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const type = event?.type === "mousemove" || event?.type === "mouseenter" || event?.type === "mouseleave" ? "hover" : "press";
|
|
51
|
+
setOpen(val, type);
|
|
52
|
+
};
|
|
53
|
+
const floating = useFloatingRaw({
|
|
54
|
+
...props,
|
|
55
|
+
open: openRef.current
|
|
56
|
+
});
|
|
57
|
+
const currentHoverable = hoverableRef.current;
|
|
58
|
+
const dataRef = React.useRef({});
|
|
59
|
+
dataRef.current.placement = floating.placement;
|
|
60
|
+
const floatingRefs = floating.refs;
|
|
61
|
+
const nullRef = { current: null };
|
|
62
|
+
const interactionContext = {
|
|
63
|
+
open: openRef.current,
|
|
64
|
+
onOpenChange,
|
|
65
|
+
refs: {
|
|
66
|
+
reference: floatingRefs?.reference || nullRef,
|
|
67
|
+
floating: floatingRefs?.floating || nullRef,
|
|
68
|
+
domReference: floatingRefs?.reference || nullRef
|
|
69
|
+
},
|
|
70
|
+
elements: {
|
|
71
|
+
get reference() {
|
|
72
|
+
return floatingRefs?.reference?.current || null;
|
|
73
|
+
},
|
|
74
|
+
get floating() {
|
|
75
|
+
return floatingRefs?.floating?.current || null;
|
|
76
|
+
},
|
|
77
|
+
get domReference() {
|
|
78
|
+
return floatingRefs?.reference?.current || null;
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
dataRef,
|
|
82
|
+
events,
|
|
83
|
+
triggerElements,
|
|
84
|
+
handleCloseActiveRef
|
|
85
|
+
};
|
|
86
|
+
const { delay: groupDelay, currentId: groupCurrentId } = useDelayGroup(interactionContext, { id: groupIdRef.current });
|
|
87
|
+
const isInActiveGroup = groupIdRef.current && groupCurrentId != null && typeof groupDelay === "object";
|
|
88
|
+
let delay;
|
|
89
|
+
let restMs;
|
|
90
|
+
if (isInActiveGroup) {
|
|
91
|
+
delay = groupDelay;
|
|
92
|
+
restMs = 0;
|
|
93
|
+
} else if (delayRef.current !== void 0) {
|
|
94
|
+
delay = delayRef.current;
|
|
95
|
+
restMs = restMsRef.current ?? 0;
|
|
96
|
+
} else {
|
|
97
|
+
delay = currentHoverable && typeof currentHoverable === "object" ? currentHoverable.delay ?? 0 : 0;
|
|
98
|
+
restMs = currentHoverable && typeof currentHoverable === "object" ? currentHoverable.restMs ?? 0 : 0;
|
|
99
|
+
}
|
|
100
|
+
const currentRole = roleRef.current;
|
|
101
|
+
const currentFocus = focusRef.current;
|
|
102
|
+
const { getReferenceProps, getFloatingProps: getFloatingPropsInner } = useInteractions([
|
|
103
|
+
currentHoverable ? useHover(interactionContext, {
|
|
104
|
+
enabled: !disableRef.current && !!currentHoverable,
|
|
105
|
+
delay,
|
|
106
|
+
restMs,
|
|
107
|
+
handleClose: safePolygon({
|
|
108
|
+
requireIntent: true,
|
|
109
|
+
buffer: 1,
|
|
110
|
+
__debug: typeof window !== "undefined" && new URLSearchParams(window.location.search).get("debug") === "safePolygon"
|
|
111
|
+
}),
|
|
112
|
+
...typeof currentHoverable === "object" && currentHoverable
|
|
113
|
+
}) : useHover(interactionContext, { enabled: false }),
|
|
114
|
+
useFocus(interactionContext, {
|
|
115
|
+
enabled: !disableRef.current && !disableFocusRef.current,
|
|
116
|
+
visibleOnly: true,
|
|
117
|
+
...currentFocus
|
|
118
|
+
}),
|
|
119
|
+
useRole(interactionContext, { role: currentRole })
|
|
120
|
+
]);
|
|
121
|
+
const getFloatingProps = currentHoverable ? (userProps) => {
|
|
122
|
+
const merged = getFloatingPropsInner(userProps);
|
|
123
|
+
const origEnter = merged.onMouseEnter;
|
|
124
|
+
const origLeave = merged.onMouseLeave;
|
|
125
|
+
return {
|
|
126
|
+
...merged,
|
|
127
|
+
onMouseEnter: (e) => {
|
|
128
|
+
isOverFloatingRef.current = true;
|
|
129
|
+
origEnter?.(e);
|
|
130
|
+
},
|
|
131
|
+
onMouseLeave: (e) => {
|
|
132
|
+
isOverFloatingRef.current = false;
|
|
133
|
+
origLeave?.(e);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
} : getFloatingPropsInner;
|
|
137
|
+
const openDelay = typeof delay === "number" ? delay : delay?.open ?? 0;
|
|
138
|
+
const closeDelay = typeof delay === "number" ? delay : delay?.close ?? 0;
|
|
139
|
+
const setOpenWithDelay = () => {
|
|
140
|
+
clearTimeout(restTimerRef.current);
|
|
141
|
+
if (restMs && !openDelay) {
|
|
142
|
+
restTimerRef.current = setTimeout(() => {
|
|
143
|
+
setOpen(true, "hover");
|
|
144
|
+
}, restMs);
|
|
145
|
+
} else if (openDelay) {
|
|
146
|
+
restTimerRef.current = setTimeout(() => {
|
|
147
|
+
setOpen(true, "hover");
|
|
148
|
+
}, openDelay);
|
|
149
|
+
} else {
|
|
150
|
+
setOpen(true, "hover");
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
return {
|
|
154
|
+
...floating,
|
|
155
|
+
open: openRef.current,
|
|
156
|
+
triggerElements,
|
|
157
|
+
getReferenceProps,
|
|
158
|
+
getFloatingProps,
|
|
159
|
+
onHoverReference: currentHoverable ? (_event) => {
|
|
160
|
+
clearTimeout(graceRef.current);
|
|
161
|
+
onTriggerRef.current = true;
|
|
162
|
+
pendingCloseRef.current = false;
|
|
163
|
+
clearTimeout(restTimerRef.current);
|
|
164
|
+
if (openRef.current) return;
|
|
165
|
+
setOpenWithDelay();
|
|
166
|
+
} : void 0,
|
|
167
|
+
onLeaveReference: currentHoverable ? () => {
|
|
168
|
+
clearTimeout(restTimerRef.current);
|
|
169
|
+
clearTimeout(graceRef.current);
|
|
170
|
+
graceRef.current = setTimeout(() => {
|
|
171
|
+
onTriggerRef.current = false;
|
|
172
|
+
if (pendingCloseRef.current) {
|
|
173
|
+
pendingCloseRef.current = false;
|
|
174
|
+
setOpen(false, "hover");
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (openRef.current) {
|
|
178
|
+
graceRef.current = setTimeout(() => {
|
|
179
|
+
if (openRef.current && !isOverFloatingRef.current && !handleCloseActiveRef.current) {
|
|
180
|
+
setOpen(false, "hover");
|
|
181
|
+
}
|
|
182
|
+
}, Math.max(250, closeDelay));
|
|
183
|
+
}
|
|
184
|
+
}, 40);
|
|
185
|
+
} : void 0
|
|
186
|
+
};
|
|
187
|
+
}, [setOpen]);
|
|
211
188
|
};
|
|
189
|
+
|
|
212
190
|
export { useFloatingContext };
|
|
213
191
|
//# 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,IAAA;EAClB,MAAMiB,YAAA,GAAe5B,KAAA,CAAM0B,MAAA,CAAOX,SAAS;EAC3Ca,YAAA,CAAa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,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":["jsx/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}) => {\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 events.emit(\"openchange\", { open });\n }, [open, events]);\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) => {\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 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]\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,iBACJ;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,MAAM,OAAO,YAAY;CACjD,gBAAgB,UAAU;CAC1B,MAAM,UAAU,MAAM,OAAO,QAAQ;CACrC,QAAQ,UAAU;CAClB,MAAM,WAAW,MAAM,OAAO,SAAS;CACvC,SAAS,UAAU;CACnB,MAAM,aAAa,MAAM,OAAO,OAAO;CACvC,WAAW,UAAU;CACrB,MAAM,WAAW,MAA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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,OAAO,CACV;AACF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all) __defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: () => from[key],
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: true
|
|
28
|
+
}) : target, mod));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var useFloatingContext_native_exports = {};
|
|
31
|
+
__export(useFloatingContext_native_exports, { useFloatingContext: () => useFloatingContext });
|
|
32
|
+
module.exports = __toCommonJS(useFloatingContext_native_exports);
|
|
33
|
+
var import_react = __toESM(require("react"), 1);
|
|
34
|
+
var useFloatingContext = function() {
|
|
35
|
+
return import_react.default.useCallback(function() {}, []);
|
|
36
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
var __create = Object.create;
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
5
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -7,39 +8,31 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
7
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
10
|
var __export = (target, all) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
for (var name in all) __defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
14
15
|
};
|
|
15
16
|
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: () => from[key],
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
23
24
|
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
-
value: mod,
|
|
31
|
-
enumerable: true
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: true
|
|
32
28
|
}) : target, mod));
|
|
33
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
-
value: true
|
|
35
|
-
}), mod);
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
30
|
var useFloatingContext_native_exports = {};
|
|
37
|
-
__export(useFloatingContext_native_exports, {
|
|
38
|
-
useFloatingContext: () => useFloatingContext
|
|
39
|
-
});
|
|
31
|
+
__export(useFloatingContext_native_exports, { useFloatingContext: () => useFloatingContext });
|
|
40
32
|
module.exports = __toCommonJS(useFloatingContext_native_exports);
|
|
41
33
|
var import_react = __toESM(require("react"), 1);
|
|
42
|
-
var useFloatingContext = function
|
|
43
|
-
|
|
34
|
+
var useFloatingContext = function() {
|
|
35
|
+
return import_react.default.useCallback(function() {}, []);
|
|
44
36
|
};
|
|
37
|
+
|
|
45
38
|
//# sourceMappingURL=useFloatingContext.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useFloatingContext.native.js","names":[],"sources":["jsx/useFloatingContext.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useFloatingContext_native_exports = {};\n__export(useFloatingContext_native_exports, {\n useFloatingContext: () => useFloatingContext\n});\nmodule.exports = __toCommonJS(useFloatingContext_native_exports);\nvar import_react = __toESM(require(\"react\"), 1);\nvar useFloatingContext = function() {\n return import_react.default.useCallback(function() {\n }, []);\n};\n//# sourceMappingURL=useFloatingContext.native.js.map\n"],"mappings":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,oCAAoC,CAAC;AACzC,SAAS,mCAAmC,EAC1C,0BAA0B,mBAC5B,CAAC;AACD,OAAO,UAAU,aAAa,iCAAiC;AAC/D,IAAI,eAAe,QAAQ,QAAQ,OAAO,GAAG,CAAC;AAC9C,IAAI,qBAAqB,WAAW;CAClC,OAAO,aAAa,QAAQ,YAAY,WAAW,CACnD,GAAG,CAAC,CAAC;AACP"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/popover",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.643.1",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -34,31 +34,31 @@
|
|
|
34
34
|
"clean:build": "tamagui-build clean:build"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@tamagui/adapt": "
|
|
38
|
-
"@tamagui/animate": "
|
|
39
|
-
"@tamagui/animate-presence": "
|
|
40
|
-
"@tamagui/compose-refs": "
|
|
41
|
-
"@tamagui/constants": "
|
|
42
|
-
"@tamagui/core": "
|
|
43
|
-
"@tamagui/dismissable": "
|
|
44
|
-
"@tamagui/floating": "
|
|
45
|
-
"@tamagui/focus-scope": "
|
|
46
|
-
"@tamagui/helpers": "
|
|
47
|
-
"@tamagui/polyfill-dev": "
|
|
48
|
-
"@tamagui/popper": "
|
|
49
|
-
"@tamagui/portal": "
|
|
50
|
-
"@tamagui/remove-scroll": "
|
|
51
|
-
"@tamagui/scroll-view": "
|
|
52
|
-
"@tamagui/sheet": "
|
|
53
|
-
"@tamagui/stacks": "
|
|
54
|
-
"@tamagui/use-controllable-state": "
|
|
55
|
-
"@tamagui/z-index-stack": "
|
|
37
|
+
"@tamagui/adapt": "3.0.0-beta.643.1",
|
|
38
|
+
"@tamagui/animate": "3.0.0-beta.643.1",
|
|
39
|
+
"@tamagui/animate-presence": "3.0.0-beta.643.1",
|
|
40
|
+
"@tamagui/compose-refs": "3.0.0-beta.643.1",
|
|
41
|
+
"@tamagui/constants": "3.0.0-beta.643.1",
|
|
42
|
+
"@tamagui/core": "3.0.0-beta.643.1",
|
|
43
|
+
"@tamagui/dismissable": "3.0.0-beta.643.1",
|
|
44
|
+
"@tamagui/floating": "3.0.0-beta.643.1",
|
|
45
|
+
"@tamagui/focus-scope": "3.0.0-beta.643.1",
|
|
46
|
+
"@tamagui/helpers": "3.0.0-beta.643.1",
|
|
47
|
+
"@tamagui/polyfill-dev": "3.0.0-beta.643.1",
|
|
48
|
+
"@tamagui/popper": "3.0.0-beta.643.1",
|
|
49
|
+
"@tamagui/portal": "3.0.0-beta.643.1",
|
|
50
|
+
"@tamagui/remove-scroll": "3.0.0-beta.643.1",
|
|
51
|
+
"@tamagui/scroll-view": "3.0.0-beta.643.1",
|
|
52
|
+
"@tamagui/sheet": "3.0.0-beta.643.1",
|
|
53
|
+
"@tamagui/stacks": "3.0.0-beta.643.1",
|
|
54
|
+
"@tamagui/use-controllable-state": "3.0.0-beta.643.1",
|
|
55
|
+
"@tamagui/z-index-stack": "3.0.0-beta.643.1",
|
|
56
56
|
"react-freeze": "^1.0.3"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@tamagui/build": "
|
|
59
|
+
"@tamagui/build": "3.0.0-beta.643.1",
|
|
60
60
|
"react": ">=19",
|
|
61
|
-
"react-native": "0.
|
|
61
|
+
"react-native": "0.86.2"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"react": ">=19"
|