mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-26 19:18:57 +01:00
9aaa49f5a7
It brings with a set of iterations and follow-ups to the initial package update. It also fixes a regression that happened for interactive blocks. Props gziolo, luisherranz, cbravobernal. See #60315. Built from https://develop.svn.wordpress.org/trunk@57499 git-svn-id: http://core.svn.wordpress.org/trunk@57000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
1.8 KiB
JavaScript
1 line
1.8 KiB
JavaScript
import*as e from"@wordpress/interactivity";var t={978:e=>{e.exports=import("@wordpress/interactivity-router")}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const t=(e=>{var t={};return n.d(t,e),t})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store}),r=e=>e&&e instanceof window.HTMLAnchorElement&&e.href&&(!e.target||"_self"===e.target)&&e.origin===window.location.origin;(0,t.store)("core/query",{state:{get startAnimation(){return"start"===(0,t.getContext)().animation},get finishAnimation(){return"finish"===(0,t.getContext)().animation}},actions:{*navigate(e){const o=(0,t.getContext)(),{ref:i}=(0,t.getElement)(),{queryRef:a}=o,s=a?.dataset.wpNavigationDisabled;if(r(i)&&(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.defaultPrevented))(e)&&!s){e.preventDefault();const t=setTimeout((()=>{o.message=o.loadingText,o.animation="start"}),400),{actions:r}=yield Promise.resolve().then(n.bind(n,978));yield r.navigate(i.href),clearTimeout(t),o.message=o.loadedText+(o.message===o.loadedText?" ":""),o.animation="finish",o.url=i.href;const s=".wp-block-post-template a[href]";a.querySelector(s)?.focus()}},*prefetch(){const{queryRef:e}=(0,t.getContext)(),{ref:o}=(0,t.getElement)(),i=e?.dataset.wpNavigationDisabled;if(r(o)&&!i){const{actions:e}=yield Promise.resolve().then(n.bind(n,978));yield e.prefetch(o.href)}}},callbacks:{*prefetch(){const{url:e}=(0,t.getContext)(),{ref:o}=(0,t.getElement)();if(e&&r(o)){const{actions:e}=yield Promise.resolve().then(n.bind(n,978));yield e.prefetch(o.href)}},setQueryRef(){const e=(0,t.getContext)(),{ref:r}=(0,t.getElement)();e.queryRef=r}}})})(); |