react-modal-global
Advanced tools
Comparing version 2023.5.26-experimental-3 to 2023.5.26-experimental-4
@@ -17,3 +17,3 @@ 'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var EventEmitter=require("eventemitter3"),jsxRuntime=require("react/jsx-runtime"),react=require("react"),reactDom=require("react-dom");function _interopDefaultLegacy(a){return a&&"object"===typeof a&&"default"in a?a:{"default":a}}var EventEmitter__default=_interopDefaultLegacy(EventEmitter); | ||
{children:jsxRuntime.jsx(modalContext.Provider,Object.assign({value:f},{children:react.createElement(f.component,Object.assign({},f.params,{key:f.id}))}))}),f.id))}))} | ||
function ModalPortal(a){let b=react.useId();react.useEffect(()=>()=>{a.controller.closeById(b)},[a.controller,b]);return react.useMemo(()=>{function c(f){f=null===f||void 0===f?void 0:f.parentElement;null!=f&&(f.replaceWith(d),d.setAttribute("class",f.className))}let d=document.createElement("div"),e=a.controller.open(function(){return jsxRuntime.jsx("div",{ref:c})},Object.assign(Object.assign({},a.params),{id:b}));if(a.onClose)e.on("close",a.onClose);return jsxRuntime.jsx(modalContext.Provider,Object.assign({value:e}, | ||
{children:reactDom.createPortal(a.children,d,b)}))},[a.controller,b])}exports.ModalContainer=ModalContainer;exports.ModalController=ModalController;exports.ModalPortal=ModalPortal;exports.ModalWindow=ModalWindow;exports.useModalSnapshot=useModalSnapshot;exports.useModalWindow=useModalWindow | ||
function ModalPortal(a){let b=react.useId();react.useEffect(()=>()=>{a.controller.closeById(b)},[a.controller,b]);return react.useMemo(()=>{function c(f){null!=f&&f.replaceWith(d)}let d=document.createElement("div"),e=a.controller.open(function(){return jsxRuntime.jsx("div",{ref:c})},Object.assign(Object.assign({},a.params),{id:b}));if(a.onClose)e.on("close",a.onClose);return jsxRuntime.jsx(modalContext.Provider,Object.assign({value:e},{children:reactDom.createPortal(a.children,d,b)}))},[a.controller, | ||
b])}exports.ModalContainer=ModalContainer;exports.ModalController=ModalController;exports.ModalPortal=ModalPortal;exports.ModalWindow=ModalWindow;exports.useModalSnapshot=useModalSnapshot;exports.useModalWindow=useModalWindow |
{ | ||
"name": "react-modal-global", | ||
"version": "2023.5.26-experimental-3", | ||
"version": "2023.5.26-experimental-4", | ||
"description": "Highly reusable React Modal that can be run from useEffect.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35937
328