@hanzogui/toast 8.3.1 → 8.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Toast.js +122 -0
- package/dist/cjs/Toast.js.map +1 -0
- package/dist/cjs/ToastAnnounce.js +55 -0
- package/dist/cjs/ToastAnnounce.js.map +1 -0
- package/dist/cjs/ToastComposable.js +849 -0
- package/dist/cjs/ToastComposable.js.map +1 -0
- package/dist/cjs/ToastImperative.js +90 -0
- package/dist/cjs/ToastImperative.js.map +1 -0
- package/dist/cjs/ToastImpl.js +307 -0
- package/dist/cjs/ToastImpl.js.map +1 -0
- package/dist/cjs/ToastItemFrame.js +121 -0
- package/dist/cjs/ToastItemFrame.js.map +1 -0
- package/dist/cjs/ToastPortal.js +16 -0
- package/dist/cjs/ToastPortal.js.map +1 -0
- package/dist/cjs/ToastProvider.js +72 -0
- package/dist/cjs/ToastProvider.js.map +1 -0
- package/dist/cjs/ToastState.js +284 -0
- package/dist/cjs/ToastState.js.map +1 -0
- package/dist/cjs/ToastViewport.js +289 -0
- package/dist/cjs/ToastViewport.js.map +1 -0
- package/dist/cjs/Toaster.js +13 -0
- package/dist/cjs/Toaster.js.map +1 -0
- package/dist/cjs/constants.js +6 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/createNativeToast.js +42 -0
- package/dist/cjs/createNativeToast.js.map +1 -0
- package/dist/cjs/dispatchNativeToast.js +31 -0
- package/dist/cjs/dispatchNativeToast.js.map +1 -0
- package/dist/cjs/index.js +5 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/useAnimatedDragGesture.js +251 -0
- package/dist/cjs/useAnimatedDragGesture.js.map +1 -0
- package/dist/cjs/useReducedMotion.js +52 -0
- package/dist/cjs/useReducedMotion.js.map +1 -0
- package/dist/cjs/useToastAnimations.js +252 -0
- package/dist/cjs/useToastAnimations.js.map +1 -0
- package/dist/cjs/v2.js +17 -0
- package/dist/cjs/v2.js.map +1 -0
- package/dist/esm/Toast.js +117 -0
- package/dist/esm/Toast.js.map +1 -0
- package/dist/esm/ToastAnnounce.js +50 -0
- package/dist/esm/ToastAnnounce.js.map +1 -0
- package/dist/esm/ToastComposable.js +843 -0
- package/dist/esm/ToastComposable.js.map +1 -0
- package/dist/esm/ToastImperative.js +82 -0
- package/dist/esm/ToastImperative.js.map +1 -0
- package/dist/esm/ToastImpl.js +301 -0
- package/dist/esm/ToastImpl.js.map +1 -0
- package/dist/esm/ToastItemFrame.js +117 -0
- package/dist/esm/ToastItemFrame.js.map +1 -0
- package/dist/esm/ToastPortal.js +13 -0
- package/dist/esm/ToastPortal.js.map +1 -0
- package/dist/esm/ToastProvider.js +64 -0
- package/dist/esm/ToastProvider.js.map +1 -0
- package/dist/esm/ToastState.js +281 -0
- package/dist/esm/ToastState.js.map +1 -0
- package/dist/esm/ToastViewport.js +282 -0
- package/dist/esm/ToastViewport.js.map +1 -0
- package/dist/esm/Toaster.js +9 -0
- package/dist/esm/Toaster.js.map +1 -0
- package/dist/esm/constants.js +3 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/createNativeToast.js +36 -0
- package/dist/esm/createNativeToast.js.map +1 -0
- package/dist/esm/dispatchNativeToast.js +28 -0
- package/dist/esm/dispatchNativeToast.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/useAnimatedDragGesture.js +247 -0
- package/dist/esm/useAnimatedDragGesture.js.map +1 -0
- package/dist/esm/useReducedMotion.js +48 -0
- package/dist/esm/useReducedMotion.js.map +1 -0
- package/dist/esm/useToastAnimations.js +248 -0
- package/dist/esm/useToastAnimations.js.map +1 -0
- package/dist/esm/v2.js +8 -0
- package/dist/esm/v2.js.map +1 -0
- package/dist/native/Toast.js +117 -0
- package/dist/native/Toast.js.map +1 -0
- package/dist/native/ToastAnnounce.js +50 -0
- package/dist/native/ToastAnnounce.js.map +1 -0
- package/dist/native/ToastComposable.js +843 -0
- package/dist/native/ToastComposable.js.map +1 -0
- package/dist/native/ToastImperative.js +82 -0
- package/dist/native/ToastImperative.js.map +1 -0
- package/dist/native/ToastImpl.js +301 -0
- package/dist/native/ToastImpl.js.map +1 -0
- package/dist/native/ToastItemFrame.js +117 -0
- package/dist/native/ToastItemFrame.js.map +1 -0
- package/dist/native/ToastPortal.js +13 -0
- package/dist/native/ToastPortal.js.map +1 -0
- package/dist/native/ToastProvider.js +64 -0
- package/dist/native/ToastProvider.js.map +1 -0
- package/dist/native/ToastState.js +281 -0
- package/dist/native/ToastState.js.map +1 -0
- package/dist/native/ToastViewport.js +282 -0
- package/dist/native/ToastViewport.js.map +1 -0
- package/dist/native/Toaster.js +9 -0
- package/dist/native/Toaster.js.map +1 -0
- package/dist/native/constants.js +3 -0
- package/dist/native/constants.js.map +1 -0
- package/dist/native/createNativeToast.js +25 -0
- package/dist/native/createNativeToast.js.map +1 -0
- package/dist/native/dispatchNativeToast.js +28 -0
- package/dist/native/dispatchNativeToast.js.map +1 -0
- package/dist/native/index.js +2 -0
- package/dist/native/index.js.map +1 -0
- package/dist/native/types.js +2 -0
- package/dist/native/types.js.map +1 -0
- package/dist/native/useAnimatedDragGesture.js +210 -0
- package/dist/native/useAnimatedDragGesture.js.map +1 -0
- package/dist/native/useReducedMotion.js +48 -0
- package/dist/native/useReducedMotion.js.map +1 -0
- package/dist/native/useToastAnimations.js +248 -0
- package/dist/native/useToastAnimations.js.map +1 -0
- package/dist/native/v2.js +8 -0
- package/dist/native/v2.js.map +1 -0
- package/package.json +48 -44
- package/src/Toast.tsx +9 -9
- package/src/ToastAnnounce.tsx +2 -2
- package/src/ToastComposable.tsx +9 -9
- package/src/ToastImperative.tsx +2 -2
- package/src/ToastImpl.tsx +5 -5
- package/src/ToastPortal.tsx +4 -1
- package/src/ToastProvider.tsx +4 -4
- package/src/ToastState.ts +1 -1
- package/src/ToastViewport.tsx +4 -4
- package/src/Toaster.tsx +5 -5
- package/src/createNativeToast.native.tsx +1 -1
- package/src/createNativeToast.tsx +1 -1
- package/src/dispatchNativeToast.ts +3 -3
- package/src/index.ts +7 -3
- package/src/useAnimatedDragGesture.native.ts +1 -1
- package/src/useAnimatedDragGesture.ts +1 -1
- package/src/v2.ts +13 -9
- package/types/Toast.d.ts +19 -19
- package/types/Toast.d.ts.map +1 -1
- package/types/ToastAnnounce.d.ts +1 -1
- package/types/ToastAnnounce.d.ts.map +1 -1
- package/types/ToastComposable.d.ts +14 -14
- package/types/ToastComposable.d.ts.map +1 -1
- package/types/ToastImperative.d.ts +3 -3
- package/types/ToastImperative.d.ts.map +1 -1
- package/types/ToastImpl.d.ts +7 -7
- package/types/ToastImpl.d.ts.map +1 -1
- package/types/ToastItemFrame.d.ts +4 -4
- package/types/ToastItemFrame.d.ts.map +1 -1
- package/types/ToastPortal.d.ts +2 -2
- package/types/ToastPortal.d.ts.map +1 -1
- package/types/ToastProvider.d.ts +3 -3
- package/types/ToastProvider.d.ts.map +1 -1
- package/types/ToastState.d.ts +15 -12
- package/types/ToastState.d.ts.map +1 -1
- package/types/ToastViewport.d.ts +5 -5
- package/types/Toaster.d.ts +4 -4
- package/types/Toaster.d.ts.map +1 -1
- package/types/createNativeToast.d.ts +1 -1
- package/types/createNativeToast.d.ts.map +1 -1
- package/types/createNativeToast.native.d.ts +1 -1
- package/types/createNativeToast.native.d.ts.map +1 -1
- package/types/dispatchNativeToast.d.ts +2 -2
- package/types/dispatchNativeToast.d.ts.map +1 -1
- package/types/index.d.ts +3 -3
- package/types/index.d.ts.map +1 -1
- package/types/useAnimatedDragGesture.d.ts +1 -1
- package/types/useAnimatedDragGesture.d.ts.map +1 -1
- package/types/useAnimatedDragGesture.native.d.ts +1 -1
- package/types/useAnimatedDragGesture.native.d.ts.map +1 -1
- package/types/v2.d.ts +9 -9
- package/types/v2.d.ts.map +1 -1
- package/dist/cjs/Toast.cjs +0 -178
- package/dist/cjs/Toast.native.js +0 -181
- package/dist/cjs/Toast.native.js.map +0 -1
- package/dist/cjs/ToastAnnounce.cjs +0 -103
- package/dist/cjs/ToastAnnounce.native.js +0 -111
- package/dist/cjs/ToastAnnounce.native.js.map +0 -1
- package/dist/cjs/ToastComposable.cjs +0 -947
- package/dist/cjs/ToastComposable.native.js +0 -1055
- package/dist/cjs/ToastComposable.native.js.map +0 -1
- package/dist/cjs/ToastImperative.cjs +0 -119
- package/dist/cjs/ToastImperative.native.js +0 -130
- package/dist/cjs/ToastImperative.native.js.map +0 -1
- package/dist/cjs/ToastImpl.cjs +0 -354
- package/dist/cjs/ToastImpl.native.js +0 -364
- package/dist/cjs/ToastImpl.native.js.map +0 -1
- package/dist/cjs/ToastItemFrame.cjs +0 -143
- package/dist/cjs/ToastItemFrame.native.js +0 -148
- package/dist/cjs/ToastItemFrame.native.js.map +0 -1
- package/dist/cjs/ToastPortal.cjs +0 -49
- package/dist/cjs/ToastPortal.native.js +0 -52
- package/dist/cjs/ToastPortal.native.js.map +0 -1
- package/dist/cjs/ToastProvider.cjs +0 -150
- package/dist/cjs/ToastProvider.native.js +0 -161
- package/dist/cjs/ToastProvider.native.js.map +0 -1
- package/dist/cjs/ToastState.cjs +0 -311
- package/dist/cjs/ToastState.native.js +0 -324
- package/dist/cjs/ToastState.native.js.map +0 -1
- package/dist/cjs/ToastViewport.cjs +0 -319
- package/dist/cjs/ToastViewport.native.js +0 -343
- package/dist/cjs/ToastViewport.native.js.map +0 -1
- package/dist/cjs/Toaster.cjs +0 -87
- package/dist/cjs/Toaster.native.js +0 -91
- package/dist/cjs/Toaster.native.js.map +0 -1
- package/dist/cjs/constants.cjs +0 -30
- package/dist/cjs/constants.native.js +0 -33
- package/dist/cjs/constants.native.js.map +0 -1
- package/dist/cjs/createNativeToast.cjs +0 -59
- package/dist/cjs/createNativeToast.native.js +0 -60
- package/dist/cjs/createNativeToast.native.js.map +0 -1
- package/dist/cjs/dispatchNativeToast.cjs +0 -47
- package/dist/cjs/dispatchNativeToast.native.js +0 -52
- package/dist/cjs/dispatchNativeToast.native.js.map +0 -1
- package/dist/cjs/index.cjs +0 -20
- package/dist/cjs/index.native.js +0 -23
- package/dist/cjs/index.native.js.map +0 -1
- package/dist/cjs/types.cjs +0 -18
- package/dist/cjs/types.native.js +0 -21
- package/dist/cjs/types.native.js.map +0 -1
- package/dist/cjs/useAnimatedDragGesture.cjs +0 -214
- package/dist/cjs/useAnimatedDragGesture.native.js +0 -224
- package/dist/cjs/useAnimatedDragGesture.native.js.map +0 -1
- package/dist/cjs/useReducedMotion.cjs +0 -74
- package/dist/cjs/useReducedMotion.native.js +0 -83
- package/dist/cjs/useReducedMotion.native.js.map +0 -1
- package/dist/cjs/useToastAnimations.cjs +0 -292
- package/dist/cjs/useToastAnimations.native.js +0 -302
- package/dist/cjs/useToastAnimations.native.js.map +0 -1
- package/dist/cjs/v2.cjs +0 -36
- package/dist/cjs/v2.native.js +0 -39
- package/dist/cjs/v2.native.js.map +0 -1
- package/dist/esm/Toast.mjs +0 -137
- package/dist/esm/Toast.mjs.map +0 -1
- package/dist/esm/Toast.native.js +0 -137
- package/dist/esm/Toast.native.js.map +0 -1
- package/dist/esm/ToastAnnounce.mjs +0 -66
- package/dist/esm/ToastAnnounce.mjs.map +0 -1
- package/dist/esm/ToastAnnounce.native.js +0 -71
- package/dist/esm/ToastAnnounce.native.js.map +0 -1
- package/dist/esm/ToastComposable.mjs +0 -909
- package/dist/esm/ToastComposable.mjs.map +0 -1
- package/dist/esm/ToastComposable.native.js +0 -1014
- package/dist/esm/ToastComposable.native.js.map +0 -1
- package/dist/esm/ToastImperative.mjs +0 -80
- package/dist/esm/ToastImperative.mjs.map +0 -1
- package/dist/esm/ToastImperative.native.js +0 -88
- package/dist/esm/ToastImperative.native.js.map +0 -1
- package/dist/esm/ToastImpl.mjs +0 -316
- package/dist/esm/ToastImpl.mjs.map +0 -1
- package/dist/esm/ToastImpl.native.js +0 -329
- package/dist/esm/ToastImpl.native.js.map +0 -1
- package/dist/esm/ToastItemFrame.mjs +0 -114
- package/dist/esm/ToastItemFrame.mjs.map +0 -1
- package/dist/esm/ToastItemFrame.native.js +0 -116
- package/dist/esm/ToastItemFrame.native.js.map +0 -1
- package/dist/esm/ToastPortal.mjs +0 -24
- package/dist/esm/ToastPortal.mjs.map +0 -1
- package/dist/esm/ToastPortal.native.js +0 -24
- package/dist/esm/ToastPortal.native.js.map +0 -1
- package/dist/esm/ToastProvider.mjs +0 -110
- package/dist/esm/ToastProvider.mjs.map +0 -1
- package/dist/esm/ToastProvider.native.js +0 -118
- package/dist/esm/ToastProvider.native.js.map +0 -1
- package/dist/esm/ToastState.mjs +0 -285
- package/dist/esm/ToastState.mjs.map +0 -1
- package/dist/esm/ToastState.native.js +0 -295
- package/dist/esm/ToastState.native.js.map +0 -1
- package/dist/esm/ToastViewport.mjs +0 -280
- package/dist/esm/ToastViewport.mjs.map +0 -1
- package/dist/esm/ToastViewport.native.js +0 -301
- package/dist/esm/ToastViewport.native.js.map +0 -1
- package/dist/esm/Toaster.mjs +0 -51
- package/dist/esm/Toaster.mjs.map +0 -1
- package/dist/esm/Toaster.native.js +0 -52
- package/dist/esm/Toaster.native.js.map +0 -1
- package/dist/esm/constants.mjs +0 -4
- package/dist/esm/constants.mjs.map +0 -1
- package/dist/esm/constants.native.js +0 -4
- package/dist/esm/constants.native.js.map +0 -1
- package/dist/esm/createNativeToast.mjs +0 -32
- package/dist/esm/createNativeToast.mjs.map +0 -1
- package/dist/esm/createNativeToast.native.js +0 -30
- package/dist/esm/createNativeToast.native.js.map +0 -1
- package/dist/esm/dispatchNativeToast.mjs +0 -22
- package/dist/esm/dispatchNativeToast.mjs.map +0 -1
- package/dist/esm/dispatchNativeToast.native.js +0 -24
- package/dist/esm/dispatchNativeToast.native.js.map +0 -1
- package/dist/esm/index.mjs +0 -2
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js +0 -2
- package/dist/esm/index.native.js.map +0 -1
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/types.mjs.map +0 -1
- package/dist/esm/types.native.js +0 -2
- package/dist/esm/types.native.js.map +0 -1
- package/dist/esm/useAnimatedDragGesture.mjs +0 -178
- package/dist/esm/useAnimatedDragGesture.mjs.map +0 -1
- package/dist/esm/useAnimatedDragGesture.native.js +0 -185
- package/dist/esm/useAnimatedDragGesture.native.js.map +0 -1
- package/dist/esm/useReducedMotion.mjs +0 -38
- package/dist/esm/useReducedMotion.mjs.map +0 -1
- package/dist/esm/useReducedMotion.native.js +0 -44
- package/dist/esm/useReducedMotion.native.js.map +0 -1
- package/dist/esm/useToastAnimations.mjs +0 -256
- package/dist/esm/useToastAnimations.mjs.map +0 -1
- package/dist/esm/useToastAnimations.native.js +0 -263
- package/dist/esm/useToastAnimations.native.js.map +0 -1
- package/dist/esm/v2.mjs +0 -6
- package/dist/esm/v2.mjs.map +0 -1
- package/dist/esm/v2.native.js +0 -6
- package/dist/esm/v2.native.js.map +0 -1
- package/dist/jsx/Toast.mjs +0 -137
- package/dist/jsx/Toast.mjs.map +0 -1
- package/dist/jsx/Toast.native.js +0 -181
- package/dist/jsx/Toast.native.js.map +0 -1
- package/dist/jsx/ToastAnnounce.mjs +0 -66
- package/dist/jsx/ToastAnnounce.mjs.map +0 -1
- package/dist/jsx/ToastAnnounce.native.js +0 -111
- package/dist/jsx/ToastAnnounce.native.js.map +0 -1
- package/dist/jsx/ToastComposable.mjs +0 -909
- package/dist/jsx/ToastComposable.mjs.map +0 -1
- package/dist/jsx/ToastComposable.native.js +0 -1055
- package/dist/jsx/ToastComposable.native.js.map +0 -1
- package/dist/jsx/ToastImperative.mjs +0 -80
- package/dist/jsx/ToastImperative.mjs.map +0 -1
- package/dist/jsx/ToastImperative.native.js +0 -130
- package/dist/jsx/ToastImperative.native.js.map +0 -1
- package/dist/jsx/ToastImpl.mjs +0 -316
- package/dist/jsx/ToastImpl.mjs.map +0 -1
- package/dist/jsx/ToastImpl.native.js +0 -364
- package/dist/jsx/ToastImpl.native.js.map +0 -1
- package/dist/jsx/ToastItemFrame.mjs +0 -114
- package/dist/jsx/ToastItemFrame.mjs.map +0 -1
- package/dist/jsx/ToastItemFrame.native.js +0 -148
- package/dist/jsx/ToastItemFrame.native.js.map +0 -1
- package/dist/jsx/ToastPortal.mjs +0 -24
- package/dist/jsx/ToastPortal.mjs.map +0 -1
- package/dist/jsx/ToastPortal.native.js +0 -52
- package/dist/jsx/ToastPortal.native.js.map +0 -1
- package/dist/jsx/ToastProvider.mjs +0 -110
- package/dist/jsx/ToastProvider.mjs.map +0 -1
- package/dist/jsx/ToastProvider.native.js +0 -161
- package/dist/jsx/ToastProvider.native.js.map +0 -1
- package/dist/jsx/ToastState.mjs +0 -285
- package/dist/jsx/ToastState.mjs.map +0 -1
- package/dist/jsx/ToastState.native.js +0 -324
- package/dist/jsx/ToastState.native.js.map +0 -1
- package/dist/jsx/ToastViewport.mjs +0 -280
- package/dist/jsx/ToastViewport.mjs.map +0 -1
- package/dist/jsx/ToastViewport.native.js +0 -343
- package/dist/jsx/ToastViewport.native.js.map +0 -1
- package/dist/jsx/Toaster.mjs +0 -51
- package/dist/jsx/Toaster.mjs.map +0 -1
- package/dist/jsx/Toaster.native.js +0 -91
- package/dist/jsx/Toaster.native.js.map +0 -1
- package/dist/jsx/constants.mjs +0 -4
- package/dist/jsx/constants.mjs.map +0 -1
- package/dist/jsx/constants.native.js +0 -33
- package/dist/jsx/constants.native.js.map +0 -1
- package/dist/jsx/createNativeToast.mjs +0 -32
- package/dist/jsx/createNativeToast.mjs.map +0 -1
- package/dist/jsx/createNativeToast.native.js +0 -60
- package/dist/jsx/createNativeToast.native.js.map +0 -1
- package/dist/jsx/dispatchNativeToast.mjs +0 -22
- package/dist/jsx/dispatchNativeToast.mjs.map +0 -1
- package/dist/jsx/dispatchNativeToast.native.js +0 -52
- package/dist/jsx/dispatchNativeToast.native.js.map +0 -1
- package/dist/jsx/index.js +0 -2
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs +0 -2
- package/dist/jsx/index.mjs.map +0 -1
- package/dist/jsx/index.native.js +0 -23
- package/dist/jsx/index.native.js.map +0 -1
- package/dist/jsx/types.mjs +0 -2
- package/dist/jsx/types.mjs.map +0 -1
- package/dist/jsx/types.native.js +0 -21
- package/dist/jsx/types.native.js.map +0 -1
- package/dist/jsx/useAnimatedDragGesture.mjs +0 -178
- package/dist/jsx/useAnimatedDragGesture.mjs.map +0 -1
- package/dist/jsx/useAnimatedDragGesture.native.js +0 -224
- package/dist/jsx/useAnimatedDragGesture.native.js.map +0 -1
- package/dist/jsx/useReducedMotion.mjs +0 -38
- package/dist/jsx/useReducedMotion.mjs.map +0 -1
- package/dist/jsx/useReducedMotion.native.js +0 -83
- package/dist/jsx/useReducedMotion.native.js.map +0 -1
- package/dist/jsx/useToastAnimations.mjs +0 -256
- package/dist/jsx/useToastAnimations.mjs.map +0 -1
- package/dist/jsx/useToastAnimations.native.js +0 -302
- package/dist/jsx/useToastAnimations.native.js.map +0 -1
- package/dist/jsx/v2.mjs +0 -6
- package/dist/jsx/v2.mjs.map +0 -1
- package/dist/jsx/v2.native.js +0 -39
- package/dist/jsx/v2.native.js.map +0 -1
- package/v2/index.cjs +0 -2
- package/v2/index.js +0 -2
- package/v2/index.native.cjs +0 -2
- package/v2/index.native.js +0 -2
package/dist/jsx/Toaster.mjs
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Toast } from "./ToastComposable.mjs";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
const Toaster = React.forwardRef(function Toaster2(props, ref) {
|
|
5
|
-
const {
|
|
6
|
-
position = "bottom-right",
|
|
7
|
-
expand = false,
|
|
8
|
-
visibleToasts,
|
|
9
|
-
gap,
|
|
10
|
-
duration,
|
|
11
|
-
offset,
|
|
12
|
-
hotkey,
|
|
13
|
-
swipeDirection,
|
|
14
|
-
swipeThreshold,
|
|
15
|
-
closeButton,
|
|
16
|
-
theme,
|
|
17
|
-
icons,
|
|
18
|
-
toastOptions,
|
|
19
|
-
containerAriaLabel = "Notifications",
|
|
20
|
-
native,
|
|
21
|
-
burntOptions,
|
|
22
|
-
notificationOptions,
|
|
23
|
-
reducedMotion
|
|
24
|
-
} = props;
|
|
25
|
-
return /* @__PURE__ */jsx(Toast, {
|
|
26
|
-
position,
|
|
27
|
-
expand,
|
|
28
|
-
visibleToasts,
|
|
29
|
-
gap,
|
|
30
|
-
duration: toastOptions?.duration ?? duration,
|
|
31
|
-
swipeDirection,
|
|
32
|
-
swipeThreshold,
|
|
33
|
-
closeButton,
|
|
34
|
-
theme,
|
|
35
|
-
icons,
|
|
36
|
-
native,
|
|
37
|
-
burntOptions,
|
|
38
|
-
notificationOptions,
|
|
39
|
-
reducedMotion,
|
|
40
|
-
children: /* @__PURE__ */jsx(Toast.Viewport, {
|
|
41
|
-
ref,
|
|
42
|
-
offset,
|
|
43
|
-
hotkey,
|
|
44
|
-
label: containerAriaLabel,
|
|
45
|
-
children: /* @__PURE__ */jsx(Toast.List, {})
|
|
46
|
-
})
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
Toaster.displayName = "Toaster";
|
|
50
|
-
export { Toaster };
|
|
51
|
-
//# sourceMappingURL=Toaster.mjs.map
|
package/dist/jsx/Toaster.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","Toast","jsx","Toaster","forwardRef","props","ref","position","expand","visibleToasts","gap","duration","offset","hotkey","swipeDirection","swipeThreshold","closeButton","theme","icons","toastOptions","containerAriaLabel","native","burntOptions","notificationOptions","reducedMotion","children","Viewport","label","List","displayName"],"sources":["../../src/Toaster.tsx"],"sourcesContent":[null],"mappings":"AAMA,YAAYA,KAAA,MAAW;AACvB,SAASC,KAAA,QAAa;AAsKZ,SAAAC,GAAA;AA9CH,MAAMC,OAAA,GAAUH,KAAA,CAAMI,UAAA,CAC3B,SAASD,SAAQE,KAAA,EAAOC,GAAA,EAAK;EAC3B,MAAM;IACJC,QAAA,GAAW;IACXC,MAAA,GAAS;IACTC,aAAA;IACAC,GAAA;IACAC,QAAA;IACAC,MAAA;IACAC,MAAA;IACAC,cAAA;IACAC,cAAA;IACAC,WAAA;IACAC,KAAA;IACAC,KAAA;IACAC,YAAA;IACAC,kBAAA,GAAqB;IACrBC,MAAA;IACAC,YAAA;IACAC,mBAAA;IACAC;EACF,IAAInB,KAAA;EAEJ,OACE,eAAAH,GAAA,CAACD,KAAA;IACCM,QAAA;IACAC,MAAA;IACAC,aAAA;IACAC,GAAA;IACAC,QAAA,EAAUQ,YAAA,EAAcR,QAAA,IAAYA,QAAA;IACpCG,cAAA;IACAC,cAAA;IACAC,WAAA;IACAC,KAAA;IACAC,KAAA;IACAG,MAAA;IACAC,YAAA;IACAC,mBAAA;IACAC,aAAA;IAEAC,QAAA,iBAAAvB,GAAA,CAACD,KAAA,CAAMyB,QAAA,EAAN;MACCpB,GAAA;MACAM,MAAA;MACAC,MAAA;MACAc,KAAA,EAAOP,kBAAA;MAEPK,QAAA,iBAAAvB,GAAA,CAACD,KAAA,CAAM2B,IAAA,EAAN,EAAW;IAAA,CACd;EAAA,CACF;AAEJ,CACF;AAEAzB,OAAA,CAAQ0B,WAAA,GAAc","ignoreList":[]}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all) __defProp(target, name, {
|
|
11
|
-
get: all[name],
|
|
12
|
-
enumerable: true
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
-
get: () => from[key],
|
|
19
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
-
value: mod,
|
|
31
|
-
enumerable: true
|
|
32
|
-
}) : target, mod));
|
|
33
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
-
value: true
|
|
35
|
-
}), mod);
|
|
36
|
-
var Toaster_exports = {};
|
|
37
|
-
__export(Toaster_exports, {
|
|
38
|
-
Toaster: () => Toaster
|
|
39
|
-
});
|
|
40
|
-
module.exports = __toCommonJS(Toaster_exports);
|
|
41
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
-
var React = __toESM(require("react"), 1);
|
|
43
|
-
var import_ToastComposable = require("./ToastComposable.native.js");
|
|
44
|
-
var Toaster = /* @__PURE__ */React.forwardRef(function Toaster2(props, ref) {
|
|
45
|
-
var {
|
|
46
|
-
position = "bottom-right",
|
|
47
|
-
expand = false,
|
|
48
|
-
visibleToasts,
|
|
49
|
-
gap,
|
|
50
|
-
duration,
|
|
51
|
-
offset,
|
|
52
|
-
hotkey,
|
|
53
|
-
swipeDirection,
|
|
54
|
-
swipeThreshold,
|
|
55
|
-
closeButton,
|
|
56
|
-
theme,
|
|
57
|
-
icons,
|
|
58
|
-
toastOptions,
|
|
59
|
-
containerAriaLabel = "Notifications",
|
|
60
|
-
native,
|
|
61
|
-
burntOptions,
|
|
62
|
-
notificationOptions,
|
|
63
|
-
reducedMotion
|
|
64
|
-
} = props;
|
|
65
|
-
var _toastOptions_duration;
|
|
66
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ToastComposable.Toast, {
|
|
67
|
-
position,
|
|
68
|
-
expand,
|
|
69
|
-
visibleToasts,
|
|
70
|
-
gap,
|
|
71
|
-
duration: (_toastOptions_duration = toastOptions === null || toastOptions === void 0 ? void 0 : toastOptions.duration) !== null && _toastOptions_duration !== void 0 ? _toastOptions_duration : duration,
|
|
72
|
-
swipeDirection,
|
|
73
|
-
swipeThreshold,
|
|
74
|
-
closeButton,
|
|
75
|
-
theme,
|
|
76
|
-
icons,
|
|
77
|
-
native,
|
|
78
|
-
burntOptions,
|
|
79
|
-
notificationOptions,
|
|
80
|
-
reducedMotion,
|
|
81
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ToastComposable.Toast.Viewport, {
|
|
82
|
-
ref,
|
|
83
|
-
offset,
|
|
84
|
-
hotkey,
|
|
85
|
-
label: containerAriaLabel,
|
|
86
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ToastComposable.Toast.List, {})
|
|
87
|
-
})
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
Toaster.displayName = "Toaster";
|
|
91
|
-
//# sourceMappingURL=Toaster.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toESM","mod","isNodeMode","__esModule","value","__toCommonJS","Toaster_exports","Toaster","module","exports","import_jsx_runtime","require","React","import_ToastComposable","forwardRef","Toaster2","props","ref","position","expand","visibleToasts","gap","duration","offset","hotkey","swipeDirection","swipeThreshold","closeButton","theme","icons","toastOptions","containerAriaLabel","native","burntOptions","notificationOptions","reducedMotion","_toastOptions_duration","jsx","Toast","children","Viewport"],"sources":["../../src/Toaster.tsx"],"sourcesContent":[null],"mappings":"AAMA,YAAY;;AACZ,IAAAA,QAAS,GAAAC,MAAA,CAAaC,MAAA;AAsKZ,IAAAC,SAAA,GAAAF,MAAA,CAAAG,cAAA;AA9CH,IAAAC,gBAAgB,GAAMJ,MAAA,CAAAK,wBAAA;AAAA,IAC3BC,iBAAiB,GAAAN,MAAO,CAAAO,mBAAK;AAC3B,IAAAC,YAAM,GAAAR,MAAA,CAAAS,cAAA;AAAA,IAAAC,YACJ,GAAWV,MAAA,CAAAW,SAAA,CAAAC,cAAA;AAAA,IAAAC,QACX,GAASA,CAAAC,MAAA,EAAAC,GAAA;EAAA,KACT,IAAAC,IAAA,IAAAD,GAAA,EAAAb,SACA,CAAAY,MAAA,EAAAE,IAAA;IAAAC,GAAA,EAAAF,GAAA,CAAAC,IAAA;IAAAE,UAAA;EAAA;AAAA;AACA,IAAAC,WACA,GAAAA,CAAAC,EAAA,EAAAC,IAAA,EAAAC,MAAA,EAAAC,IAAA;EAAA,IACAF,IAAA,WAAAA,IAAA,wBAAAA,IAAA;IAAA,KACA,IAAAG,GAAA,IAAAlB,iBAAA,CAAAe,IAAA,GACA,KAAAX,YAAA,CAAAe,IAAA,CAAAL,EAAA,EAAAI,GAAA,KAAAA,GAAA,KAAAF,MAAA,EACApB,SAAA,CAAAkB,EAAA,EAAAI,GAAA;MAAAP,GAAA,EAAAA,CAAA,KAAAI,IAAA,CAAAG,GAAA;MAAAN,UAAA,IAAAK,IAAA,GAAAnB,gBAAA,CAAAiB,IAAA,EAAAG,GAAA,MAAAD,IAAA,CAAAL;IAAA;EAAA;EACA,OACAE,EAAA;AAAA;AACA,IAAAM,OACA,GAAAA,CAAAC,GAAA,EAAAC,UAAqB,EAAAd,MAAA,MAAAA,MAAA,GAAAa,GAAA,WAAA5B,QAAA,CAAAS,YAAA,CAAAmB,GAAA,SAAAR,WAAA;AAAA;AACrB;AACA;AACA;AACAS,UACE,KAAAD,GAAA,KAAAA,GAAA,CAAAE,UAAA,GAAA3B,SAAA,CAAAY,MAAA;EAAAgB,KAAA,EAAAH,GAAA;EAAAT,UAAA;AAAA,KAAAJ,MAAA,EAEJa,GACE;AAAC,IAAAI,YAAA,GAAAJ,GAAA,IAAAR,WAAA,CAAAjB,SAAA;EAAA4B,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAK,eACC;AAAAnB,QACA,CAAAmB,eAAA;EAAAC,OACA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC,OACA,GAAAJ,YAAU,CAAAC,eAA0B;AAAA,IAAAI,kBACpC,GAAAC,OAAA;AAAA,IAAAC,KACA,GAAAZ,OAAA,CAAAW,OAAA;AAAA,IAAAE,sBACA,GAAAF,OAAA;AAAA,IAAAJ,OACA,kBAAAK,KAAA,CAAAE,UAAA,UAAAC,SAAAC,KAAA,EAAAC,GAAA;EAAA;IACAC,QAAA;IAAAC,MAAA;IAAAC,aAAA;IAAAC,GAAA;IAAAC,QAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,cAAA;IAAAC,cAAA;IAAAC,WAAA;IAAAC,KAAA;IAAAC,KAAA;IAAAC,YAAA;IAAAC,kBAAA;IAAAC,MAAA;IAAAC,YAAA;IAAAC,mBAAA;IAAAC;EAAA,IAAAnB,KAAA;EAAA,IAAAoB,sBACA;EAAA,OACA,mBAAA1B,kBAAA,CAAA2B,GAAA,EAAAxB,sBAAA,CAAAyB,KAAA;IAAApB,QACA;IAAAC,MACA;IAAAC,aAEA;IAAAC,GAAA;IAAOC,QAAN,GAAAc,sBAAA,GAAAN,YAAA,aAAAA,YAAA,uBAAAA,YAAA,CAAAR,QAAA,cAAAc,sBAAA,cAAAA,sBAAA,GAAAd,QAAA;IAAAG,cACC;IAAAC,cACA;IAAAC,WACA;IAAAC,KAAA;IACOC,KAAA;IAEKG,MAAA;IAAAC,YACd;IAAAC,mBAAA;IACFC,aAAA;IAEJI,QAAA,qBAAA7B,kBAAA,CAAA2B,GAAA,EAAAxB,sBAAA,CAAAyB,KAAA,CAAAE,QAAA;MACFvB,GAAA;MAEAM,MAAQ","ignoreList":[]}
|
package/dist/jsx/constants.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TOAST_NAME","TOAST_CONTEXT"],"sources":["../../src/constants.ts"],"sourcesContent":[null],"mappings":"AAAO,MAAMA,UAAA,GAAa;AACnB,MAAMC,aAAA,GAAgB","ignoreList":[]}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
-
get: () => from[key],
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
}), mod);
|
|
25
|
-
var constants_exports = {};
|
|
26
|
-
__export(constants_exports, {
|
|
27
|
-
TOAST_CONTEXT: () => TOAST_CONTEXT,
|
|
28
|
-
TOAST_NAME: () => TOAST_NAME
|
|
29
|
-
});
|
|
30
|
-
module.exports = __toCommonJS(constants_exports);
|
|
31
|
-
var TOAST_NAME = "Toast";
|
|
32
|
-
var TOAST_CONTEXT = "Toast";
|
|
33
|
-
//# sourceMappingURL=constants.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__defProp","Object","defineProperty"],"sources":["../../src/constants.ts"],"sourcesContent":[null],"mappings":"AAAO,YAAM;;AACN,IAAAA,SAAM,GAAAC,MAAgB,CAAAC,cAAA","ignoreList":[]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const createNativeToast = (title, {
|
|
2
|
-
message,
|
|
3
|
-
notificationOptions
|
|
4
|
-
}) => {
|
|
5
|
-
if (!("Notification" in window)) {
|
|
6
|
-
return false;
|
|
7
|
-
}
|
|
8
|
-
if (Notification.permission !== "granted") return false;
|
|
9
|
-
const notification = new Notification(title, {
|
|
10
|
-
body: message,
|
|
11
|
-
...notificationOptions
|
|
12
|
-
});
|
|
13
|
-
return {
|
|
14
|
-
nativeToastRef: notification
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
const hideNativeToast = ref => {
|
|
18
|
-
if (!("Notification" in window)) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (ref) {
|
|
22
|
-
ref.close();
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
async function requestNotificationPermission() {
|
|
26
|
-
if (!("Notification" in window)) return null;
|
|
27
|
-
if (Notification.permission === "granted") return "granted";
|
|
28
|
-
if (Notification.permission === "denied") return "denied";
|
|
29
|
-
return Notification.requestPermission();
|
|
30
|
-
}
|
|
31
|
-
export { createNativeToast, hideNativeToast, requestNotificationPermission };
|
|
32
|
-
//# sourceMappingURL=createNativeToast.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createNativeToast","title","message","notificationOptions","window","Notification","permission","notification","body","nativeToastRef","hideNativeToast","ref","close","requestNotificationPermission","requestPermission"],"sources":["../../src/createNativeToast.tsx"],"sourcesContent":[null],"mappings":"AAEO,MAAMA,iBAAA,GAA0CA,CACrDC,KAAA,EACA;EAAEC,OAAA;EAASC;AAAoB,MAC5B;EACH,IAAI,EAAE,kBAAkBC,MAAA,GAAS;IAC/B,OAAO;EACT;EAEA,IAAIC,YAAA,CAAaC,UAAA,KAAe,WAAW,OAAO;EAElD,MAAMC,YAAA,GAAe,IAAIF,YAAA,CAAaJ,KAAA,EAAO;IAC3CO,IAAA,EAAMN,OAAA;IACN,GAAGC;EACL,CAAC;EAED,OAAO;IACLM,cAAA,EAAgBF;EAClB;AACF;AAEO,MAAMG,eAAA,GAAuCC,GAAA,IAAQ;EAC1D,IAAI,EAAE,kBAAkBP,MAAA,GAAS;IAC/B;EACF;EAEA,IAAIO,GAAA,EAAK;IACPA,GAAA,CAAIC,KAAA,CAAM;EACZ;AACF;AAMA,eAAsBC,8BAAA,EAAwE;EAC5F,IAAI,EAAE,kBAAkBT,MAAA,GAAS,OAAO;EACxC,IAAIC,YAAA,CAAaC,UAAA,KAAe,WAAW,OAAO;EAClD,IAAID,YAAA,CAAaC,UAAA,KAAe,UAAU,OAAO;EACjD,OAAOD,YAAA,CAAaS,iBAAA,CAAkB;AACxC","ignoreList":[]}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
-
get: () => from[key],
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
}), mod);
|
|
25
|
-
var createNativeToast_native_exports = {};
|
|
26
|
-
__export(createNativeToast_native_exports, {
|
|
27
|
-
createNativeToast: () => createNativeToast,
|
|
28
|
-
hideNativeToast: () => hideNativeToast,
|
|
29
|
-
requestNotificationPermission: () => requestNotificationPermission
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(createNativeToast_native_exports);
|
|
32
|
-
var import_native = require("@hanzogui/native");
|
|
33
|
-
var createNativeToast = function (title, param) {
|
|
34
|
-
var {
|
|
35
|
-
message,
|
|
36
|
-
duration,
|
|
37
|
-
burntOptions
|
|
38
|
-
} = param;
|
|
39
|
-
var burnt = (0, import_native.getBurnt)();
|
|
40
|
-
if (!burnt.isEnabled) {
|
|
41
|
-
console.warn(`Warning: Must call import '@hanzogui/native/setup-burnt' at your app entry point to use native toasts`);
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
burnt.state.toast({
|
|
45
|
-
title,
|
|
46
|
-
message,
|
|
47
|
-
duration: duration ? duration / 1e3 : void 0,
|
|
48
|
-
...burntOptions
|
|
49
|
-
});
|
|
50
|
-
return true;
|
|
51
|
-
};
|
|
52
|
-
var hideNativeToast = function () {
|
|
53
|
-
var burnt = (0, import_native.getBurnt)();
|
|
54
|
-
if (!burnt.isEnabled) return;
|
|
55
|
-
burnt.state.dismissAllAlerts();
|
|
56
|
-
};
|
|
57
|
-
async function requestNotificationPermission() {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=createNativeToast.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createNativeToast_native_exports","__export","createNativeToast","hideNativeToast","requestNotificationPermission","module","exports","__toCommonJS","import_native","require","title","param","message","duration","burntOptions","burnt","getBurnt","isEnabled","console","warn","state","toast","dismissAllAlerts"],"sources":["../../src/createNativeToast.native.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gCAAA;AAAAC,QAAA,CAAAD,gCAAA;EAAAE,iBAAA,EAAAA,CAAA,KAAAA,iBAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAA,eAAA;EAAAC,6BAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAP,gCAAA;AAAA,IAAAQ,aAAA,GAAyBC,OAAA;AAClB,IAAIP,iBAAA,GAAoB,SAAAA,CAASQ,KAAA,EAAOC,KAAA,EAAO;EAClD,IAAI;IAAEC,OAAA;IAASC,QAAA;IAAUC;EAAa,IAAIH,KAAA;EAC1C,IAAII,KAAA,OAAQP,aAAA,CAAAQ,QAAA,EAAS;EACrB,IAAI,CAACD,KAAA,CAAME,SAAA,EAAW;IAClBC,OAAA,CAAQC,IAAA,CAAK,uGAAuG;IACpH,OAAO;EACX;EACAJ,KAAA,CAAMK,KAAA,CAAMC,KAAA,CAAM;IACdX,KAAA;IACAE,OAAA;IACAC,QAAA,EAAUA,QAAA,GAAWA,QAAA,GAAW,MAAO;IACvC,GAAGC;EACP,CAAC;EACD,OAAO;AACX;AACO,IAAIX,eAAA,GAAkB,SAAAA,CAAA,EAAW;EACpC,IAAIY,KAAA,OAAQP,aAAA,CAAAQ,QAAA,EAAS;EACrB,IAAI,CAACD,KAAA,CAAME,SAAA,EAAW;EACtBF,KAAA,CAAMK,KAAA,CAAME,gBAAA,CAAiB;AACjC;AACA,eAAsBlB,8BAAA,EAAgC;EAClD,OAAO;AACX","ignoreList":[]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createNativeToast } from "./createNativeToast.mjs";
|
|
2
|
-
function dispatchNativeToast(toast, opts) {
|
|
3
|
-
const titleText = typeof toast.title === "function" ? toast.title() : toast.title;
|
|
4
|
-
if (typeof titleText !== "string") return false;
|
|
5
|
-
const descText = typeof toast.description === "function" ? toast.description() : toast.description;
|
|
6
|
-
const toastType = toast.type ?? "default";
|
|
7
|
-
const preset = toastType === "error" ? "error" : toastType === "success" ? "done" : "none";
|
|
8
|
-
const haptic = toastType === "error" ? "error" : toastType === "success" ? "success" : toastType === "warning" ? "warning" : "none";
|
|
9
|
-
const result = createNativeToast(titleText, {
|
|
10
|
-
message: typeof descText === "string" ? descText : void 0,
|
|
11
|
-
duration: toast.duration ?? opts.duration,
|
|
12
|
-
burntOptions: {
|
|
13
|
-
preset,
|
|
14
|
-
haptic,
|
|
15
|
-
...opts.burntOptions
|
|
16
|
-
},
|
|
17
|
-
notificationOptions: opts.notificationOptions
|
|
18
|
-
});
|
|
19
|
-
return result !== false;
|
|
20
|
-
}
|
|
21
|
-
export { dispatchNativeToast };
|
|
22
|
-
//# sourceMappingURL=dispatchNativeToast.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createNativeToast","dispatchNativeToast","toast","opts","titleText","title","descText","description","toastType","type","preset","haptic","result","message","duration","burntOptions","notificationOptions"],"sources":["../../src/dispatchNativeToast.ts"],"sourcesContent":[null],"mappings":"AAEA,SAASA,iBAAA,QAAyB;AAM3B,SAASC,oBACdC,KAAA,EACAC,IAAA,EAKS;EACT,MAAMC,SAAA,GAAY,OAAOF,KAAA,CAAMG,KAAA,KAAU,aAAaH,KAAA,CAAMG,KAAA,CAAM,IAAIH,KAAA,CAAMG,KAAA;EAC5E,IAAI,OAAOD,SAAA,KAAc,UAAU,OAAO;EAE1C,MAAME,QAAA,GACJ,OAAOJ,KAAA,CAAMK,WAAA,KAAgB,aAAaL,KAAA,CAAMK,WAAA,CAAY,IAAIL,KAAA,CAAMK,WAAA;EACxE,MAAMC,SAAA,GAAYN,KAAA,CAAMO,IAAA,IAAQ;EAEhC,MAAMC,MAAA,GACJF,SAAA,KAAc,UAAU,UAAUA,SAAA,KAAc,YAAY,SAAS;EACvE,MAAMG,MAAA,GACJH,SAAA,KAAc,UACV,UACAA,SAAA,KAAc,YACZ,YACAA,SAAA,KAAc,YACZ,YACA;EAEV,MAAMI,MAAA,GAASZ,iBAAA,CAAkBI,SAAA,EAAW;IAC1CS,OAAA,EAAS,OAAOP,QAAA,KAAa,WAAWA,QAAA,GAAW;IACnDQ,QAAA,EAAUZ,KAAA,CAAMY,QAAA,IAAYX,IAAA,CAAKW,QAAA;IACjCC,YAAA,EAAc;MAAEL,MAAA;MAAQC,MAAA;MAAQ,GAAGR,IAAA,CAAKY;IAAa;IACrDC,mBAAA,EAAqBb,IAAA,CAAKa;EAC5B,CAAC;EAED,OAAOJ,MAAA,KAAW;AACpB","ignoreList":[]}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
-
get: () => from[key],
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
}), mod);
|
|
25
|
-
var dispatchNativeToast_exports = {};
|
|
26
|
-
__export(dispatchNativeToast_exports, {
|
|
27
|
-
dispatchNativeToast: () => dispatchNativeToast
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(dispatchNativeToast_exports);
|
|
30
|
-
var import_createNativeToast = require("./createNativeToast.native.js");
|
|
31
|
-
function dispatchNativeToast(toast, opts) {
|
|
32
|
-
var titleText = typeof toast.title === "function" ? toast.title() : toast.title;
|
|
33
|
-
if (typeof titleText !== "string") return false;
|
|
34
|
-
var descText = typeof toast.description === "function" ? toast.description() : toast.description;
|
|
35
|
-
var _toast_type;
|
|
36
|
-
var toastType = (_toast_type = toast.type) !== null && _toast_type !== void 0 ? _toast_type : "default";
|
|
37
|
-
var preset = toastType === "error" ? "error" : toastType === "success" ? "done" : "none";
|
|
38
|
-
var haptic = toastType === "error" ? "error" : toastType === "success" ? "success" : toastType === "warning" ? "warning" : "none";
|
|
39
|
-
var _toast_duration;
|
|
40
|
-
var result = (0, import_createNativeToast.createNativeToast)(titleText, {
|
|
41
|
-
message: typeof descText === "string" ? descText : void 0,
|
|
42
|
-
duration: (_toast_duration = toast.duration) !== null && _toast_duration !== void 0 ? _toast_duration : opts.duration,
|
|
43
|
-
burntOptions: {
|
|
44
|
-
preset,
|
|
45
|
-
haptic,
|
|
46
|
-
...opts.burntOptions
|
|
47
|
-
},
|
|
48
|
-
notificationOptions: opts.notificationOptions
|
|
49
|
-
});
|
|
50
|
-
return result !== false;
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=dispatchNativeToast.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call"],"sources":["../../src/dispatchNativeToast.ts"],"sourcesContent":[null],"mappings":"AAEA,YAAS;;AAMF,IAAAA,SAAS,GAAAC,MAAA,CAAAC,cAEd;AAMA,IAAAC,gBAAkB,GAAAF,MAAO,CAAAG,wBAAgB;AACzC,IAAAC,iBAAW,GAAAJ,MAAc,CAAAK,mBAAiB;AAE1C,IAAAC,YAAM,GACJN,MAAA,CAAOO,SAAM,CAAAC,cAAgB;AAC/B,IAAAC,QAAM,GAAAA,CAAAC,MAAY,EAAAC,GAAM;EAExB,SAAMC,IAAA,IACJD,GAAA,EACFZ,SAAM,CAAAW,MACJ,EAAAE,IAAA;IAAAC,GAAc,EAAAF,GAAA,CAAAC,IACV;IAAAE,UACA;EAAA,EAAc;AAMpB;AAA4C,IAC1CC,WAAS,GAAAA,CAAAC,EAAO,EAAAC,IAAA,EAAAC,MAAa,EAAAC,IAAA,KAAW;EAAW,IACnDF,IAAA,IAAU,OAAMA,IAAA,aAAiB,WAAAA,IAAA;IACjC,SAAAG,GAAA,IAAgBhB,iBAAgB,CAAAa,IAAG,GACnC,KAAAX,YAAA,CAAAe,IAAqB,CAAAL,EAAK,EAAAI,GAAA,KAAAA,GAAA,KAAAF,MAAA,EAC3BnB,SAAA,CAAAiB,EAAA,EAAAI,GAAA;MAAAP,GAAA,EAAAA,CAAA,KAAAI,IAAA,CAAAG,GAAA;MAAAN,UAAA,IAAAK,IAAA,GAAAjB,gBAAA,CAAAe,IAAA,EAAAG,GAAA,MAAAD,IAAA,CAAAL;IAAA;EAED;EACF,OAAAE,EAAA","ignoreList":[]}
|
package/dist/jsx/index.js
DELETED
package/dist/jsx/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
package/dist/jsx/index.mjs
DELETED
package/dist/jsx/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
package/dist/jsx/index.native.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
10
|
-
get: () => from[key],
|
|
11
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
18
|
-
value: true
|
|
19
|
-
}), mod);
|
|
20
|
-
var index_exports = {};
|
|
21
|
-
module.exports = __toCommonJS(index_exports);
|
|
22
|
-
__reExport(index_exports, require("./Toast.native.js"), module.exports);
|
|
23
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA","ignoreList":[]}
|
package/dist/jsx/types.mjs
DELETED
package/dist/jsx/types.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
|
package/dist/jsx/types.native.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
10
|
-
get: () => from[key],
|
|
11
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
17
|
-
value: true
|
|
18
|
-
}), mod);
|
|
19
|
-
var types_exports = {};
|
|
20
|
-
module.exports = __toCommonJS(types_exports);
|
|
21
|
-
//# sourceMappingURL=types.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
const VELOCITY_THRESHOLD = 0.11;
|
|
3
|
-
function resisted(delta, maxResist = 25) {
|
|
4
|
-
if (delta >= 0) return delta;
|
|
5
|
-
const pastBoundary = Math.abs(delta);
|
|
6
|
-
const resistedDistance = Math.sqrt(pastBoundary) * 2;
|
|
7
|
-
return -Math.min(resistedDistance, maxResist);
|
|
8
|
-
}
|
|
9
|
-
const EXIT_DRAG_CAP = 80;
|
|
10
|
-
function cappedExit(delta) {
|
|
11
|
-
if (Math.abs(delta) <= EXIT_DRAG_CAP) return delta;
|
|
12
|
-
const sign = delta > 0 ? 1 : -1;
|
|
13
|
-
const overshoot = Math.abs(delta) - EXIT_DRAG_CAP;
|
|
14
|
-
return sign * (EXIT_DRAG_CAP + Math.sqrt(overshoot) * 2);
|
|
15
|
-
}
|
|
16
|
-
function useAnimatedDragGesture(options) {
|
|
17
|
-
const {
|
|
18
|
-
direction,
|
|
19
|
-
threshold,
|
|
20
|
-
disabled,
|
|
21
|
-
expanded,
|
|
22
|
-
onDragMove,
|
|
23
|
-
onDragStart,
|
|
24
|
-
onDismiss,
|
|
25
|
-
onCancel
|
|
26
|
-
} = options;
|
|
27
|
-
const [isDragging, setIsDragging] = React.useState(false);
|
|
28
|
-
const dragStartRef = React.useRef(null);
|
|
29
|
-
const lockedDirectionRef = React.useRef(null);
|
|
30
|
-
const captureElementRef = React.useRef(null);
|
|
31
|
-
const isHorizontal = direction === "left" || direction === "right" || direction === "horizontal";
|
|
32
|
-
const isVertical = direction === "up" || direction === "down" || direction === "vertical";
|
|
33
|
-
const preventSelectRef = React.useRef(null);
|
|
34
|
-
function startPreventingSelection() {
|
|
35
|
-
if (typeof document === "undefined") return;
|
|
36
|
-
window.getSelection()?.removeAllRanges();
|
|
37
|
-
const handler = e => e.preventDefault();
|
|
38
|
-
preventSelectRef.current = handler;
|
|
39
|
-
document.addEventListener("selectstart", handler, true);
|
|
40
|
-
}
|
|
41
|
-
function stopPreventingSelection() {
|
|
42
|
-
if (preventSelectRef.current) {
|
|
43
|
-
document.removeEventListener("selectstart", preventSelectRef.current, true);
|
|
44
|
-
preventSelectRef.current = null;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
const cleanup = React.useCallback(() => {
|
|
48
|
-
dragStartRef.current = null;
|
|
49
|
-
lockedDirectionRef.current = null;
|
|
50
|
-
setIsDragging(false);
|
|
51
|
-
stopPreventingSelection();
|
|
52
|
-
}, []);
|
|
53
|
-
React.useEffect(() => {
|
|
54
|
-
return () => {
|
|
55
|
-
if (dragStartRef.current) {
|
|
56
|
-
if (captureElementRef.current && dragStartRef.current.pointerId) {
|
|
57
|
-
try {
|
|
58
|
-
captureElementRef.current.releasePointerCapture(dragStartRef.current.pointerId);
|
|
59
|
-
} catch {}
|
|
60
|
-
}
|
|
61
|
-
cleanup();
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
}, [cleanup]);
|
|
65
|
-
const handlePointerDown = React.useCallback(event => {
|
|
66
|
-
if (disabled) return;
|
|
67
|
-
if (event.button !== 0) return;
|
|
68
|
-
const target = event.target;
|
|
69
|
-
if (target.closest('button, a, input, textarea, select, [role="button"]')) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const hasSelection = (window.getSelection()?.toString().length ?? 0) > 0;
|
|
73
|
-
if (hasSelection) return;
|
|
74
|
-
const captureElement = event.currentTarget;
|
|
75
|
-
captureElementRef.current = captureElement;
|
|
76
|
-
captureElement.setPointerCapture(event.pointerId);
|
|
77
|
-
dragStartRef.current = {
|
|
78
|
-
startX: event.clientX,
|
|
79
|
-
startY: event.clientY,
|
|
80
|
-
startTime: Date.now(),
|
|
81
|
-
pointerId: event.pointerId
|
|
82
|
-
};
|
|
83
|
-
startPreventingSelection();
|
|
84
|
-
setIsDragging(true);
|
|
85
|
-
onDragStart?.();
|
|
86
|
-
}, [disabled, onDragStart]);
|
|
87
|
-
const handlePointerMove = React.useCallback(event => {
|
|
88
|
-
if (!dragStartRef.current || disabled) return;
|
|
89
|
-
const deltaX = event.clientX - dragStartRef.current.startX;
|
|
90
|
-
const deltaY = event.clientY - dragStartRef.current.startY;
|
|
91
|
-
if (!lockedDirectionRef.current && (Math.abs(deltaX) > 1 || Math.abs(deltaY) > 1)) {
|
|
92
|
-
lockedDirectionRef.current = Math.abs(deltaX) > Math.abs(deltaY) ? "x" : "y";
|
|
93
|
-
}
|
|
94
|
-
let offsetX = 0;
|
|
95
|
-
let offsetY = 0;
|
|
96
|
-
if (direction === "right") {
|
|
97
|
-
offsetX = deltaX > 0 ? cappedExit(deltaX) : resisted(deltaX);
|
|
98
|
-
} else if (direction === "left") {
|
|
99
|
-
offsetX = deltaX < 0 ? cappedExit(deltaX) : -resisted(-deltaX);
|
|
100
|
-
} else if (direction === "down") {
|
|
101
|
-
offsetY = deltaY > 0 ? cappedExit(deltaY) : resisted(deltaY);
|
|
102
|
-
} else if (direction === "up") {
|
|
103
|
-
offsetY = deltaY < 0 ? cappedExit(deltaY) : -resisted(-deltaY);
|
|
104
|
-
} else if (direction === "horizontal") {
|
|
105
|
-
offsetX = cappedExit(deltaX);
|
|
106
|
-
} else if (direction === "vertical") {
|
|
107
|
-
offsetY = cappedExit(deltaY);
|
|
108
|
-
}
|
|
109
|
-
onDragMove(offsetX, offsetY);
|
|
110
|
-
}, [disabled, direction, expanded, isHorizontal, isVertical, onDragMove]);
|
|
111
|
-
const handlePointerUp = React.useCallback(event => {
|
|
112
|
-
if (!dragStartRef.current || disabled) return;
|
|
113
|
-
const deltaX = event.clientX - dragStartRef.current.startX;
|
|
114
|
-
const deltaY = event.clientY - dragStartRef.current.startY;
|
|
115
|
-
const timeTaken = Date.now() - dragStartRef.current.startTime;
|
|
116
|
-
const velocityX = Math.abs(deltaX) / timeTaken;
|
|
117
|
-
const velocityY = Math.abs(deltaY) / timeTaken;
|
|
118
|
-
const lockedDirection = lockedDirectionRef.current;
|
|
119
|
-
const isLockedToWrongAxis = lockedDirection === "y" && isHorizontal || lockedDirection === "x" && isVertical;
|
|
120
|
-
const relevantDelta = isHorizontal ? deltaX : deltaY;
|
|
121
|
-
const relevantVelocity = isHorizontal ? velocityX : velocityY;
|
|
122
|
-
const passedThreshold = Math.abs(relevantDelta) >= threshold;
|
|
123
|
-
const hasVelocity = relevantVelocity > VELOCITY_THRESHOLD;
|
|
124
|
-
let exitDirection = null;
|
|
125
|
-
if (!isLockedToWrongAxis) {
|
|
126
|
-
if (direction === "right" && deltaX > 0) exitDirection = "right";else if (direction === "left" && deltaX < 0) exitDirection = "left";else if (direction === "horizontal") {
|
|
127
|
-
if (Math.abs(deltaX) > Math.abs(deltaY)) {
|
|
128
|
-
exitDirection = deltaX > 0 ? "right" : "left";
|
|
129
|
-
}
|
|
130
|
-
} else if (direction === "down" && deltaY > 0) exitDirection = "down";else if (direction === "up" && deltaY < 0) exitDirection = "up";else if (direction === "vertical") {
|
|
131
|
-
if (Math.abs(deltaY) > Math.abs(deltaX)) {
|
|
132
|
-
exitDirection = deltaY > 0 ? "down" : "up";
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
const shouldDismiss = exitDirection && (passedThreshold || hasVelocity);
|
|
137
|
-
if (captureElementRef.current) {
|
|
138
|
-
try {
|
|
139
|
-
captureElementRef.current.releasePointerCapture(event.pointerId);
|
|
140
|
-
} catch {}
|
|
141
|
-
}
|
|
142
|
-
cleanup();
|
|
143
|
-
if (shouldDismiss && exitDirection) {
|
|
144
|
-
onDismiss(exitDirection, relevantVelocity);
|
|
145
|
-
} else {
|
|
146
|
-
onCancel();
|
|
147
|
-
}
|
|
148
|
-
}, [disabled, direction, threshold, isHorizontal, isVertical, onDismiss, onCancel, cleanup]);
|
|
149
|
-
const handlePointerCancel = React.useCallback(event => {
|
|
150
|
-
if (captureElementRef.current) {
|
|
151
|
-
try {
|
|
152
|
-
captureElementRef.current.releasePointerCapture(event.pointerId);
|
|
153
|
-
} catch {}
|
|
154
|
-
}
|
|
155
|
-
cleanup();
|
|
156
|
-
onCancel();
|
|
157
|
-
}, [onCancel, cleanup]);
|
|
158
|
-
const handleLostPointerCapture = React.useCallback(() => {
|
|
159
|
-
if (dragStartRef.current) {
|
|
160
|
-
cleanup();
|
|
161
|
-
onCancel();
|
|
162
|
-
}
|
|
163
|
-
}, [onCancel, cleanup]);
|
|
164
|
-
const gestureHandlers = {
|
|
165
|
-
onPointerDown: handlePointerDown,
|
|
166
|
-
onPointerMove: handlePointerMove,
|
|
167
|
-
onPointerUp: handlePointerUp,
|
|
168
|
-
onPointerCancel: handlePointerCancel,
|
|
169
|
-
onLostPointerCapture: handleLostPointerCapture
|
|
170
|
-
};
|
|
171
|
-
return {
|
|
172
|
-
isDragging,
|
|
173
|
-
gestureHandlers,
|
|
174
|
-
gesture: null
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
export { useAnimatedDragGesture };
|
|
178
|
-
//# sourceMappingURL=useAnimatedDragGesture.mjs.map
|