@fluentui/react-toast 9.1.6 → 9.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +115 -1
- package/CHANGELOG.md +34 -2
- package/dist/index.d.ts +3 -2
- package/lib/components/AriaLive/AriaLive.js.map +1 -1
- package/lib/components/AriaLive/renderAriaLive.js +7 -2
- package/lib/components/AriaLive/renderAriaLive.js.map +1 -1
- package/lib/components/AriaLive/useAriaLive.js +6 -4
- package/lib/components/AriaLive/useAriaLive.js.map +1 -1
- package/lib/components/Timer/Timer.js +1 -1
- package/lib/components/Timer/Timer.js.map +1 -1
- package/lib/components/Toast/Toast.js.map +1 -1
- package/lib/components/Toast/renderToast.js +5 -4
- package/lib/components/Toast/renderToast.js.map +1 -1
- package/lib/components/Toast/useToast.js.map +1 -1
- package/lib/components/Toast/useToastContextValues.js +1 -1
- package/lib/components/Toast/useToastContextValues.js.map +1 -1
- package/lib/components/ToastBody/ToastBody.js.map +1 -1
- package/lib/components/ToastBody/renderToastBody.js +7 -2
- package/lib/components/ToastBody/renderToastBody.js.map +1 -1
- package/lib/components/ToastBody/useToastBody.js +1 -1
- package/lib/components/ToastBody/useToastBody.js.map +1 -1
- package/lib/components/ToastContainer/ToastContainer.js.map +1 -1
- package/lib/components/ToastContainer/renderToastContainer.js +12 -7
- package/lib/components/ToastContainer/renderToastContainer.js.map +1 -1
- package/lib/components/ToastContainer/useToastContainer.js +15 -15
- package/lib/components/ToastContainer/useToastContainer.js.map +1 -1
- package/lib/components/ToastContainer/useToastContainerContextValues.js +1 -1
- package/lib/components/ToastContainer/useToastContainerContextValues.js.map +1 -1
- package/lib/components/ToastFooter/ToastFooter.js.map +1 -1
- package/lib/components/ToastFooter/renderToastFooter.js +2 -2
- package/lib/components/ToastFooter/renderToastFooter.js.map +1 -1
- package/lib/components/ToastFooter/useToastFooter.js.map +1 -1
- package/lib/components/ToastTitle/ToastTitle.js.map +1 -1
- package/lib/components/ToastTitle/renderToastTitle.js +8 -2
- package/lib/components/ToastTitle/renderToastTitle.js.map +1 -1
- package/lib/components/ToastTitle/useToastTitle.js +1 -1
- package/lib/components/ToastTitle/useToastTitle.js.map +1 -1
- package/lib/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
- package/lib/components/ToastTrigger/ToastTrigger.js.map +1 -1
- package/lib/components/ToastTrigger/useToastTrigger.js +8 -7
- package/lib/components/ToastTrigger/useToastTrigger.js.map +1 -1
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Toaster/Toaster.types.js.map +1 -1
- package/lib/components/Toaster/renderToaster.js +18 -5
- package/lib/components/Toaster/renderToaster.js.map +1 -1
- package/lib/components/Toaster/useToastAnnounce.js.map +1 -1
- package/lib/components/Toaster/useToaster.js +7 -6
- package/lib/components/Toaster/useToaster.js.map +1 -1
- package/lib/components/Toaster/useToasterFocusManagement.js +2 -2
- package/lib/components/Toaster/useToasterFocusManagement.js.map +1 -1
- package/lib/contexts/toastContainerContext.js.map +1 -1
- package/lib/state/useToastController.js +3 -2
- package/lib/state/useToastController.js.map +1 -1
- package/lib/state/useToaster.js +15 -11
- package/lib/state/useToaster.js.map +1 -1
- package/lib/state/vanilla/createToaster.js +7 -7
- package/lib/state/vanilla/createToaster.js.map +1 -1
- package/lib/state/vanilla/dismissAllToasts.js.map +1 -1
- package/lib/state/vanilla/dismissToast.js.map +1 -1
- package/lib/state/vanilla/dispatchToast.js.map +1 -1
- package/lib/state/vanilla/getPositionStyles.js +1 -1
- package/lib/state/vanilla/getPositionStyles.js.map +1 -1
- package/lib/state/vanilla/pauseToast.js.map +1 -1
- package/lib/state/vanilla/playToast.js.map +1 -1
- package/lib/state/vanilla/updateToast.js.map +1 -1
- package/lib-commonjs/AriaLive.js +2 -2
- package/lib-commonjs/AriaLive.js.map +1 -1
- package/lib-commonjs/Toast.js +2 -2
- package/lib-commonjs/Toast.js.map +1 -1
- package/lib-commonjs/ToastBody.js +2 -2
- package/lib-commonjs/ToastBody.js.map +1 -1
- package/lib-commonjs/ToastContainer.js +2 -2
- package/lib-commonjs/ToastContainer.js.map +1 -1
- package/lib-commonjs/ToastFooter.js +2 -2
- package/lib-commonjs/ToastFooter.js.map +1 -1
- package/lib-commonjs/ToastTitle.js +2 -2
- package/lib-commonjs/ToastTitle.js.map +1 -1
- package/lib-commonjs/ToastTrigger.js +2 -2
- package/lib-commonjs/ToastTrigger.js.map +1 -1
- package/lib-commonjs/Toaster.js +2 -2
- package/lib-commonjs/Toaster.js.map +1 -1
- package/lib-commonjs/components/AriaLive/AriaLive.js +7 -5
- package/lib-commonjs/components/AriaLive/AriaLive.js.map +1 -1
- package/lib-commonjs/components/AriaLive/AriaLive.types.js +2 -2
- package/lib-commonjs/components/AriaLive/AriaLive.types.js.map +1 -1
- package/lib-commonjs/components/AriaLive/index.js +6 -6
- package/lib-commonjs/components/AriaLive/index.js.map +1 -1
- package/lib-commonjs/components/AriaLive/renderAriaLive.js +13 -6
- package/lib-commonjs/components/AriaLive/renderAriaLive.js.map +1 -1
- package/lib-commonjs/components/AriaLive/useAriaLive.js +16 -12
- package/lib-commonjs/components/AriaLive/useAriaLive.js.map +1 -1
- package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js +7 -3
- package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Timer/Timer.js +8 -6
- package/lib-commonjs/components/Timer/Timer.js.map +1 -1
- package/lib-commonjs/components/Timer/index.js +2 -2
- package/lib-commonjs/components/Timer/index.js.map +1 -1
- package/lib-commonjs/components/Timer/useTimerStyles.styles.js +4 -2
- package/lib-commonjs/components/Timer/useTimerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Toast/Toast.js +7 -5
- package/lib-commonjs/components/Toast/Toast.js.map +1 -1
- package/lib-commonjs/components/Toast/index.js +6 -6
- package/lib-commonjs/components/Toast/index.js.map +1 -1
- package/lib-commonjs/components/Toast/renderToast.js +12 -9
- package/lib-commonjs/components/Toast/renderToast.js.map +1 -1
- package/lib-commonjs/components/Toast/useToast.js +7 -5
- package/lib-commonjs/components/Toast/useToast.js.map +1 -1
- package/lib-commonjs/components/Toast/useToastContextValues.js +4 -2
- package/lib-commonjs/components/Toast/useToastContextValues.js.map +1 -1
- package/lib-commonjs/components/Toast/useToastStyles.styles.js +8 -4
- package/lib-commonjs/components/Toast/useToastStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastBody/ToastBody.js +7 -5
- package/lib-commonjs/components/ToastBody/ToastBody.js.map +1 -1
- package/lib-commonjs/components/ToastBody/index.js +6 -6
- package/lib-commonjs/components/ToastBody/index.js.map +1 -1
- package/lib-commonjs/components/ToastBody/renderToastBody.js +13 -6
- package/lib-commonjs/components/ToastBody/renderToastBody.js.map +1 -1
- package/lib-commonjs/components/ToastBody/useToastBody.js +11 -9
- package/lib-commonjs/components/ToastBody/useToastBody.js.map +1 -1
- package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js +9 -5
- package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/ToastContainer.js +7 -5
- package/lib-commonjs/components/ToastContainer/ToastContainer.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/ToastContainer.types.js +2 -2
- package/lib-commonjs/components/ToastContainer/ToastContainer.types.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/index.js +7 -7
- package/lib-commonjs/components/ToastContainer/index.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/renderToastContainer.js +19 -12
- package/lib-commonjs/components/ToastContainer/renderToastContainer.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/useToastContainer.js +42 -40
- package/lib-commonjs/components/ToastContainer/useToastContainer.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/useToastContainerContextValues.js +6 -4
- package/lib-commonjs/components/ToastContainer/useToastContainerContextValues.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js +8 -4
- package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastFooter/ToastFooter.js +7 -5
- package/lib-commonjs/components/ToastFooter/ToastFooter.js.map +1 -1
- package/lib-commonjs/components/ToastFooter/index.js +6 -6
- package/lib-commonjs/components/ToastFooter/index.js.map +1 -1
- package/lib-commonjs/components/ToastFooter/renderToastFooter.js +8 -6
- package/lib-commonjs/components/ToastFooter/renderToastFooter.js.map +1 -1
- package/lib-commonjs/components/ToastFooter/useToastFooter.js +7 -5
- package/lib-commonjs/components/ToastFooter/useToastFooter.js.map +1 -1
- package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js +7 -3
- package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/ToastTitle.js +7 -5
- package/lib-commonjs/components/ToastTitle/ToastTitle.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/index.js +6 -6
- package/lib-commonjs/components/ToastTitle/index.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/renderToastTitle.js +14 -6
- package/lib-commonjs/components/ToastTitle/renderToastTitle.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/useToastTitle.js +17 -15
- package/lib-commonjs/components/ToastTitle/useToastTitle.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js +13 -9
- package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastTrigger/ToastTrigger.js +5 -3
- package/lib-commonjs/components/ToastTrigger/ToastTrigger.js.map +1 -1
- package/lib-commonjs/components/ToastTrigger/ToastTrigger.types.js +2 -2
- package/lib-commonjs/components/ToastTrigger/ToastTrigger.types.js.map +1 -1
- package/lib-commonjs/components/ToastTrigger/index.js +5 -5
- package/lib-commonjs/components/ToastTrigger/index.js.map +1 -1
- package/lib-commonjs/components/ToastTrigger/renderToastTrigger.js +3 -1
- package/lib-commonjs/components/ToastTrigger/renderToastTrigger.js.map +1 -1
- package/lib-commonjs/components/ToastTrigger/useToastTrigger.js +18 -15
- package/lib-commonjs/components/ToastTrigger/useToastTrigger.js.map +1 -1
- package/lib-commonjs/components/Toaster/Toaster.js +7 -5
- package/lib-commonjs/components/Toaster/Toaster.js.map +1 -1
- package/lib-commonjs/components/Toaster/index.js +6 -6
- package/lib-commonjs/components/Toaster/index.js.map +1 -1
- package/lib-commonjs/components/Toaster/renderToaster.js +26 -11
- package/lib-commonjs/components/Toaster/renderToaster.js.map +1 -1
- package/lib-commonjs/components/Toaster/useToastAnnounce.js +8 -6
- package/lib-commonjs/components/Toaster/useToastAnnounce.js.map +1 -1
- package/lib-commonjs/components/Toaster/useToaster.js +25 -22
- package/lib-commonjs/components/Toaster/useToaster.js.map +1 -1
- package/lib-commonjs/components/Toaster/useToasterFocusManagement.js +19 -17
- package/lib-commonjs/components/Toaster/useToasterFocusManagement.js.map +1 -1
- package/lib-commonjs/components/Toaster/useToasterStyles.styles.js +7 -3
- package/lib-commonjs/components/Toaster/useToasterStyles.styles.js.map +1 -1
- package/lib-commonjs/contexts/toastContainerContext.js +8 -4
- package/lib-commonjs/contexts/toastContainerContext.js.map +1 -1
- package/lib-commonjs/index.js +93 -35
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/state/constants.js +6 -2
- package/lib-commonjs/state/constants.js.map +1 -1
- package/lib-commonjs/state/index.js +10 -6
- package/lib-commonjs/state/index.js.map +1 -1
- package/lib-commonjs/state/types.js +2 -2
- package/lib-commonjs/state/types.js.map +1 -1
- package/lib-commonjs/state/useToastController.js +9 -6
- package/lib-commonjs/state/useToastController.js.map +1 -1
- package/lib-commonjs/state/useToaster.js +26 -20
- package/lib-commonjs/state/useToaster.js.map +1 -1
- package/lib-commonjs/state/vanilla/createToaster.js +14 -12
- package/lib-commonjs/state/vanilla/createToaster.js.map +1 -1
- package/lib-commonjs/state/vanilla/dismissAllToasts.js +3 -1
- package/lib-commonjs/state/vanilla/dismissAllToasts.js.map +1 -1
- package/lib-commonjs/state/vanilla/dismissToast.js +3 -1
- package/lib-commonjs/state/vanilla/dismissToast.js.map +1 -1
- package/lib-commonjs/state/vanilla/dispatchToast.js +3 -1
- package/lib-commonjs/state/vanilla/dispatchToast.js.map +1 -1
- package/lib-commonjs/state/vanilla/getPositionStyles.js +4 -2
- package/lib-commonjs/state/vanilla/getPositionStyles.js.map +1 -1
- package/lib-commonjs/state/vanilla/index.js +9 -9
- package/lib-commonjs/state/vanilla/index.js.map +1 -1
- package/lib-commonjs/state/vanilla/pauseToast.js +3 -1
- package/lib-commonjs/state/vanilla/pauseToast.js.map +1 -1
- package/lib-commonjs/state/vanilla/playToast.js +3 -1
- package/lib-commonjs/state/vanilla/playToast.js.map +1 -1
- package/lib-commonjs/state/vanilla/updateToast.js +3 -1
- package/lib-commonjs/state/vanilla/updateToast.js.map +1 -1
- package/package.json +14 -14
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
+
_export_star._(require("./Toaster"), exports);
|
|
7
|
+
_export_star._(require("./Toaster.types"), exports);
|
|
8
|
+
_export_star._(require("./renderToaster"), exports);
|
|
9
|
+
_export_star._(require("./useToaster"), exports);
|
|
10
|
+
_export_star._(require("./useToasterStyles.styles"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Toaster';\nexport * from './Toaster.types';\nexport * from './renderToaster';\nexport * from './useToaster';\nexport * from './useToasterStyles.styles';\n"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Toaster';\nexport * from './Toaster.types';\nexport * from './renderToaster';\nexport * from './useToaster';\nexport * from './useToasterStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
|
@@ -1,20 +1,35 @@
|
|
|
1
|
-
/** @jsxRuntime
|
|
1
|
+
/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ "use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "renderToaster_unstable", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderToaster_unstable;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
13
|
+
const _reactportal = require("@fluentui/react-portal");
|
|
14
|
+
const _AriaLive = require("../AriaLive");
|
|
13
15
|
const renderToaster_unstable = (state)=>{
|
|
14
|
-
const { announceRef
|
|
15
|
-
(0,
|
|
16
|
+
const { announceRef, renderAriaLive } = state;
|
|
17
|
+
(0, _reactutilities.assertSlots)(state);
|
|
16
18
|
const hasToasts = !!state.bottomStart || !!state.bottomEnd || !!state.topStart || !!state.topEnd;
|
|
17
|
-
return /*#__PURE__*/ (0,
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
20
|
+
children: [
|
|
21
|
+
renderAriaLive ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_AriaLive.AriaLive, {
|
|
22
|
+
announceRef: announceRef
|
|
23
|
+
}) : null,
|
|
24
|
+
hasToasts ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_reactportal.Portal, {
|
|
25
|
+
mountNode: state.mountNode,
|
|
26
|
+
children: [
|
|
27
|
+
state.bottomStart ? /*#__PURE__*/ (0, _jsxruntime.jsx)(state.bottomStart, {}) : null,
|
|
28
|
+
state.bottomEnd ? /*#__PURE__*/ (0, _jsxruntime.jsx)(state.bottomEnd, {}) : null,
|
|
29
|
+
state.topStart ? /*#__PURE__*/ (0, _jsxruntime.jsx)(state.topStart, {}) : null,
|
|
30
|
+
state.topEnd ? /*#__PURE__*/ (0, _jsxruntime.jsx)(state.topEnd, {}) : null
|
|
31
|
+
]
|
|
32
|
+
}) : null
|
|
33
|
+
]
|
|
34
|
+
});
|
|
20
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderToaster.js"],"sourcesContent":["/** @jsxRuntime
|
|
1
|
+
{"version":3,"sources":["renderToaster.js"],"sourcesContent":["/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\nimport { AriaLive } from '../AriaLive';\n/**\n * Render the final JSX of Toaster\n */ export const renderToaster_unstable = (state)=>{\n const { announceRef, renderAriaLive } = state;\n assertSlots(state);\n const hasToasts = !!state.bottomStart || !!state.bottomEnd || !!state.topStart || !!state.topEnd;\n return /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n renderAriaLive ? /*#__PURE__*/ _jsx(AriaLive, {\n announceRef: announceRef\n }) : null,\n hasToasts ? /*#__PURE__*/ _jsxs(Portal, {\n mountNode: state.mountNode,\n children: [\n state.bottomStart ? /*#__PURE__*/ _jsx(state.bottomStart, {}) : null,\n state.bottomEnd ? /*#__PURE__*/ _jsx(state.bottomEnd, {}) : null,\n state.topStart ? /*#__PURE__*/ _jsx(state.topStart, {}) : null,\n state.topEnd ? /*#__PURE__*/ _jsx(state.topEnd, {}) : null\n ]\n }) : null\n ]\n });\n};\n"],"names":["renderToaster_unstable","state","announceRef","renderAriaLive","assertSlots","hasToasts","bottomStart","bottomEnd","topStart","topEnd","_jsxs","_Fragment","children","_jsx","AriaLive","Portal","mountNode"],"mappings":"AAAA,0BAA0B,GAAG,iDAAiD;;;;+BAM7DA;;;eAAAA;;;4BANkI;gCACvH;6BACL;0BACE;AAGd,MAAMA,yBAAyB,CAACC;IACvC,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAE,GAAGF;IACxCG,IAAAA,2BAAW,EAACH;IACZ,MAAMI,YAAY,CAAC,CAACJ,MAAMK,WAAW,IAAI,CAAC,CAACL,MAAMM,SAAS,IAAI,CAAC,CAACN,MAAMO,QAAQ,IAAI,CAAC,CAACP,MAAMQ,MAAM;IAChG,OAAO,WAAW,GAAGC,IAAAA,gBAAK,EAACC,oBAAS,EAAE;QAClCC,UAAU;YACNT,iBAAiB,WAAW,GAAGU,IAAAA,eAAI,EAACC,kBAAQ,EAAE;gBAC1CZ,aAAaA;YACjB,KAAK;YACLG,YAAY,WAAW,GAAGK,IAAAA,gBAAK,EAACK,mBAAM,EAAE;gBACpCC,WAAWf,MAAMe,SAAS;gBAC1BJ,UAAU;oBACNX,MAAMK,WAAW,GAAG,WAAW,GAAGO,IAAAA,eAAI,EAACZ,MAAMK,WAAW,EAAE,CAAC,KAAK;oBAChEL,MAAMM,SAAS,GAAG,WAAW,GAAGM,IAAAA,eAAI,EAACZ,MAAMM,SAAS,EAAE,CAAC,KAAK;oBAC5DN,MAAMO,QAAQ,GAAG,WAAW,GAAGK,IAAAA,eAAI,EAACZ,MAAMO,QAAQ,EAAE,CAAC,KAAK;oBAC1DP,MAAMQ,MAAM,GAAG,WAAW,GAAGI,IAAAA,eAAI,EAACZ,MAAMQ,MAAM,EAAE,CAAC,KAAK;iBACzD;YACL,KAAK;SACR;IACL;AACJ"}
|
|
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "useToastAnnounce", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return useToastAnnounce;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const _react = /*#__PURE__*/
|
|
11
|
-
const
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
12
14
|
function useToastAnnounce(announce) {
|
|
13
15
|
const activeRef = _react.useRef(true);
|
|
14
16
|
const cleanupRef = _react.useRef(()=>undefined);
|
|
@@ -25,13 +27,13 @@ function useToastAnnounce(announce) {
|
|
|
25
27
|
return;
|
|
26
28
|
}
|
|
27
29
|
const onFocusIn = (e)=>{
|
|
28
|
-
if ((0,
|
|
30
|
+
if ((0, _reactutilities.isHTMLElement)(e.currentTarget) && e.currentTarget.contains((0, _reactutilities.isHTMLElement)(e.relatedTarget) ? e.relatedTarget : null)) {
|
|
29
31
|
return;
|
|
30
32
|
}
|
|
31
33
|
activeRef.current = false;
|
|
32
34
|
};
|
|
33
35
|
const onFocusOut = (e)=>{
|
|
34
|
-
if ((0,
|
|
36
|
+
if ((0, _reactutilities.isHTMLElement)(e.currentTarget) && e.currentTarget.contains((0, _reactutilities.isHTMLElement)(e.relatedTarget) ? e.relatedTarget : null)) {
|
|
35
37
|
return;
|
|
36
38
|
}
|
|
37
39
|
activeRef.current = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useToastAnnounce.js"],"sourcesContent":["import * as React from 'react';\nimport { isHTMLElement } from '@fluentui/react-utilities';\n/**\n * Wraps an aria live announcement function.\n * Aria live announcements can be detrimental once the user is already navigating\n * multiple toasts. Once the user is focused inside the toaster, the announecments should be disabled.\n * @param announce\n * @returns A function to announce a toast and a ref to attach to the toaster element\n */ export function useToastAnnounce(announce) {\n const activeRef = React.useRef(true);\n const cleanupRef = React.useRef(()=>undefined);\n const announceToast = React.useCallback((message, options)=>{\n if (activeRef.current) {\n announce(message, options);\n }\n }, [\n announce\n ]);\n const toasterRef = React.useCallback((el)=>{\n if (!el) {\n cleanupRef.current();\n return;\n }\n const onFocusIn = (e)=>{\n if (isHTMLElement(e.currentTarget) && e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)) {\n return;\n }\n activeRef.current = false;\n };\n const onFocusOut = (e)=>{\n if (isHTMLElement(e.currentTarget) && e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)) {\n return;\n }\n activeRef.current = true;\n };\n el.addEventListener('focusin', onFocusIn);\n el.addEventListener('focusout', onFocusOut);\n cleanupRef.current = ()=>{\n el.removeEventListener('focusin', onFocusIn);\n el.removeEventListener('focusout', onFocusOut);\n };\n }, []);\n return {\n announceToast,\n toasterRef\n };\n}\n"],"names":["useToastAnnounce","announce","activeRef","React","useRef","cleanupRef","undefined","announceToast","useCallback","message","options","current","toasterRef","el","onFocusIn","e","isHTMLElement","currentTarget","contains","relatedTarget","onFocusOut","addEventListener","removeEventListener"],"mappings":";;;;+BAQoBA
|
|
1
|
+
{"version":3,"sources":["useToastAnnounce.js"],"sourcesContent":["import * as React from 'react';\nimport { isHTMLElement } from '@fluentui/react-utilities';\n/**\n * Wraps an aria live announcement function.\n * Aria live announcements can be detrimental once the user is already navigating\n * multiple toasts. Once the user is focused inside the toaster, the announecments should be disabled.\n * @param announce\n * @returns A function to announce a toast and a ref to attach to the toaster element\n */ export function useToastAnnounce(announce) {\n const activeRef = React.useRef(true);\n const cleanupRef = React.useRef(()=>undefined);\n const announceToast = React.useCallback((message, options)=>{\n if (activeRef.current) {\n announce(message, options);\n }\n }, [\n announce\n ]);\n const toasterRef = React.useCallback((el)=>{\n if (!el) {\n cleanupRef.current();\n return;\n }\n const onFocusIn = (e)=>{\n if (isHTMLElement(e.currentTarget) && e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)) {\n return;\n }\n activeRef.current = false;\n };\n const onFocusOut = (e)=>{\n if (isHTMLElement(e.currentTarget) && e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)) {\n return;\n }\n activeRef.current = true;\n };\n el.addEventListener('focusin', onFocusIn);\n el.addEventListener('focusout', onFocusOut);\n cleanupRef.current = ()=>{\n el.removeEventListener('focusin', onFocusIn);\n el.removeEventListener('focusout', onFocusOut);\n };\n }, []);\n return {\n announceToast,\n toasterRef\n };\n}\n"],"names":["useToastAnnounce","announce","activeRef","React","useRef","cleanupRef","undefined","announceToast","useCallback","message","options","current","toasterRef","el","onFocusIn","e","isHTMLElement","currentTarget","contains","relatedTarget","onFocusOut","addEventListener","removeEventListener"],"mappings":";;;;+BAQoBA;;;eAAAA;;;;iEARG;gCACO;AAOnB,SAASA,iBAAiBC,QAAQ;IACzC,MAAMC,YAAYC,OAAMC,MAAM,CAAC;IAC/B,MAAMC,aAAaF,OAAMC,MAAM,CAAC,IAAIE;IACpC,MAAMC,gBAAgBJ,OAAMK,WAAW,CAAC,CAACC,SAASC;QAC9C,IAAIR,UAAUS,OAAO,EAAE;YACnBV,SAASQ,SAASC;QACtB;IACJ,GAAG;QACCT;KACH;IACD,MAAMW,aAAaT,OAAMK,WAAW,CAAC,CAACK;QAClC,IAAI,CAACA,IAAI;YACLR,WAAWM,OAAO;YAClB;QACJ;QACA,MAAMG,YAAY,CAACC;YACf,IAAIC,IAAAA,6BAAa,EAACD,EAAEE,aAAa,KAAKF,EAAEE,aAAa,CAACC,QAAQ,CAACF,IAAAA,6BAAa,EAACD,EAAEI,aAAa,IAAIJ,EAAEI,aAAa,GAAG,OAAO;gBACrH;YACJ;YACAjB,UAAUS,OAAO,GAAG;QACxB;QACA,MAAMS,aAAa,CAACL;YAChB,IAAIC,IAAAA,6BAAa,EAACD,EAAEE,aAAa,KAAKF,EAAEE,aAAa,CAACC,QAAQ,CAACF,IAAAA,6BAAa,EAACD,EAAEI,aAAa,IAAIJ,EAAEI,aAAa,GAAG,OAAO;gBACrH;YACJ;YACAjB,UAAUS,OAAO,GAAG;QACxB;QACAE,GAAGQ,gBAAgB,CAAC,WAAWP;QAC/BD,GAAGQ,gBAAgB,CAAC,YAAYD;QAChCf,WAAWM,OAAO,GAAG;YACjBE,GAAGS,mBAAmB,CAAC,WAAWR;YAClCD,GAAGS,mBAAmB,CAAC,YAAYF;QACvC;IACJ,GAAG,EAAE;IACL,OAAO;QACHb;QACAK;IACJ;AACJ"}
|
|
@@ -4,49 +4,51 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "useToaster_unstable", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return useToaster_unstable;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const _react = /*#__PURE__*/
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
14
|
+
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
15
|
+
const _reacttabster = require("@fluentui/react-tabster");
|
|
16
|
+
const _keyboardkeys = require("@fluentui/keyboard-keys");
|
|
15
17
|
const _state = require("../../state");
|
|
16
|
-
const
|
|
18
|
+
const _ToastContainer = require("../ToastContainer");
|
|
17
19
|
const _useToasterFocusManagement = require("./useToasterFocusManagement");
|
|
18
20
|
const _useToastAnnounce = require("./useToastAnnounce");
|
|
19
21
|
const useToaster_unstable = (props)=>{
|
|
20
|
-
const { offset
|
|
22
|
+
const { offset, announce: announceProp, mountNode, ...rest } = props;
|
|
21
23
|
const announceRef = _react.useRef(()=>null);
|
|
22
|
-
const { toastsToRender
|
|
24
|
+
const { toastsToRender, isToastVisible, pauseAllToasts, playAllToasts, tryRestoreFocus, closeAllToasts } = (0, _state.useToaster)(rest);
|
|
23
25
|
const announce = _react.useCallback((message, options)=>announceRef.current(message, options), []);
|
|
24
|
-
const { dir
|
|
25
|
-
const rootProps =
|
|
26
|
+
const { dir } = (0, _reactsharedcontexts.useFluent_unstable)();
|
|
27
|
+
const rootProps = _reactutilities.slot.always((0, _reactutilities.getNativeElementProps)('div', rest), {
|
|
26
28
|
elementType: 'div'
|
|
27
29
|
});
|
|
28
|
-
const focusableGroupAttr = (0,
|
|
30
|
+
const focusableGroupAttr = (0, _reacttabster.useFocusableGroup)({
|
|
29
31
|
tabBehavior: 'limited-trap-focus',
|
|
30
32
|
ignoreDefaultKeydown: {
|
|
31
33
|
Escape: true
|
|
32
34
|
}
|
|
33
35
|
});
|
|
34
|
-
const onKeyDown = (0,
|
|
35
|
-
var _props_onKeyDown;
|
|
36
|
-
if (e.key ===
|
|
36
|
+
const onKeyDown = (0, _reactutilities.useEventCallback)((e)=>{
|
|
37
|
+
var _props_onKeyDown, _props;
|
|
38
|
+
if (e.key === _keyboardkeys.Escape) {
|
|
37
39
|
e.preventDefault();
|
|
38
40
|
closeAllToasts();
|
|
39
41
|
}
|
|
40
|
-
(_props_onKeyDown = props.onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(
|
|
42
|
+
(_props_onKeyDown = (_props = props).onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(_props, e);
|
|
41
43
|
});
|
|
42
44
|
const usePositionSlot = (toastPosition)=>{
|
|
43
45
|
var _toastsToRender_get;
|
|
44
46
|
const focusManagementRef = (0, _useToasterFocusManagement.useToasterFocusManagement_unstable)(pauseAllToasts, playAllToasts);
|
|
45
|
-
const { announceToast
|
|
46
|
-
return
|
|
47
|
+
const { announceToast, toasterRef } = (0, _useToastAnnounce.useToastAnnounce)(announceProp !== null && announceProp !== void 0 ? announceProp : announce);
|
|
48
|
+
return _reactutilities.slot.optional(toastsToRender.has(toastPosition) ? rootProps : null, {
|
|
47
49
|
defaultProps: {
|
|
48
|
-
ref: (0,
|
|
49
|
-
children: (_toastsToRender_get = toastsToRender.get(toastPosition)) === null || _toastsToRender_get === void 0 ? void 0 : _toastsToRender_get.map((toast)=>/*#__PURE__*/ _react.createElement(
|
|
50
|
+
ref: (0, _reactutilities.useMergedRefs)(focusManagementRef, toasterRef),
|
|
51
|
+
children: (_toastsToRender_get = toastsToRender.get(toastPosition)) === null || _toastsToRender_get === void 0 ? void 0 : _toastsToRender_get.map((toast)=>/*#__PURE__*/ _react.createElement(_ToastContainer.ToastContainer, {
|
|
50
52
|
...toast,
|
|
51
53
|
tryRestoreFocus: tryRestoreFocus,
|
|
52
54
|
intent: toast.intent,
|
|
@@ -64,6 +66,7 @@ const useToaster_unstable = (props)=>{
|
|
|
64
66
|
};
|
|
65
67
|
return {
|
|
66
68
|
dir,
|
|
69
|
+
mountNode,
|
|
67
70
|
components: {
|
|
68
71
|
root: 'div',
|
|
69
72
|
bottomStart: 'div',
|
|
@@ -71,7 +74,7 @@ const useToaster_unstable = (props)=>{
|
|
|
71
74
|
topStart: 'div',
|
|
72
75
|
topEnd: 'div'
|
|
73
76
|
},
|
|
74
|
-
root:
|
|
77
|
+
root: _reactutilities.slot.always(rootProps, {
|
|
75
78
|
elementType: 'div'
|
|
76
79
|
}),
|
|
77
80
|
bottomStart: usePositionSlot(_state.TOAST_POSITIONS.bottomStart),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useToaster.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useEventCallback, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport { TOAST_POSITIONS, useToaster } from '../../state';\nimport { ToastContainer } from '../ToastContainer';\nimport { useToasterFocusManagement_unstable } from './useToasterFocusManagement';\nimport { useToastAnnounce } from './useToastAnnounce';\n/**\n * Create the state required to render Toaster.\n *\n * @param props - props from this instance of Toaster\n */ export const useToaster_unstable = (props)=>{\n const { offset
|
|
1
|
+
{"version":3,"sources":["useToaster.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useEventCallback, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport { TOAST_POSITIONS, useToaster } from '../../state';\nimport { ToastContainer } from '../ToastContainer';\nimport { useToasterFocusManagement_unstable } from './useToasterFocusManagement';\nimport { useToastAnnounce } from './useToastAnnounce';\n/**\n * Create the state required to render Toaster.\n *\n * @param props - props from this instance of Toaster\n */ export const useToaster_unstable = (props)=>{\n const { offset, announce: announceProp, mountNode, ...rest } = props;\n const announceRef = React.useRef(()=>null);\n const { toastsToRender, isToastVisible, pauseAllToasts, playAllToasts, tryRestoreFocus, closeAllToasts } = useToaster(rest);\n const announce = React.useCallback((message, options)=>announceRef.current(message, options), []);\n const { dir } = useFluent();\n const rootProps = slot.always(getNativeElementProps('div', rest), {\n elementType: 'div'\n });\n const focusableGroupAttr = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n ignoreDefaultKeydown: {\n Escape: true\n }\n });\n const onKeyDown = useEventCallback((e)=>{\n var _props_onKeyDown, _props;\n if (e.key === Escape) {\n e.preventDefault();\n closeAllToasts();\n }\n (_props_onKeyDown = (_props = props).onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(_props, e);\n });\n const usePositionSlot = (toastPosition)=>{\n var _toastsToRender_get;\n const focusManagementRef = useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts);\n const { announceToast, toasterRef } = useToastAnnounce(announceProp !== null && announceProp !== void 0 ? announceProp : announce);\n return slot.optional(toastsToRender.has(toastPosition) ? rootProps : null, {\n defaultProps: {\n ref: useMergedRefs(focusManagementRef, toasterRef),\n children: (_toastsToRender_get = toastsToRender.get(toastPosition)) === null || _toastsToRender_get === void 0 ? void 0 : _toastsToRender_get.map((toast)=>/*#__PURE__*/ React.createElement(ToastContainer, {\n ...toast,\n tryRestoreFocus: tryRestoreFocus,\n intent: toast.intent,\n announce: announceToast,\n key: toast.toastId,\n visible: isToastVisible(toast.toastId)\n }, toast.content)),\n onKeyDown,\n ...focusableGroupAttr,\n 'data-toaster-position': toastPosition,\n role: 'list'\n },\n elementType: 'div'\n });\n };\n return {\n dir,\n mountNode,\n components: {\n root: 'div',\n bottomStart: 'div',\n bottomEnd: 'div',\n topStart: 'div',\n topEnd: 'div'\n },\n root: slot.always(rootProps, {\n elementType: 'div'\n }),\n bottomStart: usePositionSlot(TOAST_POSITIONS.bottomStart),\n bottomEnd: usePositionSlot(TOAST_POSITIONS.bottomEnd),\n topStart: usePositionSlot(TOAST_POSITIONS.topStart),\n topEnd: usePositionSlot(TOAST_POSITIONS.topEnd),\n announceRef,\n offset,\n announce: announceProp !== null && announceProp !== void 0 ? announceProp : announce,\n renderAriaLive: !announceProp\n };\n};\n"],"names":["useToaster_unstable","props","offset","announce","announceProp","mountNode","rest","announceRef","React","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","closeAllToasts","useToaster","useCallback","message","options","current","dir","useFluent","rootProps","slot","always","getNativeElementProps","elementType","focusableGroupAttr","useFocusableGroup","tabBehavior","ignoreDefaultKeydown","Escape","onKeyDown","useEventCallback","e","_props_onKeyDown","_props","key","preventDefault","call","usePositionSlot","toastPosition","_toastsToRender_get","focusManagementRef","useToasterFocusManagement_unstable","announceToast","toasterRef","useToastAnnounce","optional","has","defaultProps","ref","useMergedRefs","children","get","map","toast","createElement","ToastContainer","intent","toastId","visible","content","role","components","root","bottomStart","bottomEnd","topStart","topEnd","TOAST_POSITIONS","renderAriaLive"],"mappings":";;;;+BAaiBA;;;eAAAA;;;;iEAbM;gCACsD;qCAC7B;8BACd;8BACX;uBACqB;gCACb;2CACoB;kCAClB;AAKtB,MAAMA,sBAAsB,CAACC;IACpC,MAAM,EAAEC,MAAM,EAAEC,UAAUC,YAAY,EAAEC,SAAS,EAAE,GAAGC,MAAM,GAAGL;IAC/D,MAAMM,cAAcC,OAAMC,MAAM,CAAC,IAAI;IACrC,MAAM,EAAEC,cAAc,EAAEC,cAAc,EAAEC,cAAc,EAAEC,aAAa,EAAEC,eAAe,EAAEC,cAAc,EAAE,GAAGC,IAAAA,iBAAU,EAACV;IACtH,MAAMH,WAAWK,OAAMS,WAAW,CAAC,CAACC,SAASC,UAAUZ,YAAYa,OAAO,CAACF,SAASC,UAAU,EAAE;IAChG,MAAM,EAAEE,GAAG,EAAE,GAAGC,IAAAA,uCAAS;IACzB,MAAMC,YAAYC,oBAAI,CAACC,MAAM,CAACC,IAAAA,qCAAqB,EAAC,OAAOpB,OAAO;QAC9DqB,aAAa;IACjB;IACA,MAAMC,qBAAqBC,IAAAA,+BAAiB,EAAC;QACzCC,aAAa;QACbC,sBAAsB;YAClBC,QAAQ;QACZ;IACJ;IACA,MAAMC,YAAYC,IAAAA,gCAAgB,EAAC,CAACC;QAChC,IAAIC,kBAAkBC;QACtB,IAAIF,EAAEG,GAAG,KAAKN,oBAAM,EAAE;YAClBG,EAAEI,cAAc;YAChBxB;QACJ;QACCqB,CAAAA,mBAAmB,AAACC,CAAAA,SAASpC,KAAI,EAAGgC,SAAS,AAAD,MAAO,QAAQG,qBAAqB,KAAK,IAAI,KAAK,IAAIA,iBAAiBI,IAAI,CAACH,QAAQF;IACrI;IACA,MAAMM,kBAAkB,CAACC;QACrB,IAAIC;QACJ,MAAMC,qBAAqBC,IAAAA,6DAAkC,EAACjC,gBAAgBC;QAC9E,MAAM,EAAEiC,aAAa,EAAEC,UAAU,EAAE,GAAGC,IAAAA,kCAAgB,EAAC5C,iBAAiB,QAAQA,iBAAiB,KAAK,IAAIA,eAAeD;QACzH,OAAOqB,oBAAI,CAACyB,QAAQ,CAACvC,eAAewC,GAAG,CAACR,iBAAiBnB,YAAY,MAAM;YACvE4B,cAAc;gBACVC,KAAKC,IAAAA,6BAAa,EAACT,oBAAoBG;gBACvCO,UAAU,AAACX,CAAAA,sBAAsBjC,eAAe6C,GAAG,CAACb,cAAa,MAAO,QAAQC,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBa,GAAG,CAAC,CAACC,QAAQ,WAAW,GAAGjD,OAAMkD,aAAa,CAACC,8BAAc,EAAE;wBACrM,GAAGF,KAAK;wBACR3C,iBAAiBA;wBACjB8C,QAAQH,MAAMG,MAAM;wBACpBzD,UAAU2C;wBACVR,KAAKmB,MAAMI,OAAO;wBAClBC,SAASnD,eAAe8C,MAAMI,OAAO;oBACzC,GAAGJ,MAAMM,OAAO;gBACpB9B;gBACA,GAAGL,kBAAkB;gBACrB,yBAAyBc;gBACzBsB,MAAM;YACV;YACArC,aAAa;QACjB;IACJ;IACA,OAAO;QACHN;QACAhB;QACA4D,YAAY;YACRC,MAAM;YACNC,aAAa;YACbC,WAAW;YACXC,UAAU;YACVC,QAAQ;QACZ;QACAJ,MAAM1C,oBAAI,CAACC,MAAM,CAACF,WAAW;YACzBI,aAAa;QACjB;QACAwC,aAAa1B,gBAAgB8B,sBAAe,CAACJ,WAAW;QACxDC,WAAW3B,gBAAgB8B,sBAAe,CAACH,SAAS;QACpDC,UAAU5B,gBAAgB8B,sBAAe,CAACF,QAAQ;QAClDC,QAAQ7B,gBAAgB8B,sBAAe,CAACD,MAAM;QAC9C/D;QACAL;QACAC,UAAUC,iBAAiB,QAAQA,iBAAiB,KAAK,IAAIA,eAAeD;QAC5EqE,gBAAgB,CAACpE;IACrB;AACJ"}
|
|
@@ -4,17 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "useToasterFocusManagement_unstable", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return useToasterFocusManagement_unstable;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const _react = /*#__PURE__*/
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
13
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
14
|
+
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
15
|
+
const _keyboardkeys = require("@fluentui/keyboard-keys");
|
|
16
|
+
const _ToastContainer = require("../ToastContainer");
|
|
15
17
|
const noop = ()=>undefined;
|
|
16
18
|
function useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts) {
|
|
17
|
-
const { targetDocument
|
|
19
|
+
const { targetDocument } = (0, _reactsharedcontexts.useFluent_unstable)();
|
|
18
20
|
const cleanupListenersRef = _react.useRef(noop);
|
|
19
21
|
return _react.useCallback((el)=>{
|
|
20
22
|
if (!el || !targetDocument) {
|
|
@@ -24,7 +26,7 @@ function useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts) {
|
|
|
24
26
|
}
|
|
25
27
|
const toastContainerWalker = targetDocument.createTreeWalker(el, NodeFilter.SHOW_ELEMENT, {
|
|
26
28
|
acceptNode (node) {
|
|
27
|
-
if ((0,
|
|
29
|
+
if ((0, _reactutilities.isHTMLElement)(node) && node.classList.contains(_ToastContainer.toastContainerClassNames.root)) {
|
|
28
30
|
return NodeFilter.FILTER_ACCEPT;
|
|
29
31
|
}
|
|
30
32
|
return NodeFilter.FILTER_SKIP;
|
|
@@ -36,22 +38,22 @@ function useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts) {
|
|
|
36
38
|
* This is a temporary measure, Tabster does not have an API yet to enable mover arrow keys from within grouppers
|
|
37
39
|
* Once tabster fully supports this use case, remove this hook
|
|
38
40
|
*/ const keydownListener = (e)=>{
|
|
39
|
-
const { target
|
|
40
|
-
if (!(0,
|
|
41
|
+
const { target, key } = e;
|
|
42
|
+
if (!(0, _reactutilities.isHTMLElement)(target)) {
|
|
41
43
|
return;
|
|
42
44
|
}
|
|
43
|
-
if (key ===
|
|
45
|
+
if (key === _keyboardkeys.ArrowDown) {
|
|
44
46
|
toastContainerWalker.currentNode = target;
|
|
45
47
|
let nextToastContainer = toastContainerWalker.nextNode();
|
|
46
48
|
if (!nextToastContainer) {
|
|
47
49
|
toastContainerWalker.currentNode = el;
|
|
48
50
|
nextToastContainer = toastContainerWalker.nextNode();
|
|
49
51
|
}
|
|
50
|
-
if ((0,
|
|
52
|
+
if ((0, _reactutilities.isHTMLElement)(nextToastContainer)) {
|
|
51
53
|
nextToastContainer.focus();
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
|
-
if (key ===
|
|
56
|
+
if (key === _keyboardkeys.ArrowUp) {
|
|
55
57
|
toastContainerWalker.currentNode = target;
|
|
56
58
|
let prevToastContainer = toastContainerWalker.previousNode();
|
|
57
59
|
if (prevToastContainer && prevToastContainer.contains(target)) {
|
|
@@ -61,18 +63,18 @@ function useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts) {
|
|
|
61
63
|
toastContainerWalker.currentNode = el;
|
|
62
64
|
prevToastContainer = toastContainerWalker.lastChild();
|
|
63
65
|
}
|
|
64
|
-
if ((0,
|
|
66
|
+
if ((0, _reactutilities.isHTMLElement)(prevToastContainer)) {
|
|
65
67
|
prevToastContainer.focus();
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
70
|
};
|
|
69
71
|
const focusInListener = (e)=>{
|
|
70
|
-
if ((0,
|
|
72
|
+
if ((0, _reactutilities.isHTMLElement)(e.currentTarget) && !e.currentTarget.contains((0, _reactutilities.isHTMLElement)(e.relatedTarget) ? e.relatedTarget : null)) {
|
|
71
73
|
pauseAllToasts();
|
|
72
74
|
}
|
|
73
75
|
};
|
|
74
76
|
const focusOutListener = (e)=>{
|
|
75
|
-
if ((0,
|
|
77
|
+
if ((0, _reactutilities.isHTMLElement)(e.currentTarget) && !e.currentTarget.contains((0, _reactutilities.isHTMLElement)(e.relatedTarget) ? e.relatedTarget : null)) {
|
|
76
78
|
playAllToasts();
|
|
77
79
|
}
|
|
78
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useToasterFocusManagement.js"],"sourcesContent":["import { isHTMLElement } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowDown, ArrowUp } from '@fluentui/keyboard-keys';\nimport { toastContainerClassNames } from '../ToastContainer';\nconst noop = ()=>undefined;\n/**\n * @internal\n */ export function useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts) {\n const { targetDocument
|
|
1
|
+
{"version":3,"sources":["useToasterFocusManagement.js"],"sourcesContent":["import { isHTMLElement } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowDown, ArrowUp } from '@fluentui/keyboard-keys';\nimport { toastContainerClassNames } from '../ToastContainer';\nconst noop = ()=>undefined;\n/**\n * @internal\n */ export function useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts) {\n const { targetDocument } = useFluent();\n const cleanupListenersRef = React.useRef(noop);\n return React.useCallback((el)=>{\n if (!el || !targetDocument) {\n cleanupListenersRef.current();\n cleanupListenersRef.current = noop;\n return;\n }\n const toastContainerWalker = targetDocument.createTreeWalker(el, NodeFilter.SHOW_ELEMENT, {\n acceptNode (node) {\n if (isHTMLElement(node) && node.classList.contains(toastContainerClassNames.root)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n return NodeFilter.FILTER_SKIP;\n }\n });\n /**\n * FIXME: https://github.com/microsoft/tabster/issues/299\n * Toasts should be arrow navigable and focus should be trapped in a stack of tasts\n * This is a temporary measure, Tabster does not have an API yet to enable mover arrow keys from within grouppers\n * Once tabster fully supports this use case, remove this hook\n */ const keydownListener = (e)=>{\n const { target, key } = e;\n if (!isHTMLElement(target)) {\n return;\n }\n if (key === ArrowDown) {\n toastContainerWalker.currentNode = target;\n let nextToastContainer = toastContainerWalker.nextNode();\n if (!nextToastContainer) {\n toastContainerWalker.currentNode = el;\n nextToastContainer = toastContainerWalker.nextNode();\n }\n if (isHTMLElement(nextToastContainer)) {\n nextToastContainer.focus();\n }\n }\n if (key === ArrowUp) {\n toastContainerWalker.currentNode = target;\n let prevToastContainer = toastContainerWalker.previousNode();\n if (prevToastContainer && prevToastContainer.contains(target)) {\n prevToastContainer = toastContainerWalker.previousNode();\n }\n if (!prevToastContainer) {\n toastContainerWalker.currentNode = el;\n prevToastContainer = toastContainerWalker.lastChild();\n }\n if (isHTMLElement(prevToastContainer)) {\n prevToastContainer.focus();\n }\n }\n };\n const focusInListener = (e)=>{\n if (isHTMLElement(e.currentTarget) && !e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)) {\n pauseAllToasts();\n }\n };\n const focusOutListener = (e)=>{\n if (isHTMLElement(e.currentTarget) && !e.currentTarget.contains(isHTMLElement(e.relatedTarget) ? e.relatedTarget : null)) {\n playAllToasts();\n }\n };\n el.addEventListener('keydown', keydownListener);\n el.addEventListener('focusin', focusInListener);\n el.addEventListener('focusout', focusOutListener);\n cleanupListenersRef.current = ()=>{\n el.removeEventListener('keydown', keydownListener);\n el.removeEventListener('focusin', focusInListener);\n el.removeEventListener('focusout', focusOutListener);\n };\n }, [\n targetDocument,\n pauseAllToasts,\n playAllToasts\n ]);\n}\n"],"names":["useToasterFocusManagement_unstable","noop","undefined","pauseAllToasts","playAllToasts","targetDocument","useFluent","cleanupListenersRef","React","useRef","useCallback","el","current","toastContainerWalker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","node","isHTMLElement","classList","contains","toastContainerClassNames","root","FILTER_ACCEPT","FILTER_SKIP","keydownListener","e","target","key","ArrowDown","currentNode","nextToastContainer","nextNode","focus","ArrowUp","prevToastContainer","previousNode","lastChild","focusInListener","currentTarget","relatedTarget","focusOutListener","addEventListener","removeEventListener"],"mappings":";;;;+BAQoBA;;;eAAAA;;;;gCARU;iEACP;qCACyB;8BACb;gCACM;AACzC,MAAMC,OAAO,IAAIC;AAGN,SAASF,mCAAmCG,cAAc,EAAEC,aAAa;IAChF,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,MAAMC,sBAAsBC,OAAMC,MAAM,CAACR;IACzC,OAAOO,OAAME,WAAW,CAAC,CAACC;QACtB,IAAI,CAACA,MAAM,CAACN,gBAAgB;YACxBE,oBAAoBK,OAAO;YAC3BL,oBAAoBK,OAAO,GAAGX;YAC9B;QACJ;QACA,MAAMY,uBAAuBR,eAAeS,gBAAgB,CAACH,IAAII,WAAWC,YAAY,EAAE;YACtFC,YAAYC,IAAI;gBACZ,IAAIC,IAAAA,6BAAa,EAACD,SAASA,KAAKE,SAAS,CAACC,QAAQ,CAACC,wCAAwB,CAACC,IAAI,GAAG;oBAC/E,OAAOR,WAAWS,aAAa;gBACnC;gBACA,OAAOT,WAAWU,WAAW;YACjC;QACJ;QACA;;;;;OAKD,GAAG,MAAMC,kBAAkB,CAACC;YACvB,MAAM,EAAEC,MAAM,EAAEC,GAAG,EAAE,GAAGF;YACxB,IAAI,CAACR,IAAAA,6BAAa,EAACS,SAAS;gBACxB;YACJ;YACA,IAAIC,QAAQC,uBAAS,EAAE;gBACnBjB,qBAAqBkB,WAAW,GAAGH;gBACnC,IAAII,qBAAqBnB,qBAAqBoB,QAAQ;gBACtD,IAAI,CAACD,oBAAoB;oBACrBnB,qBAAqBkB,WAAW,GAAGpB;oBACnCqB,qBAAqBnB,qBAAqBoB,QAAQ;gBACtD;gBACA,IAAId,IAAAA,6BAAa,EAACa,qBAAqB;oBACnCA,mBAAmBE,KAAK;gBAC5B;YACJ;YACA,IAAIL,QAAQM,qBAAO,EAAE;gBACjBtB,qBAAqBkB,WAAW,GAAGH;gBACnC,IAAIQ,qBAAqBvB,qBAAqBwB,YAAY;gBAC1D,IAAID,sBAAsBA,mBAAmBf,QAAQ,CAACO,SAAS;oBAC3DQ,qBAAqBvB,qBAAqBwB,YAAY;gBAC1D;gBACA,IAAI,CAACD,oBAAoB;oBACrBvB,qBAAqBkB,WAAW,GAAGpB;oBACnCyB,qBAAqBvB,qBAAqByB,SAAS;gBACvD;gBACA,IAAInB,IAAAA,6BAAa,EAACiB,qBAAqB;oBACnCA,mBAAmBF,KAAK;gBAC5B;YACJ;QACJ;QACA,MAAMK,kBAAkB,CAACZ;YACrB,IAAIR,IAAAA,6BAAa,EAACQ,EAAEa,aAAa,KAAK,CAACb,EAAEa,aAAa,CAACnB,QAAQ,CAACF,IAAAA,6BAAa,EAACQ,EAAEc,aAAa,IAAId,EAAEc,aAAa,GAAG,OAAO;gBACtHtC;YACJ;QACJ;QACA,MAAMuC,mBAAmB,CAACf;YACtB,IAAIR,IAAAA,6BAAa,EAACQ,EAAEa,aAAa,KAAK,CAACb,EAAEa,aAAa,CAACnB,QAAQ,CAACF,IAAAA,6BAAa,EAACQ,EAAEc,aAAa,IAAId,EAAEc,aAAa,GAAG,OAAO;gBACtHrC;YACJ;QACJ;QACAO,GAAGgC,gBAAgB,CAAC,WAAWjB;QAC/Bf,GAAGgC,gBAAgB,CAAC,WAAWJ;QAC/B5B,GAAGgC,gBAAgB,CAAC,YAAYD;QAChCnC,oBAAoBK,OAAO,GAAG;YAC1BD,GAAGiC,mBAAmB,CAAC,WAAWlB;YAClCf,GAAGiC,mBAAmB,CAAC,WAAWL;YAClC5B,GAAGiC,mBAAmB,CAAC,YAAYF;QACvC;IACJ,GAAG;QACCrC;QACAF;QACAC;KACH;AACL"}
|
|
@@ -9,8 +9,12 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
toasterClassNames: ()
|
|
13
|
-
|
|
12
|
+
toasterClassNames: function() {
|
|
13
|
+
return toasterClassNames;
|
|
14
|
+
},
|
|
15
|
+
useToasterStyles_unstable: function() {
|
|
16
|
+
return useToasterStyles_unstable;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
19
|
const _react = require("@griffel/react");
|
|
16
20
|
const _index = require("../../state/index");
|
|
@@ -19,7 +23,7 @@ const toasterClassNames = {
|
|
|
19
23
|
};
|
|
20
24
|
/**
|
|
21
25
|
* Styles for the root slot
|
|
22
|
-
*/ const useRootBaseClassName = /*#__PURE__*/ (0, _react
|
|
26
|
+
*/ const useRootBaseClassName = /*#__PURE__*/ (0, _react.__resetStyles)("r3hfdjz", null, [
|
|
23
27
|
".r3hfdjz{position:fixed;width:292px;pointer-events:none;}"
|
|
24
28
|
]);
|
|
25
29
|
const useToasterStyles_unstable = (state)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useToasterStyles.styles.js"],"sourcesContent":["import { __resetStyles, mergeClasses } from '@griffel/react';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\nexport const toasterClassNames = {\n root: 'fui-Toaster'\n};\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r3hfdjz\", null, [\".r3hfdjz{position:fixed;width:292px;pointer-events:none;}\"]);\n/**\n * Apply styling to the Toaster slots based on the state\n */\nexport const useToasterStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.root.className);\n if (state.bottomStart) {\n var _state_bottomStart;\n state.bottomStart.className = className;\n var _style;\n (_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n if (state.bottomEnd) {\n var _state_bottomEnd;\n state.bottomEnd.className = className;\n var _style1;\n (_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n if (state.topStart) {\n var _state_topStart;\n state.topStart.className = className;\n var _style2;\n (_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n if (state.topEnd) {\n var _state_topEnd;\n state.topEnd.className = className;\n var _style3;\n (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n return state;\n};\n//# sourceMappingURL=useToasterStyles.styles.js.map"],"names":["toasterClassNames","useToasterStyles_unstable","root","useRootBaseClassName","__resetStyles","state","rootBaseClassName","className","mergeClasses","bottomStart","_state_bottomStart","_style","style","Object","assign","getPositionStyles","TOAST_POSITIONS","dir","offset","bottomEnd","_state_bottomEnd","_style1","topStart","_state_topStart","_style2","topEnd","_state_topEnd","_style3"],"mappings":";;;;;;;;;;;IAEaA,iBAAiB
|
|
1
|
+
{"version":3,"sources":["useToasterStyles.styles.js"],"sourcesContent":["import { __resetStyles, mergeClasses } from '@griffel/react';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\nexport const toasterClassNames = {\n root: 'fui-Toaster'\n};\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r3hfdjz\", null, [\".r3hfdjz{position:fixed;width:292px;pointer-events:none;}\"]);\n/**\n * Apply styling to the Toaster slots based on the state\n */\nexport const useToasterStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.root.className);\n if (state.bottomStart) {\n var _state_bottomStart;\n state.bottomStart.className = className;\n var _style;\n (_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n if (state.bottomEnd) {\n var _state_bottomEnd;\n state.bottomEnd.className = className;\n var _style1;\n (_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n if (state.topStart) {\n var _state_topStart;\n state.topStart.className = className;\n var _style2;\n (_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n if (state.topEnd) {\n var _state_topEnd;\n state.topEnd.className = className;\n var _style3;\n (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n return state;\n};\n//# sourceMappingURL=useToasterStyles.styles.js.map"],"names":["toasterClassNames","useToasterStyles_unstable","root","useRootBaseClassName","__resetStyles","state","rootBaseClassName","className","mergeClasses","bottomStart","_state_bottomStart","_style","style","Object","assign","getPositionStyles","TOAST_POSITIONS","dir","offset","bottomEnd","_state_bottomEnd","_style1","topStart","_state_topStart","_style2","topEnd","_state_topEnd","_style3"],"mappings":";;;;;;;;;;;IAEaA,iBAAiB;eAAjBA;;IAUAC,yBAAyB;eAAzBA;;;uBAZ+B;uBACO;AAC5C,MAAMD,oBAAoB;IAC/BE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,oBAAa,EAAC,WAAW,MAAM;IAAC;CAA4D;AAI/H,MAAMH,4BAA4BI,CAAAA;IACvC,MAAMC,oBAAoBH;IAC1B,MAAMI,YAAYC,IAAAA,mBAAY,EAACR,kBAAkBE,IAAI,EAAEI,mBAAmBD,MAAMH,IAAI,CAACK,SAAS;IAC9F,IAAIF,MAAMI,WAAW,EAAE;QACrB,IAAIC;QACJL,MAAMI,WAAW,CAACF,SAAS,GAAGA;QAC9B,IAAII;QACHA,CAAAA,SAAS,AAACD,CAAAA,qBAAqBL,MAAMI,WAAW,AAAD,EAAGG,KAAK,AAAD,MAAO,QAAQD,WAAW,KAAK,IAAIA,SAASD,mBAAmBE,KAAK,GAAG,CAAC;QAC/HC,OAAOC,MAAM,CAACT,MAAMI,WAAW,CAACG,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACP,WAAW,EAAEJ,MAAMY,GAAG,EAAEZ,MAAMa,MAAM;IAC/G;IACA,IAAIb,MAAMc,SAAS,EAAE;QACnB,IAAIC;QACJf,MAAMc,SAAS,CAACZ,SAAS,GAAGA;QAC5B,IAAIc;QACHA,CAAAA,UAAU,AAACD,CAAAA,mBAAmBf,MAAMc,SAAS,AAAD,EAAGP,KAAK,AAAD,MAAO,QAAQS,YAAY,KAAK,IAAIA,UAAUD,iBAAiBR,KAAK,GAAG,CAAC;QAC5HC,OAAOC,MAAM,CAACT,MAAMc,SAAS,CAACP,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACG,SAAS,EAAEd,MAAMY,GAAG,EAAEZ,MAAMa,MAAM;IAC3G;IACA,IAAIb,MAAMiB,QAAQ,EAAE;QAClB,IAAIC;QACJlB,MAAMiB,QAAQ,CAACf,SAAS,GAAGA;QAC3B,IAAIiB;QACHA,CAAAA,UAAU,AAACD,CAAAA,kBAAkBlB,MAAMiB,QAAQ,AAAD,EAAGV,KAAK,AAAD,MAAO,QAAQY,YAAY,KAAK,IAAIA,UAAUD,gBAAgBX,KAAK,GAAG,CAAC;QACzHC,OAAOC,MAAM,CAACT,MAAMiB,QAAQ,CAACV,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACM,QAAQ,EAAEjB,MAAMY,GAAG,EAAEZ,MAAMa,MAAM;IACzG;IACA,IAAIb,MAAMoB,MAAM,EAAE;QAChB,IAAIC;QACJrB,MAAMoB,MAAM,CAAClB,SAAS,GAAGA;QACzB,IAAIoB;QACHA,CAAAA,UAAU,AAACD,CAAAA,gBAAgBrB,MAAMoB,MAAM,AAAD,EAAGb,KAAK,AAAD,MAAO,QAAQe,YAAY,KAAK,IAAIA,UAAUD,cAAcd,KAAK,GAAG,CAAC;QACnHC,OAAOC,MAAM,CAACT,MAAMoB,MAAM,CAACb,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACS,MAAM,EAAEpB,MAAMY,GAAG,EAAEZ,MAAMa,MAAM;IACrG;IACA,OAAOb;AACT,GACA,mDAAmD"}
|
|
@@ -9,11 +9,15 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
ToastContainerContextProvider: ()
|
|
13
|
-
|
|
12
|
+
ToastContainerContextProvider: function() {
|
|
13
|
+
return ToastContainerContextProvider;
|
|
14
|
+
},
|
|
15
|
+
useToastContainerContext: function() {
|
|
16
|
+
return useToastContainerContext;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
|
-
const
|
|
16
|
-
const _react = /*#__PURE__*/
|
|
19
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
20
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
17
21
|
const toastContainerContextDefaultValue = {
|
|
18
22
|
close: ()=>null,
|
|
19
23
|
intent: undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["toastContainerContext.js"],"sourcesContent":["import * as React from 'react';\nconst toastContainerContextDefaultValue = {\n close: ()=>null,\n intent: undefined,\n bodyId: '',\n titleId: ''\n};\nconst ToastContainerContext = /*#__PURE__*/ React.createContext(undefined);\nexport const ToastContainerContextProvider = ToastContainerContext.Provider;\nvar _React_useContext;\nexport const useToastContainerContext = ()=>(_React_useContext = React.useContext(ToastContainerContext)) !== null && _React_useContext !== void 0 ? _React_useContext : toastContainerContextDefaultValue;\n"],"names":["ToastContainerContextProvider","useToastContainerContext","toastContainerContextDefaultValue","close","intent","undefined","bodyId","titleId","ToastContainerContext","React","createContext","Provider","_React_useContext","useContext"],"mappings":";;;;;;;;;;;IAQaA,6BAA6B
|
|
1
|
+
{"version":3,"sources":["toastContainerContext.js"],"sourcesContent":["import * as React from 'react';\nconst toastContainerContextDefaultValue = {\n close: ()=>null,\n intent: undefined,\n bodyId: '',\n titleId: ''\n};\nconst ToastContainerContext = /*#__PURE__*/ React.createContext(undefined);\nexport const ToastContainerContextProvider = ToastContainerContext.Provider;\nvar _React_useContext;\nexport const useToastContainerContext = ()=>(_React_useContext = React.useContext(ToastContainerContext)) !== null && _React_useContext !== void 0 ? _React_useContext : toastContainerContextDefaultValue;\n"],"names":["ToastContainerContextProvider","useToastContainerContext","toastContainerContextDefaultValue","close","intent","undefined","bodyId","titleId","ToastContainerContext","React","createContext","Provider","_React_useContext","useContext"],"mappings":";;;;;;;;;;;IAQaA,6BAA6B;eAA7BA;;IAEAC,wBAAwB;eAAxBA;;;;iEAVU;AACvB,MAAMC,oCAAoC;IACtCC,OAAO,IAAI;IACXC,QAAQC;IACRC,QAAQ;IACRC,SAAS;AACb;AACA,MAAMC,wBAAwB,WAAW,GAAGC,OAAMC,aAAa,CAACL;AACzD,MAAML,gCAAgCQ,sBAAsBG,QAAQ;AAC3E,IAAIC;AACG,MAAMX,2BAA2B,IAAI,AAACW,CAAAA,oBAAoBH,OAAMI,UAAU,CAACL,sBAAqB,MAAO,QAAQI,sBAAsB,KAAK,IAAIA,oBAAoBV"}
|