@oxyhq/bloom 0.50.2 → 0.51.0
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/NOTICE +89 -0
- package/README.md +12 -7
- package/lib/commonjs/avatar-group/AvatarGroup.web.js +2 -1
- package/lib/commonjs/avatar-group/AvatarGroup.web.js.map +1 -1
- package/lib/commonjs/bottom-sheet/index.web.js +2 -1
- package/lib/commonjs/bottom-sheet/index.web.js.map +1 -1
- package/lib/commonjs/context-menu/index.web.js +3 -2
- package/lib/commonjs/context-menu/index.web.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.web.js +4 -3
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- package/lib/commonjs/index.js +90 -83
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +116 -109
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/menu/index.web.js +2 -1
- package/lib/commonjs/menu/index.web.js.map +1 -1
- package/lib/commonjs/popover/index.web.js +3 -2
- package/lib/commonjs/popover/index.web.js.map +1 -1
- package/lib/commonjs/portal/index.js +4 -1
- package/lib/commonjs/portal/index.js.map +1 -1
- package/lib/commonjs/progressive-blur/index.js +79 -0
- package/lib/commonjs/progressive-blur/index.js.map +1 -0
- package/lib/commonjs/progressive-blur/index.web.js +67 -0
- package/lib/commonjs/progressive-blur/index.web.js.map +1 -0
- package/lib/commonjs/progressive-blur/shared.js +66 -0
- package/lib/commonjs/progressive-blur/shared.js.map +1 -0
- package/lib/commonjs/progressive-blur/types.js +6 -0
- package/lib/commonjs/progressive-blur/types.js.map +1 -0
- package/lib/commonjs/select/index.web.js +2 -1
- package/lib/commonjs/select/index.web.js.map +1 -1
- package/lib/commonjs/styles/web-view-style.js +26 -0
- package/lib/commonjs/styles/web-view-style.js.map +1 -0
- package/lib/commonjs/tab-bar/TabBarBase.js +415 -0
- package/lib/commonjs/tab-bar/TabBarBase.js.map +1 -0
- package/lib/commonjs/tab-bar/expo-router/RouterTabBar.js +83 -0
- package/lib/commonjs/tab-bar/expo-router/RouterTabBar.js.map +1 -0
- package/lib/commonjs/tab-bar/expo-router/fading-tab-screen.js +119 -0
- package/lib/commonjs/tab-bar/expo-router/fading-tab-screen.js.map +1 -0
- package/lib/commonjs/tab-bar/expo-router/index.js +26 -0
- package/lib/commonjs/tab-bar/expo-router/index.js.map +1 -0
- package/lib/commonjs/tab-bar/glyph.js +43 -0
- package/lib/commonjs/tab-bar/glyph.js.map +1 -0
- package/lib/commonjs/tab-bar/glyph.native.js +55 -0
- package/lib/commonjs/tab-bar/glyph.native.js.map +1 -0
- package/lib/commonjs/tab-bar/index.js +65 -0
- package/lib/commonjs/tab-bar/index.js.map +1 -0
- package/lib/commonjs/tab-bar/index.web.js +67 -0
- package/lib/commonjs/tab-bar/index.web.js.map +1 -0
- package/lib/commonjs/tab-bar/minimize-context.js +127 -0
- package/lib/commonjs/tab-bar/minimize-context.js.map +1 -0
- package/lib/commonjs/tab-bar/shared.js +139 -0
- package/lib/commonjs/tab-bar/shared.js.map +1 -0
- package/lib/commonjs/tab-bar/surface.js +50 -0
- package/lib/commonjs/tab-bar/surface.js.map +1 -0
- package/lib/commonjs/tab-bar/surface.native.js +56 -0
- package/lib/commonjs/tab-bar/surface.native.js.map +1 -0
- package/lib/commonjs/tab-bar/surface.web.js +59 -0
- package/lib/commonjs/tab-bar/surface.web.js.map +1 -0
- package/lib/commonjs/tab-bar/types.js +6 -0
- package/lib/commonjs/tab-bar/types.js.map +1 -0
- package/lib/commonjs/toast/Positioner.js +117 -0
- package/lib/commonjs/toast/Positioner.js.map +1 -0
- package/lib/commonjs/toast/ToastContent.js +301 -0
- package/lib/commonjs/toast/ToastContent.js.map +1 -0
- package/lib/commonjs/toast/ToastHost.js +69 -0
- package/lib/commonjs/toast/ToastHost.js.map +1 -0
- package/lib/commonjs/toast/ToastHost.native.js +44 -0
- package/lib/commonjs/toast/ToastHost.native.js.map +1 -0
- package/lib/commonjs/toast/ToastIcon.js +57 -0
- package/lib/commonjs/toast/ToastIcon.js.map +1 -0
- package/lib/commonjs/toast/ToastRow.js +411 -0
- package/lib/commonjs/toast/ToastRow.js.map +1 -0
- package/lib/commonjs/toast/ToastSwipeHandler.js +189 -0
- package/lib/commonjs/toast/ToastSwipeHandler.js.map +1 -0
- package/lib/commonjs/toast/Toaster.js +205 -0
- package/lib/commonjs/toast/Toaster.js.map +1 -0
- package/lib/commonjs/toast/animations.js +274 -0
- package/lib/commonjs/toast/animations.js.map +1 -0
- package/lib/commonjs/toast/constants.js +56 -0
- package/lib/commonjs/toast/constants.js.map +1 -0
- package/lib/commonjs/toast/context.js +42 -0
- package/lib/commonjs/toast/context.js.map +1 -0
- package/lib/commonjs/toast/index.js +32 -126
- package/lib/commonjs/toast/index.js.map +1 -1
- package/lib/commonjs/toast/position-utils.js +115 -0
- package/lib/commonjs/toast/position-utils.js.map +1 -0
- package/lib/commonjs/toast/positioner-utils.js +141 -0
- package/lib/commonjs/toast/positioner-utils.js.map +1 -0
- package/lib/commonjs/toast/toast-comparator.js +28 -0
- package/lib/commonjs/toast/toast-comparator.js.map +1 -0
- package/lib/commonjs/toast/toast-fns.js +90 -0
- package/lib/commonjs/toast/toast-fns.js.map +1 -0
- package/lib/commonjs/toast/toast-store.js +352 -0
- package/lib/commonjs/toast/toast-store.js.map +1 -0
- package/lib/commonjs/toast/toast-timers.js +110 -0
- package/lib/commonjs/toast/toast-timers.js.map +1 -0
- package/lib/commonjs/toast/types.js +42 -0
- package/lib/commonjs/toast/types.js.map +1 -1
- package/lib/commonjs/toast/use-animated-target.js +57 -0
- package/lib/commonjs/toast/use-animated-target.js.map +1 -0
- package/lib/commonjs/toast/use-app-state.js +76 -0
- package/lib/commonjs/toast/use-app-state.js.map +1 -0
- package/lib/commonjs/toast/use-toast-colors.js +114 -0
- package/lib/commonjs/toast/use-toast-colors.js.map +1 -0
- package/lib/commonjs/toast/use-toast-position.js +40 -0
- package/lib/commonjs/toast/use-toast-position.js.map +1 -0
- package/lib/commonjs/tooltip/index.web.js +2 -1
- package/lib/commonjs/tooltip/index.web.js.map +1 -1
- package/lib/commonjs/zoomable-image-gallery/ZoomableImageGallery.js +20 -8
- package/lib/commonjs/zoomable-image-gallery/ZoomableImageGallery.js.map +1 -1
- package/lib/module/avatar-group/AvatarGroup.web.js +2 -1
- package/lib/module/avatar-group/AvatarGroup.web.js.map +1 -1
- package/lib/module/bottom-sheet/index.web.js +2 -1
- package/lib/module/bottom-sheet/index.web.js.map +1 -1
- package/lib/module/context-menu/index.web.js +3 -2
- package/lib/module/context-menu/index.web.js.map +1 -1
- package/lib/module/dialog/Dialog.web.js +4 -3
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- package/lib/module/index.js +3 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +3 -2
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/menu/index.web.js +2 -1
- package/lib/module/menu/index.web.js.map +1 -1
- package/lib/module/popover/index.web.js +3 -2
- package/lib/module/popover/index.web.js.map +1 -1
- package/lib/module/portal/index.js +4 -1
- package/lib/module/portal/index.js.map +1 -1
- package/lib/module/progressive-blur/index.js +74 -0
- package/lib/module/progressive-blur/index.js.map +1 -0
- package/lib/module/progressive-blur/index.web.js +62 -0
- package/lib/module/progressive-blur/index.web.js.map +1 -0
- package/lib/module/progressive-blur/shared.js +60 -0
- package/lib/module/progressive-blur/shared.js.map +1 -0
- package/lib/module/progressive-blur/types.js +4 -0
- package/lib/module/progressive-blur/types.js.map +1 -0
- package/lib/module/select/index.web.js +2 -1
- package/lib/module/select/index.web.js.map +1 -1
- package/lib/module/styles/web-view-style.js +22 -0
- package/lib/module/styles/web-view-style.js.map +1 -0
- package/lib/module/tab-bar/TabBarBase.js +408 -0
- package/lib/module/tab-bar/TabBarBase.js.map +1 -0
- package/lib/module/tab-bar/expo-router/RouterTabBar.js +78 -0
- package/lib/module/tab-bar/expo-router/RouterTabBar.js.map +1 -0
- package/lib/module/tab-bar/expo-router/fading-tab-screen.js +113 -0
- package/lib/module/tab-bar/expo-router/fading-tab-screen.js.map +1 -0
- package/lib/module/tab-bar/expo-router/index.js +15 -0
- package/lib/module/tab-bar/expo-router/index.js.map +1 -0
- package/lib/module/tab-bar/glyph.js +38 -0
- package/lib/module/tab-bar/glyph.js.map +1 -0
- package/lib/module/tab-bar/glyph.native.js +50 -0
- package/lib/module/tab-bar/glyph.native.js.map +1 -0
- package/lib/module/tab-bar/index.js +24 -0
- package/lib/module/tab-bar/index.js.map +1 -0
- package/lib/module/tab-bar/index.web.js +26 -0
- package/lib/module/tab-bar/index.web.js.map +1 -0
- package/lib/module/tab-bar/minimize-context.js +118 -0
- package/lib/module/tab-bar/minimize-context.js.map +1 -0
- package/lib/module/tab-bar/shared.js +132 -0
- package/lib/module/tab-bar/shared.js.map +1 -0
- package/lib/module/tab-bar/surface.js +44 -0
- package/lib/module/tab-bar/surface.js.map +1 -0
- package/lib/module/tab-bar/surface.native.js +50 -0
- package/lib/module/tab-bar/surface.native.js.map +1 -0
- package/lib/module/tab-bar/surface.web.js +53 -0
- package/lib/module/tab-bar/surface.web.js.map +1 -0
- package/lib/module/tab-bar/types.js +4 -0
- package/lib/module/tab-bar/types.js.map +1 -0
- package/lib/module/toast/Positioner.js +110 -0
- package/lib/module/toast/Positioner.js.map +1 -0
- package/lib/module/toast/ToastContent.js +295 -0
- package/lib/module/toast/ToastContent.js.map +1 -0
- package/lib/module/toast/ToastHost.js +63 -0
- package/lib/module/toast/ToastHost.js.map +1 -0
- package/lib/module/toast/ToastHost.native.js +38 -0
- package/lib/module/toast/ToastHost.native.js.map +1 -0
- package/lib/module/toast/ToastIcon.js +52 -0
- package/lib/module/toast/ToastIcon.js.map +1 -0
- package/lib/module/toast/ToastRow.js +407 -0
- package/lib/module/toast/ToastRow.js.map +1 -0
- package/lib/module/toast/ToastSwipeHandler.js +182 -0
- package/lib/module/toast/ToastSwipeHandler.js.map +1 -0
- package/lib/module/toast/Toaster.js +198 -0
- package/lib/module/toast/Toaster.js.map +1 -0
- package/lib/module/toast/animations.js +261 -0
- package/lib/module/toast/animations.js.map +1 -0
- package/lib/module/toast/constants.js +52 -0
- package/lib/module/toast/constants.js.map +1 -0
- package/lib/module/toast/context.js +34 -0
- package/lib/module/toast/context.js.map +1 -0
- package/lib/module/toast/index.js +27 -103
- package/lib/module/toast/index.js.map +1 -1
- package/lib/module/toast/position-utils.js +107 -0
- package/lib/module/toast/position-utils.js.map +1 -0
- package/lib/module/toast/positioner-utils.js +134 -0
- package/lib/module/toast/positioner-utils.js.map +1 -0
- package/lib/module/toast/toast-comparator.js +22 -0
- package/lib/module/toast/toast-comparator.js.map +1 -0
- package/lib/module/toast/toast-fns.js +85 -0
- package/lib/module/toast/toast-fns.js.map +1 -0
- package/lib/module/toast/toast-store.js +346 -0
- package/lib/module/toast/toast-store.js.map +1 -0
- package/lib/module/toast/toast-timers.js +104 -0
- package/lib/module/toast/toast-timers.js.map +1 -0
- package/lib/module/toast/types.js +38 -0
- package/lib/module/toast/types.js.map +1 -1
- package/lib/module/toast/use-animated-target.js +52 -0
- package/lib/module/toast/use-animated-target.js.map +1 -0
- package/lib/module/toast/use-app-state.js +70 -0
- package/lib/module/toast/use-app-state.js.map +1 -0
- package/lib/module/toast/use-toast-colors.js +109 -0
- package/lib/module/toast/use-toast-colors.js.map +1 -0
- package/lib/module/toast/use-toast-position.js +35 -0
- package/lib/module/toast/use-toast-position.js.map +1 -0
- package/lib/module/tooltip/index.web.js +2 -1
- package/lib/module/tooltip/index.web.js.map +1 -1
- package/lib/module/zoomable-image-gallery/ZoomableImageGallery.js +20 -8
- package/lib/module/zoomable-image-gallery/ZoomableImageGallery.js.map +1 -1
- package/lib/typescript/commonjs/avatar-group/AvatarGroup.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/context-menu/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +2 -1
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/menu/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/popover/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/portal/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/progressive-blur/index.d.ts +23 -0
- package/lib/typescript/commonjs/progressive-blur/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/progressive-blur/index.web.d.ts +30 -0
- package/lib/typescript/commonjs/progressive-blur/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/progressive-blur/shared.d.ts +35 -0
- package/lib/typescript/commonjs/progressive-blur/shared.d.ts.map +1 -0
- package/lib/typescript/commonjs/progressive-blur/types.d.ts +21 -0
- package/lib/typescript/commonjs/progressive-blur/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/select/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/styles/web-view-style.d.ts +21 -0
- package/lib/typescript/commonjs/styles/web-view-style.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/TabBarBase.d.ts +36 -0
- package/lib/typescript/commonjs/tab-bar/TabBarBase.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/expo-router/RouterTabBar.d.ts +59 -0
- package/lib/typescript/commonjs/tab-bar/expo-router/RouterTabBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/expo-router/fading-tab-screen.d.ts +11 -0
- package/lib/typescript/commonjs/tab-bar/expo-router/fading-tab-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/expo-router/index.d.ts +14 -0
- package/lib/typescript/commonjs/tab-bar/expo-router/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/glyph.d.ts +6 -0
- package/lib/typescript/commonjs/tab-bar/glyph.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/glyph.native.d.ts +6 -0
- package/lib/typescript/commonjs/tab-bar/glyph.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/index.d.ts +12 -0
- package/lib/typescript/commonjs/tab-bar/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/index.web.d.ts +12 -0
- package/lib/typescript/commonjs/tab-bar/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/minimize-context.d.ts +51 -0
- package/lib/typescript/commonjs/tab-bar/minimize-context.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/shared.d.ts +93 -0
- package/lib/typescript/commonjs/tab-bar/shared.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/surface.d.ts +6 -0
- package/lib/typescript/commonjs/tab-bar/surface.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/surface.native.d.ts +6 -0
- package/lib/typescript/commonjs/tab-bar/surface.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/surface.web.d.ts +6 -0
- package/lib/typescript/commonjs/tab-bar/surface.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/types.d.ts +85 -0
- package/lib/typescript/commonjs/tab-bar/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/Positioner.d.ts +21 -0
- package/lib/typescript/commonjs/toast/Positioner.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/ToastContent.d.ts +14 -0
- package/lib/typescript/commonjs/toast/ToastContent.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/ToastHost.d.ts +6 -0
- package/lib/typescript/commonjs/toast/ToastHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/ToastHost.native.d.ts +6 -0
- package/lib/typescript/commonjs/toast/ToastHost.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/ToastIcon.d.ts +9 -0
- package/lib/typescript/commonjs/toast/ToastIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/ToastRow.d.ts +80 -0
- package/lib/typescript/commonjs/toast/ToastRow.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/ToastSwipeHandler.d.ts +30 -0
- package/lib/typescript/commonjs/toast/ToastSwipeHandler.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/Toaster.d.ts +19 -0
- package/lib/typescript/commonjs/toast/Toaster.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/animations.d.ts +62 -0
- package/lib/typescript/commonjs/toast/animations.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/constants.d.ts +39 -0
- package/lib/typescript/commonjs/toast/constants.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/context.d.ts +19 -0
- package/lib/typescript/commonjs/toast/context.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/index.d.ts +23 -76
- package/lib/typescript/commonjs/toast/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/position-utils.d.ts +30 -0
- package/lib/typescript/commonjs/toast/position-utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/positioner-utils.d.ts +72 -0
- package/lib/typescript/commonjs/toast/positioner-utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/toast-comparator.d.ts +12 -0
- package/lib/typescript/commonjs/toast/toast-comparator.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/toast-fns.d.ts +3 -0
- package/lib/typescript/commonjs/toast/toast-fns.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/toast-store.d.ts +52 -0
- package/lib/typescript/commonjs/toast/toast-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/toast-timers.d.ts +24 -0
- package/lib/typescript/commonjs/toast/toast-timers.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/types.d.ts +222 -5
- package/lib/typescript/commonjs/toast/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/use-animated-target.d.ts +7 -0
- package/lib/typescript/commonjs/toast/use-animated-target.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/use-app-state.d.ts +18 -0
- package/lib/typescript/commonjs/toast/use-app-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/use-toast-colors.d.ts +22 -0
- package/lib/typescript/commonjs/toast/use-toast-colors.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/use-toast-position.d.ts +37 -0
- package/lib/typescript/commonjs/toast/use-toast-position.d.ts.map +1 -0
- package/lib/typescript/commonjs/tooltip/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/zoomable-image-gallery/ZoomableImageGallery.d.ts.map +1 -1
- package/lib/typescript/module/avatar-group/AvatarGroup.web.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/index.web.d.ts.map +1 -1
- package/lib/typescript/module/context-menu/index.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +2 -1
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/menu/index.web.d.ts.map +1 -1
- package/lib/typescript/module/popover/index.web.d.ts.map +1 -1
- package/lib/typescript/module/portal/index.d.ts.map +1 -1
- package/lib/typescript/module/progressive-blur/index.d.ts +23 -0
- package/lib/typescript/module/progressive-blur/index.d.ts.map +1 -0
- package/lib/typescript/module/progressive-blur/index.web.d.ts +30 -0
- package/lib/typescript/module/progressive-blur/index.web.d.ts.map +1 -0
- package/lib/typescript/module/progressive-blur/shared.d.ts +35 -0
- package/lib/typescript/module/progressive-blur/shared.d.ts.map +1 -0
- package/lib/typescript/module/progressive-blur/types.d.ts +21 -0
- package/lib/typescript/module/progressive-blur/types.d.ts.map +1 -0
- package/lib/typescript/module/select/index.web.d.ts.map +1 -1
- package/lib/typescript/module/styles/web-view-style.d.ts +21 -0
- package/lib/typescript/module/styles/web-view-style.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/TabBarBase.d.ts +36 -0
- package/lib/typescript/module/tab-bar/TabBarBase.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/expo-router/RouterTabBar.d.ts +59 -0
- package/lib/typescript/module/tab-bar/expo-router/RouterTabBar.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/expo-router/fading-tab-screen.d.ts +11 -0
- package/lib/typescript/module/tab-bar/expo-router/fading-tab-screen.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/expo-router/index.d.ts +14 -0
- package/lib/typescript/module/tab-bar/expo-router/index.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/glyph.d.ts +6 -0
- package/lib/typescript/module/tab-bar/glyph.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/glyph.native.d.ts +6 -0
- package/lib/typescript/module/tab-bar/glyph.native.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/index.d.ts +12 -0
- package/lib/typescript/module/tab-bar/index.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/index.web.d.ts +12 -0
- package/lib/typescript/module/tab-bar/index.web.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/minimize-context.d.ts +51 -0
- package/lib/typescript/module/tab-bar/minimize-context.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/shared.d.ts +93 -0
- package/lib/typescript/module/tab-bar/shared.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/surface.d.ts +6 -0
- package/lib/typescript/module/tab-bar/surface.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/surface.native.d.ts +6 -0
- package/lib/typescript/module/tab-bar/surface.native.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/surface.web.d.ts +6 -0
- package/lib/typescript/module/tab-bar/surface.web.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/types.d.ts +85 -0
- package/lib/typescript/module/tab-bar/types.d.ts.map +1 -0
- package/lib/typescript/module/toast/Positioner.d.ts +21 -0
- package/lib/typescript/module/toast/Positioner.d.ts.map +1 -0
- package/lib/typescript/module/toast/ToastContent.d.ts +14 -0
- package/lib/typescript/module/toast/ToastContent.d.ts.map +1 -0
- package/lib/typescript/module/toast/ToastHost.d.ts +6 -0
- package/lib/typescript/module/toast/ToastHost.d.ts.map +1 -0
- package/lib/typescript/module/toast/ToastHost.native.d.ts +6 -0
- package/lib/typescript/module/toast/ToastHost.native.d.ts.map +1 -0
- package/lib/typescript/module/toast/ToastIcon.d.ts +9 -0
- package/lib/typescript/module/toast/ToastIcon.d.ts.map +1 -0
- package/lib/typescript/module/toast/ToastRow.d.ts +80 -0
- package/lib/typescript/module/toast/ToastRow.d.ts.map +1 -0
- package/lib/typescript/module/toast/ToastSwipeHandler.d.ts +30 -0
- package/lib/typescript/module/toast/ToastSwipeHandler.d.ts.map +1 -0
- package/lib/typescript/module/toast/Toaster.d.ts +19 -0
- package/lib/typescript/module/toast/Toaster.d.ts.map +1 -0
- package/lib/typescript/module/toast/animations.d.ts +62 -0
- package/lib/typescript/module/toast/animations.d.ts.map +1 -0
- package/lib/typescript/module/toast/constants.d.ts +39 -0
- package/lib/typescript/module/toast/constants.d.ts.map +1 -0
- package/lib/typescript/module/toast/context.d.ts +19 -0
- package/lib/typescript/module/toast/context.d.ts.map +1 -0
- package/lib/typescript/module/toast/index.d.ts +23 -76
- package/lib/typescript/module/toast/index.d.ts.map +1 -1
- package/lib/typescript/module/toast/position-utils.d.ts +30 -0
- package/lib/typescript/module/toast/position-utils.d.ts.map +1 -0
- package/lib/typescript/module/toast/positioner-utils.d.ts +72 -0
- package/lib/typescript/module/toast/positioner-utils.d.ts.map +1 -0
- package/lib/typescript/module/toast/toast-comparator.d.ts +12 -0
- package/lib/typescript/module/toast/toast-comparator.d.ts.map +1 -0
- package/lib/typescript/module/toast/toast-fns.d.ts +3 -0
- package/lib/typescript/module/toast/toast-fns.d.ts.map +1 -0
- package/lib/typescript/module/toast/toast-store.d.ts +52 -0
- package/lib/typescript/module/toast/toast-store.d.ts.map +1 -0
- package/lib/typescript/module/toast/toast-timers.d.ts +24 -0
- package/lib/typescript/module/toast/toast-timers.d.ts.map +1 -0
- package/lib/typescript/module/toast/types.d.ts +222 -5
- package/lib/typescript/module/toast/types.d.ts.map +1 -1
- package/lib/typescript/module/toast/use-animated-target.d.ts +7 -0
- package/lib/typescript/module/toast/use-animated-target.d.ts.map +1 -0
- package/lib/typescript/module/toast/use-app-state.d.ts +18 -0
- package/lib/typescript/module/toast/use-app-state.d.ts.map +1 -0
- package/lib/typescript/module/toast/use-toast-colors.d.ts +22 -0
- package/lib/typescript/module/toast/use-toast-colors.d.ts.map +1 -0
- package/lib/typescript/module/toast/use-toast-position.d.ts +37 -0
- package/lib/typescript/module/toast/use-toast-position.d.ts.map +1 -0
- package/lib/typescript/module/tooltip/index.web.d.ts.map +1 -1
- package/lib/typescript/module/zoomable-image-gallery/ZoomableImageGallery.d.ts.map +1 -1
- package/package.json +63 -25
- package/src/__tests__/TabBar.test.tsx +342 -0
- package/src/__tests__/TabBarReanimatedDeps.test.ts +130 -0
- package/src/__tests__/TabBarWebFork.test.ts +197 -0
- package/src/__tests__/ToastContent.test.tsx +192 -0
- package/src/__tests__/ToastHostWebFork.test.ts +155 -0
- package/src/__tests__/Toaster.test.tsx +527 -0
- package/src/__tests__/animated-style-deps.test.ts +156 -0
- package/src/__tests__/toast-animations.test.ts +98 -0
- package/src/__tests__/toast-comparator.test.ts +131 -0
- package/src/__tests__/toast-enter-driver.test.ts +147 -0
- package/src/__tests__/toast-fns.test.ts +240 -0
- package/src/__tests__/toast-position-utils.test.ts +259 -0
- package/src/__tests__/toast-positioner-utils.test.ts +214 -0
- package/src/__tests__/toast-store.test.ts +622 -0
- package/src/__tests__/toast-timers.test.ts +163 -0
- package/src/__tests__/use-animated-target.test.tsx +60 -0
- package/src/__tests__/use-app-state.test.tsx +127 -0
- package/src/__tests__/use-toast-colors.test.tsx +189 -0
- package/src/__tests__/web-position-fixed.test.ts +70 -0
- package/src/avatar-group/AvatarGroup.web.tsx +2 -1
- package/src/bottom-sheet/index.web.tsx +3 -2
- package/src/context-menu/index.web.tsx +3 -2
- package/src/dialog/Dialog.web.tsx +4 -3
- package/src/index.ts +4 -1
- package/src/index.web.ts +4 -1
- package/src/menu/index.web.tsx +2 -1
- package/src/popover/index.web.tsx +3 -2
- package/src/portal/index.tsx +4 -1
- package/src/progressive-blur/index.tsx +78 -0
- package/src/progressive-blur/index.web.tsx +65 -0
- package/src/progressive-blur/shared.ts +81 -0
- package/src/progressive-blur/types.ts +21 -0
- package/src/select/index.web.tsx +2 -1
- package/src/styles/web-view-style.ts +21 -0
- package/src/tab-bar/TabBar.stories.tsx +217 -0
- package/src/tab-bar/TabBarBase.tsx +517 -0
- package/src/tab-bar/expo-router/RouterTabBar.tsx +80 -0
- package/src/tab-bar/expo-router/fading-tab-screen.tsx +109 -0
- package/src/tab-bar/expo-router/index.ts +13 -0
- package/src/tab-bar/glyph.native.tsx +46 -0
- package/src/tab-bar/glyph.tsx +31 -0
- package/src/tab-bar/index.ts +32 -0
- package/src/tab-bar/index.web.tsx +34 -0
- package/src/tab-bar/minimize-context.tsx +117 -0
- package/src/tab-bar/shared.ts +159 -0
- package/src/tab-bar/surface.native.tsx +60 -0
- package/src/tab-bar/surface.tsx +47 -0
- package/src/tab-bar/surface.web.tsx +56 -0
- package/src/tab-bar/types.ts +88 -0
- package/src/toast/Positioner.tsx +121 -0
- package/src/toast/Toast.stories.tsx +292 -65
- package/src/toast/ToastContent.tsx +405 -0
- package/src/toast/ToastHost.native.tsx +31 -0
- package/src/toast/ToastHost.tsx +67 -0
- package/src/toast/ToastIcon.tsx +55 -0
- package/src/toast/ToastRow.tsx +485 -0
- package/src/toast/ToastSwipeHandler.tsx +222 -0
- package/src/toast/Toaster.tsx +259 -0
- package/src/toast/animations.ts +313 -0
- package/src/toast/constants.ts +76 -0
- package/src/toast/context.tsx +44 -0
- package/src/toast/index.tsx +47 -123
- package/src/toast/position-utils.ts +149 -0
- package/src/toast/positioner-utils.ts +142 -0
- package/src/toast/toast-comparator.ts +41 -0
- package/src/toast/toast-fns.ts +104 -0
- package/src/toast/toast-store.ts +432 -0
- package/src/toast/toast-timers.ts +124 -0
- package/src/toast/types.ts +301 -5
- package/src/toast/use-animated-target.ts +61 -0
- package/src/toast/use-app-state.ts +77 -0
- package/src/toast/use-toast-colors.ts +133 -0
- package/src/toast/use-toast-position.ts +46 -0
- package/src/tooltip/index.web.tsx +2 -1
- package/src/zoomable-image-gallery/ZoomableImageGallery.stories.tsx +134 -0
- package/src/zoomable-image-gallery/ZoomableImageGallery.tsx +50 -27
- package/lib/commonjs/toast/Toast.js +0 -267
- package/lib/commonjs/toast/Toast.js.map +0 -1
- package/lib/commonjs/toast/const.js +0 -8
- package/lib/commonjs/toast/const.js.map +0 -1
- package/lib/commonjs/toast/index.web.js +0 -114
- package/lib/commonjs/toast/index.web.js.map +0 -1
- package/lib/commonjs/toast/sonner/index.js +0 -9
- package/lib/commonjs/toast/sonner/index.js.map +0 -1
- package/lib/commonjs/toast/sonner/index.web.js +0 -9
- package/lib/commonjs/toast/sonner/index.web.js.map +0 -1
- package/lib/module/toast/Toast.js +0 -258
- package/lib/module/toast/Toast.js.map +0 -1
- package/lib/module/toast/const.js +0 -4
- package/lib/module/toast/const.js.map +0 -1
- package/lib/module/toast/index.web.js +0 -74
- package/lib/module/toast/index.web.js.map +0 -1
- package/lib/module/toast/sonner/index.js +0 -5
- package/lib/module/toast/sonner/index.js.map +0 -1
- package/lib/module/toast/sonner/index.web.js +0 -5
- package/lib/module/toast/sonner/index.web.js.map +0 -1
- package/lib/typescript/commonjs/toast/Toast.d.ts +0 -23
- package/lib/typescript/commonjs/toast/Toast.d.ts.map +0 -1
- package/lib/typescript/commonjs/toast/const.d.ts +0 -2
- package/lib/typescript/commonjs/toast/const.d.ts.map +0 -1
- package/lib/typescript/commonjs/toast/index.web.d.ts +0 -29
- package/lib/typescript/commonjs/toast/index.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/toast/sonner/index.d.ts +0 -2
- package/lib/typescript/commonjs/toast/sonner/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/toast/sonner/index.web.d.ts +0 -2
- package/lib/typescript/commonjs/toast/sonner/index.web.d.ts.map +0 -1
- package/lib/typescript/module/toast/Toast.d.ts +0 -23
- package/lib/typescript/module/toast/Toast.d.ts.map +0 -1
- package/lib/typescript/module/toast/const.d.ts +0 -2
- package/lib/typescript/module/toast/const.d.ts.map +0 -1
- package/lib/typescript/module/toast/index.web.d.ts +0 -29
- package/lib/typescript/module/toast/index.web.d.ts.map +0 -1
- package/lib/typescript/module/toast/sonner/index.d.ts +0 -2
- package/lib/typescript/module/toast/sonner/index.d.ts.map +0 -1
- package/lib/typescript/module/toast/sonner/index.web.d.ts +0 -2
- package/lib/typescript/module/toast/sonner/index.web.d.ts.map +0 -1
- package/src/toast/Toast.tsx +0 -269
- package/src/toast/const.ts +0 -1
- package/src/toast/index.web.tsx +0 -101
- package/src/toast/sonner/index.ts +0 -3
- package/src/toast/sonner/index.web.ts +0 -3
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { ToastTimerRegistry } from '../toast/toast-timers';
|
|
2
|
+
import { ENTERING_ANIMATION_DURATION } from '../toast/constants';
|
|
3
|
+
|
|
4
|
+
describe('ToastTimerRegistry', () => {
|
|
5
|
+
let timers: ToastTimerRegistry;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
jest.useFakeTimers();
|
|
9
|
+
timers = new ToastTimerRegistry();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
timers.clearAll();
|
|
14
|
+
jest.useRealTimers();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('fires after the enter animation plus the duration', () => {
|
|
18
|
+
const onComplete = jest.fn();
|
|
19
|
+
timers.start({ id: 1, duration: 4000, onComplete });
|
|
20
|
+
|
|
21
|
+
jest.advanceTimersByTime(ENTERING_ANIMATION_DURATION + 3999);
|
|
22
|
+
expect(onComplete).not.toHaveBeenCalled();
|
|
23
|
+
|
|
24
|
+
jest.advanceTimersByTime(1);
|
|
25
|
+
expect(onComplete).toHaveBeenCalledTimes(1);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('never starts a timer for a non-finite duration', () => {
|
|
29
|
+
const onComplete = jest.fn();
|
|
30
|
+
timers.start({ id: 'infinite', duration: Infinity, onComplete });
|
|
31
|
+
timers.start({ id: 'nan', duration: Number.NaN, onComplete });
|
|
32
|
+
|
|
33
|
+
jest.advanceTimersByTime(1_000_000);
|
|
34
|
+
expect(onComplete).not.toHaveBeenCalled();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('clear stops a pending timer', () => {
|
|
38
|
+
const onComplete = jest.fn();
|
|
39
|
+
timers.start({ id: 1, duration: 1000, onComplete });
|
|
40
|
+
timers.clear(1);
|
|
41
|
+
|
|
42
|
+
jest.advanceTimersByTime(1_000_000);
|
|
43
|
+
expect(onComplete).not.toHaveBeenCalled();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('clearAll stops every pending timer', () => {
|
|
47
|
+
const first = jest.fn();
|
|
48
|
+
const second = jest.fn();
|
|
49
|
+
timers.start({ id: 'a', duration: 1000, onComplete: first });
|
|
50
|
+
timers.start({ id: 'b', duration: 1000, onComplete: second });
|
|
51
|
+
|
|
52
|
+
timers.clearAll();
|
|
53
|
+
jest.advanceTimersByTime(1_000_000);
|
|
54
|
+
|
|
55
|
+
expect(first).not.toHaveBeenCalled();
|
|
56
|
+
expect(second).not.toHaveBeenCalled();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('restarting an id replaces the previous timer instead of stacking one', () => {
|
|
60
|
+
const onComplete = jest.fn();
|
|
61
|
+
timers.start({ id: 1, duration: 1000, onComplete });
|
|
62
|
+
jest.advanceTimersByTime(500);
|
|
63
|
+
timers.start({ id: 1, duration: 1000, onComplete });
|
|
64
|
+
|
|
65
|
+
jest.advanceTimersByTime(1_000_000);
|
|
66
|
+
expect(onComplete).toHaveBeenCalledTimes(1);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('pause banks the remaining time and resume runs only that remainder', () => {
|
|
70
|
+
const onComplete = jest.fn();
|
|
71
|
+
timers.start({ id: 1, duration: 4000, onComplete });
|
|
72
|
+
|
|
73
|
+
jest.advanceTimersByTime(1000);
|
|
74
|
+
timers.pause(1);
|
|
75
|
+
|
|
76
|
+
// Paused timers must survive an arbitrarily long background stint.
|
|
77
|
+
jest.advanceTimersByTime(1_000_000);
|
|
78
|
+
expect(onComplete).not.toHaveBeenCalled();
|
|
79
|
+
|
|
80
|
+
timers.resume(1);
|
|
81
|
+
jest.advanceTimersByTime(2999);
|
|
82
|
+
expect(onComplete).not.toHaveBeenCalled();
|
|
83
|
+
|
|
84
|
+
jest.advanceTimersByTime(1);
|
|
85
|
+
expect(onComplete).toHaveBeenCalledTimes(1);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it('gives a resumed toast at least one second, however little was left', () => {
|
|
89
|
+
const onComplete = jest.fn();
|
|
90
|
+
timers.start({ id: 1, duration: 4000, onComplete });
|
|
91
|
+
|
|
92
|
+
jest.advanceTimersByTime(3900);
|
|
93
|
+
timers.pause(1);
|
|
94
|
+
timers.resume(1);
|
|
95
|
+
|
|
96
|
+
jest.advanceTimersByTime(999);
|
|
97
|
+
expect(onComplete).not.toHaveBeenCalled();
|
|
98
|
+
|
|
99
|
+
jest.advanceTimersByTime(1);
|
|
100
|
+
expect(onComplete).toHaveBeenCalledTimes(1);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('pausing twice does not double-subtract the elapsed time', () => {
|
|
104
|
+
const onComplete = jest.fn();
|
|
105
|
+
timers.start({ id: 1, duration: 4000, onComplete });
|
|
106
|
+
|
|
107
|
+
jest.advanceTimersByTime(1000);
|
|
108
|
+
timers.pause(1);
|
|
109
|
+
jest.advanceTimersByTime(1000);
|
|
110
|
+
timers.pause(1);
|
|
111
|
+
|
|
112
|
+
timers.resume(1);
|
|
113
|
+
jest.advanceTimersByTime(2999);
|
|
114
|
+
expect(onComplete).not.toHaveBeenCalled();
|
|
115
|
+
jest.advanceTimersByTime(1);
|
|
116
|
+
expect(onComplete).toHaveBeenCalledTimes(1);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('resume is a no-op for an unknown or running timer', () => {
|
|
120
|
+
const onComplete = jest.fn();
|
|
121
|
+
timers.start({ id: 1, duration: 4000, onComplete });
|
|
122
|
+
|
|
123
|
+
timers.resume('unknown');
|
|
124
|
+
// Still running (not paused) — resume must not restart the clock.
|
|
125
|
+
timers.resume(1);
|
|
126
|
+
|
|
127
|
+
jest.advanceTimersByTime(ENTERING_ANIMATION_DURATION + 4000);
|
|
128
|
+
expect(onComplete).toHaveBeenCalledTimes(1);
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it('pauseAll / resumeAll cover every registered timer', () => {
|
|
132
|
+
const first = jest.fn();
|
|
133
|
+
const second = jest.fn();
|
|
134
|
+
timers.start({ id: 'a', duration: 4000, onComplete: first });
|
|
135
|
+
timers.start({ id: 'b', duration: 6000, onComplete: second });
|
|
136
|
+
|
|
137
|
+
jest.advanceTimersByTime(1000);
|
|
138
|
+
timers.pauseAll();
|
|
139
|
+
jest.advanceTimersByTime(1_000_000);
|
|
140
|
+
expect(first).not.toHaveBeenCalled();
|
|
141
|
+
expect(second).not.toHaveBeenCalled();
|
|
142
|
+
|
|
143
|
+
timers.resumeAll();
|
|
144
|
+
jest.advanceTimersByTime(3000);
|
|
145
|
+
expect(first).toHaveBeenCalledTimes(1);
|
|
146
|
+
expect(second).not.toHaveBeenCalled();
|
|
147
|
+
|
|
148
|
+
jest.advanceTimersByTime(2000);
|
|
149
|
+
expect(second).toHaveBeenCalledTimes(1);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('drops the record once a timer has fired, so resume cannot revive it', () => {
|
|
153
|
+
const onComplete = jest.fn();
|
|
154
|
+
timers.start({ id: 1, duration: 1000, onComplete });
|
|
155
|
+
jest.advanceTimersByTime(ENTERING_ANIMATION_DURATION + 1000);
|
|
156
|
+
expect(onComplete).toHaveBeenCalledTimes(1);
|
|
157
|
+
|
|
158
|
+
timers.pause(1);
|
|
159
|
+
timers.resume(1);
|
|
160
|
+
jest.advanceTimersByTime(1_000_000);
|
|
161
|
+
expect(onComplete).toHaveBeenCalledTimes(1);
|
|
162
|
+
});
|
|
163
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { act, renderHook } from '@testing-library/react-native';
|
|
2
|
+
import { Easing } from 'react-native-reanimated';
|
|
3
|
+
|
|
4
|
+
import { useAnimatedTarget } from '../toast/use-animated-target';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The point of this hook is WHERE the animation starts: assigned from JS, never
|
|
8
|
+
* returned from a mapper (which does not tick on web). That distinction is not
|
|
9
|
+
* observable under the reanimated test mock — it resolves `withTiming` straight
|
|
10
|
+
* to its destination — so it is guarded by the source assertion in
|
|
11
|
+
* `ToastHostWebFork.test.ts` and verified for real in a browser. What these tests
|
|
12
|
+
* pin is the value contract the row depends on.
|
|
13
|
+
*/
|
|
14
|
+
const CONFIG = { duration: 600, easing: Easing.linear };
|
|
15
|
+
|
|
16
|
+
describe('useAnimatedTarget', () => {
|
|
17
|
+
it('starts at the initial target rather than at zero', () => {
|
|
18
|
+
const { result } = renderHook(() => useAnimatedTarget(120, CONFIG));
|
|
19
|
+
expect(result.current.value).toBe(120);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('animates toward a changed target', () => {
|
|
23
|
+
const { result, rerender } = renderHook(
|
|
24
|
+
({ target }: { target: number }) => useAnimatedTarget(target, CONFIG),
|
|
25
|
+
{ initialProps: { target: 0 } },
|
|
26
|
+
);
|
|
27
|
+
expect(result.current.value).toBe(0);
|
|
28
|
+
|
|
29
|
+
act(() => {
|
|
30
|
+
rerender({ target: -140 });
|
|
31
|
+
});
|
|
32
|
+
// The reanimated test mock resolves withTiming to its destination value.
|
|
33
|
+
expect(result.current.value).toBe(-140);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('keeps the same shared value across renders', () => {
|
|
37
|
+
const { result, rerender } = renderHook(
|
|
38
|
+
({ target }: { target: number }) => useAnimatedTarget(target, CONFIG),
|
|
39
|
+
{ initialProps: { target: 0 } },
|
|
40
|
+
);
|
|
41
|
+
const first = result.current;
|
|
42
|
+
|
|
43
|
+
act(() => {
|
|
44
|
+
rerender({ target: 10 });
|
|
45
|
+
});
|
|
46
|
+
expect(result.current).toBe(first);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('does not re-assign when the target is unchanged', () => {
|
|
50
|
+
const { result, rerender } = renderHook(
|
|
51
|
+
({ target }: { target: number }) => useAnimatedTarget(target, CONFIG),
|
|
52
|
+
{ initialProps: { target: 42 } },
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
act(() => {
|
|
56
|
+
rerender({ target: 42 });
|
|
57
|
+
});
|
|
58
|
+
expect(result.current.value).toBe(42);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { AppState, type AppStateStatus } from 'react-native';
|
|
2
|
+
import { act, renderHook } from '@testing-library/react-native';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
subscribeToAppState,
|
|
6
|
+
useAppStateChange,
|
|
7
|
+
} from '../toast/use-app-state';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Both platform branches matter: RN-Web reports `AppState.isAvailable === false`
|
|
11
|
+
* during prerender (no document to listen to), where upstream's unconditional
|
|
12
|
+
* subscribe + `subscription.remove()` on unmount throws a `TypeError`.
|
|
13
|
+
*/
|
|
14
|
+
describe('subscribeToAppState', () => {
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
AppState.isAvailable = true;
|
|
17
|
+
jest.restoreAllMocks();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('subscribes and unsubscribes when AppState is available', () => {
|
|
21
|
+
const remove = jest.fn();
|
|
22
|
+
const addEventListener = jest
|
|
23
|
+
.spyOn(AppState, 'addEventListener')
|
|
24
|
+
.mockReturnValue({ remove });
|
|
25
|
+
|
|
26
|
+
const unsubscribe = subscribeToAppState(() => {});
|
|
27
|
+
expect(addEventListener).toHaveBeenCalledTimes(1);
|
|
28
|
+
expect(addEventListener.mock.calls[0]?.[0]).toBe('change');
|
|
29
|
+
|
|
30
|
+
unsubscribe();
|
|
31
|
+
expect(remove).toHaveBeenCalledTimes(1);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('does not subscribe, and returns a safe no-op, when AppState is unavailable', () => {
|
|
35
|
+
AppState.isAvailable = false;
|
|
36
|
+
const addEventListener = jest.spyOn(AppState, 'addEventListener');
|
|
37
|
+
|
|
38
|
+
const unsubscribe = subscribeToAppState(() => {});
|
|
39
|
+
|
|
40
|
+
expect(addEventListener).not.toHaveBeenCalled();
|
|
41
|
+
// The whole point: tearing down must not throw where there is no subscription.
|
|
42
|
+
expect(() => unsubscribe()).not.toThrow();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
describe('useAppStateChange', () => {
|
|
47
|
+
const setup = () => {
|
|
48
|
+
const onBackground = jest.fn();
|
|
49
|
+
const onForeground = jest.fn();
|
|
50
|
+
const listeners: Array<(status: AppStateStatus) => void> = [];
|
|
51
|
+
const remove = jest.fn();
|
|
52
|
+
|
|
53
|
+
jest.spyOn(AppState, 'addEventListener').mockImplementation((_event, listener) => {
|
|
54
|
+
listeners.push(listener);
|
|
55
|
+
return { remove };
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const hook = renderHook(() =>
|
|
59
|
+
useAppStateChange({ onBackground, onForeground }),
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const emit = (status: AppStateStatus) => {
|
|
63
|
+
act(() => {
|
|
64
|
+
for (const listener of listeners) {
|
|
65
|
+
listener(status);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return { onBackground, onForeground, emit, remove, hook };
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
afterEach(() => {
|
|
74
|
+
AppState.isAvailable = true;
|
|
75
|
+
jest.restoreAllMocks();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('reports leaving and returning to the foreground', () => {
|
|
79
|
+
const { onBackground, onForeground, emit } = setup();
|
|
80
|
+
|
|
81
|
+
emit('background');
|
|
82
|
+
expect(onBackground).toHaveBeenCalledTimes(1);
|
|
83
|
+
expect(onForeground).not.toHaveBeenCalled();
|
|
84
|
+
|
|
85
|
+
emit('active');
|
|
86
|
+
expect(onForeground).toHaveBeenCalledTimes(1);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('reports one edge per transition, not one per event', () => {
|
|
90
|
+
const { onBackground, onForeground, emit } = setup();
|
|
91
|
+
|
|
92
|
+
// iOS emits `inactive` on the way to `background`; upstream treats both as a
|
|
93
|
+
// fresh backgrounding and pauses an already-paused timer again.
|
|
94
|
+
emit('inactive');
|
|
95
|
+
emit('background');
|
|
96
|
+
expect(onBackground).toHaveBeenCalledTimes(1);
|
|
97
|
+
|
|
98
|
+
emit('active');
|
|
99
|
+
emit('active');
|
|
100
|
+
expect(onForeground).toHaveBeenCalledTimes(1);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('ignores an initial active event when the app was already active', () => {
|
|
104
|
+
const { onBackground, onForeground, emit } = setup();
|
|
105
|
+
emit('active');
|
|
106
|
+
expect(onForeground).not.toHaveBeenCalled();
|
|
107
|
+
expect(onBackground).not.toHaveBeenCalled();
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('removes its subscription on unmount', () => {
|
|
111
|
+
const { remove, hook } = setup();
|
|
112
|
+
hook.unmount();
|
|
113
|
+
expect(remove).toHaveBeenCalledTimes(1);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('mounts and unmounts cleanly with no AppState subscription at all', () => {
|
|
117
|
+
AppState.isAvailable = false;
|
|
118
|
+
const onBackground = jest.fn();
|
|
119
|
+
const onForeground = jest.fn();
|
|
120
|
+
|
|
121
|
+
const hook = renderHook(() =>
|
|
122
|
+
useAppStateChange({ onBackground, onForeground }),
|
|
123
|
+
);
|
|
124
|
+
expect(() => hook.unmount()).not.toThrow();
|
|
125
|
+
expect(onBackground).not.toHaveBeenCalled();
|
|
126
|
+
});
|
|
127
|
+
});
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { renderHook } from '@testing-library/react-native';
|
|
3
|
+
|
|
4
|
+
import { BloomThemeProvider } from '../theme/BloomThemeProvider';
|
|
5
|
+
import { buildTheme } from '../theme/build-theme';
|
|
6
|
+
import { useToastColors } from '../toast/use-toast-colors';
|
|
7
|
+
import type { ToastVariant } from '../toast/types';
|
|
8
|
+
|
|
9
|
+
const MODE = 'light';
|
|
10
|
+
const PRESET = 'oxy';
|
|
11
|
+
const tokens = buildTheme(PRESET, MODE).colors;
|
|
12
|
+
|
|
13
|
+
const wrapper = ({ children }: { children: React.ReactNode }) => (
|
|
14
|
+
<BloomThemeProvider mode={MODE} colorPreset={PRESET}>
|
|
15
|
+
{children}
|
|
16
|
+
</BloomThemeProvider>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const colorsFor = (
|
|
20
|
+
variant: ToastVariant | undefined,
|
|
21
|
+
richColors = false,
|
|
22
|
+
) =>
|
|
23
|
+
renderHook(() => useToastColors({ variant, richColors }), { wrapper }).result
|
|
24
|
+
.current;
|
|
25
|
+
|
|
26
|
+
/** Every variant plus the absent one — the full key space of the resolver. */
|
|
27
|
+
const ALL: Array<ToastVariant | undefined> = [
|
|
28
|
+
undefined,
|
|
29
|
+
'success',
|
|
30
|
+
'error',
|
|
31
|
+
'warning',
|
|
32
|
+
'info',
|
|
33
|
+
'loading',
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
describe('useToastColors', () => {
|
|
37
|
+
describe('by default (richColors off)', () => {
|
|
38
|
+
it('paints an identical neutral surface for every variant', () => {
|
|
39
|
+
const baseline = colorsFor(undefined);
|
|
40
|
+
|
|
41
|
+
for (const variant of ALL) {
|
|
42
|
+
const colors = colorsFor(variant);
|
|
43
|
+
expect({ variant, surface: colors.surface }).toEqual({
|
|
44
|
+
variant,
|
|
45
|
+
surface: baseline.surface,
|
|
46
|
+
});
|
|
47
|
+
expect({ variant, border: colors.border }).toEqual({
|
|
48
|
+
variant,
|
|
49
|
+
border: baseline.border,
|
|
50
|
+
});
|
|
51
|
+
expect({ variant, title: colors.title }).toEqual({
|
|
52
|
+
variant,
|
|
53
|
+
title: baseline.title,
|
|
54
|
+
});
|
|
55
|
+
expect({ variant, description: colors.description }).toEqual({
|
|
56
|
+
variant,
|
|
57
|
+
description: baseline.description,
|
|
58
|
+
});
|
|
59
|
+
expect({ variant, closeButton: colors.closeButton }).toEqual({
|
|
60
|
+
variant,
|
|
61
|
+
closeButton: baseline.closeButton,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('uses the theme surface roles, never a brand *Subtle tint', () => {
|
|
67
|
+
const colors = colorsFor('success');
|
|
68
|
+
expect(colors.surface).toBe(tokens.backgroundSecondary);
|
|
69
|
+
expect(colors.border).toBe(tokens.border);
|
|
70
|
+
expect(colors.title).toBe(tokens.text);
|
|
71
|
+
expect(colors.description).toBe(tokens.textSecondary);
|
|
72
|
+
expect(colors.surface).not.toBe(tokens.primarySubtle);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('never emits a brand token anywhere, for any variant or prop value', () => {
|
|
76
|
+
const brand = [
|
|
77
|
+
tokens.primarySubtle,
|
|
78
|
+
tokens.primarySubtleForeground,
|
|
79
|
+
tokens.negativeSubtle,
|
|
80
|
+
tokens.negativeSubtleForeground,
|
|
81
|
+
tokens.negative,
|
|
82
|
+
tokens.primary,
|
|
83
|
+
];
|
|
84
|
+
for (const variant of ALL) {
|
|
85
|
+
for (const rich of [false, true]) {
|
|
86
|
+
const { action, ...flat } = colorsFor(variant, rich);
|
|
87
|
+
const emitted = [...Object.values(flat), ...Object.values(action)];
|
|
88
|
+
expect({
|
|
89
|
+
variant,
|
|
90
|
+
rich,
|
|
91
|
+
brandLeaks: emitted.filter((value) => brand.includes(value)),
|
|
92
|
+
}).toEqual({ variant, rich, brandLeaks: [] });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it.each<[ToastVariant | undefined, keyof typeof tokens]>([
|
|
98
|
+
['success', 'success'],
|
|
99
|
+
['error', 'error'],
|
|
100
|
+
['warning', 'warning'],
|
|
101
|
+
['info', 'info'],
|
|
102
|
+
['loading', 'textSecondary'],
|
|
103
|
+
[undefined, 'textSecondary'],
|
|
104
|
+
])('tints only the icon: %s -> colors.%s', (variant, token) => {
|
|
105
|
+
expect(colorsFor(variant).icon).toBe(tokens[token]);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('keeps the action button neutral for every variant', () => {
|
|
109
|
+
const baseline = colorsFor(undefined).action;
|
|
110
|
+
expect(baseline.background).toBe(tokens.backgroundTertiary);
|
|
111
|
+
expect(baseline.pressedBackground).toBe(tokens.contrast50);
|
|
112
|
+
|
|
113
|
+
for (const variant of ALL) {
|
|
114
|
+
expect({ variant, action: colorsFor(variant).action }).toEqual({
|
|
115
|
+
variant,
|
|
116
|
+
action: baseline,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
describe('with richColors', () => {
|
|
123
|
+
/** The four variants that carry a status colour. */
|
|
124
|
+
const STATUS: Array<[ToastVariant, keyof typeof tokens]> = [
|
|
125
|
+
['success', 'success'],
|
|
126
|
+
['error', 'error'],
|
|
127
|
+
['warning', 'warning'],
|
|
128
|
+
['info', 'info'],
|
|
129
|
+
];
|
|
130
|
+
|
|
131
|
+
it('never tints the surface — that is the whole point of the prop', () => {
|
|
132
|
+
for (const variant of ALL) {
|
|
133
|
+
expect({ variant, surface: colorsFor(variant, true).surface }).toEqual({
|
|
134
|
+
variant,
|
|
135
|
+
surface: tokens.backgroundSecondary,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it.each(STATUS)(
|
|
141
|
+
'lifts border, title and icon to the status colour: %s',
|
|
142
|
+
(variant, token) => {
|
|
143
|
+
const colors = colorsFor(variant, true);
|
|
144
|
+
expect(colors.border).toBe(tokens[token]);
|
|
145
|
+
expect(colors.title).toBe(tokens[token]);
|
|
146
|
+
expect(colors.icon).toBe(tokens[token]);
|
|
147
|
+
},
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
it.each(STATUS)(
|
|
151
|
+
'never reaches for a brand token, so the %s icon keeps its hue with the prop on',
|
|
152
|
+
(variant) => {
|
|
153
|
+
expect(colorsFor(variant, true).icon).toBe(colorsFor(variant).icon);
|
|
154
|
+
},
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
it.each(STATUS)(
|
|
158
|
+
'leaves description, close button and actions neutral: %s',
|
|
159
|
+
(variant) => {
|
|
160
|
+
const rich = colorsFor(variant, true);
|
|
161
|
+
const plain = colorsFor(variant);
|
|
162
|
+
expect(rich.description).toBe(plain.description);
|
|
163
|
+
expect(rich.closeButton).toBe(plain.closeButton);
|
|
164
|
+
expect(rich.cancelText).toBe(plain.cancelText);
|
|
165
|
+
expect(rich.action).toEqual(plain.action);
|
|
166
|
+
},
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
it('leaves a variant-less and a loading toast completely untouched', () => {
|
|
170
|
+
expect(colorsFor(undefined, true)).toEqual(colorsFor(undefined));
|
|
171
|
+
expect(colorsFor('loading', true)).toEqual(colorsFor('loading'));
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
it('is still visibly different from the default for every status variant', () => {
|
|
175
|
+
for (const [variant] of STATUS) {
|
|
176
|
+
const rich = colorsFor(variant, true);
|
|
177
|
+
const plain = colorsFor(variant);
|
|
178
|
+
expect({ variant, changed: rich.border !== plain.border }).toEqual({
|
|
179
|
+
variant,
|
|
180
|
+
changed: true,
|
|
181
|
+
});
|
|
182
|
+
expect({ variant, changed: rich.title !== plain.title }).toEqual({
|
|
183
|
+
variant,
|
|
184
|
+
changed: true,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { readdirSync, readFileSync, statSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
|
|
4
|
+
import { WEB_POSITION_FIXED } from '../styles/web-view-style';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `position: fixed` is web-only CSS that React Native's `ViewStyle` does not
|
|
8
|
+
* model, so every web fork used to assert it inline. Thirteen sites spelled it
|
|
9
|
+
* `position: 'fixed' as 'absolute'` — not a widening but an outright FALSE
|
|
10
|
+
* assertion to the compiler (the value is not `'absolute'`), which would survive
|
|
11
|
+
* a rename and reads as if the style were absolute. One more used
|
|
12
|
+
* `as ViewStyle['position']`.
|
|
13
|
+
*
|
|
14
|
+
* They now all import `WEB_POSITION_FIXED`, whose single documented cast lives in
|
|
15
|
+
* `styles/web-view-style.ts`. This guard stops the inline spellings coming back.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const SRC = join(__dirname, '..');
|
|
19
|
+
|
|
20
|
+
function sourceFiles(dir: string): string[] {
|
|
21
|
+
return readdirSync(dir).flatMap((entry) => {
|
|
22
|
+
const full = join(dir, entry);
|
|
23
|
+
if (statSync(full).isDirectory()) {
|
|
24
|
+
return entry === '__tests__' ? [] : sourceFiles(full);
|
|
25
|
+
}
|
|
26
|
+
return /\.tsx?$/.test(entry) ? [full] : [];
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const files = sourceFiles(SRC);
|
|
31
|
+
|
|
32
|
+
describe('web position: fixed', () => {
|
|
33
|
+
it('resolves to the CSS value at runtime', () => {
|
|
34
|
+
expect(WEB_POSITION_FIXED).toBe('fixed');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('finds source files to scan (guards against a broken walk)', () => {
|
|
38
|
+
expect(files.length).toBeGreaterThan(100);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it.each([
|
|
42
|
+
["position: 'fixed' as 'absolute'", /position:\s*'fixed'\s+as\s+'absolute'/],
|
|
43
|
+
["position: 'fixed' as ViewStyle['position']", /position:\s*'fixed'\s+as\s+ViewStyle/],
|
|
44
|
+
['a bare position: fixed literal', /position:\s*'fixed'\s*,/],
|
|
45
|
+
])('has no %s left in src', (_label, pattern) => {
|
|
46
|
+
const offenders = files.filter((file) => {
|
|
47
|
+
const source = readFileSync(file, 'utf8')
|
|
48
|
+
// Comments may still discuss the retired spelling.
|
|
49
|
+
.replace(/\/\*[\s\S]*?\*\//g, '')
|
|
50
|
+
.replace(/^\s*\/\/.*$/gm, '');
|
|
51
|
+
return pattern.test(source);
|
|
52
|
+
});
|
|
53
|
+
expect(offenders.map((f) => f.replace(`${SRC}/`, ''))).toEqual([]);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('keeps the only cast inside styles/web-view-style.ts', () => {
|
|
57
|
+
const module = readFileSync(join(SRC, 'styles/web-view-style.ts'), 'utf8')
|
|
58
|
+
.replace(/\/\*[\s\S]*?\*\//g, '')
|
|
59
|
+
.replace(/^\s*\/\/.*$/gm, '');
|
|
60
|
+
expect(module.match(/ as /g)).toHaveLength(1);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('is imported by every fork that positions something fixed', () => {
|
|
64
|
+
const importers = files.filter((file) =>
|
|
65
|
+
readFileSync(file, 'utf8').includes('WEB_POSITION_FIXED'),
|
|
66
|
+
);
|
|
67
|
+
// The 10 consumers plus the module that defines it.
|
|
68
|
+
expect(importers.length).toBeGreaterThanOrEqual(11);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -3,6 +3,7 @@ import { Pressable, StyleSheet, View } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { Portal } from '../portal';
|
|
5
5
|
import { Z_INDEX } from '../styles/z-index';
|
|
6
|
+
import { WEB_POSITION_FIXED } from '../styles/web-view-style';
|
|
6
7
|
import { UserHoverCard } from '../user-hover-card';
|
|
7
8
|
import {
|
|
8
9
|
AvatarGroupBase,
|
|
@@ -133,7 +134,7 @@ const AvatarGroupWebComponent: React.FC<AvatarGroupProps> = (props) => {
|
|
|
133
134
|
|
|
134
135
|
const webStyles = StyleSheet.create({
|
|
135
136
|
floating: {
|
|
136
|
-
position:
|
|
137
|
+
position: WEB_POSITION_FIXED,
|
|
137
138
|
zIndex: Z_INDEX.tooltip,
|
|
138
139
|
},
|
|
139
140
|
card: {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { StyleSheet
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
4
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
5
5
|
import { Portal } from '../portal/index.web';
|
|
6
6
|
import { Z_INDEX } from '../styles/z-index';
|
|
7
|
+
import { WEB_POSITION_FIXED } from '../styles/web-view-style';
|
|
7
8
|
import {
|
|
8
9
|
BottomSheetBase,
|
|
9
10
|
type BottomSheetProps,
|
|
@@ -52,7 +53,7 @@ const webStyles = StyleSheet.create({
|
|
|
52
53
|
// the sheet's own interactive descendants (backdrop, sheet) while empty
|
|
53
54
|
// gaps stay click-through (`box-none`). `StyleSheet.absoluteFill` from
|
|
54
55
|
// the sheet body then anchors to this box.
|
|
55
|
-
position:
|
|
56
|
+
position: WEB_POSITION_FIXED,
|
|
56
57
|
top: 0,
|
|
57
58
|
left: 0,
|
|
58
59
|
right: 0,
|
|
@@ -20,6 +20,7 @@ import { Text } from '../typography';
|
|
|
20
20
|
import { Portal } from '../portal/index.web';
|
|
21
21
|
import { useInteractionState } from '../hooks/useInteractionState';
|
|
22
22
|
import { createOverlayZIndex } from '../styles/z-index';
|
|
23
|
+
import { WEB_POSITION_FIXED } from '../styles/web-view-style';
|
|
23
24
|
import { bloomShadowStyle } from '../design-tokens/shadows';
|
|
24
25
|
import { ItemCtx, useItemContext } from './context';
|
|
25
26
|
import type {
|
|
@@ -326,7 +327,7 @@ export function ContextMenuDivider() {
|
|
|
326
327
|
|
|
327
328
|
const styles = StyleSheet.create({
|
|
328
329
|
backdrop: {
|
|
329
|
-
position:
|
|
330
|
+
position: WEB_POSITION_FIXED,
|
|
330
331
|
top: 0,
|
|
331
332
|
left: 0,
|
|
332
333
|
right: 0,
|
|
@@ -336,7 +337,7 @@ const styles = StyleSheet.create({
|
|
|
336
337
|
pointerEvents: 'auto',
|
|
337
338
|
},
|
|
338
339
|
dropdown: {
|
|
339
|
-
position:
|
|
340
|
+
position: WEB_POSITION_FIXED,
|
|
340
341
|
zIndex: contextMenuZIndex.surface,
|
|
341
342
|
borderRadius: 8,
|
|
342
343
|
padding: 4,
|