diff --git a/build/editor.asset.php b/build/editor.asset.php
index ab03a59e..348190a2 100644
--- a/build/editor.asset.php
+++ b/build/editor.asset.php
@@ -1 +1 @@
- array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '37a5b8942a9df01b9dc3');
+ array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '67ec6a1a89612cbe46c7');
diff --git a/build/editor.js b/build/editor.js
index 1e981208..1e015e34 100644
--- a/build/editor.js
+++ b/build/editor.js
@@ -4,7 +4,7 @@
(0,S.__)('Only a single component can be used per block. Multiple found inside block "%s".',"lazy-blocks"),n.block)),wp.element.createElement("div",null);t=!0;var i=Fs(Fs({},l),(u=e.attribs,c=Fs({},u),Object.keys(ks).forEach((function(e){var t=ks[e];void 0!==c[e]&&delete Object.assign(c,Os({},t,c[e]))[e]})),Is.forEach((function(e){if("string"==typeof c[e]){var t=c[e].charAt(0);if("["===t||"{"===t)try{c[e]=_s().parse(c[e])}catch(t){delete c[e]}else delete c[e]}})),Object.keys(c).forEach((function(e){"false"===c[e]?c[e]=!1:"true"===c[e]&&(c[e]=!0)})),c));return(0,vs.isEqual)(i,l)||a(i),e.children&&e.children.length?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",s),Ds(e.children,o)):wp.element.createElement("div",s)}var u,c;if("script"===e.type){var d,f,p={};return null!=e&&null!==(d=e.attribs)&&void 0!==d&&d.src&&(p.src=e.attribs.src),null!=e&&null!==(f=e.children[0])&&void 0!==f&&f.data&&(p.innerHTML=e.children[0].data),void 0!==r&&(p.blockContentWrapper=r),wp.element.createElement(Ts,p)}}};return ws(e,o)}(t)}function Ps(e){return Ps="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ps(e)}function Ms(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=e[r.name];if("true"===r.save_in_meta&&(i=t[r.save_in_meta_name||r.name]),r.child_of&&n.controls[r.child_of]&&o>-1){var l=Ys(e,t,n,n.controls[r.child_of]);l&&void 0!==l[o]&&void 0!==l[o][r.name]&&(i=l[o][r.name])}return i=(0,gs.applyFilters)("lzb.editor.control.".concat(r.type,".getValue"),i,r,o),void 0===(i=(0,gs.applyFilters)("lzb.editor.control.getValue",i,r,o))&&(i=""),i}function Ks(e,t){var n=!1,r=u(t.type);if(r&&r.restrictions.required_settings&&t.required&&"true"===t.required){var o=""!==e&&void 0!==e,i=(0,gs.applyFilters)("lzb.editor.control.validate",(0,gs.applyFilters)("lzb.editor.control.".concat(t.type,".validate"),{valid:o,message:""},e,t),e,t),l=i.valid,a=i.message;l||(n=a||(0,S.__)("This control is required.","lazy-blocks"))}return n}function Js(e){return Js="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Js(e)}function Zs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qs(e){for(var t=1;t-1){var c=Ys(i,a,o,o.controls[t.child_of]);c&&void 0!==c[n]&&(c[n][t.name]=e,e=c),s=(t=o.controls[t.child_of]).name}e=(0,gs.applyFilters)("lzb.editor.control.".concat(t.type,".updateValue"),e,t,n),e=(0,gs.applyFilters)("lzb.editor.control.updateValue",e,t,n),"true"===t.save_in_meta?u(Qs(Qs({},a),{},ec({},t.save_in_meta_name||s,e))):l(ec({},s,e))}},{key:"getControls",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.lazyBlockData,n={};return Object.keys(t.controls).forEach((function(r){var o=t.controls[r],i=u(o.type);i&&i.attributes&&(o=Qs(Qs({},(0,vs.cloneDeep)(i.attributes)),o)),(!e&&!o.child_of||e&&o.child_of===e)&&(n[r]=o)})),n}},{key:"renderControls",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],l=this.getControls(r);return Object.keys(l).forEach((function(r){var a=l[r],u=t.renderControl(a,e,r,o,n);u&&i.push(u)})),"inspector"===e&&i.length&&(i=wp.element.createElement(v.PanelBody,null,i)),i=(0,gs.applyFilters)("lzb.editor.controls.render",i,{placement:e,group:n,childOf:r,childIndex:o,getControls:this.getControls,renderControl:this.renderControl})}},{key:"renderControl",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"default",l=this.props,a=l.lazyBlockData,s=l.isLazyBlockSelected,c=l.allowErrorNotice,d=l.attributes,f=l.meta,p=!1,h=e.type&&"nowhere"!==e.placement&&("both"===e.placement||e.placement===t),m=e.label,g=u(e.type);if("content"!==t&&(h=h&&e.group===i),g&&g.restrictions&&(h&&g.restrictions.placement_settings&&(h=g.restrictions.placement_settings.indexOf(t)>-1||g.restrictions.placement_settings.indexOf("".concat(t,"-fallback"))>-1),h&&"content"===t&&("content"===e.placement||"both"===e.placement)&&g.restrictions.hide_if_not_selected_settings&&e.hide_if_not_selected&&"true"===e.hide_if_not_selected&&(h=s),g.restrictions.required_settings&&e.required&&"true"===e.required&&(m="".concat(m||"",' *'))),e.child_of||h){var y={data:Qs(Qs({},e),{},{help:!!e.help&&wp.element.createElement(Jt.RawHTML,null,e.help),label:!!m&&wp.element.createElement("span",{dangerouslySetInnerHTML:{__html:m}})}),placement:t,childIndex:o,uniqueId:n,getValue:function(){return Ys(d,f,a,arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:o)},onChange:function(t){r.onControlChange(t,e,o)},getControls:this.getControls,renderControls:this.renderControls},b=(0,gs.applyFilters)("lzb.editor.control.".concat(e.type,".render"),"",y,this.props);if(b&&(b=(0,gs.applyFilters)("lzb.editor.control.render",b,y,this.props)),b){var C="",D=Ks(y.getValue(),e);c&&D&&(C=wp.element.createElement(v.Notice,{key:"notice-".concat(e.name),status:"error",isDismissible:!1,className:"lzb-constructor-notice"},D)),p="inspector"===t?wp.element.createElement(Jt.Fragment,{key:"control-".concat(n)},b,C):wp.element.createElement("div",{key:"control-".concat(n),style:{width:e.width?"".concat(e.width,"%"):""}},b,C)}}return p}},{key:"render",value:function(){return this.renderControls(this.props.placement,this.props.group)}}])}(Jt.Component);function uc(){return uc=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0?(e=r,E&&(E("lazyblock-".concat(n)),k(e))):I()))}var R=(0,ms.useThrottle)(T,500);(0,Jt.useEffect)((function(){l.current||R()}),[i,R]),(0,Jt.useEffect)((function(){return l.current=!1,T(),function(){a.current=!1,I()}}),[]);var P=i.blockUniqueClass,M=void 0===P?"":P,z=f()("lazyblock",p>0&&!r&&"lzb-invalid",M),B={},L={default:!0,styles:!1,advanced:!1};Object.keys(t.controls).forEach((function(e){if(t.controls[e].child_of||(B[t.controls[e].name]=Ys(i,C,t,t.controls[e])),"content"!==t.controls[e].placement)switch(t.controls[e].group){case"default":L.default=!0;break;case"styles":L.styles=!0;break;case"advanced":L.advanced=!0}})),["lazyblock","className","align","anchor","blockId","blockUniqueClass"].forEach((function(e){B[e]=i[e]}));var j=!0;switch(t.code.show_preview){case"selected":j=w;break;case"unselected":j=!w;break;case"never":j=!1}return wp.element.createElement("div",(0,ps.useBlockProps)({className:z}),wp.element.createElement("div",{className:"lzb-content-title"},t.icon&&/^dashicons/.test(t.icon)?wp.element.createElement("span",{className:t.icon}):null,t.icon&&!/^dashicons/.test(t.icon)?wp.element.createElement("span",{dangerouslySetInnerHTML:{__html:t.icon}}):null,wp.element.createElement("h6",null,t.title)),Object.keys(L).map((function(t){return L[t]?wp.element.createElement(ps.InspectorControls,{key:"inspector-".concat(t),group:t},wp.element.createElement("div",{className:"lzb-inspector-controls lzb-inspector-controls-".concat(t),"data-lazyblocks-block-name":e.name},"default"===t&&s&&p>0&&wp.element.createElement("div",{className:"lzb-invalid-notice"},(0,S.sprintf)(
+(0,S.__)("Error loading block preview: %s","lazy-blocks"),f.response.message||f.response.code||f.response):wp.element.createElement(wp.element.Fragment,null,f?wp.element.createElement(Rs,{content:f,props:e,blockContentWrapper:F}):null,b?wp.element.createElement(v.Spinner,null):null):"",wp.element.createElement("div",{ref:F,className:"lzb-preview-server"},wp.element.createElement(Hs,{key:f},P))}function Ys(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=e[r.name];if("true"===r.save_in_meta&&(i=t[r.save_in_meta_name||r.name]),r.child_of&&n.controls[r.child_of]&&o>-1){var l=Ys(e,t,n,n.controls[r.child_of]);l&&void 0!==l[o]&&void 0!==l[o][r.name]&&(i=l[o][r.name])}return i=(0,gs.applyFilters)("lzb.editor.control.".concat(r.type,".getValue"),i,r,o),void 0===(i=(0,gs.applyFilters)("lzb.editor.control.getValue",i,r,o))&&(i=""),i}function Ks(e,t){var n=!1,r=u(t.type);if(r&&r.restrictions.required_settings&&t.required&&"true"===t.required){var o=""!==e&&void 0!==e,i=(0,gs.applyFilters)("lzb.editor.control.validate",(0,gs.applyFilters)("lzb.editor.control.".concat(t.type,".validate"),{valid:o,message:""},e,t),e,t),l=i.valid,a=i.message;l||(n=a||(0,S.__)("This control is required.","lazy-blocks"))}return n}function Js(e){return Js="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Js(e)}function Zs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qs(e){for(var t=1;t-1){var c=Ys(i,a,o,o.controls[t.child_of]);c&&void 0!==c[n]&&(c[n][t.name]=e,e=c),s=(t=o.controls[t.child_of]).name}e=(0,gs.applyFilters)("lzb.editor.control.".concat(t.type,".updateValue"),e,t,n),e=(0,gs.applyFilters)("lzb.editor.control.updateValue",e,t,n),"true"===t.save_in_meta?u(Qs(Qs({},a),{},ec({},t.save_in_meta_name||s,e))):l(ec({},s,e))}},{key:"getControls",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.lazyBlockData,n={};return Object.keys(t.controls).forEach((function(r){var o=t.controls[r],i=u(o.type);i&&i.attributes&&(o=Qs(Qs({},(0,vs.cloneDeep)(i.attributes)),o)),(!e&&!o.child_of||e&&o.child_of===e)&&(n[r]=o)})),n}},{key:"renderControls",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],l=this.getControls(r);return Object.keys(l).forEach((function(r){var a=l[r],u=t.renderControl(a,e,r,o,n);u&&i.push(u)})),"inspector"===e&&i.length&&(i=wp.element.createElement(v.PanelBody,null,i)),i=(0,gs.applyFilters)("lzb.editor.controls.render",i,{placement:e,group:n,childOf:r,childIndex:o,getControls:this.getControls,renderControl:this.renderControl})}},{key:"renderControl",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"default",a=this.props,s=a.lazyBlockData,c=a.isLazyBlockSelected,d=a.allowErrorNotice,f=a.attributes,p=a.meta,h=!1,m=e.type&&"nowhere"!==e.placement&&("both"===e.placement||e.placement===t),g=e.label,y=u(e.type);if("content"!==t&&(m=m&&e.group===l),y&&y.restrictions&&(m&&y.restrictions.placement_settings&&(m=y.restrictions.placement_settings.indexOf(t)>-1||y.restrictions.placement_settings.indexOf("".concat(t,"-fallback"))>-1),m&&"content"===t&&("content"===e.placement||"both"===e.placement)&&y.restrictions.hide_if_not_selected_settings&&e.hide_if_not_selected&&"true"===e.hide_if_not_selected&&(m=c),y.restrictions.required_settings&&e.required&&"true"===e.required&&(g="".concat(g||"",' *'))),e.child_of||m){var b={data:Qs(Qs({},e),{},{help:!!e.help&&wp.element.createElement(Jt.RawHTML,null,e.help),label:!!g&&wp.element.createElement("span",{dangerouslySetInnerHTML:{__html:g}})}),placement:t,childIndex:i,uniqueId:n,getValue:function(){return Ys(f,p,s,arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:i)},onChange:function(t){r.onControlChange(t,e,i)},getControls:this.getControls,renderControls:this.renderControls},C=(0,gs.applyFilters)("lzb.editor.control.".concat(e.type,".render"),"",b,this.props);if(C&&(C=(0,gs.applyFilters)("lzb.editor.control.render",C,b,this.props)),C){var D=b.getValue(),w=[];if("true"===e.save_in_meta){var _,E=(0,o.select)("core/editor").getCurrentPostType(),x=(0,o.select)("core").getPostType(E);(null==x||null===(_=x.supports)||void 0===_?void 0:_["custom-fields"])||w.push(wp.element.createElement(v.Notice,{key:"notice-".concat(e.name),status:"error",isDismissible:!1,className:"lzb-constructor-notice"},(0,S.__)("This post type doesn't support custom fields","lazy-blocks")))}var A=Ks(D,e);d&&A&&w.push(wp.element.createElement(v.Notice,{key:"notice-".concat(e.name),status:"error",isDismissible:!1,className:"lzb-constructor-notice"},A)),h="inspector"===t?wp.element.createElement(Jt.Fragment,{key:"control-".concat(n)},C,w):wp.element.createElement("div",{key:"control-".concat(n),style:{width:e.width?"".concat(e.width,"%"):""}},C,w)}}return h}},{key:"render",value:function(){return this.renderControls(this.props.placement,this.props.group)}}])}(Jt.Component);function uc(){return uc=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0?(e=r,E&&(E("lazyblock-".concat(n)),k(e))):I()))}var R=(0,ms.useThrottle)(T,500);(0,Jt.useEffect)((function(){l.current||R()}),[i,R]),(0,Jt.useEffect)((function(){return l.current=!1,T(),function(){a.current=!1,I()}}),[]);var P=i.blockUniqueClass,M=void 0===P?"":P,z=f()("lazyblock",p>0&&!r&&"lzb-invalid",M),B={},L={default:!0,styles:!1,advanced:!1};Object.keys(t.controls).forEach((function(e){if(t.controls[e].child_of||(B[t.controls[e].name]=Ys(i,C,t,t.controls[e])),"content"!==t.controls[e].placement)switch(t.controls[e].group){case"default":L.default=!0;break;case"styles":L.styles=!0;break;case"advanced":L.advanced=!0}})),["lazyblock","className","align","anchor","blockId","blockUniqueClass"].forEach((function(e){B[e]=i[e]}));var j=!0;switch(t.code.show_preview){case"selected":j=w;break;case"unselected":j=!w;break;case"never":j=!1}return wp.element.createElement("div",(0,ps.useBlockProps)({className:z}),wp.element.createElement("div",{className:"lzb-content-title"},t.icon&&/^dashicons/.test(t.icon)?wp.element.createElement("span",{className:t.icon}):null,t.icon&&!/^dashicons/.test(t.icon)?wp.element.createElement("span",{dangerouslySetInnerHTML:{__html:t.icon}}):null,wp.element.createElement("h6",null,t.title)),Object.keys(L).map((function(t){return L[t]?wp.element.createElement(ps.InspectorControls,{key:"inspector-".concat(t),group:t},wp.element.createElement("div",{className:"lzb-inspector-controls lzb-inspector-controls-".concat(t),"data-lazyblocks-block-name":e.name},"default"===t&&s&&p>0&&wp.element.createElement("div",{className:"lzb-invalid-notice"},(0,S.sprintf)(
// translators: %d: number of child controls.
// translators: %d: number of child controls.
(0,S._n)("Validation failed. %d control require attention.","Validation failed. %d controls require attention.",p,"lazy-blocks"),p)),wp.element.createElement(ac,uc({placement:"inspector",group:t,isLazyBlockSelected:w,allowErrorNotice:s,meta:C,setMeta:function(){y&&D.apply(void 0,arguments)}},e)))):null})),t.edit_url?wp.element.createElement(ps.BlockControls,{group:"other"},wp.element.createElement(v.ToolbarButton,{icon:wp.element.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.2894 4.8356C10.3698 4.35341 10.787 4 11.2758 4H12.5816C13.0704 4 13.4876 4.35341 13.5679 4.8356L13.8083 6.27728C14.6162 6.53233 15.3503 6.95375 15.9703 7.50134L17.3131 6.99826C17.7709 6.82676 18.2856 7.01136 18.53 7.4347L19.1829 8.56551C19.4273 8.98886 19.3298 9.52686 18.9524 9.83755L17.8658 10.7321C17.9537 11.1408 18 11.565 18 12C18 12.4348 17.9537 12.8588 17.8659 13.2674L18.9534 14.1627C19.3308 14.4734 19.4283 15.0114 19.1839 15.4347L18.531 16.5655C18.2866 16.9889 17.7719 17.1735 17.3142 17.002L15.9704 16.4986C15.3503 17.0462 14.6162 17.4677 13.8083 17.7227L13.5679 19.1644C13.4876 19.6466 13.0704 20 12.5816 20H11.2758C10.787 20 10.3698 19.6466 10.2894 19.1644L10.0408 17.6729C9.27409 17.4081 8.57776 16.9923 7.98745 16.461L6.5433 17.002C6.08553 17.1735 5.57087 16.9889 5.32645 16.5655L4.67358 15.4347C4.42916 15.0114 4.52663 14.4734 4.90404 14.1627L6.11343 13.1671C6.03901 12.7896 6 12.3993 6 12C6 11.6005 6.03905 11.2101 6.11353 10.8325L4.90501 9.83755C4.52761 9.52686 4.43014 8.98886 4.67456 8.56551L5.32743 7.4347C5.57185 7.01136 6.08651 6.82676 6.54428 6.99826L7.98755 7.53896C8.57784 7.00768 9.27413 6.59188 10.0408 6.32714L10.2894 4.8356ZM15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12Z",fill:"currentColor"})),label:(0,S.__)("Edit Block","lazy-blocks"),href:t.edit_url.replace("&","&"),target:"_blank",rel:"noopener noreferrer"})):null,wp.element.createElement("div",{className:"lzb-content-controls","data-lazyblocks-block-name":e.name},wp.element.createElement(ac,uc({placement:"content",isLazyBlockSelected:w,allowErrorNotice:s,meta:C,setMeta:function(){y&&D.apply(void 0,arguments)}},e))),j?wp.element.createElement(Xs,{block:t.slug,clientId:n,attributes:B}):null)}function hc(){return ps.useInnerBlocksProps.save().children}function mc(){return mc=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]&&arguments[0],t=[];return e||(e=u()),e?(e.forEach((function(e){t.push(e),e.innerBlocks&&e.innerBlocks.length&&(t=[].concat(yc(t),yc(s(e.innerBlocks))))})),t):t}),[u]),c=(0,Jt.useCallback)((function(e){var o=n.blockId;if(!o||e){var l={};if(e&&s().forEach((function(e){e.clientId&&e.attributes&&e.attributes.blockId&&(l[e.attributes.blockId]=e.clientId,e.clientId!==r&&e.attributes.blockId===o&&(o=""))})),r&&!o&&void 0!==o){for(var a=o||"",u=10;!a||void 0!==l[a]&&l[a]!==r&&u>0;)a=gc.unique(r),u-=1;if(a&&void 0===l[a]&&(l[a]=r),a!==o){var c="".concat(i.replace("/","-"),"-").concat(a);t({blockId:a,blockUniqueClass:c})}}}}),[n,r,s,i,t]),d=(0,ms.useThrottle)(c,60);(0,Jt.useEffect)((function(){l.lazyblock&&(a.current?d():(a.current=!0,c(!0)))}),[l,n,c,d])}(t),wp.element.createElement(e,t)}}),"withBlockId");(0,gs.addFilter)("editor.BlockEdit","lazyblocks/blockId",Cc)})()})();
\ No newline at end of file