@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,32 +1,28 @@
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
- };
1
+ const createNativeToast = (title, { message, notificationOptions }) => {
2
+ if (!("Notification" in window)) {
3
+ return false;
4
+ }
5
+ if (Notification.permission !== "granted") return false;
6
+ const notification = new Notification(title, {
7
+ body: message,
8
+ ...notificationOptions
9
+ });
10
+ return { nativeToastRef: notification };
16
11
  };
17
- const hideNativeToast = ref => {
18
- if (!("Notification" in window)) {
19
- return;
20
- }
21
- if (ref) {
22
- ref.close();
23
- }
12
+ const hideNativeToast = (ref) => {
13
+ if (!("Notification" in window)) {
14
+ return;
15
+ }
16
+ if (ref) {
17
+ ref.close();
18
+ }
24
19
  };
25
20
  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();
21
+ if (!("Notification" in window)) return null;
22
+ if (Notification.permission === "granted") return "granted";
23
+ if (Notification.permission === "denied") return "denied";
24
+ return Notification.requestPermission();
30
25
  }
26
+
31
27
  export { createNativeToast, hideNativeToast, requestNotificationPermission };
32
28
  //# sourceMappingURL=createNativeToast.mjs.map
@@ -1 +1 @@
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
+ {"version":3,"file":"createNativeToast.js","names":[],"sources":["esm/createNativeToast.js"],"sourcesContent":["const createNativeToast = (title, { message, notificationOptions }) => {\n if (!(\"Notification\" in window)) {\n return false;\n }\n if (Notification.permission !== \"granted\") return false;\n const notification = new Notification(title, {\n body: message,\n ...notificationOptions\n });\n return {\n nativeToastRef: notification\n };\n};\nconst hideNativeToast = (ref) => {\n if (!(\"Notification\" in window)) {\n return;\n }\n if (ref) {\n ref.close();\n }\n};\nasync function requestNotificationPermission() {\n if (!(\"Notification\" in window)) return null;\n if (Notification.permission === \"granted\") return \"granted\";\n if (Notification.permission === \"denied\") return \"denied\";\n return Notification.requestPermission();\n}\nexport {\n createNativeToast,\n hideNativeToast,\n requestNotificationPermission\n};\n//# sourceMappingURL=createNativeToast.js.map\n"],"mappings":";AAAA,MAAM,qBAAqB,OAAO,EAAE,SAAS,0BAA0B;CACrE,IAAI,EAAE,kBAAkB,SAAS;EAC/B,OAAO;CACT;CACA,IAAI,aAAa,eAAe,WAAW,OAAO;CAClD,MAAM,eAAe,IAAI,aAAa,OAAO;EAC3C,MAAM;EACN,GAAG;CACL,CAAC;CACD,OAAO,EACL,gBAAgB,aAClB;AACF;AACA,MAAM,mBAAmB,QAAQ;CAC/B,IAAI,EAAE,kBAAkB,SAAS;EAC/B;CACF;CACA,IAAI,KAAK;EACP,IAAI,MAAM;CACZ;AACF;AACA,eAAe,gCAAgC;CAC7C,IAAI,EAAE,kBAAkB,SAAS,OAAO;CACxC,IAAI,aAAa,eAAe,WAAW,OAAO;CAClD,IAAI,aAAa,eAAe,UAAU,OAAO;CACjD,OAAO,aAAa,kBAAkB;AACxC"}
@@ -1,30 +1,28 @@
1
1
  import { getBurnt } from "@tamagui/native";
