@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,274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.easeOutQuartFn = exports.easeInOutCircFn = exports.TOAST_ENTER_DRIVER = exports.MAX_CACHED_ANIMATIONS = void 0;
|
|
7
|
+
exports.getToastEnterAnimation = getToastEnterAnimation;
|
|
8
|
+
exports.getToastExitAnimation = getToastExitAnimation;
|
|
9
|
+
exports.resolveAnimationField = void 0;
|
|
10
|
+
exports.resolveToastEnterAnimation = resolveToastEnterAnimation;
|
|
11
|
+
exports.toastAnimationCacheSize = toastAnimationCacheSize;
|
|
12
|
+
exports.useToastLayoutAnimations = void 0;
|
|
13
|
+
var _reactNative = require("react-native");
|
|
14
|
+
var _reactNativeReanimated = require("react-native-reanimated");
|
|
15
|
+
var _constants = require("./constants.js");
|
|
16
|
+
var _context = require("./context.js");
|
|
17
|
+
/**
|
|
18
|
+
* Derived from sonner-native v0.26.4 — src/animations.ts, src/animation-utils.ts
|
|
19
|
+
* and src/easings.ts (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
|
|
20
|
+
*
|
|
21
|
+
* W1 — THE EXIT DEFAULT IS A `Keyframe` INSTANCE, NOT A WORKLET BUILDER.
|
|
22
|
+
*
|
|
23
|
+
* Upstream returns a custom `EntryExitAnimationFunction` for both directions. On
|
|
24
|
+
* web that produces NO animation at all: reanimated's web layout-animation
|
|
25
|
+
* manager looks the builder up by preset name, finds none, logs a warning per
|
|
26
|
+
* toast and falls through to `makeElementVisible`, so a toast simply appears and
|
|
27
|
+
* disappears. A `ReanimatedKeyframe` compiles to a real CSS `@keyframes` rule on
|
|
28
|
+
* web and to the same interpolation on native, so one definition covers both
|
|
29
|
+
* platforms — which is what the exit default below is.
|
|
30
|
+
*
|
|
31
|
+
* ON WEB THE ENTER IS NOT A LAYOUT ANIMATION — NEVER HAND IT TO `entering`
|
|
32
|
+
* THERE. This is the fix for a blocker where a second toast landed exactly on top
|
|
33
|
+
* of the first, and it MUST NOT be undone by "simplifying" the web enter back
|
|
34
|
+
* into a `Keyframe`:
|
|
35
|
+
*
|
|
36
|
+
* reanimated's web ENTERING path calls `setElementAnimation(element, config,
|
|
37
|
+
* true)`, whose third argument is `shouldSavePosition`. For any animation name
|
|
38
|
+
* that is not one of its own predefined presets — which is every `Keyframe`,
|
|
39
|
+
* since those mint a fresh `REA-ENTERING-n` rule — it also schedules
|
|
40
|
+
* `scheduleAnimationCleanup(name, duration, cb)`, and that callback runs
|
|
41
|
+
* `setElementPosition(element, snapshot)`: `position: absolute`, an explicit
|
|
42
|
+
* `top`/`left`/`width`/`height` and `transform: ''`, taken from a snapshot
|
|
43
|
+
* captured when the enter animation ENDED. The timeout is `duration * 5`, so at
|
|
44
|
+
* Bloom's 300ms enter the row is frozen in VIEWPORT coordinates 1500ms after it
|
|
45
|
+
* appeared, and its parent collapses to `height: 0`. A row that moves inside
|
|
46
|
+
* that window — i.e. any row that is still on screen when the next toast
|
|
47
|
+
* arrives — has its stack translate exactly cancelled and redraws on top of the
|
|
48
|
+
* newcomer. It is completely silent: no error, no warning.
|
|
49
|
+
*
|
|
50
|
+
* So on web the enter is driven imperatively instead: `ToastRow` seeds a shared
|
|
51
|
+
* value at 0 and animates it to 1 (`useAnimatedTarget`'s `from`), interpolating
|
|
52
|
+
* opacity and `ENTER_TRANSLATE_Y` to the same distances and curve the `Keyframe`
|
|
53
|
+
* uses, without touching reanimated's web layout-animation machinery.
|
|
54
|
+
*
|
|
55
|
+
* NATIVE KEEPS THE `Keyframe` ON `entering`. `ENTER_DRIVER` below is the ONE
|
|
56
|
+
* switch: there is no `setElementPosition` on native — that whole pin is a web-DOM
|
|
57
|
+
* behaviour — so native pays nothing for the web bug, and driving the enter
|
|
58
|
+
* imperatively there instead regressed it hard (a `bottom-center` toast stopped
|
|
59
|
+
* painting altogether). Native runs the device-verified layout-animation path and
|
|
60
|
+
* never starts a mount-time `withTiming` for the enter at all.
|
|
61
|
+
*
|
|
62
|
+
* The EXIT goes through `exiting` on BOTH platforms, which is safe: reanimated
|
|
63
|
+
* pins the throwaway dummy clone it animates (`shouldSavePosition` is false for
|
|
64
|
+
* the real element), and it is what keeps a dismissed row mounted long enough to
|
|
65
|
+
* animate.
|
|
66
|
+
*
|
|
67
|
+
* Consumer-supplied *predefined* builders (`FadeIn`, `SlideInUp`) keep working on
|
|
68
|
+
* both platforms for both enter and exit, and always go through `entering` /
|
|
69
|
+
* `exiting`. A consumer's own custom worklet builder still animates on native and
|
|
70
|
+
* is silently ignored on web, and a consumer's custom `Keyframe` passed as
|
|
71
|
+
* `animation.enter` will hit the pin described above on web — both are reanimated
|
|
72
|
+
* limitations Bloom cannot bridge.
|
|
73
|
+
*
|
|
74
|
+
* Exit instances are cached per animation shape because building one is not free
|
|
75
|
+
* and, more importantly, because `Keyframe.parseDefinitions()` MUTATES the
|
|
76
|
+
* definition object it was constructed with (it rewrites `from`/`to` into
|
|
77
|
+
* `0`/`100` and deletes them). Each cached instance therefore owns its own
|
|
78
|
+
* definition object; sharing one definition across two instances would make the
|
|
79
|
+
* second throw "Please provide 0 or 'from' keyframe". Re-parsing a single
|
|
80
|
+
* instance is idempotent, so one instance is safely shared by every row of the
|
|
81
|
+
* same shape.
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* `Easing.bezier()` (not `bezierFn`) returns an easing *factory*, which is what
|
|
86
|
+
* `Keyframe` accepts on both platforms — reanimated's dev-only worklet assertion
|
|
87
|
+
* short-circuits on the `.factory` property, so these pass without the worklets
|
|
88
|
+
* babel plugin too.
|
|
89
|
+
*/
|
|
90
|
+
const EASE_OUT_QUART = _reactNativeReanimated.Easing.bezier(0.165, 0.84, 0.44, 1);
|
|
91
|
+
const EASE_IN_OUT_CUBIC = _reactNativeReanimated.Easing.bezier(0.645, 0.045, 0.355, 1);
|
|
92
|
+
/**
|
|
93
|
+
* THE one platform switch in the toast engine: which mechanism plays Bloom's
|
|
94
|
+
* DEFAULT enter animation. See the header for why the two platforms cannot share
|
|
95
|
+
* one mechanism.
|
|
96
|
+
*/
|
|
97
|
+
const TOAST_ENTER_DRIVER = exports.TOAST_ENTER_DRIVER = _reactNative.Platform.OS === 'web' ? 'imperative' : 'layoutAnimation';
|
|
98
|
+
|
|
99
|
+
/** Worklet-callable easing for `withTiming` inside mappers and layout transitions. */
|
|
100
|
+
const easeOutQuartFn = exports.easeOutQuartFn = _reactNativeReanimated.Easing.bezierFn(0.165, 0.84, 0.44, 1);
|
|
101
|
+
const easeInOutCircFn = exports.easeInOutCircFn = _reactNativeReanimated.Easing.bezierFn(0.785, 0.135, 0.15, 0.86);
|
|
102
|
+
|
|
103
|
+
/** How far a row travels on the way in, per position. */
|
|
104
|
+
const ENTER_TRANSLATE_Y = {
|
|
105
|
+
'top-center': -20,
|
|
106
|
+
'bottom-center': 50,
|
|
107
|
+
center: 50
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/** A lone row leaves the screen entirely; a stacked one only slides by `stackGap`. */
|
|
111
|
+
const EXIT_TRANSLATE_Y_SINGLE = 150;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Bounded so an animated `gap` cannot grow the cache without limit. The natural
|
|
115
|
+
* key space is 3 enter shapes + 3 positions x hidden x single x one stackGap = 15
|
|
116
|
+
* entries, so this leaves room for a few gap values while staying O(1) memory.
|
|
117
|
+
*/
|
|
118
|
+
const MAX_CACHED_ANIMATIONS = exports.MAX_CACHED_ANIMATIONS = 32;
|
|
119
|
+
const animationCache = new Map();
|
|
120
|
+
function cachedAnimation(key, build) {
|
|
121
|
+
const hit = animationCache.get(key);
|
|
122
|
+
if (hit) {
|
|
123
|
+
return hit;
|
|
124
|
+
}
|
|
125
|
+
if (animationCache.size >= MAX_CACHED_ANIMATIONS) {
|
|
126
|
+
// Map iterates in insertion order, so this evicts the least recently added.
|
|
127
|
+
const oldest = animationCache.keys().next();
|
|
128
|
+
if (!oldest.done) {
|
|
129
|
+
animationCache.delete(oldest.value);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
const built = build();
|
|
133
|
+
animationCache.set(key, built);
|
|
134
|
+
return built;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** Exported so the bounded-growth invariant above is testable. */
|
|
138
|
+
function toastAnimationCacheSize() {
|
|
139
|
+
return animationCache.size;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Native only — on web the same shape is played imperatively by `ToastRow`. */
|
|
143
|
+
function getToastEnterAnimation(position) {
|
|
144
|
+
return cachedAnimation(`enter|${position}`, () => new _reactNativeReanimated.Keyframe({
|
|
145
|
+
from: {
|
|
146
|
+
opacity: 0,
|
|
147
|
+
transform: [{
|
|
148
|
+
translateY: ENTER_TRANSLATE_Y[position]
|
|
149
|
+
}]
|
|
150
|
+
},
|
|
151
|
+
to: {
|
|
152
|
+
opacity: 1,
|
|
153
|
+
transform: [{
|
|
154
|
+
translateY: 0
|
|
155
|
+
}],
|
|
156
|
+
easing: EASE_OUT_QUART
|
|
157
|
+
}
|
|
158
|
+
}).duration(_constants.ENTERING_ANIMATION_DURATION));
|
|
159
|
+
}
|
|
160
|
+
function getToastExitAnimation({
|
|
161
|
+
position,
|
|
162
|
+
isHiddenByLimit,
|
|
163
|
+
isSingle,
|
|
164
|
+
stackGap
|
|
165
|
+
}) {
|
|
166
|
+
return cachedAnimation(`exit|${position}|${isHiddenByLimit}|${isSingle}|${stackGap}`, () => {
|
|
167
|
+
// A row culled by `visibleToasts` is buried under the stack; sliding it
|
|
168
|
+
// would look wrong, so it only fades.
|
|
169
|
+
if (isHiddenByLimit) {
|
|
170
|
+
return new _reactNativeReanimated.Keyframe({
|
|
171
|
+
from: {
|
|
172
|
+
opacity: 1
|
|
173
|
+
},
|
|
174
|
+
to: {
|
|
175
|
+
opacity: 0,
|
|
176
|
+
easing: EASE_IN_OUT_CUBIC
|
|
177
|
+
}
|
|
178
|
+
}).duration(_constants.ENTERING_ANIMATION_DURATION);
|
|
179
|
+
}
|
|
180
|
+
const distance = isSingle ? EXIT_TRANSLATE_Y_SINGLE : stackGap;
|
|
181
|
+
const translateY = position === 'top-center' ? -distance : distance;
|
|
182
|
+
return new _reactNativeReanimated.Keyframe({
|
|
183
|
+
from: {
|
|
184
|
+
opacity: 1,
|
|
185
|
+
transform: [{
|
|
186
|
+
translateY: 0
|
|
187
|
+
}]
|
|
188
|
+
},
|
|
189
|
+
to: {
|
|
190
|
+
opacity: 0,
|
|
191
|
+
transform: [{
|
|
192
|
+
translateY
|
|
193
|
+
}],
|
|
194
|
+
easing: EASE_IN_OUT_CUBIC
|
|
195
|
+
}
|
|
196
|
+
})
|
|
197
|
+
// Matches the store's overlay teardown delay, which is also
|
|
198
|
+
// ENTERING_ANIMATION_DURATION — a longer exit would be cut off.
|
|
199
|
+
.duration(_constants.ENTERING_ANIMATION_DURATION);
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Pure so the platform split is testable without a renderer.
|
|
204
|
+
*
|
|
205
|
+
* INVARIANT: exactly ONE of `entering` / `enterTranslateY` is ever set. Both
|
|
206
|
+
* would play the enter twice; neither would leave the row with no enter animation
|
|
207
|
+
* at all and — on the imperative path — parked at `opacity: 0`, one full
|
|
208
|
+
* `enterTranslateY` away from its slot. A consumer override always wins and always
|
|
209
|
+
* goes through `entering`, on both platforms.
|
|
210
|
+
*/
|
|
211
|
+
function resolveToastEnterAnimation({
|
|
212
|
+
position,
|
|
213
|
+
enterOverride,
|
|
214
|
+
driver
|
|
215
|
+
}) {
|
|
216
|
+
if (enterOverride !== undefined && enterOverride !== 'default') {
|
|
217
|
+
return {
|
|
218
|
+
entering: enterOverride,
|
|
219
|
+
enterTranslateY: undefined
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
return driver === 'imperative' ? {
|
|
223
|
+
entering: undefined,
|
|
224
|
+
enterTranslateY: ENTER_TRANSLATE_Y[position]
|
|
225
|
+
} : {
|
|
226
|
+
entering: getToastEnterAnimation(position),
|
|
227
|
+
enterTranslateY: undefined
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/** Per-toast animation wins over the outlet's; `'default'` opts back in to Bloom's. */
|
|
232
|
+
const resolveAnimationField = (toastValue, toasterValue, defaultValue) => {
|
|
233
|
+
const resolved = toastValue !== undefined ? toastValue : toasterValue;
|
|
234
|
+
if (resolved === undefined || resolved === 'default') {
|
|
235
|
+
return defaultValue;
|
|
236
|
+
}
|
|
237
|
+
return resolved;
|
|
238
|
+
};
|
|
239
|
+
exports.resolveAnimationField = resolveAnimationField;
|
|
240
|
+
const useToastLayoutAnimations = (positionProp, animationProp, isHiddenByLimit, numberOfToasts) => {
|
|
241
|
+
const {
|
|
242
|
+
position: positionCtx,
|
|
243
|
+
gap,
|
|
244
|
+
animation: animationCtx
|
|
245
|
+
} = (0, _context.useToastContext)();
|
|
246
|
+
const position = positionProp ?? positionCtx;
|
|
247
|
+
const stackGap = gap ?? _constants.toastDefaults.stackGap;
|
|
248
|
+
const reducedMotion = (0, _reactNativeReanimated.useReducedMotion)();
|
|
249
|
+
if (reducedMotion) {
|
|
250
|
+
return {
|
|
251
|
+
entering: undefined,
|
|
252
|
+
exiting: undefined,
|
|
253
|
+
enterTranslateY: undefined
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
const defaultExiting = getToastExitAnimation({
|
|
257
|
+
position,
|
|
258
|
+
isHiddenByLimit,
|
|
259
|
+
isSingle: numberOfToasts <= 1,
|
|
260
|
+
stackGap
|
|
261
|
+
});
|
|
262
|
+
return {
|
|
263
|
+
...resolveToastEnterAnimation({
|
|
264
|
+
position,
|
|
265
|
+
enterOverride: animationProp?.enter !== undefined ? animationProp.enter : animationCtx?.enter,
|
|
266
|
+
driver: TOAST_ENTER_DRIVER
|
|
267
|
+
}),
|
|
268
|
+
// An overflow-culled row always uses Bloom's fade: a consumer's custom exit
|
|
269
|
+
// would animate a row the user cannot even see.
|
|
270
|
+
exiting: isHiddenByLimit ? defaultExiting : resolveAnimationField(animationProp?.exit, animationCtx?.exit, defaultExiting)
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
exports.useToastLayoutAnimations = useToastLayoutAnimations;
|
|
274
|
+
//# sourceMappingURL=animations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_reactNativeReanimated","_constants","_context","EASE_OUT_QUART","Easing","bezier","EASE_IN_OUT_CUBIC","TOAST_ENTER_DRIVER","exports","Platform","OS","easeOutQuartFn","bezierFn","easeInOutCircFn","ENTER_TRANSLATE_Y","center","EXIT_TRANSLATE_Y_SINGLE","MAX_CACHED_ANIMATIONS","animationCache","Map","cachedAnimation","key","build","hit","get","size","oldest","keys","next","done","delete","value","built","set","toastAnimationCacheSize","getToastEnterAnimation","position","Keyframe","from","opacity","transform","translateY","to","easing","duration","ENTERING_ANIMATION_DURATION","getToastExitAnimation","isHiddenByLimit","isSingle","stackGap","distance","resolveToastEnterAnimation","enterOverride","driver","undefined","entering","enterTranslateY","resolveAnimationField","toastValue","toasterValue","defaultValue","resolved","useToastLayoutAnimations","positionProp","animationProp","numberOfToasts","positionCtx","gap","animation","animationCtx","useToastContext","toastDefaults","reducedMotion","useReducedMotion","exiting","defaultExiting","enter","exit"],"sourceRoot":"../../../src","sources":["toast/animations.ts"],"mappings":";;;;;;;;;;;;AAkEA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAOA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AA3EA;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;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;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,cAAc,GAAGC,6BAAM,CAACC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1D,MAAMC,iBAAiB,GAAGF,6BAAM,CAACC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAI/D;AACA;AACA;AACA;AACA;AACO,MAAME,kBAAoC,GAAAC,OAAA,CAAAD,kBAAA,GAC/CE,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAG,YAAY,GAAG,iBAAiB;;AAE1D;AACO,MAAMC,cAAc,GAAAH,OAAA,CAAAG,cAAA,GAAGP,6BAAM,CAACQ,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAC5D,MAAMC,eAAe,GAAAL,OAAA,CAAAK,eAAA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,eAAe,EAAEF;IAAU,CAAC;EAChF;EAEA,MAAMqB,cAAc,GAAG7B,qBAAqB,CAAC;IAC3CV,QAAQ;IACRW,eAAe;IACfC,QAAQ,EAAEiB,cAAc,IAAI,CAAC;IAC7BhB;EACF,CAAC,CAAC;EAEF,OAAO;IACL,GAAGE,0BAA0B,CAAC;MAC5Bf,QAAQ;MACRgB,aAAa,EACXY,aAAa,EAAEY,KAAK,KAAKtB,SAAS,GAC9BU,aAAa,CAACY,KAAK,GACnBP,YAAY,EAAEO,KAAK;MACzBvB,MAAM,EAAE9C;IACV,CAAC,CAAC;IACF;IACA;IACAmE,OAAO,EAAE3B,eAAe,GACpB4B,cAAc,GACdlB,qBAAqB,CACnBO,aAAa,EAAEa,IAAI,EACnBR,YAAY,EAAEQ,IAAI,EAClBF,cACF;EACN,CAAC;AACH,CAAC;AAACnE,OAAA,CAAAsD,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.toastDefaults = exports.STACKING_ANIMATION_DURATION = exports.OUTSIDE_PRESS_PADDING = exports.MIN_STACK_SCALE_X = exports.ESTIMATED_TOAST_HEIGHT = exports.ENTERING_ANIMATION_DURATION = exports.CLOSE_BUTTON_HIT_AREA = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Derived from sonner-native v0.26.4 — src/constants.ts and src/animations.ts
|
|
9
|
+
* (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
|
|
10
|
+
*
|
|
11
|
+
* The two animation durations live HERE rather than in `animations.ts` so
|
|
12
|
+
* `toast-store.ts` never has to import a Reanimated-dependent module: the store
|
|
13
|
+
* stays pure JS and its suite needs zero React Native mocks.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** Fallback row height until a toast has been measured. */
|
|
17
|
+
const ESTIMATED_TOAST_HEIGHT = exports.ESTIMATED_TOAST_HEIGHT = 70;
|
|
18
|
+
const CLOSE_BUTTON_HIT_AREA = exports.CLOSE_BUTTON_HIT_AREA = 60;
|
|
19
|
+
const OUTSIDE_PRESS_PADDING = exports.OUTSIDE_PRESS_PADDING = 20;
|
|
20
|
+
/** However deep a stack gets, a buried row never narrows past this scale. */
|
|
21
|
+
const MIN_STACK_SCALE_X = exports.MIN_STACK_SCALE_X = 0.8;
|
|
22
|
+
|
|
23
|
+
/** Enter animation length; also the auto-close timer's head start and the overlay teardown delay. */
|
|
24
|
+
const ENTERING_ANIMATION_DURATION = exports.ENTERING_ANIMATION_DURATION = 300;
|
|
25
|
+
const STACKING_ANIMATION_DURATION = exports.STACKING_ANIMATION_DURATION = 600;
|
|
26
|
+
const toastDefaults = exports.toastDefaults = {
|
|
27
|
+
duration: 3000,
|
|
28
|
+
position: 'bottom-center',
|
|
29
|
+
/**
|
|
30
|
+
* 0 means "derive from the safe-area inset" — `getInsetValues` then yields
|
|
31
|
+
* `inset + 8`, or 16 when there is no inset. A non-zero default would pin the
|
|
32
|
+
* stack to a fixed offset and ignore the notch / home indicator entirely.
|
|
33
|
+
*/
|
|
34
|
+
offset: 0,
|
|
35
|
+
swipeToDismissDirection: 'left',
|
|
36
|
+
/**
|
|
37
|
+
* No default variant: a plain `toast('Saved')` must render neutral. Upstream
|
|
38
|
+
* defaults this to `'info'`, which silently gives every unqualified toast
|
|
39
|
+
* info styling.
|
|
40
|
+
*/
|
|
41
|
+
variant: undefined,
|
|
42
|
+
visibleToasts: 3,
|
|
43
|
+
closeButton: false,
|
|
44
|
+
dismissible: true,
|
|
45
|
+
unstyled: false,
|
|
46
|
+
invert: false,
|
|
47
|
+
pauseWhenPageIsHidden: true,
|
|
48
|
+
gap: 8,
|
|
49
|
+
theme: 'system',
|
|
50
|
+
autoWiggleOnUpdate: 'never',
|
|
51
|
+
richColors: false,
|
|
52
|
+
enableStacking: false,
|
|
53
|
+
stackGap: 8,
|
|
54
|
+
allowFontScaling: true
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ESTIMATED_TOAST_HEIGHT","exports","CLOSE_BUTTON_HIT_AREA","OUTSIDE_PRESS_PADDING","MIN_STACK_SCALE_X","ENTERING_ANIMATION_DURATION","STACKING_ANIMATION_DURATION","toastDefaults","duration","position","offset","swipeToDismissDirection","variant","undefined","visibleToasts","closeButton","dismissible","unstyled","invert","pauseWhenPageIsHidden","gap","theme","autoWiggleOnUpdate","richColors","enableStacking","stackGap","allowFontScaling"],"sourceRoot":"../../../src","sources":["toast/constants.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACO,MAAMA,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,EAAE;AACjC,MAAME,qBAAqB,GAAAD,OAAA,CAAAC,qBAAA,GAAG,EAAE;AAChC,MAAMC,qBAAqB,GAAAF,OAAA,CAAAE,qBAAA,GAAG,EAAE;AACvC;AACO,MAAMC,iBAAiB,GAAAH,OAAA,CAAAG,iBAAA,GAAG,GAAG;;AAEpC;AACO,MAAMC,2BAA2B,GAAAJ,OAAA,CAAAI,2BAAA,GAAG,GAAG;AACvC,MAAMC,2BAA2B,GAAAL,OAAA,CAAAK,2BAAA,GAAG,GAAG;AAEvC,MAAMC,aAmBZ,GAAAN,OAAA,CAAAM,aAAA,GAAG;EACFC,QAAQ,EAAE,IAAI;EACdC,QAAQ,EAAE,eAAe;EACzB;AACF;AACA;AACA;AACA;EACEC,MAAM,EAAE,CAAC;EACTC,uBAAuB,EAAE,MAAM;EAC/B;AACF;AACA;AACA;AACA;EACEC,OAAO,EAAEC,SAAS;EAClBC,aAAa,EAAE,CAAC;EAChBC,WAAW,EAAE,KAAK;EAClBC,WAAW,EAAE,IAAI;EACjBC,QAAQ,EAAE,KAAK;EACfC,MAAM,EAAE,KAAK;EACbC,qBAAqB,EAAE,IAAI;EAC3BC,GAAG,EAAE,CAAC;EACNC,KAAK,EAAE,QAAQ;EACfC,kBAAkB,EAAE,OAAO;EAC3BC,UAAU,EAAE,KAAK;EACjBC,cAAc,EAAE,KAAK;EACrBC,QAAQ,EAAE,CAAC;EACXC,gBAAgB,EAAE;AACpB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useToastContext = exports.useDynamicToastContext = exports.ToastContext = exports.DynamicToastContext = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
9
|
+
/**
|
|
10
|
+
* Derived from sonner-native v0.26.4 — src/context.tsx
|
|
11
|
+
* (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
|
|
12
|
+
*
|
|
13
|
+
* Two contexts, split by change frequency: the resolved `Toaster` configuration
|
|
14
|
+
* (stable for the lifetime of the outlet) and the live stack state (changes on
|
|
15
|
+
* every measurement). Splitting them keeps a height measurement from
|
|
16
|
+
* re-rendering every row's config-derived memo.
|
|
17
|
+
*
|
|
18
|
+
* Upstream also passes `addToast` through the stable context; Bloom's rows talk
|
|
19
|
+
* to `toastStore` directly, which is the single authority.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const ToastContext = exports.ToastContext = /*#__PURE__*/React.createContext(null);
|
|
23
|
+
ToastContext.displayName = 'BloomToastContext';
|
|
24
|
+
const DynamicToastContext = exports.DynamicToastContext = /*#__PURE__*/React.createContext(null);
|
|
25
|
+
DynamicToastContext.displayName = 'BloomDynamicToastContext';
|
|
26
|
+
const useToastContext = () => {
|
|
27
|
+
const context = React.useContext(ToastContext);
|
|
28
|
+
if (!context) {
|
|
29
|
+
throw new Error('useToastContext must be used within a <ToastOutlet>');
|
|
30
|
+
}
|
|
31
|
+
return context;
|
|
32
|
+
};
|
|
33
|
+
exports.useToastContext = useToastContext;
|
|
34
|
+
const useDynamicToastContext = () => {
|
|
35
|
+
const context = React.useContext(DynamicToastContext);
|
|
36
|
+
if (!context) {
|
|
37
|
+
throw new Error('useDynamicToastContext must be used within a <ToastOutlet>');
|
|
38
|
+
}
|
|
39
|
+
return context;
|
|
40
|
+
};
|
|
41
|
+
exports.useDynamicToastContext = useDynamicToastContext;
|
|
42
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ToastContext","exports","createContext","displayName","DynamicToastContext","useToastContext","context","useContext","Error","useDynamicToastContext"],"sourceRoot":"../../../src","sources":["toast/context.tsx"],"mappings":";;;;;;AAYA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAA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OAAA,CAAAI,eAAA,GAAAA,eAAA;AAEK,MAAMI,sBAAsB,GAAGA,CAAA,KAA+B;EACnE,MAAMH,OAAO,GAAG5B,KAAK,CAAC6B,UAAU,CAACH,mBAAmB,CAAC;EACrD,IAAI,CAACE,OAAO,EAAE;IACZ,MAAM,IAAIE,KAAK,CACb,4DACF,CAAC;EACH;EACA,OAAOF,OAAO;AAChB,CAAC;AAACL,OAAA,CAAAQ,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -3,150 +3,56 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
get: function () {
|
|
9
|
-
return _Toast.Action;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "DURATION", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _const.DURATION;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "Icon", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _Toast.Icon;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "Outer", {
|
|
6
|
+
exports.ToastOutlet = ToastOutlet;
|
|
7
|
+
Object.defineProperty(exports, "Toaster", {
|
|
25
8
|
enumerable: true,
|
|
26
9
|
get: function () {
|
|
27
|
-
return
|
|
10
|
+
return _Toaster.Toaster;
|
|
28
11
|
}
|
|
29
12
|
});
|
|
30
|
-
Object.defineProperty(exports, "
|
|
13
|
+
Object.defineProperty(exports, "toast", {
|
|
31
14
|
enumerable: true,
|
|
32
15
|
get: function () {
|
|
33
|
-
return
|
|
16
|
+
return _toastFns.toast;
|
|
34
17
|
}
|
|
35
18
|
});
|
|
36
|
-
Object.defineProperty(exports, "
|
|
19
|
+
Object.defineProperty(exports, "toastDefaults", {
|
|
37
20
|
enumerable: true,
|
|
38
21
|
get: function () {
|
|
39
|
-
return
|
|
22
|
+
return _constants.toastDefaults;
|
|
40
23
|
}
|
|
41
24
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
45
|
-
var _reactNative = require("react-native");
|
|
46
|
-
var _nonSecure = require("nanoid/non-secure");
|
|
47
|
-
var _sonnerNative = require("sonner-native");
|
|
48
|
-
var _const = require("./const.js");
|
|
49
|
-
var _Toast = require("./Toast.js");
|
|
25
|
+
var React = _interopRequireWildcard(require("react"));
|
|
26
|
+
var _Toaster = require("./Toaster.js");
|
|
50
27
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
|
+
var _toastFns = require("./toast-fns.js");
|
|
29
|
+
var _constants = require("./constants.js");
|
|
51
30
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
52
31
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*/
|
|
56
|
-
function ToastOutlet() {
|
|
57
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sonnerNative.Toaster, {
|
|
58
|
-
pauseWhenPageIsHidden: true,
|
|
59
|
-
gap: 8
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
function OuterWrapper({
|
|
63
|
-
children
|
|
64
|
-
}) {
|
|
65
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
66
|
-
style: wrapperStyles.container,
|
|
67
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.Outer, {
|
|
68
|
-
children: children
|
|
69
|
-
})
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Direct access to the Sonner API. Use sparingly — `toast()` covers the
|
|
75
|
-
* common case and keeps the surface tied to bloom's themed look.
|
|
76
|
-
*/
|
|
77
|
-
const api = exports.api = _sonnerNative.toast;
|
|
78
|
-
function dispatch(content, type, options = {}) {
|
|
79
|
-
const id = (0, _nonSecure.nanoid)();
|
|
80
|
-
if (typeof content === 'string') {
|
|
81
|
-
_sonnerNative.toast.custom(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.ToastConfigProvider, {
|
|
82
|
-
id: id,
|
|
83
|
-
type: type,
|
|
84
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(OuterWrapper, {
|
|
85
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.Icon, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.Text, {
|
|
86
|
-
children: content
|
|
87
|
-
})]
|
|
88
|
-
})
|
|
89
|
-
}), {
|
|
90
|
-
...options,
|
|
91
|
-
id,
|
|
92
|
-
duration: options?.duration ?? _const.DURATION
|
|
93
|
-
});
|
|
94
|
-
} else if (/*#__PURE__*/(0, _react.isValidElement)(content)) {
|
|
95
|
-
_sonnerNative.toast.custom(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.ToastConfigProvider, {
|
|
96
|
-
id: id,
|
|
97
|
-
type: type,
|
|
98
|
-
children: content
|
|
99
|
-
}), {
|
|
100
|
-
...options,
|
|
101
|
-
id,
|
|
102
|
-
duration: options?.duration ?? _const.DURATION
|
|
103
|
-
});
|
|
104
|
-
} else {
|
|
105
|
-
throw new Error(`Toast can be a string or a React element, got ${typeof content}`);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Show a toast notification.
|
|
32
|
+
* The toast stack. Mount this ONCE near the app root — `OxyProvider` already
|
|
33
|
+
* does, so most apps never write it themselves.
|
|
111
34
|
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
35
|
+
* Every default (position, swipe direction, offset, gap, `visibleToasts`,
|
|
36
|
+
* duration, pause-when-hidden) comes from `toastDefaults`, which `Toaster`
|
|
37
|
+
* applies; passing a prop here overrides exactly that one.
|
|
115
38
|
*
|
|
116
|
-
* ```
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* toast.error('Network error', { duration: 5000 });
|
|
120
|
-
* toast.dismiss(id);
|
|
39
|
+
* ```tsx
|
|
40
|
+
* <ToastOutlet />
|
|
41
|
+
* <ToastOutlet position="top-center" visibleToasts={5} />
|
|
121
42
|
* ```
|
|
122
43
|
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
toastImpl.success = (content, options) => dispatch(content, 'success', options ?? {});
|
|
131
|
-
toastImpl.error = (content, options) => dispatch(content, 'error', options ?? {});
|
|
132
|
-
toastImpl.warning = (content, options) => dispatch(content, 'warning', options ?? {});
|
|
133
|
-
toastImpl.info = (content, options) => dispatch(content, 'info', options ?? {});
|
|
134
|
-
toastImpl.dismiss = id => _sonnerNative.toast.dismiss(id);
|
|
135
|
-
const toast = exports.toast = toastImpl;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Alias of `toast` kept for compatibility with the original 0.4.x surface
|
|
139
|
-
* where `show()` was the documented entry point. New code should prefer
|
|
140
|
-
* `toast()` directly.
|
|
44
|
+
* On iOS a toast that must appear above a native modal needs the overlay host
|
|
45
|
+
* injected — Bloom does not depend on `react-native-screens` itself:
|
|
46
|
+
*
|
|
47
|
+
* ```tsx
|
|
48
|
+
* import { FullWindowOverlay } from 'react-native-screens';
|
|
49
|
+
* <ToastOutlet ToasterOverlayWrapper={FullWindowOverlay} />
|
|
50
|
+
* ```
|
|
141
51
|
*/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
paddingHorizontal: 20,
|
|
149
|
-
width: '100%'
|
|
150
|
-
}
|
|
151
|
-
});
|
|
52
|
+
function ToastOutlet(props) {
|
|
53
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toaster.Toaster, {
|
|
54
|
+
...props
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
ToastOutlet.displayName = 'ToastOutlet';
|
|
152
58
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_Toaster","_jsxRuntime","_toastFns","_constants","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ToastOutlet","props","jsx","Toaster","displayName"],"sourceRoot":"../../../src","sources":["toast/index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAAoC,IAAAE,WAAA,GAAAF,OAAA;AAGpC,IAAAG,SAAA,GAAAH,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AAA4C,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MA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