@tamagui/toast 1.12.2 → 1.13.0

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/ToastImperative.tsx"],
4
- "sourcesContent": ["import { isWeb } from '@tamagui/core'\nimport { Scope, createContextScope } from '@tamagui/create-context'\nimport React, { 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 ShowToastOptions 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}\ntype ScopedProps<P> = P & { __scopeToast?: Scope }\n\ntype ToastData = { title: string; id: string } & CreateNativeToastOptions & {\n isHandledNatively: boolean\n }\n\ninterface ImperativeToastContextValue {\n currentToast: ToastData | null\n nativeToast: NativeToastRef | null\n showToast: (title: string, options?: ShowToastOptions) => boolean\n hideToast: () => void\n options?: ToastImperativeOptions\n}\n\nconst [createImperativeToastContext, createImperativeToastScope] =\n createContextScope('ImperativeToast')\n\nconst [ToastImperativeProviderProvider, useToastProviderContext] =\n createImperativeToastContext<ImperativeToastContextValue>('ToastImperativeProvider')\n\nconst useToast = () => {\n const context = useToastProviderContext('useToast', undefined)\n\n return {\n /**\n * The currently displaying toast\n */\n currentToast: context.currentToast,\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: context.showToast,\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: context.hideToast,\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}\nconst ToastImperativeProvider = ({\n children,\n options,\n __scopeToast,\n}: ScopedProps<ToastImperativeProviderProps>) => {\n const counterRef = useRef(0)\n const [toast, setToast] =\n React.useState<ImperativeToastContextValue['currentToast']>(null)\n const [lastNativeToastRef, setLastNativeToastRef] =\n React.useState<ImperativeToastContextValue['nativeToast']>(null)\n const showToast = React.useCallback<ImperativeToastContextValue['showToast']>(\n (title, showToastOptions) => {\n const native = showToastOptions?.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, showToastOptions ?? {})\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 ...showToastOptions,\n isHandledNatively,\n })\n return true\n },\n [setToast, options.native]\n )\n const hideToast = React.useCallback(() => {\n lastNativeToastRef?.close()\n setToast(null)\n }, [setToast, lastNativeToastRef])\n\n return (\n <ToastImperativeProviderProvider\n scope={__scopeToast}\n showToast={showToast}\n hideToast={hideToast}\n currentToast={toast}\n nativeToast={lastNativeToastRef}\n options={options}\n >\n {children}\n </ToastImperativeProviderProvider>\n )\n}\n\nexport { ToastImperativeProvider, useToast }\nexport type { ToastImperativeProviderProps, ToastNativePlatform, ToastNativeValue }\n"],
5
- "mappings": "AAAA,SAAS,aAAa;AACtB,SAAgB,0BAA0B;AAC1C,OAAO,SAAS,cAAc;AAC9B,SAAS,gBAAgB;AAEzB,SAAS,yBAAyB;AAsClC,MAAM,CAAC,8BAA8B,0BAA0B,IAC7D,mBAAmB,iBAAiB;AAEtC,MAAM,CAAC,iCAAiC,uBAAuB,IAC7D,6BAA0D,yBAAyB;AAErF,MAAM,WAAW,MAAM;AACrB,QAAM,UAAU,wBAAwB,YAAY,MAAS;AAE7D,SAAO;AAAA;AAAA;AAAA;AAAA,IAIL,cAAc,QAAQ;AAAA;AAAA;AAAA;AAAA,IAItB,MAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQd,MAAM,QAAQ;AAAA,EAChB;AACF;AASA,MAAM,0BAA0B,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACF,MAAiD;AAC/C,QAAM,aAAa,OAAO,CAAC;AAC3B,QAAM,CAAC,OAAO,QAAQ,IACpB,MAAM,SAAsD,IAAI;AAClE,QAAM,CAAC,oBAAoB,qBAAqB,IAC9C,MAAM,SAAqD,IAAI;AACjE,QAAM,YAAY,MAAM;AAAA,IACtB,CAAC,OAAO,qBAAqB;AAC3B,YAAM,SAAS,kBAAkB,UAAU,QAAQ;AACnD,YAAM,cAAc,MAAM,QAAQ,MAAM,IACpC,OAAO,SAAS,KAAK,IACrB,WAAW;AACf,YAAM,iBAAiB,MAAM,QAAQ,MAAM,IACvC,OAAO,SAAS,QAAQ,IACxB,WAAW;AACf,YAAM,kBACJ,mBACC,MAAM,QAAQ,MAAM,IAAI,OAAO,SAAS,SAAS,IAAI,WAAW;AACnE,YAAM,cACJ,mBACC,MAAM,QAAQ,MAAM,IAAI,OAAO,SAAS,KAAK,IAAI,WAAW;AAE/D,YAAM,oBACJ,WAAW,QACV,SAAS,eACT,CAAC,SAAS,kBACV,SAAS,OAAO,aAAa,mBAC7B,SAAS,OAAO,SAAS;AAE5B,UAAI,mBAAmB;AACrB,cAAM,oBAAoB,kBAAkB,OAAO,oBAAoB,CAAC,CAAC;AACzE,YAAI,OAAO,sBAAsB,YAAY,kBAAkB,gBAAgB;AAC7E,gCAAsB,kBAAkB,cAAc;AAAA,QACxD;AAAA,MACF;AACA,iBAAW;AACX,eAAS;AAAA,QACP;AAAA,QACA,IAAI,WAAW,QAAQ,SAAS;AAAA,QAChC,GAAG;AAAA,QACH;AAAA,MACF,CAAC;AACD,aAAO;AAAA,IACT;AAAA,IACA,CAAC,UAAU,QAAQ,MAAM;AAAA,EAC3B;AACA,QAAM,YAAY,MAAM,YAAY,MAAM;AACxC,wBAAoB,MAAM;AAC1B,aAAS,IAAI;AAAA,EACf,GAAG,CAAC,UAAU,kBAAkB,CAAC;AAEjC,SACE,CAAC;AAAA,IACC,OAAO;AAAA,IACP,WAAW;AAAA,IACX,WAAW;AAAA,IACX,cAAc;AAAA,IACd,aAAa;AAAA,IACb,SAAS;AAAA,IAER,SACH,EATC;AAWL;",
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": "AAAA,SAAS,aAAa;AACtB,OAAO,SAAS,eAAe,YAAY,SAAS,cAAc;AAClE,SAAS,gBAAgB;AAEzB,SAAS,yBAAyB;AAiDlC,MAAM,eAAe,cAA6B,CAAC,CAAQ;AAC3D,MAAM,sBAAsB,cAAgC,IAAI;AAEzD,MAAM,qBAAqB,MAAM;AACtC,SAAO,WAAW,YAAY;AAChC;AAEO,MAAM,gBAAgB,MAAM;AACjC,SAAO,WAAW,mBAAmB;AACvC;AAGO,MAAM,WAAW,MAAM;AAC5B,SAAO;AAAA,IACL,GAAG,mBAAmB;AAAA,IACtB,cAAc,cAAc;AAAA,EAC9B;AACF;AAUO,MAAM,0BAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AACF,MAAoC;AAClC,QAAM,aAAa,OAAO,CAAC;AAE3B,QAAM,CAAC,OAAO,QAAQ,IAA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U,WAAW,IAAI,CAAC,CAAC;AAEpE,QAAM,sBAAsB,QAAQ,MAAM;AAAA,EAAC,GAAG,CAAC,CAAC;AAEhD,SACE,CAAC,aAAa,SAAS,OAAO,cAC5B,CAAC,oBAAoB,SAAS,OAAO,QAClC,SACH,EAFC,oBAAoB,SAGvB,EAJC,aAAa;AAMlB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/createNativeToast.native.tsx"],
4
- "sourcesContent": ["import { BurntToastOptions, CreateNativeToastsFn, HideNativeToastsFn } from './types'\n\nexport const createNativeToast: CreateNativeToastsFn = (\n title,\n { message, duration, burntOptions }\n) => {\n // import inline to allow lazy usage of native dependecy:\n const Burnt: { toast: (options: BurntToastOptions) => any } = require('burnt')\n\n Burnt.toast({\n title,\n message,\n duration: duration ? duration * 1000 : undefined,\n ...burntOptions,\n })\n return true\n}\n\nexport const hideNativeToast: HideNativeToastsFn = () => {\n const Burnt: { dismissAllAlerts: () => any } = require('burnt')\n Burnt.dismissAllAlerts()\n}\n"],
5
- "mappings": "AAEO,MAAM,oBAA0C,CACrD,OACA,EAAE,SAAS,UAAU,aAAa,MAC/B;AAEH,QAAM,QAAwD,QAAQ,OAAO;AAE7E,QAAM,MAAM;AAAA,IACV;AAAA,IACA;AAAA,IACA,UAAU,WAAW,WAAW,MAAO;AAAA,IACvC,GAAG;AAAA,EACL,CAAC;AACD,SAAO;AACT;AAEO,MAAM,kBAAsC,MAAM;AACvD,QAAM,QAAyC,QAAQ,OAAO;AAC9D,QAAM,iBAAiB;AACzB;",
4
+ "sourcesContent": ["import { BurntToastOptions, CreateNativeToastsFn, HideNativeToastsFn } from './types'\n\nexport const createNativeToast: CreateNativeToastsFn = (\n title,\n { message, duration, burntOptions }\n) => {\n // import inline to allow lazy usage of native dependecy:\n const Burnt = require('burnt') as typeof import('burnt')\n\n Burnt.toast({\n title,\n message,\n duration: duration ? duration * 1000 : undefined,\n ...burntOptions,\n })\n return true\n}\n\nexport const hideNativeToast: HideNativeToastsFn = () => {\n const Burnt = require('burnt') as typeof import('burnt')\n Burnt.dismissAllAlerts()\n}\n"],
5
+ "mappings": "AAEO,MAAM,oBAA0C,CACrD,OACA,EAAE,SAAS,UAAU,aAAa,MAC/B;AAEH,QAAM,QAAQ,QAAQ,OAAO;AAE7B,QAAM,MAAM;AAAA,IACV;AAAA,IACA;AAAA,IACA,UAAU,WAAW,WAAW,MAAO;AAAA,IACvC,GAAG;AAAA,EACL,CAAC;AACD,SAAO;AACT;AAEO,MAAM,kBAAsC,MAAM;AACvD,QAAM,QAAQ,QAAQ,OAAO;AAC7B,QAAM,iBAAiB;AACzB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/createNativeToast.native.tsx"],
4
- "sourcesContent": ["import { BurntToastOptions, CreateNativeToastsFn, HideNativeToastsFn } from './types'\n\nexport const createNativeToast: CreateNativeToastsFn = (\n title,\n { message, duration, burntOptions }\n) => {\n // import inline to allow lazy usage of native dependecy:\n const Burnt: { toast: (options: BurntToastOptions) => any } = require('burnt')\n\n Burnt.toast({\n title,\n message,\n duration: duration ? duration * 1000 : undefined,\n ...burntOptions,\n })\n return true\n}\n\nexport const hideNativeToast: HideNativeToastsFn = () => {\n const Burnt: { dismissAllAlerts: () => any } = require('burnt')\n Burnt.dismissAllAlerts()\n}\n"],
5
- "mappings": "AAEO,MAAM,oBAA0C,CACrD,OACA,EAAE,SAAS,UAAU,aAAa,MAC/B;AAEH,QAAM,QAAwD,QAAQ,OAAO;AAE7E,QAAM,MAAM;AAAA,IACV;AAAA,IACA;AAAA,IACA,UAAU,WAAW,WAAW,MAAO;AAAA,IACvC,GAAG;AAAA,EACL,CAAC;AACD,SAAO;AACT;AAEO,MAAM,kBAAsC,MAAM;AACvD,QAAM,QAAyC,QAAQ,OAAO;AAC9D,QAAM,iBAAiB;AACzB;",
4
+ "sourcesContent": ["import { BurntToastOptions, CreateNativeToastsFn, HideNativeToastsFn } from './types'\n\nexport const createNativeToast: CreateNativeToastsFn = (\n title,\n { message, duration, burntOptions }\n) => {\n // import inline to allow lazy usage of native dependecy:\n const Burnt = require('burnt') as typeof import('burnt')\n\n Burnt.toast({\n title,\n message,\n duration: duration ? duration * 1000 : undefined,\n ...burntOptions,\n })\n return true\n}\n\nexport const hideNativeToast: HideNativeToastsFn = () => {\n const Burnt = require('burnt') as typeof import('burnt')\n Burnt.dismissAllAlerts()\n}\n"],
5
+ "mappings": "AAEO,MAAM,oBAA0C,CACrD,OACA,EAAE,SAAS,UAAU,aAAa,MAC/B;AAEH,QAAM,QAAQ,QAAQ,OAAO;AAE7B,QAAM,MAAM;AAAA,IACV;AAAA,IACA;AAAA,IACA,UAAU,WAAW,WAAW,MAAO;AAAA,IACvC,GAAG;AAAA,EACL,CAAC;AACD,SAAO;AACT;AAEO,MAAM,kBAAsC,MAAM;AACvD,QAAM,QAAQ,QAAQ,OAAO;AAC7B,QAAM,iBAAiB;AACzB;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/toast",
3
- "version": "1.12.2",
3
+ "version": "1.13.0",
4
4
  "source": "src/index.ts",
