Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-modal-global

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-modal-global - npm Package Compare versions

Comparing version 2023.5.26-experimental to 2023.5.26-experimental-2

5

dist/index.d.ts

@@ -292,4 +292,5 @@ import EventEmitter from 'eventemitter3';

controller: ModalController;
children: ReactNode;
onClose?(): void;
children: ReactNode;
params?: Partial<ModalParams>;
}

@@ -301,4 +302,4 @@ /**

*/
declare function ModalPortal(props: ModalPortalProps): React.ReactPortal;
declare function ModalPortal(props: ModalPortalProps): JSX.Element;
export { ModalContainer, ModalController, ModalPortal, ModalWindow, useModalSnapshot, useModalWindow };

4

dist/index.ts

@@ -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})},{id:b});if(a.onClose)e.on("close",a.onClose);return 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){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
{
"name": "react-modal-global",
"version": "2023.5.26-experimental",
"version": "2023.5.26-experimental-2",
"description": "Highly reusable React Modal that can be run from useEffect.",

@@ -5,0 +5,0 @@ "main": "dist/index.ts",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc