Kadence Blocks – Gutenberg Page Builder Toolkit - Version 2.2.1

Version Description

Release Date: January 17th, 2022 * Fix: Possible issue with Table of Contents.

Download this release

Release Info

Developer britner
Plugin Icon 128x128 Kadence Blocks – Gutenberg Page Builder Toolkit
Version 2.2.1
Comparing to
See all releases

Code changes from version 2.2.0 to 2.2.1

dist/assets/js/kb-table-of-contents.min.js CHANGED
@@ -1 +1 @@
1
- !function(){"use strict";function t(){var t=window,e=document;if(!("scrollBehavior"in e.documentElement.style)||!0===t.__forceSmoothScrollPolyfill__){var o,l=t.HTMLElement||t.Element,r=468,n={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:l.prototype.scroll||s,scrollIntoView:l.prototype.scrollIntoView},i=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now,c=(o=t.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(o)?1:0);t.scroll=t.scrollTo=function(){void 0!==arguments[0]&&(!0!==a(arguments[0])?u.call(t,e.body,void 0!==arguments[0].left?~~arguments[0].left:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:t.scrollY||t.pageYOffset):n.scroll.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:t.scrollY||t.pageYOffset))},t.scrollBy=function(){void 0!==arguments[0]&&(a(arguments[0])?n.scrollBy.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):u.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset)))},l.prototype.scroll=l.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==a(arguments[0])){var t=arguments[0].left,e=arguments[0].top;u.call(this,this,void 0===t?this.scrollLeft:~~t,void 0===e?this.scrollTop:~~e)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");n.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},l.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==a(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):n.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},l.prototype.scrollIntoView=function(){if(!0!==a(arguments[0])){var o=function(t){for(;t!==e.body&&!1===(l=f(o=t,"Y")&&d(o,"Y"),r=f(o,"X")&&d(o,"X"),l||r);)t=t.parentNode||t.host;var o,l,r;return t}(this),l=o.getBoundingClientRect(),r=this.getBoundingClientRect();o!==e.body?(u.call(this,o,o.scrollLeft+r.left-l.left,o.scrollTop+r.top-l.top),"fixed"!==t.getComputedStyle(o).position&&t.scrollBy({left:l.left,top:l.top,behavior:"smooth"})):t.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else n.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(t,e){this.scrollLeft=t,this.scrollTop=e}function a(t){if(null===t||"object"!=typeof t||void 0===t.behavior||"auto"===t.behavior||"instant"===t.behavior)return!0;if("object"==typeof t&&"smooth"===t.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+t.behavior+" is not a valid value for enumeration ScrollBehavior.")}function f(t,e){return"Y"===e?t.clientHeight+c<t.scrollHeight:"X"===e?t.clientWidth+c<t.scrollWidth:void 0}function d(e,o){var l=t.getComputedStyle(e,null)["overflow"+o];return"auto"===l||"scroll"===l}function p(e){var o,l,n,c,s=(i()-e.startTime)/r;c=s=s>1?1:s,o=.5*(1-Math.cos(Math.PI*c)),l=e.startX+(e.x-e.startX)*o,n=e.startY+(e.y-e.startY)*o,e.method.call(e.scrollable,l,n),l===e.x&&n===e.y||t.requestAnimationFrame(p.bind(t,e))}function u(o,l,r){var c,a,f,d,u=i();o===e.body?(c=t,a=t.scrollX||t.pageXOffset,f=t.scrollY||t.pageYOffset,d=n.scroll):(c=o,a=o.scrollLeft,f=o.scrollTop,d=s),p({scrollable:c,method:d,startTime:u,startX:a,startY:f,x:l,y:r})}}"object"==typeof exports&&"undefined"!=typeof module?module.exports={polyfill:t}:t()}(),function(){"use strict";window.kadenceTOC={initAddAnchors:function(){var t=JSON.parse(kadence_blocks_toc.headings);for(let l=0;l<t.length;l++){var e=document.querySelectorAll("h"+t[l].level);if(!e.length)return;var o=encodeURIComponent(t[l].content).toString().normalize().replace(/[^\w\s]/gi,"");for(let r=0;r<e.length;r++){if(e[r].textContent=e[r].textContent.replace(/–/g,"-").replace(/—/g,"-").replace(/…/g,"...").replace(/’/g,"'").replace(/‘/g,"'").replace(/“/g,'"').replace(/”/g,'"'),o===encodeURIComponent(e[r].textContent).toString().normalize().replace(/[^\w\s]/gi,"")&&!e[r].getAttribute("id")){e[r].setAttribute("id",t[l].anchor);break}}}},toggleAttribute:function(t,e,o,l){void 0===o&&(o=!0),void 0===l&&(l=!1),t.getAttribute(e)!==o?t.setAttribute(e,o):t.setAttribute(e,l)},toggleClass:function(t,e,o){void 0===e&&(e="active"),void 0===o&&(o="hidden"),t.classList.contains(e)?(t.classList.remove(e),t.classList.add(o)):(t.classList.add(e),t.classList.remove(o))},initCollapse:function(){var t=document.querySelectorAll(".kb-collapsible-toc");if(t.length)for(let o=0;o<t.length;o++){var e=t[o].querySelector(".kb-table-of-contents-toggle");e.onclick=()=>{window.kadenceTOC.toggleAttribute(e,"aria-expanded","true","false"),window.kadenceTOC.toggleAttribute(e,"aria-label",kadence_blocks_toc.collapseText,kadence_blocks_toc.expandText),window.kadenceTOC.toggleClass(t[o],"kb-toc-toggle-active","kb-toc-toggle-hidden")}}},scrollToElement(t,e,o=!0){var l=Math.floor(t.getBoundingClientRect().top)-e;window.scrollBy({top:l,left:0,behavior:"smooth"});var r=setInterval((function(){var l=window.innerHeight+window.pageYOffset>=document.body.offsetHeight-2;(Math.floor(t.getBoundingClientRect().top)-e==0||l)&&(t.tabIndex="-1",t.focus(),o&&window.history.pushState("","","#"+t.id),clearInterval(r))}),100)},initScroll:function(){var t=document.querySelectorAll(".kb-toc-smooth-scroll");if(t.length)for(let l=0;l<t.length;l++){var e=parseInt(t[l].getAttribute("data-scroll-offset")),o=t[l].querySelectorAll("a.kb-table-of-contents__entry");for(let t=0;t<o.length;t++)o[t].onclick=t=>{if(t.target.getAttribute("href"))var o=t.target;else{if(!(o=t.target.closest("a")))return;if(!o.getAttribute("href"))return}var l=o.getAttribute("href").substring(o.getAttribute("href").indexOf("#")),r=document.getElementById(l.replace("#",""));r&&(t.preventDefault(),window.kadenceTOC.scrollToElement(r,e))}}},initScrollSpy:function(){if("function"==typeof Gumshoe){var t=document.querySelectorAll('.wp-block-kadence-tableofcontents[data-scroll-spy="true"]');if(!t.length)return;var e=[];for(let l=0;l<t.length;l++){var o=parseInt(t[l].getAttribute("data-scroll-offset"));e[l]=new Gumshoe("."+t[l].classList[2]+" .kb-table-of-content-list a",{nested:!0,nestedClass:"active-parent",offset:function(){return o||0}})}}},init:function(){window.kadenceTOC.initAddAnchors(),window.kadenceTOC.initCollapse(),window.kadenceTOC.initScroll(),window.kadenceTOC.initScrollSpy()}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",window.kadenceTOC.init):window.kadenceTOC.init()}();
1
+ !function(){"use strict";function t(){var t=window,e=document;if(!("scrollBehavior"in e.documentElement.style)||!0===t.__forceSmoothScrollPolyfill__){var o,l=t.HTMLElement||t.Element,r=468,n={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:l.prototype.scroll||s,scrollIntoView:l.prototype.scrollIntoView},i=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now,c=(o=t.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(o)?1:0);t.scroll=t.scrollTo=function(){void 0!==arguments[0]&&(!0!==a(arguments[0])?u.call(t,e.body,void 0!==arguments[0].left?~~arguments[0].left:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:t.scrollY||t.pageYOffset):n.scroll.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:t.scrollY||t.pageYOffset))},t.scrollBy=function(){void 0!==arguments[0]&&(a(arguments[0])?n.scrollBy.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):u.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset)))},l.prototype.scroll=l.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==a(arguments[0])){var t=arguments[0].left,e=arguments[0].top;u.call(this,this,void 0===t?this.scrollLeft:~~t,void 0===e?this.scrollTop:~~e)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");n.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},l.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==a(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):n.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},l.prototype.scrollIntoView=function(){if(!0!==a(arguments[0])){var o=function(t){for(;t!==e.body&&!1===(l=f(o=t,"Y")&&d(o,"Y"),r=f(o,"X")&&d(o,"X"),l||r);)t=t.parentNode||t.host;var o,l,r;return t}(this),l=o.getBoundingClientRect(),r=this.getBoundingClientRect();o!==e.body?(u.call(this,o,o.scrollLeft+r.left-l.left,o.scrollTop+r.top-l.top),"fixed"!==t.getComputedStyle(o).position&&t.scrollBy({left:l.left,top:l.top,behavior:"smooth"})):t.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else n.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(t,e){this.scrollLeft=t,this.scrollTop=e}function a(t){if(null===t||"object"!=typeof t||void 0===t.behavior||"auto"===t.behavior||"instant"===t.behavior)return!0;if("object"==typeof t&&"smooth"===t.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+t.behavior+" is not a valid value for enumeration ScrollBehavior.")}function f(t,e){return"Y"===e?t.clientHeight+c<t.scrollHeight:"X"===e?t.clientWidth+c<t.scrollWidth:void 0}function d(e,o){var l=t.getComputedStyle(e,null)["overflow"+o];return"auto"===l||"scroll"===l}function p(e){var o,l,n,c,s=(i()-e.startTime)/r;c=s=s>1?1:s,o=.5*(1-Math.cos(Math.PI*c)),l=e.startX+(e.x-e.startX)*o,n=e.startY+(e.y-e.startY)*o,e.method.call(e.scrollable,l,n),l===e.x&&n===e.y||t.requestAnimationFrame(p.bind(t,e))}function u(o,l,r){var c,a,f,d,u=i();o===e.body?(c=t,a=t.scrollX||t.pageXOffset,f=t.scrollY||t.pageYOffset,d=n.scroll):(c=o,a=o.scrollLeft,f=o.scrollTop,d=s),p({scrollable:c,method:d,startTime:u,startX:a,startY:f,x:l,y:r})}}"object"==typeof exports&&"undefined"!=typeof module?module.exports={polyfill:t}:t()}(),function(){"use strict";window.kadenceTOC={initAddAnchors:function(){var t=JSON.parse(kadence_blocks_toc.headings);for(let r=0;r<t.length;r++){var e=document.querySelectorAll("h"+t[r].level);if(!e.length)return;var o=encodeURIComponent(t[r].content).toString().normalize().replace(/[^\w\s]/gi,"");for(let n=0;n<e.length;n++){var l=e[n].textContent.replace(/–/g,"-").replace(/—/g,"-").replace(/…/g,"...").replace(/’/g,"'").replace(/‘/g,"'").replace(/“/g,'"').replace(/”/g,'"');if(o===(l=encodeURIComponent(l).toString().normalize().replace(/[^\w\s]/gi,""))&&!e[n].getAttribute("id")){e[n].setAttribute("id",t[r].anchor);break}}}},toggleAttribute:function(t,e,o,l){void 0===o&&(o=!0),void 0===l&&(l=!1),t.getAttribute(e)!==o?t.setAttribute(e,o):t.setAttribute(e,l)},toggleClass:function(t,e,o){void 0===e&&(e="active"),void 0===o&&(o="hidden"),t.classList.contains(e)?(t.classList.remove(e),t.classList.add(o)):(t.classList.add(e),t.classList.remove(o))},initCollapse:function(){var t=document.querySelectorAll(".kb-collapsible-toc");if(t.length)for(let o=0;o<t.length;o++){var e=t[o].querySelector(".kb-table-of-contents-toggle");e.onclick=()=>{window.kadenceTOC.toggleAttribute(e,"aria-expanded","true","false"),window.kadenceTOC.toggleAttribute(e,"aria-label",kadence_blocks_toc.collapseText,kadence_blocks_toc.expandText),window.kadenceTOC.toggleClass(t[o],"kb-toc-toggle-active","kb-toc-toggle-hidden")}}},scrollToElement(t,e,o=!0){var l=Math.floor(t.getBoundingClientRect().top)-e;window.scrollBy({top:l,left:0,behavior:"smooth"});var r=setInterval((function(){var l=window.innerHeight+window.pageYOffset>=document.body.offsetHeight-2;(Math.floor(t.getBoundingClientRect().top)-e==0||l)&&(t.tabIndex="-1",t.focus(),o&&window.history.pushState("","","#"+t.id),clearInterval(r))}),100)},initScroll:function(){var t=document.querySelectorAll(".kb-toc-smooth-scroll");if(t.length)for(let l=0;l<t.length;l++){var e=parseInt(t[l].getAttribute("data-scroll-offset")),o=t[l].querySelectorAll("a.kb-table-of-contents__entry");for(let t=0;t<o.length;t++)o[t].onclick=t=>{if(t.target.getAttribute("href"))var o=t.target;else{if(!(o=t.target.closest("a")))return;if(!o.getAttribute("href"))return}var l=o.getAttribute("href").substring(o.getAttribute("href").indexOf("#")),r=document.getElementById(l.replace("#",""));r&&(t.preventDefault(),window.kadenceTOC.scrollToElement(r,e))}}},initScrollSpy:function(){if("function"==typeof Gumshoe){var t=document.querySelectorAll('.wp-block-kadence-tableofcontents[data-scroll-spy="true"]');if(!t.length)return;var e=[];for(let l=0;l<t.length;l++){var o=parseInt(t[l].getAttribute("data-scroll-offset"));e[l]=new Gumshoe("."+t[l].classList[2]+" .kb-table-of-content-list a",{nested:!0,nestedClass:"active-parent",offset:function(){return o||0}})}}},init:function(){window.kadenceTOC.initAddAnchors(),window.kadenceTOC.initCollapse(),window.kadenceTOC.initScroll(),window.kadenceTOC.initScrollSpy()}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",window.kadenceTOC.init):window.kadenceTOC.init()}();
dist/assets/js/src/kb-table-of-contents.js CHANGED
@@ -20,8 +20,8 @@
20
  }
