WordPress/wp-includes/js/dist/interactivity-router.min.js
desrosj d4a8067885 Build/Test Tools: Update several dependencies.
This updates the following dependencies:
- `@pmmmwh/react-refresh-webpack-plugin` from `0.5.5` to `0.5.11`.
- `autoprefixer` from `10.4.16` to `10.4.17`.
- `copy-webpack-plugin` from `11.0.0` to `12.0.2`.
- `cssnano` from `6.0.1` to `6.0.3`.
- `dotenv` from `16.3.1` to `16.4.4`.
- `dotenv-expand` from `10.0.0` to `11.0.3`.
- `postcss` from `8.4.31` to `8.4.35`.
- `sass` from `1.69.3` to `1.70.0`.
- `sinon` from `16.0.3` to `16.1.3`.
- `source-map-loader` from `4.0.1` to `5.0.0`.
- `terser-webpack-plugin` from `5.3.9` to `5.3.10`.
- `wait-on` from `7.0.1` to `7.2.0`.
- `webpack` from `5.89.0` to `5.90.2`.

Additionally, `npm audit fix` has been run.

See #59658.
Built from https://develop.svn.wordpress.org/trunk@57635


git-svn-id: http://core.svn.wordpress.org/trunk@57136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-15 16:53:15 +00:00

2 lines
2.5 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! This file is auto-generated */
import*as e from"@wordpress/interactivity";var t={d:(e,o)=>{for(var i in o)t.o(o,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:o[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},o={};t.d(o,{o:()=>p,w:()=>h});const i=(e=>{var o={};return t.d(o,e),o})({getConfig:()=>e.getConfig,privateApis:()=>e.privateApis,store:()=>e.store}),{directivePrefix:n,getRegionRootFragment:r,initialVdom:a,toVdom:s,render:c}=(0,i.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),d=new Map,l=e=>{const t=new URL(e,window.location);return t.pathname+t.search},g=(e,{vdom:t}={})=>{const o={},i=`data-${n}-router-region`;e.querySelectorAll(`[${i}]`).forEach((e=>{const n=e.getAttribute(i);o[n]=t?.has(e)?t.get(e):s(e)}));const r=e.querySelector("title")?.innerText;return{regions:o,title:r}},w=e=>{const t=`data-${n}-router-region`;document.querySelectorAll(`[${t}]`).forEach((o=>{const i=o.getAttribute(t),n=r(o);c(e.regions[i],n)})),e.title&&(document.title=e.title)},m=e=>(window.location.assign(e),new Promise((()=>{})));window.addEventListener("popstate",(async()=>{const e=l(window.location),t=d.has(e)&&await d.get(e);t?(w(t),h.url=window.location.href):window.location.reload()})),d.set(l(window.location),Promise.resolve(g(document,{vdom:a})));let u="";const{state:h,actions:p}=(0,i.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1,texts:{}}},actions:{*navigate(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();o&&(yield m(e));const n=l(e),{navigation:r}=h,{loadingAnimation:a=!0,screenReaderAnnouncement:s=!0,timeout:c=1e4}=t;u=e,p.prefetch(n,t);const g=new Promise((e=>setTimeout(e,c))),v=setTimeout((()=>{u===e&&(a&&(r.hasStarted=!0,r.hasFinished=!1),s&&(r.message=r.texts.loading))}),400),f=yield Promise.race([d.get(n),g]);clearTimeout(v),u===e&&(f?(w(f),window.history[t.replace?"replaceState":"pushState"]({},"",e),h.url=e,a&&(r.hasStarted=!1,r.hasFinished=!0),s&&(r.message=r.texts.loaded+(r.message===r.texts.loaded?" ":""))):yield m(e))},prefetch(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();if(o)return;const n=l(e);!t.force&&d.has(n)||d.set(n,(async(e,{html:t})=>{try{if(!t){const o=await window.fetch(e);if(200!==o.status)return!1;t=await o.text()}const o=(new window.DOMParser).parseFromString(t,"text/html");return g(o)}catch(e){return!1}})(n,t))}}});var v=o.o,f=o.w;export{v as actions,f as state};