WordPress/wp-includes/blocks/query/view.min.js

1 line
1.4 KiB
JavaScript
Raw Normal View History

"use strict";(self.__WordPressPrivateInteractivityAPI__=self.__WordPressPrivateInteractivityAPI__||[]).push([[155],{890:function(e,t,a){var r=a(754);const i=e=>e&&e instanceof window.HTMLAnchorElement&&e.href&&(!e.target||"_self"===e.target)&&e.origin===window.location.origin;(0,r.h)({selectors:{core:{query:{startAnimation:({context:e})=>"start"===e.core.query.animation,finishAnimation:({context:e})=>"finish"===e.core.query.animation}}},actions:{core:{query:{navigate:async({event:e,ref:t,context:a})=>{const o=t.closest("[data-wp-navigation-id]")?.dataset.wpNavigationDisabled;if(i(t)&&(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.defaultPrevented))(e)&&!o){e.preventDefault();const i=t.closest("[data-wp-navigation-id]").dataset.wpNavigationId,o=setTimeout((()=>{a.core.query.message=a.core.query.loadingText,a.core.query.animation="start"}),400);await(0,r.c4)(t.href),clearTimeout(o),a.core.query.message=a.core.query.loadedText+(a.core.query.message===a.core.query.loadedText?" ":""),a.core.query.animation="finish",a.core.query.url=t.href;const n=`[data-wp-navigation-id=${i}] .wp-block-post-template a[href]`;document.querySelector(n)?.focus()}},prefetch:async({ref:e})=>{const t=e.closest("[data-wp-navigation-id]")?.dataset.wpNavigationDisabled;i(e)&&!t&&await(0,r.tL)(e.href)}}}},effects:{core:{query:{prefetch:async({ref:e,context:t})=>{t.core.query.url&&i(e)&&await(0,r.tL)(e.href)}}}}})}},function(e){var t;t=890,e(e.s=t)}]);