From 19b7243a944fc400cbfdeb6f5c5f24a117be5c5e Mon Sep 17 00:00:00 2001 From: Chrillaz <totalchriz@gmail.com> Date: Mon, 2 Nov 2020 14:51:06 +0100 Subject: [PATCH] patch block name --- blocks.php | 2 +- build/index.asset.php | 2 +- build/index.js | 2 +- readme.txt | 4 ++-- src/filters/attributes.js | 2 +- src/filters/blockEdit.js | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/blocks.php b/blocks.php index 861444a..3e6aedd 100644 --- a/blocks.php +++ b/blocks.php @@ -2,7 +2,7 @@ /** * Plugin Name: Noor Blocks * Description: Collection of custom blocks. - * Version: 1.1.4 + * Version: 1.1.5 * Author: Noor Digital Agency * Author URI: https://noordigital.com * Text Domain: blocks diff --git a/build/index.asset.php b/build/index.asset.php index 8b7570e..31828d8 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ -<?php return array('index.js' => array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => 'b272959f1e9ea39ae01ce48f310d8aa3'), 'accordion.js' => array('dependencies' => array('wp-polyfill'), 'version' => '667f7b37f3c5299d2fe9a3111cca5cee')); \ No newline at end of file +<?php return array('index.js' => array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '2da94a544408b91c3d45dc4074651b37'), 'accordion.js' => array('dependencies' => array('wp-polyfill'), 'version' => '667f7b37f3c5299d2fe9a3111cca5cee')); \ No newline at end of file diff --git a/build/index.js b/build/index.js index 8dd6c04..7455908 100644 --- a/build/index.js +++ b/build/index.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{18:function(e,t,n){}}]),function(e){function t(t){for(var o,a,l=t[0],i=t[1],s=t[2],b=0,d=[];b<l.length;b++)a=l[b],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&d.push(r[a][0]),r[a]=0;for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o]);for(u&&u(t);d.length;)d.shift()();return c.push.apply(c,s||[]),n()}function n(){for(var e,t=0;t<c.length;t++){for(var n=c[t],o=!0,l=1;l<n.length;l++){var i=n[l];0!==r[i]&&(o=!1)}o&&(c.splice(t--,1),e=a(a.s=n[0]))}return e}var o={},r={1:0},c=[];function a(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=o,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(n,o,function(t){return e[t]}.bind(null,o));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var l=window.webpackJsonp=window.webpackJsonp||[],i=l.push.bind(l);l.push=t,l=l.slice();for(var s=0;s<l.length;s++)t(l[s]);var u=i;c.push([14,2]),n()}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t,n){var o=n(5);e.exports=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}},function(e,t){function n(){return e.exports=n=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.apply(this,arguments)}e.exports=n},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t,n){var o=n(15),r=n(16),c=n(8),a=n(17);e.exports=function(e,t){return o(e)||r(e,t)||c(e,t)||a()}},function(e,t){!function(){e.exports=this.wp.data}()},,function(e,t,n){n(23),n(18),e.exports=n(19)},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],o=!0,r=!1,c=void 0;try{for(var a,l=e[Symbol.iterator]();!(o=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){r=!0,c=e}finally{try{o||null==l.return||l.return()}finally{if(r)throw c}}return n}}},function(e,t){e.exports=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.")}},,function(e,t,n){},,,,function(e,t,n){"use strict";n.r(t);var o={};n.r(o),n.d(o,"name",(function(){return O})),n.d(o,"settings",(function(){return f}));var r={};n.r(r),n.d(r,"name",(function(){return _})),n.d(r,"settings",(function(){return C}));var c={};n.r(c),n.d(c,"name",(function(){return w})),n.d(c,"settings",(function(){return I}));var a=n(10),l=n(1),i=n(3),s=n(11),u=n.n(s),b=n(0),d=n(2),m=n(9),p=n.n(m),g=function(e){var t=e.onClick,n=e.options,o=e.initialChecked,r=e.showIcons,c=e.label;return Object(b.createElement)(d.ButtonGroup,p()({mode:"radio"},!r&&{onClick:function(e){return t(e)}}),c&&Object(b.createElement)("p",null,Object(b.createElement)("strong",null,c)),n.map((function(e,n){return Object(b.createElement)(d.Button,p()({},r&&{onClick:function(e){return t(e)}},{className:o===e&&"is-primary",key:n,checked:o,value:e}),r?Object(b.createElement)(d.Dashicon,{icon:e}):e)})))};var O="accordion",f={title:Object(l.__)("Accordion","accordion"),description:Object(l.__)("Accordion block","blocks"),category:"noor-collection",icon:"list-view",supports:{html:!1},attributes:{anchorContent:{type:"string",default:""},titleContent:{type:"string",default:"Example title..."},titleTag:{type:"string",default:"h4"},initialState:{type:"boolean",default:!1},titleColor:{type:"string"},titleBackground:{type:"string"},contentBackground:{type:"string"},expandIcon:{type:"string",default:"arrow-down-alt2"},collapseIcon:{type:"string",default:"arrow-up-alt2"},iconAlignment:{type:"string",default:"right"},mediaControl:{type:"boolean",default:!0}},edit:Object(i.withColors)({titleColor:"color",titleBackground:"background-color",contentBackground:"background-color"})((function(e){var t=e.titleColor,n=e.setTitleColor,o=e.titleBackground,r=e.setTitleBackground,c=e.contentBackground,a=e.setContentBackground,s=e.attributes,m=e.setAttributes,p=(e.mediaControl,Object(b.useState)(!1)),O=u()(p,2),f=O[0],j=O[1],h=null!=t.class?t.class:"",_=null!=o.class?o.class:"",C=null!=c.class?c.class:"",y={expand:["arrow-down","arrow-right","arrow-down-alt2","arrow-right-alt2","arrow-down-alt","arrow-right-alt","plus"],collapse:["arrow-up","arrow-up-alt2","minus","arrow-up-alt","no-alt"]};return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(i.InspectorControls,null,Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Base Settings"),initialOpen:!0},Object(b.createElement)("label",{className:"block-base-control__label"},Object(b.createElement)("strong",null,Object(l.__)("Anchor title"))),Object(b.createElement)(d.__experimentalInputControl,{value:s.anchorContent,onChange:function(e){return m({anchorContent:e})}}),Object(b.createElement)("label",{className:"block-base-control__label"},Object(b.createElement)("strong",null,Object(l.__)("Initial state"))),Object(b.createElement)(d.ToggleControl,{label:s.initialState?"Expanded by default":"Collapsed by default",checked:s.initialState,onChange:function(){return m({initialState:!s.initialState})}}),Object(b.createElement)(g,{label:Object(l.__)("Title size"),onClick:function(e){return m({titleTag:e.target.value})},options:["h1","h2","h3","h4","h5","h6"],initialChecked:s.titleTag})),Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Icon settings"),initialOpen:!1},Object(b.createElement)(g,{label:Object(l.__)("Expand Icon"),onClick:function(e){return e.preventDefault(),m({expandIcon:e.currentTarget.value})},options:y.expand,initialChecked:s.expandIcon,showIcons:!0}),Object(b.createElement)(g,{label:Object(l.__)("Collapse Icon"),onClick:function(e){return e.preventDefault(),m({collapseIcon:e.currentTarget.value})},options:y.collapse,initialChecked:s.collapseIcon,showIcons:!0})),Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Mobile View Control"),initialOpen:!0},Object(b.createElement)(d.ToggleControl,{label:Object(l.__)("".concat(e.attributes.mediaControl?"Display":"Hide"," on mobile")),checked:e.attributes.mediaControl,onChange:function(t){return e.setAttributes({mediaControl:t})}})),Object(b.createElement)(i.PanelColorSettings,{title:Object(l.__)("Color settings"),initialOpen:!1,colorSettings:[{value:t.color,onChange:n,label:Object(l.__)("Title text color")},{value:o.color,onChange:r,label:Object(l.__)("Title background color")},{value:c.color,onChange:a,label:Object(l.__)("Content background color")}]})),Object(b.createElement)("div",{id:"#".concat(s.anchorContent),className:"noor-block-accordion ".concat(_),onClick:function(){return j(!f)},"aria-expanded":"".concat(s.initialState||f)},Object(b.createElement)(i.RichText,{className:"noor-block-accordion__title ".concat(h),tagName:s.titleTag,value:s.titleContent,formattingControls:["bold","italic","align"],onChange:function(e){return m({titleContent:e})}}),Object(b.createElement)(d.Dashicon,{icon:f?s.collapseIcon:s.expandIcon,className:"noor-block-accordion__icon ".concat(h)})),Object(b.createElement)("div",{className:"noor-block-accordion__content ".concat(C)},Object(b.createElement)(i.InnerBlocks,{allowedBlocks:["core/paragraph","core/list","core/button"],template:[["core/paragraph",{}]]})))})),save:function(e){var t=e.attributes,n=t.titleColor,o=t.titleBackground,r=t.contentBackground,c=t.mediaControl,a=null!=n?Object(i.getColorClassName)("color",n):"",l=null!=o?Object(i.getColorClassName)("background-color",o):"",s=null!=r?Object(i.getColorClassName)("background-color",r):"",u=c?"":"on-media-hide";return Object(b.createElement)(b.Fragment,null,Object(b.createElement)("div",{id:"#".concat(t.anchorContent),className:"noor-block-accordion ".concat(l," ").concat(u),"aria-expanded":t.initialState},Object(b.createElement)(i.RichText.Content,{className:"noor-block-accordion__title ".concat(a),tagName:t.titleTag,value:t.titleContent}),Object(b.createElement)("span",{className:"noor-block-accordion__icon dashicons dashicons-".concat(t.expandIcon," ").concat(a),"aria-hidden":"true","data-state":!t.initialState}),Object(b.createElement)("span",{className:"noor-block-accordion__icon dashicons dashicons-".concat(t.collapseIcon," ").concat(a),"aria-hidden":"true","data-state":t.initialState})),Object(b.createElement)("div",{className:"noor-block-accordion__content ".concat(s)},Object(b.createElement)(i.InnerBlocks.Content,null)))}},j=n(4),h=n(12);var _="bullet-point",C={title:Object(l.__)("Bullet point","accordion"),description:Object(l.__)("Bullet point block","blocks"),category:"noor-collection",icon:"marker",supports:{html:!1},attributes:{color:{type:"string"},backgroundColor:{type:"string"},align:{type:"string",default:"center"},useMedia:{type:"boolean",default:!1},mediaInput:{type:"string",default:""},mediaId:{type:"number",default:0},mediaUrl:{type:"string",default:""},mediaControl:{type:"boolean",default:!0}},edit:Object(j.compose)(Object(i.withColors)({color:"color",backgroundColor:"background-color"}),Object(h.withSelect)((function(e,t){return{media:t.attributes.mediaId?e("core").getMedia(t.attributes.mediaId):void 0}})))((function(e){var t=e.color,n=e.setColor,o=e.backgroundColor,r=e.setBackgroundColor,c=e.attributes,a=e.setAttributes,s=(e.className,c.align),u=c.mediaId,m=(c.mediaControl,null!=t.class?t.class:""),p=null!=o.class?o.class:"";return""!=c.mediaUrl&&c.mediaUrl,Object(b.createElement)(b.Fragment,null,Object(b.createElement)(i.InspectorControls,null,Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Content settings"),initialOpen:!1},Object(b.createElement)(d.ToggleControl,{label:c.useMedia?"Set text content":"Set background image",checked:c.useMedia,onChange:function(){return a({useMedia:!c.useMedia})}}),c.useMedia?Object(b.createElement)("div",{className:"editor-post-featured-image"},Object(b.createElement)(i.MediaUploadCheck,null,Object(b.createElement)(i.MediaUpload,{onSelect:function(t){e.setAttributes({mediaId:t.id,mediaUrl:t.url})},value:u,allowedTypes:["image"],render:function(t){var n=t.open;return Object(b.createElement)(d.Button,{className:0==u?"editor-post-featured-image__toggle":"editor-post-featured-image__preview",onClick:n},0==u&&Object(l.__)("Choose an image"),null!=e.media&&Object(b.createElement)(d.ResponsiveWrapper,{naturalWidth:e.media.media_details.width,naturalHeight:e.media.media_details.height},Object(b.createElement)("img",{src:e.media.source_url})))}}))):Object(b.createElement)(d.__experimentalInputControl,{value:c.mediaInput,onChange:function(e){return a({mediaInput:e})}})),Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Mobile View Control"),initialOpen:!0},Object(b.createElement)(d.ToggleControl,{label:Object(l.__)("".concat(e.attributes.mediaControl?"Display":"Hide"," on mobile")),checked:e.attributes.mediaControl,onChange:function(t){return e.setAttributes({mediaControl:t})}})),Object(b.createElement)(i.PanelColorSettings,{title:Object(l.__)("Colot settings"),initialOpen:!0,colorSettings:[{value:t.color,onChange:n,label:Object(l.__)("Text color")},{value:o.color,onChange:r,label:Object(l.__)("Background color")}]})),Object(b.createElement)(i.BlockControls,null,Object(b.createElement)(i.BlockAlignmentToolbar,{value:s,onChange:function(e){a({align:e})},controls:["left","right","center"]})),Object(b.createElement)("div",{className:"noor-block-bullet-point has-align-".concat(s)},Object(b.createElement)("div",{className:"noor-block-bullet-point__point ".concat(p)},c.useMedia&&0!=c.mediaId?Object(b.createElement)("img",{src:c.mediaUrl}):Object(b.createElement)("h3",{className:"noor-block-bullet-point__text-content ".concat(m)},c.mediaInput))))})),save:function(e){var t=e.attributes,n=t.color,o=t.backgroundColor,r=t.align,c=t.mediaControl,a=null!=n?Object(i.getColorClassName)("color",n):"",l=null!=o?Object(i.getColorClassName)("background-color",o):"",s=c?"":"on-media-hide";return Object(b.createElement)("div",{className:"noor-block-bullet-point has-align-".concat(r," ").concat(s)},Object(b.createElement)("div",{className:"noor-block-bullet-point__point ".concat(l)},t.useMedia&&0!=t.mediaId?Object(b.createElement)("img",{src:t.mediaUrl}):Object(b.createElement)("h3",{className:"noor-block-bullet-point__text-content ".concat(a)},t.mediaInput)))}},y=n(6),k=n.n(y);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var w="google-map",I={title:Object(l.__)("Google map","noorblocks"),description:Object(l.__)("Embeds an google maps iframe","noorblocks"),category:"noor-collection",icon:"location-alt",supports:{html:!1,align:!0},attributes:{zoom:{type:"number",default:20},width:{type:"number",default:100},height:{type:"number",default:75},address:{type:"object",default:{street:"",zip:"",city:"",country:"sweden"}},src:{type:"string"},mediaControl:{type:"boolean",default:!0}},edit:function(e){var t=options.map_secret_key,n=e.attributes,o=e.setAttributes,r=n.width,c=n.height,a=n.zoom,s=n.address,u=(n.mediaControl,Object.values(s).filter((function(e){return""!=e})).reduce((function(e,t,n){return e+" "+t}),"").trim().toLowerCase()),m="".concat("https://www.google.com/maps/embed/v1/place?key="+t,"&q=").concat(encodeURI(u),"&zoom=").concat(a);o({src:m});var p={width:r+"%",paddingBottom:c+"%"};return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(i.InspectorControls,null,Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Map Controls"),initialOpen:!0},Object(b.createElement)(d.RangeControl,{label:Object(l.__)("Frame Width"),value:r,onChange:function(e){return o({width:e})},min:0,max:100}),Object(b.createElement)(d.RangeControl,{label:Object(l.__)("Frame Height"),value:c,onChange:function(e){return o({height:e})},min:0,max:100}),Object(b.createElement)(d.RangeControl,{label:Object(l.__)("Frame Zoom"),value:a,onChange:function(e){return o({zoom:e})},min:0,max:100})),Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Map Location"),initialOpen:!0},Object(b.createElement)("label",{className:"block-base-control__label"},Object(b.createElement)("strong",null,Object(l.__)("Street Address"))),Object(b.createElement)(d.__experimentalInputControl,{value:s.street,onChange:function(e){return o({address:v(v({},s),{},{street:e})})}}),Object(b.createElement)("label",{className:"block-base-control__label"},Object(b.createElement)("strong",null,Object(l.__)("Postal Code/Zip"))),Object(b.createElement)(d.__experimentalInputControl,{value:s.zip,onChange:function(e){return o({address:v(v({},s),{},{zip:e})})}}),Object(b.createElement)("label",{className:"block-base-control__label"},Object(b.createElement)("strong",null,Object(l.__)("City"))),Object(b.createElement)(d.__experimentalInputControl,{value:s.city,onChange:function(e){return o({address:v(v({},s),{},{city:e})})}}),Object(b.createElement)("label",{className:"block-base-control__label"},Object(b.createElement)("strong",null,Object(l.__)("Country"))),Object(b.createElement)(d.__experimentalInputControl,{value:s.country,onChange:function(e){return o({address:v(v({},s),{},{country:e})})}})),Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Mobile View Control"),initialOpen:!0},Object(b.createElement)(ToggleControl,{label:Object(l.__)("".concat(e.attributes.mediaControl?"Display":"Hide"," on mobile")),checked:e.attributes.mediaControl,onChange:function(t){return e.setAttributes({mediaControl:t})}}))),Object(b.createElement)("div",{className:"noor-block-google-map",style:p},""!=t?Object(b.createElement)("iframe",{width:"361",height:"160",src:m,frameBorder:"0",allowFullScreen:!0}):Object(b.createElement)("p",null,Object(l.__)("Please provide API key in settings"))))},save:function(e){var t=e.attributes,n=t.width,o=t.height,r=t.src;return e.className="noor-block-google-map ".concat(e.attributes.mediaControl?"":"on-media-hide"),Object(b.createElement)("div",{className:e.className,style:{width:"".concat(n,"%"),paddingBottom:"".concat(o,"%")}},Object(b.createElement)("iframe",{width:"361",height:"160",frameBorder:"0",src:r,allowFullScreen:!0}))}},x=n(7);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var N={useIcon:{type:"boolean",default:!0},alignIcon:{type:"boolean",default:!1},icon:{type:"string",default:"arrow-right-alt"}},S=function(e){var t=e.setAttributes,n=e.attributes.mediaControl;return Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Mobile View Control"),initialOpen:!0},Object(b.createElement)(d.ToggleControl,{label:Object(l.__)("".concat(n?"Display":"Hide"," on mobile")),checked:n,onChange:function(e){return t({mediaControl:e})}}))},T=function(e){var t=e.backgroundColor,n=e.setBackgroundColor;return(0,e.setAttributes)({className:null!=t.class?t.class+" has-background":""}),Object(b.createElement)(i.PanelColorSettings,{title:Object(l.__)("Color settings"),initialOpen:!1,colorSettings:[{value:t.color,onChange:n,label:Object(l.__)("Column background color")}]})},A=function(e){var t=e.attributes,n=t.useIcon,o=t.alignIcon,r=t.icon,c=e.setAttributes,a=function(e,t){var a,l;t&&t.preventDefault(),c({icon:e}),a=o?"has-left-icon":"has-right-icon",l=n&&""!==r?"has-icon-".concat(r):"",c({className:a+" "+l})};return a(r),Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Inline Icon Control"),initialOpen:!0},Object(b.createElement)(d.ToggleControl,{label:Object(l.__)("Use inline icon"),checked:n,onChange:function(e){c({useIcon:e}),e||a("")}}),Object(b.createElement)(d.ToggleControl,{label:o?Object(l.__)("Icon before"):Object(l.__)("Icon after"),checked:o,onChange:function(){return c({alignIcon:!o})}}),n&&Object(b.createElement)(g,{label:Object(l.__)("Inline Icon"),onClick:function(e){e.preventDefault(),c({icon:e.currentTarget.value,event:e})},options:["arrow-right-alt","arrow-left-alt","arrow-right-alt2","arrow-left-alt2","clock","location"],initialChecked:r,showIcons:!0}))},M=function(e){var t=e.color,n=e.setColor,o=e.backgroundColor,r=e.setBackgroundColor,c=e.setAttributes;return c({className:null!=t.class?t.class+" has-color":""}),c({className:null!=o.class?o.class+" has-background":""}),Object(b.createElement)(Fragment,null,Object(b.createElement)(i.PanelColorSettings,{title:Object(l.__)("Color settings"),initialOpen:!1,colorSettings:[{value:o.color,onChange:r,label:Object(l.__)("Button background color")},{value:t.color,onChange:n,label:Object(l.__)("Button text color")}]}),Object(b.createElement)(A,e))},D={attributes:function(e,t){return t.includes("noor")||Object.assign(e.attributes,{mediaControl:{type:"boolean",default:!0}}),"core/button"===t&&Object.assign(e.attributes,B({},N)),"wp-bootstrap-blocks"===t&&Object.assign(e.attributes,B(B({},N),{},{backgroundColor:{type:"string"},color:{type:"string"}})),"core/column"===t&&Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e},blockEdit:Object(j.compose)(Object(i.withColors)({backgroundColor:"background-color",color:"color"}),Object(j.createHigherOrderComponent)((function(e){return function(t){return t.name.includes("noor")?Object(b.createElement)(e,t):Object(b.createElement)(b.Fragment,null,Object(b.createElement)(e,t),Object(b.createElement)(i.InspectorControls,null,Object(b.createElement)(S,t),"core/column"===t.name&&Object(b.createElement)(T,t),"core/button"===t.name&&Object(b.createElement)(A,t),"wp-bootstrap-blocks"===t.name&&Object(b.createElement)(M,t)))}}),"blockEdit")),extraProps:function(e,t,n){return n.mediaControl||t.name.includes("noor")||(e.className=e.className+" on-media-hide"),e}};Object(x.addFilter)("blocks.registerBlockType","noor/gutenberg-blocks/custom-attributes",D.attributes),Object(x.addFilter)("editor.BlockEdit","noor/gutenberg-blocks/custom-control",D.blockEdit),Object(x.addFilter)("blocks.getSaveContent.extraProps","noor/gutenberg-blocks/extraProps",D.extraProps),[o,r,c].forEach((function(e){return function(e){var t=e.name,n=e.settings;Object(a.registerBlockType)("noor/"+t,n)}(e)}))}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{18:function(e,t,n){}}]),function(e){function t(t){for(var o,a,l=t[0],i=t[1],s=t[2],b=0,d=[];b<l.length;b++)a=l[b],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&d.push(r[a][0]),r[a]=0;for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o]);for(u&&u(t);d.length;)d.shift()();return c.push.apply(c,s||[]),n()}function n(){for(var e,t=0;t<c.length;t++){for(var n=c[t],o=!0,l=1;l<n.length;l++){var i=n[l];0!==r[i]&&(o=!1)}o&&(c.splice(t--,1),e=a(a.s=n[0]))}return e}var o={},r={1:0},c=[];function a(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=o,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(n,o,function(t){return e[t]}.bind(null,o));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var l=window.webpackJsonp=window.webpackJsonp||[],i=l.push.bind(l);l.push=t,l=l.slice();for(var s=0;s<l.length;s++)t(l[s]);var u=i;c.push([14,2]),n()}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t,n){var o=n(5);e.exports=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}},function(e,t){function n(){return e.exports=n=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.apply(this,arguments)}e.exports=n},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t,n){var o=n(15),r=n(16),c=n(8),a=n(17);e.exports=function(e,t){return o(e)||r(e,t)||c(e,t)||a()}},function(e,t){!function(){e.exports=this.wp.data}()},,function(e,t,n){n(23),n(18),e.exports=n(19)},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],o=!0,r=!1,c=void 0;try{for(var a,l=e[Symbol.iterator]();!(o=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){r=!0,c=e}finally{try{o||null==l.return||l.return()}finally{if(r)throw c}}return n}}},function(e,t){e.exports=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.")}},,function(e,t,n){},,,,function(e,t,n){"use strict";n.r(t);var o={};n.r(o),n.d(o,"name",(function(){return O})),n.d(o,"settings",(function(){return f}));var r={};n.r(r),n.d(r,"name",(function(){return _})),n.d(r,"settings",(function(){return C}));var c={};n.r(c),n.d(c,"name",(function(){return w})),n.d(c,"settings",(function(){return I}));var a=n(10),l=n(1),i=n(3),s=n(11),u=n.n(s),b=n(0),d=n(2),m=n(9),p=n.n(m),g=function(e){var t=e.onClick,n=e.options,o=e.initialChecked,r=e.showIcons,c=e.label;return Object(b.createElement)(d.ButtonGroup,p()({mode:"radio"},!r&&{onClick:function(e){return t(e)}}),c&&Object(b.createElement)("p",null,Object(b.createElement)("strong",null,c)),n.map((function(e,n){return Object(b.createElement)(d.Button,p()({},r&&{onClick:function(e){return t(e)}},{className:o===e&&"is-primary",key:n,checked:o,value:e}),r?Object(b.createElement)(d.Dashicon,{icon:e}):e)})))};var O="accordion",f={title:Object(l.__)("Accordion","accordion"),description:Object(l.__)("Accordion block","blocks"),category:"noor-collection",icon:"list-view",supports:{html:!1},attributes:{anchorContent:{type:"string",default:""},titleContent:{type:"string",default:"Example title..."},titleTag:{type:"string",default:"h4"},initialState:{type:"boolean",default:!1},titleColor:{type:"string"},titleBackground:{type:"string"},contentBackground:{type:"string"},expandIcon:{type:"string",default:"arrow-down-alt2"},collapseIcon:{type:"string",default:"arrow-up-alt2"},iconAlignment:{type:"string",default:"right"},mediaControl:{type:"boolean",default:!0}},edit:Object(i.withColors)({titleColor:"color",titleBackground:"background-color",contentBackground:"background-color"})((function(e){var t=e.titleColor,n=e.setTitleColor,o=e.titleBackground,r=e.setTitleBackground,c=e.contentBackground,a=e.setContentBackground,s=e.attributes,m=e.setAttributes,p=(e.mediaControl,Object(b.useState)(!1)),O=u()(p,2),f=O[0],j=O[1],h=null!=t.class?t.class:"",_=null!=o.class?o.class:"",C=null!=c.class?c.class:"",y={expand:["arrow-down","arrow-right","arrow-down-alt2","arrow-right-alt2","arrow-down-alt","arrow-right-alt","plus"],collapse:["arrow-up","arrow-up-alt2","minus","arrow-up-alt","no-alt"]};return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(i.InspectorControls,null,Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Base Settings"),initialOpen:!0},Object(b.createElement)("label",{className:"block-base-control__label"},Object(b.createElement)("strong",null,Object(l.__)("Anchor title"))),Object(b.createElement)(d.__experimentalInputControl,{value:s.anchorContent,onChange:function(e){return m({anchorContent:e})}}),Object(b.createElement)("label",{className:"block-base-control__label"},Object(b.createElement)("strong",null,Object(l.__)("Initial state"))),Object(b.createElement)(d.ToggleControl,{label:s.initialState?"Expanded by default":"Collapsed by default",checked:s.initialState,onChange:function(){return m({initialState:!s.initialState})}}),Object(b.createElement)(g,{label:Object(l.__)("Title size"),onClick:function(e){return m({titleTag:e.target.value})},options:["h1","h2","h3","h4","h5","h6"],initialChecked:s.titleTag})),Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Icon settings"),initialOpen:!1},Object(b.createElement)(g,{label:Object(l.__)("Expand Icon"),onClick:function(e){return e.preventDefault(),m({expandIcon:e.currentTarget.value})},options:y.expand,initialChecked:s.expandIcon,showIcons:!0}),Object(b.createElement)(g,{label:Object(l.__)("Collapse Icon"),onClick:function(e){return e.preventDefault(),m({collapseIcon:e.currentTarget.value})},options:y.collapse,initialChecked:s.collapseIcon,showIcons:!0})),Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Mobile View Control"),initialOpen:!0},Object(b.createElement)(d.ToggleControl,{label:Object(l.__)("".concat(e.attributes.mediaControl?"Display":"Hide"," on mobile")),checked:e.attributes.mediaControl,onChange:function(t){return e.setAttributes({mediaControl:t})}})),Object(b.createElement)(i.PanelColorSettings,{title:Object(l.__)("Color settings"),initialOpen:!1,colorSettings:[{value:t.color,onChange:n,label:Object(l.__)("Title text color")},{value:o.color,onChange:r,label:Object(l.__)("Title background color")},{value:c.color,onChange:a,label:Object(l.__)("Content background color")}]})),Object(b.createElement)("div",{id:"#".concat(s.anchorContent),className:"noor-block-accordion ".concat(_),onClick:function(){return j(!f)},"aria-expanded":"".concat(s.initialState||f)},Object(b.createElement)(i.RichText,{className:"noor-block-accordion__title ".concat(h),tagName:s.titleTag,value:s.titleContent,formattingControls:["bold","italic","align"],onChange:function(e){return m({titleContent:e})}}),Object(b.createElement)(d.Dashicon,{icon:f?s.collapseIcon:s.expandIcon,className:"noor-block-accordion__icon ".concat(h)})),Object(b.createElement)("div",{className:"noor-block-accordion__content ".concat(C)},Object(b.createElement)(i.InnerBlocks,{allowedBlocks:["core/paragraph","core/list","core/button"],template:[["core/paragraph",{}]]})))})),save:function(e){var t=e.attributes,n=t.titleColor,o=t.titleBackground,r=t.contentBackground,c=t.mediaControl,a=null!=n?Object(i.getColorClassName)("color",n):"",l=null!=o?Object(i.getColorClassName)("background-color",o):"",s=null!=r?Object(i.getColorClassName)("background-color",r):"",u=c?"":"on-media-hide";return Object(b.createElement)(b.Fragment,null,Object(b.createElement)("div",{id:"#".concat(t.anchorContent),className:"noor-block-accordion ".concat(l," ").concat(u),"aria-expanded":t.initialState},Object(b.createElement)(i.RichText.Content,{className:"noor-block-accordion__title ".concat(a),tagName:t.titleTag,value:t.titleContent}),Object(b.createElement)("span",{className:"noor-block-accordion__icon dashicons dashicons-".concat(t.expandIcon," ").concat(a),"aria-hidden":"true","data-state":!t.initialState}),Object(b.createElement)("span",{className:"noor-block-accordion__icon dashicons dashicons-".concat(t.collapseIcon," ").concat(a),"aria-hidden":"true","data-state":t.initialState})),Object(b.createElement)("div",{className:"noor-block-accordion__content ".concat(s)},Object(b.createElement)(i.InnerBlocks.Content,null)))}},j=n(4),h=n(12);var _="bullet-point",C={title:Object(l.__)("Bullet point","accordion"),description:Object(l.__)("Bullet point block","blocks"),category:"noor-collection",icon:"marker",supports:{html:!1},attributes:{color:{type:"string"},backgroundColor:{type:"string"},align:{type:"string",default:"center"},useMedia:{type:"boolean",default:!1},mediaInput:{type:"string",default:""},mediaId:{type:"number",default:0},mediaUrl:{type:"string",default:""},mediaControl:{type:"boolean",default:!0}},edit:Object(j.compose)(Object(i.withColors)({color:"color",backgroundColor:"background-color"}),Object(h.withSelect)((function(e,t){return{media:t.attributes.mediaId?e("core").getMedia(t.attributes.mediaId):void 0}})))((function(e){var t=e.color,n=e.setColor,o=e.backgroundColor,r=e.setBackgroundColor,c=e.attributes,a=e.setAttributes,s=(e.className,c.align),u=c.mediaId,m=(c.mediaControl,null!=t.class?t.class:""),p=null!=o.class?o.class:"";return""!=c.mediaUrl&&c.mediaUrl,Object(b.createElement)(b.Fragment,null,Object(b.createElement)(i.InspectorControls,null,Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Content settings"),initialOpen:!1},Object(b.createElement)(d.ToggleControl,{label:c.useMedia?"Set text content":"Set background image",checked:c.useMedia,onChange:function(){return a({useMedia:!c.useMedia})}}),c.useMedia?Object(b.createElement)("div",{className:"editor-post-featured-image"},Object(b.createElement)(i.MediaUploadCheck,null,Object(b.createElement)(i.MediaUpload,{onSelect:function(t){e.setAttributes({mediaId:t.id,mediaUrl:t.url})},value:u,allowedTypes:["image"],render:function(t){var n=t.open;return Object(b.createElement)(d.Button,{className:0==u?"editor-post-featured-image__toggle":"editor-post-featured-image__preview",onClick:n},0==u&&Object(l.__)("Choose an image"),null!=e.media&&Object(b.createElement)(d.ResponsiveWrapper,{naturalWidth:e.media.media_details.width,naturalHeight:e.media.media_details.height},Object(b.createElement)("img",{src:e.media.source_url})))}}))):Object(b.createElement)(d.__experimentalInputControl,{value:c.mediaInput,onChange:function(e){return a({mediaInput:e})}})),Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Mobile View Control"),initialOpen:!0},Object(b.createElement)(d.ToggleControl,{label:Object(l.__)("".concat(e.attributes.mediaControl?"Display":"Hide"," on mobile")),checked:e.attributes.mediaControl,onChange:function(t){return e.setAttributes({mediaControl:t})}})),Object(b.createElement)(i.PanelColorSettings,{title:Object(l.__)("Colot settings"),initialOpen:!0,colorSettings:[{value:t.color,onChange:n,label:Object(l.__)("Text color")},{value:o.color,onChange:r,label:Object(l.__)("Background color")}]})),Object(b.createElement)(i.BlockControls,null,Object(b.createElement)(i.BlockAlignmentToolbar,{value:s,onChange:function(e){a({align:e})},controls:["left","right","center"]})),Object(b.createElement)("div",{className:"noor-block-bullet-point has-align-".concat(s)},Object(b.createElement)("div",{className:"noor-block-bullet-point__point ".concat(p)},c.useMedia&&0!=c.mediaId?Object(b.createElement)("img",{src:c.mediaUrl}):Object(b.createElement)("h3",{className:"noor-block-bullet-point__text-content ".concat(m)},c.mediaInput))))})),save:function(e){var t=e.attributes,n=t.color,o=t.backgroundColor,r=t.align,c=t.mediaControl,a=null!=n?Object(i.getColorClassName)("color",n):"",l=null!=o?Object(i.getColorClassName)("background-color",o):"",s=c?"":"on-media-hide";return Object(b.createElement)("div",{className:"noor-block-bullet-point has-align-".concat(r," ").concat(s)},Object(b.createElement)("div",{className:"noor-block-bullet-point__point ".concat(l)},t.useMedia&&0!=t.mediaId?Object(b.createElement)("img",{src:t.mediaUrl}):Object(b.createElement)("h3",{className:"noor-block-bullet-point__text-content ".concat(a)},t.mediaInput)))}},y=n(6),k=n.n(y);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var w="google-map",I={title:Object(l.__)("Google map","noorblocks"),description:Object(l.__)("Embeds an google maps iframe","noorblocks"),category:"noor-collection",icon:"location-alt",supports:{html:!1,align:!0},attributes:{zoom:{type:"number",default:20},width:{type:"number",default:100},height:{type:"number",default:75},address:{type:"object",default:{street:"",zip:"",city:"",country:"sweden"}},src:{type:"string"},mediaControl:{type:"boolean",default:!0}},edit:function(e){var t=options.map_secret_key,n=e.attributes,o=e.setAttributes,r=n.width,c=n.height,a=n.zoom,s=n.address,u=(n.mediaControl,Object.values(s).filter((function(e){return""!=e})).reduce((function(e,t,n){return e+" "+t}),"").trim().toLowerCase()),m="".concat("https://www.google.com/maps/embed/v1/place?key="+t,"&q=").concat(encodeURI(u),"&zoom=").concat(a);o({src:m});var p={width:r+"%",paddingBottom:c+"%"};return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(i.InspectorControls,null,Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Map Controls"),initialOpen:!0},Object(b.createElement)(d.RangeControl,{label:Object(l.__)("Frame Width"),value:r,onChange:function(e){return o({width:e})},min:0,max:100}),Object(b.createElement)(d.RangeControl,{label:Object(l.__)("Frame Height"),value:c,onChange:function(e){return o({height:e})},min:0,max:100}),Object(b.createElement)(d.RangeControl,{label:Object(l.__)("Frame Zoom"),value:a,onChange:function(e){return o({zoom:e})},min:0,max:100})),Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Map Location"),initialOpen:!0},Object(b.createElement)("label",{className:"block-base-control__label"},Object(b.createElement)("strong",null,Object(l.__)("Street Address"))),Object(b.createElement)(d.__experimentalInputControl,{value:s.street,onChange:function(e){return o({address:v(v({},s),{},{street:e})})}}),Object(b.createElement)("label",{className:"block-base-control__label"},Object(b.createElement)("strong",null,Object(l.__)("Postal Code/Zip"))),Object(b.createElement)(d.__experimentalInputControl,{value:s.zip,onChange:function(e){return o({address:v(v({},s),{},{zip:e})})}}),Object(b.createElement)("label",{className:"block-base-control__label"},Object(b.createElement)("strong",null,Object(l.__)("City"))),Object(b.createElement)(d.__experimentalInputControl,{value:s.city,onChange:function(e){return o({address:v(v({},s),{},{city:e})})}}),Object(b.createElement)("label",{className:"block-base-control__label"},Object(b.createElement)("strong",null,Object(l.__)("Country"))),Object(b.createElement)(d.__experimentalInputControl,{value:s.country,onChange:function(e){return o({address:v(v({},s),{},{country:e})})}})),Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Mobile View Control"),initialOpen:!0},Object(b.createElement)(ToggleControl,{label:Object(l.__)("".concat(e.attributes.mediaControl?"Display":"Hide"," on mobile")),checked:e.attributes.mediaControl,onChange:function(t){return e.setAttributes({mediaControl:t})}}))),Object(b.createElement)("div",{className:"noor-block-google-map",style:p},""!=t?Object(b.createElement)("iframe",{width:"361",height:"160",src:m,frameBorder:"0",allowFullScreen:!0}):Object(b.createElement)("p",null,Object(l.__)("Please provide API key in settings"))))},save:function(e){var t=e.attributes,n=t.width,o=t.height,r=t.src;return e.className="noor-block-google-map ".concat(e.attributes.mediaControl?"":"on-media-hide"),Object(b.createElement)("div",{className:e.className,style:{width:"".concat(n,"%"),paddingBottom:"".concat(o,"%")}},Object(b.createElement)("iframe",{width:"361",height:"160",frameBorder:"0",src:r,allowFullScreen:!0}))}},x=n(7);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var N={useIcon:{type:"boolean",default:!0},alignIcon:{type:"boolean",default:!1},icon:{type:"string",default:"arrow-right-alt"}},S=function(e){var t=e.setAttributes,n=e.attributes.mediaControl;return Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Mobile View Control"),initialOpen:!0},Object(b.createElement)(d.ToggleControl,{label:Object(l.__)("".concat(n?"Display":"Hide"," on mobile")),checked:n,onChange:function(e){return t({mediaControl:e})}}))},T=function(e){var t=e.backgroundColor,n=e.setBackgroundColor;return(0,e.setAttributes)({className:null!=t.class?t.class+" has-background":""}),Object(b.createElement)(i.PanelColorSettings,{title:Object(l.__)("Color settings"),initialOpen:!1,colorSettings:[{value:t.color,onChange:n,label:Object(l.__)("Column background color")}]})},A=function(e){var t=e.attributes,n=t.useIcon,o=t.alignIcon,r=t.icon,c=e.setAttributes,a=function(e,t){var a,l;t&&t.preventDefault(),c({icon:e}),a=o?"has-left-icon":"has-right-icon",l=n&&""!==r?"has-icon-".concat(r):"",c({className:a+" "+l})};return a(r),Object(b.createElement)(d.PanelBody,{title:Object(l.__)("Inline Icon Control"),initialOpen:!0},Object(b.createElement)(d.ToggleControl,{label:Object(l.__)("Use inline icon"),checked:n,onChange:function(e){c({useIcon:e}),e||a("")}}),Object(b.createElement)(d.ToggleControl,{label:o?Object(l.__)("Icon before"):Object(l.__)("Icon after"),checked:o,onChange:function(){return c({alignIcon:!o})}}),n&&Object(b.createElement)(g,{label:Object(l.__)("Inline Icon"),onClick:function(e){e.preventDefault(),c({icon:e.currentTarget.value,event:e})},options:["arrow-right-alt","arrow-left-alt","arrow-right-alt2","arrow-left-alt2","clock","location"],initialChecked:r,showIcons:!0}))},M=function(e){var t=e.color,n=e.setColor,o=e.backgroundColor,r=e.setBackgroundColor,c=e.setAttributes;return c({className:null!=t.class?t.class+" has-color":""}),c({className:null!=o.class?o.class+" has-background":""}),Object(b.createElement)(Fragment,null,Object(b.createElement)(i.PanelColorSettings,{title:Object(l.__)("Color settings"),initialOpen:!1,colorSettings:[{value:o.color,onChange:r,label:Object(l.__)("Button background color")},{value:t.color,onChange:n,label:Object(l.__)("Button text color")}]}),Object(b.createElement)(A,e))},D={attributes:function(e,t){return t.includes("noor")||Object.assign(e.attributes,{mediaControl:{type:"boolean",default:!0}}),"core/button"===t&&Object.assign(e.attributes,B({},N)),"wp-bootstrap-blocks/button"===t&&Object.assign(e.attributes,B(B({},N),{},{backgroundColor:{type:"string"},color:{type:"string"}})),"core/column"===t&&Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e},blockEdit:Object(j.compose)(Object(i.withColors)({backgroundColor:"background-color",color:"color"}),Object(j.createHigherOrderComponent)((function(e){return function(t){return t.name.includes("noor")?Object(b.createElement)(e,t):Object(b.createElement)(b.Fragment,null,Object(b.createElement)(e,t),Object(b.createElement)(i.InspectorControls,null,Object(b.createElement)(S,t),"core/column"===t.name&&Object(b.createElement)(T,t),"core/button"===t.name&&Object(b.createElement)(A,t),"wp-bootstrap-blocks/button"===t.name&&Object(b.createElement)(M,t)))}}),"blockEdit")),extraProps:function(e,t,n){return n.mediaControl||t.name.includes("noor")||(e.className=e.className+" on-media-hide"),e}};Object(x.addFilter)("blocks.registerBlockType","noor/gutenberg-blocks/custom-attributes",D.attributes),Object(x.addFilter)("editor.BlockEdit","noor/gutenberg-blocks/custom-control",D.blockEdit),Object(x.addFilter)("blocks.getSaveContent.extraProps","noor/gutenberg-blocks/extraProps",D.extraProps),[o,r,c].forEach((function(e){return function(e){var t=e.name,n=e.settings;Object(a.registerBlockType)("noor/"+t,n)}(e)}))}]); \ No newline at end of file diff --git a/readme.txt b/readme.txt index d0ba6e1..7e9b2b7 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: Tags: block Requires at least: 5.3.2 Tested up to: 5.4.1 -Stable tag: 1.1.4 +Stable tag: 1.1.5 Requires PHP: 7.0.0 License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -56,7 +56,7 @@ directory take precedence. For example, `/assets/screenshot-1.png` would win ove 1. Added global block control for media query display -* Patch 1.1.4 +* Patch 1.1.5 1. Added button attrs to wp-bootstrap-blocks button block diff --git a/src/filters/attributes.js b/src/filters/attributes.js index 9af50cd..fb33a75 100644 --- a/src/filters/attributes.js +++ b/src/filters/attributes.js @@ -33,7 +33,7 @@ export const attributes = (settings, name) => { } // wp-bootstrap-blocks plugin - if ( 'wp-bootstrap-blocks' === name ) { + if ( 'wp-bootstrap-blocks/button' === name ) { Object.assign(settings.attributes, { ...inlineIconAttributes, diff --git a/src/filters/blockEdit.js b/src/filters/blockEdit.js index 4f886ce..bae7ab1 100644 --- a/src/filters/blockEdit.js +++ b/src/filters/blockEdit.js @@ -24,7 +24,7 @@ export const blockEdit = compose( <SmallScreenControl {...props} /> {props.name === 'core/column' && <ColumnBackgrounControl {...props} />} {props.name === 'core/button' && <ButtonIconControl {...props} />} - {props.name === 'wp-bootstrap-blocks' && <ButtonAllControls {...props} />} + {props.name === 'wp-bootstrap-blocks/button' && <ButtonAllControls {...props} />} </InspectorControls> </Fragment> )