diff options
Diffstat (limited to 'wp-includes/js/dist/server-side-render.min.js')
-rw-r--r-- | wp-includes/js/dist/server-side-render.min.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/wp-includes/js/dist/server-side-render.min.js b/wp-includes/js/dist/server-side-render.min.js index 7902429..9c4e9b4 100644 --- a/wp-includes/js/dist/server-side-render.min.js +++ b/wp-includes/js/dist/server-side-render.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(){"use strict";var e={5619:function(e){e.exports=function e(r,t){if(r===t)return!0;if(r&&t&&"object"==typeof r&&"object"==typeof t){if(r.constructor!==t.constructor)return!1;var n,o,u;if(Array.isArray(r)){if((n=r.length)!=t.length)return!1;for(o=n;0!=o--;)if(!e(r[o],t[o]))return!1;return!0}if(r instanceof Map&&t instanceof Map){if(r.size!==t.size)return!1;for(o of r.entries())if(!t.has(o[0]))return!1;for(o of r.entries())if(!e(o[1],t.get(o[0])))return!1;return!0}if(r instanceof Set&&t instanceof Set){if(r.size!==t.size)return!1;for(o of r.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(r)&&ArrayBuffer.isView(t)){if((n=r.length)!=t.length)return!1;for(o=n;0!=o--;)if(r[o]!==t[o])return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if((n=(u=Object.keys(r)).length)!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,u[o]))return!1;for(o=n;0!=o--;){var s=u[o];if(!e(r[s],t[s]))return!1}return!0}return r!=r&&t!=t}}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var u=r[n]={exports:{}};return e[n](u,u.exports,t),u.exports}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(e,r){return Object.prototype.hasOwnProperty.call(e,r)};var n={};!function(){t.d(n,{default:function(){return v}});var e=window.wp.element,r=window.wp.data,o=t(5619),u=t.n(o),s=window.wp.compose,i=window.wp.i18n,c=window.wp.apiFetch,a=t.n(c),l=window.wp.url,f=window.wp.components,p=window.wp.blocks;const d={};function w({className:r}){return(0,e.createElement)(f.Placeholder,{className:r},(0,i.__)("Block rendered as empty."))}function m({response:r,className:t}){const n=(0,i.sprintf)((0,i.__)("Error loading block: %s"),r.errorMsg);return(0,e.createElement)(f.Placeholder,{className:t},n)}function y({children:r,showLoader:t}){return(0,e.createElement)("div",{style:{position:"relative"}},t&&(0,e.createElement)("div",{style:{position:"absolute",top:"50%",left:"50%",marginTop:"-9px",marginLeft:"-9px"}},(0,e.createElement)(f.Spinner,null)),(0,e.createElement)("div",{style:{opacity:t?"0.3":1}},r))}function g(r){const{attributes:t,block:n,className:o,httpMethod:i="GET",urlQueryArgs:c,skipBlockSupportAttributes:f=!1,EmptyResponsePlaceholder:g=w,ErrorResponsePlaceholder:h=m,LoadingResponsePlaceholder:v=y}=r,b=(0,e.useRef)(!0),[E,S]=(0,e.useState)(!1),O=(0,e.useRef)(),[P,k]=(0,e.useState)(null),x=(0,s.usePrevious)(r),[A,j]=(0,e.useState)(!1);function M(){var e,r;if(!b.current)return;j(!0);let o=t&&(0,p.__experimentalSanitizeBlockAttributes)(n,t);f&&(o=function(e){const{backgroundColor:r,borderColor:t,fontFamily:n,fontSize:o,gradient:u,textColor:s,className:i,...c}=e,{border:a,color:l,elements:f,spacing:p,typography:w,...m}=e?.style||d;return{...c,style:m}}(o));const u="POST"===i,s=u?null:null!==(e=o)&&void 0!==e?e:null,w=function(e,r=null,t={}){return(0,l.addQueryArgs)(`/wp/v2/block-renderer/${e}`,{context:"edit",...null!==r?{attributes:r}:{},...t})}(n,s,c),m=u?{attributes:null!==(r=o)&&void 0!==r?r:null}:null,y=O.current=a()({path:w,data:m,method:u?"POST":"GET"}).then((e=>{b.current&&y===O.current&&e&&k(e.rendered)})).catch((e=>{b.current&&y===O.current&&k({error:!0,errorMsg:e.message})})).finally((()=>{b.current&&y===O.current&&j(!1)}));return y}const R=(0,s.useDebounce)(M,500);(0,e.useEffect)((()=>()=>{b.current=!1}),[]),(0,e.useEffect)((()=>{void 0===x?M():u()(x,r)||R()})),(0,e.useEffect)((()=>{if(!A)return;const e=setTimeout((()=>{S(!0)}),1e3);return()=>clearTimeout(e)}),[A]);const T=!!P,_=""===P,N=P?.error;return A?(0,e.createElement)(v,{...r,showLoader:E},T&&(0,e.createElement)(e.RawHTML,{className:o},P)):_||!T?(0,e.createElement)(g,{...r}):N?(0,e.createElement)(h,{response:P,...r}):(0,e.createElement)(e.RawHTML,{className:o},P)}const h={};var v=(0,r.withSelect)((e=>{const r=e("core/editor");if(r){const e=r.getCurrentPostId();if(e&&"number"==typeof e)return{currentPostId:e}}return h}))((({urlQueryArgs:r=h,currentPostId:t,...n})=>{const o=(0,e.useMemo)((()=>t?{post_id:t,...r}:r),[t,r]);return(0,e.createElement)(g,{urlQueryArgs:o,...n})}))}(),(window.wp=window.wp||{}).serverSideRender=n.default}();
\ No newline at end of file +(()=>{"use strict";var e={7734:e=>{e.exports=function e(r,t){if(r===t)return!0;if(r&&t&&"object"==typeof r&&"object"==typeof t){if(r.constructor!==t.constructor)return!1;var n,o,s;if(Array.isArray(r)){if((n=r.length)!=t.length)return!1;for(o=n;0!=o--;)if(!e(r[o],t[o]))return!1;return!0}if(r instanceof Map&&t instanceof Map){if(r.size!==t.size)return!1;for(o of r.entries())if(!t.has(o[0]))return!1;for(o of r.entries())if(!e(o[1],t.get(o[0])))return!1;return!0}if(r instanceof Set&&t instanceof Set){if(r.size!==t.size)return!1;for(o of r.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(r)&&ArrayBuffer.isView(t)){if((n=r.length)!=t.length)return!1;for(o=n;0!=o--;)if(r[o]!==t[o])return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if((n=(s=Object.keys(r)).length)!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=n;0!=o--;){var u=s[o];if(!e(r[u],t[u]))return!1}return!0}return r!=r&&t!=t}}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var s=r[n]={exports:{}};return e[n](s,s.exports,t),s.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var n={};(()=>{t.d(n,{default:()=>b});const e=window.React,r=window.wp.element,o=window.wp.data;var s=t(7734),u=t.n(s);const i=window.wp.compose,c=window.wp.i18n,a=window.wp.apiFetch;var l=t.n(a);const f=window.wp.url,p=window.wp.components,d=window.wp.blocks,w={};function m({className:r}){return(0,e.createElement)(p.Placeholder,{className:r},(0,c.__)("Block rendered as empty."))}function y({response:r,className:t}){const n=(0,c.sprintf)((0,c.__)("Error loading block: %s"),r.errorMsg);return(0,e.createElement)(p.Placeholder,{className:t},n)}function g({children:r,showLoader:t}){return(0,e.createElement)("div",{style:{position:"relative"}},t&&(0,e.createElement)("div",{style:{position:"absolute",top:"50%",left:"50%",marginTop:"-9px",marginLeft:"-9px"}},(0,e.createElement)(p.Spinner,null)),(0,e.createElement)("div",{style:{opacity:t?"0.3":1}},r))}function h(t){const{attributes:n,block:o,className:s,httpMethod:c="GET",urlQueryArgs:a,skipBlockSupportAttributes:p=!1,EmptyResponsePlaceholder:h=m,ErrorResponsePlaceholder:v=y,LoadingResponsePlaceholder:b=g}=t,E=(0,r.useRef)(!0),[S,O]=(0,r.useState)(!1),P=(0,r.useRef)(),[k,x]=(0,r.useState)(null),A=(0,i.usePrevious)(t),[R,j]=(0,r.useState)(!1);function M(){var e,r;if(!E.current)return;j(!0);let t=n&&(0,d.__experimentalSanitizeBlockAttributes)(o,n);p&&(t=function(e){const{backgroundColor:r,borderColor:t,fontFamily:n,fontSize:o,gradient:s,textColor:u,className:i,...c}=e,{border:a,color:l,elements:f,spacing:p,typography:d,...m}=e?.style||w;return{...c,style:m}}(t));const s="POST"===c,u=s?null:null!==(e=t)&&void 0!==e?e:null,i=function(e,r=null,t={}){return(0,f.addQueryArgs)(`/wp/v2/block-renderer/${e}`,{context:"edit",...null!==r?{attributes:r}:{},...t})}(o,u,a),m=s?{attributes:null!==(r=t)&&void 0!==r?r:null}:null,y=P.current=l()({path:i,data:m,method:s?"POST":"GET"}).then((e=>{E.current&&y===P.current&&e&&x(e.rendered)})).catch((e=>{E.current&&y===P.current&&x({error:!0,errorMsg:e.message})})).finally((()=>{E.current&&y===P.current&&j(!1)}));return y}const T=(0,i.useDebounce)(M,500);(0,r.useEffect)((()=>()=>{E.current=!1}),[]),(0,r.useEffect)((()=>{void 0===A?M():u()(A,t)||T()})),(0,r.useEffect)((()=>{if(!R)return;const e=setTimeout((()=>{O(!0)}),1e3);return()=>clearTimeout(e)}),[R]);const _=!!k,N=""===k,z=k?.error;return R?(0,e.createElement)(b,{...t,showLoader:S},_&&(0,e.createElement)(r.RawHTML,{className:s},k)):N||!_?(0,e.createElement)(h,{...t}):z?(0,e.createElement)(v,{response:k,...t}):(0,e.createElement)(r.RawHTML,{className:s},k)}const v={},b=(0,o.withSelect)((e=>{const r=e("core/editor");if(r){const e=r.getCurrentPostId();if(e&&"number"==typeof e)return{currentPostId:e}}return v}))((({urlQueryArgs:t=v,currentPostId:n,...o})=>{const s=(0,r.useMemo)((()=>n?{post_id:n,...t}:t),[n,t]);return(0,e.createElement)(h,{urlQueryArgs:s,...o})}))})(),(window.wp=window.wp||{}).serverSideRender=n.default})();
\ No newline at end of file |