5
5
  "types": "./types/index.d.ts",
6
6
  "main": "dist/cjs",
@@ -31,24 +31,26 @@
31
31
  }
32
32
  },
33
33
  "dependencies": {
34
- "@tamagui/animate-presence": "1.12.2",
35
- "@tamagui/compose-refs": "1.12.2",
36
- "@tamagui/core": "1.12.2",
37
- "@tamagui/create-context": "1.12.2",
38
- "@tamagui/dismissable": "1.12.2",
39
- "@tamagui/polyfill-dev": "1.12.2",
40
- "@tamagui/portal": "1.12.2",
41
- "@tamagui/stacks": "1.12.2",
42
- "@tamagui/text": "1.12.2",
43
- "@tamagui/use-controllable-state": "1.12.2",
44
- "@tamagui/visually-hidden": "1.12.2"
34
+ "@tamagui/animate-presence": "1.13.0",
35
+ "@tamagui/compose-refs": "1.13.0",
36
+ "@tamagui/core": "1.13.0",
37
+ "@tamagui/create-context": "1.13.0",
38
+ "@tamagui/dismissable": "1.13.0",
39
+ "@tamagui/polyfill-dev": "1.13.0",
40
+ "@tamagui/portal": "1.13.0",
41
+ "@tamagui/stacks": "1.13.0",
42
+ "@tamagui/text": "1.13.0",
43
+ "@tamagui/use-controllable-state": "1.13.0",
44
+ "@tamagui/visually-hidden": "1.13.0"
45
45
  },
