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.1.7 to 1.2.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)=>{const{children:f,open:i,_rd:u,onCancel:s,onClose:p,_md:m,...y}=e;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&&u&&e.open!==i&&(i?m?()=>e.showModal():()=>e.show():()=>e.close())()},[u,i,n,m]),/*#__PURE__*/o.default.createElement("dialog",r({},y,{ref:n,onCancel:e=>{e.preventDefault(),s(e,n.current)},onClose:e=>{p(e,n.current)}}),f)});f.defaultProps={onClose:()=>{},onCancel:()=>{}};const 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);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}))});

@@ -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 a=0;const d="_rdp",c=()=>"undefined"!=typeof document&&document.head,f=t.forwardRef((e,n)=>{const{children:f,open:i,_rd:u,onCancel:s,onClose:p,_md:m,...h}=e;return t.useEffect(()=>{if(c()&&!l()){if(a<=0){const e=document.createElement("style");e.innerHTML="dialog:not([open]){display: none;}",e.id=d,document.head.appendChild(e)}return a++,()=>{if(a--,!c()||a>0)return;const e=document.getElementById(d);e&&document.head.removeChild(e)}}},[]),t.useEffect(()=>{const e=n.current;e&&u&&e.open!==i&&(i?m?()=>e.showModal():()=>e.show():()=>e.close())()},[u,i,n,m]),/*#__PURE__*/o.default.createElement("dialog",r({},h,{ref:n,onCancel:e=>{e.preventDefault(),s(e,n.current)},onClose:e=>{p(e,n.current)}}),f)});f.defaultProps={onClose:()=>{},onCancel:()=>{}};const i=e=>{const n=t.createRef(),[a,d]=t.useState();return t.useEffect(()=>{const e=n.current;if(a||!e)return;let t=!0;return(l()?Promise.resolve():import("dialog-polyfill")).then(t=>{t&&t.default.registerDialog(e)}).catch(e=>{}).finally(()=>{t&&d(!0)}),()=>t=!1},[n,a]),/*#__PURE__*/o.default.createElement(f,r({},e,{_rd:a,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);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}))});

@@ -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 c=()=>"undefined"!=typeof window&&!!window.HTMLDialogElement;let d=0;const a=()=>"undefined"!=typeof document&&document.head,i=t((t,o)=>{const{children:r,open:i,_rd:s,onCancel:u,onClose:p,_md:f,...m}=t;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=o.current;e&&s&&e.open!==i&&(i?f?()=>e.showModal():()=>e.show():()=>e.close())()},[s,i,o,f]),/*#__PURE__*/e.createElement("dialog",l({},m,{ref:o,onCancel:e=>{e.preventDefault(),u(e,o.current)},onClose:e=>{p(e,o.current)}}),r)});i.defaultProps={onClose:()=>{},onCancel:()=>{}};const s=t=>{const d=o(),[a,s]=r();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=>{console.warn("dialog-polyfill could not be loaded",e)}).finally(()=>{n&&s(!0)}),()=>n=!1},[d,a]),/*#__PURE__*/e.createElement(i,l({},t,{_rd:a,ref:d}))},u=n=>/*#__PURE__*/e.createElement(s,l({},n,{_md:!0})),p=n=>/*#__PURE__*/e.createElement(s,l({},n,{_md:!1}));export{p as Dialog,u as Modal};
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};

