@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,622 @@
|
|
|
1
|
+
import { ENTERING_ANIMATION_DURATION, toastDefaults } from '../toast/constants';
|
|
2
|
+
import { toastStore } from '../toast/toast-store';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The store is deliberately free of React Native / Reanimated imports, so this
|
|
6
|
+
* suite needs no platform mocks — see the header of `toast/toast-store.ts`.
|
|
7
|
+
*/
|
|
8
|
+
const flushMicrotasks = async () => {
|
|
9
|
+
await Promise.resolve();
|
|
10
|
+
await Promise.resolve();
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
describe('toastStore', () => {
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
jest.useFakeTimers();
|
|
16
|
+
toastStore.setConfig({});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
toastStore.dismissToast(undefined);
|
|
21
|
+
// Drains the hide-overlay timeout so the next test starts from a clean state.
|
|
22
|
+
jest.runOnlyPendingTimers();
|
|
23
|
+
jest.useRealTimers();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe('enqueue', () => {
|
|
27
|
+
it('appends toasts in call order and hands back incrementing ids', () => {
|
|
28
|
+
const first = toastStore.addToast({ title: 'first' });
|
|
29
|
+
const second = toastStore.addToast({ title: 'second' });
|
|
30
|
+
|
|
31
|
+
expect([first, second]).toEqual([1, 2]);
|
|
32
|
+
expect(toastStore.getSnapshot().toasts.map((t) => t.title)).toEqual([
|
|
33
|
+
'first',
|
|
34
|
+
'second',
|
|
35
|
+
]);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('returns the caller-supplied id instead of a counter value', () => {
|
|
39
|
+
expect(toastStore.addToast({ title: 'x', id: 'my-id' })).toBe('my-id');
|
|
40
|
+
// A supplied id must not burn a counter value.
|
|
41
|
+
expect(toastStore.addToast({ title: 'y' })).toBe(1);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('falls back to the counter for an empty-string id', () => {
|
|
45
|
+
expect(toastStore.addToast({ title: 'x', id: '' })).toBe(1);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('applies the configured duration, then the default', () => {
|
|
49
|
+
toastStore.setConfig({ duration: 9000 });
|
|
50
|
+
toastStore.addToast({ title: 'configured' });
|
|
51
|
+
expect(toastStore.getSnapshot().toasts[0]?.duration).toBe(9000);
|
|
52
|
+
|
|
53
|
+
toastStore.addToast({ title: 'explicit', duration: 100 });
|
|
54
|
+
expect(toastStore.getSnapshot().toasts[1]?.duration).toBe(100);
|
|
55
|
+
|
|
56
|
+
toastStore.setConfig({});
|
|
57
|
+
toastStore.addToast({ title: 'default' });
|
|
58
|
+
expect(toastStore.getSnapshot().toasts[2]?.duration).toBe(
|
|
59
|
+
toastDefaults.duration,
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('leaves the variant absent unless one was asked for', () => {
|
|
64
|
+
toastStore.addToast({ title: 'plain' });
|
|
65
|
+
expect(toastStore.getSnapshot().toasts[0]?.variant).toBeUndefined();
|
|
66
|
+
|
|
67
|
+
toastStore.addToast({ title: 'loud', variant: 'error' });
|
|
68
|
+
expect(toastStore.getSnapshot().toasts[1]?.variant).toBe('error');
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('creates one ref per toast', () => {
|
|
72
|
+
const id = toastStore.addToast({ title: 'x' });
|
|
73
|
+
expect(toastStore.getToastRef(id)).toBeDefined();
|
|
74
|
+
expect(toastStore.getToastRef('nope')).toBeUndefined();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('auto-closes after the enter animation plus the duration', () => {
|
|
78
|
+
const onAutoClose = jest.fn();
|
|
79
|
+
toastStore.addToast({ title: 'x', duration: 1000, onAutoClose });
|
|
80
|
+
|
|
81
|
+
jest.advanceTimersByTime(ENTERING_ANIMATION_DURATION + 999);
|
|
82
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(1);
|
|
83
|
+
|
|
84
|
+
jest.advanceTimersByTime(1);
|
|
85
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(0);
|
|
86
|
+
expect(onAutoClose).toHaveBeenCalledWith(1);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
describe('visibleToasts cap', () => {
|
|
91
|
+
it('drops the oldest toast once the cap is exceeded', () => {
|
|
92
|
+
toastStore.setConfig({ visibleToasts: 2 });
|
|
93
|
+
toastStore.addToast({ title: 'a' });
|
|
94
|
+
toastStore.addToast({ title: 'b' });
|
|
95
|
+
toastStore.addToast({ title: 'c' });
|
|
96
|
+
|
|
97
|
+
const state = toastStore.getSnapshot();
|
|
98
|
+
expect(state.toasts.map((t) => t.title)).toEqual(['b', 'c']);
|
|
99
|
+
expect([...state.toastsById.keys()]).toEqual([2, 3]);
|
|
100
|
+
expect(state.toastRefs[1]).toBeUndefined();
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('defaults the cap to toastDefaults.visibleToasts', () => {
|
|
104
|
+
for (let i = 0; i < toastDefaults.visibleToasts + 2; i++) {
|
|
105
|
+
toastStore.addToast({ title: `t${i}` });
|
|
106
|
+
}
|
|
107
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(
|
|
108
|
+
toastDefaults.visibleToasts,
|
|
109
|
+
);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('stops the evicted toast auto-closing a survivor', () => {
|
|
113
|
+
toastStore.setConfig({ visibleToasts: 1 });
|
|
114
|
+
const onAutoClose = jest.fn();
|
|
115
|
+
toastStore.addToast({ title: 'a', duration: 1000, onAutoClose });
|
|
116
|
+
toastStore.addToast({ title: 'b', duration: 50_000 });
|
|
117
|
+
|
|
118
|
+
jest.advanceTimersByTime(ENTERING_ANIMATION_DURATION + 1000);
|
|
119
|
+
expect(onAutoClose).not.toHaveBeenCalled();
|
|
120
|
+
expect(toastStore.getSnapshot().toasts.map((t) => t.title)).toEqual(['b']);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('replaces toastHeights when eviction discards a measured height', () => {
|
|
124
|
+
toastStore.setConfig({ visibleToasts: 1 });
|
|
125
|
+
const id = toastStore.addToast({ title: 'a' });
|
|
126
|
+
toastStore.setToastHeight(id, 70);
|
|
127
|
+
const heights = toastStore.getSnapshot().toastHeights;
|
|
128
|
+
|
|
129
|
+
toastStore.addToast({ title: 'b' });
|
|
130
|
+
|
|
131
|
+
const state = toastStore.getSnapshot();
|
|
132
|
+
expect(state.toastHeights[id]).toBeUndefined();
|
|
133
|
+
expect(state.toastHeights).not.toBe(heights);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
describe('update by id', () => {
|
|
138
|
+
it('updates in place instead of appending', () => {
|
|
139
|
+
toastStore.addToast({ title: 'first' });
|
|
140
|
+
toastStore.addToast({ title: 'pending', id: 'job' });
|
|
141
|
+
toastStore.addToast({ title: 'last' });
|
|
142
|
+
|
|
143
|
+
toastStore.addToast({ title: 'done', id: 'job', variant: 'success' });
|
|
144
|
+
|
|
145
|
+
const state = toastStore.getSnapshot();
|
|
146
|
+
expect(state.toasts.map((t) => t.title)).toEqual([
|
|
147
|
+
'first',
|
|
148
|
+
'done',
|
|
149
|
+
'last',
|
|
150
|
+
]);
|
|
151
|
+
expect(state.toastsById.get('job')?.variant).toBe('success');
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('keeps the same ref across an update', () => {
|
|
155
|
+
const id = toastStore.addToast({ title: 'a', id: 'stable' });
|
|
156
|
+
const ref = toastStore.getToastRef(id);
|
|
157
|
+
toastStore.addToast({ title: 'b', id: 'stable' });
|
|
158
|
+
expect(toastStore.getToastRef(id)).toBe(ref);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it('restarts the auto-close timer with the updated duration', () => {
|
|
162
|
+
toastStore.addToast({ title: 'a', id: 'job', duration: 1000 });
|
|
163
|
+
jest.advanceTimersByTime(1000);
|
|
164
|
+
|
|
165
|
+
toastStore.addToast({ title: 'b', id: 'job', duration: 5000 });
|
|
166
|
+
|
|
167
|
+
jest.advanceTimersByTime(ENTERING_ANIMATION_DURATION + 4999);
|
|
168
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(1);
|
|
169
|
+
jest.advanceTimersByTime(1);
|
|
170
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(0);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
it("wiggles on every update when autoWiggleOnUpdate is 'always'", () => {
|
|
174
|
+
toastStore.setConfig({ autoWiggleOnUpdate: 'always' });
|
|
175
|
+
const id = toastStore.addToast({ title: 'same', id: 'job' });
|
|
176
|
+
const wiggle = jest.fn();
|
|
177
|
+
const ref = toastStore.getToastRef(id);
|
|
178
|
+
if (ref) ref.current = { wiggle };
|
|
179
|
+
|
|
180
|
+
toastStore.addToast({ title: 'same', id: 'job' });
|
|
181
|
+
expect(wiggle).toHaveBeenCalledTimes(1);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it("wiggles only on a visible change when autoWiggleOnUpdate is 'toast-change'", () => {
|
|
185
|
+
toastStore.setConfig({ autoWiggleOnUpdate: 'toast-change' });
|
|
186
|
+
const id = toastStore.addToast({ title: 'same', id: 'job' });
|
|
187
|
+
const wiggle = jest.fn();
|
|
188
|
+
const ref = toastStore.getToastRef(id);
|
|
189
|
+
if (ref) ref.current = { wiggle };
|
|
190
|
+
|
|
191
|
+
toastStore.addToast({ title: 'same', id: 'job' });
|
|
192
|
+
expect(wiggle).not.toHaveBeenCalled();
|
|
193
|
+
|
|
194
|
+
toastStore.addToast({ title: 'changed', id: 'job' });
|
|
195
|
+
expect(wiggle).toHaveBeenCalledTimes(1);
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
it("never wiggles when autoWiggleOnUpdate is left at 'never'", () => {
|
|
199
|
+
const id = toastStore.addToast({ title: 'a', id: 'job' });
|
|
200
|
+
const wiggle = jest.fn();
|
|
201
|
+
const ref = toastStore.getToastRef(id);
|
|
202
|
+
if (ref) ref.current = { wiggle };
|
|
203
|
+
|
|
204
|
+
toastStore.addToast({ title: 'b', id: 'job' });
|
|
205
|
+
expect(wiggle).not.toHaveBeenCalled();
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
describe('dismiss', () => {
|
|
210
|
+
it('removes one toast by id and reports the id back', () => {
|
|
211
|
+
const kept = toastStore.addToast({ title: 'keep' });
|
|
212
|
+
const dropped = toastStore.addToast({ title: 'drop' });
|
|
213
|
+
|
|
214
|
+
expect(toastStore.dismissToast(dropped)).toBe(dropped);
|
|
215
|
+
|
|
216
|
+
const state = toastStore.getSnapshot();
|
|
217
|
+
expect(state.toasts.map((t) => t.id)).toEqual([kept]);
|
|
218
|
+
expect(state.toastsById.has(dropped)).toBe(false);
|
|
219
|
+
expect(state.toastRefs[dropped]).toBeUndefined();
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
it('calls onDismiss for a user dismissal and onAutoClose otherwise', () => {
|
|
223
|
+
const onDismiss = jest.fn();
|
|
224
|
+
const onAutoClose = jest.fn();
|
|
225
|
+
const id = toastStore.addToast({ title: 'a', onDismiss, onAutoClose });
|
|
226
|
+
|
|
227
|
+
toastStore.dismissToast(id, 'onDismiss');
|
|
228
|
+
expect(onDismiss).toHaveBeenCalledWith(id);
|
|
229
|
+
expect(onAutoClose).not.toHaveBeenCalled();
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
it('cancels the auto-close timer of a dismissed toast', () => {
|
|
233
|
+
const onAutoClose = jest.fn();
|
|
234
|
+
const id = toastStore.addToast({ title: 'a', duration: 1000, onAutoClose });
|
|
235
|
+
toastStore.dismissToast(id, 'onDismiss');
|
|
236
|
+
|
|
237
|
+
jest.advanceTimersByTime(1_000_000);
|
|
238
|
+
expect(onAutoClose).not.toHaveBeenCalled();
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
it('clears everything and resets the counter on dismiss-all', () => {
|
|
242
|
+
const onDismiss = jest.fn();
|
|
243
|
+
toastStore.addToast({ title: 'a', onDismiss });
|
|
244
|
+
toastStore.addToast({ title: 'b', onDismiss });
|
|
245
|
+
|
|
246
|
+
expect(toastStore.dismissToast(undefined, 'onDismiss')).toBeUndefined();
|
|
247
|
+
|
|
248
|
+
const state = toastStore.getSnapshot();
|
|
249
|
+
expect(state.toasts).toHaveLength(0);
|
|
250
|
+
expect(state.toastsById.size).toBe(0);
|
|
251
|
+
expect(state.toastsCounter).toBe(1);
|
|
252
|
+
expect(state.toastRefs).toEqual({});
|
|
253
|
+
expect(state.toastHeights).toEqual({});
|
|
254
|
+
expect(state.isExpanded).toBe(false);
|
|
255
|
+
expect(onDismiss).toHaveBeenCalledTimes(2);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it('stops pending auto-closes on dismiss-all', () => {
|
|
259
|
+
const onAutoClose = jest.fn();
|
|
260
|
+
toastStore.addToast({ title: 'a', duration: 1000, onAutoClose });
|
|
261
|
+
toastStore.dismissToast(undefined, 'onDismiss');
|
|
262
|
+
|
|
263
|
+
jest.advanceTimersByTime(1_000_000);
|
|
264
|
+
expect(onAutoClose).not.toHaveBeenCalled();
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it('dismissing an unknown id leaves the queue untouched', () => {
|
|
268
|
+
toastStore.addToast({ title: 'a' });
|
|
269
|
+
expect(toastStore.dismissToast('ghost')).toBe('ghost');
|
|
270
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(1);
|
|
271
|
+
});
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
describe('shouldShowOverlay', () => {
|
|
275
|
+
it('turns on with the first toast and off only after the exit animation', () => {
|
|
276
|
+
expect(toastStore.getSnapshot().shouldShowOverlay).toBe(false);
|
|
277
|
+
|
|
278
|
+
const id = toastStore.addToast({ title: 'a' });
|
|
279
|
+
expect(toastStore.getSnapshot().shouldShowOverlay).toBe(true);
|
|
280
|
+
|
|
281
|
+
toastStore.dismissToast(id, 'onDismiss');
|
|
282
|
+
// Still on — the row is mid-exit.
|
|
283
|
+
expect(toastStore.getSnapshot().shouldShowOverlay).toBe(true);
|
|
284
|
+
|
|
285
|
+
jest.advanceTimersByTime(ENTERING_ANIMATION_DURATION - 1);
|
|
286
|
+
expect(toastStore.getSnapshot().shouldShowOverlay).toBe(true);
|
|
287
|
+
|
|
288
|
+
jest.advanceTimersByTime(1);
|
|
289
|
+
expect(toastStore.getSnapshot().shouldShowOverlay).toBe(false);
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
it('stays on while other toasts remain', () => {
|
|
293
|
+
const first = toastStore.addToast({ title: 'a' });
|
|
294
|
+
toastStore.addToast({ title: 'b' });
|
|
295
|
+
|
|
296
|
+
toastStore.dismissToast(first, 'onDismiss');
|
|
297
|
+
jest.advanceTimersByTime(ENTERING_ANIMATION_DURATION * 2);
|
|
298
|
+
|
|
299
|
+
expect(toastStore.getSnapshot().shouldShowOverlay).toBe(true);
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
it('cancels a scheduled hide when a new toast arrives first', () => {
|
|
303
|
+
const id = toastStore.addToast({ title: 'a' });
|
|
304
|
+
toastStore.dismissToast(id, 'onDismiss');
|
|
305
|
+
|
|
306
|
+
toastStore.addToast({ title: 'b' });
|
|
307
|
+
jest.advanceTimersByTime(ENTERING_ANIMATION_DURATION * 2);
|
|
308
|
+
|
|
309
|
+
expect(toastStore.getSnapshot().shouldShowOverlay).toBe(true);
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Row offsets are recomputed in React from `toastHeights` (see
|
|
315
|
+
* `use-toast-position.ts`), so a mutation MUST produce a new object or the
|
|
316
|
+
* recompute never happens and the stack overlaps itself. This replaces the
|
|
317
|
+
* hand-rolled `toastHeightsVersion` counter upstream needs for its worklet.
|
|
318
|
+
*/
|
|
319
|
+
describe('toastHeights identity', () => {
|
|
320
|
+
it('replaces the object on every height mutation', () => {
|
|
321
|
+
const id = toastStore.addToast({ title: 'a' });
|
|
322
|
+
const initial = toastStore.getSnapshot().toastHeights;
|
|
323
|
+
|
|
324
|
+
toastStore.setToastHeight(id, 70);
|
|
325
|
+
const afterFirst = toastStore.getSnapshot().toastHeights;
|
|
326
|
+
expect(afterFirst).not.toBe(initial);
|
|
327
|
+
expect(afterFirst[id]).toBe(70);
|
|
328
|
+
|
|
329
|
+
toastStore.setToastHeight(id, 84);
|
|
330
|
+
const afterSecond = toastStore.getSnapshot().toastHeights;
|
|
331
|
+
expect(afterSecond).not.toBe(afterFirst);
|
|
332
|
+
expect(afterSecond[id]).toBe(84);
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
it('never mutates a previously handed-out object', () => {
|
|
336
|
+
const id = toastStore.addToast({ title: 'a' });
|
|
337
|
+
toastStore.setToastHeight(id, 70);
|
|
338
|
+
const snapshot = toastStore.getSnapshot().toastHeights;
|
|
339
|
+
|
|
340
|
+
const second = toastStore.addToast({ title: 'b' });
|
|
341
|
+
toastStore.setToastHeight(second, 40);
|
|
342
|
+
|
|
343
|
+
// The object a previous render captured must still read as it did then.
|
|
344
|
+
expect(snapshot[second]).toBeUndefined();
|
|
345
|
+
expect(Object.keys(snapshot)).toEqual([String(id)]);
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
it('keeps the same object when the height is unchanged', () => {
|
|
349
|
+
const id = toastStore.addToast({ title: 'a' });
|
|
350
|
+
toastStore.setToastHeight(id, 70);
|
|
351
|
+
const heights = toastStore.getSnapshot().toastHeights;
|
|
352
|
+
|
|
353
|
+
toastStore.setToastHeight(id, 70);
|
|
354
|
+
expect(toastStore.getSnapshot().toastHeights).toBe(heights);
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
it('replaces the object when a dismissal drops a height', () => {
|
|
358
|
+
const id = toastStore.addToast({ title: 'a' });
|
|
359
|
+
toastStore.setToastHeight(id, 70);
|
|
360
|
+
const heights = toastStore.getSnapshot().toastHeights;
|
|
361
|
+
|
|
362
|
+
toastStore.dismissToast(id, 'onDismiss');
|
|
363
|
+
expect(toastStore.getSnapshot().toastHeights).not.toBe(heights);
|
|
364
|
+
expect(toastStore.getSnapshot().toastHeights[id]).toBeUndefined();
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
it('replaces the object on dismiss-all', () => {
|
|
368
|
+
const id = toastStore.addToast({ title: 'a' });
|
|
369
|
+
toastStore.setToastHeight(id, 70);
|
|
370
|
+
const heights = toastStore.getSnapshot().toastHeights;
|
|
371
|
+
|
|
372
|
+
toastStore.dismissToast(undefined, 'onDismiss');
|
|
373
|
+
expect(toastStore.getSnapshot().toastHeights).not.toBe(heights);
|
|
374
|
+
expect(toastStore.getSnapshot().toastHeights).toEqual({});
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
describe('promise lifecycle', () => {
|
|
379
|
+
it('starts pending, then swaps in the resolved title', async () => {
|
|
380
|
+
const id = toastStore.addToast({
|
|
381
|
+
title: 'Saving…',
|
|
382
|
+
variant: 'loading',
|
|
383
|
+
promiseOptions: {
|
|
384
|
+
promise: Promise.resolve('Saved'),
|
|
385
|
+
loading: 'Saving…',
|
|
386
|
+
error: 'Failed',
|
|
387
|
+
},
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
expect(toastStore.getSnapshot().toasts[0]).toMatchObject({
|
|
391
|
+
title: 'Saving…',
|
|
392
|
+
variant: 'loading',
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
await flushMicrotasks();
|
|
396
|
+
|
|
397
|
+
const settled = toastStore.getSnapshot().toastsById.get(id);
|
|
398
|
+
expect(settled).toMatchObject({ title: 'Saved', variant: 'success' });
|
|
399
|
+
expect(settled?.promiseOptions).toBeUndefined();
|
|
400
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(1);
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
it('swaps in the rejected title from an error formatter', async () => {
|
|
404
|
+
const id = toastStore.addToast({
|
|
405
|
+
title: 'Saving…',
|
|
406
|
+
variant: 'loading',
|
|
407
|
+
promiseOptions: {
|
|
408
|
+
promise: Promise.reject(new Error('offline')),
|
|
409
|
+
loading: 'Saving…',
|
|
410
|
+
error: (error: unknown) =>
|
|
411
|
+
`Failed: ${error instanceof Error ? error.message : 'unknown'}`,
|
|
412
|
+
},
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
await flushMicrotasks();
|
|
416
|
+
|
|
417
|
+
expect(toastStore.getSnapshot().toastsById.get(id)).toMatchObject({
|
|
418
|
+
title: 'Failed: offline',
|
|
419
|
+
variant: 'error',
|
|
420
|
+
});
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
it('accepts a plain string as the rejected title', async () => {
|
|
424
|
+
const id = toastStore.addToast({
|
|
425
|
+
title: 'Saving…',
|
|
426
|
+
variant: 'loading',
|
|
427
|
+
promiseOptions: {
|
|
428
|
+
promise: Promise.reject(new Error('offline')),
|
|
429
|
+
loading: 'Saving…',
|
|
430
|
+
error: 'Could not save',
|
|
431
|
+
},
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
await flushMicrotasks();
|
|
435
|
+
|
|
436
|
+
expect(toastStore.getSnapshot().toastsById.get(id)?.title).toBe(
|
|
437
|
+
'Could not save',
|
|
438
|
+
);
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
it('does not auto-close while the promise is pending', () => {
|
|
442
|
+
let resolvePromise: ((value: string) => void) | undefined;
|
|
443
|
+
toastStore.addToast({
|
|
444
|
+
title: 'Saving…',
|
|
445
|
+
duration: 1000,
|
|
446
|
+
promiseOptions: {
|
|
447
|
+
promise: new Promise<string>((resolve) => {
|
|
448
|
+
resolvePromise = resolve;
|
|
449
|
+
}),
|
|
450
|
+
loading: 'Saving…',
|
|
451
|
+
error: 'Failed',
|
|
452
|
+
},
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
jest.advanceTimersByTime(1_000_000);
|
|
456
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(1);
|
|
457
|
+
resolvePromise?.('Saved');
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
it('auto-closes once the promise has settled', async () => {
|
|
461
|
+
toastStore.addToast({
|
|
462
|
+
title: 'Saving…',
|
|
463
|
+
duration: 1000,
|
|
464
|
+
promiseOptions: {
|
|
465
|
+
promise: Promise.resolve('Saved'),
|
|
466
|
+
loading: 'Saving…',
|
|
467
|
+
error: 'Failed',
|
|
468
|
+
},
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
await flushMicrotasks();
|
|
472
|
+
jest.advanceTimersByTime(ENTERING_ANIMATION_DURATION + 1000);
|
|
473
|
+
|
|
474
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(0);
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
it('drops the result of a promise whose toast was already dismissed', async () => {
|
|
478
|
+
const id = toastStore.addToast({
|
|
479
|
+
title: 'Saving…',
|
|
480
|
+
promiseOptions: {
|
|
481
|
+
promise: Promise.resolve('Saved'),
|
|
482
|
+
loading: 'Saving…',
|
|
483
|
+
error: 'Failed',
|
|
484
|
+
},
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
toastStore.dismissToast(id, 'onDismiss');
|
|
488
|
+
await flushMicrotasks();
|
|
489
|
+
|
|
490
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(0);
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
it('applies the per-phase styles', async () => {
|
|
494
|
+
const loadingStyles = { title: { fontSize: 10 } };
|
|
495
|
+
const successStyles = { title: { fontSize: 20 } };
|
|
496
|
+
const id = toastStore.addToast({
|
|
497
|
+
title: 'Saving…',
|
|
498
|
+
styles: loadingStyles,
|
|
499
|
+
promiseOptions: {
|
|
500
|
+
promise: Promise.resolve('Saved'),
|
|
501
|
+
loading: 'Saving…',
|
|
502
|
+
error: 'Failed',
|
|
503
|
+
styles: { loading: loadingStyles, success: successStyles },
|
|
504
|
+
},
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
expect(toastStore.getSnapshot().toastsById.get(id)?.styles).toBe(
|
|
508
|
+
loadingStyles,
|
|
509
|
+
);
|
|
510
|
+
|
|
511
|
+
await flushMicrotasks();
|
|
512
|
+
expect(toastStore.getSnapshot().toastsById.get(id)?.styles).toBe(
|
|
513
|
+
successStyles,
|
|
514
|
+
);
|
|
515
|
+
});
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
describe('wiggle', () => {
|
|
519
|
+
it('calls the row ref and restarts the auto-close timer', () => {
|
|
520
|
+
const id = toastStore.addToast({ title: 'a', duration: 1000 });
|
|
521
|
+
const wiggle = jest.fn();
|
|
522
|
+
const ref = toastStore.getToastRef(id);
|
|
523
|
+
if (ref) ref.current = { wiggle };
|
|
524
|
+
|
|
525
|
+
jest.advanceTimersByTime(1000);
|
|
526
|
+
toastStore.wiggleToast(id);
|
|
527
|
+
expect(wiggle).toHaveBeenCalledTimes(1);
|
|
528
|
+
|
|
529
|
+
jest.advanceTimersByTime(ENTERING_ANIMATION_DURATION + 999);
|
|
530
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(1);
|
|
531
|
+
jest.advanceTimersByTime(1);
|
|
532
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(0);
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
it('ignores an unknown id', () => {
|
|
536
|
+
expect(() => toastStore.wiggleToast('ghost')).not.toThrow();
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
it('never starts a timer for a toast that should stay up forever', () => {
|
|
540
|
+
const id = toastStore.addToast({ title: 'a', duration: Infinity });
|
|
541
|
+
toastStore.wiggleToast(id);
|
|
542
|
+
|
|
543
|
+
jest.advanceTimersByTime(1_000_000);
|
|
544
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(1);
|
|
545
|
+
});
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
describe('expand / collapse', () => {
|
|
549
|
+
it('pauses timers while expanded and resumes them on collapse', () => {
|
|
550
|
+
toastStore.addToast({ title: 'a', duration: 1000 });
|
|
551
|
+
|
|
552
|
+
toastStore.expand();
|
|
553
|
+
expect(toastStore.getSnapshot().isExpanded).toBe(true);
|
|
554
|
+
jest.advanceTimersByTime(1_000_000);
|
|
555
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(1);
|
|
556
|
+
|
|
557
|
+
toastStore.collapse();
|
|
558
|
+
expect(toastStore.getSnapshot().isExpanded).toBe(false);
|
|
559
|
+
jest.advanceTimersByTime(1000);
|
|
560
|
+
expect(toastStore.getSnapshot().toasts).toHaveLength(0);
|
|
561
|
+
});
|
|
562
|
+
|
|
563
|
+
it('ignores a re-expand inside the collapse cooldown', () => {
|
|
564
|
+
toastStore.addToast({ title: 'a' });
|
|
565
|
+
toastStore.expand();
|
|
566
|
+
toastStore.collapse();
|
|
567
|
+
|
|
568
|
+
toastStore.toggleExpand();
|
|
569
|
+
expect(toastStore.getSnapshot().isExpanded).toBe(false);
|
|
570
|
+
|
|
571
|
+
jest.advanceTimersByTime(100);
|
|
572
|
+
toastStore.toggleExpand();
|
|
573
|
+
expect(toastStore.getSnapshot().isExpanded).toBe(true);
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
it('auto-collapses once only one toast is left', () => {
|
|
577
|
+
const first = toastStore.addToast({ title: 'a' });
|
|
578
|
+
toastStore.addToast({ title: 'b' });
|
|
579
|
+
toastStore.expand();
|
|
580
|
+
|
|
581
|
+
toastStore.dismissToast(first, 'onDismiss');
|
|
582
|
+
expect(toastStore.getSnapshot().isExpanded).toBe(false);
|
|
583
|
+
});
|
|
584
|
+
});
|
|
585
|
+
|
|
586
|
+
describe('subscription', () => {
|
|
587
|
+
it('keeps the snapshot referentially stable while nothing changes', () => {
|
|
588
|
+
const snapshot = toastStore.getSnapshot();
|
|
589
|
+
expect(toastStore.getSnapshot()).toBe(snapshot);
|
|
590
|
+
|
|
591
|
+
const id = toastStore.addToast({ title: 'a' });
|
|
592
|
+
const afterAdd = toastStore.getSnapshot();
|
|
593
|
+
expect(afterAdd).not.toBe(snapshot);
|
|
594
|
+
expect(toastStore.getSnapshot()).toBe(afterAdd);
|
|
595
|
+
|
|
596
|
+
// A no-op height write must not invalidate the snapshot.
|
|
597
|
+
toastStore.setToastHeight(id, 70);
|
|
598
|
+
const afterHeight = toastStore.getSnapshot();
|
|
599
|
+
toastStore.setToastHeight(id, 70);
|
|
600
|
+
expect(toastStore.getSnapshot()).toBe(afterHeight);
|
|
601
|
+
});
|
|
602
|
+
|
|
603
|
+
it('notifies subscribers on mutation and stops after unsubscribe', () => {
|
|
604
|
+
const listener = jest.fn();
|
|
605
|
+
const unsubscribe = toastStore.subscribe(listener);
|
|
606
|
+
|
|
607
|
+
const id = toastStore.addToast({ title: 'a' });
|
|
608
|
+
expect(listener).toHaveBeenCalledTimes(1);
|
|
609
|
+
|
|
610
|
+
toastStore.setToastHeight(id, 70);
|
|
611
|
+
expect(listener).toHaveBeenCalledTimes(2);
|
|
612
|
+
|
|
613
|
+
// Unchanged height — no notification.
|
|
614
|
+
toastStore.setToastHeight(id, 70);
|
|
615
|
+
expect(listener).toHaveBeenCalledTimes(2);
|
|
616
|
+
|
|
617
|
+
unsubscribe();
|
|
618
|
+
toastStore.addToast({ title: 'b' });
|
|
619
|
+
expect(listener).toHaveBeenCalledTimes(2);
|
|
620
|
+
});
|
|
621
|
+
});
|
|
622
|
+
});
|