@radix-ui/react-portal
Advanced tools
Comparing version 0.0.3 to 0.0.4
import * as React from "react"; | ||
type PortalProps = { | ||
children: React.ReactNode; | ||
import { Primitive } from "@radix-ui/react-primitive"; | ||
import * as Polymorphic from "@radix-ui/react-polymorphic"; | ||
import { Merge } from "@radix-ui/utils"; | ||
type PortalOwnProps = Merge<Polymorphic.OwnProps<typeof Primitive>, { | ||
containerRef?: React.RefObject<HTMLElement>; | ||
}; | ||
export const Portal: React.FC<PortalProps>; | ||
export const Root: React.FC<PortalProps>; | ||
}>; | ||
type PortalPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Primitive>, PortalOwnProps>; | ||
export const Portal: PortalPrimitive; | ||
export const Root: PortalPrimitive; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
var r,e,t,n=require("@radix-ui/react-utils").useLayoutEffect,o=(r=require("react-dom"))&&r.__esModule?r.default:r,u=(e={},t=require("react"),Object.keys(t).forEach((function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})})),e);function a(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(r)))return;var t=[],n=!0,o=!1,u=void 0;try{for(var a,i=r[Symbol.iterator]();!(n=(a=i.next()).done)&&(t.push(a.value),!e||t.length!==e);n=!0);}catch(r){o=!0,u=r}finally{try{n||null==i.return||i.return()}finally{if(o)throw u}}return t}(r,e)||function(r,e){if(!r)return;if("string"==typeof r)return i(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(r,e)}(r,e)||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(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}var l=function(r){var e,t=r.children,i=r.containerRef,l=null!==(e=null==i?void 0:i.current)&&void 0!==e?e:"undefined"!=typeof document?document.body:void 0,c=a(u.useState({}),2)[1];if(n((function(){c({})}),[]),l){return o.createPortal(u.createElement("radix-portal",null,t),l)}return null};exports.Portal=l;var c=l;exports.Root=c; | ||
var e,r,t,n=require("@radix-ui/react-primitive").Primitive,o=require("@radix-ui/utils").getSelector,i=require("@radix-ui/react-utils").useLayoutEffect,u=(e=require("react-dom"))&&e.__esModule?e.default:e,c=(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(){return(a=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)}function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function f(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?l(Object(t),!0).forEach((function(r){y(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function y(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function s(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,i=void 0;try{for(var u,c=e[Symbol.iterator]();!(n=(u=c.next()).done)&&(t.push(u.value),!r||t.length!==r);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return t}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return b(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 b(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 b(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 p(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var d=c.forwardRef((function(e,r){var t,l=e.selector,y=void 0===l?o("Portal"):l,b=e.containerRef,d=e.style,O=p(e,["selector","containerRef","style"]),v=null!==(t=null==b?void 0:b.current)&&void 0!==t?t:"undefined"!=typeof document?document.body:void 0,m=s(c.useState({}),2)[1];return i((function(){m({})}),[]),v?u.createPortal(c.createElement(n,a({selector:y},O,{ref:r,style:v===document.body?f({position:"absolute",top:0,left:0,zIndex:2147483647},d):void 0})),v):null}));exports.Portal=d;var O=d;exports.Root=O; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{useLayoutEffect as t}from"@radix-ui/react-utils";import r from"react-dom";import*as o from"react";export const Portal=({children:e,containerRef:n})=>{var a;const l=null!==(a=null==n?void 0:n.current)&&void 0!==a?a:"undefined"!=typeof document?document.body:void 0,[,c]=o.useState({});if(t((()=>{c({})}),[]),l){const t="radix-portal";return r.createPortal(o.createElement(t,null,e),l)}return null};export const Root=Portal; | ||
import{Primitive as e}from"@radix-ui/react-primitive";import{getSelector as t}from"@radix-ui/utils";import{useLayoutEffect as r}from"@radix-ui/react-utils";import o from"react-dom";import*as n from"react";function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},c=Object.keys(e);for(o=0;o<c.length;o++)r=c[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)r=c[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}const f="Portal";export const Portal=n.forwardRef(((i,u)=>{var p;const{selector:s=t(f),containerRef:b,style:O}=i,y=a(i,["selector","containerRef","style"]),m=null!==(p=null==b?void 0:b.current)&&void 0!==p?p:"undefined"!=typeof document?document.body:void 0,[,d]=n.useState({});return r((()=>{d({})}),[]),m?o.createPortal(n.createElement(e,c({selector:s},y,{ref:u,style:m===document.body?l({position:"absolute",top:0,left:0,zIndex:2147483647},O):void 0})),m):null}));export const Root=Portal; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-portal", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"license": "MIT", | ||
@@ -19,3 +19,6 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"@radix-ui/react-utils": "0.0.3" | ||
"@radix-ui/react-polymorphic": "0.0.4", | ||
"@radix-ui/react-primitive": "0.0.3", | ||
"@radix-ui/react-utils": "0.0.4", | ||
"@radix-ui/utils": "0.0.3" | ||
}, | ||
@@ -22,0 +25,0 @@ "peerDependencies": { |
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
16120
33
6
+ Added@radix-ui/utils@0.0.3
+ Added@radix-ui/react-polymorphic@0.0.4(transitive)
+ Added@radix-ui/react-primitive@0.0.3(transitive)
+ Added@radix-ui/react-utils@0.0.4(transitive)
- Removed@radix-ui/react-polymorphic@0.0.3(transitive)
- Removed@radix-ui/react-utils@0.0.3(transitive)
Updated@radix-ui/react-utils@0.0.4