Current File : /home/resuelf/www/wp-content/plugins/gutenberg/build/block-library/blocks/search/view.min.js |
!function(){"use strict";var e=window.wp.interactivity;const{actions:t}=(0,e.store)("core/search",{state:{get ariaLabel(){const{isSearchInputVisible:t,ariaLabelCollapsed:n,ariaLabelExpanded:r}=(0,e.getContext)();return t?r:n},get ariaControls(){const{isSearchInputVisible:t,inputId:n}=(0,e.getContext)();return t?null:n},get type(){const{isSearchInputVisible:t}=(0,e.getContext)();return t?"submit":"button"},get tabindex(){const{isSearchInputVisible:t}=(0,e.getContext)();return t?"0":"-1"}},actions:{openSearchInput(t){const n=(0,e.getContext)(),{ref:r}=(0,e.getElement)();n.isSearchInputVisible||(t.preventDefault(),n.isSearchInputVisible=!0,r.parentElement.querySelector("input").focus())},closeSearchInput(){(0,e.getContext)().isSearchInputVisible=!1},handleSearchKeydown(n){const{ref:r}=(0,e.getElement)();"Escape"===n?.key&&(t.closeSearchInput(),r.querySelector("button").focus())},handleSearchFocusout(n){const{ref:r}=(0,e.getElement)();r.contains(n.relatedTarget)||n.target===window.document.activeElement||t.closeSearchInput()}}})}();
//# sourceMappingURL=view.min.js.map