@interop-ui/react-portal
Advanced tools
Comparing version 0.0.1-5 to 0.0.1-6
@@ -1,2 +0,2 @@ | ||
var e,r,t,n=require("@interop-ui/react-debug-context").useDebugContext,o=(e=require("react-dom"))&&e.__esModule?e.default:e,u=(r={},t=require("react"),Object.keys(t).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return t[e]}})})),r);function i(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,u=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw u}}return t}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return a(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,r)}(e,r)||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(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 l(){return"undefined"!=typeof document?document.createElement("interop-portal"):null}exports.Portal=function(e){var r=e.children,t=e.containerRef,a=n(),c=i(u.useState(l),1)[0];return u.useEffect((function(){if(c){var e;if(void 0!==a.portalContainerRef)null===(e=a.portalContainerRef.current)||void 0===e||e.appendChild(c);else t&&t.current?t.current.appendChild(c):document.body.appendChild(c);return function(){c.remove()}}}),[c,t,a.portalContainerRef]),c?o.createPortal(r,c):null}; | ||
var e,r,t,n=require("@interop-ui/react-utils").useLayoutEffect,o=require("@interop-ui/react-debug-context").useDebugContext,u=(e=require("react-dom"))&&e.__esModule?e.default:e,i=(r={},t=require("react"),Object.keys(t).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return t[e]}})})),r);function a(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,u=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw u}}return t}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return l(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return l(e,r)}(e,r)||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 l(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 c(){return"undefined"!=typeof document?document.createElement("interop-portal"):null}exports.Portal=function(e){var r=e.children,t=e.containerRef,l=o(),f=a(i.useState(c),1)[0];return n((function(){if(f){var e;if(void 0!==l.portalContainerRef)null===(e=l.portalContainerRef.current)||void 0===e||e.appendChild(f);else t&&t.current?t.current.appendChild(f):document.body.appendChild(f);return function(){f.remove()}}}),[f,t,l.portalContainerRef]),f?u.createPortal(r,f):null}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{useDebugContext as e}from"@interop-ui/react-debug-context";import t from"react-dom";import*as r from"react";export const Portal=({children:o,containerRef:a})=>{const i=e(),[c]=r.useState(n);return r.useEffect(()=>{if(c){var e;if(void 0!==i.portalContainerRef)null===(e=i.portalContainerRef.current)||void 0===e||e.appendChild(c);else a&&a.current?a.current.appendChild(c):document.body.appendChild(c);return()=>{c.remove()}}},[c,a,i.portalContainerRef]),c?t.createPortal(o,c):null};function n(){return"undefined"!=typeof document?document.createElement("interop-portal"):null} | ||
import{useLayoutEffect as e}from"@interop-ui/react-utils";import{useDebugContext as r}from"@interop-ui/react-debug-context";import t from"react-dom";import*as n from"react";export const Portal=({children:i,containerRef:a})=>{const l=r(),[p]=n.useState(o);return e((()=>{if(p){var e;if(void 0!==l.portalContainerRef)null===(e=l.portalContainerRef.current)||void 0===e||e.appendChild(p);else a&&a.current?a.current.appendChild(p):document.body.appendChild(p);return()=>{p.remove()}}}),[p,a,l.portalContainerRef]),p?t.createPortal(i,p):null};function o(){return"undefined"!=typeof document?document.createElement("interop-portal"):null} | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@interop-ui/react-portal", | ||
"version": "0.0.1-5", | ||
"version": "0.0.1-6", | ||
"license": "MIT", | ||
@@ -20,4 +20,4 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"@interop-ui/react-debug-context": "0.0.1-5", | ||
"@interop-ui/react-utils": "0.0.1-5", | ||
"@interop-ui/react-debug-context": "0.0.1-6", | ||
"@interop-ui/react-utils": "0.0.1-6", | ||
"@interop-ui/utils": "0.0.1-3" | ||
@@ -24,0 +24,0 @@ }, |
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
11165
+ Added@interop-ui/react-debug-context@0.0.1-6(transitive)
+ Added@interop-ui/react-utils@0.0.1-6(transitive)
- Removed@interop-ui/react-debug-context@0.0.1-5(transitive)
- Removed@interop-ui/react-utils@0.0.1-5(transitive)