lol backups and old site first commit
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
// packages/a11y/build-module/shared/clear.mjs
|
||||
function clear() {
|
||||
const regions = document.getElementsByClassName("a11y-speak-region");
|
||||
const introText = document.getElementById("a11y-speak-intro-text");
|
||||
for (let i = 0; i < regions.length; i++) {
|
||||
regions[i].textContent = "";
|
||||
}
|
||||
if (introText) {
|
||||
introText.setAttribute("hidden", "hidden");
|
||||
}
|
||||
}
|
||||
|
||||
// packages/a11y/build-module/shared/filter-message.mjs
|
||||
var previousMessage = "";
|
||||
function filterMessage(message) {
|
||||
message = message.replace(/<[^<>]+>/g, " ");
|
||||
if (previousMessage === message) {
|
||||
message += " ";
|
||||
}
|
||||
previousMessage = message;
|
||||
return message;
|
||||
}
|
||||
|
||||
// packages/a11y/build-module/shared/index.mjs
|
||||
function speak(message, ariaLive) {
|
||||
clear();
|
||||
message = filterMessage(message);
|
||||
const introText = document.getElementById("a11y-speak-intro-text");
|
||||
const containerAssertive = document.getElementById(
|
||||
"a11y-speak-assertive"
|
||||
);
|
||||
const containerPolite = document.getElementById("a11y-speak-polite");
|
||||
if (containerAssertive && ariaLive === "assertive") {
|
||||
containerAssertive.textContent = message;
|
||||
} else if (containerPolite) {
|
||||
containerPolite.textContent = message;
|
||||
}
|
||||
if (introText) {
|
||||
introText.removeAttribute("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
// packages/a11y/build-module/module/index.mjs
|
||||
var setup = () => {
|
||||
};
|
||||
export {
|
||||
setup,
|
||||
speak
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => 'f62f48906198ea8abc60');
|
||||
@@ -0,0 +1 @@
|
||||
function i(){let t=document.getElementsByClassName("a11y-speak-region"),n=document.getElementById("a11y-speak-intro-text");for(let e=0;e<t.length;e++)t[e].textContent="";n&&n.setAttribute("hidden","hidden")}var a="";function c(t){return t=t.replace(/<[^<>]+>/g," "),a===t&&(t+=" "),a=t,t}function l(t,n){i(),t=c(t);let e=document.getElementById("a11y-speak-intro-text"),o=document.getElementById("a11y-speak-assertive"),r=document.getElementById("a11y-speak-polite");o&&n==="assertive"?o.textContent=t:r&&(r.textContent=t),e&&e.removeAttribute("hidden")}var m=()=>{};export{m as setup,l as speak};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('wp-data', 'wp-i18n'), 'version' => '104b6117f4f3d5b94cc3');
|
||||
File diff suppressed because one or more lines are too long
+88
@@ -0,0 +1,88 @@
|
||||
// packages/block-editor/build-module/utils/fit-text-frontend.mjs
|
||||
import { store, getElement, getContext } from "@wordpress/interactivity";
|
||||
|
||||
// packages/block-editor/build-module/utils/fit-text-utils.mjs
|
||||
function findOptimalFontSize(textElement, applyFontSize) {
|
||||
const alreadyHasScrollableHeight = textElement.scrollHeight > textElement.clientHeight;
|
||||
let minSize = 0;
|
||||
let maxSize = 2400;
|
||||
let bestSize = minSize;
|
||||
const computedStyle = window.getComputedStyle(textElement);
|
||||
let paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;
|
||||
let paddingRight = parseFloat(computedStyle.paddingRight) || 0;
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(textElement);
|
||||
let referenceElement = textElement;
|
||||
const parentElement = textElement.parentElement;
|
||||
if (parentElement) {
|
||||
const parentElementComputedStyle = window.getComputedStyle(parentElement);
|
||||
if (parentElementComputedStyle?.display === "flex") {
|
||||
referenceElement = parentElement;
|
||||
paddingLeft += parseFloat(parentElementComputedStyle.paddingLeft) || 0;
|
||||
paddingRight += parseFloat(parentElementComputedStyle.paddingRight) || 0;
|
||||
}
|
||||
}
|
||||
let maxclientHeight = referenceElement.clientHeight;
|
||||
while (minSize <= maxSize) {
|
||||
const midSize = Math.floor((minSize + maxSize) / 2);
|
||||
applyFontSize(midSize);
|
||||
const rect = range.getBoundingClientRect();
|
||||
const textWidth = rect.width;
|
||||
const fitsWidth = textElement.scrollWidth <= referenceElement.clientWidth && textWidth <= referenceElement.clientWidth - paddingLeft - paddingRight;
|
||||
const fitsHeight = alreadyHasScrollableHeight || textElement.scrollHeight <= referenceElement.clientHeight || textElement.scrollHeight <= maxclientHeight;
|
||||
if (referenceElement.clientHeight > maxclientHeight) {
|
||||
maxclientHeight = referenceElement.clientHeight;
|
||||
}
|
||||
if (fitsWidth && fitsHeight) {
|
||||
bestSize = midSize;
|
||||
minSize = midSize + 1;
|
||||
} else {
|
||||
maxSize = midSize - 1;
|
||||
}
|
||||
}
|
||||
range.detach();
|
||||
return bestSize;
|
||||
}
|
||||
function optimizeFitText(textElement, applyFontSize) {
|
||||
if (!textElement) {
|
||||
return;
|
||||
}
|
||||
applyFontSize(0);
|
||||
const optimalSize = findOptimalFontSize(textElement, applyFontSize);
|
||||
applyFontSize(optimalSize);
|
||||
return optimalSize;
|
||||
}
|
||||
|
||||
// packages/block-editor/build-module/utils/fit-text-frontend.mjs
|
||||
store("core/fit-text", {
|
||||
callbacks: {
|
||||
init() {
|
||||
const context = getContext();
|
||||
const { ref } = getElement();
|
||||
const applyFontSize = (fontSize) => {
|
||||
if (!ref) {
|
||||
return;
|
||||
}
|
||||
if (fontSize === 0) {
|
||||
ref.style.fontSize = "";
|
||||
} else {
|
||||
ref.style.fontSize = `${fontSize}px`;
|
||||
}
|
||||
};
|
||||
context.fontSize = optimizeFitText(ref, applyFontSize);
|
||||
if (window.ResizeObserver && ref?.parentElement) {
|
||||
const resizeObserver = new window.ResizeObserver(() => {
|
||||
context.fontSize = optimizeFitText(ref, applyFontSize);
|
||||
});
|
||||
resizeObserver.observe(ref.parentElement);
|
||||
resizeObserver.observe(ref);
|
||||
return () => {
|
||||
if (resizeObserver) {
|
||||
resizeObserver.disconnect();
|
||||
}
|
||||
};
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => 'f465b12ad4eba72e96bb');
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{store as H,getElement as w,getContext as b}from"@wordpress/interactivity";function S(e,t){let o=e.scrollHeight>e.clientHeight,i=0,l=2400,g=i,f=window.getComputedStyle(e),p=parseFloat(f.paddingLeft)||0,h=parseFloat(f.paddingRight)||0,c=document.createRange();c.selectNodeContents(e);let r=e,s=e.parentElement;if(s){let n=window.getComputedStyle(s);n?.display==="flex"&&(r=s,p+=parseFloat(n.paddingLeft)||0,h+=parseFloat(n.paddingRight)||0)}let d=r.clientHeight;for(;i<=l;){let n=Math.floor((i+l)/2);t(n);let m=c.getBoundingClientRect().width,u=e.scrollWidth<=r.clientWidth&&m<=r.clientWidth-p-h,z=o||e.scrollHeight<=r.clientHeight||e.scrollHeight<=d;r.clientHeight>d&&(d=r.clientHeight),u&&z?(g=n,i=n+1):l=n-1}return c.detach(),g}function a(e,t){if(!e)return;t(0);let o=S(e,t);return t(o),o}H("core/fit-text",{callbacks:{init(){let e=b(),{ref:t}=w(),o=i=>{t&&(i===0?t.style.fontSize="":t.style.fontSize=`${i}px`)};if(e.fontSize=a(t,o),window.ResizeObserver&&t?.parentElement){let i=new window.ResizeObserver(()=>{e.fontSize=a(t,o)});return i.observe(t.parentElement),i.observe(t),()=>{i&&i.disconnect()}}}}});
|
||||
@@ -0,0 +1,108 @@
|
||||
// packages/block-library/build-module/accordion/view.mjs
|
||||
import { store, getContext } from "@wordpress/interactivity";
|
||||
var hashHandled = false;
|
||||
var { actions } = store(
|
||||
"core/accordion",
|
||||
{
|
||||
state: {
|
||||
get isOpen() {
|
||||
const { id, accordionItems } = getContext();
|
||||
const accordionItem = accordionItems.find(
|
||||
(item) => item.id === id
|
||||
);
|
||||
return accordionItem ? accordionItem.isOpen : false;
|
||||
},
|
||||
get isHidden() {
|
||||
const { id, accordionItems } = getContext();
|
||||
const accordionItem = accordionItems.find(
|
||||
(item) => item.id === id
|
||||
);
|
||||
return accordionItem?.isOpen ? null : "until-found";
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
toggle: () => {
|
||||
const context = getContext();
|
||||
const { id, autoclose, accordionItems } = context;
|
||||
const accordionItem = accordionItems.find(
|
||||
(item) => item.id === id
|
||||
);
|
||||
if (autoclose) {
|
||||
accordionItems.forEach((item) => {
|
||||
item.isOpen = item.id === id ? !accordionItem.isOpen : false;
|
||||
});
|
||||
} else {
|
||||
accordionItem.isOpen = !accordionItem.isOpen;
|
||||
}
|
||||
},
|
||||
openPanelByHash: () => {
|
||||
if (hashHandled || !window.location?.hash?.length) {
|
||||
return;
|
||||
}
|
||||
const context = getContext();
|
||||
const { id, accordionItems, autoclose } = context;
|
||||
const hash = decodeURIComponent(
|
||||
window.location.hash.slice(1)
|
||||
);
|
||||
const targetElement = window.document.getElementById(hash);
|
||||
if (!targetElement) {
|
||||
return;
|
||||
}
|
||||
const panelElement = window.document.querySelector(
|
||||
'.wp-block-accordion-panel[aria-labelledby="' + id + '"]'
|
||||
);
|
||||
if (!panelElement || !panelElement.contains(targetElement)) {
|
||||
return;
|
||||
}
|
||||
hashHandled = true;
|
||||
if (autoclose) {
|
||||
accordionItems.forEach((item) => {
|
||||
item.isOpen = item.id === id;
|
||||
});
|
||||
} else {
|
||||
const targetItem = accordionItems.find(
|
||||
(item) => item.id === id
|
||||
);
|
||||
if (targetItem) {
|
||||
targetItem.isOpen = true;
|
||||
}
|
||||
}
|
||||
window.setTimeout(() => {
|
||||
targetElement.scrollIntoView();
|
||||
}, 0);
|
||||
},
|
||||
handleBeforeMatch: () => {
|
||||
const context = getContext();
|
||||
const { id, autoclose, accordionItems } = context;
|
||||
const accordionItem = accordionItems.find(
|
||||
(item) => item.id === id
|
||||
);
|
||||
if (accordionItem) {
|
||||
if (autoclose) {
|
||||
accordionItems.forEach((item) => {
|
||||
item.isOpen = item.id === id;
|
||||
});
|
||||
} else {
|
||||
accordionItem.isOpen = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
callbacks: {
|
||||
initAccordionItems: () => {
|
||||
const context = getContext();
|
||||
const { id, openByDefault, accordionItems } = context;
|
||||
accordionItems.push({
|
||||
id,
|
||||
isOpen: openByDefault
|
||||
});
|
||||
actions.openPanelByHash();
|
||||
},
|
||||
hashChange: () => {
|
||||
hashHandled = false;
|
||||
actions.openPanelByHash();
|
||||
}
|
||||
}
|
||||
},
|
||||
{ lock: true }
|
||||
);
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => '2bfb90e7aee6b5300a7c');
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{store as p,getContext as s}from"@wordpress/interactivity";var d=!1,{actions:l}=p("core/accordion",{state:{get isOpen(){let{id:c,accordionItems:e}=s(),t=e.find(n=>n.id===c);return t?t.isOpen:!1},get isHidden(){let{id:c,accordionItems:e}=s();return e.find(n=>n.id===c)?.isOpen?null:"until-found"}},actions:{toggle:()=>{let c=s(),{id:e,autoclose:t,accordionItems:n}=c,i=n.find(o=>o.id===e);t?n.forEach(o=>{o.isOpen=o.id===e?!i.isOpen:!1}):i.isOpen=!i.isOpen},openPanelByHash:()=>{if(d||!window.location?.hash?.length)return;let c=s(),{id:e,accordionItems:t,autoclose:n}=c,i=decodeURIComponent(window.location.hash.slice(1)),o=window.document.getElementById(i);if(!o)return;let r=window.document.querySelector('.wp-block-accordion-panel[aria-labelledby="'+e+'"]');if(!(!r||!r.contains(o))){if(d=!0,n)t.forEach(a=>{a.isOpen=a.id===e});else{let a=t.find(f=>f.id===e);a&&(a.isOpen=!0)}window.setTimeout(()=>{o.scrollIntoView()},0)}},handleBeforeMatch:()=>{let c=s(),{id:e,autoclose:t,accordionItems:n}=c,i=n.find(o=>o.id===e);i&&(t?n.forEach(o=>{o.isOpen=o.id===e}):i.isOpen=!0)}},callbacks:{initAccordionItems:()=>{let c=s(),{id:e,openByDefault:t,accordionItems:n}=c;n.push({id:e,isOpen:t}),l.openPanelByHash()},hashChange:()=>{d=!1,l.openPanelByHash()}}},{lock:!0});
|
||||
@@ -0,0 +1,44 @@
|
||||
// packages/block-library/build-module/file/view.mjs
|
||||
import { store } from "@wordpress/interactivity";
|
||||
|
||||
// packages/block-library/build-module/file/utils/index.mjs
|
||||
var browserSupportsPdfs = () => {
|
||||
if (window.navigator.pdfViewerEnabled) {
|
||||
return true;
|
||||
}
|
||||
if (window.navigator.userAgent.indexOf("Mobi") > -1) {
|
||||
return false;
|
||||
}
|
||||
if (window.navigator.userAgent.indexOf("Android") > -1) {
|
||||
return false;
|
||||
}
|
||||
if (window.navigator.userAgent.indexOf("Macintosh") > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) {
|
||||
return false;
|
||||
}
|
||||
if (!!(window.ActiveXObject || "ActiveXObject" in window) && !(createActiveXObject("AcroPDF.PDF") || createActiveXObject("PDF.PdfCtrl"))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
var createActiveXObject = (type) => {
|
||||
let ax;
|
||||
try {
|
||||
ax = new window.ActiveXObject(type);
|
||||
} catch {
|
||||
ax = void 0;
|
||||
}
|
||||
return ax;
|
||||
};
|
||||
|
||||
// packages/block-library/build-module/file/view.mjs
|
||||
store(
|
||||
"core/file",
|
||||
{
|
||||
state: {
|
||||
get hasPdfPreview() {
|
||||
return browserSupportsPdfs();
|
||||
}
|
||||
}
|
||||
},
|
||||
{ lock: true }
|
||||
);
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => 'a9114a756e418400594c');
|
||||
@@ -0,0 +1 @@
|
||||
import{store as n}from"@wordpress/interactivity";var t=()=>window.navigator.pdfViewerEnabled?!0:!(window.navigator.userAgent.indexOf("Mobi")>-1||window.navigator.userAgent.indexOf("Android")>-1||window.navigator.userAgent.indexOf("Macintosh")>-1&&window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2||(window.ActiveXObject||"ActiveXObject"in window)&&!(e("AcroPDF.PDF")||e("PDF.PdfCtrl"))),e=i=>{let r;try{r=new window.ActiveXObject(i)}catch{r=void 0}return r};n("core/file",{state:{get hasPdfPreview(){return t()}}},{lock:!0});
|
||||
@@ -0,0 +1,45 @@
|
||||
// packages/block-library/build-module/form/view.mjs
|
||||
var formSettings;
|
||||
try {
|
||||
formSettings = JSON.parse(
|
||||
document.getElementById(
|
||||
"wp-script-module-data-@wordpress/block-library/form/view"
|
||||
)?.textContent
|
||||
);
|
||||
} catch {
|
||||
}
|
||||
document.querySelectorAll("form.wp-block-form").forEach(function(form) {
|
||||
if (!formSettings || !form.action || !form.action.startsWith("mailto:")) {
|
||||
return;
|
||||
}
|
||||
const redirectNotification = (status) => {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
urlParams.append("wp-form-result", status);
|
||||
window.location.search = urlParams.toString();
|
||||
};
|
||||
form.addEventListener("submit", async function(event) {
|
||||
event.preventDefault();
|
||||
const formData = Object.fromEntries(new FormData(form).entries());
|
||||
formData.formAction = form.action;
|
||||
formData._ajax_nonce = formSettings.nonce;
|
||||
formData.action = formSettings.action;
|
||||
formData._wp_http_referer = window.location.href;
|
||||
formData.formAction = form.action;
|
||||
try {
|
||||
const response = await fetch(formSettings.ajaxUrl, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
body: new URLSearchParams(formData).toString()
|
||||
});
|
||||
if (response.ok) {
|
||||
redirectNotification("success");
|
||||
} else {
|
||||
redirectNotification("error");
|
||||
}
|
||||
} catch {
|
||||
redirectNotification("error");
|
||||
}
|
||||
});
|
||||
});
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '5542f8ad251fe43ef09e');
|
||||
@@ -0,0 +1 @@
|
||||
var o;try{o=JSON.parse(document.getElementById("wp-script-module-data-@wordpress/block-library/form/view")?.textContent)}catch{}document.querySelectorAll("form.wp-block-form").forEach(function(e){if(!o||!e.action||!e.action.startsWith("mailto:"))return;let r=n=>{let t=new URLSearchParams(window.location.search);t.append("wp-form-result",n),window.location.search=t.toString()};e.addEventListener("submit",async function(n){n.preventDefault();let t=Object.fromEntries(new FormData(e).entries());t.formAction=e.action,t._ajax_nonce=o.nonce,t.action=o.action,t._wp_http_referer=window.location.href,t.formAction=e.action;try{(await fetch(o.ajaxUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()})).ok?r("success"):r("error")}catch{r("error")}})});
|
||||
@@ -0,0 +1,462 @@
|
||||
// packages/block-library/build-module/image/view.mjs
|
||||
import {
|
||||
store,
|
||||
getContext,
|
||||
getElement,
|
||||
getConfig,
|
||||
withSyncEvent,
|
||||
withScope
|
||||
} from "@wordpress/interactivity";
|
||||
|
||||
// packages/block-library/build-module/image/constants.mjs
|
||||
var IMAGE_PRELOAD_DELAY = 200;
|
||||
|
||||
// packages/block-library/build-module/image/view.mjs
|
||||
var isTouching = false;
|
||||
var lastTouchTime = 0;
|
||||
var touchStartEvent = {
|
||||
startX: 0,
|
||||
startY: 0,
|
||||
startTime: 0
|
||||
};
|
||||
var focusableSelectors = [
|
||||
".wp-lightbox-close-button",
|
||||
".wp-lightbox-navigation-button"
|
||||
];
|
||||
function getImageSrc({ uploadedSrc }) {
|
||||
return uploadedSrc || "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
|
||||
}
|
||||
function getImageSrcset({ lightboxSrcset }) {
|
||||
return lightboxSrcset || "";
|
||||
}
|
||||
var { state, actions, callbacks } = store(
|
||||
"core/image",
|
||||
{
|
||||
state: {
|
||||
selectedImageId: null,
|
||||
selectedGalleryId: null,
|
||||
preloadTimers: /* @__PURE__ */ new Map(),
|
||||
preloadedImageIds: /* @__PURE__ */ new Set(),
|
||||
get galleryImages() {
|
||||
if (!state.selectedGalleryId) {
|
||||
return [state.selectedImageId];
|
||||
}
|
||||
return Object.entries(state.metadata).filter(
|
||||
([, value]) => value.galleryId === state.selectedGalleryId
|
||||
).sort(([, a], [, b]) => {
|
||||
const orderA = a.order ?? 0;
|
||||
const orderB = b.order ?? 0;
|
||||
return orderA - orderB;
|
||||
}).map(([key]) => key);
|
||||
},
|
||||
get selectedImageIndex() {
|
||||
return state.galleryImages.findIndex(
|
||||
(id) => id === state.selectedImageId
|
||||
);
|
||||
},
|
||||
get selectedImage() {
|
||||
return state.metadata[state.selectedImageId];
|
||||
},
|
||||
get hasNavigationIcon() {
|
||||
const { navigationButtonType } = state.selectedImage;
|
||||
return navigationButtonType === "icon" || navigationButtonType === "both";
|
||||
},
|
||||
get hasNavigationText() {
|
||||
const { navigationButtonType } = state.selectedImage;
|
||||
return navigationButtonType === "text" || navigationButtonType === "both";
|
||||
},
|
||||
get thisImage() {
|
||||
const { imageId } = getContext();
|
||||
return state.metadata[imageId];
|
||||
},
|
||||
get hasNavigation() {
|
||||
return state.galleryImages.length > 1;
|
||||
},
|
||||
get hasNextImage() {
|
||||
return state.selectedImageIndex + 1 < state.galleryImages.length;
|
||||
},
|
||||
get hasPreviousImage() {
|
||||
return state.selectedImageIndex - 1 >= 0;
|
||||
},
|
||||
get overlayOpened() {
|
||||
return state.selectedImageId !== null;
|
||||
},
|
||||
get roleAttribute() {
|
||||
return state.overlayOpened ? "dialog" : null;
|
||||
},
|
||||
get ariaModal() {
|
||||
return state.overlayOpened ? "true" : null;
|
||||
},
|
||||
get ariaLabel() {
|
||||
return state.selectedImage.customAriaLabel || getConfig().defaultAriaLabel;
|
||||
},
|
||||
get closeButtonAriaLabel() {
|
||||
return state.hasNavigationText ? void 0 : getConfig().closeButtonText;
|
||||
},
|
||||
get prevButtonAriaLabel() {
|
||||
return state.hasNavigationText ? void 0 : getConfig().prevButtonText;
|
||||
},
|
||||
get nextButtonAriaLabel() {
|
||||
return state.hasNavigationText ? void 0 : getConfig().nextButtonText;
|
||||
},
|
||||
get enlargedSrc() {
|
||||
return getImageSrc(state.selectedImage);
|
||||
},
|
||||
get enlargedSrcset() {
|
||||
return getImageSrcset(state.selectedImage);
|
||||
},
|
||||
get figureStyles() {
|
||||
return state.overlayOpened && `${state.selectedImage.figureStyles?.replace(
|
||||
/margin[^;]*;?/g,
|
||||
""
|
||||
)};`;
|
||||
},
|
||||
get imgStyles() {
|
||||
return state.overlayOpened && `${state.selectedImage.imgStyles?.replace(
|
||||
/;$/,
|
||||
""
|
||||
)}; object-fit:cover;`;
|
||||
},
|
||||
get isContentHidden() {
|
||||
const ctx = getContext();
|
||||
return state.overlayEnabled && state.selectedImageId === ctx.imageId;
|
||||
},
|
||||
get isContentVisible() {
|
||||
const ctx = getContext();
|
||||
return !state.overlayEnabled && state.selectedImageId === ctx.imageId;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
showLightbox() {
|
||||
const { imageId } = getContext();
|
||||
if (!state.metadata[imageId].imageRef?.complete) {
|
||||
return;
|
||||
}
|
||||
state.scrollTopReset = document.documentElement.scrollTop;
|
||||
state.scrollLeftReset = document.documentElement.scrollLeft;
|
||||
state.selectedImageId = imageId;
|
||||
const { galleryId } = getContext("core/gallery") || {};
|
||||
state.selectedGalleryId = galleryId || null;
|
||||
state.overlayEnabled = true;
|
||||
callbacks.setOverlayStyles();
|
||||
},
|
||||
hideLightbox() {
|
||||
if (state.overlayEnabled) {
|
||||
state.overlayEnabled = false;
|
||||
setTimeout(function() {
|
||||
state.selectedImage.buttonRef.focus({
|
||||
preventScroll: true
|
||||
});
|
||||
state.selectedImageId = null;
|
||||
state.selectedGalleryId = null;
|
||||
}, 450);
|
||||
}
|
||||
},
|
||||
showPreviousImage: withSyncEvent((event) => {
|
||||
event.stopPropagation();
|
||||
const nextIndex = state.hasPreviousImage ? state.selectedImageIndex - 1 : state.galleryImages.length - 1;
|
||||
state.selectedImageId = state.galleryImages[nextIndex];
|
||||
callbacks.setOverlayStyles();
|
||||
}),
|
||||
showNextImage: withSyncEvent((event) => {
|
||||
event.stopPropagation();
|
||||
const nextIndex = state.hasNextImage ? state.selectedImageIndex + 1 : 0;
|
||||
state.selectedImageId = state.galleryImages[nextIndex];
|
||||
callbacks.setOverlayStyles();
|
||||
}),
|
||||
handleKeydown: withSyncEvent((event) => {
|
||||
if (state.overlayEnabled) {
|
||||
if (event.key === "Escape") {
|
||||
actions.hideLightbox();
|
||||
} else if (event.key === "ArrowLeft") {
|
||||
actions.showPreviousImage(event);
|
||||
} else if (event.key === "ArrowRight") {
|
||||
actions.showNextImage(event);
|
||||
} else if (event.key === "Tab") {
|
||||
const focusableElements = Array.from(
|
||||
document.querySelectorAll(focusableSelectors)
|
||||
);
|
||||
const firstFocusableElement = focusableElements[0];
|
||||
const lastFocusableElement = focusableElements[focusableElements.length - 1];
|
||||
if (event.shiftKey && event.target === firstFocusableElement) {
|
||||
event.preventDefault();
|
||||
lastFocusableElement.focus();
|
||||
} else if (!event.shiftKey && event.target === lastFocusableElement) {
|
||||
event.preventDefault();
|
||||
firstFocusableElement.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}),
|
||||
handleTouchMove: withSyncEvent((event) => {
|
||||
if (state.overlayEnabled) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}),
|
||||
handleTouchStart(event) {
|
||||
isTouching = true;
|
||||
const t = event.touches && event.touches[0];
|
||||
if (t) {
|
||||
touchStartEvent.startX = t.clientX;
|
||||
touchStartEvent.startY = t.clientY;
|
||||
touchStartEvent.startTime = Date.now();
|
||||
}
|
||||
},
|
||||
handleTouchEnd: withSyncEvent((event) => {
|
||||
const touchEndEvent = event.changedTouches && event.changedTouches[0] || event.touches && event.touches[0];
|
||||
const now = Date.now();
|
||||
if (touchEndEvent && state.overlayEnabled) {
|
||||
const deltaX = touchEndEvent.clientX - touchStartEvent.startX;
|
||||
const deltaY = touchEndEvent.clientY - touchStartEvent.startY;
|
||||
const absDeltaX = Math.abs(deltaX);
|
||||
const absDeltaY = Math.abs(deltaY);
|
||||
const elapsedMs = now - touchStartEvent.startTime;
|
||||
const isHorizontalSwipe = (
|
||||
// Swipe distance is greater than 50px
|
||||
absDeltaX > 50 && // Horizontal movement is much larger than the vertical movement
|
||||
absDeltaX > absDeltaY * 1.5 && // Fast action of less than 800ms
|
||||
elapsedMs < 800
|
||||
);
|
||||
if (isHorizontalSwipe) {
|
||||
event.preventDefault();
|
||||
if (deltaX < 0) {
|
||||
actions.showNextImage(event);
|
||||
} else {
|
||||
actions.showPreviousImage(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
lastTouchTime = now;
|
||||
isTouching = false;
|
||||
}),
|
||||
handleScroll() {
|
||||
if (state.overlayOpened) {
|
||||
if (!isTouching && Date.now() - lastTouchTime > 450) {
|
||||
window.scrollTo(
|
||||
state.scrollLeftReset,
|
||||
state.scrollTopReset
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
preloadImage() {
|
||||
const { imageId } = getContext();
|
||||
if (state.preloadedImageIds.has(imageId)) {
|
||||
return;
|
||||
}
|
||||
const imageMetadata = state.metadata[imageId];
|
||||
const imageLink = document.createElement("link");
|
||||
imageLink.rel = "preload";
|
||||
imageLink.as = "image";
|
||||
imageLink.href = getImageSrc(imageMetadata);
|
||||
const srcset = getImageSrcset(imageMetadata);
|
||||
if (srcset) {
|
||||
imageLink.setAttribute("imagesrcset", srcset);
|
||||
imageLink.setAttribute("imagesizes", "100vw");
|
||||
}
|
||||
document.head.appendChild(imageLink);
|
||||
state.preloadedImageIds.add(imageId);
|
||||
},
|
||||
preloadImageWithDelay() {
|
||||
const { imageId } = getContext();
|
||||
actions.cancelPreload();
|
||||
const timerId = setTimeout(
|
||||
withScope(() => {
|
||||
actions.preloadImage();
|
||||
state.preloadTimers.delete(imageId);
|
||||
}),
|
||||
IMAGE_PRELOAD_DELAY
|
||||
);
|
||||
state.preloadTimers.set(imageId, timerId);
|
||||
},
|
||||
cancelPreload() {
|
||||
const { imageId } = getContext();
|
||||
if (state.preloadTimers.has(imageId)) {
|
||||
clearTimeout(state.preloadTimers.get(imageId));
|
||||
state.preloadTimers.delete(imageId);
|
||||
}
|
||||
}
|
||||
},
|
||||
callbacks: {
|
||||
setOverlayStyles() {
|
||||
if (!state.overlayEnabled) {
|
||||
return;
|
||||
}
|
||||
let {
|
||||
naturalWidth,
|
||||
naturalHeight,
|
||||
offsetWidth: originalWidth,
|
||||
offsetHeight: originalHeight
|
||||
} = state.selectedImage.imageRef;
|
||||
let { x: screenPosX, y: screenPosY } = state.selectedImage.imageRef.getBoundingClientRect();
|
||||
const naturalRatio = naturalWidth / naturalHeight;
|
||||
let originalRatio = originalWidth / originalHeight;
|
||||
if (state.selectedImage.scaleAttr === "contain") {
|
||||
if (naturalRatio > originalRatio) {
|
||||
const heightWithoutSpace = originalWidth / naturalRatio;
|
||||
screenPosY += (originalHeight - heightWithoutSpace) / 2;
|
||||
originalHeight = heightWithoutSpace;
|
||||
} else {
|
||||
const widthWithoutSpace = originalHeight * naturalRatio;
|
||||
screenPosX += (originalWidth - widthWithoutSpace) / 2;
|
||||
originalWidth = widthWithoutSpace;
|
||||
}
|
||||
}
|
||||
originalRatio = originalWidth / originalHeight;
|
||||
let imgMaxWidth = parseFloat(
|
||||
state.selectedImage.targetWidth && state.selectedImage.targetWidth !== "none" ? state.selectedImage.targetWidth : naturalWidth
|
||||
);
|
||||
let imgMaxHeight = parseFloat(
|
||||
state.selectedImage.targetHeight && state.selectedImage.targetHeight !== "none" ? state.selectedImage.targetHeight : naturalHeight
|
||||
);
|
||||
let imgRatio = imgMaxWidth / imgMaxHeight;
|
||||
let containerMaxWidth = imgMaxWidth;
|
||||
let containerMaxHeight = imgMaxHeight;
|
||||
let containerWidth = imgMaxWidth;
|
||||
let containerHeight = imgMaxHeight;
|
||||
if (naturalRatio.toFixed(2) !== imgRatio.toFixed(2)) {
|
||||
if (naturalRatio > imgRatio) {
|
||||
const reducedHeight = imgMaxWidth / naturalRatio;
|
||||
if (imgMaxHeight - reducedHeight > imgMaxWidth) {
|
||||
imgMaxHeight = reducedHeight;
|
||||
imgMaxWidth = reducedHeight * naturalRatio;
|
||||
} else {
|
||||
imgMaxHeight = imgMaxWidth / naturalRatio;
|
||||
}
|
||||
} else {
|
||||
const reducedWidth = imgMaxHeight * naturalRatio;
|
||||
if (imgMaxWidth - reducedWidth > imgMaxHeight) {
|
||||
imgMaxWidth = reducedWidth;
|
||||
imgMaxHeight = reducedWidth / naturalRatio;
|
||||
} else {
|
||||
imgMaxWidth = imgMaxHeight * naturalRatio;
|
||||
}
|
||||
}
|
||||
containerWidth = imgMaxWidth;
|
||||
containerHeight = imgMaxHeight;
|
||||
imgRatio = imgMaxWidth / imgMaxHeight;
|
||||
if (originalRatio > imgRatio) {
|
||||
containerMaxWidth = imgMaxWidth;
|
||||
containerMaxHeight = containerMaxWidth / originalRatio;
|
||||
} else {
|
||||
containerMaxHeight = imgMaxHeight;
|
||||
containerMaxWidth = containerMaxHeight * originalRatio;
|
||||
}
|
||||
}
|
||||
if (originalWidth > containerWidth || originalHeight > containerHeight) {
|
||||
containerWidth = originalWidth;
|
||||
containerHeight = originalHeight;
|
||||
}
|
||||
let horizontalPadding = 0;
|
||||
let verticalPadding = 160;
|
||||
if (480 < window.innerWidth) {
|
||||
horizontalPadding = 80;
|
||||
verticalPadding = 160;
|
||||
}
|
||||
if (960 < window.innerWidth) {
|
||||
horizontalPadding = state.hasNavigation ? 320 : 80;
|
||||
verticalPadding = 80;
|
||||
}
|
||||
const targetMaxWidth = Math.min(
|
||||
window.innerWidth - horizontalPadding,
|
||||
containerWidth
|
||||
);
|
||||
const targetMaxHeight = Math.min(
|
||||
window.innerHeight - verticalPadding,
|
||||
containerHeight
|
||||
);
|
||||
const targetContainerRatio = targetMaxWidth / targetMaxHeight;
|
||||
if (originalRatio > targetContainerRatio) {
|
||||
containerWidth = targetMaxWidth;
|
||||
containerHeight = containerWidth / originalRatio;
|
||||
} else {
|
||||
containerHeight = targetMaxHeight;
|
||||
containerWidth = containerHeight * originalRatio;
|
||||
}
|
||||
const containerScale = originalWidth / containerWidth;
|
||||
const lightboxImgWidth = imgMaxWidth * (containerWidth / containerMaxWidth);
|
||||
const lightboxImgHeight = imgMaxHeight * (containerHeight / containerMaxHeight);
|
||||
state.overlayStyles = `
|
||||
--wp--lightbox-initial-top-position: ${screenPosY}px;
|
||||
--wp--lightbox-initial-left-position: ${screenPosX}px;
|
||||
--wp--lightbox-container-width: ${containerWidth + 1}px;
|
||||
--wp--lightbox-container-height: ${containerHeight + 1}px;
|
||||
--wp--lightbox-image-width: ${lightboxImgWidth}px;
|
||||
--wp--lightbox-image-height: ${lightboxImgHeight}px;
|
||||
--wp--lightbox-scale: ${containerScale};
|
||||
--wp--lightbox-scrollbar-width: ${window.innerWidth - document.documentElement.clientWidth}px;
|
||||
`;
|
||||
},
|
||||
setButtonStyles() {
|
||||
const { ref } = getElement();
|
||||
if (!ref) {
|
||||
return;
|
||||
}
|
||||
const { imageId } = getContext();
|
||||
state.metadata[imageId].imageRef = ref;
|
||||
state.metadata[imageId].currentSrc = ref.currentSrc;
|
||||
const {
|
||||
naturalWidth,
|
||||
naturalHeight,
|
||||
offsetWidth,
|
||||
offsetHeight
|
||||
} = ref;
|
||||
if (naturalWidth === 0 || naturalHeight === 0) {
|
||||
return;
|
||||
}
|
||||
const figure = ref.parentElement;
|
||||
const figureWidth = ref.parentElement.clientWidth;
|
||||
let figureHeight = ref.parentElement.clientHeight;
|
||||
const caption = figure.querySelector("figcaption");
|
||||
if (caption) {
|
||||
const captionComputedStyle = window.getComputedStyle(caption);
|
||||
if (!["absolute", "fixed"].includes(
|
||||
captionComputedStyle.position
|
||||
)) {
|
||||
figureHeight = figureHeight - caption.offsetHeight - parseFloat(captionComputedStyle.marginTop) - parseFloat(captionComputedStyle.marginBottom);
|
||||
}
|
||||
}
|
||||
const buttonOffsetTop = figureHeight - offsetHeight;
|
||||
const buttonOffsetRight = figureWidth - offsetWidth;
|
||||
let buttonTop = buttonOffsetTop + 16;
|
||||
let buttonRight = buttonOffsetRight + 16;
|
||||
if (state.metadata[imageId].scaleAttr === "contain") {
|
||||
const naturalRatio = naturalWidth / naturalHeight;
|
||||
const offsetRatio = offsetWidth / offsetHeight;
|
||||
if (naturalRatio >= offsetRatio) {
|
||||
const referenceHeight = offsetWidth / naturalRatio;
|
||||
buttonTop = (offsetHeight - referenceHeight) / 2 + buttonOffsetTop + 16;
|
||||
buttonRight = buttonOffsetRight + 16;
|
||||
} else {
|
||||
const referenceWidth = offsetHeight * naturalRatio;
|
||||
buttonTop = buttonOffsetTop + 16;
|
||||
buttonRight = (offsetWidth - referenceWidth) / 2 + buttonOffsetRight + 16;
|
||||
}
|
||||
}
|
||||
state.metadata[imageId].buttonTop = buttonTop;
|
||||
state.metadata[imageId].buttonRight = buttonRight;
|
||||
},
|
||||
setOverlayFocus() {
|
||||
if (state.overlayEnabled) {
|
||||
const { ref } = getElement();
|
||||
ref.focus();
|
||||
}
|
||||
},
|
||||
setInertElements() {
|
||||
document.querySelectorAll("body > :not(.wp-lightbox-overlay)").forEach((el) => {
|
||||
if (state.overlayEnabled) {
|
||||
el.setAttribute("inert", "");
|
||||
} else {
|
||||
el.removeAttribute("inert");
|
||||
}
|
||||
});
|
||||
},
|
||||
initTriggerButton() {
|
||||
const { imageId } = getContext();
|
||||
const { ref } = getElement();
|
||||
state.metadata[imageId].buttonRef = ref;
|
||||
}
|
||||
}
|
||||
},
|
||||
{ lock: true }
|
||||
);
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => '25ee935fd6c67371d0f3');
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,180 @@
|
||||
// packages/block-library/build-module/navigation/view.mjs
|
||||
import {
|
||||
store,
|
||||
getContext,
|
||||
getElement,
|
||||
withSyncEvent
|
||||
} from "@wordpress/interactivity";
|
||||
var focusableSelectors = [
|
||||
"a[href]",
|
||||
'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',
|
||||
"select:not([disabled]):not([aria-hidden])",
|
||||
"textarea:not([disabled]):not([aria-hidden])",
|
||||
"button:not([disabled]):not([aria-hidden])",
|
||||
"[contenteditable]",
|
||||
'[tabindex]:not([tabindex^="-"])'
|
||||
];
|
||||
function getFocusableElements(ref) {
|
||||
const focusableElements = ref.querySelectorAll(focusableSelectors);
|
||||
return Array.from(focusableElements).filter((element) => {
|
||||
if (typeof element.checkVisibility === "function") {
|
||||
return element.checkVisibility({
|
||||
checkOpacity: false,
|
||||
checkVisibilityCSS: true
|
||||
});
|
||||
}
|
||||
return element.offsetParent !== null;
|
||||
});
|
||||
}
|
||||
document.addEventListener("click", () => {
|
||||
});
|
||||
var { state, actions } = store(
|
||||
"core/navigation",
|
||||
{
|
||||
state: {
|
||||
get roleAttribute() {
|
||||
const ctx = getContext();
|
||||
return ctx.type === "overlay" && state.isMenuOpen ? "dialog" : null;
|
||||
},
|
||||
get ariaModal() {
|
||||
const ctx = getContext();
|
||||
return ctx.type === "overlay" && state.isMenuOpen ? "true" : null;
|
||||
},
|
||||
get ariaLabel() {
|
||||
const ctx = getContext();
|
||||
return ctx.type === "overlay" && state.isMenuOpen ? ctx.ariaLabel : null;
|
||||
},
|
||||
get isMenuOpen() {
|
||||
return Object.values(state.menuOpenedBy).filter(Boolean).length > 0;
|
||||
},
|
||||
get menuOpenedBy() {
|
||||
const ctx = getContext();
|
||||
return ctx.type === "overlay" ? ctx.overlayOpenedBy : ctx.submenuOpenedBy;
|
||||
},
|
||||
get isSubmenuOpen() {
|
||||
const ctx = getContext();
|
||||
const isOverlayOpen = Object.values(ctx.overlayOpenedBy || {}).filter(Boolean).length > 0;
|
||||
return isOverlayOpen || state.isMenuOpen;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
openMenuOnHover(event) {
|
||||
if (event?.pointerType === "touch") {
|
||||
return;
|
||||
}
|
||||
const { type } = getContext();
|
||||
if (type === "submenu") {
|
||||
actions.openMenu("hover");
|
||||
}
|
||||
},
|
||||
closeMenuOnHover(event) {
|
||||
if (event?.pointerType === "touch") {
|
||||
return;
|
||||
}
|
||||
const { type } = getContext();
|
||||
if (type === "submenu") {
|
||||
actions.closeMenu("hover");
|
||||
}
|
||||
},
|
||||
openMenuOnClick() {
|
||||
const ctx = getContext();
|
||||
const { ref } = getElement();
|
||||
ctx.previousFocus = ref;
|
||||
actions.openMenu("click");
|
||||
},
|
||||
closeMenuOnClick() {
|
||||
actions.closeMenu("click");
|
||||
actions.closeMenu("focus");
|
||||
},
|
||||
openMenuOnFocus() {
|
||||
actions.openMenu("focus");
|
||||
},
|
||||
toggleMenuOnClick() {
|
||||
const ctx = getContext();
|
||||
const { ref } = getElement();
|
||||
if (window.document.activeElement !== ref) {
|
||||
ref.focus();
|
||||
}
|
||||
const { menuOpenedBy } = state;
|
||||
if (menuOpenedBy.click || menuOpenedBy.focus) {
|
||||
actions.closeMenu("click");
|
||||
actions.closeMenu("focus");
|
||||
actions.closeMenu("hover");
|
||||
} else {
|
||||
ctx.previousFocus = ref;
|
||||
actions.openMenu("click");
|
||||
}
|
||||
},
|
||||
handleMenuKeydown: withSyncEvent((event) => {
|
||||
const { type, firstFocusableElement, lastFocusableElement } = getContext();
|
||||
if (state.menuOpenedBy.click) {
|
||||
if (event.key === "Escape") {
|
||||
event.stopPropagation();
|
||||
actions.closeMenu("click");
|
||||
actions.closeMenu("focus");
|
||||
return;
|
||||
}
|
||||
if (type === "overlay" && event.key === "Tab") {
|
||||
if (event.shiftKey && window.document.activeElement === firstFocusableElement) {
|
||||
event.preventDefault();
|
||||
lastFocusableElement.focus();
|
||||
} else if (!event.shiftKey && window.document.activeElement === lastFocusableElement) {
|
||||
event.preventDefault();
|
||||
firstFocusableElement.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}),
|
||||
handleMenuFocusout: withSyncEvent((event) => {
|
||||
const { modal, type } = getContext();
|
||||
if (event.relatedTarget === null || !modal?.contains(event.relatedTarget) && event.target !== window.document.activeElement && type === "submenu") {
|
||||
actions.closeMenu("click");
|
||||
actions.closeMenu("focus");
|
||||
}
|
||||
}),
|
||||
openMenu(menuOpenedOn = "click") {
|
||||
const { type } = getContext();
|
||||
state.menuOpenedBy[menuOpenedOn] = true;
|
||||
if (type === "overlay") {
|
||||
document.documentElement.classList.add("has-modal-open");
|
||||
}
|
||||
},
|
||||
closeMenu(menuClosedOn = "click") {
|
||||
const ctx = getContext();
|
||||
state.menuOpenedBy[menuClosedOn] = false;
|
||||
if (!state.isMenuOpen) {
|
||||
if (ctx.modal?.contains(window.document.activeElement)) {
|
||||
ctx.previousFocus?.focus();
|
||||
}
|
||||
ctx.modal = null;
|
||||
ctx.previousFocus = null;
|
||||
if (ctx.type === "overlay") {
|
||||
document.documentElement.classList.remove(
|
||||
"has-modal-open"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
callbacks: {
|
||||
initMenu() {
|
||||
const ctx = getContext();
|
||||
const { ref } = getElement();
|
||||
if (state.isMenuOpen) {
|
||||
const focusableElements = getFocusableElements(ref);
|
||||
ctx.modal = ref;
|
||||
ctx.firstFocusableElement = focusableElements[0];
|
||||
ctx.lastFocusableElement = focusableElements[focusableElements.length - 1];
|
||||
}
|
||||
},
|
||||
focusFirstElement() {
|
||||
const { ref } = getElement();
|
||||
if (state.isMenuOpen) {
|
||||
const focusableElements = getFocusableElements(ref);
|
||||
focusableElements?.[0]?.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{ lock: true }
|
||||
);
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => '1bf28ded04f9f188bdcb');
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{store as r,getContext as o,getElement as s,withSyncEvent as i}from"@wordpress/interactivity";var d=["a[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","[contenteditable]",'[tabindex]:not([tabindex^="-"])'];function a(e){let n=e.querySelectorAll(d);return Array.from(n).filter(t=>typeof t.checkVisibility=="function"?t.checkVisibility({checkOpacity:!1,checkVisibilityCSS:!0}):t.offsetParent!==null)}document.addEventListener("click",()=>{});var{state:l,actions:c}=r("core/navigation",{state:{get roleAttribute(){return o().type==="overlay"&&l.isMenuOpen?"dialog":null},get ariaModal(){return o().type==="overlay"&&l.isMenuOpen?"true":null},get ariaLabel(){let e=o();return e.type==="overlay"&&l.isMenuOpen?e.ariaLabel:null},get isMenuOpen(){return Object.values(l.menuOpenedBy).filter(Boolean).length>0},get menuOpenedBy(){let e=o();return e.type==="overlay"?e.overlayOpenedBy:e.submenuOpenedBy},get isSubmenuOpen(){let e=o();return Object.values(e.overlayOpenedBy||{}).filter(Boolean).length>0||l.isMenuOpen}},actions:{openMenuOnHover(e){if(e?.pointerType==="touch")return;let{type:n}=o();n==="submenu"&&c.openMenu("hover")},closeMenuOnHover(e){if(e?.pointerType==="touch")return;let{type:n}=o();n==="submenu"&&c.closeMenu("hover")},openMenuOnClick(){let e=o(),{ref:n}=s();e.previousFocus=n,c.openMenu("click")},closeMenuOnClick(){c.closeMenu("click"),c.closeMenu("focus")},openMenuOnFocus(){c.openMenu("focus")},toggleMenuOnClick(){let e=o(),{ref:n}=s();window.document.activeElement!==n&&n.focus();let{menuOpenedBy:t}=l;t.click||t.focus?(c.closeMenu("click"),c.closeMenu("focus"),c.closeMenu("hover")):(e.previousFocus=n,c.openMenu("click"))},handleMenuKeydown:i(e=>{let{type:n,firstFocusableElement:t,lastFocusableElement:u}=o();if(l.menuOpenedBy.click){if(e.key==="Escape"){e.stopPropagation(),c.closeMenu("click"),c.closeMenu("focus");return}n==="overlay"&&e.key==="Tab"&&(e.shiftKey&&window.document.activeElement===t?(e.preventDefault(),u.focus()):!e.shiftKey&&window.document.activeElement===u&&(e.preventDefault(),t.focus()))}}),handleMenuFocusout:i(e=>{let{modal:n,type:t}=o();(e.relatedTarget===null||!n?.contains(e.relatedTarget)&&e.target!==window.document.activeElement&&t==="submenu")&&(c.closeMenu("click"),c.closeMenu("focus"))}),openMenu(e="click"){let{type:n}=o();l.menuOpenedBy[e]=!0,n==="overlay"&&document.documentElement.classList.add("has-modal-open")},closeMenu(e="click"){let n=o();l.menuOpenedBy[e]=!1,l.isMenuOpen||(n.modal?.contains(window.document.activeElement)&&n.previousFocus?.focus(),n.modal=null,n.previousFocus=null,n.type==="overlay"&&document.documentElement.classList.remove("has-modal-open"))}},callbacks:{initMenu(){let e=o(),{ref:n}=s();if(l.isMenuOpen){let t=a(n);e.modal=n,e.firstFocusableElement=t[0],e.lastFocusableElement=t[t.length-1]}},focusFirstElement(){let{ref:e}=s();l.isMenuOpen&&a(e)?.[0]?.focus()}}},{lock:!0});
|
||||
File diff suppressed because it is too large
Load Diff
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => 'e921883a3f8a7b1ead70');
|
||||
+64
File diff suppressed because one or more lines are too long
@@ -0,0 +1,53 @@
|
||||
// packages/block-library/build-module/query/view.mjs
|
||||
import {
|
||||
store,
|
||||
getContext,
|
||||
getElement,
|
||||
withSyncEvent
|
||||
} from "@wordpress/interactivity";
|
||||
var isValidLink = (ref) => ref && ref instanceof window.HTMLAnchorElement && ref.href && (!ref.target || ref.target === "_self") && ref.origin === window.location.origin;
|
||||
var isValidEvent = (event) => event.button === 0 && // Left clicks only.
|
||||
!event.metaKey && // Open in new tab (Mac).
|
||||
!event.ctrlKey && // Open in new tab (Windows).
|
||||
!event.altKey && // Download.
|
||||
!event.shiftKey && !event.defaultPrevented;
|
||||
store(
|
||||
"core/query",
|
||||
{
|
||||
actions: {
|
||||
navigate: withSyncEvent(function* (event) {
|
||||
const ctx = getContext();
|
||||
const { ref } = getElement();
|
||||
const queryRef = ref.closest(
|
||||
".wp-block-query[data-wp-router-region]"
|
||||
);
|
||||
if (isValidLink(ref) && isValidEvent(event)) {
|
||||
event.preventDefault();
|
||||
const { actions } = yield import("@wordpress/interactivity-router");
|
||||
yield actions.navigate(ref.href);
|
||||
ctx.url = ref.href;
|
||||
const firstAnchor = `.wp-block-post-template a[href]`;
|
||||
queryRef.querySelector(firstAnchor)?.focus();
|
||||
}
|
||||
}),
|
||||
*prefetch() {
|
||||
const { ref } = getElement();
|
||||
if (isValidLink(ref)) {
|
||||
const { actions } = yield import("@wordpress/interactivity-router");
|
||||
yield actions.prefetch(ref.href);
|
||||
}
|
||||
}
|
||||
},
|
||||
callbacks: {
|
||||
*prefetch() {
|
||||
const { url } = getContext();
|
||||
const { ref } = getElement();
|
||||
if (url && isValidLink(ref)) {
|
||||
const { actions } = yield import("@wordpress/interactivity-router");
|
||||
yield actions.prefetch(ref.href);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{ lock: true }
|
||||
);
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static'), array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => '7a4ec5bfb61a7137cf4b');
|
||||
@@ -0,0 +1 @@
|
||||
import{store as a,getContext as c,getElement as r,withSyncEvent as l}from"@wordpress/interactivity";var i=t=>t&&t instanceof window.HTMLAnchorElement&&t.href&&(!t.target||t.target==="_self")&&t.origin===window.location.origin,f=t=>t.button===0&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey&&!t.defaultPrevented;a("core/query",{actions:{navigate:l(function*(t){let e=c(),{ref:o}=r(),n=o.closest(".wp-block-query[data-wp-router-region]");if(i(o)&&f(t)){t.preventDefault();let{actions:s}=yield import("@wordpress/interactivity-router");yield s.navigate(o.href),e.url=o.href,n.querySelector(".wp-block-post-template a[href]")?.focus()}}),*prefetch(){let{ref:t}=r();if(i(t)){let{actions:e}=yield import("@wordpress/interactivity-router");yield e.prefetch(t.href)}}},callbacks:{*prefetch(){let{url:t}=c(),{ref:e}=r();if(t&&i(e)){let{actions:o}=yield import("@wordpress/interactivity-router");yield o.prefetch(e.href)}}}},{lock:!0});
|
||||
@@ -0,0 +1,63 @@
|
||||
// packages/block-library/build-module/search/view.mjs
|
||||
import {
|
||||
store,
|
||||
getContext,
|
||||
getElement,
|
||||
withSyncEvent
|
||||
} from "@wordpress/interactivity";
|
||||
var { actions } = store(
|
||||
"core/search",
|
||||
{
|
||||
state: {
|
||||
get ariaLabel() {
|
||||
const {
|
||||
isSearchInputVisible,
|
||||
ariaLabelCollapsed,
|
||||
ariaLabelExpanded
|
||||
} = getContext();
|
||||
return isSearchInputVisible ? ariaLabelExpanded : ariaLabelCollapsed;
|
||||
},
|
||||
get ariaControls() {
|
||||
const { isSearchInputVisible, inputId } = getContext();
|
||||
return isSearchInputVisible ? null : inputId;
|
||||
},
|
||||
get type() {
|
||||
const { isSearchInputVisible } = getContext();
|
||||
return isSearchInputVisible ? "submit" : "button";
|
||||
},
|
||||
get tabindex() {
|
||||
const { isSearchInputVisible } = getContext();
|
||||
return isSearchInputVisible ? "0" : "-1";
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
openSearchInput: withSyncEvent((event) => {
|
||||
const ctx = getContext();
|
||||
const { ref } = getElement();
|
||||
if (!ctx.isSearchInputVisible) {
|
||||
event.preventDefault();
|
||||
ctx.isSearchInputVisible = true;
|
||||
ref.parentElement.querySelector("input").focus();
|
||||
}
|
||||
}),
|
||||
closeSearchInput() {
|
||||
const ctx = getContext();
|
||||
ctx.isSearchInputVisible = false;
|
||||
},
|
||||
handleSearchKeydown: withSyncEvent((event) => {
|
||||
const { ref } = getElement();
|
||||
if (event?.key === "Escape") {
|
||||
actions.closeSearchInput();
|
||||
ref.querySelector("button").focus();
|
||||
}
|
||||
}),
|
||||
handleSearchFocusout: withSyncEvent((event) => {
|
||||
const { ref } = getElement();
|
||||
if (!ref.contains(event.relatedTarget) && event.target !== window.document.activeElement) {
|
||||
actions.closeSearchInput();
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
{ lock: true }
|
||||
);
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => '38bd0e230eaffa354d2a');
|
||||
@@ -0,0 +1 @@
|
||||
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});
|
||||
@@ -0,0 +1,170 @@
|
||||
// packages/block-library/build-module/tabs/view.mjs
|
||||
import {
|
||||
store,
|
||||
getContext,
|
||||
getElement,
|
||||
withSyncEvent
|
||||
} from "@wordpress/interactivity";
|
||||
var { actions, state } = store(
|
||||
"core/tabs",
|
||||
{
|
||||
state: {
|
||||
/**
|
||||
* Gets a contextually aware list of tabs for the current tabs block.
|
||||
*
|
||||
* @type {Array}
|
||||
*/
|
||||
get tabsList() {
|
||||
const context = getContext();
|
||||
const tabsId = context?.tabsId;
|
||||
const tabsList = state[tabsId];
|
||||
return tabsList;
|
||||
},
|
||||
/**
|
||||
* Gets the index of the active tab element whether it
|
||||
* is a tab label or tab panel.
|
||||
*
|
||||
* @type {number|null}
|
||||
*/
|
||||
get tabIndex() {
|
||||
const { attributes } = getElement();
|
||||
const tabId = attributes?.id?.replace("tab__", "") || null;
|
||||
if (!tabId) {
|
||||
return null;
|
||||
}
|
||||
const { tabsList } = state;
|
||||
const tabIndex = tabsList.findIndex((t) => t === tabId);
|
||||
return tabIndex;
|
||||
},
|
||||
/**
|
||||
* Whether the tab panel or tab label is the active tab.
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isActiveTab() {
|
||||
const { activeTabIndex } = getContext();
|
||||
const { tabIndex } = state;
|
||||
return activeTabIndex === tabIndex;
|
||||
},
|
||||
/**
|
||||
* The value of the tabindex attribute for tab buttons.
|
||||
* Only the active tab should be in the tab sequence.
|
||||
*
|
||||
* @type {number}
|
||||
*/
|
||||
get tabIndexAttribute() {
|
||||
return state.isActiveTab ? 0 : -1;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
/**
|
||||
* Handles the keydown events for the tab label and tabs controller.
|
||||
*
|
||||
* @param {KeyboardEvent} event The keydown event.
|
||||
*/
|
||||
handleTabKeyDown: withSyncEvent((event) => {
|
||||
const { tabIndex, tabsList } = state;
|
||||
if (tabIndex === null) {
|
||||
return;
|
||||
}
|
||||
if (event.key === "ArrowRight") {
|
||||
event.preventDefault();
|
||||
actions.moveFocus(tabIndex + 1);
|
||||
} else if (event.key === "ArrowLeft") {
|
||||
event.preventDefault();
|
||||
actions.moveFocus(tabIndex - 1);
|
||||
} else if (event.key === "Home") {
|
||||
event.preventDefault();
|
||||
actions.moveFocus(0);
|
||||
} else if (event.key === "End") {
|
||||
event.preventDefault();
|
||||
actions.moveFocus(tabsList.length - 1);
|
||||
}
|
||||
}),
|
||||
/**
|
||||
* Handles the click event for the tab label.
|
||||
*
|
||||
* @param {MouseEvent} event The click event.
|
||||
*/
|
||||
handleTabClick: withSyncEvent((event) => {
|
||||
event.preventDefault();
|
||||
const { tabIndex } = state;
|
||||
if (tabIndex !== null) {
|
||||
actions.setActiveTab(tabIndex);
|
||||
}
|
||||
}),
|
||||
/**
|
||||
* Moves focus to a specific tab without activating it.
|
||||
*
|
||||
* @param {number} tabIndex The index to move focus to.
|
||||
*/
|
||||
moveFocus: (tabIndex) => {
|
||||
const { tabsList } = state;
|
||||
if (!tabsList || tabsList.length === 0) {
|
||||
return;
|
||||
}
|
||||
let newIndex = tabIndex;
|
||||
if (newIndex < 0) {
|
||||
newIndex = tabsList.length - 1;
|
||||
} else if (newIndex >= tabsList.length) {
|
||||
newIndex = 0;
|
||||
}
|
||||
const tabId = tabsList[newIndex];
|
||||
const tabElement = document.getElementById("tab__" + tabId);
|
||||
if (tabElement) {
|
||||
tabElement.focus();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Sets the active tab index.
|
||||
*
|
||||
* @param {number} tabIndex The index of the active tab.
|
||||
* @param {boolean} scrollToTab Whether to scroll to the tab element.
|
||||
*/
|
||||
setActiveTab: (tabIndex, scrollToTab = false) => {
|
||||
const { tabsList } = state;
|
||||
if (!tabsList || tabsList.length === 0) {
|
||||
return;
|
||||
}
|
||||
let newIndex = tabIndex;
|
||||
if (newIndex < 0) {
|
||||
newIndex = 0;
|
||||
} else if (newIndex >= tabsList.length) {
|
||||
newIndex = tabsList.length - 1;
|
||||
}
|
||||
const context = getContext();
|
||||
context.activeTabIndex = newIndex;
|
||||
if (scrollToTab) {
|
||||
const tabId = tabsList[newIndex];
|
||||
const tabElement = document.getElementById(tabId);
|
||||
if (tabElement) {
|
||||
setTimeout(() => {
|
||||
tabElement.scrollIntoView({ behavior: "smooth" });
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
callbacks: {
|
||||
/**
|
||||
* When the tabs are initialized, we need to check if there is a hash in the url and if so if it exists in the current tabsList, set the active tab to that index.
|
||||
*
|
||||
*/
|
||||
onTabsInit: () => {
|
||||
const { tabsList } = state;
|
||||
if (tabsList.length === 0) {
|
||||
return;
|
||||
}
|
||||
const { hash } = window.location;
|
||||
const tabId = hash.replace("#", "");
|
||||
const tabIndex = tabsList.findIndex((t) => t === tabId);
|
||||
if (tabIndex >= 0) {
|
||||
actions.setActiveTab(tabIndex, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
lock: true
|
||||
}
|
||||
);
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => 'cc1a34b1bee3c2e17bc4');
|
||||
@@ -0,0 +1 @@
|
||||
import{store as d,getContext as i,getElement as u,withSyncEvent as b}from"@wordpress/interactivity";var{actions:c,state:a}=d("core/tabs",{state:{get tabsList(){let t=i()?.tabsId;return a[t]},get tabIndex(){let{attributes:e}=u(),t=e?.id?.replace("tab__","")||null;if(!t)return null;let{tabsList:n}=a;return n.findIndex(o=>o===t)},get isActiveTab(){let{activeTabIndex:e}=i(),{tabIndex:t}=a;return e===t},get tabIndexAttribute(){return a.isActiveTab?0:-1}},actions:{handleTabKeyDown:b(e=>{let{tabIndex:t,tabsList:n}=a;t!==null&&(e.key==="ArrowRight"?(e.preventDefault(),c.moveFocus(t+1)):e.key==="ArrowLeft"?(e.preventDefault(),c.moveFocus(t-1)):e.key==="Home"?(e.preventDefault(),c.moveFocus(0)):e.key==="End"&&(e.preventDefault(),c.moveFocus(n.length-1)))}),handleTabClick:b(e=>{e.preventDefault();let{tabIndex:t}=a;t!==null&&c.setActiveTab(t)}),moveFocus:e=>{let{tabsList:t}=a;if(!t||t.length===0)return;let n=e;n<0?n=t.length-1:n>=t.length&&(n=0);let s=t[n],o=document.getElementById("tab__"+s);o&&o.focus()},setActiveTab:(e,t=!1)=>{let{tabsList:n}=a;if(!n||n.length===0)return;let s=e;s<0?s=0:s>=n.length&&(s=n.length-1);let o=i();if(o.activeTabIndex=s,t){let r=n[s],l=document.getElementById(r);l&&setTimeout(()=>{l.scrollIntoView({behavior:"smooth"})},100)}}},callbacks:{onTabsInit:()=>{let{tabsList:e}=a;if(e.length===0)return;let{hash:t}=window.location,n=t.replace("#",""),s=e.findIndex(o=>o===n);s>=0&&c.setActiveTab(s,!0)}}},{lock:!0});
|
||||
+11022
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-primitives', 'wp-private-apis', 'wp-theme'), 'module_dependencies' => array(array('id' => '@wordpress/a11y', 'import' => 'static'), array('id' => '@wordpress/lazy-editor', 'import' => 'dynamic'), array('id' => '@wordpress/route', 'import' => 'static')), 'version' => '97d6c844a12f1615212a');
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,456 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
|
||||
// package-external:@wordpress/data
|
||||
var require_data = __commonJS({
|
||||
"package-external:@wordpress/data"(exports, module) {
|
||||
module.exports = window.wp.data;
|
||||
}
|
||||
});
|
||||
|
||||
// package-external:@wordpress/private-apis
|
||||
var require_private_apis = __commonJS({
|
||||
"package-external:@wordpress/private-apis"(exports, module) {
|
||||
module.exports = window.wp.privateApis;
|
||||
}
|
||||
});
|
||||
|
||||
// package-external:@wordpress/components
|
||||
var require_components = __commonJS({
|
||||
"package-external:@wordpress/components"(exports, module) {
|
||||
module.exports = window.wp.components;
|
||||
}
|
||||
});
|
||||
|
||||
// package-external:@wordpress/element
|
||||
var require_element = __commonJS({
|
||||
"package-external:@wordpress/element"(exports, module) {
|
||||
module.exports = window.wp.element;
|
||||
}
|
||||
});
|
||||
|
||||
// package-external:@wordpress/i18n
|
||||
var require_i18n = __commonJS({
|
||||
"package-external:@wordpress/i18n"(exports, module) {
|
||||
module.exports = window.wp.i18n;
|
||||
}
|
||||
});
|
||||
|
||||
// vendor-external:react/jsx-runtime
|
||||
var require_jsx_runtime = __commonJS({
|
||||
"vendor-external:react/jsx-runtime"(exports, module) {
|
||||
module.exports = window.ReactJSXRuntime;
|
||||
}
|
||||
});
|
||||
|
||||
// packages/connectors/build-module/api.mjs
|
||||
var import_data2 = __toESM(require_data(), 1);
|
||||
|
||||
// packages/connectors/build-module/store.mjs
|
||||
var import_data = __toESM(require_data(), 1);
|
||||
|
||||
// packages/connectors/build-module/lock-unlock.mjs
|
||||
var import_private_apis = __toESM(require_private_apis(), 1);
|
||||
var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
|
||||
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
|
||||
"@wordpress/connectors"
|
||||
);
|
||||
|
||||
// packages/connectors/build-module/store.mjs
|
||||
var STORE_NAME = "core/connectors";
|
||||
var DEFAULT_STATE = {
|
||||
connectors: {}
|
||||
};
|
||||
var actions = {
|
||||
registerConnector(slug, config) {
|
||||
return {
|
||||
type: "REGISTER_CONNECTOR",
|
||||
slug,
|
||||
config
|
||||
};
|
||||
},
|
||||
unregisterConnector(slug) {
|
||||
return {
|
||||
type: "UNREGISTER_CONNECTOR",
|
||||
slug
|
||||
};
|
||||
}
|
||||
};
|
||||
function reducer(state = DEFAULT_STATE, action) {
|
||||
switch (action.type) {
|
||||
case "REGISTER_CONNECTOR":
|
||||
return {
|
||||
...state,
|
||||
connectors: {
|
||||
...state.connectors,
|
||||
[action.slug]: {
|
||||
...state.connectors[action.slug],
|
||||
slug: action.slug,
|
||||
...action.config
|
||||
}
|
||||
}
|
||||
};
|
||||
case "UNREGISTER_CONNECTOR": {
|
||||
if (!state.connectors[action.slug]) {
|
||||
return state;
|
||||
}
|
||||
const { [action.slug]: _, ...rest } = state.connectors;
|
||||
return {
|
||||
...state,
|
||||
connectors: rest
|
||||
};
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
var selectors = {
|
||||
getConnectors: (0, import_data.createSelector)(
|
||||
(state) => Object.values(state.connectors),
|
||||
(state) => [state.connectors]
|
||||
),
|
||||
getConnector(state, slug) {
|
||||
return state.connectors[slug];
|
||||
}
|
||||
};
|
||||
var store = (0, import_data.createReduxStore)(STORE_NAME, {
|
||||
reducer
|
||||
});
|
||||
(0, import_data.register)(store);
|
||||
unlock(store).registerPrivateActions(actions);
|
||||
unlock(store).registerPrivateSelectors(selectors);
|
||||
|
||||
// packages/connectors/build-module/api.mjs
|
||||
function registerConnector(slug, config) {
|
||||
unlock((0, import_data2.dispatch)(store)).registerConnector(slug, config);
|
||||
}
|
||||
function unregisterConnector(slug) {
|
||||
unlock((0, import_data2.dispatch)(store)).unregisterConnector(slug);
|
||||
}
|
||||
|
||||
// packages/connectors/build-module/connector-item.mjs
|
||||
var import_components = __toESM(require_components(), 1);
|
||||
var import_element = __toESM(require_element(), 1);
|
||||
var import_i18n = __toESM(require_i18n(), 1);
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
||||
function ConnectorItem({
|
||||
className,
|
||||
logo,
|
||||
name,
|
||||
description,
|
||||
actionArea,
|
||||
children
|
||||
}) {
|
||||
const headingId = (0, import_element.useId)();
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalItem, { className, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 4, role: "group", "aria-labelledby": headingId, children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { alignment: "center", spacing: 4, wrap: true, children: [
|
||||
logo,
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexBlock, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 0, children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_components.__experimentalText,
|
||||
{
|
||||
weight: "var(--wpds-typography-font-weight-emphasis, 600)",
|
||||
size: 15,
|
||||
id: headingId,
|
||||
as: "h2",
|
||||
children: name
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalText, { variant: "muted", size: 12, children: description })
|
||||
] }) }),
|
||||
actionArea
|
||||
] }),
|
||||
children
|
||||
] }) });
|
||||
}
|
||||
function getHelpLinkLabel(helpUrl, helpLabel) {
|
||||
if (helpLabel) {
|
||||
return helpLabel;
|
||||
}
|
||||
if (!helpUrl) {
|
||||
return void 0;
|
||||
}
|
||||
try {
|
||||
return new URL(helpUrl).hostname;
|
||||
} catch {
|
||||
return helpUrl;
|
||||
}
|
||||
}
|
||||
function createConnectorHelpLink(helpUrl, helpLabel, message) {
|
||||
if (!helpUrl) {
|
||||
return void 0;
|
||||
}
|
||||
return (0, import_element.createInterpolateElement)(
|
||||
(0, import_i18n.sprintf)(message, "<a></a>"),
|
||||
{
|
||||
a: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ExternalLink, { href: helpUrl, children: getHelpLinkLabel(helpUrl, helpLabel) })
|
||||
}
|
||||
);
|
||||
}
|
||||
function useConnectorSettingsSave(onSave, fallbackErrorMessage) {
|
||||
const [isSaving, setIsSaving] = (0, import_element.useState)(false);
|
||||
const [saveError, setSaveError] = (0, import_element.useState)(null);
|
||||
const handleSave = async (value) => {
|
||||
setSaveError(null);
|
||||
setIsSaving(true);
|
||||
try {
|
||||
await onSave?.(value);
|
||||
} catch (error) {
|
||||
setSaveError(
|
||||
error instanceof Error ? error.message : fallbackErrorMessage
|
||||
);
|
||||
} finally {
|
||||
setIsSaving(false);
|
||||
}
|
||||
};
|
||||
return {
|
||||
isSaving,
|
||||
saveError,
|
||||
setSaveError,
|
||||
handleSave
|
||||
};
|
||||
}
|
||||
function ConnectorSettingsFrame({
|
||||
readOnly,
|
||||
children
|
||||
}) {
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_components.__experimentalVStack,
|
||||
{
|
||||
spacing: 4,
|
||||
className: "connector-settings",
|
||||
style: readOnly ? {
|
||||
"--wp-components-color-background": "#f0f0f0"
|
||||
} : void 0,
|
||||
children
|
||||
}
|
||||
);
|
||||
}
|
||||
function ConnectorSettingsFooter({
|
||||
readOnly,
|
||||
onRemove,
|
||||
canSave,
|
||||
isSaving,
|
||||
onSave
|
||||
}) {
|
||||
if (readOnly) {
|
||||
if (!onRemove) {
|
||||
return null;
|
||||
}
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalHStack, { justify: "flex-start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Button, { variant: "link", isDestructive: true, onClick: onRemove, children: (0, import_i18n.__)("Remove and replace") }) });
|
||||
}
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalHStack, { justify: "flex-start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_components.Button,
|
||||
{
|
||||
__next40pxDefaultSize: true,
|
||||
variant: "primary",
|
||||
disabled: !canSave || isSaving,
|
||||
accessibleWhenDisabled: true,
|
||||
isBusy: isSaving,
|
||||
onClick: onSave,
|
||||
children: (0, import_i18n.__)("Save")
|
||||
}
|
||||
) });
|
||||
}
|
||||
function DefaultConnectorSettings({
|
||||
onSave,
|
||||
onRemove,
|
||||
initialValue = "",
|
||||
helpUrl,
|
||||
helpLabel,
|
||||
readOnly = false,
|
||||
keySource
|
||||
}) {
|
||||
const [apiKey, setApiKey] = (0, import_element.useState)(initialValue);
|
||||
const { isSaving, saveError, setSaveError, handleSave } = useConnectorSettingsSave(
|
||||
onSave,
|
||||
(0, import_i18n.__)(
|
||||
"It was not possible to connect to the provider using this key."
|
||||
)
|
||||
);
|
||||
const helpLink = createConnectorHelpLink(
|
||||
helpUrl,
|
||||
helpLabel,
|
||||
/* translators: %s: Link to provider settings. */
|
||||
(0, import_i18n.__)("Get your API key at %s")
|
||||
);
|
||||
const isExternallyConfigured = keySource === "env" || keySource === "constant";
|
||||
const getHelp = () => {
|
||||
if (isExternallyConfigured) {
|
||||
if (keySource === "env") {
|
||||
return (0, import_i18n.__)(
|
||||
"This API key is configured using an environment variable."
|
||||
);
|
||||
}
|
||||
if (keySource === "constant") {
|
||||
return (0, import_i18n.__)("This API key is configured as a constant.");
|
||||
}
|
||||
}
|
||||
if (readOnly) {
|
||||
return helpUrl ? createConnectorHelpLink(
|
||||
helpUrl,
|
||||
helpLabel,
|
||||
/* translators: %s: Link to provider settings. */
|
||||
(0, import_i18n.__)(
|
||||
"Your API key is stored securely. You can manage it at %s"
|
||||
)
|
||||
) : (0, import_i18n.__)("Your API key is stored securely.");
|
||||
}
|
||||
if (saveError) {
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { role: "alert", className: "connector-settings__error", children: saveError });
|
||||
}
|
||||
return helpLink;
|
||||
};
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ConnectorSettingsFrame, { readOnly, children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_components.TextControl,
|
||||
{
|
||||
label: (0, import_i18n.__)("API Key"),
|
||||
value: apiKey,
|
||||
onChange: (value) => {
|
||||
if (!readOnly) {
|
||||
setSaveError(null);
|
||||
setApiKey(value);
|
||||
}
|
||||
},
|
||||
placeholder: (0, import_i18n.__)("Enter your API key"),
|
||||
disabled: readOnly || isSaving,
|
||||
autoComplete: "off",
|
||||
help: getHelp()
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
ConnectorSettingsFooter,
|
||||
{
|
||||
readOnly,
|
||||
onRemove,
|
||||
canSave: !!apiKey,
|
||||
isSaving,
|
||||
onSave: () => handleSave(apiKey)
|
||||
}
|
||||
)
|
||||
] });
|
||||
}
|
||||
function ApplicationPasswordConnectorSettings({
|
||||
onSave,
|
||||
onRemove,
|
||||
initialUsername = "",
|
||||
helpUrl,
|
||||
helpLabel,
|
||||
readOnly = false,
|
||||
keySource
|
||||
}) {
|
||||
const [username, setUsername] = (0, import_element.useState)(initialUsername);
|
||||
const [applicationPassword, setApplicationPassword] = (0, import_element.useState)("");
|
||||
const { isSaving, saveError, setSaveError, handleSave } = useConnectorSettingsSave(
|
||||
onSave,
|
||||
(0, import_i18n.__)("It was not possible to save these credentials.")
|
||||
);
|
||||
const help = createConnectorHelpLink(
|
||||
helpUrl,
|
||||
helpLabel,
|
||||
/* translators: %s: Link to the remote site's application passwords screen. */
|
||||
(0, import_i18n.__)("Create an application password at %s")
|
||||
);
|
||||
let applicationPasswordHelp = help;
|
||||
if (keySource === "env") {
|
||||
applicationPasswordHelp = (0, import_i18n.__)(
|
||||
"These credentials are configured using an environment variable."
|
||||
);
|
||||
} else if (keySource === "constant") {
|
||||
applicationPasswordHelp = (0, import_i18n.__)(
|
||||
"These credentials are configured as a constant."
|
||||
);
|
||||
} else if (readOnly) {
|
||||
applicationPasswordHelp = (0, import_i18n.__)(
|
||||
"Your application password is stored securely."
|
||||
);
|
||||
}
|
||||
if (saveError) {
|
||||
applicationPasswordHelp = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { role: "alert", className: "connector-settings__error", children: saveError });
|
||||
}
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ConnectorSettingsFrame, { readOnly, children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_components.TextControl,
|
||||
{
|
||||
label: (0, import_i18n.__)("Username"),
|
||||
value: username,
|
||||
onChange: (value) => {
|
||||
if (!readOnly) {
|
||||
setSaveError(null);
|
||||
setUsername(value);
|
||||
}
|
||||
},
|
||||
placeholder: (0, import_i18n.__)("Enter your username"),
|
||||
disabled: readOnly || isSaving,
|
||||
autoComplete: "username"
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_components.TextControl,
|
||||
{
|
||||
label: (0, import_i18n.__)("Application password"),
|
||||
value: readOnly ? "••••••••••••••••" : applicationPassword,
|
||||
onChange: (value) => {
|
||||
if (!readOnly) {
|
||||
setSaveError(null);
|
||||
setApplicationPassword(value);
|
||||
}
|
||||
},
|
||||
type: "password",
|
||||
placeholder: (0, import_i18n.__)("Enter your application password"),
|
||||
disabled: readOnly || isSaving,
|
||||
autoComplete: "new-password",
|
||||
help: applicationPasswordHelp
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
ConnectorSettingsFooter,
|
||||
{
|
||||
readOnly,
|
||||
onRemove,
|
||||
canSave: !!username.trim() && !!applicationPassword,
|
||||
isSaving,
|
||||
onSave: () => handleSave({
|
||||
username: username.trim(),
|
||||
applicationPassword
|
||||
})
|
||||
}
|
||||
)
|
||||
] });
|
||||
}
|
||||
|
||||
// packages/connectors/build-module/private-apis.mjs
|
||||
var privateApis = {};
|
||||
lock(privateApis, { store, STORE_NAME });
|
||||
export {
|
||||
ApplicationPasswordConnectorSettings as __experimentalApplicationPasswordConnectorSettings,
|
||||
ConnectorItem as __experimentalConnectorItem,
|
||||
DefaultConnectorSettings as __experimentalDefaultConnectorSettings,
|
||||
registerConnector as __experimentalRegisterConnector,
|
||||
unregisterConnector as __experimentalUnregisterConnector,
|
||||
privateApis
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-private-apis'), 'version' => '8aa4346de9f4f9cbfaef');
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-notices', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-theme', 'wp-url', 'wp-warning'), 'module_dependencies' => array(array('id' => '@wordpress/a11y', 'import' => 'static'), array('id' => '@wordpress/route', 'import' => 'static')), 'version' => '06bbdee380f4cf86dff0');
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,127 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
|
||||
// package-external:@wordpress/api-fetch
|
||||
var require_api_fetch = __commonJS({
|
||||
"package-external:@wordpress/api-fetch"(exports, module) {
|
||||
module.exports = window.wp.apiFetch;
|
||||
}
|
||||
});
|
||||
|
||||
// package-external:@wordpress/url
|
||||
var require_url = __commonJS({
|
||||
"package-external:@wordpress/url"(exports, module) {
|
||||
module.exports = window.wp.url;
|
||||
}
|
||||
});
|
||||
|
||||
// packages/core-abilities/build-module/index.mjs
|
||||
var import_api_fetch = __toESM(require_api_fetch(), 1);
|
||||
var import_url = __toESM(require_url(), 1);
|
||||
import { registerAbility, registerAbilityCategory } from "@wordpress/abilities";
|
||||
var API_BASE = "/wp-abilities/v1";
|
||||
var ABILITIES_ENDPOINT = `${API_BASE}/abilities`;
|
||||
var CATEGORIES_ENDPOINT = `${API_BASE}/categories`;
|
||||
function createServerCallback(ability) {
|
||||
return async (input) => {
|
||||
let method = "POST";
|
||||
if (!!ability.meta?.annotations?.readonly) {
|
||||
method = "GET";
|
||||
} else if (!!ability.meta?.annotations?.destructive && !!ability.meta?.annotations?.idempotent) {
|
||||
method = "DELETE";
|
||||
}
|
||||
let path = `${ABILITIES_ENDPOINT}/${ability.name}/run`;
|
||||
const options = {
|
||||
method
|
||||
};
|
||||
if (["GET", "DELETE"].includes(method) && input !== null && input !== void 0) {
|
||||
path = (0, import_url.addQueryArgs)(path, { input });
|
||||
} else if (method === "POST" && input !== null && input !== void 0) {
|
||||
options.data = { input };
|
||||
}
|
||||
return (0, import_api_fetch.default)({
|
||||
path,
|
||||
...options
|
||||
});
|
||||
};
|
||||
}
|
||||
async function initializeCategories() {
|
||||
try {
|
||||
const categories = await (0, import_api_fetch.default)({
|
||||
path: (0, import_url.addQueryArgs)(CATEGORIES_ENDPOINT, {
|
||||
per_page: -1,
|
||||
context: "edit"
|
||||
})
|
||||
});
|
||||
if (categories && Array.isArray(categories)) {
|
||||
for (const category of categories) {
|
||||
registerAbilityCategory(category.slug, {
|
||||
label: category.label,
|
||||
description: category.description,
|
||||
meta: {
|
||||
annotations: { serverRegistered: true }
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch ability categories:", error);
|
||||
}
|
||||
}
|
||||
async function initializeAbilities() {
|
||||
try {
|
||||
const abilities = await (0, import_api_fetch.default)({
|
||||
path: (0, import_url.addQueryArgs)(ABILITIES_ENDPOINT, {
|
||||
per_page: -1,
|
||||
context: "edit"
|
||||
})
|
||||
});
|
||||
if (abilities && Array.isArray(abilities)) {
|
||||
for (const ability of abilities) {
|
||||
registerAbility({
|
||||
...ability,
|
||||
callback: createServerCallback(ability),
|
||||
meta: {
|
||||
annotations: {
|
||||
...ability.meta?.annotations,
|
||||
serverRegistered: true
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch abilities:", error);
|
||||
}
|
||||
}
|
||||
async function initialize() {
|
||||
await initializeCategories();
|
||||
await initializeAbilities();
|
||||
}
|
||||
var ready = initialize();
|
||||
export {
|
||||
ready
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('wp-api-fetch', 'wp-url'), 'module_dependencies' => array(array('id' => '@wordpress/abilities', 'import' => 'static')), 'version' => '012760fd849397dd0031');
|
||||
@@ -0,0 +1 @@
|
||||
var E=Object.create;var s=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var b=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of u(t))!w.call(e,a)&&a!==i&&s(e,a,{get:()=>t[a],enumerable:!(r=A(t,a))||r.enumerable});return e};var l=(e,t,i)=>(i=e!=null?E(v(e)):{},b(t||!e||!e.__esModule?s(i,"default",{value:e,enumerable:!0}):i,e));var f=c((C,d)=>{d.exports=window.wp.apiFetch});var y=c((D,p)=>{p.exports=window.wp.url});var o=l(f(),1),n=l(y(),1);import{registerAbility as h,registerAbilityCategory as T}from"@wordpress/abilities";var m="/wp-abilities/v1",g=`${m}/abilities`,I=`${m}/categories`;function S(e){return async t=>{let i="POST";e.meta?.annotations?.readonly?i="GET":e.meta?.annotations?.destructive&&e.meta?.annotations?.idempotent&&(i="DELETE");let r=`${g}/${e.name}/run`,a={method:i};return["GET","DELETE"].includes(i)&&t!==null&&t!==void 0?r=(0,n.addQueryArgs)(r,{input:t}):i==="POST"&&t!==null&&t!==void 0&&(a.data={input:t}),(0,o.default)({path:r,...a})}}async function x(){try{let e=await(0,o.default)({path:(0,n.addQueryArgs)(I,{per_page:-1,context:"edit"})});if(e&&Array.isArray(e))for(let t of e)T(t.slug,{label:t.label,description:t.description,meta:{annotations:{serverRegistered:!0}}})}catch(e){console.error("Failed to fetch ability categories:",e)}}async function O(){try{let e=await(0,o.default)({path:(0,n.addQueryArgs)(g,{per_page:-1,context:"edit"})});if(e&&Array.isArray(e))for(let t of e)h({...t,callback:S(t),meta:{annotations:{...t.meta?.annotations,serverRegistered:!0}}})}catch(e){console.error("Failed to fetch abilities:",e)}}async function P(){await x(),await O()}var N=P();export{N as ready};
|
||||
@@ -0,0 +1,70 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
|
||||
// package-external:@wordpress/data
|
||||
var require_data = __commonJS({
|
||||
"package-external:@wordpress/data"(exports, module) {
|
||||
module.exports = window.wp.data;
|
||||
}
|
||||
});
|
||||
|
||||
// package-external:@wordpress/core-data
|
||||
var require_core_data = __commonJS({
|
||||
"package-external:@wordpress/core-data"(exports, module) {
|
||||
module.exports = window.wp.coreData;
|
||||
}
|
||||
});
|
||||
|
||||
// package-external:@wordpress/i18n
|
||||
var require_i18n = __commonJS({
|
||||
"package-external:@wordpress/i18n"(exports, module) {
|
||||
module.exports = window.wp.i18n;
|
||||
}
|
||||
});
|
||||
|
||||
// packages/dashboard-init/build-module/index.mjs
|
||||
var import_data = __toESM(require_data(), 1);
|
||||
var import_core_data = __toESM(require_core_data(), 1);
|
||||
var import_i18n = __toESM(require_i18n(), 1);
|
||||
async function init() {
|
||||
if ((0, import_data.select)(import_core_data.store).getEntityConfig("root", "widgetModule")) {
|
||||
return;
|
||||
}
|
||||
(0, import_data.dispatch)(import_core_data.store).addEntities([
|
||||
{
|
||||
name: "widgetModule",
|
||||
kind: "root",
|
||||
key: "name",
|
||||
baseURL: "/wp/v2/widget-modules",
|
||||
plural: "widgetModules",
|
||||
label: (0, import_i18n.__)("Widget modules"),
|
||||
supportsPagination: false
|
||||
}
|
||||
]);
|
||||
}
|
||||
export {
|
||||
init
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('wp-core-data', 'wp-data', 'wp-i18n'), 'version' => 'dfe923ac4bd0bd01b9aa');
|
||||
@@ -0,0 +1 @@
|
||||
var x=Object.create;var p=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var d=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports);var E=(t,o,e,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of M(o))!k.call(t,i)&&i!==e&&p(t,i,{get:()=>o[i],enumerable:!(s=y(o,i))||s.enumerable});return t};var n=(t,o,e)=>(e=t!=null?x(b(t)):{},E(o||!t||!t.__esModule?p(e,"default",{value:t,enumerable:!0}):e,t));var l=d((h,w)=>{w.exports=window.wp.data});var u=d((v,m)=>{m.exports=window.wp.coreData});var f=d((C,g)=>{g.exports=window.wp.i18n});var r=n(l(),1),a=n(u(),1),c=n(f(),1);async function D(){(0,r.select)(a.store).getEntityConfig("root","widgetModule")||(0,r.dispatch)(a.store).addEntities([{name:"widgetModule",kind:"root",key:"name",baseURL:"/wp/v2/widget-modules",plural:"widgetModules",label:(0,c.__)("Widget modules"),supportsPagination:!1}])}export{D as init};
|
||||
@@ -0,0 +1,105 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
|
||||
// package-external:@wordpress/primitives
|
||||
var require_primitives = __commonJS({
|
||||
"package-external:@wordpress/primitives"(exports, module) {
|
||||
module.exports = window.wp.primitives;
|
||||
}
|
||||
});
|
||||
|
||||
// vendor-external:react/jsx-runtime
|
||||
var require_jsx_runtime = __commonJS({
|
||||
"vendor-external:react/jsx-runtime"(exports, module) {
|
||||
module.exports = window.ReactJSXRuntime;
|
||||
}
|
||||
});
|
||||
|
||||
// package-external:@wordpress/data
|
||||
var require_data = __commonJS({
|
||||
"package-external:@wordpress/data"(exports, module) {
|
||||
module.exports = window.wp.data;
|
||||
}
|
||||
});
|
||||
|
||||
// packages/icons/build-module/library/home.mjs
|
||||
var import_primitives = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
||||
var home_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z" }) });
|
||||
|
||||
// packages/icons/build-module/library/layout.mjs
|
||||
var import_primitives2 = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
||||
var layout_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) });
|
||||
|
||||
// packages/icons/build-module/library/navigation.mjs
|
||||
var import_primitives3 = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
||||
var navigation_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z" }) });
|
||||
|
||||
// packages/icons/build-module/library/page.mjs
|
||||
var import_primitives4 = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
||||
var page_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" })
|
||||
] });
|
||||
|
||||
// packages/icons/build-module/library/styles.mjs
|
||||
var import_primitives5 = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
||||
var styles_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z" }) });
|
||||
|
||||
// packages/icons/build-module/library/symbol-filled.mjs
|
||||
var import_primitives6 = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
|
||||
var symbol_filled_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) });
|
||||
|
||||
// packages/icons/build-module/library/symbol.mjs
|
||||
var import_primitives7 = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
|
||||
var symbol_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) });
|
||||
|
||||
// packages/edit-site-init/build-module/index.mjs
|
||||
var import_data = __toESM(require_data(), 1);
|
||||
import { store as bootStore } from "@wordpress/boot";
|
||||
async function init() {
|
||||
const menuIcons = {
|
||||
home: { icon: home_default },
|
||||
styles: { icon: styles_default },
|
||||
navigation: { icon: navigation_default },
|
||||
pages: { icon: page_default },
|
||||
templateParts: { icon: symbol_filled_default },
|
||||
patterns: { icon: symbol_default },
|
||||
templates: { icon: layout_default }
|
||||
};
|
||||
Object.entries(menuIcons).forEach(([id, { icon }]) => {
|
||||
(0, import_data.dispatch)(bootStore).updateMenuItem(id, { icon });
|
||||
});
|
||||
}
|
||||
export {
|
||||
init
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-data', 'wp-element', 'wp-primitives'), 'module_dependencies' => array(array('id' => '@wordpress/boot', 'import' => 'static')), 'version' => 'e2f82d3d1c3179d25626');
|
||||
@@ -0,0 +1 @@
|
||||
var A=Object.create;var j=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var h=(f,a)=>()=>(a||f((a={exports:{}}).exports,a),a.exports);var _=(f,a,r,z)=>{if(a&&typeof a=="object"||typeof a=="function")for(let l of F(a))!N.call(f,l)&&l!==r&&j(f,l,{get:()=>a[l],enumerable:!(z=U(a,l))||z.enumerable});return f};var t=(f,a,r)=>(r=f!=null?A(I(f)):{},_(a||!f||!f.__esModule?j(r,"default",{value:f,enumerable:!0}):r,f));var e=h((O,T)=>{T.exports=window.wp.primitives});var o=h((Z,D)=>{D.exports=window.ReactJSXRuntime});var H=h((sa,P)=>{P.exports=window.wp.data});var d=t(e(),1),g=t(o(),1),w=(0,g.jsx)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,g.jsx)(d.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})});var u=t(e(),1),v=t(o(),1),b=(0,v.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,v.jsx)(u.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})});var i=t(e(),1),y=t(o(),1),x=(0,y.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,y.jsx)(i.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})});var s=t(e(),1),m=t(o(),1),L=(0,m.jsxs)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,m.jsx)(s.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,m.jsx)(s.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]});var p=t(e(),1),C=t(o(),1),R=(0,C.jsx)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,C.jsx)(p.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"})});var n=t(e(),1),k=t(o(),1),V=(0,k.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,k.jsx)(n.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});var c=t(e(),1),S=t(o(),1),B=(0,S.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,S.jsx)(c.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});var M=t(H(),1);import{store as q}from"@wordpress/boot";async function ua(){Object.entries({home:{icon:w},styles:{icon:R},navigation:{icon:x},pages:{icon:L},templateParts:{icon:V},patterns:{icon:B},templates:{icon:b}}).forEach(([a,{icon:r}])=>{(0,M.dispatch)(q).updateMenuItem(a,{icon:r})})}export{ua as init};
|
||||
@@ -0,0 +1,28 @@
|
||||
// packages/interactivity-router/build-module/full-page.mjs
|
||||
var isValidLink = (ref) => ref && ref instanceof window.HTMLAnchorElement && ref.href && (!ref.target || ref.target === "_self") && ref.origin === window.location.origin && !ref.pathname.startsWith("/wp-admin") && !ref.pathname.startsWith("/wp-login.php") && !ref.getAttribute("href").startsWith("#") && !new URL(ref.href).searchParams.has("_wpnonce");
|
||||
var isValidEvent = (event) => event && event.button === 0 && // Left clicks only.
|
||||
!event.metaKey && // Open in new tab (Mac).
|
||||
!event.ctrlKey && // Open in new tab (Windows).
|
||||
!event.altKey && // Download.
|
||||
!event.shiftKey && !event.defaultPrevented;
|
||||
document.addEventListener("click", async (event) => {
|
||||
const ref = event.target.closest("a");
|
||||
if (isValidLink(ref) && isValidEvent(event)) {
|
||||
event.preventDefault();
|
||||
const { actions } = await import("@wordpress/interactivity-router");
|
||||
actions.navigate(ref.href);
|
||||
}
|
||||
});
|
||||
document.addEventListener(
|
||||
"mouseenter",
|
||||
async (event) => {
|
||||
if (event.target?.nodeName === "A") {
|
||||
const ref = event.target.closest("a");
|
||||
if (isValidLink(ref) && isValidEvent(event)) {
|
||||
const { actions } = await import("@wordpress/interactivity-router");
|
||||
actions.prefetch(ref.href);
|
||||
}
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => '5c07cd7a12ae073c5241');
|
||||
+1
@@ -0,0 +1 @@
|
||||
var s=t=>t&&t instanceof window.HTMLAnchorElement&&t.href&&(!t.target||t.target==="_self")&&t.origin===window.location.origin&&!t.pathname.startsWith("/wp-admin")&&!t.pathname.startsWith("/wp-login.php")&&!t.getAttribute("href").startsWith("#")&&!new URL(t.href).searchParams.has("_wpnonce"),n=t=>t&&t.button===0&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey&&!t.defaultPrevented;document.addEventListener("click",async t=>{let a=t.target.closest("a");if(s(a)&&n(t)){t.preventDefault();let{actions:i}=await import("@wordpress/interactivity-router");i.navigate(a.href)}});document.addEventListener("mouseenter",async t=>{if(t.target?.nodeName==="A"){let a=t.target.closest("a");if(s(a)&&n(t)){let{actions:i}=await import("@wordpress/interactivity-router");i.prefetch(a.href)}}},!0);
|
||||
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/a11y', 'import' => 'dynamic'), array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => 'a6e90b8896f83fb1b5dd');
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => 'efaa5193bbad9c60ffd1');
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '662cb0e7f68d2a21cd68');
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
|
||||
// packages/latex-to-mathml/build-module/loader.mjs
|
||||
function loader() {
|
||||
return import("@wordpress/latex-to-mathml");
|
||||
}
|
||||
export {
|
||||
loader as default
|
||||
};
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/latex-to-mathml', 'import' => 'dynamic')), 'version' => '4f37456af539bd3d2351');
|
||||
@@ -0,0 +1 @@
|
||||
function r(){return import("@wordpress/latex-to-mathml")}export{r as default};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-private-apis', 'wp-style-engine'), 'version' => 'f947bd8281443624c0d0');
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
/**
|
||||
* Script module registry - Auto-generated by build process.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* @package wp
|
||||
*/
|
||||
|
||||
return array(
|
||||
array(
|
||||
'id' => '@wordpress/a11y',
|
||||
'path' => 'a11y/index',
|
||||
'asset' => 'a11y/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/abilities',
|
||||
'path' => 'abilities/index',
|
||||
'asset' => 'abilities/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-editor/utils/fit-text-frontend',
|
||||
'path' => 'block-editor/utils/fit-text-frontend',
|
||||
'asset' => 'block-editor/utils/fit-text-frontend.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/accordion/view',
|
||||
'path' => 'block-library/accordion/view',
|
||||
'asset' => 'block-library/accordion/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/file/view',
|
||||
'path' => 'block-library/file/view',
|
||||
'asset' => 'block-library/file/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/form/view',
|
||||
'path' => 'block-library/form/view',
|
||||
'asset' => 'block-library/form/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/image/view',
|
||||
'path' => 'block-library/image/view',
|
||||
'asset' => 'block-library/image/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/navigation/view',
|
||||
'path' => 'block-library/navigation/view',
|
||||
'asset' => 'block-library/navigation/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/playlist/view',
|
||||
'path' => 'block-library/playlist/view',
|
||||
'asset' => 'block-library/playlist/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/query/view',
|
||||
'path' => 'block-library/query/view',
|
||||
'asset' => 'block-library/query/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/search/view',
|
||||
'path' => 'block-library/search/view',
|
||||
'asset' => 'block-library/search/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/tabs/view',
|
||||
'path' => 'block-library/tabs/view',
|
||||
'asset' => 'block-library/tabs/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/boot',
|
||||
'path' => 'boot/index',
|
||||
'asset' => 'boot/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/connectors',
|
||||
'path' => 'connectors/index',
|
||||
'asset' => 'connectors/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/content-types',
|
||||
'path' => 'content-types/index',
|
||||
'asset' => 'content-types/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/core-abilities',
|
||||
'path' => 'core-abilities/index',
|
||||
'asset' => 'core-abilities/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/dashboard-init',
|
||||
'path' => 'dashboard-init/index',
|
||||
'asset' => 'dashboard-init/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/edit-site-init',
|
||||
'path' => 'edit-site-init/index',
|
||||
'asset' => 'edit-site-init/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/interactivity',
|
||||
'path' => 'interactivity/index',
|
||||
'asset' => 'interactivity/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/interactivity-router',
|
||||
'path' => 'interactivity-router/index',
|
||||
'asset' => 'interactivity-router/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/interactivity-router/full-page',
|
||||
'path' => 'interactivity-router/full-page',
|
||||
'asset' => 'interactivity-router/full-page.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/latex-to-mathml',
|
||||
'path' => 'latex-to-mathml/index',
|
||||
'asset' => 'latex-to-mathml/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/latex-to-mathml/loader',
|
||||
'path' => 'latex-to-mathml/loader',
|
||||
'asset' => 'latex-to-mathml/loader.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/lazy-editor',
|
||||
'path' => 'lazy-editor/index',
|
||||
'asset' => 'lazy-editor/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/route',
|
||||
'path' => 'route/index',
|
||||
'asset' => 'route/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/video-conversion/loader',
|
||||
'path' => 'video-conversion/loader',
|
||||
'asset' => 'video-conversion/loader.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/video-conversion/worker',
|
||||
'path' => 'video-conversion/worker',
|
||||
'asset' => 'video-conversion/worker.min.asset.php',
|
||||
'min_only' => true,
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/vips/loader',
|
||||
'path' => 'vips/loader',
|
||||
'asset' => 'vips/loader.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/vips/worker',
|
||||
'path' => 'vips/worker',
|
||||
'asset' => 'vips/worker.min.asset.php',
|
||||
'min_only' => true,
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/workflow',
|
||||
'path' => 'workflow/index',
|
||||
'asset' => 'workflow/index.min.asset.php',
|
||||
),
|
||||
);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-private-apis'), 'version' => 'ef851c0f4dda0d1dd359');
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
|
||||
// packages/video-conversion/build-module/loader.mjs
|
||||
function loader() {
|
||||
return import("@wordpress/video-conversion/worker");
|
||||
}
|
||||
export {
|
||||
loader as default
|
||||
};
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/video-conversion/worker', 'import' => 'dynamic')), 'version' => '81a2ac6d5619086278fd');
|
||||
@@ -0,0 +1 @@
|
||||
function r(){return import("@wordpress/video-conversion/worker")}export{r as default};
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '4d3627c45251ceb4f9a2');
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/vips/worker', 'import' => 'dynamic')), 'version' => '07c9acb45d3e5d81829a');
|
||||
@@ -0,0 +1 @@
|
||||
function r(){return import("@wordpress/vips/worker")}export{r as default};
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '685442d334b2d3e70832');
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-primitives', 'wp-private-apis'), 'module_dependencies' => array(array('id' => '@wordpress/abilities', 'import' => 'static'), array('id' => '@wordpress/core-abilities', 'import' => 'dynamic')), 'version' => '9e09ede3195f2f51bc49');
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user