@leafygreen-ui/portal
Advanced tools
Comparing version 4.0.1 to 4.0.2
# @leafygreen-ui/portal | ||
## 4.0.2 | ||
### Patch Changes | ||
- 548ca2c: Replace useLayoutEffect with useIsomorphicLayoutEffect hook | ||
## 4.0.1 | ||
@@ -4,0 +10,0 @@ |
@@ -1,2 +0,2 @@ | ||
import{useLayoutEffect as r,useState as t}from"react";import n from"prop-types";import{createPortal as e}from"react-dom";function o(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null==n)return;var e,o,a=[],i=!0,l=!1;try{for(n=n.call(r);!(i=(e=n.next()).done)&&(a.push(e.value),!t||a.length!==t);i=!0);}catch(r){l=!0,o=r}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(r,t)||function(r,t){if(!r)return;if("string"==typeof r)return a(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);"Object"===n&&r.constructor&&(n=r.constructor.name);if("Map"===n||"Set"===n)return Array.from(r);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(r,t)}(r,t)||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.")}()}function a(r,t){(null==t||t>r.length)&&(t=r.length);for(var n=0,e=new Array(t);n<t;n++)e[n]=r[n];return e}function i(n){var a,i=function(n){var e=o(t(),2),a=e[0],i=e[1];return r((function(){if(!n){var r=document.createElement("div");return document.body.appendChild(r),i(r),function(){r.remove()}}i(n)}),[n]),a}(null!==(a=n.container)&&void 0!==a?a:void 0);return r((function(){var r;i&&!n.container&&(i.className=null!==(r=n.className)&&void 0!==r?r:"")}),[i,n.container,n.className]),i?e(n.children,i):null}i.displayName="Portal",i.propTypes={children:n.node,className:n.string,container:n.oneOfType([n.node,n.object])};export default i; | ||
import{useState as r}from"react";import t from"prop-types";import{createPortal as n}from"react-dom";import{useIsomorphicLayoutEffect as e}from"@leafygreen-ui/hooks";function o(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null==n)return;var e,o,a=[],i=!0,l=!1;try{for(n=n.call(r);!(i=(e=n.next()).done)&&(a.push(e.value),!t||a.length!==t);i=!0);}catch(r){l=!0,o=r}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(r,t)||function(r,t){if(!r)return;if("string"==typeof r)return a(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);"Object"===n&&r.constructor&&(n=r.constructor.name);if("Map"===n||"Set"===n)return Array.from(r);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(r,t)}(r,t)||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.")}()}function a(r,t){(null==t||t>r.length)&&(t=r.length);for(var n=0,e=new Array(t);n<t;n++)e[n]=r[n];return e}function i(t){var a,i=function(t){var n=o(r(),2),a=n[0],i=n[1];return e((function(){if(!t){var r=document.createElement("div");return document.body.appendChild(r),i(r),function(){r.remove()}}i(t)}),[t]),a}(null!==(a=t.container)&&void 0!==a?a:void 0);return e((function(){var r;i&&!t.container&&(i.className=null!==(r=t.className)&&void 0!==r?r:"")}),[i,t.container,t.className]),i?n(t.children,i):null}i.displayName="Portal",i.propTypes={children:t.node,className:t.string,container:t.oneOfType([t.node,t.object])};export default i; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("prop-types"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","prop-types","react-dom"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["@leafygreen-ui/portal"]=t(e.React,e.PropTypes,e.ReactDOM)}(this,(function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,a=[],u=!0,i=!1;try{for(r=r.call(e);!(u=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);u=!0);}catch(e){i=!0,o=e}finally{try{u||null==r.return||r.return()}finally{if(i)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,t)}(e,t)||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.")}()}function u(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 i(t){var n,o=function(t){var r=a(e.useState(),2),n=r[0],o=r[1];return e.useLayoutEffect((function(){if(!t){var e=document.createElement("div");return document.body.appendChild(e),o(e),function(){e.remove()}}o(t)}),[t]),n}(null!==(n=t.container)&&void 0!==n?n:void 0);return e.useLayoutEffect((function(){var e;o&&!t.container&&(o.className=null!==(e=t.className)&&void 0!==e?e:"")}),[o,t.container,t.className]),o?r.createPortal(t.children,o):null}return i.displayName="Portal",i.propTypes={children:o.default.node,className:o.default.string,container:o.default.oneOfType([o.default.node,o.default.object])},i})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("prop-types"),require("react-dom"),require("@leafygreen-ui/hooks")):"function"==typeof define&&define.amd?define(["react","prop-types","react-dom","@leafygreen-ui/hooks"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["@leafygreen-ui/portal"]=t(e.React,e.PropTypes,e.ReactDOM,e["@leafygreen-ui/hooks"])}(this,(function(e,t,r,n){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(t);function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,a=[],u=!0,i=!1;try{for(r=r.call(e);!(u=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);u=!0);}catch(e){i=!0,o=e}finally{try{u||null==r.return||r.return()}finally{if(i)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e,t)||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.")}()}function i(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(t){var o,a=function(t){var r=u(e.useState(),2),o=r[0],a=r[1];return n.useIsomorphicLayoutEffect((function(){if(!t){var e=document.createElement("div");return document.body.appendChild(e),a(e),function(){e.remove()}}a(t)}),[t]),o}(null!==(o=t.container)&&void 0!==o?o:void 0);return n.useIsomorphicLayoutEffect((function(){var e;a&&!t.container&&(a.className=null!==(e=t.className)&&void 0!==e?e:"")}),[a,t.container,t.className]),a?r.createPortal(t.children,a):null}return l.displayName="Portal",l.propTypes={children:a.default.node,className:a.default.string,container:a.default.oneOfType([a.default.node,a.default.object])},l})); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@leafygreen-ui/portal", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "LeafyGreen UI Kit Portal", | ||
@@ -26,2 +26,3 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"@leafygreen-ui/hooks": "^7.1.1", | ||
"@leafygreen-ui/lib": "^9.0.0" | ||
@@ -28,0 +29,0 @@ }, |
@@ -18,4 +18,7 @@ { | ||
"path": "../theme" | ||
}, | ||
{ | ||
"path": "../../packages/hooks" | ||
} | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
185530
290
3
+ Added@leafygreen-ui/hooks@^7.1.1
+ Added@leafygreen-ui/hooks@7.7.8(transitive)