laipower/wp-content/themes/generatepress/assets/dist/block-editor.js

1 line
18 KiB
JavaScript
Raw Normal View History

!function(){"use strict";var t={};function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function r(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,i,o,s=[],u=!0,h=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){h=!0,a=t}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(h)throw a}}return s}}(t,r)||function(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,{a:r}),r},t.d=function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var n=window.wp.plugins,a=window.wp.element,i=window.wp.domReady,o=t.n(i);function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}(0,n.registerPlugin)("generatepress-content-width",{render:function(){var t,e=r((0,a.useState)(generatepressBlockEditor.sidebarLayout),2),n=e[0],i=e[1],s=r((0,a.useState)(generatepressBlockEditor.contentAreaType),2),u=s[0],h=s[1],f=null===(t=document.querySelector(".editor-styles-wrapper"))||void 0===t?void 0:t.style;return(0,a.useEffect)((function(){var t,e=document.querySelector(".editor-styles-wrapper");null==e||null===(t=e.style)||void 0===t||t.setProperty("--content-width",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r="",n="px",a=generatepressBlockEditor.customContentWidth?parseInt(generatepressBlockEditor.customContentWidth):generatepressBlockEditor.containerWidth,i=generatepressBlockEditor.leftSidebarWidth,o=generatepressBlockEditor.rightSidebarWidth;if(r="left-sidebar"===t?a*((100-i)/100):"right-sidebar"===t?a*((100-o)/100):"no-sidebar"===t?a:a*((100-(Number(i)+Number(o)))/100),""===e){var s=parseInt(generatepressBlockEditor.contentPaddingRight)+parseInt(generatepressBlockEditor.contentPaddingLeft);r=Number(r)-s}return"true"!==e||generatepressBlockEditor.customContentWidth||(r=100,n="%"),r+n}(n,u))}),[n,u,JSON.stringify(f)]),o()((function(){var t=document.getElementById("generate-sidebar-layout"),e=document.getElementById("_generate-full-width-content");t&&(t.onchange=function(t){i(t.target.value||generatepressBlockEditor.globalSidebarLayout)}),e&&(e.onchange=function(t){h(t.target.value||generatepressBlockEditor.contentAreaType)})})),null}});var u=/^\s+/,h=/\s+$/;function f(t,e){if(e=e||{},(t=t||"")instanceof f)return t;if(!(this instanceof f))return new f(t,e);var r=function(t){var e,r,n,a={r:0,g:0,b:0},i=1,o=null,f=null,l=null,c=!1,d=!1;return"string"==typeof t&&(t=function(t){t=t.replace(u,"").replace(h,"").toLowerCase();var e,r=!1;if(R[t])t=R[t],r=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=T.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=T.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=T.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=T.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=T.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=T.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=T.hex8.exec(t))?{r:B(e[1]),g:B(e[2]),b:B(e[3]),a:q(e[4]),format:r?"name":"hex8"}:(e=T.hex6.exec(t))?{r:B(e[1]),g:B(e[2]),b:B(e[3]),format:r?"name":"hex"}:(e=T.hex4.exec(t))?{r:B(e[1]+""+e[1]),g:B(e[2]+""+e[2]),b:B(e[3]+""+e[3]),a:q(e[4]+""+e[4]),format:r?"name":"hex8"}:!!(e=T.he