46
46
  "peerDependencies": {
47
+ "burnt": "^0.10.0",
47
48
  "react": "*",
48
49
  "react-native": "*"
49
50
  },
50
51
  "devDependencies": {
51
- "@tamagui/build": "1.12.2",
52
+ "@tamagui/build": "1.13.0",
53
+ "burnt": "^0.10.0",
52
54
  "react": "^18.2.0",
53
55
  "react-native": "^0.71.4"
54
56
  },
package/src/Toast.tsx CHANGED
@@ -38,10 +38,10 @@ const TITLE_NAME = 'ToastTitle'
38
38
 
39
39
  const ToastTitleFrame = styled(SizableText, {
40
40
  name: TITLE_NAME,
41
- color: '$color',
42
41
  variants: {
43
42
  unstyled: {
44
43
  false: {
44
+ color: '$color',
45
45
  size: '$4',
46
46
  },
47
47
  },
@@ -50,6 +50,7 @@ const ToastTitleFrame = styled(SizableText, {
50
50
  unstyled: false,
51
51
  },
52
52
  })
53
+
53
54
  type PrimitiveDivProps = GetProps<typeof ToastTitleFrame>
54
55
  type ToastTitleProps = PrimitiveDivProps & {}
55
56
 
@@ -70,18 +71,21 @@ const DESCRIPTION_NAME = 'ToastDescription'
70
71
 
71
72
  const ToastDescriptionFrame = styled(SizableText, {
72
73
  name: DESCRIPTION_NAME,
73
- color: '$color11',
74
+
74
75
  variants: {
75
76
  unstyled: {
76
77
  false: {
78
+ color: '$color11',
77
79
  size: '$1',
78
80
  },
79
81
  },
80
82
  },
83
+
81
84
  defaultVariants: {
82
85
  unstyled: false,
83
86
  },
84
87
  })
88
+
85
89
  type ToastDescriptionFrameProps = GetProps<typeof ToastDescriptionFrame>
86
90
  type ToastDescriptionProps = ToastDescriptionFrameProps & {}
87
91
 
@@ -1,6 +1,5 @@
1
1
  import { isWeb } from '@tamagui/core'
2
- import { Scope, createContextScope } from '@tamagui/create-context'
3
- import React, { useRef } from 'react'
2
+ import React, { createContext, useContext, useMemo, useRef } from 'react'
4
3
  import { Platform } from 'react-native'
5
4
 
6
5
  import { createNativeToast } from './createNativeToast'
@@ -11,13 +10,13 @@ import {
11
10
  ToastNativeValue,
12
11
  } from './types'
13
12
 
14
- interface ToastImperativeOptions extends Omit<CreateNativeToastOptions, "message"> {
13
+ interface ToastImperativeOptions extends Omit<CreateNativeToastOptions, 'message'> {
15
14
  /**
16
15
  * 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`.
17
16
  */
18
17
  native?: ToastNativeValue
19
18
  }
20
- interface ShowToastOptions extends CreateNativeToastOptions {
19
+ interface ShowOptions extends CreateNativeToastOptions {
21
20
  /**
22
21
  * Used when need custom data
23
22
  */
@@ -27,46 +26,47 @@ interface ShowToastOptions extends CreateNativeToastOptions {
27
26
  */
28
27
  native?: ToastNativeValue
29
28
  }
30
- type ScopedProps<P> = P & { __scopeToast?: Scope }
31
29
 
32
30
  type ToastData = { title: string; id: string } & CreateNativeToastOptions & {
33
31
  isHandledNatively: boolean
34
32
  }
35
33
 
36
- interface ImperativeToastContextValue {
37
- currentToast: ToastData | null
34
+ interface ToastContextI {
38
35
  nativeToast: NativeToastRef | null
39
- showToast: (title: string, options?: ShowToastOptions) => boolean
40
- hideToast: () => void
36
+
37
+ /**
38
+ * 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).
39
+ */
40
+ show: (title: string, options?: ShowOptions) => boolean
41
+
42
+ /**
43
+ * Call it to hide the currently displayed toast.
44
+ *
45
+ * _NOTE_: does not work on Android native toasts
46
+ *
47
+ * _NOTE_: hides the last toast on web notification toasts
48
+ */
49
+ hide: () => void
50
+
41
51
  options?: ToastImperativeOptions
42
52
  }
43
53
 
44
- const [createImperativeToastContext, createImperativeToastScope] =
45
- createContextScope('ImperativeToast')
54
+ const ToastContext = createContext<ToastContextI>({} as any)
55
+ const ToastCurrentContext = createContext<ToastData | null>(null)
46
56
 
47
- const [ToastImperativeProviderProvider, useToastProviderContext] =
48
- createImperativeToastContext<ImperativeToastContextValue>('ToastImperativeProvider')
57
+ export const useToastController = () => {
58
+ return useContext(ToastContext)
59
+ }
49
60
 
50
- const useToast = () => {
51
- const context = useToastProviderContext('useToast', undefined)
61
+ export const useToastState = () => {
62
+ return useContext(ToastCurrentContext)
63
+ }
52
64
 
65
+ /** @deprecated use `useToastController` and `useToastState` instead to avoid performance pitfalls */
66
+ export const useToast = () => {
53
67
  return {
54
- /**
55
- * The currently displaying toast
56
- */
57
- currentToast: context.currentToast,
58
- /**
59
- * 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).
60
- */
61
- show: context.showToast,
62
- /**
63
- * Call it to hide the currently displayed toast.
64
- *
65
- * _NOTE_: does not work on Android native toasts
66
- *
67
- * _NOTE_: hides the last toast on web notification toasts
68
- */
69
- hide: context.hideToast,
68
+ ...useToastController(),
69
+ currentToast: useToastState(),
70
70
  }
71
71
  }
72
72
 
@@ -77,19 +77,21 @@ interface ToastImperativeProviderProps {
77
77
  */
78
78
  options: ToastImperativeOptions
79
79
  }
80
- const ToastImperativeProvider = ({
80
+
81
+ export const ToastImperativeProvider = ({
81
82
  children,
82
83
  options,
83
- __scopeToast,
84
- }: ScopedProps<ToastImperativeProviderProps>) => {
84
+ }: ToastImperativeProviderProps) => {
85
85
  const counterRef = useRef(0)
86
- const [toast, setToast] =
87
- React.useState<ImperativeToastContextValue['currentToast']>(null)
86
+
87
+ const [toast, setToast] = React.useState<ToastData | null>(null)
88
+
88
89
  const [lastNativeToastRef, setLastNativeToastRef] =
89
- React.useState<ImperativeToastContextValue['nativeToast']>(null)
90
- const showToast = React.useCallback<ImperativeToastContextValue['showToast']>(
91
- (title, showToastOptions) => {
92
- const native = showToastOptions?.native ?? options.native
90
+ React.useState<ToastContextI['nativeToast']>(null)
91
+
92
+ const show = React.useCallback<ToastContextI['show']>(
93
+ (title, showOptions) => {
94
+ const native = showOptions?.native ?? options.native
93
95
  const isWebNative = Array.isArray(native)
94
96
  ? native.includes('web')
95
97
  : native === 'web'
@@ -111,7 +113,7 @@ const ToastImperativeProvider = ({
111
113
  (Platform.OS === 'ios' && isIosNative)
112
114
 
113
115
  if (isHandledNatively) {
114
- const nativeToastResult = createNativeToast(title, showToastOptions ?? {})
116
+ const nativeToastResult = createNativeToast(title, showOptions ?? {})
115
117
  if (typeof nativeToastResult === 'object' && nativeToastResult.nativeToastRef) {
116
118
  setLastNativeToastRef(nativeToastResult.nativeToastRef)
117
119
  }
@@ -120,31 +122,36 @@ const ToastImperativeProvider = ({
120
122
  setToast({
121
123
  title,
122
124
  id: counterRef.current.toString(),
123
- ...showToastOptions,
125
+ ...showOptions,
124
126
  isHandledNatively,
125
127
  })
126
128
  return true
127
129
  },
128
130
  [setToast, options.native]
129
131
  )
130
- const hideToast = React.useCallback(() => {
132
+ const hide = React.useCallback(() => {
131
133
  lastNativeToastRef?.close()
132
134
  setToast(null)
133
135
  }, [setToast, lastNativeToastRef])
134
136
 
137
+ const contextValue = useMemo(() => {
138
+ return {
139
+ show,
140
+ hide,
141
+ nativeToast: lastNativeToastRef,
142
+ options,
143
+ }
144
+ }, [show, hide, lastNativeToastRef, JSON.stringify(options || null)])
145
+
146
+ const currentContextValue = useMemo(() => {}, [])
147
+
135
148
  return (
136
- <ToastImperativeProviderProvider
137
- scope={__scopeToast}
138
- showToast={showToast}
139
- hideToast={hideToast}
140
- currentToast={toast}
141
- nativeToast={lastNativeToastRef}
142
- options={options}
143
- >
144
- {children}
145
- </ToastImperativeProviderProvider>
149
+ <ToastContext.Provider value={contextValue}>
150
+ <ToastCurrentContext.Provider value={toast}>
151
+ {children}
152
+ </ToastCurrentContext.Provider>
153
+ </ToastContext.Provider>
146
154
  )
147
155
  }
148
156
 
149
- export { ToastImperativeProvider, useToast }
150
157
  export type { ToastImperativeProviderProps, ToastNativePlatform, ToastNativeValue }
@@ -5,7 +5,7 @@ export const createNativeToast: CreateNativeToastsFn = (
5
5
  { message, duration, burntOptions }
6
6
  ) => {
7
7
  // import inline to allow lazy usage of native dependecy:
8
- const Burnt: { toast: (options: BurntToastOptions) => any } = require('burnt')
8
+ const Burnt = require('burnt') as typeof import('burnt')
9
9
 
10
10
  Burnt.toast({
11
11
  title,
@@ -17,6 +17,6 @@ export const createNativeToast: CreateNativeToastsFn = (
17
17
  }
18
18
 
19
19
  export const hideNativeToast: HideNativeToastsFn = () => {
20
- const Burnt: { dismissAllAlerts: () => any } = require('burnt')
20
+ const Burnt = require('burnt') as typeof import('burnt')
21
21
  Burnt.dismissAllAlerts()
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../src/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,cAAc,EAOf,MAAM,eAAe,CAAA;AAItB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACtF,OAAO,EAGL,UAAU,EAEX,MAAM,aAAa,CAAA;AACpB,OAAO,EAEL,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAQnE,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;GAanB,CAAA;AACF,KAAK,iBAAiB,GAAG,QAAQ,CAAC,OAAO,eAAe,CAAC,CAAA;AACzD,KAAK,eAAe,GAAG,iBAAiB,GAAG,EAAE,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAxGT;;;;;WAKG;iBACM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QANf;;;;;WAKG;iBACM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0GhB,CAAA;AAID,OAAO,EACL,KAAK,EACL,aAAa,EACb,aAAa,EAEb,gBAAgB,EAEhB,QAAQ,GACT,CAAA;AACD,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAElB,gBAAgB,EAChB,mBAAmB,GACpB,CAAA"}
@@ -1,13 +1,12 @@
1
- import { Scope } from '@tamagui/create-context';
2
1
  import React from 'react';
3
- import { CreateNativeToastOptions, ToastNativePlatform, ToastNativeValue } from './types';
4
- interface ToastImperativeOptions extends Omit<CreateNativeToastOptions, "message"> {
2
+ import { CreateNativeToastOptions, NativeToastRef, ToastNativePlatform, ToastNativeValue } from './types';
3
+ interface ToastImperativeOptions extends Omit<CreateNativeToastOptions, 'message'> {
5
4
  /**
6
5
  * 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`.
7
6
  */
8
7
  native?: ToastNativeValue;
9
8
  }
10
- interface ShowToastOptions extends CreateNativeToastOptions {
9
+ interface ShowOptions extends CreateNativeToastOptions {
11
10
  /**
12
11
  * Used when need custom data
13
12
  */
@@ -17,24 +16,38 @@ interface ShowToastOptions extends CreateNativeToastOptions {
17
16
  */
18
17
  native?: ToastNativeValue;
19
18
  }
20
- type ScopedProps<P> = P & {
21
- __scopeToast?: Scope;
22
- };
23
19
  type ToastData = {
24
20
  title: string;
25
21
  id: string;
26
22
  } & CreateNativeToastOptions & {
27
23
  isHandledNatively: boolean;
28
24
  };
29
- declare const useToast: () => {
25
+ interface ToastContextI {
26
+ nativeToast: NativeToastRef | null;
30
27
  /**
31
- * The currently displaying toast
28
+ * 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).
32
29
  */
30
+ show: (title: string, options?: ShowOptions) => boolean;
31
+ /**
32
+ * Call it to hide the currently displayed toast.
33
+ *
34
+ * _NOTE_: does not work on Android native toasts
35
+ *
36
+ * _NOTE_: hides the last toast on web notification toasts
37
+ */
38
+ hide: () => void;
39
+ options?: ToastImperativeOptions;
40
+ }
41
+ export declare const useToastController: () => ToastContextI;
42
+ export declare const useToastState: () => ToastData | null;
43
+ /** @deprecated use `useToastController` and `useToastState` instead to avoid performance pitfalls */
44
+ export declare const useToast: () => {
33
45
  currentToast: ToastData | null;
46
+ nativeToast: NativeToastRef | null;
34
47
  /**
35
48
  * 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).
36
49
  */
37
- show: (title: string, options?: ShowToastOptions) => boolean;
50
+ show: (title: string, options?: ShowOptions) => boolean;
38
51
  /**
39
52
  * Call it to hide the currently displayed toast.
40
53
  *
@@ -43,6 +56,7 @@ declare const useToast: () => {
43
56
  * _NOTE_: hides the last toast on web notification toasts
44
57
  */
45
58
  hide: () => void;
59
+ options?: ToastImperativeOptions | undefined;
46
60
  };
47
61
  interface ToastImperativeProviderProps {
48
62
  children: React.ReactNode;
@@ -51,7 +65,6 @@ interface ToastImperativeProviderProps {
51
65
  */
52
66
  options: ToastImperativeOptions;
53
67
  }
54
- declare const ToastImperativeProvider: ({ children, options, __scopeToast, }: ScopedProps<ToastImperativeProviderProps>) => JSX.Element;
55
- export { ToastImperativeProvider, useToast };
68
+ export declare const ToastImperativeProvider: ({ children, options, }: ToastImperativeProviderProps) => JSX.Element;
56
69
  export type { ToastImperativeProviderProps, ToastNativePlatform, ToastNativeValue };
57
70
  //# sourceMappingURL=ToastImperative.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToastImperative.d.ts","sourceRoot":"","sources":["../src/ToastImperative.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAsB,MAAM,yBAAyB,CAAA;AACnE,OAAO,KAAiB,MAAM,OAAO,CAAA;AAIrC,OAAO,EACL,wBAAwB,EAExB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAEhB,UAAU,sBAAuB,SAAQ,IAAI,CAAC,wBAAwB,EAAE,SAAS,CAAC;IAChF;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAC1B;AACD,UAAU,gBAAiB,SAAQ,wBAAwB;IACzD;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAC1B;AACD,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,YAAY,CAAC,EAAE,KAAK,CAAA;CAAE,CAAA;AAElD,KAAK,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,wBAAwB,GAAG;IACxE,iBAAiB,EAAE,OAAO,CAAA;CAC3B,CAAA;AAgBH,QAAA,MAAM,QAAQ;IAIV;;OAEG;;IAEH;;OAEG;kBArBc,MAAM,YAAY,gBAAgB,KAAK,OAAO;IAuB/D;;;;;;OAMG;gBA5BY,IAAI;CA+BtB,CAAA;AAED,UAAU,4BAA4B;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,OAAO,EAAE,sBAAsB,CAAA;CAChC;AACD,QAAA,MAAM,uBAAuB,yCAI1B,YAAY,4BAA4B,CAAC,gBA+D3C,CAAA;AAED,OAAO,EAAE,uBAAuB,EAAE,QAAQ,E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