CMS Project Sync
This commit is contained in:
@@ -0,0 +1,176 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat get default export */
|
||||
/******/ (() => {
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = (module) => {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ () => (module['default']) :
|
||||
/******/ () => (module);
|
||||
/******/ __webpack_require__.d(getter, { a: getter });
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
setup: () => (/* binding */ setup),
|
||||
speak: () => (/* reexport */ speak)
|
||||
});
|
||||
|
||||
;// external ["wp","domReady"]
|
||||
const external_wp_domReady_namespaceObject = window["wp"]["domReady"];
|
||||
var external_wp_domReady_default = /*#__PURE__*/__webpack_require__.n(external_wp_domReady_namespaceObject);
|
||||
;// ./node_modules/@wordpress/a11y/build-module/script/add-container.js
|
||||
function addContainer(ariaLive = "polite") {
|
||||
const container = document.createElement("div");
|
||||
container.id = `a11y-speak-${ariaLive}`;
|
||||
container.className = "a11y-speak-region";
|
||||
container.setAttribute(
|
||||
"style",
|
||||
"position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"
|
||||
);
|
||||
container.setAttribute("aria-live", ariaLive);
|
||||
container.setAttribute("aria-relevant", "additions text");
|
||||
container.setAttribute("aria-atomic", "true");
|
||||
const { body } = document;
|
||||
if (body) {
|
||||
body.appendChild(container);
|
||||
}
|
||||
return container;
|
||||
}
|
||||
|
||||
|
||||
;// external ["wp","i18n"]
|
||||
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
|
||||
;// ./node_modules/@wordpress/a11y/build-module/script/add-intro-text.js
|
||||
|
||||
function addIntroText() {
|
||||
const introText = document.createElement("p");
|
||||
introText.id = "a11y-speak-intro-text";
|
||||
introText.className = "a11y-speak-intro-text";
|
||||
introText.textContent = (0,external_wp_i18n_namespaceObject.__)("Notifications");
|
||||
introText.setAttribute(
|
||||
"style",
|
||||
"position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"
|
||||
);
|
||||
introText.setAttribute("hidden", "");
|
||||
const { body } = document;
|
||||
if (body) {
|
||||
body.appendChild(introText);
|
||||
}
|
||||
return introText;
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/a11y/build-module/shared/clear.js
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/a11y/build-module/shared/filter-message.js
|
||||
let previousMessage = "";
|
||||
function filterMessage(message) {
|
||||
message = message.replace(/<[^<>]+>/g, " ");
|
||||
if (previousMessage === message) {
|
||||
message += "\xA0";
|
||||
}
|
||||
previousMessage = message;
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/a11y/build-module/shared/index.js
|
||||
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/a11y/build-module/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
function setup() {
|
||||
const introText = document.getElementById("a11y-speak-intro-text");
|
||||
const containerAssertive = document.getElementById(
|
||||
"a11y-speak-assertive"
|
||||
);
|
||||
const containerPolite = document.getElementById("a11y-speak-polite");
|
||||
if (introText === null) {
|
||||
addIntroText();
|
||||
}
|
||||
if (containerAssertive === null) {
|
||||
addContainer("assertive");
|
||||
}
|
||||
if (containerPolite === null) {
|
||||
addContainer("polite");
|
||||
}
|
||||
}
|
||||
external_wp_domReady_default()(setup);
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).a11y = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{setup:()=>s,speak:()=>d});const n=window.wp.domReady;var o=e.n(n);function i(e="polite"){const t=document.createElement("div");t.id=`a11y-speak-${e}`,t.className="a11y-speak-region",t.setAttribute("style","position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true");const{body:n}=document;return n&&n.appendChild(t),t}const a=window.wp.i18n;let r="";function d(e,t){!function(){const e=document.getElementsByClassName("a11y-speak-region"),t=document.getElementById("a11y-speak-intro-text");for(let t=0;t<e.length;t++)e[t].textContent="";t&&t.setAttribute("hidden","hidden")}(),e=function(e){return e=e.replace(/<[^<>]+>/g," "),r===e&&(e+=" "),r=e,e}(e);const n=document.getElementById("a11y-speak-intro-text"),o=document.getElementById("a11y-speak-assertive"),i=document.getElementById("a11y-speak-polite");o&&"assertive"===t?o.textContent=e:i&&(i.textContent=e),n&&n.removeAttribute("hidden")}function s(){const e=document.getElementById("a11y-speak-intro-text"),t=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");null===e&&function(){const e=document.createElement("p");e.id="a11y-speak-intro-text",e.className="a11y-speak-intro-text",e.textContent=(0,a.__)("Notifications"),e.setAttribute("style","position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"),e.setAttribute("hidden","");const{body:t}=document;t&&t.appendChild(e)}(),null===t&&i("assertive"),null===n&&i("polite")}o()(s),(window.wp=window.wp||{}).a11y=t})();
|
||||
@@ -0,0 +1,158 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
NavigableRegion: () => (/* reexport */ navigable_region_default),
|
||||
Page: () => (/* reexport */ page_default)
|
||||
});
|
||||
|
||||
;// external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// ./node_modules/clsx/dist/clsx.mjs
|
||||
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx);
|
||||
;// external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// ./node_modules/@wordpress/admin-ui/build-module/navigable-region/index.js
|
||||
|
||||
|
||||
|
||||
const NavigableRegion = (0,external_wp_element_namespaceObject.forwardRef)(
|
||||
({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => {
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
Tag,
|
||||
{
|
||||
ref,
|
||||
className: dist_clsx("admin-ui-navigable-region", className),
|
||||
"aria-label": ariaLabel,
|
||||
role: "region",
|
||||
tabIndex: "-1",
|
||||
...props,
|
||||
children
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
NavigableRegion.displayName = "NavigableRegion";
|
||||
var navigable_region_default = NavigableRegion;
|
||||
|
||||
|
||||
;// external ["wp","components"]
|
||||
const external_wp_components_namespaceObject = window["wp"]["components"];
|
||||
;// ./node_modules/@wordpress/admin-ui/build-module/page/header.js
|
||||
|
||||
|
||||
function Header({
|
||||
breadcrumbs,
|
||||
badges,
|
||||
title,
|
||||
subTitle,
|
||||
actions
|
||||
}) {
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "admin-ui-page__header", as: "header", children: [
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
|
||||
external_wp_components_namespaceObject.__experimentalHStack,
|
||||
{
|
||||
className: "admin-ui-page__header-title",
|
||||
justify: "space-between",
|
||||
spacing: 2,
|
||||
children: [
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, children: [
|
||||
title && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { as: "h2", level: 3, weight: 500, truncate: true, children: title }),
|
||||
breadcrumbs,
|
||||
badges
|
||||
] }),
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
external_wp_components_namespaceObject.__experimentalHStack,
|
||||
{
|
||||
style: { width: "auto", flexShrink: 0 },
|
||||
spacing: 2,
|
||||
className: "admin-ui-page__header-actions",
|
||||
children: actions
|
||||
}
|
||||
)
|
||||
]
|
||||
}
|
||||
),
|
||||
subTitle && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "admin-ui-page__header-subtitle", children: subTitle })
|
||||
] });
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/admin-ui/build-module/page/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
function Page({
|
||||
breadcrumbs,
|
||||
badges,
|
||||
title,
|
||||
subTitle,
|
||||
children,
|
||||
className,
|
||||
actions,
|
||||
hasPadding = false
|
||||
}) {
|
||||
const classes = dist_clsx("admin-ui-page", className);
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(navigable_region_default, { className: classes, ariaLabel: title, children: [
|
||||
(title || breadcrumbs || badges) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
Header,
|
||||
{
|
||||
breadcrumbs,
|
||||
badges,
|
||||
title,
|
||||
subTitle,
|
||||
actions
|
||||
}
|
||||
),
|
||||
hasPadding ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "admin-ui-page__content has-padding", children }) : children
|
||||
] });
|
||||
}
|
||||
var page_default = Page;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/admin-ui/build-module/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).adminUi = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={d:(a,i)=>{for(var n in i)e.o(i,n)&&!e.o(a,n)&&Object.defineProperty(a,n,{enumerable:!0,get:i[n]})},o:(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},a={};e.r(a),e.d(a,{NavigableRegion:()=>s,Page:()=>c});const i=window.ReactJSXRuntime;function n(e){var a,i,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var t=e.length;for(a=0;a<t;a++)e[a]&&(i=n(e[a]))&&(r&&(r+=" "),r+=i)}else for(i in e)e[i]&&(r&&(r+=" "),r+=i);return r}const r=function(){for(var e,a,i=0,r="",t=arguments.length;i<t;i++)(e=arguments[i])&&(a=n(e))&&(r&&(r+=" "),r+=a);return r},t=(0,window.wp.element.forwardRef)((({children:e,className:a,ariaLabel:n,as:t="div",...s},l)=>(0,i.jsx)(t,{ref:l,className:r("admin-ui-navigable-region",a),"aria-label":n,role:"region",tabIndex:"-1",...s,children:e})));t.displayName="NavigableRegion";var s=t;const l=window.wp.components;function d({breadcrumbs:e,badges:a,title:n,subTitle:r,actions:t}){return(0,i.jsxs)(l.__experimentalVStack,{className:"admin-ui-page__header",as:"header",children:[(0,i.jsxs)(l.__experimentalHStack,{className:"admin-ui-page__header-title",justify:"space-between",spacing:2,children:[(0,i.jsxs)(l.__experimentalHStack,{spacing:2,children:[n&&(0,i.jsx)(l.__experimentalHeading,{as:"h2",level:3,weight:500,truncate:!0,children:n}),e,a]}),(0,i.jsx)(l.__experimentalHStack,{style:{width:"auto",flexShrink:0},spacing:2,className:"admin-ui-page__header-actions",children:t})]}),r&&(0,i.jsx)("p",{className:"admin-ui-page__header-subtitle",children:r})]})}var c=function({breadcrumbs:e,badges:a,title:n,subTitle:t,children:l,className:c,actions:o,hasPadding:m=!1}){const u=r("admin-ui-page",c);return(0,i.jsxs)(s,{className:u,ariaLabel:n,children:[(n||e||a)&&(0,i.jsx)(d,{breadcrumbs:e,badges:a,title:n,subTitle:t,actions:o}),m?(0,i.jsx)("div",{className:"admin-ui-page__content has-padding",children:l}):l]})};(window.wp=window.wp||{}).adminUi=a})();
|
||||
@@ -0,0 +1,498 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
store: () => (/* reexport */ store)
|
||||
});
|
||||
|
||||
// NAMESPACE OBJECT: ./node_modules/@wordpress/annotations/build-module/store/selectors.js
|
||||
var selectors_namespaceObject = {};
|
||||
__webpack_require__.r(selectors_namespaceObject);
|
||||
__webpack_require__.d(selectors_namespaceObject, {
|
||||
__experimentalGetAllAnnotationsForBlock: () => (__experimentalGetAllAnnotationsForBlock),
|
||||
__experimentalGetAnnotations: () => (__experimentalGetAnnotations),
|
||||
__experimentalGetAnnotationsForBlock: () => (__experimentalGetAnnotationsForBlock),
|
||||
__experimentalGetAnnotationsForRichText: () => (__experimentalGetAnnotationsForRichText)
|
||||
});
|
||||
|
||||
// NAMESPACE OBJECT: ./node_modules/@wordpress/annotations/build-module/store/actions.js
|
||||
var actions_namespaceObject = {};
|
||||
__webpack_require__.r(actions_namespaceObject);
|
||||
__webpack_require__.d(actions_namespaceObject, {
|
||||
__experimentalAddAnnotation: () => (__experimentalAddAnnotation),
|
||||
__experimentalRemoveAnnotation: () => (__experimentalRemoveAnnotation),
|
||||
__experimentalRemoveAnnotationsBySource: () => (__experimentalRemoveAnnotationsBySource),
|
||||
__experimentalUpdateAnnotationRange: () => (__experimentalUpdateAnnotationRange)
|
||||
});
|
||||
|
||||
;// external ["wp","richText"]
|
||||
const external_wp_richText_namespaceObject = window["wp"]["richText"];
|
||||
;// external ["wp","i18n"]
|
||||
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
|
||||
;// ./node_modules/@wordpress/annotations/build-module/store/constants.js
|
||||
const STORE_NAME = "core/annotations";
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/annotations/build-module/format/annotation.js
|
||||
|
||||
|
||||
const FORMAT_NAME = "core/annotation";
|
||||
const ANNOTATION_ATTRIBUTE_PREFIX = "annotation-text-";
|
||||
|
||||
function applyAnnotations(record, annotations = []) {
|
||||
annotations.forEach((annotation2) => {
|
||||
let { start, end } = annotation2;
|
||||
if (start > record.text.length) {
|
||||
start = record.text.length;
|
||||
}
|
||||
if (end > record.text.length) {
|
||||
end = record.text.length;
|
||||
}
|
||||
const className = ANNOTATION_ATTRIBUTE_PREFIX + annotation2.source;
|
||||
const id = ANNOTATION_ATTRIBUTE_PREFIX + annotation2.id;
|
||||
record = (0,external_wp_richText_namespaceObject.applyFormat)(
|
||||
record,
|
||||
{
|
||||
type: FORMAT_NAME,
|
||||
attributes: {
|
||||
className,
|
||||
id
|
||||
}
|
||||
},
|
||||
start,
|
||||
end
|
||||
);
|
||||
});
|
||||
return record;
|
||||
}
|
||||
function removeAnnotations(record) {
|
||||
return removeFormat(record, "core/annotation", 0, record.text.length);
|
||||
}
|
||||
function retrieveAnnotationPositions(formats) {
|
||||
const positions = {};
|
||||
formats.forEach((characterFormats, i) => {
|
||||
characterFormats = characterFormats || [];
|
||||
characterFormats = characterFormats.filter(
|
||||
(format) => format.type === FORMAT_NAME
|
||||
);
|
||||
characterFormats.forEach((format) => {
|
||||
let { id } = format.attributes;
|
||||
id = id.replace(ANNOTATION_ATTRIBUTE_PREFIX, "");
|
||||
if (!positions.hasOwnProperty(id)) {
|
||||
positions[id] = {
|
||||
start: i
|
||||
};
|
||||
}
|
||||
positions[id].end = i + 1;
|
||||
});
|
||||
});
|
||||
return positions;
|
||||
}
|
||||
function updateAnnotationsWithPositions(annotations, positions, { removeAnnotation, updateAnnotationRange }) {
|
||||
annotations.forEach((currentAnnotation) => {
|
||||
const position = positions[currentAnnotation.id];
|
||||
if (!position) {
|
||||
removeAnnotation(currentAnnotation.id);
|
||||
return;
|
||||
}
|
||||
const { start, end } = currentAnnotation;
|
||||
if (start !== position.start || end !== position.end) {
|
||||
updateAnnotationRange(
|
||||
currentAnnotation.id,
|
||||
position.start,
|
||||
position.end
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
const annotation = {
|
||||
name: FORMAT_NAME,
|
||||
title: (0,external_wp_i18n_namespaceObject.__)("Annotation"),
|
||||
tagName: "mark",
|
||||
className: "annotation-text",
|
||||
attributes: {
|
||||
className: "class",
|
||||
id: "id"
|
||||
},
|
||||
edit() {
|
||||
return null;
|
||||
},
|
||||
__experimentalGetPropsForEditableTreePreparation(select, { richTextIdentifier, blockClientId }) {
|
||||
return {
|
||||
annotations: select(
|
||||
STORE_NAME
|
||||
).__experimentalGetAnnotationsForRichText(
|
||||
blockClientId,
|
||||
richTextIdentifier
|
||||
)
|
||||
};
|
||||
},
|
||||
__experimentalCreatePrepareEditableTree({ annotations }) {
|
||||
return (formats, text) => {
|
||||
if (annotations.length === 0) {
|
||||
return formats;
|
||||
}
|
||||
let record = { formats, text };
|
||||
record = applyAnnotations(record, annotations);
|
||||
return record.formats;
|
||||
};
|
||||
},
|
||||
__experimentalGetPropsForEditableTreeChangeHandler(dispatch) {
|
||||
return {
|
||||
removeAnnotation: dispatch(STORE_NAME).__experimentalRemoveAnnotation,
|
||||
updateAnnotationRange: dispatch(STORE_NAME).__experimentalUpdateAnnotationRange
|
||||
};
|
||||
},
|
||||
__experimentalCreateOnChangeEditableValue(props) {
|
||||
return (formats) => {
|
||||
const positions = retrieveAnnotationPositions(formats);
|
||||
const { removeAnnotation, updateAnnotationRange, annotations } = props;
|
||||
updateAnnotationsWithPositions(annotations, positions, {
|
||||
removeAnnotation,
|
||||
updateAnnotationRange
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/annotations/build-module/format/index.js
|
||||
|
||||
|
||||
const { name: format_name, ...settings } = annotation;
|
||||
(0,external_wp_richText_namespaceObject.registerFormatType)(format_name, settings);
|
||||
|
||||
;// external ["wp","hooks"]
|
||||
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
|
||||
;// external ["wp","data"]
|
||||
const external_wp_data_namespaceObject = window["wp"]["data"];
|
||||
;// ./node_modules/@wordpress/annotations/build-module/block/index.js
|
||||
|
||||
|
||||
|
||||
const addAnnotationClassName = (OriginalComponent) => {
|
||||
return (0,external_wp_data_namespaceObject.withSelect)((select, { clientId, className }) => {
|
||||
const annotations = select(STORE_NAME).__experimentalGetAnnotationsForBlock(
|
||||
clientId
|
||||
);
|
||||
return {
|
||||
className: annotations.map((annotation) => {
|
||||
return "is-annotated-by-" + annotation.source;
|
||||
}).concat(className).filter(Boolean).join(" ")
|
||||
};
|
||||
})(OriginalComponent);
|
||||
};
|
||||
(0,external_wp_hooks_namespaceObject.addFilter)(
|
||||
"editor.BlockListBlock",
|
||||
"core/annotations",
|
||||
addAnnotationClassName
|
||||
);
|
||||
|
||||
;// ./node_modules/@wordpress/annotations/build-module/store/reducer.js
|
||||
function filterWithReference(collection, predicate) {
|
||||
const filteredCollection = collection.filter(predicate);
|
||||
return collection.length === filteredCollection.length ? collection : filteredCollection;
|
||||
}
|
||||
const mapValues = (obj, callback) => Object.entries(obj).reduce(
|
||||
(acc, [key, value]) => ({
|
||||
...acc,
|
||||
[key]: callback(value)
|
||||
}),
|
||||
{}
|
||||
);
|
||||
function isValidAnnotationRange(annotation) {
|
||||
return typeof annotation.start === "number" && typeof annotation.end === "number" && annotation.start <= annotation.end;
|
||||
}
|
||||
function annotations(state = {}, action) {
|
||||
switch (action.type) {
|
||||
case "ANNOTATION_ADD":
|
||||
const blockClientId = action.blockClientId;
|
||||
const newAnnotation = {
|
||||
id: action.id,
|
||||
blockClientId,
|
||||
richTextIdentifier: action.richTextIdentifier,
|
||||
source: action.source,
|
||||
selector: action.selector,
|
||||
range: action.range
|
||||
};
|
||||
if (newAnnotation.selector === "range" && !isValidAnnotationRange(newAnnotation.range)) {
|
||||
return state;
|
||||
}
|
||||
const previousAnnotationsForBlock = state?.[blockClientId] ?? [];
|
||||
return {
|
||||
...state,
|
||||
[blockClientId]: [
|
||||
...previousAnnotationsForBlock,
|
||||
newAnnotation
|
||||
]
|
||||
};
|
||||
case "ANNOTATION_REMOVE":
|
||||
return mapValues(state, (annotationsForBlock) => {
|
||||
return filterWithReference(
|
||||
annotationsForBlock,
|
||||
(annotation) => {
|
||||
return annotation.id !== action.annotationId;
|
||||
}
|
||||
);
|
||||
});
|
||||
case "ANNOTATION_UPDATE_RANGE":
|
||||
return mapValues(state, (annotationsForBlock) => {
|
||||
let hasChangedRange = false;
|
||||
const newAnnotations = annotationsForBlock.map(
|
||||
(annotation) => {
|
||||
if (annotation.id === action.annotationId) {
|
||||
hasChangedRange = true;
|
||||
return {
|
||||
...annotation,
|
||||
range: {
|
||||
start: action.start,
|
||||
end: action.end
|
||||
}
|
||||
};
|
||||
}
|
||||
return annotation;
|
||||
}
|
||||
);
|
||||
return hasChangedRange ? newAnnotations : annotationsForBlock;
|
||||
});
|
||||
case "ANNOTATION_REMOVE_SOURCE":
|
||||
return mapValues(state, (annotationsForBlock) => {
|
||||
return filterWithReference(
|
||||
annotationsForBlock,
|
||||
(annotation) => {
|
||||
return annotation.source !== action.source;
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
return state;
|
||||
}
|
||||
var reducer_default = annotations;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/annotations/build-module/store/selectors.js
|
||||
|
||||
const EMPTY_ARRAY = [];
|
||||
const __experimentalGetAnnotationsForBlock = (0,external_wp_data_namespaceObject.createSelector)(
|
||||
(state, blockClientId) => {
|
||||
return (state?.[blockClientId] ?? []).filter((annotation) => {
|
||||
return annotation.selector === "block";
|
||||
});
|
||||
},
|
||||
(state, blockClientId) => [state?.[blockClientId] ?? EMPTY_ARRAY]
|
||||
);
|
||||
function __experimentalGetAllAnnotationsForBlock(state, blockClientId) {
|
||||
return state?.[blockClientId] ?? EMPTY_ARRAY;
|
||||
}
|
||||
const __experimentalGetAnnotationsForRichText = (0,external_wp_data_namespaceObject.createSelector)(
|
||||
(state, blockClientId, richTextIdentifier) => {
|
||||
return (state?.[blockClientId] ?? []).filter((annotation) => {
|
||||
return annotation.selector === "range" && richTextIdentifier === annotation.richTextIdentifier;
|
||||
}).map((annotation) => {
|
||||
const { range, ...other } = annotation;
|
||||
return {
|
||||
...range,
|
||||
...other
|
||||
};
|
||||
});
|
||||
},
|
||||
(state, blockClientId) => [state?.[blockClientId] ?? EMPTY_ARRAY]
|
||||
);
|
||||
function __experimentalGetAnnotations(state) {
|
||||
return Object.values(state).flat();
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/annotations/node_modules/uuid/dist/esm-browser/native.js
|
||||
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
||||
/* harmony default export */ const esm_browser_native = ({
|
||||
randomUUID
|
||||
});
|
||||
;// ./node_modules/@wordpress/annotations/node_modules/uuid/dist/esm-browser/rng.js
|
||||
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
||||
// require the crypto API and do not support built-in fallback to lower quality random number
|
||||
// generators (like Math.random()).
|
||||
let getRandomValues;
|
||||
const rnds8 = new Uint8Array(16);
|
||||
function rng() {
|
||||
// lazy load so that environments that need to polyfill have a chance to do so
|
||||
if (!getRandomValues) {
|
||||
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
||||
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
||||
|
||||
if (!getRandomValues) {
|
||||
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
||||
}
|
||||
}
|
||||
|
||||
return getRandomValues(rnds8);
|
||||
}
|
||||
;// ./node_modules/@wordpress/annotations/node_modules/uuid/dist/esm-browser/stringify.js
|
||||
|
||||
/**
|
||||
* Convert array of 16 byte values to UUID string format of the form:
|
||||
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
||||
*/
|
||||
|
||||
const byteToHex = [];
|
||||
|
||||
for (let i = 0; i < 256; ++i) {
|
||||
byteToHex.push((i + 0x100).toString(16).slice(1));
|
||||
}
|
||||
|
||||
function unsafeStringify(arr, offset = 0) {
|
||||
// Note: Be careful editing this code! It's been tuned for performance
|
||||
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
||||
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
||||
}
|
||||
|
||||
function stringify(arr, offset = 0) {
|
||||
const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
|
||||
// of the following:
|
||||
// - One or more input array values don't map to a hex octet (leading to
|
||||
// "undefined" in the uuid)
|
||||
// - Invalid input values for the RFC `version` or `variant` fields
|
||||
|
||||
if (!validate(uuid)) {
|
||||
throw TypeError('Stringified UUID is invalid');
|
||||
}
|
||||
|
||||
return uuid;
|
||||
}
|
||||
|
||||
/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
|
||||
;// ./node_modules/@wordpress/annotations/node_modules/uuid/dist/esm-browser/v4.js
|
||||
|
||||
|
||||
|
||||
|
||||
function v4(options, buf, offset) {
|
||||
if (esm_browser_native.randomUUID && !buf && !options) {
|
||||
return esm_browser_native.randomUUID();
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
||||
|
||||
rnds[6] = rnds[6] & 0x0f | 0x40;
|
||||
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
||||
|
||||
if (buf) {
|
||||
offset = offset || 0;
|
||||
|
||||
for (let i = 0; i < 16; ++i) {
|
||||
buf[offset + i] = rnds[i];
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
return unsafeStringify(rnds);
|
||||
}
|
||||
|
||||
/* harmony default export */ const esm_browser_v4 = (v4);
|
||||
;// ./node_modules/@wordpress/annotations/build-module/store/actions.js
|
||||
|
||||
function __experimentalAddAnnotation({
|
||||
blockClientId,
|
||||
richTextIdentifier = null,
|
||||
range = null,
|
||||
selector = "range",
|
||||
source = "default",
|
||||
id = esm_browser_v4()
|
||||
}) {
|
||||
const action = {
|
||||
type: "ANNOTATION_ADD",
|
||||
id,
|
||||
blockClientId,
|
||||
richTextIdentifier,
|
||||
source,
|
||||
selector
|
||||
};
|
||||
if (selector === "range") {
|
||||
action.range = range;
|
||||
}
|
||||
return action;
|
||||
}
|
||||
function __experimentalRemoveAnnotation(annotationId) {
|
||||
return {
|
||||
type: "ANNOTATION_REMOVE",
|
||||
annotationId
|
||||
};
|
||||
}
|
||||
function __experimentalUpdateAnnotationRange(annotationId, start, end) {
|
||||
return {
|
||||
type: "ANNOTATION_UPDATE_RANGE",
|
||||
annotationId,
|
||||
start,
|
||||
end
|
||||
};
|
||||
}
|
||||
function __experimentalRemoveAnnotationsBySource(source) {
|
||||
return {
|
||||
type: "ANNOTATION_REMOVE_SOURCE",
|
||||
source
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/annotations/build-module/store/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
|
||||
reducer: reducer_default,
|
||||
selectors: selectors_namespaceObject,
|
||||
actions: actions_namespaceObject
|
||||
});
|
||||
(0,external_wp_data_namespaceObject.register)(store);
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/annotations/build-module/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).annotations = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+2
File diff suppressed because one or more lines are too long
@@ -0,0 +1,530 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
"default": () => (/* binding */ index_default)
|
||||
});
|
||||
|
||||
;// external ["wp","i18n"]
|
||||
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
|
||||
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.js
|
||||
function createNonceMiddleware(nonce) {
|
||||
const middleware = (options, next) => {
|
||||
const { headers = {} } = options;
|
||||
for (const headerName in headers) {
|
||||
if (headerName.toLowerCase() === "x-wp-nonce" && headers[headerName] === middleware.nonce) {
|
||||
return next(options);
|
||||
}
|
||||
}
|
||||
return next({
|
||||
...options,
|
||||
headers: {
|
||||
...headers,
|
||||
"X-WP-Nonce": middleware.nonce
|
||||
}
|
||||
});
|
||||
};
|
||||
middleware.nonce = nonce;
|
||||
return middleware;
|
||||
}
|
||||
var nonce_default = createNonceMiddleware;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js
|
||||
const namespaceAndEndpointMiddleware = (options, next) => {
|
||||
let path = options.path;
|
||||
let namespaceTrimmed, endpointTrimmed;
|
||||
if (typeof options.namespace === "string" && typeof options.endpoint === "string") {
|
||||
namespaceTrimmed = options.namespace.replace(/^\/|\/$/g, "");
|
||||
endpointTrimmed = options.endpoint.replace(/^\//, "");
|
||||
if (endpointTrimmed) {
|
||||
path = namespaceTrimmed + "/" + endpointTrimmed;
|
||||
} else {
|
||||
path = namespaceTrimmed;
|
||||
}
|
||||
}
|
||||
delete options.namespace;
|
||||
delete options.endpoint;
|
||||
return next({
|
||||
...options,
|
||||
path
|
||||
});
|
||||
};
|
||||
var namespace_endpoint_default = namespaceAndEndpointMiddleware;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.js
|
||||
|
||||
const createRootURLMiddleware = (rootURL) => (options, next) => {
|
||||
return namespace_endpoint_default(options, (optionsWithPath) => {
|
||||
let url = optionsWithPath.url;
|
||||
let path = optionsWithPath.path;
|
||||
let apiRoot;
|
||||
if (typeof path === "string") {
|
||||
apiRoot = rootURL;
|
||||
if (-1 !== rootURL.indexOf("?")) {
|
||||
path = path.replace("?", "&");
|
||||
}
|
||||
path = path.replace(/^\//, "");
|
||||
if ("string" === typeof apiRoot && -1 !== apiRoot.indexOf("?")) {
|
||||
path = path.replace("?", "&");
|
||||
}
|
||||
url = apiRoot + path;
|
||||
}
|
||||
return next({
|
||||
...optionsWithPath,
|
||||
url
|
||||
});
|
||||
});
|
||||
};
|
||||
var root_url_default = createRootURLMiddleware;
|
||||
|
||||
|
||||
;// external ["wp","url"]
|
||||
const external_wp_url_namespaceObject = window["wp"]["url"];
|
||||
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js
|
||||
|
||||
function createPreloadingMiddleware(preloadedData) {
|
||||
const cache = Object.fromEntries(
|
||||
Object.entries(preloadedData).map(([path, data]) => [
|
||||
(0,external_wp_url_namespaceObject.normalizePath)(path),
|
||||
data
|
||||
])
|
||||
);
|
||||
return (options, next) => {
|
||||
const { parse = true } = options;
|
||||
let rawPath = options.path;
|
||||
if (!rawPath && options.url) {
|
||||
const { rest_route: pathFromQuery, ...queryArgs } = (0,external_wp_url_namespaceObject.getQueryArgs)(
|
||||
options.url
|
||||
);
|
||||
if (typeof pathFromQuery === "string") {
|
||||
rawPath = (0,external_wp_url_namespaceObject.addQueryArgs)(pathFromQuery, queryArgs);
|
||||
}
|
||||
}
|
||||
if (typeof rawPath !== "string") {
|
||||
return next(options);
|
||||
}
|
||||
const method = options.method || "GET";
|
||||
const path = (0,external_wp_url_namespaceObject.normalizePath)(rawPath);
|
||||
if ("GET" === method && cache[path]) {
|
||||
const cacheData = cache[path];
|
||||
delete cache[path];
|
||||
return prepareResponse(cacheData, !!parse);
|
||||
} else if ("OPTIONS" === method && cache[method] && cache[method][path]) {
|
||||
const cacheData = cache[method][path];
|
||||
delete cache[method][path];
|
||||
return prepareResponse(cacheData, !!parse);
|
||||
}
|
||||
return next(options);
|
||||
};
|
||||
}
|
||||
function prepareResponse(responseData, parse) {
|
||||
if (parse) {
|
||||
return Promise.resolve(responseData.body);
|
||||
}
|
||||
try {
|
||||
return Promise.resolve(
|
||||
new window.Response(JSON.stringify(responseData.body), {
|
||||
status: 200,
|
||||
statusText: "OK",
|
||||
headers: responseData.headers
|
||||
})
|
||||
);
|
||||
} catch {
|
||||
Object.entries(
|
||||
responseData.headers
|
||||
).forEach(([key, value]) => {
|
||||
if (key.toLowerCase() === "link") {
|
||||
responseData.headers[key] = value.replace(
|
||||
/<([^>]+)>/,
|
||||
(_, url) => `<${encodeURI(url)}>`
|
||||
);
|
||||
}
|
||||
});
|
||||
return Promise.resolve(
|
||||
parse ? responseData.body : new window.Response(JSON.stringify(responseData.body), {
|
||||
status: 200,
|
||||
statusText: "OK",
|
||||
headers: responseData.headers
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
var preloading_default = createPreloadingMiddleware;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js
|
||||
|
||||
|
||||
const modifyQuery = ({ path, url, ...options }, queryArgs) => ({
|
||||
...options,
|
||||
url: url && (0,external_wp_url_namespaceObject.addQueryArgs)(url, queryArgs),
|
||||
path: path && (0,external_wp_url_namespaceObject.addQueryArgs)(path, queryArgs)
|
||||
});
|
||||
const parseResponse = (response) => response.json ? response.json() : Promise.reject(response);
|
||||
const parseLinkHeader = (linkHeader) => {
|
||||
if (!linkHeader) {
|
||||
return {};
|
||||
}
|
||||
const match = linkHeader.match(/<([^>]+)>; rel="next"/);
|
||||
return match ? {
|
||||
next: match[1]
|
||||
} : {};
|
||||
};
|
||||
const getNextPageUrl = (response) => {
|
||||
const { next } = parseLinkHeader(response.headers.get("link"));
|
||||
return next;
|
||||
};
|
||||
const requestContainsUnboundedQuery = (options) => {
|
||||
const pathIsUnbounded = !!options.path && options.path.indexOf("per_page=-1") !== -1;
|
||||
const urlIsUnbounded = !!options.url && options.url.indexOf("per_page=-1") !== -1;
|
||||
return pathIsUnbounded || urlIsUnbounded;
|
||||
};
|
||||
const fetchAllMiddleware = async (options, next) => {
|
||||
if (options.parse === false) {
|
||||
return next(options);
|
||||
}
|
||||
if (!requestContainsUnboundedQuery(options)) {
|
||||
return next(options);
|
||||
}
|
||||
const response = await index_default({
|
||||
...modifyQuery(options, {
|
||||
per_page: 100
|
||||
}),
|
||||
// Ensure headers are returned for page 1.
|
||||
parse: false
|
||||
});
|
||||
const results = await parseResponse(response);
|
||||
if (!Array.isArray(results)) {
|
||||
return results;
|
||||
}
|
||||
let nextPage = getNextPageUrl(response);
|
||||
if (!nextPage) {
|
||||
return results;
|
||||
}
|
||||
let mergedResults = [].concat(results);
|
||||
while (nextPage) {
|
||||
const nextResponse = await index_default({
|
||||
...options,
|
||||
// Ensure the URL for the next page is used instead of any provided path.
|
||||
path: void 0,
|
||||
url: nextPage,
|
||||
// Ensure we still get headers so we can identify the next page.
|
||||
parse: false
|
||||
});
|
||||
const nextResults = await parseResponse(nextResponse);
|
||||
mergedResults = mergedResults.concat(nextResults);
|
||||
nextPage = getNextPageUrl(nextResponse);
|
||||
}
|
||||
return mergedResults;
|
||||
};
|
||||
var fetch_all_middleware_default = fetchAllMiddleware;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js
|
||||
const OVERRIDE_METHODS = /* @__PURE__ */ new Set(["PATCH", "PUT", "DELETE"]);
|
||||
const DEFAULT_METHOD = "GET";
|
||||
const httpV1Middleware = (options, next) => {
|
||||
const { method = DEFAULT_METHOD } = options;
|
||||
if (OVERRIDE_METHODS.has(method.toUpperCase())) {
|
||||
options = {
|
||||
...options,
|
||||
headers: {
|
||||
...options.headers,
|
||||
"X-HTTP-Method-Override": method,
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
method: "POST"
|
||||
};
|
||||
}
|
||||
return next(options);
|
||||
};
|
||||
var http_v1_default = httpV1Middleware;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/user-locale.js
|
||||
|
||||
const userLocaleMiddleware = (options, next) => {
|
||||
if (typeof options.url === "string" && !(0,external_wp_url_namespaceObject.hasQueryArg)(options.url, "_locale")) {
|
||||
options.url = (0,external_wp_url_namespaceObject.addQueryArgs)(options.url, { _locale: "user" });
|
||||
}
|
||||
if (typeof options.path === "string" && !(0,external_wp_url_namespaceObject.hasQueryArg)(options.path, "_locale")) {
|
||||
options.path = (0,external_wp_url_namespaceObject.addQueryArgs)(options.path, { _locale: "user" });
|
||||
}
|
||||
return next(options);
|
||||
};
|
||||
var user_locale_default = userLocaleMiddleware;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/api-fetch/build-module/utils/response.js
|
||||
|
||||
async function parseJsonAndNormalizeError(response) {
|
||||
try {
|
||||
return await response.json();
|
||||
} catch {
|
||||
throw {
|
||||
code: "invalid_json",
|
||||
message: (0,external_wp_i18n_namespaceObject.__)("The response is not a valid JSON response.")
|
||||
};
|
||||
}
|
||||
}
|
||||
async function parseResponseAndNormalizeError(response, shouldParseResponse = true) {
|
||||
if (!shouldParseResponse) {
|
||||
return response;
|
||||
}
|
||||
if (response.status === 204) {
|
||||
return null;
|
||||
}
|
||||
return await parseJsonAndNormalizeError(response);
|
||||
}
|
||||
async function parseAndThrowError(response, shouldParseResponse = true) {
|
||||
if (!shouldParseResponse) {
|
||||
throw response;
|
||||
}
|
||||
throw await parseJsonAndNormalizeError(response);
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/media-upload.js
|
||||
|
||||
|
||||
function isMediaUploadRequest(options) {
|
||||
const isCreateMethod = !!options.method && options.method === "POST";
|
||||
const isMediaEndpoint = !!options.path && options.path.indexOf("/wp/v2/media") !== -1 || !!options.url && options.url.indexOf("/wp/v2/media") !== -1;
|
||||
return isMediaEndpoint && isCreateMethod;
|
||||
}
|
||||
const mediaUploadMiddleware = (options, next) => {
|
||||
if (!isMediaUploadRequest(options)) {
|
||||
return next(options);
|
||||
}
|
||||
let retries = 0;
|
||||
const maxRetries = 5;
|
||||
const postProcess = (attachmentId) => {
|
||||
retries++;
|
||||
return next({
|
||||
path: `/wp/v2/media/${attachmentId}/post-process`,
|
||||
method: "POST",
|
||||
data: { action: "create-image-subsizes" },
|
||||
parse: false
|
||||
}).catch(() => {
|
||||
if (retries < maxRetries) {
|
||||
return postProcess(attachmentId);
|
||||
}
|
||||
next({
|
||||
path: `/wp/v2/media/${attachmentId}?force=true`,
|
||||
method: "DELETE"
|
||||
});
|
||||
return Promise.reject();
|
||||
});
|
||||
};
|
||||
return next({ ...options, parse: false }).catch((response) => {
|
||||
if (!(response instanceof globalThis.Response)) {
|
||||
return Promise.reject(response);
|
||||
}
|
||||
const attachmentId = response.headers.get(
|
||||
"x-wp-upload-attachment-id"
|
||||
);
|
||||
if (response.status >= 500 && response.status < 600 && attachmentId) {
|
||||
return postProcess(attachmentId).catch(() => {
|
||||
if (options.parse !== false) {
|
||||
return Promise.reject({
|
||||
code: "post_process",
|
||||
message: (0,external_wp_i18n_namespaceObject.__)(
|
||||
"Media upload failed. If this is a photo or a large image, please scale it down and try again."
|
||||
)
|
||||
});
|
||||
}
|
||||
return Promise.reject(response);
|
||||
});
|
||||
}
|
||||
return parseAndThrowError(response, options.parse);
|
||||
}).then(
|
||||
(response) => parseResponseAndNormalizeError(response, options.parse)
|
||||
);
|
||||
};
|
||||
var media_upload_default = mediaUploadMiddleware;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/api-fetch/build-module/middlewares/theme-preview.js
|
||||
|
||||
const createThemePreviewMiddleware = (themePath) => (options, next) => {
|
||||
if (typeof options.url === "string") {
|
||||
const wpThemePreview = (0,external_wp_url_namespaceObject.getQueryArg)(
|
||||
options.url,
|
||||
"wp_theme_preview"
|
||||
);
|
||||
if (wpThemePreview === void 0) {
|
||||
options.url = (0,external_wp_url_namespaceObject.addQueryArgs)(options.url, {
|
||||
wp_theme_preview: themePath
|
||||
});
|
||||
} else if (wpThemePreview === "") {
|
||||
options.url = (0,external_wp_url_namespaceObject.removeQueryArgs)(
|
||||
options.url,
|
||||
"wp_theme_preview"
|
||||
);
|
||||
}
|
||||
}
|
||||
if (typeof options.path === "string") {
|
||||
const wpThemePreview = (0,external_wp_url_namespaceObject.getQueryArg)(
|
||||
options.path,
|
||||
"wp_theme_preview"
|
||||
);
|
||||
if (wpThemePreview === void 0) {
|
||||
options.path = (0,external_wp_url_namespaceObject.addQueryArgs)(options.path, {
|
||||
wp_theme_preview: themePath
|
||||
});
|
||||
} else if (wpThemePreview === "") {
|
||||
options.path = (0,external_wp_url_namespaceObject.removeQueryArgs)(
|
||||
options.path,
|
||||
"wp_theme_preview"
|
||||
);
|
||||
}
|
||||
}
|
||||
return next(options);
|
||||
};
|
||||
var theme_preview_default = createThemePreviewMiddleware;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/api-fetch/build-module/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const DEFAULT_HEADERS = {
|
||||
// The backend uses the Accept header as a condition for considering an
|
||||
// incoming request as a REST request.
|
||||
//
|
||||
// See: https://core.trac.wordpress.org/ticket/44534
|
||||
Accept: "application/json, */*;q=0.1"
|
||||
};
|
||||
const DEFAULT_OPTIONS = {
|
||||
credentials: "include"
|
||||
};
|
||||
const middlewares = [
|
||||
user_locale_default,
|
||||
namespace_endpoint_default,
|
||||
http_v1_default,
|
||||
fetch_all_middleware_default
|
||||
];
|
||||
function registerMiddleware(middleware) {
|
||||
middlewares.unshift(middleware);
|
||||
}
|
||||
const defaultFetchHandler = (nextOptions) => {
|
||||
const { url, path, data, parse = true, ...remainingOptions } = nextOptions;
|
||||
let { body, headers } = nextOptions;
|
||||
headers = { ...DEFAULT_HEADERS, ...headers };
|
||||
if (data) {
|
||||
body = JSON.stringify(data);
|
||||
headers["Content-Type"] = "application/json";
|
||||
}
|
||||
const responsePromise = globalThis.fetch(
|
||||
// Fall back to explicitly passing `window.location` which is the behavior if `undefined` is passed.
|
||||
url || path || window.location.href,
|
||||
{
|
||||
...DEFAULT_OPTIONS,
|
||||
...remainingOptions,
|
||||
body,
|
||||
headers
|
||||
}
|
||||
);
|
||||
return responsePromise.then(
|
||||
(response) => {
|
||||
if (!response.ok) {
|
||||
return parseAndThrowError(response, parse);
|
||||
}
|
||||
return parseResponseAndNormalizeError(response, parse);
|
||||
},
|
||||
(err) => {
|
||||
if (err && err.name === "AbortError") {
|
||||
throw err;
|
||||
}
|
||||
if (!globalThis.navigator.onLine) {
|
||||
throw {
|
||||
code: "offline_error",
|
||||
message: (0,external_wp_i18n_namespaceObject.__)(
|
||||
"Unable to connect. Please check your Internet connection."
|
||||
)
|
||||
};
|
||||
}
|
||||
throw {
|
||||
code: "fetch_error",
|
||||
message: (0,external_wp_i18n_namespaceObject.__)(
|
||||
"Could not get a valid response from the server."
|
||||
)
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
let fetchHandler = defaultFetchHandler;
|
||||
function setFetchHandler(newFetchHandler) {
|
||||
fetchHandler = newFetchHandler;
|
||||
}
|
||||
const apiFetch = (options) => {
|
||||
const enhancedHandler = middlewares.reduceRight(
|
||||
(next, middleware) => {
|
||||
return (workingOptions) => middleware(workingOptions, next);
|
||||
},
|
||||
fetchHandler
|
||||
);
|
||||
return enhancedHandler(options).catch((error) => {
|
||||
if (error.code !== "rest_cookie_invalid_nonce") {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
return globalThis.fetch(apiFetch.nonceEndpoint).then((response) => {
|
||||
if (!response.ok) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
return response.text();
|
||||
}).then((text) => {
|
||||
apiFetch.nonceMiddleware.nonce = text;
|
||||
return apiFetch(options);
|
||||
});
|
||||
});
|
||||
};
|
||||
apiFetch.use = registerMiddleware;
|
||||
apiFetch.setFetchHandler = setFetchHandler;
|
||||
apiFetch.createNonceMiddleware = nonce_default;
|
||||
apiFetch.createPreloadingMiddleware = preloading_default;
|
||||
apiFetch.createRootURLMiddleware = root_url_default;
|
||||
apiFetch.fetchAllMiddleware = fetch_all_middleware_default;
|
||||
apiFetch.mediaUploadMiddleware = media_upload_default;
|
||||
apiFetch.createThemePreviewMiddleware = theme_preview_default;
|
||||
var index_default = apiFetch;
|
||||
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).apiFetch = __webpack_exports__["default"];
|
||||
/******/ })()
|
||||
;
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,299 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ autop: () => (/* binding */ autop),
|
||||
/* harmony export */ removep: () => (/* binding */ removep)
|
||||
/* harmony export */ });
|
||||
const htmlSplitRegex = (() => {
|
||||
const comments = "!(?:-(?!->)[^\\-]*)*(?:-->)?";
|
||||
const cdata = "!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?";
|
||||
const escaped = "(?=!--|!\\[CDATA\\[)((?=!-)" + // If yes, which type?
|
||||
comments + "|" + cdata + ")";
|
||||
const regex = "(<(" + // Conditional expression follows.
|
||||
escaped + // Find end of escaped element.
|
||||
"|[^>]*>?))";
|
||||
return new RegExp(regex);
|
||||
})();
|
||||
function htmlSplit(input) {
|
||||
const parts = [];
|
||||
let workingInput = input;
|
||||
let match;
|
||||
while (match = workingInput.match(htmlSplitRegex)) {
|
||||
const index = match.index;
|
||||
parts.push(workingInput.slice(0, index));
|
||||
parts.push(match[0]);
|
||||
workingInput = workingInput.slice(index + match[0].length);
|
||||
}
|
||||
if (workingInput.length) {
|
||||
parts.push(workingInput);
|
||||
}
|
||||
return parts;
|
||||
}
|
||||
function replaceInHtmlTags(haystack, replacePairs) {
|
||||
const textArr = htmlSplit(haystack);
|
||||
let changed = false;
|
||||
const needles = Object.keys(replacePairs);
|
||||
for (let i = 1; i < textArr.length; i += 2) {
|
||||
for (let j = 0; j < needles.length; j++) {
|
||||
const needle = needles[j];
|
||||
if (-1 !== textArr[i].indexOf(needle)) {
|
||||
textArr[i] = textArr[i].replace(
|
||||
new RegExp(needle, "g"),
|
||||
replacePairs[needle]
|
||||
);
|
||||
changed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
haystack = textArr.join("");
|
||||
}
|
||||
return haystack;
|
||||
}
|
||||
function autop(text, br = true) {
|
||||
const preTags = [];
|
||||
if (text.trim() === "") {
|
||||
return "";
|
||||
}
|
||||
text = text + "\n";
|
||||
if (text.indexOf("<pre") !== -1) {
|
||||
const textParts = text.split("</pre>");
|
||||
const lastText = textParts.pop();
|
||||
text = "";
|
||||
for (let i = 0; i < textParts.length; i++) {
|
||||
const textPart = textParts[i];
|
||||
const start = textPart.indexOf("<pre");
|
||||
if (start === -1) {
|
||||
text += textPart;
|
||||
continue;
|
||||
}
|
||||
const name = "<pre wp-pre-tag-" + i + "></pre>";
|
||||
preTags.push([name, textPart.substr(start) + "</pre>"]);
|
||||
text += textPart.substr(0, start) + name;
|
||||
}
|
||||
text += lastText;
|
||||
}
|
||||
text = text.replace(/<br\s*\/?>\s*<br\s*\/?>/g, "\n\n");
|
||||
const allBlocks = "(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";
|
||||
text = text.replace(
|
||||
new RegExp("(<" + allBlocks + "[\\s/>])", "g"),
|
||||
"\n\n$1"
|
||||
);
|
||||
text = text.replace(
|
||||
new RegExp("(</" + allBlocks + ">)", "g"),
|
||||
"$1\n\n"
|
||||
);
|
||||
text = text.replace(/\r\n|\r/g, "\n");
|
||||
text = replaceInHtmlTags(text, { "\n": " <!-- wpnl --> " });
|
||||
if (text.indexOf("<option") !== -1) {
|
||||
text = text.replace(/\s*<option/g, "<option");
|
||||
text = text.replace(/<\/option>\s*/g, "</option>");
|
||||
}
|
||||
if (text.indexOf("</object>") !== -1) {
|
||||
text = text.replace(/(<object[^>]*>)\s*/g, "$1");
|
||||
text = text.replace(/\s*<\/object>/g, "</object>");
|
||||
text = text.replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g, "$1");
|
||||
}
|
||||
if (text.indexOf("<source") !== -1 || text.indexOf("<track") !== -1) {
|
||||
text = text.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g, "$1");
|
||||
text = text.replace(/\s*([<\[]\/(?:audio|video)[>\]])/g, "$1");
|
||||
text = text.replace(/\s*(<(?:source|track)[^>]*>)\s*/g, "$1");
|
||||
}
|
||||
if (text.indexOf("<figcaption") !== -1) {
|
||||
text = text.replace(/\s*(<figcaption[^>]*>)/, "$1");
|
||||
text = text.replace(/<\/figcaption>\s*/, "</figcaption>");
|
||||
}
|
||||
text = text.replace(/\n\n+/g, "\n\n");
|
||||
const texts = text.split(/\n\s*\n/).filter(Boolean);
|
||||
text = "";
|
||||
texts.forEach((textPiece) => {
|
||||
text += "<p>" + textPiece.replace(/^\n*|\n*$/g, "") + "</p>\n";
|
||||
});
|
||||
text = text.replace(/<p>\s*<\/p>/g, "");
|
||||
text = text.replace(
|
||||
/<p>([^<]+)<\/(div|address|form)>/g,
|
||||
"<p>$1</p></$2>"
|
||||
);
|
||||
text = text.replace(
|
||||
new RegExp("<p>\\s*(</?" + allBlocks + "[^>]*>)\\s*</p>", "g"),
|
||||
"$1"
|
||||
);
|
||||
text = text.replace(/<p>(<li.+?)<\/p>/g, "$1");
|
||||
text = text.replace(/<p><blockquote([^>]*)>/gi, "<blockquote$1><p>");
|
||||
text = text.replace(/<\/blockquote><\/p>/g, "</p></blockquote>");
|
||||
text = text.replace(
|
||||
new RegExp("<p>\\s*(</?" + allBlocks + "[^>]*>)", "g"),
|
||||
"$1"
|
||||
);
|
||||
text = text.replace(
|
||||
new RegExp("(</?" + allBlocks + "[^>]*>)\\s*</p>", "g"),
|
||||
"$1"
|
||||
);
|
||||
if (br) {
|
||||
text = text.replace(
|
||||
/<(script|style).*?<\/\\1>/g,
|
||||
(match) => match[0].replace(/\n/g, "<WPPreserveNewline />")
|
||||
);
|
||||
text = text.replace(/<br>|<br\/>/g, "<br />");
|
||||
text = text.replace(
|
||||
/(<br \/>)?\s*\n/g,
|
||||
(a, b) => b ? a : "<br />\n"
|
||||
);
|
||||
text = text.replace(/<WPPreserveNewline \/>/g, "\n");
|
||||
}
|
||||
text = text.replace(
|
||||
new RegExp("(</?" + allBlocks + "[^>]*>)\\s*<br />", "g"),
|
||||
"$1"
|
||||
);
|
||||
text = text.replace(
|
||||
/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,
|
||||
"$1"
|
||||
);
|
||||
text = text.replace(/\n<\/p>$/g, "</p>");
|
||||
preTags.forEach((preTag) => {
|
||||
const [name, original] = preTag;
|
||||
text = text.replace(name, original);
|
||||
});
|
||||
if (-1 !== text.indexOf("<!-- wpnl -->")) {
|
||||
text = text.replace(/\s?<!-- wpnl -->\s?/g, "\n");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
function removep(html) {
|
||||
const blocklist = "blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure";
|
||||
const blocklist1 = blocklist + "|div|p";
|
||||
const blocklist2 = blocklist + "|pre";
|
||||
const preserve = [];
|
||||
let preserveLinebreaks = false;
|
||||
let preserveBr = false;
|
||||
if (!html) {
|
||||
return "";
|
||||
}
|
||||
if (html.indexOf("<script") !== -1 || html.indexOf("<style") !== -1) {
|
||||
html = html.replace(
|
||||
/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,
|
||||
(match) => {
|
||||
preserve.push(match);
|
||||
return "<wp-preserve>";
|
||||
}
|
||||
);
|
||||
}
|
||||
if (html.indexOf("<pre") !== -1) {
|
||||
preserveLinebreaks = true;
|
||||
html = html.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g, (a) => {
|
||||
a = a.replace(/<br ?\/?>(\r\n|\n)?/g, "<wp-line-break>");
|
||||
a = a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g, "<wp-line-break>");
|
||||
return a.replace(/\r?\n/g, "<wp-line-break>");
|
||||
});
|
||||
}
|
||||
if (html.indexOf("[caption") !== -1) {
|
||||
preserveBr = true;
|
||||
html = html.replace(/\[caption[\s\S]+?\[\/caption\]/g, (a) => {
|
||||
return a.replace(/<br([^>]*)>/g, "<wp-temp-br$1>").replace(/[\r\n\t]+/, "");
|
||||
});
|
||||
}
|
||||
html = html.replace(
|
||||
new RegExp("\\s*</(" + blocklist1 + ")>\\s*", "g"),
|
||||
"</$1>\n"
|
||||
);
|
||||
html = html.replace(
|
||||
new RegExp("\\s*<((?:" + blocklist1 + ")(?: [^>]*)?)>", "g"),
|
||||
"\n<$1>"
|
||||
);
|
||||
html = html.replace(/(<p [^>]+>[\s\S]*?)<\/p>/g, "$1</p#>");
|
||||
html = html.replace(/<div( [^>]*)?>\s*<p>/gi, "<div$1>\n\n");
|
||||
html = html.replace(/\s*<p>/gi, "");
|
||||
html = html.replace(/\s*<\/p>\s*/gi, "\n\n");
|
||||
html = html.replace(/\n[\s\u00a0]+\n/g, "\n\n");
|
||||
html = html.replace(/(\s*)<br ?\/?>\s*/gi, (_, space) => {
|
||||
if (space && space.indexOf("\n") !== -1) {
|
||||
return "\n\n";
|
||||
}
|
||||
return "\n";
|
||||
});
|
||||
html = html.replace(/\s*<div/g, "\n<div");
|
||||
html = html.replace(/<\/div>\s*/g, "</div>\n");
|
||||
html = html.replace(
|
||||
/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,
|
||||
"\n\n[caption$1[/caption]\n\n"
|
||||
);
|
||||
html = html.replace(/caption\]\n\n+\[caption/g, "caption]\n\n[caption");
|
||||
html = html.replace(
|
||||
new RegExp("\\s*<((?:" + blocklist2 + ")(?: [^>]*)?)\\s*>", "g"),
|
||||
"\n<$1>"
|
||||
);
|
||||
html = html.replace(
|
||||
new RegExp("\\s*</(" + blocklist2 + ")>\\s*", "g"),
|
||||
"</$1>\n"
|
||||
);
|
||||
html = html.replace(/<((li|dt|dd)[^>]*)>/g, " <$1>");
|
||||
if (html.indexOf("<option") !== -1) {
|
||||
html = html.replace(/\s*<option/g, "\n<option");
|
||||
html = html.replace(/\s*<\/select>/g, "\n</select>");
|
||||
}
|
||||
if (html.indexOf("<hr") !== -1) {
|
||||
html = html.replace(/\s*<hr( [^>]*)?>\s*/g, "\n\n<hr$1>\n\n");
|
||||
}
|
||||
if (html.indexOf("<object") !== -1) {
|
||||
html = html.replace(/<object[\s\S]+?<\/object>/g, (a) => {
|
||||
return a.replace(/[\r\n]+/g, "");
|
||||
});
|
||||
}
|
||||
html = html.replace(/<\/p#>/g, "</p>\n");
|
||||
html = html.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g, "\n$1");
|
||||
html = html.replace(/^\s+/, "");
|
||||
html = html.replace(/[\s\u00a0]+$/, "");
|
||||
if (preserveLinebreaks) {
|
||||
html = html.replace(/<wp-line-break>/g, "\n");
|
||||
}
|
||||
if (preserveBr) {
|
||||
html = html.replace(/<wp-temp-br([^>]*)>/g, "<br$1>");
|
||||
}
|
||||
if (preserve.length) {
|
||||
html = html.replace(/<wp-preserve>/g, () => {
|
||||
return preserve.shift();
|
||||
});
|
||||
}
|
||||
return html;
|
||||
}
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).autop = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/**
|
||||
* This file is intentionally left blank and acts as
|
||||
* a resolvable JavaScript entry point for this package.
|
||||
*/
|
||||
|
||||
(window.wp = window.wp || {}).baseStyles = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(window.wp=window.wp||{}).baseStyles={};
|
||||
@@ -0,0 +1,89 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ createBlobURL: () => (/* binding */ createBlobURL),
|
||||
/* harmony export */ downloadBlob: () => (/* binding */ downloadBlob),
|
||||
/* harmony export */ getBlobByURL: () => (/* binding */ getBlobByURL),
|
||||
/* harmony export */ getBlobTypeByURL: () => (/* binding */ getBlobTypeByURL),
|
||||
/* harmony export */ isBlobURL: () => (/* binding */ isBlobURL),
|
||||
/* harmony export */ revokeBlobURL: () => (/* binding */ revokeBlobURL)
|
||||
/* harmony export */ });
|
||||
const cache = {};
|
||||
function createBlobURL(file) {
|
||||
const url = window.URL.createObjectURL(file);
|
||||
cache[url] = file;
|
||||
return url;
|
||||
}
|
||||
function getBlobByURL(url) {
|
||||
return cache[url];
|
||||
}
|
||||
function getBlobTypeByURL(url) {
|
||||
return getBlobByURL(url)?.type.split("/")[0];
|
||||
}
|
||||
function revokeBlobURL(url) {
|
||||
if (cache[url]) {
|
||||
window.URL.revokeObjectURL(url);
|
||||
}
|
||||
delete cache[url];
|
||||
}
|
||||
function isBlobURL(url) {
|
||||
if (!url || !url.indexOf) {
|
||||
return false;
|
||||
}
|
||||
return url.indexOf("blob:") === 0;
|
||||
}
|
||||
function downloadBlob(filename, content, contentType = "") {
|
||||
if (!filename || !content) {
|
||||
return;
|
||||
}
|
||||
const file = new window.Blob([content], { type: contentType });
|
||||
const url = window.URL.createObjectURL(file);
|
||||
const anchorElement = document.createElement("a");
|
||||
anchorElement.href = url;
|
||||
anchorElement.download = filename;
|
||||
anchorElement.style.display = "none";
|
||||
document.body.appendChild(anchorElement);
|
||||
anchorElement.click();
|
||||
document.body.removeChild(anchorElement);
|
||||
window.URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).blob = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={d:(o,t)=>{for(var n in t)e.o(t,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:t[n]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{createBlobURL:()=>n,downloadBlob:()=>c,getBlobByURL:()=>r,getBlobTypeByURL:()=>d,isBlobURL:()=>l,revokeBlobURL:()=>i});const t={};function n(e){const o=window.URL.createObjectURL(e);return t[o]=e,o}function r(e){return t[e]}function d(e){return r(e)?.type.split("/")[0]}function i(e){t[e]&&window.URL.revokeObjectURL(e),delete t[e]}function l(e){return!(!e||!e.indexOf)&&0===e.indexOf("blob:")}function c(e,o,t=""){if(!e||!o)return;const n=new window.Blob([o],{type:t}),r=window.URL.createObjectURL(n),d=document.createElement("a");d.href=r,d.download=e,d.style.display="none",document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(r)}(window.wp=window.wp||{}).blob=o})();
|
||||
+1844
File diff suppressed because it is too large
Load Diff
+2
File diff suppressed because one or more lines are too long
+67469
File diff suppressed because one or more lines are too long
+23
File diff suppressed because one or more lines are too long
+57922
File diff suppressed because one or more lines are too long
+4
File diff suppressed because one or more lines are too long
Vendored
+245
@@ -0,0 +1,245 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ parse: () => (/* binding */ parse)
|
||||
/* harmony export */ });
|
||||
let document;
|
||||
let offset;
|
||||
let output;
|
||||
let stack;
|
||||
const tokenizer = /<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;
|
||||
function Block(blockName, attrs, innerBlocks, innerHTML, innerContent) {
|
||||
return {
|
||||
blockName,
|
||||
attrs,
|
||||
innerBlocks,
|
||||
innerHTML,
|
||||
innerContent
|
||||
};
|
||||
}
|
||||
function Freeform(innerHTML) {
|
||||
return Block(null, {}, [], innerHTML, [innerHTML]);
|
||||
}
|
||||
function Frame(block, tokenStart, tokenLength, prevOffset, leadingHtmlStart) {
|
||||
return {
|
||||
block,
|
||||
tokenStart,
|
||||
tokenLength,
|
||||
prevOffset: prevOffset || tokenStart + tokenLength,
|
||||
leadingHtmlStart
|
||||
};
|
||||
}
|
||||
const parse = (doc) => {
|
||||
document = doc;
|
||||
offset = 0;
|
||||
output = [];
|
||||
stack = [];
|
||||
tokenizer.lastIndex = 0;
|
||||
do {
|
||||
} while (proceed());
|
||||
return output;
|
||||
};
|
||||
function proceed() {
|
||||
const stackDepth = stack.length;
|
||||
const next = nextToken();
|
||||
const [tokenType, blockName, attrs, startOffset, tokenLength] = next;
|
||||
const leadingHtmlStart = startOffset > offset ? offset : null;
|
||||
switch (tokenType) {
|
||||
case "no-more-tokens":
|
||||
if (0 === stackDepth) {
|
||||
addFreeform();
|
||||
return false;
|
||||
}
|
||||
if (1 === stackDepth) {
|
||||
addBlockFromStack();
|
||||
return false;
|
||||
}
|
||||
while (0 < stack.length) {
|
||||
addBlockFromStack();
|
||||
}
|
||||
return false;
|
||||
case "void-block":
|
||||
if (0 === stackDepth) {
|
||||
if (null !== leadingHtmlStart) {
|
||||
output.push(
|
||||
Freeform(
|
||||
document.substr(
|
||||
leadingHtmlStart,
|
||||
startOffset - leadingHtmlStart
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
output.push(Block(blockName, attrs, [], "", []));
|
||||
offset = startOffset + tokenLength;
|
||||
return true;
|
||||
}
|
||||
addInnerBlock(
|
||||
Block(blockName, attrs, [], "", []),
|
||||
startOffset,
|
||||
tokenLength
|
||||
);
|
||||
offset = startOffset + tokenLength;
|
||||
return true;
|
||||
case "block-opener":
|
||||
stack.push(
|
||||
Frame(
|
||||
Block(blockName, attrs, [], "", []),
|
||||
startOffset,
|
||||
tokenLength,
|
||||
startOffset + tokenLength,
|
||||
leadingHtmlStart
|
||||
)
|
||||
);
|
||||
offset = startOffset + tokenLength;
|
||||
return true;
|
||||
case "block-closer":
|
||||
if (0 === stackDepth) {
|
||||
addFreeform();
|
||||
return false;
|
||||
}
|
||||
if (1 === stackDepth) {
|
||||
addBlockFromStack(startOffset);
|
||||
offset = startOffset + tokenLength;
|
||||
return true;
|
||||
}
|
||||
const stackTop = stack.pop();
|
||||
const html = document.substr(
|
||||
stackTop.prevOffset,
|
||||
startOffset - stackTop.prevOffset
|
||||
);
|
||||
stackTop.block.innerHTML += html;
|
||||
stackTop.block.innerContent.push(html);
|
||||
stackTop.prevOffset = startOffset + tokenLength;
|
||||
addInnerBlock(
|
||||
stackTop.block,
|
||||
stackTop.tokenStart,
|
||||
stackTop.tokenLength,
|
||||
startOffset + tokenLength
|
||||
);
|
||||
offset = startOffset + tokenLength;
|
||||
return true;
|
||||
default:
|
||||
addFreeform();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function parseJSON(input) {
|
||||
try {
|
||||
return JSON.parse(input);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
function nextToken() {
|
||||
const matches = tokenizer.exec(document);
|
||||
if (null === matches) {
|
||||
return ["no-more-tokens", "", null, 0, 0];
|
||||
}
|
||||
const startedAt = matches.index;
|
||||
const [
|
||||
match,
|
||||
closerMatch,
|
||||
namespaceMatch,
|
||||
nameMatch,
|
||||
attrsMatch,
|
||||
,
|
||||
voidMatch
|
||||
] = matches;
|
||||
const length = match.length;
|
||||
const isCloser = !!closerMatch;
|
||||
const isVoid = !!voidMatch;
|
||||
const namespace = namespaceMatch || "core/";
|
||||
const name = namespace + nameMatch;
|
||||
const hasAttrs = !!attrsMatch;
|
||||
const attrs = hasAttrs ? parseJSON(attrsMatch) : {};
|
||||
if (isCloser && (isVoid || hasAttrs)) {
|
||||
}
|
||||
if (isVoid) {
|
||||
return ["void-block", name, attrs, startedAt, length];
|
||||
}
|
||||
if (isCloser) {
|
||||
return ["block-closer", name, null, startedAt, length];
|
||||
}
|
||||
return ["block-opener", name, attrs, startedAt, length];
|
||||
}
|
||||
function addFreeform(rawLength) {
|
||||
const length = rawLength ? rawLength : document.length - offset;
|
||||
if (0 === length) {
|
||||
return;
|
||||
}
|
||||
output.push(Freeform(document.substr(offset, length)));
|
||||
}
|
||||
function addInnerBlock(block, tokenStart, tokenLength, lastOffset) {
|
||||
const parent = stack[stack.length - 1];
|
||||
parent.block.innerBlocks.push(block);
|
||||
const html = document.substr(
|
||||
parent.prevOffset,
|
||||
tokenStart - parent.prevOffset
|
||||
);
|
||||
if (html) {
|
||||
parent.block.innerHTML += html;
|
||||
parent.block.innerContent.push(html);
|
||||
}
|
||||
parent.block.innerContent.push(null);
|
||||
parent.prevOffset = lastOffset ? lastOffset : tokenStart + tokenLength;
|
||||
}
|
||||
function addBlockFromStack(endOffset) {
|
||||
const { block, leadingHtmlStart, prevOffset, tokenStart } = stack.pop();
|
||||
const html = endOffset ? document.substr(prevOffset, endOffset - prevOffset) : document.substr(prevOffset);
|
||||
if (html) {
|
||||
block.innerHTML += html;
|
||||
block.innerContent.push(html);
|
||||
}
|
||||
if (null !== leadingHtmlStart) {
|
||||
output.push(
|
||||
Freeform(
|
||||
document.substr(
|
||||
leadingHtmlStart,
|
||||
tokenStart - leadingHtmlStart
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
output.push(block);
|
||||
}
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).blockSerializationDefaultParser = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var n={d:(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(n,e)=>Object.prototype.hasOwnProperty.call(n,e),r:n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})}},e={};let t,r,o,s;n.r(e),n.d(e,{parse:()=>i});const l=/<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function u(n,e,t,r,o){return{blockName:n,attrs:e,innerBlocks:t,innerHTML:r,innerContent:o}}function c(n){return u(null,{},[],n,[n])}const i=n=>{t=n,r=0,o=[],s=[],l.lastIndex=0;do{}while(f());return o};function f(){const n=s.length,e=function(){const n=l.exec(t);if(null===n)return["no-more-tokens","",null,0,0];const e=n.index,[r,o,s,u,c,,i]=n,f=r.length,p=!!o,a=!!i,b=(s||"core/")+u,k=!!c,h=k?function(n){try{return JSON.parse(n)}catch(n){return null}}(c):{};if(a)return["void-block",b,h,e,f];if(p)return["block-closer",b,null,e,f];return["block-opener",b,h,e,f]}(),[i,f,k,h,d]=e,g=h>r?r:null;switch(i){case"no-more-tokens":if(0===n)return p(),!1;if(1===n)return b(),!1;for(;0<s.length;)b();return!1;case"void-block":return 0===n?(null!==g&&o.push(c(t.substr(g,h-g))),o.push(u(f,k,[],"",[])),r=h+d,!0):(a(u(f,k,[],"",[]),h,d),r=h+d,!0);case"block-opener":return s.push(function(n,e,t,r,o){return{block:n,tokenStart:e,tokenLength:t,prevOffset:r||e+t,leadingHtmlStart:o}}(u(f,k,[],"",[]),h,d,h+d,g)),r=h+d,!0;case"block-closer":if(0===n)return p(),!1;if(1===n)return b(h),r=h+d,!0;const e=s.pop(),l=t.substr(e.prevOffset,h-e.prevOffset);return e.block.innerHTML+=l,e.block.innerContent.push(l),e.prevOffset=h+d,a(e.block,e.tokenStart,e.tokenLength,h+d),r=h+d,!0;default:return p(),!1}}function p(n){const e=n||t.length-r;0!==e&&o.push(c(t.substr(r,e)))}function a(n,e,r,o){const l=s[s.length-1];l.block.innerBlocks.push(n);const u=t.substr(l.prevOffset,e-l.prevOffset);u&&(l.block.innerHTML+=u,l.block.innerContent.push(u)),l.block.innerContent.push(null),l.prevOffset=o||e+r}function b(n){const{block:e,leadingHtmlStart:r,prevOffset:l,tokenStart:u}=s.pop(),i=n?t.substr(l,n-l):t.substr(l);i&&(e.innerHTML+=i,e.innerContent.push(i)),null!==r&&o.push(c(t.substr(r,u-r))),o.push(e)}(window.wp=window.wp||{}).blockSerializationDefaultParser=e})();
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+33
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+680
@@ -0,0 +1,680 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
initializeCommandPalette: () => (/* binding */ initializeCommandPalette),
|
||||
privateApis: () => (/* reexport */ privateApis)
|
||||
});
|
||||
|
||||
;// external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// external ["wp","router"]
|
||||
const external_wp_router_namespaceObject = window["wp"]["router"];
|
||||
;// external ["wp","commands"]
|
||||
const external_wp_commands_namespaceObject = window["wp"]["commands"];
|
||||
;// external ["wp","i18n"]
|
||||
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
|
||||
;// external ["wp","primitives"]
|
||||
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
|
||||
;// ./node_modules/@wordpress/icons/build-module/library/external.js
|
||||
|
||||
|
||||
var external_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" }) });
|
||||
|
||||
|
||||
;// external ["wp","coreData"]
|
||||
const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
|
||||
;// external ["wp","data"]
|
||||
const external_wp_data_namespaceObject = window["wp"]["data"];
|
||||
;// ./node_modules/@wordpress/core-commands/build-module/admin-navigation-commands.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const getViewSiteCommand = () => function useViewSiteCommand() {
|
||||
const homeUrl = (0,external_wp_data_namespaceObject.useSelect)((select) => {
|
||||
return select(external_wp_coreData_namespaceObject.store).getEntityRecord(
|
||||
"root",
|
||||
"__unstableBase"
|
||||
)?.home;
|
||||
}, []);
|
||||
const commands = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
||||
if (!homeUrl) {
|
||||
return [];
|
||||
}
|
||||
return [
|
||||
{
|
||||
name: "core/view-site",
|
||||
label: (0,external_wp_i18n_namespaceObject.__)("View site"),
|
||||
icon: external_default,
|
||||
callback: ({ close }) => {
|
||||
close();
|
||||
window.open(homeUrl, "_blank");
|
||||
}
|
||||
}
|
||||
];
|
||||
}, [homeUrl]);
|
||||
return {
|
||||
isLoading: false,
|
||||
commands
|
||||
};
|
||||
};
|
||||
function useAdminNavigationCommands(menuCommands) {
|
||||
const commands = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
||||
return (menuCommands ?? []).map((menuCommand) => {
|
||||
const label = (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
/* translators: %s: menu label */
|
||||
(0,external_wp_i18n_namespaceObject.__)("Go to: %s"),
|
||||
menuCommand.label
|
||||
);
|
||||
return {
|
||||
name: menuCommand.name,
|
||||
label,
|
||||
searchLabel: label,
|
||||
callback: ({ close }) => {
|
||||
document.location = menuCommand.url;
|
||||
close();
|
||||
}
|
||||
};
|
||||
});
|
||||
}, [menuCommands]);
|
||||
(0,external_wp_commands_namespaceObject.useCommands)(commands);
|
||||
(0,external_wp_commands_namespaceObject.useCommandLoader)({
|
||||
name: "core/view-site",
|
||||
hook: getViewSiteCommand()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/icons/build-module/library/post.js
|
||||
|
||||
|
||||
var post_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z" }) });
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/icons/build-module/library/page.js
|
||||
|
||||
|
||||
var page_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }),
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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" })
|
||||
] });
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/icons/build-module/library/layout.js
|
||||
|
||||
|
||||
var layout_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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" }) });
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
|
||||
|
||||
|
||||
var symbol_filled_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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" }) });
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/icons/build-module/library/styles.js
|
||||
|
||||
|
||||
var styles_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
external_wp_primitives_namespaceObject.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"
|
||||
}
|
||||
) });
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/icons/build-module/library/navigation.js
|
||||
|
||||
|
||||
var navigation_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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" }) });
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/icons/build-module/library/symbol.js
|
||||
|
||||
|
||||
var symbol_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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" }) });
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/icons/build-module/library/brush.js
|
||||
|
||||
|
||||
var brush_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z" }) });
|
||||
|
||||
|
||||
;// external ["wp","url"]
|
||||
const external_wp_url_namespaceObject = window["wp"]["url"];
|
||||
;// external ["wp","compose"]
|
||||
const external_wp_compose_namespaceObject = window["wp"]["compose"];
|
||||
;// external ["wp","htmlEntities"]
|
||||
const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
|
||||
;// external ["wp","privateApis"]
|
||||
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
|
||||
;// ./node_modules/@wordpress/core-commands/build-module/lock-unlock.js
|
||||
|
||||
const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__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/core-commands"
|
||||
);
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/core-commands/build-module/utils/order-entity-records-by-search.js
|
||||
function orderEntityRecordsBySearch(records = [], search = "") {
|
||||
if (!Array.isArray(records) || !records.length) {
|
||||
return [];
|
||||
}
|
||||
if (!search) {
|
||||
return records;
|
||||
}
|
||||
const priority = [];
|
||||
const nonPriority = [];
|
||||
for (let i = 0; i < records.length; i++) {
|
||||
const record = records[i];
|
||||
if (record?.title?.raw?.toLowerCase()?.includes(search?.toLowerCase())) {
|
||||
priority.push(record);
|
||||
} else {
|
||||
nonPriority.push(record);
|
||||
}
|
||||
}
|
||||
return priority.concat(nonPriority);
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/core-commands/build-module/site-editor-navigation-commands.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const { useHistory } = unlock(external_wp_router_namespaceObject.privateApis);
|
||||
const icons = {
|
||||
post: post_default,
|
||||
page: page_default,
|
||||
wp_template: layout_default,
|
||||
wp_template_part: symbol_filled_default
|
||||
};
|
||||
function useDebouncedValue(value) {
|
||||
const [debouncedValue, setDebouncedValue] = (0,external_wp_element_namespaceObject.useState)("");
|
||||
const debounced = (0,external_wp_compose_namespaceObject.useDebounce)(setDebouncedValue, 250);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
debounced(value);
|
||||
return () => debounced.cancel();
|
||||
}, [debounced, value]);
|
||||
return debouncedValue;
|
||||
}
|
||||
const getNavigationCommandLoaderPerPostType = (postType) => function useNavigationCommandLoader({ search }) {
|
||||
const history = useHistory();
|
||||
const { isBlockBasedTheme, canCreateTemplate } = (0,external_wp_data_namespaceObject.useSelect)(
|
||||
(select) => {
|
||||
return {
|
||||
isBlockBasedTheme: select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme,
|
||||
canCreateTemplate: select(external_wp_coreData_namespaceObject.store).canUser("create", {
|
||||
kind: "postType",
|
||||
name: "wp_template"
|
||||
})
|
||||
};
|
||||
},
|
||||
[]
|
||||
);
|
||||
const delayedSearch = useDebouncedValue(search);
|
||||
const { records, isLoading } = (0,external_wp_data_namespaceObject.useSelect)(
|
||||
(select) => {
|
||||
if (!delayedSearch) {
|
||||
return {
|
||||
isLoading: false
|
||||
};
|
||||
}
|
||||
const query = {
|
||||
search: delayedSearch,
|
||||
per_page: 10,
|
||||
orderby: "relevance",
|
||||
status: [
|
||||
"publish",
|
||||
"future",
|
||||
"draft",
|
||||
"pending",
|
||||
"private"
|
||||
]
|
||||
};
|
||||
return {
|
||||
records: select(external_wp_coreData_namespaceObject.store).getEntityRecords(
|
||||
"postType",
|
||||
postType,
|
||||
query
|
||||
),
|
||||
isLoading: !select(external_wp_coreData_namespaceObject.store).hasFinishedResolution(
|
||||
"getEntityRecords",
|
||||
["postType", postType, query]
|
||||
)
|
||||
};
|
||||
},
|
||||
[delayedSearch]
|
||||
);
|
||||
const commands = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
||||
return (records ?? []).map((record) => {
|
||||
const command = {
|
||||
name: postType + "-" + record.id,
|
||||
searchLabel: record.title?.rendered + " " + record.id,
|
||||
label: record.title?.rendered ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(record.title?.rendered) : (0,external_wp_i18n_namespaceObject.__)("(no title)"),
|
||||
icon: icons[postType]
|
||||
};
|
||||
if (!canCreateTemplate || postType === "post" || postType === "page" && !isBlockBasedTheme) {
|
||||
return {
|
||||
...command,
|
||||
callback: ({ close }) => {
|
||||
const args = {
|
||||
post: record.id,
|
||||
action: "edit"
|
||||
};
|
||||
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)("post.php", args);
|
||||
document.location = targetUrl;
|
||||
close();
|
||||
}
|
||||
};
|
||||
}
|
||||
const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes(
|
||||
"site-editor.php"
|
||||
);
|
||||
return {
|
||||
...command,
|
||||
callback: ({ close }) => {
|
||||
if (isSiteEditor) {
|
||||
history.navigate(
|
||||
`/${postType}/${record.id}?canvas=edit`
|
||||
);
|
||||
} else {
|
||||
document.location = (0,external_wp_url_namespaceObject.addQueryArgs)(
|
||||
"site-editor.php",
|
||||
{
|
||||
p: `/${postType}/${record.id}`,
|
||||
canvas: "edit"
|
||||
}
|
||||
);
|
||||
}
|
||||
close();
|
||||
}
|
||||
};
|
||||
});
|
||||
}, [canCreateTemplate, records, isBlockBasedTheme, history]);
|
||||
return {
|
||||
commands,
|
||||
isLoading
|
||||
};
|
||||
};
|
||||
const getNavigationCommandLoaderPerTemplate = (templateType) => function useNavigationCommandLoader({ search }) {
|
||||
const history = useHistory();
|
||||
const { isBlockBasedTheme, canCreateTemplate } = (0,external_wp_data_namespaceObject.useSelect)(
|
||||
(select) => {
|
||||
return {
|
||||
isBlockBasedTheme: select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme,
|
||||
canCreateTemplate: select(external_wp_coreData_namespaceObject.store).canUser("create", {
|
||||
kind: "postType",
|
||||
name: templateType
|
||||
})
|
||||
};
|
||||
},
|
||||
[]
|
||||
);
|
||||
const { records, isLoading } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
|
||||
const { getEntityRecords } = select(external_wp_coreData_namespaceObject.store);
|
||||
const query = { per_page: -1 };
|
||||
return {
|
||||
records: getEntityRecords("postType", templateType, query),
|
||||
isLoading: !select(external_wp_coreData_namespaceObject.store).hasFinishedResolution(
|
||||
"getEntityRecords",
|
||||
["postType", templateType, query]
|
||||
)
|
||||
};
|
||||
}, []);
|
||||
const orderedRecords = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
||||
return orderEntityRecordsBySearch(records, search).slice(0, 10);
|
||||
}, [records, search]);
|
||||
const commands = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
||||
if (!canCreateTemplate || !isBlockBasedTheme && !templateType === "wp_template_part") {
|
||||
return [];
|
||||
}
|
||||
const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes(
|
||||
"site-editor.php"
|
||||
);
|
||||
const result = [];
|
||||
result.push(
|
||||
...orderedRecords.map((record) => {
|
||||
return {
|
||||
name: templateType + "-" + record.id,
|
||||
searchLabel: record.title?.rendered + " " + record.id,
|
||||
label: record.title?.rendered ? record.title?.rendered : (0,external_wp_i18n_namespaceObject.__)("(no title)"),
|
||||
icon: icons[templateType],
|
||||
callback: ({ close }) => {
|
||||
if (isSiteEditor) {
|
||||
history.navigate(
|
||||
`/${templateType}/${record.id}?canvas=edit`
|
||||
);
|
||||
} else {
|
||||
document.location = (0,external_wp_url_namespaceObject.addQueryArgs)(
|
||||
"site-editor.php",
|
||||
{
|
||||
p: `/${templateType}/${record.id}`,
|
||||
canvas: "edit"
|
||||
}
|
||||
);
|
||||
}
|
||||
close();
|
||||
}
|
||||
};
|
||||
})
|
||||
);
|
||||
if (orderedRecords?.length > 0 && templateType === "wp_template_part") {
|
||||
result.push({
|
||||
name: "core/edit-site/open-template-parts",
|
||||
label: (0,external_wp_i18n_namespaceObject.__)("Go to: Template parts"),
|
||||
icon: symbol_filled_default,
|
||||
callback: ({ close }) => {
|
||||
if (isSiteEditor) {
|
||||
history.navigate(
|
||||
"/pattern?postType=wp_template_part&categoryId=all-parts"
|
||||
);
|
||||
} else {
|
||||
document.location = (0,external_wp_url_namespaceObject.addQueryArgs)(
|
||||
"site-editor.php",
|
||||
{
|
||||
p: "/pattern",
|
||||
postType: "wp_template_part",
|
||||
categoryId: "all-parts"
|
||||
}
|
||||
);
|
||||
}
|
||||
close();
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}, [canCreateTemplate, isBlockBasedTheme, orderedRecords, history]);
|
||||
return {
|
||||
commands,
|
||||
isLoading
|
||||
};
|
||||
};
|
||||
const getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNavigationCommands() {
|
||||
const history = useHistory();
|
||||
const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes(
|
||||
"site-editor.php"
|
||||
);
|
||||
const { isBlockBasedTheme, canCreateTemplate, canCreatePatterns } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
|
||||
return {
|
||||
isBlockBasedTheme: select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme,
|
||||
canCreateTemplate: select(external_wp_coreData_namespaceObject.store).canUser("create", {
|
||||
kind: "postType",
|
||||
name: "wp_template"
|
||||
}),
|
||||
canCreatePatterns: select(external_wp_coreData_namespaceObject.store).canUser("create", {
|
||||
kind: "postType",
|
||||
name: "wp_block"
|
||||
})
|
||||
};
|
||||
}, []);
|
||||
const commands = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
||||
const result = [];
|
||||
if (canCreateTemplate && isBlockBasedTheme) {
|
||||
result.push({
|
||||
name: "core/edit-site/open-styles",
|
||||
label: (0,external_wp_i18n_namespaceObject.__)("Go to: Styles"),
|
||||
icon: styles_default,
|
||||
callback: ({ close }) => {
|
||||
if (isSiteEditor) {
|
||||
history.navigate("/styles");
|
||||
} else {
|
||||
document.location = (0,external_wp_url_namespaceObject.addQueryArgs)(
|
||||
"site-editor.php",
|
||||
{
|
||||
p: "/styles"
|
||||
}
|
||||
);
|
||||
}
|
||||
close();
|
||||
}
|
||||
});
|
||||
result.push({
|
||||
name: "core/edit-site/open-navigation",
|
||||
label: (0,external_wp_i18n_namespaceObject.__)("Go to: Navigation"),
|
||||
icon: navigation_default,
|
||||
callback: ({ close }) => {
|
||||
if (isSiteEditor) {
|
||||
history.navigate("/navigation");
|
||||
} else {
|
||||
document.location = (0,external_wp_url_namespaceObject.addQueryArgs)(
|
||||
"site-editor.php",
|
||||
{
|
||||
p: "/navigation"
|
||||
}
|
||||
);
|
||||
}
|
||||
close();
|
||||
}
|
||||
});
|
||||
result.push({
|
||||
name: "core/edit-site/open-templates",
|
||||
label: (0,external_wp_i18n_namespaceObject.__)("Go to: Templates"),
|
||||
icon: layout_default,
|
||||
callback: ({ close }) => {
|
||||
if (isSiteEditor) {
|
||||
history.navigate("/template");
|
||||
} else {
|
||||
document.location = (0,external_wp_url_namespaceObject.addQueryArgs)(
|
||||
"site-editor.php",
|
||||
{
|
||||
p: "/template"
|
||||
}
|
||||
);
|
||||
}
|
||||
close();
|
||||
}
|
||||
});
|
||||
}
|
||||
if (canCreatePatterns) {
|
||||
result.push({
|
||||
name: "core/edit-site/open-patterns",
|
||||
label: (0,external_wp_i18n_namespaceObject.__)("Go to: Patterns"),
|
||||
icon: symbol_default,
|
||||
callback: ({ close }) => {
|
||||
if (canCreateTemplate) {
|
||||
if (isSiteEditor) {
|
||||
history.navigate("/pattern");
|
||||
} else {
|
||||
document.location = (0,external_wp_url_namespaceObject.addQueryArgs)(
|
||||
"site-editor.php",
|
||||
{
|
||||
p: "/pattern"
|
||||
}
|
||||
);
|
||||
}
|
||||
close();
|
||||
} else {
|
||||
document.location.href = "edit.php?post_type=wp_block";
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}, [
|
||||
history,
|
||||
isSiteEditor,
|
||||
canCreateTemplate,
|
||||
canCreatePatterns,
|
||||
isBlockBasedTheme
|
||||
]);
|
||||
return {
|
||||
commands,
|
||||
isLoading: false
|
||||
};
|
||||
};
|
||||
const getGlobalStylesOpenCssCommands = () => function useGlobalStylesOpenCssCommands() {
|
||||
const history = useHistory();
|
||||
const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes(
|
||||
"site-editor.php"
|
||||
);
|
||||
const { canEditCSS } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
|
||||
const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } = select(external_wp_coreData_namespaceObject.store);
|
||||
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
||||
const globalStyles = globalStylesId ? getEntityRecord("root", "globalStyles", globalStylesId) : void 0;
|
||||
return {
|
||||
canEditCSS: !!globalStyles?._links?.["wp:action-edit-css"]
|
||||
};
|
||||
}, []);
|
||||
const commands = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
||||
if (!canEditCSS) {
|
||||
return [];
|
||||
}
|
||||
return [
|
||||
{
|
||||
name: "core/open-styles-css",
|
||||
label: (0,external_wp_i18n_namespaceObject.__)("Open custom CSS"),
|
||||
icon: brush_default,
|
||||
callback: ({ close }) => {
|
||||
close();
|
||||
if (isSiteEditor) {
|
||||
history.navigate("/styles?section=/css");
|
||||
} else {
|
||||
document.location = (0,external_wp_url_namespaceObject.addQueryArgs)(
|
||||
"site-editor.php",
|
||||
{
|
||||
p: "/styles",
|
||||
section: "/css"
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
}, [history, canEditCSS, isSiteEditor]);
|
||||
return {
|
||||
isLoading: false,
|
||||
commands
|
||||
};
|
||||
};
|
||||
function useSiteEditorNavigationCommands(isNetworkAdmin) {
|
||||
(0,external_wp_commands_namespaceObject.useCommandLoader)({
|
||||
name: "core/edit-site/navigate-pages",
|
||||
hook: getNavigationCommandLoaderPerPostType("page"),
|
||||
disabled: isNetworkAdmin
|
||||
});
|
||||
(0,external_wp_commands_namespaceObject.useCommandLoader)({
|
||||
name: "core/edit-site/navigate-posts",
|
||||
hook: getNavigationCommandLoaderPerPostType("post"),
|
||||
disabled: isNetworkAdmin
|
||||
});
|
||||
(0,external_wp_commands_namespaceObject.useCommandLoader)({
|
||||
name: "core/edit-site/navigate-templates",
|
||||
hook: getNavigationCommandLoaderPerTemplate("wp_template"),
|
||||
disabled: isNetworkAdmin
|
||||
});
|
||||
(0,external_wp_commands_namespaceObject.useCommandLoader)({
|
||||
name: "core/edit-site/navigate-template-parts",
|
||||
hook: getNavigationCommandLoaderPerTemplate("wp_template_part"),
|
||||
disabled: isNetworkAdmin
|
||||
});
|
||||
(0,external_wp_commands_namespaceObject.useCommandLoader)({
|
||||
name: "core/edit-site/basic-navigation",
|
||||
hook: getSiteEditorBasicNavigationCommands(),
|
||||
context: "site-editor",
|
||||
disabled: isNetworkAdmin
|
||||
});
|
||||
(0,external_wp_commands_namespaceObject.useCommandLoader)({
|
||||
name: "core/edit-site/global-styles-css",
|
||||
hook: getGlobalStylesOpenCssCommands(),
|
||||
disabled: isNetworkAdmin
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/core-commands/build-module/private-apis.js
|
||||
|
||||
|
||||
|
||||
function useCommands() {
|
||||
useAdminNavigationCommands();
|
||||
useSiteEditorNavigationCommands();
|
||||
}
|
||||
const privateApis = {};
|
||||
lock(privateApis, {
|
||||
useCommands
|
||||
});
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/core-commands/build-module/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const { RouterProvider } = unlock(external_wp_router_namespaceObject.privateApis);
|
||||
function CommandPalette({ settings }) {
|
||||
const { menu_commands: menuCommands, is_network_admin: isNetworkAdmin } = settings;
|
||||
useAdminNavigationCommands(menuCommands);
|
||||
useSiteEditorNavigationCommands(isNetworkAdmin);
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(RouterProvider, { pathArg: "p", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_commands_namespaceObject.CommandMenu, {}) });
|
||||
}
|
||||
function initializeCommandPalette(settings) {
|
||||
const root = document.createElement("div");
|
||||
document.body.appendChild(root);
|
||||
(0,external_wp_element_namespaceObject.createRoot)(root).render(
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CommandPalette, { settings }) })
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).coreCommands = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+2
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+2486
File diff suppressed because it is too large
Load Diff
+2
File diff suppressed because one or more lines are too long
+123
@@ -0,0 +1,123 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat get default export */
|
||||
/******/ (() => {
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = (module) => {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ () => (module['default']) :
|
||||
/******/ () => (module);
|
||||
/******/ __webpack_require__.d(getter, { a: getter });
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
__unstableAwaitPromise: () => (/* binding */ __unstableAwaitPromise),
|
||||
apiFetch: () => (/* binding */ apiFetch),
|
||||
controls: () => (/* binding */ controls),
|
||||
dispatch: () => (/* binding */ dispatch),
|
||||
select: () => (/* binding */ build_module_select),
|
||||
syncSelect: () => (/* binding */ syncSelect)
|
||||
});
|
||||
|
||||
;// external ["wp","apiFetch"]
|
||||
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
|
||||
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
|
||||
;// external ["wp","data"]
|
||||
const external_wp_data_namespaceObject = window["wp"]["data"];
|
||||
;// external ["wp","deprecated"]
|
||||
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
|
||||
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
|
||||
;// ./node_modules/@wordpress/data-controls/build-module/index.js
|
||||
|
||||
|
||||
|
||||
function apiFetch(request) {
|
||||
return {
|
||||
type: "API_FETCH",
|
||||
request
|
||||
};
|
||||
}
|
||||
function build_module_select(storeNameOrDescriptor, selectorName, ...args) {
|
||||
external_wp_deprecated_default()("`select` control in `@wordpress/data-controls`", {
|
||||
since: "5.7",
|
||||
alternative: "built-in `resolveSelect` control in `@wordpress/data`"
|
||||
});
|
||||
return external_wp_data_namespaceObject.controls.resolveSelect(
|
||||
storeNameOrDescriptor,
|
||||
selectorName,
|
||||
...args
|
||||
);
|
||||
}
|
||||
function syncSelect(storeNameOrDescriptor, selectorName, ...args) {
|
||||
external_wp_deprecated_default()("`syncSelect` control in `@wordpress/data-controls`", {
|
||||
since: "5.7",
|
||||
alternative: "built-in `select` control in `@wordpress/data`"
|
||||
});
|
||||
return external_wp_data_namespaceObject.controls.select(storeNameOrDescriptor, selectorName, ...args);
|
||||
}
|
||||
function dispatch(storeNameOrDescriptor, actionName, ...args) {
|
||||
external_wp_deprecated_default()("`dispatch` control in `@wordpress/data-controls`", {
|
||||
since: "5.7",
|
||||
alternative: "built-in `dispatch` control in `@wordpress/data`"
|
||||
});
|
||||
return external_wp_data_namespaceObject.controls.dispatch(storeNameOrDescriptor, actionName, ...args);
|
||||
}
|
||||
const __unstableAwaitPromise = function(promise) {
|
||||
return {
|
||||
type: "AWAIT_PROMISE",
|
||||
promise
|
||||
};
|
||||
};
|
||||
const controls = {
|
||||
AWAIT_PROMISE({ promise }) {
|
||||
return promise;
|
||||
},
|
||||
API_FETCH({ request }) {
|
||||
return external_wp_apiFetch_default()(request);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).dataControls = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{__unstableAwaitPromise:()=>p,apiFetch:()=>i,controls:()=>u,dispatch:()=>d,select:()=>a,syncSelect:()=>l});const o=window.wp.apiFetch;var r=e.n(o);const n=window.wp.data,s=window.wp.deprecated;var c=e.n(s);function i(e){return{type:"API_FETCH",request:e}}function a(e,t,...o){return c()("`select` control in `@wordpress/data-controls`",{since:"5.7",alternative:"built-in `resolveSelect` control in `@wordpress/data`"}),n.controls.resolveSelect(e,t,...o)}function l(e,t,...o){return c()("`syncSelect` control in `@wordpress/data-controls`",{since:"5.7",alternative:"built-in `select` control in `@wordpress/data`"}),n.controls.select(e,t,...o)}function d(e,t,...o){return c()("`dispatch` control in `@wordpress/data-controls`",{since:"5.7",alternative:"built-in `dispatch` control in `@wordpress/data`"}),n.controls.dispatch(e,t,...o)}const p=function(e){return{type:"AWAIT_PROMISE",promise:e}},u={AWAIT_PROMISE:({promise:e})=>e,API_FETCH:({request:e})=>r()(e)};(window.wp=window.wp||{}).dataControls=t})();
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
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,59 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
"default": () => (/* binding */ deprecated)
|
||||
});
|
||||
|
||||
// UNUSED EXPORTS: logged
|
||||
|
||||
;// external ["wp","hooks"]
|
||||
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
|
||||
;// ./node_modules/@wordpress/deprecated/build-module/index.js
|
||||
|
||||
const logged = /* @__PURE__ */ Object.create(null);
|
||||
function deprecated(feature, options = {}) {
|
||||
const { since, version, alternative, plugin, link, hint } = options;
|
||||
const pluginMessage = plugin ? ` from ${plugin}` : "";
|
||||
const sinceMessage = since ? ` since version ${since}` : "";
|
||||
const versionMessage = version ? ` and will be removed${pluginMessage} in version ${version}` : "";
|
||||
const useInsteadMessage = alternative ? ` Please use ${alternative} instead.` : "";
|
||||
const linkMessage = link ? ` See: ${link}` : "";
|
||||
const hintMessage = hint ? ` Note: ${hint}` : "";
|
||||
const message = `${feature} is deprecated${sinceMessage}${versionMessage}.${useInsteadMessage}${linkMessage}${hintMessage}`;
|
||||
if (message in logged) {
|
||||
return;
|
||||
}
|
||||
(0,external_wp_hooks_namespaceObject.doAction)("deprecated", feature, options, message);
|
||||
console.warn(message);
|
||||
logged[message] = true;
|
||||
}
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).deprecated = __webpack_exports__["default"];
|
||||
/******/ })()
|
||||
;
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={d:(n,o)=>{for(var t in o)e.o(o,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:o[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n)},n={};e.d(n,{default:()=>i});const o=window.wp.hooks,t=Object.create(null);function i(e,n={}){const{since:i,version:r,alternative:d,plugin:a,link:c,hint:s}=n,l=`${e} is deprecated${i?` since version ${i}`:""}${r?` and will be removed${a?` from ${a}`:""} in version ${r}`:""}.${d?` Please use ${d} instead.`:""}${c?` See: ${c}`:""}${s?` Note: ${s}`:""}`;l in t||((0,o.doAction)("deprecated",e,n,l),console.warn(l),t[l]=!0)}(window.wp=window.wp||{}).deprecated=n.default})();
|
||||
Vendored
+696
File diff suppressed because one or more lines are too long
Vendored
+696
File diff suppressed because one or more lines are too long
Vendored
+68
File diff suppressed because one or more lines are too long
INFO-3163 (CMS Web Dev)/Project/project/wp-includes/js/dist/development/react-refresh-runtime.min.js
Vendored
+68
File diff suppressed because one or more lines are too long
@@ -0,0 +1,43 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "default": () => (/* binding */ domReady)
|
||||
/* harmony export */ });
|
||||
function domReady(callback) {
|
||||
if (typeof document === "undefined") {
|
||||
return;
|
||||
}
|
||||
if (document.readyState === "complete" || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
|
||||
document.readyState === "interactive") {
|
||||
return void callback();
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", callback);
|
||||
}
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).domReady = __webpack_exports__["default"];
|
||||
/******/ })()
|
||||
;
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={d:(t,d)=>{for(var o in d)e.o(d,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:d[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};function d(e){"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e())}e.d(t,{default:()=>d}),(window.wp=window.wp||{}).domReady=t.default})();
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4166
File diff suppressed because it is too large
Load Diff
+2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,87 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
escapeAmpersand: () => (/* binding */ escapeAmpersand),
|
||||
escapeAttribute: () => (/* binding */ escapeAttribute),
|
||||
escapeEditableHTML: () => (/* binding */ escapeEditableHTML),
|
||||
escapeHTML: () => (/* binding */ escapeHTML),
|
||||
escapeLessThan: () => (/* binding */ escapeLessThan),
|
||||
escapeQuotationMark: () => (/* binding */ escapeQuotationMark),
|
||||
isValidAttributeName: () => (/* binding */ isValidAttributeName)
|
||||
});
|
||||
|
||||
;// ./node_modules/@wordpress/escape-html/build-module/escape-greater.js
|
||||
function __unstableEscapeGreaterThan(value) {
|
||||
return value.replace(/>/g, ">");
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/escape-html/build-module/index.js
|
||||
|
||||
const REGEXP_INVALID_ATTRIBUTE_NAME = /[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;
|
||||
function escapeAmpersand(value) {
|
||||
return value.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi, "&");
|
||||
}
|
||||
function escapeQuotationMark(value) {
|
||||
return value.replace(/"/g, """);
|
||||
}
|
||||
function escapeLessThan(value) {
|
||||
return value.replace(/</g, "<");
|
||||
}
|
||||
function escapeAttribute(value) {
|
||||
return __unstableEscapeGreaterThan(
|
||||
escapeQuotationMark(escapeAmpersand(value))
|
||||
);
|
||||
}
|
||||
function escapeHTML(value) {
|
||||
return escapeLessThan(escapeAmpersand(value));
|
||||
}
|
||||
function escapeEditableHTML(value) {
|
||||
return escapeLessThan(value.replace(/&/g, "&"));
|
||||
}
|
||||
function isValidAttributeName(name) {
|
||||
return !REGEXP_INVALID_ATTRIBUTE_NAME.test(name);
|
||||
}
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).escapeHtml = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{escapeAmpersand:()=>n,escapeAttribute:()=>u,escapeEditableHTML:()=>i,escapeHTML:()=>c,escapeLessThan:()=>o,escapeQuotationMark:()=>a,isValidAttributeName:()=>p});const r=/[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;function n(e){return e.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi,"&")}function a(e){return e.replace(/"/g,""")}function o(e){return e.replace(/</g,"<")}function u(e){return function(e){return e.replace(/>/g,">")}(a(n(e)))}function c(e){return o(n(e))}function i(e){return o(e.replace(/&/g,"&"))}function p(e){return!r.test(e)}(window.wp=window.wp||{}).escapeHtml=t})();
|
||||
+2062
File diff suppressed because it is too large
Load Diff
+2
File diff suppressed because one or more lines are too long
@@ -0,0 +1,479 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ 507:
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
A: () => (/* binding */ createHooks_default)
|
||||
});
|
||||
|
||||
// UNUSED EXPORTS: _Hooks
|
||||
|
||||
;// ./node_modules/@wordpress/hooks/build-module/validateNamespace.js
|
||||
function validateNamespace(namespace) {
|
||||
if ("string" !== typeof namespace || "" === namespace) {
|
||||
console.error("The namespace must be a non-empty string.");
|
||||
return false;
|
||||
}
|
||||
if (!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(namespace)) {
|
||||
console.error(
|
||||
"The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."
|
||||
);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
var validateNamespace_default = validateNamespace;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/hooks/build-module/validateHookName.js
|
||||
function validateHookName(hookName) {
|
||||
if ("string" !== typeof hookName || "" === hookName) {
|
||||
console.error("The hook name must be a non-empty string.");
|
||||
return false;
|
||||
}
|
||||
if (/^__/.test(hookName)) {
|
||||
console.error("The hook name cannot begin with `__`.");
|
||||
return false;
|
||||
}
|
||||
if (!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(hookName)) {
|
||||
console.error(
|
||||
"The hook name can only contain numbers, letters, dashes, periods and underscores."
|
||||
);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
var validateHookName_default = validateHookName;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/hooks/build-module/createAddHook.js
|
||||
|
||||
|
||||
function createAddHook(hooks, storeKey) {
|
||||
return function addHook(hookName, namespace, callback, priority = 10) {
|
||||
const hooksStore = hooks[storeKey];
|
||||
if (!validateHookName_default(hookName)) {
|
||||
return;
|
||||
}
|
||||
if (!validateNamespace_default(namespace)) {
|
||||
return;
|
||||
}
|
||||
if ("function" !== typeof callback) {
|
||||
console.error("The hook callback must be a function.");
|
||||
return;
|
||||
}
|
||||
if ("number" !== typeof priority) {
|
||||
console.error(
|
||||
"If specified, the hook priority must be a number."
|
||||
);
|
||||
return;
|
||||
}
|
||||
const handler = { callback, priority, namespace };
|
||||
if (hooksStore[hookName]) {
|
||||
const handlers = hooksStore[hookName].handlers;
|
||||
let i;
|
||||
for (i = handlers.length; i > 0; i--) {
|
||||
if (priority >= handlers[i - 1].priority) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i === handlers.length) {
|
||||
handlers[i] = handler;
|
||||
} else {
|
||||
handlers.splice(i, 0, handler);
|
||||
}
|
||||
hooksStore.__current.forEach((hookInfo) => {
|
||||
if (hookInfo.name === hookName && hookInfo.currentIndex >= i) {
|
||||
hookInfo.currentIndex++;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
hooksStore[hookName] = {
|
||||
handlers: [handler],
|
||||
runs: 0
|
||||
};
|
||||
}
|
||||
if (hookName !== "hookAdded") {
|
||||
hooks.doAction(
|
||||
"hookAdded",
|
||||
hookName,
|
||||
namespace,
|
||||
callback,
|
||||
priority
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
var createAddHook_default = createAddHook;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/hooks/build-module/createRemoveHook.js
|
||||
|
||||
|
||||
function createRemoveHook(hooks, storeKey, removeAll = false) {
|
||||
return function removeHook(hookName, namespace) {
|
||||
const hooksStore = hooks[storeKey];
|
||||
if (!validateHookName_default(hookName)) {
|
||||
return;
|
||||
}
|
||||
if (!removeAll && !validateNamespace_default(namespace)) {
|
||||
return;
|
||||
}
|
||||
if (!hooksStore[hookName]) {
|
||||
return 0;
|
||||
}
|
||||
let handlersRemoved = 0;
|
||||
if (removeAll) {
|
||||
handlersRemoved = hooksStore[hookName].handlers.length;
|
||||
hooksStore[hookName] = {
|
||||
runs: hooksStore[hookName].runs,
|
||||
handlers: []
|
||||
};
|
||||
} else {
|
||||
const handlers = hooksStore[hookName].handlers;
|
||||
for (let i = handlers.length - 1; i >= 0; i--) {
|
||||
if (handlers[i].namespace === namespace) {
|
||||
handlers.splice(i, 1);
|
||||
handlersRemoved++;
|
||||
hooksStore.__current.forEach((hookInfo) => {
|
||||
if (hookInfo.name === hookName && hookInfo.currentIndex >= i) {
|
||||
hookInfo.currentIndex--;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hookName !== "hookRemoved") {
|
||||
hooks.doAction("hookRemoved", hookName, namespace);
|
||||
}
|
||||
return handlersRemoved;
|
||||
};
|
||||
}
|
||||
var createRemoveHook_default = createRemoveHook;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/hooks/build-module/createHasHook.js
|
||||
function createHasHook(hooks, storeKey) {
|
||||
return function hasHook(hookName, namespace) {
|
||||
const hooksStore = hooks[storeKey];
|
||||
if ("undefined" !== typeof namespace) {
|
||||
return hookName in hooksStore && hooksStore[hookName].handlers.some(
|
||||
(hook) => hook.namespace === namespace
|
||||
);
|
||||
}
|
||||
return hookName in hooksStore;
|
||||
};
|
||||
}
|
||||
var createHasHook_default = createHasHook;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/hooks/build-module/createRunHook.js
|
||||
function createRunHook(hooks, storeKey, returnFirstArg, async) {
|
||||
return function runHook(hookName, ...args) {
|
||||
const hooksStore = hooks[storeKey];
|
||||
if (!hooksStore[hookName]) {
|
||||
hooksStore[hookName] = {
|
||||
handlers: [],
|
||||
runs: 0
|
||||
};
|
||||
}
|
||||
hooksStore[hookName].runs++;
|
||||
const handlers = hooksStore[hookName].handlers;
|
||||
if (false) {}
|
||||
if (!handlers || !handlers.length) {
|
||||
return returnFirstArg ? args[0] : void 0;
|
||||
}
|
||||
const hookInfo = {
|
||||
name: hookName,
|
||||
currentIndex: 0
|
||||
};
|
||||
async function asyncRunner() {
|
||||
try {
|
||||
hooksStore.__current.add(hookInfo);
|
||||
let result = returnFirstArg ? args[0] : void 0;
|
||||
while (hookInfo.currentIndex < handlers.length) {
|
||||
const handler = handlers[hookInfo.currentIndex];
|
||||
result = await handler.callback.apply(null, args);
|
||||
if (returnFirstArg) {
|
||||
args[0] = result;
|
||||
}
|
||||
hookInfo.currentIndex++;
|
||||
}
|
||||
return returnFirstArg ? result : void 0;
|
||||
} finally {
|
||||
hooksStore.__current.delete(hookInfo);
|
||||
}
|
||||
}
|
||||
function syncRunner() {
|
||||
try {
|
||||
hooksStore.__current.add(hookInfo);
|
||||
let result = returnFirstArg ? args[0] : void 0;
|
||||
while (hookInfo.currentIndex < handlers.length) {
|
||||
const handler = handlers[hookInfo.currentIndex];
|
||||
result = handler.callback.apply(null, args);
|
||||
if (returnFirstArg) {
|
||||
args[0] = result;
|
||||
}
|
||||
hookInfo.currentIndex++;
|
||||
}
|
||||
return returnFirstArg ? result : void 0;
|
||||
} finally {
|
||||
hooksStore.__current.delete(hookInfo);
|
||||
}
|
||||
}
|
||||
return (async ? asyncRunner : syncRunner)();
|
||||
};
|
||||
}
|
||||
var createRunHook_default = createRunHook;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/hooks/build-module/createCurrentHook.js
|
||||
function createCurrentHook(hooks, storeKey) {
|
||||
return function currentHook() {
|
||||
const hooksStore = hooks[storeKey];
|
||||
const currentArray = Array.from(hooksStore.__current);
|
||||
return currentArray.at(-1)?.name ?? null;
|
||||
};
|
||||
}
|
||||
var createCurrentHook_default = createCurrentHook;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/hooks/build-module/createDoingHook.js
|
||||
function createDoingHook(hooks, storeKey) {
|
||||
return function doingHook(hookName) {
|
||||
const hooksStore = hooks[storeKey];
|
||||
if ("undefined" === typeof hookName) {
|
||||
return hooksStore.__current.size > 0;
|
||||
}
|
||||
return Array.from(hooksStore.__current).some(
|
||||
(hook) => hook.name === hookName
|
||||
);
|
||||
};
|
||||
}
|
||||
var createDoingHook_default = createDoingHook;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/hooks/build-module/createDidHook.js
|
||||
|
||||
function createDidHook(hooks, storeKey) {
|
||||
return function didHook(hookName) {
|
||||
const hooksStore = hooks[storeKey];
|
||||
if (!validateHookName_default(hookName)) {
|
||||
return;
|
||||
}
|
||||
return hooksStore[hookName] && hooksStore[hookName].runs ? hooksStore[hookName].runs : 0;
|
||||
};
|
||||
}
|
||||
var createDidHook_default = createDidHook;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/hooks/build-module/createHooks.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class _Hooks {
|
||||
actions;
|
||||
filters;
|
||||
addAction;
|
||||
addFilter;
|
||||
removeAction;
|
||||
removeFilter;
|
||||
hasAction;
|
||||
hasFilter;
|
||||
removeAllActions;
|
||||
removeAllFilters;
|
||||
doAction;
|
||||
doActionAsync;
|
||||
applyFilters;
|
||||
applyFiltersAsync;
|
||||
currentAction;
|
||||
currentFilter;
|
||||
doingAction;
|
||||
doingFilter;
|
||||
didAction;
|
||||
didFilter;
|
||||
constructor() {
|
||||
this.actions = /* @__PURE__ */ Object.create(null);
|
||||
this.actions.__current = /* @__PURE__ */ new Set();
|
||||
this.filters = /* @__PURE__ */ Object.create(null);
|
||||
this.filters.__current = /* @__PURE__ */ new Set();
|
||||
this.addAction = createAddHook_default(this, "actions");
|
||||
this.addFilter = createAddHook_default(this, "filters");
|
||||
this.removeAction = createRemoveHook_default(this, "actions");
|
||||
this.removeFilter = createRemoveHook_default(this, "filters");
|
||||
this.hasAction = createHasHook_default(this, "actions");
|
||||
this.hasFilter = createHasHook_default(this, "filters");
|
||||
this.removeAllActions = createRemoveHook_default(this, "actions", true);
|
||||
this.removeAllFilters = createRemoveHook_default(this, "filters", true);
|
||||
this.doAction = createRunHook_default(this, "actions", false, false);
|
||||
this.doActionAsync = createRunHook_default(this, "actions", false, true);
|
||||
this.applyFilters = createRunHook_default(this, "filters", true, false);
|
||||
this.applyFiltersAsync = createRunHook_default(this, "filters", true, true);
|
||||
this.currentAction = createCurrentHook_default(this, "actions");
|
||||
this.currentFilter = createCurrentHook_default(this, "filters");
|
||||
this.doingAction = createDoingHook_default(this, "actions");
|
||||
this.doingFilter = createDoingHook_default(this, "filters");
|
||||
this.didAction = createDidHook_default(this, "actions");
|
||||
this.didFilter = createDidHook_default(this, "filters");
|
||||
}
|
||||
}
|
||||
function createHooks() {
|
||||
return new _Hooks();
|
||||
}
|
||||
var createHooks_default = createHooks;
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8770:
|
||||
/***/ (() => {
|
||||
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The module cache
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||
/******/ if (cachedModule !== undefined) {
|
||||
/******/ return cachedModule.exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
/******/ // no module.loaded needed
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat get default export */
|
||||
/******/ (() => {
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = (module) => {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ () => (module['default']) :
|
||||
/******/ () => (module);
|
||||
/******/ __webpack_require__.d(getter, { a: getter });
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
|
||||
(() => {
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ actions: () => (/* binding */ actions),
|
||||
/* harmony export */ addAction: () => (/* binding */ addAction),
|
||||
/* harmony export */ addFilter: () => (/* binding */ addFilter),
|
||||
/* harmony export */ applyFilters: () => (/* binding */ applyFilters),
|
||||
/* harmony export */ applyFiltersAsync: () => (/* binding */ applyFiltersAsync),
|
||||
/* harmony export */ createHooks: () => (/* reexport safe */ _createHooks__WEBPACK_IMPORTED_MODULE_1__.A),
|
||||
/* harmony export */ currentAction: () => (/* binding */ currentAction),
|
||||
/* harmony export */ currentFilter: () => (/* binding */ currentFilter),
|
||||
/* harmony export */ defaultHooks: () => (/* binding */ defaultHooks),
|
||||
/* harmony export */ didAction: () => (/* binding */ didAction),
|
||||
/* harmony export */ didFilter: () => (/* binding */ didFilter),
|
||||
/* harmony export */ doAction: () => (/* binding */ doAction),
|
||||
/* harmony export */ doActionAsync: () => (/* binding */ doActionAsync),
|
||||
/* harmony export */ doingAction: () => (/* binding */ doingAction),
|
||||
/* harmony export */ doingFilter: () => (/* binding */ doingFilter),
|
||||
/* harmony export */ filters: () => (/* binding */ filters),
|
||||
/* harmony export */ hasAction: () => (/* binding */ hasAction),
|
||||
/* harmony export */ hasFilter: () => (/* binding */ hasFilter),
|
||||
/* harmony export */ removeAction: () => (/* binding */ removeAction),
|
||||
/* harmony export */ removeAllActions: () => (/* binding */ removeAllActions),
|
||||
/* harmony export */ removeAllFilters: () => (/* binding */ removeAllFilters),
|
||||
/* harmony export */ removeFilter: () => (/* binding */ removeFilter)
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _createHooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(507);
|
||||
/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8770);
|
||||
/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
||||
/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _types__WEBPACK_IMPORTED_MODULE_0__) if(["default","actions","addAction","addFilter","applyFilters","applyFiltersAsync","createHooks","currentAction","currentFilter","defaultHooks","didAction","didFilter","doAction","doActionAsync","doingAction","doingFilter","filters","hasAction","hasFilter","removeAction","removeAllActions","removeAllFilters","removeFilter"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _types__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]
|
||||
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
||||
|
||||
|
||||
const defaultHooks = (0,_createHooks__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)();
|
||||
const {
|
||||
addAction,
|
||||
addFilter,
|
||||
removeAction,
|
||||
removeFilter,
|
||||
hasAction,
|
||||
hasFilter,
|
||||
removeAllActions,
|
||||
removeAllFilters,
|
||||
doAction,
|
||||
doActionAsync,
|
||||
applyFilters,
|
||||
applyFiltersAsync,
|
||||
currentAction,
|
||||
currentFilter,
|
||||
doingAction,
|
||||
doingFilter,
|
||||
didAction,
|
||||
didFilter,
|
||||
actions,
|
||||
filters
|
||||
} = defaultHooks;
|
||||
|
||||
|
||||
})();
|
||||
|
||||
(window.wp = window.wp || {}).hooks = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,62 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ decodeEntities: () => (/* binding */ decodeEntities)
|
||||
/* harmony export */ });
|
||||
let _decodeTextArea;
|
||||
function decodeEntities(html) {
|
||||
if ("string" !== typeof html || -1 === html.indexOf("&")) {
|
||||
return html;
|
||||
}
|
||||
if (void 0 === _decodeTextArea) {
|
||||
if (document.implementation && document.implementation.createHTMLDocument) {
|
||||
_decodeTextArea = document.implementation.createHTMLDocument("").createElement("textarea");
|
||||
} else {
|
||||
_decodeTextArea = document.createElement("textarea");
|
||||
}
|
||||
}
|
||||
_decodeTextArea.innerHTML = html;
|
||||
const decoded = _decodeTextArea.textContent ?? "";
|
||||
_decodeTextArea.innerHTML = "";
|
||||
return decoded;
|
||||
}
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).htmlEntities = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};let n;function o(e){if("string"!=typeof e||-1===e.indexOf("&"))return e;void 0===n&&(n=document.implementation&&document.implementation.createHTMLDocument?document.implementation.createHTMLDocument("").createElement("textarea"):document.createElement("textarea")),n.innerHTML=e;const t=n.textContent??"";return n.innerHTML="",t}e.r(t),e.d(t,{decodeEntities:()=>o}),(window.wp=window.wp||{}).htmlEntities=t})();
|
||||
@@ -0,0 +1,992 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
__: () => (/* reexport */ __),
|
||||
_n: () => (/* reexport */ _n),
|
||||
_nx: () => (/* reexport */ _nx),
|
||||
_x: () => (/* reexport */ _x),
|
||||
createI18n: () => (/* reexport */ createI18n),
|
||||
defaultI18n: () => (/* reexport */ default_i18n_default),
|
||||
getLocaleData: () => (/* reexport */ getLocaleData),
|
||||
hasTranslation: () => (/* reexport */ hasTranslation),
|
||||
isRTL: () => (/* reexport */ isRTL),
|
||||
resetLocaleData: () => (/* reexport */ resetLocaleData),
|
||||
setLocaleData: () => (/* reexport */ setLocaleData),
|
||||
sprintf: () => (/* reexport */ sprintf_sprintf),
|
||||
subscribe: () => (/* reexport */ subscribe)
|
||||
});
|
||||
|
||||
;// ./node_modules/@tannin/sprintf/src/index.js
|
||||
/**
|
||||
* Regular expression matching format placeholder syntax.
|
||||
*
|
||||
* The pattern for matching named arguments is a naive and incomplete matcher
|
||||
* against valid JavaScript identifier names.
|
||||
*
|
||||
* via Mathias Bynens:
|
||||
*
|
||||
* >An identifier must start with $, _, or any character in the Unicode
|
||||
* >categories “Uppercase letter (Lu)”, “Lowercase letter (Ll)”, “Titlecase
|
||||
* >letter (Lt)”, “Modifier letter (Lm)”, “Other letter (Lo)”, or “Letter
|
||||
* >number (Nl)”.
|
||||
* >
|
||||
* >The rest of the string can contain the same characters, plus any U+200C zero
|
||||
* >width non-joiner characters, U+200D zero width joiner characters, and
|
||||
* >characters in the Unicode categories “Non-spacing mark (Mn)”, “Spacing
|
||||
* >combining mark (Mc)”, “Decimal digit number (Nd)”, or “Connector
|
||||
* >punctuation (Pc)”.
|
||||
*
|
||||
* If browser support is constrained to those supporting ES2015, this could be
|
||||
* made more accurate using the `u` flag:
|
||||
*
|
||||
* ```
|
||||
* /^[$_\p{L}\p{Nl}][$_\p{L}\p{Nl}\u200C\u200D\p{Mn}\p{Mc}\p{Nd}\p{Pc}]*$/u;
|
||||
* ```
|
||||
*
|
||||
* @see http://www.pixelbeat.org/programming/gcc/format_specs.html
|
||||
* @see https://mathiasbynens.be/notes/javascript-identifiers#valid-identifier-names
|
||||
*
|
||||
* @type {RegExp}
|
||||
*/
|
||||
var PATTERN =
|
||||
/%(((\d+)\$)|(\(([$_a-zA-Z][$_a-zA-Z0-9]*)\)))?[ +0#-]*\d*(\.(\d+|\*))?(ll|[lhqL])?([cduxXefgsp%])/g;
|
||||
// ▲ ▲ ▲ ▲ ▲ ▲ ▲ type
|
||||
// │ │ │ │ │ └ Length (unsupported)
|
||||
// │ │ │ │ └ Precision / max width
|
||||
// │ │ │ └ Min width (unsupported)
|
||||
// │ │ └ Flags (unsupported)
|
||||
// └ Index └ Name (for named arguments)
|
||||
/**
|
||||
* Given a format string, returns string with arguments interpolatation.
|
||||
* Arguments can either be provided directly via function arguments spread, or
|
||||
* with an array as the second argument.
|
||||
*
|
||||
* @see https://en.wikipedia.org/wiki/Printf_format_string
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* import sprintf from '@tannin/sprintf';
|
||||
*
|
||||
* sprintf( 'Hello %s!', 'world' );
|
||||
* // ⇒ 'Hello world!'
|
||||
* ```
|
||||
* @template {string} T
|
||||
* @overload
|
||||
* @param {T} string - string printf format string
|
||||
* @param {...import('../types').SprintfArgs<T>} args - arguments to interpolate
|
||||
*
|
||||
* @return {string} Formatted string.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Given a format string, returns string with arguments interpolatation.
|
||||
* Arguments can either be provided directly via function arguments spread, or
|
||||
* with an array as the second argument.
|
||||
*
|
||||
* @see https://en.wikipedia.org/wiki/Printf_format_string
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* import sprintf from '@tannin/sprintf';
|
||||
*
|
||||
* sprintf( 'Hello %s!', 'world' );
|
||||
* // ⇒ 'Hello world!'
|
||||
* ```
|
||||
* @template {string} T
|
||||
* @overload
|
||||
* @param {T} string - string printf format string
|
||||
* @param {import('../types').SprintfArgs<T>} args - arguments to interpolate
|
||||
*
|
||||
* @return {string} Formatted string.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Given a format string, returns string with arguments interpolatation.
|
||||
* Arguments can either be provided directly via function arguments spread, or
|
||||
* with an array as the second argument.
|
||||
*
|
||||
* @see https://en.wikipedia.org/wiki/Printf_format_string
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* import sprintf from '@tannin/sprintf';
|
||||
*
|
||||
* sprintf( 'Hello %s!', 'world' );
|
||||
* // ⇒ 'Hello world!'
|
||||
* ```
|
||||
* @template {string} T
|
||||
* @param {T} string - string printf format string
|
||||
* @param {...import('../types').SprintfArgs<T>} args - arguments to interpolate
|
||||
*
|
||||
* @return {string} Formatted string.
|
||||
*/
|
||||
function sprintf(string, ...args) {
|
||||
var i = 0;
|
||||
if (Array.isArray(args[0])) {
|
||||
args = /** @type {import('../types').SprintfArgs<T>[]} */ (
|
||||
/** @type {unknown} */ args[0]
|
||||
);
|
||||
}
|
||||
|
||||
return string.replace(PATTERN, function () {
|
||||
var index,
|
||||
// name needs to be documented as `string | undefined` else value will have tpye unknown.
|
||||
/**
|
||||
* Name of the argument to substitute, if any.
|
||||
*
|
||||
* @type {string | undefined}
|
||||
*/
|
||||
name,
|
||||
precision,
|
||||
type,
|
||||
value;
|
||||
|
||||
index = arguments[3];
|
||||
name = arguments[5];
|
||||
precision = arguments[7];
|
||||
type = arguments[9];
|
||||
|
||||
// There's no placeholder substitution in the explicit "%", meaning it
|
||||
// is not necessary to increment argument index.
|
||||
if (type === '%') {
|
||||
return '%';
|
||||
}
|
||||
|
||||
// Asterisk precision determined by peeking / shifting next argument.
|
||||
if (precision === '*') {
|
||||
precision = args[i];
|
||||
i++;
|
||||
}
|
||||
|
||||
if (name === undefined) {
|
||||
// If not a positional argument, use counter value.
|
||||
if (index === undefined) {
|
||||
index = i + 1;
|
||||
}
|
||||
|
||||
i++;
|
||||
|
||||
// Positional argument.
|
||||
value = args[index - 1];
|
||||
} else if (
|
||||
args[0] &&
|
||||
typeof args[0] === 'object' &&
|
||||
args[0].hasOwnProperty(name)
|
||||
) {
|
||||
// If it's a named argument, use name.
|
||||
value = args[0][name];
|
||||
}
|
||||
|
||||
// Parse as type.
|
||||
if (type === 'f') {
|
||||
value = parseFloat(value) || 0;
|
||||
} else if (type === 'd') {
|
||||
value = parseInt(value) || 0;
|
||||
}
|
||||
|
||||
// Apply precision.
|
||||
if (precision !== undefined) {
|
||||
if (type === 'f') {
|
||||
value = value.toFixed(precision);
|
||||
} else if (type === 's') {
|
||||
value = value.substr(0, precision);
|
||||
}
|
||||
}
|
||||
|
||||
// To avoid "undefined" concatenation, return empty string if no
|
||||
// placeholder substitution can be performed.
|
||||
return value !== undefined && value !== null ? value : '';
|
||||
});
|
||||
}
|
||||
|
||||
;// ./node_modules/@wordpress/i18n/build-module/sprintf.js
|
||||
|
||||
function sprintf_sprintf(format, ...args) {
|
||||
return sprintf(format, ...args);
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@tannin/postfix/index.js
|
||||
var PRECEDENCE, OPENERS, TERMINATORS, postfix_PATTERN;
|
||||
|
||||
/**
|
||||
* Operator precedence mapping.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
PRECEDENCE = {
|
||||
'(': 9,
|
||||
'!': 8,
|
||||
'*': 7,
|
||||
'/': 7,
|
||||
'%': 7,
|
||||
'+': 6,
|
||||
'-': 6,
|
||||
'<': 5,
|
||||
'<=': 5,
|
||||
'>': 5,
|
||||
'>=': 5,
|
||||
'==': 4,
|
||||
'!=': 4,
|
||||
'&&': 3,
|
||||
'||': 2,
|
||||
'?': 1,
|
||||
'?:': 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* Characters which signal pair opening, to be terminated by terminators.
|
||||
*
|
||||
* @type {string[]}
|
||||
*/
|
||||
OPENERS = [ '(', '?' ];
|
||||
|
||||
/**
|
||||
* Characters which signal pair termination, the value an array with the
|
||||
* opener as its first member. The second member is an optional operator
|
||||
* replacement to push to the stack.
|
||||
*
|
||||
* @type {string[]}
|
||||
*/
|
||||
TERMINATORS = {
|
||||
')': [ '(' ],
|
||||
':': [ '?', '?:' ],
|
||||
};
|
||||
|
||||
/**
|
||||
* Pattern matching operators and openers.
|
||||
*
|
||||
* @type {RegExp}
|
||||
*/
|
||||
postfix_PATTERN = /<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;
|
||||
|
||||
/**
|
||||
* Given a C expression, returns the equivalent postfix (Reverse Polish)
|
||||
* notation terms as an array.
|
||||
*
|
||||
* If a postfix string is desired, simply `.join( ' ' )` the result.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* import postfix from '@tannin/postfix';
|
||||
*
|
||||
* postfix( 'n > 1' );
|
||||
* // ⇒ [ 'n', '1', '>' ]
|
||||
* ```
|
||||
*
|
||||
* @param {string} expression C expression.
|
||||
*
|
||||
* @return {string[]} Postfix terms.
|
||||
*/
|
||||
function postfix( expression ) {
|
||||
var terms = [],
|
||||
stack = [],
|
||||
match, operator, term, element;
|
||||
|
||||
while ( ( match = expression.match( postfix_PATTERN ) ) ) {
|
||||
operator = match[ 0 ];
|
||||
|
||||
// Term is the string preceding the operator match. It may contain
|
||||
// whitespace, and may be empty (if operator is at beginning).
|
||||
term = expression.substr( 0, match.index ).trim();
|
||||
if ( term ) {
|
||||
terms.push( term );
|
||||
}
|
||||
|
||||
while ( ( element = stack.pop() ) ) {
|
||||
if ( TERMINATORS[ operator ] ) {
|
||||
if ( TERMINATORS[ operator ][ 0 ] === element ) {
|
||||
// Substitution works here under assumption that because
|
||||
// the assigned operator will no longer be a terminator, it
|
||||
// will be pushed to the stack during the condition below.
|
||||
operator = TERMINATORS[ operator ][ 1 ] || operator;
|
||||
break;
|
||||
}
|
||||
} else if ( OPENERS.indexOf( element ) >= 0 || PRECEDENCE[ element ] < PRECEDENCE[ operator ] ) {
|
||||
// Push to stack if either an opener or when pop reveals an
|
||||
// element of lower precedence.
|
||||
stack.push( element );
|
||||
break;
|
||||
}
|
||||
|
||||
// For each popped from stack, push to terms.
|
||||
terms.push( element );
|
||||
}
|
||||
|
||||
if ( ! TERMINATORS[ operator ] ) {
|
||||
stack.push( operator );
|
||||
}
|
||||
|
||||
// Slice matched fragment from expression to continue match.
|
||||
expression = expression.substr( match.index + operator.length );
|
||||
}
|
||||
|
||||
// Push remainder of operand, if exists, to terms.
|
||||
expression = expression.trim();
|
||||
if ( expression ) {
|
||||
terms.push( expression );
|
||||
}
|
||||
|
||||
// Pop remaining items from stack into terms.
|
||||
return terms.concat( stack.reverse() );
|
||||
}
|
||||
|
||||
;// ./node_modules/@tannin/evaluate/index.js
|
||||
/**
|
||||
* Operator callback functions.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
var OPERATORS = {
|
||||
'!': function( a ) {
|
||||
return ! a;
|
||||
},
|
||||
'*': function( a, b ) {
|
||||
return a * b;
|
||||
},
|
||||
'/': function( a, b ) {
|
||||
return a / b;
|
||||
},
|
||||
'%': function( a, b ) {
|
||||
return a % b;
|
||||
},
|
||||
'+': function( a, b ) {
|
||||
return a + b;
|
||||
},
|
||||
'-': function( a, b ) {
|
||||
return a - b;
|
||||
},
|
||||
'<': function( a, b ) {
|
||||
return a < b;
|
||||
},
|
||||
'<=': function( a, b ) {
|
||||
return a <= b;
|
||||
},
|
||||
'>': function( a, b ) {
|
||||
return a > b;
|
||||
},
|
||||
'>=': function( a, b ) {
|
||||
return a >= b;
|
||||
},
|
||||
'==': function( a, b ) {
|
||||
return a === b;
|
||||
},
|
||||
'!=': function( a, b ) {
|
||||
return a !== b;
|
||||
},
|
||||
'&&': function( a, b ) {
|
||||
return a && b;
|
||||
},
|
||||
'||': function( a, b ) {
|
||||
return a || b;
|
||||
},
|
||||
'?:': function( a, b, c ) {
|
||||
if ( a ) {
|
||||
throw b;
|
||||
}
|
||||
|
||||
return c;
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Given an array of postfix terms and operand variables, returns the result of
|
||||
* the postfix evaluation.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* import evaluate from '@tannin/evaluate';
|
||||
*
|
||||
* // 3 + 4 * 5 / 6 ⇒ '3 4 5 * 6 / +'
|
||||
* const terms = [ '3', '4', '5', '*', '6', '/', '+' ];
|
||||
*
|
||||
* evaluate( terms, {} );
|
||||
* // ⇒ 6.333333333333334
|
||||
* ```
|
||||
*
|
||||
* @param {string[]} postfix Postfix terms.
|
||||
* @param {Object} variables Operand variables.
|
||||
*
|
||||
* @return {*} Result of evaluation.
|
||||
*/
|
||||
function evaluate( postfix, variables ) {
|
||||
var stack = [],
|
||||
i, j, args, getOperatorResult, term, value;
|
||||
|
||||
for ( i = 0; i < postfix.length; i++ ) {
|
||||
term = postfix[ i ];
|
||||
|
||||
getOperatorResult = OPERATORS[ term ];
|
||||
if ( getOperatorResult ) {
|
||||
// Pop from stack by number of function arguments.
|
||||
j = getOperatorResult.length;
|
||||
args = Array( j );
|
||||
while ( j-- ) {
|
||||
args[ j ] = stack.pop();
|
||||
}
|
||||
|
||||
try {
|
||||
value = getOperatorResult.apply( null, args );
|
||||
} catch ( earlyReturn ) {
|
||||
return earlyReturn;
|
||||
}
|
||||
} else if ( variables.hasOwnProperty( term ) ) {
|
||||
value = variables[ term ];
|
||||
} else {
|
||||
value = +term;
|
||||
}
|
||||
|
||||
stack.push( value );
|
||||
}
|
||||
|
||||
return stack[ 0 ];
|
||||
}
|
||||
|
||||
;// ./node_modules/@tannin/compile/index.js
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Given a C expression, returns a function which can be called to evaluate its
|
||||
* result.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* import compile from '@tannin/compile';
|
||||
*
|
||||
* const evaluate = compile( 'n > 1' );
|
||||
*
|
||||
* evaluate( { n: 2 } );
|
||||
* // ⇒ true
|
||||
* ```
|
||||
*
|
||||
* @param {string} expression C expression.
|
||||
*
|
||||
* @return {(variables?:{[variable:string]:*})=>*} Compiled evaluator.
|
||||
*/
|
||||
function compile( expression ) {
|
||||
var terms = postfix( expression );
|
||||
|
||||
return function( variables ) {
|
||||
return evaluate( terms, variables );
|
||||
};
|
||||
}
|
||||
|
||||
;// ./node_modules/@tannin/plural-forms/index.js
|
||||
|
||||
|
||||
/**
|
||||
* Given a C expression, returns a function which, when called with a value,
|
||||
* evaluates the result with the value assumed to be the "n" variable of the
|
||||
* expression. The result will be coerced to its numeric equivalent.
|
||||
*
|
||||
* @param {string} expression C expression.
|
||||
*
|
||||
* @return {Function} Evaluator function.
|
||||
*/
|
||||
function pluralForms( expression ) {
|
||||
var evaluate = compile( expression );
|
||||
|
||||
return function( n ) {
|
||||
return +evaluate( { n: n } );
|
||||
};
|
||||
}
|
||||
|
||||
;// ./node_modules/tannin/index.js
|
||||
|
||||
|
||||
/**
|
||||
* Tannin constructor options.
|
||||
*
|
||||
* @typedef {Object} TanninOptions
|
||||
*
|
||||
* @property {string} [contextDelimiter] Joiner in string lookup with context.
|
||||
* @property {Function} [onMissingKey] Callback to invoke when key missing.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Domain metadata.
|
||||
*
|
||||
* @typedef {Object} TanninDomainMetadata
|
||||
*
|
||||
* @property {string} [domain] Domain name.
|
||||
* @property {string} [lang] Language code.
|
||||
* @property {(string|Function)} [plural_forms] Plural forms expression or
|
||||
* function evaluator.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Domain translation pair respectively representing the singular and plural
|
||||
* translation.
|
||||
*
|
||||
* @typedef {[string,string]} TanninTranslation
|
||||
*/
|
||||
|
||||
/**
|
||||
* Locale data domain. The key is used as reference for lookup, the value an
|
||||
* array of two string entries respectively representing the singular and plural
|
||||
* translation.
|
||||
*
|
||||
* @typedef {{[key:string]:TanninDomainMetadata|TanninTranslation,'':TanninDomainMetadata|TanninTranslation}} TanninLocaleDomain
|
||||
*/
|
||||
|
||||
/**
|
||||
* Jed-formatted locale data.
|
||||
*
|
||||
* @see http://messageformat.github.io/Jed/
|
||||
*
|
||||
* @typedef {{[domain:string]:TanninLocaleDomain}} TanninLocaleData
|
||||
*/
|
||||
|
||||
/**
|
||||
* Default Tannin constructor options.
|
||||
*
|
||||
* @type {TanninOptions}
|
||||
*/
|
||||
var DEFAULT_OPTIONS = {
|
||||
contextDelimiter: '\u0004',
|
||||
onMissingKey: null,
|
||||
};
|
||||
|
||||
/**
|
||||
* Given a specific locale data's config `plural_forms` value, returns the
|
||||
* expression.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```
|
||||
* getPluralExpression( 'nplurals=2; plural=(n != 1);' ) === '(n != 1)'
|
||||
* ```
|
||||
*
|
||||
* @param {string} pf Locale data plural forms.
|
||||
*
|
||||
* @return {string} Plural forms expression.
|
||||
*/
|
||||
function getPluralExpression( pf ) {
|
||||
var parts, i, part;
|
||||
|
||||
parts = pf.split( ';' );
|
||||
|
||||
for ( i = 0; i < parts.length; i++ ) {
|
||||
part = parts[ i ].trim();
|
||||
if ( part.indexOf( 'plural=' ) === 0 ) {
|
||||
return part.substr( 7 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tannin constructor.
|
||||
*
|
||||
* @class
|
||||
*
|
||||
* @param {TanninLocaleData} data Jed-formatted locale data.
|
||||
* @param {TanninOptions} [options] Tannin options.
|
||||
*/
|
||||
function Tannin( data, options ) {
|
||||
var key;
|
||||
|
||||
/**
|
||||
* Jed-formatted locale data.
|
||||
*
|
||||
* @name Tannin#data
|
||||
* @type {TanninLocaleData}
|
||||
*/
|
||||
this.data = data;
|
||||
|
||||
/**
|
||||
* Plural forms function cache, keyed by plural forms string.
|
||||
*
|
||||
* @name Tannin#pluralForms
|
||||
* @type {Object<string,Function>}
|
||||
*/
|
||||
this.pluralForms = {};
|
||||
|
||||
/**
|
||||
* Effective options for instance, including defaults.
|
||||
*
|
||||
* @name Tannin#options
|
||||
* @type {TanninOptions}
|
||||
*/
|
||||
this.options = {};
|
||||
|
||||
for ( key in DEFAULT_OPTIONS ) {
|
||||
this.options[ key ] = options !== undefined && key in options
|
||||
? options[ key ]
|
||||
: DEFAULT_OPTIONS[ key ];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the plural form index for the given domain and value.
|
||||
*
|
||||
* @param {string} domain Domain on which to calculate plural form.
|
||||
* @param {number} n Value for which plural form is to be calculated.
|
||||
*
|
||||
* @return {number} Plural form index.
|
||||
*/
|
||||
Tannin.prototype.getPluralForm = function( domain, n ) {
|
||||
var getPluralForm = this.pluralForms[ domain ],
|
||||
config, plural, pf;
|
||||
|
||||
if ( ! getPluralForm ) {
|
||||
config = this.data[ domain ][ '' ];
|
||||
|
||||
pf = (
|
||||
config[ 'Plural-Forms' ] ||
|
||||
config[ 'plural-forms' ] ||
|
||||
// Ignore reason: As known, there's no way to document the empty
|
||||
// string property on a key to guarantee this as metadata.
|
||||
// @ts-ignore
|
||||
config.plural_forms
|
||||
);
|
||||
|
||||
if ( typeof pf !== 'function' ) {
|
||||
plural = getPluralExpression(
|
||||
config[ 'Plural-Forms' ] ||
|
||||
config[ 'plural-forms' ] ||
|
||||
// Ignore reason: As known, there's no way to document the empty
|
||||
// string property on a key to guarantee this as metadata.
|
||||
// @ts-ignore
|
||||
config.plural_forms
|
||||
);
|
||||
|
||||
pf = pluralForms( plural );
|
||||
}
|
||||
|
||||
getPluralForm = this.pluralForms[ domain ] = pf;
|
||||
}
|
||||
|
||||
return getPluralForm( n );
|
||||
};
|
||||
|
||||
/**
|
||||
* Translate a string.
|
||||
*
|
||||
* @param {string} domain Translation domain.
|
||||
* @param {string|void} context Context distinguishing terms of the same name.
|
||||
* @param {string} singular Primary key for translation lookup.
|
||||
* @param {string=} plural Fallback value used for non-zero plural
|
||||
* form index.
|
||||
* @param {number=} n Value to use in calculating plural form.
|
||||
*
|
||||
* @return {string} Translated string.
|
||||
*/
|
||||
Tannin.prototype.dcnpgettext = function( domain, context, singular, plural, n ) {
|
||||
var index, key, entry;
|
||||
|
||||
if ( n === undefined ) {
|
||||
// Default to singular.
|
||||
index = 0;
|
||||
} else {
|
||||
// Find index by evaluating plural form for value.
|
||||
index = this.getPluralForm( domain, n );
|
||||
}
|
||||
|
||||
key = singular;
|
||||
|
||||
// If provided, context is prepended to key with delimiter.
|
||||
if ( context ) {
|
||||
key = context + this.options.contextDelimiter + singular;
|
||||
}
|
||||
|
||||
entry = this.data[ domain ][ key ];
|
||||
|
||||
// Verify not only that entry exists, but that the intended index is within
|
||||
// range and non-empty.
|
||||
if ( entry && entry[ index ] ) {
|
||||
return entry[ index ];
|
||||
}
|
||||
|
||||
if ( this.options.onMissingKey ) {
|
||||
this.options.onMissingKey( singular, domain );
|
||||
}
|
||||
|
||||
// If entry not found, fall back to singular vs. plural with zero index
|
||||
// representing the singular value.
|
||||
return index === 0 ? singular : plural;
|
||||
};
|
||||
|
||||
;// ./node_modules/@wordpress/i18n/build-module/create-i18n.js
|
||||
|
||||
const DEFAULT_LOCALE_DATA = {
|
||||
"": {
|
||||
plural_forms(n) {
|
||||
return n === 1 ? 0 : 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
const I18N_HOOK_REGEXP = /^i18n\.(n?gettext|has_translation)(_|$)/;
|
||||
const createI18n = (initialData, initialDomain, hooks) => {
|
||||
const tannin = new Tannin({});
|
||||
const listeners = /* @__PURE__ */ new Set();
|
||||
const notifyListeners = () => {
|
||||
listeners.forEach((listener) => listener());
|
||||
};
|
||||
const subscribe = (callback) => {
|
||||
listeners.add(callback);
|
||||
return () => listeners.delete(callback);
|
||||
};
|
||||
const getLocaleData = (domain = "default") => tannin.data[domain];
|
||||
const doSetLocaleData = (data, domain = "default") => {
|
||||
tannin.data[domain] = {
|
||||
...tannin.data[domain],
|
||||
...data
|
||||
};
|
||||
tannin.data[domain][""] = {
|
||||
...DEFAULT_LOCALE_DATA[""],
|
||||
...tannin.data[domain]?.[""]
|
||||
};
|
||||
delete tannin.pluralForms[domain];
|
||||
};
|
||||
const setLocaleData = (data, domain) => {
|
||||
doSetLocaleData(data, domain);
|
||||
notifyListeners();
|
||||
};
|
||||
const addLocaleData = (data, domain = "default") => {
|
||||
tannin.data[domain] = {
|
||||
...tannin.data[domain],
|
||||
...data,
|
||||
// Populate default domain configuration (supported locale date which omits
|
||||
// a plural forms expression).
|
||||
"": {
|
||||
...DEFAULT_LOCALE_DATA[""],
|
||||
...tannin.data[domain]?.[""],
|
||||
...data?.[""]
|
||||
}
|
||||
};
|
||||
delete tannin.pluralForms[domain];
|
||||
notifyListeners();
|
||||
};
|
||||
const resetLocaleData = (data, domain) => {
|
||||
tannin.data = {};
|
||||
tannin.pluralForms = {};
|
||||
setLocaleData(data, domain);
|
||||
};
|
||||
const dcnpgettext = (domain = "default", context, single, plural, number) => {
|
||||
if (!tannin.data[domain]) {
|
||||
doSetLocaleData(void 0, domain);
|
||||
}
|
||||
return tannin.dcnpgettext(domain, context, single, plural, number);
|
||||
};
|
||||
const getFilterDomain = (domain) => domain || "default";
|
||||
const __ = (text, domain) => {
|
||||
let translation = dcnpgettext(domain, void 0, text);
|
||||
if (!hooks) {
|
||||
return translation;
|
||||
}
|
||||
translation = hooks.applyFilters(
|
||||
"i18n.gettext",
|
||||
translation,
|
||||
text,
|
||||
domain
|
||||
);
|
||||
return hooks.applyFilters(
|
||||
"i18n.gettext_" + getFilterDomain(domain),
|
||||
translation,
|
||||
text,
|
||||
domain
|
||||
);
|
||||
};
|
||||
const _x = (text, context, domain) => {
|
||||
let translation = dcnpgettext(domain, context, text);
|
||||
if (!hooks) {
|
||||
return translation;
|
||||
}
|
||||
translation = hooks.applyFilters(
|
||||
"i18n.gettext_with_context",
|
||||
translation,
|
||||
text,
|
||||
context,
|
||||
domain
|
||||
);
|
||||
return hooks.applyFilters(
|
||||
"i18n.gettext_with_context_" + getFilterDomain(domain),
|
||||
translation,
|
||||
text,
|
||||
context,
|
||||
domain
|
||||
);
|
||||
};
|
||||
const _n = (single, plural, number, domain) => {
|
||||
let translation = dcnpgettext(
|
||||
domain,
|
||||
void 0,
|
||||
single,
|
||||
plural,
|
||||
number
|
||||
);
|
||||
if (!hooks) {
|
||||
return translation;
|
||||
}
|
||||
translation = hooks.applyFilters(
|
||||
"i18n.ngettext",
|
||||
translation,
|
||||
single,
|
||||
plural,
|
||||
number,
|
||||
domain
|
||||
);
|
||||
return hooks.applyFilters(
|
||||
"i18n.ngettext_" + getFilterDomain(domain),
|
||||
translation,
|
||||
single,
|
||||
plural,
|
||||
number,
|
||||
domain
|
||||
);
|
||||
};
|
||||
const _nx = (single, plural, number, context, domain) => {
|
||||
let translation = dcnpgettext(
|
||||
domain,
|
||||
context,
|
||||
single,
|
||||
plural,
|
||||
number
|
||||
);
|
||||
if (!hooks) {
|
||||
return translation;
|
||||
}
|
||||
translation = hooks.applyFilters(
|
||||
"i18n.ngettext_with_context",
|
||||
translation,
|
||||
single,
|
||||
plural,
|
||||
number,
|
||||
context,
|
||||
domain
|
||||
);
|
||||
return hooks.applyFilters(
|
||||
"i18n.ngettext_with_context_" + getFilterDomain(domain),
|
||||
translation,
|
||||
single,
|
||||
plural,
|
||||
number,
|
||||
context,
|
||||
domain
|
||||
);
|
||||
};
|
||||
const isRTL = () => {
|
||||
return "rtl" === _x("ltr", "text direction");
|
||||
};
|
||||
const hasTranslation = (single, context, domain) => {
|
||||
const key = context ? context + "" + single : single;
|
||||
let result = !!tannin.data?.[domain ?? "default"]?.[key];
|
||||
if (hooks) {
|
||||
result = hooks.applyFilters(
|
||||
"i18n.has_translation",
|
||||
result,
|
||||
single,
|
||||
context,
|
||||
domain
|
||||
);
|
||||
result = hooks.applyFilters(
|
||||
"i18n.has_translation_" + getFilterDomain(domain),
|
||||
result,
|
||||
single,
|
||||
context,
|
||||
domain
|
||||
);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
if (initialData) {
|
||||
setLocaleData(initialData, initialDomain);
|
||||
}
|
||||
if (hooks) {
|
||||
const onHookAddedOrRemoved = (hookName) => {
|
||||
if (I18N_HOOK_REGEXP.test(hookName)) {
|
||||
notifyListeners();
|
||||
}
|
||||
};
|
||||
hooks.addAction("hookAdded", "core/i18n", onHookAddedOrRemoved);
|
||||
hooks.addAction("hookRemoved", "core/i18n", onHookAddedOrRemoved);
|
||||
}
|
||||
return {
|
||||
getLocaleData,
|
||||
setLocaleData,
|
||||
addLocaleData,
|
||||
resetLocaleData,
|
||||
subscribe,
|
||||
__,
|
||||
_x,
|
||||
_n,
|
||||
_nx,
|
||||
isRTL,
|
||||
hasTranslation
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
;// external ["wp","hooks"]
|
||||
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
|
||||
;// ./node_modules/@wordpress/i18n/build-module/default-i18n.js
|
||||
|
||||
|
||||
const i18n = createI18n(void 0, void 0, external_wp_hooks_namespaceObject.defaultHooks);
|
||||
var default_i18n_default = i18n;
|
||||
const getLocaleData = i18n.getLocaleData.bind(i18n);
|
||||
const setLocaleData = i18n.setLocaleData.bind(i18n);
|
||||
const resetLocaleData = i18n.resetLocaleData.bind(i18n);
|
||||
const subscribe = i18n.subscribe.bind(i18n);
|
||||
const __ = i18n.__.bind(i18n);
|
||||
const _x = i18n._x.bind(i18n);
|
||||
const _n = i18n._n.bind(i18n);
|
||||
const _nx = i18n._nx.bind(i18n);
|
||||
const isRTL = i18n.isRTL.bind(i18n);
|
||||
const hasTranslation = i18n.hasTranslation.bind(i18n);
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/i18n/build-module/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).i18n = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
File diff suppressed because one or more lines are too long
+113
@@ -0,0 +1,113 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
"default": () => (/* binding */ isShallowEqual),
|
||||
isShallowEqualArrays: () => (/* reexport */ isShallowEqualArrays),
|
||||
isShallowEqualObjects: () => (/* reexport */ isShallowEqualObjects)
|
||||
});
|
||||
|
||||
;// ./node_modules/@wordpress/is-shallow-equal/build-module/objects.js
|
||||
function isShallowEqualObjects(a, b) {
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
const aKeys = Object.keys(a);
|
||||
const bKeys = Object.keys(b);
|
||||
if (aKeys.length !== bKeys.length) {
|
||||
return false;
|
||||
}
|
||||
let i = 0;
|
||||
while (i < aKeys.length) {
|
||||
const key = aKeys[i];
|
||||
const aValue = a[key];
|
||||
if (
|
||||
// In iterating only the keys of the first object after verifying
|
||||
// equal lengths, account for the case that an explicit `undefined`
|
||||
// value in the first is implicitly undefined in the second.
|
||||
//
|
||||
// Example: isShallowEqualObjects( { a: undefined }, { b: 5 } )
|
||||
aValue === void 0 && !b.hasOwnProperty(key) || aValue !== b[key]
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/is-shallow-equal/build-module/arrays.js
|
||||
function isShallowEqualArrays(a, b) {
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
if (a.length !== b.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0, len = a.length; i < len; i++) {
|
||||
if (a[i] !== b[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/is-shallow-equal/build-module/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
function isShallowEqual(a, b) {
|
||||
if (a && b) {
|
||||
if (a.constructor === Object && b.constructor === Object) {
|
||||
return isShallowEqualObjects(a, b);
|
||||
} else if (Array.isArray(a) && Array.isArray(b)) {
|
||||
return isShallowEqualArrays(a, b);
|
||||
}
|
||||
}
|
||||
return a === b;
|
||||
}
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).isShallowEqual = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var r={d:(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e),r:r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}},e={};function t(r,e){if(r===e)return!0;const t=Object.keys(r),n=Object.keys(e);if(t.length!==n.length)return!1;let o=0;for(;o<t.length;){const n=t[o],i=r[n];if(void 0===i&&!e.hasOwnProperty(n)||i!==e[n])return!1;o++}return!0}function n(r,e){if(r===e)return!0;if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function o(r,e){if(r&&e){if(r.constructor===Object&&e.constructor===Object)return t(r,e);if(Array.isArray(r)&&Array.isArray(e))return n(r,e)}return r===e}r.r(e),r.d(e,{default:()=>o,isShallowEqualArrays:()=>n,isShallowEqualObjects:()=>t}),(window.wp=window.wp||{}).isShallowEqual=e})();
|
||||
+293
@@ -0,0 +1,293 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
ShortcutProvider: () => (/* reexport */ ShortcutProvider),
|
||||
__unstableUseShortcutEventMatch: () => (/* reexport */ useShortcutEventMatch),
|
||||
store: () => (/* reexport */ store),
|
||||
useShortcut: () => (/* reexport */ useShortcut)
|
||||
});
|
||||
|
||||
// NAMESPACE OBJECT: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/actions.js
|
||||
var actions_namespaceObject = {};
|
||||
__webpack_require__.r(actions_namespaceObject);
|
||||
__webpack_require__.d(actions_namespaceObject, {
|
||||
registerShortcut: () => (registerShortcut),
|
||||
unregisterShortcut: () => (unregisterShortcut)
|
||||
});
|
||||
|
||||
// NAMESPACE OBJECT: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/selectors.js
|
||||
var selectors_namespaceObject = {};
|
||||
__webpack_require__.r(selectors_namespaceObject);
|
||||
__webpack_require__.d(selectors_namespaceObject, {
|
||||
getAllShortcutKeyCombinations: () => (getAllShortcutKeyCombinations),
|
||||
getAllShortcutRawKeyCombinations: () => (getAllShortcutRawKeyCombinations),
|
||||
getCategoryShortcuts: () => (getCategoryShortcuts),
|
||||
getShortcutAliases: () => (getShortcutAliases),
|
||||
getShortcutDescription: () => (getShortcutDescription),
|
||||
getShortcutKeyCombination: () => (getShortcutKeyCombination),
|
||||
getShortcutRepresentation: () => (getShortcutRepresentation)
|
||||
});
|
||||
|
||||
;// external ["wp","data"]
|
||||
const external_wp_data_namespaceObject = window["wp"]["data"];
|
||||
;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/reducer.js
|
||||
function reducer(state = {}, action) {
|
||||
switch (action.type) {
|
||||
case "REGISTER_SHORTCUT":
|
||||
return {
|
||||
...state,
|
||||
[action.name]: {
|
||||
category: action.category,
|
||||
keyCombination: action.keyCombination,
|
||||
aliases: action.aliases,
|
||||
description: action.description
|
||||
}
|
||||
};
|
||||
case "UNREGISTER_SHORTCUT":
|
||||
const { [action.name]: actionName, ...remainingState } = state;
|
||||
return remainingState;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
var reducer_default = reducer;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/actions.js
|
||||
function registerShortcut({
|
||||
name,
|
||||
category,
|
||||
description,
|
||||
keyCombination,
|
||||
aliases
|
||||
}) {
|
||||
return {
|
||||
type: "REGISTER_SHORTCUT",
|
||||
name,
|
||||
category,
|
||||
keyCombination,
|
||||
aliases,
|
||||
description
|
||||
};
|
||||
}
|
||||
function unregisterShortcut(name) {
|
||||
return {
|
||||
type: "UNREGISTER_SHORTCUT",
|
||||
name
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
;// external ["wp","keycodes"]
|
||||
const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
|
||||
;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/selectors.js
|
||||
|
||||
|
||||
const EMPTY_ARRAY = [];
|
||||
const FORMATTING_METHODS = {
|
||||
display: external_wp_keycodes_namespaceObject.displayShortcut,
|
||||
raw: external_wp_keycodes_namespaceObject.rawShortcut,
|
||||
ariaLabel: external_wp_keycodes_namespaceObject.shortcutAriaLabel
|
||||
};
|
||||
function getKeyCombinationRepresentation(shortcut, representation) {
|
||||
if (!shortcut) {
|
||||
return null;
|
||||
}
|
||||
return shortcut.modifier ? FORMATTING_METHODS[representation][shortcut.modifier](
|
||||
shortcut.character
|
||||
) : shortcut.character;
|
||||
}
|
||||
function getShortcutKeyCombination(state, name) {
|
||||
return state[name] ? state[name].keyCombination : null;
|
||||
}
|
||||
function getShortcutRepresentation(state, name, representation = "display") {
|
||||
const shortcut = getShortcutKeyCombination(state, name);
|
||||
return getKeyCombinationRepresentation(shortcut, representation);
|
||||
}
|
||||
function getShortcutDescription(state, name) {
|
||||
return state[name] ? state[name].description : null;
|
||||
}
|
||||
function getShortcutAliases(state, name) {
|
||||
return state[name] && state[name].aliases ? state[name].aliases : EMPTY_ARRAY;
|
||||
}
|
||||
const getAllShortcutKeyCombinations = (0,external_wp_data_namespaceObject.createSelector)(
|
||||
(state, name) => {
|
||||
return [
|
||||
getShortcutKeyCombination(state, name),
|
||||
...getShortcutAliases(state, name)
|
||||
].filter(Boolean);
|
||||
},
|
||||
(state, name) => [state[name]]
|
||||
);
|
||||
const getAllShortcutRawKeyCombinations = (0,external_wp_data_namespaceObject.createSelector)(
|
||||
(state, name) => {
|
||||
return getAllShortcutKeyCombinations(state, name).map(
|
||||
(combination) => getKeyCombinationRepresentation(combination, "raw")
|
||||
);
|
||||
},
|
||||
(state, name) => [state[name]]
|
||||
);
|
||||
const getCategoryShortcuts = (0,external_wp_data_namespaceObject.createSelector)(
|
||||
(state, categoryName) => {
|
||||
return Object.entries(state).filter(([, shortcut]) => shortcut.category === categoryName).map(([name]) => name);
|
||||
},
|
||||
(state) => [state]
|
||||
);
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
const STORE_NAME = "core/keyboard-shortcuts";
|
||||
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
|
||||
reducer: reducer_default,
|
||||
actions: actions_namespaceObject,
|
||||
selectors: selectors_namespaceObject
|
||||
});
|
||||
(0,external_wp_data_namespaceObject.register)(store);
|
||||
|
||||
|
||||
;// external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/hooks/use-shortcut-event-match.js
|
||||
|
||||
|
||||
|
||||
function useShortcutEventMatch() {
|
||||
const { getAllShortcutKeyCombinations } = (0,external_wp_data_namespaceObject.useSelect)(
|
||||
store
|
||||
);
|
||||
function isMatch(name, event) {
|
||||
return getAllShortcutKeyCombinations(name).some(
|
||||
({ modifier, character }) => {
|
||||
return external_wp_keycodes_namespaceObject.isKeyboardEvent[modifier](event, character);
|
||||
}
|
||||
);
|
||||
}
|
||||
return isMatch;
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/context.js
|
||||
|
||||
const globalShortcuts = /* @__PURE__ */ new Set();
|
||||
const globalListener = (event) => {
|
||||
for (const keyboardShortcut of globalShortcuts) {
|
||||
keyboardShortcut(event);
|
||||
}
|
||||
};
|
||||
const context = (0,external_wp_element_namespaceObject.createContext)({
|
||||
add: (shortcut) => {
|
||||
if (globalShortcuts.size === 0) {
|
||||
document.addEventListener("keydown", globalListener);
|
||||
}
|
||||
globalShortcuts.add(shortcut);
|
||||
},
|
||||
delete: (shortcut) => {
|
||||
globalShortcuts.delete(shortcut);
|
||||
if (globalShortcuts.size === 0) {
|
||||
document.removeEventListener("keydown", globalListener);
|
||||
}
|
||||
}
|
||||
});
|
||||
context.displayName = "KeyboardShortcutsContext";
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/hooks/use-shortcut.js
|
||||
|
||||
|
||||
|
||||
function useShortcut(name, callback, { isDisabled = false } = {}) {
|
||||
const shortcuts = (0,external_wp_element_namespaceObject.useContext)(context);
|
||||
const isMatch = useShortcutEventMatch();
|
||||
const callbackRef = (0,external_wp_element_namespaceObject.useRef)();
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
callbackRef.current = callback;
|
||||
}, [callback]);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
if (isDisabled) {
|
||||
return;
|
||||
}
|
||||
function _callback(event) {
|
||||
if (isMatch(name, event)) {
|
||||
callbackRef.current(event);
|
||||
}
|
||||
}
|
||||
shortcuts.add(_callback);
|
||||
return () => {
|
||||
shortcuts.delete(_callback);
|
||||
};
|
||||
}, [name, isDisabled, shortcuts]);
|
||||
}
|
||||
|
||||
|
||||
;// external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/components/shortcut-provider.js
|
||||
|
||||
|
||||
|
||||
const { Provider } = context;
|
||||
function ShortcutProvider(props) {
|
||||
const [keyboardShortcuts] = (0,external_wp_element_namespaceObject.useState)(() => /* @__PURE__ */ new Set());
|
||||
function onKeyDown(event) {
|
||||
if (props.onKeyDown) {
|
||||
props.onKeyDown(event);
|
||||
}
|
||||
for (const keyboardShortcut of keyboardShortcuts) {
|
||||
keyboardShortcut(event);
|
||||
}
|
||||
}
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, { value: keyboardShortcuts, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...props, onKeyDown }) });
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).keyboardShortcuts = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ShortcutProvider:()=>K,__unstableUseShortcutEventMatch:()=>R,store:()=>h,useShortcut:()=>T});var o={};e.r(o),e.d(o,{registerShortcut:()=>c,unregisterShortcut:()=>a});var r={};e.r(r),e.d(r,{getAllShortcutKeyCombinations:()=>w,getAllShortcutRawKeyCombinations:()=>p,getCategoryShortcuts:()=>b,getShortcutAliases:()=>m,getShortcutDescription:()=>f,getShortcutKeyCombination:()=>y,getShortcutRepresentation:()=>S});const n=window.wp.data;var i=function(e={},t){switch(t.type){case"REGISTER_SHORTCUT":return{...e,[t.name]:{category:t.category,keyCombination:t.keyCombination,aliases:t.aliases,description:t.description}};case"UNREGISTER_SHORTCUT":const{[t.name]:o,...r}=e;return r}return e};function c({name:e,category:t,description:o,keyCombination:r,aliases:n}){return{type:"REGISTER_SHORTCUT",name:e,category:t,keyCombination:r,aliases:n,description:o}}function a(e){return{type:"UNREGISTER_SHORTCUT",name:e}}const s=window.wp.keycodes,u=[],d={display:s.displayShortcut,raw:s.rawShortcut,ariaLabel:s.shortcutAriaLabel};function l(e,t){return e?e.modifier?d[t][e.modifier](e.character):e.character:null}function y(e,t){return e[t]?e[t].keyCombination:null}function S(e,t,o="display"){return l(y(e,t),o)}function f(e,t){return e[t]?e[t].description:null}function m(e,t){return e[t]&&e[t].aliases?e[t].aliases:u}const w=(0,n.createSelector)(((e,t)=>[y(e,t),...m(e,t)].filter(Boolean)),((e,t)=>[e[t]])),p=(0,n.createSelector)(((e,t)=>w(e,t).map((e=>l(e,"raw")))),((e,t)=>[e[t]])),b=(0,n.createSelector)(((e,t)=>Object.entries(e).filter((([,e])=>e.category===t)).map((([e])=>e))),(e=>[e])),h=(0,n.createReduxStore)("core/keyboard-shortcuts",{reducer:i,actions:o,selectors:r});(0,n.register)(h);const g=window.wp.element;function R(){const{getAllShortcutKeyCombinations:e}=(0,n.useSelect)(h);return function(t,o){return e(t).some((({modifier:e,character:t})=>s.isKeyboardEvent[e](o,t)))}}const C=new Set,v=e=>{for(const t of C)t(e)},E=(0,g.createContext)({add:e=>{0===C.size&&document.addEventListener("keydown",v),C.add(e)},delete:e=>{C.delete(e),0===C.size&&document.removeEventListener("keydown",v)}});function T(e,t,{isDisabled:o=!1}={}){const r=(0,g.useContext)(E),n=R(),i=(0,g.useRef)();(0,g.useEffect)((()=>{i.current=t}),[t]),(0,g.useEffect)((()=>{if(!o)return r.add(t),()=>{r.delete(t)};function t(t){n(e,t)&&i.current(t)}}),[e,o,r])}E.displayName="KeyboardShortcutsContext";const k=window.ReactJSXRuntime,{Provider:O}=E;function K(e){const[t]=(0,g.useState)((()=>new Set));return(0,k.jsx)(O,{value:t,children:(0,k.jsx)("div",{...e,onKeyDown:function(o){e.onKeyDown&&e.onKeyDown(o);for(const e of t)e(o)}})})}(window.wp=window.wp||{}).keyboardShortcuts=t})();
|
||||
@@ -0,0 +1,242 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
ALT: () => (/* binding */ ALT),
|
||||
BACKSPACE: () => (/* binding */ BACKSPACE),
|
||||
COMMAND: () => (/* binding */ COMMAND),
|
||||
CTRL: () => (/* binding */ CTRL),
|
||||
DELETE: () => (/* binding */ DELETE),
|
||||
DOWN: () => (/* binding */ DOWN),
|
||||
END: () => (/* binding */ END),
|
||||
ENTER: () => (/* binding */ ENTER),
|
||||
ESCAPE: () => (/* binding */ ESCAPE),
|
||||
F10: () => (/* binding */ F10),
|
||||
HOME: () => (/* binding */ HOME),
|
||||
LEFT: () => (/* binding */ LEFT),
|
||||
PAGEDOWN: () => (/* binding */ PAGEDOWN),
|
||||
PAGEUP: () => (/* binding */ PAGEUP),
|
||||
RIGHT: () => (/* binding */ RIGHT),
|
||||
SHIFT: () => (/* binding */ SHIFT),
|
||||
SPACE: () => (/* binding */ SPACE),
|
||||
TAB: () => (/* binding */ TAB),
|
||||
UP: () => (/* binding */ UP),
|
||||
ZERO: () => (/* binding */ ZERO),
|
||||
displayShortcut: () => (/* binding */ displayShortcut),
|
||||
displayShortcutList: () => (/* binding */ displayShortcutList),
|
||||
isAppleOS: () => (/* reexport */ isAppleOS),
|
||||
isKeyboardEvent: () => (/* binding */ isKeyboardEvent),
|
||||
modifiers: () => (/* binding */ modifiers),
|
||||
rawShortcut: () => (/* binding */ rawShortcut),
|
||||
shortcutAriaLabel: () => (/* binding */ shortcutAriaLabel)
|
||||
});
|
||||
|
||||
;// external ["wp","i18n"]
|
||||
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
|
||||
;// ./node_modules/@wordpress/keycodes/build-module/platform.js
|
||||
function isAppleOS(_window) {
|
||||
if (!_window) {
|
||||
if (typeof window === "undefined") {
|
||||
return false;
|
||||
}
|
||||
_window = window;
|
||||
}
|
||||
const { platform } = _window.navigator;
|
||||
return platform.indexOf("Mac") !== -1 || ["iPad", "iPhone"].includes(platform);
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/keycodes/build-module/index.js
|
||||
|
||||
|
||||
const BACKSPACE = 8;
|
||||
const TAB = 9;
|
||||
const ENTER = 13;
|
||||
const ESCAPE = 27;
|
||||
const SPACE = 32;
|
||||
const PAGEUP = 33;
|
||||
const PAGEDOWN = 34;
|
||||
const END = 35;
|
||||
const HOME = 36;
|
||||
const LEFT = 37;
|
||||
const UP = 38;
|
||||
const RIGHT = 39;
|
||||
const DOWN = 40;
|
||||
const DELETE = 46;
|
||||
const F10 = 121;
|
||||
const ALT = "alt";
|
||||
const CTRL = "ctrl";
|
||||
const COMMAND = "meta";
|
||||
const SHIFT = "shift";
|
||||
const ZERO = 48;
|
||||
function capitaliseFirstCharacter(string) {
|
||||
return string.length < 2 ? string.toUpperCase() : string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
function mapValues(object, mapFn) {
|
||||
return Object.fromEntries(
|
||||
Object.entries(object).map(([key, value]) => [
|
||||
key,
|
||||
mapFn(value)
|
||||
])
|
||||
);
|
||||
}
|
||||
const modifiers = {
|
||||
primary: (_isApple) => _isApple() ? [COMMAND] : [CTRL],
|
||||
primaryShift: (_isApple) => _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT],
|
||||
primaryAlt: (_isApple) => _isApple() ? [ALT, COMMAND] : [CTRL, ALT],
|
||||
secondary: (_isApple) => _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT],
|
||||
access: (_isApple) => _isApple() ? [CTRL, ALT] : [SHIFT, ALT],
|
||||
ctrl: () => [CTRL],
|
||||
alt: () => [ALT],
|
||||
ctrlShift: () => [CTRL, SHIFT],
|
||||
shift: () => [SHIFT],
|
||||
shiftAlt: () => [SHIFT, ALT],
|
||||
undefined: () => []
|
||||
};
|
||||
const rawShortcut = /* @__PURE__ */ mapValues(modifiers, (modifier) => {
|
||||
return (character, _isApple = isAppleOS) => {
|
||||
return [...modifier(_isApple), character.toLowerCase()].join(
|
||||
"+"
|
||||
);
|
||||
};
|
||||
});
|
||||
const displayShortcutList = /* @__PURE__ */ mapValues(
|
||||
modifiers,
|
||||
(modifier) => {
|
||||
return (character, _isApple = isAppleOS) => {
|
||||
const isApple = _isApple();
|
||||
const replacementKeyMap = {
|
||||
[ALT]: isApple ? "\u2325" : "Alt",
|
||||
[CTRL]: isApple ? "\u2303" : "Ctrl",
|
||||
// Make sure ⌃ is the U+2303 UP ARROWHEAD unicode character and not the caret character.
|
||||
[COMMAND]: "\u2318",
|
||||
[SHIFT]: isApple ? "\u21E7" : "Shift"
|
||||
};
|
||||
const modifierKeys = modifier(_isApple).reduce(
|
||||
(accumulator, key) => {
|
||||
const replacementKey = replacementKeyMap[key] ?? key;
|
||||
if (isApple) {
|
||||
return [...accumulator, replacementKey];
|
||||
}
|
||||
return [...accumulator, replacementKey, "+"];
|
||||
},
|
||||
[]
|
||||
);
|
||||
return [
|
||||
...modifierKeys,
|
||||
capitaliseFirstCharacter(character)
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
const displayShortcut = /* @__PURE__ */ mapValues(
|
||||
displayShortcutList,
|
||||
(shortcutList) => {
|
||||
return (character, _isApple = isAppleOS) => shortcutList(character, _isApple).join("");
|
||||
}
|
||||
);
|
||||
const shortcutAriaLabel = /* @__PURE__ */ mapValues(modifiers, (modifier) => {
|
||||
return (character, _isApple = isAppleOS) => {
|
||||
const isApple = _isApple();
|
||||
const replacementKeyMap = {
|
||||
[SHIFT]: "Shift",
|
||||
[COMMAND]: isApple ? "Command" : "Control",
|
||||
[CTRL]: "Control",
|
||||
[ALT]: isApple ? "Option" : "Alt",
|
||||
/* translators: comma as in the character ',' */
|
||||
",": (0,external_wp_i18n_namespaceObject.__)("Comma"),
|
||||
/* translators: period as in the character '.' */
|
||||
".": (0,external_wp_i18n_namespaceObject.__)("Period"),
|
||||
/* translators: backtick as in the character '`' */
|
||||
"`": (0,external_wp_i18n_namespaceObject.__)("Backtick"),
|
||||
/* translators: tilde as in the character '~' */
|
||||
"~": (0,external_wp_i18n_namespaceObject.__)("Tilde")
|
||||
};
|
||||
return [...modifier(_isApple), character].map(
|
||||
(key) => capitaliseFirstCharacter(replacementKeyMap[key] ?? key)
|
||||
).join(isApple ? " " : " + ");
|
||||
};
|
||||
});
|
||||
function getEventModifiers(event) {
|
||||
return [ALT, CTRL, COMMAND, SHIFT].filter(
|
||||
(key) => event[`${key}Key`]
|
||||
);
|
||||
}
|
||||
const isKeyboardEvent = /* @__PURE__ */ mapValues(modifiers, (getModifiers) => {
|
||||
return (event, character, _isApple = isAppleOS) => {
|
||||
const mods = getModifiers(_isApple);
|
||||
const eventMods = getEventModifiers(event);
|
||||
const replacementWithShiftKeyMap = {
|
||||
Comma: ",",
|
||||
Backslash: "\\",
|
||||
// Windows returns `\` for both IntlRo and IntlYen.
|
||||
IntlRo: "\\",
|
||||
IntlYen: "\\"
|
||||
};
|
||||
const modsDiff = mods.filter(
|
||||
(mod) => !eventMods.includes(mod)
|
||||
);
|
||||
const eventModsDiff = eventMods.filter(
|
||||
(mod) => !mods.includes(mod)
|
||||
);
|
||||
if (modsDiff.length > 0 || eventModsDiff.length > 0) {
|
||||
return false;
|
||||
}
|
||||
let key = event.key.toLowerCase();
|
||||
if (!character) {
|
||||
return mods.includes(key);
|
||||
}
|
||||
if (event.altKey && character.length === 1) {
|
||||
key = String.fromCharCode(event.keyCode).toLowerCase();
|
||||
}
|
||||
if (event.shiftKey && character.length === 1 && replacementWithShiftKeyMap[event.code]) {
|
||||
key = replacementWithShiftKeyMap[event.code];
|
||||
}
|
||||
if (character === "del") {
|
||||
character = "delete";
|
||||
}
|
||||
return key === character.toLowerCase();
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).keycodes = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ALT:()=>S,BACKSPACE:()=>n,COMMAND:()=>A,CTRL:()=>E,DELETE:()=>m,DOWN:()=>C,END:()=>f,ENTER:()=>l,ESCAPE:()=>a,F10:()=>w,HOME:()=>u,LEFT:()=>p,PAGEDOWN:()=>d,PAGEUP:()=>s,RIGHT:()=>h,SHIFT:()=>O,SPACE:()=>c,TAB:()=>i,UP:()=>y,ZERO:()=>P,displayShortcut:()=>j,displayShortcutList:()=>_,isAppleOS:()=>o,isKeyboardEvent:()=>v,modifiers:()=>T,rawShortcut:()=>L,shortcutAriaLabel:()=>k});const r=window.wp.i18n;function o(e){if(!e){if("undefined"==typeof window)return!1;e=window}const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}const n=8,i=9,l=13,a=27,c=32,s=33,d=34,f=35,u=36,p=37,y=38,h=39,C=40,m=46,w=121,S="alt",E="ctrl",A="meta",O="shift",P=48;function b(e){return e.length<2?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}function g(e,t){return Object.fromEntries(Object.entries(e).map((([e,r])=>[e,t(r)])))}const T={primary:e=>e()?[A]:[E],primaryShift:e=>e()?[O,A]:[E,O],primaryAlt:e=>e()?[S,A]:[E,S],secondary:e=>e()?[O,S,A]:[E,O,S],access:e=>e()?[E,S]:[O,S],ctrl:()=>[E],alt:()=>[S],ctrlShift:()=>[E,O],shift:()=>[O],shiftAlt:()=>[O,S],undefined:()=>[]},L=g(T,(e=>(t,r=o)=>[...e(r),t.toLowerCase()].join("+"))),_=g(T,(e=>(t,r=o)=>{const n=r(),i={[S]:n?"⌥":"Alt",[E]:n?"⌃":"Ctrl",[A]:"⌘",[O]:n?"⇧":"Shift"};return[...e(r).reduce(((e,t)=>{const r=i[t]??t;return n?[...e,r]:[...e,r,"+"]}),[]),b(t)]})),j=g(_,(e=>(t,r=o)=>e(t,r).join(""))),k=g(T,(e=>(t,n=o)=>{const i=n(),l={[O]:"Shift",[A]:i?"Command":"Control",[E]:"Control",[S]:i?"Option":"Alt",",":(0,r.__)("Comma"),".":(0,r.__)("Period"),"`":(0,r.__)("Backtick"),"~":(0,r.__)("Tilde")};return[...e(n),t].map((e=>b(l[e]??e))).join(i?" ":" + ")}));const v=g(T,(e=>(t,r,n=o)=>{const i=e(n),l=function(e){return[S,E,A,O].filter((t=>e[`${t}Key`]))}(t),a={Comma:",",Backslash:"\\",IntlRo:"\\",IntlYen:"\\"},c=i.filter((e=>!l.includes(e))),s=l.filter((e=>!i.includes(e)));if(c.length>0||s.length>0)return!1;let d=t.key.toLowerCase();return r?(t.altKey&&1===r.length&&(d=String.fromCharCode(t.keyCode).toLowerCase()),t.shiftKey&&1===r.length&&a[t.code]&&(d=a[t.code]),"del"===r&&(r="delete"),d===r.toLowerCase()):i.includes(d)}));(window.wp=window.wp||{}).keycodes=t})();
|
||||
+13982
File diff suppressed because it is too large
Load Diff
+2
File diff suppressed because one or more lines are too long
+780
@@ -0,0 +1,780 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat get default export */
|
||||
/******/ (() => {
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = (module) => {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ () => (module['default']) :
|
||||
/******/ () => (module);
|
||||
/******/ __webpack_require__.d(getter, { a: getter });
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
|
||||
;// external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// external ["wp","i18n"]
|
||||
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
|
||||
;// ./node_modules/tslib/tslib.es6.mjs
|
||||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
||||
|
||||
var extendStatics = function(d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
|
||||
function __extends(d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
}
|
||||
|
||||
var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
return __assign.apply(this, arguments);
|
||||
}
|
||||
|
||||
function __rest(s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
function __decorate(decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
}
|
||||
|
||||
function __param(paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
}
|
||||
|
||||
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
||||
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
||||
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
||||
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
||||
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
||||
var _, done = false;
|
||||
for (var i = decorators.length - 1; i >= 0; i--) {
|
||||
var context = {};
|
||||
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
||||
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
||||
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
||||
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
||||
if (kind === "accessor") {
|
||||
if (result === void 0) continue;
|
||||
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
||||
if (_ = accept(result.get)) descriptor.get = _;
|
||||
if (_ = accept(result.set)) descriptor.set = _;
|
||||
if (_ = accept(result.init)) initializers.unshift(_);
|
||||
}
|
||||
else if (_ = accept(result)) {
|
||||
if (kind === "field") initializers.unshift(_);
|
||||
else descriptor[key] = _;
|
||||
}
|
||||
}
|
||||
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
||||
done = true;
|
||||
};
|
||||
|
||||
function __runInitializers(thisArg, initializers, value) {
|
||||
var useValue = arguments.length > 2;
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
||||
}
|
||||
return useValue ? value : void 0;
|
||||
};
|
||||
|
||||
function __propKey(x) {
|
||||
return typeof x === "symbol" ? x : "".concat(x);
|
||||
};
|
||||
|
||||
function __setFunctionName(f, name, prefix) {
|
||||
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
||||
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
||||
};
|
||||
|
||||
function __metadata(metadataKey, metadataValue) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
||||
}
|
||||
|
||||
function __awaiter(thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
}
|
||||
|
||||
function __generator(thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
||||
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
}
|
||||
|
||||
var __createBinding = Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
});
|
||||
|
||||
function __exportStar(m, o) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
||||
}
|
||||
|
||||
function __values(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
}
|
||||
|
||||
function __read(o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
function __spread() {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++)
|
||||
ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
function __spreadArrays() {
|
||||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
||||
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
||||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
||||
r[k] = a[j];
|
||||
return r;
|
||||
}
|
||||
|
||||
function __spreadArray(to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
}
|
||||
|
||||
function __await(v) {
|
||||
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
||||
}
|
||||
|
||||
function __asyncGenerator(thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
||||
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
}
|
||||
|
||||
function __asyncDelegator(o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
||||
}
|
||||
|
||||
function __asyncValues(o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator], i;
|
||||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
||||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||
}
|
||||
|
||||
function __makeTemplateObject(cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
return cooked;
|
||||
};
|
||||
|
||||
var __setModuleDefault = Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
};
|
||||
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
|
||||
function __importStar(mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
}
|
||||
|
||||
function __importDefault(mod) {
|
||||
return (mod && mod.__esModule) ? mod : { default: mod };
|
||||
}
|
||||
|
||||
function __classPrivateFieldGet(receiver, state, kind, f) {
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
||||
}
|
||||
|
||||
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
}
|
||||
|
||||
function __classPrivateFieldIn(state, receiver) {
|
||||
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
||||
return typeof state === "function" ? receiver === state : state.has(receiver);
|
||||
}
|
||||
|
||||
function __addDisposableResource(env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose, inner;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
dispose = value[Symbol.asyncDispose];
|
||||
}
|
||||
if (dispose === void 0) {
|
||||
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
||||
dispose = value[Symbol.dispose];
|
||||
if (async) inner = dispose;
|
||||
}
|
||||
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
||||
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
||||
env.stack.push({ value: value, dispose: dispose, async: async });
|
||||
}
|
||||
else if (async) {
|
||||
env.stack.push({ async: true });
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
||||
var e = new Error(message);
|
||||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
||||
};
|
||||
|
||||
function __disposeResources(env) {
|
||||
function fail(e) {
|
||||
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
||||
env.hasError = true;
|
||||
}
|
||||
var r, s = 0;
|
||||
function next() {
|
||||
while (r = env.stack.pop()) {
|
||||
try {
|
||||
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
||||
if (r.dispose) {
|
||||
var result = r.dispose.call(r.value);
|
||||
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
||||
}
|
||||
else s |= 1;
|
||||
}
|
||||
catch (e) {
|
||||
fail(e);
|
||||
}
|
||||
}
|
||||
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
||||
if (env.hasError) throw env.error;
|
||||
}
|
||||
return next();
|
||||
}
|
||||
|
||||
function __rewriteRelativeImportExtension(path, preserveJsx) {
|
||||
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
||||
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
||||
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
||||
});
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
/* harmony default export */ const tslib_es6 = ({
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__esDecorate,
|
||||
__runInitializers,
|
||||
__propKey,
|
||||
__setFunctionName,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__createBinding,
|
||||
__exportStar,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
__rewriteRelativeImportExtension,
|
||||
});
|
||||
|
||||
;// ./node_modules/lower-case/dist.es2015/index.js
|
||||
/**
|
||||
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
|
||||
*/
|
||||
var SUPPORTED_LOCALE = {
|
||||
tr: {
|
||||
regexp: /\u0130|\u0049|\u0049\u0307/g,
|
||||
map: {
|
||||
İ: "\u0069",
|
||||
I: "\u0131",
|
||||
İ: "\u0069",
|
||||
},
|
||||
},
|
||||
az: {
|
||||
regexp: /\u0130/g,
|
||||
map: {
|
||||
İ: "\u0069",
|
||||
I: "\u0131",
|
||||
İ: "\u0069",
|
||||
},
|
||||
},
|
||||
lt: {
|
||||
regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
|
||||
map: {
|
||||
I: "\u0069\u0307",
|
||||
J: "\u006A\u0307",
|
||||
Į: "\u012F\u0307",
|
||||
Ì: "\u0069\u0307\u0300",
|
||||
Í: "\u0069\u0307\u0301",
|
||||
Ĩ: "\u0069\u0307\u0303",
|
||||
},
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Localized lower case.
|
||||
*/
|
||||
function localeLowerCase(str, locale) {
|
||||
var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
|
||||
if (lang)
|
||||
return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
|
||||
return lowerCase(str);
|
||||
}
|
||||
/**
|
||||
* Lower case as a function.
|
||||
*/
|
||||
function lowerCase(str) {
|
||||
return str.toLowerCase();
|
||||
}
|
||||
|
||||
;// ./node_modules/no-case/dist.es2015/index.js
|
||||
|
||||
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
|
||||
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
|
||||
// Remove all non-word characters.
|
||||
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
|
||||
/**
|
||||
* Normalize the string into something other libraries can manipulate easier.
|
||||
*/
|
||||
function noCase(input, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
|
||||
var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
|
||||
var start = 0;
|
||||
var end = result.length;
|
||||
// Trim the delimiter from around the output string.
|
||||
while (result.charAt(start) === "\0")
|
||||
start++;
|
||||
while (result.charAt(end - 1) === "\0")
|
||||
end--;
|
||||
// Transform each token independently.
|
||||
return result.slice(start, end).split("\0").map(transform).join(delimiter);
|
||||
}
|
||||
/**
|
||||
* Replace `re` in the input string with the replacement value.
|
||||
*/
|
||||
function replace(input, re, value) {
|
||||
if (re instanceof RegExp)
|
||||
return input.replace(re, value);
|
||||
return re.reduce(function (input, re) { return input.replace(re, value); }, input);
|
||||
}
|
||||
|
||||
;// ./node_modules/dot-case/dist.es2015/index.js
|
||||
|
||||
|
||||
function dotCase(input, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
return noCase(input, __assign({ delimiter: "." }, options));
|
||||
}
|
||||
|
||||
;// ./node_modules/param-case/dist.es2015/index.js
|
||||
|
||||
|
||||
function paramCase(input, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
return dotCase(input, __assign({ delimiter: "-" }, options));
|
||||
}
|
||||
|
||||
;// external ["wp","apiFetch"]
|
||||
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
|
||||
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
|
||||
;// external ["wp","blob"]
|
||||
const external_wp_blob_namespaceObject = window["wp"]["blob"];
|
||||
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/export.js
|
||||
|
||||
|
||||
|
||||
async function exportReusableBlock(id) {
|
||||
const postType = await external_wp_apiFetch_default()({ path: `/wp/v2/types/wp_block` });
|
||||
const post = await external_wp_apiFetch_default()({
|
||||
path: `/wp/v2/${postType.rest_base}/${id}?context=edit`
|
||||
});
|
||||
const title = post.title.raw;
|
||||
const content = post.content.raw;
|
||||
const syncStatus = post.wp_pattern_sync_status;
|
||||
const fileContent = JSON.stringify(
|
||||
{
|
||||
__file: "wp_block",
|
||||
title,
|
||||
content,
|
||||
syncStatus
|
||||
},
|
||||
null,
|
||||
2
|
||||
);
|
||||
const fileName = paramCase(title) + ".json";
|
||||
(0,external_wp_blob_namespaceObject.downloadBlob)(fileName, fileContent, "application/json");
|
||||
}
|
||||
var export_default = exportReusableBlock;
|
||||
|
||||
|
||||
;// external ["wp","compose"]
|
||||
const external_wp_compose_namespaceObject = window["wp"]["compose"];
|
||||
;// external ["wp","components"]
|
||||
const external_wp_components_namespaceObject = window["wp"]["components"];
|
||||
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/file.js
|
||||
function readTextFile(file) {
|
||||
const reader = new window.FileReader();
|
||||
return new Promise((resolve) => {
|
||||
reader.onload = () => {
|
||||
resolve(reader.result);
|
||||
};
|
||||
reader.readAsText(file);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/import.js
|
||||
|
||||
|
||||
async function importReusableBlock(file) {
|
||||
const fileContent = await readTextFile(file);
|
||||
let parsedContent;
|
||||
try {
|
||||
parsedContent = JSON.parse(fileContent);
|
||||
} catch (e) {
|
||||
throw new Error("Invalid JSON file");
|
||||
}
|
||||
if (parsedContent.__file !== "wp_block" || !parsedContent.title || !parsedContent.content || typeof parsedContent.title !== "string" || typeof parsedContent.content !== "string" || parsedContent.syncStatus && typeof parsedContent.syncStatus !== "string") {
|
||||
throw new Error("Invalid pattern JSON file");
|
||||
}
|
||||
const postType = await external_wp_apiFetch_default()({ path: `/wp/v2/types/wp_block` });
|
||||
const reusableBlock = await external_wp_apiFetch_default()({
|
||||
path: `/wp/v2/${postType.rest_base}`,
|
||||
data: {
|
||||
title: parsedContent.title,
|
||||
content: parsedContent.content,
|
||||
status: "publish",
|
||||
meta: parsedContent.syncStatus === "unsynced" ? { wp_pattern_sync_status: parsedContent.syncStatus } : void 0
|
||||
},
|
||||
method: "POST"
|
||||
});
|
||||
return reusableBlock;
|
||||
}
|
||||
var import_default = importReusableBlock;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-form/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function ImportForm({ instanceId, onUpload }) {
|
||||
const inputId = "list-reusable-blocks-import-form-" + instanceId;
|
||||
const formRef = (0,external_wp_element_namespaceObject.useRef)();
|
||||
const [isLoading, setIsLoading] = (0,external_wp_element_namespaceObject.useState)(false);
|
||||
const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null);
|
||||
const [file, setFile] = (0,external_wp_element_namespaceObject.useState)(null);
|
||||
const onChangeFile = (event) => {
|
||||
setFile(event.target.files[0]);
|
||||
setError(null);
|
||||
};
|
||||
const onSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
if (!file) {
|
||||
return;
|
||||
}
|
||||
setIsLoading({ isLoading: true });
|
||||
import_default(file).then((reusableBlock) => {
|
||||
if (!formRef) {
|
||||
return;
|
||||
}
|
||||
setIsLoading(false);
|
||||
onUpload(reusableBlock);
|
||||
}).catch((errors) => {
|
||||
if (!formRef) {
|
||||
return;
|
||||
}
|
||||
let uiMessage;
|
||||
switch (errors.message) {
|
||||
case "Invalid JSON file":
|
||||
uiMessage = (0,external_wp_i18n_namespaceObject.__)("Invalid JSON file");
|
||||
break;
|
||||
case "Invalid pattern JSON file":
|
||||
uiMessage = (0,external_wp_i18n_namespaceObject.__)("Invalid pattern JSON file");
|
||||
break;
|
||||
default:
|
||||
uiMessage = (0,external_wp_i18n_namespaceObject.__)("Unknown error");
|
||||
}
|
||||
setIsLoading(false);
|
||||
setError(uiMessage);
|
||||
});
|
||||
};
|
||||
const onDismissError = () => {
|
||||
setError(null);
|
||||
};
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
|
||||
"form",
|
||||
{
|
||||
className: "list-reusable-blocks-import-form",
|
||||
onSubmit,
|
||||
ref: formRef,
|
||||
children: [
|
||||
error && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "error", onRemove: () => onDismissError(), children: error }),
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
"label",
|
||||
{
|
||||
htmlFor: inputId,
|
||||
className: "list-reusable-blocks-import-form__label",
|
||||
children: (0,external_wp_i18n_namespaceObject.__)("File")
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { id: inputId, type: "file", onChange: onChangeFile }),
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
external_wp_components_namespaceObject.Button,
|
||||
{
|
||||
__next40pxDefaultSize: true,
|
||||
type: "submit",
|
||||
isBusy: isLoading,
|
||||
accessibleWhenDisabled: true,
|
||||
disabled: !file || isLoading,
|
||||
variant: "secondary",
|
||||
className: "list-reusable-blocks-import-form__button",
|
||||
children: (0,external_wp_i18n_namespaceObject._x)("Import", "button label")
|
||||
}
|
||||
)
|
||||
]
|
||||
}
|
||||
);
|
||||
}
|
||||
var import_form_default = (0,external_wp_compose_namespaceObject.withInstanceId)(ImportForm);
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-dropdown/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function ImportDropdown({ onUpload }) {
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
external_wp_components_namespaceObject.Dropdown,
|
||||
{
|
||||
popoverProps: { placement: "bottom-start" },
|
||||
contentClassName: "list-reusable-blocks-import-dropdown__content",
|
||||
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
external_wp_components_namespaceObject.Button,
|
||||
{
|
||||
size: "compact",
|
||||
className: "list-reusable-blocks-import-dropdown__button",
|
||||
"aria-expanded": isOpen,
|
||||
onClick: onToggle,
|
||||
variant: "primary",
|
||||
children: (0,external_wp_i18n_namespaceObject.__)("Import from JSON")
|
||||
}
|
||||
),
|
||||
renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(import_form_default, { onUpload: (0,external_wp_compose_namespaceObject.pipe)(onClose, onUpload) })
|
||||
}
|
||||
);
|
||||
}
|
||||
var import_dropdown_default = ImportDropdown;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
document.body.addEventListener("click", (event) => {
|
||||
if (!event.target.classList.contains("wp-list-reusable-blocks__export")) {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
export_default(event.target.dataset.id);
|
||||
});
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const button = document.querySelector(".page-title-action");
|
||||
if (!button) {
|
||||
return;
|
||||
}
|
||||
const showNotice = () => {
|
||||
const notice = document.createElement("div");
|
||||
notice.className = "notice notice-success is-dismissible";
|
||||
notice.innerHTML = `<p>${(0,external_wp_i18n_namespaceObject.__)("Pattern imported successfully!")}</p>`;
|
||||
const headerEnd = document.querySelector(".wp-header-end");
|
||||
if (!headerEnd) {
|
||||
return;
|
||||
}
|
||||
headerEnd.parentNode.insertBefore(notice, headerEnd);
|
||||
};
|
||||
const container = document.createElement("div");
|
||||
container.className = "list-reusable-blocks__container";
|
||||
button.parentNode.insertBefore(container, button);
|
||||
(0,external_wp_element_namespaceObject.createRoot)(container).render(
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(import_dropdown_default, { onUpload: showNotice }) })
|
||||
);
|
||||
});
|
||||
|
||||
(window.wp = window.wp || {}).listReusableBlocks = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.ReactJSXRuntime,n=window.wp.element,o=window.wp.i18n;var r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function s(e){return e.toLowerCase()}var a=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],i=/[^A-Z0-9]+/gi;function l(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function c(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?a:n,r=t.stripRegexp,c=void 0===r?i:r,p=t.transform,d=void 0===p?s:p,u=t.delimiter,w=void 0===u?" ":u,f=l(l(e,o,"$1\0$2"),c,"\0"),m=0,b=f.length;"\0"===f.charAt(m);)m++;for(;"\0"===f.charAt(b-1);)b--;return f.slice(m,b).split("\0").map(d).join(w)}(e,r({delimiter:"."},t))}const p=window.wp.apiFetch;var d=e.n(p);const u=window.wp.blob;var w=async function(e){const t=await d()({path:"/wp/v2/types/wp_block"}),n=await d()({path:`/wp/v2/${t.rest_base}/${e}?context=edit`}),o=n.title.raw,s=n.content.raw,a=n.wp_pattern_sync_status,i=JSON.stringify({__file:"wp_block",title:o,content:s,syncStatus:a},null,2),l=(void 0===p&&(p={}),c(o,r({delimiter:"-"},p))+".json");var p;(0,u.downloadBlob)(l,i,"application/json")};const f=window.wp.compose,m=window.wp.components;var b=async function(e){const t=await function(e){const t=new window.FileReader;return new Promise((n=>{t.onload=()=>{n(t.result)},t.readAsText(e)}))}(e);let n;try{n=JSON.parse(t)}catch(e){throw new Error("Invalid JSON file")}if("wp_block"!==n.__file||!n.title||!n.content||"string"!=typeof n.title||"string"!=typeof n.content||n.syncStatus&&"string"!=typeof n.syncStatus)throw new Error("Invalid pattern JSON file");const o=await d()({path:"/wp/v2/types/wp_block"});return await d()({path:`/wp/v2/${o.rest_base}`,data:{title:n.title,content:n.content,status:"publish",meta:"unsynced"===n.syncStatus?{wp_pattern_sync_status:n.syncStatus}:void 0},method:"POST"})};var _=(0,f.withInstanceId)((function({instanceId:e,onUpload:r}){const s="list-reusable-blocks-import-form-"+e,a=(0,n.useRef)(),[i,l]=(0,n.useState)(!1),[c,p]=(0,n.useState)(null),[d,u]=(0,n.useState)(null);return(0,t.jsxs)("form",{className:"list-reusable-blocks-import-form",onSubmit:e=>{e.preventDefault(),d&&(l({isLoading:!0}),b(d).then((e=>{a&&(l(!1),r(e))})).catch((e=>{if(!a)return;let t;switch(e.message){case"Invalid JSON file":t=(0,o.__)("Invalid JSON file");break;case"Invalid pattern JSON file":t=(0,o.__)("Invalid pattern JSON file");break;default:t=(0,o.__)("Unknown error")}l(!1),p(t)})))},ref:a,children:[c&&(0,t.jsx)(m.Notice,{status:"error",onRemove:()=>{p(null)},children:c}),(0,t.jsx)("label",{htmlFor:s,className:"list-reusable-blocks-import-form__label",children:(0,o.__)("File")}),(0,t.jsx)("input",{id:s,type:"file",onChange:e=>{u(e.target.files[0]),p(null)}}),(0,t.jsx)(m.Button,{__next40pxDefaultSize:!0,type:"submit",isBusy:i,accessibleWhenDisabled:!0,disabled:!d||i,variant:"secondary",className:"list-reusable-blocks-import-form__button",children:(0,o._x)("Import","button label")})]})}));var v=function({onUpload:e}){return(0,t.jsx)(m.Dropdown,{popoverProps:{placement:"bottom-start"},contentClassName:"list-reusable-blocks-import-dropdown__content",renderToggle:({isOpen:e,onToggle:n})=>(0,t.jsx)(m.Button,{size:"compact",className:"list-reusable-blocks-import-dropdown__button","aria-expanded":e,onClick:n,variant:"primary",children:(0,o.__)("Import from JSON")}),renderContent:({onClose:n})=>(0,t.jsx)(_,{onUpload:(0,f.pipe)(n,e)})})};document.body.addEventListener("click",(e=>{e.target.classList.contains("wp-list-reusable-blocks__export")&&(e.preventDefault(),w(e.target.dataset.id))})),document.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector(".page-title-action");if(!e)return;const r=document.createElement("div");r.className="list-reusable-blocks__container",e.parentNode.insertBefore(r,e),(0,n.createRoot)(r).render((0,t.jsx)(n.StrictMode,{children:(0,t.jsx)(v,{onUpload:()=>{const e=document.createElement("div");e.className="notice notice-success is-dismissible",e.innerHTML=`<p>${(0,o.__)("Pattern imported successfully!")}</p>`;const t=document.querySelector(".wp-header-end");t&&t.parentNode.insertBefore(e,t)}})}))})),(window.wp=window.wp||{}).listReusableBlocks={}})();
|
||||
@@ -0,0 +1,860 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat get default export */
|
||||
/******/ (() => {
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = (module) => {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ () => (module['default']) :
|
||||
/******/ () => (module);
|
||||
/******/ __webpack_require__.d(getter, { a: getter });
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
MediaUpload: () => (/* reexport */ media_upload_default),
|
||||
privateApis: () => (/* reexport */ privateApis),
|
||||
transformAttachment: () => (/* reexport */ transformAttachment),
|
||||
uploadMedia: () => (/* reexport */ uploadMedia),
|
||||
validateFileSize: () => (/* reexport */ validateFileSize),
|
||||
validateMimeType: () => (/* reexport */ validateMimeType),
|
||||
validateMimeTypeForUser: () => (/* reexport */ validateMimeTypeForUser)
|
||||
});
|
||||
|
||||
;// external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// external ["wp","i18n"]
|
||||
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/components/media-upload/index.js
|
||||
|
||||
|
||||
const DEFAULT_EMPTY_GALLERY = [];
|
||||
const getFeaturedImageMediaFrame = () => {
|
||||
const { wp } = window;
|
||||
return wp.media.view.MediaFrame.Select.extend({
|
||||
/**
|
||||
* Enables the Set Featured Image Button.
|
||||
*
|
||||
* @param {Object} toolbar toolbar for featured image state
|
||||
* @return {void}
|
||||
*/
|
||||
featuredImageToolbar(toolbar) {
|
||||
this.createSelectToolbar(toolbar, {
|
||||
text: wp.media.view.l10n.setFeaturedImage,
|
||||
state: this.options.state
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Handle the edit state requirements of selected media item.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
editState() {
|
||||
const selection = this.state("featured-image").get("selection");
|
||||
const view = new wp.media.view.EditImage({
|
||||
model: selection.single(),
|
||||
controller: this
|
||||
}).render();
|
||||
this.content.set(view);
|
||||
view.loadEditor();
|
||||
},
|
||||
/**
|
||||
* Create the default states.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
createStates: function createStates() {
|
||||
this.on(
|
||||
"toolbar:create:featured-image",
|
||||
this.featuredImageToolbar,
|
||||
this
|
||||
);
|
||||
this.on("content:render:edit-image", this.editState, this);
|
||||
this.states.add([
|
||||
new wp.media.controller.FeaturedImage(),
|
||||
new wp.media.controller.EditImage({
|
||||
model: this.options.editImage
|
||||
})
|
||||
]);
|
||||
}
|
||||
});
|
||||
};
|
||||
const getSingleMediaFrame = () => {
|
||||
const { wp } = window;
|
||||
return wp.media.view.MediaFrame.Select.extend({
|
||||
/**
|
||||
* Create the default states on the frame.
|
||||
*/
|
||||
createStates() {
|
||||
const options = this.options;
|
||||
if (this.options.states) {
|
||||
return;
|
||||
}
|
||||
this.states.add([
|
||||
// Main states.
|
||||
new wp.media.controller.Library({
|
||||
library: wp.media.query(options.library),
|
||||
multiple: options.multiple,
|
||||
title: options.title,
|
||||
priority: 20,
|
||||
filterable: "uploaded"
|
||||
// Allow filtering by uploaded images.
|
||||
}),
|
||||
new wp.media.controller.EditImage({
|
||||
model: options.editImage
|
||||
})
|
||||
]);
|
||||
}
|
||||
});
|
||||
};
|
||||
const getGalleryDetailsMediaFrame = () => {
|
||||
const { wp } = window;
|
||||
return wp.media.view.MediaFrame.Post.extend({
|
||||
/**
|
||||
* Set up gallery toolbar.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
galleryToolbar() {
|
||||
const editing = this.state().get("editing");
|
||||
this.toolbar.set(
|
||||
new wp.media.view.Toolbar({
|
||||
controller: this,
|
||||
items: {
|
||||
insert: {
|
||||
style: "primary",
|
||||
text: editing ? wp.media.view.l10n.updateGallery : wp.media.view.l10n.insertGallery,
|
||||
priority: 80,
|
||||
requires: { library: true },
|
||||
/**
|
||||
* @fires wp.media.controller.State#update
|
||||
*/
|
||||
click() {
|
||||
const controller = this.controller, state = controller.state();
|
||||
controller.close();
|
||||
state.trigger(
|
||||
"update",
|
||||
state.get("library")
|
||||
);
|
||||
controller.setState(controller.options.state);
|
||||
controller.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Handle the edit state requirements of selected media item.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
editState() {
|
||||
const selection = this.state("gallery").get("selection");
|
||||
const view = new wp.media.view.EditImage({
|
||||
model: selection.single(),
|
||||
controller: this
|
||||
}).render();
|
||||
this.content.set(view);
|
||||
view.loadEditor();
|
||||
},
|
||||
/**
|
||||
* Create the default states.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
createStates: function createStates() {
|
||||
this.on("toolbar:create:main-gallery", this.galleryToolbar, this);
|
||||
this.on("content:render:edit-image", this.editState, this);
|
||||
this.states.add([
|
||||
new wp.media.controller.Library({
|
||||
id: "gallery",
|
||||
title: wp.media.view.l10n.createGalleryTitle,
|
||||
priority: 40,
|
||||
toolbar: "main-gallery",
|
||||
filterable: "uploaded",
|
||||
multiple: "add",
|
||||
editable: false,
|
||||
library: wp.media.query({
|
||||
type: "image",
|
||||
...this.options.library
|
||||
})
|
||||
}),
|
||||
new wp.media.controller.EditImage({
|
||||
model: this.options.editImage
|
||||
}),
|
||||
new wp.media.controller.GalleryEdit({
|
||||
library: this.options.selection,
|
||||
editing: this.options.editing,
|
||||
menu: "gallery",
|
||||
displaySettings: false,
|
||||
multiple: true
|
||||
}),
|
||||
new wp.media.controller.GalleryAdd()
|
||||
]);
|
||||
}
|
||||
});
|
||||
};
|
||||
const slimImageObject = (img) => {
|
||||
const attrSet = [
|
||||
"sizes",
|
||||
"mime",
|
||||
"type",
|
||||
"subtype",
|
||||
"id",
|
||||
"url",
|
||||
"alt",
|
||||
"link",
|
||||
"caption"
|
||||
];
|
||||
return attrSet.reduce((result, key) => {
|
||||
if (img?.hasOwnProperty(key)) {
|
||||
result[key] = img[key];
|
||||
}
|
||||
return result;
|
||||
}, {});
|
||||
};
|
||||
const getAttachmentsCollection = (ids) => {
|
||||
const { wp } = window;
|
||||
return wp.media.query({
|
||||
order: "ASC",
|
||||
orderby: "post__in",
|
||||
post__in: ids,
|
||||
posts_per_page: -1,
|
||||
query: true,
|
||||
type: "image"
|
||||
});
|
||||
};
|
||||
class MediaUpload extends external_wp_element_namespaceObject.Component {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.openModal = this.openModal.bind(this);
|
||||
this.onOpen = this.onOpen.bind(this);
|
||||
this.onSelect = this.onSelect.bind(this);
|
||||
this.onUpdate = this.onUpdate.bind(this);
|
||||
this.onClose = this.onClose.bind(this);
|
||||
}
|
||||
initializeListeners() {
|
||||
this.frame.on("select", this.onSelect);
|
||||
this.frame.on("update", this.onUpdate);
|
||||
this.frame.on("open", this.onOpen);
|
||||
this.frame.on("close", this.onClose);
|
||||
}
|
||||
/**
|
||||
* Sets the Gallery frame and initializes listeners.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
buildAndSetGalleryFrame() {
|
||||
const {
|
||||
addToGallery = false,
|
||||
allowedTypes,
|
||||
multiple = false,
|
||||
value = DEFAULT_EMPTY_GALLERY
|
||||
} = this.props;
|
||||
if (value === this.lastGalleryValue) {
|
||||
return;
|
||||
}
|
||||
const { wp } = window;
|
||||
this.lastGalleryValue = value;
|
||||
if (this.frame) {
|
||||
this.frame.remove();
|
||||
}
|
||||
let currentState;
|
||||
if (addToGallery) {
|
||||
currentState = "gallery-library";
|
||||
} else {
|
||||
currentState = value && value.length ? "gallery-edit" : "gallery";
|
||||
}
|
||||
if (!this.GalleryDetailsMediaFrame) {
|
||||
this.GalleryDetailsMediaFrame = getGalleryDetailsMediaFrame();
|
||||
}
|
||||
const attachments = getAttachmentsCollection(value);
|
||||
const selection = new wp.media.model.Selection(attachments.models, {
|
||||
props: attachments.props.toJSON(),
|
||||
multiple
|
||||
});
|
||||
this.frame = new this.GalleryDetailsMediaFrame({
|
||||
mimeType: allowedTypes,
|
||||
state: currentState,
|
||||
multiple,
|
||||
selection,
|
||||
editing: !!value?.length
|
||||
});
|
||||
wp.media.frame = this.frame;
|
||||
this.initializeListeners();
|
||||
}
|
||||
/**
|
||||
* Initializes the Media Library requirements for the featured image flow.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
buildAndSetFeatureImageFrame() {
|
||||
const { wp } = window;
|
||||
const { value: featuredImageId, multiple, allowedTypes } = this.props;
|
||||
const featuredImageFrame = getFeaturedImageMediaFrame();
|
||||
const attachments = getAttachmentsCollection(featuredImageId);
|
||||
const selection = new wp.media.model.Selection(attachments.models, {
|
||||
props: attachments.props.toJSON()
|
||||
});
|
||||
this.frame = new featuredImageFrame({
|
||||
mimeType: allowedTypes,
|
||||
state: "featured-image",
|
||||
multiple,
|
||||
selection,
|
||||
editing: featuredImageId
|
||||
});
|
||||
wp.media.frame = this.frame;
|
||||
wp.media.view.settings.post = {
|
||||
...wp.media.view.settings.post,
|
||||
featuredImageId: featuredImageId || -1
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Initializes the Media Library requirements for the single image flow.
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
buildAndSetSingleMediaFrame() {
|
||||
const { wp } = window;
|
||||
const {
|
||||
allowedTypes,
|
||||
multiple = false,
|
||||
title = (0,external_wp_i18n_namespaceObject.__)("Select or Upload Media"),
|
||||
value
|
||||
} = this.props;
|
||||
const frameConfig = {
|
||||
title,
|
||||
multiple
|
||||
};
|
||||
if (!!allowedTypes) {
|
||||
frameConfig.library = { type: allowedTypes };
|
||||
}
|
||||
if (this.frame) {
|
||||
this.frame.remove();
|
||||
}
|
||||
const singleImageFrame = getSingleMediaFrame();
|
||||
const attachments = getAttachmentsCollection(value);
|
||||
const selection = new wp.media.model.Selection(attachments.models, {
|
||||
props: attachments.props.toJSON()
|
||||
});
|
||||
this.frame = new singleImageFrame({
|
||||
mimeType: allowedTypes,
|
||||
multiple,
|
||||
selection,
|
||||
...frameConfig
|
||||
});
|
||||
wp.media.frame = this.frame;
|
||||
}
|
||||
componentWillUnmount() {
|
||||
this.frame?.remove();
|
||||
}
|
||||
onUpdate(selections) {
|
||||
const { onSelect, multiple = false } = this.props;
|
||||
const state = this.frame.state();
|
||||
const selectedImages = selections || state.get("selection");
|
||||
if (!selectedImages || !selectedImages.models.length) {
|
||||
return;
|
||||
}
|
||||
if (multiple) {
|
||||
onSelect(
|
||||
selectedImages.models.map(
|
||||
(model) => slimImageObject(model.toJSON())
|
||||
)
|
||||
);
|
||||
} else {
|
||||
onSelect(slimImageObject(selectedImages.models[0].toJSON()));
|
||||
}
|
||||
}
|
||||
onSelect() {
|
||||
const { onSelect, multiple = false } = this.props;
|
||||
const attachment = this.frame.state().get("selection").toJSON();
|
||||
onSelect(multiple ? attachment : attachment[0]);
|
||||
}
|
||||
onOpen() {
|
||||
const { wp } = window;
|
||||
const { value } = this.props;
|
||||
this.updateCollection();
|
||||
if (this.props.mode) {
|
||||
this.frame.content.mode(this.props.mode);
|
||||
}
|
||||
const hasMedia = Array.isArray(value) ? !!value?.length : !!value;
|
||||
if (!hasMedia) {
|
||||
return;
|
||||
}
|
||||
const isGallery = this.props.gallery;
|
||||
const selection = this.frame.state().get("selection");
|
||||
const valueArray = Array.isArray(value) ? value : [value];
|
||||
if (!isGallery) {
|
||||
valueArray.forEach((id) => {
|
||||
selection.add(wp.media.attachment(id));
|
||||
});
|
||||
}
|
||||
const attachments = getAttachmentsCollection(valueArray);
|
||||
attachments.more().done(function() {
|
||||
if (isGallery && attachments?.models?.length) {
|
||||
selection.add(attachments.models);
|
||||
}
|
||||
});
|
||||
}
|
||||
onClose() {
|
||||
const { onClose } = this.props;
|
||||
if (onClose) {
|
||||
onClose();
|
||||
}
|
||||
this.frame.detach();
|
||||
}
|
||||
updateCollection() {
|
||||
const frameContent = this.frame.content.get();
|
||||
if (frameContent && frameContent.collection) {
|
||||
const collection = frameContent.collection;
|
||||
collection.toArray().forEach((model) => model.trigger("destroy", model));
|
||||
collection.mirroring._hasMore = true;
|
||||
collection.more();
|
||||
}
|
||||
}
|
||||
openModal() {
|
||||
const {
|
||||
gallery = false,
|
||||
unstableFeaturedImageFlow = false,
|
||||
modalClass
|
||||
} = this.props;
|
||||
if (gallery) {
|
||||
this.buildAndSetGalleryFrame();
|
||||
} else {
|
||||
this.buildAndSetSingleMediaFrame();
|
||||
}
|
||||
if (modalClass) {
|
||||
this.frame.$el.addClass(modalClass);
|
||||
}
|
||||
if (unstableFeaturedImageFlow) {
|
||||
this.buildAndSetFeatureImageFrame();
|
||||
}
|
||||
this.initializeListeners();
|
||||
this.frame.open();
|
||||
}
|
||||
render() {
|
||||
return this.props.render({ open: this.openModal });
|
||||
}
|
||||
}
|
||||
var media_upload_default = MediaUpload;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/components/index.js
|
||||
|
||||
|
||||
|
||||
;// external ["wp","blob"]
|
||||
const external_wp_blob_namespaceObject = window["wp"]["blob"];
|
||||
;// external ["wp","apiFetch"]
|
||||
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
|
||||
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/utils/flatten-form-data.js
|
||||
function isPlainObject(data) {
|
||||
return data !== null && typeof data === "object" && Object.getPrototypeOf(data) === Object.prototype;
|
||||
}
|
||||
function flattenFormData(formData, key, data) {
|
||||
if (isPlainObject(data)) {
|
||||
for (const [name, value] of Object.entries(data)) {
|
||||
flattenFormData(formData, `${key}[${name}]`, value);
|
||||
}
|
||||
} else if (data !== void 0) {
|
||||
formData.append(key, String(data));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/utils/transform-attachment.js
|
||||
function transformAttachment(attachment) {
|
||||
const { alt_text, source_url, ...savedMediaProps } = attachment;
|
||||
return {
|
||||
...savedMediaProps,
|
||||
alt: attachment.alt_text,
|
||||
caption: attachment.caption?.raw ?? "",
|
||||
title: attachment.title.raw,
|
||||
url: attachment.source_url,
|
||||
poster: attachment._embedded?.["wp:featuredmedia"]?.[0]?.source_url || void 0
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/utils/upload-to-server.js
|
||||
|
||||
|
||||
|
||||
async function uploadToServer(file, additionalData = {}, signal) {
|
||||
const data = new FormData();
|
||||
data.append("file", file, file.name || file.type.replace("/", "."));
|
||||
for (const [key, value] of Object.entries(additionalData)) {
|
||||
flattenFormData(
|
||||
data,
|
||||
key,
|
||||
value
|
||||
);
|
||||
}
|
||||
return transformAttachment(
|
||||
await external_wp_apiFetch_default()({
|
||||
// This allows the video block to directly get a video's poster image.
|
||||
path: "/wp/v2/media?_embed=wp:featuredmedia",
|
||||
body: data,
|
||||
method: "POST",
|
||||
signal
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/utils/upload-error.js
|
||||
class UploadError extends Error {
|
||||
code;
|
||||
file;
|
||||
constructor({ code, message, file, cause }) {
|
||||
super(message, { cause });
|
||||
Object.setPrototypeOf(this, new.target.prototype);
|
||||
this.code = code;
|
||||
this.file = file;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/utils/validate-mime-type.js
|
||||
|
||||
|
||||
function validateMimeType(file, allowedTypes) {
|
||||
if (!allowedTypes) {
|
||||
return;
|
||||
}
|
||||
const isAllowedType = allowedTypes.some((allowedType) => {
|
||||
if (allowedType.includes("/")) {
|
||||
return allowedType === file.type;
|
||||
}
|
||||
return file.type.startsWith(`${allowedType}/`);
|
||||
});
|
||||
if (file.type && !isAllowedType) {
|
||||
throw new UploadError({
|
||||
code: "MIME_TYPE_NOT_SUPPORTED",
|
||||
message: (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
// translators: %s: file name.
|
||||
(0,external_wp_i18n_namespaceObject.__)("%s: Sorry, this file type is not supported here."),
|
||||
file.name
|
||||
),
|
||||
file
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/utils/get-mime-types-array.js
|
||||
function getMimeTypesArray(wpMimeTypesObject) {
|
||||
if (!wpMimeTypesObject) {
|
||||
return null;
|
||||
}
|
||||
return Object.entries(wpMimeTypesObject).flatMap(
|
||||
([extensionsString, mime]) => {
|
||||
const [type] = mime.split("/");
|
||||
const extensions = extensionsString.split("|");
|
||||
return [
|
||||
mime,
|
||||
...extensions.map(
|
||||
(extension) => `${type}/${extension}`
|
||||
)
|
||||
];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/utils/validate-mime-type-for-user.js
|
||||
|
||||
|
||||
|
||||
function validateMimeTypeForUser(file, wpAllowedMimeTypes) {
|
||||
const allowedMimeTypesForUser = getMimeTypesArray(wpAllowedMimeTypes);
|
||||
if (!allowedMimeTypesForUser) {
|
||||
return;
|
||||
}
|
||||
const isAllowedMimeTypeForUser = allowedMimeTypesForUser.includes(
|
||||
file.type
|
||||
);
|
||||
if (file.type && !isAllowedMimeTypeForUser) {
|
||||
throw new UploadError({
|
||||
code: "MIME_TYPE_NOT_ALLOWED_FOR_USER",
|
||||
message: (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
// translators: %s: file name.
|
||||
(0,external_wp_i18n_namespaceObject.__)(
|
||||
"%s: Sorry, you are not allowed to upload this file type."
|
||||
),
|
||||
file.name
|
||||
),
|
||||
file
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/utils/validate-file-size.js
|
||||
|
||||
|
||||
function validateFileSize(file, maxUploadFileSize) {
|
||||
if (file.size <= 0) {
|
||||
throw new UploadError({
|
||||
code: "EMPTY_FILE",
|
||||
message: (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
// translators: %s: file name.
|
||||
(0,external_wp_i18n_namespaceObject.__)("%s: This file is empty."),
|
||||
file.name
|
||||
),
|
||||
file
|
||||
});
|
||||
}
|
||||
if (maxUploadFileSize && file.size > maxUploadFileSize) {
|
||||
throw new UploadError({
|
||||
code: "SIZE_ABOVE_LIMIT",
|
||||
message: (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
// translators: %s: file name.
|
||||
(0,external_wp_i18n_namespaceObject.__)(
|
||||
"%s: This file exceeds the maximum upload size for this site."
|
||||
),
|
||||
file.name
|
||||
),
|
||||
file
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/utils/upload-media.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function uploadMedia({
|
||||
wpAllowedMimeTypes,
|
||||
allowedTypes,
|
||||
additionalData = {},
|
||||
filesList,
|
||||
maxUploadFileSize,
|
||||
onError,
|
||||
onFileChange,
|
||||
signal,
|
||||
multiple = true
|
||||
}) {
|
||||
if (!multiple && filesList.length > 1) {
|
||||
onError?.(new Error((0,external_wp_i18n_namespaceObject.__)("Only one file can be used here.")));
|
||||
return;
|
||||
}
|
||||
const validFiles = [];
|
||||
const filesSet = [];
|
||||
const setAndUpdateFiles = (index, value) => {
|
||||
if (!window.__experimentalMediaProcessing) {
|
||||
if (filesSet[index]?.url) {
|
||||
(0,external_wp_blob_namespaceObject.revokeBlobURL)(filesSet[index].url);
|
||||
}
|
||||
}
|
||||
filesSet[index] = value;
|
||||
onFileChange?.(
|
||||
filesSet.filter((attachment) => attachment !== null)
|
||||
);
|
||||
};
|
||||
for (const mediaFile of filesList) {
|
||||
try {
|
||||
validateMimeTypeForUser(mediaFile, wpAllowedMimeTypes);
|
||||
} catch (error) {
|
||||
onError?.(error);
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
validateMimeType(mediaFile, allowedTypes);
|
||||
} catch (error) {
|
||||
onError?.(error);
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
validateFileSize(mediaFile, maxUploadFileSize);
|
||||
} catch (error) {
|
||||
onError?.(error);
|
||||
continue;
|
||||
}
|
||||
validFiles.push(mediaFile);
|
||||
if (!window.__experimentalMediaProcessing) {
|
||||
filesSet.push({ url: (0,external_wp_blob_namespaceObject.createBlobURL)(mediaFile) });
|
||||
onFileChange?.(filesSet);
|
||||
}
|
||||
}
|
||||
validFiles.map(async (file, index) => {
|
||||
try {
|
||||
const attachment = await uploadToServer(
|
||||
file,
|
||||
additionalData,
|
||||
signal
|
||||
);
|
||||
setAndUpdateFiles(index, attachment);
|
||||
} catch (error) {
|
||||
setAndUpdateFiles(index, null);
|
||||
let message;
|
||||
if (typeof error === "object" && error !== null && "message" in error) {
|
||||
message = typeof error.message === "string" ? error.message : String(error.message);
|
||||
} else {
|
||||
message = (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
// translators: %s: file name
|
||||
(0,external_wp_i18n_namespaceObject.__)("Error while uploading file %s to the media library."),
|
||||
file.name
|
||||
);
|
||||
}
|
||||
onError?.(
|
||||
new UploadError({
|
||||
code: "GENERAL",
|
||||
message,
|
||||
file,
|
||||
cause: error instanceof Error ? error : void 0
|
||||
})
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/utils/sideload-to-server.js
|
||||
|
||||
|
||||
|
||||
async function sideloadToServer(file, attachmentId, additionalData = {}, signal) {
|
||||
const data = new FormData();
|
||||
data.append("file", file, file.name || file.type.replace("/", "."));
|
||||
for (const [key, value] of Object.entries(additionalData)) {
|
||||
flattenFormData(
|
||||
data,
|
||||
key,
|
||||
value
|
||||
);
|
||||
}
|
||||
return transformAttachment(
|
||||
await external_wp_apiFetch_default()({
|
||||
path: `/wp/v2/media/${attachmentId}/sideload`,
|
||||
body: data,
|
||||
method: "POST",
|
||||
signal
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/utils/sideload-media.js
|
||||
|
||||
|
||||
|
||||
const noop = () => {
|
||||
};
|
||||
async function sideloadMedia({
|
||||
file,
|
||||
attachmentId,
|
||||
additionalData = {},
|
||||
signal,
|
||||
onFileChange,
|
||||
onError = noop
|
||||
}) {
|
||||
try {
|
||||
const attachment = await sideloadToServer(
|
||||
file,
|
||||
attachmentId,
|
||||
additionalData,
|
||||
signal
|
||||
);
|
||||
onFileChange?.([attachment]);
|
||||
} catch (error) {
|
||||
let message;
|
||||
if (error instanceof Error) {
|
||||
message = error.message;
|
||||
} else {
|
||||
message = (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
// translators: %s: file name
|
||||
(0,external_wp_i18n_namespaceObject.__)("Error while sideloading file %s to the server."),
|
||||
file.name
|
||||
);
|
||||
}
|
||||
onError(
|
||||
new UploadError({
|
||||
code: "GENERAL",
|
||||
message,
|
||||
file,
|
||||
cause: error instanceof Error ? error : void 0
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
;// external ["wp","privateApis"]
|
||||
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/lock-unlock.js
|
||||
|
||||
const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__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/media-utils"
|
||||
);
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/private-apis.js
|
||||
|
||||
|
||||
const privateApis = {};
|
||||
lock(privateApis, {
|
||||
sideloadMedia: sideloadMedia
|
||||
});
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/media-utils/build-module/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).mediaUtils = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+2
File diff suppressed because one or more lines are too long
@@ -0,0 +1,209 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
store: () => (/* reexport */ store)
|
||||
});
|
||||
|
||||
// NAMESPACE OBJECT: ./node_modules/@wordpress/notices/build-module/store/actions.js
|
||||
var actions_namespaceObject = {};
|
||||
__webpack_require__.r(actions_namespaceObject);
|
||||
__webpack_require__.d(actions_namespaceObject, {
|
||||
createErrorNotice: () => (createErrorNotice),
|
||||
createInfoNotice: () => (createInfoNotice),
|
||||
createNotice: () => (createNotice),
|
||||
createSuccessNotice: () => (createSuccessNotice),
|
||||
createWarningNotice: () => (createWarningNotice),
|
||||
removeAllNotices: () => (removeAllNotices),
|
||||
removeNotice: () => (removeNotice),
|
||||
removeNotices: () => (removeNotices)
|
||||
});
|
||||
|
||||
// NAMESPACE OBJECT: ./node_modules/@wordpress/notices/build-module/store/selectors.js
|
||||
var selectors_namespaceObject = {};
|
||||
__webpack_require__.r(selectors_namespaceObject);
|
||||
__webpack_require__.d(selectors_namespaceObject, {
|
||||
getNotices: () => (getNotices)
|
||||
});
|
||||
|
||||
;// external ["wp","data"]
|
||||
const external_wp_data_namespaceObject = window["wp"]["data"];
|
||||
;// ./node_modules/@wordpress/notices/build-module/store/utils/on-sub-key.js
|
||||
const onSubKey = (actionProperty) => (reducer) => (state = {}, action) => {
|
||||
const key = action[actionProperty];
|
||||
if (key === void 0) {
|
||||
return state;
|
||||
}
|
||||
const nextKeyState = reducer(state[key], action);
|
||||
if (nextKeyState === state[key]) {
|
||||
return state;
|
||||
}
|
||||
return {
|
||||
...state,
|
||||
[key]: nextKeyState
|
||||
};
|
||||
};
|
||||
var on_sub_key_default = onSubKey;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/notices/build-module/store/reducer.js
|
||||
|
||||
const notices = on_sub_key_default("context")((state = [], action) => {
|
||||
switch (action.type) {
|
||||
case "CREATE_NOTICE":
|
||||
return [
|
||||
...state.filter(({ id }) => id !== action.notice.id),
|
||||
action.notice
|
||||
];
|
||||
case "REMOVE_NOTICE":
|
||||
return state.filter(({ id }) => id !== action.id);
|
||||
case "REMOVE_NOTICES":
|
||||
return state.filter(({ id }) => !action.ids.includes(id));
|
||||
case "REMOVE_ALL_NOTICES":
|
||||
return state.filter(({ type }) => type !== action.noticeType);
|
||||
}
|
||||
return state;
|
||||
});
|
||||
var reducer_default = notices;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/notices/build-module/store/constants.js
|
||||
const DEFAULT_CONTEXT = "global";
|
||||
const DEFAULT_STATUS = "info";
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/notices/build-module/store/actions.js
|
||||
|
||||
let uniqueId = 0;
|
||||
function createNotice(status = DEFAULT_STATUS, content, options = {}) {
|
||||
const {
|
||||
speak = true,
|
||||
isDismissible = true,
|
||||
context = DEFAULT_CONTEXT,
|
||||
id = `${context}${++uniqueId}`,
|
||||
actions = [],
|
||||
type = "default",
|
||||
__unstableHTML,
|
||||
icon = null,
|
||||
explicitDismiss = false,
|
||||
onDismiss
|
||||
} = options;
|
||||
content = String(content);
|
||||
return {
|
||||
type: "CREATE_NOTICE",
|
||||
context,
|
||||
notice: {
|
||||
id,
|
||||
status,
|
||||
content,
|
||||
spokenMessage: speak ? content : null,
|
||||
__unstableHTML,
|
||||
isDismissible,
|
||||
actions,
|
||||
type,
|
||||
icon,
|
||||
explicitDismiss,
|
||||
onDismiss
|
||||
}
|
||||
};
|
||||
}
|
||||
function createSuccessNotice(content, options) {
|
||||
return createNotice("success", content, options);
|
||||
}
|
||||
function createInfoNotice(content, options) {
|
||||
return createNotice("info", content, options);
|
||||
}
|
||||
function createErrorNotice(content, options) {
|
||||
return createNotice("error", content, options);
|
||||
}
|
||||
function createWarningNotice(content, options) {
|
||||
return createNotice("warning", content, options);
|
||||
}
|
||||
function removeNotice(id, context = DEFAULT_CONTEXT) {
|
||||
return {
|
||||
type: "REMOVE_NOTICE",
|
||||
id,
|
||||
context
|
||||
};
|
||||
}
|
||||
function removeAllNotices(noticeType = "default", context = DEFAULT_CONTEXT) {
|
||||
return {
|
||||
type: "REMOVE_ALL_NOTICES",
|
||||
noticeType,
|
||||
context
|
||||
};
|
||||
}
|
||||
function removeNotices(ids, context = DEFAULT_CONTEXT) {
|
||||
return {
|
||||
type: "REMOVE_NOTICES",
|
||||
ids,
|
||||
context
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/notices/build-module/store/selectors.js
|
||||
|
||||
const DEFAULT_NOTICES = [];
|
||||
function getNotices(state, context = DEFAULT_CONTEXT) {
|
||||
return state[context] || DEFAULT_NOTICES;
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/notices/build-module/store/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
const store = (0,external_wp_data_namespaceObject.createReduxStore)("core/notices", {
|
||||
reducer: reducer_default,
|
||||
actions: actions_namespaceObject,
|
||||
selectors: selectors_namespaceObject
|
||||
});
|
||||
(0,external_wp_data_namespaceObject.register)(store);
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/notices/build-module/index.js
|
||||
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).notices = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:()=>_});var n={};e.r(n),e.d(n,{createErrorNotice:()=>f,createInfoNotice:()=>d,createNotice:()=>a,createSuccessNotice:()=>l,createWarningNotice:()=>E,removeAllNotices:()=>y,removeNotice:()=>p,removeNotices:()=>O});var i={};e.r(i),e.d(i,{getNotices:()=>T});const r=window.wp.data;var o=(e=>t=>(n={},i)=>{const r=i[e];if(void 0===r)return n;const o=t(n[r],i);return o===n[r]?n:{...n,[r]:o}})("context")(((e=[],t)=>{switch(t.type){case"CREATE_NOTICE":return[...e.filter((({id:e})=>e!==t.notice.id)),t.notice];case"REMOVE_NOTICE":return e.filter((({id:e})=>e!==t.id));case"REMOVE_NOTICES":return e.filter((({id:e})=>!t.ids.includes(e)));case"REMOVE_ALL_NOTICES":return e.filter((({type:e})=>e!==t.noticeType))}return e}));const c="global",s="info";let u=0;function a(e=s,t,n={}){const{speak:i=!0,isDismissible:r=!0,context:o=c,id:a=`${o}${++u}`,actions:l=[],type:d="default",__unstableHTML:f,icon:E=null,explicitDismiss:p=!1,onDismiss:y}=n;return{type:"CREATE_NOTICE",context:o,notice:{id:a,status:e,content:t=String(t),spokenMessage:i?t:null,__unstableHTML:f,isDismissible:r,actions:l,type:d,icon:E,explicitDismiss:p,onDismiss:y}}}function l(e,t){return a("success",e,t)}function d(e,t){return a("info",e,t)}function f(e,t){return a("error",e,t)}function E(e,t){return a("warning",e,t)}function p(e,t=c){return{type:"REMOVE_NOTICE",id:e,context:t}}function y(e="default",t=c){return{type:"REMOVE_ALL_NOTICES",noticeType:e,context:t}}function O(e,t=c){return{type:"REMOVE_NOTICES",ids:e,context:t}}const N=[];function T(e,t=c){return e[t]||N}const _=(0,r.createReduxStore)("core/notices",{reducer:o,actions:n,selectors:i});(0,r.register)(_),(window.wp=window.wp||{}).notices=t})();
|
||||
@@ -0,0 +1,323 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat get default export */
|
||||
/******/ (() => {
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = (module) => {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ () => (module['default']) :
|
||||
/******/ () => (module);
|
||||
/******/ __webpack_require__.d(getter, { a: getter });
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
DotTip: () => (/* reexport */ dot_tip_default),
|
||||
store: () => (/* reexport */ store)
|
||||
});
|
||||
|
||||
// NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/actions.js
|
||||
var actions_namespaceObject = {};
|
||||
__webpack_require__.r(actions_namespaceObject);
|
||||
__webpack_require__.d(actions_namespaceObject, {
|
||||
disableTips: () => (disableTips),
|
||||
dismissTip: () => (dismissTip),
|
||||
enableTips: () => (enableTips),
|
||||
triggerGuide: () => (triggerGuide)
|
||||
});
|
||||
|
||||
// NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/selectors.js
|
||||
var selectors_namespaceObject = {};
|
||||
__webpack_require__.r(selectors_namespaceObject);
|
||||
__webpack_require__.d(selectors_namespaceObject, {
|
||||
areTipsEnabled: () => (selectors_areTipsEnabled),
|
||||
getAssociatedGuide: () => (getAssociatedGuide),
|
||||
isTipVisible: () => (isTipVisible)
|
||||
});
|
||||
|
||||
;// external ["wp","deprecated"]
|
||||
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
|
||||
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
|
||||
;// external ["wp","data"]
|
||||
const external_wp_data_namespaceObject = window["wp"]["data"];
|
||||
;// ./node_modules/@wordpress/nux/build-module/store/reducer.js
|
||||
|
||||
function guides(state = [], action) {
|
||||
switch (action.type) {
|
||||
case "TRIGGER_GUIDE":
|
||||
return [...state, action.tipIds];
|
||||
}
|
||||
return state;
|
||||
}
|
||||
function areTipsEnabled(state = true, action) {
|
||||
switch (action.type) {
|
||||
case "DISABLE_TIPS":
|
||||
return false;
|
||||
case "ENABLE_TIPS":
|
||||
return true;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
function dismissedTips(state = {}, action) {
|
||||
switch (action.type) {
|
||||
case "DISMISS_TIP":
|
||||
return {
|
||||
...state,
|
||||
[action.id]: true
|
||||
};
|
||||
case "ENABLE_TIPS":
|
||||
return {};
|
||||
}
|
||||
return state;
|
||||
}
|
||||
const preferences = (0,external_wp_data_namespaceObject.combineReducers)({ areTipsEnabled, dismissedTips });
|
||||
var reducer_default = (0,external_wp_data_namespaceObject.combineReducers)({ guides, preferences });
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/nux/build-module/store/actions.js
|
||||
function triggerGuide(tipIds) {
|
||||
return {
|
||||
type: "TRIGGER_GUIDE",
|
||||
tipIds
|
||||
};
|
||||
}
|
||||
function dismissTip(id) {
|
||||
return {
|
||||
type: "DISMISS_TIP",
|
||||
id
|
||||
};
|
||||
}
|
||||
function disableTips() {
|
||||
return {
|
||||
type: "DISABLE_TIPS"
|
||||
};
|
||||
}
|
||||
function enableTips() {
|
||||
return {
|
||||
type: "ENABLE_TIPS"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/nux/build-module/store/selectors.js
|
||||
|
||||
const getAssociatedGuide = (0,external_wp_data_namespaceObject.createSelector)(
|
||||
(state, tipId) => {
|
||||
for (const tipIds of state.guides) {
|
||||
if (tipIds.includes(tipId)) {
|
||||
const nonDismissedTips = tipIds.filter(
|
||||
(tId) => !Object.keys(
|
||||
state.preferences.dismissedTips
|
||||
).includes(tId)
|
||||
);
|
||||
const [currentTipId = null, nextTipId = null] = nonDismissedTips;
|
||||
return { tipIds, currentTipId, nextTipId };
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
(state) => [state.guides, state.preferences.dismissedTips]
|
||||
);
|
||||
function isTipVisible(state, tipId) {
|
||||
if (!state.preferences.areTipsEnabled) {
|
||||
return false;
|
||||
}
|
||||
if (state.preferences.dismissedTips?.hasOwnProperty(tipId)) {
|
||||
return false;
|
||||
}
|
||||
const associatedGuide = getAssociatedGuide(state, tipId);
|
||||
if (associatedGuide && associatedGuide.currentTipId !== tipId) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function selectors_areTipsEnabled(state) {
|
||||
return state.preferences.areTipsEnabled;
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/nux/build-module/store/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
const STORE_NAME = "core/nux";
|
||||
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
|
||||
reducer: reducer_default,
|
||||
actions: actions_namespaceObject,
|
||||
selectors: selectors_namespaceObject,
|
||||
persist: ["preferences"]
|
||||
});
|
||||
(0,external_wp_data_namespaceObject.registerStore)(STORE_NAME, {
|
||||
reducer: reducer_default,
|
||||
actions: actions_namespaceObject,
|
||||
selectors: selectors_namespaceObject,
|
||||
persist: ["preferences"]
|
||||
});
|
||||
|
||||
|
||||
;// external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// external ["wp","compose"]
|
||||
const external_wp_compose_namespaceObject = window["wp"]["compose"];
|
||||
;// external ["wp","components"]
|
||||
const external_wp_components_namespaceObject = window["wp"]["components"];
|
||||
;// external ["wp","i18n"]
|
||||
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
|
||||
;// external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// external ["wp","primitives"]
|
||||
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
|
||||
;// ./node_modules/@wordpress/icons/build-module/library/close.js
|
||||
|
||||
|
||||
var close_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" }) });
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/nux/build-module/components/dot-tip/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function onClick(event) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
function DotTip({
|
||||
position = "middle right",
|
||||
children,
|
||||
isVisible,
|
||||
hasNextTip,
|
||||
onDismiss,
|
||||
onDisable
|
||||
}) {
|
||||
const anchorParent = (0,external_wp_element_namespaceObject.useRef)(null);
|
||||
const onFocusOutsideCallback = (0,external_wp_element_namespaceObject.useCallback)(
|
||||
(event) => {
|
||||
if (!anchorParent.current) {
|
||||
return;
|
||||
}
|
||||
if (anchorParent.current.contains(event.relatedTarget)) {
|
||||
return;
|
||||
}
|
||||
onDisable();
|
||||
},
|
||||
[onDisable, anchorParent]
|
||||
);
|
||||
if (!isVisible) {
|
||||
return null;
|
||||
}
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
|
||||
external_wp_components_namespaceObject.Popover,
|
||||
{
|
||||
className: "nux-dot-tip",
|
||||
position,
|
||||
focusOnMount: true,
|
||||
role: "dialog",
|
||||
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Editor tips"),
|
||||
onClick,
|
||||
onFocusOutside: onFocusOutsideCallback,
|
||||
children: [
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children }),
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
external_wp_components_namespaceObject.Button,
|
||||
{
|
||||
__next40pxDefaultSize: true,
|
||||
variant: "link",
|
||||
onClick: onDismiss,
|
||||
children: hasNextTip ? (0,external_wp_i18n_namespaceObject.__)("See next tip") : (0,external_wp_i18n_namespaceObject.__)("Got it")
|
||||
}
|
||||
) }),
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
external_wp_components_namespaceObject.Button,
|
||||
{
|
||||
size: "small",
|
||||
className: "nux-dot-tip__disable",
|
||||
icon: close_default,
|
||||
label: (0,external_wp_i18n_namespaceObject.__)("Disable tips"),
|
||||
onClick: onDisable
|
||||
}
|
||||
)
|
||||
]
|
||||
}
|
||||
);
|
||||
}
|
||||
var dot_tip_default = (0,external_wp_compose_namespaceObject.compose)(
|
||||
(0,external_wp_data_namespaceObject.withSelect)((select, { tipId }) => {
|
||||
const { isTipVisible, getAssociatedGuide } = select(store);
|
||||
const associatedGuide = getAssociatedGuide(tipId);
|
||||
return {
|
||||
isVisible: isTipVisible(tipId),
|
||||
hasNextTip: !!(associatedGuide && associatedGuide.nextTipId)
|
||||
};
|
||||
}),
|
||||
(0,external_wp_data_namespaceObject.withDispatch)((dispatch, { tipId }) => {
|
||||
const { dismissTip, disableTips } = dispatch(store);
|
||||
return {
|
||||
onDismiss() {
|
||||
dismissTip(tipId);
|
||||
},
|
||||
onDisable() {
|
||||
disableTips();
|
||||
}
|
||||
};
|
||||
})
|
||||
)(DotTip);
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/nux/build-module/index.js
|
||||
|
||||
|
||||
|
||||
external_wp_deprecated_default()("wp.nux", {
|
||||
since: "5.4",
|
||||
hint: "wp.components.Guide can be used to show a user guide.",
|
||||
version: "6.2"
|
||||
});
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).nux = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={n:i=>{var n=i&&i.__esModule?()=>i.default:()=>i;return e.d(n,{a:n}),n},d:(i,n)=>{for(var t in n)e.o(n,t)&&!e.o(i,t)&&Object.defineProperty(i,t,{enumerable:!0,get:n[t]})},o:(e,i)=>Object.prototype.hasOwnProperty.call(e,i),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},i={};e.r(i),e.d(i,{DotTip:()=>E,store:()=>m});var n={};e.r(n),e.d(n,{disableTips:()=>a,dismissTip:()=>u,enableTips:()=>l,triggerGuide:()=>p});var t={};e.r(t),e.d(t,{areTipsEnabled:()=>T,getAssociatedGuide:()=>w,isTipVisible:()=>f});const s=window.wp.deprecated;var r=e.n(s);const o=window.wp.data;const c=(0,o.combineReducers)({areTipsEnabled:function(e=!0,i){switch(i.type){case"DISABLE_TIPS":return!1;case"ENABLE_TIPS":return!0}return e},dismissedTips:function(e={},i){switch(i.type){case"DISMISS_TIP":return{...e,[i.id]:!0};case"ENABLE_TIPS":return{}}return e}});var d=(0,o.combineReducers)({guides:function(e=[],i){return"TRIGGER_GUIDE"===i.type?[...e,i.tipIds]:e},preferences:c});function p(e){return{type:"TRIGGER_GUIDE",tipIds:e}}function u(e){return{type:"DISMISS_TIP",id:e}}function a(){return{type:"DISABLE_TIPS"}}function l(){return{type:"ENABLE_TIPS"}}const w=(0,o.createSelector)(((e,i)=>{for(const n of e.guides)if(n.includes(i)){const i=n.filter((i=>!Object.keys(e.preferences.dismissedTips).includes(i))),[t=null,s=null]=i;return{tipIds:n,currentTipId:t,nextTipId:s}}return null}),(e=>[e.guides,e.preferences.dismissedTips]));function f(e,i){if(!e.preferences.areTipsEnabled)return!1;if(e.preferences.dismissedTips?.hasOwnProperty(i))return!1;const n=w(e,i);return!n||n.currentTipId===i}function T(e){return e.preferences.areTipsEnabled}const b="core/nux",m=(0,o.createReduxStore)(b,{reducer:d,actions:n,selectors:t,persist:["preferences"]});(0,o.registerStore)(b,{reducer:d,actions:n,selectors:t,persist:["preferences"]});const I=window.ReactJSXRuntime,S=window.wp.compose,_=window.wp.components,x=window.wp.i18n,g=window.wp.element,h=window.wp.primitives;var y=(0,I.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,I.jsx)(h.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})});function v(e){e.stopPropagation()}var E=(0,S.compose)((0,o.withSelect)(((e,{tipId:i})=>{const{isTipVisible:n,getAssociatedGuide:t}=e(m),s=t(i);return{isVisible:n(i),hasNextTip:!(!s||!s.nextTipId)}})),(0,o.withDispatch)(((e,{tipId:i})=>{const{dismissTip:n,disableTips:t}=e(m);return{onDismiss(){n(i)},onDisable(){t()}}})))((function({position:e="middle right",children:i,isVisible:n,hasNextTip:t,onDismiss:s,onDisable:r}){const o=(0,g.useRef)(null),c=(0,g.useCallback)((e=>{o.current&&(o.current.contains(e.relatedTarget)||r())}),[r,o]);return n?(0,I.jsxs)(_.Popover,{className:"nux-dot-tip",position:e,focusOnMount:!0,role:"dialog","aria-label":(0,x.__)("Editor tips"),onClick:v,onFocusOutside:c,children:[(0,I.jsx)("p",{children:i}),(0,I.jsx)("p",{children:(0,I.jsx)(_.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:s,children:t?(0,x.__)("See next tip"):(0,x.__)("Got it")})}),(0,I.jsx)(_.Button,{size:"small",className:"nux-dot-tip__disable",icon:y,label:(0,x.__)("Disable tips"),onClick:r})]}):null}));r()("wp.nux",{since:"5.4",hint:"wp.components.Guide can be used to show a user guide.",version:"6.2"}),(window.wp=window.wp||{}).nux=i})();
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,458 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat get default export */
|
||||
/******/ (() => {
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = (module) => {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ () => (module['default']) :
|
||||
/******/ () => (module);
|
||||
/******/ __webpack_require__.d(getter, { a: getter });
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
PluginArea: () => (/* reexport */ plugin_area_default),
|
||||
getPlugin: () => (/* reexport */ getPlugin),
|
||||
getPlugins: () => (/* reexport */ getPlugins),
|
||||
registerPlugin: () => (/* reexport */ registerPlugin),
|
||||
unregisterPlugin: () => (/* reexport */ unregisterPlugin),
|
||||
usePluginContext: () => (/* reexport */ usePluginContext),
|
||||
withPluginContext: () => (/* reexport */ withPluginContext)
|
||||
});
|
||||
|
||||
;// external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// ./node_modules/memize/dist/index.js
|
||||
/**
|
||||
* Memize options object.
|
||||
*
|
||||
* @typedef MemizeOptions
|
||||
*
|
||||
* @property {number} [maxSize] Maximum size of the cache.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Internal cache entry.
|
||||
*
|
||||
* @typedef MemizeCacheNode
|
||||
*
|
||||
* @property {?MemizeCacheNode|undefined} [prev] Previous node.
|
||||
* @property {?MemizeCacheNode|undefined} [next] Next node.
|
||||
* @property {Array<*>} args Function arguments for cache
|
||||
* entry.
|
||||
* @property {*} val Function result.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Properties of the enhanced function for controlling cache.
|
||||
*
|
||||
* @typedef MemizeMemoizedFunction
|
||||
*
|
||||
* @property {()=>void} clear Clear the cache.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Accepts a function to be memoized, and returns a new memoized function, with
|
||||
* optional options.
|
||||
*
|
||||
* @template {(...args: any[]) => any} F
|
||||
*
|
||||
* @param {F} fn Function to memoize.
|
||||
* @param {MemizeOptions} [options] Options object.
|
||||
*
|
||||
* @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function.
|
||||
*/
|
||||
function memize(fn, options) {
|
||||
var size = 0;
|
||||
|
||||
/** @type {?MemizeCacheNode|undefined} */
|
||||
var head;
|
||||
|
||||
/** @type {?MemizeCacheNode|undefined} */
|
||||
var tail;
|
||||
|
||||
options = options || {};
|
||||
|
||||
function memoized(/* ...args */) {
|
||||
var node = head,
|
||||
len = arguments.length,
|
||||
args,
|
||||
i;
|
||||
|
||||
searchCache: while (node) {
|
||||
// Perform a shallow equality test to confirm that whether the node
|
||||
// under test is a candidate for the arguments passed. Two arrays
|
||||
// are shallowly equal if their length matches and each entry is
|
||||
// strictly equal between the two sets. Avoid abstracting to a
|
||||
// function which could incur an arguments leaking deoptimization.
|
||||
|
||||
// Check whether node arguments match arguments length
|
||||
if (node.args.length !== arguments.length) {
|
||||
node = node.next;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check whether node arguments match arguments values
|
||||
for (i = 0; i < len; i++) {
|
||||
if (node.args[i] !== arguments[i]) {
|
||||
node = node.next;
|
||||
continue searchCache;
|
||||
}
|
||||
}
|
||||
|
||||
// At this point we can assume we've found a match
|
||||
|
||||
// Surface matched node to head if not already
|
||||
if (node !== head) {
|
||||
// As tail, shift to previous. Must only shift if not also
|
||||
// head, since if both head and tail, there is no previous.
|
||||
if (node === tail) {
|
||||
tail = node.prev;
|
||||
}
|
||||
|
||||
// Adjust siblings to point to each other. If node was tail,
|
||||
// this also handles new tail's empty `next` assignment.
|
||||
/** @type {MemizeCacheNode} */ (node.prev).next = node.next;
|
||||
if (node.next) {
|
||||
node.next.prev = node.prev;
|
||||
}
|
||||
|
||||
node.next = head;
|
||||
node.prev = null;
|
||||
/** @type {MemizeCacheNode} */ (head).prev = node;
|
||||
head = node;
|
||||
}
|
||||
|
||||
// Return immediately
|
||||
return node.val;
|
||||
}
|
||||
|
||||
// No cached value found. Continue to insertion phase:
|
||||
|
||||
// Create a copy of arguments (avoid leaking deoptimization)
|
||||
args = new Array(len);
|
||||
for (i = 0; i < len; i++) {
|
||||
args[i] = arguments[i];
|
||||
}
|
||||
|
||||
node = {
|
||||
args: args,
|
||||
|
||||
// Generate the result from original function
|
||||
val: fn.apply(null, args),
|
||||
};
|
||||
|
||||
// Don't need to check whether node is already head, since it would
|
||||
// have been returned above already if it was
|
||||
|
||||
// Shift existing head down list
|
||||
if (head) {
|
||||
head.prev = node;
|
||||
node.next = head;
|
||||
} else {
|
||||
// If no head, follows that there's no tail (at initial or reset)
|
||||
tail = node;
|
||||
}
|
||||
|
||||
// Trim tail if we're reached max size and are pending cache insertion
|
||||
if (size === /** @type {MemizeOptions} */ (options).maxSize) {
|
||||
tail = /** @type {MemizeCacheNode} */ (tail).prev;
|
||||
/** @type {MemizeCacheNode} */ (tail).next = null;
|
||||
} else {
|
||||
size++;
|
||||
}
|
||||
|
||||
head = node;
|
||||
|
||||
return node.val;
|
||||
}
|
||||
|
||||
memoized.clear = function () {
|
||||
head = null;
|
||||
tail = null;
|
||||
size = 0;
|
||||
};
|
||||
|
||||
// Ignore reason: There's not a clear solution to create an intersection of
|
||||
// the function with additional properties, where the goal is to retain the
|
||||
// function signature of the incoming argument and add control properties
|
||||
// on the return value.
|
||||
|
||||
// @ts-ignore
|
||||
return memoized;
|
||||
}
|
||||
|
||||
|
||||
|
||||
;// external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// external ["wp","hooks"]
|
||||
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
|
||||
;// external ["wp","isShallowEqual"]
|
||||
const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
|
||||
var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
|
||||
;// external ["wp","compose"]
|
||||
const external_wp_compose_namespaceObject = window["wp"]["compose"];
|
||||
;// external ["wp","deprecated"]
|
||||
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
|
||||
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
|
||||
;// ./node_modules/@wordpress/plugins/build-module/components/plugin-context/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
const Context = (0,external_wp_element_namespaceObject.createContext)({
|
||||
name: null,
|
||||
icon: null
|
||||
});
|
||||
Context.displayName = "PluginContext";
|
||||
const PluginContextProvider = Context.Provider;
|
||||
function usePluginContext() {
|
||||
return (0,external_wp_element_namespaceObject.useContext)(Context);
|
||||
}
|
||||
const withPluginContext = (mapContextToProps) => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((OriginalComponent) => {
|
||||
external_wp_deprecated_default()("wp.plugins.withPluginContext", {
|
||||
since: "6.8.0",
|
||||
alternative: "wp.plugins.usePluginContext"
|
||||
});
|
||||
return (props) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Context.Consumer, { children: (context) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
OriginalComponent,
|
||||
{
|
||||
...props,
|
||||
...mapContextToProps(context, props)
|
||||
}
|
||||
) });
|
||||
}, "withPluginContext");
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/plugins/build-module/components/plugin-error-boundary/index.js
|
||||
|
||||
class PluginErrorBoundary extends external_wp_element_namespaceObject.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
hasError: false
|
||||
};
|
||||
}
|
||||
static getDerivedStateFromError() {
|
||||
return { hasError: true };
|
||||
}
|
||||
componentDidCatch(error) {
|
||||
const { name, onError } = this.props;
|
||||
if (onError) {
|
||||
onError(name, error);
|
||||
}
|
||||
}
|
||||
render() {
|
||||
if (!this.state.hasError) {
|
||||
return this.props.children;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
;// external ["wp","primitives"]
|
||||
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
|
||||
;// ./node_modules/@wordpress/icons/build-module/library/plugins.js
|
||||
|
||||
|
||||
var plugins_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z" }) });
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/plugins/build-module/api/index.js
|
||||
|
||||
|
||||
const plugins = {};
|
||||
function registerPlugin(name, settings) {
|
||||
if (typeof settings !== "object") {
|
||||
console.error("No settings object provided!");
|
||||
return null;
|
||||
}
|
||||
if (typeof name !== "string") {
|
||||
console.error("Plugin name must be string.");
|
||||
return null;
|
||||
}
|
||||
if (!/^[a-z][a-z0-9-]*$/.test(name)) {
|
||||
console.error(
|
||||
'Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'
|
||||
);
|
||||
return null;
|
||||
}
|
||||
if (plugins[name]) {
|
||||
console.error(`Plugin "${name}" is already registered.`);
|
||||
}
|
||||
settings = (0,external_wp_hooks_namespaceObject.applyFilters)(
|
||||
"plugins.registerPlugin",
|
||||
settings,
|
||||
name
|
||||
);
|
||||
const { render, scope } = settings;
|
||||
if (typeof render !== "function") {
|
||||
console.error(
|
||||
'The "render" property must be specified and must be a valid function.'
|
||||
);
|
||||
return null;
|
||||
}
|
||||
if (scope) {
|
||||
if (typeof scope !== "string") {
|
||||
console.error("Plugin scope must be string.");
|
||||
return null;
|
||||
}
|
||||
if (!/^[a-z][a-z0-9-]*$/.test(scope)) {
|
||||
console.error(
|
||||
'Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'
|
||||
);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
plugins[name] = {
|
||||
name,
|
||||
icon: plugins_default,
|
||||
...settings
|
||||
};
|
||||
(0,external_wp_hooks_namespaceObject.doAction)("plugins.pluginRegistered", settings, name);
|
||||
return settings;
|
||||
}
|
||||
function unregisterPlugin(name) {
|
||||
if (!plugins[name]) {
|
||||
console.error('Plugin "' + name + '" is not registered.');
|
||||
return;
|
||||
}
|
||||
const oldPlugin = plugins[name];
|
||||
delete plugins[name];
|
||||
(0,external_wp_hooks_namespaceObject.doAction)("plugins.pluginUnregistered", oldPlugin, name);
|
||||
return oldPlugin;
|
||||
}
|
||||
function getPlugin(name) {
|
||||
return plugins[name];
|
||||
}
|
||||
function getPlugins(scope) {
|
||||
return Object.values(plugins).filter(
|
||||
(plugin) => plugin.scope === scope
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/plugins/build-module/components/plugin-area/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const getPluginContext = memize(
|
||||
(icon, name) => ({
|
||||
icon,
|
||||
name
|
||||
})
|
||||
);
|
||||
function PluginArea({
|
||||
scope,
|
||||
onError
|
||||
}) {
|
||||
const store = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
||||
let lastValue = [];
|
||||
return {
|
||||
subscribe(listener) {
|
||||
(0,external_wp_hooks_namespaceObject.addAction)(
|
||||
"plugins.pluginRegistered",
|
||||
"core/plugins/plugin-area/plugins-registered",
|
||||
listener
|
||||
);
|
||||
(0,external_wp_hooks_namespaceObject.addAction)(
|
||||
"plugins.pluginUnregistered",
|
||||
"core/plugins/plugin-area/plugins-unregistered",
|
||||
listener
|
||||
);
|
||||
return () => {
|
||||
(0,external_wp_hooks_namespaceObject.removeAction)(
|
||||
"plugins.pluginRegistered",
|
||||
"core/plugins/plugin-area/plugins-registered"
|
||||
);
|
||||
(0,external_wp_hooks_namespaceObject.removeAction)(
|
||||
"plugins.pluginUnregistered",
|
||||
"core/plugins/plugin-area/plugins-unregistered"
|
||||
);
|
||||
};
|
||||
},
|
||||
getValue() {
|
||||
const nextValue = getPlugins(scope);
|
||||
if (!external_wp_isShallowEqual_default()(lastValue, nextValue)) {
|
||||
lastValue = nextValue;
|
||||
}
|
||||
return lastValue;
|
||||
}
|
||||
};
|
||||
}, [scope]);
|
||||
const plugins = (0,external_wp_element_namespaceObject.useSyncExternalStore)(
|
||||
store.subscribe,
|
||||
store.getValue,
|
||||
store.getValue
|
||||
);
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: { display: "none" }, children: plugins.map(({ icon, name, render: Plugin }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
PluginContextProvider,
|
||||
{
|
||||
value: getPluginContext(icon, name),
|
||||
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PluginErrorBoundary, { name, onError, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Plugin, {}) })
|
||||
},
|
||||
name
|
||||
)) });
|
||||
}
|
||||
var plugin_area_default = PluginArea;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/plugins/build-module/components/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/plugins/build-module/index.js
|
||||
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).plugins = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={n:n=>{var r=n&&n.__esModule?()=>n.default:()=>n;return e.d(r,{a:r}),r},d:(n,r)=>{for(var t in r)e.o(r,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:r[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{PluginArea:()=>j,getPlugin:()=>y,getPlugins:()=>P,registerPlugin:()=>f,unregisterPlugin:()=>x,usePluginContext:()=>g,withPluginContext:()=>d});const r=window.ReactJSXRuntime;const t=window.wp.element,i=window.wp.hooks,o=window.wp.isShallowEqual;var l=e.n(o);const s=window.wp.compose,u=window.wp.deprecated;var a=e.n(u);const c=(0,t.createContext)({name:null,icon:null});c.displayName="PluginContext";const p=c.Provider;function g(){return(0,t.useContext)(c)}const d=e=>(0,s.createHigherOrderComponent)((n=>(a()("wp.plugins.withPluginContext",{since:"6.8.0",alternative:"wp.plugins.usePluginContext"}),t=>(0,r.jsx)(c.Consumer,{children:i=>(0,r.jsx)(n,{...t,...e(i,t)})}))),"withPluginContext");class v extends t.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){const{name:n,onError:r}=this.props;r&&r(n,e)}render(){return this.state.hasError?null:this.props.children}}const w=window.wp.primitives;var m=(0,r.jsx)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(w.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"})});const h={};function f(e,n){if("object"!=typeof n)return console.error("No settings object provided!"),null;if("string"!=typeof e)return console.error("Plugin name must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(e))return console.error('Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'),null;h[e]&&console.error(`Plugin "${e}" is already registered.`),n=(0,i.applyFilters)("plugins.registerPlugin",n,e);const{render:r,scope:t}=n;if("function"!=typeof r)return console.error('The "render" property must be specified and must be a valid function.'),null;if(t){if("string"!=typeof t)return console.error("Plugin scope must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(t))return console.error('Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'),null}return h[e]={name:e,icon:m,...n},(0,i.doAction)("plugins.pluginRegistered",n,e),n}function x(e){if(!h[e])return void console.error('Plugin "'+e+'" is not registered.');const n=h[e];return delete h[e],(0,i.doAction)("plugins.pluginUnregistered",n,e),n}function y(e){return h[e]}function P(e){return Object.values(h).filter((n=>n.scope===e))}const b=function(e,n){var r,t,i=0;function o(){var o,l,s=r,u=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(l=0;l<u;l++)if(s.args[l]!==arguments[l]){s=s.next;continue e}return s!==r&&(s===t&&(t=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=r,s.prev=null,r.prev=s,r=s),s.val}s=s.next}for(o=new Array(u),l=0;l<u;l++)o[l]=arguments[l];return s={args:o,val:e.apply(null,o)},r?(r.prev=s,s.next=r):t=s,i===n.maxSize?(t=t.prev).next=null:i++,r=s,s.val}return n=n||{},o.clear=function(){r=null,t=null,i=0},o}(((e,n)=>({icon:e,name:n})));var j=function({scope:e,onError:n}){const o=(0,t.useMemo)((()=>{let n=[];return{subscribe:e=>((0,i.addAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered",e),(0,i.addAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered",e),()=>{(0,i.removeAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered"),(0,i.removeAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered")}),getValue(){const r=P(e);return l()(n,r)||(n=r),n}}}),[e]),s=(0,t.useSyncExternalStore)(o.subscribe,o.getValue,o.getValue);return(0,r.jsx)("div",{style:{display:"none"},children:s.map((({icon:e,name:t,render:i})=>(0,r.jsx)(p,{value:b(e,t),children:(0,r.jsx)(v,{name:t,onError:n,children:(0,r.jsx)(i,{})})},t)))})};(window.wp=window.wp||{}).plugins=n})();
|
||||
+546
@@ -0,0 +1,546 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat get default export */
|
||||
/******/ (() => {
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = (module) => {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ () => (module['default']) :
|
||||
/******/ () => (module);
|
||||
/******/ __webpack_require__.d(getter, { a: getter });
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
__unstableCreatePersistenceLayer: () => (/* binding */ __unstableCreatePersistenceLayer),
|
||||
create: () => (/* reexport */ create)
|
||||
});
|
||||
|
||||
;// external ["wp","apiFetch"]
|
||||
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
|
||||
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
|
||||
;// ./node_modules/@wordpress/preferences-persistence/build-module/create/debounce-async.js
|
||||
function debounceAsync(func, delayMS) {
|
||||
let timeoutId;
|
||||
let activePromise;
|
||||
return async function debounced(...args) {
|
||||
if (!activePromise && !timeoutId) {
|
||||
return new Promise((resolve, reject) => {
|
||||
activePromise = func(...args).then((...thenArgs) => {
|
||||
resolve(...thenArgs);
|
||||
}).catch((error) => {
|
||||
reject(error);
|
||||
}).finally(() => {
|
||||
activePromise = null;
|
||||
});
|
||||
});
|
||||
}
|
||||
if (activePromise) {
|
||||
await activePromise;
|
||||
}
|
||||
if (timeoutId) {
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = null;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
timeoutId = setTimeout(() => {
|
||||
activePromise = func(...args).then((...thenArgs) => {
|
||||
resolve(...thenArgs);
|
||||
}).catch((error) => {
|
||||
reject(error);
|
||||
}).finally(() => {
|
||||
activePromise = null;
|
||||
timeoutId = null;
|
||||
});
|
||||
}, delayMS);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences-persistence/build-module/create/index.js
|
||||
|
||||
|
||||
const EMPTY_OBJECT = {};
|
||||
const localStorage = window.localStorage;
|
||||
function create({
|
||||
preloadedData,
|
||||
localStorageRestoreKey = "WP_PREFERENCES_RESTORE_DATA",
|
||||
requestDebounceMS = 2500
|
||||
} = {}) {
|
||||
let cache = preloadedData;
|
||||
const debouncedApiFetch = debounceAsync((external_wp_apiFetch_default()), requestDebounceMS);
|
||||
async function get() {
|
||||
if (cache) {
|
||||
return cache;
|
||||
}
|
||||
const user = await external_wp_apiFetch_default()({
|
||||
path: "/wp/v2/users/me?context=edit"
|
||||
});
|
||||
const serverData = user?.meta?.persisted_preferences;
|
||||
const localData = JSON.parse(
|
||||
localStorage.getItem(localStorageRestoreKey)
|
||||
);
|
||||
const serverTimestamp = Date.parse(serverData?._modified) || 0;
|
||||
const localTimestamp = Date.parse(localData?._modified) || 0;
|
||||
if (serverData && serverTimestamp >= localTimestamp) {
|
||||
cache = serverData;
|
||||
} else if (localData) {
|
||||
cache = localData;
|
||||
} else {
|
||||
cache = EMPTY_OBJECT;
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
function set(newData) {
|
||||
const dataWithTimestamp = {
|
||||
...newData,
|
||||
_modified: (/* @__PURE__ */ new Date()).toISOString()
|
||||
};
|
||||
cache = dataWithTimestamp;
|
||||
localStorage.setItem(
|
||||
localStorageRestoreKey,
|
||||
JSON.stringify(dataWithTimestamp)
|
||||
);
|
||||
debouncedApiFetch({
|
||||
path: "/wp/v2/users/me",
|
||||
method: "PUT",
|
||||
// `keepalive` will still send the request in the background,
|
||||
// even when a browser unload event might interrupt it.
|
||||
// This should hopefully make things more resilient.
|
||||
// This does have a size limit of 64kb, but the data is usually
|
||||
// much less.
|
||||
keepalive: true,
|
||||
data: {
|
||||
meta: {
|
||||
persisted_preferences: dataWithTimestamp
|
||||
}
|
||||
}
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
return {
|
||||
get,
|
||||
set
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-feature-preferences.js
|
||||
function moveFeaturePreferences(state, sourceStoreName) {
|
||||
const preferencesStoreName = "core/preferences";
|
||||
const interfaceStoreName = "core/interface";
|
||||
const interfaceFeatures = state?.[interfaceStoreName]?.preferences?.features?.[sourceStoreName];
|
||||
const sourceFeatures = state?.[sourceStoreName]?.preferences?.features;
|
||||
const featuresToMigrate = interfaceFeatures ? interfaceFeatures : sourceFeatures;
|
||||
if (!featuresToMigrate) {
|
||||
return state;
|
||||
}
|
||||
const existingPreferences = state?.[preferencesStoreName]?.preferences;
|
||||
if (existingPreferences?.[sourceStoreName]) {
|
||||
return state;
|
||||
}
|
||||
let updatedInterfaceState;
|
||||
if (interfaceFeatures) {
|
||||
const otherInterfaceState = state?.[interfaceStoreName];
|
||||
const otherInterfaceScopes = state?.[interfaceStoreName]?.preferences?.features;
|
||||
updatedInterfaceState = {
|
||||
[interfaceStoreName]: {
|
||||
...otherInterfaceState,
|
||||
preferences: {
|
||||
features: {
|
||||
...otherInterfaceScopes,
|
||||
[sourceStoreName]: void 0
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
let updatedSourceState;
|
||||
if (sourceFeatures) {
|
||||
const otherSourceState = state?.[sourceStoreName];
|
||||
const sourcePreferences = state?.[sourceStoreName]?.preferences;
|
||||
updatedSourceState = {
|
||||
[sourceStoreName]: {
|
||||
...otherSourceState,
|
||||
preferences: {
|
||||
...sourcePreferences,
|
||||
features: void 0
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
return {
|
||||
...state,
|
||||
[preferencesStoreName]: {
|
||||
preferences: {
|
||||
...existingPreferences,
|
||||
[sourceStoreName]: featuresToMigrate
|
||||
}
|
||||
},
|
||||
...updatedInterfaceState,
|
||||
...updatedSourceState
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-third-party-feature-preferences.js
|
||||
function moveThirdPartyFeaturePreferencesToPreferences(state) {
|
||||
const interfaceStoreName = "core/interface";
|
||||
const preferencesStoreName = "core/preferences";
|
||||
const interfaceScopes = state?.[interfaceStoreName]?.preferences?.features;
|
||||
const interfaceScopeKeys = interfaceScopes ? Object.keys(interfaceScopes) : [];
|
||||
if (!interfaceScopeKeys?.length) {
|
||||
return state;
|
||||
}
|
||||
return interfaceScopeKeys.reduce(function(convertedState, scope) {
|
||||
if (scope.startsWith("core")) {
|
||||
return convertedState;
|
||||
}
|
||||
const featuresToMigrate = interfaceScopes?.[scope];
|
||||
if (!featuresToMigrate) {
|
||||
return convertedState;
|
||||
}
|
||||
const existingMigratedData = convertedState?.[preferencesStoreName]?.preferences?.[scope];
|
||||
if (existingMigratedData) {
|
||||
return convertedState;
|
||||
}
|
||||
const otherPreferencesScopes = convertedState?.[preferencesStoreName]?.preferences;
|
||||
const otherInterfaceState = convertedState?.[interfaceStoreName];
|
||||
const otherInterfaceScopes = convertedState?.[interfaceStoreName]?.preferences?.features;
|
||||
return {
|
||||
...convertedState,
|
||||
[preferencesStoreName]: {
|
||||
preferences: {
|
||||
...otherPreferencesScopes,
|
||||
[scope]: featuresToMigrate
|
||||
}
|
||||
},
|
||||
[interfaceStoreName]: {
|
||||
...otherInterfaceState,
|
||||
preferences: {
|
||||
features: {
|
||||
...otherInterfaceScopes,
|
||||
[scope]: void 0
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}, state);
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-individual-preference.js
|
||||
const identity = (arg) => arg;
|
||||
function moveIndividualPreferenceToPreferences(state, { from: sourceStoreName, to: scope }, key, convert = identity) {
|
||||
const preferencesStoreName = "core/preferences";
|
||||
const sourcePreference = state?.[sourceStoreName]?.preferences?.[key];
|
||||
if (sourcePreference === void 0) {
|
||||
return state;
|
||||
}
|
||||
const targetPreference = state?.[preferencesStoreName]?.preferences?.[scope]?.[key];
|
||||
if (targetPreference) {
|
||||
return state;
|
||||
}
|
||||
const otherScopes = state?.[preferencesStoreName]?.preferences;
|
||||
const otherPreferences = state?.[preferencesStoreName]?.preferences?.[scope];
|
||||
const otherSourceState = state?.[sourceStoreName];
|
||||
const allSourcePreferences = state?.[sourceStoreName]?.preferences;
|
||||
const convertedPreferences = convert({ [key]: sourcePreference });
|
||||
return {
|
||||
...state,
|
||||
[preferencesStoreName]: {
|
||||
preferences: {
|
||||
...otherScopes,
|
||||
[scope]: {
|
||||
...otherPreferences,
|
||||
...convertedPreferences
|
||||
}
|
||||
}
|
||||
},
|
||||
[sourceStoreName]: {
|
||||
...otherSourceState,
|
||||
preferences: {
|
||||
...allSourcePreferences,
|
||||
[key]: void 0
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-interface-enable-items.js
|
||||
function moveInterfaceEnableItems(state) {
|
||||
const interfaceStoreName = "core/interface";
|
||||
const preferencesStoreName = "core/preferences";
|
||||
const sourceEnableItems = state?.[interfaceStoreName]?.enableItems;
|
||||
if (!sourceEnableItems) {
|
||||
return state;
|
||||
}
|
||||
const allPreferences = state?.[preferencesStoreName]?.preferences ?? {};
|
||||
const sourceComplementaryAreas = sourceEnableItems?.singleEnableItems?.complementaryArea ?? {};
|
||||
const preferencesWithConvertedComplementaryAreas = Object.keys(
|
||||
sourceComplementaryAreas
|
||||
).reduce((accumulator, scope) => {
|
||||
const data = sourceComplementaryAreas[scope];
|
||||
if (accumulator?.[scope]?.complementaryArea) {
|
||||
return accumulator;
|
||||
}
|
||||
return {
|
||||
...accumulator,
|
||||
[scope]: {
|
||||
...accumulator[scope],
|
||||
complementaryArea: data
|
||||
}
|
||||
};
|
||||
}, allPreferences);
|
||||
const sourcePinnedItems = sourceEnableItems?.multipleEnableItems?.pinnedItems ?? {};
|
||||
const allConvertedData = Object.keys(sourcePinnedItems).reduce(
|
||||
(accumulator, scope) => {
|
||||
const data = sourcePinnedItems[scope];
|
||||
if (accumulator?.[scope]?.pinnedItems) {
|
||||
return accumulator;
|
||||
}
|
||||
return {
|
||||
...accumulator,
|
||||
[scope]: {
|
||||
...accumulator[scope],
|
||||
pinnedItems: data
|
||||
}
|
||||
};
|
||||
},
|
||||
preferencesWithConvertedComplementaryAreas
|
||||
);
|
||||
const otherInterfaceItems = state[interfaceStoreName];
|
||||
return {
|
||||
...state,
|
||||
[preferencesStoreName]: {
|
||||
preferences: allConvertedData
|
||||
},
|
||||
[interfaceStoreName]: {
|
||||
...otherInterfaceItems,
|
||||
enableItems: void 0
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/convert-edit-post-panels.js
|
||||
function convertEditPostPanels(preferences) {
|
||||
const panels = preferences?.panels ?? {};
|
||||
return Object.keys(panels).reduce(
|
||||
(convertedData, panelName) => {
|
||||
const panel = panels[panelName];
|
||||
if (panel?.enabled === false) {
|
||||
convertedData.inactivePanels.push(panelName);
|
||||
}
|
||||
if (panel?.opened === true) {
|
||||
convertedData.openPanels.push(panelName);
|
||||
}
|
||||
return convertedData;
|
||||
},
|
||||
{ inactivePanels: [], openPanels: [] }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function getLegacyData(userId) {
|
||||
const key = `WP_DATA_USER_${userId}`;
|
||||
const unparsedData = window.localStorage.getItem(key);
|
||||
return JSON.parse(unparsedData);
|
||||
}
|
||||
function convertLegacyData(data) {
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
data = moveFeaturePreferences(data, "core/edit-widgets");
|
||||
data = moveFeaturePreferences(data, "core/customize-widgets");
|
||||
data = moveFeaturePreferences(data, "core/edit-post");
|
||||
data = moveFeaturePreferences(data, "core/edit-site");
|
||||
data = moveThirdPartyFeaturePreferencesToPreferences(data);
|
||||
data = moveInterfaceEnableItems(data);
|
||||
data = moveIndividualPreferenceToPreferences(
|
||||
data,
|
||||
{ from: "core/edit-post", to: "core/edit-post" },
|
||||
"hiddenBlockTypes"
|
||||
);
|
||||
data = moveIndividualPreferenceToPreferences(
|
||||
data,
|
||||
{ from: "core/edit-post", to: "core/edit-post" },
|
||||
"editorMode"
|
||||
);
|
||||
data = moveIndividualPreferenceToPreferences(
|
||||
data,
|
||||
{ from: "core/edit-post", to: "core/edit-post" },
|
||||
"panels",
|
||||
convertEditPostPanels
|
||||
);
|
||||
data = moveIndividualPreferenceToPreferences(
|
||||
data,
|
||||
{ from: "core/editor", to: "core" },
|
||||
"isPublishSidebarEnabled"
|
||||
);
|
||||
data = moveIndividualPreferenceToPreferences(
|
||||
data,
|
||||
{ from: "core/edit-post", to: "core" },
|
||||
"isPublishSidebarEnabled"
|
||||
);
|
||||
data = moveIndividualPreferenceToPreferences(
|
||||
data,
|
||||
{ from: "core/edit-site", to: "core/edit-site" },
|
||||
"editorMode"
|
||||
);
|
||||
return data?.["core/preferences"]?.preferences;
|
||||
}
|
||||
function convertLegacyLocalStorageData(userId) {
|
||||
const data = getLegacyData(userId);
|
||||
return convertLegacyData(data);
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/preferences-package-data/convert-complementary-areas.js
|
||||
function convertComplementaryAreas(state) {
|
||||
return Object.keys(state).reduce((stateAccumulator, scope) => {
|
||||
const scopeData = state[scope];
|
||||
if (scopeData?.complementaryArea) {
|
||||
const updatedScopeData = { ...scopeData };
|
||||
delete updatedScopeData.complementaryArea;
|
||||
updatedScopeData.isComplementaryAreaVisible = true;
|
||||
stateAccumulator[scope] = updatedScopeData;
|
||||
return stateAccumulator;
|
||||
}
|
||||
return stateAccumulator;
|
||||
}, state);
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/preferences-package-data/convert-editor-settings.js
|
||||
function convertEditorSettings(data) {
|
||||
let newData = data;
|
||||
const settingsToMoveToCore = [
|
||||
"allowRightClickOverrides",
|
||||
"distractionFree",
|
||||
"editorMode",
|
||||
"fixedToolbar",
|
||||
"focusMode",
|
||||
"hiddenBlockTypes",
|
||||
"inactivePanels",
|
||||
"keepCaretInsideBlock",
|
||||
"mostUsedBlocks",
|
||||
"openPanels",
|
||||
"showBlockBreadcrumbs",
|
||||
"showIconLabels",
|
||||
"showListViewByDefault",
|
||||
"isPublishSidebarEnabled",
|
||||
"isComplementaryAreaVisible",
|
||||
"pinnedItems"
|
||||
];
|
||||
settingsToMoveToCore.forEach((setting) => {
|
||||
if (data?.["core/edit-post"]?.[setting] !== void 0) {
|
||||
newData = {
|
||||
...newData,
|
||||
core: {
|
||||
...newData?.core,
|
||||
[setting]: data["core/edit-post"][setting]
|
||||
}
|
||||
};
|
||||
delete newData["core/edit-post"][setting];
|
||||
}
|
||||
if (data?.["core/edit-site"]?.[setting] !== void 0) {
|
||||
delete newData["core/edit-site"][setting];
|
||||
}
|
||||
});
|
||||
if (Object.keys(newData?.["core/edit-post"] ?? {})?.length === 0) {
|
||||
delete newData["core/edit-post"];
|
||||
}
|
||||
if (Object.keys(newData?.["core/edit-site"] ?? {})?.length === 0) {
|
||||
delete newData["core/edit-site"];
|
||||
}
|
||||
return newData;
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/preferences-package-data/index.js
|
||||
|
||||
|
||||
function convertPreferencesPackageData(data) {
|
||||
let newData = convertComplementaryAreas(data);
|
||||
newData = convertEditorSettings(newData);
|
||||
return newData;
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences-persistence/build-module/index.js
|
||||
|
||||
|
||||
|
||||
function __unstableCreatePersistenceLayer(serverData, userId) {
|
||||
const localStorageRestoreKey = `WP_PREFERENCES_USER_${userId}`;
|
||||
const localData = JSON.parse(
|
||||
window.localStorage.getItem(localStorageRestoreKey)
|
||||
);
|
||||
const serverModified = Date.parse(serverData && serverData._modified) || 0;
|
||||
const localModified = Date.parse(localData && localData._modified) || 0;
|
||||
let preloadedData;
|
||||
if (serverData && serverModified >= localModified) {
|
||||
preloadedData = convertPreferencesPackageData(serverData);
|
||||
} else if (localData) {
|
||||
preloadedData = convertPreferencesPackageData(localData);
|
||||
} else {
|
||||
preloadedData = convertLegacyLocalStorageData(userId);
|
||||
}
|
||||
return create({
|
||||
preloadedData,
|
||||
localStorageRestoreKey
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).preferencesPersistence = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+2
File diff suppressed because one or more lines are too long
@@ -0,0 +1,572 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat get default export */
|
||||
/******/ (() => {
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = (module) => {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ () => (module['default']) :
|
||||
/******/ () => (module);
|
||||
/******/ __webpack_require__.d(getter, { a: getter });
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
PreferenceToggleMenuItem: () => (/* reexport */ PreferenceToggleMenuItem),
|
||||
privateApis: () => (/* reexport */ privateApis),
|
||||
store: () => (/* reexport */ store)
|
||||
});
|
||||
|
||||
// NAMESPACE OBJECT: ./node_modules/@wordpress/preferences/build-module/store/actions.js
|
||||
var actions_namespaceObject = {};
|
||||
__webpack_require__.r(actions_namespaceObject);
|
||||
__webpack_require__.d(actions_namespaceObject, {
|
||||
set: () => (set),
|
||||
setDefaults: () => (setDefaults),
|
||||
setPersistenceLayer: () => (setPersistenceLayer),
|
||||
toggle: () => (toggle)
|
||||
});
|
||||
|
||||
// NAMESPACE OBJECT: ./node_modules/@wordpress/preferences/build-module/store/selectors.js
|
||||
var selectors_namespaceObject = {};
|
||||
__webpack_require__.r(selectors_namespaceObject);
|
||||
__webpack_require__.d(selectors_namespaceObject, {
|
||||
get: () => (get)
|
||||
});
|
||||
|
||||
;// external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// external ["wp","data"]
|
||||
const external_wp_data_namespaceObject = window["wp"]["data"];
|
||||
;// external ["wp","components"]
|
||||
const external_wp_components_namespaceObject = window["wp"]["components"];
|
||||
;// external ["wp","i18n"]
|
||||
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
|
||||
;// external ["wp","primitives"]
|
||||
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
|
||||
;// ./node_modules/@wordpress/icons/build-module/library/check.js
|
||||
|
||||
|
||||
var check_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });
|
||||
|
||||
|
||||
;// external ["wp","a11y"]
|
||||
const external_wp_a11y_namespaceObject = window["wp"]["a11y"];
|
||||
;// ./node_modules/@wordpress/preferences/build-module/store/reducer.js
|
||||
|
||||
function defaults(state = {}, action) {
|
||||
if (action.type === "SET_PREFERENCE_DEFAULTS") {
|
||||
const { scope, defaults: values } = action;
|
||||
return {
|
||||
...state,
|
||||
[scope]: {
|
||||
...state[scope],
|
||||
...values
|
||||
}
|
||||
};
|
||||
}
|
||||
return state;
|
||||
}
|
||||
function withPersistenceLayer(reducer) {
|
||||
let persistenceLayer;
|
||||
return (state, action) => {
|
||||
if (action.type === "SET_PERSISTENCE_LAYER") {
|
||||
const { persistenceLayer: persistence, persistedData } = action;
|
||||
persistenceLayer = persistence;
|
||||
return persistedData;
|
||||
}
|
||||
const nextState = reducer(state, action);
|
||||
if (action.type === "SET_PREFERENCE_VALUE") {
|
||||
persistenceLayer?.set(nextState);
|
||||
}
|
||||
return nextState;
|
||||
};
|
||||
}
|
||||
const preferences = withPersistenceLayer((state = {}, action) => {
|
||||
if (action.type === "SET_PREFERENCE_VALUE") {
|
||||
const { scope, name, value } = action;
|
||||
return {
|
||||
...state,
|
||||
[scope]: {
|
||||
...state[scope],
|
||||
[name]: value
|
||||
}
|
||||
};
|
||||
}
|
||||
return state;
|
||||
});
|
||||
var reducer_default = (0,external_wp_data_namespaceObject.combineReducers)({
|
||||
defaults,
|
||||
preferences
|
||||
});
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences/build-module/store/actions.js
|
||||
function toggle(scope, name) {
|
||||
return function({ select, dispatch }) {
|
||||
const currentValue = select.get(scope, name);
|
||||
dispatch.set(scope, name, !currentValue);
|
||||
};
|
||||
}
|
||||
function set(scope, name, value) {
|
||||
return {
|
||||
type: "SET_PREFERENCE_VALUE",
|
||||
scope,
|
||||
name,
|
||||
value
|
||||
};
|
||||
}
|
||||
function setDefaults(scope, defaults) {
|
||||
return {
|
||||
type: "SET_PREFERENCE_DEFAULTS",
|
||||
scope,
|
||||
defaults
|
||||
};
|
||||
}
|
||||
async function setPersistenceLayer(persistenceLayer) {
|
||||
const persistedData = await persistenceLayer.get();
|
||||
return {
|
||||
type: "SET_PERSISTENCE_LAYER",
|
||||
persistenceLayer,
|
||||
persistedData
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
;// external ["wp","deprecated"]
|
||||
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
|
||||
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
|
||||
;// ./node_modules/@wordpress/preferences/build-module/store/selectors.js
|
||||
|
||||
const withDeprecatedKeys = (originalGet) => (state, scope, name) => {
|
||||
const settingsToMoveToCore = [
|
||||
"allowRightClickOverrides",
|
||||
"distractionFree",
|
||||
"editorMode",
|
||||
"fixedToolbar",
|
||||
"focusMode",
|
||||
"hiddenBlockTypes",
|
||||
"inactivePanels",
|
||||
"keepCaretInsideBlock",
|
||||
"mostUsedBlocks",
|
||||
"openPanels",
|
||||
"showBlockBreadcrumbs",
|
||||
"showIconLabels",
|
||||
"showListViewByDefault",
|
||||
"isPublishSidebarEnabled",
|
||||
"isComplementaryAreaVisible",
|
||||
"pinnedItems"
|
||||
];
|
||||
if (settingsToMoveToCore.includes(name) && ["core/edit-post", "core/edit-site"].includes(scope)) {
|
||||
external_wp_deprecated_default()(
|
||||
`wp.data.select( 'core/preferences' ).get( '${scope}', '${name}' )`,
|
||||
{
|
||||
since: "6.5",
|
||||
alternative: `wp.data.select( 'core/preferences' ).get( 'core', '${name}' )`
|
||||
}
|
||||
);
|
||||
return originalGet(state, "core", name);
|
||||
}
|
||||
return originalGet(state, scope, name);
|
||||
};
|
||||
const get = withDeprecatedKeys((state, scope, name) => {
|
||||
const value = state.preferences[scope]?.[name];
|
||||
return value !== void 0 ? value : state.defaults[scope]?.[name];
|
||||
});
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences/build-module/store/constants.js
|
||||
const STORE_NAME = "core/preferences";
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences/build-module/store/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
|
||||
reducer: reducer_default,
|
||||
actions: actions_namespaceObject,
|
||||
selectors: selectors_namespaceObject
|
||||
});
|
||||
(0,external_wp_data_namespaceObject.register)(store);
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences/build-module/components/preference-toggle-menu-item/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function PreferenceToggleMenuItem({
|
||||
scope,
|
||||
name,
|
||||
label,
|
||||
info,
|
||||
messageActivated,
|
||||
messageDeactivated,
|
||||
shortcut,
|
||||
handleToggling = true,
|
||||
onToggle = () => null,
|
||||
disabled = false
|
||||
}) {
|
||||
const isActive = (0,external_wp_data_namespaceObject.useSelect)(
|
||||
(select) => !!select(store).get(scope, name),
|
||||
[scope, name]
|
||||
);
|
||||
const { toggle } = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
||||
const speakMessage = () => {
|
||||
if (isActive) {
|
||||
const message = messageDeactivated || (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
/* translators: %s: preference name, e.g. 'Fullscreen mode' */
|
||||
(0,external_wp_i18n_namespaceObject.__)("Preference deactivated - %s"),
|
||||
label
|
||||
);
|
||||
(0,external_wp_a11y_namespaceObject.speak)(message);
|
||||
} else {
|
||||
const message = messageActivated || (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
/* translators: %s: preference name, e.g. 'Fullscreen mode' */
|
||||
(0,external_wp_i18n_namespaceObject.__)("Preference activated - %s"),
|
||||
label
|
||||
);
|
||||
(0,external_wp_a11y_namespaceObject.speak)(message);
|
||||
}
|
||||
};
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
external_wp_components_namespaceObject.MenuItem,
|
||||
{
|
||||
icon: isActive && check_default,
|
||||
isSelected: isActive,
|
||||
onClick: () => {
|
||||
onToggle();
|
||||
if (handleToggling) {
|
||||
toggle(scope, name);
|
||||
}
|
||||
speakMessage();
|
||||
},
|
||||
role: "menuitemcheckbox",
|
||||
info,
|
||||
shortcut,
|
||||
disabled,
|
||||
children: label
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences/build-module/components/index.js
|
||||
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences/build-module/components/preference-base-option/index.js
|
||||
|
||||
|
||||
function BaseOption({ help, label, isChecked, onChange, children }) {
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "preference-base-option", children: [
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
external_wp_components_namespaceObject.ToggleControl,
|
||||
{
|
||||
__nextHasNoMarginBottom: true,
|
||||
help,
|
||||
label,
|
||||
checked: isChecked,
|
||||
onChange
|
||||
}
|
||||
),
|
||||
children
|
||||
] });
|
||||
}
|
||||
var preference_base_option_default = BaseOption;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences/build-module/components/preference-toggle-control/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
function PreferenceToggleControl(props) {
|
||||
const {
|
||||
scope,
|
||||
featureName,
|
||||
onToggle = () => {
|
||||
},
|
||||
...remainingProps
|
||||
} = props;
|
||||
const isChecked = (0,external_wp_data_namespaceObject.useSelect)(
|
||||
(select) => !!select(store).get(scope, featureName),
|
||||
[scope, featureName]
|
||||
);
|
||||
const { toggle } = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
||||
const onChange = () => {
|
||||
onToggle();
|
||||
toggle(scope, featureName);
|
||||
};
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
preference_base_option_default,
|
||||
{
|
||||
onChange,
|
||||
isChecked,
|
||||
...remainingProps
|
||||
}
|
||||
);
|
||||
}
|
||||
var preference_toggle_control_default = PreferenceToggleControl;
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences/build-module/components/preferences-modal/index.js
|
||||
|
||||
|
||||
|
||||
function PreferencesModal({ closeModal, children }) {
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
external_wp_components_namespaceObject.Modal,
|
||||
{
|
||||
className: "preferences-modal",
|
||||
title: (0,external_wp_i18n_namespaceObject.__)("Preferences"),
|
||||
onRequestClose: closeModal,
|
||||
children
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences/build-module/components/preferences-modal-section/index.js
|
||||
|
||||
const Section = ({ description, title, children }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "preferences-modal__section", children: [
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("legend", { className: "preferences-modal__section-legend", children: [
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "preferences-modal__section-title", children: title }),
|
||||
description && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "preferences-modal__section-description", children: description })
|
||||
] }),
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "preferences-modal__section-content", children })
|
||||
] });
|
||||
var preferences_modal_section_default = Section;
|
||||
|
||||
|
||||
;// external ["wp","compose"]
|
||||
const external_wp_compose_namespaceObject = window["wp"]["compose"];
|
||||
;// external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// ./node_modules/@wordpress/icons/build-module/icon/index.js
|
||||
|
||||
var icon_default = (0,external_wp_element_namespaceObject.forwardRef)(
|
||||
({ icon, size = 24, ...props }, ref) => {
|
||||
return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
|
||||
width: size,
|
||||
height: size,
|
||||
...props,
|
||||
ref
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/icons/build-module/library/chevron-left.js
|
||||
|
||||
|
||||
var chevron_left_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) });
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
|
||||
|
||||
|
||||
var chevron_right_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });
|
||||
|
||||
|
||||
;// external ["wp","privateApis"]
|
||||
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
|
||||
;// ./node_modules/@wordpress/preferences/build-module/lock-unlock.js
|
||||
|
||||
const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__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/preferences"
|
||||
);
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences/build-module/components/preferences-modal-tabs/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis);
|
||||
const PREFERENCES_MENU = "preferences-menu";
|
||||
function PreferencesModalTabs({ sections }) {
|
||||
const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium");
|
||||
const [activeMenu, setActiveMenu] = (0,external_wp_element_namespaceObject.useState)(PREFERENCES_MENU);
|
||||
const { tabs, sectionsContentMap } = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
||||
let mappedTabs = {
|
||||
tabs: [],
|
||||
sectionsContentMap: {}
|
||||
};
|
||||
if (sections.length) {
|
||||
mappedTabs = sections.reduce(
|
||||
(accumulator, { name, tabLabel: title, content }) => {
|
||||
accumulator.tabs.push({ name, title });
|
||||
accumulator.sectionsContentMap[name] = content;
|
||||
return accumulator;
|
||||
},
|
||||
{ tabs: [], sectionsContentMap: {} }
|
||||
);
|
||||
}
|
||||
return mappedTabs;
|
||||
}, [sections]);
|
||||
let modalContent;
|
||||
if (isLargeViewport) {
|
||||
modalContent = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "preferences__tabs", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
|
||||
Tabs,
|
||||
{
|
||||
defaultTabId: activeMenu !== PREFERENCES_MENU ? activeMenu : void 0,
|
||||
onSelect: setActiveMenu,
|
||||
orientation: "vertical",
|
||||
children: [
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabList, { className: "preferences__tabs-tablist", children: tabs.map((tab) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
Tabs.Tab,
|
||||
{
|
||||
tabId: tab.name,
|
||||
className: "preferences__tabs-tab",
|
||||
children: tab.title
|
||||
},
|
||||
tab.name
|
||||
)) }),
|
||||
tabs.map((tab) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
Tabs.TabPanel,
|
||||
{
|
||||
tabId: tab.name,
|
||||
className: "preferences__tabs-tabpanel",
|
||||
focusable: false,
|
||||
children: sectionsContentMap[tab.name] || null
|
||||
},
|
||||
tab.name
|
||||
))
|
||||
]
|
||||
}
|
||||
) });
|
||||
} else {
|
||||
modalContent = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator, { initialPath: "/", className: "preferences__provider", children: [
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Card, { isBorderless: true, size: "small", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CardBody, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { children: tabs.map((tab) => {
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
external_wp_components_namespaceObject.Navigator.Button,
|
||||
{
|
||||
path: `/${tab.name}`,
|
||||
as: external_wp_components_namespaceObject.__experimentalItem,
|
||||
isAction: true,
|
||||
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { children: tab.title }) }),
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
icon_default,
|
||||
{
|
||||
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_default : chevron_right_default
|
||||
}
|
||||
) })
|
||||
] })
|
||||
},
|
||||
tab.name
|
||||
);
|
||||
}) }) }) }) }),
|
||||
sections.length && sections.map((section) => {
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
external_wp_components_namespaceObject.Navigator.Screen,
|
||||
{
|
||||
path: `/${section.name}`,
|
||||
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Card, { isBorderless: true, size: "large", children: [
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
|
||||
external_wp_components_namespaceObject.CardHeader,
|
||||
{
|
||||
isBorderless: false,
|
||||
justify: "left",
|
||||
size: "small",
|
||||
gap: "6",
|
||||
children: [
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
|
||||
external_wp_components_namespaceObject.Navigator.BackButton,
|
||||
{
|
||||
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_default : chevron_left_default,
|
||||
label: (0,external_wp_i18n_namespaceObject.__)("Back")
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { size: "16", children: section.tabLabel })
|
||||
]
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CardBody, { children: section.content })
|
||||
] })
|
||||
},
|
||||
`${section.name}-menu`
|
||||
);
|
||||
})
|
||||
] });
|
||||
}
|
||||
return modalContent;
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences/build-module/private-apis.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const privateApis = {};
|
||||
lock(privateApis, {
|
||||
PreferenceBaseOption: preference_base_option_default,
|
||||
PreferenceToggleControl: preference_toggle_control_default,
|
||||
PreferencesModal: PreferencesModal,
|
||||
PreferencesModalSection: preferences_modal_section_default,
|
||||
PreferencesModalTabs: PreferencesModalTabs
|
||||
});
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/preferences/build-module/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).preferences = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+2
File diff suppressed because one or more lines are too long
@@ -0,0 +1,119 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
BlockQuotation: () => (/* reexport */ BlockQuotation),
|
||||
Circle: () => (/* reexport */ Circle),
|
||||
Defs: () => (/* reexport */ Defs),
|
||||
G: () => (/* reexport */ G),
|
||||
HorizontalRule: () => (/* reexport */ HorizontalRule),
|
||||
Line: () => (/* reexport */ Line),
|
||||
LinearGradient: () => (/* reexport */ LinearGradient),
|
||||
Path: () => (/* reexport */ Path),
|
||||
Polygon: () => (/* reexport */ Polygon),
|
||||
RadialGradient: () => (/* reexport */ RadialGradient),
|
||||
Rect: () => (/* reexport */ Rect),
|
||||
SVG: () => (/* reexport */ SVG),
|
||||
Stop: () => (/* reexport */ Stop),
|
||||
View: () => (/* reexport */ View)
|
||||
});
|
||||
|
||||
;// external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// ./node_modules/clsx/dist/clsx.mjs
|
||||
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx);
|
||||
;// external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// ./node_modules/@wordpress/primitives/build-module/svg/index.js
|
||||
|
||||
|
||||
|
||||
const Circle = (props) => (0,external_wp_element_namespaceObject.createElement)("circle", props);
|
||||
const G = (props) => (0,external_wp_element_namespaceObject.createElement)("g", props);
|
||||
const Line = (props) => (0,external_wp_element_namespaceObject.createElement)("line", props);
|
||||
const Path = (props) => (0,external_wp_element_namespaceObject.createElement)("path", props);
|
||||
const Polygon = (props) => (0,external_wp_element_namespaceObject.createElement)("polygon", props);
|
||||
const Rect = (props) => (0,external_wp_element_namespaceObject.createElement)("rect", props);
|
||||
const Defs = (props) => (0,external_wp_element_namespaceObject.createElement)("defs", props);
|
||||
const RadialGradient = (props) => (0,external_wp_element_namespaceObject.createElement)("radialGradient", props);
|
||||
const LinearGradient = (props) => (0,external_wp_element_namespaceObject.createElement)("linearGradient", props);
|
||||
const Stop = (props) => (0,external_wp_element_namespaceObject.createElement)("stop", props);
|
||||
const SVG = (0,external_wp_element_namespaceObject.forwardRef)(
|
||||
/**
|
||||
* @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed.
|
||||
* Other props will be passed through to svg component.
|
||||
* @param {import('react').ForwardedRef<SVGSVGElement>} ref The forwarded ref to the SVG element.
|
||||
*
|
||||
* @return {JSX.Element} Stop component
|
||||
*/
|
||||
({ className, isPressed, ...props }, ref) => {
|
||||
const appliedProps = {
|
||||
...props,
|
||||
className: dist_clsx(className, { "is-pressed": isPressed }) || void 0,
|
||||
"aria-hidden": true,
|
||||
focusable: false
|
||||
};
|
||||
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("svg", { ...appliedProps, ref });
|
||||
}
|
||||
);
|
||||
SVG.displayName = "SVG";
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/primitives/build-module/horizontal-rule/index.js
|
||||
const HorizontalRule = "hr";
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/primitives/build-module/block-quotation/index.js
|
||||
const BlockQuotation = "blockquote";
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/primitives/build-module/view/index.js
|
||||
const View = "div";
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/primitives/build-module/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).primitives = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{BlockQuotation:()=>g,Circle:()=>i,Defs:()=>m,G:()=>l,HorizontalRule:()=>b,Line:()=>c,LinearGradient:()=>u,Path:()=>s,Polygon:()=>d,RadialGradient:()=>p,Rect:()=>f,SVG:()=>w,Stop:()=>y,View:()=>v});const r=window.ReactJSXRuntime;function n(e){var t,r,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=n(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}const o=function(){for(var e,t,r=0,o="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=n(e))&&(o&&(o+=" "),o+=t);return o},a=window.wp.element,i=e=>(0,a.createElement)("circle",e),l=e=>(0,a.createElement)("g",e),c=e=>(0,a.createElement)("line",e),s=e=>(0,a.createElement)("path",e),d=e=>(0,a.createElement)("polygon",e),f=e=>(0,a.createElement)("rect",e),m=e=>(0,a.createElement)("defs",e),p=e=>(0,a.createElement)("radialGradient",e),u=e=>(0,a.createElement)("linearGradient",e),y=e=>(0,a.createElement)("stop",e),w=(0,a.forwardRef)((({className:e,isPressed:t,...n},a)=>{const i={...n,className:o(e,{"is-pressed":t})||void 0,"aria-hidden":!0,focusable:!1};return(0,r.jsx)("svg",{...i,ref:a})}));w.displayName="SVG";const b="hr",g="blockquote",v="div";(window.wp=window.wp||{}).primitives=t})();
|
||||
+373
@@ -0,0 +1,373 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ 5033:
|
||||
/***/ ((module, exports, __webpack_require__) => {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (factory) {
|
||||
if (true) {
|
||||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
||||
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
||||
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
||||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
} else {}
|
||||
}(function(){
|
||||
'use strict';
|
||||
var scheduleStart, throttleDelay, lazytimer, lazyraf;
|
||||
var root = typeof window != 'undefined' ?
|
||||
window :
|
||||
typeof __webpack_require__.g != undefined ?
|
||||
__webpack_require__.g :
|
||||
this || {};
|
||||
var requestAnimationFrame = root.cancelRequestAnimationFrame && root.requestAnimationFrame || setTimeout;
|
||||
var cancelRequestAnimationFrame = root.cancelRequestAnimationFrame || clearTimeout;
|
||||
var tasks = [];
|
||||
var runAttempts = 0;
|
||||
var isRunning = false;
|
||||
var remainingTime = 7;
|
||||
var minThrottle = 35;
|
||||
var throttle = 125;
|
||||
var index = 0;
|
||||
var taskStart = 0;
|
||||
var tasklength = 0;
|
||||
var IdleDeadline = {
|
||||
get didTimeout(){
|
||||
return false;
|
||||
},
|
||||
timeRemaining: function(){
|
||||
var timeRemaining = remainingTime - (Date.now() - taskStart);
|
||||
return timeRemaining < 0 ? 0 : timeRemaining;
|
||||
},
|
||||
};
|
||||
var setInactive = debounce(function(){
|
||||
remainingTime = 22;
|
||||
throttle = 66;
|
||||
minThrottle = 0;
|
||||
});
|
||||
|
||||
function debounce(fn){
|
||||
var id, timestamp;
|
||||
var wait = 99;
|
||||
var check = function(){
|
||||
var last = (Date.now()) - timestamp;
|
||||
|
||||
if (last < wait) {
|
||||
id = setTimeout(check, wait - last);
|
||||
} else {
|
||||
id = null;
|
||||
fn();
|
||||
}
|
||||
};
|
||||
return function(){
|
||||
timestamp = Date.now();
|
||||
if(!id){
|
||||
id = setTimeout(check, wait);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function abortRunning(){
|
||||
if(isRunning){
|
||||
if(lazyraf){
|
||||
cancelRequestAnimationFrame(lazyraf);
|
||||
}
|
||||
if(lazytimer){
|
||||
clearTimeout(lazytimer);
|
||||
}
|
||||
isRunning = false;
|
||||
}
|
||||
}
|
||||
|
||||
function onInputorMutation(){
|
||||
if(throttle != 125){
|
||||
remainingTime = 7;
|
||||
throttle = 125;
|
||||
minThrottle = 35;
|
||||
|
||||
if(isRunning) {
|
||||
abortRunning();
|
||||
scheduleLazy();
|
||||
}
|
||||
}
|
||||
setInactive();
|
||||
}
|
||||
|
||||
function scheduleAfterRaf() {
|
||||
lazyraf = null;
|
||||
lazytimer = setTimeout(runTasks, 0);
|
||||
}
|
||||
|
||||
function scheduleRaf(){
|
||||
lazytimer = null;
|
||||
requestAnimationFrame(scheduleAfterRaf);
|
||||
}
|
||||
|
||||
function scheduleLazy(){
|
||||
|
||||
if(isRunning){return;}
|
||||
throttleDelay = throttle - (Date.now() - taskStart);
|
||||
|
||||
scheduleStart = Date.now();
|
||||
|
||||
isRunning = true;
|
||||
|
||||
if(minThrottle && throttleDelay < minThrottle){
|
||||
throttleDelay = minThrottle;
|
||||
}
|
||||
|
||||
if(throttleDelay > 9){
|
||||
lazytimer = setTimeout(scheduleRaf, throttleDelay);
|
||||
} else {
|
||||
throttleDelay = 0;
|
||||
scheduleRaf();
|
||||
}
|
||||
}
|
||||
|
||||
function runTasks(){
|
||||
var task, i, len;
|
||||
var timeThreshold = remainingTime > 9 ?
|
||||
9 :
|
||||
1
|
||||
;
|
||||
|
||||
taskStart = Date.now();
|
||||
isRunning = false;
|
||||
|
||||
lazytimer = null;
|
||||
|
||||
if(runAttempts > 2 || taskStart - throttleDelay - 50 < scheduleStart){
|
||||
for(i = 0, len = tasks.length; i < len && IdleDeadline.timeRemaining() > timeThreshold; i++){
|
||||
task = tasks.shift();
|
||||
tasklength++;
|
||||
if(task){
|
||||
task(IdleDeadline);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(tasks.length){
|
||||
scheduleLazy();
|
||||
} else {
|
||||
runAttempts = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function requestIdleCallbackShim(task){
|
||||
index++;
|
||||
tasks.push(task);
|
||||
scheduleLazy();
|
||||
return index;
|
||||
}
|
||||
|
||||
function cancelIdleCallbackShim(id){
|
||||
var index = id - 1 - tasklength;
|
||||
if(tasks[index]){
|
||||
tasks[index] = null;
|
||||
}
|
||||
}
|
||||
|
||||
if(!root.requestIdleCallback || !root.cancelIdleCallback){
|
||||
root.requestIdleCallback = requestIdleCallbackShim;
|
||||
root.cancelIdleCallback = cancelIdleCallbackShim;
|
||||
|
||||
if(root.document && document.addEventListener){
|
||||
root.addEventListener('scroll', onInputorMutation, true);
|
||||
root.addEventListener('resize', onInputorMutation);
|
||||
|
||||
document.addEventListener('focus', onInputorMutation, true);
|
||||
document.addEventListener('mouseover', onInputorMutation, true);
|
||||
['click', 'keypress', 'touchstart', 'mousedown'].forEach(function(name){
|
||||
document.addEventListener(name, onInputorMutation, {capture: true, passive: true});
|
||||
});
|
||||
|
||||
if(root.MutationObserver){
|
||||
new MutationObserver( onInputorMutation ).observe( document.documentElement, {childList: true, subtree: true, attributes: true} );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
try{
|
||||
root.requestIdleCallback(function(){}, {timeout: 0});
|
||||
} catch(e){
|
||||
(function(rIC){
|
||||
var timeRemainingProto, timeRemaining;
|
||||
root.requestIdleCallback = function(fn, timeout){
|
||||
if(timeout && typeof timeout.timeout == 'number'){
|
||||
return rIC(fn, timeout.timeout);
|
||||
}
|
||||
return rIC(fn);
|
||||
};
|
||||
if(root.IdleCallbackDeadline && (timeRemainingProto = IdleCallbackDeadline.prototype)){
|
||||
timeRemaining = Object.getOwnPropertyDescriptor(timeRemainingProto, 'timeRemaining');
|
||||
if(!timeRemaining || !timeRemaining.configurable || !timeRemaining.get){return;}
|
||||
Object.defineProperty(timeRemainingProto, 'timeRemaining', {
|
||||
value: function(){
|
||||
return timeRemaining.get.call(this);
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
});
|
||||
}
|
||||
})(root.requestIdleCallback)
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
request: requestIdleCallbackShim,
|
||||
cancel: cancelIdleCallbackShim,
|
||||
};
|
||||
}));
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The module cache
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||
/******/ if (cachedModule !== undefined) {
|
||||
/******/ return cachedModule.exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
/******/ // no module.loaded needed
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/global */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.g = (function() {
|
||||
/******/ if (typeof globalThis === 'object') return globalThis;
|
||||
/******/ try {
|
||||
/******/ return this || new Function('return this')();
|
||||
/******/ } catch (e) {
|
||||
/******/ if (typeof window === 'object') return window;
|
||||
/******/ }
|
||||
/******/ })();
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
|
||||
(() => {
|
||||
"use strict";
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
createQueue: () => (/* binding */ createQueue)
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/requestidlecallback/index.js
|
||||
var requestidlecallback = __webpack_require__(5033);
|
||||
;// ./node_modules/@wordpress/priority-queue/build-module/request-idle-callback.js
|
||||
|
||||
function createRequestIdleCallback() {
|
||||
if (typeof window === "undefined") {
|
||||
return (callback) => {
|
||||
setTimeout(() => callback(Date.now()), 0);
|
||||
};
|
||||
}
|
||||
return window.requestIdleCallback;
|
||||
}
|
||||
var request_idle_callback_default = createRequestIdleCallback();
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/priority-queue/build-module/index.js
|
||||
|
||||
const createQueue = () => {
|
||||
const waitingList = /* @__PURE__ */ new Map();
|
||||
let isRunning = false;
|
||||
const runWaitingList = (deadline) => {
|
||||
for (const [nextElement, callback] of waitingList) {
|
||||
waitingList.delete(nextElement);
|
||||
callback();
|
||||
if ("number" === typeof deadline || deadline.timeRemaining() <= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (waitingList.size === 0) {
|
||||
isRunning = false;
|
||||
return;
|
||||
}
|
||||
request_idle_callback_default(runWaitingList);
|
||||
};
|
||||
const add = (element, item) => {
|
||||
waitingList.set(element, item);
|
||||
if (!isRunning) {
|
||||
isRunning = true;
|
||||
request_idle_callback_default(runWaitingList);
|
||||
}
|
||||
};
|
||||
const flush = (element) => {
|
||||
const callback = waitingList.get(element);
|
||||
if (void 0 === callback) {
|
||||
return false;
|
||||
}
|
||||
waitingList.delete(element);
|
||||
callback();
|
||||
return true;
|
||||
};
|
||||
const cancel = (element) => {
|
||||
return waitingList.delete(element);
|
||||
};
|
||||
const reset = () => {
|
||||
waitingList.clear();
|
||||
isRunning = false;
|
||||
};
|
||||
return {
|
||||
add,
|
||||
flush,
|
||||
cancel,
|
||||
reset
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
})();
|
||||
|
||||
(window.wp = window.wp || {}).priorityQueue = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{var e={5033:(e,t,n)=>{var o,r,i;r=[],void 0===(i="function"==typeof(o=function(){"use strict";var e,t,o,r,i="undefined"!=typeof window?window:null!=typeof n.g?n.g:this||{},u=i.cancelRequestAnimationFrame&&i.requestAnimationFrame||setTimeout,a=i.cancelRequestAnimationFrame||clearTimeout,c=[],l=0,s=!1,d=7,f=35,m=125,b=0,p=0,v=0,w={get didTimeout(){return!1},timeRemaining:function(){var e=d-(Date.now()-p);return e<0?0:e}},y=g((function(){d=22,m=66,f=0}));function g(e){var t,n,o=99,r=function(){var i=Date.now()-n;i<o?t=setTimeout(r,o-i):(t=null,e())};return function(){n=Date.now(),t||(t=setTimeout(r,o))}}function h(){s&&(r&&a(r),o&&clearTimeout(o),s=!1)}function k(){125!=m&&(d=7,m=125,f=35,s&&(h(),C())),y()}function T(){r=null,o=setTimeout(D,0)}function q(){o=null,u(T)}function C(){s||(t=m-(Date.now()-p),e=Date.now(),s=!0,f&&t<f&&(t=f),t>9?o=setTimeout(q,t):(t=0,q()))}function D(){var n,r,i,u=d>9?9:1;if(p=Date.now(),s=!1,o=null,l>2||p-t-50<e)for(r=0,i=c.length;r<i&&w.timeRemaining()>u;r++)n=c.shift(),v++,n&&n(w);c.length?C():l=0}function I(e){return b++,c.push(e),C(),b}function O(e){var t=e-1-v;c[t]&&(c[t]=null)}if(i.requestIdleCallback&&i.cancelIdleCallback)try{i.requestIdleCallback((function(){}),{timeout:0})}catch(e){!function(e){var t,n;if(i.requestIdleCallback=function(t,n){return n&&"number"==typeof n.timeout?e(t,n.timeout):e(t)},i.IdleCallbackDeadline&&(t=IdleCallbackDeadline.prototype)){if(!(n=Object.getOwnPropertyDescriptor(t,"timeRemaining"))||!n.configurable||!n.get)return;Object.defineProperty(t,"timeRemaining",{value:function(){return n.get.call(this)},enumerable:!0,configurable:!0})}}(i.requestIdleCallback)}else i.requestIdleCallback=I,i.cancelIdleCallback=O,i.document&&document.addEventListener&&(i.addEventListener("scroll",k,!0),i.addEventListener("resize",k),document.addEventListener("focus",k,!0),document.addEventListener("mouseover",k,!0),["click","keypress","touchstart","mousedown"].forEach((function(e){document.addEventListener(e,k,{capture:!0,passive:!0})})),i.MutationObserver&&new MutationObserver(k).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}));return{request:I,cancel:O}})?o.apply(t,r):o)||(e.exports=i)}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{createQueue:()=>t});n(5033);var e="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback;const t=()=>{const t=new Map;let n=!1;const o=r=>{for(const[e,n]of t)if(t.delete(e),n(),"number"==typeof r||r.timeRemaining()<=0)break;0!==t.size?e(o):n=!1};return{add:(r,i)=>{t.set(r,i),n||(n=!0,e(o))},flush:e=>{const n=t.get(e);return void 0!==n&&(t.delete(e),n(),!0)},cancel:e=>t.delete(e),reset:()=>{t.clear(),n=!1}}}})(),(window.wp=window.wp||{}).priorityQueue=o})();
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user