@@ -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 c=()=>"undefined"!=typeof window&&!!window.HTMLDialogElement;let d=0;const a=()=>"undefined"!=typeof document&&document.head,i=t((t,o)=>{const{children:r,open:i,_rd:s,onCancel:u,onClose:m,_md:p,...f}=t;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=o.current;e&&s&&e.open!==i&&(i?p?()=>e.showModal():()=>e.show():()=>e.close())()},[s,i,o,p]),/*#__PURE__*/e.createElement("dialog",l({},f,{ref:o,onCancel:e=>{e.preventDefault(),u(e,o.current)},onClose:e=>{m(e,o.current)}}),r)});i.defaultProps={onClose:()=>{},onCancel:()=>{}};const s=t=>{const d=o(),[a,s]=r();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&&s(!0)}),()=>n=!1},[d,a]),/*#__PURE__*/e.createElement(i,l({},t,{_rd:a,ref:d}))},u=n=>/*#__PURE__*/e.createElement(s,l({},n,{_md:!0})),m=n=>/*#__PURE__*/e.createElement(s,l({},n,{_md:!1}));export{m as Dialog,u as Modal};
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};
{
"name": "react-dialog-polyfill",
"version": "1.1.7",
"version": "1.2.0",
"description": "<dialog> element bundled with polyfill for React",

@@ -18,13 +18,2 @@ "main": "lib/index.js",

],
"scripts": {
"test": "echo \"No tests \" && exit 0",
"build:module": "microbundle --no-pkg-main --no-sourcemap --no-generateTypes --jsx React.createElement --define __isDev__=false -i src/index.js -o lib/react-dialog-polyfill.module.js -f es",
"build:umd": "microbundle --no-pkg-main --no-sourcemap --no-generateTypes --jsx React.createElement --define __isDev__=false -i src/index.js -o lib/react-dialog-polyfill.js -f umd",
"build:dev:module": "microbundle --no-pkg-main --no-sourcemap --no-generateTypes --jsx React.createElement --define __isDev__=true -i src/index.js -o lib/react-dialog-polyfill.module.dev.js -f es",
"build:dev:umd": "microbundle --no-pkg-main --no-sourcemap --no-generateTypes --jsx React.createElement --define __isDev__=true -i src/index.js -o lib/react-dialog-polyfill.dev.js -f umd",
"build:types": "cp src/index.d.ts lib/index.d.ts",
"clean": "rimraf lib/react-dialog-polyfill.dev.js lib/react-dialog-polyfill.js lib/react-dialog-polyfill.module.dev.js lib/react-dialog-polyfill.module.js lib/index.d.ts",
"build": "yarn build:dev:module && yarn build:dev:umd && yarn build:module && yarn build:umd && yarn build:types",
"format": "prettier --write \"{src,tests}/**/*.js\""
},
"repository": {

@@ -50,15 +39,27 @@ "type": "git",

"peerDependencies": {
"react": "^0.13.0 || ^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
"react": "^0.13.0 || ^0.14.0 || >=15"
},
"devDependencies": {
"eslint": "^8.25.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-webpack-plugin": "^3.2.0",
"eslint": "^9.6.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-webpack-plugin": "^4.2.0",
"microbundle": "^0.15.1",
"prettier": "^2.7.1",
"rimraf": "^3.0.2"
"prettier": "^3.3.2",
"rimraf": "^5.0.8"
},
"dependencies": {
"dialog-polyfill": "^0.5.6"
},
"scripts": {
"test": "echo \"No tests \" && exit 0",
"build:module": "microbundle --no-pkg-main --no-sourcemap --no-generateTypes --jsx React.createElement --define __isDev__=false -i src/index.js -o lib/react-dialog-polyfill.module.js -f es",
"build:umd": "microbundle --no-pkg-main --no-sourcemap --no-generateTypes --jsx React.createElement --define __isDev__=false -i src/index.js -o lib/react-dialog-polyfill.js -f umd",
"build:dev:module": "microbundle --no-pkg-main --no-sourcemap --no-generateTypes --jsx React.createElement --define __isDev__=true -i src/index.js -o lib/react-dialog-polyfill.module.dev.js -f es",
"build:dev:umd": "microbundle --no-pkg-main --no-sourcemap --no-generateTypes --jsx React.createElement --define __isDev__=true -i src/index.js -o lib/react-dialog-polyfill.dev.js -f umd",
"build:types": "cp src/index.d.ts lib/index.d.ts",
"clean": "rimraf lib/react-dialog-polyfill.dev.js lib/react-dialog-polyfill.js lib/react-dialog-polyfill.module.dev.js lib/react-dialog-polyfill.module.js lib/index.d.ts",
"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"
}
}
}
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