@tamagui/popper 3.0.0-beta.924.1 → 3.0.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/Popper.cjs +16 -12
- package/dist/cjs/Popper.native.cjs +25 -53
- package/dist/cjs/Popper.native.js +25 -53
- package/dist/cjs/Popper.native.js.map +1 -1
- package/dist/cjs/useRepositionOnNative.cjs +24 -0
- package/dist/cjs/useRepositionOnNative.native.cjs +63 -0
- package/dist/cjs/useRepositionOnNative.native.js +65 -0
- package/dist/cjs/useRepositionOnNative.native.js.map +1 -0
- package/dist/esm/Popper.mjs +17 -12
- package/dist/esm/Popper.mjs.map +1 -1
- package/dist/esm/Popper.native.js +26 -54
- package/dist/esm/Popper.native.js.map +1 -1
- package/dist/esm/useRepositionOnNative.mjs +4 -0
- package/dist/esm/useRepositionOnNative.mjs.map +1 -0
- package/dist/esm/useRepositionOnNative.native.js +36 -0
- package/dist/esm/useRepositionOnNative.native.js.map +1 -0
- package/dist/jsx/Popper.mjs +17 -12
- package/dist/jsx/Popper.mjs.map +1 -1
- package/dist/jsx/Popper.native.cjs +25 -53
- package/dist/jsx/Popper.native.js +25 -53
- package/dist/jsx/Popper.native.js.map +1 -1
- package/dist/jsx/useRepositionOnNative.mjs +4 -0
- package/dist/jsx/useRepositionOnNative.mjs.map +1 -0
- package/dist/jsx/useRepositionOnNative.native.cjs +63 -0
- package/dist/jsx/useRepositionOnNative.native.js +65 -0
- package/dist/jsx/useRepositionOnNative.native.js.map +1 -0
- package/package.json +12 -11
- package/src/Popper.tsx +45 -59
- package/src/useRepositionOnNative.native.ts +40 -0
- package/src/useRepositionOnNative.ts +8 -0
- package/types/Popper.d.ts +6 -7
- package/types/Popper.d.ts.map +1 -1
- package/types/useRepositionOnNative.d.ts +6 -0
- package/types/useRepositionOnNative.d.ts.map +1 -0
- package/types/useRepositionOnNative.native.d.ts +7 -0
- package/types/useRepositionOnNative.native.d.ts.map +1 -0
package/src/Popper.tsx
CHANGED
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
import { flushSync } from 'react-dom'
|
|
3
3
|
import { useComposedRefs } from '@tamagui/compose-refs'
|
|
4
4
|
import { isWeb, useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
5
|
-
import type {
|
|
5
|
+
import type { TamaguiElement, ViewProps } from '@tamagui/core'
|
|
6
6
|
import {
|
|
7
7
|
createStyledHOC,
|
|
8
8
|
LayoutMeasurementController,
|
|
9
9
|
View as TamaguiView,
|
|
10
10
|
createRefComponent,
|
|
11
11
|
createStyledContext,
|
|
12
|
-
getVariableValue,
|
|
13
12
|
registerLayoutNode,
|
|
14
13
|
styled,
|
|
15
14
|
} from '@tamagui/core'
|
|
@@ -36,10 +35,10 @@ import {
|
|
|
36
35
|
size as sizeMiddleware,
|
|
37
36
|
useFloating,
|
|
38
37
|
} from '@tamagui/floating'
|
|
39
|
-
import { getSize } from '@tamagui/get-token'
|
|
40
38
|
import { startTransition } from '@tamagui/start-transition'
|
|
41
39
|
import * as React from 'react'
|
|
42
|
-
|
|
40
|
+
|
|
41
|
+
import { useRepositionOnNative } from './useRepositionOnNative'
|
|
43
42
|
|
|
44
43
|
type ShiftProps = typeof shift extends (options: infer Opts) => void ? Opts : never
|
|
45
44
|
type FlipProps = typeof flip extends (options: infer Opts) => void ? Opts : never
|
|
@@ -50,7 +49,6 @@ type FlipProps = typeof flip extends (options: infer Opts) => void ? Opts : neve
|
|
|
50
49
|
|
|
51
50
|
export type PopperContextShared = {
|
|
52
51
|
open: boolean
|
|
53
|
-
size?: SizeTokens
|
|
54
52
|
hasFloating: boolean
|
|
55
53
|
arrowStyle?: Partial<Coords> & {
|
|
56
54
|
centerOffset: number
|
|
@@ -146,7 +144,6 @@ export type PopperProps = {
|
|
|
146
144
|
* */
|
|
147
145
|
open?: boolean
|
|
148
146
|
|
|
149
|
-
size?: SizeTokens
|
|
150
147
|
children?: React.ReactNode
|
|
151
148
|
|
|
152
149
|
/**
|
|
@@ -346,7 +343,6 @@ function tamaguiAutoUpdate(
|
|
|
346
343
|
export function Popper(props: PopperProps) {
|
|
347
344
|
const {
|
|
348
345
|
children,
|
|
349
|
-
size,
|
|
350
346
|
strategy = 'absolute',
|
|
351
347
|
placement = 'bottom',
|
|
352
348
|
stayInFrame,
|
|
@@ -484,41 +480,10 @@ export function Popper(props: PopperProps) {
|
|
|
484
480
|
|
|
485
481
|
const { middlewareData } = floating
|
|
486
482
|
|
|
487
|
-
|
|
488
|
-
// On Native there's no autoupdate so we call update() when necessary
|
|
489
|
-
|
|
490
|
-
// Subscribe to window dimensions (orientation, scale, etc...)
|
|
491
|
-
const dimensions = useWindowDimensions()
|
|
492
|
-
|
|
493
|
-
// Subscribe to keyboard state
|
|
494
|
-
const [keyboardOpen, setKeyboardOpen] = React.useState(false)
|
|
495
|
-
React.useEffect(() => {
|
|
496
|
-
const showSubscription = Keyboard.addListener('keyboardDidShow', () => {
|
|
497
|
-
startTransition(() => {
|
|
498
|
-
setKeyboardOpen(true)
|
|
499
|
-
})
|
|
500
|
-
})
|
|
501
|
-
const hideSubscription = Keyboard.addListener('keyboardDidHide', () => {
|
|
502
|
-
startTransition(() => {
|
|
503
|
-
setKeyboardOpen(false)
|
|
504
|
-
})
|
|
505
|
-
})
|
|
506
|
-
|
|
507
|
-
return () => {
|
|
508
|
-
showSubscription.remove()
|
|
509
|
-
hideSubscription.remove()
|
|
510
|
-
}
|
|
511
|
-
}, [])
|
|
512
|
-
|
|
513
|
-
useIsomorphicLayoutEffect(() => {
|
|
514
|
-
if (passThrough) return
|
|
515
|
-
floating.update()
|
|
516
|
-
}, [passThrough, dimensions, keyboardOpen])
|
|
517
|
-
}
|
|
483
|
+
useRepositionOnNative(floating.update, passThrough)
|
|
518
484
|
|
|
519
485
|
const popperContext = React.useMemo(() => {
|
|
520
486
|
return {
|
|
521
|
-
size,
|
|
522
487
|
arrowRef: setArrow,
|
|
523
488
|
arrowStyle: middlewareData.arrow,
|
|
524
489
|
onArrowSize: setArrowSize,
|
|
@@ -531,7 +496,6 @@ export function Popper(props: PopperProps) {
|
|
|
531
496
|
} satisfies PopperContextValue
|
|
532
497
|
}, [
|
|
533
498
|
open,
|
|
534
|
-
size,
|
|
535
499
|
floating,
|
|
536
500
|
JSON.stringify(middlewareData.arrow || null),
|
|
537
501
|
JSON.stringify(middlewareData.transformOrigin || null),
|
|
@@ -632,6 +596,20 @@ export const PopperAnchor = createStyledHOC(
|
|
|
632
596
|
// flushSync forces synchronous commit so update() below reads
|
|
633
597
|
// the correct reference element immediately.
|
|
634
598
|
onMouseEnter: (e) => {
|
|
599
|
+
const anchorProps = rest as ViewProps
|
|
600
|
+
// asChild consumers (including Menu.Trigger) put their guard on
|
|
601
|
+
// the child rather than on the anchor's interaction props.
|
|
602
|
+
if (
|
|
603
|
+
anchorProps.asChild &&
|
|
604
|
+
React.isValidElement<ViewProps>(anchorProps.children)
|
|
605
|
+
) {
|
|
606
|
+
anchorProps.children.props.onPointerEnter?.(e as any)
|
|
607
|
+
if (e.defaultPrevented || ('isCanceled' in e && e.isCanceled)) return
|
|
608
|
+
}
|
|
609
|
+
const hoverProps = refProps ?? rest
|
|
610
|
+
hoverProps.onPointerEnter?.(e)
|
|
611
|
+
if (e.defaultPrevented || ('isCanceled' in e && e.isCanceled)) return
|
|
612
|
+
|
|
635
613
|
const el = (e.currentTarget ?? ref.current) as HTMLElement | null
|
|
636
614
|
if (el instanceof HTMLElement) {
|
|
637
615
|
flushSync(() => refs.setReference(el))
|
|
@@ -639,7 +617,6 @@ export const PopperAnchor = createStyledHOC(
|
|
|
639
617
|
|
|
640
618
|
if (!refProps) return
|
|
641
619
|
|
|
642
|
-
refProps.onPointerEnter?.(e)
|
|
643
620
|
context.onHoverReference?.(e.nativeEvent)
|
|
644
621
|
}
|
|
645
622
|
},
|
|
@@ -709,7 +686,7 @@ export const PopperContent = createRefComponent<PopperContentElement, PopperCont
|
|
|
709
686
|
// when animatePosition=true, disableAnimation state changes cycle the DOM node
|
|
710
687
|
// (null then re-mount). we block all null calls here to prevent floating-ui from
|
|
711
688
|
// losing its reference mid-cycle; genuine unmount is handled by the useEffect below.
|
|
712
|
-
// for same-node cycling (
|
|
689
|
+
// for same-node cycling (transition prop change without remount), refs.setFloating
|
|
713
690
|
// is a no-op in floating-ui (same-node guard), so we call update() to force recompute.
|
|
714
691
|
const lastNodeRef = React.useRef<any>(null)
|
|
715
692
|
const safeSetFloating = React.useCallback(
|
|
@@ -813,14 +790,13 @@ export const PopperContent = createRefComponent<PopperContentElement, PopperCont
|
|
|
813
790
|
position: strategy,
|
|
814
791
|
opacity: hide ? 0 : 1,
|
|
815
792
|
// when animatePosition is controlled by the user, always emit these keys with
|
|
816
|
-
// safe no-op values (transition:
|
|
817
|
-
//
|
|
818
|
-
//
|
|
793
|
+
// safe no-op values (transition: 'none') so the inner View's hook count
|
|
794
|
+
// stays stable across animatePos toggles. animatePresence must always be
|
|
795
|
+
// false here too, to short-circuit usePresence consistently.
|
|
819
796
|
...(isAnimatePosControlled && {
|
|
820
|
-
|
|
821
|
-
//
|
|
822
|
-
|
|
823
|
-
animateOnly: animatePos && !disableAnimation ? rest.animateOnly : [],
|
|
797
|
+
// `none` keeps the styles applied while turning transitions off, letting
|
|
798
|
+
// the element move to its position silently before animations start
|
|
799
|
+
transition: animatePos && !disableAnimation ? rest.transition : 'none',
|
|
824
800
|
animatePresence: false,
|
|
825
801
|
}),
|
|
826
802
|
}
|
|
@@ -874,7 +850,8 @@ export const PopperContent = createRefComponent<PopperContentElement, PopperCont
|
|
|
874
850
|
|
|
875
851
|
export type PopperArrowExtraProps = {
|
|
876
852
|
offset?: number
|
|
877
|
-
size
|
|
853
|
+
/** arrow size in px */
|
|
854
|
+
size?: number
|
|
878
855
|
scope?: string
|
|
879
856
|
/**
|
|
880
857
|
* Enable smooth animation when the arrow position changes
|
|
@@ -918,13 +895,11 @@ export const PopperArrow = createRefComponent<TamaguiElement, PopperArrowProps>(
|
|
|
918
895
|
const context = usePopperContext(scope)
|
|
919
896
|
|
|
920
897
|
// TODO: get rid! at the very least move up to Popover and simplify
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
const size = Math.max(0, +sizeVal)
|
|
898
|
+
// arrow px used to be size-token * 0.52 - 11.5, but the offset zeroes every
|
|
899
|
+
// v6 token (size 2 is 8px: 8 * 0.52 - 11.5 < 0), so call sites pass
|
|
900
|
+
// round(token * 0.52) instead: v6 2 -> 4, v6 3 -> 6, v5-site 4 -> 23.
|
|
901
|
+
// the bare default matches the old output for a mid v5 size (36 * 0.52 - 11.5 ≈ 7)
|
|
902
|
+
const size = typeof sizeProp === 'number' ? sizeProp : 7
|
|
928
903
|
|
|
929
904
|
const { placement } = context
|
|
930
905
|
const refs = useComposedRefs(context.arrowRef, forwardedRef)
|
|
@@ -953,6 +928,16 @@ export const PopperArrow = createRefComponent<TamaguiElement, PopperArrowProps>(
|
|
|
953
928
|
arrowStyle[oppSide] = -size
|
|
954
929
|
innerArrowStyle[oppSide] = size / 2
|
|
955
930
|
}
|
|
931
|
+
// extend the clip into the content by the border width so the arrow fill
|
|
932
|
+
// covers the content border and does not leave a line across the base
|
|
933
|
+
const overlap = typeof borderWidth === 'number' ? borderWidth : 0
|
|
934
|
+
if (overlap) {
|
|
935
|
+
if (isVertical) {
|
|
936
|
+
arrowStyle.height = size + overlap
|
|
937
|
+
} else {
|
|
938
|
+
arrowStyle.width = size + overlap
|
|
939
|
+
}
|
|
940
|
+
}
|
|
956
941
|
if (oppSide === 'top' || oppSide === 'bottom') {
|
|
957
942
|
arrowStyle.left = 0
|
|
958
943
|
}
|
|
@@ -973,8 +958,9 @@ export const PopperArrow = createRefComponent<TamaguiElement, PopperArrowProps>(
|
|
|
973
958
|
{...arrowStyle}
|
|
974
959
|
{...(!arrowPositioned && { opacity: 0 })}
|
|
975
960
|
{...(isAnimatePosControlled && {
|
|
976
|
-
|
|
977
|
-
|
|
961
|
+
// the arrow only ever moves, so its transition names `transform` and
|
|
962
|
+
// nothing else: `left`/`top` have to jump with the popper, not trail it
|
|
963
|
+
transition: animatePosition ? { transform: transition } : 'none',
|
|
978
964
|
animatePresence: false,
|
|
979
965
|
})}
|
|
980
966
|
>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
2
|
+
import { startTransition } from '@tamagui/start-transition'
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Keyboard, useWindowDimensions } from 'react-native'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Native has no autoupdate, so the floating position is recomputed by hand
|
|
8
|
+
* whenever the two things that invalidate it change: the window (orientation,
|
|
9
|
+
* scale) and the soft keyboard.
|
|
10
|
+
*/
|
|
11
|
+
export const useRepositionOnNative = (
|
|
12
|
+
update: () => void,
|
|
13
|
+
passThrough: boolean | undefined
|
|
14
|
+
) => {
|
|
15
|
+
const dimensions = useWindowDimensions()
|
|
16
|
+
|
|
17
|
+
const [keyboardOpen, setKeyboardOpen] = React.useState(false)
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
const showSubscription = Keyboard.addListener('keyboardDidShow', () => {
|
|
20
|
+
startTransition(() => {
|
|
21
|
+
setKeyboardOpen(true)
|
|
22
|
+
})
|
|
23
|
+
})
|
|
24
|
+
const hideSubscription = Keyboard.addListener('keyboardDidHide', () => {
|
|
25
|
+
startTransition(() => {
|
|
26
|
+
setKeyboardOpen(false)
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
return () => {
|
|
31
|
+
showSubscription.remove()
|
|
32
|
+
hideSubscription.remove()
|
|
33
|
+
}
|
|
34
|
+
}, [])
|
|
35
|
+
|
|
36
|
+
useIsomorphicLayoutEffect(() => {
|
|
37
|
+
if (passThrough) return
|
|
38
|
+
update()
|
|
39
|
+
}, [passThrough, dimensions, keyboardOpen])
|
|
40
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web gets this for free: floating-ui's autoupdate already watches resize and
|
|
3
|
+
* scroll, so there is nothing to do here. The native sibling is the real one.
|
|
4
|
+
*/
|
|
5
|
+
export const useRepositionOnNative = (
|
|
6
|
+
_update: () => void,
|
|
7
|
+
_passThrough: boolean | undefined
|
|
8
|
+
) => {}
|
package/types/Popper.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TamaguiElement, ViewProps } from '@tamagui/core';
|
|
2
2
|
import type { PopupTriggerMap } from '@tamagui/floating';
|
|
3
3
|
import type { Coords, OffsetOptions, Placement, SizeOptions, Strategy, UseFloatingReturn } from '@tamagui/floating';
|
|
4
4
|
import { flip, shift } from '@tamagui/floating';
|
|
@@ -7,7 +7,6 @@ type ShiftProps = typeof shift extends (options: infer Opts) => void ? Opts : ne
|
|
|
7
7
|
type FlipProps = typeof flip extends (options: infer Opts) => void ? Opts : never;
|
|
8
8
|
export type PopperContextShared = {
|
|
9
9
|
open: boolean;
|
|
10
|
-
size?: SizeTokens;
|
|
11
10
|
hasFloating: boolean;
|
|
12
11
|
arrowStyle?: Partial<Coords> & {
|
|
13
12
|
centerOffset: number;
|
|
@@ -71,7 +70,6 @@ export type PopperProps = {
|
|
|
71
70
|
* Optional, will disable measuring updates when open is false for better performance
|
|
72
71
|
* */
|
|
73
72
|
open?: boolean;
|
|
74
|
-
size?: SizeTokens;
|
|
75
73
|
children?: React.ReactNode;
|
|
76
74
|
/**
|
|
77
75
|
* Determine the preferred placement of the content in relation to the trigger
|
|
@@ -116,7 +114,7 @@ export type PopperAnchorExtraProps = {
|
|
|
116
114
|
scope?: string;
|
|
117
115
|
};
|
|
118
116
|
export type PopperAnchorProps = ViewProps;
|
|
119
|
-
export declare const PopperAnchor: import("@tamagui/core").TamaguiComponent<
|
|
117
|
+
export declare const PopperAnchor: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, TamaguiElement, Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, keyof PopperAnchorExtraProps> & PopperAnchorExtraProps, import("@tamagui/core").StackStyleBase, Omit<{}, keyof PopperAnchorExtraProps>, {}>;
|
|
120
118
|
export type PopperContentProps = ViewProps & {
|
|
121
119
|
scope?: string;
|
|
122
120
|
/**
|
|
@@ -125,7 +123,7 @@ export type PopperContentProps = ViewProps & {
|
|
|
125
123
|
animatePosition?: boolean | 'even-when-repositioning';
|
|
126
124
|
passThrough?: boolean;
|
|
127
125
|
};
|
|
128
|
-
export declare const PopperContentFrame: React.FunctionComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps,
|
|
126
|
+
export declare const PopperContentFrame: React.FunctionComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, never> & Omit<import("@tamagui/core").WithThemeValues<Omit<import("@tamagui/core").StackStyleBase, never>> & import("@tamagui/core").WithFlatVariantValues<{}> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>, keyof import("@tamagui/core").RNTamaguiViewNonStyleProps> & {
|
|
129
127
|
ref?: React.Ref<TamaguiElement> | undefined;
|
|
130
128
|
}> & import("@tamagui/core").StaticComponentObject<import("@tamagui/core").TamaDefer, TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {}, import("@tamagui/core").StaticConfigPublic> & Omit<import("@tamagui/core").StaticConfigPublic, "staticConfig"> & {
|
|
131
129
|
__tama: [import("@tamagui/core").TamaDefer, TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {}, import("@tamagui/core").StaticConfigPublic];
|
|
@@ -133,7 +131,8 @@ export declare const PopperContentFrame: React.FunctionComponent<Omit<import("@t
|
|
|
133
131
|
export declare const PopperContent: import("@tamagui/compose-refs").RefComponent<TamaguiElement, PopperContentProps>;
|
|
134
132
|
export type PopperArrowExtraProps = {
|
|
135
133
|
offset?: number;
|
|
136
|
-
size
|
|
134
|
+
/** arrow size in px */
|
|
135
|
+
size?: number;
|
|
137
136
|
scope?: string;
|
|
138
137
|
/**
|
|
139
138
|
* Enable smooth animation when the arrow position changes
|
|
@@ -141,7 +140,7 @@ export type PopperArrowExtraProps = {
|
|
|
141
140
|
animatePosition?: boolean;
|
|
142
141
|
};
|
|
143
142
|
export type PopperArrowProps = ViewProps & PopperArrowExtraProps;
|
|
144
|
-
export declare const PopperArrowFrame: React.FunctionComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps,
|
|
143
|
+
export declare const PopperArrowFrame: React.FunctionComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, never> & Omit<import("@tamagui/core").WithThemeValues<Omit<import("@tamagui/core").StackStyleBase, never>> & import("@tamagui/core").WithFlatVariantValues<{}> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>>, keyof import("@tamagui/core").RNTamaguiViewNonStyleProps> & {
|
|
145
144
|
ref?: React.Ref<TamaguiElement> | undefined;
|
|
146
145
|
}> & import("@tamagui/core").StaticComponentObject<import("@tamagui/core").TamaDefer, TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {}, import("@tamagui/core").StaticConfigPublic> & Omit<import("@tamagui/core").StaticConfigPublic, "staticConfig"> & {
|
|
147
146
|
__tama: [import("@tamagui/core").TamaDefer, TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {}, import("@tamagui/core").StaticConfigPublic];
|
package/types/Popper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popper.d.ts","sourceRoot":"","sources":["../src/Popper.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Popper.d.ts","sourceRoot":"","sources":["../src/Popper.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE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,OAAO,CAAC,EAAE,kBAAkB,QAEvD;AAmID,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,qBA2KxC;AAQD,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IACjC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AACD,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAA;AAEzC,eAAO,MAAM,YAAY,kSAuGxB,CAAA;AAQD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,yBAAyB,CAAA;IACrD,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;CAE7B,CAAA;AAEF,eAAO,MAAM,aAAa,kFAiMzB,CAAA;AAMD,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,qBAAqB,CAAA;AAEhE,eAAO,MAAM,gBAAgB;;;;CAG3B,CAAA;AAqBF,eAAO,MAAM,WAAW,gFAyGvB,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web gets this for free: floating-ui's autoupdate already watches resize and
|
|
3
|
+
* scroll, so there is nothing to do here. The native sibling is the real one.
|
|
4
|
+
*/
|
|
5
|
+
export declare const useRepositionOnNative: (_update: () => void, _passThrough: boolean | undefined) => void;
|
|
6
|
+
//# sourceMappingURL=useRepositionOnNative.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRepositionOnNative.d.ts","sourceRoot":"","sources":["../src/useRepositionOnNative.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,qBAAqB,YACvB,MAAM,IAAI,gBACL,OAAO,GAAG,SAAS,SAC5B,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native has no autoupdate, so the floating position is recomputed by hand
|
|
3
|
+
* whenever the two things that invalidate it change: the window (orientation,
|
|
4
|
+
* scale) and the soft keyboard.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useRepositionOnNative: (update: () => void, passThrough: boolean | undefined) => void;
|
|
7
|
+
//# sourceMappingURL=useRepositionOnNative.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRepositionOnNative.native.d.ts","sourceRoot":"","sources":["../src/useRepositionOnNative.native.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,WACxB,MAAM,IAAI,eACL,OAAO,GAAG,SAAS,SA2BjC,CAAA"}
|