You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@reach/dialog

Package Overview
Dependencies
8
Maintainers
4
Versions
67
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.9.1 to 0.10.0

17

dist/dialog.cjs.development.js

@@ -74,3 +74,18 @@ 'use strict';

return utils.checkStyles("dialog");
}, []);
}, []); // We want to ignore the immediate focus of a tooltip so it doesn't pop
// up again when the menu closes, only pops up when focus returns again
// to the tooltip (like native OS tooltips).
React.useEffect(function () {
if (isOpen) {
// @ts-ignore
window.__REACH_DISABLE_TOOLTIPS = true;
} else {
window.requestAnimationFrame(function () {
// Wait a frame so that this doesn't fire before tooltip does
// @ts-ignore
window.__REACH_DISABLE_TOOLTIPS = false;
});
}
}, [isOpen]);
return isOpen ? React__default.createElement(Portal, {

@@ -77,0 +92,0 @@ "data-reach-dialog-wrapper": ""

2

dist/dialog.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var o=require("react"),n=e(o),r=e(require("@reach/portal")),t=require("@reach/utils"),i=e(require("react-focus-lock")),a=require("react-remove-scroll");function c(e,o){if(null==e)return{};var n,r,t={},i=Object.keys(e);for(r=0;r<i.length;r++)o.indexOf(n=i[r])>=0||(t[n]=e[n]);return t}e(require("prop-types"));var u=o.forwardRef((function(e,i){var a=e.isOpen,u=void 0===a||a,s=c(e,["isOpen"]);return o.useEffect((function(){return t.checkStyles("dialog")}),[]),u?n.createElement(r,{"data-reach-dialog-wrapper":""},n.createElement(l,Object.assign({ref:i},s))):null})),l=o.forwardRef((function(e,r){var u=e.allowPinchZoom,l=e.initialFocusRef,s=e.onClick,f=e.onDismiss,d=void 0===f?t.noop:f,p=e.onMouseDown,v=e.onKeyDown,m=c(e,["allowPinchZoom","initialFocusRef","onClick","onDismiss","onMouseDown","onKeyDown"]),w=o.useRef(null),h=o.useRef(null),g=t.useForkedRef(h,r),E=o.useCallback((function(){l&&l.current&&l.current.focus()}),[l]);return o.useEffect((function(){return h.current?(o=[],n=[],r=t.getOwnerDocument(e=h.current)||document,e?(Array.prototype.forEach.call(r.querySelectorAll("body > *"),(function(r){var t,i;if(r!==(null===(t=e.parentNode)||void 0===t||null===(i=t.parentNode)||void 0===i?void 0:i.parentNode)){var a=r.getAttribute("aria-hidden");null!==a&&"false"!==a||(o.push(a),n.push(r),r.setAttribute("aria-hidden","true"))}})),function(){n.forEach((function(e,n){var r=o[n];null===r?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r)}))}):t.noop):void 0;var e,o,n,r}),[]),n.createElement(i,{autoFocus:!0,returnFocus:!0,onActivation:E},n.createElement(a.RemoveScroll,{allowPinchZoom:u},n.createElement("div",Object.assign({},m,{ref:g,"data-reach-dialog-overlay":"",onClick:t.wrapEvent(s,(function(e){w.current===e.target&&(e.stopPropagation(),d(e))})),onKeyDown:t.wrapEvent(v,(function(e){"Escape"===e.key&&(e.stopPropagation(),d(e))})),onMouseDown:t.wrapEvent(p,(function(e){w.current=e.target}))}))))})),s=o.forwardRef((function(e,o){var r=e.onClick,i=c(e,["onClick","onKeyDown"]);return n.createElement("div",Object.assign({"aria-modal":"true",role:"dialog",tabIndex:-1},i,{ref:o,"data-reach-dialog-content":"",onClick:t.wrapEvent(r,(function(e){e.stopPropagation()}))}))})),f=o.forwardRef((function(e,o){var r=e.isOpen,i=e.onDismiss,a=void 0===i?t.noop:i,l=e.initialFocusRef,f=e.allowPinchZoom,d=c(e,["isOpen","onDismiss","initialFocusRef","allowPinchZoom"]);return n.createElement(u,{initialFocusRef:l,allowPinchZoom:f,isOpen:r,onDismiss:a},n.createElement(s,Object.assign({ref:o},d)))}));exports.Dialog=f,exports.DialogContent=s,exports.DialogOverlay=u,exports.default=f;
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react"),o=e(n),t=e(require("@reach/portal")),r=require("@reach/utils"),i=e(require("react-focus-lock")),a=require("react-remove-scroll");function c(e,n){if(null==e)return{};var o,t,r={},i=Object.keys(e);for(t=0;t<i.length;t++)n.indexOf(o=i[t])>=0||(r[o]=e[o]);return r}e(require("prop-types"));var u=n.forwardRef((function(e,i){var a=e.isOpen,u=void 0===a||a,s=c(e,["isOpen"]);return n.useEffect((function(){return r.checkStyles("dialog")}),[]),n.useEffect((function(){u?window.__REACH_DISABLE_TOOLTIPS=!0:window.requestAnimationFrame((function(){window.__REACH_DISABLE_TOOLTIPS=!1}))}),[u]),u?o.createElement(t,{"data-reach-dialog-wrapper":""},o.createElement(l,Object.assign({ref:i},s))):null})),l=n.forwardRef((function(e,t){var u=e.allowPinchZoom,l=e.initialFocusRef,s=e.onClick,f=e.onDismiss,d=void 0===f?r.noop:f,p=e.onMouseDown,v=e.onKeyDown,w=c(e,["allowPinchZoom","initialFocusRef","onClick","onDismiss","onMouseDown","onKeyDown"]),m=n.useRef(null),E=n.useRef(null),h=r.useForkedRef(E,t),g=n.useCallback((function(){l&&l.current&&l.current.focus()}),[l]);return n.useEffect((function(){return E.current?(n=[],o=[],t=r.getOwnerDocument(e=E.current)||document,e?(Array.prototype.forEach.call(t.querySelectorAll("body > *"),(function(t){var r,i;if(t!==(null===(r=e.parentNode)||void 0===r||null===(i=r.parentNode)||void 0===i?void 0:i.parentNode)){var a=t.getAttribute("aria-hidden");null!==a&&"false"!==a||(n.push(a),o.push(t),t.setAttribute("aria-hidden","true"))}})),function(){o.forEach((function(e,o){var t=n[o];null===t?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t)}))}):r.noop):void 0;var e,n,o,t}),[]),o.createElement(i,{autoFocus:!0,returnFocus:!0,onActivation:g},o.createElement(a.RemoveScroll,{allowPinchZoom:u},o.createElement("div",Object.assign({},w,{ref:h,"data-reach-dialog-overlay":"",onClick:r.wrapEvent(s,(function(e){m.current===e.target&&(e.stopPropagation(),d(e))})),onKeyDown:r.wrapEvent(v,(function(e){"Escape"===e.key&&(e.stopPropagation(),d(e))})),onMouseDown:r.wrapEvent(p,(function(e){m.current=e.target}))}))))})),s=n.forwardRef((function(e,n){var t=e.onClick,i=c(e,["onClick","onKeyDown"]);return o.createElement("div",Object.assign({"aria-modal":"true",role:"dialog",tabIndex:-1},i,{ref:n,"data-reach-dialog-content":"",onClick:r.wrapEvent(t,(function(e){e.stopPropagation()}))}))})),f=n.forwardRef((function(e,n){var t=e.isOpen,i=e.onDismiss,a=void 0===i?r.noop:i,l=e.initialFocusRef,f=e.allowPinchZoom,d=c(e,["isOpen","onDismiss","initialFocusRef","allowPinchZoom"]);return o.createElement(u,{initialFocusRef:l,allowPinchZoom:f,isOpen:t,onDismiss:a},o.createElement(s,Object.assign({ref:n},d)))}));exports.Dialog=f,exports.DialogContent=s,exports.DialogOverlay=u,exports.default=f;
//# sourceMappingURL=dialog.cjs.production.min.js.map

@@ -67,3 +67,18 @@ import React, { forwardRef, useEffect, useRef, useCallback } from 'react';

return checkStyles("dialog");
}, []);
}, []); // We want to ignore the immediate focus of a tooltip so it doesn't pop
// up again when the menu closes, only pops up when focus returns again
// to the tooltip (like native OS tooltips).
useEffect(function () {
if (isOpen) {
// @ts-ignore
window.__REACH_DISABLE_TOOLTIPS = true;
} else {
window.requestAnimationFrame(function () {
// Wait a frame so that this doesn't fire before tooltip does
// @ts-ignore
window.__REACH_DISABLE_TOOLTIPS = false;
});
}
}, [isOpen]);
return isOpen ? React.createElement(Portal, {

@@ -70,0 +85,0 @@ "data-reach-dialog-wrapper": ""

{
"name": "@reach/dialog",
"version": "0.9.1",
"version": "0.10.0",
"description": "Accessible React Modal Dialog.",

@@ -16,4 +16,4 @@ "author": "React Training <hello@reacttraining.com>",

"dependencies": {
"@reach/portal": "^0.9.0",
"@reach/utils": "^0.9.0",
"@reach/portal": "^0.10.0",
"@reach/utils": "^0.10.0",
"prop-types": "^15.7.2",

@@ -36,3 +36,3 @@ "react-focus-lock": "^2.2.1",

],
"gitHead": "19b5b1ec7682dfed613512f1592958a47d43ad4d"
"gitHead": "e95268bdcebc7f0b5311beff4b6a8e29636decfe"
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc