@tamagui/popover 2.7.7 → 3.0.0-beta.637.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 (48) hide show
  1. package/dist/cjs/Popover.cjs +509 -664
  2. package/dist/cjs/Popover.native.cjs +603 -0
  3. package/dist/cjs/Popover.native.js +536 -691
  4. package/dist/cjs/Popover.native.js.map +1 -1
  5. package/dist/cjs/index.cjs +10 -11
  6. package/dist/cjs/index.native.cjs +22 -0
  7. package/dist/cjs/index.native.js +10 -10
  8. package/dist/cjs/index.native.js.map +1 -1
  9. package/dist/cjs/useFloatingContext.cjs +202 -234
  10. package/dist/cjs/useFloatingContext.native.cjs +36 -0
  11. package/dist/cjs/useFloatingContext.native.js +20 -27
  12. package/dist/cjs/useFloatingContext.native.js.map +1 -1
  13. package/dist/esm/Popover.mjs +473 -617
  14. package/dist/esm/Popover.mjs.map +1 -1
  15. package/dist/esm/Popover.native.js +499 -644
  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 +186 -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 +473 -617
  25. package/dist/jsx/Popover.mjs.map +1 -1
  26. package/dist/jsx/Popover.native.cjs +603 -0
  27. package/dist/jsx/Popover.native.js +536 -691
  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 +22 -0
  32. package/dist/jsx/index.native.js +10 -10
  33. package/dist/jsx/index.native.js.map +1 -1
  34. package/dist/jsx/useFloatingContext.mjs +186 -208
  35. package/dist/jsx/useFloatingContext.mjs.map +1 -1
  36. package/dist/jsx/useFloatingContext.native.cjs +36 -0
  37. package/dist/jsx/useFloatingContext.native.js +20 -27
  38. package/dist/jsx/useFloatingContext.native.js.map +1 -1
  39. package/package.json +22 -22
  40. package/src/Popover.tsx +115 -147
  41. package/types/Popover.d.ts +33 -109
  42. package/types/Popover.d.ts.map +1 -1
  43. package/types/useFloatingContext.d.ts.map +1 -1
  44. package/dist/esm/index.js.map +0 -1
  45. package/dist/esm/index.mjs.map +0 -1
  46. package/dist/esm/index.native.js.map +0 -1
  47. package/dist/jsx/index.js.map +0 -1
  48. package/dist/jsx/index.mjs.map +0 -1
@@ -1,3 +1,4 @@
1
+
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -5,245 +6,212 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
6
  var __getProtoOf = Object.getPrototypeOf;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
12
13
  };
13
14
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
21
22
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: true
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
30
26
  }) : target, mod));
31
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: true
33
- }), mod);
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
28
  var useFloatingContext_exports = {};
35
- __export(useFloatingContext_exports, {
36
- useFloatingContext: () => useFloatingContext
37
- });
29
+ __export(useFloatingContext_exports, { useFloatingContext: () => useFloatingContext });
38
30
  module.exports = __toCommonJS(useFloatingContext_exports);
39
31
  var import_react = __toESM(require("react"), 1);
40
32
  var import_floating = require("@tamagui/floating");
