@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.
- package/dist/cjs/ToastComposable.cjs +773 -882
- package/dist/cjs/ToastComposable.native.cjs +924 -0
- package/dist/cjs/ToastComposable.native.js +854 -966
- package/dist/cjs/ToastComposable.native.js.map +1 -1
- package/dist/cjs/ToastItemFrame.cjs +48 -119
- package/dist/cjs/ToastItemFrame.native.cjs +76 -0
- package/dist/cjs/ToastItemFrame.native.js +50 -120
- package/dist/cjs/ToastItemFrame.native.js.map +1 -1
- package/dist/cjs/ToastState.cjs +281 -290
- package/dist/cjs/ToastState.native.cjs +312 -0
- package/dist/cjs/ToastState.native.js +280 -290
- package/dist/cjs/ToastState.native.js.map +1 -1
- package/dist/cjs/createNativeToast.cjs +38 -44
- package/dist/cjs/createNativeToast.native.cjs +54 -0
- package/dist/cjs/createNativeToast.native.js +36 -40
- package/dist/cjs/createNativeToast.native.js.map +1 -1
- package/dist/cjs/dispatchNativeToast.cjs +32 -35
- package/dist/cjs/dispatchNativeToast.native.cjs +48 -0
- package/dist/cjs/dispatchNativeToast.native.js +34 -36
- package/dist/cjs/dispatchNativeToast.native.js.map +1 -1
- package/dist/cjs/index.cjs +25 -12
- package/dist/cjs/index.native.cjs +35 -0
- package/dist/cjs/index.native.js +26 -12
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/types.cjs +10 -11
- package/dist/cjs/types.native.cjs +19 -0
- package/dist/cjs/types.native.js +10 -10
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/useAnimatedDragGesture.cjs +197 -194
- package/dist/cjs/useAnimatedDragGesture.native.cjs +210 -0
- package/dist/cjs/useAnimatedDragGesture.native.js +179 -191
- package/dist/cjs/useAnimatedDragGesture.native.js.map +1 -1
- package/dist/cjs/useReducedMotion.cjs +47 -55
- package/dist/cjs/useReducedMotion.native.cjs +74 -0
- package/dist/cjs/useReducedMotion.native.js +53 -60
- package/dist/cjs/useReducedMotion.native.js.map +1 -1
- package/dist/cjs/useToastAnimations.cjs +198 -270
- package/dist/cjs/useToastAnimations.native.cjs +229 -0
- package/dist/cjs/useToastAnimations.native.js +205 -276
- package/dist/cjs/useToastAnimations.native.js.map +1 -1
- package/dist/esm/ToastComposable.mjs +752 -854
- package/dist/esm/ToastComposable.mjs.map +1 -1
- package/dist/esm/ToastComposable.native.js +834 -940
- package/dist/esm/ToastComposable.native.js.map +1 -1
- package/dist/esm/ToastItemFrame.mjs +31 -99
- package/dist/esm/ToastItemFrame.mjs.map +1 -1
- package/dist/esm/ToastItemFrame.native.js +34 -102
- package/dist/esm/ToastItemFrame.native.js.map +1 -1
- package/dist/esm/ToastState.mjs +266 -273
- package/dist/esm/ToastState.mjs.map +1 -1
- package/dist/esm/ToastState.native.js +265 -274
- package/dist/esm/ToastState.native.js.map +1 -1
- package/dist/esm/createNativeToast.mjs +22 -26
- package/dist/esm/createNativeToast.mjs.map +1 -1
- package/dist/esm/createNativeToast.native.js +21 -23
- package/dist/esm/createNativeToast.native.js.map +1 -1
- package/dist/esm/dispatchNativeToast.mjs +19 -17
- package/dist/esm/dispatchNativeToast.mjs.map +1 -1
- package/dist/esm/dispatchNativeToast.native.js +21 -19
- package/dist/esm/dispatchNativeToast.native.js.map +1 -1
- package/dist/esm/index.js +5 -2
- package/dist/esm/index.mjs +5 -2
- package/dist/esm/index.native.js +5 -2
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/types.native.js +0 -2
- package/dist/esm/useAnimatedDragGesture.mjs +181 -168
- package/dist/esm/useAnimatedDragGesture.mjs.map +1 -1
- package/dist/esm/useAnimatedDragGesture.native.js +163 -166
- package/dist/esm/useAnimatedDragGesture.native.js.map +1 -1
- package/dist/esm/useReducedMotion.mjs +31 -29
- package/dist/esm/useReducedMotion.mjs.map +1 -1
- package/dist/esm/useReducedMotion.native.js +37 -35
- package/dist/esm/useReducedMotion.native.js.map +1 -1
- package/dist/esm/useToastAnimations.mjs +183 -245
- package/dist/esm/useToastAnimations.mjs.map +1 -1
- package/dist/esm/useToastAnimations.native.js +190 -252
- package/dist/esm/useToastAnimations.native.js.map +1 -1
- package/dist/jsx/ToastComposable.mjs +752 -854
- package/dist/jsx/ToastComposable.mjs.map +1 -1
- package/dist/jsx/ToastComposable.native.cjs +924 -0
- package/dist/jsx/ToastComposable.native.js +854 -966
- package/dist/jsx/ToastComposable.native.js.map +1 -1
- package/dist/jsx/ToastItemFrame.mjs +31 -99
- package/dist/jsx/ToastItemFrame.mjs.map +1 -1
- package/dist/jsx/ToastItemFrame.native.cjs +76 -0
- package/dist/jsx/ToastItemFrame.native.js +50 -120
- package/dist/jsx/ToastItemFrame.native.js.map +1 -1
- package/dist/jsx/ToastState.mjs +266 -273
- package/dist/jsx/ToastState.mjs.map +1 -1
- package/dist/jsx/ToastState.native.cjs +312 -0
- package/dist/jsx/ToastState.native.js +280 -290
- package/dist/jsx/ToastState.native.js.map +1 -1
- package/dist/jsx/createNativeToast.mjs +22 -26
- package/dist/jsx/createNativeToast.mjs.map +1 -1
- package/dist/jsx/createNativeToast.native.cjs +54 -0
- package/dist/jsx/createNativeToast.native.js +36 -40
- package/dist/jsx/createNativeToast.native.js.map +1 -1
- package/dist/jsx/dispatchNativeToast.mjs +19 -17
- package/dist/jsx/dispatchNativeToast.mjs.map +1 -1
- package/dist/jsx/dispatchNativeToast.native.cjs +48 -0
- package/dist/jsx/dispatchNativeToast.native.js +34 -36
- package/dist/jsx/dispatchNativeToast.native.js.map +1 -1
- package/dist/jsx/index.js +5 -2
- package/dist/jsx/index.mjs +5 -2
- package/dist/jsx/index.native.cjs +35 -0
- package/dist/jsx/index.native.js +26 -12
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/types.mjs +0 -2
- package/dist/jsx/types.native.cjs +19 -0
- package/dist/jsx/types.native.js +10 -10
- package/dist/jsx/types.native.js.map +1 -1
- package/dist/jsx/useAnimatedDragGesture.mjs +181 -168
- package/dist/jsx/useAnimatedDragGesture.mjs.map +1 -1
- package/dist/jsx/useAnimatedDragGesture.native.cjs +210 -0
- package/dist/jsx/useAnimatedDragGesture.native.js +179 -191
- package/dist/jsx/useAnimatedDragGesture.native.js.map +1 -1
- package/dist/jsx/useReducedMotion.mjs +31 -29
- package/dist/jsx/useReducedMotion.mjs.map +1 -1
- package/dist/jsx/useReducedMotion.native.cjs +74 -0
- package/dist/jsx/useReducedMotion.native.js +53 -60
- package/dist/jsx/useReducedMotion.native.js.map +1 -1
- package/dist/jsx/useToastAnimations.mjs +183 -245
- package/dist/jsx/useToastAnimations.mjs.map +1 -1
- package/dist/jsx/useToastAnimations.native.cjs +229 -0
- package/dist/jsx/useToastAnimations.native.js +205 -276
- package/dist/jsx/useToastAnimations.native.js.map +1 -1
- package/package.json +20 -37
- package/src/ToastComposable.tsx +55 -97
- package/src/ToastItemFrame.tsx +22 -81
- package/src/ToastState.ts +1 -0
- package/src/index.ts +34 -2
- package/src/types.ts +11 -0
- package/src/useAnimatedDragGesture.native.ts +1 -1
- package/src/useAnimatedDragGesture.ts +1 -1
- package/src/useToastAnimations.ts +20 -36
- package/types/ToastComposable.d.ts +124 -47
- package/types/ToastComposable.d.ts.map +1 -1
- package/types/ToastItemFrame.d.ts +52 -21
- package/types/ToastItemFrame.d.ts.map +1 -1
- package/types/ToastState.d.ts +15 -11
- package/types/ToastState.d.ts.map +1 -1
- package/types/index.d.ts +6 -2
- package/types/index.d.ts.map +1 -1
- package/types/types.d.ts +1 -0
- package/types/types.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/useToastAnimations.d.ts +2 -8
- package/types/useToastAnimations.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/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/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/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/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/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/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/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/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/esm/types.mjs.map +0 -1
- package/dist/esm/types.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/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/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/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/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
- package/dist/jsx/types.mjs.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/src/Toast.tsx +0 -219
- package/src/ToastAnnounce.tsx +0 -103
- package/src/ToastImperative.tsx +0 -192
- package/src/ToastImpl.tsx +0 -514
- package/src/ToastPortal.tsx +0 -19
- package/src/ToastProvider.tsx +0 -204
- package/src/ToastViewport.tsx +0 -430
- package/src/Toaster.tsx +0 -181
- package/src/constants.ts +0 -2
- package/src/v2.ts +0 -31
- package/types/Toast.d.ts +0 -84
- package/types/Toast.d.ts.map +0 -1
- package/types/ToastAnnounce.d.ts +0 -18
- package/types/ToastAnnounce.d.ts.map +0 -1
- package/types/ToastImperative.d.ts +0 -95
- package/types/ToastImperative.d.ts.map +0 -1
- package/types/ToastImpl.d.ts +0 -109
- package/types/ToastImpl.d.ts.map +0 -1
- package/types/ToastPortal.d.ts +0 -8
- package/types/ToastPortal.d.ts.map +0 -1
- package/types/ToastProvider.d.ts +0 -92
- package/types/ToastProvider.d.ts.map +0 -1
- package/types/ToastViewport.d.ts +0 -75
- package/types/ToastViewport.d.ts.map +0 -1
- package/types/Toaster.d.ts +0 -112
- package/types/Toaster.d.ts.map +0 -1
- package/types/constants.d.ts +0 -3
- package/types/constants.d.ts.map +0 -1
- package/types/v2.d.ts +0 -10
- package/types/v2.d.ts.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
|
@@ -1,32 +1,28 @@
|
|
|
1
|
-
const createNativeToast = (title, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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,"
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
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":["
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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":["
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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":["
|
|
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
|
-
|
|
2
|
-
|
|
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 };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 };
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 };
|
package/dist/esm/types.mjs
CHANGED
package/dist/esm/types.native.js
CHANGED