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

react-dialog-polyfill

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dialog-polyfill - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

2

lib/react-dialog-polyfill.dev.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e||self).reactDialogPolyfill={},e.react)}(this,function(e,t){function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=/*#__PURE__*/n(t);function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r.apply(this,arguments)}const l=()=>"undefined"!=typeof window&&!!window.HTMLDialogElement;let d=0;const a="_rdp",c=()=>"undefined"!=typeof document&&document.head,f=t.forwardRef((e,n)=>{let{onClose:f=(()=>{}),onCancel:i=(()=>{}),...u}=e;const{children:s,open:p,_rd:m,_md:y,...h}=u;return t.useEffect(()=>{if(c()&&!l()){if(d<=0){const e=document.createElement("style");e.innerHTML="dialog:not([open]){display: none;}",e.id=a,document.head.appendChild(e)}return d++,()=>{if(d--,!c()||d>0)return;const e=document.getElementById(a);e&&document.head.removeChild(e)}}},[]),t.useEffect(()=>{const e=n.current;e&&m&&e.open!==p&&(p?y?()=>e.showModal():()=>e.show():()=>e.close())()},[m,p,n,y]),/*#__PURE__*/o.default.createElement("dialog",r({},h,{ref:n,onCancel:e=>{e.preventDefault(),i(e,n.current)},onClose:e=>{f(e,n.current)}}),s)}),i=e=>{const n=t.createRef(),[d,a]=t.useState();return t.useEffect(()=>{const e=n.current;if(d||!e)return;let t=!0;return(l()?Promise.resolve():import("dialog-polyfill")).then(t=>{t&&t.default.registerDialog(e)}).catch(e=>{console.warn("dialog-polyfill could not be loaded",e)}).finally(()=>{t&&a(!0)}),()=>t=!1},[n,d]),/*#__PURE__*/o.default.createElement(f,r({},e,{_rd:d,ref:n}))};e.Dialog=e=>/*#__PURE__*/o.default.createElement(i,r({},e,{_md:!1})),e.Modal=e=>/*#__PURE__*/o.default.createElement(i,r({},e,{_md:!0}))});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e||self).reactDialogPolyfill={},e.react)}(this,function(e,t){function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=/*#__PURE__*/n(t);const l=()=>"undefined"!=typeof window&&!!window.HTMLDialogElement,r=()=>"undefined"!=typeof document&&document.head;let d=0;const a="_rdp",c=t.forwardRef((e,n)=>{let{onClose:c=(()=>{}),onCancel:i=(()=>{}),children:f,open:u,_rd:s,_md:m,...p}=e;return t.useEffect(()=>{if(r()&&!l()){if(d<=0){const e=document.createElement("style");e.innerHTML="dialog:not([open]){display: none;}",e.id=a,document.head.appendChild(e)}return d++,()=>{if(d--,!r()||d>0)return;const e=document.getElementById(a);e&&document.head.removeChild(e)}}},[]),t.useEffect(()=>{const e=n.current;e&&s&&e.open!==u&&(u?m?()=>e.showModal():()=>e.show():()=>e.close())()},[s,u,n,m]),/*#__PURE__*/o.default.createElement("dialog",Object.assign({},p,{onCancel:e=>{e.preventDefault(),i(e,n.current)},onClose:e=>{c(e,n.current)},ref:n}),f)}),i=e=>{const n=t.createRef(),[r,d]=t.useState();return t.useEffect(()=>{const e=n.current;if(r||!e)return;let t=!0;return(l()?Promise.resolve():import("dialog-polyfill")).then(t=>{t&&t.default.registerDialog(e)}).catch(e=>{console.warn("dialog-polyfill could not be loaded",e)}).finally(()=>{t&&d(!0)}),()=>t=!1},[n,r]),/*#__PURE__*/o.default.createElement(c,Object.assign({},e,{_rd:r,ref:n}))};e.Dialog=e=>/*#__PURE__*/o.default.createElement(i,Object.assign({},e,{_md:!1})),e.Modal=e=>/*#__PURE__*/o.default.createElement(i,Object.assign({},e,{_md:!0}))});

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e||self).reactDialogPolyfill={},e.react)}(this,function(e,t){function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=/*#__PURE__*/n(t);function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r.apply(this,arguments)}const l=()=>"undefined"!=typeof window&&!!window.HTMLDialogElement;let d=0;const a="_rdp",f=()=>"undefined"!=typeof document&&document.head,c=t.forwardRef((e,n)=>{let{onClose:c=(()=>{}),onCancel:i=(()=>{}),...u}=e;const{children:s,open:p,_rd:m,_md:h,...y}=u;return t.useEffect(()=>{if(f()&&!l()){if(d<=0){const e=document.createElement("style");e.innerHTML="dialog:not([open]){display: none;}",e.id=a,document.head.appendChild(e)}return d++,()=>{if(d--,!f()||d>0)return;const e=document.getElementById(a);e&&document.head.removeChild(e)}}},[]),t.useEffect(()=>{const e=n.current;e&&m&&e.open!==p&&(p?h?()=>e.showModal():()=>e.show():()=>e.close())()},[m,p,n,h]),/*#__PURE__*/o.default.createElement("dialog",r({},y,{ref:n,onCancel:e=>{e.preventDefault(),i(e,n.current)},onClose:e=>{c(e,n.current)}}),s)}),i=e=>{const n=t.createRef(),[d,a]=t.useState();return t.useEffect(()=>{const e=n.current;if(d||!e)return;let t=!0;return(l()?Promise.resolve():import("dialog-polyfill")).then(t=>{t&&t.default.registerDialog(e)}).catch(e=>{}).finally(()=>{t&&a(!0)}),()=>t=!1},[n,d]),/*#__PURE__*/o.default.createElement(c,r({},e,{_rd:d,ref:n}))};e.Dialog=e=>/*#__PURE__*/o.default.createElement(i,r({},e,{_md:!1})),e.Modal=e=>/*#__PURE__*/o.default.createElement(i,r({},e,{_md:!0}))});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e||self).reactDialogPolyfill={},e.react)}(this,function(e,t){function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=/*#__PURE__*/n(t);const r=()=>"undefined"!=typeof window&&!!window.HTMLDialogElement,l=()=>"undefined"!=typeof document&&document.head;let d=0;const a="_rdp",c=t.forwardRef((e,n)=>{let{onClose:c=(()=>{}),onCancel:f=(()=>{}),children:i,open:u,_rd:s,_md:m,...p}=e;return t.useEffect(()=>{if(l()&&!r()){if(d<=0){const e=document.createElement("style");e.innerHTML="dialog:not([open]){display: none;}",e.id=a,document.head.appendChild(e)}return d++,()=>{if(d--,!l()||d>0)return;const e=document.getElementById(a);e&&document.head.removeChild(e)}}},[]),t.useEffect(()=>{const e=n.current;e&&s&&e.open!==u&&(u?m?()=>e.showModal():()=>e.show():()=>e.close())()},[s,u,n,m]),/*#__PURE__*/o.default.createElement("dialog",Object.assign({},p,{onCancel:e=>{e.preventDefault(),f(e,n.current)},onClose:e=>{c(e,n.current)},ref:n}),i)}),f=e=>{const n=t.createRef(),[l,d]=t.useState();return t.useEffect(()=>{const e=n.current;if(l||!e)return;let t=!0;return(r()?Promise.resolve():import("dialog-polyfill")).then(t=>{t&&t.default.registerDialog(e)}).catch(e=>{}).finally(()=>{t&&d(!0)}),()=>t=!1},[n,l]),/*#__PURE__*/o.default.createElement(c,Object.assign({},e,{_rd:l,ref:n}))};e.Dialog=e=>/*#__PURE__*/o.default.createElement(f,Object.assign({},e,{_md:!1})),e.Modal=e=>/*#__PURE__*/o.default.createElement(f,Object.assign({},e,{_md:!0}))});

