@tamagui/toast 2.7.7 → 3.0.0-beta.643.1

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.
Files changed (303) hide show
  1. package/dist/cjs/ToastComposable.cjs +773 -882
  2. package/dist/cjs/ToastComposable.native.cjs +924 -0
  3. package/dist/cjs/ToastComposable.native.js +854 -966
  4. package/dist/cjs/ToastComposable.native.js.map +1 -1
  5. package/dist/cjs/ToastItemFrame.cjs +48 -119
  6. package/dist/cjs/ToastItemFrame.native.cjs +76 -0
  7. package/dist/cjs/ToastItemFrame.native.js +50 -120
  8. package/dist/cjs/ToastItemFrame.native.js.map +1 -1
  9. package/dist/cjs/ToastState.cjs +281 -290
  10. package/dist/cjs/ToastState.native.cjs +312 -0
  11. package/dist/cjs/ToastState.native.js +280 -290
  12. package/dist/cjs/ToastState.native.js.map +1 -1
  13. package/dist/cjs/createNativeToast.cjs +38 -44
  14. package/dist/cjs/createNativeToast.native.cjs +54 -0
  15. package/dist/cjs/createNativeToast.native.js +36 -40
  16. package/dist/cjs/createNativeToast.native.js.map +1 -1
  17. package/dist/cjs/dispatchNativeToast.cjs +32 -35
  18. package/dist/cjs/dispatchNativeToast.native.cjs +48 -0
  19. package/dist/cjs/dispatchNativeToast.native.js +34 -36
  20. package/dist/cjs/dispatchNativeToast.native.js.map +1 -1
  21. package/dist/cjs/index.cjs +25 -12
  22. package/dist/cjs/index.native.cjs +35 -0
  23. package/dist/cjs/index.native.js +26 -12
  24. package/dist/cjs/index.native.js.map +1 -1
  25. package/dist/cjs/types.cjs +10 -11
  26. package/dist/cjs/types.native.cjs +19 -0
  27. package/dist/cjs/types.native.js +10 -10
  28. package/dist/cjs/types.native.js.map +1 -1
  29. package/dist/cjs/useAnimatedDragGesture.cjs +197 -194
  30. package/dist/cjs/useAnimatedDragGesture.native.cjs +210 -0
  31. package/dist/cjs/useAnimatedDragGesture.native.js +179 -191
  32. package/dist/cjs/useAnimatedDragGesture.native.js.map +1 -1
  33. package/dist/cjs/useReducedMotion.cjs +47 -55
  34. package/dist/cjs/useReducedMotion.native.cjs +74 -0
  35. package/dist/cjs/useReducedMotion.native.js +53 -60
  36. package/dist/cjs/useReducedMotion.native.js.map +1 -1
  37. package/dist/cjs/useToastAnimations.cjs +198 -270
  38. package/dist/cjs/useToastAnimations.native.cjs +229 -0
  39. package/dist/cjs/useToastAnimations.native.js +205 -276
  40. package/dist/cjs/useToastAnimations.native.js.map +1 -1
  41. package/dist/esm/ToastComposable.mjs +752 -854
  42. package/dist/esm/ToastComposable.mjs.map +1 -1
  43. package/dist/esm/ToastComposable.native.js +834 -940
  44. package/dist/esm/ToastComposable.native.js.map +1 -1
  45. package/dist/esm/ToastItemFrame.mjs +31 -99
  46. package/dist/esm/ToastItemFrame.mjs.map +1 -1
  47. package/dist/esm/ToastItemFrame.native.js +34 -102
  48. package/dist/esm/ToastItemFrame.native.js.map +1 -1
  49. package/dist/esm/ToastState.mjs +266 -273
  50. package/dist/esm/ToastState.mjs.map +1 -1
  51. package/dist/esm/ToastState.native.js +265 -274
  52. package/dist/esm/ToastState.native.js.map +1 -1
  53. package/dist/esm/createNativeToast.mjs +22 -26
  54. package/dist/esm/createNativeToast.mjs.map +1 -1
  55. package/dist/esm/createNativeToast.native.js +21 -23
  56. package/dist/esm/createNativeToast.native.js.map +1 -1
  57. package/dist/esm/dispatchNativeToast.mjs +19 -17
  58. package/dist/esm/dispatchNativeToast.mjs.map +1 -1
  59. package/dist/esm/dispatchNativeToast.native.js +21 -19
  60. package/dist/esm/dispatchNativeToast.native.js.map +1 -1
  61. package/dist/esm/index.js +5 -2
  62. package/dist/esm/index.mjs +5 -2
  63. package/dist/esm/index.native.js +5 -2
  64. package/dist/esm/types.mjs +0 -2
  65. package/dist/esm/types.native.js +0 -2
  66. package/dist/esm/useAnimatedDragGesture.mjs +181 -168
  67. package/dist/esm/useAnimatedDragGesture.mjs.map +1 -1
  68. package/dist/esm/useAnimatedDragGesture.native.js +163 -166
  69. package/dist/esm/useAnimatedDragGesture.native.js.map +1 -1
  70. package/dist/esm/useReducedMotion.mjs +31 -29
  71. package/dist/esm/useReducedMotion.mjs.map +1 -1
  72. package/dist/esm/useReducedMotion.native.js +37 -35
  73. package/dist/esm/useReducedMotion.native.js.map +1 -1
  74. package/dist/esm/useToastAnimations.mjs +183 -245
  75. package/dist/esm/useToastAnimations.mjs.map +1 -1
  76. package/dist/esm/useToastAnimations.native.js +190 -252
  77. package/dist/esm/useToastAnimations.native.js.map +1 -1
  78. package/dist/jsx/ToastComposable.mjs +752 -854
  79. package/dist/jsx/ToastComposable.mjs.map +1 -1
  80. package/dist/jsx/ToastComposable.native.cjs +924 -0
  81. package/dist/jsx/ToastComposable.native.js +854 -966
  82. package/dist/jsx/ToastComposable.native.js.map +1 -1
  83. package/dist/jsx/ToastItemFrame.mjs +31 -99
  84. package/dist/jsx/ToastItemFrame.mjs.map +1 -1
  85. package/dist/jsx/ToastItemFrame.native.cjs +76 -0
  86. package/dist/jsx/ToastItemFrame.native.js +50 -120
  87. package/dist/jsx/ToastItemFrame.native.js.map +1 -1
  88. package/dist/jsx/ToastState.mjs +266 -273
  89. package/dist/jsx/ToastState.mjs.map +1 -1
  90. package/dist/jsx/ToastState.native.cjs +312 -0
  91. package/dist/jsx/ToastState.native.js +280 -290
  92. package/dist/jsx/ToastState.native.js.map +1 -1
  93. package/dist/jsx/createNativeToast.mjs +22 -26
  94. package/dist/jsx/createNativeToast.mjs.map +1 -1
  95. package/dist/jsx/createNativeToast.native.cjs +54 -0
  96. package/dist/jsx/createNativeToast.native.js +36 -40
  97. package/dist/jsx/createNativeToast.native.js.map +1 -1
  98. package/dist/jsx/dispatchNativeToast.mjs +19 -17
  99. package/dist/jsx/dispatchNativeToast.mjs.map +1 -1
  100. package/dist/jsx/dispatchNativeToast.native.cjs +48 -0
  101. package/dist/jsx/dispatchNativeToast.native.js +34 -36
  102. package/dist/jsx/dispatchNativeToast.native.js.map +1 -1
  103. package/dist/jsx/index.js +5 -2
  104. package/dist/jsx/index.mjs +5 -2
  105. package/dist/jsx/index.native.cjs +35 -0
  106. package/dist/jsx/index.native.js +26 -12
  107. package/dist/jsx/index.native.js.map +1 -1
  108. package/dist/jsx/types.mjs +0 -2
  109. package/dist/jsx/types.native.cjs +19 -0
  110. package/dist/jsx/types.native.js +10 -10
  111. package/dist/jsx/types.native.js.map +1 -1
  112. package/dist/jsx/useAnimatedDragGesture.mjs +181 -168
  113. package/dist/jsx/useAnimatedDragGesture.mjs.map +1 -1
  114. package/dist/jsx/useAnimatedDragGesture.native.cjs +210 -0
  115. package/dist/jsx/useAnimatedDragGesture.native.js +179 -191
  116. package/dist/jsx/useAnimatedDragGesture.native.js.map +1 -1
  117. package/dist/jsx/useReducedMotion.mjs +31 -29
  118. package/dist/jsx/useReducedMotion.mjs.map +1 -1
  119. package/dist/jsx/useReducedMotion.native.cjs +74 -0
  120. package/dist/jsx/useReducedMotion.native.js +53 -60
  121. package/dist/jsx/useReducedMotion.native.js.map +1 -1
  122. package/dist/jsx/useToastAnimations.mjs +183 -245
  123. package/dist/jsx/useToastAnimations.mjs.map +1 -1
  124. package/dist/jsx/useToastAnimations.native.cjs +229 -0
  125. package/dist/jsx/useToastAnimations.native.js +205 -276
  126. package/dist/jsx/useToastAnimations.native.js.map +1 -1
  127. package/package.json +20 -37
  128. package/src/ToastComposable.tsx +55 -97
  129. package/src/ToastItemFrame.tsx +22 -81
  130. package/src/ToastState.ts +1 -0
  131. package/src/index.ts +34 -2
  132. package/src/types.ts +11 -0
  133. package/src/useAnimatedDragGesture.native.ts +1 -1
  134. package/src/useAnimatedDragGesture.ts +1 -1
  135. package/src/useToastAnimations.ts +20 -36
  136. package/types/ToastComposable.d.ts +124 -47
  137. package/types/ToastComposable.d.ts.map +1 -1
  138. package/types/ToastItemFrame.d.ts +52 -21
  139. package/types/ToastItemFrame.d.ts.map +1 -1
  140. package/types/ToastState.d.ts +15 -11
  141. package/types/ToastState.d.ts.map +1 -1
  142. package/types/index.d.ts +6 -2
  143. package/types/index.d.ts.map +1 -1
  144. package/types/types.d.ts +1 -0
  145. package/types/types.d.ts.map +1 -1
  146. package/types/useAnimatedDragGesture.d.ts +1 -1
  147. package/types/useAnimatedDragGesture.d.ts.map +1 -1
  148. package/types/useAnimatedDragGesture.native.d.ts +1 -1
  149. package/types/useAnimatedDragGesture.native.d.ts.map +1 -1
  150. package/types/useToastAnimations.d.ts +2 -8
  151. package/types/useToastAnimations.d.ts.map +1 -1
  152. package/dist/cjs/Toast.cjs +0 -178
  153. package/dist/cjs/Toast.native.js +0 -181
  154. package/dist/cjs/Toast.native.js.map +0 -1
  155. package/dist/cjs/ToastAnnounce.cjs +0 -103
  156. package/dist/cjs/ToastAnnounce.native.js +0 -111
  157. package/dist/cjs/ToastAnnounce.native.js.map +0 -1
  158. package/dist/cjs/ToastImperative.cjs +0 -119
  159. package/dist/cjs/ToastImperative.native.js +0 -130
  160. package/dist/cjs/ToastImperative.native.js.map +0 -1
  161. package/dist/cjs/ToastImpl.cjs +0 -354
  162. package/dist/cjs/ToastImpl.native.js +0 -364
  163. package/dist/cjs/ToastImpl.native.js.map +0 -1
  164. package/dist/cjs/ToastPortal.cjs +0 -49
  165. package/dist/cjs/ToastPortal.native.js +0 -52
  166. package/dist/cjs/ToastPortal.native.js.map +0 -1
  167. package/dist/cjs/ToastProvider.cjs +0 -150
  168. package/dist/cjs/ToastProvider.native.js +0 -161
  169. package/dist/cjs/ToastProvider.native.js.map +0 -1
  170. package/dist/cjs/ToastViewport.cjs +0 -319
  171. package/dist/cjs/ToastViewport.native.js +0 -343
  172. package/dist/cjs/ToastViewport.native.js.map +0 -1
  173. package/dist/cjs/Toaster.cjs +0 -87
  174. package/dist/cjs/Toaster.native.js +0 -91
  175. package/dist/cjs/Toaster.native.js.map +0 -1
  176. package/dist/cjs/constants.cjs +0 -30
  177. package/dist/cjs/constants.native.js +0 -33
  178. package/dist/cjs/constants.native.js.map +0 -1
  179. package/dist/cjs/v2.cjs +0 -36
  180. package/dist/cjs/v2.native.js +0 -39
  181. package/dist/cjs/v2.native.js.map +0 -1
  182. package/dist/esm/Toast.mjs +0 -137
  183. package/dist/esm/Toast.mjs.map +0 -1
  184. package/dist/esm/Toast.native.js +0 -137
  185. package/dist/esm/Toast.native.js.map +0 -1
  186. package/dist/esm/ToastAnnounce.mjs +0 -66
  187. package/dist/esm/ToastAnnounce.mjs.map +0 -1
  188. package/dist/esm/ToastAnnounce.native.js +0 -71
  189. package/dist/esm/ToastAnnounce.native.js.map +0 -1
  190. package/dist/esm/ToastImperative.mjs +0 -80
  191. package/dist/esm/ToastImperative.mjs.map +0 -1
  192. package/dist/esm/ToastImperative.native.js +0 -88
  193. package/dist/esm/ToastImperative.native.js.map +0 -1
  194. package/dist/esm/ToastImpl.mjs +0 -316
  195. package/dist/esm/ToastImpl.mjs.map +0 -1
  196. package/dist/esm/ToastImpl.native.js +0 -329
  197. package/dist/esm/ToastImpl.native.js.map +0 -1
  198. package/dist/esm/ToastPortal.mjs +0 -24
  199. package/dist/esm/ToastPortal.mjs.map +0 -1
  200. package/dist/esm/ToastPortal.native.js +0 -24
  201. package/dist/esm/ToastPortal.native.js.map +0 -1
  202. package/dist/esm/ToastProvider.mjs +0 -110
  203. package/dist/esm/ToastProvider.mjs.map +0 -1
  204. package/dist/esm/ToastProvider.native.js +0 -118
  205. package/dist/esm/ToastProvider.native.js.map +0 -1
  206. package/dist/esm/ToastViewport.mjs +0 -280
  207. package/dist/esm/ToastViewport.mjs.map +0 -1
  208. package/dist/esm/ToastViewport.native.js +0 -301
  209. package/dist/esm/ToastViewport.native.js.map +0 -1
  210. package/dist/esm/Toaster.mjs +0 -51
  211. package/dist/esm/Toaster.mjs.map +0 -1
  212. package/dist/esm/Toaster.native.js +0 -52
  213. package/dist/esm/Toaster.native.js.map +0 -1
  214. package/dist/esm/constants.mjs +0 -4
  215. package/dist/esm/constants.mjs.map +0 -1
  216. package/dist/esm/constants.native.js +0 -4
  217. package/dist/esm/constants.native.js.map +0 -1
  218. package/dist/esm/index.js.map +0 -1
  219. package/dist/esm/index.mjs.map +0 -1
  220. package/dist/esm/index.native.js.map +0 -1
  221. package/dist/esm/types.mjs.map +0 -1
  222. package/dist/esm/types.native.js.map +0 -1
  223. package/dist/esm/v2.mjs +0 -6
  224. package/dist/esm/v2.mjs.map +0 -1
  225. package/dist/esm/v2.native.js +0 -6
  226. package/dist/esm/v2.native.js.map +0 -1
  227. package/dist/jsx/Toast.mjs +0 -137
  228. package/dist/jsx/Toast.mjs.map +0 -1
  229. package/dist/jsx/Toast.native.js +0 -181
  230. package/dist/jsx/Toast.native.js.map +0 -1
  231. package/dist/jsx/ToastAnnounce.mjs +0 -66
  232. package/dist/jsx/ToastAnnounce.mjs.map +0 -1
  233. package/dist/jsx/ToastAnnounce.native.js +0 -111
  234. package/dist/jsx/ToastAnnounce.native.js.map +0 -1
  235. package/dist/jsx/ToastImperative.mjs +0 -80
  236. package/dist/jsx/ToastImperative.mjs.map +0 -1
  237. package/dist/jsx/ToastImperative.native.js +0 -130
  238. package/dist/jsx/ToastImperative.native.js.map +0 -1
  239. package/dist/jsx/ToastImpl.mjs +0 -316
  240. package/dist/jsx/ToastImpl.mjs.map +0 -1
  241. package/dist/jsx/ToastImpl.native.js +0 -364
  242. package/dist/jsx/ToastImpl.native.js.map +0 -1
  243. package/dist/jsx/ToastPortal.mjs +0 -24
  244. package/dist/jsx/ToastPortal.mjs.map +0 -1
  245. package/dist/jsx/ToastPortal.native.js +0 -52
  246. package/dist/jsx/ToastPortal.native.js.map +0 -1
  247. package/dist/jsx/ToastProvider.mjs +0 -110
  248. package/dist/jsx/ToastProvider.mjs.map +0 -1
  249. package/dist/jsx/ToastProvider.native.js +0 -161
  250. package/dist/jsx/ToastProvider.native.js.map +0 -1
  251. package/dist/jsx/ToastViewport.mjs +0 -280
  252. package/dist/jsx/ToastViewport.mjs.map +0 -1
  253. package/dist/jsx/ToastViewport.native.js +0 -343
  254. package/dist/jsx/ToastViewport.native.js.map +0 -1
  255. package/dist/jsx/Toaster.mjs +0 -51
  256. package/dist/jsx/Toaster.mjs.map +0 -1
  257. package/dist/jsx/Toaster.native.js +0 -91
  258. package/dist/jsx/Toaster.native.js.map +0 -1
  259. package/dist/jsx/constants.mjs +0 -4
  260. package/dist/jsx/constants.mjs.map +0 -1
  261. package/dist/jsx/constants.native.js +0 -33
  262. package/dist/jsx/constants.native.js.map +0 -1
  263. package/dist/jsx/index.js.map +0 -1
  264. package/dist/jsx/index.mjs.map +0 -1
  265. package/dist/jsx/types.mjs.map +0 -1
  266. package/dist/jsx/v2.mjs +0 -6
  267. package/dist/jsx/v2.mjs.map +0 -1
  268. package/dist/jsx/v2.native.js +0 -39
  269. package/dist/jsx/v2.native.js.map +0 -1
  270. package/src/Toast.tsx +0 -219
  271. package/src/ToastAnnounce.tsx +0 -103
  272. package/src/ToastImperative.tsx +0 -192
  273. package/src/ToastImpl.tsx +0 -514
  274. package/src/ToastPortal.tsx +0 -19
  275. package/src/ToastProvider.tsx +0 -204
  276. package/src/ToastViewport.tsx +0 -430
  277. package/src/Toaster.tsx +0 -181
  278. package/src/constants.ts +0 -2
  279. package/src/v2.ts +0 -31
  280. package/types/Toast.d.ts +0 -84
  281. package/types/Toast.d.ts.map +0 -1
  282. package/types/ToastAnnounce.d.ts +0 -18
  283. package/types/ToastAnnounce.d.ts.map +0 -1
  284. package/types/ToastImperative.d.ts +0 -95
  285. package/types/ToastImperative.d.ts.map +0 -1
  286. package/types/ToastImpl.d.ts +0 -109
  287. package/types/ToastImpl.d.ts.map +0 -1
  288. package/types/ToastPortal.d.ts +0 -8
  289. package/types/ToastPortal.d.ts.map +0 -1
  290. package/types/ToastProvider.d.ts +0 -92
  291. package/types/ToastProvider.d.ts.map +0 -1
  292. package/types/ToastViewport.d.ts +0 -75
  293. package/types/ToastViewport.d.ts.map +0 -1
  294. package/types/Toaster.d.ts +0 -112
  295. package/types/Toaster.d.ts.map +0 -1
  296. package/types/constants.d.ts +0 -3
  297. package/types/constants.d.ts.map +0 -1
  298. package/types/v2.d.ts +0 -10
  299. package/types/v2.d.ts.map +0 -1
  300. package/v2/index.cjs +0 -2
  301. package/v2/index.js +0 -2
  302. package/v2/index.native.cjs +0 -2
  303. package/v2/index.native.js +0 -2
