Outlook_Addin_LLM/node_modules/@fluentui/react-dialog/lib-commonjs/contexts/dialogContext.js

39 lines
1.2 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
DialogContext: function() {
return DialogContext;
},
DialogProvider: function() {
return DialogProvider;
},
useDialogContext_unstable: function() {
return useDialogContext_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactcontextselector = require("@fluentui/react-context-selector");
const defaultContextValue = {
open: false,
inertTrapFocus: false,
modalType: 'modal',
isNestedDialog: false,
dialogRef: {
current: null
},
requestOpenChange () {
/* noop */ }
};
const DialogContext = (0, _reactcontextselector.createContext)(undefined);
const DialogProvider = DialogContext.Provider;
const useDialogContext_unstable = (selector)=>(0, _reactcontextselector.useContextSelector)(DialogContext, (ctx = defaultContextValue)=>selector(ctx));