@radix-ui/react-announce
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -1,2 +0,2 @@ | ||
var e,t,r=require("@radix-ui/react-use-layout-effect").useLayoutEffect,i=require("@radix-ui/react-primitive").Primitive,n=require("@radix-ui/react-compose-refs").useComposedRefs,a=c(require("react-dom")),o=(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),u=c(require("@babel/runtime/helpers/extends"));function c(e){return e&&e.__esModule?e.default:e}const s={polite:"status",assertive:"alert",off:"none"},l=new Map,d=o.forwardRef(((e,t)=>{const{"aria-relevant":c,children:d,type:m="polite",role:p=s[m],regionIdentifier:v,...b}=e,y=["true",!0].includes(b["aria-atomic"]),h=o.useRef(document),A=o.useCallback((e=>{e&&(h.current=e.ownerDocument)}),[]),g=o.useRef(null),x=n(t,g,A),[E,q]=o.useState(),w=c?Array.isArray(c)?c.join(" "):c:void 0,R=o.useCallback((()=>{const e=h.current,t={type:m,role:p,relevant:w,id:v,atomic:y},r=function({type:e,relevant:t,role:r,atomic:i,id:n}){return`[${f(n)}]${[["aria-live",e],["aria-atomic",i],["aria-relevant",t],["role",r]].filter((([,e])=>!!e)).map((([e,t])=>`[${e}=${t}]`)).join("")}`}(t);return e.querySelector(r)||function(e,{type:t,relevant:r,role:i,atomic:n,id:a}){const o=e.createElement("div");o.setAttribute(f(a),""),o.setAttribute("style","position: absolute; top: -1px; width: 1px; height: 1px; overflow: hidden;"),e.body.appendChild(o),o.setAttribute("aria-live",t),o.setAttribute("aria-atomic",String(n||!1)),o.setAttribute("role",i),r&&o.setAttribute("aria-relevant",r);return o}(e,t)}),[y,w,p,m,v]);return r((()=>{q(R())}),[R]),o.useEffect((()=>{const e=h.current;function t(){r.setAttribute("role",e.hidden?"none":p),r.setAttribute("aria-live",e.hidden?"off":m)}const r=R();if(l.get(r)){const e=l.get(r);l.set(r,e+1)}else e.addEventListener("visibilitychange",t),l.set(r,1);return function(){const i=l.get(r);l.set(r,i-1),1===i&&e.removeEventListener("visibilitychange",t)}}),[R,p,m]),o.createElement(o.Fragment,null,o.createElement(i,u({},b,{ref:x}),d),E&&a.createPortal(o.createElement("div",null,d),E))}));function f(e){return"data-radix-announce-region"+(e?`-${e}`:"")}exports.Announce=d,d.displayName="Announce";const m=d;exports.Root=m; | ||
var e,t,r=require("@radix-ui/react-use-layout-effect").useLayoutEffect,i=require("@radix-ui/react-primitive").Primitive,n=require("@radix-ui/react-compose-refs").useComposedRefs,a=c(require("react-dom")),o=(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),u=c(require("@babel/runtime/helpers/extends"));function c(e){return e&&e.__esModule?e.default:e}const s={polite:"status",assertive:"alert",off:"none"},l=new Map,d=/*#__PURE__*/o.forwardRef(((e,t)=>{const{"aria-relevant":c,children:d,type:m="polite",role:p=s[m],regionIdentifier:v,...b}=e,y=["true",!0].includes(b["aria-atomic"]),h=o.useRef(document),g=o.useCallback((e=>{e&&(h.current=e.ownerDocument)}),[]),A=o.useRef(null),x=n(t,A,g),[E,q]=o.useState(),w=c?Array.isArray(c)?c.join(" "):c:void 0,R=o.useCallback((()=>{const e=h.current,t={type:m,role:p,relevant:w,id:v,atomic:y},r=function({type:e,relevant:t,role:r,atomic:i,id:n}){return`[${f(n)}]${[["aria-live",e],["aria-atomic",i],["aria-relevant",t],["role",r]].filter((([,e])=>!!e)).map((([e,t])=>`[${e}=${t}]`)).join("")}`}(t);return e.querySelector(r)||function(e,{type:t,relevant:r,role:i,atomic:n,id:a}){const o=e.createElement("div");o.setAttribute(f(a),""),o.setAttribute("style","position: absolute; top: -1px; width: 1px; height: 1px; overflow: hidden;"),e.body.appendChild(o),o.setAttribute("aria-live",t),o.setAttribute("aria-atomic",String(n||!1)),o.setAttribute("role",i),r&&o.setAttribute("aria-relevant",r);return o}(e,t)}),[y,w,p,m,v]);return r((()=>{q(R())}),[R]),o.useEffect((()=>{const e=h.current;function t(){r.setAttribute("role",e.hidden?"none":p),r.setAttribute("aria-live",e.hidden?"off":m)}const r=R();if(l.get(r)){const e=l.get(r);l.set(r,e+1)}else e.addEventListener("visibilitychange",t),l.set(r,1);return function(){const i=l.get(r);l.set(r,i-1),1===i&&e.removeEventListener("visibilitychange",t)}}),[R,p,m]),/*#__PURE__*/o.createElement(o.Fragment,null,/*#__PURE__*/o.createElement(i,u({},b,{ref:x}),d),E&&/*#__PURE__*/a.createPortal(/*#__PURE__*/o.createElement("div",null,d),E))}));function f(e){return"data-radix-announce-region"+(e?`-${e}`:"")}exports.Announce=d;const m=d;exports.Root=m; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{useLayoutEffect as e}from"@radix-ui/react-use-layout-effect";import{Primitive as t}from"@radix-ui/react-primitive";import{useComposedRefs as r}from"@radix-ui/react-compose-refs";import i from"react-dom";import*as n from"react";import o from"@babel/runtime/helpers/esm/extends";const a={polite:"status",assertive:"alert",off:"none"},c=new Map;export const Announce=n.forwardRef(((s,u)=>{const{"aria-relevant":m,children:d,type:f="polite",role:p=a[f],regionIdentifier:v,...b}=s,A=["true",!0].includes(b["aria-atomic"]),y=n.useRef(document),h=n.useCallback((e=>{e&&(y.current=e.ownerDocument)}),[]),g=n.useRef(null),x=r(u,g,h),[E,w]=n.useState(),$=m?Array.isArray(m)?m.join(" "):m:void 0,R=n.useCallback((()=>{const e=y.current,t={type:f,role:p,relevant:$,id:v,atomic:A},r=function({type:e,relevant:t,role:r,atomic:i,id:n}){return`[${l(n)}]${[["aria-live",e],["aria-atomic",i],["aria-relevant",t],["role",r]].filter((([,e])=>!!e)).map((([e,t])=>`[${e}=${t}]`)).join("")}`}(t);return e.querySelector(r)||function(e,{type:t,relevant:r,role:i,atomic:n,id:o}){const a=e.createElement("div");a.setAttribute(l(o),""),a.setAttribute("style","position: absolute; top: -1px; width: 1px; height: 1px; overflow: hidden;"),e.body.appendChild(a),a.setAttribute("aria-live",t),a.setAttribute("aria-atomic",String(n||!1)),a.setAttribute("role",i),r&&a.setAttribute("aria-relevant",r);return a}(e,t)}),[A,$,p,f,v]);return e((()=>{w(R())}),[R]),n.useEffect((()=>{const e=y.current;function t(){r.setAttribute("role",e.hidden?"none":p),r.setAttribute("aria-live",e.hidden?"off":f)}const r=R();if(c.get(r)){const e=c.get(r);c.set(r,e+1)}else e.addEventListener("visibilitychange",t),c.set(r,1);return function(){const i=c.get(r);c.set(r,i-1),1===i&&e.removeEventListener("visibilitychange",t)}}),[R,p,f]),n.createElement(n.Fragment,null,n.createElement(t,o({},b,{ref:x}),d),E&&i.createPortal(n.createElement("div",null,d),E))}));function l(e){return"data-radix-announce-region"+(e?`-${e}`:"")}Announce.displayName="Announce";export const Root=Announce; | ||
import{useLayoutEffect as e}from"@radix-ui/react-use-layout-effect";import{Primitive as t}from"@radix-ui/react-primitive";import{useComposedRefs as r}from"@radix-ui/react-compose-refs";import i from"react-dom";import*as n from"react";import o from"@babel/runtime/helpers/esm/extends";const a={polite:"status",assertive:"alert",off:"none"},c=new Map;export const Announce=/*#__PURE__*/n.forwardRef(((s,u)=>{const{"aria-relevant":m,children:d,type:f="polite",role:p=a[f],regionIdentifier:v,...b}=s,y=["true",!0].includes(b["aria-atomic"]),A=n.useRef(document),h=n.useCallback((e=>{e&&(A.current=e.ownerDocument)}),[]),g=n.useRef(null),x=r(u,g,h),[E,w]=n.useState(),$=m?Array.isArray(m)?m.join(" "):m:void 0,R=n.useCallback((()=>{const e=A.current,t={type:f,role:p,relevant:$,id:v,atomic:y},r=function({type:e,relevant:t,role:r,atomic:i,id:n}){return`[${l(n)}]${[["aria-live",e],["aria-atomic",i],["aria-relevant",t],["role",r]].filter((([,e])=>!!e)).map((([e,t])=>`[${e}=${t}]`)).join("")}`}(t);return e.querySelector(r)||function(e,{type:t,relevant:r,role:i,atomic:n,id:o}){const a=e.createElement("div");a.setAttribute(l(o),""),a.setAttribute("style","position: absolute; top: -1px; width: 1px; height: 1px; overflow: hidden;"),e.body.appendChild(a),a.setAttribute("aria-live",t),a.setAttribute("aria-atomic",String(n||!1)),a.setAttribute("role",i),r&&a.setAttribute("aria-relevant",r);return a}(e,t)}),[y,$,p,f,v]);return e((()=>{w(R())}),[R]),n.useEffect((()=>{const e=A.current;function t(){r.setAttribute("role",e.hidden?"none":p),r.setAttribute("aria-live",e.hidden?"off":f)}const r=R();if(c.get(r)){const e=c.get(r);c.set(r,e+1)}else e.addEventListener("visibilitychange",t),c.set(r,1);return function(){const i=c.get(r);c.set(r,i-1),1===i&&e.removeEventListener("visibilitychange",t)}}),[R,p,f]),/*#__PURE__*/n.createElement(n.Fragment,null,/*#__PURE__*/n.createElement(t,o({},b,{ref:x}),d),E&&/*#__PURE__*/i.createPortal(/*#__PURE__*/n.createElement("div",null,d),E))}));/*#__PURE__*/function l(e){return"data-radix-announce-region"+(e?`-${e}`:"")}export const Root=Announce; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-announce", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"license": "MIT", | ||
@@ -21,6 +21,6 @@ "source": "src/index.ts", | ||
"@babel/runtime": "^7.13.10", | ||
"@radix-ui/react-compose-refs": "0.0.4", | ||
"@radix-ui/react-polymorphic": "0.0.9", | ||
"@radix-ui/react-primitive": "0.0.10", | ||
"@radix-ui/react-use-layout-effect": "0.0.4" | ||
"@radix-ui/react-compose-refs": "0.0.5", | ||
"@radix-ui/react-polymorphic": "0.0.10", | ||
"@radix-ui/react-primitive": "0.0.11", | ||
"@radix-ui/react-use-layout-effect": "0.0.5" | ||
}, | ||
@@ -27,0 +27,0 @@ "peerDependencies": { |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
37795
0
+ Added@radix-ui/react-compose-refs@0.0.5(transitive)
+ Added@radix-ui/react-polymorphic@0.0.10(transitive)
+ Added@radix-ui/react-primitive@0.0.11(transitive)
+ Added@radix-ui/react-use-layout-effect@0.0.5(transitive)
- Removed@radix-ui/react-compose-refs@0.0.4(transitive)
- Removed@radix-ui/react-polymorphic@0.0.9(transitive)
- Removed@radix-ui/react-primitive@0.0.10(transitive)
- Removed@radix-ui/react-use-layout-effect@0.0.4(transitive)