@@ -1,1 +0,1 @@

import e,{useEffect as n,forwardRef as t,createRef as o,useState as r}from"react";function l(){return l=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},l.apply(this,arguments)}const d=()=>"undefined"!=typeof window&&!!window.HTMLDialogElement;let c=0;const a=()=>"undefined"!=typeof document&&document.head,i=t((t,o)=>{let{onClose:r=(()=>{}),onCancel:i=(()=>{}),...u}=t;const{children:s,open:m,_rd:p,_md:f,...h}=u;return n(()=>{if(a()&&!d()){if(c<=0){const e=document.createElement("style");e.innerHTML="dialog:not([open]){display: none;}",e.id="_rdp",document.head.appendChild(e)}return c++,()=>{if(c--,!a()||c>0)return;const e=document.getElementById("_rdp");e&&document.head.removeChild(e)}}},[]),n(()=>{const e=o.current;e&&p&&e.open!==m&&(m?f?()=>e.showModal():()=>e.show():()=>e.close())()},[p,m,o,f]),/*#__PURE__*/e.createElement("dialog",l({},h,{ref:o,onCancel:e=>{e.preventDefault(),i(e,o.current)},onClose:e=>{r(e,o.current)}}),s)}),u=t=>{const c=o(),[a,u]=r();return n(()=>{const e=c.current;if(a||!e)return;let n=!0;return(d()?Promise.resolve():import("dialog-polyfill")).then(n=>{n&&n.default.registerDialog(e)}).catch(e=>{console.warn("dialog-polyfill could not be loaded",e)}).finally(()=>{n&&u(!0)}),()=>n=!1},[c,a]),/*#__PURE__*/e.createElement(i,l({},t,{_rd:a,ref:c}))},s=n=>/*#__PURE__*/e.createElement(u,l({},n,{_md:!0})),m=n=>/*#__PURE__*/e.createElement(u,l({},n,{_md:!1}));export{m as Dialog,s as Modal};
import e,{forwardRef as n,useEffect as t,createRef as o,useState as r}from"react";const l=()=>"undefined"!=typeof window&&!!window.HTMLDialogElement,d=()=>"undefined"!=typeof document&&document.head;let c=0;const i=n((n,o)=>{let{onClose:r=(()=>{}),onCancel:i=(()=>{}),children:a,open:s,_rd:m,_md:u,...f}=n;return t(()=>{if(d()&&!l()){if(c<=0){const e=document.createElement("style");e.innerHTML="dialog:not([open]){display: none;}",e.id="_rdp",document.head.appendChild(e)}return c++,()=>{if(c--,!d()||c>0)return;const e=document.getElementById("_rdp");e&&document.head.removeChild(e)}}},[]),t(()=>{const e=o.current;e&&m&&e.open!==s&&(s?u?()=>e.showModal():()=>e.show():()=>e.close())()},[m,s,o,u]),/*#__PURE__*/e.createElement("dialog",Object.assign({},f,{onCancel:e=>{e.preventDefault(),i(e,o.current)},onClose:e=>{r(e,o.current)},ref:o}),a)}),a=n=>{const d=o(),[c,a]=r();return t(()=>{const e=d.current;if(c||!e)return;let n=!0;return(l()?Promise.resolve():import("dialog-polyfill")).then(n=>{n&&n.default.registerDialog(e)}).catch(e=>{console.warn("dialog-polyfill could not be loaded",e)}).finally(()=>{n&&a(!0)}),()=>n=!1},[d,c]),/*#__PURE__*/e.createElement(i,Object.assign({},n,{_rd:c,ref:d}))},s=n=>/*#__PURE__*/e.createElement(a,Object.assign({},n,{_md:!0})),m=n=>/*#__PURE__*/e.createElement(a,Object.assign({},n,{_md:!1}));export{m as Dialog,s as Modal};

