@tamagui/popover 1.114.4 → 1.115.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 +435 -0
- package/dist/cjs/index.cjs +19 -0
- package/dist/cjs/useFloatingContext.cjs +81 -0
- package/dist/cjs/useFloatingContext.native.cjs +38 -0
- package/dist/cjs/useFloatingContext.native.cjs.map +6 -0
- package/package.json +22 -21
- package/dist/cjs/Popover.js +0 -353
- package/dist/cjs/index.js +0 -16
- package/dist/cjs/useFloatingContext.js +0 -74
- /package/dist/cjs/{Popover.js.map → Popover.cjs.map} +0 -0
- /package/dist/cjs/{index.js.map → index.cjs.map} +0 -0
- /package/dist/cjs/{useFloatingContext.js.map → useFloatingContext.cjs.map} +0 -0
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
32
|
+
var Popover_exports = {};
|
|
33
|
+
__export(Popover_exports, {
|
|
34
|
+
Popover: () => Popover,
|
|
35
|
+
PopoverAnchor: () => PopoverAnchor,
|
|
36
|
+
PopoverArrow: () => PopoverArrow,
|
|
37
|
+
PopoverClose: () => PopoverClose,
|
|
38
|
+
PopoverContent: () => PopoverContent,
|
|
39
|
+
PopoverContext: () => PopoverContext,
|
|
40
|
+
PopoverTrigger: () => PopoverTrigger,
|
|
41
|
+
usePopoverContext: () => usePopoverContext
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(Popover_exports);
|
|
44
|
+
var import_polyfill_dev = require("@tamagui/polyfill-dev"),
|
|
45
|
+
import_adapt = require("@tamagui/adapt"),
|
|
46
|
+
import_animate = require("@tamagui/animate"),
|
|
47
|
+
import_animate_presence = require("@tamagui/animate-presence"),
|
|
48
|
+
import_aria_hidden = require("@tamagui/aria-hidden"),
|
|
49
|
+
import_compose_refs = require("@tamagui/compose-refs"),
|
|
50
|
+
import_constants = require("@tamagui/constants"),
|
|
51
|
+
import_core = require("@tamagui/core"),
|
|
52
|
+
import_floating = require("@tamagui/floating"),
|
|
53
|
+
import_focus_scope = require("@tamagui/focus-scope"),
|
|
54
|
+
import_helpers = require("@tamagui/helpers"),
|
|
55
|
+
import_popper = require("@tamagui/popper"),
|
|
56
|
+
import_portal = require("@tamagui/portal"),
|
|
57
|
+
import_remove_scroll = require("@tamagui/remove-scroll"),
|
|
58
|
+
import_sheet = require("@tamagui/sheet"),
|
|
59
|
+
import_stacks = require("@tamagui/stacks"),
|
|
60
|
+
import_use_controllable_state = require("@tamagui/use-controllable-state"),
|
|
61
|
+
React = __toESM(require("react")),
|
|
62
|
+
import_react_native = require("react-native-web"),
|
|
63
|
+
import_useFloatingContext = require("./useFloatingContext.cjs"),
|
|
64
|
+
import_jsx_runtime = require("react/jsx-runtime");
|
|
65
|
+
const POPOVER_SCOPE = "PopoverScope",
|
|
66
|
+
PopoverContext = (0, import_core.createStyledContext)({}),
|
|
67
|
+
usePopoverContext = PopoverContext.useStyledContext,
|
|
68
|
+
PopoverAnchor = React.forwardRef(function (props, forwardedRef) {
|
|
69
|
+
const {
|
|
70
|
+
__scopePopover,
|
|
71
|
+
...rest
|
|
72
|
+
} = props,
|
|
73
|
+
context = usePopoverContext(__scopePopover),
|
|
74
|
+
{
|
|
75
|
+
onCustomAnchorAdd,
|
|
76
|
+
onCustomAnchorRemove
|
|
77
|
+
} = context || {};
|
|
78
|
+
return React.useEffect(() => (onCustomAnchorAdd(), () => onCustomAnchorRemove()), [onCustomAnchorAdd, onCustomAnchorRemove]), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popper.PopperAnchor, {
|
|
79
|
+
__scopePopper: __scopePopover || POPOVER_SCOPE,
|
|
80
|
+
...rest,
|
|
81
|
+
ref: forwardedRef
|
|
82
|
+
});
|
|
83
|
+
}),
|
|
84
|
+
PopoverTrigger = React.forwardRef(function (props, forwardedRef) {
|
|
85
|
+
const {
|
|
86
|
+
__scopePopover,
|
|
87
|
+
...rest
|
|
88
|
+
} = props,
|
|
89
|
+
context = usePopoverContext(__scopePopover),
|
|
90
|
+
anchorTo = context.anchorTo,
|
|
91
|
+
composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
|
|
92
|
+
if (!props.children) return null;
|
|
93
|
+
const trigger = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.View, {
|
|
94
|
+
"aria-expanded": context.open,
|
|
95
|
+
"data-state": getState(context.open),
|
|
96
|
+
...rest,
|
|
97
|
+
ref: composedTriggerRef,
|
|
98
|
+
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle)
|
|
99
|
+
});
|
|
100
|
+
if (anchorTo) {
|
|
101
|
+
const virtualRef = {
|
|
102
|
+
current: {
|
|
103
|
+
getBoundingClientRect: () => import_constants.isWeb ? DOMRect.fromRect(anchorTo) : anchorTo,
|
|
104
|
+
...(!import_constants.isWeb && {
|
|
105
|
+
measure: c => c(anchorTo?.x, anchorTo?.y, anchorTo?.width, anchorTo?.height),
|
|
106
|
+
measureInWindow: c => c(anchorTo?.x, anchorTo?.y, anchorTo?.width, anchorTo?.height)
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popper.PopperAnchor, {
|
|
111
|
+
virtualRef,
|
|
112
|
+
__scopePopper: __scopePopover || POPOVER_SCOPE,
|
|
113
|
+
children: trigger
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popper.PopperAnchor, {
|
|
117
|
+
__scopePopper: __scopePopover || POPOVER_SCOPE,
|
|
118
|
+
asChild: !0,
|
|
119
|
+
children: trigger
|
|
120
|
+
});
|
|
121
|
+
}),
|
|
122
|
+
PopoverContent = import_popper.PopperContentFrame.extractable(React.forwardRef(function (props, forwardedRef) {
|
|
123
|
+
const {
|
|
124
|
+
allowPinchZoom,
|
|
125
|
+
trapFocus,
|
|
126
|
+
disableRemoveScroll = !0,
|
|
127
|
+
zIndex,
|
|
128
|
+
__scopePopover,
|
|
129
|
+
...contentImplProps
|
|
130
|
+
} = props,
|
|
131
|
+
context = usePopoverContext(__scopePopover),
|
|
132
|
+
contentRef = React.useRef(null),
|
|
133
|
+
composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef),
|
|
134
|
+
isRightClickOutsideRef = React.useRef(!1),
|
|
135
|
+
[isFullyHidden, setIsFullyHidden] = React.useState(!context.open);
|
|
136
|
+
return context.open && isFullyHidden && setIsFullyHidden(!1), React.useEffect(() => {
|
|
137
|
+
if (!context.open) return;
|
|
138
|
+
const content = contentRef.current;
|
|
139
|
+
if (content) return (0, import_aria_hidden.hideOthers)(content);
|
|
140
|
+
}, [context.open]), !context.keepChildrenMounted && isFullyHidden ? null : /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopoverContentPortal, {
|
|
141
|
+
__scopePopover,
|
|
142
|
+
zIndex: props.zIndex,
|
|
143
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.Stack, {
|
|
144
|
+
pointerEvents: context.open ? "auto" : "none",
|
|
145
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopoverContentImpl, {
|
|
146
|
+
...contentImplProps,
|
|
147
|
+
disableRemoveScroll,
|
|
148
|
+
ref: composedRefs,
|
|
149
|
+
setIsFullyHidden,
|
|
150
|
+
__scopePopover,
|
|
151
|
+
trapFocus: trapFocus ?? context.open,
|
|
152
|
+
disableOutsidePointerEvents: !0,
|
|
153
|
+
onCloseAutoFocus: (0, import_helpers.composeEventHandlers)(props.onCloseAutoFocus, event => {
|
|
154
|
+
event.preventDefault(), isRightClickOutsideRef.current || context.triggerRef.current?.focus();
|
|
155
|
+
}),
|
|
156
|
+
onPointerDownOutside: (0, import_helpers.composeEventHandlers)(props.onPointerDownOutside, event => {
|
|
157
|
+
const originalEvent = event.detail.originalEvent,
|
|
158
|
+
ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === !0,
|
|
159
|
+
isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
160
|
+
isRightClickOutsideRef.current = isRightClick;
|
|
161
|
+
}, {
|
|
162
|
+
checkDefaultPrevented: !1
|
|
163
|
+
}),
|
|
164
|
+
onFocusOutside: (0, import_helpers.composeEventHandlers)(props.onFocusOutside, event => event.preventDefault(), {
|
|
165
|
+
checkDefaultPrevented: !1
|
|
166
|
+
})
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
}));
|
|
171
|
+
function PopoverRepropagateContext(props) {
|
|
172
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popper.PopperContext.Provider, {
|
|
173
|
+
scope: props.scope,
|
|
174
|
+
...props.popperContext,
|
|
175
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopoverContext.Provider, {
|
|
176
|
+
...props.context,
|
|
177
|
+
children: props.children
|
|
178
|
+
})
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function PopoverContentPortal(props) {
|
|
182
|
+
const {
|
|
183
|
+
__scopePopover
|
|
184
|
+
} = props,
|
|
185
|
+
zIndex = props.zIndex ?? 15e4,
|
|
186
|
+
context = usePopoverContext(__scopePopover),
|
|
187
|
+
popperContext = (0, import_popper.usePopperContext)(__scopePopover || POPOVER_SCOPE),
|
|
188
|
+
themeName = (0, import_core.useThemeName)();
|
|
189
|
+
let contents = props.children;
|
|
190
|
+
return (import_react_native.Platform.OS === "android" || import_react_native.Platform.OS === "ios") && (contents = /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopoverRepropagateContext, {
|
|
191
|
+
scope: __scopePopover || POPOVER_SCOPE,
|
|
192
|
+
popperContext,
|
|
193
|
+
context,
|
|
194
|
+
children: props.children
|
|
195
|
+
})), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_portal.Portal, {
|
|
196
|
+
zIndex,
|
|
197
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_core.Theme, {
|
|
198
|
+
forceClassName: !0,
|
|
199
|
+
name: themeName,
|
|
200
|
+
children: [!!context.open && !context.breakpointActive && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_stacks.YStack, {
|
|
201
|
+
fullscreen: !0,
|
|
202
|
+
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle)
|
|
203
|
+
}), contents]
|
|
204
|
+
})
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
const PopoverContentImpl = React.forwardRef(function (props, forwardedRef) {
|
|
208
|
+
const {
|
|
209
|
+
trapFocus,
|
|
210
|
+
__scopePopover,
|
|
211
|
+
onOpenAutoFocus,
|
|
212
|
+
onCloseAutoFocus,
|
|
213
|
+
disableOutsidePointerEvents,
|
|
214
|
+
disableFocusScope,
|
|
215
|
+
onEscapeKeyDown,
|
|
216
|
+
onPointerDownOutside,
|
|
217
|
+
onFocusOutside,
|
|
218
|
+
onInteractOutside,
|
|
219
|
+
children,
|
|
220
|
+
disableRemoveScroll,
|
|
221
|
+
freezeContentsWhenHidden,
|
|
222
|
+
setIsFullyHidden,
|
|
223
|
+
...contentProps
|
|
224
|
+
} = props,
|
|
225
|
+
context = usePopoverContext(__scopePopover),
|
|
226
|
+
{
|
|
227
|
+
open,
|
|
228
|
+
keepChildrenMounted
|
|
229
|
+
} = context,
|
|
230
|
+
popperContext = (0, import_popper.usePopperContext)(__scopePopover || POPOVER_SCOPE),
|
|
231
|
+
handleExitComplete = React.useCallback(() => {
|
|
232
|
+
setIsFullyHidden?.(!0);
|
|
233
|
+
}, [setIsFullyHidden]);
|
|
234
|
+
if (context.breakpointActive) {
|
|
235
|
+
const childrenWithoutScrollView = React.Children.toArray(children).map(child => React.isValidElement(child) && child.type === import_react_native.ScrollView ? child.props.children : child);
|
|
236
|
+
let content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, {
|
|
237
|
+
children: childrenWithoutScrollView
|
|
238
|
+
});
|
|
239
|
+
return (import_react_native.Platform.OS === "android" || import_react_native.Platform.OS === "ios") && (content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popper.PopperContext.Provider, {
|
|
240
|
+
scope: __scopePopover || POPOVER_SCOPE,
|
|
241
|
+
...popperContext,
|
|
242
|
+
children: childrenWithoutScrollView
|
|
243
|
+
})), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_portal.PortalItem, {
|
|
244
|
+
hostName: `${context.id}PopoverContents`,
|
|
245
|
+
children: content
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_animate.Animate, {
|
|
249
|
+
type: "presence",
|
|
250
|
+
present: !!open,
|
|
251
|
+
keepChildrenMounted,
|
|
252
|
+
onExitComplete: handleExitComplete,
|
|
253
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popper.PopperContent, {
|
|
254
|
+
__scopePopper: __scopePopover || POPOVER_SCOPE,
|
|
255
|
+
"data-state": getState(open),
|
|
256
|
+
id: context.contentId,
|
|
257
|
+
ref: forwardedRef,
|
|
258
|
+
...contentProps,
|
|
259
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_remove_scroll.RemoveScroll, {
|
|
260
|
+
enabled: disableRemoveScroll ? !1 : open,
|
|
261
|
+
allowPinchZoom: !0,
|
|
262
|
+
removeScrollBar: !1,
|
|
263
|
+
style: dspContentsStyle,
|
|
264
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, {
|
|
265
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_focus_scope.FocusScope, {
|
|
266
|
+
loop: !0,
|
|
267
|
+
enabled: disableFocusScope ? !1 : open,
|
|
268
|
+
trapped: trapFocus,
|
|
269
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
270
|
+
onUnmountAutoFocus: onCloseAutoFocus,
|
|
271
|
+
children: import_constants.isWeb ? /* @__PURE__ */(0, import_jsx_runtime.jsx)("div", {
|
|
272
|
+
style: dspContentsStyle,
|
|
273
|
+
children
|
|
274
|
+
}) : children
|
|
275
|
+
})
|
|
276
|
+
})
|
|
277
|
+
})
|
|
278
|
+
}, context.contentId)
|
|
279
|
+
});
|
|
280
|
+
}),
|
|
281
|
+
dspContentsStyle = {
|
|
282
|
+
display: "contents"
|
|
283
|
+
},
|
|
284
|
+
PopoverClose = React.forwardRef(function (props, forwardedRef) {
|
|
285
|
+
const {
|
|
286
|
+
__scopePopover,
|
|
287
|
+
...rest
|
|
288
|
+
} = props,
|
|
289
|
+
context = usePopoverContext(__scopePopover);
|
|
290
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_stacks.YStack, {
|
|
291
|
+
...rest,
|
|
292
|
+
ref: forwardedRef,
|
|
293
|
+
componentName: "PopoverClose",
|
|
294
|
+
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, () => context.onOpenChange(!1, "press"))
|
|
295
|
+
});
|
|
296
|
+
}),
|
|
297
|
+
PopoverArrow = import_popper.PopperArrow.styleable(function (props, forwardedRef) {
|
|
298
|
+
const {
|
|
299
|
+
__scopePopover,
|
|
300
|
+
...rest
|
|
301
|
+
} = props,
|
|
302
|
+
context = usePopoverContext(__scopePopover);
|
|
303
|
+
return useSheetBreakpointActive(context.sheetBreakpoint) ? null : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popper.PopperArrow, {
|
|
304
|
+
__scopePopper: __scopePopover || POPOVER_SCOPE,
|
|
305
|
+
componentName: "PopoverArrow",
|
|
306
|
+
...rest,
|
|
307
|
+
ref: forwardedRef
|
|
308
|
+
});
|
|
309
|
+
}),
|
|
310
|
+
Popover = (0, import_helpers.withStaticProperties)(React.forwardRef((props, forwardedRef) => {
|
|
311
|
+
const {
|
|
312
|
+
children,
|
|
313
|
+
open: openProp,
|
|
314
|
+
defaultOpen,
|
|
315
|
+
onOpenChange,
|
|
316
|
+
__scopePopover,
|
|
317
|
+
keepChildrenMounted,
|
|
318
|
+
hoverable,
|
|
319
|
+
disableFocus,
|
|
320
|
+
...restProps
|
|
321
|
+
} = props,
|
|
322
|
+
id = React.useId(),
|
|
323
|
+
{
|
|
324
|
+
when,
|
|
325
|
+
AdaptProvider
|
|
326
|
+
} = (0, import_adapt.useAdaptParent)({
|
|
327
|
+
Contents: React.useCallback(() => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_portal.PortalHost, {
|
|
328
|
+
name: `${id}PopoverContents`
|
|
329
|
+
}), [])
|
|
330
|
+
}),
|
|
331
|
+
sheetBreakpoint = when,
|
|
332
|
+
triggerRef = React.useRef(null),
|
|
333
|
+
[hasCustomAnchor, setHasCustomAnchor] = React.useState(!1),
|
|
334
|
+
viaRef = React.useRef(),
|
|
335
|
+
[open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
336
|
+
prop: openProp,
|
|
337
|
+
defaultProp: defaultOpen || !1,
|
|
338
|
+
onChange: val => {
|
|
339
|
+
onOpenChange?.(val, viaRef.current);
|
|
340
|
+
}
|
|
341
|
+
}),
|
|
342
|
+
handleOpenChange = (0, import_core.useEvent)((val, via) => {
|
|
343
|
+
viaRef.current = via, setOpen(val);
|
|
344
|
+
}),
|
|
345
|
+
sheetActive = useSheetBreakpointActive(sheetBreakpoint),
|
|
346
|
+
floatingContext = (0, import_useFloatingContext.useFloatingContext)({
|
|
347
|
+
open,
|
|
348
|
+
setOpen: handleOpenChange,
|
|
349
|
+
disable: sheetActive,
|
|
350
|
+
hoverable,
|
|
351
|
+
disableFocus
|
|
352
|
+
}),
|
|
353
|
+
[anchorTo, setAnchorToRaw] = React.useState(),
|
|
354
|
+
setAnchorTo = (0, import_core.createShallowSetState)(setAnchorToRaw);
|
|
355
|
+
React.useImperativeHandle(forwardedRef, () => ({
|
|
356
|
+
anchorTo: setAnchorTo,
|
|
357
|
+
toggle: () => setOpen(prev => !prev),
|
|
358
|
+
open: () => setOpen(!0),
|
|
359
|
+
close: () => setOpen(!1),
|
|
360
|
+
setOpen
|
|
361
|
+
}));
|
|
362
|
+
const popoverContext = {
|
|
363
|
+
id,
|
|
364
|
+
sheetBreakpoint,
|
|
365
|
+
contentId: React.useId(),
|
|
366
|
+
triggerRef,
|
|
367
|
+
open,
|
|
368
|
+
breakpointActive: sheetActive,
|
|
369
|
+
onOpenChange: handleOpenChange,
|
|
370
|
+
onOpenToggle: (0, import_core.useEvent)(() => {
|
|
371
|
+
open && sheetActive || setOpen(!open);
|
|
372
|
+
}),
|
|
373
|
+
hasCustomAnchor,
|
|
374
|
+
anchorTo,
|
|
375
|
+
onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(!0), []),
|
|
376
|
+
onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(!1), []),
|
|
377
|
+
keepChildrenMounted
|
|
378
|
+
},
|
|
379
|
+
contents = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_popper.Popper, {
|
|
380
|
+
__scopePopper: __scopePopover || POPOVER_SCOPE,
|
|
381
|
+
stayInFrame: !0,
|
|
382
|
+
...restProps,
|
|
383
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopoverContext.Provider, {
|
|
384
|
+
scope: __scopePopover,
|
|
385
|
+
...popoverContext,
|
|
386
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopoverSheetController, {
|
|
387
|
+
onOpenChange: setOpen,
|
|
388
|
+
children
|
|
389
|
+
})
|
|
390
|
+
})
|
|
391
|
+
});
|
|
392
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(AdaptProvider, {
|
|
393
|
+
children: import_constants.isWeb ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_floating.FloatingOverrideContext.Provider, {
|
|
394
|
+
value: floatingContext,
|
|
395
|
+
children: contents
|
|
396
|
+
}) : contents
|
|
397
|
+
});
|
|
398
|
+
}), {
|
|
399
|
+
Anchor: PopoverAnchor,
|
|
400
|
+
Arrow: PopoverArrow,
|
|
401
|
+
Trigger: PopoverTrigger,
|
|
402
|
+
Content: PopoverContent,
|
|
403
|
+
Close: PopoverClose,
|
|
404
|
+
Adapt: import_adapt.Adapt,
|
|
405
|
+
ScrollView: import_react_native.ScrollView,
|
|
406
|
+
Sheet: import_sheet.Sheet.Controlled
|
|
407
|
+
});
|
|
408
|
+
function getState(open) {
|
|
409
|
+
return open ? "open" : "closed";
|
|
410
|
+
}
|
|
411
|
+
const PopoverSheetController = ({
|
|
412
|
+
__scopePopover,
|
|
413
|
+
...props
|
|
414
|
+
}) => {
|
|
415
|
+
const context = usePopoverContext(__scopePopover),
|
|
416
|
+
showSheet = useShowPopoverSheet(context),
|
|
417
|
+
breakpointActive = context.breakpointActive,
|
|
418
|
+
getShowSheet = (0, import_core.useGet)(showSheet);
|
|
419
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_sheet.SheetController, {
|
|
420
|
+
onOpenChange: val => {
|
|
421
|
+
getShowSheet() && props.onOpenChange?.(val);
|
|
422
|
+
},
|
|
423
|
+
open: context.open,
|
|
424
|
+
hidden: breakpointActive === !1,
|
|
425
|
+
children: props.children
|
|
426
|
+
});
|
|
427
|
+
},
|
|
428
|
+
useSheetBreakpointActive = breakpoint => {
|
|
429
|
+
const media = (0, import_core.useMedia)();
|
|
430
|
+
return typeof breakpoint == "boolean" || !breakpoint ? !!breakpoint : media[breakpoint];
|
|
431
|
+
},
|
|
432
|
+
useShowPopoverSheet = context => {
|
|
433
|
+
const breakpointActive = useSheetBreakpointActive(context.sheetBreakpoint);
|
|
434
|
+
return context.open === !1 ? !1 : breakpointActive;
|
|
435
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
7
|
+
get: () => from[key],
|
|
8
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
|
+
});
|
|
10
|
+
return to;
|
|
11
|
+
},
|
|
12
|
+
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
+
value: !0
|
|
15
|
+
}), mod);
|
|
16
|
+
var src_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(src_exports);
|
|
18
|
+
__reExport(src_exports, require("./Popover.cjs"), module.exports);
|
|
19
|
+
__reExport(src_exports, require("./useFloatingContext.cjs"), module.exports);
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
32
|
+
var useFloatingContext_exports = {};
|
|
33
|
+
__export(useFloatingContext_exports, {
|
|
34
|
+
useFloatingContext: () => useFloatingContext
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(useFloatingContext_exports);
|
|
37
|
+
var import_react = __toESM(require("react")),
|
|
38
|
+
import_react2 = require("@floating-ui/react");
|
|
39
|
+
const useFloatingContext = ({
|
|
40
|
+
open,
|
|
41
|
+
setOpen,
|
|
42
|
+
disable,
|
|
43
|
+
disableFocus,
|
|
44
|
+
hoverable
|
|
45
|
+
}) => import_react.default.useCallback(props => {
|
|
46
|
+
const floating = (0, import_react2.useFloating)({
|
|
47
|
+
...props,
|
|
48
|
+
open,
|
|
49
|
+
onOpenChange: (val, event) => {
|
|
50
|
+
const type = event?.type === "mousemove" || event?.type === "mouseenter" || event?.type === "mouseleave" ? "hover" : "press";
|
|
51
|
+
setOpen(val, type);
|
|
52
|
+
}
|
|
53
|
+
}),
|
|
54
|
+
{
|
|
55
|
+
getReferenceProps,
|
|
56
|
+
getFloatingProps
|
|
57
|
+
} = (0, import_react2.useInteractions)([hoverable ? (0, import_react2.useHover)(floating.context, {
|
|
58
|
+
enabled: !disable && hoverable,
|
|
59
|
+
handleClose: (0, import_react2.safePolygon)({
|
|
60
|
+
requireIntent: !0,
|
|
61
|
+
blockPointerEvents: !0,
|
|
62
|
+
buffer: 1
|
|
63
|
+
}),
|
|
64
|
+
...(hoverable && typeof hoverable == "object" && hoverable)
|
|
65
|
+
}) : (0, import_react2.useHover)(floating.context, {
|
|
66
|
+
enabled: !1
|
|
67
|
+
}), (0, import_react2.useFocus)(floating.context, {
|
|
68
|
+
enabled: !disable && !disableFocus,
|
|
69
|
+
visibleOnly: !0
|
|
70
|
+
}), (0, import_react2.useRole)(floating.context, {
|
|
71
|
+
role: "dialog"
|
|
72
|
+
}), (0, import_react2.useDismiss)(floating.context, {
|
|
73
|
+
enabled: !disable
|
|
74
|
+
})]);
|
|
75
|
+
return {
|
|
76
|
+
...floating,
|
|
77
|
+
open,
|
|
78
|
+
getReferenceProps,
|
|
79
|
+
getFloatingProps
|
|
80
|
+
};
|
|
81
|
+
}, [open, setOpen, disable, disableFocus, hoverable]);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
32
|
+
var useFloatingContext_native_exports = {};
|
|
33
|
+
__export(useFloatingContext_native_exports, {
|
|
34
|
+
useFloatingContext: () => useFloatingContext
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(useFloatingContext_native_exports);
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
const useFloatingContext = () => import_react.default.useCallback(() => {}, []);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/popover",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.115.1",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -29,36 +29,37 @@
|
|
|
29
29
|
"react-native": "./dist/cjs/index.native.js",
|
|
30
30
|
"types": "./types/index.d.ts",
|
|
31
31
|
"import": "./dist/esm/index.mjs",
|
|
32
|
-
"require": "./dist/cjs/index.
|
|
32
|
+
"require": "./dist/cjs/index.cjs",
|
|
33
|
+
"default": "./dist/cjs/index.native.js"
|
|
33
34
|
}
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
37
|
"@floating-ui/react": "^0.26.24",
|
|
37
|
-
"@tamagui/adapt": "1.
|
|
38
|
-
"@tamagui/animate": "1.
|
|
39
|
-
"@tamagui/aria-hidden": "1.
|
|
40
|
-
"@tamagui/compose-refs": "1.
|
|
41
|
-
"@tamagui/constants": "1.
|
|
42
|
-
"@tamagui/core": "1.
|
|
43
|
-
"@tamagui/dismissable": "1.
|
|
44
|
-
"@tamagui/floating": "1.
|
|
45
|
-
"@tamagui/focus-scope": "1.
|
|
46
|
-
"@tamagui/helpers": "1.
|
|
47
|
-
"@tamagui/polyfill-dev": "1.
|
|
48
|
-
"@tamagui/popper": "1.
|
|
49
|
-
"@tamagui/portal": "1.
|
|
50
|
-
"@tamagui/remove-scroll": "1.
|
|
51
|
-
"@tamagui/scroll-view": "1.
|
|
52
|
-
"@tamagui/sheet": "1.
|
|
53
|
-
"@tamagui/stacks": "1.
|
|
54
|
-
"@tamagui/use-controllable-state": "1.
|
|
38
|
+
"@tamagui/adapt": "1.115.1",
|
|
39
|
+
"@tamagui/animate": "1.115.1",
|
|
40
|
+
"@tamagui/aria-hidden": "1.115.1",
|
|
41
|
+
"@tamagui/compose-refs": "1.115.1",
|
|
42
|
+
"@tamagui/constants": "1.115.1",
|
|
43
|
+
"@tamagui/core": "1.115.1",
|
|
44
|
+
"@tamagui/dismissable": "1.115.1",
|
|
45
|
+
"@tamagui/floating": "1.115.1",
|
|
46
|
+
"@tamagui/focus-scope": "1.115.1",
|
|
47
|
+
"@tamagui/helpers": "1.115.1",
|
|
48
|
+
"@tamagui/polyfill-dev": "1.115.1",
|
|
49
|
+
"@tamagui/popper": "1.115.1",
|
|
50
|
+
"@tamagui/portal": "1.115.1",
|
|
51
|
+
"@tamagui/remove-scroll": "1.115.1",
|
|
52
|
+
"@tamagui/scroll-view": "1.115.1",
|
|
53
|
+
"@tamagui/sheet": "1.115.1",
|
|
54
|
+
"@tamagui/stacks": "1.115.1",
|
|
55
|
+
"@tamagui/use-controllable-state": "1.115.1",
|
|
55
56
|
"react-freeze": "^1.0.3"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
59
|
"react": "*"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
|
-
"@tamagui/build": "1.
|
|
62
|
+
"@tamagui/build": "1.115.1",
|
|
62
63
|
"react": "^18.2.0 || ^19.0.0",
|
|
63
64
|
"react-native": "0.74.1"
|
|
64
65
|
},
|
package/dist/cjs/Popover.js
DELETED
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
-
var Popover_exports = {};
|
|
24
|
-
__export(Popover_exports, {
|
|
25
|
-
Popover: () => Popover,
|
|
26
|
-
PopoverAnchor: () => PopoverAnchor,
|
|
27
|
-
PopoverArrow: () => PopoverArrow,
|
|
28
|
-
PopoverClose: () => PopoverClose,
|
|
29
|
-
PopoverContent: () => PopoverContent,
|
|
30
|
-
PopoverContext: () => PopoverContext,
|
|
31
|
-
PopoverTrigger: () => PopoverTrigger,
|
|
32
|
-
usePopoverContext: () => usePopoverContext
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(Popover_exports);
|
|
35
|
-
var import_polyfill_dev = require("@tamagui/polyfill-dev"), import_adapt = require("@tamagui/adapt"), import_animate = require("@tamagui/animate"), import_animate_presence = require("@tamagui/animate-presence"), import_aria_hidden = require("@tamagui/aria-hidden"), import_compose_refs = require("@tamagui/compose-refs"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_floating = require("@tamagui/floating"), import_focus_scope = require("@tamagui/focus-scope"), import_helpers = require("@tamagui/helpers"), import_popper = require("@tamagui/popper"), import_portal = require("@tamagui/portal"), import_remove_scroll = require("@tamagui/remove-scroll"), import_sheet = require("@tamagui/sheet"), import_stacks = require("@tamagui/stacks"), import_use_controllable_state = require("@tamagui/use-controllable-state"), React = __toESM(require("react")), import_react_native = require("react-native-web"), import_useFloatingContext = require("./useFloatingContext"), import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
const POPOVER_SCOPE = "PopoverScope", PopoverContext = (0, import_core.createStyledContext)({}), usePopoverContext = PopoverContext.useStyledContext, PopoverAnchor = React.forwardRef(function(props, forwardedRef) {
|
|
37
|
-
const { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover), { onCustomAnchorAdd, onCustomAnchorRemove } = context || {};
|
|
38
|
-
return React.useEffect(() => (onCustomAnchorAdd(), () => onCustomAnchorRemove()), [onCustomAnchorAdd, onCustomAnchorRemove]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
-
import_popper.PopperAnchor,
|
|
40
|
-
{
|
|
41
|
-
__scopePopper: __scopePopover || POPOVER_SCOPE,
|
|
42
|
-
...rest,
|
|
43
|
-
ref: forwardedRef
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
}), PopoverTrigger = React.forwardRef(function(props, forwardedRef) {
|
|
47
|
-
const { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover), anchorTo = context.anchorTo, composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
|
|
48
|
-
if (!props.children) return null;
|
|
49
|
-
const trigger = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
-
import_core.View,
|
|
51
|
-
{
|
|
52
|
-
"aria-expanded": context.open,
|
|
53
|
-
"data-state": getState(context.open),
|
|
54
|
-
...rest,
|
|
55
|
-
ref: composedTriggerRef,
|
|
56
|
-
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle)
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
if (anchorTo) {
|
|
60
|
-
const virtualRef = {
|
|
61
|
-
current: {
|
|
62
|
-
getBoundingClientRect: () => import_constants.isWeb ? DOMRect.fromRect(anchorTo) : anchorTo,
|
|
63
|
-
...!import_constants.isWeb && {
|
|
64
|
-
measure: (c) => c(anchorTo?.x, anchorTo?.y, anchorTo?.width, anchorTo?.height),
|
|
65
|
-
measureInWindow: (c) => c(anchorTo?.x, anchorTo?.y, anchorTo?.width, anchorTo?.height)
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
|
-
import_popper.PopperAnchor,
|
|
71
|
-
{
|
|
72
|
-
virtualRef,
|
|
73
|
-
__scopePopper: __scopePopover || POPOVER_SCOPE,
|
|
74
|
-
children: trigger
|
|
75
|
-
}
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.PopperAnchor, { __scopePopper: __scopePopover || POPOVER_SCOPE, asChild: !0, children: trigger });
|
|
79
|
-
}), PopoverContent = import_popper.PopperContentFrame.extractable(
|
|
80
|
-
React.forwardRef(function(props, forwardedRef) {
|
|
81
|
-
const {
|
|
82
|
-
allowPinchZoom,
|
|
83
|
-
trapFocus,
|
|
84
|
-
disableRemoveScroll = !0,
|
|
85
|
-
zIndex,
|
|
86
|
-
__scopePopover,
|
|
87
|
-
...contentImplProps
|
|
88
|
-
} = props, context = usePopoverContext(__scopePopover), contentRef = React.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef), isRightClickOutsideRef = React.useRef(!1), [isFullyHidden, setIsFullyHidden] = React.useState(!context.open);
|
|
89
|
-
return context.open && isFullyHidden && setIsFullyHidden(!1), React.useEffect(() => {
|
|
90
|
-
if (!context.open) return;
|
|
91
|
-
const content = contentRef.current;
|
|
92
|
-
if (content) return (0, import_aria_hidden.hideOthers)(content);
|
|
93
|
-
}, [context.open]), !context.keepChildrenMounted && isFullyHidden ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverContentPortal, { __scopePopover, zIndex: props.zIndex, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Stack, { pointerEvents: context.open ? "auto" : "none", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
|
-
PopoverContentImpl,
|
|
95
|
-
{
|
|
96
|
-
...contentImplProps,
|
|
97
|
-
disableRemoveScroll,
|
|
98
|
-
ref: composedRefs,
|
|
99
|
-
setIsFullyHidden,
|
|
100
|
-
__scopePopover,
|
|
101
|
-
trapFocus: trapFocus ?? context.open,
|
|
102
|
-
disableOutsidePointerEvents: !0,
|
|
103
|
-
onCloseAutoFocus: (0, import_helpers.composeEventHandlers)(props.onCloseAutoFocus, (event) => {
|
|
104
|
-
event.preventDefault(), isRightClickOutsideRef.current || context.triggerRef.current?.focus();
|
|
105
|
-
}),
|
|
106
|
-
onPointerDownOutside: (0, import_helpers.composeEventHandlers)(
|
|
107
|
-
props.onPointerDownOutside,
|
|
108
|
-
(event) => {
|
|
109
|
-
const originalEvent = event.detail.originalEvent, ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === !0, isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
110
|
-
isRightClickOutsideRef.current = isRightClick;
|
|
111
|
-
},
|
|
112
|
-
{ checkDefaultPrevented: !1 }
|
|
113
|
-
),
|
|
114
|
-
onFocusOutside: (0, import_helpers.composeEventHandlers)(
|
|
115
|
-
props.onFocusOutside,
|
|
116
|
-
(event) => event.preventDefault(),
|
|
117
|
-
{ checkDefaultPrevented: !1 }
|
|
118
|
-
)
|
|
119
|
-
}
|
|
120
|
-
) }) });
|
|
121
|
-
})
|
|
122
|
-
);
|
|
123
|
-
function PopoverRepropagateContext(props) {
|
|
124
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popper.PopperContext.Provider, { scope: props.scope, ...props.popperContext, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverContext.Provider, { ...props.context, children: props.children }) });
|
|
125
|
-
}
|
|
126
|
-
function PopoverContentPortal(props) {
|
|
127
|
-
const { __scopePopover } = props, zIndex = props.zIndex ?? 15e4, context = usePopoverContext(__scopePopover), popperContext = (0, import_popper.usePopperContext)(__scopePopover || POPOVER_SCOPE), themeName = (0, import_core.useThemeName)();
|
|
128
|
-
let contents = props.children;
|
|
129
|
-
return (import_react_native.Platform.OS === "android" || import_react_native.Platform.OS === "ios") && (contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
|
-
PopoverRepropagateContext,
|
|
131
|
-
{
|
|
132
|
-
scope: __scopePopover || POPOVER_SCOPE,
|
|
133
|
-
popperContext,
|
|
134
|
-
context,
|
|
135
|
-
children: props.children
|
|
136
|
-
}
|
|
137
|
-
)), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.Portal, { zIndex, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Theme, { forceClassName: !0, name: themeName, children: [
|
|
138
|
-
!!context.open && !context.breakpointActive && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
139
|
-
import_stacks.YStack,
|
|
140
|
-
{
|
|
141
|
-
fullscreen: !0,
|
|
142
|
-
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle)
|
|
143
|
-
}
|
|
144
|
-
),
|
|
145
|
-
contents
|
|
146
|
-
] }) });
|
|
147
|
-
}
|
|
148
|
-
const PopoverContentImpl = React.forwardRef(function(props, forwardedRef) {
|
|
149
|
-
const {
|
|
150
|
-
trapFocus,
|
|
151
|
-
__scopePopover,
|
|
152
|
-
onOpenAutoFocus,
|
|
153
|
-
onCloseAutoFocus,
|
|
154
|
-
disableOutsidePointerEvents,
|
|
155
|
-
disableFocusScope,
|
|
156
|
-
onEscapeKeyDown,
|
|
157
|
-
onPointerDownOutside,
|
|
158
|
-
onFocusOutside,
|
|
159
|
-
onInteractOutside,
|
|
160
|
-
children,
|
|
161
|
-
disableRemoveScroll,
|
|
162
|
-
freezeContentsWhenHidden,
|
|
163
|
-
setIsFullyHidden,
|
|
164
|
-
...contentProps
|
|
165
|
-
} = props, context = usePopoverContext(__scopePopover), { open, keepChildrenMounted } = context, popperContext = (0, import_popper.usePopperContext)(__scopePopover || POPOVER_SCOPE), handleExitComplete = React.useCallback(() => {
|
|
166
|
-
setIsFullyHidden?.(!0);
|
|
167
|
-
}, [setIsFullyHidden]);
|
|
168
|
-
if (context.breakpointActive) {
|
|
169
|
-
const childrenWithoutScrollView = React.Children.toArray(children).map((child) => React.isValidElement(child) && child.type === import_react_native.ScrollView ? child.props.children : child);
|
|
170
|
-
let content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, { children: childrenWithoutScrollView });
|
|
171
|
-
return (import_react_native.Platform.OS === "android" || import_react_native.Platform.OS === "ios") && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
172
|
-
import_popper.PopperContext.Provider,
|
|
173
|
-
{
|
|
174
|
-
scope: __scopePopover || POPOVER_SCOPE,
|
|
175
|
-
...popperContext,
|
|
176
|
-
children: childrenWithoutScrollView
|
|
177
|
-
}
|
|
178
|
-
)), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.PortalItem, { hostName: `${context.id}PopoverContents`, children: content });
|
|
179
|
-
}
|
|
180
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
181
|
-
import_animate.Animate,
|
|
182
|
-
{
|
|
183
|
-
type: "presence",
|
|
184
|
-
present: !!open,
|
|
185
|
-
keepChildrenMounted,
|
|
186
|
-
onExitComplete: handleExitComplete,
|
|
187
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
188
|
-
import_popper.PopperContent,
|
|
189
|
-
{
|
|
190
|
-
__scopePopper: __scopePopover || POPOVER_SCOPE,
|
|
191
|
-
"data-state": getState(open),
|
|
192
|
-
id: context.contentId,
|
|
193
|
-
ref: forwardedRef,
|
|
194
|
-
...contentProps,
|
|
195
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
196
|
-
import_remove_scroll.RemoveScroll,
|
|
197
|
-
{
|
|
198
|
-
enabled: disableRemoveScroll ? !1 : open,
|
|
199
|
-
allowPinchZoom: !0,
|
|
200
|
-
removeScrollBar: !1,
|
|
201
|
-
style: dspContentsStyle,
|
|
202
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.ResetPresence, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
203
|
-
import_focus_scope.FocusScope,
|
|
204
|
-
{
|
|
205
|
-
loop: !0,
|
|
206
|
-
enabled: disableFocusScope ? !1 : open,
|
|
207
|
-
trapped: trapFocus,
|
|
208
|
-
onMountAutoFocus: onOpenAutoFocus,
|
|
209
|
-
onUnmountAutoFocus: onCloseAutoFocus,
|
|
210
|
-
children: import_constants.isWeb ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: dspContentsStyle, children }) : children
|
|
211
|
-
}
|
|
212
|
-
) })
|
|
213
|
-
}
|
|
214
|
-
)
|
|
215
|
-
},
|
|
216
|
-
context.contentId
|
|
217
|
-
)
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
}), dspContentsStyle = {
|
|
221
|
-
display: "contents"
|
|
222
|
-
}, PopoverClose = React.forwardRef(function(props, forwardedRef) {
|
|
223
|
-
const { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover);
|
|
224
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
225
|
-
import_stacks.YStack,
|
|
226
|
-
{
|
|
227
|
-
...rest,
|
|
228
|
-
ref: forwardedRef,
|
|
229
|
-
componentName: "PopoverClose",
|
|
230
|
-
onPress: (0, import_helpers.composeEventHandlers)(
|
|
231
|
-
props.onPress,
|
|
232
|
-
() => context.onOpenChange(!1, "press")
|
|
233
|
-
)
|
|
234
|
-
}
|
|
235
|
-
);
|
|
236
|
-
}), PopoverArrow = import_popper.PopperArrow.styleable(
|
|
237
|
-
function(props, forwardedRef) {
|
|
238
|
-
const { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover);
|
|
239
|
-
return useSheetBreakpointActive(context.sheetBreakpoint) ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
240
|
-
import_popper.PopperArrow,
|
|
241
|
-
{
|
|
242
|
-
__scopePopper: __scopePopover || POPOVER_SCOPE,
|
|
243
|
-
componentName: "PopoverArrow",
|
|
244
|
-
...rest,
|
|
245
|
-
ref: forwardedRef
|
|
246
|
-
}
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
|
-
), Popover = (0, import_helpers.withStaticProperties)(
|
|
250
|
-
React.forwardRef(
|
|
251
|
-
(props, forwardedRef) => {
|
|
252
|
-
const {
|
|
253
|
-
children,
|
|
254
|
-
open: openProp,
|
|
255
|
-
defaultOpen,
|
|
256
|
-
onOpenChange,
|
|
257
|
-
__scopePopover,
|
|
258
|
-
keepChildrenMounted,
|
|
259
|
-
hoverable,
|
|
260
|
-
disableFocus,
|
|
261
|
-
...restProps
|
|
262
|
-
} = props, id = React.useId(), { when, AdaptProvider } = (0, import_adapt.useAdaptParent)({
|
|
263
|
-
Contents: React.useCallback(() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.PortalHost, { name: `${id}PopoverContents` }), [])
|
|
264
|
-
}), sheetBreakpoint = when, triggerRef = React.useRef(null), [hasCustomAnchor, setHasCustomAnchor] = React.useState(!1), viaRef = React.useRef(), [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
265
|
-
prop: openProp,
|
|
266
|
-
defaultProp: defaultOpen || !1,
|
|
267
|
-
onChange: (val) => {
|
|
268
|
-
onOpenChange?.(val, viaRef.current);
|
|
269
|
-
}
|
|
270
|
-
}), handleOpenChange = (0, import_core.useEvent)((val, via) => {
|
|
271
|
-
viaRef.current = via, setOpen(val);
|
|
272
|
-
}), sheetActive = useSheetBreakpointActive(sheetBreakpoint), floatingContext = (0, import_useFloatingContext.useFloatingContext)({
|
|
273
|
-
open,
|
|
274
|
-
setOpen: handleOpenChange,
|
|
275
|
-
disable: sheetActive,
|
|
276
|
-
hoverable,
|
|
277
|
-
disableFocus
|
|
278
|
-
}), [anchorTo, setAnchorToRaw] = React.useState(), setAnchorTo = (0, import_core.createShallowSetState)(
|
|
279
|
-
setAnchorToRaw
|
|
280
|
-
);
|
|
281
|
-
React.useImperativeHandle(forwardedRef, () => ({
|
|
282
|
-
anchorTo: setAnchorTo,
|
|
283
|
-
toggle: () => setOpen((prev) => !prev),
|
|
284
|
-
open: () => setOpen(!0),
|
|
285
|
-
close: () => setOpen(!1),
|
|
286
|
-
setOpen
|
|
287
|
-
}));
|
|
288
|
-
const popoverContext = {
|
|
289
|
-
id,
|
|
290
|
-
sheetBreakpoint,
|
|
291
|
-
contentId: React.useId(),
|
|
292
|
-
triggerRef,
|
|
293
|
-
open,
|
|
294
|
-
breakpointActive: sheetActive,
|
|
295
|
-
onOpenChange: handleOpenChange,
|
|
296
|
-
onOpenToggle: (0, import_core.useEvent)(() => {
|
|
297
|
-
open && sheetActive || setOpen(!open);
|
|
298
|
-
}),
|
|
299
|
-
hasCustomAnchor,
|
|
300
|
-
anchorTo,
|
|
301
|
-
onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(!0), []),
|
|
302
|
-
onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(!1), []),
|
|
303
|
-
keepChildrenMounted
|
|
304
|
-
}, contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
305
|
-
import_popper.Popper,
|
|
306
|
-
{
|
|
307
|
-
__scopePopper: __scopePopover || POPOVER_SCOPE,
|
|
308
|
-
stayInFrame: !0,
|
|
309
|
-
...restProps,
|
|
310
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverContext.Provider, { scope: __scopePopover, ...popoverContext, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverSheetController, { onOpenChange: setOpen, children }) })
|
|
311
|
-
}
|
|
312
|
-
);
|
|
313
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AdaptProvider, { children: import_constants.isWeb ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_floating.FloatingOverrideContext.Provider, { value: floatingContext, children: contents }) : contents });
|
|
314
|
-
}
|
|
315
|
-
),
|
|
316
|
-
{
|
|
317
|
-
Anchor: PopoverAnchor,
|
|
318
|
-
Arrow: PopoverArrow,
|
|
319
|
-
Trigger: PopoverTrigger,
|
|
320
|
-
Content: PopoverContent,
|
|
321
|
-
Close: PopoverClose,
|
|
322
|
-
Adapt: import_adapt.Adapt,
|
|
323
|
-
ScrollView: import_react_native.ScrollView,
|
|
324
|
-
Sheet: import_sheet.Sheet.Controlled
|
|
325
|
-
}
|
|
326
|
-
);
|
|
327
|
-
function getState(open) {
|
|
328
|
-
return open ? "open" : "closed";
|
|
329
|
-
}
|
|
330
|
-
const PopoverSheetController = ({
|
|
331
|
-
__scopePopover,
|
|
332
|
-
...props
|
|
333
|
-
}) => {
|
|
334
|
-
const context = usePopoverContext(__scopePopover), showSheet = useShowPopoverSheet(context), breakpointActive = context.breakpointActive, getShowSheet = (0, import_core.useGet)(showSheet);
|
|
335
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
336
|
-
import_sheet.SheetController,
|
|
337
|
-
{
|
|
338
|
-
onOpenChange: (val) => {
|
|
339
|
-
getShowSheet() && props.onOpenChange?.(val);
|
|
340
|
-
},
|
|
341
|
-
open: context.open,
|
|
342
|
-
hidden: breakpointActive === !1,
|
|
343
|
-
children: props.children
|
|
344
|
-
}
|
|
345
|
-
);
|
|
346
|
-
}, useSheetBreakpointActive = (breakpoint) => {
|
|
347
|
-
const media = (0, import_core.useMedia)();
|
|
348
|
-
return typeof breakpoint == "boolean" || !breakpoint ? !!breakpoint : media[breakpoint];
|
|
349
|
-
}, useShowPopoverSheet = (context) => {
|
|
350
|
-
const breakpointActive = useSheetBreakpointActive(context.sheetBreakpoint);
|
|
351
|
-
return context.open === !1 ? !1 : breakpointActive;
|
|
352
|
-
};
|
|
353
|
-
//# sourceMappingURL=Popover.js.map
|
package/dist/cjs/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
|
-
return to;
|
|
10
|
-
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
11
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
12
|
-
var src_exports = {};
|
|
13
|
-
module.exports = __toCommonJS(src_exports);
|
|
14
|
-
__reExport(src_exports, require("./Popover"), module.exports);
|
|
15
|
-
__reExport(src_exports, require("./useFloatingContext"), module.exports);
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
-
var useFloatingContext_exports = {};
|
|
24
|
-
__export(useFloatingContext_exports, {
|
|
25
|
-
useFloatingContext: () => useFloatingContext
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(useFloatingContext_exports);
|
|
28
|
-
var import_react = __toESM(require("react")), import_react2 = require("@floating-ui/react");
|
|
29
|
-
const useFloatingContext = ({
|
|
30
|
-
open,
|
|
31
|
-
setOpen,
|
|
32
|
-
disable,
|
|
33
|
-
disableFocus,
|
|
34
|
-
hoverable
|
|
35
|
-
}) => import_react.default.useCallback(
|
|
36
|
-
(props) => {
|
|
37
|
-
const floating = (0, import_react2.useFloating)({
|
|
38
|
-
...props,
|
|
39
|
-
open,
|
|
40
|
-
onOpenChange: (val, event) => {
|
|
41
|
-
const type = event?.type === "mousemove" || event?.type === "mouseenter" || event?.type === "mouseleave" ? "hover" : "press";
|
|
42
|
-
setOpen(val, type);
|
|
43
|
-
}
|
|
44
|
-
}), { getReferenceProps, getFloatingProps } = (0, import_react2.useInteractions)([
|
|
45
|
-
hoverable ? (0, import_react2.useHover)(floating.context, {
|
|
46
|
-
enabled: !disable && hoverable,
|
|
47
|
-
handleClose: (0, import_react2.safePolygon)({
|
|
48
|
-
requireIntent: !0,
|
|
49
|
-
blockPointerEvents: !0,
|
|
50
|
-
buffer: 1
|
|
51
|
-
}),
|
|
52
|
-
...hoverable && typeof hoverable == "object" && hoverable
|
|
53
|
-
}) : (0, import_react2.useHover)(floating.context, {
|
|
54
|
-
enabled: !1
|
|
55
|
-
}),
|
|
56
|
-
(0, import_react2.useFocus)(floating.context, {
|
|
57
|
-
enabled: !disable && !disableFocus,
|
|
58
|
-
visibleOnly: !0
|
|
59
|
-
}),
|
|
60
|
-
(0, import_react2.useRole)(floating.context, { role: "dialog" }),
|
|
61
|
-
(0, import_react2.useDismiss)(floating.context, {
|
|
62
|
-
enabled: !disable
|
|
63
|
-
})
|
|
64
|
-
]);
|
|
65
|
-
return {
|
|
66
|
-
...floating,
|
|
67
|
-
open,
|
|
68
|
-
getReferenceProps,
|
|
69
|
-
getFloatingProps
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
[open, setOpen, disable, disableFocus, hoverable]
|
|
73
|
-
);
|
|
74
|
-
//# sourceMappingURL=useFloatingContext.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|