@tamagui/toast 1.13.2 → 1.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Toast.js +1 -181
- package/dist/cjs/Toast.js.map +3 -3
- package/dist/cjs/ToastAnnounce.js +1 -92
- package/dist/cjs/ToastAnnounce.js.map +2 -2
- package/dist/cjs/ToastImperative.js +1 -110
- package/dist/cjs/ToastImperative.js.map +2 -2
- package/dist/cjs/ToastImpl.js +1 -352
- package/dist/cjs/ToastImpl.js.map +2 -2
- package/dist/cjs/ToastProvider.js +1 -119
- package/dist/cjs/ToastProvider.js.map +2 -2
- package/dist/cjs/ToastViewport.js +1 -312
- package/dist/cjs/ToastViewport.js.map +2 -2
- package/dist/cjs/constants.js +1 -28
- package/dist/cjs/constants.js.map +2 -2
- package/dist/cjs/createNativeToast.js +1 -69
- package/dist/cjs/createNativeToast.js.map +2 -2
- package/dist/cjs/createNativeToast.native.js +1 -43
- package/dist/cjs/createNativeToast.native.js.map +2 -2
- package/dist/cjs/index.js +1 -18
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/types.js +1 -16
- package/dist/cjs/types.js.map +2 -2
- package/dist/esm/Toast.js +1 -157
- package/dist/esm/Toast.js.map +3 -3
- package/dist/esm/Toast.mjs +1 -157
- package/dist/esm/Toast.mjs.map +3 -3
- package/dist/esm/ToastAnnounce.js +1 -63
- package/dist/esm/ToastAnnounce.js.map +2 -2
- package/dist/esm/ToastAnnounce.mjs +1 -63
- package/dist/esm/ToastAnnounce.mjs.map +2 -2
- package/dist/esm/ToastImperative.js +1 -73
- package/dist/esm/ToastImperative.js.map +2 -2
- package/dist/esm/ToastImperative.mjs +1 -73
- package/dist/esm/ToastImperative.mjs.map +2 -2
- package/dist/esm/ToastImpl.js +1 -328
- package/dist/esm/ToastImpl.js.map +2 -2
- package/dist/esm/ToastImpl.mjs +1 -328
- package/dist/esm/ToastImpl.mjs.map +2 -2
- package/dist/esm/ToastProvider.js +1 -80
- package/dist/esm/ToastProvider.js.map +2 -2
- package/dist/esm/ToastProvider.mjs +1 -80
- package/dist/esm/ToastProvider.mjs.map +2 -2
- package/dist/esm/ToastViewport.js +1 -279
- package/dist/esm/ToastViewport.js.map +2 -2
- package/dist/esm/ToastViewport.mjs +1 -279
- package/dist/esm/ToastViewport.mjs.map +2 -2
- package/dist/esm/constants.js +1 -4
- package/dist/esm/constants.js.map +2 -2
- package/dist/esm/constants.mjs +1 -4
- package/dist/esm/constants.mjs.map +2 -2
- package/dist/esm/createNativeToast.js +1 -44
- package/dist/esm/createNativeToast.js.map +2 -2
- package/dist/esm/createNativeToast.mjs +1 -44
- package/dist/esm/createNativeToast.mjs.map +2 -2
- package/dist/esm/createNativeToast.native.js +1 -18
- package/dist/esm/createNativeToast.native.js.map +2 -2
- package/dist/esm/createNativeToast.native.mjs +1 -18
- package/dist/esm/createNativeToast.native.mjs.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/jsx/Toast.js +1 -150
- package/dist/jsx/Toast.js.map +3 -3
- package/dist/jsx/Toast.mjs +1 -150
- package/dist/jsx/Toast.mjs.map +3 -3
- package/dist/jsx/ToastAnnounce.js +1 -59
- package/dist/jsx/ToastAnnounce.js.map +2 -2
- package/dist/jsx/ToastAnnounce.mjs +1 -59
- package/dist/jsx/ToastAnnounce.mjs.map +2 -2
- package/dist/jsx/ToastImperative.js +1 -72
- package/dist/jsx/ToastImperative.js.map +2 -2
- package/dist/jsx/ToastImperative.mjs +1 -72
- package/dist/jsx/ToastImperative.mjs.map +2 -2
- package/dist/jsx/ToastImpl.js +1 -307
- package/dist/jsx/ToastImpl.js.map +2 -2
- package/dist/jsx/ToastImpl.mjs +1 -307
- package/dist/jsx/ToastImpl.mjs.map +2 -2
- package/dist/jsx/ToastProvider.js +1 -75
- package/dist/jsx/ToastProvider.js.map +2 -2
- package/dist/jsx/ToastProvider.mjs +1 -75
- package/dist/jsx/ToastProvider.mjs.map +2 -2
- package/dist/jsx/ToastViewport.js +1 -259
- package/dist/jsx/ToastViewport.js.map +2 -2
- package/dist/jsx/ToastViewport.mjs +1 -259
- package/dist/jsx/ToastViewport.mjs.map +2 -2
- package/dist/jsx/constants.js +1 -4
- package/dist/jsx/constants.js.map +2 -2
- package/dist/jsx/constants.mjs +1 -4
- package/dist/jsx/constants.mjs.map +2 -2
- package/dist/jsx/createNativeToast.js +1 -44
- package/dist/jsx/createNativeToast.js.map +2 -2
- package/dist/jsx/createNativeToast.mjs +1 -44
- package/dist/jsx/createNativeToast.mjs.map +2 -2
- package/dist/jsx/createNativeToast.native.js +1 -18
- package/dist/jsx/createNativeToast.native.js.map +2 -2
- package/dist/jsx/createNativeToast.native.mjs +1 -18
- package/dist/jsx/createNativeToast.native.mjs.map +2 -2
- package/dist/jsx/index.js +1 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +1 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/package.json +13 -13
- package/src/Toast.tsx +9 -1
- package/types/Toast.d.ts +2 -2
- package/types/Toast.d.ts.map +1 -1
|
@@ -1,64 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
Stack,
|
|
4
|
-
Text,
|
|
5
|
-
styled,
|
|
6
|
-
useEvent,
|
|
7
|
-
useIsomorphicLayoutEffect
|
|
8
|
-
} from "@tamagui/core";
|
|
9
|
-
import { Portal } from "@tamagui/portal";
|
|
10
|
-
import { VisuallyHidden } from "@tamagui/visually-hidden";
|
|
11
|
-
import * as React from "react";
|
|
12
|
-
import { useToastProviderContext } from "./ToastProvider";
|
|
13
|
-
import { TOAST_NAME } from "./constants";
|
|
14
|
-
const ToastAnnounceExcludeFrame = styled(Stack, {
|
|
15
|
-
name: "ToastAnnounceExclude"
|
|
16
|
-
});
|
|
17
|
-
const ToastAnnounceExclude = React.forwardRef(
|
|
18
|
-
(props, forwardedRef) => {
|
|
19
|
-
const { __scopeToast, altText, ...announceExcludeProps } = props;
|
|
20
|
-
return /* @__PURE__ */ jsx(
|
|
21
|
-
ToastAnnounceExcludeFrame,
|
|
22
|
-
{
|
|
23
|
-
"data-toast-announce-exclude": "",
|
|
24
|
-
"data-toast-announce-alt": altText || void 0,
|
|
25
|
-
...announceExcludeProps,
|
|
26
|
-
ref: forwardedRef
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
const ToastAnnounce = (props) => {
|
|
32
|
-
const { __scopeToast, children, ...announceProps } = props;
|
|
33
|
-
const context = useToastProviderContext(TOAST_NAME, __scopeToast);
|
|
34
|
-
const [renderAnnounceText, setRenderAnnounceText] = React.useState(false);
|
|
35
|
-
const [isAnnounced, setIsAnnounced] = React.useState(false);
|
|
36
|
-
useNextFrame(() => setRenderAnnounceText(true));
|
|
37
|
-
React.useEffect(() => {
|
|
38
|
-
const timer = setTimeout(() => setIsAnnounced(true), 1e3);
|
|
39
|
-
return () => clearTimeout(timer);
|
|
40
|
-
}, []);
|
|
41
|
-
return isAnnounced ? null : /* @__PURE__ */ jsx(Portal, { asChild: true, children: /* @__PURE__ */ jsx(VisuallyHidden, { ...announceProps, children: renderAnnounceText && /* @__PURE__ */ jsxs(Text, { children: [
|
|
42
|
-
context.label,
|
|
43
|
-
" ",
|
|
44
|
-
children
|
|
45
|
-
] }) }) });
|
|
46
|
-
};
|
|
47
|
-
function useNextFrame(callback = () => {
|
|
48
|
-
}) {
|
|
49
|
-
const fn = useEvent(callback);
|
|
50
|
-
useIsomorphicLayoutEffect(() => {
|
|
51
|
-
let raf1 = 0;
|
|
52
|
-
let raf2 = 0;
|
|
53
|
-
raf1 = requestAnimationFrame(() => raf2 = requestAnimationFrame(fn));
|
|
54
|
-
return () => {
|
|
55
|
-
cancelAnimationFrame(raf1);
|
|
56
|
-
cancelAnimationFrame(raf2);
|
|
57
|
-
};
|
|
58
|
-
}, [fn]);
|
|
59
|
-
}
|
|
60
|
-
export {
|
|
61
|
-
ToastAnnounce,
|
|
62
|
-
ToastAnnounceExclude
|
|
63
|
-
};
|
|
1
|
+
import{jsx as a,jsxs as g}from"react/jsx-runtime";import{Stack as p,Text as m,styled as T,useEvent as A,useIsomorphicLayoutEffect as f}from"@tamagui/core";import{Portal as x}from"@tamagui/portal";import{VisuallyHidden as P}from"@tamagui/visually-hidden";import*as s from"react";import{useToastProviderContext as E}from"./ToastProvider";import{TOAST_NAME as F}from"./constants";const y=T(p,{name:"ToastAnnounceExclude"}),S=s.forwardRef((o,e)=>{const{__scopeToast:t,altText:n,...r}=o;return a(y,{"data-toast-announce-exclude":"","data-toast-announce-alt":n||void 0,...r,ref:e})}),h=o=>{const{__scopeToast:e,children:t,...n}=o,r=E(F,e),[c,u]=s.useState(!1),[l,d]=s.useState(!1);return _(()=>u(!0)),s.useEffect(()=>{const i=setTimeout(()=>d(!0),1e3);return()=>clearTimeout(i)},[]),l?null:a(x,{asChild:!0,children:a(P,{...n,children:c&&g(m,{children:[r.label," ",t]})})})};function _(o=()=>{}){const e=A(o);f(()=>{let t=0,n=0;return t=requestAnimationFrame(()=>n=requestAnimationFrame(e)),()=>{cancelAnimationFrame(t),cancelAnimationFrame(n)}},[e])}export{h as ToastAnnounce,S as ToastAnnounceExclude};
|
|
64
2
|
//# sourceMappingURL=ToastAnnounce.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ToastAnnounce.tsx"],
|
|
4
4
|
"sourcesContent": ["import {\n GetProps,\n Stack,\n TamaguiElement,\n Text,\n styled,\n useEvent,\n useIsomorphicLayoutEffect,\n} from '@tamagui/core'\nimport { Portal } from '@tamagui/portal'\nimport { VisuallyHidden } from '@tamagui/visually-hidden'\nimport * as React from 'react'\n\nimport { ScopedProps, useToastProviderContext } from './ToastProvider'\nimport { TOAST_NAME } from './constants'\n\nconst ToastAnnounceExcludeFrame = styled(Stack, {\n name: 'ToastAnnounceExclude',\n})\ntype ToastAnnounceExcludeFrameProps = GetProps<typeof ToastAnnounceExcludeFrame>\ntype ToastAnnounceExcludeProps = ToastAnnounceExcludeFrameProps & {\n altText?: string\n}\n\nconst ToastAnnounceExclude = React.forwardRef<TamaguiElement, ToastAnnounceExcludeProps>(\n (props: ScopedProps<ToastAnnounceExcludeProps>, forwardedRef) => {\n const { __scopeToast, altText, ...announceExcludeProps } = props\n\n return (\n <ToastAnnounceExcludeFrame\n data-toast-announce-exclude=\"\"\n data-toast-announce-alt={altText || undefined}\n {...announceExcludeProps}\n ref={forwardedRef}\n />\n )\n }\n)\n\n/* -----------------------------------------------------------------------------------------------*/\n\ninterface ToastAnnounceProps\n extends Omit<GetProps<typeof VisuallyHidden>, 'children'>,\n ScopedProps<{ children: string[] }> {}\n\nconst ToastAnnounce: React.FC<ToastAnnounceProps> = (\n props: ScopedProps<ToastAnnounceProps>\n) => {\n const { __scopeToast, children, ...announceProps } = props\n const context = useToastProviderContext(TOAST_NAME, __scopeToast)\n const [renderAnnounceText, setRenderAnnounceText] = React.useState(false)\n const [isAnnounced, setIsAnnounced] = React.useState(false)\n\n // render text content in the next frame to ensure toast is announced in NVDA\n useNextFrame(() => setRenderAnnounceText(true))\n\n // cleanup after announcing\n React.useEffect(() => {\n const timer = setTimeout(() => setIsAnnounced(true), 1000)\n return () => clearTimeout(timer)\n }, [])\n\n return isAnnounced ? null : (\n <Portal asChild>\n <VisuallyHidden {...announceProps}>\n {renderAnnounceText && (\n <Text>\n {context.label} {children}\n </Text>\n )}\n </VisuallyHidden>\n </Portal>\n )\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useNextFrame(callback = () => {}) {\n const fn = useEvent(callback)\n useIsomorphicLayoutEffect(() => {\n let raf1 = 0\n let raf2 = 0\n raf1 = requestAnimationFrame(() => (raf2 = requestAnimationFrame(fn)))\n return () => {\n cancelAnimationFrame(raf1)\n cancelAnimationFrame(raf2)\n }\n }, [fn])\n}\n\n\nexport {\n ToastAnnounce,\n ToastAnnounceProps,\n ToastAnnounceExclude,\n ToastAnnounceExcludeProps,\n}\n"],
|
|
5
|
-
"mappings": "AA6BM,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AA6BM,cAAAA,EAqCI,QAAAC,MArCJ,oBA7BN,OAEE,SAAAC,EAEA,QAAAC,EACA,UAAAC,EACA,YAAAC,EACA,6BAAAC,MACK,gBACP,OAAS,UAAAC,MAAc,kBACvB,OAAS,kBAAAC,MAAsB,2BAC/B,UAAYC,MAAW,QAEvB,OAAsB,2BAAAC,MAA+B,kBACrD,OAAS,cAAAC,MAAkB,cAE3B,MAAMC,EAA4BR,EAAOF,EAAO,CAC9C,KAAM,sBACR,CAAC,EAMKW,EAAuBJ,EAAM,WACjC,CAACK,EAA+CC,IAAiB,CAC/D,KAAM,CAAE,aAAAC,EAAc,QAAAC,EAAS,GAAGC,CAAqB,EAAIJ,EAE3D,OACEd,EAACY,EAAA,CACC,8BAA4B,GAC5B,0BAAyBK,GAAW,OACnC,GAAGC,EACJ,IAAKH,EACP,CAEJ,CACF,EAQMI,EACJL,GACG,CACH,KAAM,CAAE,aAAAE,EAAc,SAAAI,EAAU,GAAGC,CAAc,EAAIP,EAC/CQ,EAAUZ,EAAwBC,EAAYK,CAAY,EAC1D,CAACO,EAAoBC,CAAqB,EAAIf,EAAM,SAAS,EAAK,EAClE,CAACgB,EAAaC,CAAc,EAAIjB,EAAM,SAAS,EAAK,EAG1D,OAAAkB,EAAa,IAAMH,EAAsB,EAAI,CAAC,EAG9Cf,EAAM,UAAU,IAAM,CACpB,MAAMmB,EAAQ,WAAW,IAAMF,EAAe,EAAI,EAAG,GAAI,EACzD,MAAO,IAAM,aAAaE,CAAK,CACjC,EAAG,CAAC,CAAC,EAEEH,EAAc,KACnBzB,EAACO,EAAA,CAAO,QAAO,GACb,SAAAP,EAACQ,EAAA,CAAgB,GAAGa,EACjB,SAAAE,GACCtB,EAACE,EAAA,CACE,UAAAmB,EAAQ,MAAM,IAAEF,GACnB,EAEJ,EACF,CAEJ,EAIA,SAASO,EAAaE,EAAW,IAAM,CAAC,EAAG,CACzC,MAAMC,EAAKzB,EAASwB,CAAQ,EAC5BvB,EAA0B,IAAM,CAC9B,IAAIyB,EAAO,EACPC,EAAO,EACX,OAAAD,EAAO,sBAAsB,IAAOC,EAAO,sBAAsBF,CAAE,CAAE,EAC9D,IAAM,CACX,qBAAqBC,CAAI,EACzB,qBAAqBC,CAAI,CAC3B,CACF,EAAG,CAACF,CAAE,CAAC,CACT",
|
|
6
|
+
"names": ["jsx", "jsxs", "Stack", "Text", "styled", "useEvent", "useIsomorphicLayoutEffect", "Portal", "VisuallyHidden", "React", "useToastProviderContext", "TOAST_NAME", "ToastAnnounceExcludeFrame", "ToastAnnounceExclude", "props", "forwardedRef", "__scopeToast", "altText", "announceExcludeProps", "ToastAnnounce", "children", "announceProps", "context", "renderAnnounceText", "setRenderAnnounceText", "isAnnounced", "setIsAnnounced", "useNextFrame", "timer", "callback", "fn", "raf1", "raf2"]
|
|
7
7
|
}
|
|
@@ -1,74 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { isWeb } from "@tamagui/core";
|
|
3
|
-
import React, { createContext, useContext, useMemo, useRef } from "react";
|
|
4
|
-
import { Platform } from "react-native";
|
|
5
|
-
import { createNativeToast } from "./createNativeToast";
|
|
6
|
-
const ToastContext = createContext({});
|
|
7
|
-
const ToastCurrentContext = createContext(null);
|
|
8
|
-
const useToastController = () => {
|
|
9
|
-
return useContext(ToastContext);
|
|
10
|
-
};
|
|
11
|
-
const useToastState = () => {
|
|
12
|
-
return useContext(ToastCurrentContext);
|
|
13
|
-
};
|
|
14
|
-
const useToast = () => {
|
|
15
|
-
return {
|
|
16
|
-
...useToastController(),
|
|
17
|
-
currentToast: useToastState()
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
const ToastImperativeProvider = ({
|
|
21
|
-
children,
|
|
22
|
-
options
|
|
23
|
-
}) => {
|
|
24
|
-
const counterRef = useRef(0);
|
|
25
|
-
const [toast, setToast] = React.useState(null);
|
|
26
|
-
const [lastNativeToastRef, setLastNativeToastRef] = React.useState(null);
|
|
27
|
-
const show = React.useCallback(
|
|
28
|
-
(title, showOptions) => {
|
|
29
|
-
const native = (showOptions == null ? void 0 : showOptions.native) ?? options.native;
|
|
30
|
-
const isWebNative = Array.isArray(native) ? native.includes("web") : native === "web";
|
|
31
|
-
const isMobileNative = Array.isArray(native) ? native.includes("mobile") : native === "mobile";
|
|
32
|
-
const isAndroidNative = isMobileNative || (Array.isArray(native) ? native.includes("android") : native === "android");
|
|
33
|
-
const isIosNative = isMobileNative || (Array.isArray(native) ? native.includes("ios") : native === "ios");
|
|
34
|
-
const isHandledNatively = native === true || isWeb && isWebNative || !isWeb && isMobileNative || Platform.OS === "android" && isAndroidNative || Platform.OS === "ios" && isIosNative;
|
|
35
|
-
if (isHandledNatively) {
|
|
36
|
-
const nativeToastResult = createNativeToast(title, showOptions ?? {});
|
|
37
|
-
if (typeof nativeToastResult === "object" && nativeToastResult.nativeToastRef) {
|
|
38
|
-
setLastNativeToastRef(nativeToastResult.nativeToastRef);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
counterRef.current++;
|
|
42
|
-
setToast({
|
|
43
|
-
title,
|
|
44
|
-
id: counterRef.current.toString(),
|
|
45
|
-
...showOptions,
|
|
46
|
-
isHandledNatively
|
|
47
|
-
});
|
|
48
|
-
return true;
|
|
49
|
-
},
|
|
50
|
-
[setToast, options.native]
|
|
51
|
-
);
|
|
52
|
-
const hide = React.useCallback(() => {
|
|
53
|
-
lastNativeToastRef == null ? void 0 : lastNativeToastRef.close();
|
|
54
|
-
setToast(null);
|
|
55
|
-
}, [setToast, lastNativeToastRef]);
|
|
56
|
-
const contextValue = useMemo(() => {
|
|
57
|
-
return {
|
|
58
|
-
show,
|
|
59
|
-
hide,
|
|
60
|
-
nativeToast: lastNativeToastRef,
|
|
61
|
-
options
|
|
62
|
-
};
|
|
63
|
-
}, [show, hide, lastNativeToastRef, JSON.stringify(options || null)]);
|
|
64
|
-
const currentContextValue = useMemo(() => {
|
|
65
|
-
}, []);
|
|
66
|
-
return /* @__PURE__ */ jsx(ToastContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(ToastCurrentContext.Provider, { value: toast, children }) });
|
|
67
|
-
};
|
|
68
|
-
export {
|
|
69
|
-
ToastImperativeProvider,
|
|
70
|
-
useToast,
|
|
71
|
-
useToastController,
|
|
72
|
-
useToastState
|
|
73
|
-
};
|
|
1
|
+
import{jsx as y}from"react/jsx-runtime";import{isWeb as d}from"@tamagui/core";import s,{createContext as p,useContext as m,useMemo as f,useRef as O}from"react";import{Platform as N}from"react-native";import{createNativeToast as V}from"./createNativeToast";const C=p({}),x=p(null),D=()=>m(C),h=()=>m(x),B=()=>({...D(),currentToast:h()}),E=({children:P,options:o})=>{const l=O(0),[I,r]=s.useState(null),[e,b]=s.useState(null),v=s.useCallback((c,a)=>{const t=(a==null?void 0:a.native)??o.native,A=Array.isArray(t)?t.includes("web"):t==="web",i=Array.isArray(t)?t.includes("mobile"):t==="mobile",S=i||(Array.isArray(t)?t.includes("android"):t==="android"),g=i||(Array.isArray(t)?t.includes("ios"):t==="ios"),T=t===!0||d&&A||!d&&i||N.OS==="android"&&S||N.OS==="ios"&&g;if(T){const n=V(c,a??{});typeof n=="object"&&n.nativeToastRef&&b(n.nativeToastRef)}return l.current++,r({title:c,id:l.current.toString(),...a,isHandledNatively:T}),!0},[r,o.native]),u=s.useCallback(()=>{e==null||e.close(),r(null)},[r,e]),R=f(()=>({show:v,hide:u,nativeToast:e,options:o}),[v,u,e,JSON.stringify(o||null)]),k=f(()=>{},[]);return y(C.Provider,{value:R,children:y(x.Provider,{value:I,children:P})})};export{E as ToastImperativeProvider,B as useToast,D as useToastController,h as useToastState};
|
|
74
2
|
//# sourceMappingURL=ToastImperative.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ToastImperative.tsx"],
|
|
4
4
|
"sourcesContent": ["import { isWeb } from '@tamagui/core'\nimport React, { createContext, useContext, useMemo, useRef } from 'react'\nimport { Platform } from 'react-native'\n\nimport { createNativeToast } from './createNativeToast'\nimport {\n CreateNativeToastOptions,\n NativeToastRef,\n ToastNativePlatform,\n ToastNativeValue,\n} from './types'\n\ninterface ToastImperativeOptions extends Omit<CreateNativeToastOptions, 'message'> {\n /**\n * Will show a native toast if is true or is set to the current platform. On iOS, it wraps `SPIndicator` and `SPAlert`. On Android, it wraps `ToastAndroid`. On web, it wraps Notification API. Mobile's native features are handled by `burnt`.\n */\n native?: ToastNativeValue\n}\ninterface ShowOptions extends CreateNativeToastOptions {\n /**\n * Used when need custom data\n */\n additionalInfo?: Record<string, any>\n /**\n * Overrides the native option on `ToastImperativeProvider`\n */\n native?: ToastNativeValue\n}\n\ntype ToastData = { title: string; id: string } & CreateNativeToastOptions & {\n isHandledNatively: boolean\n }\n\ninterface ToastContextI {\n nativeToast: NativeToastRef | null\n\n /**\n * Call it to show a new toast. If you're using native toasts, you can pass native options using \\`burntOptions\\` or \\`notificationOptions\\` depending on the native platform (mobile/web).\n */\n show: (title: string, options?: ShowOptions) => boolean\n\n /**\n * Call it to hide the currently displayed toast.\n *\n * _NOTE_: does not work on Android native toasts\n *\n * _NOTE_: hides the last toast on web notification toasts\n */\n hide: () => void\n\n options?: ToastImperativeOptions\n}\n\nconst ToastContext = createContext<ToastContextI>({} as any)\nconst ToastCurrentContext = createContext<ToastData | null>(null)\n\nexport const useToastController = () => {\n return useContext(ToastContext)\n}\n\nexport const useToastState = () => {\n return useContext(ToastCurrentContext)\n}\n\n/** @deprecated use `useToastController` and `useToastState` instead to avoid performance pitfalls */\nexport const useToast = () => {\n return {\n ...useToastController(),\n currentToast: useToastState(),\n }\n}\n\ninterface ToastImperativeProviderProps {\n children: React.ReactNode\n /**\n * Used to provide defaults to imperative API. Options can be overwritten when calling `show()`.\n */\n options: ToastImperativeOptions\n}\n\nexport const ToastImperativeProvider = ({\n children,\n options,\n}: ToastImperativeProviderProps) => {\n const counterRef = useRef(0)\n\n const [toast, setToast] = React.useState<ToastData | null>(null)\n\n const [lastNativeToastRef, setLastNativeToastRef] =\n React.useState<ToastContextI['nativeToast']>(null)\n\n const show = React.useCallback<ToastContextI['show']>(\n (title, showOptions) => {\n const native = showOptions?.native ?? options.native\n const isWebNative = Array.isArray(native)\n ? native.includes('web')\n : native === 'web'\n const isMobileNative = Array.isArray(native)\n ? native.includes('mobile')\n : native === 'mobile'\n const isAndroidNative =\n isMobileNative ||\n (Array.isArray(native) ? native.includes('android') : native === 'android')\n const isIosNative =\n isMobileNative ||\n (Array.isArray(native) ? native.includes('ios') : native === 'ios')\n\n const isHandledNatively =\n native === true ||\n (isWeb && isWebNative) ||\n (!isWeb && isMobileNative) ||\n (Platform.OS === 'android' && isAndroidNative) ||\n (Platform.OS === 'ios' && isIosNative)\n\n if (isHandledNatively) {\n const nativeToastResult = createNativeToast(title, showOptions ?? {})\n if (typeof nativeToastResult === 'object' && nativeToastResult.nativeToastRef) {\n setLastNativeToastRef(nativeToastResult.nativeToastRef)\n }\n }\n counterRef.current++\n setToast({\n title,\n id: counterRef.current.toString(),\n ...showOptions,\n isHandledNatively,\n })\n return true\n },\n [setToast, options.native]\n )\n const hide = React.useCallback(() => {\n lastNativeToastRef?.close()\n setToast(null)\n }, [setToast, lastNativeToastRef])\n\n const contextValue = useMemo(() => {\n return {\n show,\n hide,\n nativeToast: lastNativeToastRef,\n options,\n }\n }, [show, hide, lastNativeToastRef, JSON.stringify(options || null)])\n\n const currentContextValue = useMemo(() => {}, [])\n\n return (\n <ToastContext.Provider value={contextValue}>\n <ToastCurrentContext.Provider value={toast}>\n {children}\n </ToastCurrentContext.Provider>\n </ToastContext.Provider>\n )\n}\n\nexport type { ToastImperativeProviderProps, ToastNativePlatform, ToastNativeValue }\n"],
|
|
5
|
-
"mappings": "AAqJM
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAqJM,cAAAA,MAAA,oBArJN,OAAS,SAAAC,MAAa,gBACtB,OAAOC,GAAS,iBAAAC,EAAe,cAAAC,EAAY,WAAAC,EAAS,UAAAC,MAAc,QAClE,OAAS,YAAAC,MAAgB,eAEzB,OAAS,qBAAAC,MAAyB,sBAiDlC,MAAMC,EAAeN,EAA6B,CAAC,CAAQ,EACrDO,EAAsBP,EAAgC,IAAI,EAEnDQ,EAAqB,IACzBP,EAAWK,CAAY,EAGnBG,EAAgB,IACpBR,EAAWM,CAAmB,EAI1BG,EAAW,KACf,CACL,GAAGF,EAAmB,EACtB,aAAcC,EAAc,CAC9B,GAWWE,EAA0B,CAAC,CACtC,SAAAC,EACA,QAAAC,CACF,IAAoC,CAClC,MAAMC,EAAaX,EAAO,CAAC,EAErB,CAACY,EAAOC,CAAQ,EAAIjB,EAAM,SAA2B,IAAI,EAEzD,CAACkB,EAAoBC,CAAqB,EAC9CnB,EAAM,SAAuC,IAAI,EAE7CoB,EAAOpB,EAAM,YACjB,CAACqB,EAAOC,IAAgB,CACtB,MAAMC,GAASD,GAAA,YAAAA,EAAa,SAAUR,EAAQ,OACxCU,EAAc,MAAM,QAAQD,CAAM,EACpCA,EAAO,SAAS,KAAK,EACrBA,IAAW,MACTE,EAAiB,MAAM,QAAQF,CAAM,EACvCA,EAAO,SAAS,QAAQ,EACxBA,IAAW,SACTG,EACJD,IACC,MAAM,QAAQF,CAAM,EAAIA,EAAO,SAAS,SAAS,EAAIA,IAAW,WAC7DI,EACJF,IACC,MAAM,QAAQF,CAAM,EAAIA,EAAO,SAAS,KAAK,EAAIA,IAAW,OAEzDK,EACJL,IAAW,IACVxB,GAASyB,GACT,CAACzB,GAAS0B,GACVpB,EAAS,KAAO,WAAaqB,GAC7BrB,EAAS,KAAO,OAASsB,EAE5B,GAAIC,EAAmB,CACrB,MAAMC,EAAoBvB,EAAkBe,EAAOC,GAAe,CAAC,CAAC,EAChE,OAAOO,GAAsB,UAAYA,EAAkB,gBAC7DV,EAAsBU,EAAkB,cAAc,CAE1D,CACA,OAAAd,EAAW,UACXE,EAAS,CACP,MAAAI,EACA,GAAIN,EAAW,QAAQ,SAAS,EAChC,GAAGO,EACH,kBAAAM,CACF,CAAC,EACM,EACT,EACA,CAACX,EAAUH,EAAQ,MAAM,CAC3B,EACMgB,EAAO9B,EAAM,YAAY,IAAM,CACnCkB,GAAA,MAAAA,EAAoB,QACpBD,EAAS,IAAI,CACf,EAAG,CAACA,EAAUC,CAAkB,CAAC,EAE3Ba,EAAe5B,EAAQ,KACpB,CACL,KAAAiB,EACA,KAAAU,EACA,YAAaZ,EACb,QAAAJ,CACF,GACC,CAACM,EAAMU,EAAMZ,EAAoB,KAAK,UAAUJ,GAAW,IAAI,CAAC,CAAC,EAE9DkB,EAAsB7B,EAAQ,IAAM,CAAC,EAAG,CAAC,CAAC,EAEhD,OACEL,EAACS,EAAa,SAAb,CAAsB,MAAOwB,EAC5B,SAAAjC,EAACU,EAAoB,SAApB,CAA6B,MAAOQ,EAClC,SAAAH,EACH,EACF,CAEJ",
|
|
6
|
+
"names": ["jsx", "isWeb", "React", "createContext", "useContext", "useMemo", "useRef", "Platform", "createNativeToast", "ToastContext", "ToastCurrentContext", "useToastController", "useToastState", "useToast", "ToastImperativeProvider", "children", "options", "counterRef", "toast", "setToast", "lastNativeToastRef", "setLastNativeToastRef", "show", "title", "showOptions", "native", "isWebNative", "isMobileNative", "isAndroidNative", "isIosNative", "isHandledNatively", "nativeToastResult", "hide", "contextValue", "currentContextValue"]
|
|
7
7
|
}
|
|
@@ -1,74 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { isWeb } from "@tamagui/core";
|
|
3
|
-
import React, { createContext, useContext, useMemo, useRef } from "react";
|
|
4
|
-
import { Platform } from "react-native";
|
|
5
|
-
import { createNativeToast } from "./createNativeToast";
|
|
6
|
-
const ToastContext = createContext({});
|
|
7
|
-
const ToastCurrentContext = createContext(null);
|
|
8
|
-
const useToastController = () => {
|
|
9
|
-
return useContext(ToastContext);
|
|
10
|
-
};
|
|
11
|
-
const useToastState = () => {
|
|
12
|
-
return useContext(ToastCurrentContext);
|
|
13
|
-
};
|
|
14
|
-
const useToast = () => {
|
|
15
|
-
return {
|
|
16
|
-
...useToastController(),
|
|
17
|
-
currentToast: useToastState()
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
const ToastImperativeProvider = ({
|
|
21
|
-
children,
|
|
22
|
-
options
|
|
23
|
-
}) => {
|
|
24
|
-
const counterRef = useRef(0);
|
|
25
|
-
const [toast, setToast] = React.useState(null);
|
|
26
|
-
const [lastNativeToastRef, setLastNativeToastRef] = React.useState(null);
|
|
27
|
-
const show = React.useCallback(
|
|
28
|
-
(title, showOptions) => {
|
|
29
|
-
const native = (showOptions == null ? void 0 : showOptions.native) ?? options.native;
|
|
30
|
-
const isWebNative = Array.isArray(native) ? native.includes("web") : native === "web";
|
|
31
|
-
const isMobileNative = Array.isArray(native) ? native.includes("mobile") : native === "mobile";
|
|
32
|
-
const isAndroidNative = isMobileNative || (Array.isArray(native) ? native.includes("android") : native === "android");
|
|
33
|
-
const isIosNative = isMobileNative || (Array.isArray(native) ? native.includes("ios") : native === "ios");
|
|
34
|
-
const isHandledNatively = native === true || isWeb && isWebNative || !isWeb && isMobileNative || Platform.OS === "android" && isAndroidNative || Platform.OS === "ios" && isIosNative;
|
|
35
|
-
if (isHandledNatively) {
|
|
36
|
-
const nativeToastResult = createNativeToast(title, showOptions ?? {});
|
|
37
|
-
if (typeof nativeToastResult === "object" && nativeToastResult.nativeToastRef) {
|
|
38
|
-
setLastNativeToastRef(nativeToastResult.nativeToastRef);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
counterRef.current++;
|
|
42
|
-
setToast({
|
|
43
|
-
title,
|
|
44
|
-
id: counterRef.current.toString(),
|
|
45
|
-
...showOptions,
|
|
46
|
-
isHandledNatively
|
|
47
|
-
});
|
|
48
|
-
return true;
|
|
49
|
-
},
|
|
50
|
-
[setToast, options.native]
|
|
51
|
-
);
|
|
52
|
-
const hide = React.useCallback(() => {
|
|
53
|
-
lastNativeToastRef == null ? void 0 : lastNativeToastRef.close();
|
|
54
|
-
setToast(null);
|
|
55
|
-
}, [setToast, lastNativeToastRef]);
|
|
56
|
-
const contextValue = useMemo(() => {
|
|
57
|
-
return {
|
|
58
|
-
show,
|
|
59
|
-
hide,
|
|
60
|
-
nativeToast: lastNativeToastRef,
|
|
61
|
-
options
|
|
62
|
-
};
|
|
63
|
-
}, [show, hide, lastNativeToastRef, JSON.stringify(options || null)]);
|
|
64
|
-
const currentContextValue = useMemo(() => {
|
|
65
|
-
}, []);
|
|
66
|
-
return /* @__PURE__ */ jsx(ToastContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(ToastCurrentContext.Provider, { value: toast, children }) });
|
|
67
|
-
};
|
|
68
|
-
export {
|
|
69
|
-
ToastImperativeProvider,
|
|
70
|
-
useToast,
|
|
71
|
-
useToastController,
|
|
72
|
-
useToastState
|
|
73
|
-
};
|
|
1
|
+
import{jsx as y}from"react/jsx-runtime";import{isWeb as d}from"@tamagui/core";import s,{createContext as p,useContext as m,useMemo as f,useRef as O}from"react";import{Platform as N}from"react-native";import{createNativeToast as V}from"./createNativeToast";const C=p({}),x=p(null),D=()=>m(C),h=()=>m(x),B=()=>({...D(),currentToast:h()}),E=({children:P,options:o})=>{const l=O(0),[I,r]=s.useState(null),[e,b]=s.useState(null),v=s.useCallback((c,a)=>{const t=(a==null?void 0:a.native)??o.native,A=Array.isArray(t)?t.includes("web"):t==="web",i=Array.isArray(t)?t.includes("mobile"):t==="mobile",S=i||(Array.isArray(t)?t.includes("android"):t==="android"),g=i||(Array.isArray(t)?t.includes("ios"):t==="ios"),T=t===!0||d&&A||!d&&i||N.OS==="android"&&S||N.OS==="ios"&&g;if(T){const n=V(c,a??{});typeof n=="object"&&n.nativeToastRef&&b(n.nativeToastRef)}return l.current++,r({title:c,id:l.current.toString(),...a,isHandledNatively:T}),!0},[r,o.native]),u=s.useCallback(()=>{e==null||e.close(),r(null)},[r,e]),R=f(()=>({show:v,hide:u,nativeToast:e,options:o}),[v,u,e,JSON.stringify(o||null)]),k=f(()=>{},[]);return y(C.Provider,{value:R,children:y(x.Provider,{value:I,children:P})})};export{E as ToastImperativeProvider,B as useToast,D as useToastController,h as useToastState};
|
|
74
2
|
//# sourceMappingURL=ToastImperative.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ToastImperative.tsx"],
|
|
4
4
|
"sourcesContent": ["import { isWeb } from '@tamagui/core'\nimport React, { createContext, useContext, useMemo, useRef } from 'react'\nimport { Platform } from 'react-native'\n\nimport { createNativeToast } from './createNativeToast'\nimport {\n CreateNativeToastOptions,\n NativeToastRef,\n ToastNativePlatform,\n ToastNativeValue,\n} from './types'\n\ninterface ToastImperativeOptions extends Omit<CreateNativeToastOptions, 'message'> {\n /**\n * Will show a native toast if is true or is set to the current platform. On iOS, it wraps `SPIndicator` and `SPAlert`. On Android, it wraps `ToastAndroid`. On web, it wraps Notification API. Mobile's native features are handled by `burnt`.\n */\n native?: ToastNativeValue\n}\ninterface ShowOptions extends CreateNativeToastOptions {\n /**\n * Used when need custom data\n */\n additionalInfo?: Record<string, any>\n /**\n * Overrides the native option on `ToastImperativeProvider`\n */\n native?: ToastNativeValue\n}\n\ntype ToastData = { title: string; id: string } & CreateNativeToastOptions & {\n isHandledNatively: boolean\n }\n\ninterface ToastContextI {\n nativeToast: NativeToastRef | null\n\n /**\n * Call it to show a new toast. If you're using native toasts, you can pass native options using \\`burntOptions\\` or \\`notificationOptions\\` depending on the native platform (mobile/web).\n */\n show: (title: string, options?: ShowOptions) => boolean\n\n /**\n * Call it to hide the currently displayed toast.\n *\n * _NOTE_: does not work on Android native toasts\n *\n * _NOTE_: hides the last toast on web notification toasts\n */\n hide: () => void\n\n options?: ToastImperativeOptions\n}\n\nconst ToastContext = createContext<ToastContextI>({} as any)\nconst ToastCurrentContext = createContext<ToastData | null>(null)\n\nexport const useToastController = () => {\n return useContext(ToastContext)\n}\n\nexport const useToastState = () => {\n return useContext(ToastCurrentContext)\n}\n\n/** @deprecated use `useToastController` and `useToastState` instead to avoid performance pitfalls */\nexport const useToast = () => {\n return {\n ...useToastController(),\n currentToast: useToastState(),\n }\n}\n\ninterface ToastImperativeProviderProps {\n children: React.ReactNode\n /**\n * Used to provide defaults to imperative API. Options can be overwritten when calling `show()`.\n */\n options: ToastImperativeOptions\n}\n\nexport const ToastImperativeProvider = ({\n children,\n options,\n}: ToastImperativeProviderProps) => {\n const counterRef = useRef(0)\n\n const [toast, setToast] = React.useState<ToastData | null>(null)\n\n const [lastNativeToastRef, setLastNativeToastRef] =\n React.useState<ToastContextI['nativeToast']>(null)\n\n const show = React.useCallback<ToastContextI['show']>(\n (title, showOptions) => {\n const native = showOptions?.native ?? options.native\n const isWebNative = Array.isArray(native)\n ? native.includes('web')\n : native === 'web'\n const isMobileNative = Array.isArray(native)\n ? native.includes('mobile')\n : native === 'mobile'\n const isAndroidNative =\n isMobileNative ||\n (Array.isArray(native) ? native.includes('android') : native === 'android')\n const isIosNative =\n isMobileNative ||\n (Array.isArray(native) ? native.includes('ios') : native === 'ios')\n\n const isHandledNatively =\n native === true ||\n (isWeb && isWebNative) ||\n (!isWeb && isMobileNative) ||\n (Platform.OS === 'android' && isAndroidNative) ||\n (Platform.OS === 'ios' && isIosNative)\n\n if (isHandledNatively) {\n const nativeToastResult = createNativeToast(title, showOptions ?? {})\n if (typeof nativeToastResult === 'object' && nativeToastResult.nativeToastRef) {\n setLastNativeToastRef(nativeToastResult.nativeToastRef)\n }\n }\n counterRef.current++\n setToast({\n title,\n id: counterRef.current.toString(),\n ...showOptions,\n isHandledNatively,\n })\n return true\n },\n [setToast, options.native]\n )\n const hide = React.useCallback(() => {\n lastNativeToastRef?.close()\n setToast(null)\n }, [setToast, lastNativeToastRef])\n\n const contextValue = useMemo(() => {\n return {\n show,\n hide,\n nativeToast: lastNativeToastRef,\n options,\n }\n }, [show, hide, lastNativeToastRef, JSON.stringify(options || null)])\n\n const currentContextValue = useMemo(() => {}, [])\n\n return (\n <ToastContext.Provider value={contextValue}>\n <ToastCurrentContext.Provider value={toast}>\n {children}\n </ToastCurrentContext.Provider>\n </ToastContext.Provider>\n )\n}\n\nexport type { ToastImperativeProviderProps, ToastNativePlatform, ToastNativeValue }\n"],
|
|
5
|
-
"mappings": "AAqJM
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAqJM,cAAAA,MAAA,oBArJN,OAAS,SAAAC,MAAa,gBACtB,OAAOC,GAAS,iBAAAC,EAAe,cAAAC,EAAY,WAAAC,EAAS,UAAAC,MAAc,QAClE,OAAS,YAAAC,MAAgB,eAEzB,OAAS,qBAAAC,MAAyB,sBAiDlC,MAAMC,EAAeN,EAA6B,CAAC,CAAQ,EACrDO,EAAsBP,EAAgC,IAAI,EAEnDQ,EAAqB,IACzBP,EAAWK,CAAY,EAGnBG,EAAgB,IACpBR,EAAWM,CAAmB,EAI1BG,EAAW,KACf,CACL,GAAGF,EAAmB,EACtB,aAAcC,EAAc,CAC9B,GAWWE,EAA0B,CAAC,CACtC,SAAAC,EACA,QAAAC,CACF,IAAoC,CAClC,MAAMC,EAAaX,EAAO,CAAC,EAErB,CAACY,EAAOC,CAAQ,EAAIjB,EAAM,SAA2B,IAAI,EAEzD,CAACkB,EAAoBC,CAAqB,EAC9CnB,EAAM,SAAuC,IAAI,EAE7CoB,EAAOpB,EAAM,YACjB,CAACqB,EAAOC,IAAgB,CACtB,MAAMC,GAASD,GAAA,YAAAA,EAAa,SAAUR,EAAQ,OACxCU,EAAc,MAAM,QAAQD,CAAM,EACpCA,EAAO,SAAS,KAAK,EACrBA,IAAW,MACTE,EAAiB,MAAM,QAAQF,CAAM,EACvCA,EAAO,SAAS,QAAQ,EACxBA,IAAW,SACTG,EACJD,IACC,MAAM,QAAQF,CAAM,EAAIA,EAAO,SAAS,SAAS,EAAIA,IAAW,WAC7DI,EACJF,IACC,MAAM,QAAQF,CAAM,EAAIA,EAAO,SAAS,KAAK,EAAIA,IAAW,OAEzDK,EACJL,IAAW,IACVxB,GAASyB,GACT,CAACzB,GAAS0B,GACVpB,EAAS,KAAO,WAAaqB,GAC7BrB,EAAS,KAAO,OAASsB,EAE5B,GAAIC,EAAmB,CACrB,MAAMC,EAAoBvB,EAAkBe,EAAOC,GAAe,CAAC,CAAC,EAChE,OAAOO,GAAsB,UAAYA,EAAkB,gBAC7DV,EAAsBU,EAAkB,cAAc,CAE1D,CACA,OAAAd,EAAW,UACXE,EAAS,CACP,MAAAI,EACA,GAAIN,EAAW,QAAQ,SAAS,EAChC,GAAGO,EACH,kBAAAM,CACF,CAAC,EACM,EACT,EACA,CAACX,EAAUH,EAAQ,MAAM,CAC3B,EACMgB,EAAO9B,EAAM,YAAY,IAAM,CACnCkB,GAAA,MAAAA,EAAoB,QACpBD,EAAS,IAAI,CACf,EAAG,CAACA,EAAUC,CAAkB,CAAC,EAE3Ba,EAAe5B,EAAQ,KACpB,CACL,KAAAiB,EACA,KAAAU,EACA,YAAaZ,EACb,QAAAJ,CACF,GACC,CAACM,EAAMU,EAAMZ,EAAoB,KAAK,UAAUJ,GAAW,IAAI,CAAC,CAAC,EAE9DkB,EAAsB7B,EAAQ,IAAM,CAAC,EAAG,CAAC,CAAC,EAEhD,OACEL,EAACS,EAAa,SAAb,CAAsB,MAAOwB,EAC5B,SAAAjC,EAACU,EAAoB,SAApB,CAA6B,MAAOQ,EAClC,SAAAH,EACH,EACF,CAEJ",
|
|
6
|
+
"names": ["jsx", "isWeb", "React", "createContext", "useContext", "useMemo", "useRef", "Platform", "createNativeToast", "ToastContext", "ToastCurrentContext", "useToastController", "useToastState", "useToast", "ToastImperativeProvider", "children", "options", "counterRef", "toast", "setToast", "lastNativeToastRef", "setLastNativeToastRef", "show", "title", "showOptions", "native", "isWebNative", "isMobileNative", "isAndroidNative", "isIosNative", "isHandledNatively", "nativeToastResult", "hide", "contextValue", "currentContextValue"]
|
|
7
7
|
}
|