CoreFiles by mySites.guru
view.min.js1 lines, 956 bytes, from wordpress-7.0-beta2.zip
Raw History Compare with 7.0-beta1
md5
5d3a8153bf44484f53ef3840b8637b06
sha1
f9b10d9de233595b092d0e84f115157547768118
sha256
ee822d2ab27c049c92e0ae6f67f8fdd5a78fa49f21a1483869c9d196f688d490
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 3 releases, WordPress 7.0-beta1 to 7.0-beta3. See them all, or every version of this file.