react-dialog-polyfill
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -1,1 +0,1 @@ | ||
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react")):"function"==typeof define&&define.amd?define(["react"],r):"object"==typeof exports?exports["react-dialog-polyfill"]=r(require("react")):e["react-dialog-polyfill"]=r(e.react)}(this,(function(e){return(()=>{"use strict";var r,t,n={811:e=>{e.exports=require("dialog-polyfill")},297:r=>{r.exports=e}},o={};function a(e){var r=o[e];if(void 0!==r)return r.exports;var t=o[e]={exports:{}};return n[e](t,t.exports,a),t.exports}a.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,n){if(1&n&&(e=this(e)),8&n)return e;if("object"==typeof e&&e){if(4&n&&e.__esModule)return e;if(16&n&&"function"==typeof e.then)return e}var o=Object.create(null);a.r(o);var u={};r=r||[null,t({}),t([]),t(t)];for(var l=2&n&&e;"object"==typeof l&&!~r.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach((r=>u[r]=()=>e[r]));return u.default=()=>e,a.d(o,u),o},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{a.r(u),a.d(u,{Modal:()=>i,Dialog:()=>f});var e=a(297),r=a.n(e);function t(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function n(){return(n=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}var o=(0,e.forwardRef)((function(t,o){var a=t.children,u=t.open,l=t.ready,i=t.onCancel,f=t.onClose,c=t.useAsModal,s=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(t,["children","open","ready","onCancel","onClose","useAsModal"]);return(0,e.useEffect)((function(){var e=o.current;e&&l&&e.open!==u&&(u?c?function(){return e.showModal()}:function(){return e.show()}:function(){return e.close()})()}),[l,u,o,c]),r().createElement("dialog",n({},s,{ref:o,onCancel:function(e){e.preventDefault(),i(e,o.current)},onClose:function(e){f(e,o.current)}}),a)}));o.defaultProps={onClose:function(){},onCancel:function(){}};var l=function(u){var l,i,f=(0,e.createRef)(),c=(l=(0,e.useState)(),i=2,function(e){if(Array.isArray(e))return e}(l)||function(e,r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var t=[],n=!0,o=!1,a=void 0;try{for(var u,l=e[Symbol.iterator]();!(n=(u=l.next()).done)&&(t.push(u.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==l.return||l.return()}finally{if(o)throw a}}return t}}(l,i)||function(e,r){if(e){if("string"==typeof e)return t(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,r):void 0}}(l,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=c[0],d=c[1];return(0,e.useEffect)((function(){var e=f.current;if(!s&&e){var r=!0;return Promise.resolve().then(a.t.bind(a,811,23)).then((function(r){r.default.registerDialog(e)})).catch((function(e){return console.warn("dialog-polyfill was not loaded")})).finally((function(){r&&d(!0)})),function(){return r=!1}}}),[f,s]),r().createElement(o,n({},u,{ready:s,ref:f}))},i=function(e){return r().createElement(l,n({},e,{useAsModal:!0}))},f=function(e){return r().createElement(l,n({},e,{useAsModal:!1}))}})(),u})()})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports["react-dialog-polyfill"]=t(require("react")):e["react-dialog-polyfill"]=t(e.react)}(this,(function(e){return(()=>{"use strict";var t,r,n={917:e=>{e.exports=require("dialog-polyfill")},156:t=>{t.exports=e}},o={};function u(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return n[e](r,r.exports,u),r.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,u.t=function(e,n){if(1&n&&(e=this(e)),8&n)return e;if("object"==typeof e&&e){if(4&n&&e.__esModule)return e;if(16&n&&"function"==typeof e.then)return e}var o=Object.create(null);u.r(o);var a={};t=t||[null,r({}),r([]),r(r)];for(var l=2&n&&e;"object"==typeof l&&!~t.indexOf(l);l=r(l))Object.getOwnPropertyNames(l).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,u.d(o,a),o},u.d=(e,t)=>{for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{u.r(a),u.d(a,{Dialog:()=>d,Modal:()=>f});var e=u(156),t=u.n(e),r=function(){return"undefined"!=typeof document&&document.head};var n=["children","open","ready","onCancel","onClose","useAsModal"];function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l.apply(this,arguments)}var c=(0,e.forwardRef)((function(o,u){var a,c,i=o.children,f=o.open,d=o.ready,s=o.onCancel,p=o.onClose,y=o.useAsModal,v=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(o,n);return a="dialog:not([open]){display: none;}",c=(0,e.useRef)(),(0,e.useEffect)((function(){if(r())return c.current=document.createElement("style"),c.current.innerHTML=a,document.head.appendChild(c.current),function(){r()&&c.current&&document.head.removeChild(c.current)}}),[a]),(0,e.useEffect)((function(){var e=u.current;e&&d&&e.open!==f&&(f?y?function(){return e.showModal()}:function(){return e.show()}:function(){return e.close()})()}),[d,f,u,y]),t().createElement("dialog",l({},v,{ref:u,onCancel:function(e){e.preventDefault(),s(e,u.current)},onClose:function(e){p(e,u.current)}}),i)}));c.defaultProps={onClose:function(){},onCancel:function(){}};var i=function(r){var n,a,i=(0,e.createRef)(),f=(n=(0,e.useState)(),a=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,u=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(u.push(n.value),!t||u.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return u}}(n,a)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(n,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=f[0],s=f[1];return(0,e.useEffect)((function(){var e=i.current;if(!d&&e){var t=!0;return Promise.resolve().then(u.t.bind(u,917,23)).then((function(t){t.default.registerDialog(e)})).catch((function(e){return console.warn("dialog-polyfill was not loaded")})).finally((function(){t&&s(!0)})),function(){return t=!1}}}),[i,d]),t().createElement(c,l({},r,{ready:d,ref:i}))},f=function(e){return t().createElement(i,l({},e,{useAsModal:!0}))},d=function(e){return t().createElement(i,l({},e,{useAsModal:!1}))}})(),a})()})); |
{ | ||
"name": "react-dialog-polyfill", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "<dialog> element bundled with polyfill for React", | ||
@@ -39,16 +39,16 @@ "main": "lib/react-dialog-polyfill.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.13.15", | ||
"@babel/eslint-parser": "^7.13.14", | ||
"@babel/plugin-proposal-class-properties": "^7.13.0", | ||
"@babel/preset-env": "^7.13.15", | ||
"@babel/preset-react": "^7.13.13", | ||
"babel-loader": "^8.2.2", | ||
"eslint": "^7.23.0", | ||
"eslint-plugin-react-hooks": "^4.2.0", | ||
"eslint-webpack-plugin": "^2.5.3", | ||
"@babel/core": "^7.17.5", | ||
"@babel/eslint-parser": "^7.17.0", | ||
"@babel/plugin-proposal-class-properties": "^7.16.7", | ||
"@babel/preset-env": "^7.16.11", | ||
"@babel/preset-react": "^7.16.7", | ||
"babel-loader": "^8.2.3", | ||
"eslint": "^8.10.0", | ||
"eslint-plugin-react-hooks": "^4.3.0", | ||
"eslint-webpack-plugin": "^3.1.1", | ||
"peer-deps-externals-webpack-plugin": "^1.0.4", | ||
"rimraf": "^3.0.2", | ||
"webpack": "^5.31.2", | ||
"webpack-cli": "^4.6.0", | ||
"webpack-node-externals": "^2.5.2" | ||
"webpack": "^5.70.0", | ||
"webpack-cli": "^4.9.2", | ||
"webpack-node-externals": "^3.0.0" | ||
}, | ||
@@ -55,0 +55,0 @@ "dependencies": { |
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
14248