21
  var first_string = encodeURIComponent( headings[ i ].content ).toString().normalize().replace(/[^\w\s]/gi, '');
22
  for ( let n = 0; n < heading_items.length; n++ ) {
23
- heading_items[ n ].textContent = heading_items[ n ].textContent.replace(/–/g, '-').replace(/—/g, '-').replace(/…/g, '...').replace(/’/g, "'").replace(/‘/g, "'").replace(/“/g, '"').replace(/”/g, '"');
24
- var second_string = encodeURIComponent( heading_items[ n ].textContent ).toString().normalize().replace(/[^\w\s]/gi, '');
25
  if ( first_string === second_string ) {
26
  if ( ! heading_items[ n ].getAttribute( 'id' ) ) {
27
  heading_items[ n ].setAttribute( 'id', headings[ i ].anchor );
20
  }
21
  var first_string = encodeURIComponent( headings[ i ].content ).toString().normalize().replace(/[^\w\s]/gi, '');
22
  for ( let n = 0; n < heading_items.length; n++ ) {
23
+ var second_string = heading_items[ n ].textContent.replace(/–/g, '-').replace(/—/g, '-').replace(/…/g, '...').replace(/’/g, "'").replace(/‘/g, "'").replace(/“/g, '"').replace(/”/g, '"');
24
+ second_string = encodeURIComponent( second_string ).toString().normalize().replace(/[^\w\s]/gi, '');
25
  if ( first_string === second_string ) {
26
  if ( ! heading_items[ n ].getAttribute( 'id' ) ) {
27
  heading_items[ n ].setAttribute( 'id', headings[ i ].anchor );
kadence-blocks.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Advanced Page Building Blocks for Gutenberg. Create custom column layouts, backgrounds, dual buttons, icons etc.
6
  * Author: Kadence WP
7
  * Author URI: https://www.kadencewp.com
8
- * Version: 2.2.0
9
  * Text Domain: kadence-blocks
10
  * License: GPL2+
11
  * License URI: https://www.gnu.org/licenses/gpl-2.0.txt
@@ -20,7 +20,7 @@ if ( ! defined( 'ABSPATH' ) ) {
20
 
21
  define( 'KADENCE_BLOCKS_PATH', realpath( plugin_dir_path( __FILE__ ) ) . DIRECTORY_SEPARATOR );
22
  define( 'KADENCE_BLOCKS_URL', plugin_dir_url( __FILE__ ) );
23
- define( 'KADENCE_BLOCKS_VERSION', '2.2.0' );
24
  /**
25
  * Add a check before redirecting
26
  */
5
  * Description: Advanced Page Building Blocks for Gutenberg. Create custom column layouts, backgrounds, dual buttons, icons etc.
6
  * Author: Kadence WP
7
  * Author URI: https://www.kadencewp.com
8
+ * Version: 2.2.1
9
  * Text Domain: kadence-blocks
10
  * License: GPL2+
11
  * License URI: https://www.gnu.org/licenses/gpl-2.0.txt
20
 
21
  define( 'KADENCE_BLOCKS_PATH', realpath( plugin_dir_path( __FILE__ ) ) . DIRECTORY_SEPARATOR );
22
  define( 'KADENCE_BLOCKS_URL', plugin_dir_url( __FILE__ ) );
23
+ define( 'KADENCE_BLOCKS_VERSION', '2.2.1' );
24
  /**
25
  * Add a check before redirecting
26
  */
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: gutenberg, blocks, page builder, google fonts, dual buttons, svg icons, ed
4
  Donate link: https://www.kadencewp.com/about-us/
5
  Requires at least: 5.8
6
  Tested up to: 5.8
7
- Stable tag: 2.2.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -80,6 +80,11 @@ Install the plugin into the `/wp-content/plugins/` folder, and activate it.
80
 
81
  == Changelog ==
82
 
 
 
 
 
 
83
  = 2.2.0 =
84
  Release Date: January 14th, 2022
85
  * Add: Advanced Image Block.
4
  Donate link: https://www.kadencewp.com/about-us/
5
  Requires at least: 5.8
6
  Tested up to: 5.8
7
+ Stable tag: 2.2.1
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
80
 
81
  == Changelog ==
82
 
83
+ = 2.2.1 =
84
+ Release Date: January 17th, 2022
85
+ * Fix: Possible issue with Table of Contents.
86
+
87
+
88
  = 2.2.0 =
89
  Release Date: January 14th, 2022
90
  * Add: Advanced Image Block.