@@ -1,329 +0,0 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { useIsPresent } from "@tamagui/animate-presence";
3
- import { useComposedRefs } from "@tamagui/compose-refs";
4
- import { isWeb } from "@tamagui/constants";
5
- import { Theme, View, createStyledContext, styled, useConfiguration, useEvent, useThemeName } from "@tamagui/core";
6
- import { Dismissable } from "@tamagui/dismissable";
7
- import { composeEventHandlers } from "@tamagui/helpers";
8
- import { PortalItem } from "@tamagui/portal";
9
- import { YStack } from "@tamagui/stacks";
10
- import * as React from "react";
11
- import { TOAST_NAME } from "./constants.native.js";
12
- import { ToastAnnounce } from "./ToastAnnounce.native.js";
13
- import { Collection, useToastProviderContext } from "./ToastProvider.native.js";
14
- import { VIEWPORT_PAUSE, VIEWPORT_RESUME } from "./ToastViewport.native.js";
15
- var __require = /* @__PURE__ */(x => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
16
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
17
- }) : x)(function (x) {
18
- if (typeof require !== "undefined") return require.apply(this, arguments);
19
- throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
20
- });
21
- var getPanResponder = function () {
22
- return require("react-native").PanResponder;
23
- };
24
- var ToastImplFrame = styled(YStack, {
25
- name: "ToastImpl",
26
- tabIndex: 0,
27
- variants: {
28
- unstyled: {
29
- false: {
30
- focusStyle: {
31
- outlineStyle: "solid",
32
- outlineWidth: 2,
33
- outlineColor: "$outlineColor"
34
- },
35
- backgroundColor: "$color6",
36
- borderRadius: "$4",
37
- paddingHorizontal: "$4",
38
- paddingVertical: "$3",
39
- marginHorizontal: "auto",
40
- marginVertical: "$1",
41
- elevation: "$3"
42
- }
43
- }
44
- },
45
- defaultVariants: {
46
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
47
- }
48
- });
49
- var {
50
- Provider: ToastInteractiveProvider,
51
- useStyledContext: useToastInteractiveContext
52
- } = createStyledContext({
53
- onClose() {}
54
- });
55
- var ToastImpl = /* @__PURE__ */React.forwardRef(function (props, forwardedRef) {
56
- var {
57
- scope,
58
- type = "foreground",
59
- duration: durationProp,
60
- open,
61
- onClose,
62
- onEscapeKeyDown,
63
- onPause,
64
- onResume,
65
- onSwipeStart,
66
- onSwipeMove,
67
- onSwipeCancel,
68
- onSwipeEnd,
69
- viewportName = "default",
70
- ...toastProps
71
- } = props;
72
- var isPresent = useIsPresent();
73
- var context = useToastProviderContext(scope);
74
- var [node, setNode] = React.useState(null);
75
- var composedRefs = useComposedRefs(forwardedRef, setNode);
76
- var duration = durationProp || context.duration;
77
- var closeTimerStartTimeRef = React.useRef(0);
78
- var closeTimerRemainingTimeRef = React.useRef(duration);
79
- var closeTimerRef = React.useRef(0);
80
- var {
81
- onToastAdd,
82
- onToastRemove
83
- } = context;
84
- var viewport = React.useMemo(function () {
85
- return context.viewports[viewportName];
86
- }, [context.viewports, viewportName]);
87
- var handleClose = useEvent(function () {
88
- if (!isPresent) return;
89
- if (isWeb) {
90
- if (node === null || node === void 0 ? void 0 : node.contains(document.activeElement)) viewport === null || viewport === void 0 || viewport.focus();
91
- }
92
- onClose();
93
- });
94
- var startTimer = React.useCallback(function (duration2) {
95
- if (!duration2 || duration2 === Number.POSITIVE_INFINITY) return;
96
- clearTimeout(closeTimerRef.current);
97
- closeTimerStartTimeRef.current = (/* @__PURE__ */new Date()).getTime();
98
- closeTimerRef.current = setTimeout(handleClose, duration2);
99
- }, [handleClose]);
100
- var handleResume = React.useCallback(function () {
101
- startTimer(closeTimerRemainingTimeRef.current);
102
- onResume === null || onResume === void 0 || onResume();
103
- }, [onResume, startTimer]);
104
- var handlePause = React.useCallback(function () {
105
- var elapsedTime = (/* @__PURE__ */new Date()).getTime() - closeTimerStartTimeRef.current;
106
- closeTimerRemainingTimeRef.current = closeTimerRemainingTimeRef.current - elapsedTime;
107
- window.clearTimeout(closeTimerRef.current);
108
- onPause === null || onPause === void 0 || onPause();
109
- }, [onPause]);
110
- React.useEffect(function () {
111
- if (!isWeb) return;
112
- if (viewport) {
113
- viewport.addEventListener(VIEWPORT_PAUSE, handlePause);
114
- viewport.addEventListener(VIEWPORT_RESUME, handleResume);
115
- return function () {
116
- viewport.removeEventListener(VIEWPORT_PAUSE, handlePause);
117
- viewport.removeEventListener(VIEWPORT_RESUME, handleResume);
118
- };
119
- }
120
- }, [viewport, duration, onPause, onResume, startTimer]);
121
- React.useEffect(function () {
122
- if (open && !context.isClosePausedRef.current) startTimer(duration);
123
- }, [open, duration, context.isClosePausedRef, startTimer]);
124
- React.useEffect(function () {
125
- onToastAdd();
126
- return function () {
127
- return onToastRemove();
128
- };
129
- }, [onToastAdd, onToastRemove]);
130
- var announceTextContent = React.useMemo(function () {
131
- if (!isWeb) return null;
132
- return node ? getAnnounceTextContent(node) : null;
133
- }, [node]);
134
- var isHorizontalSwipe = ["left", "right", "horizontal"].includes(context.swipeDirection);
135
- var {
136
- animationDriver
137
- } = useConfiguration();
138
- if (!animationDriver) throw new Error("Must set animations in tamagui.config.ts");
139
- var {
140
- useAnimatedNumber,
141
- useAnimatedNumberStyle
142
- } = animationDriver;
143
- var animatedNumber = useAnimatedNumber(0);
144
- var _animationDriver_NumberView, _ref;
145
- var AnimatedView = (_ref = (_animationDriver_NumberView = animationDriver["NumberView"]) !== null && _animationDriver_NumberView !== void 0 ? _animationDriver_NumberView : animationDriver.View) !== null && _ref !== void 0 ? _ref : View;
146
- var animatedStyles = useAnimatedNumberStyle(animatedNumber, function (val) {
147
- "worklet";
148
-
149
- return {
150
- transform: [isHorizontalSwipe ? {
151
- translateX: val
152
- } : {
153
- translateY: val
154
- }]
155
- };
156
- });
157
- var panResponder = React.useMemo(function () {
158
- var PanResponder = getPanResponder();
159
- if (!PanResponder) return null;
160
- return PanResponder.create({
161
- onMoveShouldSetPanResponder: function (e, gesture) {
162
- if (shouldGrantGestureMove(context.swipeDirection, gesture)) {
163
- onSwipeStart === null || onSwipeStart === void 0 || onSwipeStart(e);
164
- return true;
165
- }
166
- return false;
167
- },
168
- onPanResponderGrant: function (e) {
169
- if (!isWeb) handlePause === null || handlePause === void 0 || handlePause();
170
- },
171
- onPanResponderMove: function (e, gesture) {
172
- var {
173
- x,
174
- y
175
- } = getGestureDistance(context.swipeDirection, gesture);
176
- var delta = {
177
- x,
178
- y
179
- };
180
- animatedNumber.setValue(isHorizontalSwipe ? x : y, {
181
- type: "direct"
182
- });
183
- if (isDeltaInDirection(delta, context.swipeDirection, context.swipeThreshold)) onSwipeEnd === null || onSwipeEnd === void 0 || onSwipeEnd(e);
184
- onSwipeMove === null || onSwipeMove === void 0 || onSwipeMove(e);
185
- },
186
- onPanResponderEnd: function (e, param) {
187
- var {
188
- dx,
189
- dy
190
- } = param;
191
- if (!isDeltaInDirection({
192
- x: dx,
193
- y: dy
194
- }, context.swipeDirection, context.swipeThreshold)) {
195
- if (!isWeb) handleResume === null || handleResume === void 0 || handleResume();
196
- onSwipeCancel === null || onSwipeCancel === void 0 || onSwipeCancel(e);
197
- animatedNumber.setValue(0, {
198
- type: "spring"
199
- });
200
- }
201
- }
202
- });
203
- }, [handlePause, handleResume]);
204
- var themeName = useThemeName();
205
- return /* @__PURE__ */jsxs(Fragment, {
206
- children: [announceTextContent && /* @__PURE__ */jsx(ToastAnnounce, {
207
- scope,
208
- role: "status",
209
- "aria-live": type === "foreground" ? "assertive" : "polite",
210
- "aria-atomic": true,
211
- children: announceTextContent
212
- }), /* @__PURE__ */jsx(PortalItem, {
213
- hostName: viewportName !== null && viewportName !== void 0 ? viewportName : "default",
214
- children: /* @__PURE__ */jsx(ToastInteractiveProvider, {
215
- scope,
216
- onClose: function () {
217
- handleClose();
218
- },
219
- children: /* @__PURE__ */jsx(Dismissable, {
220
- onEscapeKeyDown: composeEventHandlers(onEscapeKeyDown, function () {
221
- if (!context.isFocusedToastEscapeKeyDownRef.current) handleClose();
222
- context.isFocusedToastEscapeKeyDownRef.current = false;
223
- }),
224
- children: /* @__PURE__ */jsx(Theme, {
225
- contain: true,
226
- forceClassName: true,
227
- name: themeName,
228
- children: /* @__PURE__ */jsx(AnimatedView, {
229
- ...(panResponder === null || panResponder === void 0 ? void 0 : panResponder.panHandlers),
230
- style: [{
231
- margin: "auto"
232
- }, animatedStyles],
233
- children: /* @__PURE__ */jsx(Collection.ItemSlot, {
234
- scope: context.toastScope,
235
- children: /* @__PURE__ */jsx(ToastImplFrame, {
236
- role: "status",
237
- "aria-live": "off",
238
- "aria-atomic": true,
239
- "data-state": open ? "open" : "closed",
240
- "data-swipe-direction": context.swipeDirection,
241
- pointerEvents: "auto",
242
- "$platform-web": {
243
- touchAction: "none",
244
- userSelect: "none"
245
- },
246
- ...toastProps,
247
- ref: composedRefs,
248
- ...(isWeb && {
249
- onKeyDown: composeEventHandlers(props.onKeyDown, function (event) {
250
- if (event.key !== "Escape") return;
251
- onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
252
- if (!event.defaultPrevented) {
253
- context.isFocusedToastEscapeKeyDownRef.current = true;
254
- handleClose();
255
- }
256
- })
257
- })
258
- })
259
- })
260
- })
261
- })
262
- })
263
- }, props.id)
264
- })]
265
- });
266
- });
267
- ToastImpl.propTypes = {
268
- type(props) {
269
- if (props.type && !["foreground", "background"].includes(props.type)) {
270
- var error = `Invalid prop \`type\` supplied to \`${TOAST_NAME}\`. Expected \`foreground | background\`.`;
271
- return new Error(error);
272
- }
273
- return null;
274
- }
275
- };
276
- var isDeltaInDirection = function (delta, direction) {
277
- var threshold = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
278
- var deltaX = Math.abs(delta.x);
279
- var deltaY = Math.abs(delta.y);
280
- var isDeltaX = deltaX > deltaY;
281
- if (direction === "left" || direction === "right" || direction === "horizontal") return isDeltaX && deltaX > threshold;
282
- return !isDeltaX && deltaY > threshold;
283
- };
284
- function getAnnounceTextContent(container) {
285
- if (!isWeb) return "";
286
- var textContent = [];
287
- Array.from(container.childNodes).forEach(function (node) {
288
- if (node.nodeType === node.TEXT_NODE && node.textContent) textContent.push(node.textContent);
289
- if (isHTMLElement(node)) {
290
- var isHidden = node.ariaHidden || node.hidden || node.style.display === "none";
291
- var isExcluded = node.dataset.toastAnnounceExclude === "";
292
- if (!isHidden) if (isExcluded) {
293
- var altText = node.dataset.toastAnnounceAlt;
294
- if (altText) textContent.push(altText);
295
- } else textContent.push(...getAnnounceTextContent(node));
296
- }
297
- });
298
- return textContent;
299
- }
300
- function isHTMLElement(node) {
301
- return node.nodeType === node.ELEMENT_NODE;
302
- }
303
- var GESTURE_GRANT_THRESHOLD = 10;
304
- var shouldGrantGestureMove = function (dir, param) {
305
- var {
306
- dx,
307
- dy
308
- } = param;
309
- if ((dir === "horizontal" || dir === "left") && dx < -GESTURE_GRANT_THRESHOLD) return true;
310
- if ((dir === "horizontal" || dir === "right") && dx > GESTURE_GRANT_THRESHOLD) return true;
311
- if ((dir === "vertical" || dir === "up") && dy > -GESTURE_GRANT_THRESHOLD) return true;
312
- if ((dir === "vertical" || dir === "down") && dy < GESTURE_GRANT_THRESHOLD) return true;
313
- return false;
314
- };
315
- var getGestureDistance = function (dir, param) {
316
- var {
317
- dx,
318
- dy
319
- } = param;
320
- var y = 0;
321
- var x = 0;
322
- if (dir === "horizontal") x = dx;else if (dir === "left") x = Math.min(0, dx);else if (dir === "right") x = Math.max(0, dx);else if (dir === "vertical") y = dy;else if (dir === "up") y = Math.min(0, dy);else if (dir === "down") y = Math.max(0, dy);
323
- return {
324
- x,
325
- y
326
- };
327
- };
328
- export { ToastImpl, ToastImplFrame, useToastInteractiveContext };
329
- //# sourceMappingURL=ToastImpl.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Fragment","jsx","jsxs","useIsPresent","useComposedRefs","isWeb","Theme","View","createStyledContext","styled","useConfiguration","useEvent","useThemeName","Dismissable","composeEventHandlers","PortalItem","YStack","React","TOAST_NAME","ToastAnnounce","Collection","useToastProviderContext","VIEWPORT_PAUSE","VIEWPORT_RESUME","__require","x","require","Proxy","get","a","b","apply","arguments","Error","getPanResponder","PanResponder","ToastImplFrame","name","tabIndex","variants","unstyled","false","focusStyle","outlineStyle","outlineWidth","outlineColor","backgroundColor","borderRadius","paddingHorizontal","paddingVertical","marginHorizontal","marginVertical","elevation","defaultVariants","process","env","TAMAGUI_HEADLESS","Provider","ToastInteractiveProvider","useStyledContext","useToastInteractiveContext","onClose","ToastImpl","forwardRef","props","forwardedRef","scope","type","duration","durationProp","open","onEscapeKeyDown","onPause","onResume","onSwipeStart","onSwipeMove","onSwipeCancel","onSwipeEnd","viewportName","toastProps","isPresent","context","node","setNode","useState","composedRefs","closeTimerStartTimeRef","useRef","closeTimerRemainingTimeRef","closeTimerRef","onToastAdd","onToastRemove","viewport","useMemo","viewports","handleClose","contains","document","activeElement","focus","startTimer","useCallback","duration2","Number","POSITIVE_INFINITY","clearTimeout","current","Date","getTime","setTimeout","handleResume","handlePause","elapsedTime","window","useEffect","addEventListener","removeEventListener","isClosePausedRef","announceTextContent","getAnnounceTextContent","isHorizontalSwipe","includes","swipeDirection","animationDriver","useAnimatedNumber","useAnimatedNumberStyle","animatedNumber","_animationDriver_NumberView","_ref","AnimatedView","animatedStyles","val","transform","translateX","translateY","panResponder","create","onMoveShouldSetPanResponder","e","gesture","shouldGrantGestureMove","onPanResponderGrant","onPanResponderMove","y","getGestureDistance","delta","setValue","isDeltaInDirection","swipeThreshold","onPanResponderEnd","param","dx","dy","themeName","children","role","hostName","isFocusedToastEscapeKeyDownRef","contain","forceClassName","panHandlers","style","margin","ItemSlot","toastScope","pointerEvents","touchAction","userSelect","ref","onKeyDown","event","key","defaultPrevented","id","propTypes","error","direction","threshold","length","deltaX","Math","abs","deltaY","isDeltaX","container","textContent","Array","from","childNodes","forEach","nodeType","TEXT_NODE","push","isHTMLElement","isHidden","ariaHidden","hidden","display","isExcluded","dataset","toastAnnounceExclude","altText","toastAnnounceAlt","ELEMENT_NODE","GESTURE_GRANT_THRESHOLD","dir","min","max"],"sources":["ToastImpl.native.js"],"sourcesContent":["import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { useIsPresent } from \"@tamagui/animate-presence\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { Theme, View, createStyledContext, styled, useConfiguration, useEvent, useThemeName } from \"@tamagui/core\";\nimport { Dismissable } from \"@tamagui/dismissable\";\nimport { composeEventHandlers } from \"@tamagui/helpers\";\nimport { PortalItem } from \"@tamagui/portal\";\nimport { YStack } from \"@tamagui/stacks\";\nimport * as React from \"react\";\nimport { TOAST_NAME } from \"./constants\";\nimport { ToastAnnounce } from \"./ToastAnnounce\";\nimport { Collection, useToastProviderContext } from \"./ToastProvider\";\nimport { VIEWPORT_PAUSE, VIEWPORT_RESUME } from \"./ToastViewport\";\n\nvar __require = /* @__PURE__ */ ((x) => typeof require !== \"undefined\" ? require : typeof Proxy !== \"undefined\" ? new Proxy(x, { get: (a, b) => (typeof require !== \"undefined\" ? require : a)[b] }) : x)(function(x) {\n\tif (typeof require !== \"undefined\") return require.apply(this, arguments);\n\tthrow Error(\"Calling `require` for \\\"\" + x + \"\\\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.\");\n});\n\nvar getPanResponder = function() {\n\treturn require(\"react-native\").PanResponder;\n};\nvar ToastImplFrame = styled(YStack, {\n\tname: \"ToastImpl\",\n\ttabIndex: 0,\n\tvariants: { unstyled: { false: {\n\t\tfocusStyle: {\n\t\t\toutlineStyle: \"solid\",\n\t\t\toutlineWidth: 2,\n\t\t\toutlineColor: \"$outlineColor\"\n\t\t},\n\t\tbackgroundColor: \"$color6\",\n\t\tborderRadius: \"$4\",\n\t\tpaddingHorizontal: \"$4\",\n\t\tpaddingVertical: \"$3\",\n\t\tmarginHorizontal: \"auto\",\n\t\tmarginVertical: \"$1\",\n\t\televation: \"$3\"\n\t} } },\n\tdefaultVariants: { unstyled: process.env.TAMAGUI_HEADLESS === \"1\" }\n});\nvar { Provider: ToastInteractiveProvider, useStyledContext: useToastInteractiveContext } = createStyledContext({ onClose() {} });\nvar ToastImpl = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {\n\tvar { scope, type = \"foreground\", duration: durationProp, open, onClose, onEscapeKeyDown, onPause, onResume, onSwipeStart, onSwipeMove, onSwipeCancel, onSwipeEnd, viewportName = \"default\", ...toastProps } = props;\n\tvar isPresent = useIsPresent();\n\tvar context = useToastProviderContext(scope);\n\tvar [node, setNode] = React.useState(null);\n\tvar composedRefs = useComposedRefs(forwardedRef, setNode);\n\tvar duration = durationProp || context.duration;\n\tvar closeTimerStartTimeRef = React.useRef(0);\n\tvar closeTimerRemainingTimeRef = React.useRef(duration);\n\tvar closeTimerRef = React.useRef(0);\n\tvar { onToastAdd, onToastRemove } = context;\n\tvar viewport = React.useMemo(function() {\n\t\treturn context.viewports[viewportName];\n\t}, [context.viewports, viewportName]);\n\tvar handleClose = useEvent(function() {\n\t\tif (!isPresent) return;\n\t\tif (isWeb) {\n\t\t\tif (node === null || node === void 0 ? void 0 : node.contains(document.activeElement)) viewport === null || viewport === void 0 || viewport.focus();\n\t\t}\n\t\tonClose();\n\t});\n\tvar startTimer = React.useCallback(function(duration2) {\n\t\tif (!duration2 || duration2 === Number.POSITIVE_INFINITY) return;\n\t\tclearTimeout(closeTimerRef.current);\n\t\tcloseTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();\n\t\tcloseTimerRef.current = setTimeout(handleClose, duration2);\n\t}, [handleClose]);\n\tvar handleResume = React.useCallback(function() {\n\t\tstartTimer(closeTimerRemainingTimeRef.current);\n\t\tonResume === null || onResume === void 0 || onResume();\n\t}, [onResume, startTimer]);\n\tvar handlePause = React.useCallback(function() {\n\t\tvar elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;\n\t\tcloseTimerRemainingTimeRef.current = closeTimerRemainingTimeRef.current - elapsedTime;\n\t\twindow.clearTimeout(closeTimerRef.current);\n\t\tonPause === null || onPause === void 0 || onPause();\n\t}, [onPause]);\n\tReact.useEffect(function() {\n\t\tif (!isWeb) return;\n\t\tif (viewport) {\n\t\t\tviewport.addEventListener(VIEWPORT_PAUSE, handlePause);\n\t\t\tviewport.addEventListener(VIEWPORT_RESUME, handleResume);\n\t\t\treturn function() {\n\t\t\t\tviewport.removeEventListener(VIEWPORT_PAUSE, handlePause);\n\t\t\t\tviewport.removeEventListener(VIEWPORT_RESUME, handleResume);\n\t\t\t};\n\t\t}\n\t}, [\n\t\tviewport,\n\t\tduration,\n\t\tonPause,\n\t\tonResume,\n\t\tstartTimer\n\t]);\n\tReact.useEffect(function() {\n\t\tif (open && !context.isClosePausedRef.current) startTimer(duration);\n\t}, [\n\t\topen,\n\t\tduration,\n\t\tcontext.isClosePausedRef,\n\t\tstartTimer\n\t]);\n\tReact.useEffect(function() {\n\t\tonToastAdd();\n\t\treturn function() {\n\t\t\treturn onToastRemove();\n\t\t};\n\t}, [onToastAdd, onToastRemove]);\n\tvar announceTextContent = React.useMemo(function() {\n\t\tif (!isWeb) return null;\n\t\treturn node ? getAnnounceTextContent(node) : null;\n\t}, [node]);\n\tvar isHorizontalSwipe = [\n\t\t\"left\",\n\t\t\"right\",\n\t\t\"horizontal\"\n\t].includes(context.swipeDirection);\n\tvar { animationDriver } = useConfiguration();\n\tif (!animationDriver) throw new Error(\"Must set animations in tamagui.config.ts\");\n\tvar { useAnimatedNumber, useAnimatedNumberStyle } = animationDriver;\n\tvar animatedNumber = useAnimatedNumber(0);\n\tvar _animationDriver_NumberView, _ref;\n\tvar AnimatedView = (_ref = (_animationDriver_NumberView = animationDriver[\"NumberView\"]) !== null && _animationDriver_NumberView !== void 0 ? _animationDriver_NumberView : animationDriver.View) !== null && _ref !== void 0 ? _ref : View;\n\tvar animatedStyles = useAnimatedNumberStyle(animatedNumber, function(val) {\n\t\t\"worklet\";\n\t\treturn { transform: [isHorizontalSwipe ? { translateX: val } : { translateY: val }] };\n\t});\n\tvar panResponder = React.useMemo(function() {\n\t\tvar PanResponder = getPanResponder();\n\t\tif (!PanResponder) return null;\n\t\treturn PanResponder.create({\n\t\t\tonMoveShouldSetPanResponder: function(e, gesture) {\n\t\t\t\tif (shouldGrantGestureMove(context.swipeDirection, gesture)) {\n\t\t\t\t\tonSwipeStart === null || onSwipeStart === void 0 || onSwipeStart(e);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tonPanResponderGrant: function(e) {\n\t\t\t\tif (!isWeb) handlePause === null || handlePause === void 0 || handlePause();\n\t\t\t},\n\t\t\tonPanResponderMove: function(e, gesture) {\n\t\t\t\tvar { x, y } = getGestureDistance(context.swipeDirection, gesture);\n\t\t\t\tvar delta = {\n\t\t\t\t\tx,\n\t\t\t\t\ty\n\t\t\t\t};\n\t\t\t\tanimatedNumber.setValue(isHorizontalSwipe ? x : y, { type: \"direct\" });\n\t\t\t\tif (isDeltaInDirection(delta, context.swipeDirection, context.swipeThreshold)) onSwipeEnd === null || onSwipeEnd === void 0 || onSwipeEnd(e);\n\t\t\t\tonSwipeMove === null || onSwipeMove === void 0 || onSwipeMove(e);\n\t\t\t},\n\t\t\tonPanResponderEnd: function(e, param) {\n\t\t\t\tvar { dx, dy } = param;\n\t\t\t\tif (!isDeltaInDirection({\n\t\t\t\t\tx: dx,\n\t\t\t\t\ty: dy\n\t\t\t\t}, context.swipeDirection, context.swipeThreshold)) {\n\t\t\t\t\tif (!isWeb) handleResume === null || handleResume === void 0 || handleResume();\n\t\t\t\t\tonSwipeCancel === null || onSwipeCancel === void 0 || onSwipeCancel(e);\n\t\t\t\t\tanimatedNumber.setValue(0, { type: \"spring\" });\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}, [handlePause, handleResume]);\n\tvar themeName = useThemeName();\n\treturn /* @__PURE__ */ jsxs(Fragment, { children: [announceTextContent && /* @__PURE__ */ jsx(ToastAnnounce, {\n\t\tscope,\n\t\trole: \"status\",\n\t\t\"aria-live\": type === \"foreground\" ? \"assertive\" : \"polite\",\n\t\t\"aria-atomic\": true,\n\t\tchildren: announceTextContent\n\t}), /* @__PURE__ */ jsx(PortalItem, {\n\t\thostName: viewportName !== null && viewportName !== void 0 ? viewportName : \"default\",\n\t\tchildren: /* @__PURE__ */ jsx(ToastInteractiveProvider, {\n\t\t\tscope,\n\t\t\tonClose: function() {\n\t\t\t\thandleClose();\n\t\t\t},\n\t\t\tchildren: /* @__PURE__ */ jsx(Dismissable, {\n\t\t\t\tonEscapeKeyDown: composeEventHandlers(onEscapeKeyDown, function() {\n\t\t\t\t\tif (!context.isFocusedToastEscapeKeyDownRef.current) handleClose();\n\t\t\t\t\tcontext.isFocusedToastEscapeKeyDownRef.current = false;\n\t\t\t\t}),\n\t\t\t\tchildren: /* @__PURE__ */ jsx(Theme, {\n\t\t\t\t\tcontain: true,\n\t\t\t\t\tforceClassName: true,\n\t\t\t\t\tname: themeName,\n\t\t\t\t\tchildren: /* @__PURE__ */ jsx(AnimatedView, {\n\t\t\t\t\t\t...panResponder === null || panResponder === void 0 ? void 0 : panResponder.panHandlers,\n\t\t\t\t\t\tstyle: [{ margin: \"auto\" }, animatedStyles],\n\t\t\t\t\t\tchildren: /* @__PURE__ */ jsx(Collection.ItemSlot, {\n\t\t\t\t\t\t\tscope: context.toastScope,\n\t\t\t\t\t\t\tchildren: /* @__PURE__ */ jsx(ToastImplFrame, {\n\t\t\t\t\t\t\t\trole: \"status\",\n\t\t\t\t\t\t\t\t\"aria-live\": \"off\",\n\t\t\t\t\t\t\t\t\"aria-atomic\": true,\n\t\t\t\t\t\t\t\t\"data-state\": open ? \"open\" : \"closed\",\n\t\t\t\t\t\t\t\t\"data-swipe-direction\": context.swipeDirection,\n\t\t\t\t\t\t\t\tpointerEvents: \"auto\",\n\t\t\t\t\t\t\t\t\"$platform-web\": {\n\t\t\t\t\t\t\t\t\ttouchAction: \"none\",\n\t\t\t\t\t\t\t\t\tuserSelect: \"none\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t...toastProps,\n\t\t\t\t\t\t\t\tref: composedRefs,\n\t\t\t\t\t\t\t\t...isWeb && { onKeyDown: composeEventHandlers(props.onKeyDown, function(event) {\n\t\t\t\t\t\t\t\t\tif (event.key !== \"Escape\") return;\n\t\t\t\t\t\t\t\t\tonEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);\n\t\t\t\t\t\t\t\t\tif (!event.defaultPrevented) {\n\t\t\t\t\t\t\t\t\t\tcontext.isFocusedToastEscapeKeyDownRef.current = true;\n\t\t\t\t\t\t\t\t\t\thandleClose();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}) }\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t})\n\t\t}, props.id)\n\t})] });\n});\nToastImpl.propTypes = { type(props) {\n\tif (props.type && ![\"foreground\", \"background\"].includes(props.type)) {\n\t\tvar error = `Invalid prop \\`type\\` supplied to \\`${TOAST_NAME}\\`. Expected \\`foreground | background\\`.`;\n\t\treturn new Error(error);\n\t}\n\treturn null;\n} };\nvar isDeltaInDirection = function(delta, direction) {\n\tvar threshold = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;\n\tvar deltaX = Math.abs(delta.x);\n\tvar deltaY = Math.abs(delta.y);\n\tvar isDeltaX = deltaX > deltaY;\n\tif (direction === \"left\" || direction === \"right\" || direction === \"horizontal\") return isDeltaX && deltaX > threshold;\n\treturn !isDeltaX && deltaY > threshold;\n};\nfunction getAnnounceTextContent(container) {\n\tif (!isWeb) return \"\";\n\tvar textContent = [];\n\tArray.from(container.childNodes).forEach(function(node) {\n\t\tif (node.nodeType === node.TEXT_NODE && node.textContent) textContent.push(node.textContent);\n\t\tif (isHTMLElement(node)) {\n\t\t\tvar isHidden = node.ariaHidden || node.hidden || node.style.display === \"none\";\n\t\t\tvar isExcluded = node.dataset.toastAnnounceExclude === \"\";\n\t\t\tif (!isHidden) if (isExcluded) {\n\t\t\t\tvar altText = node.dataset.toastAnnounceAlt;\n\t\t\t\tif (altText) textContent.push(altText);\n\t\t\t} else textContent.push(...getAnnounceTextContent(node));\n\t\t}\n\t});\n\treturn textContent;\n}\nfunction isHTMLElement(node) {\n\treturn node.nodeType === node.ELEMENT_NODE;\n}\nvar GESTURE_GRANT_THRESHOLD = 10;\nvar shouldGrantGestureMove = function(dir, param) {\n\tvar { dx, dy } = param;\n\tif ((dir === \"horizontal\" || dir === \"left\") && dx < -GESTURE_GRANT_THRESHOLD) return true;\n\tif ((dir === \"horizontal\" || dir === \"right\") && dx > GESTURE_GRANT_THRESHOLD) return true;\n\tif ((dir === \"vertical\" || dir === \"up\") && dy > -GESTURE_GRANT_THRESHOLD) return true;\n\tif ((dir === \"vertical\" || dir === \"down\") && dy < GESTURE_GRANT_THRESHOLD) return true;\n\treturn false;\n};\nvar getGestureDistance = function(dir, param) {\n\tvar { dx, dy } = param;\n\tvar y = 0;\n\tvar x = 0;\n\tif (dir === \"horizontal\") x = dx;\n\telse if (dir === \"left\") x = Math.min(0, dx);\n\telse if (dir === \"right\") x = Math.max(0, dx);\n\telse if (dir === \"vertical\") y = dy;\n\telse if (dir === \"up\") y = Math.min(0, dy);\n\telse if (dir === \"down\") y = Math.max(0, dy);\n\treturn {\n\t\tx,\n\t\ty\n\t};\n};\n\nexport { ToastImpl, ToastImplFrame, useToastInteractiveContext };"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,GAAG,EAAEC,IAAI,QAAQ,mBAAmB;AACvD,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,KAAK,QAAQ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oL,GAAG,KAAK,YAAY,EAAEpL,CAAC,GAAG8H,EAAE,CAAC,KAC5B,IAAIsD,GAAG,KAAK,MAAM,EAAEpL,CAAC,GAAG2J,IAAI,CAAC0B,GAAG,CAAC,CAAC,EAAEvD,EAAE,CAAC,CAAC,KACxC,IAAIsD,GAAG,KAAK,OAAO,EAAEpL,CAAC,GAAG2J,IAAI,CAAC2B,GAAG,CAAC,CAAC,EAAExD,EAAE,CAAC,CAAC,KACzC,IAAIsD,GAAG,KAAK,UAAU,EAAE9D,CAAC,GAAGS,EAAE,CAAC,KAC/B,IAAIqD,GAAG,KAAK,IAAI,EAAE9D,CAAC,GAAGqC,IAAI,CAAC0B,GAAG,CAAC,CAAC,EAAEtD,EAAE,CAAC,CAAC,KACtC,IAAIqD,GAAG,KAAK,MAAM,EAAE9D,CAAC,GAAGqC,IAAI,CAAC2B,GAAG,CAAC,CAAC,EAAEvD,EAAE,CAAC;EAC5C,OAAO;IACN/H,CAAC;IACDsH;EACD,CAAC;AACF,CAAC;AAED,SAASjF,SAAS,EAAE1B,cAAc,EAAEwB,0BAA0B","ignoreList":[]}
@@ -1,24 +0,0 @@
1
- import { isWeb } from "@tamagui/constants";
2
- import { Portal } from "@tamagui/portal";
3
- import { ReprogapateToastProvider } from "./ToastProvider.mjs";
4
- import { jsx } from "react/jsx-runtime";
5
- function ToastPortal(props) {
6
- const {
7
- context,
8
- children,
9
- zIndex
10
- } = props;
11
- let content = children;
12
- if (!isWeb) {
13
- content = /* @__PURE__ */jsx(ReprogapateToastProvider, {
14
- context,
15
- children
16
- });
17
- }
18
- return /* @__PURE__ */jsx(Portal, {
19
- zIndex: zIndex || Number.MAX_SAFE_INTEGER,
20
- children: content
21
- });
22
- }
23
- export { ToastPortal };
24
- //# sourceMappingURL=ToastPortal.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["isWeb","Portal","ReprogapateToastProvider","jsx","ToastPortal","props","context","children","zIndex","content","Number","MAX_SAFE_INTEGER"],"sources":["../../src/ToastPortal.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,KAAA,QAAa;AACtB,SAASC,MAAA,QAAc;AAEvB,SAASC,wBAAA,QAAgE;AAWnE,SAAAC,GAAA;AATC,SAASC,YAAYC,KAAA,EAIzB;EACD,MAAM;IAAEC,OAAA;IAASC,QAAA;IAAUC;EAAO,IAAIH,KAAA;EACtC,IAAII,OAAA,GAAUF,QAAA;EACd,IAAI,CAACP,KAAA,EAAO;IACVS,OAAA,GACE,eAAAN,GAAA,CAACD,wBAAA;MAAyBI,OAAA;MAAmBC;IAAA,CAAS;EAE1D;EACA,OAAO,eAAAJ,GAAA,CAACF,MAAA;IAAOO,MAAA,EAAQA,MAAA,IAAUE,MAAA,CAAOC,gBAAA;IAAmBJ,QAAA,EAAAE;EAAA,CAAQ;AACrE","ignoreList":[]}
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { isWeb } from "@tamagui/constants";
3
- import { Portal } from "@tamagui/portal";
4
- import { ReprogapateToastProvider } from "./ToastProvider.native.js";
5
- function ToastPortal(props) {
6
- var {
7
- context,
8
- children,
9
- zIndex
10
- } = props;
11
- var content = children;
12
- if (!isWeb) {
13
- content = /* @__PURE__ */_jsx(ReprogapateToastProvider, {
14
- context,
15
- children
16
- });
17
- }
18
- return /* @__PURE__ */_jsx(Portal, {
19
- zIndex: zIndex || Number.MAX_SAFE_INTEGER,
20
- children: content
21
- });
22
- }
23
- export { ToastPortal };
24
- //# sourceMappingURL=ToastPortal.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["jsx","_jsx","isWeb","Portal","ReprogapateToastProvider","ToastPortal","props","context","children","zIndex","content"],"sources":["../../src/ToastPortal.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,GAAA,IAAAC,IAAA,QAAa;AACtB,SAASC,KAAA,4BAAc;AAEvB,SAASC,MAAA;AAWH,SAAAC,wBAAA;AATC,SAASC,YAAYC,KAAA,EAIzB;EACD;IAAMC,OAAE;IAAAC,QAAS;IAAAC;EAAU,IAAOH,KAAI;EACtC,IAAII,OAAA,GAAUF,QAAA;EACd,IAAI,CAACN,KAAA,EAAO;IACVQ,OAAA,GACE,eAAAT,IAAC,CAAAG,wBAAA;MAELG,OAAA;MACAC;IACF","ignoreList":[]}
@@ -1,110 +0,0 @@
1
- import { createCollection } from "@tamagui/collection";
2
- import { createStyledContext } from "@tamagui/core";
3
- import { startTransition } from "@tamagui/start-transition";
4
- import * as React from "react";
5
- import { TOAST_CONTEXT } from "./constants.mjs";
6
- import { ToastImperativeProvider } from "./ToastImperative.mjs";
7
- import { jsx } from "react/jsx-runtime";
8
- const PROVIDER_NAME = "ToastProvider";
9
- const [Collection, useCollection] = createCollection("Toast");
10
- const {
11
- Provider: ToastProviderProvider,
12
- useStyledContext: useToastProviderContext
13
- } = createStyledContext(
14
- // since we always provide this we can avoid setting here
15
- {}, "Toast__");
16
- const ToastProvider = props => {
17
- const {
18
- scope = TOAST_CONTEXT,
19
- id: providedId,
20
- burntOptions,
21
- native,
22
- notificationOptions,
23
- label = "Notification",
24
- duration = 5e3,
25
- swipeDirection = "right",
26
- swipeThreshold = 50,
27
- children
28
- } = props;
29
- const backupId = React.useId();
30
- const id = providedId ?? backupId;
31
- const [viewports, setViewports] = React.useState({});
32
- const [toastCount, setToastCount] = React.useState(0);
33
- const isFocusedToastEscapeKeyDownRef = React.useRef(false);
34
- const isClosePausedRef = React.useRef(false);
35
- const handleViewportChange = React.useCallback((name, viewport) => {
36
- startTransition(() => {
37
- setViewports(prev => ({
38
- ...prev,
39
- [name]: viewport
40
- }));
41
- });
42
- }, []);
43
- const options = React.useMemo(() => {
44
- return {
45
- duration,
46
- burntOptions,
47
- native,
48
- notificationOptions
49
- };
50
- }, [JSON.stringify([duration, burntOptions, native, notificationOptions])]);
51
- return /* @__PURE__ */jsx(Collection.Provider, {
52
- scope,
53
- children: /* @__PURE__ */jsx(ToastProviderProvider, {
54
- scope,
55
- id,
56
- label,
57
- duration,
58
- swipeDirection,
59
- swipeThreshold,
60
- toastCount,
61
- viewports,
62
- onViewportChange: handleViewportChange,
63
- onToastAdd: React.useCallback(() => {
64
- startTransition(() => {
65
- setToastCount(prevCount => prevCount + 1);
66
- });
67
- }, []),
68
- onToastRemove: React.useCallback(() => {
69
- startTransition(() => {
70
- setToastCount(prevCount => prevCount - 1);
71
- });
72
- }, []),
73
- isFocusedToastEscapeKeyDownRef,
74
- isClosePausedRef,
75
- options,
76
- children: /* @__PURE__ */jsx(ToastImperativeProvider, {
77
- options,
78
- children
79
- })
80
- })
81
- });
82
- };
83
- function ReprogapateToastProvider(props) {
84
- const {
85
- children,
86
- context
87
- } = props;
88
- return /* @__PURE__ */jsx(Collection.Provider, {
89
- scope: context.toastScope,
90
- children: /* @__PURE__ */jsx(ToastProviderProvider, {
91
- ...context,
92
- children: /* @__PURE__ */jsx(ToastImperativeProvider, {
93
- options: context.options,
94
- children
95
- })
96
- })
97
- });
98
- }
99
- ToastProvider.propTypes = {
100
- label(props) {
101
- if (props.label && typeof props.label === "string" && !props.label.trim()) {
102
- const error = `Invalid prop \`label\` supplied to \`${PROVIDER_NAME}\`. Expected non-empty \`string\`.`;
103
- return new Error(error);
104
- }
105
- return null;
106
- }
107
- };
108
- ToastProvider.displayName = PROVIDER_NAME;
109
- export { Collection, ReprogapateToastProvider, ToastProvider, useCollection, useToastProviderContext };
110
- //# sourceMappingURL=ToastProvider.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createCollection","createStyledContext","startTransition","React","TOAST_CONTEXT","ToastImperativeProvider","jsx","PROVIDER_NAME","Collection","useCollection","Provider","ToastProviderProvider","useStyledContext","useToastProviderContext","ToastProvider","props","scope","id","providedId","burntOptions","native","notificationOptions","label","duration","swipeDirection","swipeThreshold","children","backupId","useId","viewports","setViewports","useState","toastCount","setToastCount","isFocusedToastEscapeKeyDownRef","useRef","isClosePausedRef","handleViewportChange","useCallback","name","viewport","prev","options","useMemo","JSON","stringify","onViewportChange","onToastAdd","prevCount","onToastRemove","ReprogapateToastProvider","context","toastScope","propTypes","trim","error","Error","displayName"],"sources":["../../src/ToastProvider.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,gBAAA,QAAwB;AAEjC,SAASC,mBAAA,QAA2B;AACpC,SAASC,eAAA,QAAuB;AAChC,YAAYC,KAAA,MAAW;AAEvB,SAASC,aAAA,QAAqB;AAE9B,SAASC,uBAAA,QAA+B;AAgKhC,SAAAC,GAAA;AAzJR,MAAMC,aAAA,GAAgB;AAEtB,MAAM,CAACC,UAAA,EAAYC,aAAa,IAAIT,gBAAA,CAAiC,OAAO;AAgC5E,MAAM;EAAEU,QAAA,EAAUC,qBAAA;EAAuBC,gBAAA,EAAkBC;AAAwB,IACjFZ,mBAAA;AAAA;AAEE,CAAC,GACD,SACF;AA4CF,MAAMa,aAAA,GACJC,KAAA,IACG;EACH,MAAM;IACJC,KAAA,GAAQZ,aAAA;IACRa,EAAA,EAAIC,UAAA;IACJC,YAAA;IACAC,MAAA;IACAC,mBAAA;IACAC,KAAA,GAAQ;IACRC,QAAA,GAAW;IACXC,cAAA,GAAiB;IACjBC,cAAA,GAAiB;IACjBC;EACF,IAAIX,KAAA;EACJ,MAAMY,QAAA,GAAWxB,KAAA,CAAMyB,KAAA,CAAM;EAC7B,MAAMX,EAAA,GAAKC,UAAA,IAAcS,QAAA;EACzB,MAAM,CAACE,SAAA,EAAWC,YAAY,IAAI3B,KAAA,CAAM4B,QAAA,CAEtC,CAAC,CAAC;EACJ,MAAM,CAACC,UAAA,EAAYC,aAAa,IAAI9B,KAAA,CAAM4B,QAAA,CAAS,CAAC;EACpD,MAAMG,8BAAA,GAAiC/B,KAAA,CAAMgC,MAAA,CAAO,KAAK;EACzD,MAAMC,gBAAA,GAAmBjC,KAAA,CAAMgC,MAAA,CAAO,KAAK;EAE3C,MAAME,oBAAA,GAAuBlC,KAAA,CAAMmC,WAAA,CACjC,CAACC,IAAA,EAAcC,QAAA,KAAoC;IACjDtC,eA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