Version Description
Download this release
Release Info
Developer | gutenbergplugin |
Plugin | Gutenberg |
Version | 11.8.1 |
Comparing to | |
See all releases |
Code changes from version 11.8.0 to 11.8.1
- build/block-editor/index.js +24 -0
- build/block-editor/index.min.asset.php +1 -1
- build/block-editor/index.min.js +16 -16
- build/format-library/index.js +9 -2
- build/format-library/index.min.asset.php +1 -1
- build/format-library/index.min.js +1 -1
- changelog.txt +635 -265
- gutenberg.php +3 -3
- readme.txt +1 -1
build/block-editor/index.js
CHANGED
@@ -2273,6 +2273,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
2273 |
"useBlockDisplayInformation": function() { return /* reexport */ useBlockDisplayInformation; },
|
2274 |
"useBlockEditContext": function() { return /* reexport */ useBlockEditContext; },
|
2275 |
"useBlockProps": function() { return /* reexport */ useBlockProps; },
|
|
|
2276 |
"useSetting": function() { return /* reexport */ useSetting; },
|
2277 |
"validateThemeColors": function() { return /* reexport */ validateThemeColors; },
|
2278 |
"validateThemeGradients": function() { return /* reexport */ validateThemeGradients; },
|
@@ -32247,6 +32248,28 @@ function getSpacingClassesAndStyles(attributes) {
|
|
32247 |
};
|
32248 |
}
|
32249 |
//# sourceMappingURL=use-spacing-props.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32250 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/index.js
|
32251 |
/**
|
32252 |
* Internal dependencies
|
@@ -32267,6 +32290,7 @@ function getSpacingClassesAndStyles(attributes) {
|
|
32267 |
|
32268 |
|
32269 |
|
|
|
32270 |
//# sourceMappingURL=index.js.map
|
32271 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors/with-colors.js
|
32272 |
|
2273 |
"useBlockDisplayInformation": function() { return /* reexport */ useBlockDisplayInformation; },
|
2274 |
"useBlockEditContext": function() { return /* reexport */ useBlockEditContext; },
|
2275 |
"useBlockProps": function() { return /* reexport */ useBlockProps; },
|
2276 |
+
"useCachedTruthy": function() { return /* reexport */ useCachedTruthy; },
|
2277 |
"useSetting": function() { return /* reexport */ useSetting; },
|
2278 |
"validateThemeColors": function() { return /* reexport */ validateThemeColors; },
|
2279 |
"validateThemeGradients": function() { return /* reexport */ validateThemeGradients; },
|
32248 |
};
|
32249 |
}
|
32250 |
//# sourceMappingURL=use-spacing-props.js.map
|
32251 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/use-cached-truthy.js
|
32252 |
+
/**
|
32253 |
+
* WordPress dependencies
|
32254 |
+
*/
|
32255 |
+
|
32256 |
+
/**
|
32257 |
+
* Keeps an up-to-date copy of the passed value and returns it. If value becomes falsy, it will return the last truthy copy.
|
32258 |
+
*
|
32259 |
+
* @param {any} value
|
32260 |
+
* @return {any} value
|
32261 |
+
*/
|
32262 |
+
|
32263 |
+
function useCachedTruthy(value) {
|
32264 |
+
const [cachedValue, setCachedValue] = (0,external_wp_element_namespaceObject.useState)(value);
|
32265 |
+
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
32266 |
+
if (value) {
|
32267 |
+
setCachedValue(value);
|
32268 |
+
}
|
32269 |
+
}, [value]);
|
32270 |
+
return cachedValue;
|
32271 |
+
}
|
32272 |
+
//# sourceMappingURL=use-cached-truthy.js.map
|
32273 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/index.js
|
32274 |
/**
|
32275 |
* Internal dependencies
|
32290 |
|
32291 |
|
32292 |
|
32293 |
+
|
32294 |
//# sourceMappingURL=index.js.map
|
32295 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors/with-colors.js
|
32296 |
|
build/block-editor/index.min.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'e74a5529c0d6ec6d76498c0c8f9a539a');
|
build/block-editor/index.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
!function(){var e={9367:function(e,t){var n,o;void 0===(o="function"==typeof(n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default})?n.apply(t,[e,t]):n)||(e.exports=o)},4184:function(e,t){var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},1934:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},5913:function(e,t){"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var g=d&&d.newPos+1<a,h=m&&0<=f&&f<c;if(g||h){if(!g||h&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.newPos+1>=a&&f+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();f()||e()}),0)}();else for(;u<=d;){var g=f();if(g)return g}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},7630:function(e,t,n){"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(5913))&&o.__esModule?o:{default:o}).default)},9010:function(e,t,n){"use strict";var o=n(4657);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),f=o.offset(e),g=o.outerHeight(e),h=o.outerWidth(e),b=void 0,v=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:f.left-S.left-c,top:f.top-S.top-a},E={left:f.left+h-(S.left+w)+d,top:f.top+g-(S.top+B)+u},_=S):(b=o.offset(t),v=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(b.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:f.top-(b.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:f.left+h-(b.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+g-(b.top+v+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,_.top+y.top):!1===i?o.scrollTop(t,_.top+E.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,_.left+y.left):!1===s?o.scrollLeft(t,_.left+E.left):y.left<0?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left)))}},4979:function(e,t,n){"use strict";e.exports=n(9010)},4657:function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function f(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function g(e){return null!=e&&e==e.window}var h={};function b(e,t,n){if(g(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-f(e,["border","padding"],o):i;if(s){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return a+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var v={position:"absolute",visibility:"hidden",display:"block"};function k(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=b.apply(void 0,n):m(e,v,(function(){t=b.apply(void 0,n)})),t}function _(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&_(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);h["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=f(t,["padding","border"],n)),_(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===_(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(_(e,l))||0,o[l]=r+t[l]-n[l]);_(e,o)}(e,t)},isWindow:g,each:u,css:_,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(g(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(g(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},h)},5717:function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},8303:function(e,t,n){var o=n(1934);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},2703:function(e,t,n){"use strict";var o=n(414);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},5697:function(e,t,n){e.exports=n(2703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4857:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||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},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(3804),a=n(5697),c=n(9367),u=n(8303),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},4042:function(e,t,n){"use strict";var o=n(4857);t.Z=o.TextareaAutosize},3692:function(e){var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},f=!0,g={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],e&&(f=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){f=!1}};if(!u)return g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=l(g.node)),g.isLeaf=0==g.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){g.circular=i[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var b=t.call(g,g.node);return void 0!==b&&g.update&&g.update(b),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(i.push(g),h(),a(g.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(g,g.node[t],t);var l=e(g.node[t]);n&&c.call(g.node,t)&&(g.node[t]=l.node),l.isLast=r==g.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(g,l),o.pop()})),i.pop()),m.after&&m.after.call(g,g.node),g):g}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===i(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},3804:function(e){"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return ah},AlignmentToolbar:function(){return ch},Autocomplete:function(){return mh},BlockAlignmentControl:function(){return Do},BlockAlignmentToolbar:function(){return Oo},BlockBreadcrumb:function(){return vh},BlockColorsStyleSelector:function(){return Ch},BlockContextProvider:function(){return or},BlockControls:function(){return eo},BlockEdit:function(){return sr},BlockEditorKeyboardShortcuts:function(){return Lk},BlockEditorProvider:function(){return Ua},BlockFormatControls:function(){return Jn},BlockIcon:function(){return za},BlockInspector:function(){return Nk},BlockList:function(){return Kp},BlockMover:function(){return Ld},BlockNavigationDropdown:function(){return Gh},BlockPreview:function(){return iu},BlockSelectionClearer:function(){return $a},BlockSettingsMenu:function(){return Ep},BlockSettingsMenuControls:function(){return vp},BlockTitle:function(){return _d},BlockToolbar:function(){return Cp},BlockTools:function(){return Pk},BlockVerticalAlignmentControl:function(){return ub},BlockVerticalAlignmentToolbar:function(){return db},ButtonBlockAppender:function(){return ud},ButtonBlockerAppender:function(){return cd},ColorPalette:function(){return mb},ColorPaletteControl:function(){return fb},ContrastChecker:function(){return Zm},CopyHandler:function(){return sp},DefaultBlockAppender:function(){return sd},FontSizePicker:function(){return jf},InnerBlocks:function(){return Gp},Inserter:function(){return id},InspectorAdvancedControls:function(){return Zo},InspectorControls:function(){return Xo},JustifyContentControl:function(){return bo},JustifyToolbar:function(){return vo},LineHeightControl:function(){return wf},MediaPlaceholder:function(){return Tv},MediaReplaceFlow:function(){return Cv},MediaUpload:function(){return yv},MediaUploadCheck:function(){return Ev},MultiSelectScrollIntoView:function(){return Ak},NavigableToolbar:function(){return Sd},ObserveTyping:function(){return zk},PanelColorSettings:function(){return Nv},PlainText:function(){return nk},PreserveScrollInReorder:function(){return Vk},RichText:function(){return Jv},RichTextShortcut:function(){return lk},RichTextToolbarButton:function(){return ik},SETTINGS_DEFAULTS:function(){return b},SkipToSelectedBlock:function(){return Sk},ToolSelector:function(){return ck},Typewriter:function(){return Wk},URLInput:function(){return Jb},URLInputButton:function(){return mk},URLPopover:function(){return Iv},Warning:function(){return cr},WritingFlow:function(){return tc},__experimentalBlockAlignmentMatrixControl:function(){return hh},__experimentalBlockContentOverlay:function(){return kh},__experimentalBlockFullHeightAligmentControl:function(){return gh},__experimentalBlockPatternSetup:function(){return tb},__experimentalBlockVariationPicker:function(){return $h},__experimentalBlockVariationTransforms:function(){return ob},__experimentalBorderRadiusControl:function(){return xm},__experimentalBorderStyleControl:function(){return Lm},__experimentalColorGradientControl:function(){return dm},__experimentalDuotoneControl:function(){return Pg},__experimentalFontAppearanceControl:function(){return Pf},__experimentalFontFamilyControl:function(){return Ff},__experimentalGetBorderClassesAndStyles:function(){return Wg},__experimentalGetColorClassesAndStyles:function(){return Kg},__experimentalGetGradientClass:function(){return em},__experimentalGetGradientObjectByGradientValue:function(){return nm},__experimentalGetMatchingVariation:function(){return nb},__experimentalGetSpacingClassesAndStyles:function(){return Yg},__experimentalImageEditingProvider:function(){return Db},__experimentalImageEditor:function(){return Kb},__experimentalImageSizeControl:function(){return Yb},__experimentalImageURLInputUI:function(){return yk},__experimentalLayoutStyle:function(){return To},__experimentalLetterSpacingControl:function(){return Qf},__experimentalLibrary:function(){return Rk},__experimentalLinkControl:function(){return vv},__experimentalLinkControlSearchInput:function(){return dv},__experimentalLinkControlSearchItem:function(){return nv},__experimentalLinkControlSearchResults:function(){return lv},__experimentalListView:function(){return Hh},__experimentalPanelColorGradientSettings:function(){return qm},__experimentalPreviewOptions:function(){return Ek},__experimentalResponsiveBlockControl:function(){return rk},__experimentalUnitControl:function(){return uk},__experimentalUseBorderProps:function(){return $g},__experimentalUseColorProps:function(){return qg},__experimentalUseCustomSides:function(){return kg},__experimentalUseGradient:function(){return rm},__experimentalUseInnerBlocksProps:function(){return Up},__experimentalUseNoRecursiveRenders:function(){return qk},__experimentalUseResizeCanvas:function(){return Ck},__unstableBlockSettingsMenuFirstItem:function(){return mp},__unstableEditorStyles:function(){return ou},__unstableIframe:function(){return rc},__unstableInserterMenuExtension:function(){return Ou},__unstableRichTextInputEvent:function(){return sk},__unstableUseBlockSelectionClearer:function(){return Wa},__unstableUseCanvasClickRedirect:function(){return jk},__unstableUseClipboardHandler:function(){return ip},__unstableUseMouseMoveTypingReset:function(){return Ok},__unstableUseTypewriter:function(){return Gk},__unstableUseTypingObserver:function(){return Fk},createCustomColorsHOC:function(){return Qg},getColorClassName:function(){return Qp},getColorObjectByAttributeValues:function(){return Zp},getColorObjectByColorValue:function(){return Xp},getFontSize:function(){return Gf},getFontSizeClass:function(){return $f},getFontSizeObjectByValue:function(){return Wf},getGradientSlugByValue:function(){return om},getGradientValueBySlug:function(){return tm},getPxFromCssUnit:function(){return t_},store:function(){return Wn},storeConfig:function(){return Gn},transformStyles:function(){return eu},useBlockDisplayInformation:function(){return kd},useBlockEditContext:function(){return qn},useBlockProps:function(){return xa},useSetting:function(){return fo},validateThemeColors:function(){return Yk},validateThemeGradients:function(){return Zk},withColorContext:function(){return pb},withColors:function(){return Jg},withFontSizes:function(){return th}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return Nt},__experimentalGetAllowedBlocks:function(){return ct},__experimentalGetAllowedPatterns:function(){return mt},__experimentalGetBlockListSettingsForBlocks:function(){return kt},__experimentalGetDirectInsertBlock:function(){return ut},__experimentalGetLastBlockAttributeChanges:function(){return Ct},__experimentalGetParsedPattern:function(){return dt},__experimentalGetParsedReusableBlock:function(){return _t},__experimentalGetPatternTransformItems:function(){return gt},__experimentalGetPatternsByBlockTypes:function(){return ft},__experimentalGetReusableBlockTitle:function(){return yt},__unstableGetBlockWithoutInnerBlocks:function(){return $},__unstableGetClientIdWithClientIdsTree:function(){return K},__unstableGetClientIdsTree:function(){return q},__unstableIsLastBlockChangeIgnored:function(){return Et},areInnerBlocksControlled:function(){return Tt},canInsertBlockType:function(){return Ye},canInsertBlocks:function(){return Ze},canMoveBlock:function(){return Je},canMoveBlocks:function(){return et},canRemoveBlock:function(){return Xe},canRemoveBlocks:function(){return Qe},didAutomaticChange:function(){return It},getAdjacentBlockClientId:function(){return me},getBlock:function(){return W},getBlockAttributes:function(){return G},getBlockCount:function(){return J},getBlockHierarchyRootClientId:function(){return de},getBlockIndex:function(){return xe},getBlockInsertionPoint:function(){return Ue},getBlockListSettings:function(){return ht},getBlockMode:function(){return Ae},getBlockName:function(){return H},getBlockOrder:function(){return Ie},getBlockParents:function(){return ce},getBlockParentsByBlockName:function(){return ue},getBlockRootClientId:function(){return ae},getBlockSelectionEnd:function(){return oe},getBlockSelectionStart:function(){return ne},getBlockTransformItems:function(){return st},getBlocks:function(){return j},getBlocksByClientId:function(){return Q},getClientIdsOfDescendants:function(){return Y},getClientIdsWithDescendants:function(){return Z},getDraggedBlockClientIds:function(){return Fe},getFirstMultiSelectedBlockClientId:function(){return _e},getGlobalBlockCount:function(){return X},getInserterItems:function(){return it},getLastMultiSelectedBlockClientId:function(){return ye},getLowestCommonAncestorWithSelectedBlock:function(){return pe},getMultiSelectedBlockClientIds:function(){return ve},getMultiSelectedBlocks:function(){return ke},getMultiSelectedBlocksEndClientId:function(){return Be},getMultiSelectedBlocksStartClientId:function(){return we},getNextBlockClientId:function(){return ge},getPreviousBlockClientId:function(){return fe},getSelectedBlock:function(){return se},getSelectedBlockClientId:function(){return ie},getSelectedBlockClientIds:function(){return be},getSelectedBlockCount:function(){return re},getSelectedBlocksInitialCaretPosition:function(){return he},getSelectionEnd:function(){return te},getSelectionStart:function(){return ee},getSettings:function(){return bt},getTemplate:function(){return $e},getTemplateLock:function(){return je},hasBlockMovingClientId:function(){return Bt},hasInserterItems:function(){return at},hasMultiSelection:function(){return Re},hasSelectedBlock:function(){return le},hasSelectedInnerBlock:function(){return Ne},isAncestorBeingDragged:function(){return Ve},isAncestorMultiSelected:function(){return Se},isBlockBeingDragged:function(){return ze},isBlockHighlighted:function(){return xt},isBlockInsertionPointVisible:function(){return Ge},isBlockMultiSelected:function(){return Ce},isBlockSelected:function(){return Te},isBlockValid:function(){return U},isBlockWithinSelection:function(){return Pe},isCaretWithinFormattedText:function(){return He},isDraggingBlocks:function(){return Oe},isFirstMultiSelectedBlock:function(){return Ee},isLastBlockChangePersistent:function(){return vt},isMultiSelecting:function(){return Me},isNavigationMode:function(){return wt},isSelectionEnabled:function(){return Le},isTyping:function(){return De},isValidTemplate:function(){return We},wasBlockJustInserted:function(){return Pt}});var t={};n.r(t),n.d(t,{__unstableMarkAutomaticChange:function(){return Mn},__unstableMarkAutomaticChangeFinal:function(){return Ln},__unstableMarkLastChangeAsPersistent:function(){return Pn},__unstableMarkNextChangeAsNotPersistent:function(){return Rn},__unstableSaveReusableBlock:function(){return Nn},clearSelectedBlock:function(){return Xt},duplicateBlocks:function(){return On},enterFormattedText:function(){return Sn},exitFormattedText:function(){return wn},flashBlock:function(){return Hn},hideInsertionPoint:function(){return dn},insertAfterBlock:function(){return zn},insertBeforeBlock:function(){return Fn},insertBlock:function(){return an},insertBlocks:function(){return cn},insertDefaultBlock:function(){return In},mergeBlocks:function(){return fn},moveBlockToPosition:function(){return sn},moveBlocksDown:function(){return on},moveBlocksToPosition:function(){return ln},moveBlocksUp:function(){return rn},multiSelect:function(){return Zt},receiveBlocks:function(){return Ut},removeBlock:function(){return hn},removeBlocks:function(){return gn},replaceBlock:function(){return tn},replaceBlocks:function(){return en},replaceInnerBlocks:function(){return bn},resetBlocks:function(){return zt},resetSelection:function(){return Ht},selectBlock:function(){return $t},selectNextBlock:function(){return Kt},selectPreviousBlock:function(){return jt},selectionChange:function(){return Bn},setBlockMovingClientId:function(){return Dn},setHasControlledInnerBlocks:function(){return Un},setNavigationMode:function(){return An},setTemplateValidity:function(){return pn},showInsertionPoint:function(){return un},startDraggingBlocks:function(){return En},startMultiSelect:function(){return qt},startTyping:function(){return kn},stopDraggingBlocks:function(){return Cn},stopMultiSelect:function(){return Yt},stopTyping:function(){return yn},synchronizeTemplate:function(){return mn},toggleBlockHighlight:function(){return Vn},toggleBlockMode:function(){return vn},toggleSelection:function(){return Qt},updateBlock:function(){return Wt},updateBlockAttributes:function(){return Gt},updateBlockListSettings:function(){return xn},updateSettings:function(){return Tn},validateBlocksToTemplate:function(){return Vt}});var r=window.wp.blocks,l=window.wp.hooks;function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var s=window.wp.element,a=n(4184),c=n.n(a),u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,f={default:(0,p.createSlotFill)("BlockControls"),block:(0,p.createSlotFill)("BlockControlsBlock"),inline:(0,p.createSlotFill)("BlockFormatControls"),other:(0,p.createSlotFill)("BlockControlsOther"),parent:(0,p.createSlotFill)("BlockControlsParent")},g=window.wp.i18n;const h={insertUsage:{}},b={alignWide:!1,supportsLayout:!0,colors:[{name:(0,g.__)("Black"),slug:"black",color:"#000000"},{name:(0,g.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,g.__)("White"),slug:"white",color:"#ffffff"},{name:(0,g.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,g.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,g.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,g.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,g.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,g.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,g.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,g.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,g.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,g._x)("Small","font size name"),size:13,slug:"small"},{name:(0,g._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,g._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,g._x)("Large","font size name"),size:36,slug:"large"},{name:(0,g._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,g.__)("Thumbnail")},{slug:"medium",name:(0,g.__)("Medium")},{slug:"large",name:(0,g.__)("Large")},{slug:"full",name:(0,g.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__unstableGalleryWithImageBlocks:!1,gradients:[{name:(0,g.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,g.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,g.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,g.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,g.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,g.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,g.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,g.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,g.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,g.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,g.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,g.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}]};function v(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function k(e,t,n,o=1){const r=[...e];return r.splice(t,o),v(r,e.slice(t,t+o),n)}function _(e,t=""){const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,_(r,o))})),n}function y(e,t=""){return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e,t=u.identity){const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function S(e){return E(e,(e=>e.attributes))}function w(e,t="",n={}){return(0,u.reduce)(e[t],((t,o)=>n[o]?t:[...t,o,...w(e,o)]),[])}function B(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function I(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function x(e,t,n){const o=new Set([]),r=new Set;for(const t of n){let n=t;do{if(e.controlledInnerBlocks[n]){r.add(n);break}o.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of o)t[e]={...t[e]};for(const n of o)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of r)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const T=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>(t={},n)=>{const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=I(o,n.blocks);o.tree=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""]);break}case"UPDATE_BLOCK":o.tree=x(o,{...o.tree,[n.clientId]:{...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId]);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=x(o,{...o.tree,...e},n.clientIds);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=I(o,n.blocks);o.tree=x(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)));const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=x(o,o.tree,r);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=x(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=x(o,o.tree,e);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(o,o.tree,e);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=x(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){var o,r,l;const e=w(null!==(o=null==t?void 0:t.order)&&void 0!==o?o:{},"",null!==(r=null==t?void 0:t.controlledInnerBlocks)&&void 0!==r?r:{}),i=Object.keys((0,u.pickBy)(null!==(l=null==t?void 0:t.controlledInnerBlocks)&&void 0!==l?l:{})),s={...t,byClientId:{...(0,u.omit)(null==t?void 0:t.byClientId,e),...C(n.blocks)},attributes:{...(0,u.omit)(null==t?void 0:t.attributes,e),...S(n.blocks)},order:{...(0,u.omit)(null==t?void 0:t.order,e),...(0,u.omit)(_(n.blocks),i)},parents:{...(0,u.omit)(null==t?void 0:t.parents,e),...y(n.blocks)},controlledInnerBlocks:(null==t?void 0:t.controlledInnerBlocks)||{}},a=I(s,n.blocks);return s.tree={...(0,u.omit)(null==t?void 0:t.tree,e),...a,"":{innerBlocks:n.blocks.map((e=>a[e.clientId]))}},s}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!B(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}))({byClientId(e={},t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...C(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...C(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(e={},t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(e={},t){switch(t.type){case"RECEIVE_BLOCKS":{const n=_(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=_(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:v(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:v(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const s=i.indexOf(r);return{...e,[o]:k(i,s,s+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=_(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(e={},t){switch(t.type){case"RECEIVE_BLOCKS":return{...e,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...y(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks:(e={},{type:t,clientId:n,hasControlledInnerBlocks:o})=>"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e});function N(e={},t){switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var P,R,M=(0,m.combineReducers)({blocks:T,isTyping:function(e=!1,t){switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(e=[],t){switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},isCaretWithinFormattedText:function(e=!1,t){switch(t.type){case"ENTER_FORMATTED_TEXT":return!0;case"EXIT_FORMATTED_TEXT":return!1}return e},selection:function(e={},t){var n,o;switch(t.type){case"SELECTION_CHANGE":return{selectionStart:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.startOffset},selectionEnd:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.endOffset}};case"RESET_SELECTION":const{selectionStart:r,selectionEnd:l}=t;return{selectionStart:r,selectionEnd:l};case"MULTI_SELECT":const{start:i,end:s}=t;return{selectionStart:{clientId:i},selectionEnd:{clientId:s}};case"RESET_BLOCKS":const a=null==e||null===(n=e.selectionStart)||void 0===n?void 0:n.clientId,c=null==e||null===(o=e.selectionEnd)||void 0===o?void 0:o.clientId;if(!a&&!c)return e;if(!t.blocks.some((e=>e.clientId===a)))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some((e=>e.clientId===c)))return{...e,selectionEnd:e.selectionStart}}return{selectionStart:N(e.selectionStart,t),selectionEnd:N(e.selectionEnd,t)}},isMultiSelecting:function(e=!1,t){switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(e=!0,t){switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(e=null,t){return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(e={},t){if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:(e={},t)=>{switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(e={isValid:!0},t){switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(e=b,t){switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(e=h,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,m.select)(r.store).getActiveBlockVariation(l,o);let s=null!=i&&i.name?`${l}/${i.name}`:l;const a={name:s};return"core/block"===l&&(a.ref=o.ref,s+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[s]:{time:t.time,count:e.insertUsage[s]?e.insertUsage[s].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(e,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return null},isNavigationMode:function(e=!1,t){return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(e=null,t){return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(e={},t){var n;switch(t.type){case"INSERT_BLOCKS":return t.blocks.length?{clientId:t.blocks[0].clientId,source:null===(n=t.meta)||void 0===n?void 0:n.source}:e;case"RESET_BLOCKS":return{}}return e}});function L(e){return[e]}function A(){var e={clear:function(){e.head=null}};return e}function D(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function O(e,t){var n,o;function r(){n=R?new WeakMap:A()}function l(){var n,r,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for(s=t.apply(null,i),(n=o(s)).isUniqueByDependants||(n.lastDependants&&!D(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),r=n.head;r;){if(D(r.args,i,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:e.apply(null,i)},i[0]=null,r.args=i,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=L),o=R?function(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(P)||((l=A()).isUniqueByDependants=a,s.set(P,l)),s.get(P)}:function(){return n},l.getDependants=t,l.clear=r,r(),l}P={},R="undefined"!=typeof WeakMap;var F=window.wp.primitives,z=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"}));const V=[];function H(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function U(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function G(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function W(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const $=O(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:G(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function j(e,t){var n;const o=t&&Tt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||V}const K=O(((e,t)=>({clientId:t,innerBlocks:q(e,t)})),(e=>[e.blocks.order])),q=O(((e,t="")=>(0,u.map)(Ie(e,t),(t=>K(e,t)))),(e=>[e.blocks.order])),Y=(e,t)=>(0,u.flatMap)(t,(t=>{const n=Ie(e,t);return[...n,...Y(e,n)]})),Z=O((e=>{const t=Ie(e);return[...t,...Y(e,t)]}),(e=>[e.blocks.order])),X=O(((e,t)=>{const n=Z(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),Q=O(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>W(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function J(e,t){return Ie(e,t).length}function ee(e){return e.selection.selectionStart}function te(e){return e.selection.selectionEnd}function ne(e){return e.selection.selectionStart.clientId}function oe(e){return e.selection.selectionEnd.clientId}function re(e){return ve(e).length||(e.selection.selectionStart.clientId?1:0)}function le(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ie(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function se(e){const t=ie(e);return t?W(e,t):null}function ae(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const ce=O(((e,t,n=!1)=>{const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),ue=O(((e,t,n,o=!1)=>{const r=ce(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:H(e,t)}))),(({name:e})=>Array.isArray(n)?n.includes(e):e===n)),(({id:e})=>e))}),(e=>[e.blocks.parents]));function de(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function pe(e,t){const n=ie(e),o=[...ce(e,t),t],r=[...ce(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function me(e,t,n=1){if(void 0===t&&(t=ie(e)),void 0===t&&(t=n<0?_e(e):ye(e)),!t)return null;const o=ae(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t)+1*n;return i<0||i===l.length?null:l[i]}function fe(e,t){return me(e,t,-1)}function ge(e,t){return me(e,t,1)}function he(e){return e.initialPosition}const be=O((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return V;if(t.clientId===n.clientId)return[t.clientId];const o=ae(e,t.clientId);if(null===o)return V;const r=Ie(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?V:be(e)}const ke=O((e=>{const t=ve(e);return t.length?t.map((t=>W(e,t))):V}),(e=>[...be.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function _e(e){return(0,u.first)(ve(e))||null}function ye(e){return(0,u.last)(ve(e))||null}function Ee(e,t){return _e(e)===t}function Ce(e,t){return-1!==ve(e).indexOf(t)}const Se=O(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=ae(e,n),o=Ce(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function we(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Be(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ie(e,t){return e.blocks.order[t||""]||V}function xe(e,t,n){return Ie(e,n).indexOf(t)}function Te(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Ne(e,t,n=!1){return(0,u.some)(Ie(e,t),(t=>Te(e,t)||Ce(e,t)||n&&Ne(e,t,n)))}function Pe(e,t){if(!t)return!1;const n=ve(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Re(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Me(e){return e.isMultiSelecting}function Le(e){return e.isSelectionEnabled}function Ae(e,t){return e.blocksMode[t]||"visual"}function De(e){return e.isTyping}function Oe(e){return!!e.draggedBlocks.length}function Fe(e){return e.draggedBlocks}function ze(e,t){return e.draggedBlocks.includes(t)}function Ve(e,t){if(!Oe(e))return!1;const n=ce(e,t);return(0,u.some)(n,(t=>ze(e,t)))}function He(e){return e.isCaretWithinFormattedText}function Ue(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=ae(e,l)||void 0,n=xe(e,r.clientId,t)+1):n=Ie(e).length,{rootClientId:t,index:n}}function Ge(e){return null!==e.insertionPoint}function We(e){return e.template.isValid}function $e(e){return e.settings.template}function je(e,t){if(!t)return e.settings.templateLock;const n=ht(e,t);return n?n.templateLock:null}const Ke=(e,t,n=null)=>(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,qe=(e,t,n=null)=>{let o;if(t&&"object"==typeof t?(o=t,t=o.name):o=(0,r.getBlockType)(t),!o)return!1;const{allowedBlockTypes:l}=bt(e);if(!Ke(l,t,!0))return!1;if(je(e,n))return!1;const i=ht(e,n);if(n&&void 0===i)return!1;const s=null==i?void 0:i.allowedBlocks,a=Ke(s,t),c=o.parent,u=H(e,n),d=Ke(c,u);return null!==a&&null!==d?a||d:null!==a?a:null===d||d},Ye=O(qe,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function Ze(e,t,n=null){return t.every((t=>Ye(e,H(e,t),n)))}function Xe(e,t,n=null){const o=G(e,t);if(null===o)return!0;const{lock:r}=o,l=!!je(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function Qe(e,t,n=null){return t.every((t=>Xe(e,t,n)))}function Je(e,t,n=null){const o=G(e,t);if(null===o)return;const{lock:r}=o,l="all"===je(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function et(e,t,n=null){return t.every((t=>Je(e,t,n)))}function tt(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const nt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&qe(e,t.name,n),ot=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=tt(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:rt(r,l)}},rt=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},lt=(e,{buildScope:t="inserter"})=>n=>{const o=n.name;let l=!1;(0,r.hasBlockSupport)(n.name,"multiple",!0)||(l=(0,u.some)(Q(e,Z(e)),{name:n.name}));const{time:i,count:s=0}=tt(e,o)||{},a={id:o,name:n.name,title:n.title,icon:n.icon,isDisabled:l,frecency:rt(i,s)};if("transform"===t)return a;const c=(0,r.getBlockVariations)(n.name,"inserter");return{...a,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,variations:c,example:n.example,utility:1}},it=O(((e,t=null)=>{const n=lt(e,{buildScope:"inserter"}),o=(0,r.getBlockTypes)().filter((n=>nt(e,n,t))).map(n),l=qe(e,"core/block",t)?St(e).map((t=>{const n=`core/block/${t.id}`,o=_t(e,t.id);let l;1===o.length&&(l=(0,r.getBlockType)(o[0].name));const{time:i,count:a=0}=tt(e,n)||{},c=rt(i,a);return{id:n,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:l&&"web"===s.Platform.OS?l.icon:z,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}})):[],i=o.filter((({variations:e=[]})=>!e.some((({isDefault:e})=>e)))),a=[];for(const t of o){const{variations:n=[]}=t;if(n.length){const o=ot(e,t);a.push(...n.map(o))}}const c=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},u=i.reduce(c,{core:[],noncore:[]}),d=a.reduce(c,{core:[],noncore:[]});return[...u.core,...d.core,...u.noncore,...d.noncore,...l]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,St(e),(0,r.getBlockTypes)()])),st=O(((e,t,n=null)=>{const o=lt(e,{buildScope:"transform"}),l=(0,r.getBlockTypes)().filter((t=>nt(e,t,n))).map(o),i=(0,u.mapKeys)(l,(({name:e})=>e)),s=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>(i[null==t?void 0:t.name]&&e.push(i[t.name]),e)),[]);return(0,u.orderBy)(s,(e=>i[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),at=O(((e,t=null)=>!!(0,u.some)((0,r.getBlockTypes)(),(n=>nt(e,n,t)))||qe(e,"core/block",t)&&St(e).length>0),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,St(e),(0,r.getBlockTypes)()])),ct=O(((e,t=null)=>{if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>nt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),ut=O(((e,t=null)=>{var n,o;if(!t)return;const r=null===(n=e.blockListSettings[t])||void 0===n?void 0:n.__experimentalDefaultBlock,l=null===(o=e.blockListSettings[t])||void 0===o?void 0:o.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(W(e,t))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),dt=O(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((({name:e})=>e===t));return n?{...n,blocks:(0,r.parse)(n.content)}:null}),(e=>[e.settings.__experimentalBlockPatterns])),pt=O((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=bt(e);return t.map((({name:t})=>dt(e,t))).filter((({blocks:e})=>((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!Ke(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(e,n)))}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),mt=O(((e,t=null)=>{const n=pt(e);return(0,u.filter)(n,(({blocks:n})=>n.every((({name:n})=>Ye(e,n,t)))))}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),ft=O(((e,t,n=null)=>{if(!t)return V;const o=mt(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...mt.getDependants(e,t)])),gt=O(((e,t,n=null)=>{if(!t)return V;if(t.some((({clientId:t,innerBlocks:n})=>n.length||Tt(e,t))))return V;const o=Array.from(new Set(t.map((({name:e})=>e))));return ft(e,o,n)}),((e,t)=>[...ft.getDependants(e,t)]));function ht(e,t){return e.blockListSettings[t]}function bt(e){return e.settings}function vt(e){return e.blocks.isPersistentChange}const kt=O(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),_t=O(((e,t)=>{const n=(0,u.find)(St(e),(e=>e.id===t));return n?(0,r.parse)("string"==typeof n.content.raw?n.content.raw:n.content):null}),(e=>[St(e)])),yt=O(((e,t)=>{var n;const o=(0,u.find)(St(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[St(e)]));function Et(e){return e.blocks.isIgnoredChange}function Ct(e){return e.lastBlockAttributesChange}function St(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:V}function wt(e){return e.isNavigationMode}function Bt(e){return e.hasBlockMovingClientId}function It(e){return!!e.automaticChangeStatus}function xt(e,t){return e.highlightedBlock===t}function Tt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Nt=O(((e,t)=>{if(!t.length)return null;const n=ie(e);if(t.includes(H(e,n)))return n;const o=ve(e),r=ue(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Pt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Rt=window.wp.a11y,Mt=window.wp.richText,Lt=window.wp.deprecated,At=n.n(Lt),Dt={SLEEP:({duration:e})=>new Promise((t=>{setTimeout(t,e)})),MARK_AUTOMATIC_CHANGE_FINAL_CONTROL:(0,m.createRegistryControl)((e=>()=>{const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>e.dispatch(Wn).__unstableMarkAutomaticChangeFinal()))}))};const Ot="core/block-editor";function*Ft(){if(0===(yield m.controls.select(Ot,"getBlockCount"))){const{__unstableHasCustomAppender:e}=yield m.controls.select(Ot,"getSettings");if(e)return;return yield In()}}function*zt(e){return yield{type:"RESET_BLOCKS",blocks:e},yield*Vt(e)}function*Vt(e){const t=yield m.controls.select(Ot,"getTemplate"),n=yield m.controls.select(Ot,"getTemplateLock"),o=!t||"all"!==n||(0,r.doBlocksMatchTemplate)(e,t);if(o!==(yield m.controls.select(Ot,"isValidTemplate")))return yield pn(o),o}function Ht(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Ut(e){return At()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Gt(e,t,n=!1){return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function Wt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function $t(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}function*jt(e){const t=yield m.controls.select(Ot,"getPreviousBlockClientId",e);if(t)return yield $t(t,-1),[t]}function*Kt(e){const t=yield m.controls.select(Ot,"getNextBlockClientId",e);if(t)return yield $t(t),[t]}function qt(){return{type:"START_MULTI_SELECT"}}function Yt(){return{type:"STOP_MULTI_SELECT"}}function*Zt(e,t){if((yield m.controls.select(Ot,"getBlockRootClientId",e))!==(yield m.controls.select(Ot,"getBlockRootClientId",t)))return;yield{type:"MULTI_SELECT",start:e,end:t};const n=yield m.controls.select(Ot,"getSelectedBlockCount");(0,Rt.speak)((0,g.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
(0,g._n)("%s block selected.","%s blocks selected.",n),n),"assertive")}function Xt(){return{type:"CLEAR_SELECTED_BLOCK"}}function Qt(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Jt(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}function*en(e,t,n,o=0,r){e=(0,u.castArray)(e),t=Jt((0,u.castArray)(t),yield m.controls.select(Ot,"getSettings"));const l=yield m.controls.select(Ot,"getBlockRootClientId",(0,u.first)(e));for(let e=0;e<t.length;e++){const n=t[e];if(!(yield m.controls.select(Ot,"canInsertBlockType",n.name,l)))return}yield{type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r},yield*Ft()}function tn(e,t){return en(e,t)}function nn(e){return function*(t,n){(yield m.controls.select(Ot,"canMoveBlocks",t,n))&&(yield{clientIds:(0,u.castArray)(t),type:e,rootClientId:n})}}const on=nn("MOVE_BLOCKS_DOWN"),rn=nn("MOVE_BLOCKS_UP");function*ln(e,t="",n="",o){const r=yield m.controls.select(Ot,"canMoveBlocks",e,t),l=yield m.controls.select(Ot,"canRemoveBlocks",e,t);if(!r)return;const i={type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o};t!==n?l&&(yield m.controls.select(Ot,"canInsertBlocks",e,n))&&(yield i):yield i}function*sn(e,t="",n="",o){yield ln([e],t,n,o)}function an(e,t,n,o=!0,r){return cn([e],t,n,o,0,r)}function*cn(e,t,n,o=!0,r=0,l){(0,u.isObject)(r)&&(l=r,r=0,At()("meta argument in wp.data.dispatch('core/block-editor')",{since:"10.1",plugin:"Gutenberg",hint:"The meta argument is now the 6th argument of the function"})),e=Jt((0,u.castArray)(e),yield m.controls.select(Ot,"getSettings"));const i=[];for(const t of e)(yield m.controls.select(Ot,"canInsertBlockType",t.name,n))&&i.push(t);if(i.length)return{type:"INSERT_BLOCKS",blocks:i,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l}}function un(e,t,n={}){const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function dn(){return{type:"HIDE_INSERTION_POINT"}}function pn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}function*mn(){yield{type:"SYNCHRONIZE_TEMPLATE"};const e=yield m.controls.select(Ot,"getBlocks"),t=yield m.controls.select(Ot,"getTemplate"),n=(0,r.synchronizeBlocksWithTemplate)(e,t);return yield zt(n)}function*fn(e,t){const n=[e,t];yield{type:"MERGE_BLOCKS",blocks:n};const[o,l]=n,i=yield m.controls.select(Ot,"getBlock",o),s=(0,r.getBlockType)(i.name);if(s&&!s.merge)return void(yield $t(i.clientId));const a=yield m.controls.select(Ot,"getBlock",l),c=(0,r.getBlockType)(a.name),{clientId:d,attributeKey:p,offset:f}=yield m.controls.select(Ot,"getSelectionStart"),g=(d===o?s:c).attributes[p],h=(d===o||d===l)&&void 0!==p&&void 0!==f&&!!g;g||("number"==typeof p?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof p):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const b=(0,r.cloneBlock)(i),v=(0,r.cloneBlock)(a);if(h){const e=d===o?b:v,t=e.attributes[p],{multiline:n,__unstableMultilineWrapperTags:r,__unstablePreserveWhiteSpace:l}=g,i=(0,Mt.insert)((0,Mt.create)({html:t,multilineTag:n,multilineWrapperTags:r,preserveWhiteSpace:l}),"",f,f);e.attributes[p]=(0,Mt.toHTMLString)({value:i,multilineTag:n,preserveWhiteSpace:l})}const k=i.name===a.name?[v]:(0,r.switchToBlockType)(v,i.name);if(!k||!k.length)return;const _=s.merge(b.attributes,k[0].attributes);if(h){const e=(0,u.findKey)(_,(e=>"string"==typeof e&&-1!==e.indexOf(""))),t=_[e],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=s.attributes[e],l=(0,Mt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),a=l.text.indexOf(""),c=(0,Mt.remove)(l,a,a+1),d=(0,Mt.toHTMLString)({value:c,multilineTag:n,preserveWhiteSpace:r});_[e]=d,yield Bn(i.clientId,e,a,a)}yield*en([i.clientId,a.clientId],[{...i,attributes:{...i.attributes,..._}},...k.slice(1)],0)}function*gn(e,t=!0){if(!e||!e.length)return;e=(0,u.castArray)(e);const n=yield m.controls.select(Ot,"getBlockRootClientId",e[0]);if(!(yield m.controls.select(Ot,"canRemoveBlocks",e,n)))return;let o;o=t?yield jt(e[0]):yield m.controls.select(Ot,"getPreviousBlockClientId",e[0]),yield{type:"REMOVE_BLOCKS",clientIds:e};const r=yield*Ft();return[o||r]}function hn(e,t){return gn([e],t)}function bn(e,t,n=!1,o=0){return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function vn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function kn(){return{type:"START_TYPING"}}function yn(){return{type:"STOP_TYPING"}}function En(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Cn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Sn(){return{type:"ENTER_FORMATTED_TEXT"}}function wn(){return{type:"EXIT_FORMATTED_TEXT"}}function Bn(e,t,n,o){return{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}}function In(e,t,n){const o=(0,r.getDefaultBlockName)();if(o)return an((0,r.createBlock)(o,e),n,t)}function xn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Tn(e){return{type:"UPDATE_SETTINGS",settings:e}}function Nn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Pn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Rn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}function*Mn(){yield{type:"MARK_AUTOMATIC_CHANGE"},yield{type:"MARK_AUTOMATIC_CHANGE_FINAL_CONTROL"}}function Ln(){return{type:"MARK_AUTOMATIC_CHANGE_FINAL"}}function*An(e=!0){yield{type:"SET_NAVIGATION_MODE",isNavigationMode:e},e?(0,Rt.speak)((0,g.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Rt.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}function*Dn(e=null){yield{type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e},e&&(0,Rt.speak)((0,g.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}function*On(e,t=!0){if(!e&&!e.length)return;const n=yield m.controls.select(Ot,"getBlocksByClientId",e),o=yield m.controls.select(Ot,"getBlockRootClientId",e[0]);if((0,u.some)(n,(e=>!e)))return;const l=n.map((e=>e.name));if((0,u.some)(l,(e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const i=yield m.controls.select(Ot,"getBlockIndex",(0,u.last)((0,u.castArray)(e)),o),s=n.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return yield cn(s,i+1,o,t),s.length>1&&t&&(yield Zt((0,u.first)(s).clientId,(0,u.last)(s).clientId)),s.map((e=>e.clientId))}function*Fn(e){if(!e)return;const t=yield m.controls.select(Ot,"getBlockRootClientId",e);if(yield m.controls.select(Ot,"getTemplateLock",t))return;const n=yield m.controls.select(Ot,"getBlockIndex",e,t);return yield In({},t,n)}function*zn(e){if(!e)return;const t=yield m.controls.select(Ot,"getBlockRootClientId",e);if(yield m.controls.select(Ot,"getTemplateLock",t))return;const n=yield m.controls.select(Ot,"getBlockIndex",e,t);return yield In({},t,n+1)}function Vn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}function*Hn(e){yield Vn(e,!0),yield{type:"SLEEP",duration:150},yield Vn(e,!1)}function Un(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const Gn={reducer:M,selectors:e,actions:t,controls:Dt},Wn=(0,m.createReduxStore)(Ot,{...Gn,persist:["preferences"]});(0,m.registerStore)(Ot,{...Gn,persist:["preferences"]});const $n={name:"",isSelected:!1},jn=(0,s.createContext)($n),{Provider:Kn}=jn;function qn(){return(0,s.useContext)(jn)}function Yn(){const{isSelected:e,clientId:t,name:n}=qn();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Wn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function Zn({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const l=function(e,t){const n=Yn(),{clientId:o}=qn(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(Wn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(e,o);return l?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(l,null,(o=>{const r=(0,u.isEmpty)(o)?null:o;return(0,s.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===e&&(0,s.createElement)(p.ToolbarGroup,{controls:t}),n)}))):null}function Xn({group:e="default",...t}){const n=(0,s.useContext)(p.__experimentalToolbarContext),o=f[e].Slot,r=(0,p.__experimentalUseSlot)(o.__unstableName);return Boolean(r.fills&&r.fills.length)?"default"===e?(0,s.createElement)(o,i({},t,{bubblesVirtually:!0,fillProps:n})):(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(o,i({},t,{bubblesVirtually:!0,fillProps:n}))):null}const Qn=Zn;Qn.Slot=Xn;const Jn=e=>(0,s.createElement)(Zn,i({group:"inline"},e));Jn.Slot=e=>(0,s.createElement)(Xn,i({group:"inline"},e));var eo=Qn,to=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),no=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),oo=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),ro=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),lo=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),io=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),so=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),ao=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),co=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),uo=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));function po(e,t=""){return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const mo={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0:e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>void 0===e.fontSizes?void 0:e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.customLineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.customPadding":e=>e.enableCustomSpacing};function fo(e){const{name:t}=qn();return(0,m.useSelect)((n=>{var o;const l=n(Wn).getSettings(),i=`__experimentalFeatures.${e}`,s=`__experimentalFeatures.blocks.${t}.${e}`,a=null!==(o=(0,u.get)(l,s))&&void 0!==o?o:(0,u.get)(l,i);var c,d;if(void 0!==a)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[e]?null!==(c=null!==(d=a.user)&&void 0!==d?d:a.theme)&&void 0!==c?c:a.core:a;const p=mo[e]?mo[e](l):void 0;return void 0!==p?p:"typography.dropCap"===e||void 0}),[t,e])}const go={left:so,center:ao,right:co,"space-between":uo};var ho=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:o,popoverProps:r,isToolbar:l}){const a=e=>{n(e===o?void 0:e)},c=o?go[o]:go.left,u=[{name:"left",icon:so,title:(0,g.__)("Justify items left"),isActive:"left"===o,onClick:()=>a("left")},{name:"center",icon:ao,title:(0,g.__)("Justify items center"),isActive:"center"===o,onClick:()=>a("center")},{name:"right",icon:co,title:(0,g.__)("Justify items right"),isActive:"right"===o,onClick:()=>a("right")},{name:"space-between",icon:uo,title:(0,g.__)("Space between items"),isActive:"space-between"===o,onClick:()=>a("space-between")}],d=l?p.ToolbarGroup:p.ToolbarDropdownMenu,m=l?{isCollapsed:t}:{};return(0,s.createElement)(d,i({icon:c,popoverProps:r,label:(0,g.__)("Change items justification"),controls:u.filter((t=>e.includes(t.name)))},m))};function bo(e){return(0,s.createElement)(ho,i({},e,{isToolbar:!1}))}function vo(e){return(0,s.createElement)(ho,i({},e,{isToolbar:!0}))}const ko={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"};var _o={name:"flex",label:(0,g.__)("Flex"),inspectorControls:function({layout:e={},onChange:t}){return(0,s.createElement)(Eo,{layout:e,onChange:t})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){return null!=n&&n.allowSwitching?null:(0,s.createElement)(eo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Eo,{layout:e,onChange:t,isToolbar:!0}))},save:function({selector:e,layout:t}){const n=null!==fo("spacing.blockGap"),o=ko[t.justifyContent]||"flex-start";return(0,s.createElement)("style",null,`\n\t\t\t\t${po(e)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tgap: ${n?"var( --wp--style--block-gap, 0.5em )":"0.5em"};\n\t\t\t\t\tflex-wrap: wrap;\n\t\t\t\t\talign-items: center;\n\t\t\t\t\tflex-direction: row;\n\t\t\t\t\tjustify-content: ${o};\n\t\t\t\t}\n\n\t\t\t\t${po(e,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation:()=>"horizontal",getAlignments:()=>[]};const yo=[{value:"left",icon:so,label:(0,g.__)("Justify items left")},{value:"center",icon:ao,label:(0,g.__)("Justify items center")},{value:"right",icon:co,label:(0,g.__)("Justify items right")},{value:"space-between",icon:uo,label:(0,g.__)("Space between items")}];function Eo({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:o="left"}=e,r=n=>{t({...e,justifyContent:n})};return n?(0,s.createElement)(bo,{allowedControls:["left","center","right","space-between"],value:o,onChange:r,popoverProps:{position:"bottom right",isAlternate:!0}}):(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,g.__)("Justification")),(0,s.createElement)("div",null,yo.map((({value:e,icon:t,label:n})=>(0,s.createElement)(p.Button,{key:e,label:n,icon:t,isPressed:o===e,onClick:()=>r(e)})))))}var Co=function({icon:e,size:t=24,...n}){return(0,s.cloneElement)(e,{width:t,height:t,...n})};const So=[{name:"default",label:(0,g.__)("Flow"),inspectorControls:function({layout:e,onChange:t}){const{wideSize:n,contentSize:o}=e,r=(0,p.__experimentalUseCustomUnits)({availableUnits:fo("spacing.units")||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:o||n||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:r}),(0,s.createElement)(Co,{icon:oo})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:n||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:r}),(0,s.createElement)(Co,{icon:lo}))),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,s.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!o&&!n,onClick:()=>t({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,g.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,g.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function({selector:e,layout:t={}}){const{contentSize:n,wideSize:o}=t,r=null!==fo("spacing.blockGap");let l=n||o?`\n\t\t\t\t\t${po(e,"> *")} {\n\t\t\t\t\t\tmax-width: ${null!=n?n:o};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\n\t\t\t\t\t${po(e,'> [data-align="wide"]')} {\n\t\t\t\t\t\tmax-width: ${null!=o?o:n};\n\t\t\t\t\t}\n\n\t\t\t\t\t${po(e,'> [data-align="full"]')} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return l+=`\n\t\t\t${po(e,'> [data-align="left"]')} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-right: 2em;\n\t\t\t}\n\n\t\t\t${po(e,'> [data-align="right"]')} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-left: 2em;\n\t\t\t}\n\n\t\t`,r&&(l+=`\n\t\t\t\t${po(e,"> *")} {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t}\n\t\t\t\t${po(e,"> * + *")} {\n\t\t\t\t\tmargin-top: var( --wp--style--block-gap );\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,l)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
|
4 |
// translators: %s: container size (i.e. 600px etc)
|
@@ -57,32 +57,32 @@ function am({colors:e,gradients:t,label:n,currentTab:o,colorValue:r,gradientValu
|
|
57 |
(0,g.__)("%1$s %2$s"),o,t);e.push({key:`${n}-${r}`,name:l,style:{fontStyle:n,fontWeight:r}})}))})),e})():n?(()=>{const e=[a];return Tf.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[a];return Nf.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})})),e})()),[e.options]),u=c.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||c[0];return i&&(0,s.createElement)(p.CustomSelectControl,{className:"components-font-appearance-control",label:n?o?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight"),describedBy:u?n?o?(0,g.sprintf)(// translators: %s: Currently selected font appearance.
|
58 |
(0,g.__)("Currently selected font appearance: %s"),u.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
|
59 |
(0,g.__)("Currently selected font style: %s"),u.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
|
60 |
-
(0,g.__)("Currently selected font weight: %s"),u.name):(0,g.__)("No selected font appearance"),options:c,value:u,onChange:({selectedItem:e})=>t(e.style)})}const Rf="typography.__experimentalFontStyle",Mf="typography.__experimentalFontWeight";function Lf(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Af(e),i=!Df(e);if(!l&&!i)return null;const a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,c=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,s.createElement)(Pf,{onChange:e=>{r({style:$o({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function Af({name:e}={}){const t=(0,r.hasBlockSupport)(e,Rf),n=fo("typography.customFontStyle");return!t||!n}function Df({name:e}={}){const t=(0,r.hasBlockSupport)(e,Mf),n=fo("typography.customFontWeight");return!t||!n}function Of(e){const t=Af(e),n=Df(e);return t&&n}function Ff({value:e="",onChange:t,fontFamilies:n,...o}){const r=fo("typography.fontFamilies");if(n||(n=r),(0,u.isEmpty)(n))return null;const l=[{value:"",label:(0,g.__)("Default")},...n.map((({fontFamily:e,name:t})=>({value:e,label:t||e})))];return(0,s.createElement)(p.SelectControl,i({label:(0,g.__)("Font family"),options:l,value:e,onChange:t,labelPosition:"top"},o))}const zf="typography.__experimentalFontFamily";function Vf(e,t,n){if(!(0,r.hasBlockSupport)(t,zf))return e;if((0,r.hasBlockSupport)(t,"__experimentalSkipTypographySerialization"))return e;if(null==n||!n.fontFamily)return e;const o=new(Wd())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}function Hf({name:e,setAttributes:t,attributes:{fontFamily:n}}){var o;const r=fo("typography.fontFamilies");if(Uf({name:e}))return null;const l=null===(o=(0,u.find)(r,(({slug:e})=>n===e)))||void 0===o?void 0:o.fontFamily;return(0,s.createElement)(Ff,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const n=(0,u.find)(r,(({fontFamily:t})=>t===e));t({fontFamily:null==n?void 0:n.slug})}})}function Uf({name:e}){const t=fo("typography.fontFamilies");return!t||0===t.length||!(0,r.hasBlockSupport)(e,zf)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,zf)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Vf),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,zf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Vf(o,e,n)},e}));const Gf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Wf(e,t){return(0,u.find)(e,{size:t})||{size:t}}function $f(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var jf=function(e){const t=fo("typography.fontSizes"),n=!fo("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Kf="typography.fontSize";function qf(e,t,n){if(!(0,r.hasBlockSupport)(t,Kf))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const o=new(Wd())(e.className);o.add($f(n.fontSize));const l=o.value;return e.className=l||void 0,e}function Yf(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=Zf(e),a=fo("typography.fontSizes");if(i)return null;const c=Gf(a,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),u=(null==c?void 0:c.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(jf,{onChange:e=>{const t=Wf(a,e).slug;l({style:$o({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:u})}function Zf({name:e}={}){const t=fo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,Kf)||!n}const Xf=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=fo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,Kf)||(0,r.hasBlockSupport)(i,"typography.__experimentalSkipSerialization")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=Gf(l,a,null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return(0,s.createElement)(e,p)}),"withFontSizeInlineStyles");function Qf({value:e,onChange:t}){const n=(0,p.__experimentalUseCustomUnits)({availableUnits:fo("spacing.units")||["px","em","rem"],defaultValues:{px:"2",em:".2",rem:".2"}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter-spacing"),value:e,__unstableInputWidth:"60px",units:n,onChange:t})}(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Kf)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",qf),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Kf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),qf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Xf);const Jf="typography.__experimentalLetterSpacing";function eg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return tg(e)?null:(0,s.createElement)(Qf,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:$o({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})}})}function tg({name:e}={}){const t=!(0,r.hasBlockSupport)(e,Jf),n=fo("typography.customLetterSpacing");return t||!n}const ng=[Bf,Kf,Rf,Mf,zf,mf,yf,Jf];function og(e){const t=function(e={}){const t=[Of(e),Zf(e),xf(e),Uf(e),gf(e),Cf(e),tg(e)];return t.filter(Boolean).length===t.length}(e),n=rg(e.name);return t||!n?null:(0,s.createElement)(Xo,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Typography")},(0,s.createElement)(Hf,e),(0,s.createElement)(Yf,e),(0,s.createElement)(Lf,e),(0,s.createElement)(If,e),(0,s.createElement)(Sf,e),(0,s.createElement)(eg,e)))}const rg=e=>ng.some((t=>(0,r.hasBlockSupport)(e,t)));function lg(e){const t=(0,r.getBlockSupport)(e,fg);return!!(!0===t||null!=t&&t.blockGap)}function ig({name:e}={}){const t=!fo("spacing.blockGap");return!lg(e)||t}function sg(e){var t;const{clientId:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:fo("spacing.units")||["%","px","em","rem","vw"]}),i=Ca(n);return ig(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:e}};r({style:$o(n)});const l=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;i.current&&l&&(null===(s=i.current.parentNode)||void 0===s||s.replaceChild(i.current,i.current))},units:l,value:null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap})),native:null})}function ag(e){const t=(0,r.getBlockSupport)(e,fg);return!!(!0===t||null!=t&&t.margin)}function cg({name:e}={}){const t=!fo("spacing.customMargin"),n=!_g(e,"margin");return!ag(e)||t||n}function ug(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:fo("spacing.units")||["%","px","em","rem","vw"]}),i=kg(n,"margin"),a=i&&i.some((e=>hg.includes(e)));return cg(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:$o(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:$o(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function dg(e){const t=(0,r.getBlockSupport)(e,fg);return!!(!0===t||null!=t&&t.padding)}function pg({name:e}={}){const t=!fo("spacing.customPadding"),n=!_g(e,"padding");return!dg(e)||t||n}function mg(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:fo("spacing.units")||["%","px","em","rem","vw"]}),i=kg(n,"padding"),a=i&&i.some((e=>hg.includes(e)));return pg(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:$o(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:$o(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const fg="spacing",gg=["top","right","bottom","left"],hg=["vertical","horizontal"];function bg(e){const t=ig(e),n=pg(e),o=cg(e),l=vg(e),i=(a=e.name,"web"===s.Platform.OS&&(lg(a)||dg(a)||ag(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[fg,"__experimentalDefaultControls"]),u=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,s.createElement)(Xo,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,g.__)("Padding"),onDeselect:()=>function({attributes:e={},setAttributes:t}){const{style:n}=e;t({style:$o({...n,spacing:{...null==n?void 0:n.spacing,padding:void 0}})})}(e),resetAllFilter:u("padding"),isShownByDefault:null==c?void 0:c.padding,panelId:e.clientId},(0,s.createElement)(mg,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,g.__)("Margin"),onDeselect:()=>function({attributes:e={},setAttributes:t}){const{style:n}=e;t({style:$o({...n,spacing:{...null==n?void 0:n.spacing,margin:void 0}})})}(e),resetAllFilter:u("margin"),isShownByDefault:null==c?void 0:c.margin,panelId:e.clientId},(0,s.createElement)(ug,e)),!t&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,g.__)("Block spacing"),onDeselect:()=>function({attributes:e={},setAttributes:t}){const{style:n}=e;t({style:{...n,spacing:{...null==n?void 0:n.spacing,blockGap:void 0}}})}(e),resetAllFilter:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(sg,e)))}const vg=(e={})=>{const t=ig(e),n=pg(e),o=cg(e);return t&&n&&o};function kg(e,t){const n=(0,r.getBlockSupport)(e,fg);if(n&&"boolean"!=typeof n[t])return n[t]}function _g(e,t){const n=kg(e,t);return!(n&&n.some((e=>gg.includes(e)))&&n.some((e=>hg.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}const yg=[...ng,Om,Jm,fg],Eg=e=>yg.some((t=>(0,r.hasBlockSupport)(e,t))),Cg="var:";function Sg(e){return(0,u.startsWith)(e,Cg)?`var(--wp--${e.slice(Cg.length).split("|").join("--")})`:e}function wg(e={}){const t={};return Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((n=>{const o=r.__EXPERIMENTAL_STYLE_PROPERTY[n].value,l=r.__EXPERIMENTAL_STYLE_PROPERTY[n].properties;if((0,u.has)(e,o)&&"elements"!==(0,u.first)(o)){const r=(0,u.get)(e,o);l&&!(0,u.isString)(r)?Object.entries(l).forEach((e=>{const[n,o]=e,l=(0,u.get)(r,[o]);l&&(t[n]=Sg(l))})):t[n]=Sg((0,u.get)(e,o))}})),t}const Bg={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[Jm],"typography.__experimentalSkipSerialization":["typography"],[`${fg}.__experimentalSkipSerialization`]:["spacing"]},Ig={...Bg,[`${fg}`]:["spacing.blockGap"]};function xg(e,t,n,o=Ig){if(!Eg(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{(0,r.getBlockSupport)(t,n)&&(l=(0,u.omit)(l,e))})),e.style={...wg(l),...e.style},e}const Tg=(0,d.createHigherOrderComponent)((e=>t=>{const n=Yn();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(sf,t),(0,s.createElement)(og,t),(0,s.createElement)(Fm,t),(0,s.createElement)(bg,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Ng=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=null===(n=t.attributes.style)||void 0===n?void 0:n.elements,a=`wp-elements-${(0,d.useInstanceId)(e)}`,p=function(e,t={}){return(0,u.map)(t,((t,n)=>{const o=wg(t);return(0,u.isEmpty)(o)?"":[`.${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(a,null===(o=t.attributes.style)||void 0===o?void 0:o.elements),m=(0,s.useContext)(Kp.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,l&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:l?c()(t.className,a):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Eg(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",xg),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Eg(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),xg(o,e,n,Bg)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Tg),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Ng);var Pg=function({colorPalette:e,duotonePalette:t,disableCustomColors:n,disableCustomDuotone:o,value:r,onChange:l}){return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,g.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==fa.DOWN||(n.preventDefault(),t())},label:(0,g.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:r})}),renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Duotone")},(0,s.createElement)(p.DuotonePicker,{colorPalette:e,duotonePalette:t,disableCustomColors:n,disableCustomDuotone:o,value:r,onChange:l}))})};const Rg=[];function Mg(e=[]){const t={r:[],g:[],b:[]};return e.forEach((e=>{const n=Nc(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255)})),t}function Lg({selector:e,id:t,values:n}){const o=`\n${e} {\n\tfilter: url( #${t} );\n}\n`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:t},(0,s.createElement)("feColorMatrix",{type:"matrix",values:".299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 0 0 0 1 0"}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:n.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:n.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:n.b.join(" ")}))))),(0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:o}}))}function Ag({attributes:e,setAttributes:t}){var n;const o=null==e?void 0:e.style,r=null==o||null===(n=o.color)||void 0===n?void 0:n.duotone,l=fo("color.duotone")||Rg,i=fo("color.palette")||Rg,a=!fo("color.custom"),c=!fo("color.customDuotone")||0===(null==i?void 0:i.length)&&a;return 0===(null==l?void 0:l.length)&&c?null:(0,s.createElement)(eo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Pg,{duotonePalette:l,colorPalette:i,disableCustomDuotone:c,disableCustomColors:a,value:r,onChange:e=>{const n={...o,color:{...null==o?void 0:o.color,duotone:e}};t({style:n})}}))}Rc([Mc]);const Dg=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Ag,t))}),"withDuotoneControls"),Og=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),f=c()(null==t?void 0:t.className,p),g=(0,s.useContext)(Kp.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,g&&(0,s.createPortal)((0,s.createElement)(Lg,{selector:m,id:p,values:Mg(u)}),g),(0,s.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",Dg),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Og);const Fg="__experimentalLayout";function zg({setAttributes:e,attributes:t,name:n}){const{layout:o}=t,l=fo("layout"),i=(0,m.useSelect)((e=>{const{getSettings:t}=e(Wn);return t().supportsLayout}),[]),a=(0,r.getBlockSupport)(n,Fg,{}),{allowSwitching:c,allowEditing:u=!0,allowInheriting:d=!0,default:f}=a;if(!u)return null;const h=o||f||{},{inherit:b=!1,type:v="default"}=h;if("default"===v&&!i)return null;const k=wo(v),_=t=>e({layout:t});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xo,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},d&&!!l&&(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!b,onChange:()=>e({layout:{inherit:!b}})}),!b&&c&&(0,s.createElement)(Vg,{type:v,onChange:t=>e({layout:{type:t}})}),!b&&k&&(0,s.createElement)(k.inspectorControls,{layout:h,onChange:_,layoutBlockSupport:a}))),!b&&k&&(0,s.createElement)(k.toolBarControls,{layout:h,onChange:_,layoutBlockSupport:a}))}function Vg({type:e,onChange:t}){return(0,s.createElement)(p.ButtonGroup,null,So.map((({name:n,label:o})=>(0,s.createElement)(p.Button,{key:n,isPressed:e===n,onClick:()=>t(n)},o))))}const Hg=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Fg)&&(0,s.createElement)(zg,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Ug=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,Fg),a=(0,d.useInstanceId)(e),u=fo("layout")||{},p=(0,s.useContext)(Kp.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,Fg)||{},g=null!=m&&m.inherit?u:m||f||{},h=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(To,{selector:`.wp-container-${a}`,layout:g}),p),(0,s.createElement)(e,i({},t,{className:h})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,Fg)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Ug),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",Hg);const Gg=[];function Wg({borderColor:e,style:t}){var n;const o=(null==t?void 0:t.border)||{},r=Qp("border-color",e);return{className:c()({[r]:!!r,"has-border-color":e||(null==t||null===(n=t.border)||void 0===n?void 0:n.color)})||void 0,style:wg({border:o})}}function $g(e){const t=fo("color.palette")||Gg,n=Wg(e);if(e.borderColor){const o=Zp(t,e.borderColor);n.style.borderColor=o.color}return n}const jg=[];function Kg(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Qp("background-color",s),m=Qp("color",a),f=em(u),g=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!g&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:wg({color:(null==d?void 0:d.color)||{}})}}function qg(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=fo("color.palette")||jg,l=fo("color.gradients")||jg,i=Kg(e);if(t){const e=Zp(r,t);i.style.backgroundColor=e.color}if(o&&(i.style.background=tm(l,o)),n){const e=Zp(r,n);i.style.color=e.color}return i}function Yg(e){const{style:t}=e;return{style:wg({spacing:(null==t?void 0:t.spacing)||{}})}}const Zg=[];function Xg(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Nc(t);return(0,u.maxBy)(e,(({color:e})=>n.contrast(e))).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=Xp(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps({attributes:e,colors:t},o){return(0,u.reduce)(n,((n,r,l)=>{const i=Zp(t,e[l],e[`custom${(0,u.upperFirst)(l)}`]),s=o[l];return(null==s?void 0:s.color)===i.color&&s?n[l]=s:n[l]={...i,class:Qp(r,i.slug)},n}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Qg(e){return(...t)=>{const n=(e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"))(e);return(0,d.createHigherOrderComponent)(Xg(t,n),"withCustomColors")}}function Jg(...e){const t=(0,d.createHigherOrderComponent)((e=>t=>{const n=fo("color.palette")||Zg;return(0,s.createElement)(e,i({},t,{colors:n}))}),"withEditorColorPalette");return(0,d.createHigherOrderComponent)(Xg(e,t),"withColors")}const eh=[];var th=(...e)=>{const t=(0,u.reduce)(e,((e,t)=>(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=fo("typography.fontSizes")||eh;return(0,s.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(t,((e,t,n)=>(e[`set${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps({attributes:e,fontSizes:n},o){const r=(t,n)=>!o[n]||(e[n]?e[n]!==o[n].slug:o[n].size!==e[t]);if(!(0,u.some)(t,r))return null;const l=(0,u.reduce)((0,u.pickBy)(t,r),((t,o,r)=>{const l=e[r],i=Gf(n,l,e[o]);return t[r]={...i,class:$f(l)},t}),{});return{...o,...l}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},nh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),oh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),rh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const lh=[{icon:nh,title:(0,g.__)("Align text left"),align:"left"},{icon:oh,title:(0,g.__)("Align text center"),align:"center"},{icon:rh,title:(0,g.__)("Align text right"),align:"right"}],ih={position:"bottom right",isAlternate:!0};var sh=function({value:e,onChange:t,alignmentControls:n=lh,label:o=(0,g.__)("Align"),describedBy:r=(0,g.__)("Change text alignment"),isCollapsed:l=!0,isToolbar:a}){function c(n){return()=>t(e===n?void 0:n)}const d=(0,u.find)(n,(t=>t.align===e)),m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,f=a?{isCollapsed:l}:{};return(0,s.createElement)(m,i({icon:d?d.icon:(0,g.isRTL)()?rh:nh,label:o,toggleProps:{describedBy:r,className:d?"is-pressed":void 0},popoverProps:ih,controls:n.map((t=>{const{align:n}=t,o=e===n;return{...t,isActive:o,role:l?"menuitemradio":void 0,onClick:c(n)}}))},f))};function ah(e){return(0,s.createElement)(sh,i({},e,{isToolbar:!1}))}function ch(e){return(0,s.createElement)(sh,i({},e,{isToolbar:!0}))}var uh={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(Wn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=ku(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?Ku(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]);return[(0,s.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(za,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}};const dh=[];function ph({completers:e=dh}){const{name:t}=qn();return(0,s.useMemo)((()=>{let n=e;return(t===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(t,"__experimentalSlashInserter",!1))&&(n=n.concat([uh])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(n===e&&(n=n.map(u.clone)),n=(0,l.applyFilters)("editor.Autocomplete.completers",n,t)),n}),[e,t])}var mh=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:ph(e)}))},fh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"})),gh=function({isActive:e,label:t=(0,g.__)("Toggle full height"),onToggle:n,isDisabled:o}){return(0,s.createElement)(p.ToolbarButton,{isActive:e,icon:fh,label:t,onClick:()=>n(!e),disabled:o})},hh=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",a=`${i}__popover`;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:a,isAlternate:!0},renderToggle:({onToggle:e,isOpen:n})=>(0,s.createElement)(p.ToolbarButton,{onClick:e,"aria-haspopup":"true","aria-expanded":n,onKeyDown:t=>{n||t.keyCode!==fa.DOWN||(t.preventDefault(),e())},label:t,icon:l,showTooltip:!0,disabled:r}),renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},bh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),vh=function({rootLabelText:e}){const{selectBlock:t,clearSelectedBlock:n}=(0,m.useDispatch)(Wn),{clientId:o,parents:r,hasSelection:l}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Wn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),i=e||(0,g.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,g.__)("Block breadcrumb")},(0,s.createElement)("li",{className:l?void 0:"block-editor-block-breadcrumb__current","aria-current":l?void 0:"true"},l&&(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:n},i),!l&&i,!!o&&(0,s.createElement)(Co,{icon:bh,className:"block-editor-block-breadcrumb__separator"})),r.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>t(e)},(0,s.createElement)(_d,{clientId:e})),(0,s.createElement)(Co,{icon:bh,className:"block-editor-block-breadcrumb__separator"})))),!!o&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(_d,{clientId:o})))};function kh({clientId:e,tagName:t="div",wrapperProps:n,className:o}){const[r,l]=(0,s.useState)(!0),[a,u]=(0,s.useState)(!1),{isParentSelected:d,hasChildSelected:p,isDraggingBlocks:f,isParentHighlighted:g}=(0,m.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l}=t(Wn);return{isParentSelected:n(e),hasChildSelected:o(e,!0),isDraggingBlocks:r(),isParentHighlighted:l(e)}}),[e]),h=c()("block-editor-block-content-overlay",null==n?void 0:n.className,o,{"overlay-active":r,"parent-highlighted":g,"is-dragging-blocks":f});return(0,s.useEffect)((()=>{d||p||r||l(!0),d&&!a&&r&&l(!1),p&&r&&l(!1)}),[d,p,r,a]),(0,s.createElement)(t,i({},n,{className:h,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onMouseUp:r?()=>l(!1):void 0}),null==n?void 0:n.children)}const _h=()=>(0,s.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),yh=({style:e,className:t})=>(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e},(0,s.createElement)(_h,null))),Eh=({TextColor:e,BackgroundColor:t})=>({onToggle:n,isOpen:o})=>(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,g.__)("Open Colors Selector"),onClick:n,onKeyDown:e=>{o||e.keyCode!==fa.DOWN||(e.preventDefault(),n())},icon:(0,s.createElement)(t,null,(0,s.createElement)(e,null,(0,s.createElement)(yh,null)))}));var Ch=({children:e,...t})=>(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Eh(t),renderContent:()=>e}),Sh=(0,s.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(F.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const wh=Js(p.__experimentalTreeGridRow);function Bh({isSelected:e,position:t,level:n,rowCount:o,children:r,className:l,path:a,...u}){const d=na({isSelected:e,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:a.join("_")});return(0,s.createElement)(wh,i({ref:d,className:c()("block-editor-list-view-leaf",l),level:n,positionInSet:t,setSize:o},u),r)}const Ih=(e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e;function xh({onClick:e}){return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(Co,{icon:bh}))}var Th=(0,s.forwardRef)((function e({className:t,block:{clientId:n},isSelected:o,onClick:r,onToggleExpanded:l,position:i,siblingBlockCount:a,level:u,tabIndex:m,onFocus:f,onDragStart:h,onDragEnd:b,draggable:v},k){const _=kd(n),y=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,E=((e,t,n)=>(0,g.sprintf)(
|
61 |
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
62 |
-
(0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(i,a,u);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",t),onClick:r,"aria-describedby":y,ref:k,tabIndex:m,onFocus:f,onDragStart:h,onDragEnd:b,draggable:v},(0,s.createElement)(
|
63 |
/* translators: 1: The numerical position of the block that will be inserted. 2: The level of nesting for the block that will be inserted. */
|
64 |
-
(0,g.__)("Add block at position %1$d, Level %2$d"),t,n);return(0,s.createElement)(
|
65 |
-
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e}))}var Gh=(0,s.forwardRef)((function({isDisabled:e,__experimentalFeatures:t,...n},o){const r=(0,m.useSelect)((e=>!!e(Wn).getBlockCount()),[])&&!e;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(Uh,i({},n,{innerRef:o,isOpen:e,onToggle:t,isEnabled:r})),renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,g.__)("List view")),(0,s.createElement)(Hh,{showNestedBlocks:!0,showOnlyCurrentHierarchy:!0,__experimentalFeatures:t}))})})),Wh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"})),$h=function({icon:e=Wh,label:t=(0,g.__)("Choose variation"),instructions:n=(0,g.__)("Select a variation to start with."),variations:o,onSelect:r,allowSkip:l}){const i=c()("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,s.createElement)(p.Placeholder,{icon:e,label:t,instructions:n,className:i},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,g.__)("Block variations")},o.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>r(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),l&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(p.Button,{variant:"link",onClick:()=>r()},(0,g.__)("Skip"))))},jh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));const Kh="carousel",qh="grid",Yh=({onStartBlank:e,onBlockPatternSelect:t})=>(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(p.Button,{onClick:e},(0,g.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:t},(0,g.__)("Choose"))),Zh=({handlePrevious:e,handleNext:t,activeSlide:n,totalSlides:o})=>(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(p.Button,{icon:Bd,label:(0,g.__)("Previous pattern"),onClick:e,disabled:0===n}),(0,s.createElement)(p.Button,{icon:wd,label:(0,g.__)("Next pattern"),onClick:t,disabled:n===o-1}));var Xh=({viewMode:e,setViewMode:t,handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:l,onBlockPatternSelect:i,onStartBlank:a})=>{const c=e===Kh,u=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:io,label:(0,g.__)("Carousel view"),onClick:()=>t(Kh),isPressed:c}),(0,s.createElement)(p.Button,{icon:jh,label:(0,g.__)("Grid view"),onClick:()=>t(qh),isPressed:e===qh}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},c&&(0,s.createElement)(Zh,{handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:l}),u,c&&(0,s.createElement)(Yh,{onBlockPatternSelect:i,onStartBlank:a}))};const Qh=({viewMode:e,activeSlide:t,patterns:n,onBlockPatternSelect:o})=>{const r=(0,p.__unstableUseCompositeState)(),l="block-editor-block-pattern-setup__container";if(e===Kh){const e=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,s.createElement)("div",{className:l},(0,s.createElement)("ul",{className:"carousel-container"},n.map(((t,n)=>(0,s.createElement)(eb,{className:e.get(n)||"",key:t.name,pattern:t})))))}return(0,s.createElement)(p.__unstableComposite,i({},r,{role:"listbox",className:l,"aria-label":(0,g.__)("Patterns list")}),n.map((e=>(0,s.createElement)(Jh,{key:e.name,pattern:e,onSelect:o,composite:r}))))};function Jh({pattern:e,onSelect:t,composite:n}){const o="block-editor-block-pattern-setup-list",{blocks:r,title:l,description:a,viewportWidth:c=700}=e,u=(0,d.useInstanceId)(Jh,`${o}__item-description`);return(0,s.createElement)("div",{className:`${o}__list-item`,"aria-label":e.title,"aria-describedby":e.description?u:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},n,{className:`${o}__item`,onClick:()=>t(r)}),(0,s.createElement)(iu,{blocks:r,viewportWidth:c}),(0,s.createElement)("div",{className:`${o}__item-title`},l)),!!a&&(0,s.createElement)(p.VisuallyHidden,{id:u},a))}function eb({className:e,pattern:t}){const{blocks:n,title:o,description:r}=t,l=(0,d.useInstanceId)(eb,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${e}`,"aria-label":o,"aria-describedby":r?l:void 0},(0,s.createElement)(iu,{blocks:n,__experimentalLive:!0}),!!r&&(0,s.createElement)(p.VisuallyHidden,{id:l},r))}var tb=({clientId:e,blockName:t,filterPatternsFn:n,startBlankComponent:o,onBlockPatternSelect:l})=>{const[i,a]=(0,s.useState)(Kh),[c,u]=(0,s.useState)(0),[d,p]=(0,s.useState)(!1),{replaceBlock:f}=(0,m.useDispatch)(Wn),g=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Wn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(e,t,n);if(null==g||!g.length||d)return o;const h=l||(t=>{const n=t.map((e=>(0,r.cloneBlock)(e)));f(e,n)});return(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${i}`},(0,s.createElement)(Xh,{viewMode:i,setViewMode:a,activeSlide:c,totalSlides:g.length,handleNext:()=>{u((e=>e+1))},handlePrevious:()=>{u((e=>e-1))},onBlockPatternSelect:()=>{h(g[c].blocks)},onStartBlank:()=>{p(!0)}}),(0,s.createElement)(Qh,{viewMode:i,activeSlide:c,patterns:g,onBlockPatternSelect:h}))};const nb=(e,t)=>{if(!t||!e)return;const n=t.filter((({attributes:t})=>!(!t||!Object.keys(t).length)&&(0,u.isMatch)(e,t)));return 1===n.length?n[0]:void 0};var ob=function({blockClientId:e}){const[t,n]=(0,s.useState)(),{updateBlockAttributes:o}=(0,m.useDispatch)(Wn),{variations:l,blockAttributes:i}=(0,m.useSelect)((t=>{const{getBlockVariations:n}=t(r.store),{getBlockName:o,getBlockAttributes:l}=t(Wn),i=e&&o(e);return{variations:i&&n(i,"transform"),blockAttributes:l(e)}}),[e]);if((0,s.useEffect)((()=>{var e;n(null===(e=nb(i,l))||void 0===e?void 0:e.name)}),[i,l]),null==l||!l.length)return null;const a=l.map((({name:e,title:t,description:n})=>({value:e,label:t,info:n}))),c=t=>{o(e,{...l.find((({name:e})=>e===t)).attributes})},u="block-editor-block-variation-transforms";return(0,s.createElement)(p.DropdownMenu,{className:u,label:(0,g.__)("Transform to variation"),text:(0,g.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${u}__popover`},icon:xd,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${u}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:a,value:t,onSelect:c})))))};const rb=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),lb=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),ib={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,g._x)("Align top","Block vertical alignment setting")},center:{icon:lb,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:rb,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},sb=["top","center","bottom"],ab={isAlternate:!0};var cb=function({value:e,onChange:t,controls:n=sb,isCollapsed:o=!0,isToolbar:r}){const l=ib[e],a=ib.top,c=r?p.ToolbarGroup:p.ToolbarDropdownMenu,u=r?{isCollapsed:o}:{};return(0,s.createElement)(c,i({popoverProps:ab,icon:l?l.icon:a.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((n=>{return{...ib[n],isActive:e===n,role:o?"menuitemradio":void 0,onClick:(r=n,()=>t(e===r?void 0:r))};var r}))},u))};function ub(e){return(0,s.createElement)(cb,i({},e,{isToolbar:!1}))}function db(e){return(0,s.createElement)(cb,i({},e,{isToolbar:!0}))}var pb=(0,d.createHigherOrderComponent)((e=>t=>{const n=fo("color.palette"),o=!fo("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,u.isEmpty)(r)||!l;return(0,s.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:a}))}),"withColorContext"),mb=pb(p.ColorPalette);function fb({onChange:e,value:t,...n}){return(0,s.createElement)(dm,i({},n,{onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0}))}var gb=function(e,t){return(gb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},hb=function(){return(hb=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}).apply(this,arguments)};function bb(e,t,n,o){void 0===o&&(o=0);var r=xb(e,t,o),l=r.width,i=r.height;return e>=t*n&&l>t*n?{width:t*n,height:t}:l>t*n?{width:e,height:e/n}:l>i*n?{width:i*n,height:i}:{width:l,height:l/n}}function vb(e,t,n,o,r){void 0===r&&(r=0);var l=xb(t.width,t.height,r),i=l.width,s=l.height;return{x:kb(e.x,i,n.width,o),y:kb(e.y,s,n.height,o)}}function kb(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function _b(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function yb(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Eb(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?Cb:Sb,a={x:s(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:s(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:s(100,n.width/t.width*100/r),height:s(100,n.height/t.height*100/r)},c=Math.round(s(t.naturalWidth,a.width*t.naturalWidth/100)),u=Math.round(s(t.naturalHeight,a.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:a,croppedAreaPixels:hb(hb({},d),{x:Math.round(s(t.naturalWidth-d.width,a.x*t.naturalWidth/100)),y:Math.round(s(t.naturalHeight-d.height,a.y*t.naturalHeight/100))})}}function Cb(e,t){return Math.min(e,Math.max(0,t))}function Sb(e,t){return t}function wb(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function Bb(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Ib(e,t,n,o,r){var l=Math.cos,i=Math.sin,s=r*Math.PI/180;return[(e-n)*l(s)-(t-o)*i(s)+n,(e-n)*i(s)+(t-o)*l(s)+o]}function xb(e,t,n){var o=e/2,r=t/2,l=[Ib(0,0,o,r,n),Ib(e,0,o,r,n),Ib(e,t,o,r,n),Ib(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),s=Math.max.apply(Math,l.map((function(e){return e[0]}))),a=Math.min.apply(Math,l.map((function(e){return e[1]})));return{width:s-i,height:Math.max.apply(Math,l.map((function(e){return e[1]})))-a}}function Tb(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var Nb=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=wb(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l=n.imageRef||n.videoRef;if(l){n.mediaSize={width:l.offsetWidth,height:l.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var i=n.props.cropSize?n.props.cropSize:bb(l.offsetWidth,l.offsetHeight,n.props.aspect,n.props.rotation);n.setState({cropSize:i},n.recomputeCropPosition)}n.containerRef&&(n.containerRect=n.containerRef.getBoundingClientRect())},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){e.preventDefault(),document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=hb({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?vb(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=n.props.zoom-e.deltaY*n.props.zoomSpeed/200;n.setNewZoom(r,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},s=n.props.restrictPosition?vb(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(l)}},n.emitCropData=function(){if(n.state.cropSize){var e=Eb(n.props.restrictPosition?vb(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition),t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?vb(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function __(){this.constructor=e}gb(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&this.styleRef.remove(),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():e.cropSize!==this.props.cropSize&&this.computeSizes(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=_b(n,o),this.lastPinchRotation=yb(n,o),this.onDragStart(Bb(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=Bb(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=_b(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=yb(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.crop,i=l.x,s=l.y,a=t.rotation,c=t.zoom,u=t.cropShape,d=t.showGrid,p=t.style,m=p.containerStyle,f=p.cropAreaStyle,g=p.mediaStyle,h=t.classes,b=h.containerClassName,v=h.cropAreaClassName,k=h.mediaClassName;return Vr().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:Tb("reactEasyCrop_Container",b)},n?Vr().createElement("img",hb({alt:"",className:Tb("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:hb(hb({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&Vr().createElement("video",hb({autoPlay:!0,loop:!0,muted:!0,className:Tb("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:hb(hb({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&Vr().createElement("div",{style:hb(hb({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Tb("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",d&&"reactEasyCrop_CropAreaGrid",v)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(Vr().Component);const Pb={position:"bottom right",isAlternate:!0};var Rb=window.wp.apiFetch,Mb=n.n(Rb);const Lb=(0,s.createContext)({}),Ab=()=>(0,s.useContext)(Lb);function Db({id:e,url:t,naturalWidth:n,naturalHeight:o,isEditing:r,onFinishEditing:i,onSaveImage:a,children:c}){const u=function(e,t){const n=function({url:e,naturalWidth:t,naturalHeight:n}){const[o,r]=(0,s.useState)(),[i,a]=(0,s.useState)(),[c,u]=(0,s.useState)({x:0,y:0}),[d,p]=(0,s.useState)(),[m,f]=(0,s.useState)(),[g,h]=(0,s.useState)(),[b,v]=(0,s.useState)(),k=(0,s.useCallback)((()=>{u({x:0,y:0}),p(100),f(0),h(t/n),v(t/n)}),[t,n,u,p,f,h,v]),_=(0,s.useCallback)((()=>{const o=(m+90)%360;let i=t/n;if(m%180==90&&(i=n/t),0===o)return r(),f(o),h(1/g),void u({x:-c.y*i,y:c.x*i});const s=new window.Image;s.src=e,s.onload=function(e){const t=document.createElement("canvas");let n=0,l=0;o%180?(t.width=e.target.height,t.height=e.target.width):(t.width=e.target.width,t.height=e.target.height),90!==o&&180!==o||(n=t.width),270!==o&&180!==o||(l=t.height);const s=t.getContext("2d");s.translate(n,l),s.rotate(o*Math.PI/180),s.drawImage(e.target,0,0),t.toBlob((e=>{r(URL.createObjectURL(e)),f(o),h(1/g),u({x:-c.y*i,y:c.x*i})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof a&&(s.crossOrigin=a)}),[m,t,n,r,f,h,u]);return(0,s.useMemo)((()=>({editedUrl:o,setEditedUrl:r,crop:i,setCrop:a,position:c,setPosition:u,zoom:d,setZoom:p,rotation:m,setRotation:f,rotateClockwise:_,aspect:g,setAspect:h,defaultAspect:b,initializeTransformValues:k})),[o,r,i,a,c,u,d,p,m,f,_,g,h,b,k])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:t,naturalWidth:n,naturalHeight:o},r),d=function({crop:e,rotation:t,height:n,width:o,aspect:r,url:l,id:i,onSaveImage:a,onFinishEditing:c}){const{createErrorNotice:u}=(0,m.useDispatch)(Su.store),[d,p]=(0,s.useState)(!1),f=(0,s.useCallback)((()=>{p(!1),c()}),[p,c]),h=(0,s.useCallback)((()=>{p(!0);let s={};(e.width<99.9||e.height<99.9)&&(s=e),t>0&&(s.rotation=t),s.src=l,Mb()({path:`/wp/v2/media/${i}/edit`,method:"POST",data:s}).then((e=>{a({id:e.id,url:e.source_url,height:n&&o?o/r:void 0})})).catch((e=>{u((0,g.sprintf)(
|
66 |
/* translators: 1. Error message */
|
67 |
-
(0,g.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{p(!1),c()}))}),[p,e,t,n,o,r,l,a,u,p,c]);return(0,s.useMemo)((()=>({isInProgress:d,apply:h,cancel:f})),[d,h,f])}({id:e,url:t,onSaveImage:a,onFinishEditing:i,...u}),p=(0,s.useMemo)((()=>({...u,...d})),[u,d]);return(0,s.createElement)(Lb.Provider,{value:p},c)}function Ob({url:e,width:t,height:n,clientWidth:o,naturalHeight:r,naturalWidth:l}){const{isInProgress:i,editedUrl:a,position:u,zoom:d,aspect:m,setPosition:f,setCrop:g,setZoom:h,rotation:b}=Ab();let v=n||o*r/l;return b%180==90&&(v=o*l/r),(0,s.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":i}),style:{width:t||o,height:v}},(0,s.createElement)(Nb,{image:a||e,disabled:i,minZoom:1,maxZoom:3,crop:u,zoom:d/100,aspect:m,onCropChange:f,onCropComplete:e=>{g(e)},onZoomChange:e=>{h(100*e)}}),i&&(0,s.createElement)(p.Spinner,null))}var Fb=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function zb(){const{isInProgress:e,zoom:t,setZoom:n}=Ab();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:Pb,renderToggle:({isOpen:t,onToggle:n})=>(0,s.createElement)(p.ToolbarButton,{icon:Fb,label:(0,g.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,g.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var Vb=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Hb=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function Ub({aspectRatios:e,isDisabled:t,label:n,onClick:o,value:r}){return(0,s.createElement)(p.MenuGroup,{label:n},e.map((({title:e,aspect:n})=>(0,s.createElement)(p.MenuItem,{key:n,disabled:t,onClick:()=>{o(n)},role:"menuitemradio",isSelected:n===r,icon:n===r?Vb:void 0},e))))}function Gb({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:o,defaultAspect:r}=Ab();return(0,s.createElement)(p.DropdownMenu,{icon:Hb,label:(0,g.__)("Aspect Ratio"),popoverProps:Pb,toggleProps:e,className:"wp-block-image__aspect-ratio"},(({onClose:e})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ub,{isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,g.__)("Original"),aspect:r},{title:(0,g.__)("Square"),aspect:1}]}),(0,s.createElement)(Ub,{label:(0,g.__)("Landscape"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,g.__)("16:10"),aspect:1.6},{title:(0,g.__)("16:9"),aspect:16/9},{title:(0,g.__)("4:3"),aspect:4/3},{title:(0,g.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(Ub,{label:(0,g.__)("Portrait"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,g.__)("10:16"),aspect:.625},{title:(0,g.__)("9:16"),aspect:9/16},{title:(0,g.__)("3:4"),aspect:3/4},{title:(0,g.__)("2:3"),aspect:2/3}]}))))}var Wb=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function $b(){const{isInProgress:e,rotateClockwise:t}=Ab();return(0,s.createElement)(p.ToolbarButton,{icon:Wb,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function jb(){const{isInProgress:e,apply:t,cancel:n}=Ab();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,g.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,g.__)("Cancel")))}function Kb({url:e,width:t,height:n,clientWidth:o,naturalHeight:r,naturalWidth:l}){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ob,{url:e,width:t,height:n,clientWidth:o,naturalHeight:r,naturalWidth:l}),(0,s.createElement)(eo,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(zb,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Gb,{toggleProps:e}))),(0,s.createElement)($b,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(jb,null))))}const qb=[25,50,75,100];function Yb({imageWidth:e,imageHeight:t,imageSizeOptions:n=[],isResizable:o=!0,slug:r,width:l,height:i,onChange:a,onChangeImage:c=u.noop}){const{currentHeight:d,currentWidth:m,updateDimension:f,updateDimensions:h}=function(e,t,n,o,r){var l,i;const[a,c]=(0,s.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,s.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,s.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,s.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(i,l,t,e,a);return(0,s.createElement)(s.Fragment,null,!(0,u.isEmpty)(n)&&(0,s.createElement)(p.SelectControl,{label:(0,g.__)("Image size"),value:r,options:n,onChange:c}),o&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)("p",{className:"block-editor-image-size-control__row"},(0,g.__)("Image dimensions")),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,g.__)("Width"),value:m,min:1,onChange:e=>f("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,g.__)("Height"),value:d,min:1,onChange:e=>f("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,g.__)("Image size presets")},qb.map((n=>{const o=Math.round(e*(n/100)),r=Math.round(t*(n/100)),l=m===o&&d===r;return(0,s.createElement)(p.Button,{key:n,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>h(r,o)},n,"%")}))),(0,s.createElement)(p.Button,{isSmall:!0,onClick:()=>h()},(0,g.__)("Reset")))))}var Zb=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(F.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),Xb=({value:e,onChange:t=u.noop,settings:n})=>{if(!n||!n.length)return null;const o=n=>o=>{t({...e,[n.id]:o})},r=n.map((t=>(0,s.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:t.id,label:t.title,onChange:o(t),checked:!!e&&!!e[t.id]})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Currently selected link settings")),r)};class Qb extends s.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,s.createRef)(),this.inputRef=(0,s.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,va()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value!==o&&this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(e=""){var t;const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(t=e)&&void 0!==t&&t.length);if(e=e.trim(),!r&&(e.length<2||!o&&(0,Pu.isURL)(e)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(e,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,g.sprintf)(
|
68 |
/* translators: %s: number of results. */
|
69 |
-
(0,g._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,g.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)})).catch((()=>{this.suggestionsRequest===l&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)})),this.suggestionsRequest=l}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case fa.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case fa.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case fa.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case fa.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case fa.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case fa.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,g.__)("Link selected.")));break;case fa.ENTER:null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:n,__experimentalShowInitialSuggestions:o=!1},{showSuggestions:r}){let l=r;const i=e&&e.length;return o||i||(l=!1),!0===n&&(l=!1),{showSuggestions:l,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,s.createElement)(s.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{label:e,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,g.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:i=""}=this.props,{loading:a,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:m,suggestionOptionIdPrefix:f}=this.state,h={id:`url-input-control-${o}`,label:e,className:c()("block-editor-url-input",t,{"is-full-width":n})},b={value:i,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:r,onKeyDown:this.onKeyDown,role:"combobox","aria-label":(0,g.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(h,b,a):(0,s.createElement)(p.BaseControl,h,(0,s.createElement)("input",b),a&&(0,s.createElement)(p.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:l,selectedSuggestion:a,suggestionsListboxId:d,suggestionOptionIdPrefix:m,loading:f}=this.state,g={id:d,ref:this.autocompleteRef,role:"listbox"},h=(e,t)=>({role:"option",tabIndex:"-1",id:`${m}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===a});return(0,u.isFunction)(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:a,suggestionsListProps:g,buildSuggestionItemProps:h,isLoading:f,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!(0,u.isFunction)(t)&&r&&l.length?(0,s.createElement)(p.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},(0,s.createElement)("div",i({},g,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,s.createElement)(p.Button,i({},h(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===a}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var
|
70 |
/* translators: %s: search term. */
|
71 |
-
(0,g.__)("Create: <mark>%s</mark>"),e),{mark:(0,s.createElement)("mark",null)}),(0,s.createElement)(p.Button,i({},n,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":o}),onClick:t}),(0,s.createElement)(Co,{className:"block-editor-link-control__search-item-icon",icon:Aa}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},l)))},
|
72 |
/* translators: %s: search term. */
|
73 |
-
(0,g.__)('Search results for "%s"'),n),S=(0,s.createElement)(m?s.Fragment:p.VisuallyHidden,{},(0,s.createElement)("span",{className:"block-editor-link-control__search-results-label",id:E},C));return(0,s.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},S,(0,s.createElement)("div",i({},r,{className:b,"aria-labelledby":E}),a.map(((e,t)=>_&&ov===e.type?(0,s.createElement)(ev,{searchTerm:n,buttonText:f,onClick:()=>o(e),key:e.type,itemProps:l(e,t),isSelected:t===u}):ov===e.type?null:(0,s.createElement)(nv,{key:`${e.id}-${e.type}`,itemProps:l(e,t),suggestion:e,index:t,onClick:()=>{o(e)},isSelected:t===u,isURL:v.includes(e.type.toLowerCase()),searchTerm:n,shouldShowType:y})))))}function iv(e){const t=(0,u.startsWith)(e,"#");return(0,Pu.isURL)(e)||e&&e.includes("www.")||t}const sv=()=>Promise.resolve([]),av=e=>{let t="URL";const n=(0,Pu.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),(0,u.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,Pu.prependHTTP)(e):e,type:t}])};const cv=()=>Promise.resolve([]),uv=(0,s.forwardRef)((({value:e,children:t,currentLink:n={},className:o=null,placeholder:r=null,withCreateSuggestion:l=!1,onCreateSuggestion:i=u.noop,onChange:a=u.noop,onSelect:c=u.noop,showSuggestions:p=!0,renderSuggestions:f=(e=>(0,s.createElement)(lv,e)),fetchSuggestions:h=null,allowDirectEntry:b=!0,showInitialSuggestions:v=!1,suggestionsQuery:k={},withURLSuggestion:_=!0,createSuggestionButtonText:y},E)=>{const C=function(e,t,n,o){const{fetchSearchSuggestions:r}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Wn);return{fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),l=t?av:sv;return(0,s.useCallback)(((t,{isInitialSuggestions:i})=>iv(t)?l(t,{isInitialSuggestions:i}):(async(e,t,n,o,r,l)=>{const{isInitialSuggestions:i}=t;let s=await Promise.all([n(e,t),o(e)]);return s=e.includes(" ")||!l||i?s[0]:s[0].concat(s[1]),i||iv(e)||!r?s:s.concat({title:e,url:e,type:ov})})(t,{...e,isInitialSuggestions:i},r,l,n,o)),[l,r,n])}(k,b,l,_),S=p?h||C:cv,w=(0,d.useInstanceId)(uv),[B,I]=(0,s.useState)(),x=async e=>{let t=e;if(ov!==e.type)(b||t&&Object.keys(t).length>=1)&&c({...(0,u.omit)(n,"id","url"),...t},t);else try{var o;t=await i(e.title),null!==(o=t)&&void 0!==o&&o.url&&c(t)}catch(e){}};return(0,s.createElement)("div",null,(0,s.createElement)(Jb,{className:o,value:e,onChange:(e,t)=>{a(e),I(t)},placeholder:null!=r?r:(0,g.__)("Search or type url"),__experimentalRenderSuggestions:p?t=>f({...t,instanceId:w,withCreateSuggestion:l,currentInputValue:e,createSuggestionButtonText:y,suggestionsQuery:k,handleSuggestionClick:e=>{t.handleSuggestionClick&&t.handleSuggestionClick(e),x(e)}}):null,__experimentalFetchLinkSuggestions:S,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:v,onSubmit:(t,n)=>{var o;const r=t||B;r||null!=e&&null!==(o=e.trim())&&void 0!==o&&o.length?x(r||{url:e}):n.preventDefault()},ref:E}),t)}));var dv=uv,pv=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));const{Slot:mv,Fill:fv}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function gv(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function hv({value:e,onEditClick:t,hasRichPreviews:n=!1}){const o=n?null==e?void 0:e.url:null,{richData:r,isFetching:l}=function(e){const[t,n]=(0,s.useReducer)(gv,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Wn);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,s.useEffect)((()=>{if(null!=e&&e.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t}(o),i=r&&Object.keys(r).length,a=e&&(0,Pu.filterURLForDisplay)((0,Pu.safeDecodeURI)(e.url),16)||"",u=!e.url.length;let d;return d=null!=r&&r.icon?(0,s.createElement)("img",{src:null==r?void 0:r.icon,alt:""}):u?(0,s.createElement)(Co,{icon:pv,size:32}):(0,s.createElement)(Co,{icon:tv}),(0,s.createElement)("div",{"aria-label":(0,g.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":i,"is-fetching":!!l,"is-preview":!0,"is-error":u})},(0,s.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:c()("block-editor-link-control__search-item-icon",{"is-image":null==r?void 0:r.icon})},d),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-details"},u?(0,s.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},"Link is empty"):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ExternalLink,{className:"block-editor-link-control__search-item-title",href:e.url},(null==r?void 0:r.title)||(null==e?void 0:e.title)||a),(null==e?void 0:e.url)&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},a)))),(0,s.createElement)(p.Button,{variant:"secondary",onClick:()=>t(),className:"block-editor-link-control__search-item-action"},(0,g.__)("Edit")),(0,s.createElement)(mv,{fillProps:e})),(i&&((null==r?void 0:r.image)||(null==r?void 0:r.description))||l)&&(0,s.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==r?void 0:r.image)||l)&&(0,s.createElement)("div",{"aria-hidden":!(null!=r&&r.image),className:c()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=r&&r.image)})},(null==r?void 0:r.image)&&(0,s.createElement)("img",{src:null==r?void 0:r.image,alt:""})),((null==r?void 0:r.description)||l)&&(0,s.createElement)("div",{"aria-hidden":!(null!=r&&r.description),className:c()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=r&&r.description)})},(null==r?void 0:r.description)&&(0,s.createElement)(p.__experimentalText,{truncate:!0,numberOfLines:"2"},r.description))))}function bv({searchInputPlaceholder:e,value:t,settings:n=rv,onChange:o=u.noop,onRemove:r,noDirectEntry:l=!1,showSuggestions:i=!0,showInitialSuggestions:a,forceIsEditingLink:c,createSuggestion:d,withCreateSuggestion:m,inputValue:f="",suggestionsQuery:h={},noURLSuggestion:b=!1,createSuggestionButtonText:v,hasRichPreviews:k=!1}){var _;void 0===m&&d&&(m=!0);const y=(0,s.useRef)(!0),E=(0,s.useRef)(),[C,S]=(0,s.useState)(t&&t.url||""),w=f||C,[B,I]=(0,s.useState)(void 0!==c?c:!t||!t.url),x=(0,s.useRef)(!1),T=!(null!=w&&null!==(_=w.trim())&&void 0!==_&&_.length);function N(){var e;x.current=!(null===(e=E.current)||void 0===e||!e.contains(E.current.ownerDocument.activeElement)),I(!1)}(0,s.useEffect)((()=>{void 0!==c&&c!==B&&I(c)}),[c]),(0,s.useEffect)((()=>{y.current?y.current=!1:((tr.focus.focusable.find(E.current)[0]||E.current).focus(),x.current=!1)}),[B]);const{createPage:P,isCreatingPage:R,errorMessage:M}=function(e){const t=(0,s.useRef)(),[n,o]=(0,s.useState)(!1),[r,l]=(0,s.useState)(null);return(0,s.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=(e=>{let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCanceled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,g.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(d),L=()=>{w!==(null==t?void 0:t.url)&&o({url:w}),N()},A=r&&t&&!B&&!R,D=!(null==n||!n.length);return(0,s.createElement)("div",{tabIndex:-1,ref:E,className:"block-editor-link-control"},R&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(p.Spinner,null)," ",(0,g.__)("Creating"),"…"),(B||!t)&&!R&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-link-control__search-input-wrapper"},(0,s.createElement)(dv,{currentLink:t,className:"block-editor-link-control__search-input",placeholder:e,value:w,withCreateSuggestion:m,onCreateSuggestion:P,onChange:S,onSelect:e=>{o(e),N()},showInitialSuggestions:a,allowDirectEntry:!l,showSuggestions:i,suggestionsQuery:h,withURLSuggestion:!b,createSuggestionButtonText:v},(0,s.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,s.createElement)(p.Button,{onClick:()=>L(),onKeyDown:e=>{const{keyCode:t}=e;t!==fa.ENTER||T||(e.preventDefault(),L())},label:(0,g.__)("Submit"),icon:Zb,className:"block-editor-link-control__search-submit",disabled:T})))),M&&(0,s.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},M)),t&&!B&&!R&&(0,s.createElement)(hv,{key:null==t?void 0:t.url,value:t,onEditClick:()=>I(!0),hasRichPreviews:k}),(D||A)&&(0,s.createElement)("div",{className:"block-editor-link-control__tools"},(0,s.createElement)(Xb,{value:t,settings:n,onChange:o}),A&&(0,s.createElement)(p.Button,{className:"block-editor-link-control__unlink",isDestructive:!0,variant:"link",onClick:r},(0,g.__)("Unlink"))))}bv.ViewerFill=fv;var vv=bv,kv=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})),_v=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})),yv=(0,p.withFilters)("editor.MediaUpload")((()=>null)),Ev=function({fallback:e=null,children:t}){return(0,m.useSelect)((e=>{const{getSettings:t}=e(Wn);return!!t().mediaUpload}),[])?t:e},Cv=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Su.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,allowedTypes:n,accept:o,onSelect:r,onSelectURL:l,onFilesUpload:i=u.noop,name:a=(0,g.__)("Replace"),createNotice:c,removeNotice:d,children:f})=>{const[h,b]=(0,s.useState)(e),v=(0,m.useSelect)((e=>e(Wn).getSettings().mediaUpload),[]),k=(0,s.createRef)(),_=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),y=e=>{const t=document.createElement("div");t.innerHTML=(0,s.renderToString)(e);const n=t.textContent||t.innerText||"";setTimeout((()=>{c("error",n,{speak:!0,id:_,isDismissible:!0})}),1e3)},E=e=>{b(e.url),r(e),(0,Rt.speak)((0,g.__)("The media file has been replaced")),d(_)},C=e=>{e.keyCode===fa.DOWN&&(e.preventDefault(),e.target.click())};return(0,s.createElement)(p.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(p.ToolbarButton,{ref:k,"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:C},a),renderContent:({onClose:e})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,s.createElement)(yv,{value:t,onSelect:e=>E(e),allowedTypes:n,render:({open:e})=>(0,s.createElement)(p.MenuItem,{icon:kv,onClick:e},(0,g.__)("Open Media Library"))}),(0,s.createElement)(Ev,null,(0,s.createElement)(p.FormFileUpload,{onChange:e=>{(e=>{const t=e.target.files;i(t),v({allowedTypes:n,filesList:t,onFileChange:([e])=>{E(e)},onError:y})})(e)},accept:o,render:({openFileDialog:e})=>(0,s.createElement)(p.MenuItem,{icon:_v,onClick:()=>{e()}},(0,g.__)("Upload"))})),f),l&&(0,s.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,s.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,g.__)("Current media URL:")),(0,s.createElement)(vv,{value:{url:h},settings:[],showSuggestions:!1,onChange:({url:e})=>{b(e),l(e),k.current.focus()}})))})})),Sv=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));function wv({url:e,urlLabel:t,className:n}){const o=c()(n,"block-editor-url-popover__link-viewer-url");return e?(0,s.createElement)(p.ExternalLink,{className:o,href:e},t||(0,Pu.filterURLForDisplay)((0,Pu.safeDecodeURI)(e))):(0,s.createElement)("span",{className:o})}function Bv({additionalControls:e,children:t,renderSettings:n,position:o="bottom center",focusOnMount:r="firstElement",...l}){const[a,c]=(0,s.useState)(!1),u=!!n&&a;return(0,s.createElement)(p.Popover,i({className:"block-editor-url-popover",focusOnMount:r,position:o},l),(0,s.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,s.createElement)("div",{className:"block-editor-url-popover__row"},t,!!n&&(0,s.createElement)(p.Button,{className:"block-editor-url-popover__settings-toggle",icon:xd,label:(0,g.__)("Link settings"),onClick:()=>{c(!a)},"aria-expanded":a})),u&&(0,s.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},n())),e&&!u&&(0,s.createElement)("div",{className:"block-editor-url-popover__additional-controls"},e))}Bv.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:o,...r}){return(0,s.createElement)("form",i({className:c()("block-editor-url-popover__link-editor",t)},r),(0,s.createElement)(Jb,{value:o,onChange:n,autocompleteRef:e}),(0,s.createElement)(p.Button,{icon:Zb,label:(0,g.__)("Apply"),type:"submit"}))},Bv.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:o,urlLabel:r,...l}){return(0,s.createElement)("div",i({className:c()("block-editor-url-popover__link-viewer",e)},l),(0,s.createElement)(wv,{url:o,urlLabel:r,className:t}),n&&(0,s.createElement)(p.Button,{icon:Sv,label:(0,g.__)("Edit"),onClick:n}))};var Iv=Bv;const xv=({src:e,onChange:t,onSubmit:n,onClose:o})=>(0,s.createElement)(Iv,{onClose:o},(0,s.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n},(0,s.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,g.__)("URL"),placeholder:(0,g.__)("Paste or type URL"),onChange:t,value:e}),(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:Zb,label:(0,g.__)("Apply"),type:"submit"})));var Tv=(0,p.withFilters)("editor.MediaPlaceholder")((function({value:e={},allowedTypes:t,className:n,icon:o,labels:r={},mediaPreview:l,notices:i,isAppender:a,accept:d,addToGallery:f,multiple:h=!1,handleUpload:b=!0,dropZoneUIOnly:v,disableDropZone:k,disableMediaButtons:_,onError:y,onSelect:E,onCancel:C,onSelectURL:S,onDoubleClick:w,onFilesPreUpload:B=u.noop,onHTMLDrop:I=u.noop,children:x,mediaLibraryButton:T,placeholder:N,style:P}){const R=(0,m.useSelect)((e=>{const{getSettings:t}=e(Wn);return t().mediaUpload}),[]),[M,L]=(0,s.useState)(""),[A,D]=(0,s.useState)(!1);(0,s.useEffect)((()=>{var t;L(null!==(t=null==e?void 0:e.src)&&void 0!==t?t:"")}),[null==e?void 0:e.src]);const O=e=>{L(e.target.value)},F=()=>{D(!0)},z=()=>{D(!1)},V=e=>{e.preventDefault(),M&&S&&(S(M),z())},H=n=>{if(!b)return E(n);let o;if(B(n),h)if(f){let t=[];o=n=>{const o=(null!=e?e:[]).filter((e=>e.id?!t.some((({id:t})=>Number(t)===Number(e.id))):!t.some((({urlSlug:t})=>e.url.includes(t)))));E(o.concat(n)),t=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=E;else o=([e])=>E(e);R({allowedTypes:t,filesList:n,onFileChange:o,onError:y})},U=e=>{H(e.target.files)},G=null!=N?N:e=>{let{instructions:u,title:d}=r;if(R||S||(u=(0,g.__)("To edit this block, you need permission to upload media.")),void 0===u||void 0===d){const e=null!=t?t:[],[n]=e,o=1===e.length,r=o&&"audio"===n,l=o&&"image"===n,i=o&&"video"===n;void 0===u&&R&&(u=(0,g.__)("Upload a media file or pick one from your media library."),r?u=(0,g.__)("Upload an audio file, pick one from your media library, or add one with a URL."):l?u=(0,g.__)("Upload an image file, pick one from your media library, or add one with a URL."):i&&(u=(0,g.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===d&&(d=(0,g.__)("Media"),r?d=(0,g.__)("Audio"):l?d=(0,g.__)("Image"):i&&(d=(0,g.__)("Video")))}const m=c()("block-editor-media-placeholder",n,{"is-appender":a});return(0,s.createElement)(p.Placeholder,{icon:o,label:d,instructions:u,className:m,notices:i,onDoubleClick:w,preview:l,style:P},e,x)},W=()=>k?null:(0,s.createElement)(p.DropZone,{onFilesDrop:H,onHTMLDrop:I}),$=()=>C&&(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,g.__)("Cancel"),variant:"link",onClick:C},(0,g.__)("Cancel")),j=()=>S&&(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:F,isPressed:A,variant:"tertiary"},(0,g.__)("Insert from URL")),A&&(0,s.createElement)(xv,{src:M,onChange:O,onSubmit:V,onClose:z}));return v||_?(v&&At()("wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop",{since:"5.4",alternative:"disableMediaButtons"}),(0,s.createElement)(Ev,null,W())):(0,s.createElement)(Ev,{fallback:G(j())},(()=>{const n=null!=T?T:({open:e})=>(0,s.createElement)(p.Button,{variant:"tertiary",onClick:()=>{e()}},(0,g.__)("Media Library")),o=(0,s.createElement)(yv,{addToGallery:f,gallery:h&&!(!t||0===t.length)&&t.every((e=>"image"===e||e.startsWith("image/"))),multiple:h,onSelect:E,allowedTypes:t,value:Array.isArray(e)?e.map((({id:e})=>e)):e.id,render:n});if(R&&a)return(0,s.createElement)(s.Fragment,null,W(),(0,s.createElement)(p.FormFileUpload,{onChange:U,accept:d,multiple:h,render:({openFileDialog:e})=>{const t=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e},(0,g.__)("Upload")),o,j(),$());return G(t)}}));if(R){const e=(0,s.createElement)(s.Fragment,null,W(),(0,s.createElement)(p.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:U,accept:d,multiple:h},(0,g.__)("Upload")),o,j(),$());return G(e)}return G(o)})())})),Nv=({colorSettings:e,...t})=>{const n=e.map((({value:e,onChange:t,...n})=>({...n,colorValue:e,onColorChange:t})));return(0,s.createElement)(qm,i({settings:n,gradients:[],disableCustomGradients:!0},t))};const Pv={position:"bottom right",isAlternate:!0};var Rv=()=>(0,s.createElement)(s.Fragment,null,["bold","italic","link"].map((e=>(0,s.createElement)(p.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,s.createElement)(p.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((([{props:e}])=>e)).some((({isActive:e})=>e));return(0,s.createElement)(p.ToolbarItem,null,(n=>(0,s.createElement)(p.DropdownMenu,{icon:xd
|
74 |
-
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("More"),toggleProps:{...n,className:c()(n.className,{"is-pressed":t})},controls:(0,u.orderBy)(e.map((([{props:e}])=>e)),"title"),popoverProps:Pv})))}))),Mv=({inline:e,anchorRef:t})=>e?(0,s.createElement)(p.Popover,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:t,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,s.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Rv,null)))):(0,s.createElement)(eo,{group:"inline"},(0,s.createElement)(Rv,null));function Lv(){const{didAutomaticChange:e,getSettings:t}=(0,m.useSelect)(Wn);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==fa.DELETE&&o!==fa.BACKSPACE&&o!==fa.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function Av(e){return e.filter((({type:e})=>/^image\/(?:jpe?g|png|gif)$/.test(e))).map((e=>`<img src="${(0,rp.createBlobURL)(e)}">`)).join("")}var Dv=window.wp.shortcode;function Ov(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function Fv(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function zv({allowedFormats:e,formattingControls:t,disableFormats:n}){return n?zv.EMPTY_ARRAY:e||t?e||(At()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats"}),t.map((e=>`core/${e}`))):void 0}function Vv({value:e,pastedBlocks:t=[],onReplace:n,onSplit:o,onSplitMiddle:r,multilineTag:l}){if(!n||!o)return;const i=[],[s,a]=(0,Mt.split)(e),c=t.length>0;let u=-1;const d=(0,Mt.isEmpty)(s)&&!(0,Mt.isEmpty)(a);c&&(0,Mt.isEmpty)(s)||(i.push(o((0,Mt.toHTMLString)({value:s,multilineTag:l}),!d)),u+=1),c?(i.push(...t),u+=t.length):r&&i.push(r()),(c||r)&&(0,Mt.isEmpty)(a)||i.push(o((0,Mt.toHTMLString)({value:a,multilineTag:l}),d)),n(i,c?u:1,c?-1:0)}function Hv(e,t){return t?(0,Mt.replace)(e,/\n+/g,Mt.__UNSTABLE_LINE_SEPARATOR):(0,Mt.replace)(e,new RegExp(Mt.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function Uv(e){const t=(0,s.useRef)(e);return t.current=e,(0,d.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:l,value:i,formatTypes:s,tagName:a,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:f,pastePlainText:g}=t.current;if(!n)return void e.preventDefault();const{clipboardData:h}=e;let b="",v="";try{b=h.getData("text/plain"),v=h.getData("text/html")}catch(e){try{v=h.getData("Text")}catch(e){return}}if(v=function(e){return e.replace(/.*<!--StartFragment-->/s,"").replace(/<!--EndFragment-->.*/s,"")}(v),e.preventDefault(),window.console.log("Received HTML:\n\n",v),window.console.log("Received plain text:\n\n",b),o)return void l((0,Mt.insert)(i,b));const k=s.reduce(((e,{__unstablePasteRule:t})=>(t&&e===i&&(e=t(i,{html:v,plainText:b})),e)),i);if(k!==i)return void l(k);const _=[...(0,tr.getFilesFromDataTransfer)(h)];if("true"===h.getData("rich-text")){const e=h.getData("rich-text-multi-line-tag")||void 0;let t=(0,Mt.create)({html:v,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:f});return t=Hv(t,!!m),Ov(t,i.activeFormats),void l((0,Mt.insert)(i,t))}if(g)return void l((0,Mt.insert)(i,(0,Mt.create)({text:b})));if(_&&_.length&&!v){const e=(0,r.pasteHandler)({HTML:Av(_),mode:"BLOCKS",tagName:a,preserveWhiteSpace:f});return window.console.log("Received items:\n\n",_),void(c&&(0,Mt.isEmpty)(i)?c(e):Vv({value:i,pastedBlocks:e,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,Mt.isEmpty)(i)&&(E=b,(0,Dv.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,Mt.isEmpty)(i)&&(0,Pu.isURL)(b.trim())&&(y="BLOCKS");const C=(0,r.pasteHandler)({HTML:v,plainText:b,mode:y,tagName:a,preserveWhiteSpace:f});if("string"==typeof C){let e=(0,Mt.create)({html:C});e=Hv(e,!!m),Ov(e,i.activeFormats),l((0,Mt.insert)(i,e))}else C.length>0&&(c&&(0,Mt.isEmpty)(i)?c(C,C.length-1,-1):Vv({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function Gv(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,m.useDispatch)(Wn),o=(0,s.useRef)(e);return o.current=e,(0,d.useRefEffect)((e=>{function l(){const{value:e,onReplace:t}=o.current;if(!t)return;const{start:l,text:i}=e;if(" "!==i.slice(l-1,l))return;const s=i.slice(0,l).trim(),a=(0,r.getBlockTransforms)("from").filter((({type:e})=>"prefix"===e)),c=(0,r.findTransform)(a,(({prefix:e})=>s===e));if(!c)return;const u=(0,Mt.toHTMLString)({value:(0,Mt.slice)(e,l,i.length)});t([c.transform(u)]),n()}function i(e){const{inputType:r,type:i}=e,{value:s,onChange:a,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==r&&"compositionend"!==i)return;c&&l&&l();const d=u.reduce(((e,{__unstableInputRule:t})=>(t&&(e=t(e)),e)),s);d!==s&&(t(),a({...d,activeFormats:s.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function Wv(e){const{__unstableMarkAutomaticChange:t}=(0,m.useDispatch)(Wn),n=(0,s.useRef)(e);return n.current=e,(0,d.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:l,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;if(e.keyCode!==fa.ENTER)return;e.preventDefault();const m={...l};m.formats=o(l);const f=i&&s;if(i){const e=(0,r.getBlockTransforms)("from").filter((({type:e})=>"enter"===e)),n=(0,r.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(i([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,Mt.insert)(m,"\n")):f&&(0,Mt.__unstableIsEmptyLine)(m)?Vv({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c}):u((0,Mt.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!f&&!r?d||u((0,Mt.insert)(m,"\n")):!f&&r?p():f&&Vv({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function $v(e){return e(Mt.store).getFormatTypes()}zv.EMPTY_ARRAY=[];const jv=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function Kv(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function qv(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function Yv({formatTypes:e,onChange:t,onFocus:n,value:o,forwardedRef:r}){return e.map((e=>{const{name:l,edit:i}=e;if(!i)return null;const a=(0,Mt.getActiveFormat)(o,l),c=void 0!==a,u=(0,Mt.getActiveObject)(o),d=void 0!==u&&u.type===l;return(0,s.createElement)(i,{key:l,isActive:c,activeAttributes:c&&a.attributes||{},isObjectActive:d,activeObjectAttributes:d&&u.attributes||{},value:o,onChange:t,onFocus:n,contentRef:r})}))}const Zv=(0,s.createContext)(),Xv=(0,s.createContext)(),Qv=(0,s.forwardRef)((function e({children:t,tagName:n="div",value:o="",onChange:l,isSelected:a,multiline:f,inlineToolbar:g,wrapperClassName:h,autocompleters:b,onReplace:v,placeholder:k,allowedFormats:_,formattingControls:y,withoutInteractiveFormatting:E,onRemove:C,onMerge:S,onSplit:w,__unstableOnSplitAtEnd:B,__unstableOnSplitMiddle:I,identifier:x,preserveWhiteSpace:T,__unstablePastePlainText:N,__unstableEmbedURLOnPaste:P,__unstableDisableFormats:R,disableLineBreaks:M,unstableOnFocus:L,__unstableAllowPrefixTransformations:A,...D},O){const F=(0,d.useInstanceId)(e);x=x||F,D=function(e){return(0,u.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(D);const z=(0,s.useRef)(),{clientId:V}=qn(),{selectionStart:H,selectionEnd:U,isSelected:G,disabled:W}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n,isMultiSelecting:o,hasMultiSelection:r}=e(Wn),l=t(),i=n();let s;return void 0===a?s=l.clientId===V&&l.attributeKey===x:a&&(s=l.clientId===V),{selectionStart:s?l.offset:void 0,selectionEnd:s?i.offset:void 0,isSelected:s,disabled:o()||r()}})),{selectionChange:$}=(0,m.useDispatch)(Wn),j=Fv(f),K=zv({allowedFormats:_,formattingControls:y,disableFormats:R}),q=!K||K.length>0;let Y=o,Z=l;Array.isArray(o)&&(Y=r.children.toHTML(o),Z=e=>l(r.children.fromDOM((0,Mt.__unstableCreateElement)(document,e).childNodes)));const X=(0,s.useCallback)(((e,t)=>{$(V,x,e,t)}),[V,x]),{formatTypes:Q,prepareHandlers:J,valueHandlers:ee,changeHandlers:te,dependencies:ne}=function({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:o}){const r=(0,m.useSelect)($v,[]),l=(0,s.useMemo)((()=>r.filter((({name:e,tagName:t})=>!(o&&!o.includes(e)||n&&jv.has(t))))),[r,o,jv]),i=(0,m.useSelect)((n=>l.reduce(((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e})),o)),{})),[l,e,t]),a=(0,m.useDispatch)(),c=[],u=[],d=[],p=[];return l.forEach((n=>{if(n.__experimentalCreatePrepareEditableTree){const o=i[n.name],r=n.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:t,blockClientId:e});n.__experimentalCreateOnChangeEditableValue?u.push(r):c.push(r);for(const e in o)p.push(o[e])}if(n.__experimentalCreateOnChangeEditableValue){let o={};n.__experimentalGetPropsForEditableTreeChangeHandler&&(o=n.__experimentalGetPropsForEditableTreeChangeHandler(a,{richTextIdentifier:t,blockClientId:e})),d.push(n.__experimentalCreateOnChangeEditableValue({...i[n.name]||{},...o},{richTextIdentifier:t,blockClientId:e}))}})),{formatTypes:l,prepareHandlers:c,valueHandlers:u,changeHandlers:d,dependencies:p}}({clientId:V,identifier:x,withoutInteractiveFormatting:E,allowedFormats:K});function oe(e){return Q.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,Mt.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:re,onChange:le,ref:ie}=(0,Mt.__unstableUseRichText)({value:Y,onChange(e,{__unstableFormats:t,__unstableText:n}){Z(e),Object.values(te).forEach((e=>{e(t,n)}))},selectionStart:H,selectionEnd:U,onSelectionChange:X,placeholder:k,__unstableIsSelected:G,__unstableMultilineTag:j,__unstableDisableFormats:R,preserveWhiteSpace:T,__unstableDependencies:[...ne,n],__unstableAfterParse:function(e){return ee.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:oe,__unstableAddInvisibleFormats:function(e){return J.reduce(((t,n)=>n(t,e.text)),e.formats)}}),se=function(e){return(0,p.__unstableUseAutocompleteProps)({...e,completers:ph(e)})}({onReplace:v,completers:b,record:re,onChange:le});!function({value:e}){const t=e.activeFormats&&!!e.activeFormats.length,{isCaretWithinFormattedText:n}=(0,m.useSelect)(Wn),{enterFormattedText:o,exitFormattedText:r}=(0,m.useDispatch)(Wn);(0,s.useEffect)((()=>{t?n()||o():n()&&r()}),[t])}({value:re}),function({html:e,value:t}){const n=(0,s.useRef)(),o=t.activeFormats&&!!t.activeFormats.length,{__unstableMarkLastChangeAsPersistent:r}=(0,m.useDispatch)(Wn);(0,s.useLayoutEffect)((()=>{if(n.current){if(n.current!==t.text){const e=window.setTimeout((()=>{r()}),1e3);return n.current=t.text,()=>{window.clearTimeout(e)}}r()}else n.current=t.text}),[e,o])}({html:Y,value:re});const ae=(0,s.useRef)(new Set),ce=(0,s.useRef)(new Set);function ue(){z.current.focus()}const de=n,pe=(0,s.createElement)(s.Fragment,null,G&&(0,s.createElement)(Zv.Provider,{value:ae},(0,s.createElement)(Xv.Provider,{value:ce},(0,s.createElement)(p.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},t&&t({value:re,onChange:le,onFocus:ue}),(0,s.createElement)(Yv,{value:re,onChange:le,onFocus:ue,formatTypes:Q,forwardedRef:z})))),G&&q&&(0,s.createElement)(Mv,{inline:g,anchorRef:z.current}),(0,s.createElement)(de,i({role:"textbox","aria-multiline":!0,"aria-label":k},D,se,{ref:(0,d.useMergeRefs)([se.ref,D.ref,ie,Gv({value:re,onChange:le,__unstableAllowPrefixTransformations:A,formatTypes:Q,onReplace:v}),(0,d.useRefEffect)((e=>{function t(e){(fa.isKeyboardEvent.primary(e,"z")||fa.isKeyboardEvent.primary(e,"y")||fa.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),Kv(ae),qv(ce),Lv(),Uv({isSelected:G,disableFormats:R,onChange:le,value:re,formatTypes:Q,tagName:n,onReplace:v,onSplit:w,onSplitMiddle:I,__unstableEmbedURLOnPaste:P,multilineTag:j,preserveWhiteSpace:T,pastePlainText:N}),Wv({removeEditorOnlyFormats:oe,value:re,onReplace:v,onSplit:w,onSplitMiddle:I,multilineTag:j,onChange:le,disableLineBreaks:M,onSplitAtEnd:B}),z,O]),contentEditable:!W||void 0,suppressContentEditableWarning:!W,className:c()("block-editor-rich-text__editable",D.className,"rich-text"),onFocus:L,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===fa.DELETE||t===fa.BACKSPACE)){const{start:n,end:o,text:r}=re,l=t===fa.BACKSPACE,i=re.activeFormats&&!!re.activeFormats.length;if(!(0,Mt.isCollapsed)(re)||i||l&&0!==n||!l&&o!==r.length)return;S&&S(!l),C&&(0,Mt.isEmpty)(re)&&l&&C(!l),e.preventDefault()}}})));if(!h)return pe;At()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div"});const me=c()("block-editor-rich-text",h);return(0,s.createElement)("div",{className:me},pe)}));Qv.Content=({value:e,tagName:t,multiline:n,...o})=>{Array.isArray(e)&&(e=r.children.toHTML(e));const l=Fv(n);!e&&l&&(e=`<${l}></${l}>`);const i=(0,s.createElement)(s.RawHTML,null,e);return t?(0,s.createElement)(t,(0,u.omit)(o,["format"]),i):i},Qv.isEmpty=e=>!e||0===e.length;var Jv=Qv;const ek=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Jv,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));ek.Content=({value:e="",tagName:t="div",...n})=>(0,s.createElement)(t,n,e);var tk=ek,nk=(0,s.forwardRef)((({__experimentalVersion:e,...t},n)=>{if(2===e)return(0,s.createElement)(tk,i({ref:n},t));const{className:o,onChange:r,...l}=t;return(0,s.createElement)(kr.Z,i({ref:n,className:c()("block-editor-plain-text",o),onChange:e=>r(e.target.value)},l))}));function ok({property:e,viewport:t,desc:n}){const o=(0,d.useInstanceId)(ok),r=n||(0,g.sprintf)(
|
75 |
/* translators: 1: property name. 2: viewport name. */
|
76 |
-
(0,g._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),e,t.label);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",{"aria-describedby":`rbc-desc-${o}`},t.label),(0,s.createElement)(p.VisuallyHidden,{as:"span",id:`rbc-desc-${o}`},r))}var
|
77 |
/* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */
|
78 |
label:(0,g.__)("All")},viewports:d=[{id:"small",label:(0,g.__)("Small screens")},{id:"medium",label:(0,g.__)("Medium screens")},{id:"large",label:(0,g.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const m=o||(0,g.sprintf)(
|
79 |
/* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */
|
80 |
-
(0,g.__)("Use the same %s on all screensizes."),n),f=(0,g.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),h=l((0,s.createElement)(
|
81 |
-
/* translators: 'Help text for the responsive mode toggle control.' */return(0,s.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,s.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,s.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,s.createElement)(p.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:m,checked:!a,onChange:r,help:f}),(0,s.createElement)("div",{className:c()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&h,a&&(i?i(d):d.map((e=>(0,s.createElement)(s.Fragment,{key:e.id},l((0,s.createElement)(
|
82 |
-
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("Tools")})),position:"bottom right",renderContent:()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{role:"menu","aria-label":(0,g.__)("Tools")},(0,s.createElement)(p.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Co,{icon:
|
83 |
/* translators: button label text should, if possible, be under 16 characters. */
|
84 |
-
children:(0,g.__)("Preview")};return(0,s.createElement)(p.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:l,toggleProps:i,icon:null},(()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>r("Desktop"),icon:"Desktop"===o&&
|
85 |
/* translators: %d: number of blocks */
|
86 |
(0,g._n)("%d block","%d blocks",e.length),e.length)),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,g.sprintf)(
|
87 |
/* translators: %d: number of words */
|
88 |
-
(0,g._n)("%d word","%d words",t),t))))}));function Ik({blockName:e}){const{preferredStyle:t,onUpdatePreferredStyleVariations:n,styles:o}=(0,m.useSelect)((t=>{var n,o;const l=t(Wn).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==l||null===(n=l.value)||void 0===n?void 0:n[e],onUpdatePreferredStyleVariations:null!==(o=null==l?void 0:l.onChange)&&void 0!==o?o:null,styles:t(r.store).getBlockStyles(e)}}),[e]),l=(0,s.useMemo)((()=>[{label:(0,g.__)("Not set"),value:""},...o.map((({label:e,name:t})=>({label:e,value:t})))]),[o]),i=(0,s.useCallback)((t=>{n(e,t)}),[e,n]);return n&&(0,s.createElement)(p.SelectControl,{options:l,value:t||"",label:(0,g.__)("Default Style"),onChange:i})}const xk=({clientId:e,blockName:t,hasBlockStyles:n,bubblesVirtually:o})=>{const l=kd(e);return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(Va,l),(0,s.createElement)(ob,{blockClientId:e}),n&&(0,s.createElement)("div",null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Styles")},(0,s.createElement)(Kd,{clientId:e}),(0,r.hasBlockSupport)(t,"defaultStylePicker",!0)&&(0,s.createElement)(Ik,{blockName:t}))),(0,s.createElement)(Xo.Slot,{bubblesVirtually:o}),(0,s.createElement)(Xo.Slot,{__experimentalGroup:"dimensions",bubblesVirtually:o,label:(0,g.__)("Dimensions")}),(0,s.createElement)("div",null,(0,s.createElement)(Tk,{bubblesVirtually:o})),(0,s.createElement)(Sk,{key:"back"}))},Tk=({bubblesVirtually:e})=>{const t=(0,p.__experimentalUseSlot)(Zo.slotName);return Boolean(t.fills&&t.fills.length)?(0,s.createElement)(p.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,g.__)("Advanced"),initialOpen:!1},(0,s.createElement)(Xo.Slot,{__experimentalGroup:"advanced",bubblesVirtually:e})):null};var Nk=({showNoBlockSelectedMessage:e=!0,bubblesVirtually:t=!0})=>{const{count:n,hasBlockStyles:o,selectedBlockName:l,selectedBlockClientId:i,blockType:a}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(Wn),{getBlockStyles:l}=e(r.store),i=t(),s=i&&o(i),a=s&&(0,r.getBlockType)(s),c=s&&l(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:a,hasBlockStyles:c&&c.length>0}}),[]);if(n>1)return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(Bk,null),(0,s.createElement)(Xo.Slot,{bubblesVirtually:t}));const c=l===(0,r.getUnregisteredTypeHandlerName)();return a&&i&&!c?(0,s.createElement)(xk,{clientId:i,blockName:a.name,hasBlockStyles:o,bubblesVirtually:t}):e?(0,s.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,g.__)("No block selected.")):null};function Pk({children:e,__unstableContentRef:t,...n}){const o=(0,d.useViewportMatch)("medium"),r=(0,m.useSelect)((e=>e(Wn).getSettings().hasFixedToolbar),[]),l=(0,Qa.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:a,getBlockRootClientId:c}=(0,m.useSelect)(Wn),{duplicateBlocks:f,removeBlocks:g,insertAfterBlock:h,insertBeforeBlock:b,clearSelectedBlock:v,moveBlocksUp:k,moveBlocksDown:_}=(0,m.useDispatch)(Wn);return(0,s.createElement)("div",i({},n,{onKeyDown:function(e){if(l("core/block-editor/move-up",e)){const t=a();if(t.length){e.preventDefault();const n=c((0,u.first)(t));k(t,n)}}else if(l("core/block-editor/move-down",e)){const t=a();if(t.length){e.preventDefault();const n=c((0,u.first)(t));_(t,n)}}else if(l("core/block-editor/duplicate",e)){const t=a();t.length&&(e.preventDefault(),f(t))}else if(l("core/block-editor/remove",e)){const t=a();t.length&&(e.preventDefault(),g(t))}else if(l("core/block-editor/insert-after",e)){const t=a();t.length&&(e.preventDefault(),h((0,u.last)(t)))}else if(l("core/block-editor/insert-before",e)){const t=a();t.length&&(e.preventDefault(),b((0,u.first)(t)))}else if(l("core/block-editor/delete-multi-selection",e)){const t=a();t.length>1&&(e.preventDefault(),g(t))}else l("core/block-editor/unselect",e)&&a().length>1&&(e.preventDefault(),v(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}),(0,s.createElement)(gd,{__unstableContentRef:t},(r||!o)&&(0,s.createElement)(Sp,{isFixed:!0}),(0,s.createElement)(xp,{__unstableContentRef:t}),(0,s.createElement)(p.Popover.Slot,{name:"block-toolbar",ref:pd(t)}),e,(0,s.createElement)(p.Popover.Slot,{name:"__unstable-block-tools-after",ref:pd(t)})))}var Rk=function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r=!1,__experimentalInsertionIndex:l,__experimentalFilterValue:i,onSelect:a=u.noop,shouldFocusBlock:c=!1}){const d=(0,m.useSelect)((n=>{const{getBlockRootClientId:o}=n(Wn);return e||o(t)||void 0}),[t,e]);return(0,s.createElement)(nd,{onSelect:a,rootClientId:d,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r,__experimentalInsertionIndex:l,__experimentalFilterValue:i,shouldFocusBlock:c})};function Mk(){return null}Mk.Register=function(){const{registerShortcut:e}=(0,m.useDispatch)(Qa.store);return(0,s.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,g.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,g.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,g.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,g.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,g.__)("Remove multiple selected blocks."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,g.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,g.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,g.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,g.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,g.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var Lk=Mk;function Ak(){return At()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in."}),null}const Dk=new Set([fa.UP,fa.RIGHT,fa.DOWN,fa.LEFT,fa.ENTER,fa.BACKSPACE]);function Ok(){const e=(0,m.useSelect)((e=>e(Wn).isTyping()),[]),{stopTyping:t}=(0,m.useDispatch)(Wn);return(0,d.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function Fk(){const e=(0,m.useSelect)((e=>e(Wn).isTyping())),{startTyping:t,stopTyping:n}=(0,m.useDispatch)(Wn),o=Ok(),r=(0,d.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:l}=r;if(e){let e;function t(t){const{target:o}=t;e=l.setTimeout((()=>{(0,tr.isTextField)(o)||n()}))}function i(e){const{keyCode:t}=e;t!==fa.ESCAPE&&t!==fa.TAB||n()}function s(){const e=l.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",t),o.addEventListener("keydown",i),r.addEventListener("selectionchange",s),()=>{l.clearTimeout(e),o.removeEventListener("focus",t),o.removeEventListener("keydown",i),r.removeEventListener("selectionchange",s)}}function i(e){const{type:n,target:r}=e;(0,tr.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&Dk.has(t)}(e))&&t()}return o.addEventListener("keypress",i),o.addEventListener("keydown",i),()=>{o.removeEventListener("keypress",i),o.removeEventListener("keydown",i)}}),[e,t,n]);return(0,d.useMergeRefs)([o,r])}var zk=function({children:e}){return(0,s.createElement)("div",{ref:Fk()},e)};function Vk(){return At()("PreserveScrollInReorder component",{since:"5.4",hint:"This behavior is now built-in the block list"}),null}const Hk=-1!==window.navigator.userAgent.indexOf("Trident"),Uk=new Set([fa.UP,fa.DOWN,fa.LEFT,fa.RIGHT]);function Gk(){const e=(0,m.useSelect)((e=>e(Wn).hasSelectedBlock()),[]);return(0,d.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function s(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c({keyCode:e}){if(!m())return;const r=(0,tr.computeCaretRect)(o);if(!r)return;if(!i)return void(i=r);if(Uk.has(e))return void(i=r);const l=r.top-i.top;if(0===l)return;const s=(0,tr.getScrollContainer)(t);if(!s)return;const a=s===n.body,c=a?o.scrollY:s.scrollTop,u=a?0:s.getBoundingClientRect().top,d=a?i.top/o.innerHeight:(i.top-u)/(o.innerHeight-u);if(0===c&&d<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=r);const p=a?o.innerHeight:s.clientHeight;i.top+i.height>u+p||i.top<u?i=r:a?o.scrollBy(0,l):s.scrollTop+=l}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,tr.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",s,!0),o.addEventListener("resize",s,!0),t.addEventListener("keydown",a),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",s,!0),o.removeEventListener("resize",s,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}var Wk=Hk?e=>e.children:function({children:e}){return(0,s.createElement)("div",{ref:Gk(),className:"block-editor__typewriter"},e)};const $k=(0,u.overEvery)([tr.isTextField,tr.focus.tabbable.isTabbableIndex]);function jk(){return(0,d.useRefEffect)((e=>{function t(t){if(t.target!==e)return;const n=tr.focus.focusable.find(e),o=(0,u.findLast)(n,$k);if(!o)return;const{bottom:r}=o.getBoundingClientRect();t.clientY<r||((0,tr.placeCaretAtHorizontalEdge)(o,!0),t.preventDefault())}return e.addEventListener("mousedown",t),()=>{e.addEventListener("mousedown",t)}}),[])}const Kk=(0,s.createContext)({});function qk(e,t=""){var n;const o=(0,s.useContext)(Kk),{name:r}=qn();t=t||r;const l=Boolean(null===(n=o[t])||void 0===n?void 0:n.has(e)),i=(0,s.useMemo)((()=>function(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}(o,t,e)),[o,t,e]);return[l,(0,s.useCallback)((({children:e})=>(0,s.createElement)(Kk.Provider,{value:i},e)),[i])]}function Yk(e){if(void 0===e)e=b.colors;else{const t=e.filter((e=>e.color));0===t.length?e=b.colors:t.length<e.length&&(e=t)}return e}function Zk(e){if(void 0===e)e=b.gradients;else{const t=e.filter((e=>e.gradient));0===t.length?e=b.gradients:t.length<e.length&&(e=t)}return e}function Xk(e){const t=null==e?void 0:e.trim().match(/^(0?[-.]?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);return isNaN(e)||isNaN(parseFloat(e))?t?{value:parseFloat(t[1])||t[1],unit:t[2]}:{value:e,unit:void 0}:{value:parseFloat(e),unit:"px"}}function Qk(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>Xk(Jk(e,t)).value)).filter(Boolean);switch(n[0]){case"min":return Math.min(...o)+"px";case"max":return Math.max(...o)+"px";case"clamp":return 3!==o.length?null:o[1]<o[0]?o[0]+"px":o[1]>o[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function Jk(e,t={}){if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=Xk(e);return n.unit||(n=function(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=Qk(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return Xk(e)}(e)),function(e){for(let t=0;t<e.length;t++)if(["+","-","/","*"].includes(e[t]))return!0;return!1}(e)&&!n.unit?function(e){let t=!1;const n=e.split(/[+-/*/]/g).filter(Boolean);for(const o of n){const n=Xk(Jk(o));if(!parseFloat(n.value)){t=!0;break}e=e.replace(o,n.value)}return t?null:(o=e,Function(`'use strict'; return (${o})`)()).toFixed(0)+"px";var o}(e):function(e,t){const n=.01,o=Object.assign({},{fontSize:16,lineHeight:16,width:375,height:812,type:"font"},t),r={em:o.fontSize,rem:o.fontSize,vh:o.height*n,vw:o.width*n,vmin:(o.width<o.height?o.width:o.height)*n,vmax:(o.width>o.height?o.width:o.height)*n,"%":("font"===o.type?o.fontSize:o.width)*n,ch:8,ex:7.15625,lh:o.lineHeight},l={in:96,cm:37.79527559055118,mm:3.7795275590551185,pt:1.3333333333333333,pc:16,px:1,Q:.9448818897637794};return r[e.unit]?(r[e.unit]*e.value).toFixed(0)+"px":l[e.unit]?(l[e.unit]*e.value).toFixed(0)+"px":null}(n,t)}const e_={};var t_=function(e,t={}){const n=e+function(e){let t="";return e.hasOwnProperty("fontSize")&&(t=":"+e.width),e.hasOwnProperty("lineHeight")&&(t=":"+e.lineHeight),e.hasOwnProperty("width")&&(t=":"+e.width),e.hasOwnProperty("height")&&(t=":"+e.height),e.hasOwnProperty("type")&&(t=":"+e.type),t}(t);return e_[n]||(e_[n]=Jk(e,t)),e_[n]}}(),(window.wp=window.wp||{}).blockEditor=o}();
|
1 |
+
!function(){var e={9367:function(e,t){var n,o;void 0===(o="function"==typeof(n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default})?n.apply(t,[e,t]):n)||(e.exports=o)},4184:function(e,t){var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},1934:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},5913:function(e,t){"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var g=d&&d.newPos+1<a,h=m&&0<=f&&f<c;if(g||h){if(!g||h&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.newPos+1>=a&&f+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();f()||e()}),0)}();else for(;u<=d;){var g=f();if(g)return g}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},7630:function(e,t,n){"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(5913))&&o.__esModule?o:{default:o}).default)},9010:function(e,t,n){"use strict";var o=n(4657);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),f=o.offset(e),g=o.outerHeight(e),h=o.outerWidth(e),b=void 0,v=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:f.left-S.left-c,top:f.top-S.top-a},E={left:f.left+h-(S.left+w)+d,top:f.top+g-(S.top+B)+u},_=S):(b=o.offset(t),v=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(b.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:f.top-(b.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:f.left+h-(b.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+g-(b.top+v+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,_.top+y.top):!1===i?o.scrollTop(t,_.top+E.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,_.left+y.left):!1===s?o.scrollLeft(t,_.left+E.left):y.left<0?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left)))}},4979:function(e,t,n){"use strict";e.exports=n(9010)},4657:function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function f(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function g(e){return null!=e&&e==e.window}var h={};function b(e,t,n){if(g(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-f(e,["border","padding"],o):i;if(s){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return a+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var v={position:"absolute",visibility:"hidden",display:"block"};function k(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=b.apply(void 0,n):m(e,v,(function(){t=b.apply(void 0,n)})),t}function _(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&_(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);h["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=f(t,["padding","border"],n)),_(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===_(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(_(e,l))||0,o[l]=r+t[l]-n[l]);_(e,o)}(e,t)},isWindow:g,each:u,css:_,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(g(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(g(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},h)},5717:function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},8303:function(e,t,n){var o=n(1934);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},2703:function(e,t,n){"use strict";var o=n(414);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},5697:function(e,t,n){e.exports=n(2703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4857:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||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},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(3804),a=n(5697),c=n(9367),u=n(8303),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},4042:function(e,t,n){"use strict";var o=n(4857);t.Z=o.TextareaAutosize},3692:function(e){var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},f=!0,g={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],e&&(f=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){f=!1}};if(!u)return g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=l(g.node)),g.isLeaf=0==g.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){g.circular=i[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var b=t.call(g,g.node);return void 0!==b&&g.update&&g.update(b),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(i.push(g),h(),a(g.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(g,g.node[t],t);var l=e(g.node[t]);n&&c.call(g.node,t)&&(g.node[t]=l.node),l.isLast=r==g.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(g,l),o.pop()})),i.pop()),m.after&&m.after.call(g,g.node),g):g}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===i(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},3804:function(e){"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return ch},AlignmentToolbar:function(){return uh},Autocomplete:function(){return fh},BlockAlignmentControl:function(){return Do},BlockAlignmentToolbar:function(){return Oo},BlockBreadcrumb:function(){return kh},BlockColorsStyleSelector:function(){return Sh},BlockContextProvider:function(){return or},BlockControls:function(){return eo},BlockEdit:function(){return sr},BlockEditorKeyboardShortcuts:function(){return Ak},BlockEditorProvider:function(){return Ua},BlockFormatControls:function(){return Jn},BlockIcon:function(){return za},BlockInspector:function(){return Pk},BlockList:function(){return Kp},BlockMover:function(){return Ld},BlockNavigationDropdown:function(){return Wh},BlockPreview:function(){return iu},BlockSelectionClearer:function(){return $a},BlockSettingsMenu:function(){return Ep},BlockSettingsMenuControls:function(){return vp},BlockTitle:function(){return _d},BlockToolbar:function(){return Cp},BlockTools:function(){return Rk},BlockVerticalAlignmentControl:function(){return db},BlockVerticalAlignmentToolbar:function(){return pb},ButtonBlockAppender:function(){return ud},ButtonBlockerAppender:function(){return cd},ColorPalette:function(){return fb},ColorPaletteControl:function(){return gb},ContrastChecker:function(){return Zm},CopyHandler:function(){return sp},DefaultBlockAppender:function(){return sd},FontSizePicker:function(){return jf},InnerBlocks:function(){return Gp},Inserter:function(){return id},InspectorAdvancedControls:function(){return Zo},InspectorControls:function(){return Xo},JustifyContentControl:function(){return bo},JustifyToolbar:function(){return vo},LineHeightControl:function(){return wf},MediaPlaceholder:function(){return Nv},MediaReplaceFlow:function(){return Sv},MediaUpload:function(){return Ev},MediaUploadCheck:function(){return Cv},MultiSelectScrollIntoView:function(){return Dk},NavigableToolbar:function(){return Sd},ObserveTyping:function(){return Vk},PanelColorSettings:function(){return Pv},PlainText:function(){return ok},PreserveScrollInReorder:function(){return Hk},RichText:function(){return ek},RichTextShortcut:function(){return ik},RichTextToolbarButton:function(){return sk},SETTINGS_DEFAULTS:function(){return b},SkipToSelectedBlock:function(){return wk},ToolSelector:function(){return uk},Typewriter:function(){return $k},URLInput:function(){return ev},URLInputButton:function(){return fk},URLPopover:function(){return xv},Warning:function(){return cr},WritingFlow:function(){return tc},__experimentalBlockAlignmentMatrixControl:function(){return bh},__experimentalBlockContentOverlay:function(){return _h},__experimentalBlockFullHeightAligmentControl:function(){return hh},__experimentalBlockPatternSetup:function(){return nb},__experimentalBlockVariationPicker:function(){return jh},__experimentalBlockVariationTransforms:function(){return rb},__experimentalBorderRadiusControl:function(){return xm},__experimentalBorderStyleControl:function(){return Lm},__experimentalColorGradientControl:function(){return dm},__experimentalDuotoneControl:function(){return Pg},__experimentalFontAppearanceControl:function(){return Pf},__experimentalFontFamilyControl:function(){return Ff},__experimentalGetBorderClassesAndStyles:function(){return Wg},__experimentalGetColorClassesAndStyles:function(){return Kg},__experimentalGetGradientClass:function(){return em},__experimentalGetGradientObjectByGradientValue:function(){return nm},__experimentalGetMatchingVariation:function(){return ob},__experimentalGetSpacingClassesAndStyles:function(){return Yg},__experimentalImageEditingProvider:function(){return Ob},__experimentalImageEditor:function(){return qb},__experimentalImageSizeControl:function(){return Zb},__experimentalImageURLInputUI:function(){return Ek},__experimentalLayoutStyle:function(){return To},__experimentalLetterSpacingControl:function(){return Qf},__experimentalLibrary:function(){return Mk},__experimentalLinkControl:function(){return kv},__experimentalLinkControlSearchInput:function(){return pv},__experimentalLinkControlSearchItem:function(){return ov},__experimentalLinkControlSearchResults:function(){return iv},__experimentalListView:function(){return Uh},__experimentalPanelColorGradientSettings:function(){return qm},__experimentalPreviewOptions:function(){return Ck},__experimentalResponsiveBlockControl:function(){return lk},__experimentalUnitControl:function(){return dk},__experimentalUseBorderProps:function(){return $g},__experimentalUseColorProps:function(){return qg},__experimentalUseCustomSides:function(){return kg},__experimentalUseGradient:function(){return rm},__experimentalUseInnerBlocksProps:function(){return Up},__experimentalUseNoRecursiveRenders:function(){return Yk},__experimentalUseResizeCanvas:function(){return Sk},__unstableBlockSettingsMenuFirstItem:function(){return mp},__unstableEditorStyles:function(){return ou},__unstableIframe:function(){return rc},__unstableInserterMenuExtension:function(){return Ou},__unstableRichTextInputEvent:function(){return ak},__unstableUseBlockSelectionClearer:function(){return Wa},__unstableUseCanvasClickRedirect:function(){return Kk},__unstableUseClipboardHandler:function(){return ip},__unstableUseMouseMoveTypingReset:function(){return Fk},__unstableUseTypewriter:function(){return Wk},__unstableUseTypingObserver:function(){return zk},createCustomColorsHOC:function(){return Jg},getColorClassName:function(){return Qp},getColorObjectByAttributeValues:function(){return Zp},getColorObjectByColorValue:function(){return Xp},getFontSize:function(){return Gf},getFontSizeClass:function(){return $f},getFontSizeObjectByValue:function(){return Wf},getGradientSlugByValue:function(){return om},getGradientValueBySlug:function(){return tm},getPxFromCssUnit:function(){return n_},store:function(){return Wn},storeConfig:function(){return Gn},transformStyles:function(){return eu},useBlockDisplayInformation:function(){return kd},useBlockEditContext:function(){return qn},useBlockProps:function(){return xa},useCachedTruthy:function(){return Zg},useSetting:function(){return fo},validateThemeColors:function(){return Zk},validateThemeGradients:function(){return Xk},withColorContext:function(){return mb},withColors:function(){return eh},withFontSizes:function(){return nh}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return Nt},__experimentalGetAllowedBlocks:function(){return ct},__experimentalGetAllowedPatterns:function(){return mt},__experimentalGetBlockListSettingsForBlocks:function(){return kt},__experimentalGetDirectInsertBlock:function(){return ut},__experimentalGetLastBlockAttributeChanges:function(){return Ct},__experimentalGetParsedPattern:function(){return dt},__experimentalGetParsedReusableBlock:function(){return _t},__experimentalGetPatternTransformItems:function(){return gt},__experimentalGetPatternsByBlockTypes:function(){return ft},__experimentalGetReusableBlockTitle:function(){return yt},__unstableGetBlockWithoutInnerBlocks:function(){return $},__unstableGetClientIdWithClientIdsTree:function(){return K},__unstableGetClientIdsTree:function(){return q},__unstableIsLastBlockChangeIgnored:function(){return Et},areInnerBlocksControlled:function(){return Tt},canInsertBlockType:function(){return Ye},canInsertBlocks:function(){return Ze},canMoveBlock:function(){return Je},canMoveBlocks:function(){return et},canRemoveBlock:function(){return Xe},canRemoveBlocks:function(){return Qe},didAutomaticChange:function(){return It},getAdjacentBlockClientId:function(){return me},getBlock:function(){return W},getBlockAttributes:function(){return G},getBlockCount:function(){return J},getBlockHierarchyRootClientId:function(){return de},getBlockIndex:function(){return xe},getBlockInsertionPoint:function(){return Ue},getBlockListSettings:function(){return ht},getBlockMode:function(){return Ae},getBlockName:function(){return H},getBlockOrder:function(){return Ie},getBlockParents:function(){return ce},getBlockParentsByBlockName:function(){return ue},getBlockRootClientId:function(){return ae},getBlockSelectionEnd:function(){return oe},getBlockSelectionStart:function(){return ne},getBlockTransformItems:function(){return st},getBlocks:function(){return j},getBlocksByClientId:function(){return Q},getClientIdsOfDescendants:function(){return Y},getClientIdsWithDescendants:function(){return Z},getDraggedBlockClientIds:function(){return Fe},getFirstMultiSelectedBlockClientId:function(){return _e},getGlobalBlockCount:function(){return X},getInserterItems:function(){return it},getLastMultiSelectedBlockClientId:function(){return ye},getLowestCommonAncestorWithSelectedBlock:function(){return pe},getMultiSelectedBlockClientIds:function(){return ve},getMultiSelectedBlocks:function(){return ke},getMultiSelectedBlocksEndClientId:function(){return Be},getMultiSelectedBlocksStartClientId:function(){return we},getNextBlockClientId:function(){return ge},getPreviousBlockClientId:function(){return fe},getSelectedBlock:function(){return se},getSelectedBlockClientId:function(){return ie},getSelectedBlockClientIds:function(){return be},getSelectedBlockCount:function(){return re},getSelectedBlocksInitialCaretPosition:function(){return he},getSelectionEnd:function(){return te},getSelectionStart:function(){return ee},getSettings:function(){return bt},getTemplate:function(){return $e},getTemplateLock:function(){return je},hasBlockMovingClientId:function(){return Bt},hasInserterItems:function(){return at},hasMultiSelection:function(){return Re},hasSelectedBlock:function(){return le},hasSelectedInnerBlock:function(){return Ne},isAncestorBeingDragged:function(){return Ve},isAncestorMultiSelected:function(){return Se},isBlockBeingDragged:function(){return ze},isBlockHighlighted:function(){return xt},isBlockInsertionPointVisible:function(){return Ge},isBlockMultiSelected:function(){return Ce},isBlockSelected:function(){return Te},isBlockValid:function(){return U},isBlockWithinSelection:function(){return Pe},isCaretWithinFormattedText:function(){return He},isDraggingBlocks:function(){return Oe},isFirstMultiSelectedBlock:function(){return Ee},isLastBlockChangePersistent:function(){return vt},isMultiSelecting:function(){return Me},isNavigationMode:function(){return wt},isSelectionEnabled:function(){return Le},isTyping:function(){return De},isValidTemplate:function(){return We},wasBlockJustInserted:function(){return Pt}});var t={};n.r(t),n.d(t,{__unstableMarkAutomaticChange:function(){return Mn},__unstableMarkAutomaticChangeFinal:function(){return Ln},__unstableMarkLastChangeAsPersistent:function(){return Pn},__unstableMarkNextChangeAsNotPersistent:function(){return Rn},__unstableSaveReusableBlock:function(){return Nn},clearSelectedBlock:function(){return Xt},duplicateBlocks:function(){return On},enterFormattedText:function(){return Sn},exitFormattedText:function(){return wn},flashBlock:function(){return Hn},hideInsertionPoint:function(){return dn},insertAfterBlock:function(){return zn},insertBeforeBlock:function(){return Fn},insertBlock:function(){return an},insertBlocks:function(){return cn},insertDefaultBlock:function(){return In},mergeBlocks:function(){return fn},moveBlockToPosition:function(){return sn},moveBlocksDown:function(){return on},moveBlocksToPosition:function(){return ln},moveBlocksUp:function(){return rn},multiSelect:function(){return Zt},receiveBlocks:function(){return Ut},removeBlock:function(){return hn},removeBlocks:function(){return gn},replaceBlock:function(){return tn},replaceBlocks:function(){return en},replaceInnerBlocks:function(){return bn},resetBlocks:function(){return zt},resetSelection:function(){return Ht},selectBlock:function(){return $t},selectNextBlock:function(){return Kt},selectPreviousBlock:function(){return jt},selectionChange:function(){return Bn},setBlockMovingClientId:function(){return Dn},setHasControlledInnerBlocks:function(){return Un},setNavigationMode:function(){return An},setTemplateValidity:function(){return pn},showInsertionPoint:function(){return un},startDraggingBlocks:function(){return En},startMultiSelect:function(){return qt},startTyping:function(){return kn},stopDraggingBlocks:function(){return Cn},stopMultiSelect:function(){return Yt},stopTyping:function(){return yn},synchronizeTemplate:function(){return mn},toggleBlockHighlight:function(){return Vn},toggleBlockMode:function(){return vn},toggleSelection:function(){return Qt},updateBlock:function(){return Wt},updateBlockAttributes:function(){return Gt},updateBlockListSettings:function(){return xn},updateSettings:function(){return Tn},validateBlocksToTemplate:function(){return Vt}});var r=window.wp.blocks,l=window.wp.hooks;function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var s=window.wp.element,a=n(4184),c=n.n(a),u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,f={default:(0,p.createSlotFill)("BlockControls"),block:(0,p.createSlotFill)("BlockControlsBlock"),inline:(0,p.createSlotFill)("BlockFormatControls"),other:(0,p.createSlotFill)("BlockControlsOther"),parent:(0,p.createSlotFill)("BlockControlsParent")},g=window.wp.i18n;const h={insertUsage:{}},b={alignWide:!1,supportsLayout:!0,colors:[{name:(0,g.__)("Black"),slug:"black",color:"#000000"},{name:(0,g.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,g.__)("White"),slug:"white",color:"#ffffff"},{name:(0,g.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,g.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,g.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,g.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,g.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,g.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,g.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,g.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,g.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,g._x)("Small","font size name"),size:13,slug:"small"},{name:(0,g._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,g._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,g._x)("Large","font size name"),size:36,slug:"large"},{name:(0,g._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,g.__)("Thumbnail")},{slug:"medium",name:(0,g.__)("Medium")},{slug:"large",name:(0,g.__)("Large")},{slug:"full",name:(0,g.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__unstableGalleryWithImageBlocks:!1,gradients:[{name:(0,g.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,g.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,g.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,g.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,g.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,g.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,g.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,g.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,g.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,g.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,g.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,g.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}]};function v(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function k(e,t,n,o=1){const r=[...e];return r.splice(t,o),v(r,e.slice(t,t+o),n)}function _(e,t=""){const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,_(r,o))})),n}function y(e,t=""){return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e,t=u.identity){const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function S(e){return E(e,(e=>e.attributes))}function w(e,t="",n={}){return(0,u.reduce)(e[t],((t,o)=>n[o]?t:[...t,o,...w(e,o)]),[])}function B(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function I(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function x(e,t,n){const o=new Set([]),r=new Set;for(const t of n){let n=t;do{if(e.controlledInnerBlocks[n]){r.add(n);break}o.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of o)t[e]={...t[e]};for(const n of o)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of r)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const T=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>(t={},n)=>{const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=I(o,n.blocks);o.tree=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""]);break}case"UPDATE_BLOCK":o.tree=x(o,{...o.tree,[n.clientId]:{...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId]);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=x(o,{...o.tree,...e},n.clientIds);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=I(o,n.blocks);o.tree=x(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)));const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=x(o,o.tree,r);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=x(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=x(o,o.tree,e);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(o,o.tree,e);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=x(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){var o,r,l;const e=w(null!==(o=null==t?void 0:t.order)&&void 0!==o?o:{},"",null!==(r=null==t?void 0:t.controlledInnerBlocks)&&void 0!==r?r:{}),i=Object.keys((0,u.pickBy)(null!==(l=null==t?void 0:t.controlledInnerBlocks)&&void 0!==l?l:{})),s={...t,byClientId:{...(0,u.omit)(null==t?void 0:t.byClientId,e),...C(n.blocks)},attributes:{...(0,u.omit)(null==t?void 0:t.attributes,e),...S(n.blocks)},order:{...(0,u.omit)(null==t?void 0:t.order,e),...(0,u.omit)(_(n.blocks),i)},parents:{...(0,u.omit)(null==t?void 0:t.parents,e),...y(n.blocks)},controlledInnerBlocks:(null==t?void 0:t.controlledInnerBlocks)||{}},a=I(s,n.blocks);return s.tree={...(0,u.omit)(null==t?void 0:t.tree,e),...a,"":{innerBlocks:n.blocks.map((e=>a[e.clientId]))}},s}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!B(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}))({byClientId(e={},t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...C(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...C(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(e={},t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(e={},t){switch(t.type){case"RECEIVE_BLOCKS":{const n=_(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=_(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:v(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:v(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const s=i.indexOf(r);return{...e,[o]:k(i,s,s+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=_(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(e={},t){switch(t.type){case"RECEIVE_BLOCKS":return{...e,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...y(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks:(e={},{type:t,clientId:n,hasControlledInnerBlocks:o})=>"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e});function N(e={},t){switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var P,R,M=(0,m.combineReducers)({blocks:T,isTyping:function(e=!1,t){switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(e=[],t){switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},isCaretWithinFormattedText:function(e=!1,t){switch(t.type){case"ENTER_FORMATTED_TEXT":return!0;case"EXIT_FORMATTED_TEXT":return!1}return e},selection:function(e={},t){var n,o;switch(t.type){case"SELECTION_CHANGE":return{selectionStart:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.startOffset},selectionEnd:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.endOffset}};case"RESET_SELECTION":const{selectionStart:r,selectionEnd:l}=t;return{selectionStart:r,selectionEnd:l};case"MULTI_SELECT":const{start:i,end:s}=t;return{selectionStart:{clientId:i},selectionEnd:{clientId:s}};case"RESET_BLOCKS":const a=null==e||null===(n=e.selectionStart)||void 0===n?void 0:n.clientId,c=null==e||null===(o=e.selectionEnd)||void 0===o?void 0:o.clientId;if(!a&&!c)return e;if(!t.blocks.some((e=>e.clientId===a)))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some((e=>e.clientId===c)))return{...e,selectionEnd:e.selectionStart}}return{selectionStart:N(e.selectionStart,t),selectionEnd:N(e.selectionEnd,t)}},isMultiSelecting:function(e=!1,t){switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(e=!0,t){switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(e=null,t){return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(e={},t){if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:(e={},t)=>{switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(e={isValid:!0},t){switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(e=b,t){switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(e=h,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,m.select)(r.store).getActiveBlockVariation(l,o);let s=null!=i&&i.name?`${l}/${i.name}`:l;const a={name:s};return"core/block"===l&&(a.ref=o.ref,s+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[s]:{time:t.time,count:e.insertUsage[s]?e.insertUsage[s].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(e,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return null},isNavigationMode:function(e=!1,t){return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(e=null,t){return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(e={},t){var n;switch(t.type){case"INSERT_BLOCKS":return t.blocks.length?{clientId:t.blocks[0].clientId,source:null===(n=t.meta)||void 0===n?void 0:n.source}:e;case"RESET_BLOCKS":return{}}return e}});function L(e){return[e]}function A(){var e={clear:function(){e.head=null}};return e}function D(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function O(e,t){var n,o;function r(){n=R?new WeakMap:A()}function l(){var n,r,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for(s=t.apply(null,i),(n=o(s)).isUniqueByDependants||(n.lastDependants&&!D(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),r=n.head;r;){if(D(r.args,i,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:e.apply(null,i)},i[0]=null,r.args=i,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=L),o=R?function(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(P)||((l=A()).isUniqueByDependants=a,s.set(P,l)),s.get(P)}:function(){return n},l.getDependants=t,l.clear=r,r(),l}P={},R="undefined"!=typeof WeakMap;var F=window.wp.primitives,z=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"}));const V=[];function H(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function U(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function G(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function W(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const $=O(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:G(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function j(e,t){var n;const o=t&&Tt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||V}const K=O(((e,t)=>({clientId:t,innerBlocks:q(e,t)})),(e=>[e.blocks.order])),q=O(((e,t="")=>(0,u.map)(Ie(e,t),(t=>K(e,t)))),(e=>[e.blocks.order])),Y=(e,t)=>(0,u.flatMap)(t,(t=>{const n=Ie(e,t);return[...n,...Y(e,n)]})),Z=O((e=>{const t=Ie(e);return[...t,...Y(e,t)]}),(e=>[e.blocks.order])),X=O(((e,t)=>{const n=Z(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),Q=O(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>W(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function J(e,t){return Ie(e,t).length}function ee(e){return e.selection.selectionStart}function te(e){return e.selection.selectionEnd}function ne(e){return e.selection.selectionStart.clientId}function oe(e){return e.selection.selectionEnd.clientId}function re(e){return ve(e).length||(e.selection.selectionStart.clientId?1:0)}function le(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ie(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function se(e){const t=ie(e);return t?W(e,t):null}function ae(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const ce=O(((e,t,n=!1)=>{const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),ue=O(((e,t,n,o=!1)=>{const r=ce(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:H(e,t)}))),(({name:e})=>Array.isArray(n)?n.includes(e):e===n)),(({id:e})=>e))}),(e=>[e.blocks.parents]));function de(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function pe(e,t){const n=ie(e),o=[...ce(e,t),t],r=[...ce(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function me(e,t,n=1){if(void 0===t&&(t=ie(e)),void 0===t&&(t=n<0?_e(e):ye(e)),!t)return null;const o=ae(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t)+1*n;return i<0||i===l.length?null:l[i]}function fe(e,t){return me(e,t,-1)}function ge(e,t){return me(e,t,1)}function he(e){return e.initialPosition}const be=O((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return V;if(t.clientId===n.clientId)return[t.clientId];const o=ae(e,t.clientId);if(null===o)return V;const r=Ie(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?V:be(e)}const ke=O((e=>{const t=ve(e);return t.length?t.map((t=>W(e,t))):V}),(e=>[...be.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function _e(e){return(0,u.first)(ve(e))||null}function ye(e){return(0,u.last)(ve(e))||null}function Ee(e,t){return _e(e)===t}function Ce(e,t){return-1!==ve(e).indexOf(t)}const Se=O(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=ae(e,n),o=Ce(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function we(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Be(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ie(e,t){return e.blocks.order[t||""]||V}function xe(e,t,n){return Ie(e,n).indexOf(t)}function Te(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Ne(e,t,n=!1){return(0,u.some)(Ie(e,t),(t=>Te(e,t)||Ce(e,t)||n&&Ne(e,t,n)))}function Pe(e,t){if(!t)return!1;const n=ve(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Re(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Me(e){return e.isMultiSelecting}function Le(e){return e.isSelectionEnabled}function Ae(e,t){return e.blocksMode[t]||"visual"}function De(e){return e.isTyping}function Oe(e){return!!e.draggedBlocks.length}function Fe(e){return e.draggedBlocks}function ze(e,t){return e.draggedBlocks.includes(t)}function Ve(e,t){if(!Oe(e))return!1;const n=ce(e,t);return(0,u.some)(n,(t=>ze(e,t)))}function He(e){return e.isCaretWithinFormattedText}function Ue(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=ae(e,l)||void 0,n=xe(e,r.clientId,t)+1):n=Ie(e).length,{rootClientId:t,index:n}}function Ge(e){return null!==e.insertionPoint}function We(e){return e.template.isValid}function $e(e){return e.settings.template}function je(e,t){if(!t)return e.settings.templateLock;const n=ht(e,t);return n?n.templateLock:null}const Ke=(e,t,n=null)=>(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,qe=(e,t,n=null)=>{let o;if(t&&"object"==typeof t?(o=t,t=o.name):o=(0,r.getBlockType)(t),!o)return!1;const{allowedBlockTypes:l}=bt(e);if(!Ke(l,t,!0))return!1;if(je(e,n))return!1;const i=ht(e,n);if(n&&void 0===i)return!1;const s=null==i?void 0:i.allowedBlocks,a=Ke(s,t),c=o.parent,u=H(e,n),d=Ke(c,u);return null!==a&&null!==d?a||d:null!==a?a:null===d||d},Ye=O(qe,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function Ze(e,t,n=null){return t.every((t=>Ye(e,H(e,t),n)))}function Xe(e,t,n=null){const o=G(e,t);if(null===o)return!0;const{lock:r}=o,l=!!je(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function Qe(e,t,n=null){return t.every((t=>Xe(e,t,n)))}function Je(e,t,n=null){const o=G(e,t);if(null===o)return;const{lock:r}=o,l="all"===je(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function et(e,t,n=null){return t.every((t=>Je(e,t,n)))}function tt(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const nt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&qe(e,t.name,n),ot=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=tt(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:rt(r,l)}},rt=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},lt=(e,{buildScope:t="inserter"})=>n=>{const o=n.name;let l=!1;(0,r.hasBlockSupport)(n.name,"multiple",!0)||(l=(0,u.some)(Q(e,Z(e)),{name:n.name}));const{time:i,count:s=0}=tt(e,o)||{},a={id:o,name:n.name,title:n.title,icon:n.icon,isDisabled:l,frecency:rt(i,s)};if("transform"===t)return a;const c=(0,r.getBlockVariations)(n.name,"inserter");return{...a,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,variations:c,example:n.example,utility:1}},it=O(((e,t=null)=>{const n=lt(e,{buildScope:"inserter"}),o=(0,r.getBlockTypes)().filter((n=>nt(e,n,t))).map(n),l=qe(e,"core/block",t)?St(e).map((t=>{const n=`core/block/${t.id}`,o=_t(e,t.id);let l;1===o.length&&(l=(0,r.getBlockType)(o[0].name));const{time:i,count:a=0}=tt(e,n)||{},c=rt(i,a);return{id:n,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:l&&"web"===s.Platform.OS?l.icon:z,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}})):[],i=o.filter((({variations:e=[]})=>!e.some((({isDefault:e})=>e)))),a=[];for(const t of o){const{variations:n=[]}=t;if(n.length){const o=ot(e,t);a.push(...n.map(o))}}const c=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},u=i.reduce(c,{core:[],noncore:[]}),d=a.reduce(c,{core:[],noncore:[]});return[...u.core,...d.core,...u.noncore,...d.noncore,...l]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,St(e),(0,r.getBlockTypes)()])),st=O(((e,t,n=null)=>{const o=lt(e,{buildScope:"transform"}),l=(0,r.getBlockTypes)().filter((t=>nt(e,t,n))).map(o),i=(0,u.mapKeys)(l,(({name:e})=>e)),s=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>(i[null==t?void 0:t.name]&&e.push(i[t.name]),e)),[]);return(0,u.orderBy)(s,(e=>i[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),at=O(((e,t=null)=>!!(0,u.some)((0,r.getBlockTypes)(),(n=>nt(e,n,t)))||qe(e,"core/block",t)&&St(e).length>0),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,St(e),(0,r.getBlockTypes)()])),ct=O(((e,t=null)=>{if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>nt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),ut=O(((e,t=null)=>{var n,o;if(!t)return;const r=null===(n=e.blockListSettings[t])||void 0===n?void 0:n.__experimentalDefaultBlock,l=null===(o=e.blockListSettings[t])||void 0===o?void 0:o.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(W(e,t))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),dt=O(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((({name:e})=>e===t));return n?{...n,blocks:(0,r.parse)(n.content)}:null}),(e=>[e.settings.__experimentalBlockPatterns])),pt=O((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=bt(e);return t.map((({name:t})=>dt(e,t))).filter((({blocks:e})=>((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!Ke(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(e,n)))}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),mt=O(((e,t=null)=>{const n=pt(e);return(0,u.filter)(n,(({blocks:n})=>n.every((({name:n})=>Ye(e,n,t)))))}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),ft=O(((e,t,n=null)=>{if(!t)return V;const o=mt(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...mt.getDependants(e,t)])),gt=O(((e,t,n=null)=>{if(!t)return V;if(t.some((({clientId:t,innerBlocks:n})=>n.length||Tt(e,t))))return V;const o=Array.from(new Set(t.map((({name:e})=>e))));return ft(e,o,n)}),((e,t)=>[...ft.getDependants(e,t)]));function ht(e,t){return e.blockListSettings[t]}function bt(e){return e.settings}function vt(e){return e.blocks.isPersistentChange}const kt=O(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),_t=O(((e,t)=>{const n=(0,u.find)(St(e),(e=>e.id===t));return n?(0,r.parse)("string"==typeof n.content.raw?n.content.raw:n.content):null}),(e=>[St(e)])),yt=O(((e,t)=>{var n;const o=(0,u.find)(St(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[St(e)]));function Et(e){return e.blocks.isIgnoredChange}function Ct(e){return e.lastBlockAttributesChange}function St(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:V}function wt(e){return e.isNavigationMode}function Bt(e){return e.hasBlockMovingClientId}function It(e){return!!e.automaticChangeStatus}function xt(e,t){return e.highlightedBlock===t}function Tt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Nt=O(((e,t)=>{if(!t.length)return null;const n=ie(e);if(t.includes(H(e,n)))return n;const o=ve(e),r=ue(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Pt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Rt=window.wp.a11y,Mt=window.wp.richText,Lt=window.wp.deprecated,At=n.n(Lt),Dt={SLEEP:({duration:e})=>new Promise((t=>{setTimeout(t,e)})),MARK_AUTOMATIC_CHANGE_FINAL_CONTROL:(0,m.createRegistryControl)((e=>()=>{const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>e.dispatch(Wn).__unstableMarkAutomaticChangeFinal()))}))};const Ot="core/block-editor";function*Ft(){if(0===(yield m.controls.select(Ot,"getBlockCount"))){const{__unstableHasCustomAppender:e}=yield m.controls.select(Ot,"getSettings");if(e)return;return yield In()}}function*zt(e){return yield{type:"RESET_BLOCKS",blocks:e},yield*Vt(e)}function*Vt(e){const t=yield m.controls.select(Ot,"getTemplate"),n=yield m.controls.select(Ot,"getTemplateLock"),o=!t||"all"!==n||(0,r.doBlocksMatchTemplate)(e,t);if(o!==(yield m.controls.select(Ot,"isValidTemplate")))return yield pn(o),o}function Ht(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Ut(e){return At()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Gt(e,t,n=!1){return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function Wt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function $t(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}function*jt(e){const t=yield m.controls.select(Ot,"getPreviousBlockClientId",e);if(t)return yield $t(t,-1),[t]}function*Kt(e){const t=yield m.controls.select(Ot,"getNextBlockClientId",e);if(t)return yield $t(t),[t]}function qt(){return{type:"START_MULTI_SELECT"}}function Yt(){return{type:"STOP_MULTI_SELECT"}}function*Zt(e,t){if((yield m.controls.select(Ot,"getBlockRootClientId",e))!==(yield m.controls.select(Ot,"getBlockRootClientId",t)))return;yield{type:"MULTI_SELECT",start:e,end:t};const n=yield m.controls.select(Ot,"getSelectedBlockCount");(0,Rt.speak)((0,g.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
(0,g._n)("%s block selected.","%s blocks selected.",n),n),"assertive")}function Xt(){return{type:"CLEAR_SELECTED_BLOCK"}}function Qt(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Jt(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}function*en(e,t,n,o=0,r){e=(0,u.castArray)(e),t=Jt((0,u.castArray)(t),yield m.controls.select(Ot,"getSettings"));const l=yield m.controls.select(Ot,"getBlockRootClientId",(0,u.first)(e));for(let e=0;e<t.length;e++){const n=t[e];if(!(yield m.controls.select(Ot,"canInsertBlockType",n.name,l)))return}yield{type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r},yield*Ft()}function tn(e,t){return en(e,t)}function nn(e){return function*(t,n){(yield m.controls.select(Ot,"canMoveBlocks",t,n))&&(yield{clientIds:(0,u.castArray)(t),type:e,rootClientId:n})}}const on=nn("MOVE_BLOCKS_DOWN"),rn=nn("MOVE_BLOCKS_UP");function*ln(e,t="",n="",o){const r=yield m.controls.select(Ot,"canMoveBlocks",e,t),l=yield m.controls.select(Ot,"canRemoveBlocks",e,t);if(!r)return;const i={type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o};t!==n?l&&(yield m.controls.select(Ot,"canInsertBlocks",e,n))&&(yield i):yield i}function*sn(e,t="",n="",o){yield ln([e],t,n,o)}function an(e,t,n,o=!0,r){return cn([e],t,n,o,0,r)}function*cn(e,t,n,o=!0,r=0,l){(0,u.isObject)(r)&&(l=r,r=0,At()("meta argument in wp.data.dispatch('core/block-editor')",{since:"10.1",plugin:"Gutenberg",hint:"The meta argument is now the 6th argument of the function"})),e=Jt((0,u.castArray)(e),yield m.controls.select(Ot,"getSettings"));const i=[];for(const t of e)(yield m.controls.select(Ot,"canInsertBlockType",t.name,n))&&i.push(t);if(i.length)return{type:"INSERT_BLOCKS",blocks:i,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l}}function un(e,t,n={}){const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function dn(){return{type:"HIDE_INSERTION_POINT"}}function pn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}function*mn(){yield{type:"SYNCHRONIZE_TEMPLATE"};const e=yield m.controls.select(Ot,"getBlocks"),t=yield m.controls.select(Ot,"getTemplate"),n=(0,r.synchronizeBlocksWithTemplate)(e,t);return yield zt(n)}function*fn(e,t){const n=[e,t];yield{type:"MERGE_BLOCKS",blocks:n};const[o,l]=n,i=yield m.controls.select(Ot,"getBlock",o),s=(0,r.getBlockType)(i.name);if(s&&!s.merge)return void(yield $t(i.clientId));const a=yield m.controls.select(Ot,"getBlock",l),c=(0,r.getBlockType)(a.name),{clientId:d,attributeKey:p,offset:f}=yield m.controls.select(Ot,"getSelectionStart"),g=(d===o?s:c).attributes[p],h=(d===o||d===l)&&void 0!==p&&void 0!==f&&!!g;g||("number"==typeof p?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof p):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const b=(0,r.cloneBlock)(i),v=(0,r.cloneBlock)(a);if(h){const e=d===o?b:v,t=e.attributes[p],{multiline:n,__unstableMultilineWrapperTags:r,__unstablePreserveWhiteSpace:l}=g,i=(0,Mt.insert)((0,Mt.create)({html:t,multilineTag:n,multilineWrapperTags:r,preserveWhiteSpace:l}),"",f,f);e.attributes[p]=(0,Mt.toHTMLString)({value:i,multilineTag:n,preserveWhiteSpace:l})}const k=i.name===a.name?[v]:(0,r.switchToBlockType)(v,i.name);if(!k||!k.length)return;const _=s.merge(b.attributes,k[0].attributes);if(h){const e=(0,u.findKey)(_,(e=>"string"==typeof e&&-1!==e.indexOf(""))),t=_[e],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=s.attributes[e],l=(0,Mt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),a=l.text.indexOf(""),c=(0,Mt.remove)(l,a,a+1),d=(0,Mt.toHTMLString)({value:c,multilineTag:n,preserveWhiteSpace:r});_[e]=d,yield Bn(i.clientId,e,a,a)}yield*en([i.clientId,a.clientId],[{...i,attributes:{...i.attributes,..._}},...k.slice(1)],0)}function*gn(e,t=!0){if(!e||!e.length)return;e=(0,u.castArray)(e);const n=yield m.controls.select(Ot,"getBlockRootClientId",e[0]);if(!(yield m.controls.select(Ot,"canRemoveBlocks",e,n)))return;let o;o=t?yield jt(e[0]):yield m.controls.select(Ot,"getPreviousBlockClientId",e[0]),yield{type:"REMOVE_BLOCKS",clientIds:e};const r=yield*Ft();return[o||r]}function hn(e,t){return gn([e],t)}function bn(e,t,n=!1,o=0){return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function vn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function kn(){return{type:"START_TYPING"}}function yn(){return{type:"STOP_TYPING"}}function En(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Cn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Sn(){return{type:"ENTER_FORMATTED_TEXT"}}function wn(){return{type:"EXIT_FORMATTED_TEXT"}}function Bn(e,t,n,o){return{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}}function In(e,t,n){const o=(0,r.getDefaultBlockName)();if(o)return an((0,r.createBlock)(o,e),n,t)}function xn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Tn(e){return{type:"UPDATE_SETTINGS",settings:e}}function Nn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Pn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Rn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}function*Mn(){yield{type:"MARK_AUTOMATIC_CHANGE"},yield{type:"MARK_AUTOMATIC_CHANGE_FINAL_CONTROL"}}function Ln(){return{type:"MARK_AUTOMATIC_CHANGE_FINAL"}}function*An(e=!0){yield{type:"SET_NAVIGATION_MODE",isNavigationMode:e},e?(0,Rt.speak)((0,g.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Rt.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}function*Dn(e=null){yield{type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e},e&&(0,Rt.speak)((0,g.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}function*On(e,t=!0){if(!e&&!e.length)return;const n=yield m.controls.select(Ot,"getBlocksByClientId",e),o=yield m.controls.select(Ot,"getBlockRootClientId",e[0]);if((0,u.some)(n,(e=>!e)))return;const l=n.map((e=>e.name));if((0,u.some)(l,(e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const i=yield m.controls.select(Ot,"getBlockIndex",(0,u.last)((0,u.castArray)(e)),o),s=n.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return yield cn(s,i+1,o,t),s.length>1&&t&&(yield Zt((0,u.first)(s).clientId,(0,u.last)(s).clientId)),s.map((e=>e.clientId))}function*Fn(e){if(!e)return;const t=yield m.controls.select(Ot,"getBlockRootClientId",e);if(yield m.controls.select(Ot,"getTemplateLock",t))return;const n=yield m.controls.select(Ot,"getBlockIndex",e,t);return yield In({},t,n)}function*zn(e){if(!e)return;const t=yield m.controls.select(Ot,"getBlockRootClientId",e);if(yield m.controls.select(Ot,"getTemplateLock",t))return;const n=yield m.controls.select(Ot,"getBlockIndex",e,t);return yield In({},t,n+1)}function Vn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}function*Hn(e){yield Vn(e,!0),yield{type:"SLEEP",duration:150},yield Vn(e,!1)}function Un(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const Gn={reducer:M,selectors:e,actions:t,controls:Dt},Wn=(0,m.createReduxStore)(Ot,{...Gn,persist:["preferences"]});(0,m.registerStore)(Ot,{...Gn,persist:["preferences"]});const $n={name:"",isSelected:!1},jn=(0,s.createContext)($n),{Provider:Kn}=jn;function qn(){return(0,s.useContext)(jn)}function Yn(){const{isSelected:e,clientId:t,name:n}=qn();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Wn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function Zn({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const l=function(e,t){const n=Yn(),{clientId:o}=qn(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(Wn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(e,o);return l?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(l,null,(o=>{const r=(0,u.isEmpty)(o)?null:o;return(0,s.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===e&&(0,s.createElement)(p.ToolbarGroup,{controls:t}),n)}))):null}function Xn({group:e="default",...t}){const n=(0,s.useContext)(p.__experimentalToolbarContext),o=f[e].Slot,r=(0,p.__experimentalUseSlot)(o.__unstableName);return Boolean(r.fills&&r.fills.length)?"default"===e?(0,s.createElement)(o,i({},t,{bubblesVirtually:!0,fillProps:n})):(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(o,i({},t,{bubblesVirtually:!0,fillProps:n}))):null}const Qn=Zn;Qn.Slot=Xn;const Jn=e=>(0,s.createElement)(Zn,i({group:"inline"},e));Jn.Slot=e=>(0,s.createElement)(Xn,i({group:"inline"},e));var eo=Qn,to=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),no=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),oo=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),ro=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),lo=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),io=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),so=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),ao=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),co=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),uo=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));function po(e,t=""){return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const mo={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0:e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>void 0===e.fontSizes?void 0:e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.customLineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.customPadding":e=>e.enableCustomSpacing};function fo(e){const{name:t}=qn();return(0,m.useSelect)((n=>{var o;const l=n(Wn).getSettings(),i=`__experimentalFeatures.${e}`,s=`__experimentalFeatures.blocks.${t}.${e}`,a=null!==(o=(0,u.get)(l,s))&&void 0!==o?o:(0,u.get)(l,i);var c,d;if(void 0!==a)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[e]?null!==(c=null!==(d=a.user)&&void 0!==d?d:a.theme)&&void 0!==c?c:a.core:a;const p=mo[e]?mo[e](l):void 0;return void 0!==p?p:"typography.dropCap"===e||void 0}),[t,e])}const go={left:so,center:ao,right:co,"space-between":uo};var ho=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:o,popoverProps:r,isToolbar:l}){const a=e=>{n(e===o?void 0:e)},c=o?go[o]:go.left,u=[{name:"left",icon:so,title:(0,g.__)("Justify items left"),isActive:"left"===o,onClick:()=>a("left")},{name:"center",icon:ao,title:(0,g.__)("Justify items center"),isActive:"center"===o,onClick:()=>a("center")},{name:"right",icon:co,title:(0,g.__)("Justify items right"),isActive:"right"===o,onClick:()=>a("right")},{name:"space-between",icon:uo,title:(0,g.__)("Space between items"),isActive:"space-between"===o,onClick:()=>a("space-between")}],d=l?p.ToolbarGroup:p.ToolbarDropdownMenu,m=l?{isCollapsed:t}:{};return(0,s.createElement)(d,i({icon:c,popoverProps:r,label:(0,g.__)("Change items justification"),controls:u.filter((t=>e.includes(t.name)))},m))};function bo(e){return(0,s.createElement)(ho,i({},e,{isToolbar:!1}))}function vo(e){return(0,s.createElement)(ho,i({},e,{isToolbar:!0}))}const ko={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"};var _o={name:"flex",label:(0,g.__)("Flex"),inspectorControls:function({layout:e={},onChange:t}){return(0,s.createElement)(Eo,{layout:e,onChange:t})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){return null!=n&&n.allowSwitching?null:(0,s.createElement)(eo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Eo,{layout:e,onChange:t,isToolbar:!0}))},save:function({selector:e,layout:t}){const n=null!==fo("spacing.blockGap"),o=ko[t.justifyContent]||"flex-start";return(0,s.createElement)("style",null,`\n\t\t\t\t${po(e)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tgap: ${n?"var( --wp--style--block-gap, 0.5em )":"0.5em"};\n\t\t\t\t\tflex-wrap: wrap;\n\t\t\t\t\talign-items: center;\n\t\t\t\t\tflex-direction: row;\n\t\t\t\t\tjustify-content: ${o};\n\t\t\t\t}\n\n\t\t\t\t${po(e,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation:()=>"horizontal",getAlignments:()=>[]};const yo=[{value:"left",icon:so,label:(0,g.__)("Justify items left")},{value:"center",icon:ao,label:(0,g.__)("Justify items center")},{value:"right",icon:co,label:(0,g.__)("Justify items right")},{value:"space-between",icon:uo,label:(0,g.__)("Space between items")}];function Eo({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:o="left"}=e,r=n=>{t({...e,justifyContent:n})};return n?(0,s.createElement)(bo,{allowedControls:["left","center","right","space-between"],value:o,onChange:r,popoverProps:{position:"bottom right",isAlternate:!0}}):(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,g.__)("Justification")),(0,s.createElement)("div",null,yo.map((({value:e,icon:t,label:n})=>(0,s.createElement)(p.Button,{key:e,label:n,icon:t,isPressed:o===e,onClick:()=>r(e)})))))}var Co=function({icon:e,size:t=24,...n}){return(0,s.cloneElement)(e,{width:t,height:t,...n})};const So=[{name:"default",label:(0,g.__)("Flow"),inspectorControls:function({layout:e,onChange:t}){const{wideSize:n,contentSize:o}=e,r=(0,p.__experimentalUseCustomUnits)({availableUnits:fo("spacing.units")||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:o||n||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:r}),(0,s.createElement)(Co,{icon:oo})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:n||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:r}),(0,s.createElement)(Co,{icon:lo}))),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,s.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!o&&!n,onClick:()=>t({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,g.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,g.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function({selector:e,layout:t={}}){const{contentSize:n,wideSize:o}=t,r=null!==fo("spacing.blockGap");let l=n||o?`\n\t\t\t\t\t${po(e,"> *")} {\n\t\t\t\t\t\tmax-width: ${null!=n?n:o};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\n\t\t\t\t\t${po(e,'> [data-align="wide"]')} {\n\t\t\t\t\t\tmax-width: ${null!=o?o:n};\n\t\t\t\t\t}\n\n\t\t\t\t\t${po(e,'> [data-align="full"]')} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return l+=`\n\t\t\t${po(e,'> [data-align="left"]')} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-right: 2em;\n\t\t\t}\n\n\t\t\t${po(e,'> [data-align="right"]')} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-left: 2em;\n\t\t\t}\n\n\t\t`,r&&(l+=`\n\t\t\t\t${po(e,"> *")} {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t}\n\t\t\t\t${po(e,"> * + *")} {\n\t\t\t\t\tmargin-top: var( --wp--style--block-gap );\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,l)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
|
4 |
// translators: %s: container size (i.e. 600px etc)
|
57 |
(0,g.__)("%1$s %2$s"),o,t);e.push({key:`${n}-${r}`,name:l,style:{fontStyle:n,fontWeight:r}})}))})),e})():n?(()=>{const e=[a];return Tf.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[a];return Nf.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})})),e})()),[e.options]),u=c.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||c[0];return i&&(0,s.createElement)(p.CustomSelectControl,{className:"components-font-appearance-control",label:n?o?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight"),describedBy:u?n?o?(0,g.sprintf)(// translators: %s: Currently selected font appearance.
|
58 |
(0,g.__)("Currently selected font appearance: %s"),u.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
|
59 |
(0,g.__)("Currently selected font style: %s"),u.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
|
60 |
+
(0,g.__)("Currently selected font weight: %s"),u.name):(0,g.__)("No selected font appearance"),options:c,value:u,onChange:({selectedItem:e})=>t(e.style)})}const Rf="typography.__experimentalFontStyle",Mf="typography.__experimentalFontWeight";function Lf(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Af(e),i=!Df(e);if(!l&&!i)return null;const a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,c=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,s.createElement)(Pf,{onChange:e=>{r({style:$o({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function Af({name:e}={}){const t=(0,r.hasBlockSupport)(e,Rf),n=fo("typography.customFontStyle");return!t||!n}function Df({name:e}={}){const t=(0,r.hasBlockSupport)(e,Mf),n=fo("typography.customFontWeight");return!t||!n}function Of(e){const t=Af(e),n=Df(e);return t&&n}function Ff({value:e="",onChange:t,fontFamilies:n,...o}){const r=fo("typography.fontFamilies");if(n||(n=r),(0,u.isEmpty)(n))return null;const l=[{value:"",label:(0,g.__)("Default")},...n.map((({fontFamily:e,name:t})=>({value:e,label:t||e})))];return(0,s.createElement)(p.SelectControl,i({label:(0,g.__)("Font family"),options:l,value:e,onChange:t,labelPosition:"top"},o))}const zf="typography.__experimentalFontFamily";function Vf(e,t,n){if(!(0,r.hasBlockSupport)(t,zf))return e;if((0,r.hasBlockSupport)(t,"__experimentalSkipTypographySerialization"))return e;if(null==n||!n.fontFamily)return e;const o=new(Wd())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}function Hf({name:e,setAttributes:t,attributes:{fontFamily:n}}){var o;const r=fo("typography.fontFamilies");if(Uf({name:e}))return null;const l=null===(o=(0,u.find)(r,(({slug:e})=>n===e)))||void 0===o?void 0:o.fontFamily;return(0,s.createElement)(Ff,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const n=(0,u.find)(r,(({fontFamily:t})=>t===e));t({fontFamily:null==n?void 0:n.slug})}})}function Uf({name:e}){const t=fo("typography.fontFamilies");return!t||0===t.length||!(0,r.hasBlockSupport)(e,zf)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,zf)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Vf),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,zf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Vf(o,e,n)},e}));const Gf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Wf(e,t){return(0,u.find)(e,{size:t})||{size:t}}function $f(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var jf=function(e){const t=fo("typography.fontSizes"),n=!fo("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Kf="typography.fontSize";function qf(e,t,n){if(!(0,r.hasBlockSupport)(t,Kf))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const o=new(Wd())(e.className);o.add($f(n.fontSize));const l=o.value;return e.className=l||void 0,e}function Yf(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=Zf(e),a=fo("typography.fontSizes");if(i)return null;const c=Gf(a,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),u=(null==c?void 0:c.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(jf,{onChange:e=>{const t=Wf(a,e).slug;l({style:$o({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:u})}function Zf({name:e}={}){const t=fo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,Kf)||!n}const Xf=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=fo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,Kf)||(0,r.hasBlockSupport)(i,"typography.__experimentalSkipSerialization")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=Gf(l,a,null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return(0,s.createElement)(e,p)}),"withFontSizeInlineStyles");function Qf({value:e,onChange:t}){const n=(0,p.__experimentalUseCustomUnits)({availableUnits:fo("spacing.units")||["px","em","rem"],defaultValues:{px:"2",em:".2",rem:".2"}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter-spacing"),value:e,__unstableInputWidth:"60px",units:n,onChange:t})}(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Kf)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",qf),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Kf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),qf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Xf);const Jf="typography.__experimentalLetterSpacing";function eg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return tg(e)?null:(0,s.createElement)(Qf,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:$o({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})}})}function tg({name:e}={}){const t=!(0,r.hasBlockSupport)(e,Jf),n=fo("typography.customLetterSpacing");return t||!n}const ng=[Bf,Kf,Rf,Mf,zf,mf,yf,Jf];function og(e){const t=function(e={}){const t=[Of(e),Zf(e),xf(e),Uf(e),gf(e),Cf(e),tg(e)];return t.filter(Boolean).length===t.length}(e),n=rg(e.name);return t||!n?null:(0,s.createElement)(Xo,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Typography")},(0,s.createElement)(Hf,e),(0,s.createElement)(Yf,e),(0,s.createElement)(Lf,e),(0,s.createElement)(If,e),(0,s.createElement)(Sf,e),(0,s.createElement)(eg,e)))}const rg=e=>ng.some((t=>(0,r.hasBlockSupport)(e,t)));function lg(e){const t=(0,r.getBlockSupport)(e,fg);return!!(!0===t||null!=t&&t.blockGap)}function ig({name:e}={}){const t=!fo("spacing.blockGap");return!lg(e)||t}function sg(e){var t;const{clientId:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:fo("spacing.units")||["%","px","em","rem","vw"]}),i=Ca(n);return ig(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:e}};r({style:$o(n)});const l=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;i.current&&l&&(null===(s=i.current.parentNode)||void 0===s||s.replaceChild(i.current,i.current))},units:l,value:null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap})),native:null})}function ag(e){const t=(0,r.getBlockSupport)(e,fg);return!!(!0===t||null!=t&&t.margin)}function cg({name:e}={}){const t=!fo("spacing.customMargin"),n=!_g(e,"margin");return!ag(e)||t||n}function ug(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:fo("spacing.units")||["%","px","em","rem","vw"]}),i=kg(n,"margin"),a=i&&i.some((e=>hg.includes(e)));return cg(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:$o(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:$o(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function dg(e){const t=(0,r.getBlockSupport)(e,fg);return!!(!0===t||null!=t&&t.padding)}function pg({name:e}={}){const t=!fo("spacing.customPadding"),n=!_g(e,"padding");return!dg(e)||t||n}function mg(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:fo("spacing.units")||["%","px","em","rem","vw"]}),i=kg(n,"padding"),a=i&&i.some((e=>hg.includes(e)));return pg(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:$o(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:$o(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const fg="spacing",gg=["top","right","bottom","left"],hg=["vertical","horizontal"];function bg(e){const t=ig(e),n=pg(e),o=cg(e),l=vg(e),i=(a=e.name,"web"===s.Platform.OS&&(lg(a)||dg(a)||ag(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[fg,"__experimentalDefaultControls"]),u=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,s.createElement)(Xo,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,g.__)("Padding"),onDeselect:()=>function({attributes:e={},setAttributes:t}){const{style:n}=e;t({style:$o({...n,spacing:{...null==n?void 0:n.spacing,padding:void 0}})})}(e),resetAllFilter:u("padding"),isShownByDefault:null==c?void 0:c.padding,panelId:e.clientId},(0,s.createElement)(mg,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,g.__)("Margin"),onDeselect:()=>function({attributes:e={},setAttributes:t}){const{style:n}=e;t({style:$o({...n,spacing:{...null==n?void 0:n.spacing,margin:void 0}})})}(e),resetAllFilter:u("margin"),isShownByDefault:null==c?void 0:c.margin,panelId:e.clientId},(0,s.createElement)(ug,e)),!t&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,g.__)("Block spacing"),onDeselect:()=>function({attributes:e={},setAttributes:t}){const{style:n}=e;t({style:{...n,spacing:{...null==n?void 0:n.spacing,blockGap:void 0}}})}(e),resetAllFilter:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(sg,e)))}const vg=(e={})=>{const t=ig(e),n=pg(e),o=cg(e);return t&&n&&o};function kg(e,t){const n=(0,r.getBlockSupport)(e,fg);if(n&&"boolean"!=typeof n[t])return n[t]}function _g(e,t){const n=kg(e,t);return!(n&&n.some((e=>gg.includes(e)))&&n.some((e=>hg.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}const yg=[...ng,Om,Jm,fg],Eg=e=>yg.some((t=>(0,r.hasBlockSupport)(e,t))),Cg="var:";function Sg(e){return(0,u.startsWith)(e,Cg)?`var(--wp--${e.slice(Cg.length).split("|").join("--")})`:e}function wg(e={}){const t={};return Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((n=>{const o=r.__EXPERIMENTAL_STYLE_PROPERTY[n].value,l=r.__EXPERIMENTAL_STYLE_PROPERTY[n].properties;if((0,u.has)(e,o)&&"elements"!==(0,u.first)(o)){const r=(0,u.get)(e,o);l&&!(0,u.isString)(r)?Object.entries(l).forEach((e=>{const[n,o]=e,l=(0,u.get)(r,[o]);l&&(t[n]=Sg(l))})):t[n]=Sg((0,u.get)(e,o))}})),t}const Bg={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[Jm],"typography.__experimentalSkipSerialization":["typography"],[`${fg}.__experimentalSkipSerialization`]:["spacing"]},Ig={...Bg,[`${fg}`]:["spacing.blockGap"]};function xg(e,t,n,o=Ig){if(!Eg(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{(0,r.getBlockSupport)(t,n)&&(l=(0,u.omit)(l,e))})),e.style={...wg(l),...e.style},e}const Tg=(0,d.createHigherOrderComponent)((e=>t=>{const n=Yn();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(sf,t),(0,s.createElement)(og,t),(0,s.createElement)(Fm,t),(0,s.createElement)(bg,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Ng=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=null===(n=t.attributes.style)||void 0===n?void 0:n.elements,a=`wp-elements-${(0,d.useInstanceId)(e)}`,p=function(e,t={}){return(0,u.map)(t,((t,n)=>{const o=wg(t);return(0,u.isEmpty)(o)?"":[`.${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(a,null===(o=t.attributes.style)||void 0===o?void 0:o.elements),m=(0,s.useContext)(Kp.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,l&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:l?c()(t.className,a):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Eg(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",xg),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Eg(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),xg(o,e,n,Bg)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Tg),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Ng);var Pg=function({colorPalette:e,duotonePalette:t,disableCustomColors:n,disableCustomDuotone:o,value:r,onChange:l}){return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,g.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==fa.DOWN||(n.preventDefault(),t())},label:(0,g.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:r})}),renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Duotone")},(0,s.createElement)(p.DuotonePicker,{colorPalette:e,duotonePalette:t,disableCustomColors:n,disableCustomDuotone:o,value:r,onChange:l}))})};const Rg=[];function Mg(e=[]){const t={r:[],g:[],b:[]};return e.forEach((e=>{const n=Nc(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255)})),t}function Lg({selector:e,id:t,values:n}){const o=`\n${e} {\n\tfilter: url( #${t} );\n}\n`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:t},(0,s.createElement)("feColorMatrix",{type:"matrix",values:".299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 0 0 0 1 0"}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:n.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:n.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:n.b.join(" ")}))))),(0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:o}}))}function Ag({attributes:e,setAttributes:t}){var n;const o=null==e?void 0:e.style,r=null==o||null===(n=o.color)||void 0===n?void 0:n.duotone,l=fo("color.duotone")||Rg,i=fo("color.palette")||Rg,a=!fo("color.custom"),c=!fo("color.customDuotone")||0===(null==i?void 0:i.length)&&a;return 0===(null==l?void 0:l.length)&&c?null:(0,s.createElement)(eo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Pg,{duotonePalette:l,colorPalette:i,disableCustomDuotone:c,disableCustomColors:a,value:r,onChange:e=>{const n={...o,color:{...null==o?void 0:o.color,duotone:e}};t({style:n})}}))}Rc([Mc]);const Dg=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Ag,t))}),"withDuotoneControls"),Og=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),f=c()(null==t?void 0:t.className,p),g=(0,s.useContext)(Kp.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,g&&(0,s.createPortal)((0,s.createElement)(Lg,{selector:m,id:p,values:Mg(u)}),g),(0,s.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",Dg),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Og);const Fg="__experimentalLayout";function zg({setAttributes:e,attributes:t,name:n}){const{layout:o}=t,l=fo("layout"),i=(0,m.useSelect)((e=>{const{getSettings:t}=e(Wn);return t().supportsLayout}),[]),a=(0,r.getBlockSupport)(n,Fg,{}),{allowSwitching:c,allowEditing:u=!0,allowInheriting:d=!0,default:f}=a;if(!u)return null;const h=o||f||{},{inherit:b=!1,type:v="default"}=h;if("default"===v&&!i)return null;const k=wo(v),_=t=>e({layout:t});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xo,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},d&&!!l&&(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!b,onChange:()=>e({layout:{inherit:!b}})}),!b&&c&&(0,s.createElement)(Vg,{type:v,onChange:t=>e({layout:{type:t}})}),!b&&k&&(0,s.createElement)(k.inspectorControls,{layout:h,onChange:_,layoutBlockSupport:a}))),!b&&k&&(0,s.createElement)(k.toolBarControls,{layout:h,onChange:_,layoutBlockSupport:a}))}function Vg({type:e,onChange:t}){return(0,s.createElement)(p.ButtonGroup,null,So.map((({name:n,label:o})=>(0,s.createElement)(p.Button,{key:n,isPressed:e===n,onClick:()=>t(n)},o))))}const Hg=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Fg)&&(0,s.createElement)(zg,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Ug=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,Fg),a=(0,d.useInstanceId)(e),u=fo("layout")||{},p=(0,s.useContext)(Kp.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,Fg)||{},g=null!=m&&m.inherit?u:m||f||{},h=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(To,{selector:`.wp-container-${a}`,layout:g}),p),(0,s.createElement)(e,i({},t,{className:h})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,Fg)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Ug),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",Hg);const Gg=[];function Wg({borderColor:e,style:t}){var n;const o=(null==t?void 0:t.border)||{},r=Qp("border-color",e);return{className:c()({[r]:!!r,"has-border-color":e||(null==t||null===(n=t.border)||void 0===n?void 0:n.color)})||void 0,style:wg({border:o})}}function $g(e){const t=fo("color.palette")||Gg,n=Wg(e);if(e.borderColor){const o=Zp(t,e.borderColor);n.style.borderColor=o.color}return n}const jg=[];function Kg(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Qp("background-color",s),m=Qp("color",a),f=em(u),g=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!g&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:wg({color:(null==d?void 0:d.color)||{}})}}function qg(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=fo("color.palette")||jg,l=fo("color.gradients")||jg,i=Kg(e);if(t){const e=Zp(r,t);i.style.backgroundColor=e.color}if(o&&(i.style.background=tm(l,o)),n){const e=Zp(r,n);i.style.color=e.color}return i}function Yg(e){const{style:t}=e;return{style:wg({spacing:(null==t?void 0:t.spacing)||{}})}}function Zg(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const Xg=[];function Qg(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Nc(t);return(0,u.maxBy)(e,(({color:e})=>n.contrast(e))).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=Xp(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps({attributes:e,colors:t},o){return(0,u.reduce)(n,((n,r,l)=>{const i=Zp(t,e[l],e[`custom${(0,u.upperFirst)(l)}`]),s=o[l];return(null==s?void 0:s.color)===i.color&&s?n[l]=s:n[l]={...i,class:Qp(r,i.slug)},n}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Jg(e){return(...t)=>{const n=(e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"))(e);return(0,d.createHigherOrderComponent)(Qg(t,n),"withCustomColors")}}function eh(...e){const t=(0,d.createHigherOrderComponent)((e=>t=>{const n=fo("color.palette")||Xg;return(0,s.createElement)(e,i({},t,{colors:n}))}),"withEditorColorPalette");return(0,d.createHigherOrderComponent)(Qg(e,t),"withColors")}const th=[];var nh=(...e)=>{const t=(0,u.reduce)(e,((e,t)=>(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=fo("typography.fontSizes")||th;return(0,s.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(t,((e,t,n)=>(e[`set${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps({attributes:e,fontSizes:n},o){const r=(t,n)=>!o[n]||(e[n]?e[n]!==o[n].slug:o[n].size!==e[t]);if(!(0,u.some)(t,r))return null;const l=(0,u.reduce)((0,u.pickBy)(t,r),((t,o,r)=>{const l=e[r],i=Gf(n,l,e[o]);return t[r]={...i,class:$f(l)},t}),{});return{...o,...l}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},oh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),rh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),lh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const ih=[{icon:oh,title:(0,g.__)("Align text left"),align:"left"},{icon:rh,title:(0,g.__)("Align text center"),align:"center"},{icon:lh,title:(0,g.__)("Align text right"),align:"right"}],sh={position:"bottom right",isAlternate:!0};var ah=function({value:e,onChange:t,alignmentControls:n=ih,label:o=(0,g.__)("Align"),describedBy:r=(0,g.__)("Change text alignment"),isCollapsed:l=!0,isToolbar:a}){function c(n){return()=>t(e===n?void 0:n)}const d=(0,u.find)(n,(t=>t.align===e)),m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,f=a?{isCollapsed:l}:{};return(0,s.createElement)(m,i({icon:d?d.icon:(0,g.isRTL)()?lh:oh,label:o,toggleProps:{describedBy:r,className:d?"is-pressed":void 0},popoverProps:sh,controls:n.map((t=>{const{align:n}=t,o=e===n;return{...t,isActive:o,role:l?"menuitemradio":void 0,onClick:c(n)}}))},f))};function ch(e){return(0,s.createElement)(ah,i({},e,{isToolbar:!1}))}function uh(e){return(0,s.createElement)(ah,i({},e,{isToolbar:!0}))}var dh={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(Wn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=ku(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?Ku(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]);return[(0,s.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(za,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}};const ph=[];function mh({completers:e=ph}){const{name:t}=qn();return(0,s.useMemo)((()=>{let n=e;return(t===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(t,"__experimentalSlashInserter",!1))&&(n=n.concat([dh])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(n===e&&(n=n.map(u.clone)),n=(0,l.applyFilters)("editor.Autocomplete.completers",n,t)),n}),[e,t])}var fh=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:mh(e)}))},gh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"})),hh=function({isActive:e,label:t=(0,g.__)("Toggle full height"),onToggle:n,isDisabled:o}){return(0,s.createElement)(p.ToolbarButton,{isActive:e,icon:gh,label:t,onClick:()=>n(!e),disabled:o})},bh=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",a=`${i}__popover`;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:a,isAlternate:!0},renderToggle:({onToggle:e,isOpen:n})=>(0,s.createElement)(p.ToolbarButton,{onClick:e,"aria-haspopup":"true","aria-expanded":n,onKeyDown:t=>{n||t.keyCode!==fa.DOWN||(t.preventDefault(),e())},label:t,icon:l,showTooltip:!0,disabled:r}),renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},vh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),kh=function({rootLabelText:e}){const{selectBlock:t,clearSelectedBlock:n}=(0,m.useDispatch)(Wn),{clientId:o,parents:r,hasSelection:l}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Wn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),i=e||(0,g.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,g.__)("Block breadcrumb")},(0,s.createElement)("li",{className:l?void 0:"block-editor-block-breadcrumb__current","aria-current":l?void 0:"true"},l&&(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:n},i),!l&&i,!!o&&(0,s.createElement)(Co,{icon:vh,className:"block-editor-block-breadcrumb__separator"})),r.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>t(e)},(0,s.createElement)(_d,{clientId:e})),(0,s.createElement)(Co,{icon:vh,className:"block-editor-block-breadcrumb__separator"})))),!!o&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(_d,{clientId:o})))};function _h({clientId:e,tagName:t="div",wrapperProps:n,className:o}){const[r,l]=(0,s.useState)(!0),[a,u]=(0,s.useState)(!1),{isParentSelected:d,hasChildSelected:p,isDraggingBlocks:f,isParentHighlighted:g}=(0,m.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l}=t(Wn);return{isParentSelected:n(e),hasChildSelected:o(e,!0),isDraggingBlocks:r(),isParentHighlighted:l(e)}}),[e]),h=c()("block-editor-block-content-overlay",null==n?void 0:n.className,o,{"overlay-active":r,"parent-highlighted":g,"is-dragging-blocks":f});return(0,s.useEffect)((()=>{d||p||r||l(!0),d&&!a&&r&&l(!1),p&&r&&l(!1)}),[d,p,r,a]),(0,s.createElement)(t,i({},n,{className:h,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onMouseUp:r?()=>l(!1):void 0}),null==n?void 0:n.children)}const yh=()=>(0,s.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),Eh=({style:e,className:t})=>(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e},(0,s.createElement)(yh,null))),Ch=({TextColor:e,BackgroundColor:t})=>({onToggle:n,isOpen:o})=>(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,g.__)("Open Colors Selector"),onClick:n,onKeyDown:e=>{o||e.keyCode!==fa.DOWN||(e.preventDefault(),n())},icon:(0,s.createElement)(t,null,(0,s.createElement)(e,null,(0,s.createElement)(Eh,null)))}));var Sh=({children:e,...t})=>(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Ch(t),renderContent:()=>e}),wh=(0,s.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(F.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const Bh=Js(p.__experimentalTreeGridRow);function Ih({isSelected:e,position:t,level:n,rowCount:o,children:r,className:l,path:a,...u}){const d=na({isSelected:e,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:a.join("_")});return(0,s.createElement)(Bh,i({ref:d,className:c()("block-editor-list-view-leaf",l),level:n,positionInSet:t,setSize:o},u),r)}const xh=(e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e;function Th({onClick:e}){return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(Co,{icon:vh}))}var Nh=(0,s.forwardRef)((function e({className:t,block:{clientId:n},isSelected:o,onClick:r,onToggleExpanded:l,position:i,siblingBlockCount:a,level:u,tabIndex:m,onFocus:f,onDragStart:h,onDragEnd:b,draggable:v},k){const _=kd(n),y=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,E=((e,t,n)=>(0,g.sprintf)(
|
61 |
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
62 |
+
(0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(i,a,u);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",t),onClick:r,"aria-describedby":y,ref:k,tabIndex:m,onFocus:f,onDragStart:h,onDragEnd:b,draggable:v},(0,s.createElement)(Th,{onClick:l}),(0,s.createElement)(za,{icon:null==_?void 0:_.icon,showColors:!0}),(0,s.createElement)(_d,{clientId:n}),(null==_?void 0:_.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},_.anchor),o&&(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("(selected block)"))),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:y},E))})),Ph=(0,s.forwardRef)((({onClick:e,onToggleExpanded:t,block:n,isSelected:o,position:r,siblingBlockCount:l,level:a,...u},d)=>{const{clientId:p}=n,{blockMovingClientId:f,selectedBlockInBlockEditor:g}=(0,m.useSelect)((e=>{const{getBlockRootClientId:t,hasBlockMovingClientId:n,getSelectedBlockClientId:o}=e(Wn);return{rootClientId:t(p)||"",blockMovingClientId:n(),selectedBlockInBlockEditor:o()}}),[p]),h=f&&g===p,b=c()("block-editor-list-view-block-contents",{"is-dropping-before":h});return(0,s.createElement)(yd,{clientIds:[n.clientId]},(({draggable:c,onDragStart:p,onDragEnd:m})=>(0,s.createElement)(Nh,i({ref:d,className:b,block:n,onClick:e,onToggleExpanded:t,isSelected:o,position:r,siblingBlockCount:l,level:a,draggable:c,onDragStart:p,onDragEnd:m},u))))}));const Rh=(0,s.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),Mh=()=>(0,s.useContext)(Rh);function Lh({block:e,isSelected:t,isDragged:n,isBranchSelected:o,isLastOfSelectedBranch:r,onClick:l,onToggleExpanded:i,position:a,level:u,rowCount:d,siblingBlockCount:f,showBlockMovers:g,path:h,isExpanded:b}){const v=(0,s.useRef)(null),[k,_]=(0,s.useState)(!1),{clientId:y}=e,{toggleBlockHighlight:E}=(0,m.useDispatch)(Wn),C=g&&f>0,S=c()("block-editor-list-view-block__mover-cell",{"is-visible":k||t}),{__experimentalFeatures:w,__experimentalPersistentListViewFeatures:B,isTreeGridMounted:I}=Mh(),x=c()("block-editor-list-view-block__menu-cell",{"is-visible":k||t});(0,s.useEffect)((()=>{B&&!I&&t&&v.current.focus()}),[]);const T=B?E:()=>{},N=()=>{_(!0),T(y,!0)},P=()=>{_(!1),T(y,!1)},R=c()({"is-selected":t,"is-branch-selected":B&&o,"is-last-of-selected-branch":B&&r,"is-dragging":n});return(0,s.createElement)(Ih,{className:R,onMouseEnter:N,onMouseLeave:P,onFocus:N,onBlur:P,level:u,position:a,rowCount:d,path:h,id:`list-view-block-${y}`,"data-block":y,isExpanded:b},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:C?void 0:2,ref:v},(({ref:n,tabIndex:o,onFocus:r})=>(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(Ph,{block:e,onClick:l,onToggleExpanded:i,isSelected:t,position:a,siblingBlockCount:f,level:u,ref:n,tabIndex:o,onFocus:r})))),C&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:S,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(({ref:e,tabIndex:t,onFocus:n})=>(0,s.createElement)(Rd,{orientation:"vertical",clientIds:[y],ref:e,tabIndex:t,onFocus:n}))),(0,s.createElement)(p.__experimentalTreeGridItem,null,(({ref:e,tabIndex:t,onFocus:n})=>(0,s.createElement)(Md,{orientation:"vertical",clientIds:[y],ref:e,tabIndex:t,onFocus:n}))))),w&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:x},(({ref:e,tabIndex:t,onFocus:n})=>(0,s.createElement)(yp,{clientIds:[y],icon:op,toggleProps:{ref:e,className:"block-editor-list-view-block__menu",tabIndex:t,onFocus:n},disableOpenOnArrowDown:!0,__experimentalSelectBlock:l}))))}function Ah({parentBlockClientId:e,position:t,level:n,rowCount:o,path:r}){const l=(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isAncestorBeingDragged:o}=t(Wn);return n(e)||o(e)}),[e]),i=`list-view-appender-row__description_${(0,d.useInstanceId)(Ah)}`,a=(0,g.sprintf)(
|
63 |
/* translators: 1: The numerical position of the block that will be inserted. 2: The level of nesting for the block that will be inserted. */
|
64 |
+
(0,g.__)("Add block at position %1$d, Level %2$d"),t,n);return(0,s.createElement)(Ih,{className:c()({"is-dragging":l}),level:n,position:t,rowCount:o,path:r},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-appender__cell",colSpan:"3"},(({ref:t,tabIndex:n,onFocus:o})=>(0,s.createElement)("div",{className:"block-editor-list-view-appender__container"},(0,s.createElement)(id,{rootClientId:e,__experimentalIsQuick:!0,"aria-describedby":i,toggleProps:{ref:t,tabIndex:n,onFocus:o}}),(0,s.createElement)("div",{className:"block-editor-list-view-appender__description",id:i},a)))))}function Dh(e){const{blocks:t,selectBlock:n,showAppender:o,showBlockMovers:r,showNestedBlocks:l,parentBlockClientId:i,level:a=1,terminatedLevels:c=[],path:d=[],isBranchSelected:p=!1,isLastOfBranch:f=!1}=e,{expandedState:g,expand:h,collapse:b,draggedClientIds:v,selectedClientIds:k}=Mh(),_=!i,y=(0,u.compact)(t),E=e=>o&&!_&&xh(e,k),C=E(i),S=y.length,w=C?S+1:S,B=w;return(0,s.createElement)(s.Fragment,null,(0,u.map)(y,((e,t)=>{var i;const{clientId:u,innerBlocks:_}=e,y=t+1,C=w===y?[...c,a]:c,B=[...d,y],I=l&&!!_&&!!_.length,x=E(u),T=I||x,N=xh(u,k),P=p||N&&T,R=t===S-1,M=N||f&&R,L=f&&!T&&R,A=T?null===(i=g[u])||void 0===i||i:void 0,D=!(null==v||!v.includes(u));return(0,s.createElement)(m.AsyncModeProvider,{key:u,value:!N},(0,s.createElement)(Lh,{block:e,onClick:e=>{e.stopPropagation(),n(u)},onToggleExpanded:e=>{e.stopPropagation(),!0===A?b(u):!1===A&&h(u)},isDragged:D,isSelected:N,isBranchSelected:P,isLastOfSelectedBranch:L,level:a,position:y,rowCount:w,siblingBlockCount:S,showBlockMovers:r,terminatedLevels:c,path:B,isExpanded:A}),T&&A&&!D&&(0,s.createElement)(Dh,{blocks:_,selectBlock:n,isBranchSelected:P,isLastOfBranch:M,showAppender:o,showBlockMovers:r,showNestedBlocks:l,parentBlockClientId:u,level:a+1,terminatedLevels:C,path:B}))})),C&&(0,s.createElement)(Ah,{parentBlockClientId:i,position:w,rowCount:B,level:a,terminatedLevels:c,path:[...d,B]}))}function Oh({listViewRef:e,blockDropTarget:t}){const{rootClientId:n,clientId:o,dropPosition:r}=t||{},[l,i]=(0,s.useMemo)((()=>e.current?[n?e.current.querySelector(`[data-block="${n}"]`):void 0,o?e.current.querySelector(`[data-block="${o}"]`):void 0]:[]),[n,o]),a=i||l,c=(0,s.useCallback)((()=>{if(!l)return 0;const e=a.getBoundingClientRect();return l.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[l,a]),u=(0,s.useMemo)((()=>{if(!a)return{};const e=c();return{width:a.offsetWidth-e}}),[c,a]),d=(0,s.useCallback)((()=>{if(!a)return{};const e=a.ownerDocument,t=a.getBoundingClientRect(),n=c(),o={left:t.left+n,right:t.right,width:0,height:t.height,ownerDocument:e};return"top"===r?{...o,top:t.top,bottom:t.top}:"bottom"===r||"inside"===r?{...o,top:t.bottom,bottom:t.bottom}:{}}),[a,r,c]);return a?(0,s.createElement)(p.Popover,{noArrow:!0,animate:!1,getAnchorRect:d,focusOnMount:!1,className:"block-editor-list-view-drop-indicator"},(0,s.createElement)("div",{style:u,className:"block-editor-list-view-drop-indicator__line"})):null}function Fh(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}Dh.defaultProps={selectBlock:()=>{}};const zh=["top","bottom"];const Vh=()=>{},Hh=(e,t)=>{switch(t.type){case"expand":return{...e,[t.clientId]:!0};case"collapse":return{...e,[t.clientId]:!1};default:return e}};var Uh=(0,s.forwardRef)((function({blocks:e,showOnlyCurrentHierarchy:t,onSelect:n=Vh,__experimentalFeatures:o,__experimentalPersistentListViewFeatures:r,...l},a){const{clientIdsTree:c,selectedClientIds:u,draggedClientIds:f}=function(e,t,n){const{selectedClientIds:o,draggedClientIds:r}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockClientIds:o,getDraggedBlockClientIds:r}=e(Wn);return n?{selectedClientIds:o(),draggedClientIds:r()}:{selectedClientIds:t(),draggedClientIds:r()}}),[n]);return{clientIdsTree:((e,t,n)=>(0,m.useSelect)((o=>{const{getBlockHierarchyRootClientId:r,__unstableGetClientIdsTree:l,__unstableGetClientIdWithClientIdsTree:i}=o(Wn);if(e)return e;const s=t&&!Array.isArray(t);if(!n||!s)return l();const a=i(r(t));return a&&(!xh(a.clientId,t)||a.innerBlocks&&0!==a.innerBlocks.length)?[a]:l()}),[e,t,n]))(e,o,t),selectedClientIds:o,draggedClientIds:r}}(e,t,r),{selectBlock:h}=(0,m.useDispatch)(Wn),b=(0,s.useCallback)((e=>{h(e),n(e)}),[h,n]),[v,k]=(0,s.useReducer)(Hh,{}),{ref:_,target:y}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(Wn),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=Dp(a,c),p=o(),f=(0,d.useThrottle)((0,s.useCallback)(((o,l)=>{const s={x:o.clientX,y:o.clientY},a=!(null==p||!p.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const s=i.element.getBoundingClientRect(),[a,c]=Op(t,s,zh),u=Fh(t,s);if(void 0===r||a<r||u){r=a;const t=e.indexOf(i),d=e[t-1];if("top"===c&&d&&d.rootClientId===i.rootClientId&&!d.isDraggedBlock?(o=d,n="bottom",l=d.element.getBoundingClientRect()):(o=i,n=c,l=s),u)break}}if(!o)return;const i="bottom"===n;if(i&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const s=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+s,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l,i),element:o,isDraggedBlock:!!a&&p.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!a||r(p,i),canInsertDraggedBlocksAsChild:!a||r(p,l)}})),s);c&&i(c)}),[p]),200);return{ref:(0,d.__experimentalUseDropZone)({onDrop:u,onDragOver(e){f(e,e.currentTarget)},onDragEnd(){f.cancel(),i(null)}}),target:l}}(),E=(0,s.useRef)(),C=(0,d.useMergeRefs)([E,_,a]),S=(0,s.useRef)(!1);(0,s.useEffect)((()=>{S.current=!0}),[]);const w=(0,s.useCallback)((e=>{e&&k({type:"expand",clientId:e})}),[k]),B=(0,s.useCallback)((e=>{e&&k({type:"collapse",clientId:e})}),[k]),I=(0,s.useMemo)((()=>({__experimentalFeatures:o,__experimentalPersistentListViewFeatures:r,isTreeGridMounted:S.current,draggedClientIds:f,selectedClientIds:u,expandedState:v,expand:w,collapse:B})),[o,r,S.current,f,u,v,w,B]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(Oh,{listViewRef:E,blockDropTarget:y}),(0,s.createElement)(p.__experimentalTreeGrid,{className:"block-editor-list-view-tree","aria-label":(0,g.__)("Block navigation structure"),ref:C,onCollapseRow:e=>{var t;B(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)},onExpandRow:e=>{var t;w(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}},(0,s.createElement)(Rh.Provider,{value:I},(0,s.createElement)(Dh,i({blocks:c,selectBlock:b},l)))))}));function Gh({isEnabled:e,onToggle:t,isOpen:n,innerRef:o,...r}){return(0,s.createElement)(p.Button,i({},r,{ref:o,icon:wh,"aria-expanded":n,"aria-haspopup":"true",onClick:e?t:void 0
|
65 |
+
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e}))}var Wh=(0,s.forwardRef)((function({isDisabled:e,__experimentalFeatures:t,...n},o){const r=(0,m.useSelect)((e=>!!e(Wn).getBlockCount()),[])&&!e;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(Gh,i({},n,{innerRef:o,isOpen:e,onToggle:t,isEnabled:r})),renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,g.__)("List view")),(0,s.createElement)(Uh,{showNestedBlocks:!0,showOnlyCurrentHierarchy:!0,__experimentalFeatures:t}))})})),$h=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"})),jh=function({icon:e=$h,label:t=(0,g.__)("Choose variation"),instructions:n=(0,g.__)("Select a variation to start with."),variations:o,onSelect:r,allowSkip:l}){const i=c()("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,s.createElement)(p.Placeholder,{icon:e,label:t,instructions:n,className:i},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,g.__)("Block variations")},o.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>r(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),l&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(p.Button,{variant:"link",onClick:()=>r()},(0,g.__)("Skip"))))},Kh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));const qh="carousel",Yh="grid",Zh=({onStartBlank:e,onBlockPatternSelect:t})=>(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(p.Button,{onClick:e},(0,g.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:t},(0,g.__)("Choose"))),Xh=({handlePrevious:e,handleNext:t,activeSlide:n,totalSlides:o})=>(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(p.Button,{icon:Bd,label:(0,g.__)("Previous pattern"),onClick:e,disabled:0===n}),(0,s.createElement)(p.Button,{icon:wd,label:(0,g.__)("Next pattern"),onClick:t,disabled:n===o-1}));var Qh=({viewMode:e,setViewMode:t,handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:l,onBlockPatternSelect:i,onStartBlank:a})=>{const c=e===qh,u=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:io,label:(0,g.__)("Carousel view"),onClick:()=>t(qh),isPressed:c}),(0,s.createElement)(p.Button,{icon:Kh,label:(0,g.__)("Grid view"),onClick:()=>t(Yh),isPressed:e===Yh}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},c&&(0,s.createElement)(Xh,{handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:l}),u,c&&(0,s.createElement)(Zh,{onBlockPatternSelect:i,onStartBlank:a}))};const Jh=({viewMode:e,activeSlide:t,patterns:n,onBlockPatternSelect:o})=>{const r=(0,p.__unstableUseCompositeState)(),l="block-editor-block-pattern-setup__container";if(e===qh){const e=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,s.createElement)("div",{className:l},(0,s.createElement)("ul",{className:"carousel-container"},n.map(((t,n)=>(0,s.createElement)(tb,{className:e.get(n)||"",key:t.name,pattern:t})))))}return(0,s.createElement)(p.__unstableComposite,i({},r,{role:"listbox",className:l,"aria-label":(0,g.__)("Patterns list")}),n.map((e=>(0,s.createElement)(eb,{key:e.name,pattern:e,onSelect:o,composite:r}))))};function eb({pattern:e,onSelect:t,composite:n}){const o="block-editor-block-pattern-setup-list",{blocks:r,title:l,description:a,viewportWidth:c=700}=e,u=(0,d.useInstanceId)(eb,`${o}__item-description`);return(0,s.createElement)("div",{className:`${o}__list-item`,"aria-label":e.title,"aria-describedby":e.description?u:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},n,{className:`${o}__item`,onClick:()=>t(r)}),(0,s.createElement)(iu,{blocks:r,viewportWidth:c}),(0,s.createElement)("div",{className:`${o}__item-title`},l)),!!a&&(0,s.createElement)(p.VisuallyHidden,{id:u},a))}function tb({className:e,pattern:t}){const{blocks:n,title:o,description:r}=t,l=(0,d.useInstanceId)(tb,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${e}`,"aria-label":o,"aria-describedby":r?l:void 0},(0,s.createElement)(iu,{blocks:n,__experimentalLive:!0}),!!r&&(0,s.createElement)(p.VisuallyHidden,{id:l},r))}var nb=({clientId:e,blockName:t,filterPatternsFn:n,startBlankComponent:o,onBlockPatternSelect:l})=>{const[i,a]=(0,s.useState)(qh),[c,u]=(0,s.useState)(0),[d,p]=(0,s.useState)(!1),{replaceBlock:f}=(0,m.useDispatch)(Wn),g=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Wn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(e,t,n);if(null==g||!g.length||d)return o;const h=l||(t=>{const n=t.map((e=>(0,r.cloneBlock)(e)));f(e,n)});return(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${i}`},(0,s.createElement)(Qh,{viewMode:i,setViewMode:a,activeSlide:c,totalSlides:g.length,handleNext:()=>{u((e=>e+1))},handlePrevious:()=>{u((e=>e-1))},onBlockPatternSelect:()=>{h(g[c].blocks)},onStartBlank:()=>{p(!0)}}),(0,s.createElement)(Jh,{viewMode:i,activeSlide:c,patterns:g,onBlockPatternSelect:h}))};const ob=(e,t)=>{if(!t||!e)return;const n=t.filter((({attributes:t})=>!(!t||!Object.keys(t).length)&&(0,u.isMatch)(e,t)));return 1===n.length?n[0]:void 0};var rb=function({blockClientId:e}){const[t,n]=(0,s.useState)(),{updateBlockAttributes:o}=(0,m.useDispatch)(Wn),{variations:l,blockAttributes:i}=(0,m.useSelect)((t=>{const{getBlockVariations:n}=t(r.store),{getBlockName:o,getBlockAttributes:l}=t(Wn),i=e&&o(e);return{variations:i&&n(i,"transform"),blockAttributes:l(e)}}),[e]);if((0,s.useEffect)((()=>{var e;n(null===(e=ob(i,l))||void 0===e?void 0:e.name)}),[i,l]),null==l||!l.length)return null;const a=l.map((({name:e,title:t,description:n})=>({value:e,label:t,info:n}))),c=t=>{o(e,{...l.find((({name:e})=>e===t)).attributes})},u="block-editor-block-variation-transforms";return(0,s.createElement)(p.DropdownMenu,{className:u,label:(0,g.__)("Transform to variation"),text:(0,g.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${u}__popover`},icon:xd,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${u}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:a,value:t,onSelect:c})))))};const lb=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),ib=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),sb={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,g._x)("Align top","Block vertical alignment setting")},center:{icon:ib,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:lb,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},ab=["top","center","bottom"],cb={isAlternate:!0};var ub=function({value:e,onChange:t,controls:n=ab,isCollapsed:o=!0,isToolbar:r}){const l=sb[e],a=sb.top,c=r?p.ToolbarGroup:p.ToolbarDropdownMenu,u=r?{isCollapsed:o}:{};return(0,s.createElement)(c,i({popoverProps:cb,icon:l?l.icon:a.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((n=>{return{...sb[n],isActive:e===n,role:o?"menuitemradio":void 0,onClick:(r=n,()=>t(e===r?void 0:r))};var r}))},u))};function db(e){return(0,s.createElement)(ub,i({},e,{isToolbar:!1}))}function pb(e){return(0,s.createElement)(ub,i({},e,{isToolbar:!0}))}var mb=(0,d.createHigherOrderComponent)((e=>t=>{const n=fo("color.palette"),o=!fo("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,u.isEmpty)(r)||!l;return(0,s.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:a}))}),"withColorContext"),fb=mb(p.ColorPalette);function gb({onChange:e,value:t,...n}){return(0,s.createElement)(dm,i({},n,{onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0}))}var hb=function(e,t){return(hb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},bb=function(){return(bb=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}).apply(this,arguments)};function vb(e,t,n,o){void 0===o&&(o=0);var r=Tb(e,t,o),l=r.width,i=r.height;return e>=t*n&&l>t*n?{width:t*n,height:t}:l>t*n?{width:e,height:e/n}:l>i*n?{width:i*n,height:i}:{width:l,height:l/n}}function kb(e,t,n,o,r){void 0===r&&(r=0);var l=Tb(t.width,t.height,r),i=l.width,s=l.height;return{x:_b(e.x,i,n.width,o),y:_b(e.y,s,n.height,o)}}function _b(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function yb(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Eb(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Cb(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?Sb:wb,a={x:s(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:s(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:s(100,n.width/t.width*100/r),height:s(100,n.height/t.height*100/r)},c=Math.round(s(t.naturalWidth,a.width*t.naturalWidth/100)),u=Math.round(s(t.naturalHeight,a.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:a,croppedAreaPixels:bb(bb({},d),{x:Math.round(s(t.naturalWidth-d.width,a.x*t.naturalWidth/100)),y:Math.round(s(t.naturalHeight-d.height,a.y*t.naturalHeight/100))})}}function Sb(e,t){return Math.min(e,Math.max(0,t))}function wb(e,t){return t}function Bb(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function Ib(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function xb(e,t,n,o,r){var l=Math.cos,i=Math.sin,s=r*Math.PI/180;return[(e-n)*l(s)-(t-o)*i(s)+n,(e-n)*i(s)+(t-o)*l(s)+o]}function Tb(e,t,n){var o=e/2,r=t/2,l=[xb(0,0,o,r,n),xb(e,0,o,r,n),xb(e,t,o,r,n),xb(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),s=Math.max.apply(Math,l.map((function(e){return e[0]}))),a=Math.min.apply(Math,l.map((function(e){return e[1]})));return{width:s-i,height:Math.max.apply(Math,l.map((function(e){return e[1]})))-a}}function Nb(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var Pb=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=Bb(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l=n.imageRef||n.videoRef;if(l){n.mediaSize={width:l.offsetWidth,height:l.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var i=n.props.cropSize?n.props.cropSize:vb(l.offsetWidth,l.offsetHeight,n.props.aspect,n.props.rotation);n.setState({cropSize:i},n.recomputeCropPosition)}n.containerRef&&(n.containerRect=n.containerRef.getBoundingClientRect())},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){e.preventDefault(),document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=bb({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?kb(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=n.props.zoom-e.deltaY*n.props.zoomSpeed/200;n.setNewZoom(r,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},s=n.props.restrictPosition?kb(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(l)}},n.emitCropData=function(){if(n.state.cropSize){var e=Cb(n.props.restrictPosition?kb(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition),t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?kb(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function __(){this.constructor=e}hb(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&this.styleRef.remove(),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():e.cropSize!==this.props.cropSize&&this.computeSizes(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=yb(n,o),this.lastPinchRotation=Eb(n,o),this.onDragStart(Ib(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=Ib(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=yb(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=Eb(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.crop,i=l.x,s=l.y,a=t.rotation,c=t.zoom,u=t.cropShape,d=t.showGrid,p=t.style,m=p.containerStyle,f=p.cropAreaStyle,g=p.mediaStyle,h=t.classes,b=h.containerClassName,v=h.cropAreaClassName,k=h.mediaClassName;return Vr().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:Nb("reactEasyCrop_Container",b)},n?Vr().createElement("img",bb({alt:"",className:Nb("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:bb(bb({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&Vr().createElement("video",bb({autoPlay:!0,loop:!0,muted:!0,className:Nb("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:bb(bb({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&Vr().createElement("div",{style:bb(bb({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Nb("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",d&&"reactEasyCrop_CropAreaGrid",v)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(Vr().Component);const Rb={position:"bottom right",isAlternate:!0};var Mb=window.wp.apiFetch,Lb=n.n(Mb);const Ab=(0,s.createContext)({}),Db=()=>(0,s.useContext)(Ab);function Ob({id:e,url:t,naturalWidth:n,naturalHeight:o,isEditing:r,onFinishEditing:i,onSaveImage:a,children:c}){const u=function(e,t){const n=function({url:e,naturalWidth:t,naturalHeight:n}){const[o,r]=(0,s.useState)(),[i,a]=(0,s.useState)(),[c,u]=(0,s.useState)({x:0,y:0}),[d,p]=(0,s.useState)(),[m,f]=(0,s.useState)(),[g,h]=(0,s.useState)(),[b,v]=(0,s.useState)(),k=(0,s.useCallback)((()=>{u({x:0,y:0}),p(100),f(0),h(t/n),v(t/n)}),[t,n,u,p,f,h,v]),_=(0,s.useCallback)((()=>{const o=(m+90)%360;let i=t/n;if(m%180==90&&(i=n/t),0===o)return r(),f(o),h(1/g),void u({x:-c.y*i,y:c.x*i});const s=new window.Image;s.src=e,s.onload=function(e){const t=document.createElement("canvas");let n=0,l=0;o%180?(t.width=e.target.height,t.height=e.target.width):(t.width=e.target.width,t.height=e.target.height),90!==o&&180!==o||(n=t.width),270!==o&&180!==o||(l=t.height);const s=t.getContext("2d");s.translate(n,l),s.rotate(o*Math.PI/180),s.drawImage(e.target,0,0),t.toBlob((e=>{r(URL.createObjectURL(e)),f(o),h(1/g),u({x:-c.y*i,y:c.x*i})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof a&&(s.crossOrigin=a)}),[m,t,n,r,f,h,u]);return(0,s.useMemo)((()=>({editedUrl:o,setEditedUrl:r,crop:i,setCrop:a,position:c,setPosition:u,zoom:d,setZoom:p,rotation:m,setRotation:f,rotateClockwise:_,aspect:g,setAspect:h,defaultAspect:b,initializeTransformValues:k})),[o,r,i,a,c,u,d,p,m,f,_,g,h,b,k])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:t,naturalWidth:n,naturalHeight:o},r),d=function({crop:e,rotation:t,height:n,width:o,aspect:r,url:l,id:i,onSaveImage:a,onFinishEditing:c}){const{createErrorNotice:u}=(0,m.useDispatch)(Su.store),[d,p]=(0,s.useState)(!1),f=(0,s.useCallback)((()=>{p(!1),c()}),[p,c]),h=(0,s.useCallback)((()=>{p(!0);let s={};(e.width<99.9||e.height<99.9)&&(s=e),t>0&&(s.rotation=t),s.src=l,Lb()({path:`/wp/v2/media/${i}/edit`,method:"POST",data:s}).then((e=>{a({id:e.id,url:e.source_url,height:n&&o?o/r:void 0})})).catch((e=>{u((0,g.sprintf)(
|
66 |
/* translators: 1. Error message */
|
67 |
+
(0,g.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{p(!1),c()}))}),[p,e,t,n,o,r,l,a,u,p,c]);return(0,s.useMemo)((()=>({isInProgress:d,apply:h,cancel:f})),[d,h,f])}({id:e,url:t,onSaveImage:a,onFinishEditing:i,...u}),p=(0,s.useMemo)((()=>({...u,...d})),[u,d]);return(0,s.createElement)(Ab.Provider,{value:p},c)}function Fb({url:e,width:t,height:n,clientWidth:o,naturalHeight:r,naturalWidth:l}){const{isInProgress:i,editedUrl:a,position:u,zoom:d,aspect:m,setPosition:f,setCrop:g,setZoom:h,rotation:b}=Db();let v=n||o*r/l;return b%180==90&&(v=o*l/r),(0,s.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":i}),style:{width:t||o,height:v}},(0,s.createElement)(Pb,{image:a||e,disabled:i,minZoom:1,maxZoom:3,crop:u,zoom:d/100,aspect:m,onCropChange:f,onCropComplete:e=>{g(e)},onZoomChange:e=>{h(100*e)}}),i&&(0,s.createElement)(p.Spinner,null))}var zb=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function Vb(){const{isInProgress:e,zoom:t,setZoom:n}=Db();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:Rb,renderToggle:({isOpen:t,onToggle:n})=>(0,s.createElement)(p.ToolbarButton,{icon:zb,label:(0,g.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,g.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var Hb=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Ub=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function Gb({aspectRatios:e,isDisabled:t,label:n,onClick:o,value:r}){return(0,s.createElement)(p.MenuGroup,{label:n},e.map((({title:e,aspect:n})=>(0,s.createElement)(p.MenuItem,{key:n,disabled:t,onClick:()=>{o(n)},role:"menuitemradio",isSelected:n===r,icon:n===r?Hb:void 0},e))))}function Wb({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:o,defaultAspect:r}=Db();return(0,s.createElement)(p.DropdownMenu,{icon:Ub,label:(0,g.__)("Aspect Ratio"),popoverProps:Rb,toggleProps:e,className:"wp-block-image__aspect-ratio"},(({onClose:e})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Gb,{isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,g.__)("Original"),aspect:r},{title:(0,g.__)("Square"),aspect:1}]}),(0,s.createElement)(Gb,{label:(0,g.__)("Landscape"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,g.__)("16:10"),aspect:1.6},{title:(0,g.__)("16:9"),aspect:16/9},{title:(0,g.__)("4:3"),aspect:4/3},{title:(0,g.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(Gb,{label:(0,g.__)("Portrait"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,g.__)("10:16"),aspect:.625},{title:(0,g.__)("9:16"),aspect:9/16},{title:(0,g.__)("3:4"),aspect:3/4},{title:(0,g.__)("2:3"),aspect:2/3}]}))))}var $b=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function jb(){const{isInProgress:e,rotateClockwise:t}=Db();return(0,s.createElement)(p.ToolbarButton,{icon:$b,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function Kb(){const{isInProgress:e,apply:t,cancel:n}=Db();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,g.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,g.__)("Cancel")))}function qb({url:e,width:t,height:n,clientWidth:o,naturalHeight:r,naturalWidth:l}){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Fb,{url:e,width:t,height:n,clientWidth:o,naturalHeight:r,naturalWidth:l}),(0,s.createElement)(eo,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Vb,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Wb,{toggleProps:e}))),(0,s.createElement)(jb,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Kb,null))))}const Yb=[25,50,75,100];function Zb({imageWidth:e,imageHeight:t,imageSizeOptions:n=[],isResizable:o=!0,slug:r,width:l,height:i,onChange:a,onChangeImage:c=u.noop}){const{currentHeight:d,currentWidth:m,updateDimension:f,updateDimensions:h}=function(e,t,n,o,r){var l,i;const[a,c]=(0,s.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,s.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,s.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,s.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(i,l,t,e,a);return(0,s.createElement)(s.Fragment,null,!(0,u.isEmpty)(n)&&(0,s.createElement)(p.SelectControl,{label:(0,g.__)("Image size"),value:r,options:n,onChange:c}),o&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)("p",{className:"block-editor-image-size-control__row"},(0,g.__)("Image dimensions")),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,g.__)("Width"),value:m,min:1,onChange:e=>f("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,g.__)("Height"),value:d,min:1,onChange:e=>f("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,g.__)("Image size presets")},Yb.map((n=>{const o=Math.round(e*(n/100)),r=Math.round(t*(n/100)),l=m===o&&d===r;return(0,s.createElement)(p.Button,{key:n,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>h(r,o)},n,"%")}))),(0,s.createElement)(p.Button,{isSmall:!0,onClick:()=>h()},(0,g.__)("Reset")))))}var Xb=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(F.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),Qb=({value:e,onChange:t=u.noop,settings:n})=>{if(!n||!n.length)return null;const o=n=>o=>{t({...e,[n.id]:o})},r=n.map((t=>(0,s.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:t.id,label:t.title,onChange:o(t),checked:!!e&&!!e[t.id]})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Currently selected link settings")),r)};class Jb extends s.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,s.createRef)(),this.inputRef=(0,s.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,va()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value!==o&&this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(e=""){var t;const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(t=e)&&void 0!==t&&t.length);if(e=e.trim(),!r&&(e.length<2||!o&&(0,Pu.isURL)(e)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(e,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,g.sprintf)(
|
68 |
/* translators: %s: number of results. */
|
69 |
+
(0,g._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,g.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)})).catch((()=>{this.suggestionsRequest===l&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)})),this.suggestionsRequest=l}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case fa.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case fa.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case fa.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case fa.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case fa.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case fa.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,g.__)("Link selected.")));break;case fa.ENTER:null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:n,__experimentalShowInitialSuggestions:o=!1},{showSuggestions:r}){let l=r;const i=e&&e.length;return o||i||(l=!1),!0===n&&(l=!1),{showSuggestions:l,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,s.createElement)(s.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{label:e,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,g.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:i=""}=this.props,{loading:a,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:m,suggestionOptionIdPrefix:f}=this.state,h={id:`url-input-control-${o}`,label:e,className:c()("block-editor-url-input",t,{"is-full-width":n})},b={value:i,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:r,onKeyDown:this.onKeyDown,role:"combobox","aria-label":(0,g.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(h,b,a):(0,s.createElement)(p.BaseControl,h,(0,s.createElement)("input",b),a&&(0,s.createElement)(p.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:l,selectedSuggestion:a,suggestionsListboxId:d,suggestionOptionIdPrefix:m,loading:f}=this.state,g={id:d,ref:this.autocompleteRef,role:"listbox"},h=(e,t)=>({role:"option",tabIndex:"-1",id:`${m}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===a});return(0,u.isFunction)(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:a,suggestionsListProps:g,buildSuggestionItemProps:h,isLoading:f,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!(0,u.isFunction)(t)&&r&&l.length?(0,s.createElement)(p.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},(0,s.createElement)("div",i({},g,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,s.createElement)(p.Button,i({},h(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===a}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var ev=(0,d.compose)(d.withSafeTimeout,p.withSpokenMessages,d.withInstanceId,(0,m.withSelect)(((e,t)=>{if((0,u.isFunction)(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(Wn);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(Jb),tv=({searchTerm:e,onClick:t,itemProps:n,isSelected:o,buttonText:r})=>{if(!e)return null;let l;return l=r?(0,u.isFunction)(r)?r(e):r:(0,s.createInterpolateElement)((0,g.sprintf)(
|
70 |
/* translators: %s: search term. */
|
71 |
+
(0,g.__)("Create: <mark>%s</mark>"),e),{mark:(0,s.createElement)("mark",null)}),(0,s.createElement)(p.Button,i({},n,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":o}),onClick:t}),(0,s.createElement)(Co,{className:"block-editor-link-control__search-item-icon",icon:Aa}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},l)))},nv=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"})),ov=({itemProps:e,suggestion:t,isSelected:n=!1,onClick:o,isURL:r=!1,searchTerm:l="",shouldShowType:a=!1})=>(0,s.createElement)(p.Button,i({},e,{onClick:o,className:c()("block-editor-link-control__search-item",{"is-selected":n,"is-url":r,"is-entity":!r})}),r&&(0,s.createElement)(Co,{className:"block-editor-link-control__search-item-icon",icon:nv}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,s.createElement)(p.TextHighlight,{text:t.title,highlight:l})),(0,s.createElement)("span",{"aria-hidden":!r,className:"block-editor-link-control__search-item-info"},!r&&((0,Pu.filterURLForDisplay)((0,Pu.safeDecodeURI)(t.url))||""),r&&(0,g.__)("Press ENTER to add this link"))),a&&t.type&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-type"},"post_tag"===t.type?"tag":t.type));const rv="__CREATE__",lv=[{id:"opensInNewTab",title:(0,g.__)("Open in new tab")}];function iv({instanceId:e,withCreateSuggestion:t,currentInputValue:n,handleSuggestionClick:o,suggestionsListProps:r,buildSuggestionItemProps:l,suggestions:a,selectedSuggestion:u,isLoading:d,isInitialSuggestions:m,createSuggestionButtonText:f,suggestionsQuery:h}){const b=c()("block-editor-link-control__search-results",{"is-loading":d}),v=["url","mailto","tel","internal"],k=1===a.length&&v.includes(a[0].type.toLowerCase()),_=t&&!k&&!m,y=!(null!=h&&h.type),E=`block-editor-link-control-search-results-label-${e}`,C=m?(0,g.__)("Recently updated"):(0,g.sprintf)(
|
72 |
/* translators: %s: search term. */
|
73 |
+
(0,g.__)('Search results for "%s"'),n),S=(0,s.createElement)(m?s.Fragment:p.VisuallyHidden,{},(0,s.createElement)("span",{className:"block-editor-link-control__search-results-label",id:E},C));return(0,s.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},S,(0,s.createElement)("div",i({},r,{className:b,"aria-labelledby":E}),a.map(((e,t)=>_&&rv===e.type?(0,s.createElement)(tv,{searchTerm:n,buttonText:f,onClick:()=>o(e),key:e.type,itemProps:l(e,t),isSelected:t===u}):rv===e.type?null:(0,s.createElement)(ov,{key:`${e.id}-${e.type}`,itemProps:l(e,t),suggestion:e,index:t,onClick:()=>{o(e)},isSelected:t===u,isURL:v.includes(e.type.toLowerCase()),searchTerm:n,shouldShowType:y})))))}function sv(e){const t=(0,u.startsWith)(e,"#");return(0,Pu.isURL)(e)||e&&e.includes("www.")||t}const av=()=>Promise.resolve([]),cv=e=>{let t="URL";const n=(0,Pu.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),(0,u.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,Pu.prependHTTP)(e):e,type:t}])};const uv=()=>Promise.resolve([]),dv=(0,s.forwardRef)((({value:e,children:t,currentLink:n={},className:o=null,placeholder:r=null,withCreateSuggestion:l=!1,onCreateSuggestion:i=u.noop,onChange:a=u.noop,onSelect:c=u.noop,showSuggestions:p=!0,renderSuggestions:f=(e=>(0,s.createElement)(iv,e)),fetchSuggestions:h=null,allowDirectEntry:b=!0,showInitialSuggestions:v=!1,suggestionsQuery:k={},withURLSuggestion:_=!0,createSuggestionButtonText:y},E)=>{const C=function(e,t,n,o){const{fetchSearchSuggestions:r}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Wn);return{fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),l=t?cv:av;return(0,s.useCallback)(((t,{isInitialSuggestions:i})=>sv(t)?l(t,{isInitialSuggestions:i}):(async(e,t,n,o,r,l)=>{const{isInitialSuggestions:i}=t;let s=await Promise.all([n(e,t),o(e)]);return s=e.includes(" ")||!l||i?s[0]:s[0].concat(s[1]),i||sv(e)||!r?s:s.concat({title:e,url:e,type:rv})})(t,{...e,isInitialSuggestions:i},r,l,n,o)),[l,r,n])}(k,b,l,_),S=p?h||C:uv,w=(0,d.useInstanceId)(dv),[B,I]=(0,s.useState)(),x=async e=>{let t=e;if(rv!==e.type)(b||t&&Object.keys(t).length>=1)&&c({...(0,u.omit)(n,"id","url"),...t},t);else try{var o;t=await i(e.title),null!==(o=t)&&void 0!==o&&o.url&&c(t)}catch(e){}};return(0,s.createElement)("div",null,(0,s.createElement)(ev,{className:o,value:e,onChange:(e,t)=>{a(e),I(t)},placeholder:null!=r?r:(0,g.__)("Search or type url"),__experimentalRenderSuggestions:p?t=>f({...t,instanceId:w,withCreateSuggestion:l,currentInputValue:e,createSuggestionButtonText:y,suggestionsQuery:k,handleSuggestionClick:e=>{t.handleSuggestionClick&&t.handleSuggestionClick(e),x(e)}}):null,__experimentalFetchLinkSuggestions:S,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:v,onSubmit:(t,n)=>{var o;const r=t||B;r||null!=e&&null!==(o=e.trim())&&void 0!==o&&o.length?x(r||{url:e}):n.preventDefault()},ref:E}),t)}));var pv=dv,mv=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));const{Slot:fv,Fill:gv}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function hv(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function bv({value:e,onEditClick:t,hasRichPreviews:n=!1}){const o=n?null==e?void 0:e.url:null,{richData:r,isFetching:l}=function(e){const[t,n]=(0,s.useReducer)(hv,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Wn);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,s.useEffect)((()=>{if(null!=e&&e.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t}(o),i=r&&Object.keys(r).length,a=e&&(0,Pu.filterURLForDisplay)((0,Pu.safeDecodeURI)(e.url),16)||"",u=!e.url.length;let d;return d=null!=r&&r.icon?(0,s.createElement)("img",{src:null==r?void 0:r.icon,alt:""}):u?(0,s.createElement)(Co,{icon:mv,size:32}):(0,s.createElement)(Co,{icon:nv}),(0,s.createElement)("div",{"aria-label":(0,g.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":i,"is-fetching":!!l,"is-preview":!0,"is-error":u})},(0,s.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:c()("block-editor-link-control__search-item-icon",{"is-image":null==r?void 0:r.icon})},d),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-details"},u?(0,s.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},"Link is empty"):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ExternalLink,{className:"block-editor-link-control__search-item-title",href:e.url},(null==r?void 0:r.title)||(null==e?void 0:e.title)||a),(null==e?void 0:e.url)&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},a)))),(0,s.createElement)(p.Button,{variant:"secondary",onClick:()=>t(),className:"block-editor-link-control__search-item-action"},(0,g.__)("Edit")),(0,s.createElement)(fv,{fillProps:e})),(i&&((null==r?void 0:r.image)||(null==r?void 0:r.description))||l)&&(0,s.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==r?void 0:r.image)||l)&&(0,s.createElement)("div",{"aria-hidden":!(null!=r&&r.image),className:c()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=r&&r.image)})},(null==r?void 0:r.image)&&(0,s.createElement)("img",{src:null==r?void 0:r.image,alt:""})),((null==r?void 0:r.description)||l)&&(0,s.createElement)("div",{"aria-hidden":!(null!=r&&r.description),className:c()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=r&&r.description)})},(null==r?void 0:r.description)&&(0,s.createElement)(p.__experimentalText,{truncate:!0,numberOfLines:"2"},r.description))))}function vv({searchInputPlaceholder:e,value:t,settings:n=lv,onChange:o=u.noop,onRemove:r,noDirectEntry:l=!1,showSuggestions:i=!0,showInitialSuggestions:a,forceIsEditingLink:c,createSuggestion:d,withCreateSuggestion:m,inputValue:f="",suggestionsQuery:h={},noURLSuggestion:b=!1,createSuggestionButtonText:v,hasRichPreviews:k=!1}){var _;void 0===m&&d&&(m=!0);const y=(0,s.useRef)(!0),E=(0,s.useRef)(),[C,S]=(0,s.useState)(t&&t.url||""),w=f||C,[B,I]=(0,s.useState)(void 0!==c?c:!t||!t.url),x=(0,s.useRef)(!1),T=!(null!=w&&null!==(_=w.trim())&&void 0!==_&&_.length);function N(){var e;x.current=!(null===(e=E.current)||void 0===e||!e.contains(E.current.ownerDocument.activeElement)),I(!1)}(0,s.useEffect)((()=>{void 0!==c&&c!==B&&I(c)}),[c]),(0,s.useEffect)((()=>{y.current?y.current=!1:((tr.focus.focusable.find(E.current)[0]||E.current).focus(),x.current=!1)}),[B]);const{createPage:P,isCreatingPage:R,errorMessage:M}=function(e){const t=(0,s.useRef)(),[n,o]=(0,s.useState)(!1),[r,l]=(0,s.useState)(null);return(0,s.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=(e=>{let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCanceled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,g.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(d),L=()=>{w!==(null==t?void 0:t.url)&&o({url:w}),N()},A=r&&t&&!B&&!R,D=!(null==n||!n.length);return(0,s.createElement)("div",{tabIndex:-1,ref:E,className:"block-editor-link-control"},R&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(p.Spinner,null)," ",(0,g.__)("Creating"),"…"),(B||!t)&&!R&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-link-control__search-input-wrapper"},(0,s.createElement)(pv,{currentLink:t,className:"block-editor-link-control__search-input",placeholder:e,value:w,withCreateSuggestion:m,onCreateSuggestion:P,onChange:S,onSelect:e=>{o(e),N()},showInitialSuggestions:a,allowDirectEntry:!l,showSuggestions:i,suggestionsQuery:h,withURLSuggestion:!b,createSuggestionButtonText:v},(0,s.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,s.createElement)(p.Button,{onClick:()=>L(),onKeyDown:e=>{const{keyCode:t}=e;t!==fa.ENTER||T||(e.preventDefault(),L())},label:(0,g.__)("Submit"),icon:Xb,className:"block-editor-link-control__search-submit",disabled:T})))),M&&(0,s.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},M)),t&&!B&&!R&&(0,s.createElement)(bv,{key:null==t?void 0:t.url,value:t,onEditClick:()=>I(!0),hasRichPreviews:k}),(D||A)&&(0,s.createElement)("div",{className:"block-editor-link-control__tools"},(0,s.createElement)(Qb,{value:t,settings:n,onChange:o}),A&&(0,s.createElement)(p.Button,{className:"block-editor-link-control__unlink",isDestructive:!0,variant:"link",onClick:r},(0,g.__)("Unlink"))))}vv.ViewerFill=gv;var kv=vv,_v=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})),yv=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})),Ev=(0,p.withFilters)("editor.MediaUpload")((()=>null)),Cv=function({fallback:e=null,children:t}){return(0,m.useSelect)((e=>{const{getSettings:t}=e(Wn);return!!t().mediaUpload}),[])?t:e},Sv=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Su.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,allowedTypes:n,accept:o,onSelect:r,onSelectURL:l,onFilesUpload:i=u.noop,name:a=(0,g.__)("Replace"),createNotice:c,removeNotice:d,children:f})=>{const[h,b]=(0,s.useState)(e),v=(0,m.useSelect)((e=>e(Wn).getSettings().mediaUpload),[]),k=(0,s.createRef)(),_=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),y=e=>{const t=document.createElement("div");t.innerHTML=(0,s.renderToString)(e);const n=t.textContent||t.innerText||"";setTimeout((()=>{c("error",n,{speak:!0,id:_,isDismissible:!0})}),1e3)},E=e=>{b(e.url),r(e),(0,Rt.speak)((0,g.__)("The media file has been replaced")),d(_)},C=e=>{e.keyCode===fa.DOWN&&(e.preventDefault(),e.target.click())};return(0,s.createElement)(p.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(p.ToolbarButton,{ref:k,"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:C},a),renderContent:({onClose:e})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,s.createElement)(Ev,{value:t,onSelect:e=>E(e),allowedTypes:n,render:({open:e})=>(0,s.createElement)(p.MenuItem,{icon:_v,onClick:e},(0,g.__)("Open Media Library"))}),(0,s.createElement)(Cv,null,(0,s.createElement)(p.FormFileUpload,{onChange:e=>{(e=>{const t=e.target.files;i(t),v({allowedTypes:n,filesList:t,onFileChange:([e])=>{E(e)},onError:y})})(e)},accept:o,render:({openFileDialog:e})=>(0,s.createElement)(p.MenuItem,{icon:yv,onClick:()=>{e()}},(0,g.__)("Upload"))})),f),l&&(0,s.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,s.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,g.__)("Current media URL:")),(0,s.createElement)(kv,{value:{url:h},settings:[],showSuggestions:!1,onChange:({url:e})=>{b(e),l(e),k.current.focus()}})))})})),wv=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));function Bv({url:e,urlLabel:t,className:n}){const o=c()(n,"block-editor-url-popover__link-viewer-url");return e?(0,s.createElement)(p.ExternalLink,{className:o,href:e},t||(0,Pu.filterURLForDisplay)((0,Pu.safeDecodeURI)(e))):(0,s.createElement)("span",{className:o})}function Iv({additionalControls:e,children:t,renderSettings:n,position:o="bottom center",focusOnMount:r="firstElement",...l}){const[a,c]=(0,s.useState)(!1),u=!!n&&a;return(0,s.createElement)(p.Popover,i({className:"block-editor-url-popover",focusOnMount:r,position:o},l),(0,s.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,s.createElement)("div",{className:"block-editor-url-popover__row"},t,!!n&&(0,s.createElement)(p.Button,{className:"block-editor-url-popover__settings-toggle",icon:xd,label:(0,g.__)("Link settings"),onClick:()=>{c(!a)},"aria-expanded":a})),u&&(0,s.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},n())),e&&!u&&(0,s.createElement)("div",{className:"block-editor-url-popover__additional-controls"},e))}Iv.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:o,...r}){return(0,s.createElement)("form",i({className:c()("block-editor-url-popover__link-editor",t)},r),(0,s.createElement)(ev,{value:o,onChange:n,autocompleteRef:e}),(0,s.createElement)(p.Button,{icon:Xb,label:(0,g.__)("Apply"),type:"submit"}))},Iv.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:o,urlLabel:r,...l}){return(0,s.createElement)("div",i({className:c()("block-editor-url-popover__link-viewer",e)},l),(0,s.createElement)(Bv,{url:o,urlLabel:r,className:t}),n&&(0,s.createElement)(p.Button,{icon:wv,label:(0,g.__)("Edit"),onClick:n}))};var xv=Iv;const Tv=({src:e,onChange:t,onSubmit:n,onClose:o})=>(0,s.createElement)(xv,{onClose:o},(0,s.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n},(0,s.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,g.__)("URL"),placeholder:(0,g.__)("Paste or type URL"),onChange:t,value:e}),(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:Xb,label:(0,g.__)("Apply"),type:"submit"})));var Nv=(0,p.withFilters)("editor.MediaPlaceholder")((function({value:e={},allowedTypes:t,className:n,icon:o,labels:r={},mediaPreview:l,notices:i,isAppender:a,accept:d,addToGallery:f,multiple:h=!1,handleUpload:b=!0,dropZoneUIOnly:v,disableDropZone:k,disableMediaButtons:_,onError:y,onSelect:E,onCancel:C,onSelectURL:S,onDoubleClick:w,onFilesPreUpload:B=u.noop,onHTMLDrop:I=u.noop,children:x,mediaLibraryButton:T,placeholder:N,style:P}){const R=(0,m.useSelect)((e=>{const{getSettings:t}=e(Wn);return t().mediaUpload}),[]),[M,L]=(0,s.useState)(""),[A,D]=(0,s.useState)(!1);(0,s.useEffect)((()=>{var t;L(null!==(t=null==e?void 0:e.src)&&void 0!==t?t:"")}),[null==e?void 0:e.src]);const O=e=>{L(e.target.value)},F=()=>{D(!0)},z=()=>{D(!1)},V=e=>{e.preventDefault(),M&&S&&(S(M),z())},H=n=>{if(!b)return E(n);let o;if(B(n),h)if(f){let t=[];o=n=>{const o=(null!=e?e:[]).filter((e=>e.id?!t.some((({id:t})=>Number(t)===Number(e.id))):!t.some((({urlSlug:t})=>e.url.includes(t)))));E(o.concat(n)),t=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=E;else o=([e])=>E(e);R({allowedTypes:t,filesList:n,onFileChange:o,onError:y})},U=e=>{H(e.target.files)},G=null!=N?N:e=>{let{instructions:u,title:d}=r;if(R||S||(u=(0,g.__)("To edit this block, you need permission to upload media.")),void 0===u||void 0===d){const e=null!=t?t:[],[n]=e,o=1===e.length,r=o&&"audio"===n,l=o&&"image"===n,i=o&&"video"===n;void 0===u&&R&&(u=(0,g.__)("Upload a media file or pick one from your media library."),r?u=(0,g.__)("Upload an audio file, pick one from your media library, or add one with a URL."):l?u=(0,g.__)("Upload an image file, pick one from your media library, or add one with a URL."):i&&(u=(0,g.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===d&&(d=(0,g.__)("Media"),r?d=(0,g.__)("Audio"):l?d=(0,g.__)("Image"):i&&(d=(0,g.__)("Video")))}const m=c()("block-editor-media-placeholder",n,{"is-appender":a});return(0,s.createElement)(p.Placeholder,{icon:o,label:d,instructions:u,className:m,notices:i,onDoubleClick:w,preview:l,style:P},e,x)},W=()=>k?null:(0,s.createElement)(p.DropZone,{onFilesDrop:H,onHTMLDrop:I}),$=()=>C&&(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,g.__)("Cancel"),variant:"link",onClick:C},(0,g.__)("Cancel")),j=()=>S&&(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:F,isPressed:A,variant:"tertiary"},(0,g.__)("Insert from URL")),A&&(0,s.createElement)(Tv,{src:M,onChange:O,onSubmit:V,onClose:z}));return v||_?(v&&At()("wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop",{since:"5.4",alternative:"disableMediaButtons"}),(0,s.createElement)(Cv,null,W())):(0,s.createElement)(Cv,{fallback:G(j())},(()=>{const n=null!=T?T:({open:e})=>(0,s.createElement)(p.Button,{variant:"tertiary",onClick:()=>{e()}},(0,g.__)("Media Library")),o=(0,s.createElement)(Ev,{addToGallery:f,gallery:h&&!(!t||0===t.length)&&t.every((e=>"image"===e||e.startsWith("image/"))),multiple:h,onSelect:E,allowedTypes:t,value:Array.isArray(e)?e.map((({id:e})=>e)):e.id,render:n});if(R&&a)return(0,s.createElement)(s.Fragment,null,W(),(0,s.createElement)(p.FormFileUpload,{onChange:U,accept:d,multiple:h,render:({openFileDialog:e})=>{const t=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e},(0,g.__)("Upload")),o,j(),$());return G(t)}}));if(R){const e=(0,s.createElement)(s.Fragment,null,W(),(0,s.createElement)(p.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:U,accept:d,multiple:h},(0,g.__)("Upload")),o,j(),$());return G(e)}return G(o)})())})),Pv=({colorSettings:e,...t})=>{const n=e.map((({value:e,onChange:t,...n})=>({...n,colorValue:e,onColorChange:t})));return(0,s.createElement)(qm,i({settings:n,gradients:[],disableCustomGradients:!0},t))};const Rv={position:"bottom right",isAlternate:!0};var Mv=()=>(0,s.createElement)(s.Fragment,null,["bold","italic","link"].map((e=>(0,s.createElement)(p.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,s.createElement)(p.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((([{props:e}])=>e)).some((({isActive:e})=>e));return(0,s.createElement)(p.ToolbarItem,null,(n=>(0,s.createElement)(p.DropdownMenu,{icon:xd
|
74 |
+
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("More"),toggleProps:{...n,className:c()(n.className,{"is-pressed":t})},controls:(0,u.orderBy)(e.map((([{props:e}])=>e)),"title"),popoverProps:Rv})))}))),Lv=({inline:e,anchorRef:t})=>e?(0,s.createElement)(p.Popover,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:t,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,s.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Mv,null)))):(0,s.createElement)(eo,{group:"inline"},(0,s.createElement)(Mv,null));function Av(){const{didAutomaticChange:e,getSettings:t}=(0,m.useSelect)(Wn);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==fa.DELETE&&o!==fa.BACKSPACE&&o!==fa.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function Dv(e){return e.filter((({type:e})=>/^image\/(?:jpe?g|png|gif)$/.test(e))).map((e=>`<img src="${(0,rp.createBlobURL)(e)}">`)).join("")}var Ov=window.wp.shortcode;function Fv(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function zv(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function Vv({allowedFormats:e,formattingControls:t,disableFormats:n}){return n?Vv.EMPTY_ARRAY:e||t?e||(At()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats"}),t.map((e=>`core/${e}`))):void 0}function Hv({value:e,pastedBlocks:t=[],onReplace:n,onSplit:o,onSplitMiddle:r,multilineTag:l}){if(!n||!o)return;const i=[],[s,a]=(0,Mt.split)(e),c=t.length>0;let u=-1;const d=(0,Mt.isEmpty)(s)&&!(0,Mt.isEmpty)(a);c&&(0,Mt.isEmpty)(s)||(i.push(o((0,Mt.toHTMLString)({value:s,multilineTag:l}),!d)),u+=1),c?(i.push(...t),u+=t.length):r&&i.push(r()),(c||r)&&(0,Mt.isEmpty)(a)||i.push(o((0,Mt.toHTMLString)({value:a,multilineTag:l}),d)),n(i,c?u:1,c?-1:0)}function Uv(e,t){return t?(0,Mt.replace)(e,/\n+/g,Mt.__UNSTABLE_LINE_SEPARATOR):(0,Mt.replace)(e,new RegExp(Mt.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function Gv(e){const t=(0,s.useRef)(e);return t.current=e,(0,d.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:l,value:i,formatTypes:s,tagName:a,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:f,pastePlainText:g}=t.current;if(!n)return void e.preventDefault();const{clipboardData:h}=e;let b="",v="";try{b=h.getData("text/plain"),v=h.getData("text/html")}catch(e){try{v=h.getData("Text")}catch(e){return}}if(v=function(e){return e.replace(/.*<!--StartFragment-->/s,"").replace(/<!--EndFragment-->.*/s,"")}(v),e.preventDefault(),window.console.log("Received HTML:\n\n",v),window.console.log("Received plain text:\n\n",b),o)return void l((0,Mt.insert)(i,b));const k=s.reduce(((e,{__unstablePasteRule:t})=>(t&&e===i&&(e=t(i,{html:v,plainText:b})),e)),i);if(k!==i)return void l(k);const _=[...(0,tr.getFilesFromDataTransfer)(h)];if("true"===h.getData("rich-text")){const e=h.getData("rich-text-multi-line-tag")||void 0;let t=(0,Mt.create)({html:v,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:f});return t=Uv(t,!!m),Fv(t,i.activeFormats),void l((0,Mt.insert)(i,t))}if(g)return void l((0,Mt.insert)(i,(0,Mt.create)({text:b})));if(_&&_.length&&!v){const e=(0,r.pasteHandler)({HTML:Dv(_),mode:"BLOCKS",tagName:a,preserveWhiteSpace:f});return window.console.log("Received items:\n\n",_),void(c&&(0,Mt.isEmpty)(i)?c(e):Hv({value:i,pastedBlocks:e,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,Mt.isEmpty)(i)&&(E=b,(0,Ov.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,Mt.isEmpty)(i)&&(0,Pu.isURL)(b.trim())&&(y="BLOCKS");const C=(0,r.pasteHandler)({HTML:v,plainText:b,mode:y,tagName:a,preserveWhiteSpace:f});if("string"==typeof C){let e=(0,Mt.create)({html:C});e=Uv(e,!!m),Fv(e,i.activeFormats),l((0,Mt.insert)(i,e))}else C.length>0&&(c&&(0,Mt.isEmpty)(i)?c(C,C.length-1,-1):Hv({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function Wv(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,m.useDispatch)(Wn),o=(0,s.useRef)(e);return o.current=e,(0,d.useRefEffect)((e=>{function l(){const{value:e,onReplace:t}=o.current;if(!t)return;const{start:l,text:i}=e;if(" "!==i.slice(l-1,l))return;const s=i.slice(0,l).trim(),a=(0,r.getBlockTransforms)("from").filter((({type:e})=>"prefix"===e)),c=(0,r.findTransform)(a,(({prefix:e})=>s===e));if(!c)return;const u=(0,Mt.toHTMLString)({value:(0,Mt.slice)(e,l,i.length)});t([c.transform(u)]),n()}function i(e){const{inputType:r,type:i}=e,{value:s,onChange:a,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==r&&"compositionend"!==i)return;c&&l&&l();const d=u.reduce(((e,{__unstableInputRule:t})=>(t&&(e=t(e)),e)),s);d!==s&&(t(),a({...d,activeFormats:s.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function $v(e){const{__unstableMarkAutomaticChange:t}=(0,m.useDispatch)(Wn),n=(0,s.useRef)(e);return n.current=e,(0,d.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:l,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;if(e.keyCode!==fa.ENTER)return;e.preventDefault();const m={...l};m.formats=o(l);const f=i&&s;if(i){const e=(0,r.getBlockTransforms)("from").filter((({type:e})=>"enter"===e)),n=(0,r.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(i([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,Mt.insert)(m,"\n")):f&&(0,Mt.__unstableIsEmptyLine)(m)?Hv({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c}):u((0,Mt.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!f&&!r?d||u((0,Mt.insert)(m,"\n")):!f&&r?p():f&&Hv({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function jv(e){return e(Mt.store).getFormatTypes()}Vv.EMPTY_ARRAY=[];const Kv=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function qv(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function Yv(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function Zv({formatTypes:e,onChange:t,onFocus:n,value:o,forwardedRef:r}){return e.map((e=>{const{name:l,edit:i}=e;if(!i)return null;const a=(0,Mt.getActiveFormat)(o,l),c=void 0!==a,u=(0,Mt.getActiveObject)(o),d=void 0!==u&&u.type===l;return(0,s.createElement)(i,{key:l,isActive:c,activeAttributes:c&&a.attributes||{},isObjectActive:d,activeObjectAttributes:d&&u.attributes||{},value:o,onChange:t,onFocus:n,contentRef:r})}))}const Xv=(0,s.createContext)(),Qv=(0,s.createContext)(),Jv=(0,s.forwardRef)((function e({children:t,tagName:n="div",value:o="",onChange:l,isSelected:a,multiline:f,inlineToolbar:g,wrapperClassName:h,autocompleters:b,onReplace:v,placeholder:k,allowedFormats:_,formattingControls:y,withoutInteractiveFormatting:E,onRemove:C,onMerge:S,onSplit:w,__unstableOnSplitAtEnd:B,__unstableOnSplitMiddle:I,identifier:x,preserveWhiteSpace:T,__unstablePastePlainText:N,__unstableEmbedURLOnPaste:P,__unstableDisableFormats:R,disableLineBreaks:M,unstableOnFocus:L,__unstableAllowPrefixTransformations:A,...D},O){const F=(0,d.useInstanceId)(e);x=x||F,D=function(e){return(0,u.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(D);const z=(0,s.useRef)(),{clientId:V}=qn(),{selectionStart:H,selectionEnd:U,isSelected:G,disabled:W}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n,isMultiSelecting:o,hasMultiSelection:r}=e(Wn),l=t(),i=n();let s;return void 0===a?s=l.clientId===V&&l.attributeKey===x:a&&(s=l.clientId===V),{selectionStart:s?l.offset:void 0,selectionEnd:s?i.offset:void 0,isSelected:s,disabled:o()||r()}})),{selectionChange:$}=(0,m.useDispatch)(Wn),j=zv(f),K=Vv({allowedFormats:_,formattingControls:y,disableFormats:R}),q=!K||K.length>0;let Y=o,Z=l;Array.isArray(o)&&(Y=r.children.toHTML(o),Z=e=>l(r.children.fromDOM((0,Mt.__unstableCreateElement)(document,e).childNodes)));const X=(0,s.useCallback)(((e,t)=>{$(V,x,e,t)}),[V,x]),{formatTypes:Q,prepareHandlers:J,valueHandlers:ee,changeHandlers:te,dependencies:ne}=function({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:o}){const r=(0,m.useSelect)(jv,[]),l=(0,s.useMemo)((()=>r.filter((({name:e,tagName:t})=>!(o&&!o.includes(e)||n&&Kv.has(t))))),[r,o,Kv]),i=(0,m.useSelect)((n=>l.reduce(((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e})),o)),{})),[l,e,t]),a=(0,m.useDispatch)(),c=[],u=[],d=[],p=[];return l.forEach((n=>{if(n.__experimentalCreatePrepareEditableTree){const o=i[n.name],r=n.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:t,blockClientId:e});n.__experimentalCreateOnChangeEditableValue?u.push(r):c.push(r);for(const e in o)p.push(o[e])}if(n.__experimentalCreateOnChangeEditableValue){let o={};n.__experimentalGetPropsForEditableTreeChangeHandler&&(o=n.__experimentalGetPropsForEditableTreeChangeHandler(a,{richTextIdentifier:t,blockClientId:e})),d.push(n.__experimentalCreateOnChangeEditableValue({...i[n.name]||{},...o},{richTextIdentifier:t,blockClientId:e}))}})),{formatTypes:l,prepareHandlers:c,valueHandlers:u,changeHandlers:d,dependencies:p}}({clientId:V,identifier:x,withoutInteractiveFormatting:E,allowedFormats:K});function oe(e){return Q.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,Mt.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:re,onChange:le,ref:ie}=(0,Mt.__unstableUseRichText)({value:Y,onChange(e,{__unstableFormats:t,__unstableText:n}){Z(e),Object.values(te).forEach((e=>{e(t,n)}))},selectionStart:H,selectionEnd:U,onSelectionChange:X,placeholder:k,__unstableIsSelected:G,__unstableMultilineTag:j,__unstableDisableFormats:R,preserveWhiteSpace:T,__unstableDependencies:[...ne,n],__unstableAfterParse:function(e){return ee.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:oe,__unstableAddInvisibleFormats:function(e){return J.reduce(((t,n)=>n(t,e.text)),e.formats)}}),se=function(e){return(0,p.__unstableUseAutocompleteProps)({...e,completers:mh(e)})}({onReplace:v,completers:b,record:re,onChange:le});!function({value:e}){const t=e.activeFormats&&!!e.activeFormats.length,{isCaretWithinFormattedText:n}=(0,m.useSelect)(Wn),{enterFormattedText:o,exitFormattedText:r}=(0,m.useDispatch)(Wn);(0,s.useEffect)((()=>{t?n()||o():n()&&r()}),[t])}({value:re}),function({html:e,value:t}){const n=(0,s.useRef)(),o=t.activeFormats&&!!t.activeFormats.length,{__unstableMarkLastChangeAsPersistent:r}=(0,m.useDispatch)(Wn);(0,s.useLayoutEffect)((()=>{if(n.current){if(n.current!==t.text){const e=window.setTimeout((()=>{r()}),1e3);return n.current=t.text,()=>{window.clearTimeout(e)}}r()}else n.current=t.text}),[e,o])}({html:Y,value:re});const ae=(0,s.useRef)(new Set),ce=(0,s.useRef)(new Set);function ue(){z.current.focus()}const de=n,pe=(0,s.createElement)(s.Fragment,null,G&&(0,s.createElement)(Xv.Provider,{value:ae},(0,s.createElement)(Qv.Provider,{value:ce},(0,s.createElement)(p.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},t&&t({value:re,onChange:le,onFocus:ue}),(0,s.createElement)(Zv,{value:re,onChange:le,onFocus:ue,formatTypes:Q,forwardedRef:z})))),G&&q&&(0,s.createElement)(Lv,{inline:g,anchorRef:z.current}),(0,s.createElement)(de,i({role:"textbox","aria-multiline":!0,"aria-label":k},D,se,{ref:(0,d.useMergeRefs)([se.ref,D.ref,ie,Wv({value:re,onChange:le,__unstableAllowPrefixTransformations:A,formatTypes:Q,onReplace:v}),(0,d.useRefEffect)((e=>{function t(e){(fa.isKeyboardEvent.primary(e,"z")||fa.isKeyboardEvent.primary(e,"y")||fa.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),qv(ae),Yv(ce),Av(),Gv({isSelected:G,disableFormats:R,onChange:le,value:re,formatTypes:Q,tagName:n,onReplace:v,onSplit:w,onSplitMiddle:I,__unstableEmbedURLOnPaste:P,multilineTag:j,preserveWhiteSpace:T,pastePlainText:N}),$v({removeEditorOnlyFormats:oe,value:re,onReplace:v,onSplit:w,onSplitMiddle:I,multilineTag:j,onChange:le,disableLineBreaks:M,onSplitAtEnd:B}),z,O]),contentEditable:!W||void 0,suppressContentEditableWarning:!W,className:c()("block-editor-rich-text__editable",D.className,"rich-text"),onFocus:L,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===fa.DELETE||t===fa.BACKSPACE)){const{start:n,end:o,text:r}=re,l=t===fa.BACKSPACE,i=re.activeFormats&&!!re.activeFormats.length;if(!(0,Mt.isCollapsed)(re)||i||l&&0!==n||!l&&o!==r.length)return;S&&S(!l),C&&(0,Mt.isEmpty)(re)&&l&&C(!l),e.preventDefault()}}})));if(!h)return pe;At()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div"});const me=c()("block-editor-rich-text",h);return(0,s.createElement)("div",{className:me},pe)}));Jv.Content=({value:e,tagName:t,multiline:n,...o})=>{Array.isArray(e)&&(e=r.children.toHTML(e));const l=zv(n);!e&&l&&(e=`<${l}></${l}>`);const i=(0,s.createElement)(s.RawHTML,null,e);return t?(0,s.createElement)(t,(0,u.omit)(o,["format"]),i):i},Jv.isEmpty=e=>!e||0===e.length;var ek=Jv;const tk=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(ek,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));tk.Content=({value:e="",tagName:t="div",...n})=>(0,s.createElement)(t,n,e);var nk=tk,ok=(0,s.forwardRef)((({__experimentalVersion:e,...t},n)=>{if(2===e)return(0,s.createElement)(nk,i({ref:n},t));const{className:o,onChange:r,...l}=t;return(0,s.createElement)(kr.Z,i({ref:n,className:c()("block-editor-plain-text",o),onChange:e=>r(e.target.value)},l))}));function rk({property:e,viewport:t,desc:n}){const o=(0,d.useInstanceId)(rk),r=n||(0,g.sprintf)(
|
75 |
/* translators: 1: property name. 2: viewport name. */
|
76 |
+
(0,g._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),e,t.label);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",{"aria-describedby":`rbc-desc-${o}`},t.label),(0,s.createElement)(p.VisuallyHidden,{as:"span",id:`rbc-desc-${o}`},r))}var lk=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:a=!1,defaultLabel:u={id:"all",
|
77 |
/* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */
|
78 |
label:(0,g.__)("All")},viewports:d=[{id:"small",label:(0,g.__)("Small screens")},{id:"medium",label:(0,g.__)("Medium screens")},{id:"large",label:(0,g.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const m=o||(0,g.sprintf)(
|
79 |
/* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */
|
80 |
+
(0,g.__)("Use the same %s on all screensizes."),n),f=(0,g.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),h=l((0,s.createElement)(rk,{property:n,viewport:u}),u);
|
81 |
+
/* translators: 'Help text for the responsive mode toggle control.' */return(0,s.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,s.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,s.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,s.createElement)(p.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:m,checked:!a,onChange:r,help:f}),(0,s.createElement)("div",{className:c()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&h,a&&(i?i(d):d.map((e=>(0,s.createElement)(s.Fragment,{key:e.id},l((0,s.createElement)(rk,{property:n,viewport:e}),e))))))))};function ik({character:e,type:t,onUse:n}){const o=(0,s.useContext)(Xv),r=(0,s.useRef)();return r.current=n,(0,s.useEffect)((()=>{function n(n){fa.isKeyboardEvent[t](n,e)&&(r.current(),n.preventDefault())}return o.current.add(n),()=>{o.current.delete(n)}}),[e,t]),null}function sk({name:e,shortcutType:t,shortcutCharacter:n,...o}){let r,l="RichText.ToolbarControls";return e&&(l+=`.${e}`),t&&n&&(r=fa.displayShortcut[t](n)),(0,s.createElement)(p.Fill,{name:l},(0,s.createElement)(p.ToolbarButton,i({},o,{shortcut:r})))}function ak({inputType:e,onInput:t}){const n=(0,s.useContext)(Qv),o=(0,s.useRef)();return o.current=t,(0,s.useEffect)((()=>{function t(t){t.inputType===e&&(o.current(),t.preventDefault())}return n.current.add(t),()=>{n.current.delete(t)}}),[e]),null}const ck=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"}));var uk=(0,s.forwardRef)((function(e,t){const n=(0,m.useSelect)((e=>e(Wn).isNavigationMode()),[]),{setNavigationMode:o}=(0,m.useDispatch)(Wn),r=e=>{o("edit"!==e)};return(0,s.createElement)(p.Dropdown,{renderToggle:({isOpen:o,onToggle:r})=>(0,s.createElement)(p.Button,i({},e,{ref:t,icon:n?ck:wv,"aria-expanded":o,"aria-haspopup":"true",onClick:r
|
82 |
+
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("Tools")})),position:"bottom right",renderContent:()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{role:"menu","aria-label":(0,g.__)("Tools")},(0,s.createElement)(p.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Co,{icon:wv}),(0,g.__)("Edit"))},{value:"select",label:(0,s.createElement)(s.Fragment,null,ck,(0,g.__)("Select"))}]})),(0,s.createElement)("div",{className:"block-editor-tool-selector__help"},(0,g.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function dk({units:e,...t}){const n=(0,p.__experimentalUseCustomUnits)({availableUnits:fo("spacing.units")||["%","px","em","rem","vw"],units:e});return(0,s.createElement)(p.__experimentalUnitControl,i({units:n},t))}var pk=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));class mk extends s.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,g.__)("Edit link"):(0,g.__)("Insert link");return(0,s.createElement)("div",{className:"block-editor-url-input__button"},(0,s.createElement)(p.Button,{icon:Cm,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,s.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,s.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,s.createElement)(p.Button,{className:"block-editor-url-input__back",icon:pk,label:(0,g.__)("Close"),onClick:this.toggle}),(0,s.createElement)(ev,{value:e||"",onChange:t}),(0,s.createElement)(p.Button,{icon:Xb,label:(0,g.__)("Submit"),type:"submit"}))))}}var fk=mk,gk=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"}));const hk="none",bk="custom",vk="media",kk="attachment",_k=["noreferrer","noopener"],yk=(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,s.createElement)(p.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),Ek=({linkDestination:e,onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:r,mediaLink:l,linkTarget:i,linkClass:a,rel:c})=>{const[d,m]=(0,s.useState)(!1),f=(0,s.useCallback)((()=>{m(!0)})),[h,b]=(0,s.useState)(!1),[v,k]=(0,s.useState)(null),_=(0,s.useRef)(null),y=(0,s.useCallback)((()=>{e!==vk&&e!==kk||k(""),b(!0)})),E=(0,s.useCallback)((()=>{b(!1)})),C=(0,s.useCallback)((()=>{k(null),E(),m(!1)})),S=e=>{let t=e;return void 0===e||(0,u.isEmpty)(t)||(0,u.isEmpty)(t)||((0,u.each)(_k,(e=>{const n=new RegExp("\\b"+e+"\\b","gi");t=t.replace(n,"")})),t!==e&&(t=t.trim()),(0,u.isEmpty)(t)&&(t=void 0)),t},w=(0,s.useCallback)((()=>e=>{const t=_.current;t&&t.contains(e.target)||(m(!1),k(null),E())})),B=(0,s.useCallback)((()=>e=>{if(v){var n;const e=(null===(n=x().find((e=>e.url===v)))||void 0===n?void 0:n.linkDestination)||bk;t({href:v,linkDestination:e})}E(),k(null),e.preventDefault()})),I=(0,s.useCallback)((()=>{t({linkDestination:hk,href:""})})),x=()=>{const e=[{linkDestination:vk,title:(0,g.__)("Media File"),url:"image"===o?r:void 0,icon:yk}];return"image"===o&&l&&e.push({linkDestination:kk,title:(0,g.__)("Attachment Page"),url:"image"===o?l:void 0,icon:(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},T=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Open in new tab"),onChange:e=>{const n=(e=>{const t=e?"_blank":void 0;let n;return n=t||c?S(c):void 0,{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===i}),(0,s.createElement)(p.TextControl,{label:(0,g.__)("Link Rel"),value:S(c)||"",onChange:e=>{t({rel:e})}}),(0,s.createElement)(p.TextControl,{label:(0,g.__)("Link CSS Class"),value:a||"",onChange:e=>{t({linkClass:e})}})),N=null!==v?v:n,P=((0,u.find)(x(),["linkDestination",e])||{}).title;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{icon:Cm,className:"components-toolbar__control",label:n?(0,g.__)("Edit link"):(0,g.__)("Insert link"),"aria-expanded":d,onClick:f}),d&&(0,s.createElement)(xv,{onFocusOutside:w(),onClose:C,renderSettings:()=>T,additionalControls:!N&&(0,s.createElement)(p.NavigableMenu,null,(0,u.map)(x(),(e=>(0,s.createElement)(p.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{k(null),(e=>{const n=x();let o;o=e?((0,u.find)(n,(t=>t.url===e))||{linkDestination:bk}).linkDestination:hk,t({linkDestination:o,href:e})})(e.url),E()}},e.title))))},(!n||h)&&(0,s.createElement)(xv.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:N,onChangeInputValue:k,onSubmit:B(),autocompleteRef:_}),n&&!h&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(xv.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:y,urlLabel:P}),(0,s.createElement)(p.Button,{icon:gk,label:(0,g.__)("Remove link"),onClick:I}))))};function Ck({children:e,className:t,isEnabled:n=!0,deviceType:o,setDeviceType:r}){if((0,d.useViewportMatch)("small","<"))return null;const l={className:c()(t,"block-editor-post-preview__dropdown-content"),position:"bottom left"},i={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!n,
|
83 |
/* translators: button label text should, if possible, be under 16 characters. */
|
84 |
+
children:(0,g.__)("Preview")};return(0,s.createElement)(p.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:l,toggleProps:i,icon:null},(()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>r("Desktop"),icon:"Desktop"===o&&Hb},(0,g.__)("Desktop")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>r("Tablet"),icon:"Tablet"===o&&Hb},(0,g.__)("Tablet")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>r("Mobile"),icon:"Mobile"===o&&Hb},(0,g.__)("Mobile"))),e)))}function Sk(e){const[t,n]=(0,s.useState)(window.innerWidth);(0,s.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n<t?n:t};return(e=>{const t="Mobile"===e?"768px":"1024px";switch(e){case"Tablet":case"Mobile":return{width:o(e),margin:(window.innerHeight<800?36:72)+"px auto",height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}var wk=(0,m.withSelect)((e=>({selectedBlockClientId:e(Wn).getBlockSelectionStart()})))((({selectedBlockClientId:e})=>{const t=Ca(e);return e?(0,s.createElement)(p.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current.focus()}},(0,g.__)("Skip to the selected block")):null})),Bk=window.wp.wordcount,Ik=(0,m.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(Wn);return{blocks:t()}}))((function({blocks:e}){const t=(0,Bk.count)((0,r.serialize)(e),"words");return(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,s.createElement)(za,{icon:Vd,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,g.sprintf)(
|
85 |
/* translators: %d: number of blocks */
|
86 |
(0,g._n)("%d block","%d blocks",e.length),e.length)),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,g.sprintf)(
|
87 |
/* translators: %d: number of words */
|
88 |
+
(0,g._n)("%d word","%d words",t),t))))}));function xk({blockName:e}){const{preferredStyle:t,onUpdatePreferredStyleVariations:n,styles:o}=(0,m.useSelect)((t=>{var n,o;const l=t(Wn).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==l||null===(n=l.value)||void 0===n?void 0:n[e],onUpdatePreferredStyleVariations:null!==(o=null==l?void 0:l.onChange)&&void 0!==o?o:null,styles:t(r.store).getBlockStyles(e)}}),[e]),l=(0,s.useMemo)((()=>[{label:(0,g.__)("Not set"),value:""},...o.map((({label:e,name:t})=>({label:e,value:t})))]),[o]),i=(0,s.useCallback)((t=>{n(e,t)}),[e,n]);return n&&(0,s.createElement)(p.SelectControl,{options:l,value:t||"",label:(0,g.__)("Default Style"),onChange:i})}const Tk=({clientId:e,blockName:t,hasBlockStyles:n,bubblesVirtually:o})=>{const l=kd(e);return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(Va,l),(0,s.createElement)(rb,{blockClientId:e}),n&&(0,s.createElement)("div",null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Styles")},(0,s.createElement)(Kd,{clientId:e}),(0,r.hasBlockSupport)(t,"defaultStylePicker",!0)&&(0,s.createElement)(xk,{blockName:t}))),(0,s.createElement)(Xo.Slot,{bubblesVirtually:o}),(0,s.createElement)(Xo.Slot,{__experimentalGroup:"dimensions",bubblesVirtually:o,label:(0,g.__)("Dimensions")}),(0,s.createElement)("div",null,(0,s.createElement)(Nk,{bubblesVirtually:o})),(0,s.createElement)(wk,{key:"back"}))},Nk=({bubblesVirtually:e})=>{const t=(0,p.__experimentalUseSlot)(Zo.slotName);return Boolean(t.fills&&t.fills.length)?(0,s.createElement)(p.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,g.__)("Advanced"),initialOpen:!1},(0,s.createElement)(Xo.Slot,{__experimentalGroup:"advanced",bubblesVirtually:e})):null};var Pk=({showNoBlockSelectedMessage:e=!0,bubblesVirtually:t=!0})=>{const{count:n,hasBlockStyles:o,selectedBlockName:l,selectedBlockClientId:i,blockType:a}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(Wn),{getBlockStyles:l}=e(r.store),i=t(),s=i&&o(i),a=s&&(0,r.getBlockType)(s),c=s&&l(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:a,hasBlockStyles:c&&c.length>0}}),[]);if(n>1)return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(Ik,null),(0,s.createElement)(Xo.Slot,{bubblesVirtually:t}));const c=l===(0,r.getUnregisteredTypeHandlerName)();return a&&i&&!c?(0,s.createElement)(Tk,{clientId:i,blockName:a.name,hasBlockStyles:o,bubblesVirtually:t}):e?(0,s.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,g.__)("No block selected.")):null};function Rk({children:e,__unstableContentRef:t,...n}){const o=(0,d.useViewportMatch)("medium"),r=(0,m.useSelect)((e=>e(Wn).getSettings().hasFixedToolbar),[]),l=(0,Qa.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:a,getBlockRootClientId:c}=(0,m.useSelect)(Wn),{duplicateBlocks:f,removeBlocks:g,insertAfterBlock:h,insertBeforeBlock:b,clearSelectedBlock:v,moveBlocksUp:k,moveBlocksDown:_}=(0,m.useDispatch)(Wn);return(0,s.createElement)("div",i({},n,{onKeyDown:function(e){if(l("core/block-editor/move-up",e)){const t=a();if(t.length){e.preventDefault();const n=c((0,u.first)(t));k(t,n)}}else if(l("core/block-editor/move-down",e)){const t=a();if(t.length){e.preventDefault();const n=c((0,u.first)(t));_(t,n)}}else if(l("core/block-editor/duplicate",e)){const t=a();t.length&&(e.preventDefault(),f(t))}else if(l("core/block-editor/remove",e)){const t=a();t.length&&(e.preventDefault(),g(t))}else if(l("core/block-editor/insert-after",e)){const t=a();t.length&&(e.preventDefault(),h((0,u.last)(t)))}else if(l("core/block-editor/insert-before",e)){const t=a();t.length&&(e.preventDefault(),b((0,u.first)(t)))}else if(l("core/block-editor/delete-multi-selection",e)){const t=a();t.length>1&&(e.preventDefault(),g(t))}else l("core/block-editor/unselect",e)&&a().length>1&&(e.preventDefault(),v(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}),(0,s.createElement)(gd,{__unstableContentRef:t},(r||!o)&&(0,s.createElement)(Sp,{isFixed:!0}),(0,s.createElement)(xp,{__unstableContentRef:t}),(0,s.createElement)(p.Popover.Slot,{name:"block-toolbar",ref:pd(t)}),e,(0,s.createElement)(p.Popover.Slot,{name:"__unstable-block-tools-after",ref:pd(t)})))}var Mk=function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r=!1,__experimentalInsertionIndex:l,__experimentalFilterValue:i,onSelect:a=u.noop,shouldFocusBlock:c=!1}){const d=(0,m.useSelect)((n=>{const{getBlockRootClientId:o}=n(Wn);return e||o(t)||void 0}),[t,e]);return(0,s.createElement)(nd,{onSelect:a,rootClientId:d,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r,__experimentalInsertionIndex:l,__experimentalFilterValue:i,shouldFocusBlock:c})};function Lk(){return null}Lk.Register=function(){const{registerShortcut:e}=(0,m.useDispatch)(Qa.store);return(0,s.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,g.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,g.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,g.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,g.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,g.__)("Remove multiple selected blocks."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,g.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,g.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,g.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,g.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,g.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var Ak=Lk;function Dk(){return At()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in."}),null}const Ok=new Set([fa.UP,fa.RIGHT,fa.DOWN,fa.LEFT,fa.ENTER,fa.BACKSPACE]);function Fk(){const e=(0,m.useSelect)((e=>e(Wn).isTyping()),[]),{stopTyping:t}=(0,m.useDispatch)(Wn);return(0,d.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function zk(){const e=(0,m.useSelect)((e=>e(Wn).isTyping())),{startTyping:t,stopTyping:n}=(0,m.useDispatch)(Wn),o=Fk(),r=(0,d.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:l}=r;if(e){let e;function t(t){const{target:o}=t;e=l.setTimeout((()=>{(0,tr.isTextField)(o)||n()}))}function i(e){const{keyCode:t}=e;t!==fa.ESCAPE&&t!==fa.TAB||n()}function s(){const e=l.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",t),o.addEventListener("keydown",i),r.addEventListener("selectionchange",s),()=>{l.clearTimeout(e),o.removeEventListener("focus",t),o.removeEventListener("keydown",i),r.removeEventListener("selectionchange",s)}}function i(e){const{type:n,target:r}=e;(0,tr.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&Ok.has(t)}(e))&&t()}return o.addEventListener("keypress",i),o.addEventListener("keydown",i),()=>{o.removeEventListener("keypress",i),o.removeEventListener("keydown",i)}}),[e,t,n]);return(0,d.useMergeRefs)([o,r])}var Vk=function({children:e}){return(0,s.createElement)("div",{ref:zk()},e)};function Hk(){return At()("PreserveScrollInReorder component",{since:"5.4",hint:"This behavior is now built-in the block list"}),null}const Uk=-1!==window.navigator.userAgent.indexOf("Trident"),Gk=new Set([fa.UP,fa.DOWN,fa.LEFT,fa.RIGHT]);function Wk(){const e=(0,m.useSelect)((e=>e(Wn).hasSelectedBlock()),[]);return(0,d.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function s(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c({keyCode:e}){if(!m())return;const r=(0,tr.computeCaretRect)(o);if(!r)return;if(!i)return void(i=r);if(Gk.has(e))return void(i=r);const l=r.top-i.top;if(0===l)return;const s=(0,tr.getScrollContainer)(t);if(!s)return;const a=s===n.body,c=a?o.scrollY:s.scrollTop,u=a?0:s.getBoundingClientRect().top,d=a?i.top/o.innerHeight:(i.top-u)/(o.innerHeight-u);if(0===c&&d<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=r);const p=a?o.innerHeight:s.clientHeight;i.top+i.height>u+p||i.top<u?i=r:a?o.scrollBy(0,l):s.scrollTop+=l}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,tr.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",s,!0),o.addEventListener("resize",s,!0),t.addEventListener("keydown",a),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",s,!0),o.removeEventListener("resize",s,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}var $k=Uk?e=>e.children:function({children:e}){return(0,s.createElement)("div",{ref:Wk(),className:"block-editor__typewriter"},e)};const jk=(0,u.overEvery)([tr.isTextField,tr.focus.tabbable.isTabbableIndex]);function Kk(){return(0,d.useRefEffect)((e=>{function t(t){if(t.target!==e)return;const n=tr.focus.focusable.find(e),o=(0,u.findLast)(n,jk);if(!o)return;const{bottom:r}=o.getBoundingClientRect();t.clientY<r||((0,tr.placeCaretAtHorizontalEdge)(o,!0),t.preventDefault())}return e.addEventListener("mousedown",t),()=>{e.addEventListener("mousedown",t)}}),[])}const qk=(0,s.createContext)({});function Yk(e,t=""){var n;const o=(0,s.useContext)(qk),{name:r}=qn();t=t||r;const l=Boolean(null===(n=o[t])||void 0===n?void 0:n.has(e)),i=(0,s.useMemo)((()=>function(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}(o,t,e)),[o,t,e]);return[l,(0,s.useCallback)((({children:e})=>(0,s.createElement)(qk.Provider,{value:i},e)),[i])]}function Zk(e){if(void 0===e)e=b.colors;else{const t=e.filter((e=>e.color));0===t.length?e=b.colors:t.length<e.length&&(e=t)}return e}function Xk(e){if(void 0===e)e=b.gradients;else{const t=e.filter((e=>e.gradient));0===t.length?e=b.gradients:t.length<e.length&&(e=t)}return e}function Qk(e){const t=null==e?void 0:e.trim().match(/^(0?[-.]?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);return isNaN(e)||isNaN(parseFloat(e))?t?{value:parseFloat(t[1])||t[1],unit:t[2]}:{value:e,unit:void 0}:{value:parseFloat(e),unit:"px"}}function Jk(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>Qk(e_(e,t)).value)).filter(Boolean);switch(n[0]){case"min":return Math.min(...o)+"px";case"max":return Math.max(...o)+"px";case"clamp":return 3!==o.length?null:o[1]<o[0]?o[0]+"px":o[1]>o[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function e_(e,t={}){if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=Qk(e);return n.unit||(n=function(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=Jk(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return Qk(e)}(e)),function(e){for(let t=0;t<e.length;t++)if(["+","-","/","*"].includes(e[t]))return!0;return!1}(e)&&!n.unit?function(e){let t=!1;const n=e.split(/[+-/*/]/g).filter(Boolean);for(const o of n){const n=Qk(e_(o));if(!parseFloat(n.value)){t=!0;break}e=e.replace(o,n.value)}return t?null:(o=e,Function(`'use strict'; return (${o})`)()).toFixed(0)+"px";var o}(e):function(e,t){const n=.01,o=Object.assign({},{fontSize:16,lineHeight:16,width:375,height:812,type:"font"},t),r={em:o.fontSize,rem:o.fontSize,vh:o.height*n,vw:o.width*n,vmin:(o.width<o.height?o.width:o.height)*n,vmax:(o.width>o.height?o.width:o.height)*n,"%":("font"===o.type?o.fontSize:o.width)*n,ch:8,ex:7.15625,lh:o.lineHeight},l={in:96,cm:37.79527559055118,mm:3.7795275590551185,pt:1.3333333333333333,pc:16,px:1,Q:.9448818897637794};return r[e.unit]?(r[e.unit]*e.value).toFixed(0)+"px":l[e.unit]?(l[e.unit]*e.value).toFixed(0)+"px":null}(n,t)}const t_={};var n_=function(e,t={}){const n=e+function(e){let t="";return e.hasOwnProperty("fontSize")&&(t=":"+e.width),e.hasOwnProperty("lineHeight")&&(t=":"+e.lineHeight),e.hasOwnProperty("width")&&(t=":"+e.width),e.hasOwnProperty("height")&&(t=":"+e.height),e.hasOwnProperty("type")&&(t=":"+e.type),t}(t);return t_[n]||(t_[n]=e_(e,t)),t_[n]}}(),(window.wp=window.wp||{}).blockEditor=o}();
|
build/format-library/index.js
CHANGED
@@ -1175,11 +1175,18 @@ function InlineColorUI({
|
|
1175 |
onClose,
|
1176 |
contentRef
|
1177 |
}) {
|
1178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1179 |
ref: contentRef,
|
1180 |
value,
|
1181 |
settings: text_color_textColor
|
1182 |
-
});
|
1183 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
|
1184 |
onClose: onClose,
|
1185 |
className: "components-inline-color-popover",
|
1175 |
onClose,
|
1176 |
contentRef
|
1177 |
}) {
|
1178 |
+
/*
|
1179 |
+
As you change the text color by typing a HEX value into a field,
|
1180 |
+
the return value of document.getSelection jumps to the field you're editing,
|
1181 |
+
not the highlighted text. Given that useAnchorRef uses document.getSelection,
|
1182 |
+
it will return null, since it can't find the <mark> element within the HEX input.
|
1183 |
+
This caches the last truthy value of the selection anchor reference.
|
1184 |
+
*/
|
1185 |
+
const anchorRef = (0,external_wp_blockEditor_namespaceObject.useCachedTruthy)((0,external_wp_richText_namespaceObject.useAnchorRef)({
|
1186 |
ref: contentRef,
|
1187 |
value,
|
1188 |
settings: text_color_textColor
|
1189 |
+
}));
|
1190 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
|
1191 |
onClose: onClose,
|
1192 |
className: "components-inline-color-popover",
|
build/format-library/index.min.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '34c918a96a3161a4eb05fcb542cf0935');
|
build/format-library/index.min.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
!function(){"use strict";var e={};(function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e);var t=window.wp.richText,n=window.wp.element,o=window.wp.i18n,r=window.wp.blockEditor,a=window.wp.primitives,c=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.Path,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"}));const l="core/bold",i=(0,o.__)("Bold"),s={name:l,title:i,tagName:"strong",className:null,edit({isActive:e,value:o,onChange:a,onFocus:s}){function u(){a((0,t.toggleFormat)(o,{type:l}))}return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.RichTextShortcut,{type:"primary",character:"b",onUse:u}),(0,n.createElement)(r.RichTextToolbarButton,{name:"bold",icon:c,title:i,onClick:function(){u(),s()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),(0,n.createElement)(r.__unstableRichTextInputEvent,{inputType:"formatBold",onInput:u}))}};var u=(0,n.createElement)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(a.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"}));const m="core/code",h=(0,o.__)("Inline code"),p={name:m,title:h,tagName:"code",className:null,__unstableInputRule(e){const{start:n,text:o}=e;if("`"!==o.slice(n-1,n))return e;const r=o.slice(0,n-1).lastIndexOf("`");if(-1===r)return e;const a=r,c=n-2;return a===c?e:(e=(0,t.remove)(e,a,a+1),e=(0,t.remove)(e,c,c+1),e=(0,t.applyFormat)(e,{type:m},a,c))},edit:({value:e,onChange:o,onFocus:a,isActive:c})=>(0,n.createElement)(r.RichTextToolbarButton,{icon:u,title:h,onClick:function(){o((0,t.toggleFormat)(e,{type:m})),a()},isActive:c})};var g=window.wp.components,v=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,n.createElement)(a.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));const d=["image"],w="core/image",b=(0,o.__)("Inline image"),f={name:w,title:b,keywords:[(0,o.__)("photo"),(0,o.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function({value:e,onChange:o,onFocus:a,isObjectActive:c,activeObjectAttributes:l,contentRef:i}){const[s,u]=(0,n.useState)(!1);function m(){u(!1)}return(0,n.createElement)(r.MediaUploadCheck,null,(0,n.createElement)(r.RichTextToolbarButton,{icon:(0,n.createElement)(g.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(g.Path,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})),title:b,onClick:function(){u(!0)},isActive:c}),s&&(0,n.createElement)(r.MediaUpload,{allowedTypes:d,onSelect:({id:n,url:r,alt:c,width:l})=>{m(),o((0,t.insertObject)(e,{type:w,attributes:{className:`wp-image-${n}`,style:`width: ${Math.min(l,150)}px;`,url:r,alt:c}})),a()},onClose:m,render:({open:e})=>(e(),null)}),c&&(0,n.createElement)(y,{value:e,onChange:o,activeObjectAttributes:l,contentRef:i}))}};function y({value:e,onChange:r,activeObjectAttributes:a,contentRef:c}){const{style:l}=a,[i,s]=(0,n.useState)(null==l?void 0:l.replace(/\D/g,"")),u=(0,t.useAnchorRef)({ref:c,value:e,settings:f});return(0,n.createElement)(g.Popover,{position:"bottom center",focusOnMount:!1,anchorRef:u,className:"block-editor-format-toolbar__image-popover"},(0,n.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:t=>{const n=e.replacements.slice();n[e.start]={type:w,attributes:{...a,style:i?`width: ${i}px;`:""}},r({...e,replacements:n}),t.preventDefault()}},(0,n.createElement)(g.TextControl,{className:"block-editor-format-toolbar__image-container-value",type:"number",label:(0,o.__)("Width"),value:i,min:1,onChange:e=>s(e)}),(0,n.createElement)(g.Button,{icon:v,label:(0,o.__)("Apply"),type:"submit"})))}var E=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"}));const _="core/italic",C=(0,o.__)("Italic"),k={name:_,title:C,tagName:"em",className:null,edit({isActive:e,value:o,onChange:a,onFocus:c}){function l(){a((0,t.toggleFormat)(o,{type:_}))}return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.RichTextShortcut,{type:"primary",character:"i",onUse:l}),(0,n.createElement)(r.RichTextToolbarButton,{name:"italic",icon:E,title:C,onClick:function(){l(),c()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),(0,n.createElement)(r.__unstableRichTextInputEvent,{inputType:"formatItalic",onInput:l}))}};var x=window.wp.url,T=window.wp.htmlEntities,S=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"})),A=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),R=window.wp.a11y,F=window.wp.data,N=window.lodash;function P(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const e=(0,x.getProtocol)(t);if(!(0,x.isValidProtocol)(e))return!1;if((0,N.startsWith)(e,"http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const n=(0,x.getAuthority)(t);if(!(0,x.isValidAuthority)(n))return!1;const o=(0,x.getPath)(t);if(o&&!(0,x.isValidPath)(o))return!1;const r=(0,x.getQueryString)(t);if(r&&!(0,x.isValidQueryString)(r))return!1;const a=(0,x.getFragment)(t);if(a&&!(0,x.isValidFragment)(a))return!1}return!((0,N.startsWith)(t,"#")&&!(0,x.isValidFragment)(t))}var V=(0,g.withSpokenMessages)((function({isActive:e,activeAttributes:a,addingLink:c,value:l,onChange:i,speak:s,stopAddingLink:u,contentRef:m}){const[h,p]=(0,n.useState)(),{createPageEntity:v,userCanCreatePages:d}=(0,F.useSelect)((e=>{const{getSettings:t}=e(r.store),n=t();return{createPageEntity:n.__experimentalCreatePageEntity,userCanCreatePages:n.__experimentalUserCanCreatePages}}),[]),w={url:a.url,type:a.type,id:a.id,opensInNewTab:"_blank"===a.target,...h},b=(0,t.useAnchorRef)({ref:m,value:l,settings:z}),f=(0,n.useRef)(!!c&&"firstElement");return(0,n.createElement)(g.Popover,{anchorRef:b,focusOnMount:f.current,onClose:u,position:"bottom center"},(0,n.createElement)(r.__experimentalLinkControl,{value:w,onChange:function(n){n={...h,...n};const r=w.opensInNewTab!==n.opensInNewTab&&w.url===n.url,a=r&&void 0===n.url;if(p(a?n:void 0),a)return;const c=(0,x.prependHTTP)(n.url),m=function({url:e,type:t,id:n,opensInNewWindow:o}){const r={type:"core/link",attributes:{url:e}};return t&&(r.attributes.type=t),n&&(r.attributes.id=n),o&&(r.attributes.target="_blank",r.attributes.rel="noreferrer noopener"),r}({url:c,type:n.type,id:void 0!==n.id&&null!==n.id?String(n.id):void 0,opensInNewWindow:n.opensInNewTab});if((0,t.isCollapsed)(l)&&!e){const e=n.title||c,o=(0,t.applyFormat)((0,t.create)({text:e}),m,0,e.length);i((0,t.insert)(l,o))}else{const e=(0,t.applyFormat)(l,m);e.start=e.end,e.activeFormats=[],i(e)}r||u(),P(c)?s(e?(0,o.__)("Link edited."):(0,o.__)("Link inserted."),"assertive"):s((0,o.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")},onRemove:function(){const e=(0,t.removeFormat)(l,"core/link");i(e),u(),s((0,o.__)("Link removed."),"assertive")},forceIsEditingLink:c,hasRichPreviews:!0,createSuggestion:v&&async function(e){const t=await v({title:e,status:"draft"});return{id:t.id,type:t.type,title:t.title.rendered,url:t.link,kind:"post-type"}},withCreateSuggestion:d,createSuggestionButtonText:function(e){return(0,n.createInterpolateElement)((0,o.sprintf)(
|
2 |
/* translators: %s: search term. */
|
3 |
-
(0,o.__)("Create Page: <mark>%s</mark>"),e),{mark:(0,n.createElement)("mark",null)})}}))}));const B="core/link",M=(0,o.__)("Link"),z={name:B,title:M,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",target:"target"},__unstablePasteRule(e,{html:n,plainText:o}){if((0,t.isCollapsed)(e))return e;const r=(n||o).replace(/<[^>]+>/g,"").trim();return(0,x.isURL)(r)?(window.console.log("Created link:\n\n",r),(0,t.applyFormat)(e,{type:B,attributes:{url:(0,T.decodeEntities)(r)}})):e},edit:function({isActive:e,activeAttributes:a,value:c,onChange:l,onFocus:i,contentRef:s}){const[u,m]=(0,n.useState)(!1);function h(){const e=(0,t.getTextContent)((0,t.slice)(c));e&&(0,x.isURL)(e)&&P(e)?l((0,t.applyFormat)(c,{type:B,attributes:{url:e}})):e&&(0,x.isEmail)(e)?l((0,t.applyFormat)(c,{type:B,attributes:{url:`mailto:${e}`}})):m(!0)}function p(){l((0,t.removeFormat)(c,B)),(0,R.speak)((0,o.__)("Link removed."),"assertive")}return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.RichTextShortcut,{type:"primary",character:"k",onUse:h}),(0,n.createElement)(r.RichTextShortcut,{type:"primaryShift",character:"k",onUse:p}),e&&(0,n.createElement)(r.RichTextToolbarButton,{name:"link",icon:S,title:(0,o.__)("Unlink"),onClick:p,isActive:e,shortcutType:"primaryShift",shortcutCharacter:"k"}),!e&&(0,n.createElement)(r.RichTextToolbarButton,{name:"link",icon:A,title:M,onClick:h,isActive:e,shortcutType:"primary",shortcutCharacter:"k"}),(u||e)&&(0,n.createElement)(V,{addingLink:u,stopAddingLink:function(){m(!1),i()},isActive:e,activeAttributes:a,value:c,onChange:l,contentRef:s}))}};var H=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const L="core/strikethrough",I=(0,o.__)("Strikethrough"),j={name:L,title:I,tagName:"s",className:null,edit:({isActive:e,value:o,onChange:a,onFocus:c})=>(0,n.createElement)(r.RichTextToolbarButton,{icon:H,title:I,onClick:function(){a((0,t.toggleFormat)(o,{type:L})),c()},isActive:e})},U="core/underline",G={name:U,title:(0,o.__)("Underline"),tagName:"span",className:null,attributes:{style:"style"},edit({value:e,onChange:o}){const a=()=>{o((0,t.toggleFormat)(e,{type:U,attributes:{style:"text-decoration: underline;"}}))};return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.RichTextShortcut,{type:"primary",character:"u",onUse:a}),(0,n.createElement)(r.__unstableRichTextInputEvent,{inputType:"formatUnderline",onInput:a}))}};var O=function({icon:e,size:t=24,...o}){return(0,n.cloneElement)(e,{width:t,height:t,...o})},W=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.Path,{d:"M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z"}));function $(e=""){return e.split(";").reduce(((e,t)=>{if(t){const[n,o]=t.split(":");"color"===n&&(e.color=o),"background-color"===n&&(e.backgroundColor=o)}return e}),{})}function D(e="",t){return e.split(" ").reduce(((e,n)=>{if(n.match(/^has-([^-]+)-color$/)){const[,o]=n.match(/^has-([^-]+)-color$/),a=(0,r.getColorObjectByAttributeValues)(t,o);e.color=a.color}return e}),{})}function Q(e,n,o){const r=(0,t.getActiveFormat)(e,n);return r?{...$(r.attributes.style),...D(r.attributes.class,o)}:{}}function K({name:e,property:o,value:a,onChange:c}){const l=(0,F.useSelect)((e=>{const{getSettings:t}=e(r.store);return(0,N.get)(t(),["colors"],[])}),[]),i=(0,n.useCallback)((n=>{c(function(e,n,o,a){const{color:c,backgroundColor:l}={...Q(e,n,o),...a};if(!c&&!l)return(0,t.removeFormat)(e,n);const i=[],s=[],u={};if(l?i.push(["background-color",l].join(":")):i.push(["background-color","rgba(0, 0, 0, 0)"].join(":")),c){const e=(0,r.getColorObjectByColorValue)(o,c);e?s.push((0,r.getColorClassName)("color",e.slug)):i.push(["color",c].join(":"))}return i.length&&(u.style=i.join(";")),s.length&&(u.class=s.join(" ")),(0,t.applyFormat)(e,{type:n,attributes:u})}(a,e,l,{[o]:n}))}),[l,c,o]),s=(0,n.useMemo)((()=>Q(a,e,l)),[e,a,l]);return(0,n.createElement)(r.ColorPalette,{value:s[o],onChange:i})}function q({name:e,value:
|
1 |
!function(){"use strict";var e={};(function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e);var t=window.wp.richText,n=window.wp.element,o=window.wp.i18n,r=window.wp.blockEditor,a=window.wp.primitives,c=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.Path,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"}));const l="core/bold",i=(0,o.__)("Bold"),s={name:l,title:i,tagName:"strong",className:null,edit({isActive:e,value:o,onChange:a,onFocus:s}){function u(){a((0,t.toggleFormat)(o,{type:l}))}return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.RichTextShortcut,{type:"primary",character:"b",onUse:u}),(0,n.createElement)(r.RichTextToolbarButton,{name:"bold",icon:c,title:i,onClick:function(){u(),s()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),(0,n.createElement)(r.__unstableRichTextInputEvent,{inputType:"formatBold",onInput:u}))}};var u=(0,n.createElement)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(a.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"}));const m="core/code",h=(0,o.__)("Inline code"),p={name:m,title:h,tagName:"code",className:null,__unstableInputRule(e){const{start:n,text:o}=e;if("`"!==o.slice(n-1,n))return e;const r=o.slice(0,n-1).lastIndexOf("`");if(-1===r)return e;const a=r,c=n-2;return a===c?e:(e=(0,t.remove)(e,a,a+1),e=(0,t.remove)(e,c,c+1),e=(0,t.applyFormat)(e,{type:m},a,c))},edit:({value:e,onChange:o,onFocus:a,isActive:c})=>(0,n.createElement)(r.RichTextToolbarButton,{icon:u,title:h,onClick:function(){o((0,t.toggleFormat)(e,{type:m})),a()},isActive:c})};var g=window.wp.components,v=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,n.createElement)(a.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));const d=["image"],w="core/image",b=(0,o.__)("Inline image"),f={name:w,title:b,keywords:[(0,o.__)("photo"),(0,o.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function({value:e,onChange:o,onFocus:a,isObjectActive:c,activeObjectAttributes:l,contentRef:i}){const[s,u]=(0,n.useState)(!1);function m(){u(!1)}return(0,n.createElement)(r.MediaUploadCheck,null,(0,n.createElement)(r.RichTextToolbarButton,{icon:(0,n.createElement)(g.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(g.Path,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})),title:b,onClick:function(){u(!0)},isActive:c}),s&&(0,n.createElement)(r.MediaUpload,{allowedTypes:d,onSelect:({id:n,url:r,alt:c,width:l})=>{m(),o((0,t.insertObject)(e,{type:w,attributes:{className:`wp-image-${n}`,style:`width: ${Math.min(l,150)}px;`,url:r,alt:c}})),a()},onClose:m,render:({open:e})=>(e(),null)}),c&&(0,n.createElement)(y,{value:e,onChange:o,activeObjectAttributes:l,contentRef:i}))}};function y({value:e,onChange:r,activeObjectAttributes:a,contentRef:c}){const{style:l}=a,[i,s]=(0,n.useState)(null==l?void 0:l.replace(/\D/g,"")),u=(0,t.useAnchorRef)({ref:c,value:e,settings:f});return(0,n.createElement)(g.Popover,{position:"bottom center",focusOnMount:!1,anchorRef:u,className:"block-editor-format-toolbar__image-popover"},(0,n.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:t=>{const n=e.replacements.slice();n[e.start]={type:w,attributes:{...a,style:i?`width: ${i}px;`:""}},r({...e,replacements:n}),t.preventDefault()}},(0,n.createElement)(g.TextControl,{className:"block-editor-format-toolbar__image-container-value",type:"number",label:(0,o.__)("Width"),value:i,min:1,onChange:e=>s(e)}),(0,n.createElement)(g.Button,{icon:v,label:(0,o.__)("Apply"),type:"submit"})))}var E=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"}));const _="core/italic",C=(0,o.__)("Italic"),k={name:_,title:C,tagName:"em",className:null,edit({isActive:e,value:o,onChange:a,onFocus:c}){function l(){a((0,t.toggleFormat)(o,{type:_}))}return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.RichTextShortcut,{type:"primary",character:"i",onUse:l}),(0,n.createElement)(r.RichTextToolbarButton,{name:"italic",icon:E,title:C,onClick:function(){l(),c()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),(0,n.createElement)(r.__unstableRichTextInputEvent,{inputType:"formatItalic",onInput:l}))}};var x=window.wp.url,T=window.wp.htmlEntities,S=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"})),A=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),R=window.wp.a11y,F=window.wp.data,N=window.lodash;function P(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const e=(0,x.getProtocol)(t);if(!(0,x.isValidProtocol)(e))return!1;if((0,N.startsWith)(e,"http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const n=(0,x.getAuthority)(t);if(!(0,x.isValidAuthority)(n))return!1;const o=(0,x.getPath)(t);if(o&&!(0,x.isValidPath)(o))return!1;const r=(0,x.getQueryString)(t);if(r&&!(0,x.isValidQueryString)(r))return!1;const a=(0,x.getFragment)(t);if(a&&!(0,x.isValidFragment)(a))return!1}return!((0,N.startsWith)(t,"#")&&!(0,x.isValidFragment)(t))}var V=(0,g.withSpokenMessages)((function({isActive:e,activeAttributes:a,addingLink:c,value:l,onChange:i,speak:s,stopAddingLink:u,contentRef:m}){const[h,p]=(0,n.useState)(),{createPageEntity:v,userCanCreatePages:d}=(0,F.useSelect)((e=>{const{getSettings:t}=e(r.store),n=t();return{createPageEntity:n.__experimentalCreatePageEntity,userCanCreatePages:n.__experimentalUserCanCreatePages}}),[]),w={url:a.url,type:a.type,id:a.id,opensInNewTab:"_blank"===a.target,...h},b=(0,t.useAnchorRef)({ref:m,value:l,settings:z}),f=(0,n.useRef)(!!c&&"firstElement");return(0,n.createElement)(g.Popover,{anchorRef:b,focusOnMount:f.current,onClose:u,position:"bottom center"},(0,n.createElement)(r.__experimentalLinkControl,{value:w,onChange:function(n){n={...h,...n};const r=w.opensInNewTab!==n.opensInNewTab&&w.url===n.url,a=r&&void 0===n.url;if(p(a?n:void 0),a)return;const c=(0,x.prependHTTP)(n.url),m=function({url:e,type:t,id:n,opensInNewWindow:o}){const r={type:"core/link",attributes:{url:e}};return t&&(r.attributes.type=t),n&&(r.attributes.id=n),o&&(r.attributes.target="_blank",r.attributes.rel="noreferrer noopener"),r}({url:c,type:n.type,id:void 0!==n.id&&null!==n.id?String(n.id):void 0,opensInNewWindow:n.opensInNewTab});if((0,t.isCollapsed)(l)&&!e){const e=n.title||c,o=(0,t.applyFormat)((0,t.create)({text:e}),m,0,e.length);i((0,t.insert)(l,o))}else{const e=(0,t.applyFormat)(l,m);e.start=e.end,e.activeFormats=[],i(e)}r||u(),P(c)?s(e?(0,o.__)("Link edited."):(0,o.__)("Link inserted."),"assertive"):s((0,o.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")},onRemove:function(){const e=(0,t.removeFormat)(l,"core/link");i(e),u(),s((0,o.__)("Link removed."),"assertive")},forceIsEditingLink:c,hasRichPreviews:!0,createSuggestion:v&&async function(e){const t=await v({title:e,status:"draft"});return{id:t.id,type:t.type,title:t.title.rendered,url:t.link,kind:"post-type"}},withCreateSuggestion:d,createSuggestionButtonText:function(e){return(0,n.createInterpolateElement)((0,o.sprintf)(
|
2 |
/* translators: %s: search term. */
|
3 |
+
(0,o.__)("Create Page: <mark>%s</mark>"),e),{mark:(0,n.createElement)("mark",null)})}}))}));const B="core/link",M=(0,o.__)("Link"),z={name:B,title:M,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",target:"target"},__unstablePasteRule(e,{html:n,plainText:o}){if((0,t.isCollapsed)(e))return e;const r=(n||o).replace(/<[^>]+>/g,"").trim();return(0,x.isURL)(r)?(window.console.log("Created link:\n\n",r),(0,t.applyFormat)(e,{type:B,attributes:{url:(0,T.decodeEntities)(r)}})):e},edit:function({isActive:e,activeAttributes:a,value:c,onChange:l,onFocus:i,contentRef:s}){const[u,m]=(0,n.useState)(!1);function h(){const e=(0,t.getTextContent)((0,t.slice)(c));e&&(0,x.isURL)(e)&&P(e)?l((0,t.applyFormat)(c,{type:B,attributes:{url:e}})):e&&(0,x.isEmail)(e)?l((0,t.applyFormat)(c,{type:B,attributes:{url:`mailto:${e}`}})):m(!0)}function p(){l((0,t.removeFormat)(c,B)),(0,R.speak)((0,o.__)("Link removed."),"assertive")}return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.RichTextShortcut,{type:"primary",character:"k",onUse:h}),(0,n.createElement)(r.RichTextShortcut,{type:"primaryShift",character:"k",onUse:p}),e&&(0,n.createElement)(r.RichTextToolbarButton,{name:"link",icon:S,title:(0,o.__)("Unlink"),onClick:p,isActive:e,shortcutType:"primaryShift",shortcutCharacter:"k"}),!e&&(0,n.createElement)(r.RichTextToolbarButton,{name:"link",icon:A,title:M,onClick:h,isActive:e,shortcutType:"primary",shortcutCharacter:"k"}),(u||e)&&(0,n.createElement)(V,{addingLink:u,stopAddingLink:function(){m(!1),i()},isActive:e,activeAttributes:a,value:c,onChange:l,contentRef:s}))}};var H=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const L="core/strikethrough",I=(0,o.__)("Strikethrough"),j={name:L,title:I,tagName:"s",className:null,edit:({isActive:e,value:o,onChange:a,onFocus:c})=>(0,n.createElement)(r.RichTextToolbarButton,{icon:H,title:I,onClick:function(){a((0,t.toggleFormat)(o,{type:L})),c()},isActive:e})},U="core/underline",G={name:U,title:(0,o.__)("Underline"),tagName:"span",className:null,attributes:{style:"style"},edit({value:e,onChange:o}){const a=()=>{o((0,t.toggleFormat)(e,{type:U,attributes:{style:"text-decoration: underline;"}}))};return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.RichTextShortcut,{type:"primary",character:"u",onUse:a}),(0,n.createElement)(r.__unstableRichTextInputEvent,{inputType:"formatUnderline",onInput:a}))}};var O=function({icon:e,size:t=24,...o}){return(0,n.cloneElement)(e,{width:t,height:t,...o})},W=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.Path,{d:"M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z"}));function $(e=""){return e.split(";").reduce(((e,t)=>{if(t){const[n,o]=t.split(":");"color"===n&&(e.color=o),"background-color"===n&&(e.backgroundColor=o)}return e}),{})}function D(e="",t){return e.split(" ").reduce(((e,n)=>{if(n.match(/^has-([^-]+)-color$/)){const[,o]=n.match(/^has-([^-]+)-color$/),a=(0,r.getColorObjectByAttributeValues)(t,o);e.color=a.color}return e}),{})}function Q(e,n,o){const r=(0,t.getActiveFormat)(e,n);return r?{...$(r.attributes.style),...D(r.attributes.class,o)}:{}}function K({name:e,property:o,value:a,onChange:c}){const l=(0,F.useSelect)((e=>{const{getSettings:t}=e(r.store);return(0,N.get)(t(),["colors"],[])}),[]),i=(0,n.useCallback)((n=>{c(function(e,n,o,a){const{color:c,backgroundColor:l}={...Q(e,n,o),...a};if(!c&&!l)return(0,t.removeFormat)(e,n);const i=[],s=[],u={};if(l?i.push(["background-color",l].join(":")):i.push(["background-color","rgba(0, 0, 0, 0)"].join(":")),c){const e=(0,r.getColorObjectByColorValue)(o,c);e?s.push((0,r.getColorClassName)("color",e.slug)):i.push(["color",c].join(":"))}return i.length&&(u.style=i.join(";")),s.length&&(u.class=s.join(" ")),(0,t.applyFormat)(e,{type:n,attributes:u})}(a,e,l,{[o]:n}))}),[l,c,o]),s=(0,n.useMemo)((()=>Q(a,e,l)),[e,a,l]);return(0,n.createElement)(r.ColorPalette,{value:s[o],onChange:i})}function q({name:e,value:a,onChange:c,onClose:l,contentRef:i}){const s=(0,r.useCachedTruthy)((0,t.useAnchorRef)({ref:i,value:a,settings:ee}));return(0,n.createElement)(g.Popover,{onClose:l,className:"components-inline-color-popover",anchorRef:s},(0,n.createElement)(g.TabPanel,{tabs:[{name:"color",title:(0,o.__)("Text")},{name:"backgroundColor",title:(0,o.__)("Background")}]},(t=>(0,n.createElement)(K,{name:e,property:t.name,value:a,onChange:c}))))}const J="core/text-color",X=(0,o.__)("Highlight"),Y=[];function Z(e,t){const{ownerDocument:n}=e,{defaultView:o}=n,r=o.getComputedStyle(e).getPropertyValue(t);return"background-color"===t&&"rgba(0, 0, 0, 0)"===r&&e.parentElement?Z(e.parentElement,t):r}const ee={name:J,title:X,tagName:"mark",className:"has-inline-color",attributes:{style:"style",class:"class"},__unstableFilterAttributeValue(e,t){if("style"!==e)return t;if(t&&t.includes("background-color"))return t;const n=["background-color","rgba(0, 0, 0, 0)"].join(":");return t?[n,t].join(";"):n},edit:function({value:e,onChange:o,isActive:a,activeAttributes:c,contentRef:l}){const i=(0,r.useSetting)("color.custom"),s=(0,r.useSetting)("color.palette")||Y,[u,m]=(0,n.useState)(!1),h=(0,n.useCallback)((()=>m(!0)),[m]),p=(0,n.useCallback)((()=>m(!1)),[m]),g=(0,n.useMemo)((()=>function(e,{color:t,backgroundColor:n}){if(t||n)return{color:t||Z(e,"color"),backgroundColor:"rgba(0, 0, 0, 0)"===n?Z(e,"background-color"):n}}(l.current,Q(e,J,s))),[e,s]),v=!(0,N.isEmpty)(s)||!i;return v||a?(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.RichTextToolbarButton,{className:"format-library-text-color-button",isActive:a,icon:(0,n.createElement)(O,{icon:W,style:g}),title:X,onClick:v?h:()=>o((0,t.removeFormat)(e,J))}),u&&(0,n.createElement)(q,{name:J,onClose:p,activeAttributes:c,value:e,onChange:o,contentRef:l})):null}};var te=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.Path,{d:"M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"}));const ne="core/subscript",oe=(0,o.__)("Subscript"),re={name:ne,title:oe,tagName:"sub",className:null,edit:({isActive:e,value:o,onChange:a,onFocus:c})=>(0,n.createElement)(r.RichTextToolbarButton,{icon:te,title:oe,onClick:function(){a((0,t.toggleFormat)(o,{type:ne})),c()},isActive:e})};var ae=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.Path,{d:"M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"}));const ce="core/superscript",le=(0,o.__)("Superscript"),ie={name:ce,title:le,tagName:"sup",className:null,edit:({isActive:e,value:o,onChange:a,onFocus:c})=>(0,n.createElement)(r.RichTextToolbarButton,{icon:ae,title:le,onClick:function(){a((0,t.toggleFormat)(o,{type:ce})),c()},isActive:e})};var se=(0,n.createElement)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(a.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z"}));const ue="core/keyboard",me=(0,o.__)("Keyboard input");[s,p,f,k,z,j,G,ee,re,ie,{name:ue,title:me,tagName:"kbd",className:null,edit:({isActive:e,value:o,onChange:a,onFocus:c})=>(0,n.createElement)(r.RichTextToolbarButton,{icon:se,title:me,onClick:function(){a((0,t.toggleFormat)(o,{type:ue})),c()},isActive:e})}].forEach((({name:e,...n})=>(0,t.registerFormatType)(e,n))),(window.wp=window.wp||{}).formatLibrary=e}();
|
changelog.txt
CHANGED
@@ -1,277 +1,647 @@
|
|
1 |
== Changelog ==
|
2 |
|
3 |
-
= 11.8.
|
4 |
|
5 |
-
### Enhancements
|
6 |
-
|
7 |
-
#### Block Library
|
8 |
-
- Add spacing controls to all heading blocks. ([35772](https://github.com/WordPress/gutenberg/pull/35772))
|
9 |
-
- Enable slash inserter for heading, list, and quote. ([35360](https://github.com/WordPress/gutenberg/pull/35360))
|
10 |
-
- Unify theme block placeholder content. ([35517](https://github.com/WordPress/gutenberg/pull/35517))
|
11 |
-
- Buttons: Add gap and vertical margin support. ([34546](https://github.com/WordPress/gutenberg/pull/34546))
|
12 |
-
- Categories: Add support for showing only top-level categories. ([35726](https://github.com/WordPress/gutenberg/pull/35726))
|
13 |
-
- Column: Allow the specification of blocks allowed within columns. ([35342](https://github.com/WordPress/gutenberg/pull/35342))
|
14 |
-
- Comment Content Block: Add typography, color and padding support. ([35183](https://github.com/WordPress/gutenberg/pull/35183))
|
15 |
-
- Cover: Add allowedBlocks and TemplateLock attributes in Cover Block. ([31326](https://github.com/WordPress/gutenberg/pull/31326))
|
16 |
-
- Cover: Add option to set opacity when background colour used. ([35065](https://github.com/WordPress/gutenberg/pull/35065))
|
17 |
-
- Cover: Allow setting the height from the placeholder state. ([35068](https://github.com/WordPress/gutenberg/pull/35068))
|
18 |
-
- Cover: Change dimRatio to 50 if media added and dimRatio is set to 100. ([35789](https://github.com/WordPress/gutenberg/pull/35789))
|
19 |
-
- Cover: Only use white text when the background of the cover block is dark. ([33541](https://github.com/WordPress/gutenberg/pull/33541))
|
20 |
-
- Cover: Use the description in the placeholder. ([34970](https://github.com/WordPress/gutenberg/pull/34970))
|
21 |
-
- Embed: Add Pinterest as an embed provider. ([34895](https://github.com/WordPress/gutenberg/pull/34895))
|
22 |
-
- Feature Image: Add spacing controls to the featured image block. ([35775](https://github.com/WordPress/gutenberg/pull/35775))
|
23 |
-
- Featured image and Image: Remove descendent space. ([35466](https://github.com/WordPress/gutenberg/pull/35466))
|
24 |
-
- Gallery Block: Get media data in a single request. ([34389](https://github.com/WordPress/gutenberg/pull/34389))
|
25 |
-
- Heading: Autogenerate heading anchors. ([30825](https://github.com/WordPress/gutenberg/pull/30825))
|
26 |
-
- Quote: Update deprecation to expect style block supports. ([35615](https://github.com/WordPress/gutenberg/pull/35615))
|
27 |
-
- Page List: Show empty placeholder if no items. ([35441](https://github.com/WordPress/gutenberg/pull/35441))
|
28 |
-
- Post Date: Add more typography options. ([35422](https://github.com/WordPress/gutenberg/pull/35422))
|
29 |
-
- Post Comment Author: Add link settings and block supports. ([35595](https://github.com/WordPress/gutenberg/pull/35595))
|
30 |
-
- Post Comment Date: Add link setting and block supports. ([35112](https://github.com/WordPress/gutenberg/pull/35112))
|
31 |
-
- Quote: Added a "plain" style for quote blocks. ([29856](https://github.com/WordPress/gutenberg/pull/29856))
|
32 |
-
- Search: Enable inheritance in search block. ([35723](https://github.com/WordPress/gutenberg/pull/35723))
|
33 |
-
- Site Logo: Add a basic example to the site logo block. ([35588](https://github.com/WordPress/gutenberg/pull/35588))
|
34 |
-
- Site Logo: Move the Reset button to the Replace menu dropdown. ([35372](https://github.com/WordPress/gutenberg/pull/35372))
|
35 |
-
- Site Logo: placeholder tweaks. ([35397](https://github.com/WordPress/gutenberg/pull/35397))
|
36 |
-
- Site Tagline: Add fontStyle control to Site Tagline block. ([35507](https://github.com/WordPress/gutenberg/pull/35507))
|
37 |
-
- Site Tagline: Add wide + full support to the site tagline block. ([35589](https://github.com/WordPress/gutenberg/pull/35589))
|
38 |
-
- Site Title: Add basic example to site-title block. ([35590](https://github.com/WordPress/gutenberg/pull/35590))
|
39 |
-
- Site Logo: Remove "Reset" button icon. ([35434](https://github.com/WordPress/gutenberg/pull/35434))
|
40 |
-
- Social Icons: Add top and bottom margin support. ([35374](https://github.com/WordPress/gutenberg/pull/35374))
|
41 |
-
- Social Links: Polish logos only style. ([35586](https://github.com/WordPress/gutenberg/pull/35586))
|
42 |
-
|
43 |
-
#### Design Tools
|
44 |
-
- ToolsPanel: Switch to plus icon when no controls present in panel body. ([34107](https://github.com/WordPress/gutenberg/pull/34107))
|
45 |
-
- Block Supports: Add panel specific className. ([35793](https://github.com/WordPress/gutenberg/pull/35793))
|
46 |
-
- Block Supports: Switch dimensions inspector controls slot to bubble virtually. ([34725](https://github.com/WordPress/gutenberg/pull/34725))
|
47 |
-
- Inspector Controls: Resort the order of the design tools associated with styles hooks. ([35574](https://github.com/WordPress/gutenberg/pull/35574))
|
48 |
-
|
49 |
-
#### Global Styles
|
50 |
-
- Allow users to store duotone data. ([35318](https://github.com/WordPress/gutenberg/pull/35318))
|
51 |
-
- Allow child theme.json to be merged with parent theme.json. ([35459](https://github.com/WordPress/gutenberg/pull/35459))
|
52 |
-
- Extract the three color panels to their own global styles view. ([35400](https://github.com/WordPress/gutenberg/pull/35400))
|
53 |
-
- Font family: Switch from CSS Custom Property to classes. ([31910](https://github.com/WordPress/gutenberg/pull/31910))
|
54 |
-
- Move the global styles reset action to a dropdown menu. ([35559](https://github.com/WordPress/gutenberg/pull/35559))
|
55 |
-
- Update descriptions for the different screens under global styles. ([35429](https://github.com/WordPress/gutenberg/pull/35429))
|
56 |
-
- Update the global styles sidebar's root view to use Card components. ([35547](https://github.com/WordPress/gutenberg/pull/35547))
|
57 |
-
- Use text color to render the Aa preview in global styles. ([35631](https://github.com/WordPress/gutenberg/pull/35631))
|
58 |
-
|
59 |
-
#### Theming
|
60 |
-
- Add [data-block] to appender. ([35356](https://github.com/WordPress/gutenberg/pull/35356))
|
61 |
-
- Enable theme supports automatically for FSE theme. ([35593](https://github.com/WordPress/gutenberg/pull/35593))
|
62 |
-
- Remove default padding/margin on the body of the page and editor canvas. ([35421](https://github.com/WordPress/gutenberg/pull/35421))
|
63 |
-
- Support title in templateParts. ([35626](https://github.com/WordPress/gutenberg/pull/35626))
|
64 |
-
- CSS: Add a reset for image heights. ([30092](https://github.com/WordPress/gutenberg/pull/30092))
|
65 |
-
|
66 |
-
#### Patterns
|
67 |
-
- Increase number of items per page for default Query Loop Block. ([35603](https://github.com/WordPress/gutenberg/pull/35603))
|
68 |
-
- Featured patterns from pattern directory. ([35115](https://github.com/WordPress/gutenberg/pull/35115))
|
69 |
-
|
70 |
-
#### Block Editor
|
71 |
-
- Add animations for insertion point, dropzone, and other elements. ([33132](https://github.com/WordPress/gutenberg/pull/33132))
|
72 |
-
- Adjust Link UI visual styling. ([35414](https://github.com/WordPress/gutenberg/pull/35414))
|
73 |
-
- Add some top margin. ([35717](https://github.com/WordPress/gutenberg/pull/35717))
|
74 |
-
- Show ellipsis menu in the List View. ([35170](https://github.com/WordPress/gutenberg/pull/35170))
|
75 |
-
|
76 |
-
#### Template Editor
|
77 |
-
- Add more options to template areas in template details. ([35577](https://github.com/WordPress/gutenberg/pull/35577))
|
78 |
-
- Add template areas to template inspector. ([35239](https://github.com/WordPress/gutenberg/pull/35239))
|
79 |
-
- Add template details to template parts. ([35444](https://github.com/WordPress/gutenberg/pull/35444))
|
80 |
-
- Align the layout of the template card with the block card. ([35391](https://github.com/WordPress/gutenberg/pull/35391))
|
81 |
-
- Update site editor block placeholder styling. ([35513](https://github.com/WordPress/gutenberg/pull/35513))
|
82 |
-
- Use a dark background for the site editor. ([35520](https://github.com/WordPress/gutenberg/pull/35520))
|
83 |
-
|
84 |
-
#### Components
|
85 |
-
- Add shortcut provider. ([35652](https://github.com/WordPress/gutenberg/pull/35652))
|
86 |
-
- Iterate on the design of the colors and gradients panel. ([35535](https://github.com/WordPress/gutenberg/pull/35535))
|
87 |
-
- Navigator: Update `Navigator` styling to facilitate sticky positioning. ([35518](https://github.com/WordPress/gutenberg/pull/35518))
|
88 |
-
- Repositioned RangeControl tooltip and adjusted image zoom control dropdown height. ([27374](https://github.com/WordPress/gutenberg/pull/27374))
|
89 |
-
- Remove segmented control vertical separators. ([35497](https://github.com/WordPress/gutenberg/pull/35497))
|
90 |
-
- Storybook: Add RTL switcher to toolbar. ([35711](https://github.com/WordPress/gutenberg/pull/35711))
|
91 |
-
- Storybook: Add story for TypographyPanel. ([35293](https://github.com/WordPress/gutenberg/pull/35293))
|
92 |
-
- Storybook: Enable Controls and disable Knobs by default. ([35682](https://github.com/WordPress/gutenberg/pull/35682))
|
93 |
-
- Storybook: Remove outdated decorator configuration. ([35678](https://github.com/WordPress/gutenberg/pull/35678))
|
94 |
-
- Support "any" step in NumberControl and RangeControl. ([34542](https://github.com/WordPress/gutenberg/pull/34542))
|
95 |
-
- ToggleGroupControl: Allow custom aria-label. ([35423](https://github.com/WordPress/gutenberg/pull/35423))
|
96 |
-
- Update range control metrics. ([35540](https://github.com/WordPress/gutenberg/pull/35540))
|
97 |
-
- Update FontSize control. ([35395](https://github.com/WordPress/gutenberg/pull/35395))
|
98 |
-
|
99 |
-
#### Packages
|
100 |
-
- Create Block: Add PascalCase slug to create-block template strings. ([35462](https://github.com/WordPress/gutenberg/pull/35462))
|
101 |
-
- Create Block: Allow local directories to be passed to --template as relative paths. ([35645](https://github.com/WordPress/gutenberg/pull/35645))
|
102 |
-
- Test Setup: Add more-complete mocks of common timer functions. ([35368](https://github.com/WordPress/gutenberg/pull/35368))
|
103 |
-
- Scripts: Allow customization of the ARTIFACTS_PATH via WP_ARTIFACTS_PATH env var. ([35371](https://github.com/WordPress/gutenberg/pull/35371))
|
104 |
-
|
105 |
-
|
106 |
-
### Accessibility
|
107 |
-
- Rich text popovers: Move to block tools to fix tab order. ([34956](https://github.com/WordPress/gutenberg/pull/34956))
|
108 |
-
- Save button: Prevent focus loss. ([34731](https://github.com/WordPress/gutenberg/pull/34731))
|
109 |
-
|
110 |
-
### Performance
|
111 |
-
|
112 |
-
#### Global Styles
|
113 |
-
- Pass only the data the site editor uses. ([35458](https://github.com/WordPress/gutenberg/pull/35458))
|
114 |
-
- Use a context provider for global styles configuration. ([35622](https://github.com/WordPress/gutenberg/pull/35622))
|
115 |
-
|
116 |
-
### Bug Fixes
|
117 |
-
|
118 |
-
#### Block Library
|
119 |
-
- Block Settings: Don't render 'Move to' if the block cannot be moved. ([35463](https://github.com/WordPress/gutenberg/pull/35463))
|
120 |
-
- Cover: Update placeholder minHeight style to support non-px units. ([35614](https://github.com/WordPress/gutenberg/pull/35614))
|
121 |
-
- Cover: Update 'templateLock' attribute. ([35671](https://github.com/WordPress/gutenberg/pull/35671))
|
122 |
-
- Featured Image: Center placeholder chip contents. ([35417](https://github.com/WordPress/gutenberg/pull/35417))
|
123 |
-
- Heading: Fix undo/redo "trap". ([35767](https://github.com/WordPress/gutenberg/pull/35767))
|
124 |
-
- Heading: Remove anchor map when block unmounts. ([35761](https://github.com/WordPress/gutenberg/pull/35761))
|
125 |
-
- Site Logo: Fix site logo block on dark backgrounds. ([35718](https://github.com/WordPress/gutenberg/pull/35718))
|
126 |
-
|
127 |
-
#### i18n
|
128 |
-
- Fix HelpHub link i18n for page-jumps. ([35404](https://github.com/WordPress/gutenberg/pull/35404))
|
129 |
-
- Fix template part block untranslated strings. ([35715](https://github.com/WordPress/gutenberg/pull/35715))
|
130 |
-
- Translation note for Home/end to avoid mistranslations. ([35669](https://github.com/WordPress/gutenberg/pull/35669))
|
131 |
-
|
132 |
-
#### Packages
|
133 |
-
- Server Site Render: Prevent empty renders in ServerSideRender component caused by changing props while already fetching markup. ([35433](https://github.com/WordPress/gutenberg/pull/35433))
|
134 |
-
- Rich text: formats: allow format to filter value when changing tag name ([35516](https://github.com/WordPress/gutenberg/pull/35516/files))
|
135 |
-
|
136 |
-
#### Components
|
137 |
-
- Color Picker: Fix some issues on the color picker component; Remove tinycolor2;. ([35562](https://github.com/WordPress/gutenberg/pull/35562))
|
138 |
-
- Navigator: Hide horizontal overflow in `Navigator`. ([35332](https://github.com/WordPress/gutenberg/pull/35332))
|
139 |
-
- Popover: Fix __unstableBoundaryParent. ([35082](https://github.com/WordPress/gutenberg/pull/35082))
|
140 |
-
- RawHTML component: Allow multiple children. ([35532](https://github.com/WordPress/gutenberg/pull/35532))
|
141 |
-
- Rich text: Fix internal paste across multiline and single line instances. ([35416](https://github.com/WordPress/gutenberg/pull/35416))
|
142 |
-
- Toggle Group Control: Fix visual state when no option is selected. ([35545](https://github.com/WordPress/gutenberg/pull/35545))
|
143 |
-
- Toggle Group Control: Fixed condition to show separator correctly. ([35409](https://github.com/WordPress/gutenberg/pull/35409))
|
144 |
-
- Toogle Group Control: Fix `ToggleGroupControlOption` not passing `ref` to the underlying element. ([35546](https://github.com/WordPress/gutenberg/pull/35546))
|
145 |
-
- Tooltip: For Tooltips, prevent emitting events to child elements if they are disabled. ([35254](https://github.com/WordPress/gutenberg/pull/35254))
|
146 |
-
- Tooltip: Remove extra comma character from Tooltip when underlying component is disabled. ([35247](https://github.com/WordPress/gutenberg/pull/35247))
|
147 |
-
|
148 |
-
#### Themes
|
149 |
-
- Custom Templates: Use "title" from the theme.json. ([35592](https://github.com/WordPress/gutenberg/pull/35592))
|
150 |
-
- Elements block support: Fix link color rendering on site front end. ([35446](https://github.com/WordPress/gutenberg/pull/35446))
|
151 |
-
- Move the link color styles to the footer. ([35425](https://github.com/WordPress/gutenberg/pull/35425))
|
152 |
-
- Reset margin for all children of flow layouts. ([35426](https://github.com/WordPress/gutenberg/pull/35426))
|
153 |
-
|
154 |
-
#### Template Editor
|
155 |
-
- Use slug as template parts area item key. ([35796](https://github.com/WordPress/gutenberg/pull/35796))
|
156 |
-
- Fix missing titles in general areas. ([35657](https://github.com/WordPress/gutenberg/pull/35657))
|
157 |
-
|
158 |
-
#### Block API
|
159 |
-
- Blocks: Apply the most recent filters to previously registered blocks. ([34299](https://github.com/WordPress/gutenberg/pull/34299))
|
160 |
-
- Fix class serialization of font size and colors in dynamic blocks that use block supports. ([35751](https://github.com/WordPress/gutenberg/pull/35751))
|
161 |
-
|
162 |
-
#### Design Tools
|
163 |
-
- Border Radius Control: Fix undefined value on first click into RangeControl. ([35651](https://github.com/WordPress/gutenberg/pull/35651))
|
164 |
|
165 |
-
#### Block Editor
|
166 |
-
- Fix updating the block list after block removal. ([35721](https://github.com/WordPress/gutenberg/pull/35721))
|
167 |
-
- Fix sibling inserter animation. ([35729](https://github.com/WordPress/gutenberg/pull/35729))
|
168 |
-
- Inserter: Fix gap between Search and Tabs. ([35537](https://github.com/WordPress/gutenberg/pull/35537))
|
169 |
-
- Saving post: Transparent disabled button. ([35542](https://github.com/WordPress/gutenberg/pull/35542))
|
170 |
-
- FSE: Coding standards: DOCTYPE should be the first line/character of any HTML document. ([35442](https://github.com/WordPress/gutenberg/pull/35442))
|
171 |
-
- [Block Editor]: Fix displaying only the none alignment option ([35822](https://github.com/WordPress/gutenberg/pull/35822))
|
172 |
|
173 |
-
|
174 |
-
- Fix preloading middleware referencing stale data for OPTIONS requests. ([35527](https://github.com/WordPress/gutenberg/pull/35527))
|
175 |
|
176 |
-
|
177 |
-
- Fix expand and collapse when the icon is clicked. ([35526](https://github.com/WordPress/gutenberg/pull/35526))
|
178 |
|
179 |
-
#### Global Styles
|
180 |
-
- Fix presets that use a callback to validate user data. ([35255](https://github.com/WordPress/gutenberg/pull/35255))
|
181 |
-
|
182 |
-
#### CSS & Styling
|
183 |
-
- Remove font size classes that are enqueued in the global stylesheet. ([35182](https://github.com/WordPress/gutenberg/pull/35182))
|
184 |
|
185 |
-
#### Block API
|
186 |
-
- Allow more than 1 block stylesheets. ([32510](https://github.com/WordPress/gutenberg/pull/32510))
|
187 |
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
-
|
196 |
-
-
|
197 |
-
-
|
198 |
-
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
- Add
|
215 |
-
- Add
|
216 |
-
- Add
|
217 |
-
-
|
218 |
-
-
|
219 |
-
-
|
220 |
-
-
|
221 |
-
|
222 |
-
|
223 |
-
-
|
224 |
-
-
|
225 |
-
-
|
226 |
-
-
|
227 |
-
-
|
228 |
-
-
|
229 |
-
-
|
230 |
-
-
|
231 |
-
-
|
232 |
-
-
|
233 |
-
-
|
234 |
-
-
|
235 |
-
-
|
236 |
-
|
237 |
-
|
238 |
-
-
|
239 |
-
-
|
240 |
-
|
241 |
-
|
242 |
-
-
|
243 |
-
-
|
244 |
-
-
|
245 |
-
-
|
246 |
-
-
|
247 |
-
|
248 |
-
|
249 |
-
-
|
250 |
-
-
|
251 |
-
-
|
252 |
-
|
253 |
-
|
254 |
-
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
-
|
264 |
-
|
265 |
-
|
266 |
-
-
|
267 |
-
-
|
268 |
-
|
269 |
-
|
270 |
-
- Enable
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
|
276 |
|
277 |
= 11.7.1 =
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 11.8.1 =
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
+
### Various
|
|
|
8 |
|
9 |
+
- Keep a copy of anchor ref to preserve highlighted text selection. ([36263](https://github.com/WordPress/gutenberg/pull/36263))
|
|
|
10 |
|
|
|
|
|
|
|
|
|
|
|
11 |
|
|
|
|
|
12 |
|
13 |
+
|
14 |
+
|
15 |
+
= 11.9.0-rc.1 =
|
16 |
+
|
17 |
+
### Features
|
18 |
+
|
19 |
+
#### Block Library
|
20 |
+
- Add Media File and Attachment Page options to the native Image block Link To menu. ([34846](https://github.com/WordPress/gutenberg/pull/34846))
|
21 |
+
- Add new Comment Reply Link block. ([35774](https://github.com/WordPress/gutenberg/pull/35774))
|
22 |
+
- Add new Edit Comment Link block. ([35965](https://github.com/WordPress/gutenberg/pull/35965))
|
23 |
+
- Site Editor: Add Comment Avatar Core Block. ([35396](https://github.com/WordPress/gutenberg/pull/35396))
|
24 |
+
- Site Editor: Add new Comments Query Loop block. ([35231](https://github.com/WordPress/gutenberg/pull/35231))
|
25 |
+
|
26 |
+
#### Block Editor
|
27 |
+
- Enable native editor onboarding features globally. ([35201](https://github.com/WordPress/gutenberg/pull/35201))
|
28 |
+
|
29 |
+
|
30 |
+
### Enhancements
|
31 |
+
|
32 |
+
- Disable Xdebug by default unless specified by user. ([34324](https://github.com/WordPress/gutenberg/pull/34324))
|
33 |
+
- Improve the initial loading of the site editor. ([36044](https://github.com/WordPress/gutenberg/pull/36044))
|
34 |
+
- StripHTML - preserve leading and trailing spaces and strip script and on* attributes. ([35539](https://github.com/WordPress/gutenberg/pull/35539))
|
35 |
+
- Remove visual clue from text alignment toolbar. ([35922](https://github.com/WordPress/gutenberg/pull/35922))
|
36 |
+
- Add `flex-wrap` control to `flex` layout. ([36003](https://github.com/WordPress/gutenberg/pull/36003))
|
37 |
+
|
38 |
+
#### Block Library
|
39 |
+
- Add alignment option to the Comment Edit Link block. ([36033](https://github.com/WordPress/gutenberg/pull/36033))
|
40 |
+
- Add featured transforms in Link Control for Navigation Link items. ([35857](https://github.com/WordPress/gutenberg/pull/35857))
|
41 |
+
- Add flex layout to Buttons block and new layout type. ([35819](https://github.com/WordPress/gutenberg/pull/35819))
|
42 |
+
- Add spacing controls to Post Author block. ([35963](https://github.com/WordPress/gutenberg/pull/35963))
|
43 |
+
- Add spacing controls to Post Excerpt. ([35959](https://github.com/WordPress/gutenberg/pull/35959))
|
44 |
+
- Add create new menu button to nav block. ([36245](https://github.com/WordPress/gutenberg/pull/36245))
|
45 |
+
- Code block: Add support for padding, color & border styles. ([27582](https://github.com/WordPress/gutenberg/pull/27582))
|
46 |
+
- Columns: Add padding support. ([35701](https://github.com/WordPress/gutenberg/pull/35701))
|
47 |
+
- Comment Author Name: Add spacing to have same options as Post Author Name. ([36213](https://github.com/WordPress/gutenberg/pull/36213))
|
48 |
+
- Deprecate the Post Comment block. ([36032](https://github.com/WordPress/gutenberg/pull/36032))
|
49 |
+
- Embed: Add Wolfram Cloud as an embed provider. ([35656](https://github.com/WordPress/gutenberg/pull/35656))
|
50 |
+
- Gallery block: Replace gallery experimental setting with a check for use_balanceTags. ([34979](https://github.com/WordPress/gutenberg/pull/34979))
|
51 |
+
- Image Block: Add data-id attribute on server side render for core galleries. ([35975](https://github.com/WordPress/gutenberg/pull/35975))
|
52 |
+
- Navigation Block: Add missing menu item attributes to core/navigation. ([35634](https://github.com/WordPress/gutenberg/pull/35634))
|
53 |
+
- Navigation: Add delete nav menu button. ([35981](https://github.com/WordPress/gutenberg/pull/35981))
|
54 |
+
- Navigation: Create nav menu on pattern insertion or when the block has uncontrolled inner blocks. ([36024](https://github.com/WordPress/gutenberg/pull/36024))
|
55 |
+
- Navigation: Use a single placeholder for the block. ([36023](https://github.com/WordPress/gutenberg/pull/36023))
|
56 |
+
- Page List: Create a JS version for the editor. ([31670](https://github.com/WordPress/gutenberg/pull/31670))
|
57 |
+
- Post Comment Author: Add alignment options. ([36045](https://github.com/WordPress/gutenberg/pull/36045))
|
58 |
+
- Post Comments: Even out the top margin inside the block. ([35887](https://github.com/WordPress/gutenberg/pull/35887))
|
59 |
+
- Post Excerpt: Don't print the wrapper when there is no excerpt. ([35749](https://github.com/WordPress/gutenberg/pull/35749))
|
60 |
+
- Post Title: Return no markup if title is empty. ([35861](https://github.com/WordPress/gutenberg/pull/35861))
|
61 |
+
- Save Navigation Block data to a wp_navigation post type. ([35746](https://github.com/WordPress/gutenberg/pull/35746))
|
62 |
+
- Search: Add contextual defaults when inserted in Navigation block. ([36125](https://github.com/WordPress/gutenberg/pull/36125))
|
63 |
+
- Try using flex layout on the Navigation block. ([36169](https://github.com/WordPress/gutenberg/pull/36169))
|
64 |
+
- Update navigation block entity automatic name generation and refine naming UI. ([36238](https://github.com/WordPress/gutenberg/pull/36238))
|
65 |
+
|
66 |
+
#### Accessibility
|
67 |
+
- Add announcement on formatting change for screen readers. ([35896](https://github.com/WordPress/gutenberg/pull/35896))
|
68 |
+
- Add aria-current to navigation link, submenu, page list. ([35880](https://github.com/WordPress/gutenberg/pull/35880))
|
69 |
+
- Full Site Editing: Use SearchControl component inside nav menu. ([36011](https://github.com/WordPress/gutenberg/pull/36011))
|
70 |
+
- Improve focus styles for Link UI preview title. ([35853](https://github.com/WordPress/gutenberg/pull/35853))
|
71 |
+
- Site Editor: Enable the "Save" keyboard shortcut. ([36138](https://github.com/WordPress/gutenberg/pull/36138))
|
72 |
+
|
73 |
+
#### Block Editor
|
74 |
+
- Enable rich previews in the Link UI for the Site Editor. ([35951](https://github.com/WordPress/gutenberg/pull/35951))
|
75 |
+
- Try: Show drag slot instead of hiding the item being dragged. ([33950](https://github.com/WordPress/gutenberg/pull/33950))
|
76 |
+
- Update Link UI design for preview action buttons to use icons for edit and unlink. ([35833](https://github.com/WordPress/gutenberg/pull/35833))
|
77 |
+
|
78 |
+
#### Full Site Editing
|
79 |
+
- Move and rename the site editor menu item. ([36064](https://github.com/WordPress/gutenberg/pull/36064))
|
80 |
+
- Use Heading component on NavigationMenu and NavigationGroup components. ([36009](https://github.com/WordPress/gutenberg/pull/36009))
|
81 |
+
|
82 |
+
#### Components
|
83 |
+
- Add duotone description. ([36018](https://github.com/WordPress/gutenberg/pull/36018))
|
84 |
+
- ToolsPanel: Update typography panel layout. ([35911](https://github.com/WordPress/gutenberg/pull/35911))
|
85 |
+
|
86 |
+
#### Template Editor
|
87 |
+
- Add resizer to template part focus mode. ([35728](https://github.com/WordPress/gutenberg/pull/35728))
|
88 |
+
- Auto resize the height of template part focus mode. ([35974](https://github.com/WordPress/gutenberg/pull/35974))
|
89 |
+
|
90 |
+
#### Global Styles
|
91 |
+
- Remove the duplicated title in background, text and link views in Global Styles. ([35583](https://github.com/WordPress/gutenberg/pull/35583))
|
92 |
+
- Typography: Switch to ToolsPanel for block support UI. ([33744](https://github.com/WordPress/gutenberg/pull/33744))
|
93 |
+
|
94 |
+
#### Design Tools
|
95 |
+
- Enable transparency for duotone. ([34130](https://github.com/WordPress/gutenberg/pull/34130))
|
96 |
+
- Typography block support: Add typography support and defaults. ([34064](https://github.com/WordPress/gutenberg/pull/34064))
|
97 |
+
|
98 |
+
#### Media
|
99 |
+
- Remove "security" verbiage from warning when filetype does not pass on upload. ([36226](https://github.com/WordPress/gutenberg/pull/36226))
|
100 |
+
|
101 |
+
#### Patterns
|
102 |
+
- [Patterns]: Add a flag to hide patterns from UI. ([36108](https://github.com/WordPress/gutenberg/pull/36108))
|
103 |
+
|
104 |
+
#### Themes
|
105 |
+
- Remove experimental feature notice. ([36083](https://github.com/WordPress/gutenberg/pull/36083))
|
106 |
+
|
107 |
+
#### Testing
|
108 |
+
- Scripts: Increase timeout for end-to-end tests. ([35983](https://github.com/WordPress/gutenberg/pull/35983))
|
109 |
+
|
110 |
+
#### REST API
|
111 |
+
- URL Details: Update regex to include `og:Description`. ([35875](https://github.com/WordPress/gutenberg/pull/35875))
|
112 |
+
|
113 |
+
|
114 |
+
### New APIs
|
115 |
+
|
116 |
+
#### Global Styles
|
117 |
+
- Add API to access global settings, styles, and stylesheet. ([34843](https://github.com/WordPress/gutenberg/pull/34843))
|
118 |
+
|
119 |
+
#### Block Library
|
120 |
+
- Inner blocks: Edit/save symmetry + stabilise API. ([26031](https://github.com/WordPress/gutenberg/pull/26031))
|
121 |
+
|
122 |
+
|
123 |
+
### Bug Fixes
|
124 |
+
|
125 |
+
- Allow moving metaboxes to previously empty area. ([25187](https://github.com/WordPress/gutenberg/pull/25187))
|
126 |
+
- Avoid showing deleted records in editor saving flow. ([36027](https://github.com/WordPress/gutenberg/pull/36027))
|
127 |
+
- BaseControl: Help text id has undefined value if no id is passed to component. ([35899](https://github.com/WordPress/gutenberg/pull/35899))
|
128 |
+
- Change `console.error` to `console.warn` for enqueued styles in the editor. ([35914](https://github.com/WordPress/gutenberg/pull/35914))
|
129 |
+
- Core Data uses hardcoded baseURL prefix for taxonomies and post types. ([35850](https://github.com/WordPress/gutenberg/pull/35850))
|
130 |
+
- Do not translate HTML tag. ([35930](https://github.com/WordPress/gutenberg/pull/35930))
|
131 |
+
- Disable ability to edit menus via `Appearance -> Navigation Menus` for non-FSE themes. ([36257](https://github.com/WordPress/gutenberg/pull/36257))
|
132 |
+
- Fix crash from calls to `undefined` functions. ([36248](https://github.com/WordPress/gutenberg/pull/36248))
|
133 |
+
- Fix WPCS lint errors in global styles. ([36058](https://github.com/WordPress/gutenberg/pull/36058))
|
134 |
+
- Fix getPxFromCssUnit test stability and test that memoized function works correctly. ([35939](https://github.com/WordPress/gutenberg/pull/35939))
|
135 |
+
- Fix: Rest global styles controller accessing configuration that may not exist. ([36047](https://github.com/WordPress/gutenberg/pull/36047))
|
136 |
+
- Make saveEditedEntityRecord use the entity key when available. ([36212](https://github.com/WordPress/gutenberg/pull/36212))
|
137 |
+
- Prevent PHP notice from block-supports elements. ([35836](https://github.com/WordPress/gutenberg/pull/35836))
|
138 |
+
- Revert "Post Content: Fix float clearing on entry content (#35958)". ([36004](https://github.com/WordPress/gutenberg/pull/36004))
|
139 |
+
- Try ensuring the item after post content clears floats. ([36006](https://github.com/WordPress/gutenberg/pull/36006))
|
140 |
+
- Unhook _block_template_render_title_tag. ([36133](https://github.com/WordPress/gutenberg/pull/36133))
|
141 |
+
|
142 |
+
#### Block Library
|
143 |
+
- Classic Block: Fix select all blocks side effect. ([35999](https://github.com/WordPress/gutenberg/pull/35999))
|
144 |
+
- Column block: Only add flex-basis if width contains a number. ([35831](https://github.com/WordPress/gutenberg/pull/35831))
|
145 |
+
- Comment Template: Move inner blocks container to separate components. ([36174](https://github.com/WordPress/gutenberg/pull/36174))
|
146 |
+
- Blocks: Fix relative URLs for inlined styles. ([35538](https://github.com/WordPress/gutenberg/pull/35538))
|
147 |
+
- Fix controlled inner blocks parent block attributes updates. ([35827](https://github.com/WordPress/gutenberg/pull/35827))
|
148 |
+
- Fix incorrect attributes definitions. ([36140](https://github.com/WordPress/gutenberg/pull/36140))
|
149 |
+
- Gallery block: Only show the gallery upload error message if mixed multiple files uploaded. ([35790](https://github.com/WordPress/gutenberg/pull/35790))
|
150 |
+
- Gallery block: Remove the arbitrary alt text that is added to gallery images. ([35936](https://github.com/WordPress/gutenberg/pull/35936))
|
151 |
+
- Heading: Avoid error on split when the paragraph isn't registered. ([35871](https://github.com/WordPress/gutenberg/pull/35871))
|
152 |
+
- Navigation Submenu: Fix PHP notice. ([35984](https://github.com/WordPress/gutenberg/pull/35984))
|
153 |
+
- Navigation overlay menu: Fix submenu spacing. ([35823](https://github.com/WordPress/gutenberg/pull/35823))
|
154 |
+
- Navigation: Fix dropdown indicator. ([36106](https://github.com/WordPress/gutenberg/pull/36106))
|
155 |
+
- Navigation: Fix issues with responsive justifications. ([35913](https://github.com/WordPress/gutenberg/pull/35913))
|
156 |
+
- Navigation: Fix justifications. ([36105](https://github.com/WordPress/gutenberg/pull/36105))
|
157 |
+
- Navigation: Fix padding for social links on mobile. ([35824](https://github.com/WordPress/gutenberg/pull/35824))
|
158 |
+
- Pattern block: Remove wrapping div. ([36090](https://github.com/WordPress/gutenberg/pull/36090))
|
159 |
+
- Post Comment: Handle the case where a comment does not exist. ([35810](https://github.com/WordPress/gutenberg/pull/35810))
|
160 |
+
- Post Content: Fix float clearing on entry content. ([35958](https://github.com/WordPress/gutenberg/pull/35958))
|
161 |
+
- Post Template Block: Move inner blocks container to separate component. ([35945](https://github.com/WordPress/gutenberg/pull/35945))
|
162 |
+
- Post Terms: Prevent the block from breaking on pages. ([35957](https://github.com/WordPress/gutenberg/pull/35957))
|
163 |
+
- Site Logo: Fix center alignment. ([35971](https://github.com/WordPress/gutenberg/pull/35971))
|
164 |
+
|
165 |
+
#### Components
|
166 |
+
- Fix ColorPalette className. ([36016](https://github.com/WordPress/gutenberg/pull/36016))
|
167 |
+
- Fix `<Text>` component text color value to correct color value for Link UI preview description text. ([35851](https://github.com/WordPress/gutenberg/pull/35851))
|
168 |
+
- Fix color list picker spacing to accomodate the new color picker. ([36017](https://github.com/WordPress/gutenberg/pull/36017))
|
169 |
+
- Fix unexpected movements, and closing on first click in the color picker. ([35670](https://github.com/WordPress/gutenberg/pull/35670))
|
170 |
+
- Fixes #34855 RangeControl style issue in RTL. ([35777](https://github.com/WordPress/gutenberg/pull/35777))
|
171 |
+
- Popover: Check anchorDocument default view before removing events. ([35832](https://github.com/WordPress/gutenberg/pull/35832))
|
172 |
+
- Storybook: Lazy load LTR/RTL styles for consistent specificity. ([35771](https://github.com/WordPress/gutenberg/pull/35771))
|
173 |
+
- fix/35709: Set admin color scheme to angle color picker. ([35908](https://github.com/WordPress/gutenberg/pull/35908))
|
174 |
+
|
175 |
+
#### Global Styles
|
176 |
+
- Fix navigation in global styles sidebar. ([36203](https://github.com/WordPress/gutenberg/pull/36203))
|
177 |
+
- Fix presets data for themes that do not provide any preset. ([36054](https://github.com/WordPress/gutenberg/pull/36054))
|
178 |
+
- Generate preset metadata for font-family in the site editor. ([36022](https://github.com/WordPress/gutenberg/pull/36022))
|
179 |
+
- Hotfix for leftovers of `WP_Theme_JSON_Resolver::Get_merged_data`. ([36173](https://github.com/WordPress/gutenberg/pull/36173))
|
180 |
+
- Lower the specificity of border & padding styles for the outline block style in the button block. ([35968](https://github.com/WordPress/gutenberg/pull/35968))
|
181 |
+
- Theme.json: Remove custom prefixes from properties that did not land in 5.8. ([34485](https://github.com/WordPress/gutenberg/pull/34485))
|
182 |
+
|
183 |
+
#### Block Editor
|
184 |
+
- Fix inserter with block pattern categories. ([36116](https://github.com/WordPress/gutenberg/pull/36116))
|
185 |
+
- Fix navigation block link control zero value in it. ([36198](https://github.com/WordPress/gutenberg/pull/36198))
|
186 |
+
- Fix the update of link and suggestions in LinkControl. ([32320](https://github.com/WordPress/gutenberg/pull/32320))
|
187 |
+
- Make Link UI inactive if selection extends beyond format bounds or encounters new link. ([35946](https://github.com/WordPress/gutenberg/pull/35946))
|
188 |
+
- Fix selection by holding shift key for nested blocks. ([35668](https://github.com/WordPress/gutenberg/pull/35668))
|
189 |
+
- Fix shift+click on a child block with its parent selected. ([35988](https://github.com/WordPress/gutenberg/pull/35988))
|
190 |
+
|
191 |
+
#### Design Tools
|
192 |
+
- Font Appearance: Improve consistency of label in Typography panel. ([35860](https://github.com/WordPress/gutenberg/pull/35860))
|
193 |
+
- Font Family Support: Fix skip serialization check. ([36073](https://github.com/WordPress/gutenberg/pull/36073))
|
194 |
+
- Navigation: Force text decoration styles on nav item in editor. ([35859](https://github.com/WordPress/gutenberg/pull/35859))
|
195 |
+
|
196 |
+
#### Template Editor
|
197 |
+
- Clear selected block when clicking outside in the template part focus mode. ([35816](https://github.com/WordPress/gutenberg/pull/35816))
|
198 |
+
- Templates: Only include templates for the current post types. ([35802](https://github.com/WordPress/gutenberg/pull/35802))
|
199 |
+
|
200 |
+
#### Plugin
|
201 |
+
- Fix fatal error in Site Logo block in WP 5.9. ([36195](https://github.com/WordPress/gutenberg/pull/36195))
|
202 |
+
|
203 |
+
#### Patterns
|
204 |
+
- Update unsaved navigation block flow. ([35976](https://github.com/WordPress/gutenberg/pull/35976))
|
205 |
+
|
206 |
+
#### Accessibility
|
207 |
+
- Try to communicate to screen readers that post title is textarea. ([35898](https://github.com/WordPress/gutenberg/pull/35898))
|
208 |
+
|
209 |
+
#### Full Site Editing
|
210 |
+
- Add fallback handling for plugins or themes using the Customizer. ([35877](https://github.com/WordPress/gutenberg/pull/35877))
|
211 |
+
|
212 |
+
#### Widgets Editor
|
213 |
+
- Fix layout styles not applying in widgets customizer. ([35865](https://github.com/WordPress/gutenberg/pull/35865))
|
214 |
+
|
215 |
+
#### CSS & Styling
|
216 |
+
- Editor defaults for themes with no editor styles and when user disables theme styles. ([35736](https://github.com/WordPress/gutenberg/pull/35736))
|
217 |
+
|
218 |
+
#### History
|
219 |
+
- Support disabling autosave for native Unsupported Block Editor. ([35639](https://github.com/WordPress/gutenberg/pull/35639))
|
220 |
+
|
221 |
+
|
222 |
+
### Performance
|
223 |
+
|
224 |
+
#### List View
|
225 |
+
- Fix pagedown/pageup and improve scrolling. ([36063](https://github.com/WordPress/gutenberg/pull/36063))
|
226 |
+
|
227 |
+
#### Block Editor
|
228 |
+
- Improve opening of the block inserter via manual token-based analysis of reusable blocks. ([35763](https://github.com/WordPress/gutenberg/pull/35763))
|
229 |
+
|
230 |
+
#### Widgets Editor
|
231 |
+
- List View: Avoid re-rendering all items on block focus. Enable persistent List View in the widget editor. ([35706](https://github.com/WordPress/gutenberg/pull/35706))
|
232 |
+
|
233 |
+
#### Accessibility
|
234 |
+
- List View: Render a fixed number of items. ([35230](https://github.com/WordPress/gutenberg/pull/35230))
|
235 |
+
|
236 |
+
|
237 |
+
### Experiments
|
238 |
+
|
239 |
+
#### Block Library
|
240 |
+
- Adds in basic styling for post comment form. ([35704](https://github.com/WordPress/gutenberg/pull/35704))
|
241 |
+
- Navigation Area block. ([36178](https://github.com/WordPress/gutenberg/pull/36178))
|
242 |
+
- Migrate classic menus to block-based menus on theme switch. ([36255](https://github.com/WordPress/gutenberg/pull/36255))
|
243 |
+
- Post Comments block: Hide the "Comments Closed" message. ([35743](https://github.com/WordPress/gutenberg/pull/35743))
|
244 |
+
- Mobile responsive navigation by default. ([35917](https://github.com/WordPress/gutenberg/pull/35917))
|
245 |
+
- Reword navigation color labels. ([35916](https://github.com/WordPress/gutenberg/pull/35916))
|
246 |
+
- Show the placeholder again when moving from a valid menu to non-existing menu. ([36210](https://github.com/WordPress/gutenberg/pull/36210))
|
247 |
+
- Provide a way to manage wp_navigation posts from wp-admin. ([36126](https://github.com/WordPress/gutenberg/pull/36126))
|
248 |
+
|
249 |
+
#### Global Styles
|
250 |
+
- Add a Global Styles endpoint and use it in the site editor. ([35801](https://github.com/WordPress/gutenberg/pull/35801))
|
251 |
+
- Fix: Crash when resetting user color palette. ([36233](https://github.com/WordPress/gutenberg/pull/36233))
|
252 |
+
- Fix: Show user colors on palette indicator. ([36232](https://github.com/WordPress/gutenberg/pull/36232))
|
253 |
+
- Migrate theme.json v1 to v2. ([36155](https://github.com/WordPress/gutenberg/pull/36155))
|
254 |
+
- Update: Show all color and gradient origins (core, theme, and user). ([35970](https://github.com/WordPress/gutenberg/pull/35970))
|
255 |
+
|
256 |
+
#### Full Site Editing
|
257 |
+
- Always display Customizer menu item. ([36168](https://github.com/WordPress/gutenberg/pull/36168))
|
258 |
+
- Revert "Always display Customizer menu item". ([36189](https://github.com/WordPress/gutenberg/pull/36189))
|
259 |
+
- Remove slug and status columns from templates list in Appearance > Templates. ([35996](https://github.com/WordPress/gutenberg/pull/35996))
|
260 |
+
|
261 |
+
#### REST API
|
262 |
+
- Improve unit test coverage for REST API menus endpoints.. ([36177](https://github.com/WordPress/gutenberg/pull/36177))
|
263 |
+
|
264 |
+
#### Navigation Screen
|
265 |
+
- Navigation Editor: Show a warning when trying to save unsupported blocks. ([35993](https://github.com/WordPress/gutenberg/pull/35993))
|
266 |
+
|
267 |
+
#### Reusable Blocks
|
268 |
+
- Editor: Multi-Entity Saving UI Improvements. ([35933](https://github.com/WordPress/gutenberg/pull/35933))
|
269 |
+
|
270 |
+
#### Components
|
271 |
+
- Update: Implement new color palette editor component. ([35783](https://github.com/WordPress/gutenberg/pull/35783))
|
272 |
+
|
273 |
+
#### Block Editor
|
274 |
+
- Split control for URL and Text within Link UI. ([33849](https://github.com/WordPress/gutenberg/pull/33849))
|
275 |
+
|
276 |
+
|
277 |
+
### Documentation
|
278 |
+
|
279 |
+
- Add Thunks Tutorial. ([36051](https://github.com/WordPress/gutenberg/pull/36051))
|
280 |
+
- Add a more detailed guide for react native development. ([35529](https://github.com/WordPress/gutenberg/pull/35529))
|
281 |
+
- Add usage documentation for Rich Text package. ([35885](https://github.com/WordPress/gutenberg/pull/35885))
|
282 |
+
- Added link to Ways to keep up with Gutenberg & Full Site Editing. ([36077](https://github.com/WordPress/gutenberg/pull/36077))
|
283 |
+
- Blocks: Add view script to block schema and documentation. ([36175](https://github.com/WordPress/gutenberg/pull/36175))
|
284 |
+
- Blocks: Document changes to style and editorStyle in `block.json`. ([36218](https://github.com/WordPress/gutenberg/pull/36218))
|
285 |
+
- Docs: Add Getting Started level for documentation. ([35891](https://github.com/WordPress/gutenberg/pull/35891))
|
286 |
+
- Docs: Add section about using the schema during development. ([35835](https://github.com/WordPress/gutenberg/pull/35835))
|
287 |
+
- Docs: Fix Typos in widgets/overview.md. ([36078](https://github.com/WordPress/gutenberg/pull/36078))
|
288 |
+
- Docs: Fix schema file URL. ([36157](https://github.com/WordPress/gutenberg/pull/36157))
|
289 |
+
- Docs: Improve Getting Started landing page. ([35893](https://github.com/WordPress/gutenberg/pull/35893))
|
290 |
+
- Docs: Theme.json - fix typo. ([36139](https://github.com/WordPress/gutenberg/pull/36139))
|
291 |
+
- Docs: Tweak organization for getting-started documentation. ([34091](https://github.com/WordPress/gutenberg/pull/34091))
|
292 |
+
- Docs: Update the recommendation for the cadence of npm releases. ([35925](https://github.com/WordPress/gutenberg/pull/35925))
|
293 |
+
- Env docs: Update wordpress-develop example to clarify src/build location. ([35978](https://github.com/WordPress/gutenberg/pull/35978))
|
294 |
+
- Fix a small typo in the "Getting started" documentation. ([36109](https://github.com/WordPress/gutenberg/pull/36109))
|
295 |
+
- Fix wording in the Authoring Experience documentation. ([35969](https://github.com/WordPress/gutenberg/pull/35969))
|
296 |
+
- Move create-block changelog entries back to Unreleased section. ([35886](https://github.com/WordPress/gutenberg/pull/35886))
|
297 |
+
- Release Docs: Remove consecutive RCs warning. ([35855](https://github.com/WordPress/gutenberg/pull/35855))
|
298 |
+
- Update Components CONTRIBUTING.md indentation. ([35866](https://github.com/WordPress/gutenberg/pull/35866))
|
299 |
+
- fix: Backtick added around `<textarea>` input tag in readme file. ([34813](https://github.com/WordPress/gutenberg/pull/34813))
|
300 |
+
- theme.json docs: Add missing settings & styles. ([36137](https://github.com/WordPress/gutenberg/pull/36137))
|
301 |
+
|
302 |
+
|
303 |
+
### Code Quality
|
304 |
+
|
305 |
+
- Add Theme's base global styles endpoint. ([35985](https://github.com/WordPress/gutenberg/pull/35985))
|
306 |
+
- Add alexstine as code owner for post-title. ([36056](https://github.com/WordPress/gutenberg/pull/36056))
|
307 |
+
- Add block.json schema to generated file. ([35843](https://github.com/WordPress/gutenberg/pull/35843))
|
308 |
+
- Add schemas package. ([35998](https://github.com/WordPress/gutenberg/pull/35998))
|
309 |
+
- Improvements for the global styles endpoint. ([36071](https://github.com/WordPress/gutenberg/pull/36071))
|
310 |
+
- Make sure tests are pure. ([36253](https://github.com/WordPress/gutenberg/pull/36253))
|
311 |
+
- Move getStablePath function into the wordrpess/url package. ([35992](https://github.com/WordPress/gutenberg/pull/35992))
|
312 |
+
- Remove "experimental" from URL details REST controller and promote to `v1` namespace. ([35915](https://github.com/WordPress/gutenberg/pull/35915))
|
313 |
+
- Remove GB prefixed functions from template part. ([36180](https://github.com/WordPress/gutenberg/pull/36180))
|
314 |
+
- Schemas: Theme.json - Add `title` to templateParts. ([36145](https://github.com/WordPress/gutenberg/pull/36145))
|
315 |
+
- Updates `WP_Theme_JSON_Resolver` and tests to be equal to core. ([36223](https://github.com/WordPress/gutenberg/pull/36223))
|
316 |
+
- Update: Use small button on tools panel toggle. ([35935](https://github.com/WordPress/gutenberg/pull/35935))
|
317 |
+
- block-editor store: Migrate to thunks. ([35720](https://github.com/WordPress/gutenberg/pull/35720))
|
318 |
+
- theme.json: Update test data. ([35883](https://github.com/WordPress/gutenberg/pull/35883))
|
319 |
+
|
320 |
+
#### Block Library
|
321 |
+
- Heading: Auto-generated anchors hide implementation details. ([35747](https://github.com/WordPress/gutenberg/pull/35747))
|
322 |
+
- Mark Post Comments as stable and Comments Query Loop as experimental. ([36132](https://github.com/WordPress/gutenberg/pull/36132))
|
323 |
+
- Mark Post Navigation Link and Term Description blocks as stable. ([36163](https://github.com/WordPress/gutenberg/pull/36163))
|
324 |
+
- Remove `post-` prefix from Comment Template inner blocks. ([36171](https://github.com/WordPress/gutenberg/pull/36171))
|
325 |
+
|
326 |
+
#### Global Styles
|
327 |
+
- Refactor theme.json migrations to be a single class. ([36182](https://github.com/WordPress/gutenberg/pull/36182))
|
328 |
+
- Remove locations we do not translate from `theme-i18n.json`. ([35881](https://github.com/WordPress/gutenberg/pull/35881))
|
329 |
+
- Update `theme.json` schema migrations. ([36154](https://github.com/WordPress/gutenberg/pull/36154))
|
330 |
+
|
331 |
+
#### Post Editor
|
332 |
+
- Refactor FlatTermSelector into a functional component. ([33459](https://github.com/WordPress/gutenberg/pull/33459))
|
333 |
+
- Typo: Translated site properties. ([36097](https://github.com/WordPress/gutenberg/pull/36097))
|
334 |
+
|
335 |
+
#### Components
|
336 |
+
- ToolsPanel: Use Grid component to handle layout. ([35621](https://github.com/WordPress/gutenberg/pull/35621))
|
337 |
+
- Update spacing in CircularOptionPicker. ([36014](https://github.com/WordPress/gutenberg/pull/36014))
|
338 |
+
|
339 |
+
#### Data Layer
|
340 |
+
- [data]: Rename types file from .d.ts to .ts. ([36062](https://github.com/WordPress/gutenberg/pull/36062))
|
341 |
+
|
342 |
+
#### CSS & Styling
|
343 |
+
- Remove invalid buttons block CSS property. ([33793](https://github.com/WordPress/gutenberg/pull/33793))
|
344 |
+
|
345 |
+
|
346 |
+
### Tools
|
347 |
+
|
348 |
+
- Remove @chrisvanpatten from CODEOWNERS. ([35937](https://github.com/WordPress/gutenberg/pull/35937))
|
349 |
+
|
350 |
+
#### Testing
|
351 |
+
- Add a method to disable auto-accepting dialogs. ([35828](https://github.com/WordPress/gutenberg/pull/35828))
|
352 |
+
- Skip broken widgets test. ([36239](https://github.com/WordPress/gutenberg/pull/36239))
|
353 |
+
- Skip flaky test for loading block stylesheets in iframe. ([35961](https://github.com/WordPress/gutenberg/pull/35961))
|
354 |
+
- Tests: Run block fixtures through KSES. ([35611](https://github.com/WordPress/gutenberg/pull/35611))
|
355 |
+
|
356 |
+
#### Block Library
|
357 |
+
- Mark FSE blocks as non experimental. ([35979](https://github.com/WordPress/gutenberg/pull/35979))
|
358 |
+
|
359 |
+
|
360 |
+
### Various
|
361 |
+
|
362 |
+
- Apply borders to canvas rather than other UI elements. ([31081](https://github.com/WordPress/gutenberg/pull/31081))
|
363 |
+
- Changes for FSE backport in core. ([36201](https://github.com/WordPress/gutenberg/pull/36201))
|
364 |
+
- Mobile - Add support for the Mark HTML tag and updates Aztec iOS to 1.19.5. ([35956](https://github.com/WordPress/gutenberg/pull/35956))
|
365 |
+
- Update Appium to 1.22.0. ([35829](https://github.com/WordPress/gutenberg/pull/35829))
|
366 |
+
- Updates publish-to-s3 plugin to 0.7.0 for react-native-bridge & react-native-aztec Android and publishes '-sources.jar'. ([36034](https://github.com/WordPress/gutenberg/pull/36034))
|
367 |
+
- Use the block name in the "remove block" menu item in the settings dropdown. ([35872](https://github.com/WordPress/gutenberg/pull/35872))
|
368 |
+
|
369 |
+
#### Site Editor
|
370 |
+
- Remove navigation panel in site editor. ([36194](https://github.com/WordPress/gutenberg/pull/36194))
|
371 |
+
|
372 |
+
|
373 |
+
= 11.8.0 =
|
374 |
+
|
375 |
+
### Enhancements
|
376 |
+
|
377 |
+
#### Block Library
|
378 |
+
- Add spacing controls to all heading blocks. ([35772](https://github.com/WordPress/gutenberg/pull/35772))
|
379 |
+
- Enable slash inserter for heading, list, and quote. ([35360](https://github.com/WordPress/gutenberg/pull/35360))
|
380 |
+
- Unify theme block placeholder content. ([35517](https://github.com/WordPress/gutenberg/pull/35517))
|
381 |
+
- Buttons: Add gap and vertical margin support. ([34546](https://github.com/WordPress/gutenberg/pull/34546))
|
382 |
+
- Categories: Add support for showing only top-level categories. ([35726](https://github.com/WordPress/gutenberg/pull/35726))
|
383 |
+
- Column: Allow the specification of blocks allowed within columns. ([35342](https://github.com/WordPress/gutenberg/pull/35342))
|
384 |
+
- Comment Content Block: Add typography, color and padding support. ([35183](https://github.com/WordPress/gutenberg/pull/35183))
|
385 |
+
- Cover: Add allowedBlocks and TemplateLock attributes in Cover Block. ([31326](https://github.com/WordPress/gutenberg/pull/31326))
|
386 |
+
- Cover: Add option to set opacity when background colour used. ([35065](https://github.com/WordPress/gutenberg/pull/35065))
|
387 |
+
- Cover: Allow setting the height from the placeholder state. ([35068](https://github.com/WordPress/gutenberg/pull/35068))
|
388 |
+
- Cover: Change dimRatio to 50 if media added and dimRatio is set to 100. ([35789](https://github.com/WordPress/gutenberg/pull/35789))
|
389 |
+
- Cover: Only use white text when the background of the cover block is dark. ([33541](https://github.com/WordPress/gutenberg/pull/33541))
|
390 |
+
- Cover: Use the description in the placeholder. ([34970](https://github.com/WordPress/gutenberg/pull/34970))
|
391 |
+
- Embed: Add Pinterest as an embed provider. ([34895](https://github.com/WordPress/gutenberg/pull/34895))
|
392 |
+
- Feature Image: Add spacing controls to the featured image block. ([35775](https://github.com/WordPress/gutenberg/pull/35775))
|
393 |
+
- Featured image and Image: Remove descendent space. ([35466](https://github.com/WordPress/gutenberg/pull/35466))
|
394 |
+
- Gallery Block: Get media data in a single request. ([34389](https://github.com/WordPress/gutenberg/pull/34389))
|
395 |
+
- Heading: Autogenerate heading anchors. ([30825](https://github.com/WordPress/gutenberg/pull/30825))
|
396 |
+
- Quote: Update deprecation to expect style block supports. ([35615](https://github.com/WordPress/gutenberg/pull/35615))
|
397 |
+
- Page List: Show empty placeholder if no items. ([35441](https://github.com/WordPress/gutenberg/pull/35441))
|
398 |
+
- Post Date: Add more typography options. ([35422](https://github.com/WordPress/gutenberg/pull/35422))
|
399 |
+
- Post Comment Author: Add link settings and block supports. ([35595](https://github.com/WordPress/gutenberg/pull/35595))
|
400 |
+
- Post Comment Date: Add link setting and block supports. ([35112](https://github.com/WordPress/gutenberg/pull/35112))
|
401 |
+
- Quote: Added a "plain" style for quote blocks. ([29856](https://github.com/WordPress/gutenberg/pull/29856))
|
402 |
+
- Search: Enable inheritance in search block. ([35723](https://github.com/WordPress/gutenberg/pull/35723))
|
403 |
+
- Site Logo: Add a basic example to the site logo block. ([35588](https://github.com/WordPress/gutenberg/pull/35588))
|
404 |
+
- Site Logo: Move the Reset button to the Replace menu dropdown. ([35372](https://github.com/WordPress/gutenberg/pull/35372))
|
405 |
+
- Site Logo: placeholder tweaks. ([35397](https://github.com/WordPress/gutenberg/pull/35397))
|
406 |
+
- Site Tagline: Add fontStyle control to Site Tagline block. ([35507](https://github.com/WordPress/gutenberg/pull/35507))
|
407 |
+
- Site Tagline: Add wide + full support to the site tagline block. ([35589](https://github.com/WordPress/gutenberg/pull/35589))
|
408 |
+
- Site Title: Add basic example to site-title block. ([35590](https://github.com/WordPress/gutenberg/pull/35590))
|
409 |
+
- Site Logo: Remove "Reset" button icon. ([35434](https://github.com/WordPress/gutenberg/pull/35434))
|
410 |
+
- Social Icons: Add top and bottom margin support. ([35374](https://github.com/WordPress/gutenberg/pull/35374))
|
411 |
+
- Social Links: Polish logos only style. ([35586](https://github.com/WordPress/gutenberg/pull/35586))
|
412 |
+
|
413 |
+
#### Design Tools
|
414 |
+
- ToolsPanel: Switch to plus icon when no controls present in panel body. ([34107](https://github.com/WordPress/gutenberg/pull/34107))
|
415 |
+
- Block Supports: Add panel specific className. ([35793](https://github.com/WordPress/gutenberg/pull/35793))
|
416 |
+
- Block Supports: Switch dimensions inspector controls slot to bubble virtually. ([34725](https://github.com/WordPress/gutenberg/pull/34725))
|
417 |
+
- Inspector Controls: Resort the order of the design tools associated with styles hooks. ([35574](https://github.com/WordPress/gutenberg/pull/35574))
|
418 |
+
|
419 |
+
#### Global Styles
|
420 |
+
- Allow users to store duotone data. ([35318](https://github.com/WordPress/gutenberg/pull/35318))
|
421 |
+
- Allow child theme.json to be merged with parent theme.json. ([35459](https://github.com/WordPress/gutenberg/pull/35459))
|
422 |
+
- Extract the three color panels to their own global styles view. ([35400](https://github.com/WordPress/gutenberg/pull/35400))
|
423 |
+
- Font family: Switch from CSS Custom Property to classes. ([31910](https://github.com/WordPress/gutenberg/pull/31910))
|
424 |
+
- Move the global styles reset action to a dropdown menu. ([35559](https://github.com/WordPress/gutenberg/pull/35559))
|
425 |
+
- Update descriptions for the different screens under global styles. ([35429](https://github.com/WordPress/gutenberg/pull/35429))
|
426 |
+
- Update the global styles sidebar's root view to use Card components. ([35547](https://github.com/WordPress/gutenberg/pull/35547))
|
427 |
+
- Use text color to render the Aa preview in global styles. ([35631](https://github.com/WordPress/gutenberg/pull/35631))
|
428 |
+
|
429 |
+
#### Theming
|
430 |
+
- Add [data-block] to appender. ([35356](https://github.com/WordPress/gutenberg/pull/35356))
|
431 |
+
- Enable theme supports automatically for FSE theme. ([35593](https://github.com/WordPress/gutenberg/pull/35593))
|
432 |
+
- Remove default padding/margin on the body of the page and editor canvas. ([35421](https://github.com/WordPress/gutenberg/pull/35421))
|
433 |
+
- Support title in templateParts. ([35626](https://github.com/WordPress/gutenberg/pull/35626))
|
434 |
+
- CSS: Add a reset for image heights. ([30092](https://github.com/WordPress/gutenberg/pull/30092))
|
435 |
+
|
436 |
+
#### Patterns
|
437 |
+
- Increase number of items per page for default Query Loop Block. ([35603](https://github.com/WordPress/gutenberg/pull/35603))
|
438 |
+
- Featured patterns from pattern directory. ([35115](https://github.com/WordPress/gutenberg/pull/35115))
|
439 |
+
|
440 |
+
#### Block Editor
|
441 |
+
- Add animations for insertion point, dropzone, and other elements. ([33132](https://github.com/WordPress/gutenberg/pull/33132))
|
442 |
+
- Adjust Link UI visual styling. ([35414](https://github.com/WordPress/gutenberg/pull/35414))
|
443 |
+
- Add some top margin. ([35717](https://github.com/WordPress/gutenberg/pull/35717))
|
444 |
+
- Show ellipsis menu in the List View. ([35170](https://github.com/WordPress/gutenberg/pull/35170))
|
445 |
+
|
446 |
+
#### Template Editor
|
447 |
+
- Add more options to template areas in template details. ([35577](https://github.com/WordPress/gutenberg/pull/35577))
|
448 |
+
- Add template areas to template inspector. ([35239](https://github.com/WordPress/gutenberg/pull/35239))
|
449 |
+
- Add template details to template parts. ([35444](https://github.com/WordPress/gutenberg/pull/35444))
|
450 |
+
- Align the layout of the template card with the block card. ([35391](https://github.com/WordPress/gutenberg/pull/35391))
|
451 |
+
- Update site editor block placeholder styling. ([35513](https://github.com/WordPress/gutenberg/pull/35513))
|
452 |
+
- Use a dark background for the site editor. ([35520](https://github.com/WordPress/gutenberg/pull/35520))
|
453 |
+
|
454 |
+
#### Components
|
455 |
+
- Add shortcut provider. ([35652](https://github.com/WordPress/gutenberg/pull/35652))
|
456 |
+
- Iterate on the design of the colors and gradients panel. ([35535](https://github.com/WordPress/gutenberg/pull/35535))
|
457 |
+
- Navigator: Update `Navigator` styling to facilitate sticky positioning. ([35518](https://github.com/WordPress/gutenberg/pull/35518))
|
458 |
+
- Repositioned RangeControl tooltip and adjusted image zoom control dropdown height. ([27374](https://github.com/WordPress/gutenberg/pull/27374))
|
459 |
+
- Remove segmented control vertical separators. ([35497](https://github.com/WordPress/gutenberg/pull/35497))
|
460 |
+
- Storybook: Add RTL switcher to toolbar. ([35711](https://github.com/WordPress/gutenberg/pull/35711))
|
461 |
+
- Storybook: Add story for TypographyPanel. ([35293](https://github.com/WordPress/gutenberg/pull/35293))
|
462 |
+
- Storybook: Enable Controls and disable Knobs by default. ([35682](https://github.com/WordPress/gutenberg/pull/35682))
|
463 |
+
- Storybook: Remove outdated decorator configuration. ([35678](https://github.com/WordPress/gutenberg/pull/35678))
|
464 |
+
- Support "any" step in NumberControl and RangeControl. ([34542](https://github.com/WordPress/gutenberg/pull/34542))
|
465 |
+
- ToggleGroupControl: Allow custom aria-label. ([35423](https://github.com/WordPress/gutenberg/pull/35423))
|
466 |
+
- Update range control metrics. ([35540](https://github.com/WordPress/gutenberg/pull/35540))
|
467 |
+
- Update FontSize control. ([35395](https://github.com/WordPress/gutenberg/pull/35395))
|
468 |
+
|
469 |
+
#### Packages
|
470 |
+
- Create Block: Add PascalCase slug to create-block template strings. ([35462](https://github.com/WordPress/gutenberg/pull/35462))
|
471 |
+
- Create Block: Allow local directories to be passed to --template as relative paths. ([35645](https://github.com/WordPress/gutenberg/pull/35645))
|
472 |
+
- Test Setup: Add more-complete mocks of common timer functions. ([35368](https://github.com/WordPress/gutenberg/pull/35368))
|
473 |
+
- Scripts: Allow customization of the ARTIFACTS_PATH via WP_ARTIFACTS_PATH env var. ([35371](https://github.com/WordPress/gutenberg/pull/35371))
|
474 |
+
|
475 |
+
|
476 |
+
### Accessibility
|
477 |
+
- Rich text popovers: Move to block tools to fix tab order. ([34956](https://github.com/WordPress/gutenberg/pull/34956))
|
478 |
+
- Save button: Prevent focus loss. ([34731](https://github.com/WordPress/gutenberg/pull/34731))
|
479 |
+
|
480 |
+
### Performance
|
481 |
+
|
482 |
+
#### Global Styles
|
483 |
+
- Pass only the data the site editor uses. ([35458](https://github.com/WordPress/gutenberg/pull/35458))
|
484 |
+
- Use a context provider for global styles configuration. ([35622](https://github.com/WordPress/gutenberg/pull/35622))
|
485 |
+
|
486 |
+
### Bug Fixes
|
487 |
+
|
488 |
+
#### Block Library
|
489 |
+
- Block Settings: Don't render 'Move to' if the block cannot be moved. ([35463](https://github.com/WordPress/gutenberg/pull/35463))
|
490 |
+
- Cover: Update placeholder minHeight style to support non-px units. ([35614](https://github.com/WordPress/gutenberg/pull/35614))
|
491 |
+
- Cover: Update 'templateLock' attribute. ([35671](https://github.com/WordPress/gutenberg/pull/35671))
|
492 |
+
- Featured Image: Center placeholder chip contents. ([35417](https://github.com/WordPress/gutenberg/pull/35417))
|
493 |
+
- Heading: Fix undo/redo "trap". ([35767](https://github.com/WordPress/gutenberg/pull/35767))
|
494 |
+
- Heading: Remove anchor map when block unmounts. ([35761](https://github.com/WordPress/gutenberg/pull/35761))
|
495 |
+
- Site Logo: Fix site logo block on dark backgrounds. ([35718](https://github.com/WordPress/gutenberg/pull/35718))
|
496 |
+
|
497 |
+
#### i18n
|
498 |
+
- Fix HelpHub link i18n for page-jumps. ([35404](https://github.com/WordPress/gutenberg/pull/35404))
|
499 |
+
- Fix template part block untranslated strings. ([35715](https://github.com/WordPress/gutenberg/pull/35715))
|
500 |
+
- Translation note for Home/end to avoid mistranslations. ([35669](https://github.com/WordPress/gutenberg/pull/35669))
|
501 |
+
|
502 |
+
#### Packages
|
503 |
+
- Server Site Render: Prevent empty renders in ServerSideRender component caused by changing props while already fetching markup. ([35433](https://github.com/WordPress/gutenberg/pull/35433))
|
504 |
+
- Rich text: formats: allow format to filter value when changing tag name ([35516](https://github.com/WordPress/gutenberg/pull/35516/files))
|
505 |
+
|
506 |
+
#### Components
|
507 |
+
- Color Picker: Fix some issues on the color picker component; Remove tinycolor2;. ([35562](https://github.com/WordPress/gutenberg/pull/35562))
|
508 |
+
- Navigator: Hide horizontal overflow in `Navigator`. ([35332](https://github.com/WordPress/gutenberg/pull/35332))
|
509 |
+
- Popover: Fix __unstableBoundaryParent. ([35082](https://github.com/WordPress/gutenberg/pull/35082))
|
510 |
+
- RawHTML component: Allow multiple children. ([35532](https://github.com/WordPress/gutenberg/pull/35532))
|
511 |
+
- Rich text: Fix internal paste across multiline and single line instances. ([35416](https://github.com/WordPress/gutenberg/pull/35416))
|
512 |
+
- Toggle Group Control: Fix visual state when no option is selected. ([35545](https://github.com/WordPress/gutenberg/pull/35545))
|
513 |
+
- Toggle Group Control: Fixed condition to show separator correctly. ([35409](https://github.com/WordPress/gutenberg/pull/35409))
|
514 |
+
- Toogle Group Control: Fix `ToggleGroupControlOption` not passing `ref` to the underlying element. ([35546](https://github.com/WordPress/gutenberg/pull/35546))
|
515 |
+
- Tooltip: For Tooltips, prevent emitting events to child elements if they are disabled. ([35254](https://github.com/WordPress/gutenberg/pull/35254))
|
516 |
+
- Tooltip: Remove extra comma character from Tooltip when underlying component is disabled. ([35247](https://github.com/WordPress/gutenberg/pull/35247))
|
517 |
+
|
518 |
+
#### Themes
|
519 |
+
- Custom Templates: Use "title" from the theme.json. ([35592](https://github.com/WordPress/gutenberg/pull/35592))
|
520 |
+
- Elements block support: Fix link color rendering on site front end. ([35446](https://github.com/WordPress/gutenberg/pull/35446))
|
521 |
+
- Move the link color styles to the footer. ([35425](https://github.com/WordPress/gutenberg/pull/35425))
|
522 |
+
- Reset margin for all children of flow layouts. ([35426](https://github.com/WordPress/gutenberg/pull/35426))
|
523 |
+
|
524 |
+
#### Template Editor
|
525 |
+
- Use slug as template parts area item key. ([35796](https://github.com/WordPress/gutenberg/pull/35796))
|
526 |
+
- Fix missing titles in general areas. ([35657](https://github.com/WordPress/gutenberg/pull/35657))
|
527 |
+
|
528 |
+
#### Block API
|
529 |
+
- Blocks: Apply the most recent filters to previously registered blocks. ([34299](https://github.com/WordPress/gutenberg/pull/34299))
|
530 |
+
- Fix class serialization of font size and colors in dynamic blocks that use block supports. ([35751](https://github.com/WordPress/gutenberg/pull/35751))
|
531 |
+
|
532 |
+
#### Design Tools
|
533 |
+
- Border Radius Control: Fix undefined value on first click into RangeControl. ([35651](https://github.com/WordPress/gutenberg/pull/35651))
|
534 |
+
|
535 |
+
#### Block Editor
|
536 |
+
- Fix updating the block list after block removal. ([35721](https://github.com/WordPress/gutenberg/pull/35721))
|
537 |
+
- Fix sibling inserter animation. ([35729](https://github.com/WordPress/gutenberg/pull/35729))
|
538 |
+
- Inserter: Fix gap between Search and Tabs. ([35537](https://github.com/WordPress/gutenberg/pull/35537))
|
539 |
+
- Saving post: Transparent disabled button. ([35542](https://github.com/WordPress/gutenberg/pull/35542))
|
540 |
+
- FSE: Coding standards: DOCTYPE should be the first line/character of any HTML document. ([35442](https://github.com/WordPress/gutenberg/pull/35442))
|
541 |
+
- [Block Editor]: Fix displaying only the none alignment option ([35822](https://github.com/WordPress/gutenberg/pull/35822))
|
542 |
+
|
543 |
+
#### REST API
|
544 |
+
- Fix preloading middleware referencing stale data for OPTIONS requests. ([35527](https://github.com/WordPress/gutenberg/pull/35527))
|
545 |
+
|
546 |
+
#### List View
|
547 |
+
- Fix expand and collapse when the icon is clicked. ([35526](https://github.com/WordPress/gutenberg/pull/35526))
|
548 |
+
|
549 |
+
#### Global Styles
|
550 |
+
- Fix presets that use a callback to validate user data. ([35255](https://github.com/WordPress/gutenberg/pull/35255))
|
551 |
+
|
552 |
+
#### CSS & Styling
|
553 |
+
- Remove font size classes that are enqueued in the global stylesheet. ([35182](https://github.com/WordPress/gutenberg/pull/35182))
|
554 |
+
|
555 |
+
#### Block API
|
556 |
+
- Allow more than 1 block stylesheets. ([32510](https://github.com/WordPress/gutenberg/pull/32510))
|
557 |
+
|
558 |
+
### Experiments
|
559 |
+
|
560 |
+
#### Navigation Block
|
561 |
+
- Add block gap support. ([35277](https://github.com/WordPress/gutenberg/pull/35277))
|
562 |
+
- Enable always on burger menu for responsive navigation menus. ([35568](https://github.com/WordPress/gutenberg/pull/35568))
|
563 |
+
- Fix issue with space-between. ([35722](https://github.com/WordPress/gutenberg/pull/35722))
|
564 |
+
- Submenu item paddings & fixes. ([35716](https://github.com/WordPress/gutenberg/pull/35716))
|
565 |
+
- Fix navigation gap & padding issues. ([35752](https://github.com/WordPress/gutenberg/pull/35752))
|
566 |
+
- Remove color inheritance specificity. ([35725](https://github.com/WordPress/gutenberg/pull/35725))
|
567 |
+
- Remove deprecated classnames from Navigation Link block. ([35358](https://github.com/WordPress/gutenberg/pull/35358))
|
568 |
+
-
|
569 |
+
#### Navigation Screen
|
570 |
+
- Use new core functions in menu items REST API. ([35648](https://github.com/WordPress/gutenberg/pull/35648))
|
571 |
+
- Navigation: Preload more API requests. ([35402](https://github.com/WordPress/gutenberg/pull/35402))
|
572 |
+
- Refactor `gutenberg_initialize_editor` function and remove `block_editor_preload_data` filter. ([35838](https://github.com/WordPress/gutenberg/pull/35838))
|
573 |
+
|
574 |
+
|
575 |
+
|
576 |
+
#### Full Site Editing
|
577 |
+
- Try: Remove dotted ancestor border. ([35637](https://github.com/WordPress/gutenberg/pull/35637))
|
578 |
+
|
579 |
+
|
580 |
+
### Documentation
|
581 |
+
|
582 |
+
#### Handbook
|
583 |
+
- Add categories to TOC to help digest the FAQ. ([35519](https://github.com/WordPress/gutenberg/pull/35519))
|
584 |
+
- Add missing documentation for the `wrapperProps` property for the `BlockListBlock` component returned by the `editor.blockListEdit` filter. ([26961](https://github.com/WordPress/gutenberg/pull/26961))
|
585 |
+
- Add section on using theme.json schema. ([35739](https://github.com/WordPress/gutenberg/pull/35739))
|
586 |
+
- Add Table of Contents to FAQ page. ([35455](https://github.com/WordPress/gutenberg/pull/35455))
|
587 |
+
- Clarify documentation for InnerBlocks orientation prop. ([35712](https://github.com/WordPress/gutenberg/pull/35712))
|
588 |
+
- CustomRadius - Remove plugin only text. ([35582](https://github.com/WordPress/gutenberg/pull/35582))
|
589 |
+
- Update block categories. ([35523](https://github.com/WordPress/gutenberg/pull/35523))
|
590 |
+
- Update `npm run build` command for developing with Gutenberg locally. ([35681](https://github.com/WordPress/gutenberg/pull/35681))
|
591 |
+
|
592 |
+
#### Packages
|
593 |
+
- Block Editor: Update default value of the viewportWidth attribute in documentation. ([35659](https://github.com/WordPress/gutenberg/pull/35659))
|
594 |
+
- Components: Add the storybook link to the `/components` README. ([35493](https://github.com/WordPress/gutenberg/pull/35493))
|
595 |
+
- Components: Add readme for SkipToSelectedBlock component. ([32958](https://github.com/WordPress/gutenberg/pull/32958))
|
596 |
+
- Componentes: Add CHANGELOG entry for the fieldset removal from `FontAppearanceControl`. ([35585](https://github.com/WordPress/gutenberg/pull/35585))
|
597 |
+
- Components: Add entry to CHANGELOG regarding new ColorPicker. ([35486](https://github.com/WordPress/gutenberg/pull/35486))
|
598 |
+
- Components: Fix markdown highlighting on components CONTRIBUTING.md. ([35633](https://github.com/WordPress/gutenberg/pull/35633))
|
599 |
+
- Components: Mark `CustomSelectControl` `hint` option as experimental. ([35673](https://github.com/WordPress/gutenberg/pull/35673))
|
600 |
+
- Components: Polish `ToggleGroupControl`. ([35600](https://github.com/WordPress/gutenberg/pull/35600))
|
601 |
+
- Components: Small tweaks to contributing guidelines. ([35620](https://github.com/WordPress/gutenberg/pull/35620))
|
602 |
+
- Components: Update README for SelectControl. ([28811](https://github.com/WordPress/gutenberg/pull/28811))
|
603 |
+
- Components: Update DateTimePicker component README to remove reference to isDayHighlighted callback. ([35363](https://github.com/WordPress/gutenberg/pull/35363))
|
604 |
+
- Components, feat(SelectControl): Add children prop. ([29540](https://github.com/WordPress/gutenberg/pull/29540))
|
605 |
+
- Create Block: Update documentation and readme post merge of #35645. ([35679](https://github.com/WordPress/gutenberg/pull/35679))
|
606 |
+
|
607 |
+
### Code Quality
|
608 |
+
- Block Editor: Fix odd usage of transform-styles wrap function (and tighten types). ([23599](https://github.com/WordPress/gutenberg/pull/23599))
|
609 |
+
- Constrained tabbing: Simplify. ([34836](https://github.com/WordPress/gutenberg/pull/34836))
|
610 |
+
- Compose: Convert `usePrevious` hook to TypeScript. ([35597](https://github.com/WordPress/gutenberg/pull/35597))
|
611 |
+
- Update Callers to handle when getBlockType return undefined. ([35097](https://github.com/WordPress/gutenberg/pull/35097))
|
612 |
+
- Components: Polish ResizableBox and convert it to TypeScript. ([35062](https://github.com/WordPress/gutenberg/pull/35062))
|
613 |
+
- Components: Remove tinycolor object usage from the gradient picker. ([35544](https://github.com/WordPress/gutenberg/pull/35544))
|
614 |
+
- Components: Remove duplicated className in Card component. ([35333](https://github.com/WordPress/gutenberg/pull/35333))
|
615 |
+
- Components: Remove unused `useJumpStep` utility. ([35561](https://github.com/WordPress/gutenberg/pull/35561))
|
616 |
+
- Components: Use new color picker props. ([35566](https://github.com/WordPress/gutenberg/pull/35566))
|
617 |
+
- Components: Replace the color picker component with the new version. ([35220](https://github.com/WordPress/gutenberg/pull/35220))
|
618 |
+
- Components, FontAppearanceControl: Remove `fieldset` wrapper. ([35461](https://github.com/WordPress/gutenberg/pull/35461))
|
619 |
+
- Components, ToolsPanel: Remove hardcoded classnames. ([35415](https://github.com/WordPress/gutenberg/pull/35415))
|
620 |
+
- Components, UnitControl component: Refactor JSX components to TypeScript. ([35281](https://github.com/WordPress/gutenberg/pull/35281))
|
621 |
+
- Global Styles: Refactor how the Global Styles access and sets data. ([35264](https://github.com/WordPress/gutenberg/pull/35264))
|
622 |
+
- Post Editor: Fix-up Post Editor’s preferences modal. ([35369](https://github.com/WordPress/gutenberg/pull/35369))
|
623 |
+
- Remove Tinycolor usage from component color utils. ([35553](https://github.com/WordPress/gutenberg/pull/35553))
|
624 |
+
- Reusable Blocks: Thunkify reusable-blocks store. ([35217](https://github.com/WordPress/gutenberg/pull/35217))
|
625 |
+
|
626 |
+
|
627 |
+
### Tools
|
628 |
+
|
629 |
+
#### Packages
|
630 |
+
- Scripts: Remove inject polyfill by default. ([35436](https://github.com/WordPress/gutenberg/pull/35436))
|
631 |
+
|
632 |
+
#### Testing
|
633 |
+
- Child theme.json: Update test to better capture that childs can update single parts in isolation. ([35759](https://github.com/WordPress/gutenberg/pull/35759))
|
634 |
+
- Border Radius Control: Add fallback px unit and add utils tests. ([35786](https://github.com/WordPress/gutenberg/pull/35786))
|
635 |
+
- Fix preview end-to-end tests. ([35565](https://github.com/WordPress/gutenberg/pull/35565))
|
636 |
+
- Flaky Tests: Fix taxonomies flaky tests. ([35534](https://github.com/WordPress/gutenberg/pull/35534))
|
637 |
+
- Flaky Tests: Try another fix for flaky nav test. ([35443](https://github.com/WordPress/gutenberg/pull/35443))
|
638 |
+
- Performance tests: Add more detailed loading metrics. ([32237](https://github.com/WordPress/gutenberg/pull/32237))
|
639 |
+
- Components, Panel: Improve unit tests. ([35658](https://github.com/WordPress/gutenberg/pull/35658))
|
640 |
+
- Enable/skipped metabox test. ([35594](https://github.com/WordPress/gutenberg/pull/35594))
|
641 |
+
|
642 |
+
#### Build Tooling
|
643 |
+
- Revert version bump if build job fails. ([33239](https://github.com/WordPress/gutenberg/pull/33239))
|
644 |
+
- Updates react-native-aztec android to use S3 dependency for Aztec editor. ([35606](https://github.com/WordPress/gutenberg/pull/35606))
|
645 |
|
646 |
|
647 |
= 11.7.1 =
|
gutenberg.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: Printing since 1440. This is the development plugin for the new block editor in core.
|
6 |
* Requires at least: 5.7
|
7 |
* Requires PHP: 5.6
|
8 |
-
* Version: 11.8.
|
9 |
* Author: Gutenberg Team
|
10 |
* Text Domain: gutenberg
|
11 |
*
|
@@ -13,8 +13,8 @@
|
|
13 |
*/
|
14 |
|
15 |
### BEGIN AUTO-GENERATED DEFINES
|
16 |
-
define( 'GUTENBERG_VERSION', '11.8.
|
17 |
-
define( 'GUTENBERG_GIT_COMMIT', '
|
18 |
### END AUTO-GENERATED DEFINES
|
19 |
|
20 |
gutenberg_pre_init();
|
5 |
* Description: Printing since 1440. This is the development plugin for the new block editor in core.
|
6 |
* Requires at least: 5.7
|
7 |
* Requires PHP: 5.6
|
8 |
+
* Version: 11.8.1
|
9 |
* Author: Gutenberg Team
|
10 |
* Text Domain: gutenberg
|
11 |
*
|
13 |
*/
|
14 |
|
15 |
### BEGIN AUTO-GENERATED DEFINES
|
16 |
+
define( 'GUTENBERG_VERSION', '11.8.1' );
|
17 |
+
define( 'GUTENBERG_GIT_COMMIT', '1e9fc8ed60094d98c5e43504785aa893a02f686e' );
|
18 |
### END AUTO-GENERATED DEFINES
|
19 |
|
20 |
gutenberg_pre_init();
|
readme.txt
CHANGED
@@ -56,4 +56,4 @@ The four phases of the project are Editing, Customization, Collaboration, and Mu
|
|
56 |
|
57 |
== Changelog ==
|
58 |
|
59 |
-
To read the changelog for Gutenberg 11.8.
|
56 |
|
57 |
== Changelog ==
|
58 |
|
59 |
+
To read the changelog for Gutenberg 11.8.1, please navigate to the <a href="https://github.com/WordPress/gutenberg/releases/tag/v11.8.1">release page</a>.
|