Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pixi/accessibility

Package Overview
Dependencies
Maintainers
3
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/accessibility - npm Package Compare versions

Comparing version 6.1.3 to 6.2.0

10

dist/browser/accessibility.js
/*!
* @pixi/accessibility - v6.1.3
* Compiled Mon, 13 Sep 2021 15:29:31 UTC
* @pixi/accessibility - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
*

@@ -287,4 +287,6 @@ * @pixi/accessibility is licensed under the MIT License.

var children = displayObject.children;
for (var i = 0; i < children.length; i++) {
this.updateAccessibleObjects(children[i]);
if (children) {
for (var i = 0; i < children.length; i++) {
this.updateAccessibleObjects(children[i]);
}
}

@@ -291,0 +293,0 @@ };

6

dist/browser/accessibility.min.js
/*!
* @pixi/accessibility - v6.1.3
* Compiled Mon, 13 Sep 2021 15:29:31 UTC
* @pixi/accessibility - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
*

@@ -8,3 +8,3 @@ * @pixi/accessibility is licensed under the MIT License.

*/
this.PIXI=this.PIXI||{};var _pixi_accessibility=function(e,t,i){"use strict";var s={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};t.DisplayObject.mixin(s);var n=100,o=0,r=0,l=2,c=function(){function e(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(i.isMobile.tablet||i.isMobile.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width=n+"px",t.style.height=n+"px",t.style.position="absolute",t.style.top=o+"px",t.style.left=r+"px",t.style.zIndex=l.toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),self.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),e.prototype.createTouchHook=function(){var e=this,t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",function(){e._isMobileAccessibility=!0,e.activate(),e.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t},e.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},e.prototype.activate=function(){var e;this._isActive||(this._isActive=!0,self.document.addEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(e=this.renderer.view.parentNode)||void 0===e||e.appendChild(this.div))},e.prototype.deactivate=function(){var e;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(e=this.div.parentNode)||void 0===e||e.removeChild(this.div))},e.prototype.updateAccessibleObjects=function(e){if(e.visible&&e.accessibleChildren){e.accessible&&e.interactive&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);for(var t=e.children,i=0;i<t.length;i++)this.updateAccessibleObjects(t[i])}},e.prototype.update=function(){var e=performance.now();if(!(i.isMobile.android.device&&e<this.androidUpdateCount)&&(this.androidUpdateCount=e+this.androidUpdateFrequency,this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),s=t.left,n=t.top,o=t.width,r=t.height,l=this.renderer,c=l.width,a=l.height,d=l.resolution,h=o/c*d,u=r/a*d,p=this.div;p.style.left=s+"px",p.style.top=n+"px",p.style.width=c+"px",p.style.height=a+"px";for(var b=0;b<this.children.length;b++){var v=this.children[b];if(v.renderId!==this.renderId)v._accessibleActive=!1,i.removeItems(this.children,b,1),this.div.removeChild(v._accessibleDiv),this.pool.push(v._accessibleDiv),v._accessibleDiv=null,b--;else{p=v._accessibleDiv;var y=v.hitArea,g=v.worldTransform;v.hitArea?(p.style.left=(g.tx+y.x*g.a)*h+"px",p.style.top=(g.ty+y.y*g.d)*u+"px",p.style.width=y.width*g.a*h+"px",p.style.height=y.height*g.d*u+"px"):(y=v.getBounds(),this.capHitArea(y),p.style.left=y.x*h+"px",p.style.top=y.y*u+"px",p.style.width=y.width*h+"px",p.style.height=y.height*u+"px",p.title!==v.accessibleTitle&&null!==v.accessibleTitle&&(p.title=v.accessibleTitle),p.getAttribute("aria-label")!==v.accessibleHint&&null!==v.accessibleHint&&p.setAttribute("aria-label",v.accessibleHint)),v.accessibleTitle===p.title&&v.tabIndex===p.tabIndex||(p.title=v.accessibleTitle,p.tabIndex=v.tabIndex,this.debug&&this.updateDebugHTML(p))}}this.renderId++}},e.prototype.updateDebugHTML=function(e){e.innerHTML="type: "+e.type+"</br> title : "+e.title+"</br> tabIndex: "+e.tabIndex},e.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,i=t.width,s=t.height;e.x+e.width>i&&(e.width=i-e.x),e.y+e.height>s&&(e.height=s-e.y)},e.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width=n+"px",t.style.height=n+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=l.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title="displayObject "+e.tabIndex),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},e.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"click",s),t.dispatchEvent(i,"pointertap",s),t.dispatchEvent(i,"tap",s)},e.prototype._onFocus=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"mouseover",s)},e.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"mouseout",s)},e.prototype._onKeyDown=function(e){9===e.keyCode&&this.activate()},e.prototype._onMouseMove=function(e){0===e.movementX&&0===e.movementY||this.deactivate()},e.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},e}();return e.AccessibilityManager=c,e.accessibleTarget=s,e}({},PIXI,PIXI.utils);Object.assign(this.PIXI,_pixi_accessibility);
this.PIXI=this.PIXI||{};var _pixi_accessibility=function(e,t,i){"use strict";var s={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};t.DisplayObject.mixin(s);var n=100,o=0,r=0,l=2,c=function(){function e(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(i.isMobile.tablet||i.isMobile.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width=n+"px",t.style.height=n+"px",t.style.position="absolute",t.style.top=o+"px",t.style.left=r+"px",t.style.zIndex=l.toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),self.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),e.prototype.createTouchHook=function(){var e=this,t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",function(){e._isMobileAccessibility=!0,e.activate(),e.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t},e.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},e.prototype.activate=function(){var e;this._isActive||(this._isActive=!0,self.document.addEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(e=this.renderer.view.parentNode)||void 0===e||e.appendChild(this.div))},e.prototype.deactivate=function(){var e;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(e=this.div.parentNode)||void 0===e||e.removeChild(this.div))},e.prototype.updateAccessibleObjects=function(e){if(e.visible&&e.accessibleChildren){e.accessible&&e.interactive&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);var t=e.children;if(t)for(var i=0;i<t.length;i++)this.updateAccessibleObjects(t[i])}},e.prototype.update=function(){var e=performance.now();if(!(i.isMobile.android.device&&e<this.androidUpdateCount)&&(this.androidUpdateCount=e+this.androidUpdateFrequency,this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),s=t.left,n=t.top,o=t.width,r=t.height,l=this.renderer,c=l.width,a=l.height,d=l.resolution,h=o/c*d,u=r/a*d,p=this.div;p.style.left=s+"px",p.style.top=n+"px",p.style.width=c+"px",p.style.height=a+"px";for(var b=0;b<this.children.length;b++){var v=this.children[b];if(v.renderId!==this.renderId)v._accessibleActive=!1,i.removeItems(this.children,b,1),this.div.removeChild(v._accessibleDiv),this.pool.push(v._accessibleDiv),v._accessibleDiv=null,b--;else{p=v._accessibleDiv;var y=v.hitArea,g=v.worldTransform;v.hitArea?(p.style.left=(g.tx+y.x*g.a)*h+"px",p.style.top=(g.ty+y.y*g.d)*u+"px",p.style.width=y.width*g.a*h+"px",p.style.height=y.height*g.d*u+"px"):(y=v.getBounds(),this.capHitArea(y),p.style.left=y.x*h+"px",p.style.top=y.y*u+"px",p.style.width=y.width*h+"px",p.style.height=y.height*u+"px",p.title!==v.accessibleTitle&&null!==v.accessibleTitle&&(p.title=v.accessibleTitle),p.getAttribute("aria-label")!==v.accessibleHint&&null!==v.accessibleHint&&p.setAttribute("aria-label",v.accessibleHint)),v.accessibleTitle===p.title&&v.tabIndex===p.tabIndex||(p.title=v.accessibleTitle,p.tabIndex=v.tabIndex,this.debug&&this.updateDebugHTML(p))}}this.renderId++}},e.prototype.updateDebugHTML=function(e){e.innerHTML="type: "+e.type+"</br> title : "+e.title+"</br> tabIndex: "+e.tabIndex},e.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,i=t.width,s=t.height;e.x+e.width>i&&(e.width=i-e.x),e.y+e.height>s&&(e.height=s-e.y)},e.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width=n+"px",t.style.height=n+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=l.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title="displayObject "+e.tabIndex),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},e.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"click",s),t.dispatchEvent(i,"pointertap",s),t.dispatchEvent(i,"tap",s)},e.prototype._onFocus=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"mouseover",s)},e.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"mouseout",s)},e.prototype._onKeyDown=function(e){9===e.keyCode&&this.activate()},e.prototype._onMouseMove=function(e){0===e.movementX&&0===e.movementY||this.deactivate()},e.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},e}();return e.AccessibilityManager=c,e.accessibleTarget=s,e}({},PIXI,PIXI.utils);Object.assign(this.PIXI,_pixi_accessibility);
//# sourceMappingURL=accessibility.min.js.map
/*!
* @pixi/accessibility - v6.1.3
* Compiled Mon, 13 Sep 2021 15:29:31 UTC
* @pixi/accessibility - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
*

@@ -290,4 +290,6 @@ * @pixi/accessibility is licensed under the MIT License.

var children = displayObject.children;
for (var i = 0; i < children.length; i++) {
this.updateAccessibleObjects(children[i]);
if (children) {
for (var i = 0; i < children.length; i++) {
this.updateAccessibleObjects(children[i]);
}
}

@@ -294,0 +296,0 @@ };

/*!
* @pixi/accessibility - v6.1.3
* Compiled Mon, 13 Sep 2021 15:29:31 UTC
* @pixi/accessibility - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
*

@@ -8,3 +8,3 @@ * @pixi/accessibility is licensed under the MIT License.

*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var display=require("@pixi/display"),utils=require("@pixi/utils"),accessibleTarget={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};display.DisplayObject.mixin(accessibleTarget);var KEY_CODE_TAB=9,DIV_TOUCH_SIZE=100,DIV_TOUCH_POS_X=0,DIV_TOUCH_POS_Y=0,DIV_TOUCH_ZINDEX=2,DIV_HOOK_SIZE=1,DIV_HOOK_POS_X=-1e3,DIV_HOOK_POS_Y=-1e3,DIV_HOOK_ZINDEX=2,AccessibilityManager=function(){function e(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(utils.isMobile.tablet||utils.isMobile.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width=DIV_TOUCH_SIZE+"px",t.style.height=DIV_TOUCH_SIZE+"px",t.style.position="absolute",t.style.top=DIV_TOUCH_POS_X+"px",t.style.left=DIV_TOUCH_POS_Y+"px",t.style.zIndex=DIV_TOUCH_ZINDEX.toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),self.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),e.prototype.createTouchHook=function(){var e=this,t=document.createElement("button");t.style.width=DIV_HOOK_SIZE+"px",t.style.height=DIV_HOOK_SIZE+"px",t.style.position="absolute",t.style.top=DIV_HOOK_POS_X+"px",t.style.left=DIV_HOOK_POS_Y+"px",t.style.zIndex=DIV_HOOK_ZINDEX.toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",function(){e._isMobileAccessibility=!0,e.activate(),e.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t},e.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},e.prototype.activate=function(){var e;this._isActive||(this._isActive=!0,self.document.addEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(e=this.renderer.view.parentNode)||void 0===e||e.appendChild(this.div))},e.prototype.deactivate=function(){var e;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(e=this.div.parentNode)||void 0===e||e.removeChild(this.div))},e.prototype.updateAccessibleObjects=function(e){if(e.visible&&e.accessibleChildren){e.accessible&&e.interactive&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);for(var t=e.children,i=0;i<t.length;i++)this.updateAccessibleObjects(t[i])}},e.prototype.update=function(){var e=performance.now();if(!(utils.isMobile.android.device&&e<this.androidUpdateCount)&&(this.androidUpdateCount=e+this.androidUpdateFrequency,this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),i=t.left,s=t.top,n=t.width,o=t.height,r=this.renderer,l=r.width,a=r.height,c=r.resolution,d=n/l*c,h=o/a*c,u=this.div;u.style.left=i+"px",u.style.top=s+"px",u.style.width=l+"px",u.style.height=a+"px";for(var p=0;p<this.children.length;p++){var b=this.children[p];if(b.renderId!==this.renderId)b._accessibleActive=!1,utils.removeItems(this.children,p,1),this.div.removeChild(b._accessibleDiv),this.pool.push(b._accessibleDiv),b._accessibleDiv=null,p--;else{u=b._accessibleDiv;var v=b.hitArea,y=b.worldTransform;b.hitArea?(u.style.left=(y.tx+v.x*y.a)*d+"px",u.style.top=(y.ty+v.y*y.d)*h+"px",u.style.width=v.width*y.a*d+"px",u.style.height=v.height*y.d*h+"px"):(v=b.getBounds(),this.capHitArea(v),u.style.left=v.x*d+"px",u.style.top=v.y*h+"px",u.style.width=v.width*d+"px",u.style.height=v.height*h+"px",u.title!==b.accessibleTitle&&null!==b.accessibleTitle&&(u.title=b.accessibleTitle),u.getAttribute("aria-label")!==b.accessibleHint&&null!==b.accessibleHint&&u.setAttribute("aria-label",b.accessibleHint)),b.accessibleTitle===u.title&&b.tabIndex===u.tabIndex||(u.title=b.accessibleTitle,u.tabIndex=b.tabIndex,this.debug&&this.updateDebugHTML(u))}}this.renderId++}},e.prototype.updateDebugHTML=function(e){e.innerHTML="type: "+e.type+"</br> title : "+e.title+"</br> tabIndex: "+e.tabIndex},e.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,i=t.width,s=t.height;e.x+e.width>i&&(e.width=i-e.x),e.y+e.height>s&&(e.height=s-e.y)},e.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width=DIV_TOUCH_SIZE+"px",t.style.height=DIV_TOUCH_SIZE+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=DIV_TOUCH_ZINDEX.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title="displayObject "+e.tabIndex),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},e.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"click",s),t.dispatchEvent(i,"pointertap",s),t.dispatchEvent(i,"tap",s)},e.prototype._onFocus=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"mouseover",s)},e.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"mouseout",s)},e.prototype._onKeyDown=function(e){e.keyCode===KEY_CODE_TAB&&this.activate()},e.prototype._onMouseMove=function(e){0===e.movementX&&0===e.movementY||this.deactivate()},e.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},e}();exports.AccessibilityManager=AccessibilityManager,exports.accessibleTarget=accessibleTarget;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var display=require("@pixi/display"),utils=require("@pixi/utils"),accessibleTarget={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};display.DisplayObject.mixin(accessibleTarget);var KEY_CODE_TAB=9,DIV_TOUCH_SIZE=100,DIV_TOUCH_POS_X=0,DIV_TOUCH_POS_Y=0,DIV_TOUCH_ZINDEX=2,DIV_HOOK_SIZE=1,DIV_HOOK_POS_X=-1e3,DIV_HOOK_POS_Y=-1e3,DIV_HOOK_ZINDEX=2,AccessibilityManager=function(){function e(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(utils.isMobile.tablet||utils.isMobile.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width=DIV_TOUCH_SIZE+"px",t.style.height=DIV_TOUCH_SIZE+"px",t.style.position="absolute",t.style.top=DIV_TOUCH_POS_X+"px",t.style.left=DIV_TOUCH_POS_Y+"px",t.style.zIndex=DIV_TOUCH_ZINDEX.toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),self.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),e.prototype.createTouchHook=function(){var e=this,t=document.createElement("button");t.style.width=DIV_HOOK_SIZE+"px",t.style.height=DIV_HOOK_SIZE+"px",t.style.position="absolute",t.style.top=DIV_HOOK_POS_X+"px",t.style.left=DIV_HOOK_POS_Y+"px",t.style.zIndex=DIV_HOOK_ZINDEX.toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",function(){e._isMobileAccessibility=!0,e.activate(),e.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t},e.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},e.prototype.activate=function(){var e;this._isActive||(this._isActive=!0,self.document.addEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(e=this.renderer.view.parentNode)||void 0===e||e.appendChild(this.div))},e.prototype.deactivate=function(){var e;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(e=this.div.parentNode)||void 0===e||e.removeChild(this.div))},e.prototype.updateAccessibleObjects=function(e){if(e.visible&&e.accessibleChildren){e.accessible&&e.interactive&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);var t=e.children;if(t)for(var i=0;i<t.length;i++)this.updateAccessibleObjects(t[i])}},e.prototype.update=function(){var e=performance.now();if(!(utils.isMobile.android.device&&e<this.androidUpdateCount)&&(this.androidUpdateCount=e+this.androidUpdateFrequency,this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),i=t.left,s=t.top,n=t.width,o=t.height,r=this.renderer,l=r.width,a=r.height,c=r.resolution,d=n/l*c,h=o/a*c,u=this.div;u.style.left=i+"px",u.style.top=s+"px",u.style.width=l+"px",u.style.height=a+"px";for(var p=0;p<this.children.length;p++){var b=this.children[p];if(b.renderId!==this.renderId)b._accessibleActive=!1,utils.removeItems(this.children,p,1),this.div.removeChild(b._accessibleDiv),this.pool.push(b._accessibleDiv),b._accessibleDiv=null,p--;else{u=b._accessibleDiv;var v=b.hitArea,y=b.worldTransform;b.hitArea?(u.style.left=(y.tx+v.x*y.a)*d+"px",u.style.top=(y.ty+v.y*y.d)*h+"px",u.style.width=v.width*y.a*d+"px",u.style.height=v.height*y.d*h+"px"):(v=b.getBounds(),this.capHitArea(v),u.style.left=v.x*d+"px",u.style.top=v.y*h+"px",u.style.width=v.width*d+"px",u.style.height=v.height*h+"px",u.title!==b.accessibleTitle&&null!==b.accessibleTitle&&(u.title=b.accessibleTitle),u.getAttribute("aria-label")!==b.accessibleHint&&null!==b.accessibleHint&&u.setAttribute("aria-label",b.accessibleHint)),b.accessibleTitle===u.title&&b.tabIndex===u.tabIndex||(u.title=b.accessibleTitle,u.tabIndex=b.tabIndex,this.debug&&this.updateDebugHTML(u))}}this.renderId++}},e.prototype.updateDebugHTML=function(e){e.innerHTML="type: "+e.type+"</br> title : "+e.title+"</br> tabIndex: "+e.tabIndex},e.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,i=t.width,s=t.height;e.x+e.width>i&&(e.width=i-e.x),e.y+e.height>s&&(e.height=s-e.y)},e.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width=DIV_TOUCH_SIZE+"px",t.style.height=DIV_TOUCH_SIZE+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=DIV_TOUCH_ZINDEX.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title="displayObject "+e.tabIndex),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},e.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"click",s),t.dispatchEvent(i,"pointertap",s),t.dispatchEvent(i,"tap",s)},e.prototype._onFocus=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"mouseover",s)},e.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"mouseout",s)},e.prototype._onKeyDown=function(e){e.keyCode===KEY_CODE_TAB&&this.activate()},e.prototype._onMouseMove=function(e){0===e.movementX&&0===e.movementY||this.deactivate()},e.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},e}();exports.AccessibilityManager=AccessibilityManager,exports.accessibleTarget=accessibleTarget;
//# sourceMappingURL=accessibility.min.js.map
/*!
* @pixi/accessibility - v6.1.3
* Compiled Mon, 13 Sep 2021 15:29:31 UTC
* @pixi/accessibility - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
*

@@ -286,4 +286,6 @@ * @pixi/accessibility is licensed under the MIT License.

var children = displayObject.children;
for (var i = 0; i < children.length; i++) {
this.updateAccessibleObjects(children[i]);
if (children) {
for (var i = 0; i < children.length; i++) {
this.updateAccessibleObjects(children[i]);
}
}

@@ -290,0 +292,0 @@ };

/*!
* @pixi/accessibility - v6.1.3
* Compiled Mon, 13 Sep 2021 15:29:31 UTC
* @pixi/accessibility - v6.2.0
* Compiled Mon, 01 Nov 2021 16:52:10 UTC
*

@@ -8,3 +8,3 @@ * @pixi/accessibility is licensed under the MIT License.

*/
import{DisplayObject as e}from"@pixi/display";import{isMobile as t,removeItems as i}from"@pixi/utils";var s={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};e.mixin(s);var n=100,o=0,r=0,l=2,a=function(){function e(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this.createTouchHook();var i=document.createElement("div");i.style.width=n+"px",i.style.height=n+"px",i.style.position="absolute",i.style.top=o+"px",i.style.left=r+"px",i.style.zIndex=l.toString(),this.div=i,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),self.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),e.prototype.createTouchHook=function(){var e=this,t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",function(){e._isMobileAccessibility=!0,e.activate(),e.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t},e.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},e.prototype.activate=function(){var e;this._isActive||(this._isActive=!0,self.document.addEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(e=this.renderer.view.parentNode)||void 0===e||e.appendChild(this.div))},e.prototype.deactivate=function(){var e;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(e=this.div.parentNode)||void 0===e||e.removeChild(this.div))},e.prototype.updateAccessibleObjects=function(e){if(e.visible&&e.accessibleChildren){e.accessible&&e.interactive&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);for(var t=e.children,i=0;i<t.length;i++)this.updateAccessibleObjects(t[i])}},e.prototype.update=function(){var e=performance.now();if(!(t.android.device&&e<this.androidUpdateCount)&&(this.androidUpdateCount=e+this.androidUpdateFrequency,this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var s=this.renderer.view.getBoundingClientRect(),n=s.left,o=s.top,r=s.width,l=s.height,a=this.renderer,c=a.width,d=a.height,h=a.resolution,p=r/c*h,u=l/d*h,b=this.div;b.style.left=n+"px",b.style.top=o+"px",b.style.width=c+"px",b.style.height=d+"px";for(var v=0;v<this.children.length;v++){var y=this.children[v];if(y.renderId!==this.renderId)y._accessibleActive=!1,i(this.children,v,1),this.div.removeChild(y._accessibleDiv),this.pool.push(y._accessibleDiv),y._accessibleDiv=null,v--;else{b=y._accessibleDiv;var f=y.hitArea,g=y.worldTransform;y.hitArea?(b.style.left=(g.tx+f.x*g.a)*p+"px",b.style.top=(g.ty+f.y*g.d)*u+"px",b.style.width=f.width*g.a*p+"px",b.style.height=f.height*g.d*u+"px"):(f=y.getBounds(),this.capHitArea(f),b.style.left=f.x*p+"px",b.style.top=f.y*u+"px",b.style.width=f.width*p+"px",b.style.height=f.height*u+"px",b.title!==y.accessibleTitle&&null!==y.accessibleTitle&&(b.title=y.accessibleTitle),b.getAttribute("aria-label")!==y.accessibleHint&&null!==y.accessibleHint&&b.setAttribute("aria-label",y.accessibleHint)),y.accessibleTitle===b.title&&y.tabIndex===b.tabIndex||(b.title=y.accessibleTitle,b.tabIndex=y.tabIndex,this.debug&&this.updateDebugHTML(b))}}this.renderId++}},e.prototype.updateDebugHTML=function(e){e.innerHTML="type: "+e.type+"</br> title : "+e.title+"</br> tabIndex: "+e.tabIndex},e.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,i=t.width,s=t.height;e.x+e.width>i&&(e.width=i-e.x),e.y+e.height>s&&(e.height=s-e.y)},e.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width=n+"px",t.style.height=n+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=l.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title="displayObject "+e.tabIndex),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},e.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"click",s),t.dispatchEvent(i,"pointertap",s),t.dispatchEvent(i,"tap",s)},e.prototype._onFocus=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"mouseover",s)},e.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"mouseout",s)},e.prototype._onKeyDown=function(e){9===e.keyCode&&this.activate()},e.prototype._onMouseMove=function(e){0===e.movementX&&0===e.movementY||this.deactivate()},e.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},e}();export{a as AccessibilityManager,s as accessibleTarget};
import{DisplayObject as e}from"@pixi/display";import{isMobile as t,removeItems as i}from"@pixi/utils";var s={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};e.mixin(s);var n=100,o=0,r=0,l=2,a=function(){function e(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this.createTouchHook();var i=document.createElement("div");i.style.width=n+"px",i.style.height=n+"px",i.style.position="absolute",i.style.top=o+"px",i.style.left=r+"px",i.style.zIndex=l.toString(),this.div=i,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),self.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),e.prototype.createTouchHook=function(){var e=this,t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",function(){e._isMobileAccessibility=!0,e.activate(),e.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t},e.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},e.prototype.activate=function(){var e;this._isActive||(this._isActive=!0,self.document.addEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(e=this.renderer.view.parentNode)||void 0===e||e.appendChild(this.div))},e.prototype.deactivate=function(){var e;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(e=this.div.parentNode)||void 0===e||e.removeChild(this.div))},e.prototype.updateAccessibleObjects=function(e){if(e.visible&&e.accessibleChildren){e.accessible&&e.interactive&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);var t=e.children;if(t)for(var i=0;i<t.length;i++)this.updateAccessibleObjects(t[i])}},e.prototype.update=function(){var e=performance.now();if(!(t.android.device&&e<this.androidUpdateCount)&&(this.androidUpdateCount=e+this.androidUpdateFrequency,this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var s=this.renderer.view.getBoundingClientRect(),n=s.left,o=s.top,r=s.width,l=s.height,a=this.renderer,c=a.width,d=a.height,h=a.resolution,p=r/c*h,u=l/d*h,b=this.div;b.style.left=n+"px",b.style.top=o+"px",b.style.width=c+"px",b.style.height=d+"px";for(var v=0;v<this.children.length;v++){var y=this.children[v];if(y.renderId!==this.renderId)y._accessibleActive=!1,i(this.children,v,1),this.div.removeChild(y._accessibleDiv),this.pool.push(y._accessibleDiv),y._accessibleDiv=null,v--;else{b=y._accessibleDiv;var f=y.hitArea,g=y.worldTransform;y.hitArea?(b.style.left=(g.tx+f.x*g.a)*p+"px",b.style.top=(g.ty+f.y*g.d)*u+"px",b.style.width=f.width*g.a*p+"px",b.style.height=f.height*g.d*u+"px"):(f=y.getBounds(),this.capHitArea(f),b.style.left=f.x*p+"px",b.style.top=f.y*u+"px",b.style.width=f.width*p+"px",b.style.height=f.height*u+"px",b.title!==y.accessibleTitle&&null!==y.accessibleTitle&&(b.title=y.accessibleTitle),b.getAttribute("aria-label")!==y.accessibleHint&&null!==y.accessibleHint&&b.setAttribute("aria-label",y.accessibleHint)),y.accessibleTitle===b.title&&y.tabIndex===b.tabIndex||(b.title=y.accessibleTitle,b.tabIndex=y.tabIndex,this.debug&&this.updateDebugHTML(b))}}this.renderId++}},e.prototype.updateDebugHTML=function(e){e.innerHTML="type: "+e.type+"</br> title : "+e.title+"</br> tabIndex: "+e.tabIndex},e.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,i=t.width,s=t.height;e.x+e.width>i&&(e.width=i-e.x),e.y+e.height>s&&(e.height=s-e.y)},e.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width=n+"px",t.style.height=n+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=l.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title="displayObject "+e.tabIndex),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},e.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"click",s),t.dispatchEvent(i,"pointertap",s),t.dispatchEvent(i,"tap",s)},e.prototype._onFocus=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"mouseover",s)},e.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,"mouseout",s)},e.prototype._onKeyDown=function(e){9===e.keyCode&&this.activate()},e.prototype._onMouseMove=function(e){0===e.movementX&&0===e.movementY||this.deactivate()},e.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},e}();export{a as AccessibilityManager,s as accessibleTarget};
//# sourceMappingURL=accessibility.min.js.map
{
"name": "@pixi/accessibility",
"version": "6.1.3",
"version": "6.2.0",
"main": "dist/cjs/accessibility.js",

@@ -28,7 +28,7 @@ "module": "dist/esm/accessibility.js",

"peerDependencies": {
"@pixi/core": "6.1.3",
"@pixi/display": "6.1.3",
"@pixi/utils": "6.1.3"
"@pixi/core": "6.2.0",
"@pixi/display": "6.2.0",
"@pixi/utils": "6.2.0"
},
"gitHead": "2342b551124751206078602eb0e4408df230923e"
"gitHead": "793f21c0d0f2d2a423bd4339f40a569e1ea68711"
}

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc