function updateColumns(previousColumns, newColumns) {
      var clientId = ownProps.clientId;

      var _dispatch2 = dispatch('core/block-editor'),
          replaceInnerBlocks = _dispatch2.replaceInnerBlocks;

      var _registry$select2 = registry.select('core/block-editor'),
          getBlocks = _registry$select2.getBlocks;

      var innerBlocks = getBlocks(clientId);
      var hasExplicitWidths = hasExplicitColumnWidths(innerBlocks); // Redistribute available width for existing inner blocks.

      var isAddingColumn = newColumns > previousColumns;

      if (isAddingColumn && hasExplicitWidths) {
        // If adding a new column, assign width to the new column equal to
        // as if it were `1 / columns` of the total available space.
        var newColumnWidth = toWidthPrecision(100 / newColumns); // Redistribute in consideration of pending block insertion as
        // constraining the available working width.

        var widths = getRedistributedColumnWidths(innerBlocks, 100 - newColumnWidth);
        innerBlocks = [].concat(Object(toConsumableArray["a" /* default */])(getMappedColumnWidths(innerBlocks, widths)), Object(toConsumableArray["a" /* default */])(Object(external_lodash_["times"])(newColumns - previousColumns, function () {
          return Object(external_this_wp_blocks_["createBlock"])('core/column', {
            width: newColumnWidth
          });
        })));
      } else if (isAddingColumn) {
        innerBlocks = [].concat(Object(toConsumableArray["a" /* default */])(innerBlocks), Object(toConsumableArray["a" /* default */])(Object(external_lodash_["times"])(newColumns - previousColumns, function () {
          return Object(external_this_wp_blocks_["createBlock"])('core/column');
        })));
      } else {
        // The removed column will be the last of the inner blocks.
        innerBlocks = Object(external_lodash_["dropRight"])(innerBlocks, previousColumns - newColumns);

        if (hasExplicitWidths) {
          // Redistribute as if block is already removed.
          var _widths = getRedistributedColumnWidths(innerBlocks, 100);

          innerBlocks = getMappedColumnWidths(innerBlocks, _widths);
        }
      }

      replaceInnerBlocks(clientId, innerBlocks, false);
    }
/**
     * Updates the column count, including necessary revisions to child Column
     * blocks to grant required or redistribute available space.
     *
     * @param {number} previousColumns Previous column count.
     * @param {number} newColumns      New column count.
     */
Updates the column count, including necessary revisions to child Column
blocks to grant required or redistribute available space.

@param {number} previousColumns Previous column count.
@param {number} newColumns      New column count.
Updates the column count including necessary revisions to child Column blocks to grant required or redistribute available space . @param { number } previousColumns Previous column count . @param { number } newColumns New column count .
function updateColumns(previousColumns, newColumns) {
      var clientId = ownProps.clientId;
      var _dispatch2 = dispatch('core/block-editor'),
          replaceInnerBlocks = _dispatch2.replaceInnerBlocks;
      var _registry$select2 = registry.select('core/block-editor'),
          getBlocks = _registry$select2.getBlocks;
      var innerBlocks = getBlocks(clientId);
      var hasExplicitWidths = hasExplicitColumnWidths(innerBlocks); 
      var isAddingColumn = newColumns > previousColumns;
      if (isAddingColumn && hasExplicitWidths) {
        var newColumnWidth = toWidthPrecision(100 / newColumns); 
        var widths = getRedistributedColumnWidths(innerBlocks, 100 - newColumnWidth);
        innerBlocks = [].concat(Object(toConsumableArray["a" ])(getMappedColumnWidths(innerBlocks, widths)), Object(toConsumableArray["a" ])(Object(external_lodash_["times"])(newColumns - previousColumns, function () {
          return Object(external_this_wp_blocks_["createBlock"])('core/column', {
            width: newColumnWidth
          });
        })));
      } else if (isAddingColumn) {
        innerBlocks = [].concat(Object(toConsumableArray["a" ])(innerBlocks), Object(toConsumableArray["a" ])(Object(external_lodash_["times"])(newColumns - previousColumns, function () {
          return Object(external_this_wp_blocks_["createBlock"])('core/column');
        })));
      } else {
        innerBlocks = Object(external_lodash_["dropRight"])(innerBlocks, previousColumns - newColumns);
        if (hasExplicitWidths) {
          var _widths = getRedistributedColumnWidths(innerBlocks, 100);
          innerBlocks = getMappedColumnWidths(innerBlocks, _widths);
        }
      }
      replaceInnerBlocks(clientId, innerBlocks, false);
    }
function updateColumns ( previousColumns , newColumns ) { var clientId = ownProps . clientId ; var _dispatch2 = dispatch ( 'core/block-editor' ) , replaceInnerBlocks = _dispatch2 . replaceInnerBlocks ; var _registry$select2 = registry . select ( 'core/block-editor' ) , getBlocks = _registry$select2 . getBlocks ; var innerBlocks = getBlocks ( clientId ) ; var hasExplicitWidths = hasExplicitColumnWidths ( innerBlocks ) ; var isAddingColumn = newColumns > previousColumns ; if ( isAddingColumn && hasExplicitWidths ) { var newColumnWidth = toWidthPrecision ( 100 / newColumns ) ; var widths = getRedistributedColumnWidths ( innerBlocks , 100 - newColumnWidth ) ; innerBlocks = [ ] . concat ( Object ( toConsumableArray [ "a" ] ) ( getMappedColumnWidths ( innerBlocks , widths ) ) , Object ( toConsumableArray [ "a" ] ) ( Object ( external_lodash_ [ "times" ] ) ( newColumns - previousColumns , function ( ) { return Object ( external_this_wp_blocks_ [ "createBlock" ] ) ( 'core/column' , { width : newColumnWidth } ) ; } ) ) ) ; } else if ( isAddingColumn ) { innerBlocks = [ ] . concat ( Object ( toConsumableArray [ "a" ] ) ( innerBlocks ) , Object ( toConsumableArray [ "a" ] ) ( Object ( external_lodash_ [ "times" ] ) ( newColumns - previousColumns , function ( ) { return Object ( external_this_wp_blocks_ [ "createBlock" ] ) ( 'core/column' ) ; } ) ) ) ; } else { innerBlocks = Object ( external_lodash_ [ "dropRight" ] ) ( innerBlocks , previousColumns - newColumns ) ; if ( hasExplicitWidths ) { var _widths = getRedistributedColumnWidths ( innerBlocks , 100 ) ; innerBlocks = getMappedColumnWidths ( innerBlocks , _widths ) ; } } replaceInnerBlocks ( clientId , innerBlocks , false ) ; }
Updates the column count, including necessary revisions to child Column
 blocks to grant required or redistribute available space.
Updates the column count including necessary revisions to child Column blocks to grant required or redistribute available space .
// Redistribute available width for existing inner blocks. // If adding a new column, assign width to the new column equal to // as if it were `1 / columns` of the total available space. // Redistribute in consideration of pending block insertion as // constraining the available working width. /* default */ /* default */ /* default */ /* default */ // The removed column will be the last of the inner blocks. // Redistribute as if block is already removed.