wp core update 6.6
This commit is contained in:
@@ -95,11 +95,6 @@
|
||||
} );
|
||||
}
|
||||
|
||||
if ( skipLink ) {
|
||||
// Focus the target of skip link after pressing Enter.
|
||||
skipLink.addEventListener( 'keydown', focusTargetAfterEnter );
|
||||
}
|
||||
|
||||
if ( shortlink ) {
|
||||
shortlink.addEventListener( 'click', clickShortlink );
|
||||
}
|
||||
@@ -174,36 +169,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Focus the target of skip link after pressing Enter.
|
||||
*
|
||||
* @since 5.3.1
|
||||
*
|
||||
* @param {Event} event The keydown event.
|
||||
*/
|
||||
function focusTargetAfterEnter( event ) {
|
||||
var id, userAgent;
|
||||
|
||||
if ( event.which !== 13 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
id = event.target.getAttribute( 'href' );
|
||||
userAgent = navigator.userAgent.toLowerCase();
|
||||
|
||||
if ( userAgent.indexOf( 'applewebkit' ) > -1 && id && id.charAt( 0 ) === '#' ) {
|
||||
setTimeout( function() {
|
||||
var target = document.getElementById( id.replace( '#', '' ) );
|
||||
|
||||
if ( target ) {
|
||||
target.setAttribute( 'tabIndex', '0' );
|
||||
target.focus();
|
||||
}
|
||||
}, 100 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toogle hover class for mobile devices.
|
||||
* Toggle hover class for mobile devices.
|
||||
*
|
||||
* @since 5.3.1
|
||||
*
|
||||
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
!function(l,u,d){function f(e){27===e.which&&(e=w(e.target,".menupop"))&&(e.querySelector(".menupop > .ab-item").focus(),y(e,"hover"))}function p(e){var t;13!==e.which||e.ctrlKey||e.shiftKey||w(e.target,".ab-sub-wrapper")||(t=w(e.target,".menupop"))&&(e.preventDefault(),(a(t,"hover")?y:g)(t,"hover"))}function h(e){var t;13===e.which&&(t=e.target.getAttribute("href"),-1<d.userAgent.toLowerCase().indexOf("applewebkit"))&&t&&"#"===t.charAt(0)&&setTimeout(function(){var e=l.getElementById(t.replace("#",""));e&&(e.setAttribute("tabIndex","0"),e.focus())},100)}function m(e,t){!w(t.target,".ab-sub-wrapper")&&(t.preventDefault(),t=w(t.target,".menupop"))&&(a(t,"hover")?y:(E(e),g))(t,"hover")}function v(e){var t,r=e.target.parentNode;if(t=r?r.querySelector(".shortlink-input"):t)return e.preventDefault&&e.preventDefault(),e.returnValue=!1,g(r,"selected"),t.focus(),t.select(),!(t.onblur=function(){y(r,"selected")})}function b(){if("sessionStorage"in u)try{for(var e in sessionStorage)-1<e.indexOf("wp-autosave-")&&sessionStorage.removeItem(e)}catch(e){}}function a(e,t){return e&&(e.classList&&e.classList.contains?e.classList.contains(t):e.className&&-1<e.className.split(" ").indexOf(t))}function g(e,t){e&&(e.classList&&e.classList.add?e.classList.add(t):a(e,t)||(e.className&&(e.className+=" "),e.className+=t),e=e.querySelector("a"),"hover"===t)&&e&&e.hasAttribute("aria-expanded")&&e.setAttribute("aria-expanded","true")}function y(e,t){var r,n;if(e&&a(e,t)){if(e.classList&&e.classList.remove)e.classList.remove(t);else{for(r=" "+t+" ",n=" "+e.className+" ";-1<n.indexOf(r);)n=n.replace(r,"");e.className=n.replace(/^[\s]+|[\s]+$/g,"")}e=e.querySelector("a");"hover"===t&&e&&e.hasAttribute("aria-expanded")&&e.setAttribute("aria-expanded","false")}}function E(e){if(e&&e.length)for(var t=0;t<e.length;t++)y(e[t],"hover")}function L(e){if(!e.target||"wpadminbar"===e.target.id||"wp-admin-bar-top-secondary"===e.target.id)try{u.scrollTo({top:-32,left:0,behavior:"smooth"})}catch(e){u.scrollTo(0,-32)}}function w(e,t){for(u.Element.prototype.matches||(u.Element.prototype.matches=u.Element.prototype.matchesSelector||u.Element.prototype.mozMatchesSelector||u.Element.prototype.msMatchesSelector||u.Element.prototype.oMatchesSelector||u.Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),r=t.length;0<=--r&&t.item(r)!==this;);return-1<r});e&&e!==l;e=e.parentNode)if(e.matches(t))return e;return null}l.addEventListener("DOMContentLoaded",function(){var r,e,t,n,a,o,s,i,c=l.getElementById("wpadminbar");if(c&&"querySelectorAll"in c){r=c.querySelectorAll("li.menupop"),e=c.querySelectorAll(".ab-item"),t=l.querySelector("#wp-admin-bar-logout a"),n=l.getElementById("adminbarsearch"),a=l.getElementById("wp-admin-bar-get-shortlink"),o=c.querySelector(".screen-reader-shortcut"),s=/Mobile\/.+Safari/.test(d.userAgent)?"touchstart":"click",y(c,"nojs"),"ontouchstart"in u&&(l.body.addEventListener(s,function(e){w(e.target,"li.menupop")||E(r)}),c.addEventListener("touchstart",function e(){for(var t=0;t<r.length;t++)r[t].addEventListener("click",m.bind(null,r));c.removeEventListener("touchstart",e)})),c.addEventListener("click",L);for(i=0;i<r.length;i++)u.hoverintent(r[i],g.bind(null,r[i],"hover"),y.bind(null,r[i],"hover")).options({timeout:180}),r[i].addEventListener("keydown",p);for(i=0;i<e.length;i++)e[i].addEventListener("keydown",f);n&&((s=l.getElementById("adminbar-search")).addEventListener("focus",function(){g(n,"adminbar-focused")}),s.addEventListener("blur",function(){y(n,"adminbar-focused")})),o&&o.addEventListener("keydown",h),a&&a.addEventListener("click",v),u.location.hash&&u.scrollBy(0,-32),t&&t.addEventListener("click",b)}})}(document,window,navigator);
|
||||
!function(c,l,u){function d(e){27===e.which&&(e=E(e.target,".menupop"))&&(e.querySelector(".menupop > .ab-item").focus(),y(e,"hover"))}function p(e){var t;13!==e.which||e.ctrlKey||e.shiftKey||E(e.target,".ab-sub-wrapper")||(t=E(e.target,".menupop"))&&(e.preventDefault(),(a(t,"hover")?y:v)(t,"hover"))}function m(e,t){!E(t.target,".ab-sub-wrapper")&&(t.preventDefault(),t=E(t.target,".menupop"))&&(a(t,"hover")?y:(b(e),v))(t,"hover")}function f(e){var t,r=e.target.parentNode;if(t=r?r.querySelector(".shortlink-input"):t)return e.preventDefault&&e.preventDefault(),e.returnValue=!1,v(r,"selected"),t.focus(),t.select(),!(t.onblur=function(){y(r,"selected")})}function h(){if("sessionStorage"in l)try{for(var e in sessionStorage)-1<e.indexOf("wp-autosave-")&&sessionStorage.removeItem(e)}catch(e){}}function a(e,t){return e&&(e.classList&&e.classList.contains?e.classList.contains(t):e.className&&-1<e.className.split(" ").indexOf(t))}function v(e,t){e&&(e.classList&&e.classList.add?e.classList.add(t):a(e,t)||(e.className&&(e.className+=" "),e.className+=t),e=e.querySelector("a"),"hover"===t)&&e&&e.hasAttribute("aria-expanded")&&e.setAttribute("aria-expanded","true")}function y(e,t){var r,n;if(e&&a(e,t)){if(e.classList&&e.classList.remove)e.classList.remove(t);else{for(r=" "+t+" ",n=" "+e.className+" ";-1<n.indexOf(r);)n=n.replace(r,"");e.className=n.replace(/^[\s]+|[\s]+$/g,"")}e=e.querySelector("a");"hover"===t&&e&&e.hasAttribute("aria-expanded")&&e.setAttribute("aria-expanded","false")}}function b(e){if(e&&e.length)for(var t=0;t<e.length;t++)y(e[t],"hover")}function g(e){if(!e.target||"wpadminbar"===e.target.id||"wp-admin-bar-top-secondary"===e.target.id)try{l.scrollTo({top:-32,left:0,behavior:"smooth"})}catch(e){l.scrollTo(0,-32)}}function E(e,t){for(l.Element.prototype.matches||(l.Element.prototype.matches=l.Element.prototype.matchesSelector||l.Element.prototype.mozMatchesSelector||l.Element.prototype.msMatchesSelector||l.Element.prototype.oMatchesSelector||l.Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),r=t.length;0<=--r&&t.item(r)!==this;);return-1<r});e&&e!==c;e=e.parentNode)if(e.matches(t))return e;return null}c.addEventListener("DOMContentLoaded",function(){var r,e,t,n,a,o,s,i=c.getElementById("wpadminbar");if(i&&"querySelectorAll"in i){r=i.querySelectorAll("li.menupop"),e=i.querySelectorAll(".ab-item"),t=c.querySelector("#wp-admin-bar-logout a"),n=c.getElementById("adminbarsearch"),a=c.getElementById("wp-admin-bar-get-shortlink"),i.querySelector(".screen-reader-shortcut"),o=/Mobile\/.+Safari/.test(u.userAgent)?"touchstart":"click",y(i,"nojs"),"ontouchstart"in l&&(c.body.addEventListener(o,function(e){E(e.target,"li.menupop")||b(r)}),i.addEventListener("touchstart",function e(){for(var t=0;t<r.length;t++)r[t].addEventListener("click",m.bind(null,r));i.removeEventListener("touchstart",e)})),i.addEventListener("click",g);for(s=0;s<r.length;s++)l.hoverintent(r[s],v.bind(null,r[s],"hover"),y.bind(null,r[s],"hover")).options({timeout:180}),r[s].addEventListener("keydown",p);for(s=0;s<e.length;s++)e[s].addEventListener("keydown",d);n&&((o=c.getElementById("adminbar-search")).addEventListener("focus",function(){v(n,"adminbar-focused")}),o.addEventListener("blur",function(){y(n,"adminbar-focused")})),a&&a.addEventListener("click",f),l.location.hash&&l.scrollBy(0,-32),t&&t.addEventListener("click",h)}})}(document,window,navigator);
|
||||
@@ -22,7 +22,7 @@ window.wp = window.wp || {};
|
||||
});
|
||||
|
||||
/**
|
||||
* Allows the Customizer to be overlayed on any page.
|
||||
* Allows the Customizer to be overlaid on any page.
|
||||
*
|
||||
* By default, any element in the body with the load-customize class will open
|
||||
* an iframe overlay with the URL specified.
|
||||
|
||||
@@ -429,7 +429,7 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
|
||||
}
|
||||
|
||||
/* jshint ignore:start */
|
||||
self.orginalDocumentWrite = document.write;
|
||||
self.originalDocumentWrite = document.write;
|
||||
document.write = function() {
|
||||
throw new Error( self.data.l10n.badDocumentWrite );
|
||||
};
|
||||
@@ -473,8 +473,8 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
|
||||
partial.fallback( error, [ placement ] );
|
||||
}
|
||||
/* jshint ignore:start */
|
||||
document.write = self.orginalDocumentWrite;
|
||||
self.orginalDocumentWrite = null;
|
||||
document.write = self.originalDocumentWrite;
|
||||
self.originalDocumentWrite = null;
|
||||
/* jshint ignore:end */
|
||||
|
||||
partial.createEditShortcutForPlacement( placement );
|
||||
@@ -673,7 +673,7 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
|
||||
self._pendingPartialRequests = {};
|
||||
|
||||
/**
|
||||
* Timeout ID for the current requesr, or null if no request is current.
|
||||
* Timeout ID for the current request, or null if no request is current.
|
||||
*
|
||||
* @since 4.5.0
|
||||
* @type {number|null}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+3
-301
@@ -402,307 +402,9 @@ function annotations(state = {}, action) {
|
||||
}
|
||||
/* harmony default export */ const reducer = (annotations);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/rememo/rememo.js
|
||||
|
||||
|
||||
/** @typedef {(...args: any[]) => *[]} GetDependants */
|
||||
|
||||
/** @typedef {() => void} Clear */
|
||||
|
||||
/**
|
||||
* @typedef {{
|
||||
* getDependants: GetDependants,
|
||||
* clear: Clear
|
||||
* }} EnhancedSelector
|
||||
*/
|
||||
|
||||
/**
|
||||
* Internal cache entry.
|
||||
*
|
||||
* @typedef CacheNode
|
||||
*
|
||||
* @property {?CacheNode|undefined} [prev] Previous node.
|
||||
* @property {?CacheNode|undefined} [next] Next node.
|
||||
* @property {*[]} args Function arguments for cache entry.
|
||||
* @property {*} val Function result.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef Cache
|
||||
*
|
||||
* @property {Clear} clear Function to clear cache.
|
||||
* @property {boolean} [isUniqueByDependants] Whether dependants are valid in
|
||||
* considering cache uniqueness. A cache is unique if dependents are all arrays
|
||||
* or objects.
|
||||
* @property {CacheNode?} [head] Cache head.
|
||||
* @property {*[]} [lastDependants] Dependants from previous invocation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Arbitrary value used as key for referencing cache object in WeakMap tree.
|
||||
*
|
||||
* @type {{}}
|
||||
*/
|
||||
var LEAF_KEY = {};
|
||||
|
||||
/**
|
||||
* Returns the first argument as the sole entry in an array.
|
||||
*
|
||||
* @template T
|
||||
*
|
||||
* @param {T} value Value to return.
|
||||
*
|
||||
* @return {[T]} Value returned as entry in array.
|
||||
*/
|
||||
function arrayOf(value) {
|
||||
return [value];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the value passed is object-like, or false otherwise. A value
|
||||
* is object-like if it can support property assignment, e.g. object or array.
|
||||
*
|
||||
* @param {*} value Value to test.
|
||||
*
|
||||
* @return {boolean} Whether value is object-like.
|
||||
*/
|
||||
function isObjectLike(value) {
|
||||
return !!value && 'object' === typeof value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and returns a new cache object.
|
||||
*
|
||||
* @return {Cache} Cache object.
|
||||
*/
|
||||
function createCache() {
|
||||
/** @type {Cache} */
|
||||
var cache = {
|
||||
clear: function () {
|
||||
cache.head = null;
|
||||
},
|
||||
};
|
||||
|
||||
return cache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if entries within the two arrays are strictly equal by
|
||||
* reference from a starting index.
|
||||
*
|
||||
* @param {*[]} a First array.
|
||||
* @param {*[]} b Second array.
|
||||
* @param {number} fromIndex Index from which to start comparison.
|
||||
*
|
||||
* @return {boolean} Whether arrays are shallowly equal.
|
||||
*/
|
||||
function isShallowEqual(a, b, fromIndex) {
|
||||
var i;
|
||||
|
||||
if (a.length !== b.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (i = fromIndex; i < a.length; i++) {
|
||||
if (a[i] !== b[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a memoized selector function. The getDependants function argument is
|
||||
* called before the memoized selector and is expected to return an immutable
|
||||
* reference or array of references on which the selector depends for computing
|
||||
* its own return value. The memoize cache is preserved only as long as those
|
||||
* dependant references remain the same. If getDependants returns a different
|
||||
* reference(s), the cache is cleared and the selector value regenerated.
|
||||
*
|
||||
* @template {(...args: *[]) => *} S
|
||||
*
|
||||
* @param {S} selector Selector function.
|
||||
* @param {GetDependants=} getDependants Dependant getter returning an array of
|
||||
* references used in cache bust consideration.
|
||||
*/
|
||||
/* harmony default export */ function rememo(selector, getDependants) {
|
||||
/** @type {WeakMap<*,*>} */
|
||||
var rootCache;
|
||||
|
||||
/** @type {GetDependants} */
|
||||
var normalizedGetDependants = getDependants ? getDependants : arrayOf;
|
||||
|
||||
/**
|
||||
* Returns the cache for a given dependants array. When possible, a WeakMap
|
||||
* will be used to create a unique cache for each set of dependants. This
|
||||
* is feasible due to the nature of WeakMap in allowing garbage collection
|
||||
* to occur on entries where the key object is no longer referenced. Since
|
||||
* WeakMap requires the key to be an object, this is only possible when the
|
||||
* dependant is object-like. The root cache is created as a hierarchy where
|
||||
* each top-level key is the first entry in a dependants set, the value a
|
||||
* WeakMap where each key is the next dependant, and so on. This continues
|
||||
* so long as the dependants are object-like. If no dependants are object-
|
||||
* like, then the cache is shared across all invocations.
|
||||
*
|
||||
* @see isObjectLike
|
||||
*
|
||||
* @param {*[]} dependants Selector dependants.
|
||||
*
|
||||
* @return {Cache} Cache object.
|
||||
*/
|
||||
function getCache(dependants) {
|
||||
var caches = rootCache,
|
||||
isUniqueByDependants = true,
|
||||
i,
|
||||
dependant,
|
||||
map,
|
||||
cache;
|
||||
|
||||
for (i = 0; i < dependants.length; i++) {
|
||||
dependant = dependants[i];
|
||||
|
||||
// Can only compose WeakMap from object-like key.
|
||||
if (!isObjectLike(dependant)) {
|
||||
isUniqueByDependants = false;
|
||||
break;
|
||||
}
|
||||
|
||||
// Does current segment of cache already have a WeakMap?
|
||||
if (caches.has(dependant)) {
|
||||
// Traverse into nested WeakMap.
|
||||
caches = caches.get(dependant);
|
||||
} else {
|
||||
// Create, set, and traverse into a new one.
|
||||
map = new WeakMap();
|
||||
caches.set(dependant, map);
|
||||
caches = map;
|
||||
}
|
||||
}
|
||||
|
||||
// We use an arbitrary (but consistent) object as key for the last item
|
||||
// in the WeakMap to serve as our running cache.
|
||||
if (!caches.has(LEAF_KEY)) {
|
||||
cache = createCache();
|
||||
cache.isUniqueByDependants = isUniqueByDependants;
|
||||
caches.set(LEAF_KEY, cache);
|
||||
}
|
||||
|
||||
return caches.get(LEAF_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets root memoization cache.
|
||||
*/
|
||||
function clear() {
|
||||
rootCache = new WeakMap();
|
||||
}
|
||||
|
||||
/* eslint-disable jsdoc/check-param-names */
|
||||
/**
|
||||
* The augmented selector call, considering first whether dependants have
|
||||
* changed before passing it to underlying memoize function.
|
||||
*
|
||||
* @param {*} source Source object for derivation.
|
||||
* @param {...*} extraArgs Additional arguments to pass to selector.
|
||||
*
|
||||
* @return {*} Selector result.
|
||||
*/
|
||||
/* eslint-enable jsdoc/check-param-names */
|
||||
function callSelector(/* source, ...extraArgs */) {
|
||||
var len = arguments.length,
|
||||
cache,
|
||||
node,
|
||||
i,
|
||||
args,
|
||||
dependants;
|
||||
|
||||
// Create copy of arguments (avoid leaking deoptimization).
|
||||
args = new Array(len);
|
||||
for (i = 0; i < len; i++) {
|
||||
args[i] = arguments[i];
|
||||
}
|
||||
|
||||
dependants = normalizedGetDependants.apply(null, args);
|
||||
cache = getCache(dependants);
|
||||
|
||||
// If not guaranteed uniqueness by dependants (primitive type), shallow
|
||||
// compare against last dependants and, if references have changed,
|
||||
// destroy cache to recalculate result.
|
||||
if (!cache.isUniqueByDependants) {
|
||||
if (
|
||||
cache.lastDependants &&
|
||||
!isShallowEqual(dependants, cache.lastDependants, 0)
|
||||
) {
|
||||
cache.clear();
|
||||
}
|
||||
|
||||
cache.lastDependants = dependants;
|
||||
}
|
||||
|
||||
node = cache.head;
|
||||
while (node) {
|
||||
// Check whether node arguments match arguments
|
||||
if (!isShallowEqual(node.args, args, 1)) {
|
||||
node = node.next;
|
||||
continue;
|
||||
}
|
||||
|
||||
// At this point we can assume we've found a match
|
||||
|
||||
// Surface matched node to head if not already
|
||||
if (node !== cache.head) {
|
||||
// Adjust siblings to point to each other.
|
||||
/** @type {CacheNode} */ (node.prev).next = node.next;
|
||||
if (node.next) {
|
||||
node.next.prev = node.prev;
|
||||
}
|
||||
|
||||
node.next = cache.head;
|
||||
node.prev = null;
|
||||
/** @type {CacheNode} */ (cache.head).prev = node;
|
||||
cache.head = node;
|
||||
}
|
||||
|
||||
// Return immediately
|
||||
return node.val;
|
||||
}
|
||||
|
||||
// No cached value found. Continue to insertion phase:
|
||||
|
||||
node = /** @type {CacheNode} */ ({
|
||||
// Generate the result from original function
|
||||
val: selector.apply(null, args),
|
||||
});
|
||||
|
||||
// Avoid including the source object in the cache.
|
||||
args[0] = null;
|
||||
node.args = 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 (cache.head) {
|
||||
cache.head.prev = node;
|
||||
node.next = cache.head;
|
||||
}
|
||||
|
||||
cache.head = node;
|
||||
|
||||
return node.val;
|
||||
}
|
||||
|
||||
callSelector.getDependants = normalizedGetDependants;
|
||||
callSelector.clear = clear;
|
||||
clear();
|
||||
|
||||
return /** @type {S & EnhancedSelector} */ (callSelector);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/selectors.js
|
||||
/**
|
||||
* External dependencies
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
@@ -725,7 +427,7 @@ const EMPTY_ARRAY = [];
|
||||
*
|
||||
* @return {Array} The annotations applicable to this block.
|
||||
*/
|
||||
const __experimentalGetAnnotationsForBlock = rememo((state, blockClientId) => {
|
||||
const __experimentalGetAnnotationsForBlock = (0,external_wp_data_namespaceObject.createSelector)((state, blockClientId) => {
|
||||
var _state$blockClientId;
|
||||
return ((_state$blockClientId = state?.[blockClientId]) !== null && _state$blockClientId !== void 0 ? _state$blockClientId : []).filter(annotation => {
|
||||
return annotation.selector === 'block';
|
||||
@@ -751,7 +453,7 @@ function __experimentalGetAllAnnotationsForBlock(state, blockClientId) {
|
||||
* @param {string} richTextIdentifier Unique identifier that identifies the given RichText.
|
||||
* @return {Array} All the annotations relevant for the `RichText`.
|
||||
*/
|
||||
const __experimentalGetAnnotationsForRichText = rememo((state, blockClientId, richTextIdentifier) => {
|
||||
const __experimentalGetAnnotationsForRichText = (0,external_wp_data_namespaceObject.createSelector)((state, blockClientId, richTextIdentifier) => {
|
||||
var _state$blockClientId4;
|
||||
return ((_state$blockClientId4 = state?.[blockClientId]) !== null && _state$blockClientId4 !== void 0 ? _state$blockClientId4 : []).filter(annotation => {
|
||||
return annotation.selector === 'range' && richTextIdentifier === annotation.richTextIdentifier;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+307
-239
@@ -90,8 +90,6 @@ __webpack_require__.d(resolvers_namespaceObject, {
|
||||
getDownloadableBlocks: () => (resolvers_getDownloadableBlocks)
|
||||
});
|
||||
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: external ["wp","plugins"]
|
||||
const external_wp_plugins_namespaceObject = window["wp"]["plugins"];
|
||||
;// CONCATENATED MODULE: external ["wp","hooks"]
|
||||
@@ -1349,57 +1347,63 @@ function Icon({
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","primitives"]
|
||||
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-filled.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const starFilled = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const starFilled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"
|
||||
}));
|
||||
viewBox: "0 0 24 24",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const star_filled = (starFilled);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-half.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const starHalf = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const starHalf = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"
|
||||
}));
|
||||
viewBox: "0 0 24 24",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const star_half = (starHalf);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const starEmpty = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const starEmpty = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
fillRule: "evenodd",
|
||||
d: "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",
|
||||
clipRule: "evenodd"
|
||||
}));
|
||||
viewBox: "0 0 24 24",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
|
||||
fillRule: "evenodd",
|
||||
d: "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",
|
||||
clipRule: "evenodd"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const star_empty = (starEmpty);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/stars.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
function Stars({
|
||||
rating
|
||||
}) {
|
||||
@@ -1407,64 +1411,63 @@ function Stars({
|
||||
const fullStarCount = Math.floor(rating);
|
||||
const halfStarCount = Math.ceil(rating - fullStarCount);
|
||||
const emptyStarCount = 5 - (fullStarCount + halfStarCount);
|
||||
return (0,external_React_namespaceObject.createElement)("span", {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
|
||||
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: number of stars. */
|
||||
(0,external_wp_i18n_namespaceObject.__)('%s out of 5 stars'), stars)
|
||||
}, Array.from({
|
||||
length: fullStarCount
|
||||
}).map((_, i) => (0,external_React_namespaceObject.createElement)(icon, {
|
||||
key: `full_stars_${i}`,
|
||||
className: "block-directory-block-ratings__star-full",
|
||||
icon: star_filled,
|
||||
size: 16
|
||||
})), Array.from({
|
||||
length: halfStarCount
|
||||
}).map((_, i) => (0,external_React_namespaceObject.createElement)(icon, {
|
||||
key: `half_stars_${i}`,
|
||||
className: "block-directory-block-ratings__star-half-full",
|
||||
icon: star_half,
|
||||
size: 16
|
||||
})), Array.from({
|
||||
length: emptyStarCount
|
||||
}).map((_, i) => (0,external_React_namespaceObject.createElement)(icon, {
|
||||
key: `empty_stars_${i}`,
|
||||
className: "block-directory-block-ratings__star-empty",
|
||||
icon: star_empty,
|
||||
size: 16
|
||||
})));
|
||||
(0,external_wp_i18n_namespaceObject.__)('%s out of 5 stars'), stars),
|
||||
children: [Array.from({
|
||||
length: fullStarCount
|
||||
}).map((_, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, {
|
||||
className: "block-directory-block-ratings__star-full",
|
||||
icon: star_filled,
|
||||
size: 16
|
||||
}, `full_stars_${i}`)), Array.from({
|
||||
length: halfStarCount
|
||||
}).map((_, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, {
|
||||
className: "block-directory-block-ratings__star-half-full",
|
||||
icon: star_half,
|
||||
size: 16
|
||||
}, `half_stars_${i}`)), Array.from({
|
||||
length: emptyStarCount
|
||||
}).map((_, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, {
|
||||
className: "block-directory-block-ratings__star-empty",
|
||||
icon: star_empty,
|
||||
size: 16
|
||||
}, `empty_stars_${i}`))]
|
||||
});
|
||||
}
|
||||
/* harmony default export */ const stars = (Stars);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/block-ratings/index.js
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
const BlockRatings = ({
|
||||
rating
|
||||
}) => (0,external_React_namespaceObject.createElement)("span", {
|
||||
className: "block-directory-block-ratings"
|
||||
}, (0,external_React_namespaceObject.createElement)(stars, {
|
||||
rating: rating
|
||||
}));
|
||||
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
|
||||
className: "block-directory-block-ratings",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(stars, {
|
||||
rating: rating
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const block_ratings = (BlockRatings);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-icon/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
function DownloadableBlockIcon({
|
||||
icon
|
||||
}) {
|
||||
const className = 'block-directory-downloadable-block-icon';
|
||||
return icon.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/) !== null ? (0,external_React_namespaceObject.createElement)("img", {
|
||||
return icon.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/) !== null ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
|
||||
className: className,
|
||||
src: icon,
|
||||
alt: ""
|
||||
}) : (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
|
||||
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, {
|
||||
className: className,
|
||||
icon: icon,
|
||||
showColors: true
|
||||
@@ -1473,7 +1476,6 @@ function DownloadableBlockIcon({
|
||||
/* harmony default export */ const downloadable_block_icon = (DownloadableBlockIcon);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-notice/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -1484,6 +1486,8 @@ function DownloadableBlockIcon({
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
const DownloadableBlockNotice = ({
|
||||
block
|
||||
}) => {
|
||||
@@ -1491,11 +1495,13 @@ const DownloadableBlockNotice = ({
|
||||
if (!errorNotice) {
|
||||
return null;
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "block-directory-downloadable-block-notice"
|
||||
}, (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "block-directory-downloadable-block-notice__content"
|
||||
}, errorNotice.message, errorNotice.isFatal ? ' ' + (0,external_wp_i18n_namespaceObject.__)('Try reloading the page.') : null));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
className: "block-directory-downloadable-block-notice",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
|
||||
className: "block-directory-downloadable-block-notice__content",
|
||||
children: [errorNotice.message, errorNotice.isFatal ? ' ' + (0,external_wp_i18n_namespaceObject.__)('Try reloading the page.') : null]
|
||||
})
|
||||
});
|
||||
};
|
||||
/* harmony default export */ const downloadable_block_notice = (DownloadableBlockNotice);
|
||||
|
||||
@@ -1509,10 +1515,9 @@ const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
|
||||
const {
|
||||
lock,
|
||||
unlock
|
||||
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/block-directory');
|
||||
} = (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/block-directory');
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-block-list-item/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -1531,6 +1536,9 @@ const {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const {
|
||||
CompositeItemV2: CompositeItem
|
||||
} = unlock(external_wp_components_namespaceObject.privateApis);
|
||||
@@ -1604,8 +1612,8 @@ function DownloadableBlockListItem({
|
||||
} else if (isInstalling) {
|
||||
statusText = (0,external_wp_i18n_namespaceObject.__)('Installing…');
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)(CompositeItem, {
|
||||
render: (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(CompositeItem, {
|
||||
render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
|
||||
__experimentalIsFocusable: true,
|
||||
type: "button",
|
||||
role: "option",
|
||||
@@ -1624,35 +1632,44 @@ function DownloadableBlockListItem({
|
||||
tooltipPosition: "top center"
|
||||
}),
|
||||
store: composite,
|
||||
disabled: isInstalling || !isInstallable
|
||||
}, (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "block-directory-downloadable-block-list-item__icon"
|
||||
}, (0,external_React_namespaceObject.createElement)(downloadable_block_icon, {
|
||||
icon: icon,
|
||||
title: title
|
||||
}), isInstalling ? (0,external_React_namespaceObject.createElement)("span", {
|
||||
className: "block-directory-downloadable-block-list-item__spinner"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)) : (0,external_React_namespaceObject.createElement)(block_ratings, {
|
||||
rating: rating
|
||||
})), (0,external_React_namespaceObject.createElement)("span", {
|
||||
className: "block-directory-downloadable-block-list-item__details"
|
||||
}, (0,external_React_namespaceObject.createElement)("span", {
|
||||
className: "block-directory-downloadable-block-list-item__title"
|
||||
}, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %1$s: block title, %2$s: author name. */
|
||||
(0,external_wp_i18n_namespaceObject.__)('%1$s <span>by %2$s</span>'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), author), {
|
||||
span: (0,external_React_namespaceObject.createElement)("span", {
|
||||
className: "block-directory-downloadable-block-list-item__author"
|
||||
})
|
||||
})), hasNotice ? (0,external_React_namespaceObject.createElement)(downloadable_block_notice, {
|
||||
block: item
|
||||
}) : (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("span", {
|
||||
className: "block-directory-downloadable-block-list-item__desc"
|
||||
}, !!statusText ? statusText : (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(description)), isInstallable && !(isInstalled || isInstalling) && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, null, (0,external_wp_i18n_namespaceObject.__)('Install block')))));
|
||||
disabled: isInstalling || !isInstallable,
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
|
||||
className: "block-directory-downloadable-block-list-item__icon",
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(downloadable_block_icon, {
|
||||
icon: icon,
|
||||
title: title
|
||||
}), isInstalling ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
|
||||
className: "block-directory-downloadable-block-list-item__spinner",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
|
||||
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_ratings, {
|
||||
rating: rating
|
||||
})]
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
|
||||
className: "block-directory-downloadable-block-list-item__details",
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
|
||||
className: "block-directory-downloadable-block-list-item__title",
|
||||
children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %1$s: block title, %2$s: author name. */
|
||||
(0,external_wp_i18n_namespaceObject.__)('%1$s <span>by %2$s</span>'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), author), {
|
||||
span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
|
||||
className: "block-directory-downloadable-block-list-item__author"
|
||||
})
|
||||
})
|
||||
}), hasNotice ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(downloadable_block_notice, {
|
||||
block: item
|
||||
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
|
||||
className: "block-directory-downloadable-block-list-item__desc",
|
||||
children: !!statusText ? statusText : (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(description)
|
||||
}), isInstallable && !(isInstalled || isInstalling) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('Install block')
|
||||
})]
|
||||
})]
|
||||
})]
|
||||
});
|
||||
}
|
||||
/* harmony default export */ const downloadable_block_list_item = (DownloadableBlockListItem);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-list/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -1667,6 +1684,7 @@ function DownloadableBlockListItem({
|
||||
|
||||
|
||||
|
||||
|
||||
const {
|
||||
CompositeV2: Composite,
|
||||
useCompositeStoreV2: useCompositeStore
|
||||
@@ -1684,47 +1702,49 @@ function DownloadableBlocksList({
|
||||
if (!items.length) {
|
||||
return null;
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)(Composite, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Composite, {
|
||||
store: composite,
|
||||
role: "listbox",
|
||||
className: "block-directory-downloadable-blocks-list",
|
||||
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Blocks available for install')
|
||||
}, items.map(item => {
|
||||
return (0,external_React_namespaceObject.createElement)(downloadable_block_list_item, {
|
||||
key: item.id,
|
||||
composite: composite,
|
||||
onClick: () => {
|
||||
// Check if the block is registered (`getBlockType`
|
||||
// will return an object). If so, insert the block.
|
||||
// This prevents installing existing plugins.
|
||||
if ((0,external_wp_blocks_namespaceObject.getBlockType)(item.name)) {
|
||||
onSelect(item);
|
||||
} else {
|
||||
installBlockType(item).then(success => {
|
||||
if (success) {
|
||||
onSelect(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
onHover(null);
|
||||
},
|
||||
onHover: onHover,
|
||||
item: item
|
||||
});
|
||||
}));
|
||||
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Blocks available for install'),
|
||||
children: items.map(item => {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(downloadable_block_list_item, {
|
||||
composite: composite,
|
||||
onClick: () => {
|
||||
// Check if the block is registered (`getBlockType`
|
||||
// will return an object). If so, insert the block.
|
||||
// This prevents installing existing plugins.
|
||||
if ((0,external_wp_blocks_namespaceObject.getBlockType)(item.name)) {
|
||||
onSelect(item);
|
||||
} else {
|
||||
installBlockType(item).then(success => {
|
||||
if (success) {
|
||||
onSelect(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
onHover(null);
|
||||
},
|
||||
onHover: onHover,
|
||||
item: item
|
||||
}, item.id);
|
||||
})
|
||||
});
|
||||
}
|
||||
/* harmony default export */ const downloadable_blocks_list = (DownloadableBlocksList);
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","a11y"]
|
||||
const external_wp_a11y_namespaceObject = window["wp"]["a11y"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/inserter-panel.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function DownloadableBlocksInserterPanel({
|
||||
children,
|
||||
downloadableItems,
|
||||
@@ -1735,60 +1755,78 @@ function DownloadableBlocksInserterPanel({
|
||||
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of available blocks. */
|
||||
(0,external_wp_i18n_namespaceObject._n)('%d additional block is available to install.', '%d additional blocks are available to install.', count), count));
|
||||
}, [count]);
|
||||
return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, !hasLocalBlocks && (0,external_React_namespaceObject.createElement)("p", {
|
||||
className: "block-directory-downloadable-blocks-panel__no-local"
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('No results available from your installed blocks.')), (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "block-editor-inserter__quick-inserter-separator"
|
||||
}), (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "block-directory-downloadable-blocks-panel"
|
||||
}, (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "block-directory-downloadable-blocks-panel__header"
|
||||
}, (0,external_React_namespaceObject.createElement)("h2", {
|
||||
className: "block-directory-downloadable-blocks-panel__title"
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Available to install')), (0,external_React_namespaceObject.createElement)("p", {
|
||||
className: "block-directory-downloadable-blocks-panel__description"
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Select a block to install and add it to your post.'))), children));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [!hasLocalBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
|
||||
className: "block-directory-downloadable-blocks-panel__no-local",
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('No results available from your installed blocks.')
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
className: "block-editor-inserter__quick-inserter-separator"
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
|
||||
className: "block-directory-downloadable-blocks-panel",
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
|
||||
className: "block-directory-downloadable-blocks-panel__header",
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", {
|
||||
className: "block-directory-downloadable-blocks-panel__title",
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('Available to install')
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
|
||||
className: "block-directory-downloadable-blocks-panel__description",
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('Select a block to install and add it to your post.')
|
||||
})]
|
||||
}), children]
|
||||
})]
|
||||
});
|
||||
}
|
||||
/* harmony default export */ const inserter_panel = (DownloadableBlocksInserterPanel);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const blockDefault = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const blockDefault = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"
|
||||
}));
|
||||
viewBox: "0 0 24 24",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const block_default = (blockDefault);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/no-results.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function DownloadableBlocksNoResults() {
|
||||
return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "block-editor-inserter__no-results"
|
||||
}, (0,external_React_namespaceObject.createElement)(icon, {
|
||||
className: "block-editor-inserter__no-results-icon",
|
||||
icon: block_default
|
||||
}), (0,external_React_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('No results found.'))), (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "block-editor-inserter__tips"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Tip, null, (0,external_wp_i18n_namespaceObject.__)('Interested in creating your own block?'), (0,external_React_namespaceObject.createElement)("br", null), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
|
||||
href: "https://developer.wordpress.org/block-editor/"
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Get started here'), "."))));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
|
||||
className: "block-editor-inserter__no-results",
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, {
|
||||
className: "block-editor-inserter__no-results-icon",
|
||||
icon: block_default
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('No results found.')
|
||||
})]
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
className: "block-editor-inserter__tips",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Tip, {
|
||||
children: [(0,external_wp_i18n_namespaceObject.__)('Interested in creating your own block?'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ExternalLink, {
|
||||
href: "https://developer.wordpress.org/block-editor/",
|
||||
children: [(0,external_wp_i18n_namespaceObject.__)('Get started here'), "."]
|
||||
})]
|
||||
})
|
||||
})]
|
||||
});
|
||||
}
|
||||
/* harmony default export */ const no_results = (DownloadableBlocksNoResults);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/downloadable-blocks-panel/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -1805,6 +1843,9 @@ function DownloadableBlocksNoResults() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const EMPTY_ARRAY = [];
|
||||
const useDownloadableBlocks = filterValue => (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
const {
|
||||
@@ -1860,35 +1901,41 @@ function DownloadableBlocksPanel({
|
||||
isLoading
|
||||
} = useDownloadableBlocks(filterValue);
|
||||
if (hasPermission === undefined || isLoading || isTyping) {
|
||||
return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, hasPermission && !hasLocalBlocks && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)("p", {
|
||||
className: "block-directory-downloadable-blocks-panel__no-local"
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('No results available from your installed blocks.')), (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "block-editor-inserter__quick-inserter-separator"
|
||||
})), (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "block-directory-downloadable-blocks-panel has-blocks-loading"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [hasPermission && !hasLocalBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
|
||||
className: "block-directory-downloadable-blocks-panel__no-local",
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('No results available from your installed blocks.')
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
className: "block-editor-inserter__quick-inserter-separator"
|
||||
})]
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
className: "block-directory-downloadable-blocks-panel has-blocks-loading",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
|
||||
})]
|
||||
});
|
||||
}
|
||||
if (false === hasPermission) {
|
||||
if (!hasLocalBlocks) {
|
||||
return (0,external_React_namespaceObject.createElement)(no_results, null);
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results, {});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (downloadableBlocks.length === 0) {
|
||||
return hasLocalBlocks ? null : (0,external_React_namespaceObject.createElement)(no_results, null);
|
||||
return hasLocalBlocks ? null : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results, {});
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)(inserter_panel, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_panel, {
|
||||
downloadableItems: downloadableBlocks,
|
||||
hasLocalBlocks: hasLocalBlocks
|
||||
}, (0,external_React_namespaceObject.createElement)(downloadable_blocks_list, {
|
||||
items: downloadableBlocks,
|
||||
onSelect: onSelect,
|
||||
onHover: onHover
|
||||
}));
|
||||
hasLocalBlocks: hasLocalBlocks,
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(downloadable_blocks_list, {
|
||||
items: downloadableBlocks,
|
||||
onSelect: onSelect,
|
||||
onHover: onHover
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -1900,34 +1947,36 @@ function DownloadableBlocksPanel({
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
function InserterMenuDownloadableBlocksPanel() {
|
||||
const [debouncedFilterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)('');
|
||||
const debouncedSetFilterValue = (0,external_wp_compose_namespaceObject.debounce)(setFilterValue, 400);
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableInserterMenuExtension, null, ({
|
||||
onSelect,
|
||||
onHover,
|
||||
filterValue,
|
||||
hasItems
|
||||
}) => {
|
||||
if (debouncedFilterValue !== filterValue) {
|
||||
debouncedSetFilterValue(filterValue);
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableInserterMenuExtension, {
|
||||
children: ({
|
||||
onSelect,
|
||||
onHover,
|
||||
filterValue,
|
||||
hasItems
|
||||
}) => {
|
||||
if (debouncedFilterValue !== filterValue) {
|
||||
debouncedSetFilterValue(filterValue);
|
||||
}
|
||||
if (!debouncedFilterValue) {
|
||||
return null;
|
||||
}
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DownloadableBlocksPanel, {
|
||||
onSelect: onSelect,
|
||||
onHover: onHover,
|
||||
filterValue: debouncedFilterValue,
|
||||
hasLocalBlocks: hasItems,
|
||||
isTyping: filterValue !== debouncedFilterValue
|
||||
});
|
||||
}
|
||||
if (!debouncedFilterValue) {
|
||||
return null;
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)(DownloadableBlocksPanel, {
|
||||
onSelect: onSelect,
|
||||
onHover: onHover,
|
||||
filterValue: debouncedFilterValue,
|
||||
hasLocalBlocks: hasItems,
|
||||
isTyping: filterValue !== debouncedFilterValue
|
||||
});
|
||||
});
|
||||
}
|
||||
/* harmony default export */ const inserter_menu_downloadable_blocks_panel = (InserterMenuDownloadableBlocksPanel);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/components/compact-list/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -1937,38 +1986,43 @@ function InserterMenuDownloadableBlocksPanel() {
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function CompactList({
|
||||
items
|
||||
}) {
|
||||
if (!items.length) {
|
||||
return null;
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)("ul", {
|
||||
className: "block-directory-compact-list"
|
||||
}, items.map(({
|
||||
icon,
|
||||
id,
|
||||
title,
|
||||
author
|
||||
}) => (0,external_React_namespaceObject.createElement)("li", {
|
||||
key: id,
|
||||
className: "block-directory-compact-list__item"
|
||||
}, (0,external_React_namespaceObject.createElement)(downloadable_block_icon, {
|
||||
icon: icon,
|
||||
title: title
|
||||
}), (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "block-directory-compact-list__item-details"
|
||||
}, (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "block-directory-compact-list__item-title"
|
||||
}, title), (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "block-directory-compact-list__item-author"
|
||||
}, (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Name of the block author. */
|
||||
(0,external_wp_i18n_namespaceObject.__)('By %s'), author))))));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {
|
||||
className: "block-directory-compact-list",
|
||||
children: items.map(({
|
||||
icon,
|
||||
id,
|
||||
title,
|
||||
author
|
||||
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", {
|
||||
className: "block-directory-compact-list__item",
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(downloadable_block_icon, {
|
||||
icon: icon,
|
||||
title: title
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
|
||||
className: "block-directory-compact-list__item-details",
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
className: "block-directory-compact-list__item-title",
|
||||
children: title
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
className: "block-directory-compact-list__item-author",
|
||||
children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Name of the block author. */
|
||||
(0,external_wp_i18n_namespaceObject.__)('By %s'), author)
|
||||
})]
|
||||
})]
|
||||
}, id))
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/index.js
|
||||
var _window$wp$editPost;
|
||||
|
||||
var _window$wp$editor;
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -1982,31 +2036,34 @@ var _window$wp$editPost;
|
||||
|
||||
|
||||
|
||||
// We shouldn't import the edit-post package directly
|
||||
// because it would include the wp-edit-post in all pages loading the block-directory script.
|
||||
// We shouldn't import the editor package directly
|
||||
// because it would include the wp-editor in all pages loading the block-directory script.
|
||||
|
||||
|
||||
const {
|
||||
PluginPrePublishPanel
|
||||
} = (_window$wp$editPost = window?.wp?.editPost) !== null && _window$wp$editPost !== void 0 ? _window$wp$editPost : {};
|
||||
} = (_window$wp$editor = window?.wp?.editor) !== null && _window$wp$editor !== void 0 ? _window$wp$editor : {};
|
||||
function InstalledBlocksPrePublishPanel() {
|
||||
const newBlockTypes = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getNewBlockTypes(), []);
|
||||
if (!newBlockTypes.length) {
|
||||
return null;
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)(PluginPrePublishPanel, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PluginPrePublishPanel, {
|
||||
icon: block_default,
|
||||
title: (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
// translators: %d: number of blocks (number).
|
||||
(0,external_wp_i18n_namespaceObject._n)('Added: %d block', 'Added: %d blocks', newBlockTypes.length), newBlockTypes.length),
|
||||
initialOpen: true
|
||||
}, (0,external_React_namespaceObject.createElement)("p", {
|
||||
className: "installed-blocks-pre-publish-panel__copy"
|
||||
}, (0,external_wp_i18n_namespaceObject._n)('The following block has been added to your site.', 'The following blocks have been added to your site.', newBlockTypes.length)), (0,external_React_namespaceObject.createElement)(CompactList, {
|
||||
items: newBlockTypes
|
||||
}));
|
||||
initialOpen: true,
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
|
||||
className: "installed-blocks-pre-publish-panel__copy",
|
||||
children: (0,external_wp_i18n_namespaceObject._n)('The following block has been added to your site.', 'The following blocks have been added to your site.', newBlockTypes.length)
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CompactList, {
|
||||
items: newBlockTypes
|
||||
})]
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/get-install-missing/install-button.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -2020,6 +2077,7 @@ function InstalledBlocksPrePublishPanel() {
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
function InstallButton({
|
||||
attributes,
|
||||
block,
|
||||
@@ -2032,7 +2090,7 @@ function InstallButton({
|
||||
const {
|
||||
replaceBlock
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
|
||||
onClick: () => installBlockType(block).then(success => {
|
||||
if (success) {
|
||||
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name);
|
||||
@@ -2042,15 +2100,16 @@ function InstallButton({
|
||||
}
|
||||
}
|
||||
}),
|
||||
__experimentalIsFocusable: true,
|
||||
disabled: isInstallingBlock,
|
||||
isBusy: isInstallingBlock,
|
||||
variant: "primary"
|
||||
}, (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */
|
||||
(0,external_wp_i18n_namespaceObject.__)('Install %s'), block.title));
|
||||
variant: "primary",
|
||||
children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */
|
||||
(0,external_wp_i18n_namespaceObject.__)('Install %s'), block.title)
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/get-install-missing/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -2067,6 +2126,8 @@ function InstallButton({
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
const getInstallMissing = OriginalComponent => props => {
|
||||
const {
|
||||
originalName
|
||||
@@ -2091,11 +2152,11 @@ const getInstallMissing = OriginalComponent => props => {
|
||||
|
||||
// The user can't install blocks, or the block isn't available for download.
|
||||
if (!hasPermission || !block) {
|
||||
return (0,external_React_namespaceObject.createElement)(OriginalComponent, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
|
||||
...props
|
||||
});
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)(ModifiedWarning, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ModifiedWarning, {
|
||||
...props,
|
||||
originalBlock: block
|
||||
});
|
||||
@@ -2127,31 +2188,33 @@ const ModifiedWarning = ({
|
||||
}, [clientId]);
|
||||
let messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */
|
||||
(0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'), originalBlock.title || originalName);
|
||||
const actions = [(0,external_React_namespaceObject.createElement)(InstallButton, {
|
||||
key: "install",
|
||||
const actions = [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InstallButton, {
|
||||
block: originalBlock,
|
||||
attributes: props.attributes,
|
||||
clientId: props.clientId
|
||||
})];
|
||||
}, "install")];
|
||||
if (hasContent && hasHTMLBlock) {
|
||||
messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */
|
||||
(0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'), originalBlock.title || originalName);
|
||||
actions.push((0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
key: "convert",
|
||||
actions.push( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
|
||||
onClick: convertToHTML,
|
||||
variant: "tertiary"
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Keep as HTML')));
|
||||
variant: "tertiary",
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('Keep as HTML')
|
||||
}, "convert"));
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)("div", {
|
||||
...(0,external_wp_blockEditor_namespaceObject.useBlockProps)()
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
|
||||
actions: actions
|
||||
}, messageHTML), (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, originalUndelimitedContent));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
|
||||
...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(),
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, {
|
||||
actions: actions,
|
||||
children: messageHTML
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, {
|
||||
children: originalUndelimitedContent
|
||||
})]
|
||||
});
|
||||
};
|
||||
/* harmony default export */ const get_install_missing = (getInstallMissing);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/plugins/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -2165,9 +2228,14 @@ const ModifiedWarning = ({
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(0,external_wp_plugins_namespaceObject.registerPlugin)('block-directory', {
|
||||
render() {
|
||||
return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(AutoBlockUninstaller, null), (0,external_React_namespaceObject.createElement)(inserter_menu_downloadable_blocks_panel, null), (0,external_React_namespaceObject.createElement)(InstalledBlocksPrePublishPanel, null));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AutoBlockUninstaller, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_menu_downloadable_blocks_panel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InstalledBlocksPrePublishPanel, {})]
|
||||
});
|
||||
}
|
||||
});
|
||||
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'block-directory/fallback', (settings, name) => {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+17975
-14089
File diff suppressed because one or more lines are too long
+2
-22
File diff suppressed because one or more lines are too long
+14434
-11729
File diff suppressed because one or more lines are too long
+2
-12
File diff suppressed because one or more lines are too long
Vendored
+284
-475
File diff suppressed because it is too large
Load Diff
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+118
-461
File diff suppressed because one or more lines are too long
+1
-6
File diff suppressed because one or more lines are too long
Vendored
+11857
-11439
File diff suppressed because one or more lines are too long
+6
-20
File diff suppressed because one or more lines are too long
Vendored
+149
-40
@@ -2288,6 +2288,7 @@ __webpack_require__.d(__webpack_exports__, {
|
||||
createHigherOrderComponent: () => (/* reexport */ createHigherOrderComponent),
|
||||
debounce: () => (/* reexport */ debounce),
|
||||
ifCondition: () => (/* reexport */ if_condition),
|
||||
observableMap: () => (/* reexport */ observableMap),
|
||||
pipe: () => (/* reexport */ higher_order_pipe),
|
||||
pure: () => (/* reexport */ higher_order_pure),
|
||||
throttle: () => (/* reexport */ throttle),
|
||||
@@ -2306,6 +2307,7 @@ __webpack_require__.d(__webpack_exports__, {
|
||||
useKeyboardShortcut: () => (/* reexport */ use_keyboard_shortcut),
|
||||
useMediaQuery: () => (/* reexport */ useMediaQuery),
|
||||
useMergeRefs: () => (/* reexport */ useMergeRefs),
|
||||
useObservableValue: () => (/* reexport */ useObservableValue),
|
||||
usePrevious: () => (/* reexport */ usePrevious),
|
||||
useReducedMotion: () => (/* reexport */ use_reduced_motion),
|
||||
useRefEffect: () => (/* reexport */ useRefEffect),
|
||||
@@ -3111,6 +3113,59 @@ const throttle = (func, wait, options) => {
|
||||
});
|
||||
};
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/utils/observable-map/index.js
|
||||
/**
|
||||
* A constructor (factory) for `ObservableMap`, a map-like key/value data structure
|
||||
* where the individual entries are observable: using the `subscribe` method, you can
|
||||
* subscribe to updates for a particular keys. Each subscriber always observes one
|
||||
* specific key and is not notified about any unrelated changes (for different keys)
|
||||
* in the `ObservableMap`.
|
||||
*
|
||||
* @template K The type of the keys in the map.
|
||||
* @template V The type of the values in the map.
|
||||
* @return A new instance of the `ObservableMap` type.
|
||||
*/
|
||||
function observableMap() {
|
||||
const map = new Map();
|
||||
const listeners = new Map();
|
||||
function callListeners(name) {
|
||||
const list = listeners.get(name);
|
||||
if (!list) {
|
||||
return;
|
||||
}
|
||||
for (const listener of list) {
|
||||
listener();
|
||||
}
|
||||
}
|
||||
return {
|
||||
get(name) {
|
||||
return map.get(name);
|
||||
},
|
||||
set(name, value) {
|
||||
map.set(name, value);
|
||||
callListeners(name);
|
||||
},
|
||||
delete(name) {
|
||||
map.delete(name);
|
||||
callListeners(name);
|
||||
},
|
||||
subscribe(name, listener) {
|
||||
let list = listeners.get(name);
|
||||
if (!list) {
|
||||
list = new Set();
|
||||
listeners.set(name, list);
|
||||
}
|
||||
list.add(listener);
|
||||
return () => {
|
||||
list.delete(listener);
|
||||
if (list.size === 0) {
|
||||
listeners.delete(name);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/pipe.js
|
||||
/**
|
||||
* Parts of this source were derived and modified from lodash,
|
||||
@@ -3157,7 +3212,7 @@ const throttle = (func, wait, options) => {
|
||||
*
|
||||
* Allows to choose whether to perform left-to-right or right-to-left composition.
|
||||
*
|
||||
* @see https://docs-lodash.com/v4/flow/
|
||||
* @see https://lodash.com/docs/4#flow
|
||||
*
|
||||
* @param {boolean} reverse True if right-to-left, false for left-to-right composition.
|
||||
*/
|
||||
@@ -3175,7 +3230,7 @@ const basePipe = (reverse = false) => (...funcs) => (...args) => {
|
||||
*
|
||||
* This is inspired by `lodash`'s `flow` function.
|
||||
*
|
||||
* @see https://docs-lodash.com/v4/flow/
|
||||
* @see https://lodash.com/docs/4#flow
|
||||
*/
|
||||
const pipe = basePipe();
|
||||
|
||||
@@ -3193,15 +3248,14 @@ const pipe = basePipe();
|
||||
*
|
||||
* This is inspired by `lodash`'s `flowRight` function.
|
||||
*
|
||||
* @see https://docs-lodash.com/v4/flow-right/
|
||||
* @see https://lodash.com/docs/4#flow-right
|
||||
*/
|
||||
const compose = basePipe(true);
|
||||
/* harmony default export */ const higher_order_compose = (compose);
|
||||
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/if-condition/index.js
|
||||
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
@@ -3228,12 +3282,13 @@ const external_React_namespaceObject = window["React"];
|
||||
*
|
||||
* @return Higher-order component.
|
||||
*/
|
||||
|
||||
function ifCondition(predicate) {
|
||||
return createHigherOrderComponent(WrappedComponent => props => {
|
||||
if (!predicate(props)) {
|
||||
return null;
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)(WrappedComponent, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
|
||||
...props
|
||||
});
|
||||
}, 'ifCondition');
|
||||
@@ -3246,7 +3301,6 @@ var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(exte
|
||||
;// CONCATENATED MODULE: external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/pure/index.js
|
||||
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
@@ -3268,6 +3322,7 @@ const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
*
|
||||
* @deprecated Use `memo` or `PureComponent` instead.
|
||||
*/
|
||||
|
||||
const pure = createHigherOrderComponent(function (WrappedComponent) {
|
||||
if (WrappedComponent.prototype instanceof external_wp_element_namespaceObject.Component) {
|
||||
return class extends WrappedComponent {
|
||||
@@ -3281,7 +3336,7 @@ const pure = createHigherOrderComponent(function (WrappedComponent) {
|
||||
return !external_wp_isShallowEqual_default()(nextProps, this.props);
|
||||
}
|
||||
render() {
|
||||
return (0,external_React_namespaceObject.createElement)(WrappedComponent, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
|
||||
...this.props
|
||||
});
|
||||
}
|
||||
@@ -3332,7 +3387,6 @@ class Listener {
|
||||
/* harmony default export */ const listener = (Listener);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -3348,6 +3402,7 @@ class Listener {
|
||||
/**
|
||||
* Listener instance responsible for managing document event handling.
|
||||
*/
|
||||
|
||||
const with_global_events_listener = new listener();
|
||||
|
||||
/* eslint-disable jsdoc/no-undefined-types */
|
||||
@@ -3413,14 +3468,14 @@ function withGlobalEvents(eventTypesToHandlers) {
|
||||
}
|
||||
}
|
||||
render() {
|
||||
return (0,external_React_namespaceObject.createElement)(WrappedComponent, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
|
||||
...this.props.ownProps,
|
||||
ref: this.handleRef
|
||||
});
|
||||
}
|
||||
}
|
||||
return (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
|
||||
return (0,external_React_namespaceObject.createElement)(Wrapper, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapper, {
|
||||
ownProps: props,
|
||||
forwardedRef: ref
|
||||
});
|
||||
@@ -3470,7 +3525,9 @@ function createId(object) {
|
||||
*/
|
||||
function useInstanceId(object, prefix, preferredId) {
|
||||
return (0,external_wp_element_namespaceObject.useMemo)(() => {
|
||||
if (preferredId) return preferredId;
|
||||
if (preferredId) {
|
||||
return preferredId;
|
||||
}
|
||||
const id = createId(object);
|
||||
return prefix ? `${prefix}-${id}` : id;
|
||||
}, [object, preferredId, prefix]);
|
||||
@@ -3478,13 +3535,13 @@ function useInstanceId(object, prefix, preferredId) {
|
||||
/* harmony default export */ const use_instance_id = (useInstanceId);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-instance-id/index.js
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A Higher Order Component used to be provide a unique instance ID by
|
||||
* component.
|
||||
@@ -3493,7 +3550,7 @@ const withInstanceId = createHigherOrderComponent(WrappedComponent => {
|
||||
return props => {
|
||||
const instanceId = use_instance_id(WrappedComponent);
|
||||
// @ts-ignore
|
||||
return (0,external_React_namespaceObject.createElement)(WrappedComponent, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
|
||||
...props,
|
||||
instanceId: instanceId
|
||||
});
|
||||
@@ -3502,7 +3559,6 @@ const withInstanceId = createHigherOrderComponent(WrappedComponent => {
|
||||
/* harmony default export */ const with_instance_id = (withInstanceId);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-safe-timeout/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -3552,8 +3608,9 @@ const withSafeTimeout = createHigherOrderComponent(OriginalComponent => {
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
/*#__PURE__*/
|
||||
// @ts-ignore
|
||||
(0,external_React_namespaceObject.createElement)(OriginalComponent, {
|
||||
(0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
|
||||
...this.props,
|
||||
setTimeout: this.setTimeout,
|
||||
clearTimeout: this.clearTimeout
|
||||
@@ -3565,7 +3622,6 @@ const withSafeTimeout = createHigherOrderComponent(OriginalComponent => {
|
||||
/* harmony default export */ const with_safe_timeout = (withSafeTimeout);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-state/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -3587,6 +3643,7 @@ const withSafeTimeout = createHigherOrderComponent(OriginalComponent => {
|
||||
*
|
||||
* @return {any} A higher order component wrapper accepting a component that takes the state props + its own props + `setState` and returning a component that only accepts the own props.
|
||||
*/
|
||||
|
||||
function withState(initialState = {}) {
|
||||
external_wp_deprecated_default()('wp.compose.withState', {
|
||||
since: '5.8',
|
||||
@@ -3600,7 +3657,7 @@ function withState(initialState = {}) {
|
||||
this.state = initialState;
|
||||
}
|
||||
render() {
|
||||
return (0,external_React_namespaceObject.createElement)(OriginalComponent, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
|
||||
...this.props,
|
||||
...this.state,
|
||||
setState: this.setState
|
||||
@@ -3706,7 +3763,6 @@ function useConstrainedTabbing() {
|
||||
// See https://github.com/WordPress/gutenberg/issues/46041.
|
||||
if ( /** @type {HTMLElement} */target.contains(nextElement)) {
|
||||
event.preventDefault();
|
||||
/** @type {HTMLElement} */
|
||||
nextElement?.focus();
|
||||
return;
|
||||
}
|
||||
@@ -3896,6 +3952,11 @@ const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Hook used to focus the first tabbable element on mount.
|
||||
*
|
||||
@@ -3940,14 +4001,7 @@ function useFocusOnMount(focusOnMount = 'firstElement') {
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
focusOnMountRef.current = focusOnMount;
|
||||
}, [focusOnMount]);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
return () => {
|
||||
if (timerId.current) {
|
||||
clearTimeout(timerId.current);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
return (0,external_wp_element_namespaceObject.useCallback)(node => {
|
||||
return useRefEffect(node => {
|
||||
var _node$ownerDocument$a;
|
||||
if (!node || focusOnMountRef.current === false) {
|
||||
return;
|
||||
@@ -3959,12 +4013,17 @@ function useFocusOnMount(focusOnMount = 'firstElement') {
|
||||
timerId.current = setTimeout(() => {
|
||||
const firstTabbable = external_wp_dom_namespaceObject.focus.tabbable.find(node)[0];
|
||||
if (firstTabbable) {
|
||||
setFocus( /** @type {HTMLElement} */firstTabbable);
|
||||
setFocus(firstTabbable);
|
||||
}
|
||||
}, 0);
|
||||
return;
|
||||
}
|
||||
setFocus(node);
|
||||
return () => {
|
||||
if (timerId.current) {
|
||||
clearTimeout(timerId.current);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
}
|
||||
|
||||
@@ -4651,6 +4710,7 @@ shortcuts, callback, {
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const matchMediaCache = new Map();
|
||||
|
||||
/**
|
||||
* A new MediaQueryList object for the media query
|
||||
@@ -4659,8 +4719,17 @@ shortcuts, callback, {
|
||||
* @return {MediaQueryList|null} A new object for the media query
|
||||
*/
|
||||
function getMediaQueryList(query) {
|
||||
if (query && typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
|
||||
return window.matchMedia(query);
|
||||
if (!query) {
|
||||
return null;
|
||||
}
|
||||
let match = matchMediaCache.get(query);
|
||||
if (match) {
|
||||
return match;
|
||||
}
|
||||
if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
|
||||
match = window.matchMedia(query);
|
||||
matchMediaCache.set(query, match);
|
||||
return match;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -4910,7 +4979,6 @@ useViewportMatch.__experimentalWidthProvider = ViewportMatchWidthContext.Provide
|
||||
/* harmony default export */ const use_viewport_match = (useViewportMatch);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-resize-observer/index.js
|
||||
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
@@ -4919,6 +4987,7 @@ useViewportMatch.__experimentalWidthProvider = ViewportMatchWidthContext.Provide
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
// This of course could've been more streamlined with internal state instead of
|
||||
// refs, but then host hooks / components could not opt out of renders.
|
||||
// This could've been exported to its own module, but the current build doesn't
|
||||
@@ -4971,6 +5040,10 @@ function useResolvedElement(subscriber, refOrElement) {
|
||||
callSubscriber();
|
||||
}, [callSubscriber]);
|
||||
}
|
||||
|
||||
// Declaring my own type here instead of using the one provided by TS (available since 4.2.2), because this way I'm not
|
||||
// forcing consumers to use a specific TS version.
|
||||
|
||||
// We're only using the first element of the size sequences, until future versions of the spec solidify on how
|
||||
// exactly it'll be used for fragments in multi-column scenarios:
|
||||
// From the spec:
|
||||
@@ -5133,7 +5206,7 @@ function useResizeAware() {
|
||||
height: height !== null && height !== void 0 ? height : null
|
||||
};
|
||||
}, [width, height]);
|
||||
const resizeListener = (0,external_React_namespaceObject.createElement)("div", {
|
||||
const resizeListener = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
style: {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
@@ -5254,6 +5327,8 @@ function useWarnOnChange(object, prefix = 'Change detection') {
|
||||
}
|
||||
/* harmony default export */ const use_warn_on_change = (useWarnOnChange);
|
||||
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: ./node_modules/use-memo-one/dist/use-memo-one.esm.js
|
||||
|
||||
|
||||
@@ -5323,7 +5398,7 @@ var useCallback = (/* unused pure expression or super */ null && (useCallbackOne
|
||||
* including the function to debounce, so please wrap functions created on
|
||||
* render in components in `useCallback`.
|
||||
*
|
||||
* @see https://docs-lodash.com/v4/debounce/
|
||||
* @see https://lodash.com/docs/4#debounce
|
||||
*
|
||||
* @template {(...args: any[]) => void} TFunc
|
||||
*
|
||||
@@ -5352,8 +5427,8 @@ function useDebounce(fn, wait, options) {
|
||||
/**
|
||||
* Helper hook for input fields that need to debounce the value before using it.
|
||||
*
|
||||
* @param {any} defaultValue The default value to use.
|
||||
* @return {[string, Function, string]} The input value, the setter and the debounced input value.
|
||||
* @param defaultValue The default value to use.
|
||||
* @return The input value, the setter and the debounced input value.
|
||||
*/
|
||||
function useDebouncedInput(defaultValue = '') {
|
||||
const [input, setInput] = (0,external_wp_element_namespaceObject.useState)(defaultValue);
|
||||
@@ -5361,7 +5436,7 @@ function useDebouncedInput(defaultValue = '') {
|
||||
const setDebouncedInput = useDebounce(setDebouncedState, 250);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
setDebouncedInput(input);
|
||||
}, [input]);
|
||||
}, [input, setDebouncedInput]);
|
||||
return [input, setInput, debouncedInput];
|
||||
}
|
||||
|
||||
@@ -5387,7 +5462,7 @@ function useDebouncedInput(defaultValue = '') {
|
||||
* including the function to throttle, so please wrap functions created on
|
||||
* render in components in `useCallback`.
|
||||
*
|
||||
* @see https://docs-lodash.com/v4/throttle/
|
||||
* @see https://lodash.com/docs/4#throttle
|
||||
*
|
||||
* @template {(...args: any[]) => void} TFunc
|
||||
*
|
||||
@@ -5633,11 +5708,15 @@ function useFocusableIframe() {
|
||||
const {
|
||||
ownerDocument
|
||||
} = element;
|
||||
if (!ownerDocument) return;
|
||||
if (!ownerDocument) {
|
||||
return;
|
||||
}
|
||||
const {
|
||||
defaultView
|
||||
} = ownerDocument;
|
||||
if (!defaultView) return;
|
||||
if (!defaultView) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the iframe is the activeElement, inferring that it has
|
||||
@@ -5791,6 +5870,33 @@ function useFixedWindowList(elementRef, itemHeight, totalItems, options) {
|
||||
return [fixedListWindow, setFixedListWindow];
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-observable-value/index.js
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
/**
|
||||
* React hook that lets you observe an entry in an `ObservableMap`. The hook returns the
|
||||
* current value corresponding to the key, or `undefined` when there is no value stored.
|
||||
* It also observes changes to the value and triggers an update of the calling component
|
||||
* in case the value changes.
|
||||
*
|
||||
* @template K The type of the keys in the map.
|
||||
* @template V The type of the values in the map.
|
||||
* @param map The `ObservableMap` to observe.
|
||||
* @param name The map key to observe.
|
||||
* @return The value corresponding to the map key requested.
|
||||
*/
|
||||
function useObservableValue(map, name) {
|
||||
const [subscribe, getValue] = (0,external_wp_element_namespaceObject.useMemo)(() => [listener => map.subscribe(name, listener), () => map.get(name)], [map, name]);
|
||||
return (0,external_wp_element_namespaceObject.useSyncExternalStore)(subscribe, getValue, getValue);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/index.js
|
||||
// The `createHigherOrderComponent` helper and helper types.
|
||||
|
||||
@@ -5798,6 +5904,8 @@ function useFixedWindowList(elementRef, itemHeight, totalItems, options) {
|
||||
|
||||
// The `throttle` helper and its types.
|
||||
|
||||
// The `ObservableMap` data structure
|
||||
|
||||
|
||||
// The `compose` and `pipe` helpers (inspired by `flowRight` and `flow` from Lodash).
|
||||
|
||||
@@ -5839,6 +5947,7 @@ function useFixedWindowList(elementRef, itemHeight, totalItems, options) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
})();
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+229
-222
@@ -46,71 +46,25 @@ __webpack_require__.d(__webpack_exports__, {
|
||||
const external_wp_commands_namespaceObject = window["wp"]["commands"];
|
||||
;// CONCATENATED MODULE: external ["wp","i18n"]
|
||||
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: external ["wp","primitives"]
|
||||
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const plus = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const plus = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"
|
||||
}));
|
||||
viewBox: "0 0 24 24",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const library_plus = (plus);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const symbol = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(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"
|
||||
}));
|
||||
/* harmony default export */ const library_symbol = (symbol);
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","url"]
|
||||
const external_wp_url_namespaceObject = window["wp"]["url"];
|
||||
;// CONCATENATED MODULE: external ["wp","router"]
|
||||
const external_wp_router_namespaceObject = window["wp"]["router"];
|
||||
;// CONCATENATED MODULE: external ["wp","coreData"]
|
||||
const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
|
||||
;// CONCATENATED MODULE: external ["wp","data"]
|
||||
const external_wp_data_namespaceObject = window["wp"]["data"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-commands/build-module/hooks.js
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
function useIsTemplatesAccessible() {
|
||||
return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).canUser('read', 'templates'), []);
|
||||
}
|
||||
function useIsBlockBasedTheme() {
|
||||
return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme, []);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","privateApis"]
|
||||
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-commands/build-module/lock-unlock.js
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const {
|
||||
lock,
|
||||
unlock
|
||||
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/core-commands');
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-commands/build-module/admin-navigation-commands.js
|
||||
/**
|
||||
* WordPress dependencies
|
||||
@@ -118,22 +72,7 @@ const {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
const {
|
||||
useHistory
|
||||
} = unlock(external_wp_router_namespaceObject.privateApis);
|
||||
function useAdminNavigationCommands() {
|
||||
const history = useHistory();
|
||||
const isTemplatesAccessible = useIsTemplatesAccessible();
|
||||
const isBlockBasedTheme = useIsBlockBasedTheme();
|
||||
const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes('site-editor.php');
|
||||
(0,external_wp_commands_namespaceObject.useCommand)({
|
||||
name: 'core/add-new-post',
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Add new post'),
|
||||
@@ -150,120 +89,150 @@ function useAdminNavigationCommands() {
|
||||
document.location.href = 'post-new.php?post_type=page';
|
||||
}
|
||||
});
|
||||
(0,external_wp_commands_namespaceObject.useCommand)({
|
||||
name: 'core/manage-reusable-blocks',
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Patterns'),
|
||||
icon: library_symbol,
|
||||
callback: ({
|
||||
close
|
||||
}) => {
|
||||
if (isTemplatesAccessible && isBlockBasedTheme) {
|
||||
const args = {
|
||||
path: '/patterns'
|
||||
};
|
||||
if (isSiteEditor) {
|
||||
history.push(args);
|
||||
} else {
|
||||
document.location = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
|
||||
}
|
||||
close();
|
||||
} else {
|
||||
document.location.href = 'edit.php?post_type=wp_block';
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// CONCATENATED MODULE: external ["wp","data"]
|
||||
const external_wp_data_namespaceObject = window["wp"]["data"];
|
||||
;// CONCATENATED MODULE: external ["wp","coreData"]
|
||||
const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const post = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const post = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(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"
|
||||
}));
|
||||
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"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const library_post = (post);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const page = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
|
||||
const page = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"
|
||||
}), (0,external_React_namespaceObject.createElement)(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"
|
||||
}));
|
||||
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"
|
||||
})]
|
||||
});
|
||||
/* harmony default export */ const library_page = (page);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const layout = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const layout = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(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"
|
||||
}));
|
||||
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"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const library_layout = (layout);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const symbolFilled = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const symbolFilled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(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"
|
||||
}));
|
||||
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"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const symbol_filled = (symbolFilled);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/navigation.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const navigation = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const navigation = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
viewBox: "0 0 24 24",
|
||||
xmlns: "http://www.w3.org/2000/svg"
|
||||
}, (0,external_React_namespaceObject.createElement)(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"
|
||||
}));
|
||||
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"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const library_navigation = (navigation);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/styles.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const styles = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const styles = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
viewBox: "0 0 24 24",
|
||||
xmlns: "http://www.w3.org/2000/svg"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"
|
||||
}));
|
||||
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 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const library_styles = (styles);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
const symbol = /*#__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"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const library_symbol = (symbol);
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","router"]
|
||||
const external_wp_router_namespaceObject = window["wp"]["router"];
|
||||
;// CONCATENATED MODULE: external ["wp","url"]
|
||||
const external_wp_url_namespaceObject = window["wp"]["url"];
|
||||
;// CONCATENATED MODULE: external ["wp","compose"]
|
||||
const external_wp_compose_namespaceObject = window["wp"]["compose"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-commands/build-module/hooks.js
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
function useIsBlockBasedTheme() {
|
||||
return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme, []);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","privateApis"]
|
||||
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-commands/build-module/lock-unlock.js
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
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');
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-commands/build-module/utils/order-entity-records-by-search.js
|
||||
function orderEntityRecordsBySearch(records = [], search = '') {
|
||||
if (!Array.isArray(records) || !records.length) {
|
||||
@@ -306,8 +275,7 @@ function orderEntityRecordsBySearch(records = [], search = '') {
|
||||
|
||||
|
||||
const {
|
||||
useHistory: site_editor_navigation_commands_useHistory,
|
||||
useLocation
|
||||
useHistory
|
||||
} = unlock(external_wp_router_namespaceObject.privateApis);
|
||||
const icons = {
|
||||
post: library_post,
|
||||
@@ -327,7 +295,7 @@ function useDebouncedValue(value) {
|
||||
const getNavigationCommandLoaderPerPostType = postType => function useNavigationCommandLoader({
|
||||
search
|
||||
}) {
|
||||
const history = site_editor_navigation_commands_useHistory();
|
||||
const history = useHistory();
|
||||
const isBlockBasedTheme = useIsBlockBasedTheme();
|
||||
const delayedSearch = useDebouncedValue(search);
|
||||
const {
|
||||
@@ -375,9 +343,6 @@ const getNavigationCommandLoaderPerPostType = postType => function useNavigation
|
||||
};
|
||||
}
|
||||
const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes('site-editor.php');
|
||||
const extraArgs = isSiteEditor ? {
|
||||
canvas: (0,external_wp_url_namespaceObject.getQueryArg)(window.location.href, 'canvas')
|
||||
} : {};
|
||||
return {
|
||||
...command,
|
||||
callback: ({
|
||||
@@ -386,7 +351,7 @@ const getNavigationCommandLoaderPerPostType = postType => function useNavigation
|
||||
const args = {
|
||||
postType,
|
||||
postId: record.id,
|
||||
...extraArgs
|
||||
canvas: 'edit'
|
||||
};
|
||||
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
|
||||
if (isSiteEditor) {
|
||||
@@ -407,10 +372,7 @@ const getNavigationCommandLoaderPerPostType = postType => function useNavigation
|
||||
const getNavigationCommandLoaderPerTemplate = templateType => function useNavigationCommandLoader({
|
||||
search
|
||||
}) {
|
||||
const history = site_editor_navigation_commands_useHistory();
|
||||
const location = useLocation();
|
||||
const isPatternsPage = location?.params?.path === '/patterns' || location?.params?.postType === 'wp_block';
|
||||
const didAccessPatternsPage = !!location?.params?.didAccessPatternsPage;
|
||||
const history = useHistory();
|
||||
const isBlockBasedTheme = useIsBlockBasedTheme();
|
||||
const {
|
||||
records,
|
||||
@@ -440,11 +402,9 @@ const getNavigationCommandLoaderPerTemplate = templateType => function useNaviga
|
||||
if (!isBlockBasedTheme && !templateType === 'wp_template_part') {
|
||||
return [];
|
||||
}
|
||||
return orderedRecords.map(record => {
|
||||
const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes('site-editor.php');
|
||||
const extraArgs = isSiteEditor ? {
|
||||
canvas: (0,external_wp_url_namespaceObject.getQueryArg)(window.location.href, 'canvas')
|
||||
} : {};
|
||||
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,
|
||||
@@ -456,8 +416,7 @@ const getNavigationCommandLoaderPerTemplate = templateType => function useNaviga
|
||||
const args = {
|
||||
postType: templateType,
|
||||
postId: record.id,
|
||||
didAccessPatternsPage: !isBlockBasedTheme && (isPatternsPage || didAccessPatternsPage) ? 1 : undefined,
|
||||
...extraArgs
|
||||
canvas: 'edit'
|
||||
};
|
||||
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
|
||||
if (isSiteEditor) {
|
||||
@@ -468,7 +427,30 @@ const getNavigationCommandLoaderPerTemplate = templateType => function useNaviga
|
||||
close();
|
||||
}
|
||||
};
|
||||
});
|
||||
}));
|
||||
if (orderedRecords?.length > 0 && templateType === 'wp_template_part') {
|
||||
result.push({
|
||||
name: 'core/edit-site/open-template-parts',
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Template parts'),
|
||||
icon: symbol_filled,
|
||||
callback: ({
|
||||
close
|
||||
}) => {
|
||||
const args = {
|
||||
postType: 'wp_template_part',
|
||||
categoryId: 'all-parts'
|
||||
};
|
||||
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
|
||||
if (isSiteEditor) {
|
||||
history.push(args);
|
||||
} else {
|
||||
document.location = targetUrl;
|
||||
}
|
||||
close();
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}, [isBlockBasedTheme, orderedRecords, history]);
|
||||
return {
|
||||
commands,
|
||||
@@ -480,93 +462,118 @@ const usePostNavigationCommandLoader = getNavigationCommandLoaderPerPostType('po
|
||||
const useTemplateNavigationCommandLoader = getNavigationCommandLoaderPerTemplate('wp_template');
|
||||
const useTemplatePartNavigationCommandLoader = getNavigationCommandLoaderPerTemplate('wp_template_part');
|
||||
function useSiteEditorBasicNavigationCommands() {
|
||||
const history = site_editor_navigation_commands_useHistory();
|
||||
const history = useHistory();
|
||||
const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes('site-editor.php');
|
||||
const isTemplatesAccessible = useIsTemplatesAccessible();
|
||||
const canCreateTemplate = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
return select(external_wp_coreData_namespaceObject.store).canUser('create', 'templates');
|
||||
}, []);
|
||||
const isBlockBasedTheme = useIsBlockBasedTheme();
|
||||
const commands = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
||||
const result = [];
|
||||
if (!isTemplatesAccessible || !isBlockBasedTheme) {
|
||||
return result;
|
||||
if (canCreateTemplate && isBlockBasedTheme) {
|
||||
result.push({
|
||||
name: 'core/edit-site/open-navigation',
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Navigation'),
|
||||
icon: library_navigation,
|
||||
callback: ({
|
||||
close
|
||||
}) => {
|
||||
const args = {
|
||||
postType: 'wp_navigation'
|
||||
};
|
||||
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
|
||||
if (isSiteEditor) {
|
||||
history.push(args);
|
||||
} else {
|
||||
document.location = targetUrl;
|
||||
}
|
||||
close();
|
||||
}
|
||||
});
|
||||
result.push({
|
||||
name: 'core/edit-site/open-styles',
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Styles'),
|
||||
icon: library_styles,
|
||||
callback: ({
|
||||
close
|
||||
}) => {
|
||||
const args = {
|
||||
path: '/wp_global_styles'
|
||||
};
|
||||
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
|
||||
if (isSiteEditor) {
|
||||
history.push(args);
|
||||
} else {
|
||||
document.location = targetUrl;
|
||||
}
|
||||
close();
|
||||
}
|
||||
});
|
||||
result.push({
|
||||
name: 'core/edit-site/open-pages',
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Pages'),
|
||||
icon: library_page,
|
||||
callback: ({
|
||||
close
|
||||
}) => {
|
||||
const args = {
|
||||
postType: 'page'
|
||||
};
|
||||
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
|
||||
if (isSiteEditor) {
|
||||
history.push(args);
|
||||
} else {
|
||||
document.location = targetUrl;
|
||||
}
|
||||
close();
|
||||
}
|
||||
});
|
||||
result.push({
|
||||
name: 'core/edit-site/open-templates',
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Templates'),
|
||||
icon: library_layout,
|
||||
callback: ({
|
||||
close
|
||||
}) => {
|
||||
const args = {
|
||||
postType: 'wp_template'
|
||||
};
|
||||
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
|
||||
if (isSiteEditor) {
|
||||
history.push(args);
|
||||
} else {
|
||||
document.location = targetUrl;
|
||||
}
|
||||
close();
|
||||
}
|
||||
});
|
||||
}
|
||||
result.push({
|
||||
name: 'core/edit-site/open-navigation',
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Navigation'),
|
||||
icon: library_navigation,
|
||||
name: 'core/edit-site/open-patterns',
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Patterns'),
|
||||
icon: library_symbol,
|
||||
callback: ({
|
||||
close
|
||||
}) => {
|
||||
const args = {
|
||||
path: '/navigation'
|
||||
};
|
||||
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
|
||||
if (isSiteEditor) {
|
||||
history.push(args);
|
||||
if (canCreateTemplate) {
|
||||
const args = {
|
||||
postType: 'wp_block'
|
||||
};
|
||||
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
|
||||
if (isSiteEditor) {
|
||||
history.push(args);
|
||||
} else {
|
||||
document.location = targetUrl;
|
||||
}
|
||||
close();
|
||||
} else {
|
||||
document.location = targetUrl;
|
||||
// If a user cannot access the site editor
|
||||
document.location.href = 'edit.php?post_type=wp_block';
|
||||
}
|
||||
close();
|
||||
}
|
||||
});
|
||||
result.push({
|
||||
name: 'core/edit-site/open-styles',
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Styles'),
|
||||
icon: library_styles,
|
||||
callback: ({
|
||||
close
|
||||
}) => {
|
||||
const args = {
|
||||
path: '/wp_global_styles'
|
||||
};
|
||||
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
|
||||
if (isSiteEditor) {
|
||||
history.push(args);
|
||||
} else {
|
||||
document.location = targetUrl;
|
||||
}
|
||||
close();
|
||||
}
|
||||
});
|
||||
result.push({
|
||||
name: 'core/edit-site/open-pages',
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Pages'),
|
||||
icon: library_page,
|
||||
callback: ({
|
||||
close
|
||||
}) => {
|
||||
const args = {
|
||||
path: '/page'
|
||||
};
|
||||
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
|
||||
if (isSiteEditor) {
|
||||
history.push(args);
|
||||
} else {
|
||||
document.location = targetUrl;
|
||||
}
|
||||
close();
|
||||
}
|
||||
});
|
||||
result.push({
|
||||
name: 'core/edit-site/open-templates',
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Templates'),
|
||||
icon: library_layout,
|
||||
callback: ({
|
||||
close
|
||||
}) => {
|
||||
const args = {
|
||||
path: '/wp_template'
|
||||
};
|
||||
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
|
||||
if (isSiteEditor) {
|
||||
history.push(args);
|
||||
} else {
|
||||
document.location = targetUrl;
|
||||
}
|
||||
close();
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}, [history, isSiteEditor, isTemplatesAccessible, isBlockBasedTheme]);
|
||||
}, [history, isSiteEditor, canCreateTemplate, isBlockBasedTheme]);
|
||||
return {
|
||||
commands,
|
||||
isLoading: false
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+266
-479
File diff suppressed because it is too large
Load Diff
+1
-1
File diff suppressed because one or more lines are too long
+470
-950
File diff suppressed because it is too large
Load Diff
+1
-6
File diff suppressed because one or more lines are too long
Vendored
+61
-35
@@ -541,6 +541,7 @@ __webpack_require__.d(__webpack_exports__, {
|
||||
createRegistry: () => (/* reexport */ createRegistry),
|
||||
createRegistryControl: () => (/* reexport */ createRegistryControl),
|
||||
createRegistrySelector: () => (/* reexport */ createRegistrySelector),
|
||||
createSelector: () => (/* reexport */ rememo),
|
||||
dispatch: () => (/* reexport */ dispatch_dispatch),
|
||||
plugins: () => (/* reexport */ plugins_namespaceObject),
|
||||
register: () => (/* binding */ register),
|
||||
@@ -1575,7 +1576,7 @@ function resolveSelect(storeNameOrDescriptor, selectorName, ...args) {
|
||||
*
|
||||
* // Action generator using dispatch
|
||||
* export function* myAction() {
|
||||
* yield controls.dispatch( 'core/edit-post', 'togglePublishSidebar' );
|
||||
* yield controls.dispatch( 'core/editor', 'togglePublishSidebar' );
|
||||
* // do some other things.
|
||||
* }
|
||||
* ```
|
||||
@@ -1626,7 +1627,7 @@ const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
|
||||
const {
|
||||
lock,
|
||||
unlock
|
||||
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/data');
|
||||
} = (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/data');
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/is-promise/index.mjs
|
||||
function isPromise(obj) {
|
||||
@@ -2187,7 +2188,7 @@ function isShallowEqual(a, b, fromIndex) {
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/selectors.js
|
||||
/**
|
||||
* External dependencies
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
@@ -2196,6 +2197,7 @@ function isShallowEqual(a, b, fromIndex) {
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/** @typedef {Record<string, import('./reducer').State>} State */
|
||||
/** @typedef {import('./reducer').StateValue} StateValue */
|
||||
/** @typedef {import('./reducer').Status} Status */
|
||||
@@ -2221,10 +2223,16 @@ function getResolutionState(state, selectorName, args) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw `isResolving` value for a given selector name,
|
||||
* and arguments set. May be undefined if the selector has never been resolved
|
||||
* or not resolved for the given set of arguments, otherwise true or false for
|
||||
* resolution started and completed respectively.
|
||||
* Returns an `isResolving`-like value for a given selector name and arguments set.
|
||||
* Its value is either `undefined` if the selector has never been resolved or has been
|
||||
* invalidated, or a `true`/`false` boolean value if the resolution is in progress or
|
||||
* has finished, respectively.
|
||||
*
|
||||
* This is a legacy selector that was implemented when the "raw" internal data had
|
||||
* this `undefined | boolean` format. Nowadays the internal value is an object that
|
||||
* can be retrieved with `getResolutionState`.
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @param {State} state Data state.
|
||||
* @param {string} selectorName Selector name.
|
||||
@@ -2233,6 +2241,11 @@ function getResolutionState(state, selectorName, args) {
|
||||
* @return {boolean | undefined} isResolving value.
|
||||
*/
|
||||
function getIsResolving(state, selectorName, args) {
|
||||
external_wp_deprecated_default()('wp.data.select( store ).getIsResolving', {
|
||||
since: '6.6',
|
||||
version: '6.8',
|
||||
alternative: 'wp.data.select( store ).getResolutionState'
|
||||
});
|
||||
const resolutionState = getResolutionState(state, selectorName, args);
|
||||
return resolutionState && resolutionState.status === 'resolving';
|
||||
}
|
||||
@@ -2582,11 +2595,14 @@ const trimUndefinedValues = array => {
|
||||
*/
|
||||
const mapValues = (obj, callback) => Object.fromEntries(Object.entries(obj !== null && obj !== void 0 ? obj : {}).map(([key, value]) => [key, callback(value, key)]));
|
||||
|
||||
// Convert Map objects to plain objects
|
||||
const mapToObject = (key, state) => {
|
||||
// Convert non serializable types to plain objects
|
||||
const devToolsReplacer = (key, state) => {
|
||||
if (state instanceof Map) {
|
||||
return Object.fromEntries(state);
|
||||
}
|
||||
if (state instanceof window.HTMLElement) {
|
||||
return null;
|
||||
}
|
||||
return state;
|
||||
};
|
||||
|
||||
@@ -2862,7 +2878,7 @@ function instantiateReduxStore(key, options, registry, thunkArgs) {
|
||||
name: key,
|
||||
instanceId: key,
|
||||
serialize: {
|
||||
replacer: mapToObject
|
||||
replacer: devToolsReplacer
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -3418,9 +3434,12 @@ function createRegistry(storeConfigs = {}, parent = null) {
|
||||
}
|
||||
emitter.pause();
|
||||
Object.values(stores).forEach(store => store.emitter.pause());
|
||||
callback();
|
||||
emitter.resume();
|
||||
Object.values(stores).forEach(store => store.emitter.resume());
|
||||
try {
|
||||
callback();
|
||||
} finally {
|
||||
emitter.resume();
|
||||
Object.values(stores).forEach(store => store.emitter.resume());
|
||||
}
|
||||
}
|
||||
let registry = {
|
||||
batch,
|
||||
@@ -3773,8 +3792,6 @@ persistencePlugin.__unstableMigrate = () => {};
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/index.js
|
||||
|
||||
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: external ["wp","priorityQueue"]
|
||||
const external_wp_priorityQueue_namespaceObject = window["wp"]["priorityQueue"];
|
||||
;// CONCATENATED MODULE: external ["wp","element"]
|
||||
@@ -4239,26 +4256,31 @@ function useSelect(mapSelect, deps) {
|
||||
}
|
||||
|
||||
/**
|
||||
* A variant of the `useSelect` hook that has the same API, but will throw a
|
||||
* suspense Promise if any of the called selectors is in an unresolved state.
|
||||
* A variant of the `useSelect` hook that has the same API, but is a compatible
|
||||
* Suspense-enabled data source.
|
||||
*
|
||||
* @param {Function} mapSelect Function called on every state change. The
|
||||
* returned value is exposed to the component
|
||||
* using this hook. The function receives the
|
||||
* `registry.suspendSelect` method as the first
|
||||
* argument and the `registry` as the second one.
|
||||
* @param {Array} deps A dependency array used to memoize the `mapSelect`
|
||||
* so that the same `mapSelect` is invoked on every
|
||||
* state change unless the dependencies change.
|
||||
* @template {MapSelect} T
|
||||
* @param {T} mapSelect Function called on every state change. The
|
||||
* returned value is exposed to the component
|
||||
* using this hook. The function receives the
|
||||
* `registry.suspendSelect` method as the first
|
||||
* argument and the `registry` as the second one.
|
||||
* @param {Array} deps A dependency array used to memoize the `mapSelect`
|
||||
* so that the same `mapSelect` is invoked on every
|
||||
* state change unless the dependencies change.
|
||||
*
|
||||
* @return {Object} Data object returned by the `mapSelect` function.
|
||||
* @throws {Promise} A suspense Promise that is thrown if any of the called
|
||||
* selectors is in an unresolved state.
|
||||
*
|
||||
* @return {ReturnType<T>} Data object returned by the `mapSelect` function.
|
||||
*/
|
||||
function useSuspenseSelect(mapSelect, deps) {
|
||||
return useMappingSelect(true, mapSelect, deps);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-select/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -4311,10 +4333,11 @@ function useSuspenseSelect(mapSelect, deps) {
|
||||
*
|
||||
* @return {ComponentType} Enhanced component with merged state data props.
|
||||
*/
|
||||
|
||||
const withSelect = mapSelectToProps => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => (0,external_wp_compose_namespaceObject.pure)(ownProps => {
|
||||
const mapSelect = (select, registry) => mapSelectToProps(select, ownProps, registry);
|
||||
const mergeProps = useSelect(mapSelect);
|
||||
return (0,external_React_namespaceObject.createElement)(WrappedComponent, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
|
||||
...ownProps,
|
||||
...mergeProps
|
||||
});
|
||||
@@ -4367,7 +4390,6 @@ const useDispatchWithMap = (dispatchMap, deps) => {
|
||||
/* harmony default export */ const use_dispatch_with_map = (useDispatchWithMap);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-dispatch/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -4461,10 +4483,11 @@ const useDispatchWithMap = (dispatchMap, deps) => {
|
||||
*
|
||||
* @return {ComponentType} Enhanced component with merged dispatcher props.
|
||||
*/
|
||||
|
||||
const withDispatch = mapDispatchToProps => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => ownProps => {
|
||||
const mapDispatch = (dispatch, registry) => mapDispatchToProps(dispatch, ownProps, registry);
|
||||
const dispatchProps = use_dispatch_with_map(mapDispatch, []);
|
||||
return (0,external_React_namespaceObject.createElement)(WrappedComponent, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
|
||||
...ownProps,
|
||||
...dispatchProps
|
||||
});
|
||||
@@ -4472,7 +4495,6 @@ const withDispatch = mapDispatchToProps => (0,external_wp_compose_namespaceObjec
|
||||
/* harmony default export */ const with_dispatch = (withDispatch);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-registry/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -4491,10 +4513,13 @@ const withDispatch = mapDispatchToProps => (0,external_wp_compose_namespaceObjec
|
||||
*
|
||||
* @return {Component} Enhanced component.
|
||||
*/
|
||||
const withRegistry = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(OriginalComponent => props => (0,external_React_namespaceObject.createElement)(RegistryConsumer, null, registry => (0,external_React_namespaceObject.createElement)(OriginalComponent, {
|
||||
...props,
|
||||
registry: registry
|
||||
})), 'withRegistry');
|
||||
|
||||
const withRegistry = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(OriginalComponent => props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RegistryConsumer, {
|
||||
children: registry => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
|
||||
...props,
|
||||
registry: registry
|
||||
})
|
||||
}), 'withRegistry');
|
||||
/* harmony default export */ const with_registry = (withRegistry);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js
|
||||
@@ -4650,6 +4675,7 @@ function select_select(storeNameOrDescriptor) {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Object of available plugins to use with a registry.
|
||||
*
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+35
-33
@@ -186,9 +186,7 @@ function isValidFocusableArea(element) {
|
||||
function find(context, {
|
||||
sequential = false
|
||||
} = {}) {
|
||||
/* eslint-disable jsdoc/no-undefined-types */
|
||||
/** @type {NodeListOf<HTMLElement>} */
|
||||
/* eslint-enable jsdoc/no-undefined-types */
|
||||
const elements = context.querySelectorAll(buildSelector(sequential));
|
||||
return Array.from(elements).filter(element => {
|
||||
if (!isVisible(element)) {
|
||||
@@ -238,7 +236,7 @@ function isTabbableIndex(element) {
|
||||
return getTabIndex(element) !== -1;
|
||||
}
|
||||
|
||||
/** @typedef {Element & { type?: string, checked?: boolean, name?: string }} MaybeHTMLInputElement */
|
||||
/** @typedef {HTMLElement & { type?: string, checked?: boolean, name?: string }} MaybeHTMLInputElement */
|
||||
|
||||
/**
|
||||
* Returns a stateful reducer function which constructs a filtered array of
|
||||
@@ -289,10 +287,10 @@ function createStatefulCollapseRadioGroup() {
|
||||
* sort where equal tabIndex should be left in order of their occurrence in the
|
||||
* document.
|
||||
*
|
||||
* @param {Element} element Element.
|
||||
* @param {number} index Array index of element.
|
||||
* @param {HTMLElement} element Element.
|
||||
* @param {number} index Array index of element.
|
||||
*
|
||||
* @return {{ element: Element, index: number }} Mapped object with element, index.
|
||||
* @return {{ element: HTMLElement, index: number }} Mapped object with element, index.
|
||||
*/
|
||||
function mapElementToObjectTabbable(element, index) {
|
||||
return {
|
||||
@@ -305,9 +303,9 @@ function mapElementToObjectTabbable(element, index) {
|
||||
* An array map callback, returning an element of the given mapped object's
|
||||
* element value.
|
||||
*
|
||||
* @param {{ element: Element }} object Mapped object with element.
|
||||
* @param {{ element: HTMLElement }} object Mapped object with element.
|
||||
*
|
||||
* @return {Element} Mapped object element.
|
||||
* @return {HTMLElement} Mapped object element.
|
||||
*/
|
||||
function mapObjectTabbableToElement(object) {
|
||||
return object.element;
|
||||
@@ -318,8 +316,8 @@ function mapObjectTabbableToElement(object) {
|
||||
*
|
||||
* @see mapElementToObjectTabbable
|
||||
*
|
||||
* @param {{ element: Element, index: number }} a First object to compare.
|
||||
* @param {{ element: Element, index: number }} b Second object to compare.
|
||||
* @param {{ element: HTMLElement, index: number }} a First object to compare.
|
||||
* @param {{ element: HTMLElement, index: number }} b Second object to compare.
|
||||
*
|
||||
* @return {number} Comparator result.
|
||||
*/
|
||||
@@ -335,9 +333,9 @@ function compareObjectTabbables(a, b) {
|
||||
/**
|
||||
* Givin focusable elements, filters out tabbable element.
|
||||
*
|
||||
* @param {Element[]} focusables Focusable elements to filter.
|
||||
* @param {HTMLElement[]} focusables Focusable elements to filter.
|
||||
*
|
||||
* @return {Element[]} Tabbable elements.
|
||||
* @return {HTMLElement[]} Tabbable elements.
|
||||
*/
|
||||
function filterTabbable(focusables) {
|
||||
return focusables.filter(isTabbableIndex).map(mapElementToObjectTabbable).sort(compareObjectTabbables).map(mapObjectTabbableToElement).reduce(createStatefulCollapseRadioGroup(), []);
|
||||
@@ -345,7 +343,7 @@ function filterTabbable(focusables) {
|
||||
|
||||
/**
|
||||
* @param {Element} context
|
||||
* @return {Element[]} Tabbable elements within the context.
|
||||
* @return {HTMLElement[]} Tabbable elements within the context.
|
||||
*/
|
||||
function tabbable_find(context) {
|
||||
return filterTabbable(find(context));
|
||||
@@ -357,15 +355,12 @@ function tabbable_find(context) {
|
||||
* @param {Element} element The focusable element before which to look. Defaults
|
||||
* to the active element.
|
||||
*
|
||||
* @return {Element|undefined} Preceding tabbable element.
|
||||
* @return {HTMLElement|undefined} Preceding tabbable element.
|
||||
*/
|
||||
function findPrevious(element) {
|
||||
return filterTabbable(find(element.ownerDocument.body)).reverse().find(focusable => {
|
||||
return (
|
||||
// eslint-disable-next-line no-bitwise
|
||||
element.compareDocumentPosition(focusable) & element.DOCUMENT_POSITION_PRECEDING
|
||||
);
|
||||
});
|
||||
return filterTabbable(find(element.ownerDocument.body)).reverse().find(focusable =>
|
||||
// eslint-disable-next-line no-bitwise
|
||||
element.compareDocumentPosition(focusable) & element.DOCUMENT_POSITION_PRECEDING);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -374,15 +369,12 @@ function findPrevious(element) {
|
||||
* @param {Element} element The focusable element after which to look. Defaults
|
||||
* to the active element.
|
||||
*
|
||||
* @return {Element|undefined} Next tabbable element.
|
||||
* @return {HTMLElement|undefined} Next tabbable element.
|
||||
*/
|
||||
function findNext(element) {
|
||||
return filterTabbable(find(element.ownerDocument.body)).find(focusable => {
|
||||
return (
|
||||
// eslint-disable-next-line no-bitwise
|
||||
element.compareDocumentPosition(focusable) & element.DOCUMENT_POSITION_FOLLOWING
|
||||
);
|
||||
});
|
||||
return filterTabbable(find(element.ownerDocument.body)).find(focusable =>
|
||||
// eslint-disable-next-line no-bitwise
|
||||
element.compareDocumentPosition(focusable) & element.DOCUMENT_POSITION_FOLLOWING);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/utils/assert-is-defined.js
|
||||
@@ -440,10 +432,18 @@ function getRectangleFromRange(range) {
|
||||
left,
|
||||
right
|
||||
} of filteredRects) {
|
||||
if (top < furthestTop) furthestTop = top;
|
||||
if (bottom > furthestBottom) furthestBottom = bottom;
|
||||
if (left < furthestLeft) furthestLeft = left;
|
||||
if (right > furthestRight) furthestRight = right;
|
||||
if (top < furthestTop) {
|
||||
furthestTop = top;
|
||||
}
|
||||
if (bottom > furthestBottom) {
|
||||
furthestBottom = bottom;
|
||||
}
|
||||
if (left < furthestLeft) {
|
||||
furthestLeft = left;
|
||||
}
|
||||
if (right > furthestRight) {
|
||||
furthestRight = right;
|
||||
}
|
||||
}
|
||||
return new window.DOMRect(furthestLeft, furthestTop, furthestRight - furthestLeft, furthestBottom - furthestTop);
|
||||
}
|
||||
@@ -1107,7 +1107,7 @@ function isEdge(container, isReverse, onlyVertical = false) {
|
||||
}
|
||||
return container.value.length === container.selectionStart;
|
||||
}
|
||||
if (!( /** @type {HTMLElement} */container.isContentEditable)) {
|
||||
if (!container.isContentEditable) {
|
||||
return true;
|
||||
}
|
||||
const {
|
||||
@@ -1317,7 +1317,9 @@ function placeCaretAtEdge(container, isReverse, x) {
|
||||
return;
|
||||
}
|
||||
const range = scrollIfNoRange(container, isReverse, () => getRange(container, isReverse, x));
|
||||
if (!range) return;
|
||||
if (!range) {
|
||||
return;
|
||||
}
|
||||
const {
|
||||
ownerDocument
|
||||
} = container;
|
||||
|
||||
Vendored
+1157
-5618
File diff suppressed because it is too large
Load Diff
+1
-6
File diff suppressed because one or more lines are too long
Vendored
+17161
-22241
File diff suppressed because one or more lines are too long
+2
-28
File diff suppressed because one or more lines are too long
+1166
-976
File diff suppressed because it is too large
Load Diff
+1
-6
File diff suppressed because one or more lines are too long
Vendored
+15050
-3792
File diff suppressed because one or more lines are too long
Vendored
+8
-6
File diff suppressed because one or more lines are too long
Vendored
+2
-2
@@ -822,7 +822,7 @@ const Platform = {
|
||||
*
|
||||
* This is the same concept as the React Native implementation.
|
||||
*
|
||||
* @see https://facebook.github.io/react-native/docs/platform-specific-code#platform-module
|
||||
* @see https://reactnative.dev/docs/platform-specific-code#platform-module
|
||||
*
|
||||
* Here is an example of how to use the select method:
|
||||
* @example
|
||||
@@ -1813,7 +1813,7 @@ function renderAttributes(props) {
|
||||
}
|
||||
let value = getNormalAttributeValue(key, props[key]);
|
||||
|
||||
// If value is not of serializeable type, skip.
|
||||
// If value is not of serializable type, skip.
|
||||
if (!ATTRIBUTES_TYPES.has(typeof value)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+525
-446
File diff suppressed because it is too large
Load Diff
+1
-1
File diff suppressed because one or more lines are too long
+2
@@ -48,6 +48,8 @@ let _decodeTextArea;
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* import { decodeEntities } from '@wordpress/html-entities';
|
||||
*
|
||||
* const result = decodeEntities( 'á' );
|
||||
* console.log( result ); // result will be "á"
|
||||
* ```
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '6a8e0c21145dcb04c36d');
|
||||
<?php return array('dependencies' => array(), 'version' => '93ff47d0e70d75545606');
|
||||
|
||||
+102
-42
@@ -36,10 +36,16 @@ var x = (y) => {
|
||||
var y = (x) => (() => (x))
|
||||
const interactivity_namespaceObject = x({ ["getConfig"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getConfig), ["privateApis"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.privateApis), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) });
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity-router/build-module/index.js
|
||||
var _getConfig$navigation;
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
const {
|
||||
directivePrefix,
|
||||
getRegionRootFragment,
|
||||
@@ -50,14 +56,17 @@ const {
|
||||
populateInitialData,
|
||||
batch
|
||||
} = (0,interactivity_namespaceObject.privateApis)('I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.');
|
||||
// Check if the navigation mode is full page or region based.
|
||||
const navigationMode = (_getConfig$navigation = (0,interactivity_namespaceObject.getConfig)('core/router').navigationMode) !== null && _getConfig$navigation !== void 0 ? _getConfig$navigation : 'regionBased';
|
||||
|
||||
// The cache of visited and prefetched pages.
|
||||
// The cache of visited and prefetched pages, stylesheets and scripts.
|
||||
const pages = new Map();
|
||||
const headElements = new Map();
|
||||
|
||||
// Helper to remove domain and hash from the URL. We are only interesting in
|
||||
// caching the path and the query.
|
||||
const getPagePath = url => {
|
||||
const u = new URL(url, window.location);
|
||||
const u = new URL(url, window.location.href);
|
||||
return u.pathname + u.search;
|
||||
};
|
||||
|
||||
@@ -68,7 +77,9 @@ const fetchPage = async (url, {
|
||||
try {
|
||||
if (!html) {
|
||||
const res = await window.fetch(url);
|
||||
if (res.status !== 200) return false;
|
||||
if (res.status !== 200) {
|
||||
return false;
|
||||
}
|
||||
html = await res.text();
|
||||
}
|
||||
const dom = new window.DOMParser().parseFromString(html, 'text/html');
|
||||
@@ -80,19 +91,26 @@ const fetchPage = async (url, {
|
||||
|
||||
// Return an object with VDOM trees of those HTML regions marked with a
|
||||
// `router-region` directive.
|
||||
const regionsToVdom = (dom, {
|
||||
const regionsToVdom = async (dom, {
|
||||
vdom
|
||||
} = {}) => {
|
||||
const regions = {};
|
||||
const attrName = `data-${directivePrefix}-router-region`;
|
||||
dom.querySelectorAll(`[${attrName}]`).forEach(region => {
|
||||
const id = region.getAttribute(attrName);
|
||||
regions[id] = vdom?.has(region) ? vdom.get(region) : toVdom(region);
|
||||
});
|
||||
const regions = {
|
||||
body: undefined
|
||||
};
|
||||
let head;
|
||||
if (false) {}
|
||||
if (navigationMode === 'regionBased') {
|
||||
const attrName = `data-${directivePrefix}-router-region`;
|
||||
dom.querySelectorAll(`[${attrName}]`).forEach(region => {
|
||||
const id = region.getAttribute(attrName);
|
||||
regions[id] = vdom?.has(region) ? vdom.get(region) : toVdom(region);
|
||||
});
|
||||
}
|
||||
const title = dom.querySelector('title')?.innerText;
|
||||
const initialData = parseInitialData(dom);
|
||||
return {
|
||||
regions,
|
||||
head,
|
||||
title,
|
||||
initialData
|
||||
};
|
||||
@@ -101,13 +119,16 @@ const regionsToVdom = (dom, {
|
||||
// Render all interactive regions contained in the given page.
|
||||
const renderRegions = page => {
|
||||
batch(() => {
|
||||
populateInitialData(page.initialData);
|
||||
const attrName = `data-${directivePrefix}-router-region`;
|
||||
document.querySelectorAll(`[${attrName}]`).forEach(region => {
|
||||
const id = region.getAttribute(attrName);
|
||||
const fragment = getRegionRootFragment(region);
|
||||
render(page.regions[id], fragment);
|
||||
});
|
||||
if (false) {}
|
||||
if (navigationMode === 'regionBased') {
|
||||
populateInitialData(page.initialData);
|
||||
const attrName = `data-${directivePrefix}-router-region`;
|
||||
document.querySelectorAll(`[${attrName}]`).forEach(region => {
|
||||
const id = region.getAttribute(attrName);
|
||||
const fragment = getRegionRootFragment(region);
|
||||
render(page.regions[id], fragment);
|
||||
});
|
||||
}
|
||||
if (page.title) {
|
||||
document.title = page.title;
|
||||
}
|
||||
@@ -121,8 +142,8 @@ const renderRegions = page => {
|
||||
* potential feedback indicating that the navigation has finished while the new
|
||||
* page is being loaded.
|
||||
*
|
||||
* @param {string} href The page href.
|
||||
* @return {Promise} Promise that never resolves.
|
||||
* @param href The page href.
|
||||
* @return Promise that never resolves.
|
||||
*/
|
||||
const forcePageReload = href => {
|
||||
window.location.assign(href);
|
||||
@@ -132,7 +153,7 @@ const forcePageReload = href => {
|
||||
// Listen to the back and forward buttons and restore the page if it's in the
|
||||
// cache.
|
||||
window.addEventListener('popstate', async () => {
|
||||
const pagePath = getPagePath(window.location); // Remove hash.
|
||||
const pagePath = getPagePath(window.location.href); // Remove hash.
|
||||
const page = pages.has(pagePath) && (await pages.get(pagePath));
|
||||
if (page) {
|
||||
renderRegions(page);
|
||||
@@ -143,11 +164,28 @@ window.addEventListener('popstate', async () => {
|
||||
}
|
||||
});
|
||||
|
||||
// Cache the initial page using the intially parsed vDOM.
|
||||
pages.set(getPagePath(window.location), Promise.resolve(regionsToVdom(document, {
|
||||
// Initialize the router and cache the initial page using the initial vDOM.
|
||||
// Once this code is tested and more mature, the head should be updated for
|
||||
// region based navigation as well.
|
||||
if (false) {}
|
||||
pages.set(getPagePath(window.location.href), Promise.resolve(regionsToVdom(document, {
|
||||
vdom: initialVdom
|
||||
})));
|
||||
|
||||
// Check if the link is valid for client-side navigation.
|
||||
const isValidLink = ref => ref && ref instanceof window.HTMLAnchorElement && ref.href && (!ref.target || ref.target === '_self') && ref.origin === window.location.origin && !ref.pathname.startsWith('/wp-admin') && !ref.pathname.startsWith('/wp-login.php') && !ref.getAttribute('href').startsWith('#') && !new URL(ref.href).searchParams.has('_wpnonce');
|
||||
|
||||
// Check if the event is valid for client-side navigation.
|
||||
const isValidEvent = event => event && event.button === 0 &&
|
||||
// Left clicks only.
|
||||
!event.metaKey &&
|
||||
// Open in new tab (Mac).
|
||||
!event.ctrlKey &&
|
||||
// Open in new tab (Windows).
|
||||
!event.altKey &&
|
||||
// Download.
|
||||
!event.shiftKey && !event.defaultPrevented;
|
||||
|
||||
// Variable to store the current navigation.
|
||||
let navigatingTo = '';
|
||||
const {
|
||||
@@ -159,7 +197,11 @@ const {
|
||||
navigation: {
|
||||
hasStarted: false,
|
||||
hasFinished: false,
|
||||
texts: {}
|
||||
texts: {
|
||||
loading: '',
|
||||
loaded: ''
|
||||
},
|
||||
message: ''
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
@@ -170,16 +212,16 @@ const {
|
||||
* needed, and updates any interactive regions whose contents have
|
||||
* changed. It also creates a new entry in the browser session history.
|
||||
*
|
||||
* @param {string} href The page href.
|
||||
* @param {Object} [options] Options object.
|
||||
* @param {boolean} [options.force] If true, it forces re-fetching the URL.
|
||||
* @param {string} [options.html] HTML string to be used instead of fetching the requested URL.
|
||||
* @param {boolean} [options.replace] If true, it replaces the current entry in the browser session history.
|
||||
* @param {number} [options.timeout] Time until the navigation is aborted, in milliseconds. Default is 10000.
|
||||
* @param {boolean} [options.loadingAnimation] Whether an animation should be shown while navigating. Default to `true`.
|
||||
* @param {boolean} [options.screenReaderAnnouncement] Whether a message for screen readers should be announced while navigating. Default to `true`.
|
||||
* @param href The page href.
|
||||
* @param [options] Options object.
|
||||
* @param [options.force] If true, it forces re-fetching the URL.
|
||||
* @param [options.html] HTML string to be used instead of fetching the requested URL.
|
||||
* @param [options.replace] If true, it replaces the current entry in the browser session history.
|
||||
* @param [options.timeout] Time until the navigation is aborted, in milliseconds. Default is 10000.
|
||||
* @param [options.loadingAnimation] Whether an animation should be shown while navigating. Default to `true`.
|
||||
* @param [options.screenReaderAnnouncement] Whether a message for screen readers should be announced while navigating. Default to `true`.
|
||||
*
|
||||
* @return {Promise} Promise that resolves once the navigation is completed or aborted.
|
||||
* @return Promise that resolves once the navigation is completed or aborted.
|
||||
*/
|
||||
*navigate(href, options = {}) {
|
||||
const {
|
||||
@@ -206,7 +248,9 @@ const {
|
||||
|
||||
// Don't update the navigation status immediately, wait 400 ms.
|
||||
const loadingTimeout = setTimeout(() => {
|
||||
if (navigatingTo !== href) return;
|
||||
if (navigatingTo !== href) {
|
||||
return;
|
||||
}
|
||||
if (loadingAnimation) {
|
||||
navigation.hasStarted = true;
|
||||
navigation.hasFinished = false;
|
||||
@@ -223,9 +267,11 @@ const {
|
||||
// Once the page is fetched, the destination URL could have changed
|
||||
// (e.g., by clicking another link in the meantime). If so, bail
|
||||
// out, and let the newer execution to update the HTML.
|
||||
if (navigatingTo !== href) return;
|
||||
if (navigatingTo !== href) {
|
||||
return;
|
||||
}
|
||||
if (page && !page.initialData?.config?.['core/router']?.clientNavigationDisabled) {
|
||||
renderRegions(page);
|
||||
yield renderRegions(page);
|
||||
window.history[options.replace ? 'replaceState' : 'pushState']({}, '', href);
|
||||
|
||||
// Update the URL in the state.
|
||||
@@ -243,6 +289,14 @@ const {
|
||||
// package: https://github.com/WordPress/gutenberg/blob/c395242b8e6ee20f8b06c199e4fc2920d7018af1/packages/a11y/src/filter-message.js#L20-L26
|
||||
navigation.message = navigation.texts.loaded + (navigation.message === navigation.texts.loaded ? '\u00A0' : '');
|
||||
}
|
||||
|
||||
// Scroll to the anchor if exits in the link.
|
||||
const {
|
||||
hash
|
||||
} = new URL(href, window.location.href);
|
||||
if (hash) {
|
||||
document.querySelector(hash)?.scrollIntoView();
|
||||
}
|
||||
} else {
|
||||
yield forcePageReload(href);
|
||||
}
|
||||
@@ -253,25 +307,31 @@ const {
|
||||
* The function normalizes the URL and stores internally the fetch
|
||||
* promise, to avoid triggering a second fetch for an ongoing request.
|
||||
*
|
||||
* @param {string} url The page URL.
|
||||
* @param {Object} [options] Options object.
|
||||
* @param {boolean} [options.force] Force fetching the URL again.
|
||||
* @param {string} [options.html] HTML string to be used instead of
|
||||
* fetching the requested URL.
|
||||
* @param url The page URL.
|
||||
* @param [options] Options object.
|
||||
* @param [options.force] Force fetching the URL again.
|
||||
* @param [options.html] HTML string to be used instead of fetching the requested URL.
|
||||
*/
|
||||
prefetch(url, options = {}) {
|
||||
const {
|
||||
clientNavigationDisabled
|
||||
} = (0,interactivity_namespaceObject.getConfig)();
|
||||
if (clientNavigationDisabled) return;
|
||||
if (clientNavigationDisabled) {
|
||||
return;
|
||||
}
|
||||
const pagePath = getPagePath(url);
|
||||
if (options.force || !pages.has(pagePath)) {
|
||||
pages.set(pagePath, fetchPage(pagePath, options));
|
||||
pages.set(pagePath, fetchPage(pagePath, {
|
||||
html: options.html
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Add click and prefetch to all links.
|
||||
if (false) {}
|
||||
|
||||
var __webpack_exports__actions = __webpack_exports__.o;
|
||||
var __webpack_exports__state = __webpack_exports__.w;
|
||||
export { __webpack_exports__actions as actions, __webpack_exports__state as state };
|
||||
|
||||
@@ -1 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '05a45a314b4247af8c60');
|
||||
<?php return array('dependencies' => array(), 'version' => 'cb44832cae5c937ebbc3');
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
import*as t from"@wordpress/interactivity";var e={d:(t,i)=>{for(var o in i)e.o(i,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:i[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},i={};e.d(i,{o:()=>y,w:()=>f});const o=(t=>{var i={};return e.d(i,t),i})({getConfig:()=>t.getConfig,privateApis:()=>t.privateApis,store:()=>t.store}),{directivePrefix:a,getRegionRootFragment:n,initialVdom:r,toVdom:s,render:c,parseInitialData:l,populateInitialData:d,batch:g}=(0,o.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),w=new Map,u=t=>{const e=new URL(t,window.location);return e.pathname+e.search},h=(t,{vdom:e}={})=>{const i={},o=`data-${a}-router-region`;t.querySelectorAll(`[${o}]`).forEach((t=>{const a=t.getAttribute(o);i[a]=e?.has(t)?e.get(t):s(t)}));const n=t.querySelector("title")?.innerText,r=l(t);return{regions:i,title:n,initialData:r}},m=t=>{g((()=>{d(t.initialData);const e=`data-${a}-router-region`;document.querySelectorAll(`[${e}]`).forEach((i=>{const o=i.getAttribute(e),a=n(i);c(t.regions[o],a)})),t.title&&(document.title=t.title)}))},p=t=>(window.location.assign(t),new Promise((()=>{})));window.addEventListener("popstate",(async()=>{const t=u(window.location),e=w.has(t)&&await w.get(t);e?(m(e),f.url=window.location.href):window.location.reload()})),w.set(u(window.location),Promise.resolve(h(document,{vdom:r})));let v="";const{state:f,actions:y}=(0,o.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1,texts:{}}},actions:{*navigate(t,e={}){const{clientNavigationDisabled:i}=(0,o.getConfig)();i&&(yield p(t));const a=u(t),{navigation:n}=f,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:c=1e4}=e;v=t,y.prefetch(a,e);const l=new Promise((t=>setTimeout(t,c))),d=setTimeout((()=>{v===t&&(r&&(n.hasStarted=!0,n.hasFinished=!1),s&&(n.message=n.texts.loading))}),400),g=yield Promise.race([w.get(a),l]);clearTimeout(d),v===t&&(g&&!g.initialData?.config?.["core/router"]?.clientNavigationDisabled?(m(g),window.history[e.replace?"replaceState":"pushState"]({},"",t),f.url=t,r&&(n.hasStarted=!1,n.hasFinished=!0),s&&(n.message=n.texts.loaded+(n.message===n.texts.loaded?" ":""))):yield p(t))},prefetch(t,e={}){const{clientNavigationDisabled:i}=(0,o.getConfig)();if(i)return;const a=u(t);!e.force&&w.has(a)||w.set(a,(async(t,{html:e})=>{try{if(!e){const i=await window.fetch(t);if(200!==i.status)return!1;e=await i.text()}const i=(new window.DOMParser).parseFromString(e,"text/html");return h(i)}catch(t){return!1}})(a,e))}}});var b=i.o,x=i.w;export{b as actions,x as state};
|
||||
import*as e from"@wordpress/interactivity";var t={d:(e,o)=>{for(var i in o)t.o(o,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:o[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},o={};t.d(o,{o:()=>x,w:()=>b});const i=(e=>{var o={};return t.d(o,e),o})({getConfig:()=>e.getConfig,privateApis:()=>e.privateApis,store:()=>e.store});var a;const{directivePrefix:n,getRegionRootFragment:r,initialVdom:s,toVdom:c,render:l,parseInitialData:d,populateInitialData:g,batch:w}=(0,i.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),h=null!==(a=(0,i.getConfig)("core/router").navigationMode)&&void 0!==a?a:"regionBased",u=new Map,m=(new Map,e=>{const t=new URL(e,window.location.href);return t.pathname+t.search}),f=async(e,{vdom:t}={})=>{const o={body:void 0};if("regionBased"===h){const i=`data-${n}-router-region`;e.querySelectorAll(`[${i}]`).forEach((e=>{const a=e.getAttribute(i);o[a]=t?.has(e)?t.get(e):c(e)}))}const i=e.querySelector("title")?.innerText,a=d(e);return{regions:o,head:undefined,title:i,initialData:a}},p=e=>{w((()=>{if("regionBased"===h){g(e.initialData);const t=`data-${n}-router-region`;document.querySelectorAll(`[${t}]`).forEach((o=>{const i=o.getAttribute(t),a=r(o);l(e.regions[i],a)}))}e.title&&(document.title=e.title)}))},v=e=>(window.location.assign(e),new Promise((()=>{})));window.addEventListener("popstate",(async()=>{const e=m(window.location.href),t=u.has(e)&&await u.get(e);t?(p(t),b.url=window.location.href):window.location.reload()})),u.set(m(window.location.href),Promise.resolve(f(document,{vdom:s})));let y="";const{state:b,actions:x}=(0,i.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1,texts:{loading:"",loaded:""},message:""}},actions:{*navigate(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();o&&(yield v(e));const a=m(e),{navigation:n}=b,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:c=1e4}=t;y=e,x.prefetch(a,t);const l=new Promise((e=>setTimeout(e,c))),d=setTimeout((()=>{y===e&&(r&&(n.hasStarted=!0,n.hasFinished=!1),s&&(n.message=n.texts.loading))}),400),g=yield Promise.race([u.get(a),l]);if(clearTimeout(d),y===e)if(g&&!g.initialData?.config?.["core/router"]?.clientNavigationDisabled){yield p(g),window.history[t.replace?"replaceState":"pushState"]({},"",e),b.url=e,r&&(n.hasStarted=!1,n.hasFinished=!0),s&&(n.message=n.texts.loaded+(n.message===n.texts.loaded?" ":""));const{hash:o}=new URL(e,window.location.href);o&&document.querySelector(o)?.scrollIntoView()}else yield v(e)},prefetch(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();if(o)return;const a=m(e);!t.force&&u.has(a)||u.set(a,(async(e,{html:t})=>{try{if(!t){const o=await window.fetch(e);if(200!==o.status)return!1;t=await o.text()}const o=(new window.DOMParser).parseFromString(t,"text/html");return f(o)}catch(e){return!1}})(a,{html:t.html}))}}});var A=o.o,P=o.w;export{A as actions,P as state};
|
||||
+411
-165
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+27
-326
@@ -203,13 +203,13 @@ function registerShortcut({
|
||||
* const { unregisterShortcut } = useDispatch( keyboardShortcutsStore );
|
||||
*
|
||||
* useEffect( () => {
|
||||
* unregisterShortcut( 'core/edit-post/next-region' );
|
||||
* unregisterShortcut( 'core/editor/next-region' );
|
||||
* }, [] );
|
||||
*
|
||||
* const shortcut = useSelect(
|
||||
* ( select ) =>
|
||||
* select( keyboardShortcutsStore ).getShortcutKeyCombination(
|
||||
* 'core/edit-post/next-region'
|
||||
* 'core/editor/next-region'
|
||||
* ),
|
||||
* []
|
||||
* );
|
||||
@@ -230,317 +230,15 @@ function unregisterShortcut(name) {
|
||||
};
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/rememo/rememo.js
|
||||
|
||||
|
||||
/** @typedef {(...args: any[]) => *[]} GetDependants */
|
||||
|
||||
/** @typedef {() => void} Clear */
|
||||
|
||||
/**
|
||||
* @typedef {{
|
||||
* getDependants: GetDependants,
|
||||
* clear: Clear
|
||||
* }} EnhancedSelector
|
||||
*/
|
||||
|
||||
/**
|
||||
* Internal cache entry.
|
||||
*
|
||||
* @typedef CacheNode
|
||||
*
|
||||
* @property {?CacheNode|undefined} [prev] Previous node.
|
||||
* @property {?CacheNode|undefined} [next] Next node.
|
||||
* @property {*[]} args Function arguments for cache entry.
|
||||
* @property {*} val Function result.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef Cache
|
||||
*
|
||||
* @property {Clear} clear Function to clear cache.
|
||||
* @property {boolean} [isUniqueByDependants] Whether dependants are valid in
|
||||
* considering cache uniqueness. A cache is unique if dependents are all arrays
|
||||
* or objects.
|
||||
* @property {CacheNode?} [head] Cache head.
|
||||
* @property {*[]} [lastDependants] Dependants from previous invocation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Arbitrary value used as key for referencing cache object in WeakMap tree.
|
||||
*
|
||||
* @type {{}}
|
||||
*/
|
||||
var LEAF_KEY = {};
|
||||
|
||||
/**
|
||||
* Returns the first argument as the sole entry in an array.
|
||||
*
|
||||
* @template T
|
||||
*
|
||||
* @param {T} value Value to return.
|
||||
*
|
||||
* @return {[T]} Value returned as entry in array.
|
||||
*/
|
||||
function arrayOf(value) {
|
||||
return [value];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the value passed is object-like, or false otherwise. A value
|
||||
* is object-like if it can support property assignment, e.g. object or array.
|
||||
*
|
||||
* @param {*} value Value to test.
|
||||
*
|
||||
* @return {boolean} Whether value is object-like.
|
||||
*/
|
||||
function isObjectLike(value) {
|
||||
return !!value && 'object' === typeof value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and returns a new cache object.
|
||||
*
|
||||
* @return {Cache} Cache object.
|
||||
*/
|
||||
function createCache() {
|
||||
/** @type {Cache} */
|
||||
var cache = {
|
||||
clear: function () {
|
||||
cache.head = null;
|
||||
},
|
||||
};
|
||||
|
||||
return cache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if entries within the two arrays are strictly equal by
|
||||
* reference from a starting index.
|
||||
*
|
||||
* @param {*[]} a First array.
|
||||
* @param {*[]} b Second array.
|
||||
* @param {number} fromIndex Index from which to start comparison.
|
||||
*
|
||||
* @return {boolean} Whether arrays are shallowly equal.
|
||||
*/
|
||||
function isShallowEqual(a, b, fromIndex) {
|
||||
var i;
|
||||
|
||||
if (a.length !== b.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (i = fromIndex; i < a.length; i++) {
|
||||
if (a[i] !== b[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a memoized selector function. The getDependants function argument is
|
||||
* called before the memoized selector and is expected to return an immutable
|
||||
* reference or array of references on which the selector depends for computing
|
||||
* its own return value. The memoize cache is preserved only as long as those
|
||||
* dependant references remain the same. If getDependants returns a different
|
||||
* reference(s), the cache is cleared and the selector value regenerated.
|
||||
*
|
||||
* @template {(...args: *[]) => *} S
|
||||
*
|
||||
* @param {S} selector Selector function.
|
||||
* @param {GetDependants=} getDependants Dependant getter returning an array of
|
||||
* references used in cache bust consideration.
|
||||
*/
|
||||
/* harmony default export */ function rememo(selector, getDependants) {
|
||||
/** @type {WeakMap<*,*>} */
|
||||
var rootCache;
|
||||
|
||||
/** @type {GetDependants} */
|
||||
var normalizedGetDependants = getDependants ? getDependants : arrayOf;
|
||||
|
||||
/**
|
||||
* Returns the cache for a given dependants array. When possible, a WeakMap
|
||||
* will be used to create a unique cache for each set of dependants. This
|
||||
* is feasible due to the nature of WeakMap in allowing garbage collection
|
||||
* to occur on entries where the key object is no longer referenced. Since
|
||||
* WeakMap requires the key to be an object, this is only possible when the
|
||||
* dependant is object-like. The root cache is created as a hierarchy where
|
||||
* each top-level key is the first entry in a dependants set, the value a
|
||||
* WeakMap where each key is the next dependant, and so on. This continues
|
||||
* so long as the dependants are object-like. If no dependants are object-
|
||||
* like, then the cache is shared across all invocations.
|
||||
*
|
||||
* @see isObjectLike
|
||||
*
|
||||
* @param {*[]} dependants Selector dependants.
|
||||
*
|
||||
* @return {Cache} Cache object.
|
||||
*/
|
||||
function getCache(dependants) {
|
||||
var caches = rootCache,
|
||||
isUniqueByDependants = true,
|
||||
i,
|
||||
dependant,
|
||||
map,
|
||||
cache;
|
||||
|
||||
for (i = 0; i < dependants.length; i++) {
|
||||
dependant = dependants[i];
|
||||
|
||||
// Can only compose WeakMap from object-like key.
|
||||
if (!isObjectLike(dependant)) {
|
||||
isUniqueByDependants = false;
|
||||
break;
|
||||
}
|
||||
|
||||
// Does current segment of cache already have a WeakMap?
|
||||
if (caches.has(dependant)) {
|
||||
// Traverse into nested WeakMap.
|
||||
caches = caches.get(dependant);
|
||||
} else {
|
||||
// Create, set, and traverse into a new one.
|
||||
map = new WeakMap();
|
||||
caches.set(dependant, map);
|
||||
caches = map;
|
||||
}
|
||||
}
|
||||
|
||||
// We use an arbitrary (but consistent) object as key for the last item
|
||||
// in the WeakMap to serve as our running cache.
|
||||
if (!caches.has(LEAF_KEY)) {
|
||||
cache = createCache();
|
||||
cache.isUniqueByDependants = isUniqueByDependants;
|
||||
caches.set(LEAF_KEY, cache);
|
||||
}
|
||||
|
||||
return caches.get(LEAF_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets root memoization cache.
|
||||
*/
|
||||
function clear() {
|
||||
rootCache = new WeakMap();
|
||||
}
|
||||
|
||||
/* eslint-disable jsdoc/check-param-names */
|
||||
/**
|
||||
* The augmented selector call, considering first whether dependants have
|
||||
* changed before passing it to underlying memoize function.
|
||||
*
|
||||
* @param {*} source Source object for derivation.
|
||||
* @param {...*} extraArgs Additional arguments to pass to selector.
|
||||
*
|
||||
* @return {*} Selector result.
|
||||
*/
|
||||
/* eslint-enable jsdoc/check-param-names */
|
||||
function callSelector(/* source, ...extraArgs */) {
|
||||
var len = arguments.length,
|
||||
cache,
|
||||
node,
|
||||
i,
|
||||
args,
|
||||
dependants;
|
||||
|
||||
// Create copy of arguments (avoid leaking deoptimization).
|
||||
args = new Array(len);
|
||||
for (i = 0; i < len; i++) {
|
||||
args[i] = arguments[i];
|
||||
}
|
||||
|
||||
dependants = normalizedGetDependants.apply(null, args);
|
||||
cache = getCache(dependants);
|
||||
|
||||
// If not guaranteed uniqueness by dependants (primitive type), shallow
|
||||
// compare against last dependants and, if references have changed,
|
||||
// destroy cache to recalculate result.
|
||||
if (!cache.isUniqueByDependants) {
|
||||
if (
|
||||
cache.lastDependants &&
|
||||
!isShallowEqual(dependants, cache.lastDependants, 0)
|
||||
) {
|
||||
cache.clear();
|
||||
}
|
||||
|
||||
cache.lastDependants = dependants;
|
||||
}
|
||||
|
||||
node = cache.head;
|
||||
while (node) {
|
||||
// Check whether node arguments match arguments
|
||||
if (!isShallowEqual(node.args, args, 1)) {
|
||||
node = node.next;
|
||||
continue;
|
||||
}
|
||||
|
||||
// At this point we can assume we've found a match
|
||||
|
||||
// Surface matched node to head if not already
|
||||
if (node !== cache.head) {
|
||||
// Adjust siblings to point to each other.
|
||||
/** @type {CacheNode} */ (node.prev).next = node.next;
|
||||
if (node.next) {
|
||||
node.next.prev = node.prev;
|
||||
}
|
||||
|
||||
node.next = cache.head;
|
||||
node.prev = null;
|
||||
/** @type {CacheNode} */ (cache.head).prev = node;
|
||||
cache.head = node;
|
||||
}
|
||||
|
||||
// Return immediately
|
||||
return node.val;
|
||||
}
|
||||
|
||||
// No cached value found. Continue to insertion phase:
|
||||
|
||||
node = /** @type {CacheNode} */ ({
|
||||
// Generate the result from original function
|
||||
val: selector.apply(null, args),
|
||||
});
|
||||
|
||||
// Avoid including the source object in the cache.
|
||||
args[0] = null;
|
||||
node.args = 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 (cache.head) {
|
||||
cache.head.prev = node;
|
||||
node.next = cache.head;
|
||||
}
|
||||
|
||||
cache.head = node;
|
||||
|
||||
return node.val;
|
||||
}
|
||||
|
||||
callSelector.getDependants = normalizedGetDependants;
|
||||
callSelector.clear = clear;
|
||||
clear();
|
||||
|
||||
return /** @type {S & EnhancedSelector} */ (callSelector);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","keycodes"]
|
||||
const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/selectors.js
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/** @typedef {import('./actions').WPShortcutKeyCombination} WPShortcutKeyCombination */
|
||||
|
||||
/** @typedef {import('@wordpress/keycodes').WPKeycodeHandlerByModifier} WPKeycodeHandlerByModifier */
|
||||
@@ -599,7 +297,7 @@ function getKeyCombinationRepresentation(shortcut, representation) {
|
||||
* const {character, modifier} = useSelect(
|
||||
* ( select ) =>
|
||||
* select( keyboardShortcutsStore ).getShortcutKeyCombination(
|
||||
* 'core/edit-post/next-region'
|
||||
* 'core/editor/next-region'
|
||||
* ),
|
||||
* []
|
||||
* );
|
||||
@@ -645,9 +343,9 @@ function getShortcutKeyCombination(state, name) {
|
||||
* const {display, raw, ariaLabel} = useSelect(
|
||||
* ( select ) =>{
|
||||
* return {
|
||||
* display: select( keyboardShortcutsStore ).getShortcutRepresentation('core/edit-post/next-region' ),
|
||||
* raw: select( keyboardShortcutsStore ).getShortcutRepresentation('core/edit-post/next-region','raw' ),
|
||||
* ariaLabel: select( keyboardShortcutsStore ).getShortcutRepresentation('core/edit-post/next-region', 'ariaLabel')
|
||||
* display: select( keyboardShortcutsStore ).getShortcutRepresentation('core/editor/next-region' ),
|
||||
* raw: select( keyboardShortcutsStore ).getShortcutRepresentation('core/editor/next-region','raw' ),
|
||||
* ariaLabel: select( keyboardShortcutsStore ).getShortcutRepresentation('core/editor/next-region', 'ariaLabel')
|
||||
* }
|
||||
* },
|
||||
* []
|
||||
@@ -685,7 +383,7 @@ function getShortcutRepresentation(state, name, representation = 'display') {
|
||||
* const ExampleComponent = () => {
|
||||
* const shortcutDescription = useSelect(
|
||||
* ( select ) =>
|
||||
* select( keyboardShortcutsStore ).getShortcutDescription( 'core/edit-post/next-region' ),
|
||||
* select( keyboardShortcutsStore ).getShortcutDescription( 'core/editor/next-region' ),
|
||||
* []
|
||||
* );
|
||||
*
|
||||
@@ -718,7 +416,7 @@ function getShortcutDescription(state, name) {
|
||||
* const shortcutAliases = useSelect(
|
||||
* ( select ) =>
|
||||
* select( keyboardShortcutsStore ).getShortcutAliases(
|
||||
* 'core/edit-post/next-region'
|
||||
* 'core/editor/next-region'
|
||||
* ),
|
||||
* []
|
||||
* );
|
||||
@@ -769,7 +467,7 @@ function getShortcutAliases(state, name) {
|
||||
* const allShortcutKeyCombinations = useSelect(
|
||||
* ( select ) =>
|
||||
* select( keyboardShortcutsStore ).getAllShortcutKeyCombinations(
|
||||
* 'core/edit-post/next-region'
|
||||
* 'core/editor/next-region'
|
||||
* ),
|
||||
* []
|
||||
* );
|
||||
@@ -801,7 +499,7 @@ function getShortcutAliases(state, name) {
|
||||
*
|
||||
* @return {WPShortcutKeyCombination[]} Key combinations.
|
||||
*/
|
||||
const getAllShortcutKeyCombinations = rememo((state, name) => {
|
||||
const getAllShortcutKeyCombinations = (0,external_wp_data_namespaceObject.createSelector)((state, name) => {
|
||||
return [getShortcutKeyCombination(state, name), ...getShortcutAliases(state, name)].filter(Boolean);
|
||||
}, (state, name) => [state[name]]);
|
||||
|
||||
@@ -823,7 +521,7 @@ const getAllShortcutKeyCombinations = rememo((state, name) => {
|
||||
* const allShortcutRawKeyCombinations = useSelect(
|
||||
* ( select ) =>
|
||||
* select( keyboardShortcutsStore ).getAllShortcutRawKeyCombinations(
|
||||
* 'core/edit-post/next-region'
|
||||
* 'core/editor/next-region'
|
||||
* ),
|
||||
* []
|
||||
* );
|
||||
@@ -854,7 +552,7 @@ const getAllShortcutKeyCombinations = rememo((state, name) => {
|
||||
*
|
||||
* @return {string[]} Shortcuts.
|
||||
*/
|
||||
const getAllShortcutRawKeyCombinations = rememo((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]]);
|
||||
|
||||
@@ -891,7 +589,7 @@ const getAllShortcutRawKeyCombinations = rememo((state, name) => {
|
||||
*```
|
||||
* @return {string[]} Shortcut names.
|
||||
*/
|
||||
const getCategoryShortcuts = rememo((state, categoryName) => {
|
||||
const getCategoryShortcuts = (0,external_wp_data_namespaceObject.createSelector)((state, categoryName) => {
|
||||
return Object.entries(state).filter(([, shortcut]) => shortcut.category === categoryName).map(([name]) => name);
|
||||
}, state => [state]);
|
||||
|
||||
@@ -1039,10 +737,9 @@ function useShortcut(name, callback, {
|
||||
}, [name, isDisabled, shortcuts]);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/components/shortcut-provider.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -1052,6 +749,7 @@ const external_React_namespaceObject = window["React"];
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
const {
|
||||
Provider
|
||||
} = context;
|
||||
@@ -1068,19 +766,22 @@ const {
|
||||
function ShortcutProvider(props) {
|
||||
const [keyboardShortcuts] = (0,external_wp_element_namespaceObject.useState)(() => new Set());
|
||||
function onKeyDown(event) {
|
||||
if (props.onKeyDown) props.onKeyDown(event);
|
||||
if (props.onKeyDown) {
|
||||
props.onKeyDown(event);
|
||||
}
|
||||
for (const keyboardShortcut of keyboardShortcuts) {
|
||||
keyboardShortcut(event);
|
||||
}
|
||||
}
|
||||
|
||||
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
||||
return (0,external_React_namespaceObject.createElement)(Provider, {
|
||||
value: keyboardShortcuts
|
||||
}, (0,external_React_namespaceObject.createElement)("div", {
|
||||
...props,
|
||||
onKeyDown: onKeyDown
|
||||
}));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, {
|
||||
value: keyboardShortcuts,
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
...props,
|
||||
onKeyDown: onKeyDown
|
||||
})
|
||||
});
|
||||
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[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:()=>_,__unstableUseShortcutEventMatch:()=>T,store:()=>C,useShortcut:()=>O});var n={};e.r(n),e.d(n,{registerShortcut:()=>i,unregisterShortcut:()=>c});var r={};e.r(r),e.d(r,{getAllShortcutKeyCombinations:()=>v,getAllShortcutRawKeyCombinations:()=>b,getCategoryShortcuts:()=>R,getShortcutAliases:()=>m,getShortcutDescription:()=>g,getShortcutKeyCombination:()=>S,getShortcutRepresentation:()=>w});const o=window.wp.data;const a=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]:n,...r}=e;return r}return e};function i({name:e,category:t,description:n,keyCombination:r,aliases:o}){return{type:"REGISTER_SHORTCUT",name:e,category:t,keyCombination:r,aliases:o,description:n}}function c(e){return{type:"UNREGISTER_SHORTCUT",name:e}}var u={};function s(e){return[e]}function l(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function d(e,t){var n,r=t||s;function o(){n=new WeakMap}function a(){var t,o,a,i,c,s=arguments.length;for(i=new Array(s),a=0;a<s;a++)i[a]=arguments[a];for(t=function(e){var t,r,o,a,i,c=n,s=!0;for(t=0;t<e.length;t++){if(!(i=r=e[t])||"object"!=typeof i){s=!1;break}c.has(r)?c=c.get(r):(o=new WeakMap,c.set(r,o),c=o)}return c.has(u)||((a=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=s,c.set(u,a)),c.get(u)}(c=r.apply(null,i)),t.isUniqueByDependants||(t.lastDependants&&!l(c,t.lastDependants,0)&&t.clear(),t.lastDependants=c),o=t.head;o;){if(l(o.args,i,1))return o!==t.head&&(o.prev.next=o.next,o.next&&(o.next.prev=o.prev),o.next=t.head,o.prev=null,t.head.prev=o,t.head=o),o.val;o=o.next}return o={val:e.apply(null,i)},i[0]=null,o.args=i,t.head&&(t.head.prev=o,o.next=t.head),t.head=o,o.val}return a.getDependants=r,a.clear=o,o(),a}const f=window.wp.keycodes,p=[],y={display:f.displayShortcut,raw:f.rawShortcut,ariaLabel:f.shortcutAriaLabel};function h(e,t){return e?e.modifier?y[t][e.modifier](e.character):e.character:null}function S(e,t){return e[t]?e[t].keyCombination:null}function w(e,t,n="display"){return h(S(e,t),n)}function g(e,t){return e[t]?e[t].description:null}function m(e,t){return e[t]&&e[t].aliases?e[t].aliases:p}const v=d(((e,t)=>[S(e,t),...m(e,t)].filter(Boolean)),((e,t)=>[e[t]])),b=d(((e,t)=>v(e,t).map((e=>h(e,"raw")))),((e,t)=>[e[t]])),R=d(((e,t)=>Object.entries(e).filter((([,e])=>e.category===t)).map((([e])=>e))),(e=>[e])),C=(0,o.createReduxStore)("core/keyboard-shortcuts",{reducer:a,actions:n,selectors:r});(0,o.register)(C);const E=window.wp.element;function T(){const{getAllShortcutKeyCombinations:e}=(0,o.useSelect)(C);return function(t,n){return e(t).some((({modifier:e,character:t})=>f.isKeyboardEvent[e](n,t)))}}const k=new Set,D=e=>{for(const t of k)t(e)},x=(0,E.createContext)({add:e=>{0===k.size&&document.addEventListener("keydown",D),k.add(e)},delete:e=>{k.delete(e),0===k.size&&document.removeEventListener("keydown",D)}});function O(e,t,{isDisabled:n=!1}={}){const r=(0,E.useContext)(x),o=T(),a=(0,E.useRef)();(0,E.useEffect)((()=>{a.current=t}),[t]),(0,E.useEffect)((()=>{if(!n)return r.add(t),()=>{r.delete(t)};function t(t){o(e,t)&&a.current(t)}}),[e,n,r])}const U=window.React,{Provider:K}=x;function _(e){const[t]=(0,E.useState)((()=>new Set));return(0,U.createElement)(K,{value:t},(0,U.createElement)("div",{...e,onKeyDown:function(n){e.onKeyDown&&e.onKeyDown(n);for(const e of t)e(n)}}))}(window.wp=window.wp||{}).keyboardShortcuts=t})();
|
||||
(()=>{"use strict";var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[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,{ShortcutProvider:()=>K,__unstableUseShortcutEventMatch:()=>R,store:()=>h,useShortcut:()=>T});var o={};e.r(o),e.d(o,{registerShortcut:()=>c,unregisterShortcut:()=>a});var n={};e.r(n),e.d(n,{getAllShortcutKeyCombinations:()=>m,getAllShortcutRawKeyCombinations:()=>p,getCategoryShortcuts:()=>b,getShortcutAliases:()=>w,getShortcutDescription:()=>f,getShortcutKeyCombination:()=>y,getShortcutRepresentation:()=>S});const r=window.wp.data;const 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,...n}=e;return n}return e};function c({name:e,category:t,description:o,keyCombination:n,aliases:r}){return{type:"REGISTER_SHORTCUT",name:e,category:t,keyCombination:n,aliases:r,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 w(e,t){return e[t]&&e[t].aliases?e[t].aliases:u}const m=(0,r.createSelector)(((e,t)=>[y(e,t),...w(e,t)].filter(Boolean)),((e,t)=>[e[t]])),p=(0,r.createSelector)(((e,t)=>m(e,t).map((e=>l(e,"raw")))),((e,t)=>[e[t]])),b=(0,r.createSelector)(((e,t)=>Object.entries(e).filter((([,e])=>e.category===t)).map((([e])=>e))),(e=>[e])),h=(0,r.createReduxStore)("core/keyboard-shortcuts",{reducer:i,actions:o,selectors:n});(0,r.register)(h);const g=window.wp.element;function R(){const{getAllShortcutKeyCombinations:e}=(0,r.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 n=(0,g.useContext)(E),r=R(),i=(0,g.useRef)();(0,g.useEffect)((()=>{i.current=t}),[t]),(0,g.useEffect)((()=>{if(!o)return n.add(t),()=>{n.delete(t)};function t(t){r(e,t)&&i.current(t)}}),[e,o,n])}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})();
|
||||
+37
-30
@@ -49,8 +49,6 @@ var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// CONCATENATED MODULE: external ["wp","i18n"]
|
||||
@@ -639,8 +637,9 @@ async function importReusableBlock(file) {
|
||||
}
|
||||
/* harmony default export */ const utils_import = (importReusableBlock);
|
||||
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-form/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -653,6 +652,8 @@ async function importReusableBlock(file) {
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function ImportForm({
|
||||
instanceId,
|
||||
onUpload
|
||||
@@ -702,32 +703,36 @@ function ImportForm({
|
||||
const onDismissError = () => {
|
||||
setError(null);
|
||||
};
|
||||
return (0,external_React_namespaceObject.createElement)("form", {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", {
|
||||
className: "list-reusable-blocks-import-form",
|
||||
onSubmit: onSubmit,
|
||||
ref: formRef
|
||||
}, error && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
|
||||
status: "error",
|
||||
onRemove: () => onDismissError()
|
||||
}, error), (0,external_React_namespaceObject.createElement)("label", {
|
||||
htmlFor: inputId,
|
||||
className: "list-reusable-blocks-import-form__label"
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('File')), (0,external_React_namespaceObject.createElement)("input", {
|
||||
id: inputId,
|
||||
type: "file",
|
||||
onChange: onChangeFile
|
||||
}), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
type: "submit",
|
||||
isBusy: isLoading,
|
||||
disabled: !file || isLoading,
|
||||
variant: "secondary",
|
||||
className: "list-reusable-blocks-import-form__button"
|
||||
}, (0,external_wp_i18n_namespaceObject._x)('Import', 'button label')));
|
||||
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, {
|
||||
type: "submit",
|
||||
isBusy: isLoading,
|
||||
__experimentalIsFocusable: true,
|
||||
disabled: !file || isLoading,
|
||||
variant: "secondary",
|
||||
className: "list-reusable-blocks-import-form__button",
|
||||
children: (0,external_wp_i18n_namespaceObject._x)('Import', 'button label')
|
||||
})]
|
||||
});
|
||||
}
|
||||
/* harmony default export */ const import_form = ((0,external_wp_compose_namespaceObject.withInstanceId)(ImportForm));
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-dropdown/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -739,10 +744,11 @@ function ImportForm({
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
function ImportDropdown({
|
||||
onUpload
|
||||
}) {
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
|
||||
popoverProps: {
|
||||
placement: 'bottom-start'
|
||||
},
|
||||
@@ -750,14 +756,15 @@ function ImportDropdown({
|
||||
renderToggle: ({
|
||||
isOpen,
|
||||
onToggle
|
||||
}) => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
|
||||
"aria-expanded": isOpen,
|
||||
onClick: onToggle,
|
||||
variant: "primary"
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Import from JSON')),
|
||||
variant: "primary",
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('Import from JSON')
|
||||
}),
|
||||
renderContent: ({
|
||||
onClose
|
||||
}) => (0,external_React_namespaceObject.createElement)(import_form, {
|
||||
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(import_form, {
|
||||
onUpload: (0,external_wp_compose_namespaceObject.pipe)(onClose, onUpload)
|
||||
})
|
||||
});
|
||||
@@ -765,7 +772,6 @@ function ImportDropdown({
|
||||
/* harmony default export */ const import_dropdown = (ImportDropdown);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/list-reusable-blocks/build-module/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -779,6 +785,7 @@ function ImportDropdown({
|
||||
|
||||
|
||||
// Setup Export Links.
|
||||
|
||||
document.body.addEventListener('click', event => {
|
||||
if (!event.target.classList.contains('wp-list-reusable-blocks__export')) {
|
||||
return;
|
||||
@@ -806,7 +813,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
const container = document.createElement('div');
|
||||
container.className = 'list-reusable-blocks__container';
|
||||
button.parentNode.insertBefore(container, button);
|
||||
(0,external_wp_element_namespaceObject.createRoot)(container).render((0,external_React_namespaceObject.createElement)(import_dropdown, {
|
||||
(0,external_wp_element_namespaceObject.createRoot)(container).render( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(import_dropdown, {
|
||||
onUpload: showNotice
|
||||
}));
|
||||
});
|
||||
|
||||
+1
-1
@@ -1,2 +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);const n=window.React,o=window.wp.element,r=window.wp.i18n;var a=function(){return a=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},a.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function s(e){return e.toLowerCase()}var i=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],l=/[^A-Z0-9]+/gi;function c(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function p(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?i:n,r=t.stripRegexp,a=void 0===r?l:r,p=t.transform,d=void 0===p?s:p,u=t.delimiter,w=void 0===u?" ":u,m=c(c(e,o,"$1\0$2"),a,"\0"),f=0,b=m.length;"\0"===m.charAt(f);)f++;for(;"\0"===m.charAt(b-1);)b--;return m.slice(f,b).split("\0").map(d).join(w)}(e,a({delimiter:"."},t))}const d=window.wp.apiFetch;var u=e.n(d);const w=window.wp.blob;const m=async function(e){const t=await u()({path:"/wp/v2/types/wp_block"}),n=await u()({path:`/wp/v2/${t.rest_base}/${e}?context=edit`}),o=n.title.raw,r=n.content.raw,s=n.wp_pattern_sync_status,i=JSON.stringify({__file:"wp_block",title:o,content:r,syncStatus:s},null,2),l=(void 0===c&&(c={}),p(o,a({delimiter:"-"},c))+".json");var c;(0,w.downloadBlob)(l,i,"application/json")},f=window.wp.compose,b=window.wp.components;const _=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 u()({path:"/wp/v2/types/wp_block"});return await u()({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"})};const v=(0,f.withInstanceId)((function({instanceId:e,onUpload:t}){const a="list-reusable-blocks-import-form-"+e,s=(0,o.useRef)(),[i,l]=(0,o.useState)(!1),[c,p]=(0,o.useState)(null),[d,u]=(0,o.useState)(null);return(0,n.createElement)("form",{className:"list-reusable-blocks-import-form",onSubmit:e=>{e.preventDefault(),d&&(l({isLoading:!0}),_(d).then((e=>{s&&(l(!1),t(e))})).catch((e=>{if(!s)return;let t;switch(e.message){case"Invalid JSON file":t=(0,r.__)("Invalid JSON file");break;case"Invalid pattern JSON file":t=(0,r.__)("Invalid pattern JSON file");break;default:t=(0,r.__)("Unknown error")}l(!1),p(t)})))},ref:s},c&&(0,n.createElement)(b.Notice,{status:"error",onRemove:()=>{p(null)}},c),(0,n.createElement)("label",{htmlFor:a,className:"list-reusable-blocks-import-form__label"},(0,r.__)("File")),(0,n.createElement)("input",{id:a,type:"file",onChange:e=>{u(e.target.files[0]),p(null)}}),(0,n.createElement)(b.Button,{type:"submit",isBusy:i,disabled:!d||i,variant:"secondary",className:"list-reusable-blocks-import-form__button"},(0,r._x)("Import","button label")))}));const y=function({onUpload:e}){return(0,n.createElement)(b.Dropdown,{popoverProps:{placement:"bottom-start"},contentClassName:"list-reusable-blocks-import-dropdown__content",renderToggle:({isOpen:e,onToggle:t})=>(0,n.createElement)(b.Button,{"aria-expanded":e,onClick:t,variant:"primary"},(0,r.__)("Import from JSON")),renderContent:({onClose:t})=>(0,n.createElement)(v,{onUpload:(0,f.pipe)(t,e)})})};document.body.addEventListener("click",(e=>{e.target.classList.contains("wp-list-reusable-blocks__export")&&(e.preventDefault(),m(e.target.dataset.id))})),document.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector(".page-title-action");if(!e)return;const t=document.createElement("div");t.className="list-reusable-blocks__container",e.parentNode.insertBefore(t,e),(0,o.createRoot)(t).render((0,n.createElement)(y,{onUpload:()=>{const e=document.createElement("div");e.className="notice notice-success is-dismissible",e.innerHTML=`<p>${(0,r.__)("Pattern imported successfully!")}</p>`;const t=document.querySelector(".wp-header-end");t&&t.parentNode.insertBefore(e,t)}}))})),(window.wp=window.wp||{}).listReusableBlocks=t})();
|
||||
(()=>{"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);const 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;const 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")},f=window.wp.compose,m=window.wp.components;const 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"})},_=window.ReactJSXRuntime;const v=(0,f.withInstanceId)((function({instanceId:e,onUpload:t}){const r="list-reusable-blocks-import-form-"+e,s=(0,n.useRef)(),[a,i]=(0,n.useState)(!1),[l,c]=(0,n.useState)(null),[p,d]=(0,n.useState)(null);return(0,_.jsxs)("form",{className:"list-reusable-blocks-import-form",onSubmit:e=>{e.preventDefault(),p&&(i({isLoading:!0}),b(p).then((e=>{s&&(i(!1),t(e))})).catch((e=>{if(!s)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")}i(!1),c(t)})))},ref:s,children:[l&&(0,_.jsx)(m.Notice,{status:"error",onRemove:()=>{c(null)},children:l}),(0,_.jsx)("label",{htmlFor:r,className:"list-reusable-blocks-import-form__label",children:(0,o.__)("File")}),(0,_.jsx)("input",{id:r,type:"file",onChange:e=>{d(e.target.files[0]),c(null)}}),(0,_.jsx)(m.Button,{type:"submit",isBusy:a,__experimentalIsFocusable:!0,disabled:!p||a,variant:"secondary",className:"list-reusable-blocks-import-form__button",children:(0,o._x)("Import","button label")})]})}));const y=function({onUpload:e}){return(0,_.jsx)(m.Dropdown,{popoverProps:{placement:"bottom-start"},contentClassName:"list-reusable-blocks-import-dropdown__content",renderToggle:({isOpen:e,onToggle:t})=>(0,_.jsx)(m.Button,{"aria-expanded":e,onClick:t,variant:"primary",children:(0,o.__)("Import from JSON")}),renderContent:({onClose:t})=>(0,_.jsx)(v,{onUpload:(0,f.pipe)(t,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 t=document.createElement("div");t.className="list-reusable-blocks__container",e.parentNode.insertBefore(t,e),(0,n.createRoot)(t).render((0,_.jsx)(y,{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=t})();
|
||||
Vendored
+30
-320
@@ -204,307 +204,9 @@ function enableTips() {
|
||||
};
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/rememo/rememo.js
|
||||
|
||||
|
||||
/** @typedef {(...args: any[]) => *[]} GetDependants */
|
||||
|
||||
/** @typedef {() => void} Clear */
|
||||
|
||||
/**
|
||||
* @typedef {{
|
||||
* getDependants: GetDependants,
|
||||
* clear: Clear
|
||||
* }} EnhancedSelector
|
||||
*/
|
||||
|
||||
/**
|
||||
* Internal cache entry.
|
||||
*
|
||||
* @typedef CacheNode
|
||||
*
|
||||
* @property {?CacheNode|undefined} [prev] Previous node.
|
||||
* @property {?CacheNode|undefined} [next] Next node.
|
||||
* @property {*[]} args Function arguments for cache entry.
|
||||
* @property {*} val Function result.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef Cache
|
||||
*
|
||||
* @property {Clear} clear Function to clear cache.
|
||||
* @property {boolean} [isUniqueByDependants] Whether dependants are valid in
|
||||
* considering cache uniqueness. A cache is unique if dependents are all arrays
|
||||
* or objects.
|
||||
* @property {CacheNode?} [head] Cache head.
|
||||
* @property {*[]} [lastDependants] Dependants from previous invocation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Arbitrary value used as key for referencing cache object in WeakMap tree.
|
||||
*
|
||||
* @type {{}}
|
||||
*/
|
||||
var LEAF_KEY = {};
|
||||
|
||||
/**
|
||||
* Returns the first argument as the sole entry in an array.
|
||||
*
|
||||
* @template T
|
||||
*
|
||||
* @param {T} value Value to return.
|
||||
*
|
||||
* @return {[T]} Value returned as entry in array.
|
||||
*/
|
||||
function arrayOf(value) {
|
||||
return [value];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the value passed is object-like, or false otherwise. A value
|
||||
* is object-like if it can support property assignment, e.g. object or array.
|
||||
*
|
||||
* @param {*} value Value to test.
|
||||
*
|
||||
* @return {boolean} Whether value is object-like.
|
||||
*/
|
||||
function isObjectLike(value) {
|
||||
return !!value && 'object' === typeof value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and returns a new cache object.
|
||||
*
|
||||
* @return {Cache} Cache object.
|
||||
*/
|
||||
function createCache() {
|
||||
/** @type {Cache} */
|
||||
var cache = {
|
||||
clear: function () {
|
||||
cache.head = null;
|
||||
},
|
||||
};
|
||||
|
||||
return cache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if entries within the two arrays are strictly equal by
|
||||
* reference from a starting index.
|
||||
*
|
||||
* @param {*[]} a First array.
|
||||
* @param {*[]} b Second array.
|
||||
* @param {number} fromIndex Index from which to start comparison.
|
||||
*
|
||||
* @return {boolean} Whether arrays are shallowly equal.
|
||||
*/
|
||||
function isShallowEqual(a, b, fromIndex) {
|
||||
var i;
|
||||
|
||||
if (a.length !== b.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (i = fromIndex; i < a.length; i++) {
|
||||
if (a[i] !== b[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a memoized selector function. The getDependants function argument is
|
||||
* called before the memoized selector and is expected to return an immutable
|
||||
* reference or array of references on which the selector depends for computing
|
||||
* its own return value. The memoize cache is preserved only as long as those
|
||||
* dependant references remain the same. If getDependants returns a different
|
||||
* reference(s), the cache is cleared and the selector value regenerated.
|
||||
*
|
||||
* @template {(...args: *[]) => *} S
|
||||
*
|
||||
* @param {S} selector Selector function.
|
||||
* @param {GetDependants=} getDependants Dependant getter returning an array of
|
||||
* references used in cache bust consideration.
|
||||
*/
|
||||
/* harmony default export */ function rememo(selector, getDependants) {
|
||||
/** @type {WeakMap<*,*>} */
|
||||
var rootCache;
|
||||
|
||||
/** @type {GetDependants} */
|
||||
var normalizedGetDependants = getDependants ? getDependants : arrayOf;
|
||||
|
||||
/**
|
||||
* Returns the cache for a given dependants array. When possible, a WeakMap
|
||||
* will be used to create a unique cache for each set of dependants. This
|
||||
* is feasible due to the nature of WeakMap in allowing garbage collection
|
||||
* to occur on entries where the key object is no longer referenced. Since
|
||||
* WeakMap requires the key to be an object, this is only possible when the
|
||||
* dependant is object-like. The root cache is created as a hierarchy where
|
||||
* each top-level key is the first entry in a dependants set, the value a
|
||||
* WeakMap where each key is the next dependant, and so on. This continues
|
||||
* so long as the dependants are object-like. If no dependants are object-
|
||||
* like, then the cache is shared across all invocations.
|
||||
*
|
||||
* @see isObjectLike
|
||||
*
|
||||
* @param {*[]} dependants Selector dependants.
|
||||
*
|
||||
* @return {Cache} Cache object.
|
||||
*/
|
||||
function getCache(dependants) {
|
||||
var caches = rootCache,
|
||||
isUniqueByDependants = true,
|
||||
i,
|
||||
dependant,
|
||||
map,
|
||||
cache;
|
||||
|
||||
for (i = 0; i < dependants.length; i++) {
|
||||
dependant = dependants[i];
|
||||
|
||||
// Can only compose WeakMap from object-like key.
|
||||
if (!isObjectLike(dependant)) {
|
||||
isUniqueByDependants = false;
|
||||
break;
|
||||
}
|
||||
|
||||
// Does current segment of cache already have a WeakMap?
|
||||
if (caches.has(dependant)) {
|
||||
// Traverse into nested WeakMap.
|
||||
caches = caches.get(dependant);
|
||||
} else {
|
||||
// Create, set, and traverse into a new one.
|
||||
map = new WeakMap();
|
||||
caches.set(dependant, map);
|
||||
caches = map;
|
||||
}
|
||||
}
|
||||
|
||||
// We use an arbitrary (but consistent) object as key for the last item
|
||||
// in the WeakMap to serve as our running cache.
|
||||
if (!caches.has(LEAF_KEY)) {
|
||||
cache = createCache();
|
||||
cache.isUniqueByDependants = isUniqueByDependants;
|
||||
caches.set(LEAF_KEY, cache);
|
||||
}
|
||||
|
||||
return caches.get(LEAF_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets root memoization cache.
|
||||
*/
|
||||
function clear() {
|
||||
rootCache = new WeakMap();
|
||||
}
|
||||
|
||||
/* eslint-disable jsdoc/check-param-names */
|
||||
/**
|
||||
* The augmented selector call, considering first whether dependants have
|
||||
* changed before passing it to underlying memoize function.
|
||||
*
|
||||
* @param {*} source Source object for derivation.
|
||||
* @param {...*} extraArgs Additional arguments to pass to selector.
|
||||
*
|
||||
* @return {*} Selector result.
|
||||
*/
|
||||
/* eslint-enable jsdoc/check-param-names */
|
||||
function callSelector(/* source, ...extraArgs */) {
|
||||
var len = arguments.length,
|
||||
cache,
|
||||
node,
|
||||
i,
|
||||
args,
|
||||
dependants;
|
||||
|
||||
// Create copy of arguments (avoid leaking deoptimization).
|
||||
args = new Array(len);
|
||||
for (i = 0; i < len; i++) {
|
||||
args[i] = arguments[i];
|
||||
}
|
||||
|
||||
dependants = normalizedGetDependants.apply(null, args);
|
||||
cache = getCache(dependants);
|
||||
|
||||
// If not guaranteed uniqueness by dependants (primitive type), shallow
|
||||
// compare against last dependants and, if references have changed,
|
||||
// destroy cache to recalculate result.
|
||||
if (!cache.isUniqueByDependants) {
|
||||
if (
|
||||
cache.lastDependants &&
|
||||
!isShallowEqual(dependants, cache.lastDependants, 0)
|
||||
) {
|
||||
cache.clear();
|
||||
}
|
||||
|
||||
cache.lastDependants = dependants;
|
||||
}
|
||||
|
||||
node = cache.head;
|
||||
while (node) {
|
||||
// Check whether node arguments match arguments
|
||||
if (!isShallowEqual(node.args, args, 1)) {
|
||||
node = node.next;
|
||||
continue;
|
||||
}
|
||||
|
||||
// At this point we can assume we've found a match
|
||||
|
||||
// Surface matched node to head if not already
|
||||
if (node !== cache.head) {
|
||||
// Adjust siblings to point to each other.
|
||||
/** @type {CacheNode} */ (node.prev).next = node.next;
|
||||
if (node.next) {
|
||||
node.next.prev = node.prev;
|
||||
}
|
||||
|
||||
node.next = cache.head;
|
||||
node.prev = null;
|
||||
/** @type {CacheNode} */ (cache.head).prev = node;
|
||||
cache.head = node;
|
||||
}
|
||||
|
||||
// Return immediately
|
||||
return node.val;
|
||||
}
|
||||
|
||||
// No cached value found. Continue to insertion phase:
|
||||
|
||||
node = /** @type {CacheNode} */ ({
|
||||
// Generate the result from original function
|
||||
val: selector.apply(null, args),
|
||||
});
|
||||
|
||||
// Avoid including the source object in the cache.
|
||||
args[0] = null;
|
||||
node.args = 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 (cache.head) {
|
||||
cache.head.prev = node;
|
||||
node.next = cache.head;
|
||||
}
|
||||
|
||||
cache.head = node;
|
||||
|
||||
return node.val;
|
||||
}
|
||||
|
||||
callSelector.getDependants = normalizedGetDependants;
|
||||
callSelector.clear = clear;
|
||||
clear();
|
||||
|
||||
return /** @type {S & EnhancedSelector} */ (callSelector);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/selectors.js
|
||||
/**
|
||||
* External dependencies
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
@@ -526,7 +228,7 @@ function isShallowEqual(a, b, fromIndex) {
|
||||
*
|
||||
* @return {?NUXGuideInfo} Information about the associated guide.
|
||||
*/
|
||||
const getAssociatedGuide = rememo((state, tipId) => {
|
||||
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));
|
||||
@@ -613,8 +315,6 @@ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME,
|
||||
persist: ['preferences']
|
||||
});
|
||||
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: external ["wp","compose"]
|
||||
const external_wp_compose_namespaceObject = window["wp"]["compose"];
|
||||
;// CONCATENATED MODULE: external ["wp","components"]
|
||||
@@ -625,22 +325,24 @@ const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// CONCATENATED MODULE: external ["wp","primitives"]
|
||||
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const close_close = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const close_close = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
|
||||
}));
|
||||
viewBox: "0 0 24 24",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const library_close = (close_close);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/components/dot-tip/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -655,6 +357,8 @@ const close_close = (0,external_React_namespaceObject.createElement)(external_wp
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function onClick(event) {
|
||||
// Tips are often nested within buttons. We stop propagation so that clicking
|
||||
// on a tip doesn't result in the button being clicked.
|
||||
@@ -681,23 +385,29 @@ function DotTip({
|
||||
if (!isVisible) {
|
||||
return null;
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Popover, {
|
||||
className: "nux-dot-tip",
|
||||
position: position,
|
||||
focusOnMount: true,
|
||||
role: "dialog",
|
||||
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Editor tips'),
|
||||
onClick: onClick,
|
||||
onFocusOutside: onFocusOutsideCallback
|
||||
}, (0,external_React_namespaceObject.createElement)("p", null, children), (0,external_React_namespaceObject.createElement)("p", null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
variant: "link",
|
||||
onClick: onDismiss
|
||||
}, hasNextTip ? (0,external_wp_i18n_namespaceObject.__)('See next tip') : (0,external_wp_i18n_namespaceObject.__)('Got it'))), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
className: "nux-dot-tip__disable",
|
||||
icon: library_close,
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Disable tips'),
|
||||
onClick: onDisable
|
||||
}));
|
||||
onFocusOutside: onFocusOutsideCallback,
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
|
||||
children: children
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
|
||||
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, {
|
||||
className: "nux-dot-tip__disable",
|
||||
icon: library_close,
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Disable tips'),
|
||||
onClick: onDisable
|
||||
})]
|
||||
});
|
||||
}
|
||||
/* harmony default export */ const dot_tip = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)((select, {
|
||||
tipId
|
||||
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={n:n=>{var t=n&&n.__esModule?()=>n.default:()=>n;return e.d(t,{a:t}),t},d:(n,t)=>{for(var r in t)e.o(t,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:t[r]})},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,{DotTip:()=>G,store:()=>v});var t={};e.r(t),e.d(t,{disableTips:()=>l,dismissTip:()=>p,enableTips:()=>d,triggerGuide:()=>c});var r={};e.r(r),e.d(r,{areTipsEnabled:()=>m,getAssociatedGuide:()=>b,isTipVisible:()=>h});const i=window.wp.deprecated;var s=e.n(i);const o=window.wp.data;const a=(0,o.combineReducers)({areTipsEnabled:function(e=!0,n){switch(n.type){case"DISABLE_TIPS":return!1;case"ENABLE_TIPS":return!0}return e},dismissedTips:function(e={},n){switch(n.type){case"DISMISS_TIP":return{...e,[n.id]:!0};case"ENABLE_TIPS":return{}}return e}}),u=(0,o.combineReducers)({guides:function(e=[],n){return"TRIGGER_GUIDE"===n.type?[...e,n.tipIds]:e},preferences:a});function c(e){return{type:"TRIGGER_GUIDE",tipIds:e}}function p(e){return{type:"DISMISS_TIP",id:e}}function l(){return{type:"DISABLE_TIPS"}}function d(){return{type:"ENABLE_TIPS"}}var f={};function w(e){return[e]}function T(e,n,t){var r;if(e.length!==n.length)return!1;for(r=t;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}const b=function(e,n){var t,r=n||w;function i(){t=new WeakMap}function s(){var n,i,s,o,a,u=arguments.length;for(o=new Array(u),s=0;s<u;s++)o[s]=arguments[s];for(n=function(e){var n,r,i,s,o,a=t,u=!0;for(n=0;n<e.length;n++){if(!(o=r=e[n])||"object"!=typeof o){u=!1;break}a.has(r)?a=a.get(r):(i=new WeakMap,a.set(r,i),a=i)}return a.has(f)||((s=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=u,a.set(f,s)),a.get(f)}(a=r.apply(null,o)),n.isUniqueByDependants||(n.lastDependants&&!T(a,n.lastDependants,0)&&n.clear(),n.lastDependants=a),i=n.head;i;){if(T(i.args,o,1))return i!==n.head&&(i.prev.next=i.next,i.next&&(i.next.prev=i.prev),i.next=n.head,i.prev=null,n.head.prev=i,n.head=i),i.val;i=i.next}return i={val:e.apply(null,o)},o[0]=null,i.args=o,n.head&&(n.head.prev=i,i.next=n.head),n.head=i,i.val}return s.getDependants=r,s.clear=i,i(),s}(((e,n)=>{for(const t of e.guides)if(t.includes(n)){const n=t.filter((n=>!Object.keys(e.preferences.dismissedTips).includes(n))),[r=null,i=null]=n;return{tipIds:t,currentTipId:r,nextTipId:i}}return null}),(e=>[e.guides,e.preferences.dismissedTips]));function h(e,n){if(!e.preferences.areTipsEnabled)return!1;if(e.preferences.dismissedTips?.hasOwnProperty(n))return!1;const t=b(e,n);return!t||t.currentTipId===n}function m(e){return e.preferences.areTipsEnabled}const g="core/nux",v=(0,o.createReduxStore)(g,{reducer:u,actions:t,selectors:r,persist:["preferences"]});(0,o.registerStore)(g,{reducer:u,actions:t,selectors:r,persist:["preferences"]});const I=window.React,y=window.wp.compose,E=window.wp.components,S=window.wp.i18n,_=window.wp.element,x=window.wp.primitives,D=(0,I.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,I.createElement)(x.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function P(e){e.stopPropagation()}const G=(0,y.compose)((0,o.withSelect)(((e,{tipId:n})=>{const{isTipVisible:t,getAssociatedGuide:r}=e(v),i=r(n);return{isVisible:t(n),hasNextTip:!(!i||!i.nextTipId)}})),(0,o.withDispatch)(((e,{tipId:n})=>{const{dismissTip:t,disableTips:r}=e(v);return{onDismiss(){t(n)},onDisable(){r()}}})))((function({position:e="middle right",children:n,isVisible:t,hasNextTip:r,onDismiss:i,onDisable:s}){const o=(0,_.useRef)(null),a=(0,_.useCallback)((e=>{o.current&&(o.current.contains(e.relatedTarget)||s())}),[s,o]);return t?(0,I.createElement)(E.Popover,{className:"nux-dot-tip",position:e,focusOnMount:!0,role:"dialog","aria-label":(0,S.__)("Editor tips"),onClick:P,onFocusOutside:a},(0,I.createElement)("p",null,n),(0,I.createElement)("p",null,(0,I.createElement)(E.Button,{variant:"link",onClick:i},r?(0,S.__)("See next tip"):(0,S.__)("Got it"))),(0,I.createElement)(E.Button,{className:"nux-dot-tip__disable",icon:D,label:(0,S.__)("Disable tips"),onClick:s})):null}));s()("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=n})();
|
||||
(()=>{"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:()=>P,store:()=>I});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}}),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",I=(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 m=window.wp.compose,S=window.wp.components,_=window.wp.i18n,g=window.wp.element,h=window.wp.primitives,x=window.ReactJSXRuntime,y=(0,x.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,x.jsx)(h.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})});function E(e){e.stopPropagation()}const P=(0,m.compose)((0,o.withSelect)(((e,{tipId:i})=>{const{isTipVisible:n,getAssociatedGuide:t}=e(I),s=t(i);return{isVisible:n(i),hasNextTip:!(!s||!s.nextTipId)}})),(0,o.withDispatch)(((e,{tipId:i})=>{const{dismissTip:n,disableTips:t}=e(I);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,x.jsxs)(S.Popover,{className:"nux-dot-tip",position:e,focusOnMount:!0,role:"dialog","aria-label":(0,_.__)("Editor tips"),onClick:E,onFocusOutside:c,children:[(0,x.jsx)("p",{children:i}),(0,x.jsx)("p",{children:(0,x.jsx)(S.Button,{variant:"link",onClick:s,children:t?(0,_.__)("See next tip"):(0,_.__)("Got it")})}),(0,x.jsx)(S.Button,{className:"nux-dot-tip__disable",icon:y,label:(0,_.__)("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})();
|
||||
Vendored
+700
-279
File diff suppressed because it is too large
Load Diff
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+40
-31
@@ -60,8 +60,6 @@ __webpack_require__.d(__webpack_exports__, {
|
||||
withPluginContext: () => (/* reexport */ withPluginContext)
|
||||
});
|
||||
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: ./node_modules/memize/dist/index.js
|
||||
/**
|
||||
* Memize options object.
|
||||
@@ -233,8 +231,9 @@ const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"
|
||||
var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
|
||||
;// CONCATENATED MODULE: external ["wp","compose"]
|
||||
const external_wp_compose_namespaceObject = window["wp"]["compose"];
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/plugin-context/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -271,10 +270,12 @@ function usePluginContext() {
|
||||
* @return {Component} Enhanced component with injected context as props.
|
||||
*/
|
||||
const withPluginContext = mapContextToProps => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(OriginalComponent => {
|
||||
return props => (0,external_React_namespaceObject.createElement)(Context.Consumer, null, context => (0,external_React_namespaceObject.createElement)(OriginalComponent, {
|
||||
...props,
|
||||
...mapContextToProps(context, props)
|
||||
}));
|
||||
return props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Context.Consumer, {
|
||||
children: context => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
|
||||
...props,
|
||||
...mapContextToProps(context, props)
|
||||
})
|
||||
});
|
||||
}, 'withPluginContext');
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/plugin-error-boundary/index.js
|
||||
@@ -321,17 +322,18 @@ class PluginErrorBoundary extends external_wp_element_namespaceObject.Component
|
||||
;// CONCATENATED MODULE: external ["wp","primitives"]
|
||||
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plugins.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const plugins = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const plugins = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(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"
|
||||
}));
|
||||
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"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const library_plugins = (plugins);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/api/index.js
|
||||
@@ -345,6 +347,11 @@ const plugins = (0,external_React_namespaceObject.createElement)(external_wp_pri
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Defined behavior of a plugin type.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Plugin definitions keyed by plugin name.
|
||||
*/
|
||||
@@ -362,8 +369,8 @@ const api_plugins = {};
|
||||
* // Using ES5 syntax
|
||||
* var el = React.createElement;
|
||||
* var Fragment = wp.element.Fragment;
|
||||
* var PluginSidebar = wp.editPost.PluginSidebar;
|
||||
* var PluginSidebarMoreMenuItem = wp.editPost.PluginSidebarMoreMenuItem;
|
||||
* var PluginSidebar = wp.editor.PluginSidebar;
|
||||
* var PluginSidebarMoreMenuItem = wp.editor.PluginSidebarMoreMenuItem;
|
||||
* var registerPlugin = wp.plugins.registerPlugin;
|
||||
* var moreIcon = React.createElement( 'svg' ); //... svg element.
|
||||
*
|
||||
@@ -398,7 +405,7 @@ const api_plugins = {};
|
||||
* @example
|
||||
* ```js
|
||||
* // Using ESNext syntax
|
||||
* import { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-post';
|
||||
* import { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/editor';
|
||||
* import { registerPlugin } from '@wordpress/plugins';
|
||||
* import { more } from '@wordpress/icons';
|
||||
*
|
||||
@@ -530,7 +537,6 @@ function getPlugins(scope) {
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/plugin-area/index.js
|
||||
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
@@ -549,6 +555,7 @@ function getPlugins(scope) {
|
||||
|
||||
|
||||
|
||||
|
||||
const getPluginContext = memize((icon, name) => ({
|
||||
icon,
|
||||
name
|
||||
@@ -615,22 +622,24 @@ function PluginArea({
|
||||
}
|
||||
};
|
||||
}, [scope]);
|
||||
const plugins = (0,external_wp_element_namespaceObject.useSyncExternalStore)(store.subscribe, store.getValue);
|
||||
return (0,external_React_namespaceObject.createElement)("div", {
|
||||
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'
|
||||
}
|
||||
}, plugins.map(({
|
||||
icon,
|
||||
name,
|
||||
render: Plugin
|
||||
}) => (0,external_React_namespaceObject.createElement)(PluginContextProvider, {
|
||||
key: name,
|
||||
value: getPluginContext(icon, name)
|
||||
}, (0,external_React_namespaceObject.createElement)(PluginErrorBoundary, {
|
||||
name: name,
|
||||
onError: onError
|
||||
}, (0,external_React_namespaceObject.createElement)(Plugin, null)))));
|
||||
},
|
||||
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: name,
|
||||
onError: onError,
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Plugin, {})
|
||||
})
|
||||
}, name))
|
||||
});
|
||||
}
|
||||
/* harmony default export */ const plugin_area = (PluginArea);
|
||||
|
||||
|
||||
+1
-1
@@ -1,2 +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:()=>P,getPlugin:()=>h,getPlugins:()=>y,registerPlugin:()=>f,unregisterPlugin:()=>w,usePluginContext:()=>c,withPluginContext:()=>p});const r=window.React;const t=window.wp.element,o=window.wp.hooks,i=window.wp.isShallowEqual;var l=e.n(i);const s=window.wp.compose,u=(0,t.createContext)({name:null,icon:null}),a=u.Provider;function c(){return(0,t.useContext)(u)}const p=e=>(0,s.createHigherOrderComponent)((n=>t=>(0,r.createElement)(u.Consumer,null,(o=>(0,r.createElement)(n,{...t,...e(o,t)})))),"withPluginContext");class g 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 d=window.wp.primitives,m=(0,r.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(d.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"})),v={};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;v[e]&&console.error(`Plugin "${e}" is already registered.`),n=(0,o.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 v[e]={name:e,icon:m,...n},(0,o.doAction)("plugins.pluginRegistered",n,e),n}function w(e){if(!v[e])return void console.error('Plugin "'+e+'" is not registered.');const n=v[e];return delete v[e],(0,o.doAction)("plugins.pluginUnregistered",n,e),n}function h(e){return v[e]}function y(e){return Object.values(v).filter((n=>n.scope===e))}const x=function(e,n){var r,t,o=0;function i(){var i,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(i=new Array(u),l=0;l<u;l++)i[l]=arguments[l];return s={args:i,val:e.apply(null,i)},r?(r.prev=s,s.next=r):t=s,o===n.maxSize?(t=t.prev).next=null:o++,r=s,s.val}return n=n||{},i.clear=function(){r=null,t=null,o=0},i}(((e,n)=>({icon:e,name:n})));const P=function({scope:e,onError:n}){const i=(0,t.useMemo)((()=>{let n=[];return{subscribe:e=>((0,o.addAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered",e),(0,o.addAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered",e),()=>{(0,o.removeAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered"),(0,o.removeAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered")}),getValue(){const r=y(e);return l()(n,r)||(n=r),n}}}),[e]),s=(0,t.useSyncExternalStore)(i.subscribe,i.getValue);return(0,r.createElement)("div",{style:{display:"none"}},s.map((({icon:e,name:t,render:o})=>(0,r.createElement)(a,{key:t,value:x(e,t)},(0,r.createElement)(g,{name:t,onError:n},(0,r.createElement)(o,null))))))};(window.wp=window.wp||{}).plugins=n})();
|
||||
(()=>{"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:()=>P,getPlugin:()=>w,getPlugins:()=>x,registerPlugin:()=>h,unregisterPlugin:()=>f,usePluginContext:()=>c,withPluginContext:()=>p});const r=window.wp.element,t=window.wp.hooks,o=window.wp.isShallowEqual;var i=e.n(o);const l=window.wp.compose,s=window.ReactJSXRuntime,u=(0,r.createContext)({name:null,icon:null}),a=u.Provider;function c(){return(0,r.useContext)(u)}const p=e=>(0,l.createHigherOrderComponent)((n=>r=>(0,s.jsx)(u.Consumer,{children:t=>(0,s.jsx)(n,{...r,...e(t,r)})})),"withPluginContext");class g extends r.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 d=window.wp.primitives,v=(0,s.jsx)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(d.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"})}),m={};function h(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;m[e]&&console.error(`Plugin "${e}" is already registered.`),n=(0,t.applyFilters)("plugins.registerPlugin",n,e);const{render:r,scope:o}=n;if("function"!=typeof r)return console.error('The "render" property must be specified and must be a valid function.'),null;if(o){if("string"!=typeof o)return console.error("Plugin scope must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(o))return console.error('Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'),null}return m[e]={name:e,icon:v,...n},(0,t.doAction)("plugins.pluginRegistered",n,e),n}function f(e){if(!m[e])return void console.error('Plugin "'+e+'" is not registered.');const n=m[e];return delete m[e],(0,t.doAction)("plugins.pluginUnregistered",n,e),n}function w(e){return m[e]}function x(e){return Object.values(m).filter((n=>n.scope===e))}const y=function(e,n){var r,t,o=0;function i(){var i,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(i=new Array(u),l=0;l<u;l++)i[l]=arguments[l];return s={args:i,val:e.apply(null,i)},r?(r.prev=s,s.next=r):t=s,o===n.maxSize?(t=t.prev).next=null:o++,r=s,s.val}return n=n||{},i.clear=function(){r=null,t=null,o=0},i}(((e,n)=>({icon:e,name:n})));const P=function({scope:e,onError:n}){const o=(0,r.useMemo)((()=>{let n=[];return{subscribe:e=>((0,t.addAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered",e),(0,t.addAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered",e),()=>{(0,t.removeAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered"),(0,t.removeAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered")}),getValue(){const r=x(e);return i()(n,r)||(n=r),n}}}),[e]),l=(0,r.useSyncExternalStore)(o.subscribe,o.getValue,o.getValue);return(0,s.jsx)("div",{style:{display:"none"},children:l.map((({icon:e,name:r,render:t})=>(0,s.jsx)(a,{value:y(e,r),children:(0,s.jsx)(g,{name:r,onError:n,children:(0,s.jsx)(t,{})})},r)))})};(window.wp=window.wp||{}).plugins=n})();
|
||||
+6
-6
@@ -747,17 +747,17 @@ function convertLegacyData(data) {
|
||||
from: 'core/edit-post',
|
||||
to: 'core/edit-post'
|
||||
}, 'editorMode');
|
||||
data = moveIndividualPreferenceToPreferences(data, {
|
||||
from: 'core/edit-post',
|
||||
to: 'core/edit-post'
|
||||
}, 'preferredStyleVariations');
|
||||
data = moveIndividualPreferenceToPreferences(data, {
|
||||
from: 'core/edit-post',
|
||||
to: 'core/edit-post'
|
||||
}, 'panels', convertEditPostPanels);
|
||||
data = moveIndividualPreferenceToPreferences(data, {
|
||||
from: 'core/editor',
|
||||
to: 'core/edit-post'
|
||||
to: 'core'
|
||||
}, 'isPublishSidebarEnabled');
|
||||
data = moveIndividualPreferenceToPreferences(data, {
|
||||
from: 'core/edit-post',
|
||||
to: 'core'
|
||||
}, 'isPublishSidebarEnabled');
|
||||
data = moveIndividualPreferenceToPreferences(data, {
|
||||
from: 'core/edit-site',
|
||||
@@ -810,7 +810,7 @@ function convertComplementaryAreas(state) {
|
||||
function convertEditorSettings(data) {
|
||||
var _newData$coreEditPo, _newData$coreEditSi;
|
||||
let newData = data;
|
||||
const settingsToMoveToCore = ['allowRightClickOverrides', 'distractionFree', 'editorMode', 'fixedToolbar', 'focusMode', 'hiddenBlockTypes', 'inactivePanels', 'keepCaretInsideBlock', 'mostUsedBlocks', 'openPanels', 'showBlockBreadcrumbs', 'showIconLabels', 'showListViewByDefault'];
|
||||
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] !== undefined) {
|
||||
newData = {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+145
-109
@@ -73,8 +73,6 @@ __webpack_require__.d(selectors_namespaceObject, {
|
||||
get: () => (get)
|
||||
});
|
||||
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: external ["wp","data"]
|
||||
const external_wp_data_namespaceObject = window["wp"]["data"];
|
||||
;// CONCATENATED MODULE: external ["wp","components"]
|
||||
@@ -83,18 +81,21 @@ const external_wp_components_namespaceObject = window["wp"]["components"];
|
||||
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
|
||||
;// CONCATENATED MODULE: external ["wp","primitives"]
|
||||
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const check = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const check = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
|
||||
}));
|
||||
viewBox: "0 0 24 24",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const library_check = (check);
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","a11y"]
|
||||
@@ -290,7 +291,7 @@ var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external
|
||||
*/
|
||||
|
||||
const withDeprecatedKeys = originalGet => (state, scope, name) => {
|
||||
const settingsToMoveToCore = ['allowRightClickOverrides', 'distractionFree', 'editorMode', 'fixedToolbar', 'focusMode', 'hiddenBlockTypes', 'inactivePanels', 'keepCaretInsideBlock', 'mostUsedBlocks', 'openPanels', 'showBlockBreadcrumbs', 'showIconLabels', 'showListViewByDefault'];
|
||||
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',
|
||||
@@ -353,7 +354,6 @@ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME,
|
||||
(0,external_wp_data_namespaceObject.register)(store);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/preferences/build-module/components/preference-toggle-menu-item/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -367,6 +367,7 @@ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME,
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
function PreferenceToggleMenuItem({
|
||||
scope,
|
||||
name,
|
||||
@@ -394,7 +395,7 @@ function PreferenceToggleMenuItem({
|
||||
(0,external_wp_a11y_namespaceObject.speak)(message);
|
||||
}
|
||||
};
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
|
||||
icon: isActive && library_check,
|
||||
isSelected: isActive,
|
||||
onClick: () => {
|
||||
@@ -407,19 +408,21 @@ function PreferenceToggleMenuItem({
|
||||
role: "menuitemcheckbox",
|
||||
info: info,
|
||||
shortcut: shortcut,
|
||||
disabled: disabled
|
||||
}, label);
|
||||
disabled: disabled,
|
||||
children: label
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/preferences/build-module/components/index.js
|
||||
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/preferences/build-module/components/preference-base-option/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function BaseOption({
|
||||
help,
|
||||
label,
|
||||
@@ -427,20 +430,20 @@ function BaseOption({
|
||||
onChange,
|
||||
children
|
||||
}) {
|
||||
return (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "preference-base-option"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
|
||||
__nextHasNoMarginBottom: true,
|
||||
help: help,
|
||||
label: label,
|
||||
checked: isChecked,
|
||||
onChange: 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: help,
|
||||
label: label,
|
||||
checked: isChecked,
|
||||
onChange: onChange
|
||||
}), children]
|
||||
});
|
||||
}
|
||||
/* harmony default export */ const preference_base_option = (BaseOption);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/preferences/build-module/components/preference-toggle-control/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -451,6 +454,7 @@ function BaseOption({
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function PreferenceToggleControl(props) {
|
||||
const {
|
||||
scope,
|
||||
@@ -466,7 +470,7 @@ function PreferenceToggleControl(props) {
|
||||
onToggle();
|
||||
toggle(scope, featureName);
|
||||
};
|
||||
return (0,external_React_namespaceObject.createElement)(preference_base_option, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(preference_base_option, {
|
||||
onChange: onChange,
|
||||
isChecked: isChecked,
|
||||
...remainingProps
|
||||
@@ -475,40 +479,47 @@ function PreferenceToggleControl(props) {
|
||||
/* harmony default export */ const preference_toggle_control = (PreferenceToggleControl);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/preferences/build-module/components/preferences-modal/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function PreferencesModal({
|
||||
closeModal,
|
||||
children
|
||||
}) {
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
|
||||
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);
|
||||
onRequestClose: closeModal,
|
||||
children: children
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/preferences/build-module/components/preferences-modal-section/index.js
|
||||
|
||||
|
||||
const Section = ({
|
||||
description,
|
||||
title,
|
||||
children
|
||||
}) => (0,external_React_namespaceObject.createElement)("fieldset", {
|
||||
className: "preferences-modal__section"
|
||||
}, (0,external_React_namespaceObject.createElement)("legend", {
|
||||
className: "preferences-modal__section-legend"
|
||||
}, (0,external_React_namespaceObject.createElement)("h2", {
|
||||
className: "preferences-modal__section-title"
|
||||
}, title), description && (0,external_React_namespaceObject.createElement)("p", {
|
||||
className: "preferences-modal__section-description"
|
||||
}, description)), (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "preferences-modal__section-content"
|
||||
}, 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: children
|
||||
})]
|
||||
});
|
||||
/* harmony default export */ const preferences_modal_section = (Section);
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","compose"]
|
||||
@@ -548,31 +559,33 @@ function Icon({
|
||||
/* harmony default export */ const icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon));
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const chevronLeft = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const chevronLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
|
||||
}));
|
||||
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"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const chevron_left = (chevronLeft);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const chevronRight = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const chevronRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
|
||||
}));
|
||||
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"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const chevron_right = (chevronRight);
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","privateApis"]
|
||||
@@ -585,10 +598,9 @@ const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
|
||||
const {
|
||||
lock,
|
||||
unlock
|
||||
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/preferences');
|
||||
} = (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');
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/preferences/build-module/components/preferences-modal-tabs/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -602,6 +614,8 @@ const {
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
const {
|
||||
Tabs
|
||||
} = unlock(external_wp_components_namespaceObject.privateApis);
|
||||
@@ -649,63 +663,85 @@ function PreferencesModalTabs({
|
||||
let modalContent;
|
||||
// We render different components based on the viewport size.
|
||||
if (isLargeViewport) {
|
||||
modalContent = (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "preferences__tabs"
|
||||
}, (0,external_React_namespaceObject.createElement)(Tabs, {
|
||||
initialTabId: activeMenu !== PREFERENCES_MENU ? activeMenu : undefined,
|
||||
onSelect: setActiveMenu,
|
||||
orientation: "vertical"
|
||||
}, (0,external_React_namespaceObject.createElement)(Tabs.TabList, {
|
||||
className: "preferences__tabs-tablist"
|
||||
}, tabs.map(tab => (0,external_React_namespaceObject.createElement)(Tabs.Tab, {
|
||||
tabId: tab.name,
|
||||
key: tab.name,
|
||||
className: "preferences__tabs-tab"
|
||||
}, tab.title))), tabs.map(tab => (0,external_React_namespaceObject.createElement)(Tabs.TabPanel, {
|
||||
tabId: tab.name,
|
||||
key: tab.name,
|
||||
className: "preferences__tabs-tabpanel",
|
||||
focusable: false
|
||||
}, sectionsContentMap[tab.name] || null))));
|
||||
modalContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
className: "preferences__tabs",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs, {
|
||||
defaultTabId: activeMenu !== PREFERENCES_MENU ? activeMenu : undefined,
|
||||
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 = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, {
|
||||
modalContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, {
|
||||
initialPath: "/",
|
||||
className: "preferences__provider"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
|
||||
path: "/"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Card, {
|
||||
isBorderless: true,
|
||||
size: "small"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.CardBody, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, tabs.map(tab => {
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorButton, {
|
||||
key: tab.name,
|
||||
path: tab.name,
|
||||
as: external_wp_components_namespaceObject.__experimentalItem,
|
||||
isAction: true
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
|
||||
justify: "space-between"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, null, tab.title)), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_React_namespaceObject.createElement)(icon, {
|
||||
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right
|
||||
}))));
|
||||
}))))), sections.length && sections.map(section => {
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
|
||||
key: `${section.name}-menu`,
|
||||
path: section.name
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Card, {
|
||||
isBorderless: true,
|
||||
size: "large"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.CardHeader, {
|
||||
isBorderless: false,
|
||||
justify: "left",
|
||||
size: "small",
|
||||
gap: "6"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorBackButton, {
|
||||
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left,
|
||||
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigate to the previous view')
|
||||
}), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
|
||||
size: "16"
|
||||
}, section.tabLabel)), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.CardBody, null, section.content)));
|
||||
}));
|
||||
className: "preferences__provider",
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
|
||||
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.__experimentalNavigatorButton, {
|
||||
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, {
|
||||
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right
|
||||
})
|
||||
})]
|
||||
})
|
||||
}, tab.name);
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
}), sections.length && sections.map(section => {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, {
|
||||
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.__experimentalNavigatorBackButton, {
|
||||
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left,
|
||||
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;
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+10
-115
@@ -1,111 +1,9 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ 5755:
|
||||
/***/ ((module, exports) => {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
||||
Copyright (c) 2018 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/
|
||||
/* global define */
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var hasOwn = {}.hasOwnProperty;
|
||||
var nativeCodeString = '[native code]';
|
||||
|
||||
function classNames() {
|
||||
var classes = [];
|
||||
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var arg = arguments[i];
|
||||
if (!arg) continue;
|
||||
|
||||
var argType = typeof arg;
|
||||
|
||||
if (argType === 'string' || argType === 'number') {
|
||||
classes.push(arg);
|
||||
} else if (Array.isArray(arg)) {
|
||||
if (arg.length) {
|
||||
var inner = classNames.apply(null, arg);
|
||||
if (inner) {
|
||||
classes.push(inner);
|
||||
}
|
||||
}
|
||||
} else if (argType === 'object') {
|
||||
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
||||
classes.push(arg.toString());
|
||||
continue;
|
||||
}
|
||||
|
||||
for (var key in arg) {
|
||||
if (hasOwn.call(arg, key) && arg[key]) {
|
||||
classes.push(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return classes.join(' ');
|
||||
}
|
||||
|
||||
if ( true && module.exports) {
|
||||
classNames.default = classNames;
|
||||
module.exports = classNames;
|
||||
} else if (true) {
|
||||
// register as 'classnames', consistent with npm package name
|
||||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
|
||||
return classNames;
|
||||
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
|
||||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
} else {}
|
||||
}());
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // 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;
|
||||
/******/ }
|
||||
/******/ "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
|
||||
@@ -136,9 +34,6 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
||||
(() => {
|
||||
"use strict";
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
@@ -160,11 +55,12 @@ __webpack_require__.d(__webpack_exports__, {
|
||||
View: () => (/* reexport */ View)
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
||||
var classnames = __webpack_require__(5755);
|
||||
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
||||
;// CONCATENATED MODULE: ./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);
|
||||
;// CONCATENATED MODULE: external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/primitives/build-module/svg/index.js
|
||||
/**
|
||||
* External dependencies
|
||||
@@ -183,6 +79,7 @@ const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
*
|
||||
* @return {JSX.Element} Circle component
|
||||
*/
|
||||
|
||||
const Circle = props => (0,external_wp_element_namespaceObject.createElement)('circle', props);
|
||||
|
||||
/**
|
||||
@@ -262,7 +159,7 @@ const SVG = (0,external_wp_element_namespaceObject.forwardRef)(
|
||||
}, ref) => {
|
||||
const appliedProps = {
|
||||
...props,
|
||||
className: classnames_default()(className, {
|
||||
className: dist_clsx(className, {
|
||||
'is-pressed': isPressed
|
||||
}) || undefined,
|
||||
'aria-hidden': true,
|
||||
@@ -271,7 +168,7 @@ const SVG = (0,external_wp_element_namespaceObject.forwardRef)(
|
||||
|
||||
// Disable reason: We need to have a way to render HTML tag for web.
|
||||
// eslint-disable-next-line react/forbid-elements
|
||||
return (0,external_wp_element_namespaceObject.createElement)("svg", {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("svg", {
|
||||
...appliedProps,
|
||||
ref: ref
|
||||
});
|
||||
@@ -293,8 +190,6 @@ const View = 'div';
|
||||
|
||||
|
||||
|
||||
})();
|
||||
|
||||
(window.wp = window.wp || {}).primitives = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+1
-6
@@ -1,7 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{var e={5755:(e,t)=>{var r;
|
||||
/*!
|
||||
Copyright (c) 2018 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)){if(r.length){var i=o.apply(null,r);i&&e.push(i)}}else if("object"===a){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){e.push(r.toString());continue}for(var l in r)n.call(r,l)&&r[l]&&e.push(l)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},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]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{BlockQuotation:()=>g,Circle:()=>a,Defs:()=>d,G:()=>i,HorizontalRule:()=>y,Line:()=>l,LinearGradient:()=>f,Path:()=>s,Polygon:()=>c,RadialGradient:()=>u,Rect:()=>p,SVG:()=>m,Stop:()=>v,View:()=>b});var e=r(5755),t=r.n(e);const o=window.wp.element,a=e=>(0,o.createElement)("circle",e),i=e=>(0,o.createElement)("g",e),l=e=>(0,o.createElement)("line",e),s=e=>(0,o.createElement)("path",e),c=e=>(0,o.createElement)("polygon",e),p=e=>(0,o.createElement)("rect",e),d=e=>(0,o.createElement)("defs",e),u=e=>(0,o.createElement)("radialGradient",e),f=e=>(0,o.createElement)("linearGradient",e),v=e=>(0,o.createElement)("stop",e),m=(0,o.forwardRef)((({className:e,isPressed:r,...n},a)=>{const i={...n,className:t()(e,{"is-pressed":r})||void 0,"aria-hidden":!0,focusable:!1};return(0,o.createElement)("svg",{...i,ref:a})}));m.displayName="SVG";const y="hr",g="blockquote",b="div"})(),(window.wp=window.wp||{}).primitives=n})();
|
||||
(()=>{"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={};function r(e){var t,n,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]&&(n=r(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}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 n=function(){for(var e,t,n=0,o="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=r(e))&&(o&&(o+=" "),o+=t);return o},o=window.wp.element,a=window.ReactJSXRuntime,i=e=>(0,o.createElement)("circle",e),l=e=>(0,o.createElement)("g",e),c=e=>(0,o.createElement)("line",e),s=e=>(0,o.createElement)("path",e),d=e=>(0,o.createElement)("polygon",e),f=e=>(0,o.createElement)("rect",e),m=e=>(0,o.createElement)("defs",e),p=e=>(0,o.createElement)("radialGradient",e),u=e=>(0,o.createElement)("linearGradient",e),y=e=>(0,o.createElement)("stop",e),w=(0,o.forwardRef)((({className:e,isPressed:t,...r},o)=>{const i={...r,className:n(e,{"is-pressed":t})||void 0,"aria-hidden":!0,focusable:!1};return(0,a.jsx)("svg",{...i,ref:o})}));w.displayName="SVG";const b="hr",g="blockquote",v="div";(window.wp=window.wp||{}).primitives=t})();
|
||||
+1
-1
@@ -78,7 +78,7 @@ const registeredPrivateApis = [];
|
||||
* WITHOUT NOTICE. THIS CHANGE WILL BREAK EXISTING THIRD-PARTY CODE. SUCH A
|
||||
* CHANGE MAY OCCUR IN EITHER A MAJOR OR MINOR RELEASE.
|
||||
*/
|
||||
const requiredConsent = 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.';
|
||||
const requiredConsent = 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.';
|
||||
|
||||
/** @type {boolean} */
|
||||
let allowReRegistration;
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={d:(r,o)=>{for(var s in o)e.o(o,s)&&!e.o(r,s)&&Object.defineProperty(r,s,{enumerable:!0,get:o[s]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{__dangerousOptInToUnstableAPIsOnlyForCoreModules:()=>n});const o=["@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/commands","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/format-library","@wordpress/interface","@wordpress/patterns","@wordpress/preferences","@wordpress/reusable-blocks","@wordpress/router","@wordpress/dataviews"],s=[];let t;try{t=!1}catch(e){t=!0}const n=(e,r)=>{if(!o.includes(r))throw new Error(`You tried to opt-in to unstable APIs as module "${r}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if(!t&&s.includes(r))throw new Error(`You tried to opt-in to unstable APIs as module "${r}" which is already registered. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress."!==e)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return s.push(r),{lock:i,unlock:a}};function i(e,r){if(!e)throw new Error("Cannot lock an undefined object.");l in e||(e[l]={}),d.set(e[l],r)}function a(e){if(!e)throw new Error("Cannot unlock an undefined object.");if(!(l in e))throw new Error("Cannot unlock an object that was not locked before. ");return d.get(e[l])}const d=new WeakMap,l=Symbol("Private API ID");(window.wp=window.wp||{}).privateApis=r})();
|
||||
(()=>{"use strict";var e={d:(r,o)=>{for(var s in o)e.o(o,s)&&!e.o(r,s)&&Object.defineProperty(r,s,{enumerable:!0,get:o[s]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{__dangerousOptInToUnstableAPIsOnlyForCoreModules:()=>n});const o=["@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/commands","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/format-library","@wordpress/interface","@wordpress/patterns","@wordpress/preferences","@wordpress/reusable-blocks","@wordpress/router","@wordpress/dataviews"],s=[];let t;try{t=!1}catch(e){t=!0}const n=(e,r)=>{if(!o.includes(r))throw new Error(`You tried to opt-in to unstable APIs as module "${r}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if(!t&&s.includes(r))throw new Error(`You tried to opt-in to unstable APIs as module "${r}" which is already registered. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."!==e)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return s.push(r),{lock:i,unlock:d}};function i(e,r){if(!e)throw new Error("Cannot lock an undefined object.");l in e||(e[l]={}),a.set(e[l],r)}function d(e){if(!e)throw new Error("Cannot unlock an undefined object.");if(!(l in e))throw new Error("Cannot unlock an object that was not locked before. ");return a.get(e[l])}const a=new WeakMap,l=Symbol("Private API ID");(window.wp=window.wp||{}).privateApis=r})();
|
||||
+2
-2
@@ -265,7 +265,7 @@ exports["default"] = [call, cps];
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1508:
|
||||
/***/ 9127:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
@@ -372,7 +372,7 @@ Object.keys(_helpers).forEach(function (key) {
|
||||
});
|
||||
});
|
||||
|
||||
var _create = __webpack_require__(1508);
|
||||
var _create = __webpack_require__(9127);
|
||||
|
||||
var _create2 = _interopRequireDefault(_create);
|
||||
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+98
-76
@@ -221,26 +221,27 @@ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME,
|
||||
});
|
||||
(0,external_wp_data_namespaceObject.register)(store);
|
||||
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// CONCATENATED MODULE: external ["wp","components"]
|
||||
const external_wp_components_namespaceObject = window["wp"]["components"];
|
||||
;// CONCATENATED MODULE: external ["wp","primitives"]
|
||||
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const symbol = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(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"
|
||||
}));
|
||||
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"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const library_symbol = (symbol);
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","notices"]
|
||||
@@ -256,10 +257,9 @@ const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
|
||||
|
||||
const {
|
||||
unlock
|
||||
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/reusable-blocks');
|
||||
} = (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/reusable-blocks');
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/components/reusable-blocks-menu-items/reusable-block-convert-button.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -278,6 +278,9 @@ const {
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const {
|
||||
useReusableBlocksRenameHint,
|
||||
ReusableBlocksRenameHint
|
||||
@@ -357,57 +360,65 @@ function ReusableBlockConvertButton({
|
||||
if (!canConvert) {
|
||||
return null;
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
||||
icon: library_symbol,
|
||||
onClick: () => setIsModalOpen(true)
|
||||
}, showRenameHint ? (0,external_wp_i18n_namespaceObject.__)('Create pattern/reusable block') : (0,external_wp_i18n_namespaceObject.__)('Create pattern')), isModalOpen && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Create pattern'),
|
||||
onRequestClose: () => {
|
||||
setIsModalOpen(false);
|
||||
setTitle('');
|
||||
},
|
||||
overlayClassName: "reusable-blocks-menu-items__convert-modal"
|
||||
}, (0,external_React_namespaceObject.createElement)("form", {
|
||||
onSubmit: event => {
|
||||
event.preventDefault();
|
||||
onConvert(title);
|
||||
setIsModalOpen(false);
|
||||
setTitle('');
|
||||
onClose();
|
||||
}
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
|
||||
spacing: "5"
|
||||
}, (0,external_React_namespaceObject.createElement)(ReusableBlocksRenameHint, null), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
|
||||
__nextHasNoMarginBottom: true,
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Name'),
|
||||
value: title,
|
||||
onChange: setTitle,
|
||||
placeholder: (0,external_wp_i18n_namespaceObject.__)('My pattern')
|
||||
}), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
|
||||
label: (0,external_wp_i18n_namespaceObject._x)('Synced', 'Option that makes an individual pattern synchronized'),
|
||||
help: (0,external_wp_i18n_namespaceObject.__)('Sync this pattern across multiple locations.'),
|
||||
checked: !syncType,
|
||||
onChange: () => {
|
||||
setSyncType(!syncType ? 'unsynced' : undefined);
|
||||
}
|
||||
}), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
|
||||
justify: "right"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
variant: "tertiary",
|
||||
onClick: () => {
|
||||
setIsModalOpen(false);
|
||||
setTitle('');
|
||||
}
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
variant: "primary",
|
||||
type: "submit"
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Create')))))));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
|
||||
icon: library_symbol,
|
||||
onClick: () => setIsModalOpen(true),
|
||||
children: showRenameHint ? (0,external_wp_i18n_namespaceObject.__)('Create pattern/reusable block') : (0,external_wp_i18n_namespaceObject.__)('Create pattern')
|
||||
}), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Create pattern'),
|
||||
onRequestClose: () => {
|
||||
setIsModalOpen(false);
|
||||
setTitle('');
|
||||
},
|
||||
overlayClassName: "reusable-blocks-menu-items__convert-modal",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
|
||||
onSubmit: event => {
|
||||
event.preventDefault();
|
||||
onConvert(title);
|
||||
setIsModalOpen(false);
|
||||
setTitle('');
|
||||
onClose();
|
||||
},
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
|
||||
spacing: "5",
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReusableBlocksRenameHint, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
|
||||
__nextHasNoMarginBottom: true,
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Name'),
|
||||
value: title,
|
||||
onChange: setTitle,
|
||||
placeholder: (0,external_wp_i18n_namespaceObject.__)('My pattern')
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
|
||||
label: (0,external_wp_i18n_namespaceObject._x)('Synced', 'pattern (singular)'),
|
||||
help: (0,external_wp_i18n_namespaceObject.__)('Sync this pattern across multiple locations.'),
|
||||
checked: !syncType,
|
||||
onChange: () => {
|
||||
setSyncType(!syncType ? 'unsynced' : undefined);
|
||||
}
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
|
||||
justify: "right",
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
|
||||
variant: "tertiary",
|
||||
onClick: () => {
|
||||
setIsModalOpen(false);
|
||||
setTitle('');
|
||||
},
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
|
||||
variant: "primary",
|
||||
type: "submit",
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('Create')
|
||||
})]
|
||||
})]
|
||||
})
|
||||
})
|
||||
})]
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","url"]
|
||||
const external_wp_url_namespaceObject = window["wp"]["url"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/components/reusable-blocks-menu-items/reusable-blocks-manage-button.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -423,6 +434,9 @@ const external_wp_url_namespaceObject = window["wp"]["url"];
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
function ReusableBlocksManageButton({
|
||||
clientId
|
||||
}) {
|
||||
@@ -434,14 +448,12 @@ function ReusableBlocksManageButton({
|
||||
const {
|
||||
getBlock,
|
||||
canRemoveBlock,
|
||||
getBlockCount,
|
||||
getSettings
|
||||
getBlockCount
|
||||
} = select(external_wp_blockEditor_namespaceObject.store);
|
||||
const {
|
||||
canUser
|
||||
} = select(external_wp_coreData_namespaceObject.store);
|
||||
const reusableBlock = getBlock(clientId);
|
||||
const isBlockTheme = getSettings().__unstableIsBlockBasedTheme;
|
||||
return {
|
||||
canRemove: canRemoveBlock(clientId),
|
||||
isVisible: !!reusableBlock && (0,external_wp_blocks_namespaceObject.isReusableBlock)(reusableBlock) && !!canUser('update', 'blocks', reusableBlock.attributes.ref),
|
||||
@@ -449,7 +461,7 @@ function ReusableBlocksManageButton({
|
||||
// The site editor and templates both check whether the user
|
||||
// has edit_theme_options capabilities. We can leverage that here
|
||||
// and omit the manage patterns link if the user can't access it.
|
||||
managePatternsUrl: isBlockTheme && canUser('read', 'templates') ? (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', {
|
||||
managePatternsUrl: canUser('create', 'templates') ? (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', {
|
||||
path: '/patterns'
|
||||
}) : (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
|
||||
post_type: 'wp_block'
|
||||
@@ -462,16 +474,19 @@ function ReusableBlocksManageButton({
|
||||
if (!isVisible) {
|
||||
return null;
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
||||
href: managePatternsUrl
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Manage patterns')), canRemove && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
|
||||
onClick: () => convertBlockToStatic(clientId)
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Detach')));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
|
||||
href: managePatternsUrl,
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('Manage patterns')
|
||||
}), canRemove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
|
||||
onClick: () => convertBlockToStatic(clientId),
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('Detach')
|
||||
})]
|
||||
});
|
||||
}
|
||||
/* harmony default export */ const reusable_blocks_manage_button = (ReusableBlocksManageButton);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/components/reusable-blocks-menu-items/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -482,19 +497,26 @@ function ReusableBlocksManageButton({
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function ReusableBlocksMenuItems({
|
||||
rootClientId
|
||||
}) {
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, null, ({
|
||||
onClose,
|
||||
selectedClientIds
|
||||
}) => (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(ReusableBlockConvertButton, {
|
||||
clientIds: selectedClientIds,
|
||||
rootClientId: rootClientId,
|
||||
onClose: onClose
|
||||
}), selectedClientIds.length === 1 && (0,external_React_namespaceObject.createElement)(reusable_blocks_manage_button, {
|
||||
clientId: selectedClientIds[0]
|
||||
})));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, {
|
||||
children: ({
|
||||
onClose,
|
||||
selectedClientIds
|
||||
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReusableBlockConvertButton, {
|
||||
clientIds: selectedClientIds,
|
||||
rootClientId: rootClientId,
|
||||
onClose: onClose
|
||||
}), selectedClientIds.length === 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(reusable_blocks_manage_button, {
|
||||
clientId: selectedClientIds[0]
|
||||
})]
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/components/index.js
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+482
-775
File diff suppressed because it is too large
Load Diff
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+52
-32
@@ -42,8 +42,6 @@ __webpack_require__.d(__webpack_exports__, {
|
||||
privateApis: () => (/* reexport */ privateApis)
|
||||
});
|
||||
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
||||
@@ -866,24 +864,57 @@ const external_wp_url_namespaceObject = window["wp"]["url"];
|
||||
const history_history = createBrowserHistory();
|
||||
const originalHistoryPush = history_history.push;
|
||||
const originalHistoryReplace = history_history.replace;
|
||||
|
||||
// Preserve the `wp_theme_preview` query parameter when navigating
|
||||
// around the Site Editor.
|
||||
// TODO: move this hack out of the router into Site Editor code.
|
||||
function preserveThemePreview(params) {
|
||||
if (params.hasOwnProperty('wp_theme_preview')) {
|
||||
return params;
|
||||
}
|
||||
const currentSearch = new URLSearchParams(history_history.location.search);
|
||||
const currentThemePreview = currentSearch.get('wp_theme_preview');
|
||||
if (currentThemePreview === null) {
|
||||
return params;
|
||||
}
|
||||
return {
|
||||
...params,
|
||||
wp_theme_preview: currentThemePreview
|
||||
};
|
||||
}
|
||||
function push(params, state) {
|
||||
const currentArgs = (0,external_wp_url_namespaceObject.getQueryArgs)(window.location.href);
|
||||
const currentUrlWithoutArgs = (0,external_wp_url_namespaceObject.removeQueryArgs)(window.location.href, ...Object.keys(currentArgs));
|
||||
const newUrl = (0,external_wp_url_namespaceObject.addQueryArgs)(currentUrlWithoutArgs, params);
|
||||
return originalHistoryPush.call(history_history, newUrl, state);
|
||||
const search = (0,external_wp_url_namespaceObject.buildQueryString)(preserveThemePreview(params));
|
||||
return originalHistoryPush.call(history_history, {
|
||||
search
|
||||
}, state);
|
||||
}
|
||||
function replace(params, state) {
|
||||
const currentArgs = (0,external_wp_url_namespaceObject.getQueryArgs)(window.location.href);
|
||||
const currentUrlWithoutArgs = (0,external_wp_url_namespaceObject.removeQueryArgs)(window.location.href, ...Object.keys(currentArgs));
|
||||
const newUrl = (0,external_wp_url_namespaceObject.addQueryArgs)(currentUrlWithoutArgs, params);
|
||||
return originalHistoryReplace.call(history_history, newUrl, state);
|
||||
const search = (0,external_wp_url_namespaceObject.buildQueryString)(preserveThemePreview(params));
|
||||
return originalHistoryReplace.call(history_history, {
|
||||
search
|
||||
}, state);
|
||||
}
|
||||
const locationMemo = new WeakMap();
|
||||
function getLocationWithParams() {
|
||||
const location = history_history.location;
|
||||
let locationWithParams = locationMemo.get(location);
|
||||
if (!locationWithParams) {
|
||||
locationWithParams = {
|
||||
...location,
|
||||
params: Object.fromEntries(new URLSearchParams(location.search))
|
||||
};
|
||||
locationMemo.set(location, locationWithParams);
|
||||
}
|
||||
return locationWithParams;
|
||||
}
|
||||
history_history.push = push;
|
||||
history_history.replace = replace;
|
||||
history_history.getLocationWithParams = getLocationWithParams;
|
||||
/* harmony default export */ const build_module_history = (history_history);
|
||||
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/router/build-module/router.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -893,6 +924,7 @@ history_history.replace = replace;
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
const RoutesContext = (0,external_wp_element_namespaceObject.createContext)();
|
||||
const HistoryContext = (0,external_wp_element_namespaceObject.createContext)();
|
||||
function useLocation() {
|
||||
@@ -901,29 +933,17 @@ function useLocation() {
|
||||
function useHistory() {
|
||||
return (0,external_wp_element_namespaceObject.useContext)(HistoryContext);
|
||||
}
|
||||
function getLocationWithParams(location) {
|
||||
const searchParams = new URLSearchParams(location.search);
|
||||
return {
|
||||
...location,
|
||||
params: Object.fromEntries(searchParams.entries())
|
||||
};
|
||||
}
|
||||
function RouterProvider({
|
||||
children
|
||||
}) {
|
||||
const [location, setLocation] = (0,external_wp_element_namespaceObject.useState)(() => getLocationWithParams(build_module_history.location));
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
return build_module_history.listen(({
|
||||
location: updatedLocation
|
||||
}) => {
|
||||
setLocation(getLocationWithParams(updatedLocation));
|
||||
});
|
||||
}, []);
|
||||
return (0,external_React_namespaceObject.createElement)(HistoryContext.Provider, {
|
||||
value: build_module_history
|
||||
}, (0,external_React_namespaceObject.createElement)(RoutesContext.Provider, {
|
||||
value: location
|
||||
}, children));
|
||||
const location = (0,external_wp_element_namespaceObject.useSyncExternalStore)(build_module_history.listen, build_module_history.getLocationWithParams, build_module_history.getLocationWithParams);
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(HistoryContext.Provider, {
|
||||
value: build_module_history,
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RoutesContext.Provider, {
|
||||
value: location,
|
||||
children: children
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","privateApis"]
|
||||
@@ -936,7 +956,7 @@ const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
|
||||
const {
|
||||
lock,
|
||||
unlock
|
||||
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/router');
|
||||
} = (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/router');
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/router/build-module/private-apis.js
|
||||
/**
|
||||
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[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,{privateApis:()=>S});const n=window.React,r=window.wp.element;function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}var a;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(a||(a={}));var u=function(e){return e};var i="beforeunload",c="popstate";function s(e){e.preventDefault(),e.returnValue=""}function l(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function f(){return Math.random().toString(36).substr(2,8)}function h(e){var t=e.pathname,n=void 0===t?"/":t,r=e.search,o=void 0===r?"":r,a=e.hash,u=void 0===a?"":a;return o&&"?"!==o&&(n+="?"===o.charAt(0)?o:"?"+o),u&&"#"!==u&&(n+="#"===u.charAt(0)?u:"#"+u),n}function d(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}const p=window.wp.url,v=function(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,r=n.history;function p(){var e=n.location,t=e.pathname,o=e.search,a=e.hash,i=r.state||{};return[i.idx,u({pathname:t,search:o,hash:a,state:i.usr||null,key:i.key||"default"})]}var v=null;n.addEventListener(c,(function(){if(v)P.call(v),v=null;else{var e=a.Pop,t=p(),n=t[0],r=t[1];if(P.length){if(null!=n){var o=g-n;o&&(v={action:e,location:r,retry:function(){x(-1*o)}},x(o))}}else j(e)}}));var w=a.Pop,y=p(),g=y[0],b=y[1],m=l(),P=l();function O(e){return"string"==typeof e?e:h(e)}function k(e,t){return void 0===t&&(t=null),u(o({pathname:b.pathname,hash:"",search:""},"string"==typeof e?d(e):e,{state:t,key:f()}))}function A(e,t){return[{usr:e.state,key:e.key,idx:t},O(e)]}function S(e,t,n){return!P.length||(P.call({action:e,location:t,retry:n}),!1)}function j(e){w=e;var t=p();g=t[0],b=t[1],m.call({action:w,location:b})}function x(e){r.go(e)}null==g&&(g=0,r.replaceState(o({},r.state,{idx:g}),""));var E={get action(){return w},get location(){return b},createHref:O,push:function e(t,o){var u=a.Push,i=k(t,o);if(S(u,i,(function(){e(t,o)}))){var c=A(i,g+1),s=c[0],l=c[1];try{r.pushState(s,"",l)}catch(e){n.location.assign(l)}j(u)}},replace:function e(t,n){var o=a.Replace,u=k(t,n);if(S(o,u,(function(){e(t,n)}))){var i=A(u,g),c=i[0],s=i[1];r.replaceState(c,"",s),j(o)}},go:x,back:function(){x(-1)},forward:function(){x(1)},listen:function(e){return m.push(e)},block:function(e){var t=P.push(e);return 1===P.length&&n.addEventListener(i,s),function(){t(),P.length||n.removeEventListener(i,s)}}};return E}(),w=v.push,y=v.replace;v.push=function(e,t){const n=(0,p.getQueryArgs)(window.location.href),r=(0,p.removeQueryArgs)(window.location.href,...Object.keys(n)),o=(0,p.addQueryArgs)(r,e);return w.call(v,o,t)},v.replace=function(e,t){const n=(0,p.getQueryArgs)(window.location.href),r=(0,p.removeQueryArgs)(window.location.href,...Object.keys(n)),o=(0,p.addQueryArgs)(r,e);return y.call(v,o,t)};const g=v,b=(0,r.createContext)(),m=(0,r.createContext)();function P(e){const t=new URLSearchParams(e.search);return{...e,params:Object.fromEntries(t.entries())}}const O=window.wp.privateApis,{lock:k,unlock:A}=(0,O.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/router"),S={};k(S,{useHistory:function(){return(0,r.useContext)(m)},useLocation:function(){return(0,r.useContext)(b)},RouterProvider:function({children:e}){const[t,o]=(0,r.useState)((()=>P(g.location)));return(0,r.useEffect)((()=>g.listen((({location:e})=>{o(P(e))}))),[]),(0,n.createElement)(m.Provider,{value:g},(0,n.createElement)(b.Provider,{value:t},e))}}),(window.wp=window.wp||{}).router=t})();
|
||||
(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{privateApis:()=>j});const n=window.wp.element;function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},r.apply(this,arguments)}var o;!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(o||(o={}));var a=function(t){return t};var i="beforeunload",u="popstate";function c(t){t.preventDefault(),t.returnValue=""}function s(){var t=[];return{get length(){return t.length},push:function(e){return t.push(e),function(){t=t.filter((function(t){return t!==e}))}},call:function(e){t.forEach((function(t){return t&&t(e)}))}}}function l(){return Math.random().toString(36).substr(2,8)}function f(t){var e=t.pathname,n=void 0===e?"/":e,r=t.search,o=void 0===r?"":r,a=t.hash,i=void 0===a?"":a;return o&&"?"!==o&&(n+="?"===o.charAt(0)?o:"?"+o),i&&"#"!==i&&(n+="#"===i.charAt(0)?i:"#"+i),n}function h(t){var e={};if(t){var n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));var r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}const p=window.wp.url,d=function(t){void 0===t&&(t={});var e=t.window,n=void 0===e?document.defaultView:e,p=n.history;function d(){var t=n.location,e=t.pathname,r=t.search,o=t.hash,i=p.state||{};return[i.idx,a({pathname:e,search:r,hash:o,state:i.usr||null,key:i.key||"default"})]}var v=null;n.addEventListener(u,(function(){if(v)P.call(v),v=null;else{var t=o.Pop,e=d(),n=e[0],r=e[1];if(P.length){if(null!=n){var a=y-n;a&&(v={action:t,location:r,retry:function(){L(-1*a)}},L(a))}}else j(t)}}));var w=o.Pop,g=d(),y=g[0],m=g[1],b=s(),P=s();function S(t){return"string"==typeof t?t:f(t)}function O(t,e){return void 0===e&&(e=null),a(r({pathname:m.pathname,hash:"",search:""},"string"==typeof t?h(t):t,{state:e,key:l()}))}function x(t,e){return[{usr:t.state,key:t.key,idx:e},S(t)]}function k(t,e,n){return!P.length||(P.call({action:t,location:e,retry:n}),!1)}function j(t){w=t;var e=d();y=e[0],m=e[1],b.call({action:w,location:m})}function L(t){p.go(t)}null==y&&(y=0,p.replaceState(r({},p.state,{idx:y}),""));var _={get action(){return w},get location(){return m},createHref:S,push:function t(e,r){var a=o.Push,i=O(e,r);if(k(a,i,(function(){t(e,r)}))){var u=x(i,y+1),c=u[0],s=u[1];try{p.pushState(c,"",s)}catch(t){n.location.assign(s)}j(a)}},replace:function t(e,n){var r=o.Replace,a=O(e,n);if(k(r,a,(function(){t(e,n)}))){var i=x(a,y),u=i[0],c=i[1];p.replaceState(u,"",c),j(r)}},go:L,back:function(){L(-1)},forward:function(){L(1)},listen:function(t){return b.push(t)},block:function(t){var e=P.push(t);return 1===P.length&&n.addEventListener(i,c),function(){e(),P.length||n.removeEventListener(i,c)}}};return _}(),v=d.push,w=d.replace;function g(t){if(t.hasOwnProperty("wp_theme_preview"))return t;const e=new URLSearchParams(d.location.search).get("wp_theme_preview");return null===e?t:{...t,wp_theme_preview:e}}const y=new WeakMap;d.push=function(t,e){const n=(0,p.buildQueryString)(g(t));return v.call(d,{search:n},e)},d.replace=function(t,e){const n=(0,p.buildQueryString)(g(t));return w.call(d,{search:n},e)},d.getLocationWithParams=function(){const t=d.location;let e=y.get(t);return e||(e={...t,params:Object.fromEntries(new URLSearchParams(t.search))},y.set(t,e)),e};const m=d,b=window.ReactJSXRuntime,P=(0,n.createContext)(),S=(0,n.createContext)();const O=window.wp.privateApis,{lock:x,unlock:k}=(0,O.__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/router"),j={};x(j,{useHistory:function(){return(0,n.useContext)(S)},useLocation:function(){return(0,n.useContext)(P)},RouterProvider:function({children:t}){const e=(0,n.useSyncExternalStore)(m.listen,m.getLocationWithParams,m.getLocationWithParams);return(0,b.jsx)(S.Provider,{value:m,children:(0,b.jsx)(P.Provider,{value:e,children:t})})}}),(window.wp=window.wp||{}).router=e})();
|
||||
+59
-54
@@ -147,8 +147,6 @@ __webpack_require__.d(__webpack_exports__, {
|
||||
"default": () => (/* binding */ build_module)
|
||||
});
|
||||
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: external ["wp","element"]
|
||||
const external_wp_element_namespaceObject = window["wp"]["element"];
|
||||
;// CONCATENATED MODULE: external ["wp","data"]
|
||||
@@ -169,8 +167,9 @@ const external_wp_url_namespaceObject = window["wp"]["url"];
|
||||
const external_wp_components_namespaceObject = window["wp"]["components"];
|
||||
;// CONCATENATED MODULE: external ["wp","blocks"]
|
||||
const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/server-side-render/build-module/server-side-render.js
|
||||
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
@@ -186,6 +185,8 @@ const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const EMPTY_OBJECT = {};
|
||||
function rendererPath(block, attributes = null, urlQueryArgs = {}) {
|
||||
return (0,external_wp_url_namespaceObject.addQueryArgs)(`/wp/v2/block-renderer/${block}`, {
|
||||
@@ -223,9 +224,10 @@ function removeBlockSupportAttributes(attributes) {
|
||||
function DefaultEmptyResponsePlaceholder({
|
||||
className
|
||||
}) {
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
|
||||
className: className
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Block rendered as empty.'));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
|
||||
className: className,
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('Block rendered as empty.')
|
||||
});
|
||||
}
|
||||
function DefaultErrorResponsePlaceholder({
|
||||
response,
|
||||
@@ -234,31 +236,35 @@ function DefaultErrorResponsePlaceholder({
|
||||
const errorMessage = (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
// translators: %s: error message describing the problem
|
||||
(0,external_wp_i18n_namespaceObject.__)('Error loading block: %s'), response.errorMsg);
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
|
||||
className: className
|
||||
}, errorMessage);
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
|
||||
className: className,
|
||||
children: errorMessage
|
||||
});
|
||||
}
|
||||
function DefaultLoadingResponsePlaceholder({
|
||||
children,
|
||||
showLoader
|
||||
}) {
|
||||
return (0,external_React_namespaceObject.createElement)("div", {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
|
||||
style: {
|
||||
position: 'relative'
|
||||
}
|
||||
}, showLoader && (0,external_React_namespaceObject.createElement)("div", {
|
||||
style: {
|
||||
position: 'absolute',
|
||||
top: '50%',
|
||||
left: '50%',
|
||||
marginTop: '-9px',
|
||||
marginLeft: '-9px'
|
||||
}
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), (0,external_React_namespaceObject.createElement)("div", {
|
||||
style: {
|
||||
opacity: showLoader ? '0.3' : 1
|
||||
}
|
||||
}, children));
|
||||
},
|
||||
children: [showLoader && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
style: {
|
||||
position: 'absolute',
|
||||
top: '50%',
|
||||
left: '50%',
|
||||
marginTop: '-9px',
|
||||
marginLeft: '-9px'
|
||||
},
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
style: {
|
||||
opacity: showLoader ? '0.3' : 1
|
||||
},
|
||||
children: children
|
||||
})]
|
||||
});
|
||||
}
|
||||
function ServerSideRender(props) {
|
||||
const {
|
||||
@@ -272,7 +278,7 @@ function ServerSideRender(props) {
|
||||
ErrorResponsePlaceholder = DefaultErrorResponsePlaceholder,
|
||||
LoadingResponsePlaceholder = DefaultLoadingResponsePlaceholder
|
||||
} = props;
|
||||
const isMountedRef = (0,external_wp_element_namespaceObject.useRef)(true);
|
||||
const isMountedRef = (0,external_wp_element_namespaceObject.useRef)(false);
|
||||
const [showLoader, setShowLoader] = (0,external_wp_element_namespaceObject.useState)(false);
|
||||
const fetchRequestRef = (0,external_wp_element_namespaceObject.useRef)();
|
||||
const [response, setResponse] = (0,external_wp_element_namespaceObject.useState)(null);
|
||||
@@ -284,6 +290,11 @@ function ServerSideRender(props) {
|
||||
return;
|
||||
}
|
||||
setIsLoading(true);
|
||||
|
||||
// Schedule showing the Spinner after 1 second.
|
||||
const timeout = setTimeout(() => {
|
||||
setShowLoader(true);
|
||||
}, 1000);
|
||||
let sanitizedAttributes = attributes && (0,external_wp_blocks_namespaceObject.__experimentalSanitizeBlockAttributes)(block, attributes);
|
||||
if (skipBlockSupportAttributes) {
|
||||
sanitizedAttributes = removeBlockSupportAttributes(sanitizedAttributes);
|
||||
@@ -318,6 +329,9 @@ function ServerSideRender(props) {
|
||||
}).finally(() => {
|
||||
if (isMountedRef.current && fetchRequest === fetchRequestRef.current) {
|
||||
setIsLoading(false);
|
||||
// Cancel the timeout to show the Spinner.
|
||||
setShowLoader(false);
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
});
|
||||
return fetchRequest;
|
||||
@@ -326,8 +340,11 @@ function ServerSideRender(props) {
|
||||
|
||||
// When the component unmounts, set isMountedRef to false. This will
|
||||
// let the async fetch callbacks know when to stop.
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => () => {
|
||||
isMountedRef.current = false;
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
isMountedRef.current = true;
|
||||
return () => {
|
||||
isMountedRef.current = false;
|
||||
};
|
||||
}, []);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
// Don't debounce the first fetch. This ensures that the first render
|
||||
@@ -338,50 +355,37 @@ function ServerSideRender(props) {
|
||||
debouncedFetchData();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Effect to handle showing the loading placeholder.
|
||||
* Show it only if there is no previous response or
|
||||
* the request takes more than one second.
|
||||
*/
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
if (!isLoading) {
|
||||
return;
|
||||
}
|
||||
const timeout = setTimeout(() => {
|
||||
setShowLoader(true);
|
||||
}, 1000);
|
||||
return () => clearTimeout(timeout);
|
||||
}, [isLoading]);
|
||||
const hasResponse = !!response;
|
||||
const hasEmptyResponse = response === '';
|
||||
const hasError = response?.error;
|
||||
if (isLoading) {
|
||||
return (0,external_React_namespaceObject.createElement)(LoadingResponsePlaceholder, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LoadingResponsePlaceholder, {
|
||||
...props,
|
||||
showLoader: showLoader
|
||||
}, hasResponse && (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, {
|
||||
className: className
|
||||
}, response));
|
||||
showLoader: showLoader,
|
||||
children: hasResponse && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, {
|
||||
className: className,
|
||||
children: response
|
||||
})
|
||||
});
|
||||
}
|
||||
if (hasEmptyResponse || !hasResponse) {
|
||||
return (0,external_React_namespaceObject.createElement)(EmptyResponsePlaceholder, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EmptyResponsePlaceholder, {
|
||||
...props
|
||||
});
|
||||
}
|
||||
if (hasError) {
|
||||
return (0,external_React_namespaceObject.createElement)(ErrorResponsePlaceholder, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ErrorResponsePlaceholder, {
|
||||
response: response,
|
||||
...props
|
||||
});
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, {
|
||||
className: className
|
||||
}, response);
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, {
|
||||
className: className,
|
||||
children: response
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/server-side-render/build-module/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -396,6 +400,7 @@ function ServerSideRender(props) {
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const build_module_EMPTY_OBJECT = {};
|
||||
const ExportedServerSideRender = (0,external_wp_data_namespaceObject.withSelect)(select => {
|
||||
// FIXME: @wordpress/server-side-render should not depend on @wordpress/editor.
|
||||
@@ -429,7 +434,7 @@ const ExportedServerSideRender = (0,external_wp_data_namespaceObject.withSelect)
|
||||
...urlQueryArgs
|
||||
};
|
||||
}, [currentPostId, urlQueryArgs]);
|
||||
return (0,external_React_namespaceObject.createElement)(ServerSideRender, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ServerSideRender, {
|
||||
urlQueryArgs: newUrlQueryArgs,
|
||||
...props
|
||||
});
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
(()=>{"use strict";var e={7734:e=>{e.exports=function e(r,t){if(r===t)return!0;if(r&&t&&"object"==typeof r&&"object"==typeof t){if(r.constructor!==t.constructor)return!1;var n,o,s;if(Array.isArray(r)){if((n=r.length)!=t.length)return!1;for(o=n;0!=o--;)if(!e(r[o],t[o]))return!1;return!0}if(r instanceof Map&&t instanceof Map){if(r.size!==t.size)return!1;for(o of r.entries())if(!t.has(o[0]))return!1;for(o of r.entries())if(!e(o[1],t.get(o[0])))return!1;return!0}if(r instanceof Set&&t instanceof Set){if(r.size!==t.size)return!1;for(o of r.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(r)&&ArrayBuffer.isView(t)){if((n=r.length)!=t.length)return!1;for(o=n;0!=o--;)if(r[o]!==t[o])return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if((n=(s=Object.keys(r)).length)!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=n;0!=o--;){var u=s[o];if(!e(r[u],t[u]))return!1}return!0}return r!=r&&t!=t}}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var s=r[n]={exports:{}};return e[n](s,s.exports,t),s.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var n={};(()=>{t.d(n,{default:()=>b});const e=window.React,r=window.wp.element,o=window.wp.data;var s=t(7734),u=t.n(s);const i=window.wp.compose,c=window.wp.i18n,a=window.wp.apiFetch;var l=t.n(a);const f=window.wp.url,p=window.wp.components,d=window.wp.blocks,w={};function m({className:r}){return(0,e.createElement)(p.Placeholder,{className:r},(0,c.__)("Block rendered as empty."))}function y({response:r,className:t}){const n=(0,c.sprintf)((0,c.__)("Error loading block: %s"),r.errorMsg);return(0,e.createElement)(p.Placeholder,{className:t},n)}function g({children:r,showLoader:t}){return(0,e.createElement)("div",{style:{position:"relative"}},t&&(0,e.createElement)("div",{style:{position:"absolute",top:"50%",left:"50%",marginTop:"-9px",marginLeft:"-9px"}},(0,e.createElement)(p.Spinner,null)),(0,e.createElement)("div",{style:{opacity:t?"0.3":1}},r))}function h(t){const{attributes:n,block:o,className:s,httpMethod:c="GET",urlQueryArgs:a,skipBlockSupportAttributes:p=!1,EmptyResponsePlaceholder:h=m,ErrorResponsePlaceholder:v=y,LoadingResponsePlaceholder:b=g}=t,E=(0,r.useRef)(!0),[S,O]=(0,r.useState)(!1),P=(0,r.useRef)(),[k,x]=(0,r.useState)(null),A=(0,i.usePrevious)(t),[R,j]=(0,r.useState)(!1);function M(){var e,r;if(!E.current)return;j(!0);let t=n&&(0,d.__experimentalSanitizeBlockAttributes)(o,n);p&&(t=function(e){const{backgroundColor:r,borderColor:t,fontFamily:n,fontSize:o,gradient:s,textColor:u,className:i,...c}=e,{border:a,color:l,elements:f,spacing:p,typography:d,...m}=e?.style||w;return{...c,style:m}}(t));const s="POST"===c,u=s?null:null!==(e=t)&&void 0!==e?e:null,i=function(e,r=null,t={}){return(0,f.addQueryArgs)(`/wp/v2/block-renderer/${e}`,{context:"edit",...null!==r?{attributes:r}:{},...t})}(o,u,a),m=s?{attributes:null!==(r=t)&&void 0!==r?r:null}:null,y=P.current=l()({path:i,data:m,method:s?"POST":"GET"}).then((e=>{E.current&&y===P.current&&e&&x(e.rendered)})).catch((e=>{E.current&&y===P.current&&x({error:!0,errorMsg:e.message})})).finally((()=>{E.current&&y===P.current&&j(!1)}));return y}const T=(0,i.useDebounce)(M,500);(0,r.useEffect)((()=>()=>{E.current=!1}),[]),(0,r.useEffect)((()=>{void 0===A?M():u()(A,t)||T()})),(0,r.useEffect)((()=>{if(!R)return;const e=setTimeout((()=>{O(!0)}),1e3);return()=>clearTimeout(e)}),[R]);const _=!!k,N=""===k,z=k?.error;return R?(0,e.createElement)(b,{...t,showLoader:S},_&&(0,e.createElement)(r.RawHTML,{className:s},k)):N||!_?(0,e.createElement)(h,{...t}):z?(0,e.createElement)(v,{response:k,...t}):(0,e.createElement)(r.RawHTML,{className:s},k)}const v={},b=(0,o.withSelect)((e=>{const r=e("core/editor");if(r){const e=r.getCurrentPostId();if(e&&"number"==typeof e)return{currentPostId:e}}return v}))((({urlQueryArgs:t=v,currentPostId:n,...o})=>{const s=(0,r.useMemo)((()=>n?{post_id:n,...t}:t),[n,t]);return(0,e.createElement)(h,{urlQueryArgs:s,...o})}))})(),(window.wp=window.wp||{}).serverSideRender=n.default})();
|
||||
(()=>{"use strict";var e={7734:e=>{e.exports=function e(r,t){if(r===t)return!0;if(r&&t&&"object"==typeof r&&"object"==typeof t){if(r.constructor!==t.constructor)return!1;var n,o,s;if(Array.isArray(r)){if((n=r.length)!=t.length)return!1;for(o=n;0!=o--;)if(!e(r[o],t[o]))return!1;return!0}if(r instanceof Map&&t instanceof Map){if(r.size!==t.size)return!1;for(o of r.entries())if(!t.has(o[0]))return!1;for(o of r.entries())if(!e(o[1],t.get(o[0])))return!1;return!0}if(r instanceof Set&&t instanceof Set){if(r.size!==t.size)return!1;for(o of r.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(r)&&ArrayBuffer.isView(t)){if((n=r.length)!=t.length)return!1;for(o=n;0!=o--;)if(r[o]!==t[o])return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if((n=(s=Object.keys(r)).length)!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=n;0!=o--;){var i=s[o];if(!e(r[i],t[i]))return!1}return!0}return r!=r&&t!=t}}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var s=r[n]={exports:{}};return e[n](s,s.exports,t),s.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var n={};(()=>{t.d(n,{default:()=>b});const e=window.wp.element,r=window.wp.data;var o=t(7734),s=t.n(o);const i=window.wp.compose,u=window.wp.i18n,c=window.wp.apiFetch;var l=t.n(c);const a=window.wp.url,f=window.wp.components,d=window.wp.blocks,p=window.ReactJSXRuntime,w={};function h({className:e}){return(0,p.jsx)(f.Placeholder,{className:e,children:(0,u.__)("Block rendered as empty.")})}function y({response:e,className:r}){const t=(0,u.sprintf)((0,u.__)("Error loading block: %s"),e.errorMsg);return(0,p.jsx)(f.Placeholder,{className:r,children:t})}function g({children:e,showLoader:r}){return(0,p.jsxs)("div",{style:{position:"relative"},children:[r&&(0,p.jsx)("div",{style:{position:"absolute",top:"50%",left:"50%",marginTop:"-9px",marginLeft:"-9px"},children:(0,p.jsx)(f.Spinner,{})}),(0,p.jsx)("div",{style:{opacity:r?"0.3":1},children:e})]})}function m(r){const{attributes:t,block:n,className:o,httpMethod:u="GET",urlQueryArgs:c,skipBlockSupportAttributes:f=!1,EmptyResponsePlaceholder:m=h,ErrorResponsePlaceholder:v=y,LoadingResponsePlaceholder:b=g}=r,x=(0,e.useRef)(!1),[j,S]=(0,e.useState)(!1),O=(0,e.useRef)(),[P,k]=(0,e.useState)(null),R=(0,i.usePrevious)(r),[A,M]=(0,e.useState)(!1);function T(){var e,r;if(!x.current)return;M(!0);const o=setTimeout((()=>{S(!0)}),1e3);let s=t&&(0,d.__experimentalSanitizeBlockAttributes)(n,t);f&&(s=function(e){const{backgroundColor:r,borderColor:t,fontFamily:n,fontSize:o,gradient:s,textColor:i,className:u,...c}=e,{border:l,color:a,elements:f,spacing:d,typography:p,...h}=e?.style||w;return{...c,style:h}}(s));const i="POST"===u,p=i?null:null!==(e=s)&&void 0!==e?e:null,h=function(e,r=null,t={}){return(0,a.addQueryArgs)(`/wp/v2/block-renderer/${e}`,{context:"edit",...null!==r?{attributes:r}:{},...t})}(n,p,c),y=i?{attributes:null!==(r=s)&&void 0!==r?r:null}:null,g=O.current=l()({path:h,data:y,method:i?"POST":"GET"}).then((e=>{x.current&&g===O.current&&e&&k(e.rendered)})).catch((e=>{x.current&&g===O.current&&k({error:!0,errorMsg:e.message})})).finally((()=>{x.current&&g===O.current&&(M(!1),S(!1),clearTimeout(o))}));return g}const _=(0,i.useDebounce)(T,500);(0,e.useEffect)((()=>(x.current=!0,()=>{x.current=!1})),[]),(0,e.useEffect)((()=>{void 0===R?T():s()(R,r)||_()}));const E=!!P,N=""===P,z=P?.error;return A?(0,p.jsx)(b,{...r,showLoader:j,children:E&&(0,p.jsx)(e.RawHTML,{className:o,children:P})}):N||!E?(0,p.jsx)(m,{...r}):z?(0,p.jsx)(v,{response:P,...r}):(0,p.jsx)(e.RawHTML,{className:o,children:P})}const v={},b=(0,r.withSelect)((e=>{const r=e("core/editor");if(r){const e=r.getCurrentPostId();if(e&&"number"==typeof e)return{currentPostId:e}}return v}))((({urlQueryArgs:r=v,currentPostId:t,...n})=>{const o=(0,e.useMemo)((()=>t?{post_id:t,...r}:r),[t,r]);return(0,p.jsx)(m,{urlQueryArgs:o,...n})}))})(),(window.wp=window.wp||{}).serverSideRender=n.default})();
|
||||
+12
-34
@@ -826,33 +826,27 @@ const backgroundImage = {
|
||||
name: 'backgroundImage',
|
||||
generate: (style, options) => {
|
||||
const _backgroundImage = style?.background?.backgroundImage;
|
||||
const _backgroundSize = style?.background?.backgroundSize;
|
||||
const styleRules = [];
|
||||
if (!_backgroundImage) {
|
||||
return styleRules;
|
||||
}
|
||||
if (_backgroundImage?.source === 'file' && _backgroundImage?.url) {
|
||||
styleRules.push({
|
||||
if (typeof _backgroundImage === 'object' && _backgroundImage?.url) {
|
||||
return [{
|
||||
selector: options.selector,
|
||||
key: 'backgroundImage',
|
||||
// Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
|
||||
value: `url( '${encodeURI(safeDecodeURI(_backgroundImage.url))}' )`
|
||||
});
|
||||
}];
|
||||
}
|
||||
|
||||
// If no background size is set, but an image is, default to cover.
|
||||
if (_backgroundSize === undefined) {
|
||||
styleRules.push({
|
||||
selector: options.selector,
|
||||
key: 'backgroundSize',
|
||||
value: 'cover'
|
||||
});
|
||||
/*
|
||||
* If the background image is a string, it could already contain a url() function,
|
||||
* or have a linear-gradient value.
|
||||
*/
|
||||
if (typeof _backgroundImage === 'string') {
|
||||
return generateRule(style, options, ['background', 'backgroundImage'], 'backgroundImage');
|
||||
}
|
||||
return styleRules;
|
||||
return [];
|
||||
}
|
||||
};
|
||||
const backgroundPosition = {
|
||||
name: 'backgroundRepeat',
|
||||
name: 'backgroundPosition',
|
||||
generate: (style, options) => {
|
||||
return generateRule(style, options, ['background', 'backgroundPosition'], 'backgroundPosition');
|
||||
}
|
||||
@@ -866,23 +860,7 @@ const backgroundRepeat = {
|
||||
const backgroundSize = {
|
||||
name: 'backgroundSize',
|
||||
generate: (style, options) => {
|
||||
const _backgroundSize = style?.background?.backgroundSize;
|
||||
const _backgroundPosition = style?.background?.backgroundPosition;
|
||||
const styleRules = [];
|
||||
if (_backgroundSize === undefined) {
|
||||
return styleRules;
|
||||
}
|
||||
styleRules.push(...generateRule(style, options, ['background', 'backgroundSize'], 'backgroundSize'));
|
||||
|
||||
// If background size is set to contain, but no position is set, default to center.
|
||||
if (_backgroundSize === 'contain' && _backgroundPosition === undefined) {
|
||||
styleRules.push({
|
||||
selector: options.selector,
|
||||
key: 'backgroundPosition',
|
||||
value: 'center'
|
||||
});
|
||||
}
|
||||
return styleRules;
|
||||
return generateRule(style, options, ['background', 'backgroundSize'], 'backgroundSize');
|
||||
}
|
||||
};
|
||||
/* harmony default export */ const styles_background = ([backgroundImage, backgroundPosition, backgroundRepeat, backgroundSize]);
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+9
-2
@@ -891,8 +891,12 @@ function getPathAndQueryString(url) {
|
||||
const path = getPath(url);
|
||||
const queryString = getQueryString(url);
|
||||
let value = '/';
|
||||
if (path) value += path;
|
||||
if (queryString) value += `?${queryString}`;
|
||||
if (path) {
|
||||
value += path;
|
||||
}
|
||||
if (queryString) {
|
||||
value += `?${queryString}`;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -1326,6 +1330,9 @@ function cleanForSlug(string) {
|
||||
*/
|
||||
function getFilename(url) {
|
||||
let filename;
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
filename = new URL(url, 'http://example.com').pathname.split('/').pop();
|
||||
} catch (error) {}
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+97
-29868
File diff suppressed because one or more lines are too long
+2
-10
File diff suppressed because one or more lines are too long
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
|
||||
/*! For license information please see react-jsx-runtime.min.js.LICENSE.txt */
|
||||
(()=>{"use strict";var r={20:(r,e,t)=>{var o=t(594),n=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,f=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function _(r,e,t){var o,s={},_=null,i=null;for(o in void 0!==t&&(_=""+t),void 0!==e.key&&(_=""+e.key),void 0!==e.ref&&(i=e.ref),e)a.call(e,o)&&!p.hasOwnProperty(o)&&(s[o]=e[o]);if(r&&r.defaultProps)for(o in e=r.defaultProps)void 0===s[o]&&(s[o]=e[o]);return{$$typeof:n,type:r,key:_,ref:i,props:s,_owner:f.current}}e.Fragment=s,e.jsx=_,e.jsxs=_},848:(r,e,t)=>{r.exports=t(20)},594:r=>{r.exports=React}},e={},t=function t(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={exports:{}};return r[o](s,s.exports,t),s.exports}(848);window.ReactJSXRuntime=t})();
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
+80
-3341
File diff suppressed because one or more lines are too long
+2
-10
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
Vendored
+4
-4
@@ -215,10 +215,9 @@ const addDimensionsEventListener = (breakpoints, operators) => {
|
||||
};
|
||||
/* harmony default export */ const listener = (addDimensionsEventListener);
|
||||
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/viewport/build-module/with-viewport-match.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -247,6 +246,7 @@ const external_React_namespaceObject = window["React"];
|
||||
*
|
||||
* @return {Function} Higher-order component.
|
||||
*/
|
||||
|
||||
const withViewportMatch = queries => {
|
||||
const queryEntries = Object.entries(queries);
|
||||
const useViewPortQueriesResult = () => Object.fromEntries(queryEntries.map(([key, query]) => {
|
||||
@@ -264,7 +264,7 @@ const withViewportMatch = queries => {
|
||||
return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => {
|
||||
return (0,external_wp_compose_namespaceObject.pure)(props => {
|
||||
const queriesResult = useViewPortQueriesResult();
|
||||
return (0,external_React_namespaceObject.createElement)(WrappedComponent, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
|
||||
...props,
|
||||
...queriesResult
|
||||
});
|
||||
|
||||
+1
-1
@@ -1,2 +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,{ifViewportMatches:()=>h,store:()=>d,withViewportMatch:()=>u});var r={};e.r(r),e.d(r,{setIsMatching:()=>a});var o={};e.r(o),e.d(o,{isViewportMatch:()=>s});const n=window.wp.compose,i=window.wp.data;const c=function(e={},t){return"SET_IS_MATCHING"===t.type?t.values:e};function a(e){return{type:"SET_IS_MATCHING",values:e}}function s(e,t){return-1===t.indexOf(" ")&&(t=">= "+t),!!e[t]}const d=(0,i.createReduxStore)("core/viewport",{reducer:c,actions:r,selectors:o});(0,i.register)(d);const p=(e,t)=>{const r=(0,n.debounce)((()=>{const e=Object.fromEntries(c.map((([e,t])=>[e,t.matches])));(0,i.dispatch)(d).setIsMatching(e)}),0,{leading:!0}),o=Object.entries(t),c=Object.entries(e).flatMap((([e,t])=>o.map((([o,n])=>{const i=window.matchMedia(`(${n}: ${t}px)`);return i.addEventListener("change",r),[`${o} ${e}`,i]}))));window.addEventListener("orientationchange",r),r(),r.flush()},w=window.React,u=e=>{const t=Object.entries(e);return(0,n.createHigherOrderComponent)((e=>(0,n.pure)((r=>{const o=Object.fromEntries(t.map((([e,t])=>{let[r,o]=t.split(" ");return void 0===o&&(o=r,r=">="),[e,(0,n.useViewportMatch)(o,r)]})));return(0,w.createElement)(e,{...r,...o})}))),"withViewportMatch")},h=e=>(0,n.createHigherOrderComponent)((0,n.compose)([u({isViewportMatch:e}),(0,n.ifCondition)((e=>e.isViewportMatch))]),"ifViewportMatches");p({huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},{"<":"max-width",">=":"min-width"}),(window.wp=window.wp||{}).viewport=t})();
|
||||
(()=>{"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,{ifViewportMatches:()=>h,store:()=>d,withViewportMatch:()=>u});var r={};e.r(r),e.d(r,{setIsMatching:()=>a});var o={};e.r(o),e.d(o,{isViewportMatch:()=>s});const i=window.wp.compose,n=window.wp.data;const c=function(e={},t){return"SET_IS_MATCHING"===t.type?t.values:e};function a(e){return{type:"SET_IS_MATCHING",values:e}}function s(e,t){return-1===t.indexOf(" ")&&(t=">= "+t),!!e[t]}const d=(0,n.createReduxStore)("core/viewport",{reducer:c,actions:r,selectors:o});(0,n.register)(d);const p=(e,t)=>{const r=(0,i.debounce)((()=>{const e=Object.fromEntries(c.map((([e,t])=>[e,t.matches])));(0,n.dispatch)(d).setIsMatching(e)}),0,{leading:!0}),o=Object.entries(t),c=Object.entries(e).flatMap((([e,t])=>o.map((([o,i])=>{const n=window.matchMedia(`(${i}: ${t}px)`);return n.addEventListener("change",r),[`${o} ${e}`,n]}))));window.addEventListener("orientationchange",r),r(),r.flush()},w=window.ReactJSXRuntime,u=e=>{const t=Object.entries(e);return(0,i.createHigherOrderComponent)((e=>(0,i.pure)((r=>{const o=Object.fromEntries(t.map((([e,t])=>{let[r,o]=t.split(" ");return void 0===o&&(o=r,r=">="),[e,(0,i.useViewportMatch)(o,r)]})));return(0,w.jsx)(e,{...r,...o})}))),"withViewportMatch")},h=e=>(0,i.createHigherOrderComponent)((0,i.compose)([u({isViewportMatch:e}),(0,i.ifCondition)((e=>e.isViewportMatch))]),"ifViewportMatches");p({huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},{"<":"max-width",">=":"min-width"}),(window.wp=window.wp||{}).viewport=t})();
|
||||
Vendored
+2
-1
@@ -44,7 +44,8 @@ const logged = new Set();
|
||||
*/
|
||||
|
||||
function isDev() {
|
||||
return true && true === true;
|
||||
// eslint-disable-next-line @wordpress/wp-global-usage
|
||||
return true === true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+298
-318
@@ -1,97 +1,7 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ 5755:
|
||||
/***/ ((module, exports) => {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
||||
Copyright (c) 2018 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/
|
||||
/* global define */
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var hasOwn = {}.hasOwnProperty;
|
||||
var nativeCodeString = '[native code]';
|
||||
|
||||
function classNames() {
|
||||
var classes = [];
|
||||
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var arg = arguments[i];
|
||||
if (!arg) continue;
|
||||
|
||||
var argType = typeof arg;
|
||||
|
||||
if (argType === 'string' || argType === 'number') {
|
||||
classes.push(arg);
|
||||
} else if (Array.isArray(arg)) {
|
||||
if (arg.length) {
|
||||
var inner = classNames.apply(null, arg);
|
||||
if (inner) {
|
||||
classes.push(inner);
|
||||
}
|
||||
}
|
||||
} else if (argType === 'object') {
|
||||
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
||||
classes.push(arg.toString());
|
||||
continue;
|
||||
}
|
||||
|
||||
for (var key in arg) {
|
||||
if (hasOwn.call(arg, key) && arg[key]) {
|
||||
classes.push(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return classes.join(' ');
|
||||
}
|
||||
|
||||
if ( true && module.exports) {
|
||||
classNames.default = classNames;
|
||||
module.exports = classNames;
|
||||
} else if (true) {
|
||||
// register as 'classnames', consistent with npm package name
|
||||
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
|
||||
return classNames;
|
||||
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
|
||||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
} else {}
|
||||
}());
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // 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;
|
||||
/******/ }
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat get default export */
|
||||
@@ -136,9 +46,6 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
||||
(() => {
|
||||
"use strict";
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
@@ -172,43 +79,44 @@ __webpack_require__.d(widget_group_namespaceObject, {
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","blocks"]
|
||||
const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
|
||||
;// CONCATENATED MODULE: external "React"
|
||||
const external_React_namespaceObject = window["React"];
|
||||
;// CONCATENATED MODULE: external ["wp","primitives"]
|
||||
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
|
||||
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
||||
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/widget.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const widget = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const widget = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M6 3H8V5H16V3H18V5C19.1046 5 20 5.89543 20 7V19C20 20.1046 19.1046 21 18 21H6C4.89543 21 4 20.1046 4 19V7C4 5.89543 4.89543 5 6 5V3ZM18 6.5H6C5.72386 6.5 5.5 6.72386 5.5 7V8H18.5V7C18.5 6.72386 18.2761 6.5 18 6.5ZM18.5 9.5H5.5V19C5.5 19.2761 5.72386 19.5 6 19.5H18C18.2761 19.5 18.5 19.2761 18.5 19V9.5ZM11 11H13V13H11V11ZM7 11V13H9V11H7ZM15 13V11H17V13H15Z"
|
||||
}));
|
||||
viewBox: "0 0 24 24",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M6 3H8V5H16V3H18V5C19.1046 5 20 5.89543 20 7V19C20 20.1046 19.1046 21 18 21H6C4.89543 21 4 20.1046 4 19V7C4 5.89543 4.89543 5 6 5V3ZM18 6.5H6C5.72386 6.5 5.5 6.72386 5.5 7V8H18.5V7C18.5 6.72386 18.2761 6.5 18 6.5ZM18.5 9.5H5.5V19C5.5 19.2761 5.72386 19.5 6 19.5H18C18.2761 19.5 18.5 19.2761 18.5 19V9.5ZM11 11H13V13H11V11ZM7 11V13H9V11H7ZM15 13V11H17V13H15Z"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const library_widget = (widget);
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
||||
var classnames = __webpack_require__(5755);
|
||||
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
||||
;// CONCATENATED MODULE: ./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);
|
||||
;// CONCATENATED MODULE: external ["wp","blockEditor"]
|
||||
const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
|
||||
;// CONCATENATED MODULE: external ["wp","components"]
|
||||
const external_wp_components_namespaceObject = window["wp"]["components"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/brush.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const brush = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const brush = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(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"
|
||||
}));
|
||||
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"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const library_brush = (brush);
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","i18n"]
|
||||
@@ -220,7 +128,6 @@ const external_wp_data_namespaceObject = window["wp"]["data"];
|
||||
;// CONCATENATED MODULE: external ["wp","coreData"]
|
||||
const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/widget-type-selector.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -229,6 +136,7 @@ const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
|
||||
|
||||
|
||||
|
||||
|
||||
function WidgetTypeSelector({
|
||||
selectedId,
|
||||
onSelect
|
||||
@@ -241,12 +149,12 @@ function WidgetTypeSelector({
|
||||
})?.filter(widgetType => !hiddenIds.includes(widgetType.id));
|
||||
}, []);
|
||||
if (!widgetTypes) {
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null);
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {});
|
||||
}
|
||||
if (widgetTypes.length === 0) {
|
||||
return (0,external_wp_i18n_namespaceObject.__)('There are no widgets available.');
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
|
||||
__nextHasNoMarginBottom: true,
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Select a legacy widget to display:'),
|
||||
value: selectedId !== null && selectedId !== void 0 ? selectedId : '',
|
||||
@@ -275,15 +183,20 @@ function WidgetTypeSelector({
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/inspector-card.js
|
||||
|
||||
|
||||
function InspectorCard({
|
||||
name,
|
||||
description
|
||||
}) {
|
||||
return (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "wp-block-legacy-widget-inspector-card"
|
||||
}, (0,external_React_namespaceObject.createElement)("h3", {
|
||||
className: "wp-block-legacy-widget-inspector-card__name"
|
||||
}, name), (0,external_React_namespaceObject.createElement)("span", null, description));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
|
||||
className: "wp-block-legacy-widget-inspector-card",
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", {
|
||||
className: "wp-block-legacy-widget-inspector-card__name",
|
||||
children: name
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
|
||||
children: description
|
||||
})]
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","notices"]
|
||||
@@ -704,7 +617,6 @@ function serializeForm(form) {
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/form.js
|
||||
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
@@ -722,6 +634,8 @@ function serializeForm(form) {
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function Form({
|
||||
title,
|
||||
isVisible,
|
||||
@@ -775,36 +689,40 @@ function Form({
|
||||
};
|
||||
}, [id, idBase, instance, onChangeInstance, onChangeHasPreview, isMediumLargeViewport]);
|
||||
if (isWide && isMediumLargeViewport) {
|
||||
return (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: classnames_default()({
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
|
||||
className: dist_clsx({
|
||||
'wp-block-legacy-widget__container': isVisible
|
||||
})
|
||||
}, isVisible && (0,external_React_namespaceObject.createElement)("h3", {
|
||||
className: "wp-block-legacy-widget__edit-form-title"
|
||||
}, title), (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
|
||||
focusOnMount: false,
|
||||
placement: "right",
|
||||
offset: 32,
|
||||
resize: false,
|
||||
flip: false,
|
||||
shift: true
|
||||
}, (0,external_React_namespaceObject.createElement)("div", {
|
||||
ref: ref,
|
||||
className: "wp-block-legacy-widget__edit-form",
|
||||
hidden: !isVisible
|
||||
})));
|
||||
}),
|
||||
children: [isVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", {
|
||||
className: "wp-block-legacy-widget__edit-form-title",
|
||||
children: title
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, {
|
||||
focusOnMount: false,
|
||||
placement: "right",
|
||||
offset: 32,
|
||||
resize: false,
|
||||
flip: false,
|
||||
shift: true,
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
ref: ref,
|
||||
className: "wp-block-legacy-widget__edit-form",
|
||||
hidden: !isVisible
|
||||
})
|
||||
})]
|
||||
});
|
||||
}
|
||||
return (0,external_React_namespaceObject.createElement)("div", {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
ref: ref,
|
||||
className: "wp-block-legacy-widget__edit-form",
|
||||
hidden: !isVisible
|
||||
}, (0,external_React_namespaceObject.createElement)("h3", {
|
||||
className: "wp-block-legacy-widget__edit-form-title"
|
||||
}, title));
|
||||
hidden: !isVisible,
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", {
|
||||
className: "wp-block-legacy-widget__edit-form-title",
|
||||
children: title
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/preview.js
|
||||
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
@@ -818,6 +736,9 @@ function Form({
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function Preview({
|
||||
idBase,
|
||||
instance,
|
||||
@@ -891,44 +812,56 @@ function Preview({
|
||||
iframe.removeEventListener('load', setHeight);
|
||||
};
|
||||
}, [isLoaded]);
|
||||
return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, isVisible && !isLoaded && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: classnames_default()('wp-block-legacy-widget__edit-preview', {
|
||||
'is-offscreen': !isVisible || !isLoaded
|
||||
})
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_React_namespaceObject.createElement)("iframe", {
|
||||
ref: ref,
|
||||
className: "wp-block-legacy-widget__edit-preview-iframe",
|
||||
tabIndex: "-1",
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Legacy Widget Preview'),
|
||||
srcDoc: srcDoc,
|
||||
onLoad: event => {
|
||||
// To hide the scrollbars of the preview frame for some edge cases,
|
||||
// such as negative margins in the Gallery Legacy Widget.
|
||||
// It can't be scrolled anyway.
|
||||
// TODO: Ideally, this should be fixed in core.
|
||||
event.target.contentDocument.body.style.overflow = 'hidden';
|
||||
setIsLoaded(true);
|
||||
},
|
||||
height: 100
|
||||
}))));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [isVisible && !isLoaded && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
className: dist_clsx('wp-block-legacy-widget__edit-preview', {
|
||||
'is-offscreen': !isVisible || !isLoaded
|
||||
}),
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, {
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("iframe", {
|
||||
ref: ref,
|
||||
className: "wp-block-legacy-widget__edit-preview-iframe",
|
||||
tabIndex: "-1",
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Legacy Widget Preview'),
|
||||
srcDoc: srcDoc,
|
||||
onLoad: event => {
|
||||
// To hide the scrollbars of the preview frame for some edge cases,
|
||||
// such as negative margins in the Gallery Legacy Widget.
|
||||
// It can't be scrolled anyway.
|
||||
// TODO: Ideally, this should be fixed in core.
|
||||
event.target.contentDocument.body.style.overflow = 'hidden';
|
||||
setIsLoaded(true);
|
||||
},
|
||||
height: 100
|
||||
})
|
||||
})
|
||||
})]
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/no-preview.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function NoPreview({
|
||||
name
|
||||
}) {
|
||||
return (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "wp-block-legacy-widget__edit-no-preview"
|
||||
}, name && (0,external_React_namespaceObject.createElement)("h3", null, name), (0,external_React_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('No preview available.')));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
|
||||
className: "wp-block-legacy-widget__edit-no-preview",
|
||||
children: [name && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", {
|
||||
children: name
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('No preview available.')
|
||||
})]
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/convert-to-blocks-button.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -937,6 +870,7 @@ function NoPreview({
|
||||
|
||||
|
||||
|
||||
|
||||
function ConvertToBlocksButton({
|
||||
clientId,
|
||||
rawInstance
|
||||
@@ -944,7 +878,7 @@ function ConvertToBlocksButton({
|
||||
const {
|
||||
replaceBlocks
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
|
||||
onClick: () => {
|
||||
if (rawInstance.title) {
|
||||
replaceBlocks(clientId, [(0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
|
||||
@@ -957,12 +891,12 @@ function ConvertToBlocksButton({
|
||||
HTML: rawInstance.text
|
||||
}));
|
||||
}
|
||||
}
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Convert to blocks'));
|
||||
},
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('Convert to blocks')
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/edit/index.js
|
||||
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
@@ -988,6 +922,9 @@ function ConvertToBlocksButton({
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function Edit(props) {
|
||||
const {
|
||||
id,
|
||||
@@ -997,17 +934,18 @@ function Edit(props) {
|
||||
isWide = false
|
||||
} = props;
|
||||
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
|
||||
className: classnames_default()({
|
||||
className: dist_clsx({
|
||||
'is-wide-widget': isWide
|
||||
})
|
||||
});
|
||||
return (0,external_React_namespaceObject.createElement)("div", {
|
||||
...blockProps
|
||||
}, !id && !idBase ? (0,external_React_namespaceObject.createElement)(Empty, {
|
||||
...props
|
||||
}) : (0,external_React_namespaceObject.createElement)(NotEmpty, {
|
||||
...props
|
||||
}));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
...blockProps,
|
||||
children: !id && !idBase ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Empty, {
|
||||
...props
|
||||
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NotEmpty, {
|
||||
...props
|
||||
})
|
||||
});
|
||||
}
|
||||
function Empty({
|
||||
attributes: {
|
||||
@@ -1016,38 +954,43 @@ function Empty({
|
||||
},
|
||||
setAttributes
|
||||
}) {
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
|
||||
icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
|
||||
icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, {
|
||||
icon: library_brush
|
||||
}),
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Legacy Widget')
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexBlock, null, (0,external_React_namespaceObject.createElement)(WidgetTypeSelector, {
|
||||
selectedId: id !== null && id !== void 0 ? id : idBase,
|
||||
onSelect: ({
|
||||
selectedId,
|
||||
isMulti
|
||||
}) => {
|
||||
if (!selectedId) {
|
||||
setAttributes({
|
||||
id: null,
|
||||
idBase: null,
|
||||
instance: null
|
||||
});
|
||||
} else if (isMulti) {
|
||||
setAttributes({
|
||||
id: null,
|
||||
idBase: selectedId,
|
||||
instance: {}
|
||||
});
|
||||
} else {
|
||||
setAttributes({
|
||||
id: selectedId,
|
||||
idBase: null,
|
||||
instance: null
|
||||
});
|
||||
}
|
||||
}
|
||||
}))));
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Legacy Widget'),
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, {
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, {
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WidgetTypeSelector, {
|
||||
selectedId: id !== null && id !== void 0 ? id : idBase,
|
||||
onSelect: ({
|
||||
selectedId,
|
||||
isMulti
|
||||
}) => {
|
||||
if (!selectedId) {
|
||||
setAttributes({
|
||||
id: null,
|
||||
idBase: null,
|
||||
instance: null
|
||||
});
|
||||
} else if (isMulti) {
|
||||
setAttributes({
|
||||
id: null,
|
||||
idBase: selectedId,
|
||||
instance: {}
|
||||
});
|
||||
} else {
|
||||
setAttributes({
|
||||
id: selectedId,
|
||||
idBase: null,
|
||||
instance: null
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
});
|
||||
}
|
||||
function NotEmpty({
|
||||
attributes: {
|
||||
@@ -1073,41 +1016,53 @@ function NotEmpty({
|
||||
});
|
||||
}, []);
|
||||
if (!widgetType && hasResolvedWidgetType) {
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
|
||||
icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
|
||||
icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, {
|
||||
icon: library_brush
|
||||
}),
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Legacy Widget')
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Widget is missing.'));
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Legacy Widget'),
|
||||
children: (0,external_wp_i18n_namespaceObject.__)('Widget is missing.')
|
||||
});
|
||||
}
|
||||
if (!hasResolvedWidgetType) {
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
|
||||
});
|
||||
}
|
||||
const mode = idBase && (isNavigationMode || !isSelected) ? 'preview' : 'edit';
|
||||
return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, idBase === 'text' && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
|
||||
group: "other"
|
||||
}, (0,external_React_namespaceObject.createElement)(ConvertToBlocksButton, {
|
||||
clientId: clientId,
|
||||
rawInstance: instance.raw
|
||||
})), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_React_namespaceObject.createElement)(InspectorCard, {
|
||||
name: widgetType.name,
|
||||
description: widgetType.description
|
||||
})), (0,external_React_namespaceObject.createElement)(Form, {
|
||||
title: widgetType.name,
|
||||
isVisible: mode === 'edit',
|
||||
id: id,
|
||||
idBase: idBase,
|
||||
instance: instance,
|
||||
isWide: isWide,
|
||||
onChangeInstance: setInstance,
|
||||
onChangeHasPreview: setHasPreview
|
||||
}), idBase && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, hasPreview === null && mode === 'preview' && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)), hasPreview === true && (0,external_React_namespaceObject.createElement)(Preview, {
|
||||
idBase: idBase,
|
||||
instance: instance,
|
||||
isVisible: mode === 'preview'
|
||||
}), hasPreview === false && mode === 'preview' && (0,external_React_namespaceObject.createElement)(NoPreview, {
|
||||
name: widgetType.name
|
||||
})));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [idBase === 'text' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, {
|
||||
group: "other",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToBlocksButton, {
|
||||
clientId: clientId,
|
||||
rawInstance: instance.raw
|
||||
})
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorCard, {
|
||||
name: widgetType.name,
|
||||
description: widgetType.description
|
||||
})
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Form, {
|
||||
title: widgetType.name,
|
||||
isVisible: mode === 'edit',
|
||||
id: id,
|
||||
idBase: idBase,
|
||||
instance: instance,
|
||||
isWide: isWide,
|
||||
onChangeInstance: setInstance,
|
||||
onChangeHasPreview: setHasPreview
|
||||
}), idBase && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [hasPreview === null && mode === 'preview' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
|
||||
}), hasPreview === true && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Preview, {
|
||||
idBase: idBase,
|
||||
instance: instance,
|
||||
isVisible: mode === 'preview'
|
||||
}), hasPreview === false && mode === 'preview' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NoPreview, {
|
||||
name: widgetType.name
|
||||
})]
|
||||
})]
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/legacy-widget/transforms.js
|
||||
@@ -1373,21 +1328,21 @@ const settings = {
|
||||
};
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/group.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const group = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const group = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
viewBox: "0 0 24 24",
|
||||
xmlns: "http://www.w3.org/2000/svg"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"
|
||||
}));
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const library_group = (group);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/widget-group/edit.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -1396,6 +1351,9 @@ const group = (0,external_React_namespaceObject.createElement)(external_wp_primi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function edit_Edit(props) {
|
||||
const {
|
||||
clientId
|
||||
@@ -1403,72 +1361,86 @@ function edit_Edit(props) {
|
||||
const {
|
||||
innerBlocks
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId), [clientId]);
|
||||
return (0,external_React_namespaceObject.createElement)("div", {
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({
|
||||
className: 'widget'
|
||||
}),
|
||||
children: innerBlocks.length === 0 ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PlaceholderContent, {
|
||||
...props
|
||||
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewContent, {
|
||||
...props
|
||||
})
|
||||
}, innerBlocks.length === 0 ? (0,external_React_namespaceObject.createElement)(PlaceholderContent, {
|
||||
...props
|
||||
}) : (0,external_React_namespaceObject.createElement)(PreviewContent, {
|
||||
...props
|
||||
}));
|
||||
});
|
||||
}
|
||||
function PlaceholderContent({
|
||||
clientId
|
||||
}) {
|
||||
return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
|
||||
className: "wp-block-widget-group__placeholder",
|
||||
icon: (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
|
||||
icon: library_group
|
||||
}),
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Widget Group')
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ButtonBlockAppender, {
|
||||
rootClientId: clientId
|
||||
})), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks, {
|
||||
renderAppender: false
|
||||
}));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, {
|
||||
className: "wp-block-widget-group__placeholder",
|
||||
icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, {
|
||||
icon: library_group
|
||||
}),
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Widget Group'),
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ButtonBlockAppender, {
|
||||
rootClientId: clientId
|
||||
})
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks, {
|
||||
renderAppender: false
|
||||
})]
|
||||
});
|
||||
}
|
||||
function PreviewContent({
|
||||
attributes,
|
||||
setAttributes
|
||||
}) {
|
||||
var _attributes$title;
|
||||
return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
|
||||
tagName: "h2",
|
||||
className: "widget-title",
|
||||
allowedFormats: [],
|
||||
placeholder: (0,external_wp_i18n_namespaceObject.__)('Title'),
|
||||
value: (_attributes$title = attributes.title) !== null && _attributes$title !== void 0 ? _attributes$title : '',
|
||||
onChange: title => setAttributes({
|
||||
title
|
||||
})
|
||||
}), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks, null));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, {
|
||||
tagName: "h2",
|
||||
identifier: "title",
|
||||
className: "widget-title",
|
||||
allowedFormats: [],
|
||||
placeholder: (0,external_wp_i18n_namespaceObject.__)('Title'),
|
||||
value: (_attributes$title = attributes.title) !== null && _attributes$title !== void 0 ? _attributes$title : '',
|
||||
onChange: title => setAttributes({
|
||||
title
|
||||
})
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks, {})]
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/widget-group/save.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
function save({
|
||||
attributes
|
||||
}) {
|
||||
return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
|
||||
tagName: "h2",
|
||||
className: "widget-title",
|
||||
value: attributes.title
|
||||
}), (0,external_React_namespaceObject.createElement)("div", {
|
||||
className: "wp-widget-group__inner-blocks"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
|
||||
tagName: "h2",
|
||||
className: "widget-title",
|
||||
value: attributes.title
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
|
||||
className: "wp-widget-group__inner-blocks",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {})
|
||||
})]
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/blocks/widget-group/deprecated.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
const v1 = {
|
||||
attributes: {
|
||||
title: {
|
||||
@@ -1484,11 +1456,13 @@ const v1 = {
|
||||
save({
|
||||
attributes
|
||||
}) {
|
||||
return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
|
||||
tagName: "h2",
|
||||
className: "widget-title",
|
||||
value: attributes.title
|
||||
}), (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
|
||||
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, {
|
||||
tagName: "h2",
|
||||
className: "widget-title",
|
||||
value: attributes.title
|
||||
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {})]
|
||||
});
|
||||
}
|
||||
};
|
||||
/* harmony default export */ const deprecated = ([v1]);
|
||||
@@ -1508,6 +1482,7 @@ const widget_group_metadata = {
|
||||
$schema: "https://schemas.wp.org/trunk/block.json",
|
||||
apiVersion: 3,
|
||||
name: "core/widget-group",
|
||||
title: "Widget Group",
|
||||
category: "widgets",
|
||||
attributes: {
|
||||
title: {
|
||||
@@ -1573,52 +1548,59 @@ const widget_group_settings = {
|
||||
};
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/move-to.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
const moveTo = (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
||||
|
||||
const moveTo = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 24 24"
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M19.75 9c0-1.257-.565-2.197-1.39-2.858-.797-.64-1.827-1.017-2.815-1.247-1.802-.42-3.703-.403-4.383-.396L11 4.5V6l.177-.001c.696-.006 2.416-.02 4.028.356.887.207 1.67.518 2.216.957.52.416.829.945.829 1.688 0 .592-.167.966-.407 1.23-.255.281-.656.508-1.236.674-1.19.34-2.82.346-4.607.346h-.077c-1.692 0-3.527 0-4.942.404-.732.209-1.424.545-1.935 1.108-.526.579-.796 1.33-.796 2.238 0 1.257.565 2.197 1.39 2.858.797.64 1.827 1.017 2.815 1.247 1.802.42 3.703.403 4.383.396L13 19.5h.714V22L18 18.5 13.714 15v3H13l-.177.001c-.696.006-2.416.02-4.028-.356-.887-.207-1.67-.518-2.216-.957-.52-.416-.829-.945-.829-1.688 0-.592.167-.966.407-1.23.255-.281.656-.508 1.237-.674 1.189-.34 2.819-.346 4.606-.346h.077c1.692 0 3.527 0 4.941-.404.732-.209 1.425-.545 1.936-1.108.526-.579.796-1.33.796-2.238z"
|
||||
}));
|
||||
viewBox: "0 0 24 24",
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
|
||||
d: "M19.75 9c0-1.257-.565-2.197-1.39-2.858-.797-.64-1.827-1.017-2.815-1.247-1.802-.42-3.703-.403-4.383-.396L11 4.5V6l.177-.001c.696-.006 2.416-.02 4.028.356.887.207 1.67.518 2.216.957.52.416.829.945.829 1.688 0 .592-.167.966-.407 1.23-.255.281-.656.508-1.236.674-1.19.34-2.82.346-4.607.346h-.077c-1.692 0-3.527 0-4.942.404-.732.209-1.424.545-1.935 1.108-.526.579-.796 1.33-.796 2.238 0 1.257.565 2.197 1.39 2.858.797.64 1.827 1.017 2.815 1.247 1.802.42 3.703.403 4.383.396L13 19.5h.714V22L18 18.5 13.714 15v3H13l-.177.001c-.696.006-2.416.02-4.028-.356-.887-.207-1.67-.518-2.216-.957-.52-.416-.829-.945-.829-1.688 0-.592.167-.966.407-1.23.255-.281.656-.508 1.237-.674 1.189-.34 2.819-.346 4.606-.346h.077c1.692 0 3.527 0 4.941-.404.732-.209 1.425-.545 1.936-1.108.526-.579.796-1.33.796-2.238z"
|
||||
})
|
||||
});
|
||||
/* harmony default export */ const move_to = (moveTo);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/components/move-to-widget-area/index.js
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
function MoveToWidgetArea({
|
||||
currentWidgetAreaId,
|
||||
widgetAreas,
|
||||
onSelect
|
||||
}) {
|
||||
return (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, null, toggleProps => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
|
||||
icon: move_to,
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Move to widget area'),
|
||||
toggleProps: toggleProps
|
||||
}, ({
|
||||
onClose
|
||||
}) => (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Move to')
|
||||
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItemsChoice, {
|
||||
choices: widgetAreas.map(widgetArea => ({
|
||||
value: widgetArea.id,
|
||||
label: widgetArea.name,
|
||||
info: widgetArea.description
|
||||
})),
|
||||
value: currentWidgetAreaId,
|
||||
onSelect: value => {
|
||||
onSelect(value);
|
||||
onClose();
|
||||
}
|
||||
})))));
|
||||
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, {
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, {
|
||||
children: toggleProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, {
|
||||
icon: move_to,
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Move to widget area'),
|
||||
toggleProps: toggleProps,
|
||||
children: ({
|
||||
onClose
|
||||
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Move to'),
|
||||
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItemsChoice, {
|
||||
choices: widgetAreas.map(widgetArea => ({
|
||||
value: widgetArea.id,
|
||||
label: widgetArea.name,
|
||||
info: widgetArea.description
|
||||
})),
|
||||
value: currentWidgetAreaId,
|
||||
onSelect: value => {
|
||||
onSelect(value);
|
||||
onClose();
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/widgets/build-module/components/index.js
|
||||
@@ -1755,8 +1737,6 @@ function registerWidgetGroupBlock(supports = {}) {
|
||||
}
|
||||
|
||||
|
||||
})();
|
||||
|
||||
(window.wp = window.wp || {}).widgets = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
+1
-6
File diff suppressed because one or more lines are too long
+11
-8
@@ -1,10 +1,10 @@
|
||||
/*!
|
||||
* jQuery UI Accordion 1.13.2
|
||||
* http://jqueryui.com
|
||||
* jQuery UI Accordion 1.13.3
|
||||
* https://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Copyright OpenJS Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
* https://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Accordion
|
||||
@@ -12,8 +12,8 @@
|
||||
/* eslint-disable max-len */
|
||||
//>>description: Displays collapsible content panels for presenting information in a limited amount of space.
|
||||
/* eslint-enable max-len */
|
||||
//>>docs: http://api.jqueryui.com/accordion/
|
||||
//>>demos: http://jqueryui.com/accordion/
|
||||
//>>docs: https://api.jqueryui.com/accordion/
|
||||
//>>demos: https://jqueryui.com/accordion/
|
||||
//>>css.structure: ../../themes/base/core.css
|
||||
//>>css.structure: ../../themes/base/accordion.css
|
||||
//>>css.theme: ../../themes/base/theme.css
|
||||
@@ -26,7 +26,10 @@
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"./core"
|
||||
"../version",
|
||||
"../keycode",
|
||||
"../unique-id",
|
||||
"../widget"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
@@ -37,7 +40,7 @@
|
||||
"use strict";
|
||||
|
||||
return $.widget( "ui.accordion", {
|
||||
version: "1.13.2",
|
||||
version: "1.13.3",
|
||||
options: {
|
||||
active: 0,
|
||||
animate: {},
|
||||
|
||||
+5
-5
File diff suppressed because one or more lines are too long
+12
-8
@@ -1,17 +1,17 @@
|
||||
/*!
|
||||
* jQuery UI Autocomplete 1.13.2
|
||||
* http://jqueryui.com
|
||||
* jQuery UI Autocomplete 1.13.3
|
||||
* https://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Copyright OpenJS Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
* https://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Autocomplete
|
||||
//>>group: Widgets
|
||||
//>>description: Lists suggested words as the user is typing.
|
||||
//>>docs: http://api.jqueryui.com/autocomplete/
|
||||
//>>demos: http://jqueryui.com/autocomplete/
|
||||
//>>docs: https://api.jqueryui.com/autocomplete/
|
||||
//>>demos: https://jqueryui.com/autocomplete/
|
||||
//>>css.structure: ../../themes/base/core.css
|
||||
//>>css.structure: ../../themes/base/autocomplete.css
|
||||
//>>css.theme: ../../themes/base/theme.css
|
||||
@@ -25,7 +25,11 @@
|
||||
define( [
|
||||
"jquery",
|
||||
"./menu",
|
||||
"./core"
|
||||
"../keycode",
|
||||
"../position",
|
||||
"../safe-active-element",
|
||||
"../version",
|
||||
"../widget"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
@@ -36,7 +40,7 @@
|
||||
"use strict";
|
||||
|
||||
$.widget( "ui.autocomplete", {
|
||||
version: "1.13.2",
|
||||
version: "1.13.3",
|
||||
defaultElement: "<input>",
|
||||
options: {
|
||||
appendTo: null,
|
||||
|
||||
+5
-5
File diff suppressed because one or more lines are too long
+9
-8
@@ -1,17 +1,17 @@
|
||||
/*!
|
||||
* jQuery UI Button 1.13.2
|
||||
* http://jqueryui.com
|
||||
* jQuery UI Button 1.13.3
|
||||
* https://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Copyright OpenJS Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
* https://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Button
|
||||
//>>group: Widgets
|
||||
//>>description: Enhances a form with themeable buttons.
|
||||
//>>docs: http://api.jqueryui.com/button/
|
||||
//>>demos: http://jqueryui.com/button/
|
||||
//>>docs: https://api.jqueryui.com/button/
|
||||
//>>demos: https://jqueryui.com/button/
|
||||
//>>css.structure: ../../themes/base/core.css
|
||||
//>>css.structure: ../../themes/base/button.css
|
||||
//>>css.theme: ../../themes/base/theme.css
|
||||
@@ -30,7 +30,8 @@
|
||||
"./controlgroup",
|
||||
"./checkboxradio",
|
||||
|
||||
"./core"
|
||||
"../keycode",
|
||||
"../widget"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
@@ -41,7 +42,7 @@
|
||||
"use strict";
|
||||
|
||||
$.widget( "ui.button", {
|
||||
version: "1.13.2",
|
||||
version: "1.13.3",
|
||||
defaultElement: "<button>",
|
||||
options: {
|
||||
classes: {
|
||||
|
||||
+5
-5
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user