41
- const useFloatingContext = ({
42
- open,
43
- setOpen,
44
- disable,
45
- disableFocus,
46
- hoverable,
47
- role: roleProp = "dialog",
48
- focus: focusProp,
49
- groupId,
50
- delay: delayProp,
51
- restMs: restMsProp
52
- }) => {
53
- "use no memo";
54
-
55
- const openRef = import_react.default.useRef(open);
56
- openRef.current = open;
57
- const hoverableRef = import_react.default.useRef(hoverable);
58
- hoverableRef.current = hoverable;
59
- const disableRef = import_react.default.useRef(disable);
60
- disableRef.current = disable;
61
- const disableFocusRef = import_react.default.useRef(disableFocus);
62
- disableFocusRef.current = disableFocus;
63
- const roleRef = import_react.default.useRef(roleProp);
64
- roleRef.current = roleProp;
65
- const focusRef = import_react.default.useRef(focusProp);
66
- focusRef.current = focusProp;
67
- const groupIdRef = import_react.default.useRef(groupId);
68
- groupIdRef.current = groupId;
69
- const delayRef = import_react.default.useRef(delayProp);
70
- delayRef.current = delayProp;
71
- const restMsRef = import_react.default.useRef(restMsProp);
72
- restMsRef.current = restMsProp;
73
- const events = import_react.default.useMemo(() => (0, import_floating.createFloatingEvents)(), []);
74
- const triggerElements = import_react.default.useMemo(() => new import_floating.PopupTriggerMap(), []);
75
- import_react.default.useEffect(() => {
76
- events.emit("openchange", {
77
- open
78
- });
79
- }, [open, events]);
80
- return import_react.default.useCallback(props => {
81
- const onTriggerRef = import_react.default.useRef(false);
82
- const restTimerRef = import_react.default.useRef(void 0);
83
- const graceRef = import_react.default.useRef(void 0);
84
- const pendingCloseRef = import_react.default.useRef(false);
85
- const isOverFloatingRef = import_react.default.useRef(false);
86
- const handleCloseActiveRef = import_react.default.useRef(false);
87
- import_react.default.useEffect(() => {
88
- return () => {
89
- clearTimeout(restTimerRef.current);
90
- clearTimeout(graceRef.current);
91
- };
92
- }, []);
93
- const onOpenChange = (val, event) => {
94
- if (val && event?.type === "mouseenter") {
95
- return;
96
- }
97
- if (!val && onTriggerRef.current && (event?.type === "mousemove" || event?.type === "mouseleave")) {
98
- pendingCloseRef.current = true;
99
- return;
100
- }
101
- const type = event?.type === "mousemove" || event?.type === "mouseenter" || event?.type === "mouseleave" ? "hover" : "press";
102
- setOpen(val, type);
103
- };
104
- const floating = (0, import_floating.useFloatingRaw)({
105
- ...props,
106
- open: openRef.current
107
- });
108
- const currentHoverable = hoverableRef.current;
109
- const dataRef = import_react.default.useRef({});
110
- dataRef.current.placement = floating.placement;
111
- const floatingRefs = floating.refs;
112
- const nullRef = {
113
- current: null
114
- };
115
- const interactionContext = {
116
- open: openRef.current,
117
- onOpenChange,
118
- refs: {
119
- reference: floatingRefs?.reference || nullRef,
120
- floating: floatingRefs?.floating || nullRef,
121
- domReference: floatingRefs?.reference || nullRef
122
- },
123
- elements: {
124
- get reference() {
125
- return floatingRefs?.reference?.current || null;
126
- },
127
- get floating() {
128
- return floatingRefs?.floating?.current || null;
129
- },
130
- get domReference() {
131
- return floatingRefs?.reference?.current || null;
132
- }
133
- },
134
- dataRef,
135
- events,
136
- triggerElements,
137
- handleCloseActiveRef
138
- };
139
- const {
140
- delay: groupDelay,
141
- currentId: groupCurrentId
142
- } = (0, import_floating.useDelayGroup)(interactionContext, {
143
- id: groupIdRef.current
144
- });
145
- const isInActiveGroup = groupIdRef.current && groupCurrentId != null && typeof groupDelay === "object";
146
- let delay;
147
- let restMs;
148
- if (isInActiveGroup) {
149
- delay = groupDelay;
150
- restMs = 0;
151
- } else if (delayRef.current !== void 0) {
152
- delay = delayRef.current;
153
- restMs = restMsRef.current ?? 0;
154
- } else {
155
- delay = currentHoverable && typeof currentHoverable === "object" ? currentHoverable.delay ?? 0 : 0;
156
- restMs = currentHoverable && typeof currentHoverable === "object" ? currentHoverable.restMs ?? 0 : 0;
157
- }
158
- const currentRole = roleRef.current;
159
- const currentFocus = focusRef.current;
160
- const {
161
- getReferenceProps,
162
- getFloatingProps: getFloatingPropsInner
163
- } = (0, import_floating.useInteractions)([currentHoverable ? (0, import_floating.useHover)(interactionContext, {
164
- enabled: !disableRef.current && !!currentHoverable,
165
- delay,
166
- restMs,
167
- handleClose: (0, import_floating.safePolygon)({
168
- requireIntent: true,
169
- buffer: 1,
170
- __debug: typeof window !== "undefined" && new URLSearchParams(window.location.search).get("debug") === "safePolygon"
171
- }),
172
- ...(typeof currentHoverable === "object" && currentHoverable)
173
- }) : (0, import_floating.useHover)(interactionContext, {
174
- enabled: false
175
- }), (0, import_floating.useFocus)(interactionContext, {
176
- enabled: !disableRef.current && !disableFocusRef.current,
177
- visibleOnly: true,
178
- ...currentFocus
179
- }), (0, import_floating.useRole)(interactionContext, {
180
- role: currentRole
181
- })]);
182
- const getFloatingProps = currentHoverable ? userProps => {
183
- const merged = getFloatingPropsInner(userProps);
184
- const origEnter = merged.onMouseEnter;
185
- const origLeave = merged.onMouseLeave;
186
- return {
187
- ...merged,
188
- onMouseEnter: e => {
189
- isOverFloatingRef.current = true;
190
- origEnter?.(e);
191
- },
192
- onMouseLeave: e => {
193
- isOverFloatingRef.current = false;
194
- origLeave?.(e);
195
- }
196
- };
197
- } : getFloatingPropsInner;
198
- const openDelay = typeof delay === "number" ? delay : delay?.open ?? 0;
199
- const closeDelay = typeof delay === "number" ? delay : delay?.close ?? 0;
200
- const setOpenWithDelay = () => {
201
- clearTimeout(restTimerRef.current);
202
- if (restMs && !openDelay) {
203
- restTimerRef.current = setTimeout(() => {
204
- setOpen(true, "hover");
205
- }, restMs);
206
- } else if (openDelay) {
207
- restTimerRef.current = setTimeout(() => {
208
- setOpen(true, "hover");
209
- }, openDelay);
210
- } else {
211
- setOpen(true, "hover");
212
- }
213
- };
214
- return {
215
- ...floating,
216
- open: openRef.current,
217
- triggerElements,
218
- getReferenceProps,
219
- getFloatingProps,
220
- onHoverReference: currentHoverable ? _event => {
221
- clearTimeout(graceRef.current);
222
- onTriggerRef.current = true;
223
- pendingCloseRef.current = false;
224
- clearTimeout(restTimerRef.current);
225
- if (openRef.current) return;
226
- setOpenWithDelay();
227
- } : void 0,
228
- onLeaveReference: currentHoverable ? () => {
229
- clearTimeout(restTimerRef.current);
230
- clearTimeout(graceRef.current);
231
- graceRef.current = setTimeout(() => {
232
- onTriggerRef.current = false;
233
- if (pendingCloseRef.current) {
234
- pendingCloseRef.current = false;
235
- setOpen(false, "hover");
236
- return;
237
- }
238
- if (openRef.current) {
239
- graceRef.current = setTimeout(() => {
240
- if (openRef.current && !isOverFloatingRef.current && !handleCloseActiveRef.current) {
241
- setOpen(false, "hover");
242
- }
243
- }, Math.max(250, closeDelay));
244
- }
245
- }, 40);
246
- } : void 0
247
- };
248
- }, [setOpen]);
249
- };
33
+ const useFloatingContext = ({ open, setOpen, disable, disableFocus, hoverable, role: roleProp = "dialog", focus: focusProp, groupId, delay: delayProp, restMs: restMsProp }) => {
34
+ "use no memo";
35
+ const openRef = import_react.default.useRef(open);
36
+ openRef.current = open;
37
+ const hoverableRef = import_react.default.useRef(hoverable);
38
+ hoverableRef.current = hoverable;
39
+ const disableRef = import_react.default.useRef(disable);
40
+ disableRef.current = disable;
41
+ const disableFocusRef = import_react.default.useRef(disableFocus);
42
+ disableFocusRef.current = disableFocus;
43
+ const roleRef = import_react.default.useRef(roleProp);
44
+ roleRef.current = roleProp;
45
+ const focusRef = import_react.default.useRef(focusProp);
46
+ focusRef.current = focusProp;
47
+ const groupIdRef = import_react.default.useRef(groupId);
48
+ groupIdRef.current = groupId;
49
+ const delayRef = import_react.default.useRef(delayProp);
50
+ delayRef.current = delayProp;
51
+ const restMsRef = import_react.default.useRef(restMsProp);
52
+ restMsRef.current = restMsProp;
53
+ const events = import_react.default.useMemo(() => (0, import_floating.createFloatingEvents)(), []);
54
+ const triggerElements = import_react.default.useMemo(() => new import_floating.PopupTriggerMap(), []);
55
+ import_react.default.useEffect(() => {
56
+ events.emit("openchange", { open });
57
+ }, [open, events]);
58
+ return import_react.default.useCallback((props) => {
59
+ const onTriggerRef = import_react.default.useRef(false);
60
+ const restTimerRef = import_react.default.useRef(void 0);
61
+ const graceRef = import_react.default.useRef(void 0);
62
+ const pendingCloseRef = import_react.default.useRef(false);
63
+ const isOverFloatingRef = import_react.default.useRef(false);
64
+ const handleCloseActiveRef = import_react.default.useRef(false);
65
+ import_react.default.useEffect(() => {
66
+ return () => {
67
+ clearTimeout(restTimerRef.current);
68
+ clearTimeout(graceRef.current);
69
+ };
70
+ }, []);
71
+ const onOpenChange = (val, event) => {
72
+ if (val && event?.type === "mouseenter") {
73
+ return;
74
+ }
75
+ if (!val && onTriggerRef.current && (event?.type === "mousemove" || event?.type === "mouseleave")) {
76
+ pendingCloseRef.current = true;
77
+ return;
78
+ }
79
+ const type = event?.type === "mousemove" || event?.type === "mouseenter" || event?.type === "mouseleave" ? "hover" : "press";
80
+ setOpen(val, type);
81
+ };
82
+ const floating = (0, import_floating.useFloatingRaw)({
83
+ ...props,
84
+ open: openRef.current
85
+ });
86
+ const currentHoverable = hoverableRef.current;
87
+ const dataRef = import_react.default.useRef({});
88
+ dataRef.current.placement = floating.placement;
89
+ const floatingRefs = floating.refs;
90
+ const nullRef = { current: null };
91
+ const interactionContext = {
92
+ open: openRef.current,
93
+ onOpenChange,
94
+ refs: {
95
+ reference: floatingRefs?.reference || nullRef,
96
+ floating: floatingRefs?.floating || nullRef,
97
+ domReference: floatingRefs?.reference || nullRef
98
+ },
99
+ elements: {
100
+ get reference() {
101
+ return floatingRefs?.reference?.current || null;
102
+ },
103
+ get floating() {
104
+ return floatingRefs?.floating?.current || null;
105
+ },
106
+ get domReference() {
107
+ return floatingRefs?.reference?.current || null;
108
+ }
109
+ },
110
+ dataRef,
111
+ events,
112
+ triggerElements,
113
+ handleCloseActiveRef
114
+ };
115
+ const { delay: groupDelay, currentId: groupCurrentId } = (0, import_floating.useDelayGroup)(interactionContext, { id: groupIdRef.current });
116
+ const isInActiveGroup = groupIdRef.current && groupCurrentId != null && typeof groupDelay === "object";
117
+ let delay;
118
+ let restMs;
119
+ if (isInActiveGroup) {
120
+ delay = groupDelay;
121
+ restMs = 0;
122
+ } else if (delayRef.current !== void 0) {
123
+ delay = delayRef.current;
124
+ restMs = restMsRef.current ?? 0;
125
+ } else {
126
+ delay = currentHoverable && typeof currentHoverable === "object" ? currentHoverable.delay ?? 0 : 0;
127
+ restMs = currentHoverable && typeof currentHoverable === "object" ? currentHoverable.restMs ?? 0 : 0;
128
+ }
129
+ const currentRole = roleRef.current;
130
+ const currentFocus = focusRef.current;
131
+ const { getReferenceProps, getFloatingProps: getFloatingPropsInner } = (0, import_floating.useInteractions)([
132
+ currentHoverable ? (0, import_floating.useHover)(interactionContext, {
133
+ enabled: !disableRef.current && !!currentHoverable,
134
+ delay,
135
+ restMs,
136
+ handleClose: (0, import_floating.safePolygon)({
137
+ requireIntent: true,
138
+ buffer: 1,
139
+ __debug: typeof window !== "undefined" && new URLSearchParams(window.location.search).get("debug") === "safePolygon"
140
+ }),
141
+ ...typeof currentHoverable === "object" && currentHoverable
142
+ }) : (0, import_floating.useHover)(interactionContext, { enabled: false }),
143
+ (0, import_floating.useFocus)(interactionContext, {
144
+ enabled: !disableRef.current && !disableFocusRef.current,
145
+ visibleOnly: true,
146
+ ...currentFocus
147
+ }),
148
+ (0, import_floating.useRole)(interactionContext, { role: currentRole })
149
+ ]);
150
+ const getFloatingProps = currentHoverable ? (userProps) => {
151
+ const merged = getFloatingPropsInner(userProps);
152
+ const origEnter = merged.onMouseEnter;
153
+ const origLeave = merged.onMouseLeave;
154
+ return {
155
+ ...merged,
156
+ onMouseEnter: (e) => {
157
+ isOverFloatingRef.current = true;
158
+ origEnter?.(e);
159
+ },
160
+ onMouseLeave: (e) => {
161
+ isOverFloatingRef.current = false;
162
+ origLeave?.(e);
163
+ }
164
+ };
165
+ } : getFloatingPropsInner;
166
+ const openDelay = typeof delay === "number" ? delay : delay?.open ?? 0;
167
+ const closeDelay = typeof delay === "number" ? delay : delay?.close ?? 0;
168
+ const setOpenWithDelay = () => {
169
+ clearTimeout(restTimerRef.current);
170
+ if (restMs && !openDelay) {
171
+ restTimerRef.current = setTimeout(() => {
172
+ setOpen(true, "hover");
173
+ }, restMs);
174
+ } else if (openDelay) {
175
+ restTimerRef.current = setTimeout(() => {
176
+ setOpen(true, "hover");
177
+ }, openDelay);
178
+ } else {
179
+ setOpen(true, "hover");
180
+ }
181
+ };
182
+ return {
183
+ ...floating,
184
+ open: openRef.current,
185
+ triggerElements,
186
+ getReferenceProps,
187
+ getFloatingProps,
188
+ onHoverReference: currentHoverable ? (_event) => {
189
+ clearTimeout(graceRef.current);
190
+ onTriggerRef.current = true;
191
+ pendingCloseRef.current = false;
192
+ clearTimeout(restTimerRef.current);
193
+ if (openRef.current) return;
194
+ setOpenWithDelay();
195
+ } : void 0,
196
+ onLeaveReference: currentHoverable ? () => {
197
+ clearTimeout(restTimerRef.current);
198
+ clearTimeout(graceRef.current);
199
+ graceRef.current = setTimeout(() => {
200
+ onTriggerRef.current = false;
201
+ if (pendingCloseRef.current) {
202
+ pendingCloseRef.current = false;
203
+ setOpen(false, "hover");
204
+ return;
205
+ }
206
+ if (openRef.current) {
207
+ graceRef.current = setTimeout(() => {
208
+ if (openRef.current && !isOverFloatingRef.current && !handleCloseActiveRef.current) {
209
+ setOpen(false, "hover");
210
+ }
211
+ }, Math.max(250, closeDelay));
212
+ }
213
+ }, 40);
214
+ } : void 0
215
+ };
216
+ }, [setOpen]);
217
+ };
@@ -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
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: true
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
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
- get: () => from[key],
19
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
- });
21
- }
22
- return to;
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
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
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
- return import_react.default.useCallback(function () {}, []);
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,"names":["useFloatingContext_native_exports","__export","useFloatingContext","module","exports","__toCommonJS","import_react","__toESM","require","default","useCallback"],"sources":["../../src/useFloatingContext.native.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,iCAAA;AAAAC,QAAA,CAAAD,iCAAA;EAAAE,kBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAL,iCAAA;AAAA,IAAAM,YAAA,GAAkBC,OAAA,CAAAC,OAAA;AAEX,IAAIN,kBAAA,GAAqB,SAAAA,CAAA,EAAW;EACvC,OAAOI,YAAA,CAAAG,OAAA,CAAMC,WAAA,CAAY,YAAW,CAAC,GAAG,EAAE;AAC9C","ignoreList":[]}
1
+ {"version":3,"file":"useFloatingContext.native.js","names":[],"sources":["cjs/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"}