2
- var createNativeToast = function (title, param) {
3
- var {
4
- message,
5
- duration,
6
- burntOptions
7
- } = param;
8
- var burnt = getBurnt();
9
- if (!burnt.isEnabled) {
10
- console.warn(`Warning: Must call import '@tamagui/native/setup-burnt' at your app entry point to use native toasts`);
11
- return false;
12
- }
13
- burnt.state.toast({
14
- title,
15
- message,
16
- duration: duration ? duration / 1e3 : void 0,
17
- ...burntOptions
18
- });
19
- return true;
2
+
3
+ var createNativeToast = function(title, param) {
4
+ var { message, duration, burntOptions } = param;
5
+ var burnt = getBurnt();
6
+ if (!burnt.isEnabled) {
7
+ console.warn(`Warning: Must call import '@tamagui/native/setup-burnt' at your app entry point to use native toasts`);
8
+ return false;
9
+ }
10
+ burnt.state.toast({
11
+ title,
12
+ message,
13
+ duration: duration ? duration / 1e3 : void 0,
14
+ ...burntOptions
15
+ });
16
+ return true;
20
17
  };
21
- var hideNativeToast = function () {
22
- var burnt = getBurnt();
23
- if (!burnt.isEnabled) return;
24
- burnt.state.dismissAllAlerts();
18
+ var hideNativeToast = function() {
19
+ var burnt = getBurnt();
20
+ if (!burnt.isEnabled) return;
21
+ burnt.state.dismissAllAlerts();
25
22
  };
26
23
  async function requestNotificationPermission() {
27
- return null;
24
+ return null;
28
25
  }
26
+
29
27
  export { createNativeToast, hideNativeToast, requestNotificationPermission };
30
28
  //# sourceMappingURL=createNativeToast.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getBurnt","createNativeToast","title","param","message","duration","burntOptions","burnt","isEnabled","console","warn","state","toast","hideNativeToast","dismissAllAlerts","requestNotificationPermission"],"sources":["../../src/createNativeToast.native.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,QAAA,QAAgB;AAClB,IAAIC,iBAAA,GAAoB,SAAAA,CAASC,KAAA,EAAOC,KAAA,EAAO;EAClD,IAAI;IAAEC,OAAA;IAASC,QAAA;IAAUC;EAAa,IAAIH,KAAA;EAC1C,IAAII,KAAA,GAAQP,QAAA,CAAS;EACrB,IAAI,CAACO,KAAA,CAAMC,SAAA,EAAW;IAClBC,OAAA,CAAQC,IAAA,CAAK,sGAAsG;IACnH,OAAO;EACX;EACAH,KAAA,CAAMI,KAAA,CAAMC,KAAA,CAAM;IACdV,KAAA;IACAE,OAAA;IACAC,QAAA,EAAUA,QAAA,GAAWA,QAAA,GAAW,MAAO;IACvC,GAAGC;EACP,CAAC;EACD,OAAO;AACX;AACO,IAAIO,eAAA,GAAkB,SAAAA,CAAA,EAAW;EACpC,IAAIN,KAAA,GAAQP,QAAA,CAAS;EACrB,IAAI,CAACO,KAAA,CAAMC,SAAA,EAAW;EACtBD,KAAA,CAAMI,KAAA,CAAMG,gBAAA,CAAiB;AACjC;AACA,eAAsBC,8BAAA,EAAgC;EAClD,OAAO;AACX","ignoreList":[]}
1
+ {"version":3,"file":"createNativeToast.native.js","names":[],"sources":["esm/createNativeToast.native.js"],"sourcesContent":["import { getBurnt } from \"@tamagui/native\";\nvar createNativeToast = function(title, param) {\n var { message, duration, burntOptions } = param;\n var burnt = getBurnt();\n if (!burnt.isEnabled) {\n console.warn(`Warning: Must call import '@tamagui/native/setup-burnt' at your app entry point to use native toasts`);\n return false;\n }\n burnt.state.toast({\n title,\n message,\n duration: duration ? duration / 1e3 : void 0,\n ...burntOptions\n });\n return true;\n};\nvar hideNativeToast = function() {\n var burnt = getBurnt();\n if (!burnt.isEnabled) return;\n burnt.state.dismissAllAlerts();\n};\nasync function requestNotificationPermission() {\n return null;\n}\nexport {\n createNativeToast,\n hideNativeToast,\n requestNotificationPermission\n};\n//# sourceMappingURL=createNativeToast.native.js.map\n"],"mappings":";;;AACA,IAAI,oBAAoB,SAAS,OAAO,OAAO;CAC7C,IAAI,EAAE,SAAS,UAAU,iBAAiB;CAC1C,IAAI,QAAQ,SAAS;CACrB,IAAI,CAAC,MAAM,WAAW;EACpB,QAAQ,KAAK,sGAAsG;EACnH,OAAO;CACT;CACA,MAAM,MAAM,MAAM;EAChB;EACA;EACA,UAAU,WAAW,WAAW,MAAM,KAAK;EAC3C,GAAG;CACL,CAAC;CACD,OAAO;AACT;AACA,IAAI,kBAAkB,WAAW;CAC/B,IAAI,QAAQ,SAAS;CACrB,IAAI,CAAC,MAAM,WAAW;CACtB,MAAM,MAAM,iBAAiB;AAC/B;AACA,eAAe,gCAAgC;CAC7C,OAAO;AACT"}
@@ -1,22 +1,24 @@
1
1
  import { createNativeToast } from "./createNativeToast.mjs";
2
+
2
3
  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;
4
+ const titleText = typeof toast.title === "function" ? toast.title() : toast.title;
5
+ if (typeof titleText !== "string") return false;
6
+ const descText = typeof toast.description === "function" ? toast.description() : toast.description;
7
+ const toastType = toast.type ?? "default";
8
+ const preset = toastType === "error" ? "error" : toastType === "success" ? "done" : "none";
9
+ const haptic = toastType === "error" ? "error" : toastType === "success" ? "success" : toastType === "warning" ? "warning" : "none";
10
+ const result = createNativeToast(titleText, {
11
+ message: typeof descText === "string" ? descText : void 0,
12
+ duration: toast.duration ?? opts.duration,
13
+ burntOptions: {
14
+ preset,
15
+ haptic,
16
+ ...opts.burntOptions
17
+ },
18
+ notificationOptions: opts.notificationOptions
19
+ });
20
+ return result !== false;
20
21
  }
22
+
21
23
  export { dispatchNativeToast };
22
24
  //# sourceMappingURL=dispatchNativeToast.mjs.map
@@ -1 +1 @@
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
+ {"version":3,"file":"dispatchNativeToast.js","names":[],"sources":["esm/dispatchNativeToast.js"],"sourcesContent":["import { createNativeToast } from \"./createNativeToast\";\nfunction dispatchNativeToast(toast, opts) {\n const titleText = typeof toast.title === \"function\" ? toast.title() : toast.title;\n if (typeof titleText !== \"string\") return false;\n const descText = typeof toast.description === \"function\" ? toast.description() : toast.description;\n const toastType = toast.type ?? \"default\";\n const preset = toastType === \"error\" ? \"error\" : toastType === \"success\" ? \"done\" : \"none\";\n const haptic = toastType === \"error\" ? \"error\" : toastType === \"success\" ? \"success\" : toastType === \"warning\" ? \"warning\" : \"none\";\n const result = createNativeToast(titleText, {\n message: typeof descText === \"string\" ? descText : void 0,\n duration: toast.duration ?? opts.duration,\n burntOptions: { preset, haptic, ...opts.burntOptions },\n notificationOptions: opts.notificationOptions\n });\n return result !== false;\n}\nexport {\n dispatchNativeToast\n};\n//# sourceMappingURL=dispatchNativeToast.js.map\n"],"mappings":";;;AACA,SAAS,oBAAoB,OAAO,MAAM;CACxC,MAAM,YAAY,OAAO,MAAM,UAAU,aAAa,MAAM,MAAM,IAAI,MAAM;CAC5E,IAAI,OAAO,cAAc,UAAU,OAAO;CAC1C,MAAM,WAAW,OAAO,MAAM,gBAAgB,aAAa,MAAM,YAAY,IAAI,MAAM;CACvF,MAAM,YAAY,MAAM,QAAQ;CAChC,MAAM,SAAS,cAAc,UAAU,UAAU,cAAc,YAAY,SAAS;CACpF,MAAM,SAAS,cAAc,UAAU,UAAU,cAAc,YAAY,YAAY,cAAc,YAAY,YAAY;CAC7H,MAAM,SAAS,kBAAkB,WAAW;EAC1C,SAAS,OAAO,aAAa,WAAW,WAAW,KAAK;EACxD,UAAU,MAAM,YAAY,KAAK;EACjC,cAAc;GAAE;GAAQ;GAAQ,GAAG,KAAK;EAAa;EACrD,qBAAqB,KAAK;CAC5B,CAAC;CACD,OAAO,WAAW;AACpB"}
@@ -1,24 +1,26 @@
1
1
  import { createNativeToast } from "./createNativeToast.native.js";
2
+
2
3
  function dispatchNativeToast(toast, opts) {
3
- var titleText = typeof toast.title === "function" ? toast.title() : toast.title;
4
- if (typeof titleText !== "string") return false;
5
- var descText = typeof toast.description === "function" ? toast.description() : toast.description;
6
- var _toast_type;
7
- var toastType = (_toast_type = toast.type) !== null && _toast_type !== void 0 ? _toast_type : "default";
8
- var preset = toastType === "error" ? "error" : toastType === "success" ? "done" : "none";
9
- var haptic = toastType === "error" ? "error" : toastType === "success" ? "success" : toastType === "warning" ? "warning" : "none";
10
- var _toast_duration;
11
- var result = createNativeToast(titleText, {
12
- message: typeof descText === "string" ? descText : void 0,
13
- duration: (_toast_duration = toast.duration) !== null && _toast_duration !== void 0 ? _toast_duration : opts.duration,
14
- burntOptions: {
15
- preset,
16
- haptic,
17
- ...opts.burntOptions
18
- },
19
- notificationOptions: opts.notificationOptions
20
- });
21
- return result !== false;
4
+ var titleText = typeof toast.title === "function" ? toast.title() : toast.title;
5
+ if (typeof titleText !== "string") return false;
6
+ var descText = typeof toast.description === "function" ? toast.description() : toast.description;
7
+ var _toast_type;
8
+ var toastType = (_toast_type = toast.type) !== null && _toast_type !== void 0 ? _toast_type : "default";
9
+ var preset = toastType === "error" ? "error" : toastType === "success" ? "done" : "none";
10
+ var haptic = toastType === "error" ? "error" : toastType === "success" ? "success" : toastType === "warning" ? "warning" : "none";
11
+ var _toast_duration;
12
+ var result = createNativeToast(titleText, {
13
+ message: typeof descText === "string" ? descText : void 0,
14
+ duration: (_toast_duration = toast.duration) !== null && _toast_duration !== void 0 ? _toast_duration : opts.duration,
15
+ burntOptions: {
16
+ preset,
17
+ haptic,
18
+ ...opts.burntOptions
19
+ },
20
+ notificationOptions: opts.notificationOptions
21
+ });
22
+ return result !== false;
22
23
  }
24
+
23
25
  export { dispatchNativeToast };
24
26
  //# sourceMappingURL=dispatchNativeToast.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createNativeToast","dispatchNativeToast","toast","opts","titleText","title","descText","description","_toast_type","toastType","type","preset","haptic","_toast_duration","result","message","duration","burntOptions"],"sources":["../../src/dispatchNativeToast.ts"],"sourcesContent":[null],"mappings":"AAEA,SAASA,iBAAA,QAAyB;AAM3B,SAASC,oBACdC,KAAA,EACAC,IAAA,EAKS;EACT,IAAAC,SAAM,UAAYF,KAAO,CAAAG,KAAM,eAAU,GAAAH,KAAa,CAAAG,KAAM,KAAMH,KAAI,CAAAG,KAAM;EAC5E,IAAI,OAAOD,SAAA,KAAc,UAAU,OAAO;EAE1C,IAAAE,QAAM,UACJJ,KAAO,CAAAK,WAAM,eAAgB,GAAAL,KAAa,CAAAK,WAAM,KAAYL,KAAI,CAAAK,WAAM;EACxE,IAAAC,WAAM;EAEN,IAAAC,SAAM,GACJ,CAAAD,WAAA,GAAcN,KAAA,CAAAQ,IAAU,UAAU,IAAAF,WAAc,UAAY,IAAAA,WAAS;EACvE,IAAAG,MAAM,GAAAF,SACJ,YAAc,UACV,GAAAA,SACA,cAAc,SACZ,SACA;EAIR,IAAAG,MAAM,GAAAH,SAAS,YAAkB,UAAW,GAAAA,SAAA,6BAAAA,SAAA;EAAA,IAC1CI,eAAgB;EAAmC,IACnDC,MAAA,GAAUd,iBAAkB,CAAAI,SAAK;IACjCW,OAAA,SAAgBT,QAAQ,aAAW,GAAKA,QAAA,QAAa;IACrDU,QAAA,GAAAH,eAA0B,GAAAX,KAAA,CAAAc,QAAA,cAAAH,eAAA,cAAAA,eAAA,GAAAV,IAAA,CAAAa,QAAA;IAC3BC,YAAA;MAEDN,MAAO;MACTC,MAAA","ignoreList":[]}
1
+ {"version":3,"file":"dispatchNativeToast.native.js","names":[],"sources":["esm/dispatchNativeToast.native.js"],"sourcesContent":["import { createNativeToast } from \"./createNativeToast\";\nfunction dispatchNativeToast(toast, opts) {\n var titleText = typeof toast.title === \"function\" ? toast.title() : toast.title;\n if (typeof titleText !== \"string\") return false;\n var descText = typeof toast.description === \"function\" ? toast.description() : toast.description;\n var _toast_type;\n var toastType = (_toast_type = toast.type) !== null && _toast_type !== void 0 ? _toast_type : \"default\";\n var preset = toastType === \"error\" ? \"error\" : toastType === \"success\" ? \"done\" : \"none\";\n var haptic = toastType === \"error\" ? \"error\" : toastType === \"success\" ? \"success\" : toastType === \"warning\" ? \"warning\" : \"none\";\n var _toast_duration;\n var result = createNativeToast(titleText, {\n message: typeof descText === \"string\" ? descText : void 0,\n duration: (_toast_duration = toast.duration) !== null && _toast_duration !== void 0 ? _toast_duration : opts.duration,\n burntOptions: {\n preset,\n haptic,\n ...opts.burntOptions\n },\n notificationOptions: opts.notificationOptions\n });\n return result !== false;\n}\nexport {\n dispatchNativeToast\n};\n//# sourceMappingURL=dispatchNativeToast.js.map\n"],"mappings":";;;AACA,SAAS,oBAAoB,OAAO,MAAM;CACxC,IAAI,YAAY,OAAO,MAAM,UAAU,aAAa,MAAM,MAAM,IAAI,MAAM;CAC1E,IAAI,OAAO,cAAc,UAAU,OAAO;CAC1C,IAAI,WAAW,OAAO,MAAM,gBAAgB,aAAa,MAAM,YAAY,IAAI,MAAM;CACrF,IAAI;CACJ,IAAI,aAAa,cAAc,MAAM,UAAU,QAAQ,gBAAgB,KAAK,IAAI,cAAc;CAC9F,IAAI,SAAS,cAAc,UAAU,UAAU,cAAc,YAAY,SAAS;CAClF,IAAI,SAAS,cAAc,UAAU,UAAU,cAAc,YAAY,YAAY,cAAc,YAAY,YAAY;CAC3H,IAAI;CACJ,IAAI,SAAS,kBAAkB,WAAW;EACxC,SAAS,OAAO,aAAa,WAAW,WAAW,KAAK;EACxD,WAAW,kBAAkB,MAAM,cAAc,QAAQ,oBAAoB,KAAK,IAAI,kBAAkB,KAAK;EAC7G,cAAc;GACZ;GACA;GACA,GAAG,KAAK;EACV;EACA,qBAAqB,KAAK;CAC5B,CAAC;CACD,OAAO,WAAW;AACpB"}
package/dist/esm/index.js CHANGED
@@ -1,2 +1,5 @@
1
- export * from "./Toast.mjs";
2
- //# sourceMappingURL=index.js.map
1
+ import { Toast, useToastItem, useToasts } from "./ToastComposable.mjs";
2
+ import { toast } from "./ToastState.mjs";
3
+ import { requestNotificationPermission } from "./createNativeToast.mjs";
4
+
5
+ export { Toast, requestNotificationPermission, toast, useToastItem, useToasts };
@@ -1,2 +1,5 @@
1
- export * from "./Toast.mjs";
2
- //# sourceMappingURL=index.mjs.map
1
+ import { Toast, useToastItem, useToasts } from "./ToastComposable.mjs";
2
+ import { toast } from "./ToastState.mjs";
3
+ import { requestNotificationPermission } from "./createNativeToast.mjs";
4
+
5
+ export { Toast, requestNotificationPermission, toast, useToastItem, useToasts };
@@ -1,2 +1,5 @@
1
- export * from "./Toast.native.js";
2
- //# sourceMappingURL=index.native.js.map
1
+ import { Toast, useToastItem, useToasts } from "./ToastComposable.native.js";
2
+ import { toast } from "./ToastState.native.js";
3
+ import { requestNotificationPermission } from "./createNativeToast.native.js";
4
+
5
+ export { Toast, requestNotificationPermission, toast, useToastItem, useToasts };
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.mjs.map
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.native.js.map