CoreFiles by mySites.guru
view.min.js1 lines, 957 bytes, from wordpress-7.0.2.zip
Raw History Compare with 7.0.1
md5
a0d5f22199df6a2ed6882af34cf475e2
sha1
063e2b0db8142c537d110cffcbfc7590dc3fad6e
sha256
03f9888c8ad61c6571d33bb0e9b4505c5e191cc4612b98e79dd5af4caf3cef53
import{store as i,getContext as n,getElement as a,withSyncEvent as c}from"@wordpress/interactivity";var{actions:s}=i("core/search",{state:{get ariaLabel(){let{isSearchInputVisible:e,ariaLabelCollapsed:t,ariaLabelExpanded:r}=n();return e?r:t},get ariaControls(){let{isSearchInputVisible:e,inputId:t}=n();return e?null:t},get type(){let{isSearchInputVisible:e}=n();return e?"submit":"button"},get tabindex(){let{isSearchInputVisible:e}=n();return e?"0":"-1"}},actions:{openSearchInput:c(e=>{let t=n(),{ref:r}=a();t.isSearchInputVisible||(e.preventDefault(),t.isSearchInputVisible=!0,r.parentElement.querySelector("input").focus())}),closeSearchInput(){let e=n();e.isSearchInputVisible=!1},handleSearchKeydown:c(e=>{let{ref:t}=a();e?.key==="Escape"&&(s.closeSearchInput(),t.querySelector("button").focus())}),handleSearchFocusout:c(e=>{let{ref:t}=a();!t.contains(e.relatedTarget)&&e.target!==window.document.activeElement&&s.closeSearchInput()})}},{lock:!0});

The same content is in 41 releases, WordPress 7.0-beta4 to 7.2-RC2. See them all, or every version of this file.