@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,407 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Derived from sonner-native v0.26.4 — src/toast.tsx:39-437
|
|
5
|
+
* (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
|
|
6
|
+
*
|
|
7
|
+
* The animated shell around a row: stack offset + scale, enter/exit animation,
|
|
8
|
+
* height measurement, swipe wrapper and the imperative wiggle handle. The visual
|
|
9
|
+
* row itself is `ToastContent` (or the consumer's `jsx`).
|
|
10
|
+
*
|
|
11
|
+
* W6 — INVARIANT: THE MEASURED `Animated.View` IS `style`-ONLY, NEVER
|
|
12
|
+
* `className`'d. Under react-native-css on web, `onLayout` never fires for a
|
|
13
|
+
* className'd component, which would strand every row at
|
|
14
|
+
* `ESTIMATED_TOAST_HEIGHT` and pile the stack on top of itself. Measurement runs
|
|
15
|
+
* a three-tier ladder — `getBoundingClientRect()` (RN >= 0.83 refs and RN-Web),
|
|
16
|
+
* then `measureInWindow` (older New Arch), then `onLayout` as the safety net —
|
|
17
|
+
* so no single platform quirk can silently degrade it. A consumer's `toast.custom`
|
|
18
|
+
* JSX is unaffected: the ref sits on this engine wrapper, not on their element.
|
|
19
|
+
*
|
|
20
|
+
* W3 — the animated style READS two shared values and returns only the transform.
|
|
21
|
+
* `position`, `width` and the `top`/`bottom` anchor are static `StyleSheet` entries:
|
|
22
|
+
* upstream writes the anchor conditionally INSIDE the mapper, so the previous
|
|
23
|
+
* anchor is never cleared when `position` changes and the static keys are
|
|
24
|
+
* re-committed every frame. Both shared values are driven imperatively from plain-JS
|
|
25
|
+
* targets (`useAnimatedTarget`), never returned from a mapper.
|
|
26
|
+
*
|
|
27
|
+
* W5 — this row does NOT subscribe to `AppState`. `Toaster` holds one
|
|
28
|
+
* subscription for the whole stack (upstream creates one per row, so N toasts
|
|
29
|
+
* meant N `visibilitychange` listeners).
|
|
30
|
+
*
|
|
31
|
+
* THE EXIT IS ALWAYS A LAYOUT ANIMATION; THE ENTER DEPENDS ON THE PLATFORM.
|
|
32
|
+
* `animations.ts` returns EITHER an `entering` builder (native, and any consumer
|
|
33
|
+
* override) OR an `enterTranslateY` for `rowStyle` below to fade and slide the row
|
|
34
|
+
* in imperatively (web default) — never both. When `enterTranslateY` is
|
|
35
|
+
* `undefined`, `enterProgress` is seeded at 1 and `rowStyle` collapses to the
|
|
36
|
+
* wiggle scale alone, so nothing here competes with `entering`. Both halves of
|
|
37
|
+
* that split are load-bearing and neither may be "simplified" into the other:
|
|
38
|
+
* `animations.ts` documents the web pin that forbids `entering` on web and the
|
|
39
|
+
* native regression that forbids the imperative driver on native.
|
|
40
|
+
*/
|
|
41
|
+
import * as React from 'react';
|
|
42
|
+
import { StyleSheet, useWindowDimensions } from 'react-native';
|
|
43
|
+
import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
|
|
44
|
+
import { easeOutQuartFn, useToastLayoutAnimations } from "./animations.js";
|
|
45
|
+
import { CLOSE_BUTTON_HIT_AREA, ENTERING_ANIMATION_DURATION, STACKING_ANIMATION_DURATION, toastDefaults } from "./constants.js";
|
|
46
|
+
import { useDynamicToastContext, useToastContext } from "./context.js";
|
|
47
|
+
import { calculateStackScaleX } from "./position-utils.js";
|
|
48
|
+
import { useAnimatedTarget } from "./use-animated-target.js";
|
|
49
|
+
import { ToastContent } from "./ToastContent.js";
|
|
50
|
+
import { ToastSwipeHandler } from "./ToastSwipeHandler.js";
|
|
51
|
+
import { toastStore } from "./toast-store.js";
|
|
52
|
+
import { useToastPosition } from "./use-toast-position.js";
|
|
53
|
+
|
|
54
|
+
/** How much a wiggle grows the row, and for how long per half-cycle. */
|
|
55
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
56
|
+
const WIGGLE_SCALE = 1.035;
|
|
57
|
+
const WIGGLE_DURATION = 150;
|
|
58
|
+
const WIGGLE_REPEATS = 4;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Fold the outlet-level `toastOptions` style slots into the per-toast
|
|
62
|
+
* `ToastStyles` shape so the renderer has ONE styles object to apply. Upstream
|
|
63
|
+
* threads all fifteen slots down as separate props; collapsing them here keeps
|
|
64
|
+
* `ToastContent` to a single `styles` prop while honouring the same API. The
|
|
65
|
+
* per-toast value always wins over the outlet's.
|
|
66
|
+
*/
|
|
67
|
+
function mergeToastStyles(toastOptions, perToast, variantStyle) {
|
|
68
|
+
return {
|
|
69
|
+
toastContainer: {
|
|
70
|
+
...toastOptions.toastContainerStyle,
|
|
71
|
+
...perToast?.toastContainer
|
|
72
|
+
},
|
|
73
|
+
toast: {
|
|
74
|
+
...toastOptions.style,
|
|
75
|
+
...variantStyle,
|
|
76
|
+
...perToast?.toast
|
|
77
|
+
},
|
|
78
|
+
toastContent: {
|
|
79
|
+
...toastOptions.toastContentStyle,
|
|
80
|
+
...perToast?.toastContent
|
|
81
|
+
},
|
|
82
|
+
textContainer: {
|
|
83
|
+
...toastOptions.textContainerStyle,
|
|
84
|
+
...perToast?.textContainer
|
|
85
|
+
},
|
|
86
|
+
title: {
|
|
87
|
+
...toastOptions.titleStyle,
|
|
88
|
+
...perToast?.title
|
|
89
|
+
},
|
|
90
|
+
description: {
|
|
91
|
+
...toastOptions.descriptionStyle,
|
|
92
|
+
...perToast?.description
|
|
93
|
+
},
|
|
94
|
+
buttons: {
|
|
95
|
+
...toastOptions.buttonsStyle,
|
|
96
|
+
...perToast?.buttons
|
|
97
|
+
},
|
|
98
|
+
closeButton: {
|
|
99
|
+
...toastOptions.closeButtonStyle,
|
|
100
|
+
...perToast?.closeButton
|
|
101
|
+
},
|
|
102
|
+
closeButtonIcon: {
|
|
103
|
+
...toastOptions.closeButtonIconStyle,
|
|
104
|
+
...perToast?.closeButtonIcon
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export const ToastRow = /*#__PURE__*/React.forwardRef(function ToastRow({
|
|
109
|
+
id,
|
|
110
|
+
title,
|
|
111
|
+
jsx,
|
|
112
|
+
description,
|
|
113
|
+
icon,
|
|
114
|
+
duration,
|
|
115
|
+
variant,
|
|
116
|
+
action,
|
|
117
|
+
cancel,
|
|
118
|
+
close,
|
|
119
|
+
onDismiss,
|
|
120
|
+
dismissible = toastDefaults.dismissible,
|
|
121
|
+
closeButton: closeButtonProp,
|
|
122
|
+
actionButtonStyle,
|
|
123
|
+
actionButtonTextStyle,
|
|
124
|
+
cancelButtonStyle,
|
|
125
|
+
cancelButtonTextStyle,
|
|
126
|
+
style,
|
|
127
|
+
styles: styleOverrides,
|
|
128
|
+
promiseOptions,
|
|
129
|
+
position: positionProp,
|
|
130
|
+
animation,
|
|
131
|
+
unstyled: unstyledProp,
|
|
132
|
+
important,
|
|
133
|
+
richColors: richColorsProp,
|
|
134
|
+
onPress,
|
|
135
|
+
allowFontScaling: allowFontScalingProp,
|
|
136
|
+
maxFontSizeMultiplier: maxFontSizeMultiplierProp,
|
|
137
|
+
backgroundComponent: backgroundComponentProp,
|
|
138
|
+
numberOfToasts,
|
|
139
|
+
index,
|
|
140
|
+
orderedToastIds
|
|
141
|
+
}, ref) {
|
|
142
|
+
const {
|
|
143
|
+
closeButton: closeButtonCtx,
|
|
144
|
+
icons,
|
|
145
|
+
richColors: richColorsCtx,
|
|
146
|
+
allowFontScaling: allowFontScalingCtx,
|
|
147
|
+
maxFontSizeMultiplier: maxFontSizeMultiplierCtx,
|
|
148
|
+
enableStacking,
|
|
149
|
+
gap,
|
|
150
|
+
position: positionCtx,
|
|
151
|
+
visibleToasts,
|
|
152
|
+
unstyled: unstyledCtx,
|
|
153
|
+
toastOptions
|
|
154
|
+
} = useToastContext();
|
|
155
|
+
const {
|
|
156
|
+
toastHeights,
|
|
157
|
+
isExpanded,
|
|
158
|
+
toggleExpand
|
|
159
|
+
} = useDynamicToastContext();
|
|
160
|
+
const position = positionProp ?? positionCtx;
|
|
161
|
+
const unstyled = unstyledProp ?? toastOptions.unstyled ?? unstyledCtx;
|
|
162
|
+
const richColors = richColorsProp ?? richColorsCtx;
|
|
163
|
+
const closeButton = closeButtonProp ?? closeButtonCtx;
|
|
164
|
+
const allowFontScaling = allowFontScalingProp ?? allowFontScalingCtx;
|
|
165
|
+
const maxFontSizeMultiplier = maxFontSizeMultiplierProp ?? maxFontSizeMultiplierCtx;
|
|
166
|
+
const backgroundComponent = backgroundComponentProp ?? toastOptions.backgroundComponent;
|
|
167
|
+
const stackGap = gap ?? toastDefaults.stackGap;
|
|
168
|
+
const mergedStyles = React.useMemo(() => mergeToastStyles(toastOptions, styleOverrides, variant ? toastOptions[variant] : undefined), [toastOptions, styleOverrides, variant]);
|
|
169
|
+
|
|
170
|
+
// For top-center the array is reversed, so the front row is index 0.
|
|
171
|
+
const distanceFromFront = position === 'top-center' ? index : numberOfToasts - 1 - index;
|
|
172
|
+
const isHiddenByLimit = enableStacking && distanceFromFront >= visibleToasts;
|
|
173
|
+
const {
|
|
174
|
+
entering,
|
|
175
|
+
exiting,
|
|
176
|
+
enterTranslateY
|
|
177
|
+
} = useToastLayoutAnimations(positionProp, animation, isHiddenByLimit, numberOfToasts);
|
|
178
|
+
const yPosition = useToastPosition({
|
|
179
|
+
index,
|
|
180
|
+
numberOfToasts,
|
|
181
|
+
enableStacking,
|
|
182
|
+
position,
|
|
183
|
+
allToastHeights: toastHeights,
|
|
184
|
+
gap,
|
|
185
|
+
orderedToastIds,
|
|
186
|
+
isExpanded,
|
|
187
|
+
stackGap
|
|
188
|
+
});
|
|
189
|
+
const {
|
|
190
|
+
width: screenWidth
|
|
191
|
+
} = useWindowDimensions();
|
|
192
|
+
const stackScaleX = useAnimatedTarget(calculateStackScaleX({
|
|
193
|
+
index,
|
|
194
|
+
numberOfToasts,
|
|
195
|
+
enableStacking,
|
|
196
|
+
position,
|
|
197
|
+
isExpanded,
|
|
198
|
+
stackGap,
|
|
199
|
+
screenWidth
|
|
200
|
+
}), {
|
|
201
|
+
duration: STACKING_ANIMATION_DURATION,
|
|
202
|
+
easing: easeOutQuartFn
|
|
203
|
+
});
|
|
204
|
+
const stackTransformStyle = useAnimatedStyle(() => ({
|
|
205
|
+
transform: [{
|
|
206
|
+
translateY: yPosition.value
|
|
207
|
+
}, {
|
|
208
|
+
scaleX: stackScaleX.value
|
|
209
|
+
}]
|
|
210
|
+
}), [yPosition, stackScaleX]);
|
|
211
|
+
|
|
212
|
+
// 0 -> 1 over the enter animation. Seeded at 1 with NO mount-time `withTiming`
|
|
213
|
+
// whenever `enterTranslateY` is undefined — i.e. whenever `entering` is playing
|
|
214
|
+
// the enter instead, or reduced motion is on — leaving this style the identity.
|
|
215
|
+
const enterProgress = useAnimatedTarget(1, {
|
|
216
|
+
duration: ENTERING_ANIMATION_DURATION,
|
|
217
|
+
easing: easeOutQuartFn,
|
|
218
|
+
from: enterTranslateY === undefined ? undefined : 0
|
|
219
|
+
});
|
|
220
|
+
const enterDistance = enterTranslateY ?? 0;
|
|
221
|
+
const wiggleScale = useSharedValue(1);
|
|
222
|
+
// ONE mapper for both transforms: two animated styles on the same view would
|
|
223
|
+
// each return a `transform` array and the later one would win outright.
|
|
224
|
+
const rowStyle = useAnimatedStyle(() => ({
|
|
225
|
+
opacity: enterProgress.value,
|
|
226
|
+
transform: [{
|
|
227
|
+
translateY: (1 - enterProgress.value) * enterDistance
|
|
228
|
+
}, {
|
|
229
|
+
scale: wiggleScale.value
|
|
230
|
+
}]
|
|
231
|
+
}), [enterProgress, enterDistance, wiggleScale]);
|
|
232
|
+
const wiggle = React.useCallback(() => {
|
|
233
|
+
'worklet';
|
|
234
|
+
|
|
235
|
+
wiggleScale.value = withRepeat(withTiming(Math.min(wiggleScale.value * WIGGLE_SCALE, WIGGLE_SCALE), {
|
|
236
|
+
duration: WIGGLE_DURATION
|
|
237
|
+
}), WIGGLE_REPEATS, true);
|
|
238
|
+
}, [wiggleScale]);
|
|
239
|
+
const handleWiggle = React.useCallback(() => {
|
|
240
|
+
// A toast that never auto-closes has no timer to draw attention back to.
|
|
241
|
+
if (duration === Infinity) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
if (wiggleScale.value !== 1) {
|
|
245
|
+
// Settle back to rest first, otherwise the scale compounds.
|
|
246
|
+
wiggleScale.value = withTiming(1, {
|
|
247
|
+
duration: WIGGLE_DURATION
|
|
248
|
+
}, wiggle);
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
wiggle();
|
|
252
|
+
}, [wiggle, wiggleScale, duration]);
|
|
253
|
+
React.useImperativeHandle(ref, () => ({
|
|
254
|
+
wiggle: handleWiggle
|
|
255
|
+
}));
|
|
256
|
+
const measuredRef = React.useRef(null);
|
|
257
|
+
|
|
258
|
+
// Tiers 1 and 2 of the ladder — see the W6 note in the file header.
|
|
259
|
+
React.useLayoutEffect(() => {
|
|
260
|
+
const node = measuredRef.current;
|
|
261
|
+
if (!node) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
if (typeof node.getBoundingClientRect === 'function') {
|
|
265
|
+
toastStore.setToastHeight(id, node.getBoundingClientRect().height);
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
let stale = false;
|
|
269
|
+
node.measureInWindow((_x, _y, _width, height) => {
|
|
270
|
+
if (!stale) {
|
|
271
|
+
toastStore.setToastHeight(id, height);
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
return () => {
|
|
275
|
+
stale = true;
|
|
276
|
+
};
|
|
277
|
+
}, [id, variant, title, description, jsx]);
|
|
278
|
+
|
|
279
|
+
// Tier 3. Also the only tier that reports a LATER resize (a wrapped line, a
|
|
280
|
+
// font swap) on platforms without a synchronous read.
|
|
281
|
+
const handleLayout = React.useCallback(({
|
|
282
|
+
nativeEvent
|
|
283
|
+
}) => {
|
|
284
|
+
const {
|
|
285
|
+
height
|
|
286
|
+
} = nativeEvent.layout;
|
|
287
|
+
if (height > 0) {
|
|
288
|
+
toastStore.setToastHeight(id, height);
|
|
289
|
+
}
|
|
290
|
+
}, [id]);
|
|
291
|
+
const onRemove = React.useCallback(() => {
|
|
292
|
+
onDismiss(id);
|
|
293
|
+
}, [onDismiss, id]);
|
|
294
|
+
const onSwipeBegin = React.useCallback(() => {
|
|
295
|
+
toastStore.pauseTimer(id);
|
|
296
|
+
}, [id]);
|
|
297
|
+
const onSwipeFinalize = React.useCallback(() => {
|
|
298
|
+
if (!isExpanded) {
|
|
299
|
+
toastStore.resumeTimer(id);
|
|
300
|
+
}
|
|
301
|
+
}, [id, isExpanded]);
|
|
302
|
+
const onSwipePress = React.useCallback(({
|
|
303
|
+
x
|
|
304
|
+
}) => {
|
|
305
|
+
if (enableStacking && numberOfToasts > 1 && position !== 'center') {
|
|
306
|
+
// On Android the RNGH tap wins the race against the nested Pressable,
|
|
307
|
+
// so a press in the close-button strip has to dismiss explicitly.
|
|
308
|
+
if (x > screenWidth - CLOSE_BUTTON_HIT_AREA) {
|
|
309
|
+
if (isExpanded && closeButton && dismissible) {
|
|
310
|
+
onDismiss(id);
|
|
311
|
+
}
|
|
312
|
+
} else {
|
|
313
|
+
toggleExpand();
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
onPress?.();
|
|
317
|
+
}, [enableStacking, numberOfToasts, position, screenWidth, isExpanded, closeButton, dismissible, onDismiss, id, toggleExpand, onPress]);
|
|
318
|
+
|
|
319
|
+
// Front row on top: later rows in the stack sit progressively behind.
|
|
320
|
+
const stackZIndex = position === 'top-center' ? -(index + 1) : -(numberOfToasts - index);
|
|
321
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
322
|
+
style: [styles.anchor, anchorFor(position), {
|
|
323
|
+
zIndex: stackZIndex
|
|
324
|
+
}, stackTransformStyle],
|
|
325
|
+
children: /*#__PURE__*/_jsx(ToastSwipeHandler, {
|
|
326
|
+
onRemove: onRemove,
|
|
327
|
+
onBegin: onSwipeBegin,
|
|
328
|
+
onFinalize: onSwipeFinalize,
|
|
329
|
+
onPress: onSwipePress
|
|
330
|
+
// A pending promise toast cannot be swiped away mid-flight.
|
|
331
|
+
,
|
|
332
|
+
enabled: !promiseOptions && dismissible,
|
|
333
|
+
style: mergedStyles.toastContainer,
|
|
334
|
+
unstyled: unstyled,
|
|
335
|
+
important: important,
|
|
336
|
+
position: positionProp,
|
|
337
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
338
|
+
style: rowStyle,
|
|
339
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
340
|
+
ref: measuredRef,
|
|
341
|
+
onLayout: handleLayout,
|
|
342
|
+
entering: entering,
|
|
343
|
+
exiting: exiting,
|
|
344
|
+
children: jsx ?? /*#__PURE__*/_jsx(ToastContent, {
|
|
345
|
+
id: id,
|
|
346
|
+
title: title,
|
|
347
|
+
description: description,
|
|
348
|
+
variant: variant,
|
|
349
|
+
icon: icon,
|
|
350
|
+
icons: icons,
|
|
351
|
+
action: action,
|
|
352
|
+
cancel: cancel,
|
|
353
|
+
close: close,
|
|
354
|
+
closeButton: closeButton,
|
|
355
|
+
dismissible: dismissible,
|
|
356
|
+
richColors: richColors,
|
|
357
|
+
promiseOptions: promiseOptions,
|
|
358
|
+
styles: mergedStyles,
|
|
359
|
+
style: style,
|
|
360
|
+
unstyled: unstyled,
|
|
361
|
+
onDismiss: onDismiss,
|
|
362
|
+
actionButtonStyle: actionButtonStyle ?? toastOptions.actionButtonStyle,
|
|
363
|
+
actionButtonTextStyle: actionButtonTextStyle ?? toastOptions.actionButtonTextStyle,
|
|
364
|
+
cancelButtonStyle: cancelButtonStyle ?? toastOptions.cancelButtonStyle,
|
|
365
|
+
cancelButtonTextStyle: cancelButtonTextStyle ?? toastOptions.cancelButtonTextStyle,
|
|
366
|
+
allowFontScaling: allowFontScaling,
|
|
367
|
+
maxFontSizeMultiplier: maxFontSizeMultiplier,
|
|
368
|
+
backgroundComponent: backgroundComponent
|
|
369
|
+
})
|
|
370
|
+
})
|
|
371
|
+
})
|
|
372
|
+
})
|
|
373
|
+
});
|
|
374
|
+
});
|
|
375
|
+
const styles = StyleSheet.create({
|
|
376
|
+
anchor: {
|
|
377
|
+
position: 'absolute',
|
|
378
|
+
width: '100%'
|
|
379
|
+
},
|
|
380
|
+
anchorTop: {
|
|
381
|
+
top: 0
|
|
382
|
+
},
|
|
383
|
+
anchorBottom: {
|
|
384
|
+
bottom: 0
|
|
385
|
+
},
|
|
386
|
+
/**
|
|
387
|
+
* The container is full-bleed for every position, so the vertical midpoint lives
|
|
388
|
+
* on the ROW rather than on the container. `calculateToastPosition` then shifts
|
|
389
|
+
* the front row up by half its height to sit ON the line rather than below it —
|
|
390
|
+
* see its `centerShift`.
|
|
391
|
+
*/
|
|
392
|
+
anchorCenter: {
|
|
393
|
+
top: '50%'
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
/** Which edge of the (full-bleed, padded) container the row hangs from. */
|
|
398
|
+
function anchorFor(position) {
|
|
399
|
+
if (position === 'bottom-center') {
|
|
400
|
+
return styles.anchorBottom;
|
|
401
|
+
}
|
|
402
|
+
if (position === 'center') {
|
|
403
|
+
return styles.anchorCenter;
|
|
404
|
+
}
|
|
405
|
+
return styles.anchorTop;
|
|
406
|
+
}
|
|
407
|
+
//# sourceMappingURL=ToastRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","useWindowDimensions","Animated","useAnimatedStyle","useSharedValue","withRepeat","withTiming","easeOutQuartFn","useToastLayoutAnimations","CLOSE_BUTTON_HIT_AREA","ENTERING_ANIMATION_DURATION","STACKING_ANIMATION_DURATION","toastDefaults","useDynamicToastContext","useToastContext","calculateStackScaleX","useAnimatedTarget","ToastContent","ToastSwipeHandler","toastStore","useToastPosition","jsx","_jsx","WIGGLE_SCALE","WIGGLE_DURATION","WIGGLE_REPEATS","mergeToastStyles","toastOptions","perToast","variantStyle","toastContainer","toastContainerStyle","toast","style","toastContent","toastContentStyle","textContainer","textContainerStyle","title","titleStyle","description","descriptionStyle","buttons","buttonsStyle","closeButton","closeButtonStyle","closeButtonIcon","closeButtonIconStyle","ToastRow","forwardRef","id","icon","duration","variant","action","cancel","close","onDismiss","dismissible","closeButtonProp","actionButtonStyle","actionButtonTextStyle","cancelButtonStyle","cancelButtonTextStyle","styles","styleOverrides","promiseOptions","position","positionProp","animation","unstyled","unstyledProp","important","richColors","richColorsProp","onPress","allowFontScaling","allowFontScalingProp","maxFontSizeMultiplier","maxFontSizeMultiplierProp","backgroundComponent","backgroundComponentProp","numberOfToasts","index","orderedToastIds","ref","closeButtonCtx","icons","richColorsCtx","allowFontScalingCtx","maxFontSizeMultiplierCtx","enableStacking","gap","positionCtx","visibleToasts","unstyledCtx","toastHeights","isExpanded","toggleExpand","stackGap","mergedStyles","useMemo","undefined","distanceFromFront","isHiddenByLimit","entering","exiting","enterTranslateY","yPosition","allToastHeights","width","screenWidth","stackScaleX","easing","stackTransformStyle","transform","translateY","value","scaleX","enterProgress","from","enterDistance","wiggleScale","rowStyle","opacity","scale","wiggle","useCallback","Math","min","handleWiggle","Infinity","useImperativeHandle","measuredRef","useRef","useLayoutEffect","node","current","getBoundingClientRect","setToastHeight","height","stale","measureInWindow","_x","_y","_width","handleLayout","nativeEvent","layout","onRemove","onSwipeBegin","pauseTimer","onSwipeFinalize","resumeTimer","onSwipePress","x","stackZIndex","View","anchor","anchorFor","zIndex","children","onBegin","onFinalize","enabled","onLayout","create","anchorTop","top","anchorBottom","bottom","anchorCenter"],"sourceRoot":"../../../src","sources":["toast/ToastRow.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,UAAU,EAEVC,mBAAmB,QAEd,cAAc;AACrB,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,EACVC,UAAU,QACL,yBAAyB;AAEhC,SAASC,cAAc,EAAEC,wBAAwB,QAAQ,iBAAc;AACvE,SACEC,qBAAqB,EACrBC,2BAA2B,EAC3BC,2BAA2B,EAC3BC,aAAa,QACR,gBAAa;AACpB,SAASC,sBAAsB,EAAEC,eAAe,QAAQ,cAAW;AACnE,SAASC,oBAAoB,QAAQ,qBAAkB;AACvD,SAASC,iBAAiB,QAAQ,0BAAuB;AACzD,SAASC,YAAY,QAAQ,mBAAgB;AAC7C,SAASC,iBAAiB,QAAQ,wBAAqB;AACvD,SAASC,UAAU,QAAQ,kBAAe;AAQ1C,SAASC,gBAAgB,QAAQ,yBAAsB;;AAEvD;AAAA,SAAAC,GAAA,IAAAC,IAAA;AACA,MAAMC,YAAY,GAAG,KAAK;AAC1B,MAAMC,eAAe,GAAG,GAAG;AAC3B,MAAMC,cAAc,GAAG,CAAC;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CACvBC,YAAuD,EACvDC,QAAiC,EACjCC,YAAkC,EACrB;EACb,OAAO;IACLC,cAAc,EAAE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iBAAiB,EACfA,iBAAiB,IAAIjC,YAAY,CAACiC,iBACnC;YACDC,qBAAqB,EACnBA,qBAAqB,IAAIlC,YAAY,CAACkC,qBACvC;YACDC,iBAAiB,EACfA,iBAAiB,IAAInC,YAAY,CAACmC,iBACnC;YACDC,qBAAqB,EACnBA,qBAAqB,IAAIpC,YAAY,CAACoC,qBACvC;YACDa,gBAAgB,EAAEA,gBAAiB;YACnCE,qBAAqB,EAAEA,qBAAsB;YAC7CE,mBAAmB,EAAEA;UAAoB,CAC1C;QACF,CACY;MAAC,CACH;IAAC,CACC;EAAC,CACP,CAAC;AAEpB,CACF,CAAC;AAED,MAAMhB,MAAM,GAAGhE,UAAU,CAACsK,MAAM,CAAC;EAC/BR,MAAM,EAAE;IACN3F,QAAQ,EAAE,UAAU;IACpB2C,KAAK,EAAE;EACT,CAAC;EACDyD,SAAS,EAAE;IAAEC,GAAG,EAAE;EAAE,CAAC;EACrBC,YAAY,EAAE;IAAEC,MAAM,EAAE;EAAE,CAAC;EAC3B;AACF;AACA;AACA;AACA;AACA;EACEC,YAAY,EAAE;IAAEH,GAAG,EAAE;EAAM;AAC7B,CAAC,CAAC;;AAEF;AACA,SAAST,SAASA,CAAC5F,QAAuB,EAAE;EAC1C,IAAIA,QAAQ,KAAK,eAAe,EAAE;IAChC,OAAOH,MAAM,CAACyG,YAAY;EAC5B;EACA,IAAItG,QAAQ,KAAK,QAAQ,EAAE;IACzB,OAAOH,MAAM,CAAC2G,YAAY;EAC5B;EACA,OAAO3G,MAAM,CAACuG,SAAS;AACzB","ignoreList":[]}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Derived from sonner-native v0.26.4 — src/gestures.tsx
|
|
5
|
+
* (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
|
|
6
|
+
*
|
|
7
|
+
* W2 — the animated style reads `translate`, `direction`, `position`,
|
|
8
|
+
* `windowWidth` and `isAndroid`; ALL of them are in the dependency array. On web
|
|
9
|
+
* without the worklets babel plugin reanimated re-runs the mapper on its deps
|
|
10
|
+
* rather than on auto-tracked reads, so a missing dep freezes the swipe transform
|
|
11
|
+
* at its first frame (upstream omits `position` and `isAndroid`, so a toast that
|
|
12
|
+
* changes position mid-life swipes the wrong way).
|
|
13
|
+
*/
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import { Platform, StyleSheet, useWindowDimensions } from 'react-native';
|
|
16
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
17
|
+
import Animated, { Easing, LinearTransition, interpolate, runOnJS, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
18
|
+
import { easeInOutCircFn } from "./animations.js";
|
|
19
|
+
import { useToastContext } from "./context.js";
|
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
/** Fraction of the screen a horizontal swipe must cross to dismiss. */
|
|
22
|
+
const HORIZONTAL_DISMISS_FRACTION = 0.25;
|
|
23
|
+
/** Below this the gesture reads as a tap, so the row springs back. */
|
|
24
|
+
const TAP_SLOP = 16;
|
|
25
|
+
/** Vertical travel that fades a row fully out. */
|
|
26
|
+
const VERTICAL_FADE_DISTANCE = 60;
|
|
27
|
+
const SPRING_BACK_EASING_BOUNCINESS = 0.8;
|
|
28
|
+
const WRONG_DIRECTION_SPRING_DURATION = 400;
|
|
29
|
+
export const ToastSwipeHandler = ({
|
|
30
|
+
children,
|
|
31
|
+
onRemove,
|
|
32
|
+
style,
|
|
33
|
+
onBegin,
|
|
34
|
+
onFinalize,
|
|
35
|
+
enabled,
|
|
36
|
+
unstyled,
|
|
37
|
+
important,
|
|
38
|
+
position: positionProps,
|
|
39
|
+
onPress
|
|
40
|
+
}) => {
|
|
41
|
+
const {
|
|
42
|
+
width: windowWidth
|
|
43
|
+
} = useWindowDimensions();
|
|
44
|
+
const translate = useSharedValue(0);
|
|
45
|
+
const {
|
|
46
|
+
swipeToDismissDirection: direction,
|
|
47
|
+
position: positionCtx
|
|
48
|
+
} = useToastContext();
|
|
49
|
+
const position = positionProps ?? positionCtx;
|
|
50
|
+
const isAndroid = Platform.OS === 'android';
|
|
51
|
+
const pan = Gesture.Pan().onBegin(() => {
|
|
52
|
+
'worklet';
|
|
53
|
+
|
|
54
|
+
if (!enabled) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
runOnJS(onBegin)();
|
|
58
|
+
}).onChange(event => {
|
|
59
|
+
'worklet';
|
|
60
|
+
|
|
61
|
+
if (!enabled) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (direction === 'left' && event.translationX < 0) {
|
|
65
|
+
translate.value = event.translationX;
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (direction === 'up') {
|
|
69
|
+
const isBottomPosition = position === 'bottom-center';
|
|
70
|
+
const rawTranslation = event.translationY * (isBottomPosition ? -1 : 1);
|
|
71
|
+
|
|
72
|
+
// Negative is the dismissal direction; dragging the other way meets
|
|
73
|
+
// progressive resistance instead of moving freely.
|
|
74
|
+
if (rawTranslation < 0) {
|
|
75
|
+
translate.value = rawTranslation;
|
|
76
|
+
} else if (rawTranslation > 0) {
|
|
77
|
+
translate.value = elasticResistance(rawTranslation);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}).onFinalize(() => {
|
|
81
|
+
'worklet';
|
|
82
|
+
|
|
83
|
+
if (!enabled) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const springBack = duration => {
|
|
87
|
+
'worklet';
|
|
88
|
+
|
|
89
|
+
translate.value = withTiming(0, {
|
|
90
|
+
easing: Easing.elastic(SPRING_BACK_EASING_BOUNCINESS),
|
|
91
|
+
duration
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
const dismiss = () => {
|
|
95
|
+
'worklet';
|
|
96
|
+
|
|
97
|
+
translate.value = withTiming(-windowWidth, {
|
|
98
|
+
easing: Easing.inOut(Easing.ease)
|
|
99
|
+
}, isDone => {
|
|
100
|
+
if (isDone) {
|
|
101
|
+
runOnJS(onRemove)();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
if (direction === 'left') {
|
|
106
|
+
if (Math.abs(translate.value) < TAP_SLOP) {
|
|
107
|
+
springBack();
|
|
108
|
+
} else if (translate.value < -windowWidth * HORIZONTAL_DISMISS_FRACTION) {
|
|
109
|
+
dismiss();
|
|
110
|
+
} else {
|
|
111
|
+
springBack();
|
|
112
|
+
}
|
|
113
|
+
} else if (direction === 'up') {
|
|
114
|
+
if (translate.value > 0) {
|
|
115
|
+
// Dragged against the dismissal direction — always settle back.
|
|
116
|
+
springBack(WRONG_DIRECTION_SPRING_DURATION);
|
|
117
|
+
} else if (Math.abs(translate.value) < TAP_SLOP) {
|
|
118
|
+
springBack();
|
|
119
|
+
} else {
|
|
120
|
+
dismiss();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
runOnJS(onFinalize)();
|
|
124
|
+
});
|
|
125
|
+
const tap = Gesture.Tap().onEnd(event => {
|
|
126
|
+
'worklet';
|
|
127
|
+
|
|
128
|
+
runOnJS(onPress)({
|
|
129
|
+
x: event.x,
|
|
130
|
+
y: event.y
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
134
|
+
const transform = direction === 'left' ? {
|
|
135
|
+
translateX: translate.value
|
|
136
|
+
} : {
|
|
137
|
+
translateY: translate.value * (position === 'bottom-center' ? -1 : 1)
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
transform: [transform],
|
|
141
|
+
// Android composites the fade poorly against the elevation shadow, so the
|
|
142
|
+
// row stays opaque there and relies on the translate alone.
|
|
143
|
+
opacity: isAndroid ? 1 : interpolate(translate.value, [0, direction === 'left' ? -windowWidth : -VERTICAL_FADE_DISTANCE], [1, 0])
|
|
144
|
+
};
|
|
145
|
+
}, [direction, translate, windowWidth, position, isAndroid]);
|
|
146
|
+
return /*#__PURE__*/_jsx(GestureDetector, {
|
|
147
|
+
gesture: Gesture.Race(tap, pan),
|
|
148
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
149
|
+
style: [animatedStyle, unstyled ? undefined : styles.centered, styles.fullWidth, style]
|
|
150
|
+
// W9 — on web `LinearTransition`'s easing degrades to CSS `ease` because
|
|
151
|
+
// a `bezierFn` result carries no easing-name symbol for the CSS mapper.
|
|
152
|
+
// Accepted: the transition still runs, only its curve differs.
|
|
153
|
+
,
|
|
154
|
+
layout: LinearTransition.easing(easeInOutCircFn)
|
|
155
|
+
// https://reactnative.dev/docs/accessibility#aria-live-android
|
|
156
|
+
,
|
|
157
|
+
"aria-live": important ? 'assertive' : 'polite',
|
|
158
|
+
children: children
|
|
159
|
+
})
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
const styles = StyleSheet.create({
|
|
163
|
+
centered: {
|
|
164
|
+
justifyContent: 'center'
|
|
165
|
+
},
|
|
166
|
+
fullWidth: {
|
|
167
|
+
width: '100%'
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Apple-style progressive resistance: the further the drag goes the less the row
|
|
173
|
+
* follows it.
|
|
174
|
+
*/
|
|
175
|
+
function elasticResistance(distance) {
|
|
176
|
+
'worklet';
|
|
177
|
+
|
|
178
|
+
const BASE_RESISTANCE = 0.4;
|
|
179
|
+
const PROGRESSIVE_DAMPENING = 0.02;
|
|
180
|
+
return distance * BASE_RESISTANCE * (1 / (1 + distance * PROGRESSIVE_DAMPENING));
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=ToastSwipeHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Platform","StyleSheet","useWindowDimensions","Gesture","GestureDetector","Animated","Easing","LinearTransition","interpolate","runOnJS","useAnimatedStyle","useSharedValue","withTiming","easeInOutCircFn","useToastContext","jsx","_jsx","HORIZONTAL_DISMISS_FRACTION","TAP_SLOP","VERTICAL_FADE_DISTANCE","SPRING_BACK_EASING_BOUNCINESS","WRONG_DIRECTION_SPRING_DURATION","ToastSwipeHandler","children","onRemove","style","onBegin","onFinalize","enabled","unstyled","important","position","positionProps","onPress","width","windowWidth","translate","swipeToDismissDirection","direction","positionCtx","isAndroid","OS","pan","Pan","onChange","event","translationX","value","isBottomPosition","rawTranslation","translationY","elasticResistance","springBack","duration","easing","elastic","dismiss","inOut","ease","isDone","Math","abs","tap","Tap","onEnd","x","y","animatedStyle","transform","translateX","translateY","opacity","gesture","Race","View","undefined","styles","centered","fullWidth","layout","create","justifyContent","distance","BASE_RESISTANCE","PROGRESSIVE_DAMPENING"],"sourceRoot":"../../../src","sources":["toast/ToastSwipeHandler.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,QAAQ,EACRC,UAAU,EACVC,mBAAmB,QAEd,cAAc;AACrB,SAASC,OAAO,EAAEC,eAAe,QAAQ,8BAA8B;AACvE,OAAOC,QAAQ,IACbC,MAAM,EACNC,gBAAgB,EAChBC,WAAW,EACXC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAEhC,SAASC,eAAe,QAAQ,iBAAc;AAC9C,SAASC,eAAe,QAAQ,cAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG5C;AACA,MAAMC,2BAA2B,GAAG,IAAI;AACxC;AACA,MAAMC,QAAQ,GAAG,EAAE;AACnB;AACA,MAAMC,sBAAsB,GAAG,EAAE;AACjC,MAAMC,6BAA6B,GAAG,GAAG;AACzC,MAAMC,+BAA+B,GAAG,GAAG;AAa3C,OAAO,MAAMC,iBAEZ,GAAGA,CAAC;EACHC,QAAQ;EACRC,QAAQ;EACRC,KAAK;EACLC,OAAO;EACPC,UAAU;EACVC,OAAO;EACPC,QAAQ;EACRC,SAAS;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