@@ -1,1 +0,1 @@

import e,{useEffect as n,forwardRef as t,createRef as r,useState as o}from"react";function l(){return l=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},l.apply(this,arguments)}const c=()=>"undefined"!=typeof window&&!!window.HTMLDialogElement;let d=0;const a=()=>"undefined"!=typeof document&&document.head,i=t((t,r)=>{let{onClose:o=(()=>{}),onCancel:i=(()=>{}),...u}=t;const{children:s,open:m,_rd:p,_md:f,...h}=u;return n(()=>{if(a()&&!c()){if(d<=0){const e=document.createElement("style");e.innerHTML="dialog:not([open]){display: none;}",e.id="_rdp",document.head.appendChild(e)}return d++,()=>{if(d--,!a()||d>0)return;const e=document.getElementById("_rdp");e&&document.head.removeChild(e)}}},[]),n(()=>{const e=r.current;e&&p&&e.open!==m&&(m?f?()=>e.showModal():()=>e.show():()=>e.close())()},[p,m,r,f]),/*#__PURE__*/e.createElement("dialog",l({},h,{ref:r,onCancel:e=>{e.preventDefault(),i(e,r.current)},onClose:e=>{o(e,r.current)}}),s)}),u=t=>{const d=r(),[a,u]=o();return n(()=>{const e=d.current;if(a||!e)return;let n=!0;return(c()?Promise.resolve():import("dialog-polyfill")).then(n=>{n&&n.default.registerDialog(e)}).catch(e=>{}).finally(()=>{n&&u(!0)}),()=>n=!1},[d,a]),/*#__PURE__*/e.createElement(i,l({},t,{_rd:a,ref:d}))},s=n=>/*#__PURE__*/e.createElement(u,l({},n,{_md:!0})),m=n=>/*#__PURE__*/e.createElement(u,l({},n,{_md:!1}));export{m as Dialog,s as Modal};
import e,{forwardRef as n,useEffect as t,createRef as o,useState as r}from"react";const d=()=>"undefined"!=typeof window&&!!window.HTMLDialogElement,l=()=>"undefined"!=typeof document&&document.head;let c=0;const i=n((n,o)=>{let{onClose:r=(()=>{}),onCancel:i=(()=>{}),children:a,open:s,_rd:m,_md:u,...f}=n;return t(()=>{if(l()&&!d()){if(c<=0){const e=document.createElement("style");e.innerHTML="dialog:not([open]){display: none;}",e.id="_rdp",document.head.appendChild(e)}return c++,()=>{if(c--,!l()||c>0)return;const e=document.getElementById("_rdp");e&&document.head.removeChild(e)}}},[]),t(()=>{const e=o.current;e&&m&&e.open!==s&&(s?u?()=>e.showModal():()=>e.show():()=>e.close())()},[m,s,o,u]),/*#__PURE__*/e.createElement("dialog",Object.assign({},f,{onCancel:e=>{e.preventDefault(),i(e,o.current)},onClose:e=>{r(e,o.current)},ref:o}),a)}),a=n=>{const l=o(),[c,a]=r();return t(()=>{const e=l.current;if(c||!e)return;let n=!0;return(d()?Promise.resolve():import("dialog-polyfill")).then(n=>{n&&n.default.registerDialog(e)}).catch(e=>{}).finally(()=>{n&&a(!0)}),()=>n=!1},[l,c]),/*#__PURE__*/e.createElement(i,Object.assign({},n,{_rd:c,ref:l}))},s=n=>/*#__PURE__*/e.createElement(a,Object.assign({},n,{_md:!0})),m=n=>/*#__PURE__*/e.createElement(a,Object.assign({},n,{_md:!1}));export{m as Dialog,s as Modal};
{
"name": "react-dialog-polyfill",
"version": "1.2.0",
"version": "1.3.0",
"description": "<dialog> element bundled with polyfill for React",

@@ -41,8 +41,5 @@ "main": "lib/index.js",

"devDependencies": {
"eslint": "^9.6.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-webpack-plugin": "^4.2.0",
"microbundle": "^0.15.1",
"prettier": "^3.3.2",
"rimraf": "^5.0.8"
"@biomejs/biome": "^1.8.3",
"microbundle": "0.15.1",
"rimraf": "^6.0.1"
},

@@ -61,5 +58,6 @@ "dependencies": {

"build": "pnpm build:dev:module && pnpm build:dev:umd && pnpm build:module && pnpm build:umd && pnpm build:types",
"format": "prettier --write \"{src,tests}/**/*.js\"",
"package": "pnpm publish --no-git-checks --access public"
"format": "biome format --write ./src",
"package": "pnpm publish --no-git-checks --access public",
"lint": "biome lint"
}
}
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