@fluentui/react-toast 9.3.3 → 9.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.json +133 -1
  2. package/CHANGELOG.md +37 -2
  3. package/lib/components/AriaLive/useAriaLive.js +3 -5
  4. package/lib/components/AriaLive/useAriaLive.js.map +1 -1
  5. package/lib/components/ToastContainer/useToastContainer.js +12 -12
  6. package/lib/components/ToastContainer/useToastContainer.js.map +1 -1
  7. package/lib/components/ToastTrigger/useToastTrigger.js +5 -6
  8. package/lib/components/ToastTrigger/useToastTrigger.js.map +1 -1
  9. package/lib/components/Toaster/useToaster.js +2 -2
  10. package/lib/components/Toaster/useToaster.js.map +1 -1
  11. package/lib/contexts/toastContainerContext.js +4 -2
  12. package/lib/contexts/toastContainerContext.js.map +1 -1
  13. package/lib/state/useToastController.js +1 -2
  14. package/lib/state/useToastController.js.map +1 -1
  15. package/lib/state/useToaster.js +8 -12
  16. package/lib/state/useToaster.js.map +1 -1
  17. package/lib/state/vanilla/createToaster.js +4 -4
  18. package/lib/state/vanilla/createToaster.js.map +1 -1
  19. package/lib-commonjs/components/AriaLive/useAriaLive.js +3 -5
  20. package/lib-commonjs/components/AriaLive/useAriaLive.js.map +1 -1
  21. package/lib-commonjs/components/ToastContainer/useToastContainer.js +12 -12
  22. package/lib-commonjs/components/ToastContainer/useToastContainer.js.map +1 -1
  23. package/lib-commonjs/components/ToastTrigger/useToastTrigger.js +5 -6
  24. package/lib-commonjs/components/ToastTrigger/useToastTrigger.js.map +1 -1
  25. package/lib-commonjs/components/Toaster/useToaster.js +2 -2
  26. package/lib-commonjs/components/Toaster/useToaster.js.map +1 -1
  27. package/lib-commonjs/contexts/toastContainerContext.js +4 -2
  28. package/lib-commonjs/contexts/toastContainerContext.js.map +1 -1
  29. package/lib-commonjs/state/useToastController.js +1 -2
  30. package/lib-commonjs/state/useToastController.js.map +1 -1
  31. package/lib-commonjs/state/useToaster.js +8 -12
  32. package/lib-commonjs/state/useToaster.js.map +1 -1
  33. package/lib-commonjs/state/vanilla/createToaster.js +4 -4
  34. package/lib-commonjs/state/vanilla/createToaster.js.map +1 -1
  35. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"sources":["useToastController.js"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { dispatchToast as dispatchToastVanilla, dismissToast as dismissToastVanilla, dismissAllToasts as dismissAllToastsVanilla, updateToast as updateToastVanilla, playToast as playToastVanilla, pauseToast as pauseToastVanilla } from './vanilla';\nconst noop = ()=>undefined;\n/**\n * @param toasterId - If an id is provided all imperative methods control that specific toaster\n * @returns Imperative methods to control toasts\n */ export function useToastController(toasterId) {\n const { targetDocument } = useFluent();\n return React.useMemo(()=>{\n if (!targetDocument) {\n return {\n dispatchToast: noop,\n dismissToast: noop,\n dismissAllToasts: noop,\n updateToast: noop,\n pauseToast: noop,\n playToast: noop\n };\n }\n return {\n dispatchToast: (content, options)=>{\n var _options;\n dispatchToastVanilla(content, {\n ...options,\n toasterId,\n data: {\n root: (_options = options) === null || _options === void 0 ? void 0 : _options.root\n }\n }, targetDocument);\n },\n dismissToast: (toastId)=>{\n dismissToastVanilla(toastId, toasterId, targetDocument);\n },\n dismissAllToasts: ()=>{\n dismissAllToastsVanilla(toasterId, targetDocument);\n },\n updateToast: (options)=>{\n updateToastVanilla({\n ...options,\n data: {\n root: options.root\n },\n toasterId\n }, targetDocument);\n },\n pauseToast: (toastId)=>{\n pauseToastVanilla(toastId, toasterId, targetDocument);\n },\n playToast: (toastId)=>{\n playToastVanilla(toastId, toasterId, targetDocument);\n }\n };\n }, [\n targetDocument,\n toasterId\n ]);\n}\n"],"names":["useToastController","noop","undefined","toasterId","targetDocument","useFluent","React","useMemo","dispatchToast","dismissToast","dismissAllToasts","updateToast","pauseToast","playToast","content","options","_options","dispatchToastVanilla","data","root","toastId","dismissToastVanilla","dismissAllToastsVanilla","updateToastVanilla","pauseToastVanilla","playToastVanilla"],"mappings":";;;;+BAOoBA;;;eAAAA;;;;iEAPG;qCACyB;yBAC2L;AAC3O,MAAMC,OAAO,IAAIC;AAIN,SAASF,mBAAmBG,SAAS;IAC5C,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,OAAOC,OAAMC,OAAO,CAAC;QACjB,IAAI,CAACH,gBAAgB;YACjB,OAAO;gBACHI,eAAeP;gBACfQ,cAAcR;gBACdS,kBAAkBT;gBAClBU,aAAaV;gBACbW,YAAYX;gBACZY,WAAWZ;YACf;QACJ;QACA,OAAO;YACHO,eAAe,CAACM,SAASC;gBACrB,IAAIC;gBACJC,IAAAA,sBAAoB,EAACH,SAAS;oBAC1B,GAAGC,OAAO;oBACVZ;oBACAe,MAAM;wBACFC,MAAM,AAACH,CAAAA,WAAWD,OAAM,MAAO,QAAQC,aAAa,KAAK,IAAI,KAAK,IAAIA,SAASG,IAAI;oBACvF;gBACJ,GAAGf;YACP;YACAK,cAAc,CAACW;gBACXC,IAAAA,qBAAmB,EAACD,SAASjB,WAAWC;YAC5C;YACAM,kBAAkB;gBACdY,IAAAA,yBAAuB,EAACnB,WAAWC;YACvC;YACAO,aAAa,CAACI;gBACVQ,IAAAA,oBAAkB,EAAC;oBACf,GAAGR,OAAO;oBACVG,MAAM;wBACFC,MAAMJ,QAAQI,IAAI;oBACtB;oBACAhB;gBACJ,GAAGC;YACP;YACAQ,YAAY,CAACQ;gBACTI,IAAAA,mBAAiB,EAACJ,SAASjB,WAAWC;YAC1C;YACAS,WAAW,CAACO;gBACRK,IAAAA,kBAAgB,EAACL,SAASjB,WAAWC;YACzC;QACJ;IACJ,GAAG;QACCA;QACAD;KACH;AACL"}
1
+ {"version":3,"sources":["useToastController.js"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { dispatchToast as dispatchToastVanilla, dismissToast as dismissToastVanilla, dismissAllToasts as dismissAllToastsVanilla, updateToast as updateToastVanilla, playToast as playToastVanilla, pauseToast as pauseToastVanilla } from './vanilla';\nconst noop = ()=>undefined;\n/**\n * @param toasterId - If an id is provided all imperative methods control that specific toaster\n * @returns Imperative methods to control toasts\n */ export function useToastController(toasterId) {\n const { targetDocument } = useFluent();\n return React.useMemo(()=>{\n if (!targetDocument) {\n return {\n dispatchToast: noop,\n dismissToast: noop,\n dismissAllToasts: noop,\n updateToast: noop,\n pauseToast: noop,\n playToast: noop\n };\n }\n return {\n dispatchToast: (content, options)=>{\n dispatchToastVanilla(content, {\n ...options,\n toasterId,\n data: {\n root: options === null || options === void 0 ? void 0 : options.root\n }\n }, targetDocument);\n },\n dismissToast: (toastId)=>{\n dismissToastVanilla(toastId, toasterId, targetDocument);\n },\n dismissAllToasts: ()=>{\n dismissAllToastsVanilla(toasterId, targetDocument);\n },\n updateToast: (options)=>{\n updateToastVanilla({\n ...options,\n data: {\n root: options.root\n },\n toasterId\n }, targetDocument);\n },\n pauseToast: (toastId)=>{\n pauseToastVanilla(toastId, toasterId, targetDocument);\n },\n playToast: (toastId)=>{\n playToastVanilla(toastId, toasterId, targetDocument);\n }\n };\n }, [\n targetDocument,\n toasterId\n ]);\n}\n"],"names":["useToastController","noop","undefined","toasterId","targetDocument","useFluent","React","useMemo","dispatchToast","dismissToast","dismissAllToasts","updateToast","pauseToast","playToast","content","options","dispatchToastVanilla","data","root","toastId","dismissToastVanilla","dismissAllToastsVanilla","updateToastVanilla","pauseToastVanilla","playToastVanilla"],"mappings":";;;;+BAOoBA;;;eAAAA;;;;iEAPG;qCACyB;yBAC2L;AAC3O,MAAMC,OAAO,IAAIC;AAIN,SAASF,mBAAmBG,SAAS;IAC5C,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,OAAOC,OAAMC,OAAO,CAAC;QACjB,IAAI,CAACH,gBAAgB;YACjB,OAAO;gBACHI,eAAeP;gBACfQ,cAAcR;gBACdS,kBAAkBT;gBAClBU,aAAaV;gBACbW,YAAYX;gBACZY,WAAWZ;YACf;QACJ;QACA,OAAO;YACHO,eAAe,CAACM,SAASC;gBACrBC,IAAAA,sBAAoB,EAACF,SAAS;oBAC1B,GAAGC,OAAO;oBACVZ;oBACAc,MAAM;wBACFC,MAAMH,YAAY,QAAQA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQG,IAAI;oBACxE;gBACJ,GAAGd;YACP;YACAK,cAAc,CAACU;gBACXC,IAAAA,qBAAmB,EAACD,SAAShB,WAAWC;YAC5C;YACAM,kBAAkB;gBACdW,IAAAA,yBAAuB,EAAClB,WAAWC;YACvC;YACAO,aAAa,CAACI;gBACVO,IAAAA,oBAAkB,EAAC;oBACf,GAAGP,OAAO;oBACVE,MAAM;wBACFC,MAAMH,QAAQG,IAAI;oBACtB;oBACAf;gBACJ,GAAGC;YACP;YACAQ,YAAY,CAACO;gBACTI,IAAAA,mBAAiB,EAACJ,SAAShB,WAAWC;YAC1C;YACAS,WAAW,CAACM;gBACRK,IAAAA,kBAAgB,EAACL,SAAShB,WAAWC;YACzC;QACJ;IACJ,GAAG;QACCA;QACAD;KACH;AACL"}
@@ -25,32 +25,30 @@ function useToaster(options = {}) {
25
25
  return toasterId === userToasterId;
26
26
  });
27
27
  const isFocusShortcut = (0, _reactutilities.useEventCallback)((e)=>{
28
- var _shortcuts;
29
- if ((_shortcuts = shortcuts) === null || _shortcuts === void 0 ? void 0 : _shortcuts.focus) {
28
+ if (shortcuts === null || shortcuts === void 0 ? void 0 : shortcuts.focus) {
30
29
  return shortcuts.focus(e);
31
30
  }
32
31
  });
33
32
  const pauseAllToasts = _react.useCallback(()=>{
34
33
  toaster.visibleToasts.forEach((toastId)=>{
35
- var _toast_imperativeRef_current, _toast;
34
+ var _toast_imperativeRef_current;
36
35
  const toast = toaster.toasts.get(toastId);
37
- (_toast = toast) === null || _toast === void 0 ? void 0 : (_toast_imperativeRef_current = _toast.imperativeRef.current) === null || _toast_imperativeRef_current === void 0 ? void 0 : _toast_imperativeRef_current.pause();
36
+ toast === null || toast === void 0 ? void 0 : (_toast_imperativeRef_current = toast.imperativeRef.current) === null || _toast_imperativeRef_current === void 0 ? void 0 : _toast_imperativeRef_current.pause();
38
37
  });
39
38
  }, [
40
39
  toaster
41
40
  ]);
42
41
  const playAllToasts = _react.useCallback(()=>{
43
42
  toaster.visibleToasts.forEach((toastId)=>{
44
- var _toast_imperativeRef_current, _toast;
43
+ var _toast_imperativeRef_current;
45
44
  const toast = toaster.toasts.get(toastId);
46
- (_toast = toast) === null || _toast === void 0 ? void 0 : (_toast_imperativeRef_current = _toast.imperativeRef.current) === null || _toast_imperativeRef_current === void 0 ? void 0 : _toast_imperativeRef_current.play();
45
+ toast === null || toast === void 0 ? void 0 : (_toast_imperativeRef_current = toast.imperativeRef.current) === null || _toast_imperativeRef_current === void 0 ? void 0 : _toast_imperativeRef_current.play();
47
46
  });
48
47
  }, [
49
48
  toaster
50
49
  ]);
51
50
  const getMostRecentVisibleToast = _react.useCallback(()=>{
52
51
  return Array.from(toaster.visibleToasts).reduce((cur, next)=>{
53
- var _toast;
54
52
  const toast = toaster.toasts.get(next);
55
53
  if (!toast) {
56
54
  return cur;
@@ -58,7 +56,7 @@ function useToaster(options = {}) {
58
56
  if (!cur) {
59
57
  return toast;
60
58
  }
61
- if (cur.order < ((_toast = toast) === null || _toast === void 0 ? void 0 : _toast.order)) {
59
+ if (cur.order < (toast === null || toast === void 0 ? void 0 : toast.order)) {
62
60
  return toast;
63
61
  }
64
62
  return cur;
@@ -67,9 +65,8 @@ function useToaster(options = {}) {
67
65
  toaster
68
66
  ]);
69
67
  const tryRestoreFocus = _react.useCallback(()=>{
70
- var _mostRecentToast;
71
68
  const mostRecentToast = getMostRecentVisibleToast();
72
- if ((_mostRecentToast = mostRecentToast) === null || _mostRecentToast === void 0 ? void 0 : _mostRecentToast.imperativeRef.current) {
69
+ if (mostRecentToast === null || mostRecentToast === void 0 ? void 0 : mostRecentToast.imperativeRef.current) {
73
70
  mostRecentToast.imperativeRef.current.focus();
74
71
  } else {
75
72
  var _lastActiveElementRef_current;
@@ -81,9 +78,8 @@ function useToaster(options = {}) {
81
78
  ]);
82
79
  const closeAllToasts = _react.useCallback(()=>{
83
80
  toaster.visibleToasts.forEach((toastId)=>{
84
- var _toast;
85
81
  const toast = toaster.toasts.get(toastId);
86
- (_toast = toast) === null || _toast === void 0 ? void 0 : _toast.close();
82
+ toast === null || toast === void 0 ? void 0 : toast.close();
87
83
  });
88
84
  tryRestoreFocus();
89
85
  }, [
@@ -1 +1 @@
1
- {"version":3,"sources":["useToaster.js"],"sourcesContent":["import * as React from 'react';\nimport { isHTMLElement, useEventCallback, useForceUpdate } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { createToaster } from './vanilla';\nimport { EVENTS } from './constants';\nexport function useToaster(options = {}) {\n const forceUpdate = useForceUpdate();\n const { toasterId: userToasterId, shortcuts } = options;\n // Currently the toaster options can never be changed at runtime\n const [toaster] = React.useState(()=>createToaster(options));\n const { targetDocument } = useFluent();\n const lastActiveElementRef = React.useRef(null);\n const isCorrectToaster = useEventCallback((toasterId)=>{\n return toasterId === userToasterId;\n });\n const isFocusShortcut = useEventCallback((e)=>{\n var _shortcuts;\n if ((_shortcuts = shortcuts) === null || _shortcuts === void 0 ? void 0 : _shortcuts.focus) {\n return shortcuts.focus(e);\n }\n });\n const pauseAllToasts = React.useCallback(()=>{\n toaster.visibleToasts.forEach((toastId)=>{\n var _toast_imperativeRef_current, _toast;\n const toast = toaster.toasts.get(toastId);\n (_toast = toast) === null || _toast === void 0 ? void 0 : (_toast_imperativeRef_current = _toast.imperativeRef.current) === null || _toast_imperativeRef_current === void 0 ? void 0 : _toast_imperativeRef_current.pause();\n });\n }, [\n toaster\n ]);\n const playAllToasts = React.useCallback(()=>{\n toaster.visibleToasts.forEach((toastId)=>{\n var _toast_imperativeRef_current, _toast;\n const toast = toaster.toasts.get(toastId);\n (_toast = toast) === null || _toast === void 0 ? void 0 : (_toast_imperativeRef_current = _toast.imperativeRef.current) === null || _toast_imperativeRef_current === void 0 ? void 0 : _toast_imperativeRef_current.play();\n });\n }, [\n toaster\n ]);\n const getMostRecentVisibleToast = React.useCallback(()=>{\n return Array.from(toaster.visibleToasts).reduce((cur, next)=>{\n var _toast;\n const toast = toaster.toasts.get(next);\n if (!toast) {\n return cur;\n }\n if (!cur) {\n return toast;\n }\n if (cur.order < ((_toast = toast) === null || _toast === void 0 ? void 0 : _toast.order)) {\n return toast;\n }\n return cur;\n }, undefined);\n }, [\n toaster\n ]);\n const tryRestoreFocus = React.useCallback(()=>{\n var _mostRecentToast;\n const mostRecentToast = getMostRecentVisibleToast();\n if ((_mostRecentToast = mostRecentToast) === null || _mostRecentToast === void 0 ? void 0 : _mostRecentToast.imperativeRef.current) {\n mostRecentToast.imperativeRef.current.focus();\n } else {\n var _lastActiveElementRef_current;\n (_lastActiveElementRef_current = lastActiveElementRef.current) === null || _lastActiveElementRef_current === void 0 ? void 0 : _lastActiveElementRef_current.focus();\n lastActiveElementRef.current = null;\n }\n }, [\n getMostRecentVisibleToast\n ]);\n const closeAllToasts = React.useCallback(()=>{\n toaster.visibleToasts.forEach((toastId)=>{\n var _toast;\n const toast = toaster.toasts.get(toastId);\n (_toast = toast) === null || _toast === void 0 ? void 0 : _toast.close();\n });\n tryRestoreFocus();\n }, [\n toaster,\n tryRestoreFocus\n ]);\n React.useEffect(()=>{\n if (!targetDocument) {\n return;\n }\n const addToastListener = (eventType, callback)=>{\n const listener = (e)=>{\n if (!isCorrectToaster(e.detail.toasterId)) {\n return;\n }\n callback(e);\n forceUpdate();\n };\n targetDocument.addEventListener(eventType, listener);\n return ()=>targetDocument.removeEventListener(eventType, listener);\n };\n const buildToast = (e)=>{\n toaster.buildToast(e.detail, forceUpdate);\n };\n const dismissToast = (e)=>{\n toaster.dismissToast(e.detail.toastId);\n };\n const updateToast = (e)=>{\n toaster.updateToast(e.detail);\n };\n const dismissAllToasts = (e)=>{\n toaster.dismissAllToasts();\n };\n const pauseToast = (e)=>{\n const toast = toaster.toasts.get(e.detail.toastId);\n if (toast) {\n var _toast_imperativeRef_current;\n (_toast_imperativeRef_current = toast.imperativeRef.current) === null || _toast_imperativeRef_current === void 0 ? void 0 : _toast_imperativeRef_current.pause();\n }\n };\n const playToast = (e)=>{\n const toast = toaster.toasts.get(e.detail.toastId);\n if (toast) {\n var _toast_imperativeRef_current;\n (_toast_imperativeRef_current = toast.imperativeRef.current) === null || _toast_imperativeRef_current === void 0 ? void 0 : _toast_imperativeRef_current.play();\n }\n };\n const cleanupBuildListener = addToastListener(EVENTS.show, buildToast);\n const cleanupUpdateListener = addToastListener(EVENTS.update, updateToast);\n const cleanupDismissListener = addToastListener(EVENTS.dismiss, dismissToast);\n const cleanupDismissAllListener = addToastListener(EVENTS.dismissAll, dismissAllToasts);\n const cleanupPauseListener = addToastListener(EVENTS.pause, pauseToast);\n const cleanupPlayListener = addToastListener(EVENTS.play, playToast);\n const focusShortcutListener = (e)=>{\n if (isFocusShortcut(e)) {\n pauseAllToasts();\n const mostRecentToast = getMostRecentVisibleToast();\n if (mostRecentToast) {\n var _mostRecentToast_imperativeRef_current;\n lastActiveElementRef.current = isHTMLElement(targetDocument.activeElement) ? targetDocument.activeElement : null;\n (_mostRecentToast_imperativeRef_current = mostRecentToast.imperativeRef.current) === null || _mostRecentToast_imperativeRef_current === void 0 ? void 0 : _mostRecentToast_imperativeRef_current.focus();\n }\n }\n };\n targetDocument.addEventListener('keydown', focusShortcutListener);\n return ()=>{\n cleanupBuildListener();\n cleanupDismissAllListener();\n cleanupUpdateListener();\n cleanupDismissListener();\n cleanupPauseListener();\n cleanupPlayListener();\n targetDocument.removeEventListener('keydown', focusShortcutListener);\n };\n }, [\n toaster,\n forceUpdate,\n targetDocument,\n isCorrectToaster,\n pauseAllToasts,\n getMostRecentVisibleToast,\n isFocusShortcut\n ]);\n const toastsToRender = (()=>{\n if (!toaster) {\n return new Map();\n }\n const toRender = new Map();\n const toasts = Array.from(toaster.toasts.values());\n toasts.forEach((toast)=>{\n const { position } = toast;\n toRender.has(position) || toRender.set(position, []);\n if (position.startsWith('bottom')) {\n toRender.get(position).push(toast);\n } else {\n toRender.get(position).unshift(toast);\n }\n });\n return toRender;\n })();\n return {\n isToastVisible: toaster.isToastVisible,\n toastsToRender,\n pauseAllToasts,\n playAllToasts,\n tryRestoreFocus,\n closeAllToasts\n };\n}\n"],"names":["useToaster","options","forceUpdate","useForceUpdate","toasterId","userToasterId","shortcuts","toaster","React","useState","createToaster","targetDocument","useFluent","lastActiveElementRef","useRef","isCorrectToaster","useEventCallback","isFocusShortcut","e","_shortcuts","focus","pauseAllToasts","useCallback","visibleToasts","forEach","toastId","_toast_imperativeRef_current","_toast","toast","toasts","get","imperativeRef","current","pause","playAllToasts","play","getMostRecentVisibleToast","Array","from","reduce","cur","next","order","undefined","tryRestoreFocus","_mostRecentToast","mostRecentToast","_lastActiveElementRef_current","closeAllToasts","close","useEffect","addToastListener","eventType","callback","listener","detail","addEventListener","removeEventListener","buildToast","dismissToast","updateToast","dismissAllToasts","pauseToast","playToast","cleanupBuildListener","EVENTS","show","cleanupUpdateListener","update","cleanupDismissListener","dismiss","cleanupDismissAllListener","dismissAll","cleanupPauseListener","cleanupPlayListener","focusShortcutListener","_mostRecentToast_imperativeRef_current","isHTMLElement","activeElement","toastsToRender","Map","toRender","values","position","has","set","startsWith","push","unshift","isToastVisible"],"mappings":";;;;+BAKgBA;;;eAAAA;;;;iEALO;gCACyC;qCAChB;yBAClB;2BACP;AAChB,SAASA,WAAWC,UAAU,CAAC,CAAC;IACnC,MAAMC,cAAcC,IAAAA,8BAAc;IAClC,MAAM,EAAEC,WAAWC,aAAa,EAAEC,SAAS,EAAE,GAAGL;IAChD,gEAAgE;IAChE,MAAM,CAACM,QAAQ,GAAGC,OAAMC,QAAQ,CAAC,IAAIC,IAAAA,sBAAa,EAACT;IACnD,MAAM,EAAEU,cAAc,EAAE,GAAG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ACA,OAAOqD;IACX,CAAA;IACA,OAAO;QACHQ,gBAAgBlF,QAAQkF,cAAc;QACtCV;QACA1D;QACAa;QACAU;QACAI;IACJ;AACJ"}
1
+ {"version":3,"sources":["useToaster.js"],"sourcesContent":["import * as React from 'react';\nimport { isHTMLElement, useEventCallback, useForceUpdate } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { createToaster } from './vanilla';\nimport { EVENTS } from './constants';\nexport function useToaster(options = {}) {\n const forceUpdate = useForceUpdate();\n const { toasterId: userToasterId, shortcuts } = options;\n // Currently the toaster options can never be changed at runtime\n const [toaster] = React.useState(()=>createToaster(options));\n const { targetDocument } = useFluent();\n const lastActiveElementRef = React.useRef(null);\n const isCorrectToaster = useEventCallback((toasterId)=>{\n return toasterId === userToasterId;\n });\n const isFocusShortcut = useEventCallback((e)=>{\n if (shortcuts === null || shortcuts === void 0 ? void 0 : shortcuts.focus) {\n return shortcuts.focus(e);\n }\n });\n const pauseAllToasts = React.useCallback(()=>{\n toaster.visibleToasts.forEach((toastId)=>{\n var _toast_imperativeRef_current;\n const toast = toaster.toasts.get(toastId);\n toast === null || toast === void 0 ? void 0 : (_toast_imperativeRef_current = toast.imperativeRef.current) === null || _toast_imperativeRef_current === void 0 ? void 0 : _toast_imperativeRef_current.pause();\n });\n }, [\n toaster\n ]);\n const playAllToasts = React.useCallback(()=>{\n toaster.visibleToasts.forEach((toastId)=>{\n var _toast_imperativeRef_current;\n const toast = toaster.toasts.get(toastId);\n toast === null || toast === void 0 ? void 0 : (_toast_imperativeRef_current = toast.imperativeRef.current) === null || _toast_imperativeRef_current === void 0 ? void 0 : _toast_imperativeRef_current.play();\n });\n }, [\n toaster\n ]);\n const getMostRecentVisibleToast = React.useCallback(()=>{\n return Array.from(toaster.visibleToasts).reduce((cur, next)=>{\n const toast = toaster.toasts.get(next);\n if (!toast) {\n return cur;\n }\n if (!cur) {\n return toast;\n }\n if (cur.order < (toast === null || toast === void 0 ? void 0 : toast.order)) {\n return toast;\n }\n return cur;\n }, undefined);\n }, [\n toaster\n ]);\n const tryRestoreFocus = React.useCallback(()=>{\n const mostRecentToast = getMostRecentVisibleToast();\n if (mostRecentToast === null || mostRecentToast === void 0 ? void 0 : mostRecentToast.imperativeRef.current) {\n mostRecentToast.imperativeRef.current.focus();\n } else {\n var _lastActiveElementRef_current;\n (_lastActiveElementRef_current = lastActiveElementRef.current) === null || _lastActiveElementRef_current === void 0 ? void 0 : _lastActiveElementRef_current.focus();\n lastActiveElementRef.current = null;\n }\n }, [\n getMostRecentVisibleToast\n ]);\n const closeAllToasts = React.useCallback(()=>{\n toaster.visibleToasts.forEach((toastId)=>{\n const toast = toaster.toasts.get(toastId);\n toast === null || toast === void 0 ? void 0 : toast.close();\n });\n tryRestoreFocus();\n }, [\n toaster,\n tryRestoreFocus\n ]);\n React.useEffect(()=>{\n if (!targetDocument) {\n return;\n }\n const addToastListener = (eventType, callback)=>{\n const listener = (e)=>{\n if (!isCorrectToaster(e.detail.toasterId)) {\n return;\n }\n callback(e);\n forceUpdate();\n };\n targetDocument.addEventListener(eventType, listener);\n return ()=>targetDocument.removeEventListener(eventType, listener);\n };\n const buildToast = (e)=>{\n toaster.buildToast(e.detail, forceUpdate);\n };\n const dismissToast = (e)=>{\n toaster.dismissToast(e.detail.toastId);\n };\n const updateToast = (e)=>{\n toaster.updateToast(e.detail);\n };\n const dismissAllToasts = (e)=>{\n toaster.dismissAllToasts();\n };\n const pauseToast = (e)=>{\n const toast = toaster.toasts.get(e.detail.toastId);\n if (toast) {\n var _toast_imperativeRef_current;\n (_toast_imperativeRef_current = toast.imperativeRef.current) === null || _toast_imperativeRef_current === void 0 ? void 0 : _toast_imperativeRef_current.pause();\n }\n };\n const playToast = (e)=>{\n const toast = toaster.toasts.get(e.detail.toastId);\n if (toast) {\n var _toast_imperativeRef_current;\n (_toast_imperativeRef_current = toast.imperativeRef.current) === null || _toast_imperativeRef_current === void 0 ? void 0 : _toast_imperativeRef_current.play();\n }\n };\n const cleanupBuildListener = addToastListener(EVENTS.show, buildToast);\n const cleanupUpdateListener = addToastListener(EVENTS.update, updateToast);\n const cleanupDismissListener = addToastListener(EVENTS.dismiss, dismissToast);\n const cleanupDismissAllListener = addToastListener(EVENTS.dismissAll, dismissAllToasts);\n const cleanupPauseListener = addToastListener(EVENTS.pause, pauseToast);\n const cleanupPlayListener = addToastListener(EVENTS.play, playToast);\n const focusShortcutListener = (e)=>{\n if (isFocusShortcut(e)) {\n pauseAllToasts();\n const mostRecentToast = getMostRecentVisibleToast();\n if (mostRecentToast) {\n var _mostRecentToast_imperativeRef_current;\n lastActiveElementRef.current = isHTMLElement(targetDocument.activeElement) ? targetDocument.activeElement : null;\n (_mostRecentToast_imperativeRef_current = mostRecentToast.imperativeRef.current) === null || _mostRecentToast_imperativeRef_current === void 0 ? void 0 : _mostRecentToast_imperativeRef_current.focus();\n }\n }\n };\n targetDocument.addEventListener('keydown', focusShortcutListener);\n return ()=>{\n cleanupBuildListener();\n cleanupDismissAllListener();\n cleanupUpdateListener();\n cleanupDismissListener();\n cleanupPauseListener();\n cleanupPlayListener();\n targetDocument.removeEventListener('keydown', focusShortcutListener);\n };\n }, [\n toaster,\n forceUpdate,\n targetDocument,\n isCorrectToaster,\n pauseAllToasts,\n getMostRecentVisibleToast,\n isFocusShortcut\n ]);\n const toastsToRender = (()=>{\n if (!toaster) {\n return new Map();\n }\n const toRender = new Map();\n const toasts = Array.from(toaster.toasts.values());\n toasts.forEach((toast)=>{\n const { position } = toast;\n toRender.has(position) || toRender.set(position, []);\n if (position.startsWith('bottom')) {\n toRender.get(position).push(toast);\n } else {\n toRender.get(position).unshift(toast);\n }\n });\n return toRender;\n })();\n return {\n isToastVisible: toaster.isToastVisible,\n toastsToRender,\n pauseAllToasts,\n playAllToasts,\n tryRestoreFocus,\n closeAllToasts\n };\n}\n"],"names":["useToaster","options","forceUpdate","useForceUpdate","toasterId","userToasterId","shortcuts","toaster","React","useState","createToaster","targetDocument","useFluent","lastActiveElementRef","useRef","isCorrectToaster","useEventCallback","isFocusShortcut","e","focus","pauseAllToasts","useCallback","visibleToasts","forEach","toastId","_toast_imperativeRef_current","toast","toasts","get","imperativeRef","current","pause","playAllToasts","play","getMostRecentVisibleToast","Array","from","reduce","cur","next","order","undefined","tryRestoreFocus","mostRecentToast","_lastActiveElementRef_current","closeAllToasts","close","useEffect","addToastListener","eventType","callback","listener","detail","addEventListener","removeEventListener","buildToast","dismissToast","updateToast","dismissAllToasts","pauseToast","playToast","cleanupBuildListener","EVENTS","show","cleanupUpdateListener","update","cleanupDismissListener","dismiss","cleanupDismissAllListener","dismissAll","cleanupPauseListener","cleanupPlayListener","focusShortcutListener","_mostRecentToast_imperativeRef_current","isHTMLElement","activeElement","toastsToRender","Map","toRender","values","position","has","set","startsWith","push","unshift","isToastVisible"],"mappings":";;;;+BAKgBA;;;eAAAA;;;;iEALO;gCACyC;qCAChB;yBAClB;2BACP;AAChB,SAASA,WAAWC,UAAU,CAAC,CAAC;IACnC,MAAMC,cAAcC,IAAAA,8BAAc;IAClC,MAAM,EAAEC,WAAWC,aAAa,EAAEC,SAAS,EAAE,GAAGL;IAChD,gEAAgE;IAChE,MAAM,CAACM,QAAQ,GAAGC,OAAMC,QAAQ,CAAC,IAAIC,IAAAA,sBAAa,EAACT;IACnD,MAAM,EAAEU,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,MAAMC,uBAAuBL,OAAMM,MAAM,CAAC;IAC1C,MAAMC,mBAAmBC,IAAAA,gCAAgB,EAAC,CAACZ;QACvC,OAAOA,cAAcC;IACzB;IACA,MAAMY,kBAAkBD,IAAAA,gCAAgB,EAAC,CAACE;QACtC,IAAIZ,cAAc,QAAQA,cAAc,KAAK,IAAI,KAAK,IAAIA,UAAUa,KAAK,EAAE;YACvE,OAAOb,UAAUa,KAAK,CAACD;QAC3B;IACJ;IACA,MAAME,iBAAiBZ,OAAMa,WAAW,CAAC;QACrCd,QAAQe,aAAa,CAACC,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WmB;QAC3C,OAAO;YACHX;YACAO;YACAJ;YACAE;YACAI;YACAC;YACA5D,eAAe2C,mBAAmB,CAAC,WAAWkB;QAClD;IACJ,GAAG;QACCjE;QACAL;QACAS;QACAI;QACAK;QACAc;QACAjB;KACH;IACD,MAAM2D,iBAAiB,AAAC,CAAA;QACpB,IAAI,CAACrE,SAAS;YACV,OAAO,IAAIsE;QACf;QACA,MAAMC,WAAW,IAAID;QACrB,MAAMlD,SAASQ,MAAMC,IAAI,CAAC7B,QAAQoB,MAAM,CAACoD,MAAM;QAC/CpD,OAAOJ,OAAO,CAAC,CAACG;YACZ,MAAM,EAAEsD,QAAQ,EAAE,GAAGtD;YACrBoD,SAASG,GAAG,CAACD,aAAaF,SAASI,GAAG,CAACF,UAAU,EAAE;YACnD,IAAIA,SAASG,UAAU,CAAC,WAAW;gBAC/BL,SAASlD,GAAG,CAACoD,UAAUI,IAAI,CAAC1D;YAChC,OAAO;gBACHoD,SAASlD,GAAG,CAACoD,UAAUK,OAAO,CAAC3D;YACnC;QACJ;QACA,OAAOoD;IACX,CAAA;IACA,OAAO;QACHQ,gBAAgB/E,QAAQ+E,cAAc;QACtCV;QACAxD;QACAY;QACAU;QACAG;IACJ;AACJ"}
@@ -74,20 +74,20 @@ function createToaster(options) {
74
74
  * @param toastOptions user configured options
75
75
  * @param onUpdate Some toast methods can result in UI changes (i.e. close) use this to dispatch callbacks
76
76
  */ const buildToast = (toastOptions, onUpdate)=>{
77
- var _toast_onStatusChange, _toast;
77
+ var _toast_onStatusChange;
78
78
  const { toastId, content, toasterId } = toastOptions;
79
79
  if (toasts.has(toastId)) {
80
80
  return;
81
81
  }
82
82
  const close = ()=>{
83
- var _toast_onStatusChange, _toast;
83
+ var _toast_onStatusChange;
84
84
  const toast = toasts.get(toastId);
85
85
  if (!toast) {
86
86
  return;
87
87
  }
88
88
  visibleToasts.delete(toastId);
89
89
  onUpdate();
90
- (_toast_onStatusChange = (_toast = toast).onStatusChange) === null || _toast_onStatusChange === void 0 ? void 0 : _toast_onStatusChange.call(_toast, null, {
90
+ (_toast_onStatusChange = toast.onStatusChange) === null || _toast_onStatusChange === void 0 ? void 0 : _toast_onStatusChange.call(toast, null, {
91
91
  status: 'dismissed',
92
92
  ...toast
93
93
  });
@@ -122,7 +122,7 @@ function createToaster(options) {
122
122
  assignDefined(toast, options);
123
123
  assignDefined(toast, toastOptions);
124
124
  toasts.set(toastId, toast);
125
- (_toast_onStatusChange = (_toast = toast).onStatusChange) === null || _toast_onStatusChange === void 0 ? void 0 : _toast_onStatusChange.call(_toast, null, {
125
+ (_toast_onStatusChange = toast.onStatusChange) === null || _toast_onStatusChange === void 0 ? void 0 : _toast_onStatusChange.call(toast, null, {
126
126
  status: 'queued',
127
127
  ...toast
128
128
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["createToaster.js"],"sourcesContent":["import * as React from 'react';\nimport { createPriorityQueue } from '@fluentui/react-utilities';\nfunction assignDefined(a, b) {\n // This cast is required, as Object.entries will return string as key which is not indexable\n for (const [key, prop] of Object.entries(b)){\n // eslint-disable-next-line eqeqeq\n if (prop != undefined) {\n a[key] = prop;\n }\n }\n}\nconst defaulToastOptions = {\n onStatusChange: undefined,\n priority: 0,\n pauseOnHover: false,\n pauseOnWindowBlur: false,\n position: 'bottom-end',\n timeout: 3000\n};\n// Multiple toasts can be dispatched in a single tick, use counter to prevent collisions\nlet counter = 0;\n/**\n * Toast are managed outside of the react lifecycle because they can be\n * dispatched imperatively. Therefore the state of toast visibility can't\n * really be managed properly by a declarative lifecycle.\n */ export function createToaster(options) {\n const { limit = Number.POSITIVE_INFINITY } = options;\n const visibleToasts = new Set();\n const toasts = new Map();\n const queue = createPriorityQueue((ta, tb)=>{\n const a = toasts.get(ta);\n const b = toasts.get(tb);\n if (!a || !b) {\n return 0;\n }\n if (a.priority === b.priority) {\n return a.order - b.order;\n }\n return a.priority - b.priority;\n });\n const isToastVisible = (toastId)=>{\n return visibleToasts.has(toastId);\n };\n /**\n * Updates an existing toast with any available option\n */ const updateToast = (toastOptions)=>{\n const { toastId } = toastOptions;\n const toastToUpdate = toasts.get(toastId);\n if (!toastToUpdate) {\n return;\n }\n Object.assign(toastToUpdate, toastOptions);\n toastToUpdate.updateId++;\n };\n /**\n * Dismisses a toast with a specific id\n */ const dismissToast = (toastId)=>{\n visibleToasts.delete(toastId);\n };\n /**\n * Dismisses all toasts and clears the queue\n */ const dismissAllToasts = ()=>{\n visibleToasts.clear();\n queue.clear();\n };\n /**\n * @param toastOptions user configured options\n * @param onUpdate Some toast methods can result in UI changes (i.e. close) use this to dispatch callbacks\n */ const buildToast = (toastOptions, onUpdate)=>{\n var _toast_onStatusChange, _toast;\n const { toastId, content, toasterId } = toastOptions;\n if (toasts.has(toastId)) {\n return;\n }\n const close = ()=>{\n var _toast_onStatusChange, _toast;\n const toast = toasts.get(toastId);\n if (!toast) {\n return;\n }\n visibleToasts.delete(toastId);\n onUpdate();\n (_toast_onStatusChange = (_toast = toast).onStatusChange) === null || _toast_onStatusChange === void 0 ? void 0 : _toast_onStatusChange.call(_toast, null, {\n status: 'dismissed',\n ...toast\n });\n };\n const remove = ()=>{\n const toast = toasts.get(toastId);\n if (!toast) {\n return;\n }\n toasts.delete(toastId);\n if (visibleToasts.size < limit && queue.peek()) {\n const nextToast = toasts.get(queue.dequeue());\n if (!nextToast) {\n return;\n }\n visibleToasts.add(nextToast.toastId);\n }\n onUpdate();\n };\n const toast = {\n ...defaulToastOptions,\n close,\n remove,\n toastId,\n content,\n updateId: 0,\n toasterId,\n order: counter++,\n data: {},\n imperativeRef: React.createRef()\n };\n assignDefined(toast, options);\n assignDefined(toast, toastOptions);\n toasts.set(toastId, toast);\n (_toast_onStatusChange = (_toast = toast).onStatusChange) === null || _toast_onStatusChange === void 0 ? void 0 : _toast_onStatusChange.call(_toast, null, {\n status: 'queued',\n ...toast\n });\n if (visibleToasts.size >= limit) {\n queue.enqueue(toastId);\n } else {\n visibleToasts.add(toastId);\n }\n };\n return {\n buildToast,\n dismissAllToasts,\n dismissToast,\n isToastVisible,\n updateToast,\n visibleToasts,\n toasts\n };\n}\n"],"names":["createToaster","assignDefined","a","b","key","prop","Object","entries","undefined","defaulToastOptions","onStatusChange","priority","pauseOnHover","pauseOnWindowBlur","position","timeout","counter","options","limit","Number","POSITIVE_INFINITY","visibleToasts","Set","toasts","Map","queue","createPriorityQueue","ta","tb","get","order","isToastVisible","toastId","has","updateToast","toastOptions","toastToUpdate","assign","updateId","dismissToast","delete","dismissAllToasts","clear","buildToast","onUpdate","_toast_onStatusChange","_toast","content","toasterId","close","toast","call","status","remove","size","peek","nextToast","dequeue","add","data","imperativeRef","React","createRef","set","enqueue"],"mappings":";;;;+BAyBoBA;;;eAAAA;;;;iEAzBG;gCACa;AACpC,SAASC,cAAcC,CAAC,EAAEC,CAAC;IACvB,4FAA4F;IAC5F,KAAK,MAAM,CAACC,KAAKC,KAAK,IAAIC,OAAOC,OAAO,CAACJ,GAAG;QACxC,kCAAkC;QAClC,IAAIE,QAAQG,WAAW;YACnBN,CAAC,CAACE,IAAI,GAAGC;QACb;IACJ;AACJ;AACA,MAAMI,qBAAqB;IACvBC,gBAAgBF;IAChBG,UAAU;IACVC,cAAc;IACdC,mBAAmB;IACnBC,UAAU;IACVC,SAAS;AACb;AACA,wFAAwF;AACxF,IAAIC,UAAU;AAKH,SAAShB,cAAciB,OAAO;IACrC,MAAM,EAAEC,QAAQC,OAAOC,iBAAiB,EAAE,GAAGH;IAC7C,MAAMI,gBAAgB,IAAIC;IAC1B,MAAMC,SAAS,IAAIC;IACnB,MAAMC,QAAQC,IAAAA,mCAAmB,EAAC,CAACC,IAAIC;QACnC,MAAM1B,IAAIqB,OAAOM,GAAG,CAACF;QACrB,MAAMxB,IAAIoB,OAAOM,GAAG,CAACD;QACrB,IAAI,CAAC1B,KAAK,CAACC,GAAG;YACV,OAAO;QACX;QACA,IAAID,EAAES,QAAQ,KAAKR,EAAEQ,QAAQ,EAAE;YAC3B,OAAOT,EAAE4B,KAAK,GA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B,IAAI,IAAI;gBAC5C,MAAMC,YAAYjC,OAAOM,GAAG,CAACJ,MAAMgC,OAAO;gBAC1C,IAAI,CAACD,WAAW;oBACZ;gBACJ;gBACAnC,cAAcqC,GAAG,CAACF,UAAUxB,OAAO;YACvC;YACAY;QACJ;QACA,MAAMM,QAAQ;YACV,GAAGzC,kBAAkB;YACrBwC;YACAI;YACArB;YACAe;YACAT,UAAU;YACVU;YACAlB,OAAOd;YACP2C,MAAM,CAAC;YACPC,6BAAeC,OAAMC,SAAS;QAClC;QACA7D,cAAciD,OAAOjC;QACrBhB,cAAciD,OAAOf;QACrBZ,OAAOwC,GAAG,CAAC/B,SAASkB;QACnBL,CAAAA,wBAAwB,AAACC,CAAAA,SAASI,KAAI,EAAGxC,cAAc,AAAD,MAAO,QAAQmC,0BAA0B,KAAK,IAAI,KAAK,IAAIA,sBAAsBM,IAAI,CAACL,QAAQ,MAAM;YACvJM,QAAQ;YACR,GAAGF,KAAK;QACZ;QACA,IAAI7B,cAAciC,IAAI,IAAIpC,OAAO;YAC7BO,MAAMuC,OAAO,CAAChC;QAClB,OAAO;YACHX,cAAcqC,GAAG,CAAC1B;QACtB;IACJ;IACA,OAAO;QACHW;QACAF;QACAF;QACAR;QACAG;QACAb;QACAE;IACJ;AACJ"}
1
+ {"version":3,"sources":["createToaster.js"],"sourcesContent":["import * as React from 'react';\nimport { createPriorityQueue } from '@fluentui/react-utilities';\nfunction assignDefined(a, b) {\n // This cast is required, as Object.entries will return string as key which is not indexable\n for (const [key, prop] of Object.entries(b)){\n // eslint-disable-next-line eqeqeq\n if (prop != undefined) {\n a[key] = prop;\n }\n }\n}\nconst defaulToastOptions = {\n onStatusChange: undefined,\n priority: 0,\n pauseOnHover: false,\n pauseOnWindowBlur: false,\n position: 'bottom-end',\n timeout: 3000\n};\n// Multiple toasts can be dispatched in a single tick, use counter to prevent collisions\nlet counter = 0;\n/**\n * Toast are managed outside of the react lifecycle because they can be\n * dispatched imperatively. Therefore the state of toast visibility can't\n * really be managed properly by a declarative lifecycle.\n */ export function createToaster(options) {\n const { limit = Number.POSITIVE_INFINITY } = options;\n const visibleToasts = new Set();\n const toasts = new Map();\n const queue = createPriorityQueue((ta, tb)=>{\n const a = toasts.get(ta);\n const b = toasts.get(tb);\n if (!a || !b) {\n return 0;\n }\n if (a.priority === b.priority) {\n return a.order - b.order;\n }\n return a.priority - b.priority;\n });\n const isToastVisible = (toastId)=>{\n return visibleToasts.has(toastId);\n };\n /**\n * Updates an existing toast with any available option\n */ const updateToast = (toastOptions)=>{\n const { toastId } = toastOptions;\n const toastToUpdate = toasts.get(toastId);\n if (!toastToUpdate) {\n return;\n }\n Object.assign(toastToUpdate, toastOptions);\n toastToUpdate.updateId++;\n };\n /**\n * Dismisses a toast with a specific id\n */ const dismissToast = (toastId)=>{\n visibleToasts.delete(toastId);\n };\n /**\n * Dismisses all toasts and clears the queue\n */ const dismissAllToasts = ()=>{\n visibleToasts.clear();\n queue.clear();\n };\n /**\n * @param toastOptions user configured options\n * @param onUpdate Some toast methods can result in UI changes (i.e. close) use this to dispatch callbacks\n */ const buildToast = (toastOptions, onUpdate)=>{\n var _toast_onStatusChange;\n const { toastId, content, toasterId } = toastOptions;\n if (toasts.has(toastId)) {\n return;\n }\n const close = ()=>{\n var _toast_onStatusChange;\n const toast = toasts.get(toastId);\n if (!toast) {\n return;\n }\n visibleToasts.delete(toastId);\n onUpdate();\n (_toast_onStatusChange = toast.onStatusChange) === null || _toast_onStatusChange === void 0 ? void 0 : _toast_onStatusChange.call(toast, null, {\n status: 'dismissed',\n ...toast\n });\n };\n const remove = ()=>{\n const toast = toasts.get(toastId);\n if (!toast) {\n return;\n }\n toasts.delete(toastId);\n if (visibleToasts.size < limit && queue.peek()) {\n const nextToast = toasts.get(queue.dequeue());\n if (!nextToast) {\n return;\n }\n visibleToasts.add(nextToast.toastId);\n }\n onUpdate();\n };\n const toast = {\n ...defaulToastOptions,\n close,\n remove,\n toastId,\n content,\n updateId: 0,\n toasterId,\n order: counter++,\n data: {},\n imperativeRef: React.createRef()\n };\n assignDefined(toast, options);\n assignDefined(toast, toastOptions);\n toasts.set(toastId, toast);\n (_toast_onStatusChange = toast.onStatusChange) === null || _toast_onStatusChange === void 0 ? void 0 : _toast_onStatusChange.call(toast, null, {\n status: 'queued',\n ...toast\n });\n if (visibleToasts.size >= limit) {\n queue.enqueue(toastId);\n } else {\n visibleToasts.add(toastId);\n }\n };\n return {\n buildToast,\n dismissAllToasts,\n dismissToast,\n isToastVisible,\n updateToast,\n visibleToasts,\n toasts\n };\n}\n"],"names":["createToaster","assignDefined","a","b","key","prop","Object","entries","undefined","defaulToastOptions","onStatusChange","priority","pauseOnHover","pauseOnWindowBlur","position","timeout","counter","options","limit","Number","POSITIVE_INFINITY","visibleToasts","Set","toasts","Map","queue","createPriorityQueue","ta","tb","get","order","isToastVisible","toastId","has","updateToast","toastOptions","toastToUpdate","assign","updateId","dismissToast","delete","dismissAllToasts","clear","buildToast","onUpdate","_toast_onStatusChange","content","toasterId","close","toast","call","status","remove","size","peek","nextToast","dequeue","add","data","imperativeRef","React","createRef","set","enqueue"],"mappings":";;;;+BAyBoBA;;;eAAAA;;;;iEAzBG;gCACa;AACpC,SAASC,cAAcC,CAAC,EAAEC,CAAC;IACvB,4FAA4F;IAC5F,KAAK,MAAM,CAACC,KAAKC,KAAK,IAAIC,OAAOC,OAAO,CAACJ,GAAG;QACxC,kCAAkC;QAClC,IAAIE,QAAQG,WAAW;YACnBN,CAAC,CAACE,IAAI,GAAGC;QACb;IACJ;AACJ;AACA,MAAMI,qBAAqB;IACvBC,gBAAgBF;IAChBG,UAAU;IACVC,cAAc;IACdC,mBAAmB;IACnBC,UAAU;IACVC,SAAS;AACb;AACA,wFAAwF;AACxF,IAAIC,UAAU;AAKH,SAAShB,cAAciB,OAAO;IACrC,MAAM,EAAEC,QAAQC,OAAOC,iBAAiB,EAAE,GAAGH;IAC7C,MAAMI,gBAAgB,IAAIC;IAC1B,MAAMC,SAAS,IAAIC;I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,OAAO,MAAM;gBAC3IE,QAAQ;gBACR,GAAGF,KAAK;YACZ;QACJ;QACA,MAAMG,SAAS;YACX,MAAMH,QAAQ1B,OAAOM,GAAG,CAACG;YACzB,IAAI,CAACiB,OAAO;gBACR;YACJ;YACA1B,OAAOiB,MAAM,CAACR;YACd,IAAIX,cAAcgC,IAAI,GAAGnC,SAASO,MAAM6B,IAAI,IAAI;gBAC5C,MAAMC,YAAYhC,OAAOM,GAAG,CAACJ,MAAM+B,OAAO;gBAC1C,IAAI,CAACD,WAAW;oBACZ;gBACJ;gBACAlC,cAAcoC,GAAG,CAACF,UAAUvB,OAAO;YACvC;YACAY;QACJ;QACA,MAAMK,QAAQ;YACV,GAAGxC,kBAAkB;YACrBuC;YACAI;YACApB;YACAc;YACAR,UAAU;YACVS;YACAjB,OAAOd;YACP0C,MAAM,CAAC;YACPC,6BAAeC,OAAMC,SAAS;QAClC;QACA5D,cAAcgD,OAAOhC;QACrBhB,cAAcgD,OAAOd;QACrBZ,OAAOuC,GAAG,CAAC9B,SAASiB;QACnBJ,CAAAA,wBAAwBI,MAAMvC,cAAc,AAAD,MAAO,QAAQmC,0BAA0B,KAAK,IAAI,KAAK,IAAIA,sBAAsBK,IAAI,CAACD,OAAO,MAAM;YAC3IE,QAAQ;YACR,GAAGF,KAAK;QACZ;QACA,IAAI5B,cAAcgC,IAAI,IAAInC,OAAO;YAC7BO,MAAMsC,OAAO,CAAC/B;QAClB,OAAO;YACHX,cAAcoC,GAAG,CAACzB;QACtB;IACJ;IACA,OAAO;QACHW;QACAF;QACAF;QACAR;QACAG;QACAb;QACAE;IACJ;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-toast",
3
- "version": "9.3.3",
3
+ "version": "9.3.5",
4
4
  "description": "Toast component for Fluent UI",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -36,15 +36,15 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "react-transition-group": "^4.4.1",
39
- "@fluentui/keyboard-keys": "^9.0.4",
40
- "@fluentui/react-aria": "^9.3.36",
41
- "@fluentui/react-icons": "^2.0.207",
42
- "@fluentui/react-jsx-runtime": "^9.0.10",
43
- "@fluentui/react-portal": "^9.3.16",
44
- "@fluentui/react-shared-contexts": "^9.8.1",
45
- "@fluentui/react-tabster": "^9.12.11",
46
- "@fluentui/react-theme": "^9.1.12",
47
- "@fluentui/react-utilities": "^9.13.3",
39
+ "@fluentui/keyboard-keys": "^9.0.6",
40
+ "@fluentui/react-aria": "^9.3.38",
41
+ "@fluentui/react-icons": "^2.0.217",
42
+ "@fluentui/react-jsx-runtime": "^9.0.12",
43
+ "@fluentui/react-portal": "^9.3.18",
44
+ "@fluentui/react-shared-contexts": "^9.9.1",
45
+ "@fluentui/react-tabster": "^9.13.1",
46
+ "@fluentui/react-theme": "^9.1.14",
47
+ "@fluentui/react-utilities": "^9.13.5",
48
48
  "@griffel/react": "^1.5.14",
49
49
  "@swc/helpers": "^0.5.1"
50
50
  },