Section Block - Version 1.2.0

Version Description

Fixed: overlay opacity value (float) saved with "px" string at the end (auto-added by Gutenberg) Fixed: first and last inner elements should have no margins on top and bottom relatively Updated: outdated Gutenberg packages

Download this release

Release Info

Developer wedoplugins
Plugin Icon 128x128 Section Block
Version 1.2.0
Comparing to
See all releases

Code changes from version 1.1.0 to 1.2.0

build/block-editor.css CHANGED
@@ -1 +1 @@
1
- .wp-block-wdp-section-block{padding:var(--wdpsb-padding) 0;position:relative}.wp-block-wdp-section-block>*{position:relative}.wp-block-wdp-section-block__background{position:absolute;top:0;left:0;height:100%;width:100vw;z-index:0;overflow:hidden;border:none;border-radius:0;box-shadow:var(--wdpsb-box-shadow-xoffset) var(--wdpsb-box-shadow-yoffset) var(--wdpsb-box-shadow-blurradius) var(--wdpsb-box-shadow-spreadradius) var(--wdpsb-box-shadow-color);background-image:var(--wdpsb-background-image);background-size:cover;background-position:var(--wdpsb-background-image-position-x) var(--wdpsb-background-image-position-y)}.wp-block-wdp-section-block__background::before{position:absolute;content:'';width:100%;height:100%;left:0;top:0;background-color:var(--wdpsb-overlay-background-color);opacity:var(--wdpsb-overlay-opacity);border:none;border-radius:0}.wp-block-wdp-section-block__background::after{position:absolute;content:'';width:100%;height:100%;left:0;top:0;opacity:1;border-width:var(--wdpsb-border-width);border-style:var(--wdpsb-border-style);border-color:var(--wdpsb-border-color);border-radius:0;border-left:none;border-right:none;box-sizing:border-box}@media (min-width:783px){body:not(.folded) .edit-post-layout:not(.is-sidebar-opened) .wp-block-wdp-section-block__background{width:calc(100vw - 160px)}body:not(.folded) .edit-post-layout.is-sidebar-opened .wp-block-wdp-section-block__background{width:calc(100vw - 440px)}body.folded .edit-post-layout:not(.is-sidebar-opened) .wp-block-wdp-section-block__background{width:calc(100vw - 36px)}body.folded .edit-post-layout.is-sidebar-opened .wp-block-wdp-section-block__background{width:calc(100vw - 316px)}}.block-editor-block-list__layout [data-type="wdp/section-block"].block-editor-block-list__block .block-editor-block-list__block-edit:before{z-index:1}
1
+ @charset "UTF-8";.wp-block-wdp-section-block{padding:var(--wdpsb-padding) 0;position:relative}.wp-block-wdp-section-block>*{position:relative}.wp-block-wdp-section-block>:first-child{margin-top:0}.wp-block-wdp-section-block>:last-child{margin-bottom:0}.wp-block-wdp-section-block__background{position:absolute;top:0;left:0;height:100%;width:100vw;z-index:0;overflow:hidden;border:none;border-radius:0;box-shadow:var(--wdpsb-box-shadow-xoffset) var(--wdpsb-box-shadow-yoffset) var(--wdpsb-box-shadow-blurradius) var(--wdpsb-box-shadow-spreadradius) var(--wdpsb-box-shadow-color);background-image:var(--wdpsb-background-image);background-size:cover;background-position:var(--wdpsb-background-image-position-x) var(--wdpsb-background-image-position-y)}.wp-block-wdp-section-block__background::before{position:absolute;content:'';width:100%;height:100%;left:0;top:0;background-color:var(--wdpsb-overlay-background-color);opacity:var(--wdpsb-overlay-opacity);border:none;border-radius:0}.wp-block-wdp-section-block__background::after{position:absolute;content:'';width:100%;height:100%;left:0;top:0;opacity:1;border-width:var(--wdpsb-border-width);border-style:var(--wdpsb-border-style);border-color:var(--wdpsb-border-color);border-radius:0;border-left:none;border-right:none;box-sizing:border-box}@media (min-width:783px){body:not(.folded) .edit-post-layout:not(.is-sidebar-opened) .wp-block-wdp-section-block__background{width:calc(100vw - 160px)}body:not(.folded) .edit-post-layout.is-sidebar-opened .wp-block-wdp-section-block__background{width:calc(100vw - 440px)}body.folded .edit-post-layout:not(.is-sidebar-opened) .wp-block-wdp-section-block__background{width:calc(100vw - 36px)}body.folded .edit-post-layout.is-sidebar-opened .wp-block-wdp-section-block__background{width:calc(100vw - 316px)}}.block-editor-block-list__layout [data-type="wdp/section-block"].block-editor-block-list__block .block-editor-block-list__block-edit:before{z-index:1}.wp-block-wdp-section-block__or-span{display:inline-block;line-height:28px;padding:0 4px 0 6px}
build/block.css CHANGED
@@ -1 +1 @@
1
- .wp-block-wdp-section-block{padding:var(--wdpsb-padding) 0;position:relative}.wp-block-wdp-section-block>*{position:relative}.wp-block-wdp-section-block__background{position:absolute;top:0;left:0;height:100%;width:100vw;z-index:0;overflow:hidden;border:none;border-radius:0;box-shadow:var(--wdpsb-box-shadow-xoffset) var(--wdpsb-box-shadow-yoffset) var(--wdpsb-box-shadow-blurradius) var(--wdpsb-box-shadow-spreadradius) var(--wdpsb-box-shadow-color);background-image:var(--wdpsb-background-image);background-size:cover;background-position:var(--wdpsb-background-image-position-x) var(--wdpsb-background-image-position-y)}.wp-block-wdp-section-block__background::before{position:absolute;content:'';width:100%;height:100%;left:0;top:0;background-color:var(--wdpsb-overlay-background-color);opacity:var(--wdpsb-overlay-opacity);border:none;border-radius:0}.wp-block-wdp-section-block__background::after{position:absolute;content:'';width:100%;height:100%;left:0;top:0;opacity:1;border-width:var(--wdpsb-border-width);border-style:var(--wdpsb-border-style);border-color:var(--wdpsb-border-color);border-radius:0;border-left:none;border-right:none;box-sizing:border-box}
1
+ @charset "UTF-8";.wp-block-wdp-section-block{padding:var(--wdpsb-padding) 0;position:relative}.wp-block-wdp-section-block>*{position:relative}.wp-block-wdp-section-block>:first-child{margin-top:0}.wp-block-wdp-section-block>:last-child{margin-bottom:0}.wp-block-wdp-section-block__background{position:absolute;top:0;left:0;height:100%;width:100vw;z-index:0;overflow:hidden;border:none;border-radius:0;box-shadow:var(--wdpsb-box-shadow-xoffset) var(--wdpsb-box-shadow-yoffset) var(--wdpsb-box-shadow-blurradius) var(--wdpsb-box-shadow-spreadradius) var(--wdpsb-box-shadow-color);background-image:var(--wdpsb-background-image);background-size:cover;background-position:var(--wdpsb-background-image-position-x) var(--wdpsb-background-image-position-y)}.wp-block-wdp-section-block__background::before{position:absolute;content:'';width:100%;height:100%;left:0;top:0;background-color:var(--wdpsb-overlay-background-color);opacity:var(--wdpsb-overlay-opacity);border:none;border-radius:0}.wp-block-wdp-section-block__background::after{position:absolute;content:'';width:100%;height:100%;left:0;top:0;opacity:1;border-width:var(--wdpsb-border-width);border-style:var(--wdpsb-border-style);border-color:var(--wdpsb-border-color);border-radius:0;border-left:none;border-right:none;box-sizing:border-box}
build/block.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){var o={};function t(a){if(o[a])return o[a].exports;var n=o[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,t),n.l=!0,n.exports}t.m=e,t.c=o,t.d=function(e,o,a){t.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:a})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,o){if(1&o&&(e=t(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var n in e)t.d(a,n,function(o){return e[o]}.bind(null,n));return a},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},t.p="",t(t.s=1)}([function(e,o,t){"use strict";function a(e,o){for(var t=0;t<o.length;t++){var a=o[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}t.d(o,"a",function(){return n});var n=new(function(){function e(){!function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this,e)}var o,t,n;return o=e,(t=[{key:"getOffsetLeft",value:function(e){var o=0;do{null!==e.offsetParent&&(null===(e=e.offsetParent)||0===typeof e.offsetLeft||isNaN(e.offsetLeft)||(o+=e.offsetLeft))}while(e.offsetParent);return o}},{key:"update",value:function(e){var o,t=document.getElementById("adminmenuback"),a=0,n=this;null!==t&&(o="none"!==getComputedStyle(t,null).display,a=o?document.body.classList.contains("folded")?36:160:0),Array.from(document.querySelectorAll(".wp-block-wdp-section-block__background")).forEach(function(e){var o;e.style.marginLeft=null,o=n.getOffsetLeft(e),e.style.marginLeft=-1*(o-a)+"px"}),!0===e&&setTimeout(function(){n.update()})}}])&&a(o.prototype,t),n&&a(o,n),e}())},function(e,o,t){"use strict";t.r(o);var a=t(0);function n(e,o){for(var t=0;t<o.length;t++){var a=o[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var l=new(function(){function e(){!function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this,e)}var o,t,a;return o=e,(t=[{key:"convert",value:function(e,o){var t;return e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,o,t,a){return o+o+t+t+a+a}),(t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e))?"rgba(".concat(parseInt(t[1],16),",").concat(parseInt(t[2],16),",").concat(parseInt(t[3],16),",").concat(parseFloat(o,10),")"):e}}])&&n(o.prototype,t),a&&n(o,a),e}());function c(e,o){for(var t=0;t<o.length;t++){var a=o[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var r=new(function(){function e(){!function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this,e)}var o,t,a;return o=e,(t=[{key:"get",value:function(e){var o=e.useCustomStyles,t=e.padding,a=e.overlayBackgroundColor,n=e.overlayOpacity,c=e.borderColor,r=e.borderStyle,i=e.borderWidth,d=e.boxShadowXOffset,s=e.boxShadowYOffset,u=e.boxShadowBlurRadius,b=e.boxShadowSpreadRadius,f=e.boxShadowColor,p=e.boxShadowOpacity,m=e.backgroundImage,y=e.backgroundImageFocalPos,k={};return!1===o?k:(t!==parseInt(WDPSectionBlock.padding,10)&&(k["--wdpsb-padding"]=t+"px"),void 0!==a&&a!==WDPSectionBlock.overlayBackgroundColor&&(k["--wdpsb-overlay-background-color"]=a),n!==parseFloat(WDPSectionBlock.overlayOpacity,10)&&(k["--wdpsb-overlay-opacity"]=n),void 0!==c&&c!==WDPSectionBlock.borderColor&&(k["--wdpsb-border-color"]=c),r!==WDPSectionBlock.borderStyle&&(k["--wdpsb-border-style"]=r),i!==parseInt(WDPSectionBlock.borderWidth,10)&&(k["--wdpsb-border-width"]=i+"px"),d!==parseInt(WDPSectionBlock.boxShadowXOffset,10)&&(k["--wdpsb-box-shadow-xoffset"]=d+"px"),s!==parseInt(WDPSectionBlock.boxShadowYOffset,10)&&(k["--wdpsb-box-shadow-yoffset"]=s+"px"),u!==parseInt(WDPSectionBlock.boxShadowBlurRadius,10)&&(k["--wdpsb-box-shadow-blurradius"]=u+"px"),b!==parseInt(WDPSectionBlock.boxShadowSpreadRadius,10)&&(k["--wdpsb-box-shadow-spreadradius"]=b+"px"),void 0!==f?f===WDPSectionBlock.boxShadowColor&&p===parseFloat(WDPSectionBlock.boxShadowOpacity,10)||(k["--wdpsb-box-shadow-color"]=l.convert(f,p)):p!==parseFloat(WDPSectionBlock.boxShadowOpacity,10)&&(k["--wdpsb-box-shadow-color"]=l.convert(WDPSectionBlock.boxShadowColor,p)),null!==m&&(k["--wdpsb-background-image"]="url('".concat(m,"')")),.5!==y.x&&(k["--wdpsb-background-image-position-x"]=100*y.x+"%"),.5!==y.y&&(k["--wdpsb-background-image-position-y"]=100*y.y+"%"),k)}}])&&c(o.prototype,t),a&&c(o,a),e}()),i=wp.i18n.__,d=wp.blocks.registerBlockType,s=wp.editor,u=s.InnerBlocks,b=s.InspectorControls,f=s.MediaUpload,p=wp.element.Fragment,m=wp.components,y=m.PanelBody,k=m.RangeControl,g=m.SelectControl,S=m.ToggleControl,w=m.ColorPalette,h=m.FocalPointPicker;d("wdp/section-block",{title:i("Section Block (by We Do Plugins)","section-block"),description:i("Cool Section Block for new Block Editor.","section-block"),icon:"index-card",category:"widgets",supports:{align:["wide","full"]},attributes:{useCustomStyles:{type:"boolean",default:!1},padding:{type:"integer",default:parseInt(WDPSectionBlock.padding,10)},overlayBackgroundColor:{type:"string",default:WDPSectionBlock.overlayBackgroundColor},overlayOpacity:{type:"float",default:parseFloat(WDPSectionBlock.overlayOpacity,10)},borderColor:{type:"string",default:WDPSectionBlock.borderColor},borderStyle:{type:"string",default:WDPSectionBlock.borderStyle},borderWidth:{type:"integer",default:parseInt(WDPSectionBlock.borderWidth,10)},boxShadowXOffset:{type:"integer",default:parseInt(WDPSectionBlock.boxShadowXOffset,10)},boxShadowYOffset:{type:"integer",default:parseInt(WDPSectionBlock.boxShadowYOffset,10)},boxShadowBlurRadius:{type:"integer",default:parseInt(WDPSectionBlock.boxShadowBlurRadius,10)},boxShadowSpreadRadius:{type:"integer",default:parseInt(WDPSectionBlock.boxShadowSpreadRadius,10)},boxShadowColor:{type:"string",default:WDPSectionBlock.boxShadowColor},boxShadowOpacity:{type:"float",default:parseFloat(WDPSectionBlock.boxShadowOpacity,10)},backgroundImage:{type:"string",default:null},backgroundImageFocalPos:{type:"object",default:{x:.5,y:.5}}},edit:function(e){var o=e.attributes,t=e.setAttributes,n=e.className,l=o.useCustomStyles,c=o.padding,d=o.overlayBackgroundColor,s=o.overlayOpacity,m=o.borderColor,v=o.borderStyle,x=o.borderWidth,B=o.boxShadowXOffset,C=o.boxShadowYOffset,R=o.boxShadowBlurRadius,P=o.boxShadowSpreadRadius,O=o.boxShadowColor,E=o.boxShadowOpacity,W=o.backgroundImage,D=o.backgroundImageFocalPos;return React.createElement(p,null,React.createElement(b,null,React.createElement(y,{title:i("Use custom styles?","section-block")},React.createElement(S,{label:i("Use custom styles?","section-block"),checked:l,onChange:function(e){t({useCustomStyles:e})}})),!0===l&&React.createElement("div",null,React.createElement(y,{title:i("Overlay","section-block"),initialOpen:!1},React.createElement(p,null,React.createElement("p",null,i("Overlay background color","section-block")),React.createElement(w,{label:i("Overlay background color","section-block"),value:d,colors:WDPSectionBlock.themeColors,onChange:function(e){t({overlayBackgroundColor:e})}})),React.createElement(k,{label:i("Overlay opacity","section-block"),value:s,onChange:function(e){t({overlayOpacity:e})},min:0,max:1,step:.01})),React.createElement(y,{title:i("Padding","section-block"),initialOpen:!1},React.createElement(k,{label:i("Padding","section-block"),value:c,onChange:function(e){t({padding:e})},min:0,max:120})),React.createElement(y,{title:i("Border","section-block"),initialOpen:!1},React.createElement(p,null,React.createElement("p",null,i("Border color","section-block")),React.createElement(w,{label:i("Border color","section-block"),value:m,colors:WDPSectionBlock.themeColors,onChange:function(e){t({borderColor:e})}})),React.createElement(g,{label:i("Border style","section-block"),value:v,onChange:function(e){t({borderStyle:e})},options:[{value:"solid",label:i("Solid","section-block")},{value:"dashed",label:i("Dashed","section-block")},{value:"dotted",label:i("Dotted","section-block")}]}),React.createElement(k,{label:i("Border width","section-block"),value:x,onChange:function(e){t({borderWidth:e})},min:0,max:30})),React.createElement(y,{title:i("Box shadow","section-block"),initialOpen:!1},React.createElement(k,{label:i("X offset","section-block"),value:B,onChange:function(e){t({boxShadowXOffset:e})},min:-100,max:100}),React.createElement(k,{label:i("Y offset","section-block"),value:C,onChange:function(e){t({boxShadowYOffset:e})},min:-100,max:100}),React.createElement(k,{label:i("Blur radius","section-block"),value:R,onChange:function(e){t({boxShadowBlurRadius:e})},min:0,max:100}),React.createElement(k,{label:i("Spread radius","section-block"),value:P,onChange:function(e){t({boxShadowSpreadRadius:e})},min:-100,max:100}),React.createElement(p,null,React.createElement("p",null,i("Box shadow color","section-block")),React.createElement(w,{label:i("Box shadow color","section-block"),value:O,colors:WDPSectionBlock.themeColors,onChange:function(e){t({boxShadowColor:e})}})),React.createElement(k,{label:i("Box shadow color opacity","section-block"),value:E,onChange:function(e){t({boxShadowOpacity:e})},min:0,max:1,step:.01})),React.createElement(y,{title:i("Background image","section-block"),initialOpen:!1},React.createElement(f,{onSelect:function(e){t({backgroundImage:e.sizes.full.url})},type:"image",value:W,render:function(e){var o=e.open;return React.createElement("button",{className:"button",onClick:o},i("Upload image","section-block"))}}),null!==W&&React.createElement(p,null,React.createElement("h4",null,i("Image focal point","section-block")),React.createElement(h,{url:W,value:D,onChange:function(e){t({backgroundImageFocalPos:e})}}))))),React.createElement("div",{className:n,style:!0===l?r.get(o):{}},React.createElement("div",{className:"wp-block-wdp-section-block__background"}),React.createElement(u,null)),a.a.update(!0))},save:function(e){var o=e.attributes,t=e.className,a=o.useCustomStyles;return React.createElement("div",{className:t,style:!0===a?r.get(o):{}},React.createElement("div",{className:"wp-block-wdp-section-block__background"}),React.createElement(u.Content,null))}})}]);
1
+ !function(e){var o={};function t(a){if(o[a])return o[a].exports;var n=o[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,t),n.l=!0,n.exports}t.m=e,t.c=o,t.d=function(e,o,a){t.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:a})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,o){if(1&o&&(e=t(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var n in e)t.d(a,n,function(o){return e[o]}.bind(null,n));return a},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},t.p="",t(t.s=1)}([function(e,o,t){"use strict";function a(e,o){for(var t=0;t<o.length;t++){var a=o[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}t.d(o,"a",function(){return n});var n=new(function(){function e(){!function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this,e)}var o,t,n;return o=e,(t=[{key:"getOffsetLeft",value:function(e){var o=0;do{null!==e.offsetParent&&(null===(e=e.offsetParent)||0===typeof e.offsetLeft||isNaN(e.offsetLeft)||(o+=e.offsetLeft))}while(e.offsetParent);return o}},{key:"update",value:function(e){var o,t=document.getElementById("adminmenuback"),a=0,n=this;null!==t&&(o="none"!==getComputedStyle(t,null).display,a=o?document.body.classList.contains("folded")?36:160:0),Array.from(document.querySelectorAll(".wp-block-wdp-section-block__background")).forEach(function(e){var o;e.style.marginLeft=null,o=n.getOffsetLeft(e),e.style.marginLeft=-1*(o-a)+"px"}),!0===e&&setTimeout(function(){n.update()})}}])&&a(o.prototype,t),n&&a(o,n),e}())},function(e,o,t){"use strict";t.r(o);var a=t(0);function n(e,o){for(var t=0;t<o.length;t++){var a=o[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var l=new(function(){function e(){!function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this,e)}var o,t,a;return o=e,(t=[{key:"convert",value:function(e,o){var t;return e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,o,t,a){return o+o+t+t+a+a}),(t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e))?"rgba(".concat(parseInt(t[1],16),",").concat(parseInt(t[2],16),",").concat(parseInt(t[3],16),",").concat(parseFloat(o,10),")"):e}}])&&n(o.prototype,t),a&&n(o,a),e}());function c(e,o){for(var t=0;t<o.length;t++){var a=o[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var r=new(function(){function e(){!function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this,e)}var o,t,a;return o=e,(t=[{key:"get",value:function(e){var o=e.useCustomStyles,t=e.padding,a=e.overlayBackgroundColor,n=e.overlayOpacity,c=e.borderColor,r=e.borderStyle,i=e.borderWidth,d=e.boxShadowXOffset,s=e.boxShadowYOffset,u=e.boxShadowBlurRadius,b=e.boxShadowSpreadRadius,f=e.boxShadowColor,p=e.boxShadowOpacity,m=e.backgroundImage,k=e.backgroundImageFocalPos,y={};return!1===o?y:(t!==parseInt(WDPSectionBlock.padding,10)&&(y["--wdpsb-padding"]=t+"px"),void 0!==a&&a!==WDPSectionBlock.overlayBackgroundColor&&(y["--wdpsb-overlay-background-color"]=a),n!==parseFloat(WDPSectionBlock.overlayOpacity,10)&&(y["--wdpsb-overlay-opacity"]=n.toString()),void 0!==c&&c!==WDPSectionBlock.borderColor&&(y["--wdpsb-border-color"]=c),r!==WDPSectionBlock.borderStyle&&(y["--wdpsb-border-style"]=r),i!==parseInt(WDPSectionBlock.borderWidth,10)&&(y["--wdpsb-border-width"]=i+"px"),d!==parseInt(WDPSectionBlock.boxShadowXOffset,10)&&(y["--wdpsb-box-shadow-xoffset"]=d+"px"),s!==parseInt(WDPSectionBlock.boxShadowYOffset,10)&&(y["--wdpsb-box-shadow-yoffset"]=s+"px"),u!==parseInt(WDPSectionBlock.boxShadowBlurRadius,10)&&(y["--wdpsb-box-shadow-blurradius"]=u+"px"),b!==parseInt(WDPSectionBlock.boxShadowSpreadRadius,10)&&(y["--wdpsb-box-shadow-spreadradius"]=b+"px"),void 0!==f?f===WDPSectionBlock.boxShadowColor&&p===parseFloat(WDPSectionBlock.boxShadowOpacity,10)||(y["--wdpsb-box-shadow-color"]=l.convert(f,p)):p!==parseFloat(WDPSectionBlock.boxShadowOpacity,10)&&(y["--wdpsb-box-shadow-color"]=l.convert(WDPSectionBlock.boxShadowColor,p)),null!==m&&(y["--wdpsb-background-image"]="url('".concat(m,"')")),.5!==k.x&&(y["--wdpsb-background-image-position-x"]=100*k.x+"%"),.5!==k.y&&(y["--wdpsb-background-image-position-y"]=100*k.y+"%"),y)}}])&&c(o.prototype,t),a&&c(o,a),e}()),i=wp.i18n.__,d=wp.blocks.registerBlockType,s=wp.blockEditor,u=s.InnerBlocks,b=s.InspectorControls,f=s.MediaUpload,p=wp.element.Fragment,m=wp.components,k=m.PanelBody,y=m.RangeControl,g=m.SelectControl,S=m.ToggleControl,w=m.ColorPalette,h=m.FocalPointPicker;d("wdp/section-block",{title:i("Section Block (by We Do Plugins)","section-block"),description:i("Cool Section Block for new Block Editor.","section-block"),icon:"index-card",category:"widgets",supports:{align:["wide","full"]},attributes:{useCustomStyles:{type:"boolean",default:!1},padding:{type:"integer",default:parseInt(WDPSectionBlock.padding,10)},overlayBackgroundColor:{type:"string",default:WDPSectionBlock.overlayBackgroundColor},overlayOpacity:{type:"float",default:parseFloat(WDPSectionBlock.overlayOpacity,10)},borderColor:{type:"string",default:WDPSectionBlock.borderColor},borderStyle:{type:"string",default:WDPSectionBlock.borderStyle},borderWidth:{type:"integer",default:parseInt(WDPSectionBlock.borderWidth,10)},boxShadowXOffset:{type:"integer",default:parseInt(WDPSectionBlock.boxShadowXOffset,10)},boxShadowYOffset:{type:"integer",default:parseInt(WDPSectionBlock.boxShadowYOffset,10)},boxShadowBlurRadius:{type:"integer",default:parseInt(WDPSectionBlock.boxShadowBlurRadius,10)},boxShadowSpreadRadius:{type:"integer",default:parseInt(WDPSectionBlock.boxShadowSpreadRadius,10)},boxShadowColor:{type:"string",default:WDPSectionBlock.boxShadowColor},boxShadowOpacity:{type:"float",default:parseFloat(WDPSectionBlock.boxShadowOpacity,10)},backgroundImage:{type:"string",default:null},backgroundImageFocalPos:{type:"object",default:{x:.5,y:.5}}},edit:function(e){var o=e.attributes,t=e.setAttributes,n=e.className,l=o.useCustomStyles,c=o.padding,d=o.overlayBackgroundColor,s=o.overlayOpacity,m=o.borderColor,v=o.borderStyle,x=o.borderWidth,B=o.boxShadowXOffset,R=o.boxShadowYOffset,C=o.boxShadowBlurRadius,P=o.boxShadowSpreadRadius,E=o.boxShadowColor,O=o.boxShadowOpacity,W=o.backgroundImage,D=o.backgroundImageFocalPos;return React.createElement(p,null,React.createElement(b,null,React.createElement(k,{title:i("Use custom styles?","section-block")},React.createElement(S,{label:i("Use custom styles?","section-block"),checked:l,onChange:function(e){t({useCustomStyles:e})}})),!0===l&&React.createElement("div",null,React.createElement(k,{title:i("Overlay","section-block"),initialOpen:!1},React.createElement(p,null,React.createElement("p",null,i("Overlay background color","section-block")),React.createElement(w,{label:i("Overlay background color","section-block"),value:d,colors:WDPSectionBlock.themeColors,onChange:function(e){t({overlayBackgroundColor:e})}})),React.createElement(y,{label:i("Overlay opacity","section-block"),value:s,onChange:function(e){t({overlayOpacity:e})},min:0,max:1,step:.01})),React.createElement(k,{title:i("Padding","section-block"),initialOpen:!1},React.createElement(y,{label:i("Padding","section-block"),value:c,onChange:function(e){t({padding:e})},min:0,max:120})),React.createElement(k,{title:i("Border","section-block"),initialOpen:!1},React.createElement(p,null,React.createElement("p",null,i("Border color","section-block")),React.createElement(w,{label:i("Border color","section-block"),value:m,colors:WDPSectionBlock.themeColors,onChange:function(e){t({borderColor:e})}})),React.createElement(g,{label:i("Border style","section-block"),value:v,onChange:function(e){t({borderStyle:e})},options:[{value:"solid",label:i("Solid","section-block")},{value:"dashed",label:i("Dashed","section-block")},{value:"dotted",label:i("Dotted","section-block")}]}),React.createElement(y,{label:i("Border width","section-block"),value:x,onChange:function(e){t({borderWidth:e})},min:0,max:30})),React.createElement(k,{title:i("Box shadow","section-block"),initialOpen:!1},React.createElement(y,{label:i("X offset","section-block"),value:B,onChange:function(e){t({boxShadowXOffset:e})},min:-100,max:100}),React.createElement(y,{label:i("Y offset","section-block"),value:R,onChange:function(e){t({boxShadowYOffset:e})},min:-100,max:100}),React.createElement(y,{label:i("Blur radius","section-block"),value:C,onChange:function(e){t({boxShadowBlurRadius:e})},min:0,max:100}),React.createElement(y,{label:i("Spread radius","section-block"),value:P,onChange:function(e){t({boxShadowSpreadRadius:e})},min:-100,max:100}),React.createElement(p,null,React.createElement("p",null,i("Box shadow color","section-block")),React.createElement(w,{label:i("Box shadow color","section-block"),value:E,colors:WDPSectionBlock.themeColors,onChange:function(e){t({boxShadowColor:e})}})),React.createElement(y,{label:i("Box shadow color opacity","section-block"),value:O,onChange:function(e){t({boxShadowOpacity:e})},min:0,max:1,step:.01})),React.createElement(k,{title:i("Background image","section-block"),initialOpen:!1},React.createElement(f,{onSelect:function(e){t({backgroundImage:e.sizes.full.url})},type:"image",value:W,render:function(e){var o=e.open;return React.createElement("button",{className:"button",onClick:o},i("Upload image","section-block"))}}),null!==W&&React.createElement(p,null,React.createElement("span",{className:"wp-block-wdp-section-block__or-span"},i("or","section-block")),React.createElement("a",{href:"#",onClick:function(e){e.preventDefault(),t({backgroundImage:null})}},i("Remove this one","section-block")),React.createElement("h4",null,i("Image focal point","section-block")),React.createElement(h,{url:W,value:D,onChange:function(e){t({backgroundImageFocalPos:e})}}))))),React.createElement("div",{className:n,style:!0===l?r.get(o):{}},React.createElement("div",{className:"wp-block-wdp-section-block__background"}),React.createElement(u,null)),a.a.update(!0))},save:function(e){var o=e.attributes,t=e.className,a=o.useCustomStyles;return React.createElement("div",{className:t,style:!0===a?r.get(o):{}},React.createElement("div",{className:"wp-block-wdp-section-block__background"}),React.createElement(u.Content,null))}})}]);
readme.txt CHANGED
@@ -2,11 +2,11 @@
2
  Contributors: wedoplugins
3
  Tags: block, section, section block, gutenberg, block editor, block library, blocks
4
  Requires at least: 5.1
5
- Tested up to: 5.1
6
  Requires PHP: 5.6
7
  License: GPLv2 or later
8
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
- Stable tag: 1.1.0
10
 
11
  Section Block for new WordPress Block Editor allow you to add Sections to your website and customize it.
12
 
@@ -23,8 +23,6 @@ You can use any other Blocks inside this Section Block so this can be used to bu
23
 
24
  Blocks inside this Section Block can be wide- or full-aligned, but section itself is always full-aligned.
25
 
26
- Please note that this plugin so far require [Gutenberg plugin](https://wordpress.org/plugins/gutenberg/) to be installed with 5.3 version at minimum as it uses FocalPointPicker component as a dependency (this component is not available in WordPress core yet, at least until WordPress 5.2).
27
-
28
  == Installation ==
29
 
30
  1. Install the plugin through the WordPress plugins screen directly or upload the plugin files to the "/wp-content/plugins/section-block" directory.
@@ -33,6 +31,11 @@ Please note that this plugin so far require [Gutenberg plugin](https://wordpress
33
 
34
  == Changelog ==
35
 
 
 
 
 
 
36
  = 1.1.0 =
37
  * Fixed: issue with block height.
38
  * Added: CSS variables polyfill
2
  Contributors: wedoplugins
3
  Tags: block, section, section block, gutenberg, block editor, block library, blocks
4
  Requires at least: 5.1
5
+ Tested up to: 5.2.2
6
  Requires PHP: 5.6
7
  License: GPLv2 or later
8
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
+ Stable tag: 1.2.0
10
 
11
  Section Block for new WordPress Block Editor allow you to add Sections to your website and customize it.
12
 
23
 
24
  Blocks inside this Section Block can be wide- or full-aligned, but section itself is always full-aligned.
25
 
 
 
26
  == Installation ==
27
 
28
  1. Install the plugin through the WordPress plugins screen directly or upload the plugin files to the "/wp-content/plugins/section-block" directory.
31
 
32
  == Changelog ==
33
 
34
+ = 1.2.0 =
35
+ Fixed: overlay opacity value (float) saved with "px" string at the end (auto-added by Gutenberg)
36
+ Fixed: first and last inner elements should have no margins on top and bottom relatively
37
+ Updated: outdated Gutenberg packages
38
+
39
  = 1.1.0 =
40
  * Fixed: issue with block height.
41
  * Added: CSS variables polyfill
section-block.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Adds a Section Block to new WordPress Blocks editor.
6
  * Author: We Do Plugins
7
  * Author URI: http://wedoplugins.com/
8
- * Version: 1.1.0
9
  * License: GPL2+
10
  * Text Domain: section-block
11
  *
@@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
17
  }
18
 
19
  define( 'WDPSB_MAIN_FILE', __FILE__ );
20
- define( 'WDPSB_VERSION', '1.1.0' );
21
 
22
  require_once dirname( WDPSB_MAIN_FILE ) . '/classes/class-wdpsb-config.php';
23
  require_once dirname( WDPSB_MAIN_FILE ) . '/classes/class-wdpsb-enqueue.php';
5
  * Description: Adds a Section Block to new WordPress Blocks editor.
6
  * Author: We Do Plugins
7
  * Author URI: http://wedoplugins.com/
8
+ * Version: 1.2.0
9
  * License: GPL2+
10
  * Text Domain: section-block
11
  *
17
  }
18
 
19
  define( 'WDPSB_MAIN_FILE', __FILE__ );
20
+ define( 'WDPSB_VERSION', '1.2.0' );
21
 
22
  require_once dirname( WDPSB_MAIN_FILE ) . '/classes/class-wdpsb-config.php';
23
  require_once dirname( WDPSB_MAIN_FILE ) . '/classes/class-wdpsb-enqueue.php';