Skip to:
Content

BuddyPress.org

Ticket #8571: 8571.4.patch

File 8571.4.patch, 196.5 KB (added by imath, 3 years ago)
  • src/bp-activity/classes/class-bp-activity-component.php

    diff --git src/bp-activity/classes/class-bp-activity-component.php src/bp-activity/classes/class-bp-activity-component.php
    index 38c80cf5d..5b702b34e 100644
    class BP_Activity_Component extends BP_Component { 
    499499                                        'wp-components',
    500500                                        'wp-i18n',
    501501                                        'wp-block-editor',
     502                                        'wp-server-side-render',
    502503                                        'bp-block-data',
    503                                         'bp-block-components',
    504504                                ),
    505505                                'style'              => 'bp-latest-activities-block',
    506506                                'style_url'          => plugins_url( 'css/blocks/latest-activities.css', dirname(  __FILE__ ) ),
  • src/bp-activity/js/blocks/embed-activity.js

    diff --git src/bp-activity/js/blocks/embed-activity.js src/bp-activity/js/blocks/embed-activity.js
    index fc3a737c8..cc62d03b8 100644
    parcelRequire = (function (modules, cache, entry, globalName) { 
    117117  }
    118118
    119119  return newRequire;
    120 })({"DCTP":[function(require,module,exports) {
    121 function _arrayWithHoles(arr) {
    122   if (Array.isArray(arr)) return arr;
    123 }
    124 
    125 module.exports = _arrayWithHoles;
    126 },{}],"LoeL":[function(require,module,exports) {
    127 function _iterableToArrayLimit(arr, i) {
    128   if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
    129   var _arr = [];
    130   var _n = true;
    131   var _d = false;
    132   var _e = undefined;
    133 
    134   try {
    135     for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
    136       _arr.push(_s.value);
    137 
    138       if (i && _arr.length === i) break;
    139     }
    140   } catch (err) {
    141     _d = true;
    142     _e = err;
    143   } finally {
    144     try {
    145       if (!_n && _i["return"] != null) _i["return"]();
    146     } finally {
    147       if (_d) throw _e;
    148     }
    149   }
    150 
    151   return _arr;
    152 }
    153 
    154 module.exports = _iterableToArrayLimit;
    155 },{}],"jEQo":[function(require,module,exports) {
    156 function _arrayLikeToArray(arr, len) {
    157   if (len == null || len > arr.length) len = arr.length;
    158 
    159   for (var i = 0, arr2 = new Array(len); i < len; i++) {
    160     arr2[i] = arr[i];
    161   }
    162 
    163   return arr2;
    164 }
    165 
    166 module.exports = _arrayLikeToArray;
    167 },{}],"Dbv9":[function(require,module,exports) {
    168 var arrayLikeToArray = require("./arrayLikeToArray");
    169 
    170 function _unsupportedIterableToArray(o, minLen) {
    171   if (!o) return;
    172   if (typeof o === "string") return arrayLikeToArray(o, minLen);
    173   var n = Object.prototype.toString.call(o).slice(8, -1);
    174   if (n === "Object" && o.constructor) n = o.constructor.name;
    175   if (n === "Map" || n === "Set") return Array.from(n);
    176   if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
    177 }
    178 
    179 module.exports = _unsupportedIterableToArray;
    180 },{"./arrayLikeToArray":"jEQo"}],"MWEO":[function(require,module,exports) {
    181 function _nonIterableRest() {
    182   throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    183 }
    184 
    185 module.exports = _nonIterableRest;
    186 },{}],"DERy":[function(require,module,exports) {
    187 var arrayWithHoles = require("./arrayWithHoles");
    188 
    189 var iterableToArrayLimit = require("./iterableToArrayLimit");
    190 
    191 var unsupportedIterableToArray = require("./unsupportedIterableToArray");
    192 
    193 var nonIterableRest = require("./nonIterableRest");
    194 
    195 function _slicedToArray(arr, i) {
    196   return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
    197 }
    198 
    199 module.exports = _slicedToArray;
    200 },{"./arrayWithHoles":"DCTP","./iterableToArrayLimit":"LoeL","./unsupportedIterableToArray":"Dbv9","./nonIterableRest":"MWEO"}],"Sjre":[function(require,module,exports) {
     120})({"Sjre":[function(require,module,exports) {
    201121"use strict";
    202122
    203123Object.defineProperty(exports, "__esModule", {
    Object.defineProperty(exports, "__esModule", { 
    205125});
    206126exports.default = void 0;
    207127
    208 var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
    209 
    210 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
    211 
    212128/**
    213129 * WordPress dependencies.
    214130 */
    215 var _wp = wp,
    216     _wp$element = _wp.element,
    217     createElement = _wp$element.createElement,
    218     Fragment = _wp$element.Fragment,
    219     useState = _wp$element.useState,
    220     __ = _wp.i18n.__,
    221     _wp$components = _wp.components,
    222     Placeholder = _wp$components.Placeholder,
    223     Disabled = _wp$components.Disabled,
    224     SandBox = _wp$components.SandBox,
    225     Button = _wp$components.Button,
    226     ExternalLink = _wp$components.ExternalLink,
    227     Spinner = _wp$components.Spinner,
    228     ToolbarGroup = _wp$components.ToolbarGroup,
    229     ToolbarButton = _wp$components.ToolbarButton,
    230     compose = _wp.compose.compose,
    231     withSelect = _wp.data.withSelect,
    232     _wp$blockEditor = _wp.blockEditor,
    233     RichText = _wp$blockEditor.RichText,
    234     BlockControls = _wp$blockEditor.BlockControls;
     131const {
     132  element: {
     133    createElement,
     134    Fragment,
     135    useState
     136  },
     137  i18n: {
     138    __
     139  },
     140  components: {
     141    Placeholder,
     142    Disabled,
     143    SandBox,
     144    Button,
     145    ExternalLink,
     146    Spinner,
     147    ToolbarGroup,
     148    ToolbarButton
     149  },
     150  compose: {
     151    compose
     152  },
     153  data: {
     154    withSelect
     155  },
     156  blockEditor: {
     157    RichText,
     158    BlockControls
     159  }
     160} = wp;
    235161/**
    236162 * BuddyPress dependencies.
    237163 */
    238164
    239 var _bp = bp,
    240     embedScriptURL = _bp.blockData.embedScriptURL;
    241 
    242 var EditEmbedActivity = function EditEmbedActivity(_ref) {
    243   var attributes = _ref.attributes,
    244       setAttributes = _ref.setAttributes,
    245       isSelected = _ref.isSelected,
    246       preview = _ref.preview,
    247       fetching = _ref.fetching;
    248   var url = attributes.url,
    249       caption = attributes.caption;
    250 
    251   var label = __('BuddyPress Activity URL', 'buddypress');
    252 
    253   var _useState = useState(url),
    254       _useState2 = (0, _slicedToArray2.default)(_useState, 2),
    255       value = _useState2[0],
    256       setURL = _useState2[1];
    257 
    258   var _useState3 = useState(!url),
    259       _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
    260       isEditingURL = _useState4[0],
    261       setIsEditingURL = _useState4[1];
    262 
    263   var onSubmit = function onSubmit(event) {
     165const {
     166  blockData: {
     167    embedScriptURL
     168  }
     169} = bp;
     170
     171const EditEmbedActivity = ({
     172  attributes,
     173  setAttributes,
     174  isSelected,
     175  preview,
     176  fetching
     177}) => {
     178  const {
     179    url,
     180    caption
     181  } = attributes;
     182
     183  const label = __('BuddyPress Activity URL', 'buddypress');
     184
     185  const [value, setURL] = useState(url);
     186  const [isEditingURL, setIsEditingURL] = useState(!url);
     187
     188  const onSubmit = event => {
    264189    if (event) {
    265190      event.preventDefault();
    266191    }
    var EditEmbedActivity = function EditEmbedActivity(_ref) { 
    271196    });
    272197  };
    273198
    274   var switchBackToURLInput = function switchBackToURLInput(event) {
     199  const switchBackToURLInput = event => {
    275200    if (event) {
    276201      event.preventDefault();
    277202    }
    var EditEmbedActivity = function EditEmbedActivity(_ref) { 
    279204    setIsEditingURL(true);
    280205  };
    281206
    282   var editToolbar = createElement(BlockControls, null, createElement(ToolbarGroup, null, createElement(ToolbarButton, {
     207  const editToolbar = createElement(BlockControls, null, createElement(ToolbarGroup, null, createElement(ToolbarButton, {
    283208    icon: "edit",
    284209    title: __('Edit URL', 'buddypress'),
    285210    onClick: switchBackToURLInput
    var EditEmbedActivity = function EditEmbedActivity(_ref) { 
    299224      className: "components-placeholder__input",
    300225      "aria-label": label,
    301226      placeholder: __('Enter URL to embed here…', 'buddypress'),
    302       onChange: function onChange(event) {
    303         return setURL(event.target.value);
    304       }
     227      onChange: event => setURL(event.target.value)
    305228    }), createElement(Button, {
    306229      isPrimary: true,
    307230      type: "submit"
    var EditEmbedActivity = function EditEmbedActivity(_ref) { 
    338261    tagName: "figcaption",
    339262    placeholder: __('Write caption…', 'buddypress'),
    340263    value: caption,
    341     onChange: function onChange(value) {
    342       return setAttributes({
    343         caption: value
    344       });
    345     },
     264    onChange: value => setAttributes({
     265      caption: value
     266    }),
    346267    inlineToolbar: true
    347268  })));
    348269};
    349270
    350 var editEmbedActivityBlock = compose([withSelect(function (select, ownProps) {
    351   var url = ownProps.attributes.url;
    352 
    353   var _select = select('core'),
    354       getEmbedPreview = _select.getEmbedPreview,
    355       isRequestingEmbedPreview = _select.isRequestingEmbedPreview;
    356 
    357   var preview = !!url && getEmbedPreview(url);
    358   var fetching = !!url && isRequestingEmbedPreview(url);
     271const editEmbedActivityBlock = compose([withSelect((select, ownProps) => {
     272  const {
     273    url
     274  } = ownProps.attributes;
     275  const {
     276    getEmbedPreview,
     277    isRequestingEmbedPreview
     278  } = select('core');
     279  const preview = !!url && getEmbedPreview(url);
     280  const fetching = !!url && isRequestingEmbedPreview(url);
    359281  return {
    360282    preview: preview,
    361283    fetching: fetching
    var editEmbedActivityBlock = compose([withSelect(function (select, ownProps) { 
    363285})])(EditEmbedActivity);
    364286var _default = editEmbedActivityBlock;
    365287exports.default = _default;
    366 },{"@babel/runtime/helpers/slicedToArray":"DERy"}],"zmBI":[function(require,module,exports) {
     288},{}],"zmBI":[function(require,module,exports) {
    367289"use strict";
    368290
    369291Object.defineProperty(exports, "__esModule", {
    exports.default = void 0; 
    374296/**
    375297 * WordPress dependencies.
    376298 */
    377 var _wp = wp,
    378     RichText = _wp.blockEditor.RichText,
    379     createElement = _wp.element.createElement;
     299const {
     300  blockEditor: {
     301    RichText
     302  },
     303  element: {
     304    createElement
     305  }
     306} = wp;
    380307
    381 var saveEmbedActivityBlock = function saveEmbedActivityBlock(_ref) {
    382   var attributes = _ref.attributes;
    383   var url = attributes.url,
    384       caption = attributes.caption;
     308const saveEmbedActivityBlock = ({
     309  attributes
     310}) => {
     311  const {
     312    url,
     313    caption
     314  } = attributes;
    385315
    386316  if (!url) {
    387317    return null;
    var saveEmbedActivityBlock = function saveEmbedActivityBlock(_ref) { 
    391321    className: "wp-block-embed is-type-bp-activity"
    392322  }, createElement("div", {
    393323    className: "wp-block-embed__wrapper"
    394   }, "\n".concat(url, "\n")
     324  }, `\n${url}\n`
    395325  /* URL needs to be on its own line. */
    396326  ), !RichText.isEmpty(caption) && createElement(RichText.Content, {
    397327    tagName: "figcaption",
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    413343/**
    414344 * WordPress dependencies.
    415345 */
    416 var _wp = wp,
    417     __ = _wp.i18n.__,
    418     registerBlockType = _wp.blocks.registerBlockType;
     346const {
     347  i18n: {
     348    __
     349  },
     350  blocks: {
     351    registerBlockType
     352  }
     353} = wp;
    419354/**
    420355 * Internal dependencies.
    421356 */
  • src/bp-activity/js/blocks/latest-activities.js

    diff --git src/bp-activity/js/blocks/latest-activities.js src/bp-activity/js/blocks/latest-activities.js
    index 158c08d57..d84849602 100644
    const { 
    145145  },
    146146  i18n: {
    147147    __
    148   }
     148  },
     149  serverSideRender: ServerSideRender
    149150} = wp;
    150151/**
    151152 * BuddyPress dependencies.
    152153 */
    153154
    154155const {
    155   blockComponents: {
    156     ServerSideRender
    157   },
    158156  blockData: {
    159157    currentPostId,
    160158    activityTypes
  • src/bp-blogs/classes/class-bp-blogs-component.php

    diff --git src/bp-blogs/classes/class-bp-blogs-component.php src/bp-blogs/classes/class-bp-blogs-component.php
    index 617330a1b..eaf62872d 100644
    class BP_Blogs_Component extends BP_Component { 
    408408                                        'wp-components',
    409409                                        'wp-i18n',
    410410                                        'wp-block-editor',
    411                                         'bp-block-components',
     411                                        'wp-server-side-render',
    412412                                ),
    413413                                'style'              => 'bp-recent-posts-block',
    414414                                'style_url'          => plugins_url( 'css/blocks/recent-posts.css', dirname( __FILE__ ) ),
  • src/bp-blogs/js/blocks/recent-posts.js

    diff --git src/bp-blogs/js/blocks/recent-posts.js src/bp-blogs/js/blocks/recent-posts.js
    index 69a2add7f..ed5b309f5 100644
    exports.default = void 0; 
    128128/**
    129129 * WordPress dependencies.
    130130 */
    131 var _wp = wp,
    132     InspectorControls = _wp.blockEditor.InspectorControls,
    133     _wp$components = _wp.components,
    134     Disabled = _wp$components.Disabled,
    135     PanelBody = _wp$components.PanelBody,
    136     RangeControl = _wp$components.RangeControl,
    137     TextControl = _wp$components.TextControl,
    138     ToggleControl = _wp$components.ToggleControl,
    139     _wp$element = _wp.element,
    140     Fragment = _wp$element.Fragment,
    141     createElement = _wp$element.createElement,
    142     __ = _wp.i18n.__;
    143 /**
    144  * BuddyPress dependencies.
    145  */
    146 
    147 var _bp = bp,
    148     ServerSideRender = _bp.blockComponents.ServerSideRender;
    149 
    150 var editRecentPostsBlock = function editRecentPostsBlock(_ref) {
    151   var attributes = _ref.attributes,
    152       setAttributes = _ref.setAttributes;
    153   var title = attributes.title,
    154       maxPosts = attributes.maxPosts,
    155       linkTitle = attributes.linkTitle;
     131const {
     132  blockEditor: {
     133    InspectorControls
     134  },
     135  components: {
     136    Disabled,
     137    PanelBody,
     138    RangeControl,
     139    TextControl,
     140    ToggleControl
     141  },
     142  element: {
     143    Fragment,
     144    createElement
     145  },
     146  i18n: {
     147    __
     148  },
     149  serverSideRender: ServerSideRender
     150} = wp;
     151
     152const editRecentPostsBlock = ({
     153  attributes,
     154  setAttributes
     155}) => {
     156  const {
     157    title,
     158    maxPosts,
     159    linkTitle
     160  } = attributes;
    156161  return createElement(Fragment, null, createElement(InspectorControls, null, createElement(PanelBody, {
    157162    title: __('Settings', 'buddypress'),
    158163    initialOpen: true
    159164  }, createElement(TextControl, {
    160165    label: __('Title', 'buddypress'),
    161166    value: title,
    162     onChange: function onChange(text) {
     167    onChange: text => {
    163168      setAttributes({
    164169        title: text
    165170      });
    var editRecentPostsBlock = function editRecentPostsBlock(_ref) { 
    167172  }), createElement(RangeControl, {
    168173    label: __('Max posts to show', 'buddypress'),
    169174    value: maxPosts,
    170     onChange: function onChange(value) {
    171       return setAttributes({
    172         maxPosts: value
    173       });
    174     },
     175    onChange: value => setAttributes({
     176      maxPosts: value
     177    }),
    175178    min: 1,
    176179    max: 10,
    177180    required: true
    178181  }), createElement(ToggleControl, {
    179182    label: __('Link block title to Blogs directory', 'buddypress'),
    180183    checked: !!linkTitle,
    181     onChange: function onChange() {
     184    onChange: () => {
    182185      setAttributes({
    183186        linkTitle: !linkTitle
    184187      });
    exports.default = void 0; 
    202205/**
    203206 * WordPress dependencies.
    204207 */
    205 var _wp = wp,
    206     createBlock = _wp.blocks.createBlock;
     208const {
     209  blocks: {
     210    createBlock
     211  }
     212} = wp;
    207213/**
    208214 * Transforms Legacy Widget to Recent Posts Block.
    209215 *
    210216 * @type {Object}
    211217 */
    212218
    213 var transforms = {
     219const transforms = {
    214220  from: [{
    215221    type: 'block',
    216222    blocks: ['core/legacy-widget'],
    217     isMatch: function isMatch(_ref) {
    218       var idBase = _ref.idBase,
    219           instance = _ref.instance;
    220 
     223    isMatch: ({
     224      idBase,
     225      instance
     226    }) => {
    221227      if (!(instance !== null && instance !== void 0 && instance.raw)) {
    222228        return false;
    223229      }
    224230
    225231      return idBase === 'bp_blogs_recent_posts_widget';
    226232    },
    227     transform: function transform(_ref2) {
    228       var instance = _ref2.instance;
     233    transform: ({
     234      instance
     235    }) => {
    229236      return createBlock('bp/recent-posts', {
    230237        title: instance.raw.title,
    231238        maxPosts: instance.raw.max_posts,
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    248255/**
    249256 * WordPress dependencies.
    250257 */
    251 var _wp = wp,
    252     registerBlockType = _wp.blocks.registerBlockType,
    253     __ = _wp.i18n.__;
     258const {
     259  blocks: {
     260    registerBlockType
     261  },
     262  i18n: {
     263    __
     264  }
     265} = wp;
    254266/**
    255267 * Internal dependencies.
    256268 */
  • src/bp-core/bp-core-blocks.php

    diff --git src/bp-core/bp-core-blocks.php src/bp-core/bp-core-blocks.php
    index 1ce5c1f18..7f844a045 100644
    function bp_support_blocks() { 
    3737 *              Uses a dependency to `wp-editor` otherwise.
    3838 */
    3939function bp_register_block_components() {
    40         $server_side_renderer_dep = 'wp-server-side-render';
    41         if ( bp_is_running_wp( '5.3.0', '<' ) ) {
    42                 $server_side_renderer_dep = 'wp-editor';
    43         }
    44 
    4540        wp_register_script(
    4641                'bp-block-components',
    4742                plugins_url( 'js/block-components.js', __FILE__ ),
    function bp_register_block_components() { 
    5146                        'wp-i18n',
    5247                        'wp-api-fetch',
    5348                        'wp-url',
    54                         $server_side_renderer_dep,
    5549                ),
    5650                bp_get_version(),
    5751                false
  • src/bp-core/classes/class-bp-core.php

    diff --git src/bp-core/classes/class-bp-core.php src/bp-core/classes/class-bp-core.php
    index e2ee0bcde..9ecf8ab8d 100644
    class BP_Core extends BP_Component { 
    392392                                                'wp-components',
    393393                                                'wp-i18n',
    394394                                                'wp-block-editor',
    395                                                 'bp-block-components',
     395                                                'wp-server-side-render',
    396396                                        ),
    397397                                        'style'              => 'bp-login-form-block',
    398398                                        'style_url'          => plugins_url( 'css/blocks/login-form.css', dirname( __FILE__ ) ),
  • src/bp-core/js/block-components.js

    diff --git src/bp-core/js/block-components.js src/bp-core/js/block-components.js
    index 35f909b36..df14748df 100644
    parcelRequire = (function (modules, cache, entry, globalName) { 
    117117  }
    118118
    119119  return newRequire;
    120 })({"IC7x":[function(require,module,exports) {
    121 function _classCallCheck(instance, Constructor) {
    122   if (!(instance instanceof Constructor)) {
    123     throw new TypeError("Cannot call a class as a function");
    124   }
    125 }
    126 
    127 module.exports = _classCallCheck;
    128 },{}],"WiqS":[function(require,module,exports) {
    129 function _defineProperties(target, props) {
    130   for (var i = 0; i < props.length; i++) {
    131     var descriptor = props[i];
    132     descriptor.enumerable = descriptor.enumerable || false;
    133     descriptor.configurable = true;
    134     if ("value" in descriptor) descriptor.writable = true;
    135     Object.defineProperty(target, descriptor.key, descriptor);
    136   }
    137 }
    138 
    139 function _createClass(Constructor, protoProps, staticProps) {
    140   if (protoProps) _defineProperties(Constructor.prototype, protoProps);
    141   if (staticProps) _defineProperties(Constructor, staticProps);
    142   return Constructor;
    143 }
    144 
    145 module.exports = _createClass;
    146 },{}],"NS7G":[function(require,module,exports) {
    147 function _assertThisInitialized(self) {
    148   if (self === void 0) {
    149     throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    150   }
    151 
    152   return self;
    153 }
    154 
    155 module.exports = _assertThisInitialized;
    156 },{}],"zqo5":[function(require,module,exports) {
    157 function _setPrototypeOf(o, p) {
    158   module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
    159     o.__proto__ = p;
    160     return o;
    161   };
    162 
    163   return _setPrototypeOf(o, p);
    164 }
    165 
    166 module.exports = _setPrototypeOf;
    167 },{}],"RISo":[function(require,module,exports) {
    168 var setPrototypeOf = require("./setPrototypeOf");
    169 
    170 function _inherits(subClass, superClass) {
    171   if (typeof superClass !== "function" && superClass !== null) {
    172     throw new TypeError("Super expression must either be null or a function");
    173   }
    174 
    175   subClass.prototype = Object.create(superClass && superClass.prototype, {
    176     constructor: {
    177       value: subClass,
    178       writable: true,
    179       configurable: true
    180     }
    181   });
    182   if (superClass) setPrototypeOf(subClass, superClass);
    183 }
    184 
    185 module.exports = _inherits;
    186 },{"./setPrototypeOf":"zqo5"}],"xOn8":[function(require,module,exports) {
    187 function _typeof(obj) {
    188   "@babel/helpers - typeof";
    189 
    190   if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    191     module.exports = _typeof = function _typeof(obj) {
    192       return typeof obj;
    193     };
    194   } else {
    195     module.exports = _typeof = function _typeof(obj) {
    196       return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
    197     };
    198   }
    199 
    200   return _typeof(obj);
    201 }
    202 
    203 module.exports = _typeof;
    204 },{}],"oXYo":[function(require,module,exports) {
    205 var _typeof = require("../helpers/typeof");
    206 
    207 var assertThisInitialized = require("./assertThisInitialized");
    208 
    209 function _possibleConstructorReturn(self, call) {
    210   if (call && (_typeof(call) === "object" || typeof call === "function")) {
    211     return call;
    212   }
    213 
    214   return assertThisInitialized(self);
    215 }
    216 
    217 module.exports = _possibleConstructorReturn;
    218 },{"../helpers/typeof":"xOn8","./assertThisInitialized":"NS7G"}],"goD2":[function(require,module,exports) {
    219 function _getPrototypeOf(o) {
    220   module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
    221     return o.__proto__ || Object.getPrototypeOf(o);
    222   };
    223   return _getPrototypeOf(o);
    224 }
    225 
    226 module.exports = _getPrototypeOf;
    227 },{}],"W80x":[function(require,module,exports) {
     120})({"W80x":[function(require,module,exports) {
    228121"use strict";
    229122
    230123Object.defineProperty(exports, "__esModule", {
    Object.defineProperty(exports, "__esModule", { 
    232125});
    233126exports.default = void 0;
    234127
    235 var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
    236 
    237 var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
    238 
    239 var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
    240 
    241 var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
    242 
    243 var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
    244 
    245 var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
    246 
    247 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
    248 
    249 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
    250 
    251 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
    252 
    253128/**
    254129 * WordPress dependencies.
    255130 */
    256 var _wp = wp,
    257     apiFetch = _wp.apiFetch,
    258     Popover = _wp.components.Popover,
    259     _wp$element = _wp.element,
    260     Component = _wp$element.Component,
    261     Fragment = _wp$element.Fragment,
    262     createElement = _wp$element.createElement,
    263     __ = _wp.i18n.__,
    264     addQueryArgs = _wp.url.addQueryArgs;
    265 
    266 var AutoCompleter = /*#__PURE__*/function (_Component) {
    267   (0, _inherits2.default)(AutoCompleter, _Component);
    268 
    269   var _super = _createSuper(AutoCompleter);
    270 
    271   function AutoCompleter() {
    272     var _this;
    273 
    274     (0, _classCallCheck2.default)(this, AutoCompleter);
    275     _this = _super.apply(this, arguments);
    276     _this.state = {
     131const {
     132  apiFetch,
     133  components: {
     134    Popover
     135  },
     136  element: {
     137    Component,
     138    Fragment,
     139    createElement
     140  },
     141  i18n: {
     142    __
     143  },
     144  url: {
     145    addQueryArgs
     146  }
     147} = wp;
     148
     149class AutoCompleter extends Component {
     150  constructor() {
     151    super(...arguments);
     152    this.state = {
    277153      search: '',
    278154      items: [],
    279155      error: ''
    280156    };
    281     _this.searchItemName = _this.searchItemName.bind((0, _assertThisInitialized2.default)(_this));
    282     _this.selectItemName = _this.selectItemName.bind((0, _assertThisInitialized2.default)(_this));
    283     return _this;
     157    this.searchItemName = this.searchItemName.bind(this);
     158    this.selectItemName = this.selectItemName.bind(this);
    284159  }
    285160
    286   (0, _createClass2.default)(AutoCompleter, [{
    287     key: "searchItemName",
    288     value: function searchItemName(value) {
    289       var _this2 = this;
    290 
    291       var search = this.state.search;
    292       var _this$props = this.props,
    293           component = _this$props.component,
    294           objectQueryArgs = _this$props.objectQueryArgs;
     161  searchItemName(value) {
     162    const {
     163      search
     164    } = this.state;
     165    const {
     166      component,
     167      objectQueryArgs
     168    } = this.props;
     169    this.setState({
     170      search: value
     171    });
     172
     173    if (value.length < search.length) {
    295174      this.setState({
    296         search: value
     175        items: []
    297176      });
     177    }
    298178
    299       if (value.length < search.length) {
    300         this.setState({
    301           items: []
    302         });
    303       }
    304 
    305       var path = '/buddypress/v1/' + component;
    306       var queryArgs = {};
    307 
    308       if (value) {
    309         queryArgs.search = encodeURIComponent(value);
    310       }
     179    let path = '/buddypress/v1/' + component;
     180    let queryArgs = {};
    311181
    312       if (objectQueryArgs) {
    313         queryArgs = Object.assign(queryArgs, objectQueryArgs);
    314       }
     182    if (value) {
     183      queryArgs.search = encodeURIComponent(value);
     184    }
    315185
    316       apiFetch({
    317         path: addQueryArgs(path, queryArgs)
    318       }).then(function (items) {
    319         _this2.setState({
    320           items: items
    321         });
    322       }, function (error) {
    323         _this2.setState({
    324           error: error.message
    325         });
    326       });
     186    if (objectQueryArgs) {
     187      queryArgs = Object.assign(queryArgs, objectQueryArgs);
    327188    }
    328   }, {
    329     key: "selectItemName",
    330     value: function selectItemName(event, itemID) {
    331       var onSelectItem = this.props.onSelectItem;
    332       event.preventDefault();
     189
     190    apiFetch({
     191      path: addQueryArgs(path, queryArgs)
     192    }).then(items => {
    333193      this.setState({
    334         search: '',
    335         items: [],
    336         error: ''
     194        items: items
    337195      });
    338       return onSelectItem({
    339         itemID: itemID
     196    }, error => {
     197      this.setState({
     198        error: error.message
    340199      });
    341     }
    342   }, {
    343     key: "render",
    344     value: function render() {
    345       var _this3 = this;
    346 
    347       var _this$state = this.state,
    348           search = _this$state.search,
    349           items = _this$state.items;
    350       var _this$props2 = this.props,
    351           ariaLabel = _this$props2.ariaLabel,
    352           placeholder = _this$props2.placeholder,
    353           useAvatar = _this$props2.useAvatar,
    354           slugValue = _this$props2.slugValue;
    355       var itemsList;
    356 
    357       if (!ariaLabel) {
    358         ariaLabel = __('Item\'s name', 'buddypress');
    359       }
    360 
    361       if (!placeholder) {
    362         placeholder = __('Enter Item\'s name here…', 'buddypress');
    363       }
     200    });
     201  }
    364202
    365       if (items.length) {
    366         itemsList = items.map(function (item) {
    367           return createElement("button", {
    368             type: "button",
    369             key: 'editor-autocompleters__item-item-' + item.id,
    370             role: "option",
    371             "aria-selected": "true",
    372             className: "components-button components-autocomplete__result editor-autocompleters__user",
    373             onClick: function onClick(event) {
    374               return _this3.selectItemName(event, item.id);
    375             }
    376           }, useAvatar && createElement("img", {
    377             key: "avatar",
    378             className: "editor-autocompleters__user-avatar",
    379             alt: "",
    380             src: item.avatar_urls.thumb.replaceAll('&#038;', '&')
    381           }), createElement("span", {
    382             key: "name",
    383             className: "editor-autocompleters__user-name"
    384           }, item.name), slugValue && null !== slugValue(item) && createElement("span", {
    385             key: "slug",
    386             className: "editor-autocompleters__user-slug"
    387           }, slugValue(item)));
    388         });
    389       }
     203  selectItemName(event, itemID) {
     204    const {
     205      onSelectItem
     206    } = this.props;
     207    event.preventDefault();
     208    this.setState({
     209      search: '',
     210      items: [],
     211      error: ''
     212    });
     213    return onSelectItem({
     214      itemID: itemID
     215    });
     216  }
    390217
    391       return createElement(Fragment, null, createElement("input", {
    392         type: "text",
    393         value: search,
    394         className: "components-placeholder__input",
    395         "aria-label": ariaLabel,
    396         placeholder: placeholder,
    397         onChange: function onChange(event) {
    398           return _this3.searchItemName(event.target.value);
    399         }
    400       }), 0 !== items.length && createElement(Popover, {
    401         className: "components-autocomplete__popover",
    402         focusOnMount: false,
    403         position: "bottom left"
    404       }, createElement("div", {
    405         className: "components-autocomplete__results"
    406       }, itemsList)));
     218  render() {
     219    const {
     220      search,
     221      items
     222    } = this.state;
     223    let {
     224      ariaLabel,
     225      placeholder,
     226      useAvatar,
     227      slugValue
     228    } = this.props;
     229    let itemsList;
     230
     231    if (!ariaLabel) {
     232      ariaLabel = __('Item\'s name', 'buddypress');
    407233    }
    408   }]);
    409   return AutoCompleter;
    410 }(Component);
    411234
    412 var _default = AutoCompleter;
    413 exports.default = _default;
    414 },{"@babel/runtime/helpers/classCallCheck":"IC7x","@babel/runtime/helpers/createClass":"WiqS","@babel/runtime/helpers/assertThisInitialized":"NS7G","@babel/runtime/helpers/inherits":"RISo","@babel/runtime/helpers/possibleConstructorReturn":"oXYo","@babel/runtime/helpers/getPrototypeOf":"goD2"}],"fOJU":[function(require,module,exports) {
    415 "use strict";
     235    if (!placeholder) {
     236      placeholder = __('Enter Item\'s name here…', 'buddypress');
     237    }
    416238
    417 Object.defineProperty(exports, "__esModule", {
    418   value: true
    419 });
    420 exports.default = ServerSideRender;
     239    if (items.length) {
     240      itemsList = items.map(item => {
     241        return createElement("button", {
     242          type: "button",
     243          key: 'editor-autocompleters__item-item-' + item.id,
     244          role: "option",
     245          "aria-selected": "true",
     246          className: "components-button components-autocomplete__result editor-autocompleters__user",
     247          onClick: event => this.selectItemName(event, item.id)
     248        }, useAvatar && createElement("img", {
     249          key: "avatar",
     250          className: "editor-autocompleters__user-avatar",
     251          alt: "",
     252          src: item.avatar_urls.thumb.replaceAll('&#038;', '&')
     253        }), createElement("span", {
     254          key: "name",
     255          className: "editor-autocompleters__user-name"
     256        }, item.name), slugValue && null !== slugValue(item) && createElement("span", {
     257          key: "slug",
     258          className: "editor-autocompleters__user-slug"
     259        }, slugValue(item)));
     260      });
     261    }
    421262
    422 /**
    423  * WordPress dependencies.
    424  */
    425 var _wp = wp,
    426     createElement = _wp.element.createElement;
    427 /**
    428  * Compatibility Server Side Render.
    429  *
    430  * @since 9.0.0
    431  */
     263    return createElement(Fragment, null, createElement("input", {
     264      type: "text",
     265      value: search,
     266      className: "components-placeholder__input",
     267      "aria-label": ariaLabel,
     268      placeholder: placeholder,
     269      onChange: event => this.searchItemName(event.target.value)
     270    }), 0 !== items.length && createElement(Popover, {
     271      className: "components-autocomplete__popover",
     272      focusOnMount: false,
     273      position: "bottom left"
     274    }, createElement("div", {
     275      className: "components-autocomplete__results"
     276    }, itemsList)));
     277  }
    432278
    433 function ServerSideRender(props) {
    434   var CompatibiltyServerSideRender = wp.serverSideRender ? wp.serverSideRender : wp.editor.ServerSideRender;
    435   return createElement(CompatibiltyServerSideRender, props);
    436279}
     280
     281var _default = AutoCompleter;
     282exports.default = _default;
    437283},{}],"iA92":[function(require,module,exports) {
    438284"use strict";
    439285
    exports.default = void 0; 
    444290
    445291var _autocompleter = _interopRequireDefault(require("./autocompleter"));
    446292
    447 var _serverSideRender = _interopRequireDefault(require("./server-side-render"));
    448 
    449293function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
    450294
    451295/**
    452296 * BuddyPress components.
    453297 */
    454298var _default = {
    455   AutoCompleter: _autocompleter.default,
    456   ServerSideRender: _serverSideRender.default
     299  AutoCompleter: _autocompleter.default
    457300};
    458301exports.default = _default;
    459 },{"./autocompleter":"W80x","./server-side-render":"fOJU"}],"Ee8M":[function(require,module,exports) {
     302},{"./autocompleter":"W80x"}],"Ee8M":[function(require,module,exports) {
    460303"use strict";
    461304
    462305Object.defineProperty(exports, "__esModule", {
  • src/bp-core/js/block-data.js

    diff --git src/bp-core/js/block-data.js src/bp-core/js/block-data.js
    index f9fc38caf..03185dce6 100644
    parcelRequire = (function (modules, cache, entry, globalName) { 
    117117  }
    118118
    119119  return newRequire;
    120 })({"DCTP":[function(require,module,exports) {
    121 function _arrayWithHoles(arr) {
    122   if (Array.isArray(arr)) return arr;
    123 }
    124 
    125 module.exports = _arrayWithHoles;
    126 },{}],"LoeL":[function(require,module,exports) {
    127 function _iterableToArrayLimit(arr, i) {
    128   if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
    129   var _arr = [];
    130   var _n = true;
    131   var _d = false;
    132   var _e = undefined;
    133 
    134   try {
    135     for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
    136       _arr.push(_s.value);
    137 
    138       if (i && _arr.length === i) break;
    139     }
    140   } catch (err) {
    141     _d = true;
    142     _e = err;
    143   } finally {
    144     try {
    145       if (!_n && _i["return"] != null) _i["return"]();
    146     } finally {
    147       if (_d) throw _e;
    148     }
    149   }
    150 
    151   return _arr;
    152 }
    153 
    154 module.exports = _iterableToArrayLimit;
    155 },{}],"jEQo":[function(require,module,exports) {
    156 function _arrayLikeToArray(arr, len) {
    157   if (len == null || len > arr.length) len = arr.length;
    158 
    159   for (var i = 0, arr2 = new Array(len); i < len; i++) {
    160     arr2[i] = arr[i];
    161   }
    162 
    163   return arr2;
    164 }
    165 
    166 module.exports = _arrayLikeToArray;
    167 },{}],"Dbv9":[function(require,module,exports) {
    168 var arrayLikeToArray = require("./arrayLikeToArray");
    169 
    170 function _unsupportedIterableToArray(o, minLen) {
    171   if (!o) return;
    172   if (typeof o === "string") return arrayLikeToArray(o, minLen);
    173   var n = Object.prototype.toString.call(o).slice(8, -1);
    174   if (n === "Object" && o.constructor) n = o.constructor.name;
    175   if (n === "Map" || n === "Set") return Array.from(n);
    176   if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
    177 }
    178 
    179 module.exports = _unsupportedIterableToArray;
    180 },{"./arrayLikeToArray":"jEQo"}],"MWEO":[function(require,module,exports) {
    181 function _nonIterableRest() {
    182   throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    183 }
    184 
    185 module.exports = _nonIterableRest;
    186 },{}],"DERy":[function(require,module,exports) {
    187 var arrayWithHoles = require("./arrayWithHoles");
    188 
    189 var iterableToArrayLimit = require("./iterableToArrayLimit");
    190 
    191 var unsupportedIterableToArray = require("./unsupportedIterableToArray");
    192 
    193 var nonIterableRest = require("./nonIterableRest");
    194 
    195 function _slicedToArray(arr, i) {
    196   return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
    197 }
    198 
    199 module.exports = _slicedToArray;
    200 },{"./arrayWithHoles":"DCTP","./iterableToArrayLimit":"LoeL","./unsupportedIterableToArray":"Dbv9","./nonIterableRest":"MWEO"}],"Ih1j":[function(require,module,exports) {
     120})({"Ih1j":[function(require,module,exports) {
    201121"use strict";
    202122
    203123Object.defineProperty(exports, "__esModule", {
    exports.STORE_KEY = void 0; 
    210130 *
    211131 * @type {string}
    212132 */
    213 var STORE_KEY = 'bp/core';
     133const STORE_KEY = 'bp/core';
    214134exports.STORE_KEY = STORE_KEY;
    215135},{}],"DDtj":[function(require,module,exports) {
    216136"use strict";
    exports.getActiveComponents = void 0; 
    226146 * @param {Object} state The current state.
    227147 * @return {array} The list of Active BP Components.
    228148 */
    229 var getActiveComponents = function getActiveComponents(state) {
     149const getActiveComponents = state => {
    230150  return state.components || [];
    231151};
    232152
    exports.TYPES = void 0; 
    244164 *
    245165 * @type {Object}
    246166 */
    247 var TYPES = {
     167const TYPES = {
    248168  GET_ACTIVE_COMPONENTS: 'GET_ACTIVE_COMPONENTS',
    249169  FETCH_FROM_API: 'FETCH_FROM_API'
    250170};
    var _actionTypes = require("./action-types"); 
    272192function getActiveComponents(list) {
    273193  return {
    274194    type: _actionTypes.TYPES.GET_ACTIVE_COMPONENTS,
    275     list: list
     195    list
    276196  };
    277197}
    278198/**
    function getActiveComponents(list) { 
    287207function fetchFromAPI(path, parse) {
    288208  return {
    289209    type: _actionTypes.TYPES.FETCH_FROM_API,
    290     path: path,
    291     parse: parse
     210    path,
     211    parse
    292212  };
    293213}
    294 },{"./action-types":"gg2v"}],"rqzK":[function(require,module,exports) {
    295 /**
    296  * Copyright (c) 2014-present, Facebook, Inc.
    297  *
    298  * This source code is licensed under the MIT license found in the
    299  * LICENSE file in the root directory of this source tree.
    300  */
    301 
    302 var runtime = (function (exports) {
    303   "use strict";
    304 
    305   var Op = Object.prototype;
    306   var hasOwn = Op.hasOwnProperty;
    307   var undefined; // More compressible than void 0.
    308   var $Symbol = typeof Symbol === "function" ? Symbol : {};
    309   var iteratorSymbol = $Symbol.iterator || "@@iterator";
    310   var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
    311   var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    312 
    313   function wrap(innerFn, outerFn, self, tryLocsList) {
    314     // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
    315     var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
    316     var generator = Object.create(protoGenerator.prototype);
    317     var context = new Context(tryLocsList || []);
    318 
    319     // The ._invoke method unifies the implementations of the .next,
    320     // .throw, and .return methods.
    321     generator._invoke = makeInvokeMethod(innerFn, self, context);
    322 
    323     return generator;
    324   }
    325   exports.wrap = wrap;
    326 
    327   // Try/catch helper to minimize deoptimizations. Returns a completion
    328   // record like context.tryEntries[i].completion. This interface could
    329   // have been (and was previously) designed to take a closure to be
    330   // invoked without arguments, but in all the cases we care about we
    331   // already have an existing method we want to call, so there's no need
    332   // to create a new function object. We can even get away with assuming
    333   // the method takes exactly one argument, since that happens to be true
    334   // in every case, so we don't have to touch the arguments object. The
    335   // only additional allocation required is the completion record, which
    336   // has a stable shape and so hopefully should be cheap to allocate.
    337   function tryCatch(fn, obj, arg) {
    338     try {
    339       return { type: "normal", arg: fn.call(obj, arg) };
    340     } catch (err) {
    341       return { type: "throw", arg: err };
    342     }
    343   }
    344 
    345   var GenStateSuspendedStart = "suspendedStart";
    346   var GenStateSuspendedYield = "suspendedYield";
    347   var GenStateExecuting = "executing";
    348   var GenStateCompleted = "completed";
    349 
    350   // Returning this object from the innerFn has the same effect as
    351   // breaking out of the dispatch switch statement.
    352   var ContinueSentinel = {};
    353 
    354   // Dummy constructor functions that we use as the .constructor and
    355   // .constructor.prototype properties for functions that return Generator
    356   // objects. For full spec compliance, you may wish to configure your
    357   // minifier not to mangle the names of these two functions.
    358   function Generator() {}
    359   function GeneratorFunction() {}
    360   function GeneratorFunctionPrototype() {}
    361 
    362   // This is a polyfill for %IteratorPrototype% for environments that
    363   // don't natively support it.
    364   var IteratorPrototype = {};
    365   IteratorPrototype[iteratorSymbol] = function () {
    366     return this;
    367   };
    368 
    369   var getProto = Object.getPrototypeOf;
    370   var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
    371   if (NativeIteratorPrototype &&
    372       NativeIteratorPrototype !== Op &&
    373       hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
    374     // This environment has a native %IteratorPrototype%; use it instead
    375     // of the polyfill.
    376     IteratorPrototype = NativeIteratorPrototype;
    377   }
    378 
    379   var Gp = GeneratorFunctionPrototype.prototype =
    380     Generator.prototype = Object.create(IteratorPrototype);
    381   GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
    382   GeneratorFunctionPrototype.constructor = GeneratorFunction;
    383   GeneratorFunctionPrototype[toStringTagSymbol] =
    384     GeneratorFunction.displayName = "GeneratorFunction";
    385 
    386   // Helper for defining the .next, .throw, and .return methods of the
    387   // Iterator interface in terms of a single ._invoke method.
    388   function defineIteratorMethods(prototype) {
    389     ["next", "throw", "return"].forEach(function(method) {
    390       prototype[method] = function(arg) {
    391         return this._invoke(method, arg);
    392       };
    393     });
    394   }
    395 
    396   exports.isGeneratorFunction = function(genFun) {
    397     var ctor = typeof genFun === "function" && genFun.constructor;
    398     return ctor
    399       ? ctor === GeneratorFunction ||
    400         // For the native GeneratorFunction constructor, the best we can
    401         // do is to check its .name property.
    402         (ctor.displayName || ctor.name) === "GeneratorFunction"
    403       : false;
    404   };
    405 
    406   exports.mark = function(genFun) {
    407     if (Object.setPrototypeOf) {
    408       Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
    409     } else {
    410       genFun.__proto__ = GeneratorFunctionPrototype;
    411       if (!(toStringTagSymbol in genFun)) {
    412         genFun[toStringTagSymbol] = "GeneratorFunction";
    413       }
    414     }
    415     genFun.prototype = Object.create(Gp);
    416     return genFun;
    417   };
    418 
    419   // Within the body of any async function, `await x` is transformed to
    420   // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
    421   // `hasOwn.call(value, "__await")` to determine if the yielded value is
    422   // meant to be awaited.
    423   exports.awrap = function(arg) {
    424     return { __await: arg };
    425   };
    426 
    427   function AsyncIterator(generator, PromiseImpl) {
    428     function invoke(method, arg, resolve, reject) {
    429       var record = tryCatch(generator[method], generator, arg);
    430       if (record.type === "throw") {
    431         reject(record.arg);
    432       } else {
    433         var result = record.arg;
    434         var value = result.value;
    435         if (value &&
    436             typeof value === "object" &&
    437             hasOwn.call(value, "__await")) {
    438           return PromiseImpl.resolve(value.__await).then(function(value) {
    439             invoke("next", value, resolve, reject);
    440           }, function(err) {
    441             invoke("throw", err, resolve, reject);
    442           });
    443         }
    444 
    445         return PromiseImpl.resolve(value).then(function(unwrapped) {
    446           // When a yielded Promise is resolved, its final value becomes
    447           // the .value of the Promise<{value,done}> result for the
    448           // current iteration.
    449           result.value = unwrapped;
    450           resolve(result);
    451         }, function(error) {
    452           // If a rejected Promise was yielded, throw the rejection back
    453           // into the async generator function so it can be handled there.
    454           return invoke("throw", error, resolve, reject);
    455         });
    456       }
    457     }
    458 
    459     var previousPromise;
    460 
    461     function enqueue(method, arg) {
    462       function callInvokeWithMethodAndArg() {
    463         return new PromiseImpl(function(resolve, reject) {
    464           invoke(method, arg, resolve, reject);
    465         });
    466       }
    467 
    468       return previousPromise =
    469         // If enqueue has been called before, then we want to wait until
    470         // all previous Promises have been resolved before calling invoke,
    471         // so that results are always delivered in the correct order. If
    472         // enqueue has not been called before, then it is important to
    473         // call invoke immediately, without waiting on a callback to fire,
    474         // so that the async generator function has the opportunity to do
    475         // any necessary setup in a predictable way. This predictability
    476         // is why the Promise constructor synchronously invokes its
    477         // executor callback, and why async functions synchronously
    478         // execute code before the first await. Since we implement simple
    479         // async functions in terms of async generators, it is especially
    480         // important to get this right, even though it requires care.
    481         previousPromise ? previousPromise.then(
    482           callInvokeWithMethodAndArg,
    483           // Avoid propagating failures to Promises returned by later
    484           // invocations of the iterator.
    485           callInvokeWithMethodAndArg
    486         ) : callInvokeWithMethodAndArg();
    487     }
    488 
    489     // Define the unified helper method that is used to implement .next,
    490     // .throw, and .return (see defineIteratorMethods).
    491     this._invoke = enqueue;
    492   }
    493 
    494   defineIteratorMethods(AsyncIterator.prototype);
    495   AsyncIterator.prototype[asyncIteratorSymbol] = function () {
    496     return this;
    497   };
    498   exports.AsyncIterator = AsyncIterator;
    499 
    500   // Note that simple async functions are implemented on top of
    501   // AsyncIterator objects; they just return a Promise for the value of
    502   // the final result produced by the iterator.
    503   exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
    504     if (PromiseImpl === void 0) PromiseImpl = Promise;
    505 
    506     var iter = new AsyncIterator(
    507       wrap(innerFn, outerFn, self, tryLocsList),
    508       PromiseImpl
    509     );
    510 
    511     return exports.isGeneratorFunction(outerFn)
    512       ? iter // If outerFn is a generator, return the full iterator.
    513       : iter.next().then(function(result) {
    514           return result.done ? result.value : iter.next();
    515         });
    516   };
    517 
    518   function makeInvokeMethod(innerFn, self, context) {
    519     var state = GenStateSuspendedStart;
    520 
    521     return function invoke(method, arg) {
    522       if (state === GenStateExecuting) {
    523         throw new Error("Generator is already running");
    524       }
    525 
    526       if (state === GenStateCompleted) {
    527         if (method === "throw") {
    528           throw arg;
    529         }
    530 
    531         // Be forgiving, per 25.3.3.3.3 of the spec:
    532         // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
    533         return doneResult();
    534       }
    535 
    536       context.method = method;
    537       context.arg = arg;
    538 
    539       while (true) {
    540         var delegate = context.delegate;
    541         if (delegate) {
    542           var delegateResult = maybeInvokeDelegate(delegate, context);
    543           if (delegateResult) {
    544             if (delegateResult === ContinueSentinel) continue;
    545             return delegateResult;
    546           }
    547         }
    548 
    549         if (context.method === "next") {
    550           // Setting context._sent for legacy support of Babel's
    551           // function.sent implementation.
    552           context.sent = context._sent = context.arg;
    553 
    554         } else if (context.method === "throw") {
    555           if (state === GenStateSuspendedStart) {
    556             state = GenStateCompleted;
    557             throw context.arg;
    558           }
    559 
    560           context.dispatchException(context.arg);
    561 
    562         } else if (context.method === "return") {
    563           context.abrupt("return", context.arg);
    564         }
    565 
    566         state = GenStateExecuting;
    567 
    568         var record = tryCatch(innerFn, self, context);
    569         if (record.type === "normal") {
    570           // If an exception is thrown from innerFn, we leave state ===
    571           // GenStateExecuting and loop back for another invocation.
    572           state = context.done
    573             ? GenStateCompleted
    574             : GenStateSuspendedYield;
    575 
    576           if (record.arg === ContinueSentinel) {
    577             continue;
    578           }
    579 
    580           return {
    581             value: record.arg,
    582             done: context.done
    583           };
    584 
    585         } else if (record.type === "throw") {
    586           state = GenStateCompleted;
    587           // Dispatch the exception by looping back around to the
    588           // context.dispatchException(context.arg) call above.
    589           context.method = "throw";
    590           context.arg = record.arg;
    591         }
    592       }
    593     };
    594   }
    595 
    596   // Call delegate.iterator[context.method](context.arg) and handle the
    597   // result, either by returning a { value, done } result from the
    598   // delegate iterator, or by modifying context.method and context.arg,
    599   // setting context.delegate to null, and returning the ContinueSentinel.
    600   function maybeInvokeDelegate(delegate, context) {
    601     var method = delegate.iterator[context.method];
    602     if (method === undefined) {
    603       // A .throw or .return when the delegate iterator has no .throw
    604       // method always terminates the yield* loop.
    605       context.delegate = null;
    606 
    607       if (context.method === "throw") {
    608         // Note: ["return"] must be used for ES3 parsing compatibility.
    609         if (delegate.iterator["return"]) {
    610           // If the delegate iterator has a return method, give it a
    611           // chance to clean up.
    612           context.method = "return";
    613           context.arg = undefined;
    614           maybeInvokeDelegate(delegate, context);
    615 
    616           if (context.method === "throw") {
    617             // If maybeInvokeDelegate(context) changed context.method from
    618             // "return" to "throw", let that override the TypeError below.
    619             return ContinueSentinel;
    620           }
    621         }
    622 
    623         context.method = "throw";
    624         context.arg = new TypeError(
    625           "The iterator does not provide a 'throw' method");
    626       }
    627 
    628       return ContinueSentinel;
    629     }
    630 
    631     var record = tryCatch(method, delegate.iterator, context.arg);
    632 
    633     if (record.type === "throw") {
    634       context.method = "throw";
    635       context.arg = record.arg;
    636       context.delegate = null;
    637       return ContinueSentinel;
    638     }
    639 
    640     var info = record.arg;
    641 
    642     if (! info) {
    643       context.method = "throw";
    644       context.arg = new TypeError("iterator result is not an object");
    645       context.delegate = null;
    646       return ContinueSentinel;
    647     }
    648 
    649     if (info.done) {
    650       // Assign the result of the finished delegate to the temporary
    651       // variable specified by delegate.resultName (see delegateYield).
    652       context[delegate.resultName] = info.value;
    653 
    654       // Resume execution at the desired location (see delegateYield).
    655       context.next = delegate.nextLoc;
    656 
    657       // If context.method was "throw" but the delegate handled the
    658       // exception, let the outer generator proceed normally. If
    659       // context.method was "next", forget context.arg since it has been
    660       // "consumed" by the delegate iterator. If context.method was
    661       // "return", allow the original .return call to continue in the
    662       // outer generator.
    663       if (context.method !== "return") {
    664         context.method = "next";
    665         context.arg = undefined;
    666       }
    667 
    668     } else {
    669       // Re-yield the result returned by the delegate method.
    670       return info;
    671     }
    672 
    673     // The delegate iterator is finished, so forget it and continue with
    674     // the outer generator.
    675     context.delegate = null;
    676     return ContinueSentinel;
    677   }
    678 
    679   // Define Generator.prototype.{next,throw,return} in terms of the
    680   // unified ._invoke helper method.
    681   defineIteratorMethods(Gp);
    682 
    683   Gp[toStringTagSymbol] = "Generator";
    684 
    685   // A Generator should always return itself as the iterator object when the
    686   // @@iterator function is called on it. Some browsers' implementations of the
    687   // iterator prototype chain incorrectly implement this, causing the Generator
    688   // object to not be returned from this call. This ensures that doesn't happen.
    689   // See https://github.com/facebook/regenerator/issues/274 for more details.
    690   Gp[iteratorSymbol] = function() {
    691     return this;
    692   };
    693 
    694   Gp.toString = function() {
    695     return "[object Generator]";
    696   };
    697 
    698   function pushTryEntry(locs) {
    699     var entry = { tryLoc: locs[0] };
    700 
    701     if (1 in locs) {
    702       entry.catchLoc = locs[1];
    703     }
    704 
    705     if (2 in locs) {
    706       entry.finallyLoc = locs[2];
    707       entry.afterLoc = locs[3];
    708     }
    709 
    710     this.tryEntries.push(entry);
    711   }
    712 
    713   function resetTryEntry(entry) {
    714     var record = entry.completion || {};
    715     record.type = "normal";
    716     delete record.arg;
    717     entry.completion = record;
    718   }
    719 
    720   function Context(tryLocsList) {
    721     // The root entry object (effectively a try statement without a catch
    722     // or a finally block) gives us a place to store values thrown from
    723     // locations where there is no enclosing try statement.
    724     this.tryEntries = [{ tryLoc: "root" }];
    725     tryLocsList.forEach(pushTryEntry, this);
    726     this.reset(true);
    727   }
    728 
    729   exports.keys = function(object) {
    730     var keys = [];
    731     for (var key in object) {
    732       keys.push(key);
    733     }
    734     keys.reverse();
    735 
    736     // Rather than returning an object with a next method, we keep
    737     // things simple and return the next function itself.
    738     return function next() {
    739       while (keys.length) {
    740         var key = keys.pop();
    741         if (key in object) {
    742           next.value = key;
    743           next.done = false;
    744           return next;
    745         }
    746       }
    747 
    748       // To avoid creating an additional object, we just hang the .value
    749       // and .done properties off the next function object itself. This
    750       // also ensures that the minifier will not anonymize the function.
    751       next.done = true;
    752       return next;
    753     };
    754   };
    755 
    756   function values(iterable) {
    757     if (iterable) {
    758       var iteratorMethod = iterable[iteratorSymbol];
    759       if (iteratorMethod) {
    760         return iteratorMethod.call(iterable);
    761       }
    762 
    763       if (typeof iterable.next === "function") {
    764         return iterable;
    765       }
    766 
    767       if (!isNaN(iterable.length)) {
    768         var i = -1, next = function next() {
    769           while (++i < iterable.length) {
    770             if (hasOwn.call(iterable, i)) {
    771               next.value = iterable[i];
    772               next.done = false;
    773               return next;
    774             }
    775           }
    776 
    777           next.value = undefined;
    778           next.done = true;
    779 
    780           return next;
    781         };
    782 
    783         return next.next = next;
    784       }
    785     }
    786 
    787     // Return an iterator with no values.
    788     return { next: doneResult };
    789   }
    790   exports.values = values;
    791 
    792   function doneResult() {
    793     return { value: undefined, done: true };
    794   }
    795 
    796   Context.prototype = {
    797     constructor: Context,
    798 
    799     reset: function(skipTempReset) {
    800       this.prev = 0;
    801       this.next = 0;
    802       // Resetting context._sent for legacy support of Babel's
    803       // function.sent implementation.
    804       this.sent = this._sent = undefined;
    805       this.done = false;
    806       this.delegate = null;
    807 
    808       this.method = "next";
    809       this.arg = undefined;
    810 
    811       this.tryEntries.forEach(resetTryEntry);
    812 
    813       if (!skipTempReset) {
    814         for (var name in this) {
    815           // Not sure about the optimal order of these conditions:
    816           if (name.charAt(0) === "t" &&
    817               hasOwn.call(this, name) &&
    818               !isNaN(+name.slice(1))) {
    819             this[name] = undefined;
    820           }
    821         }
    822       }
    823     },
    824 
    825     stop: function() {
    826       this.done = true;
    827 
    828       var rootEntry = this.tryEntries[0];
    829       var rootRecord = rootEntry.completion;
    830       if (rootRecord.type === "throw") {
    831         throw rootRecord.arg;
    832       }
    833 
    834       return this.rval;
    835     },
    836 
    837     dispatchException: function(exception) {
    838       if (this.done) {
    839         throw exception;
    840       }
    841 
    842       var context = this;
    843       function handle(loc, caught) {
    844         record.type = "throw";
    845         record.arg = exception;
    846         context.next = loc;
    847 
    848         if (caught) {
    849           // If the dispatched exception was caught by a catch block,
    850           // then let that catch block handle the exception normally.
    851           context.method = "next";
    852           context.arg = undefined;
    853         }
    854 
    855         return !! caught;
    856       }
    857 
    858       for (var i = this.tryEntries.length - 1; i >= 0; --i) {
    859         var entry = this.tryEntries[i];
    860         var record = entry.completion;
    861 
    862         if (entry.tryLoc === "root") {
    863           // Exception thrown outside of any try block that could handle
    864           // it, so set the completion value of the entire function to
    865           // throw the exception.
    866           return handle("end");
    867         }
    868 
    869         if (entry.tryLoc <= this.prev) {
    870           var hasCatch = hasOwn.call(entry, "catchLoc");
    871           var hasFinally = hasOwn.call(entry, "finallyLoc");
    872 
    873           if (hasCatch && hasFinally) {
    874             if (this.prev < entry.catchLoc) {
    875               return handle(entry.catchLoc, true);
    876             } else if (this.prev < entry.finallyLoc) {
    877               return handle(entry.finallyLoc);
    878             }
    879 
    880           } else if (hasCatch) {
    881             if (this.prev < entry.catchLoc) {
    882               return handle(entry.catchLoc, true);
    883             }
    884 
    885           } else if (hasFinally) {
    886             if (this.prev < entry.finallyLoc) {
    887               return handle(entry.finallyLoc);
    888             }
    889 
    890           } else {
    891             throw new Error("try statement without catch or finally");
    892           }
    893         }
    894       }
    895     },
    896 
    897     abrupt: function(type, arg) {
    898       for (var i = this.tryEntries.length - 1; i >= 0; --i) {
    899         var entry = this.tryEntries[i];
    900         if (entry.tryLoc <= this.prev &&
    901             hasOwn.call(entry, "finallyLoc") &&
    902             this.prev < entry.finallyLoc) {
    903           var finallyEntry = entry;
    904           break;
    905         }
    906       }
    907 
    908       if (finallyEntry &&
    909           (type === "break" ||
    910            type === "continue") &&
    911           finallyEntry.tryLoc <= arg &&
    912           arg <= finallyEntry.finallyLoc) {
    913         // Ignore the finally entry if control is not jumping to a
    914         // location outside the try/catch block.
    915         finallyEntry = null;
    916       }
    917 
    918       var record = finallyEntry ? finallyEntry.completion : {};
    919       record.type = type;
    920       record.arg = arg;
    921 
    922       if (finallyEntry) {
    923         this.method = "next";
    924         this.next = finallyEntry.finallyLoc;
    925         return ContinueSentinel;
    926       }
    927 
    928       return this.complete(record);
    929     },
    930 
    931     complete: function(record, afterLoc) {
    932       if (record.type === "throw") {
    933         throw record.arg;
    934       }
    935 
    936       if (record.type === "break" ||
    937           record.type === "continue") {
    938         this.next = record.arg;
    939       } else if (record.type === "return") {
    940         this.rval = this.arg = record.arg;
    941         this.method = "return";
    942         this.next = "end";
    943       } else if (record.type === "normal" && afterLoc) {
    944         this.next = afterLoc;
    945       }
    946 
    947       return ContinueSentinel;
    948     },
    949 
    950     finish: function(finallyLoc) {
    951       for (var i = this.tryEntries.length - 1; i >= 0; --i) {
    952         var entry = this.tryEntries[i];
    953         if (entry.finallyLoc === finallyLoc) {
    954           this.complete(entry.completion, entry.afterLoc);
    955           resetTryEntry(entry);
    956           return ContinueSentinel;
    957         }
    958       }
    959     },
    960 
    961     "catch": function(tryLoc) {
    962       for (var i = this.tryEntries.length - 1; i >= 0; --i) {
    963         var entry = this.tryEntries[i];
    964         if (entry.tryLoc === tryLoc) {
    965           var record = entry.completion;
    966           if (record.type === "throw") {
    967             var thrown = record.arg;
    968             resetTryEntry(entry);
    969           }
    970           return thrown;
    971         }
    972       }
    973 
    974       // The context.catch method must only be called with a location
    975       // argument that corresponds to a known catch block.
    976       throw new Error("illegal catch attempt");
    977     },
    978 
    979     delegateYield: function(iterable, resultName, nextLoc) {
    980       this.delegate = {
    981         iterator: values(iterable),
    982         resultName: resultName,
    983         nextLoc: nextLoc
    984       };
    985 
    986       if (this.method === "next") {
    987         // Deliberately forget the last sent value so that we don't
    988         // accidentally pass it on to the delegate.
    989         this.arg = undefined;
    990       }
    991 
    992       return ContinueSentinel;
    993     }
    994   };
    995 
    996   // Regardless of whether this script is executing as a CommonJS module
    997   // or not, return the runtime object so that we can declare the variable
    998   // regeneratorRuntime in the outer scope, which allows this module to be
    999   // injected easily by `bin/regenerator --include-runtime script.js`.
    1000   return exports;
    1001 
    1002 }(
    1003   // If this script is executing as a CommonJS module, use module.exports
    1004   // as the regeneratorRuntime namespace. Otherwise create a new empty
    1005   // object. Either way, the resulting object will be used to initialize
    1006   // the regeneratorRuntime variable at the top of this file.
    1007   typeof module === "object" ? module.exports : {}
    1008 ));
    1009 
    1010 try {
    1011   regeneratorRuntime = runtime;
    1012 } catch (accidentalStrictMode) {
    1013   // This module should not be running in strict mode, so the above
    1014   // assignment should always work unless something is misconfigured. Just
    1015   // in case runtime.js accidentally runs in strict mode, we can escape
    1016   // strict mode using a global Function call. This could conceivably fail
    1017   // if a Content Security Policy forbids using Function, but in that case
    1018   // the proper solution is to fix the accidental strict mode problem. If
    1019   // you've misconfigured your bundler to force strict mode and applied a
    1020   // CSP to forbid Function, and you're not willing to fix either of those
    1021   // problems, please detail your unique predicament in a GitHub issue.
    1022   Function("r", "regeneratorRuntime = r")(runtime);
    1023 }
    1024 
    1025 },{}],"BxGn":[function(require,module,exports) {
    1026 module.exports = require("regenerator-runtime");
    1027 
    1028 },{"regenerator-runtime":"rqzK"}],"SaI5":[function(require,module,exports) {
     214},{"./action-types":"gg2v"}],"SaI5":[function(require,module,exports) {
    1029215"use strict";
    1030216
    1031217Object.defineProperty(exports, "__esModule", {
    Object.defineProperty(exports, "__esModule", { 
    1033219});
    1034220exports.getActiveComponents = getActiveComponents;
    1035221
    1036 var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
    1037 
    1038222var _actions = require("./actions");
    1039223
    1040 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
    1041 
    1042 var _marked = /*#__PURE__*/_regenerator.default.mark(getActiveComponents);
     224/**
     225 * Internal dependencies.
     226 */
    1043227
    1044228/**
    1045229 * Resolver for retrieving active BP Components.
    1046230 */
    1047 function getActiveComponents() {
    1048   var list;
    1049   return _regenerator.default.wrap(function getActiveComponents$(_context) {
    1050     while (1) {
    1051       switch (_context.prev = _context.next) {
    1052         case 0:
    1053           _context.next = 2;
    1054           return (0, _actions.fetchFromAPI)('/buddypress/v1/components?status=active', true);
    1055 
    1056         case 2:
    1057           list = _context.sent;
    1058           _context.next = 5;
    1059           return (0, _actions.getActiveComponents)(list);
    1060 
    1061         case 5:
    1062         case "end":
    1063           return _context.stop();
    1064       }
    1065     }
    1066   }, _marked);
     231function* getActiveComponents() {
     232  const list = yield (0, _actions.fetchFromAPI)('/buddypress/v1/components?status=active', true);
     233  yield (0, _actions.getActiveComponents)(list);
    1067234}
    1068 },{"@babel/runtime/regenerator":"BxGn","./actions":"NTbX"}],"cQfh":[function(require,module,exports) {
    1069 function _defineProperty(obj, key, value) {
    1070   if (key in obj) {
    1071     Object.defineProperty(obj, key, {
    1072       value: value,
    1073       enumerable: true,
    1074       configurable: true,
    1075       writable: true
    1076     });
    1077   } else {
    1078     obj[key] = value;
    1079   }
    1080 
    1081   return obj;
    1082 }
    1083 
    1084 module.exports = _defineProperty;
    1085 },{}],"yrui":[function(require,module,exports) {
     235},{"./actions":"NTbX"}],"yrui":[function(require,module,exports) {
    1086236"use strict";
    1087237
    1088238Object.defineProperty(exports, "__esModule", {
    Object.defineProperty(exports, "__esModule", { 
    1090240});
    1091241exports.default = void 0;
    1092242
    1093 var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
    1094 
    1095243var _actionTypes = require("./action-types");
    1096244
    1097 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
    1098 
    1099 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
    1100 
    1101 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
     245/**
     246 * Internal dependencies
     247 */
    1102248
    1103249/**
    1104250 * Default state.
    1105251 */
    1106 var DEFAULT_STATE = {
     252const DEFAULT_STATE = {
    1107253  components: []
    1108254};
    1109255/**
    var DEFAULT_STATE = { 
    1115261 * @return  {Object}          New or existing state.
    1116262 */
    1117263
    1118 var reducer = function reducer() {
    1119   var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_STATE;
    1120   var action = arguments.length > 1 ? arguments[1] : undefined;
    1121 
     264const reducer = (state = DEFAULT_STATE, action) => {
    1122265  switch (action.type) {
    1123266    case _actionTypes.TYPES.GET_ACTIVE_COMPONENTS:
    1124       return _objectSpread(_objectSpread({}, state), {}, {
     267      return { ...state,
    1125268        components: action.list
    1126       });
     269      };
    1127270  }
    1128271
    1129272  return state;
    var reducer = function reducer() { 
    1131274
    1132275var _default = reducer;
    1133276exports.default = _default;
    1134 },{"@babel/runtime/helpers/defineProperty":"cQfh","./action-types":"gg2v"}],"KdPQ":[function(require,module,exports) {
     277},{"./action-types":"gg2v"}],"KdPQ":[function(require,module,exports) {
    1135278"use strict";
    1136279
    1137280Object.defineProperty(exports, "__esModule", {
    exports.controls = void 0; 
    1142285/**
    1143286 * WordPress dependencies.
    1144287 */
    1145 var _wp = wp,
    1146     apiFetch = _wp.apiFetch;
     288const {
     289  apiFetch
     290} = wp;
    1147291/**
    1148292 * Default export for registering the controls with the store.
    1149293 *
    var _wp = wp, 
    1151295 *                  the controls property of the registration object.
    1152296 */
    1153297
    1154 var controls = {
    1155   FETCH_FROM_API: function FETCH_FROM_API(_ref) {
    1156     var path = _ref.path,
    1157         parse = _ref.parse;
     298const controls = {
     299  FETCH_FROM_API({
     300    path,
     301    parse
     302  }) {
    1158303    return apiFetch({
    1159       path: path,
    1160       parse: parse
     304      path,
     305      parse
    1161306    });
    1162307  }
     308
    1163309};
    1164310exports.controls = controls;
    1165311},{}],"QFc2":[function(require,module,exports) {
    function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && 
    1191337/**
    1192338 * WordPress dependencies.
    1193339 */
    1194 var _wp = wp,
    1195     registerStore = _wp.data.registerStore;
     340const {
     341  data: {
     342    registerStore
     343  }
     344} = wp;
    1196345/**
    1197346 * Internal dependencies.
    1198347 */
    1199348
    1200349registerStore(_constants.STORE_KEY, {
    1201350  reducer: _reducers.default,
    1202   actions: actions,
    1203   selectors: selectors,
     351  actions,
     352  selectors,
    1204353  controls: _controls.controls,
    1205   resolvers: resolvers
     354  resolvers
    1206355});
    1207 var BP_CORE_STORE_KEY = _constants.STORE_KEY;
     356const BP_CORE_STORE_KEY = _constants.STORE_KEY;
    1208357exports.BP_CORE_STORE_KEY = BP_CORE_STORE_KEY;
    1209358var _default = BP_CORE_STORE_KEY;
    1210359exports.default = _default;
    exports.currentPostId = currentPostId; 
    1222371exports.getCurrentWidgetsSidebar = getCurrentWidgetsSidebar;
    1223372exports.default = void 0;
    1224373
    1225 var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
    1226 
    1227374var _register = _interopRequireDefault(require("./register"));
    1228375
    1229376function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    1231378/**
    1232379 * WordPress dependencies.
    1233380 */
    1234 var _wp = wp,
    1235     useSelect = _wp.data.useSelect;
     381const {
     382  data: {
     383    useSelect
     384  }
     385} = wp;
    1236386/**
    1237387 * External dependencies.
    1238388 */
    1239389
    1240 var _lodash = lodash,
    1241     find = _lodash.find,
    1242     get = _lodash.get;
     390const {
     391  find,
     392  get
     393} = lodash;
    1243394/**
    1244395 * Internal dependencies.
    1245396 */
    var _lodash = lodash, 
    1253404 * @param {string} feature (optional) The feature to check.
    1254405 * @return {boolean} Whether a component or the feature of an active component is enabled.
    1255406 */
    1256 function isActive(component) {
    1257   var feature = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
    1258   var components = useSelect(function (select) {
     407function isActive(component, feature = '') {
     408  const components = useSelect(select => {
    1259409    return select(_register.default).getActiveComponents();
    1260410  }, []);
    1261   var activeComponent = find(components, ['name', component]);
     411  const activeComponent = find(components, ['name', component]);
    1262412
    1263413  if (!feature) {
    1264414    return !!activeComponent;
    var _default = isActive; 
    1279429exports.default = _default;
    1280430
    1281431function activityTypes() {
    1282   var components = useSelect(function (select) {
     432  const components = useSelect(select => {
    1283433    return select(_register.default).getActiveComponents();
    1284434  }, []);
    1285   var activityComponent = find(components, ['name', 'activity']);
     435  const activityComponent = find(components, ['name', 'activity']);
    1286436
    1287437  if (!activityComponent) {
    1288438    return [];
    1289439  }
    1290440
    1291   var activityTypes = get(activityComponent, ['features', 'types']);
    1292   var activityTypesList = [];
    1293   Object.entries(activityTypes).forEach(function (_ref) {
    1294     var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
    1295         type = _ref2[0],
    1296         label = _ref2[1];
    1297 
     441  const activityTypes = get(activityComponent, ['features', 'types']);
     442  let activityTypesList = [];
     443  Object.entries(activityTypes).forEach(([type, label]) => {
    1298444    activityTypesList.push({
    1299445      label: label,
    1300446      value: type
    function activityTypes() { 
    1312458
    1313459
    1314460function loggedInUser() {
    1315   var loggedInUser = useSelect(function (select) {
    1316     var store = select('core');
     461  const loggedInUser = useSelect(select => {
     462    const store = select('core');
    1317463
    1318464    if (store) {
    1319465      return select('core').getCurrentUser();
    function loggedInUser() { 
    1333479
    1334480
    1335481function postAuhor() {
    1336   var postAuhor = useSelect(function (select) {
    1337     var editorStore = select('core/editor');
    1338     var coreStore = select('core');
     482  const postAuhor = useSelect(select => {
     483    const editorStore = select('core/editor');
     484    const coreStore = select('core');
    1339485
    1340486    if (editorStore && coreStore) {
    1341       var postAuthorId = editorStore.getCurrentPostAttribute('author');
    1342       var authorsList = coreStore.getAuthors();
     487      const postAuthorId = editorStore.getCurrentPostAttribute('author');
     488      const authorsList = coreStore.getAuthors();
    1343489      return find(authorsList, ['id', postAuthorId]);
    1344490    }
    1345491
    function postAuhor() { 
    1357503
    1358504
    1359505function currentPostId() {
    1360   var currentPostId = useSelect(function (select) {
    1361     var store = select('core/editor');
     506  const currentPostId = useSelect(select => {
     507    const store = select('core/editor');
    1362508
    1363509    if (store) {
    1364510      return store.getCurrentPostId();
    function currentPostId() { 
    1378524 */
    1379525
    1380526
    1381 function getCurrentWidgetsSidebar() {
    1382   var widgetClientId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
    1383   var currentWidgetsSidebar = useSelect(function (select) {
    1384     var blockEditorStore = select('core/block-editor');
    1385     var widgetsStore = select('core/edit-widgets');
     527function getCurrentWidgetsSidebar(widgetClientId = '') {
     528  const currentWidgetsSidebar = useSelect(select => {
     529    const blockEditorStore = select('core/block-editor');
     530    const widgetsStore = select('core/edit-widgets');
    1386531
    1387532    if (widgetClientId && widgetsStore && blockEditorStore) {
    1388       var areas = blockEditorStore.getBlocks();
    1389       var parents = blockEditorStore.getBlockParents(widgetClientId);
    1390       var sidebars = [];
    1391       areas.forEach(function (_ref3) {
    1392         var clientId = _ref3.clientId,
    1393             attributes = _ref3.attributes;
     533      const areas = blockEditorStore.getBlocks();
     534      const parents = blockEditorStore.getBlockParents(widgetClientId);
     535      let sidebars = [];
     536      areas.forEach(({
     537        clientId,
     538        attributes
     539      }) => {
    1394540        sidebars.push({
    1395541          id: attributes.id,
    1396542          isCurrent: -1 !== parents.indexOf(clientId)
    function getCurrentWidgetsSidebar() { 
    1403549  }, []);
    1404550  return currentWidgetsSidebar;
    1405551}
    1406 },{"@babel/runtime/helpers/slicedToArray":"DERy","./register":"QFc2"}],"xHVY":[function(require,module,exports) {
     552},{"./register":"QFc2"}],"xHVY":[function(require,module,exports) {
    1407553"use strict";
    1408554
    1409555Object.defineProperty(exports, "__esModule", {
  • src/bp-core/js/blocks/login-form.js

    diff --git src/bp-core/js/blocks/login-form.js src/bp-core/js/blocks/login-form.js
    index 5f9eb3d0a..1fc1d0fa0 100644
    exports.default = void 0; 
    128128/**
    129129 * WordPress dependencies.
    130130 */
    131 var _wp = wp,
    132     InspectorControls = _wp.blockEditor.InspectorControls,
    133     _wp$components = _wp.components,
    134     Disabled = _wp$components.Disabled,
    135     PanelBody = _wp$components.PanelBody,
    136     TextControl = _wp$components.TextControl,
    137     ToggleControl = _wp$components.ToggleControl,
    138     _wp$element = _wp.element,
    139     Fragment = _wp$element.Fragment,
    140     createElement = _wp$element.createElement,
    141     __ = _wp.i18n.__;
    142 /**
    143  * BuddyPress dependencies.
    144  */
    145 
    146 var _bp = bp,
    147     ServerSideRender = _bp.blockComponents.ServerSideRender;
    148 
    149 var editLoginForm = function editLoginForm(_ref) {
    150   var attributes = _ref.attributes,
    151       setAttributes = _ref.setAttributes;
    152   var title = attributes.title,
    153       forgotPwdLink = attributes.forgotPwdLink;
     131const {
     132  blockEditor: {
     133    InspectorControls
     134  },
     135  components: {
     136    Disabled,
     137    PanelBody,
     138    TextControl,
     139    ToggleControl
     140  },
     141  element: {
     142    Fragment,
     143    createElement
     144  },
     145  i18n: {
     146    __
     147  },
     148  serverSideRender: ServerSideRender
     149} = wp;
     150
     151const editLoginForm = ({
     152  attributes,
     153  setAttributes
     154}) => {
     155  const {
     156    title,
     157    forgotPwdLink
     158  } = attributes;
    154159  return createElement(Fragment, null, createElement(InspectorControls, null, createElement(PanelBody, {
    155160    title: __('Settings', 'buddypress'),
    156161    initialOpen: true
    157162  }, createElement(TextControl, {
    158163    label: __('Title', 'buddypress'),
    159164    value: title,
    160     onChange: function onChange(text) {
     165    onChange: text => {
    161166      setAttributes({
    162167        title: text
    163168      });
    var editLoginForm = function editLoginForm(_ref) { 
    165170  }), createElement(ToggleControl, {
    166171    label: __('Include the link to reset the user password', 'buddypress'),
    167172    checked: !!forgotPwdLink,
    168     onChange: function onChange() {
     173    onChange: () => {
    169174      setAttributes({
    170175        forgotPwdLink: !forgotPwdLink
    171176      });
    exports.default = void 0; 
    189194/**
    190195 * WordPress dependencies.
    191196 */
    192 var _wp = wp,
    193     createBlock = _wp.blocks.createBlock;
     197const {
     198  blocks: {
     199    createBlock
     200  }
     201} = wp;
    194202/**
    195203 * Transforms Legacy Login Form Widget to Login Form Block.
    196204 *
    197205 * @type {Object}
    198206 */
    199207
    200 var transforms = {
     208const transforms = {
    201209  from: [{
    202210    type: 'block',
    203211    blocks: ['core/legacy-widget'],
    204     isMatch: function isMatch(_ref) {
    205       var idBase = _ref.idBase,
    206           instance = _ref.instance;
    207 
     212    isMatch: ({
     213      idBase,
     214      instance
     215    }) => {
    208216      if (!(instance !== null && instance !== void 0 && instance.raw)) {
    209217        return false;
    210218      }
    211219
    212220      return idBase === 'bp_core_login_widget';
    213221    },
    214     transform: function transform(_ref2) {
    215       var instance = _ref2.instance;
     222    transform: ({
     223      instance
     224    }) => {
    216225      return createBlock('bp/login-form', {
    217226        title: instance.raw.title
    218227      });
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    233242/**
    234243 * WordPress dependencies.
    235244 */
    236 var _wp = wp,
    237     registerBlockType = _wp.blocks.registerBlockType,
    238     __ = _wp.i18n.__;
     245const {
     246  blocks: {
     247    registerBlockType
     248  },
     249  i18n: {
     250    __
     251  }
     252} = wp;
    239253/**
    240254 * Internal dependencies.
    241255 */
  • src/bp-core/js/blocks/primary-nav.js

    diff --git src/bp-core/js/blocks/primary-nav.js src/bp-core/js/blocks/primary-nav.js
    index 67b40d2d0..adb34d270 100644
    exports.default = void 0; 
    128128/**
    129129 * WordPress dependencies.
    130130 */
    131 var _wp = wp,
    132     InspectorControls = _wp.blockEditor.InspectorControls,
    133     _wp$components = _wp.components,
    134     Disabled = _wp$components.Disabled,
    135     Notice = _wp$components.Notice,
    136     PanelBody = _wp$components.PanelBody,
    137     ToggleControl = _wp$components.ToggleControl,
    138     _wp$element = _wp.element,
    139     Fragment = _wp$element.Fragment,
    140     createElement = _wp$element.createElement,
    141     __ = _wp.i18n.__;
     131const {
     132  blockEditor: {
     133    InspectorControls
     134  },
     135  components: {
     136    Disabled,
     137    Notice,
     138    PanelBody,
     139    ToggleControl
     140  },
     141  element: {
     142    Fragment,
     143    createElement
     144  },
     145  i18n: {
     146    __
     147  },
     148  serverSideRender: ServerSideRender
     149} = wp;
    142150/**
    143151 * BuddyPress dependencies.
    144152 */
    145153
    146 var _bp = bp,
    147     ServerSideRender = _bp.blockComponents.ServerSideRender,
    148     getCurrentWidgetsSidebar = _bp.blockData.getCurrentWidgetsSidebar;
    149 
    150 var editPrimaryNavBlock = function editPrimaryNavBlock(_ref) {
    151   var attributes = _ref.attributes,
    152       setAttributes = _ref.setAttributes,
    153       clientId = _ref.clientId;
    154   var displayTitle = attributes.displayTitle;
    155   var currentSidebar = getCurrentWidgetsSidebar(clientId);
    156   var disabledSidebars = ['sidebar-buddypress-members', 'sidebar-buddypress-groups'];
     154const {
     155  blockData: {
     156    getCurrentWidgetsSidebar
     157  }
     158} = bp;
     159
     160const editPrimaryNavBlock = ({
     161  attributes,
     162  setAttributes,
     163  clientId
     164}) => {
     165  const {
     166    displayTitle
     167  } = attributes;
     168  const currentSidebar = getCurrentWidgetsSidebar(clientId);
     169  const disabledSidebars = ['sidebar-buddypress-members', 'sidebar-buddypress-groups'];
    157170
    158171  if (currentSidebar && currentSidebar.id && -1 !== disabledSidebars.indexOf(currentSidebar.id)) {
    159172    return createElement(Notice, {
    var editPrimaryNavBlock = function editPrimaryNavBlock(_ref) { 
    168181  }, createElement(ToggleControl, {
    169182    label: __('Include navigation title', 'buddypress'),
    170183    checked: !!displayTitle,
    171     onChange: function onChange() {
     184    onChange: () => {
    172185      setAttributes({
    173186        displayTitle: !displayTitle
    174187      });
    exports.default = void 0; 
    192205/**
    193206 * WordPress dependencies.
    194207 */
    195 var _wp = wp,
    196     createBlock = _wp.blocks.createBlock;
     208const {
     209  blocks: {
     210    createBlock
     211  }
     212} = wp;
    197213/**
    198214 * Transforms Legacy Widget to Primary Nav Block.
    199215 *
    200216 * @type {Object}
    201217 */
    202218
    203 var transforms = {
     219const transforms = {
    204220  from: [{
    205221    type: 'block',
    206222    blocks: ['core/legacy-widget'],
    207     isMatch: function isMatch(_ref) {
    208       var idBase = _ref.idBase,
    209           instance = _ref.instance;
    210 
     223    isMatch: ({
     224      idBase,
     225      instance
     226    }) => {
    211227      if (!(instance !== null && instance !== void 0 && instance.raw)) {
    212228        return false;
    213229      }
    214230
    215231      return idBase === 'bp_nouveau_sidebar_object_nav_widget';
    216232    },
    217     transform: function transform(_ref2) {
    218       var instance = _ref2.instance;
     233    transform: ({
     234      instance
     235    }) => {
    219236      return createBlock('bp/primary-nav', {
    220237        displayTitle: instance.raw.bp_nouveau_widget_title
    221238      });
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    236253/**
    237254 * WordPress dependencies.
    238255 */
    239 var _wp = wp,
    240     registerBlockType = _wp.blocks.registerBlockType,
    241     __ = _wp.i18n.__;
     256const {
     257  blocks: {
     258    registerBlockType
     259  },
     260  i18n: {
     261    __
     262  }
     263} = wp;
    242264/**
    243265 * Internal dependencies.
    244266 */
  • src/bp-core/js/dynamic-widget-block.js

    diff --git src/bp-core/js/dynamic-widget-block.js src/bp-core/js/dynamic-widget-block.js
    index dfe59fefc..867540738 100644
    parcelRequire = (function (modules, cache, entry, globalName) { 
    118118
    119119  return newRequire;
    120120})({"eNhW":[function(require,module,exports) {
    121 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    122 
    123 function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    124 
    125 function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
    126 
    127121/**
    128122 * WordPress dependencies.
    129123 */
    130 var _wp = wp,
    131     addQueryArgs = _wp.url.addQueryArgs;
     124const {
     125  url: {
     126    addQueryArgs
     127  }
     128} = wp;
    132129/**
    133130 * External dependencies.
    134131 */
    135132
    136 var _lodash = lodash,
    137     template = _lodash.template; // Use the bp global.
     133const {
     134  template
     135} = lodash; // Use the bp global.
    138136
    139137window.bp = window.bp || {};
    140138/**
    window.bp = window.bp || {}; 
    143141 * @since 9.0.0
    144142 */
    145143
    146 bp.dynamicWidgetBlock = /*#__PURE__*/function () {
    147   function bpDynamicWidgetBlock(settings, blocks) {
    148     var _this = this;
    149 
    150     _classCallCheck(this, bpDynamicWidgetBlock);
    151 
    152     var path = settings.path,
    153         root = settings.root,
    154         nonce = settings.nonce;
     144bp.dynamicWidgetBlock = class bpDynamicWidgetBlock {
     145  constructor(settings, blocks) {
     146    const {
     147      path,
     148      root,
     149      nonce
     150    } = settings;
    155151    this.path = path;
    156152    this.root = root;
    157153    this.nonce = nonce, this.blocks = blocks;
    158     this.blocks.forEach(function (block, i) {
    159       var _ref = block.query_args || 'active',
    160           type = _ref.type;
    161 
    162       var _ref2 = block.preloaded || [],
    163           body = _ref2.body;
    164 
    165       _this.blocks[i].items = {
     154    this.blocks.forEach((block, i) => {
     155      const {
     156        type
     157      } = block.query_args || 'active';
     158      const {
     159        body
     160      } = block.preloaded || [];
     161      this.blocks[i].items = {
    166162        'active': [],
    167163        'newest': [],
    168164        'popular': [],
    169165        'alphabetical': []
    170166      };
    171167
    172       if (!_this.blocks[i].items[type].length && body && body.length) {
    173         _this.blocks[i].items[type] = body;
     168      if (!this.blocks[i].items[type].length && body && body.length) {
     169        this.blocks[i].items[type] = body;
    174170      }
    175171    });
    176172  }
    177173
    178   _createClass(bpDynamicWidgetBlock, [{
    179     key: "useTemplate",
    180     value: function useTemplate(tmpl) {
    181       var options = {
    182         evaluate: /<#([\s\S]+?)#>/g,
    183         interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
    184         escape: /\{\{([^\}]+?)\}\}(?!\})/g,
    185         variable: 'data'
    186       };
    187       return template(document.querySelector('#tmpl-' + tmpl).innerHTML, options);
    188     }
    189   }, {
    190     key: "loop",
    191     value: function loop() {// This method needs to be overriden.
    192     }
    193   }, {
    194     key: "getItems",
    195     value: function getItems() {
    196       var _this2 = this;
     174  useTemplate(tmpl) {
     175    const options = {
     176      evaluate: /<#([\s\S]+?)#>/g,
     177      interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
     178      escape: /\{\{([^\}]+?)\}\}(?!\})/g,
     179      variable: 'data'
     180    };
     181    return template(document.querySelector('#tmpl-' + tmpl).innerHTML, options);
     182  }
     183
     184  loop() {// This method needs to be overriden.
     185  }
    197186
    198       var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'active';
    199       var blockIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
    200       this.blocks[blockIndex].query_args.type = type;
     187  getItems(type = 'active', blockIndex = 0) {
     188    this.blocks[blockIndex].query_args.type = type;
    201189
    202       if (this.blocks[blockIndex].items[type].length) {
     190    if (this.blocks[blockIndex].items[type].length) {
     191      this.loop(this.blocks[blockIndex].items[type], this.blocks[blockIndex].selector, type);
     192    } else {
     193      fetch(addQueryArgs(this.root + this.path, this.blocks[blockIndex].query_args), {
     194        method: 'GET',
     195        headers: {
     196          'X-WP-Nonce': this.nonce
     197        }
     198      }).then(response => response.json()).then(data => {
     199        this.blocks[blockIndex].items[type] = data;
    203200        this.loop(this.blocks[blockIndex].items[type], this.blocks[blockIndex].selector, type);
    204       } else {
    205         fetch(addQueryArgs(this.root + this.path, this.blocks[blockIndex].query_args), {
    206           method: 'GET',
    207           headers: {
    208             'X-WP-Nonce': this.nonce
    209           }
    210         }).then(function (response) {
    211           return response.json();
    212         }).then(function (data) {
    213           _this2.blocks[blockIndex].items[type] = data;
    214 
    215           _this2.loop(_this2.blocks[blockIndex].items[type], _this2.blocks[blockIndex].selector, type);
    216         });
    217       }
     201      });
    218202    }
    219   }]);
     203  }
    220204
    221   return bpDynamicWidgetBlock;
    222 }();
     205};
    223206},{}]},{},["eNhW"], null)
     207 No newline at end of file
  • src/bp-friends/classes/class-bp-friends-component.php

    diff --git src/bp-friends/classes/class-bp-friends-component.php src/bp-friends/classes/class-bp-friends-component.php
    index 287a6f417..aeb6eb70b 100644
    class BP_Friends_Component extends BP_Component { 
    370370                                                'wp-components',
    371371                                                'wp-i18n',
    372372                                                'wp-block-editor',
     373                                                'wp-server-side-render',
    373374                                                'bp-block-data',
    374                                                 'bp-block-components',
    375375                                        ),
    376376                                        'style'              => 'bp-friends-block',
    377377                                        'style_url'          => plugins_url( 'css/blocks/friends.css', dirname( __FILE__ ) ),
  • src/bp-friends/js/blocks/friends.js

    diff --git src/bp-friends/js/blocks/friends.js src/bp-friends/js/blocks/friends.js
    index 611ea18c8..d5b81cd0e 100644
    exports.TYPES = void 0; 
    128128/**
    129129 * WordPress dependencies.
    130130 */
    131 var _wp = wp,
    132     __ = _wp.i18n.__;
     131const {
     132  i18n: {
     133    __
     134  }
     135} = wp;
    133136/**
    134137 * Friends ordering types.
    135138 *
    136139 * @type {Array}
    137140 */
    138141
    139 var TYPES = [{
     142const TYPES = [{
    140143  label: __('Newest', 'buddypress'),
    141144  value: 'newest'
    142145}, {
    var _constants = require("./constants"); 
    160163/**
    161164 * WordPress dependencies.
    162165 */
    163 var _wp = wp,
    164     InspectorControls = _wp.blockEditor.InspectorControls,
    165     _wp$components = _wp.components,
    166     Disabled = _wp$components.Disabled,
    167     PanelBody = _wp$components.PanelBody,
    168     RangeControl = _wp$components.RangeControl,
    169     SelectControl = _wp$components.SelectControl,
    170     ToggleControl = _wp$components.ToggleControl,
    171     _wp$element = _wp.element,
    172     Fragment = _wp$element.Fragment,
    173     createElement = _wp$element.createElement,
    174     __ = _wp.i18n.__;
     166const {
     167  blockEditor: {
     168    InspectorControls
     169  },
     170  components: {
     171    Disabled,
     172    PanelBody,
     173    RangeControl,
     174    SelectControl,
     175    ToggleControl
     176  },
     177  element: {
     178    Fragment,
     179    createElement
     180  },
     181  i18n: {
     182    __
     183  },
     184  serverSideRender: ServerSideRender
     185} = wp;
    175186/**
    176187 * BuddyPress dependencies.
    177188 */
    178189
    179 var _bp = bp,
    180     ServerSideRender = _bp.blockComponents.ServerSideRender,
    181     currentPostId = _bp.blockData.currentPostId;
     190const {
     191  blockData: {
     192    currentPostId
     193  }
     194} = bp;
    182195/**
    183196 * Internal dependencies.
    184197 */
    185198
    186 var editDynamicFriendsBlock = function editDynamicFriendsBlock(_ref) {
    187   var attributes = _ref.attributes,
    188       setAttributes = _ref.setAttributes;
    189   var postId = attributes.postId,
    190       maxFriends = attributes.maxFriends,
    191       friendDefault = attributes.friendDefault,
    192       linkTitle = attributes.linkTitle;
    193   var post = currentPostId();
     199const editDynamicFriendsBlock = ({
     200  attributes,
     201  setAttributes
     202}) => {
     203  const {
     204    postId,
     205    maxFriends,
     206    friendDefault,
     207    linkTitle
     208  } = attributes;
     209  const post = currentPostId();
    194210
    195211  if (!postId && post) {
    196212    setAttributes({
    var editDynamicFriendsBlock = function editDynamicFriendsBlock(_ref) { 
    204220  }, createElement(RangeControl, {
    205221    label: __('Max friends to show', 'buddypress'),
    206222    value: maxFriends,
    207     onChange: function onChange(value) {
    208       return setAttributes({
    209         maxFriends: value
    210       });
    211     },
     223    onChange: value => setAttributes({
     224      maxFriends: value
     225    }),
    212226    min: 1,
    213227    max: 10,
    214228    required: true
    var editDynamicFriendsBlock = function editDynamicFriendsBlock(_ref) { 
    216230    label: __('Default members to show', 'buddypress'),
    217231    value: friendDefault,
    218232    options: _constants.TYPES,
    219     onChange: function onChange(option) {
     233    onChange: option => {
    220234      setAttributes({
    221235        friendDefault: option
    222236      });
    var editDynamicFriendsBlock = function editDynamicFriendsBlock(_ref) { 
    224238  }), createElement(ToggleControl, {
    225239    label: __('Link block title to Member\'s profile friends page', 'buddypress'),
    226240    checked: !!linkTitle,
    227     onChange: function onChange() {
     241    onChange: () => {
    228242      setAttributes({
    229243        linkTitle: !linkTitle
    230244      });
    exports.default = void 0; 
    248262/**
    249263 * WordPress dependencies.
    250264 */
    251 var _wp = wp,
    252     createBlock = _wp.blocks.createBlock;
     265const {
     266  blocks: {
     267    createBlock
     268  }
     269} = wp;
    253270/**
    254271 * Transforms Legacy Widget to Friends Block.
    255272 *
    256273 * @type {Object}
    257274 */
    258275
    259 var transforms = {
     276const transforms = {
    260277  from: [{
    261278    type: 'block',
    262279    blocks: ['core/legacy-widget'],
    263     isMatch: function isMatch(_ref) {
    264       var idBase = _ref.idBase,
    265           instance = _ref.instance;
    266 
     280    isMatch: ({
     281      idBase,
     282      instance
     283    }) => {
    267284      if (!(instance !== null && instance !== void 0 && instance.raw)) {
    268285        return false;
    269286      }
    270287
    271288      return idBase === 'bp_core_friends_widget';
    272289    },
    273     transform: function transform(_ref2) {
    274       var instance = _ref2.instance;
     290    transform: ({
     291      instance
     292    }) => {
    275293      return createBlock('bp/friends', {
    276294        maxFriends: instance.raw.max_friends,
    277295        friendDefault: instance.raw.friend_default,
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    294312/**
    295313 * WordPress dependencies.
    296314 */
    297 var _wp = wp,
    298     registerBlockType = _wp.blocks.registerBlockType,
    299     __ = _wp.i18n.__;
     315const {
     316  blocks: {
     317    registerBlockType
     318  },
     319  i18n: {
     320    __
     321  }
     322} = wp;
    300323/**
    301324 * Internal dependencies.
    302325 */
  • src/bp-friends/js/friends.js

    diff --git src/bp-friends/js/friends.js src/bp-friends/js/friends.js
    index 93de95628..359827b35 100644
    parcelRequire = (function (modules, cache, entry, globalName) { 
    118118
    119119  return newRequire;
    120120})({"pMhP":[function(require,module,exports) {
    121 function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
    122 
    123 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    124 
    125 function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    126 
    127 function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
    128 
    129 function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
    130 
    131 function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
    132 
    133 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
    134 
    135 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
    136 
    137 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
    138 
    139 function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
    140 
    141 function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
    142 
    143 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
    144 
    145 function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
    146 
    147121/**
    148122 * WordPress dependencies.
    149123 */
    150 var _wp = wp,
    151     _wp$i18n = _wp.i18n,
    152     __ = _wp$i18n.__,
    153     sprintf = _wp$i18n.sprintf;
     124const {
     125  i18n: {
     126    __,
     127    sprintf
     128  }
     129} = wp;
    154130/**
    155131 * BuddyPress dependencies.
    156132 */
    157133
    158 var _bp = bp,
    159     dynamicWidgetBlock = _bp.dynamicWidgetBlock;
     134const {
     135  dynamicWidgetBlock
     136} = bp;
    160137/**
    161138 * Front-end Friends block class.
    162139 */
    163140
    164 var bpFriendsWidgetBlock = /*#__PURE__*/function (_dynamicWidgetBlock) {
    165   _inherits(bpFriendsWidgetBlock, _dynamicWidgetBlock);
    166 
    167   var _super = _createSuper(bpFriendsWidgetBlock);
    168 
    169   function bpFriendsWidgetBlock() {
    170     _classCallCheck(this, bpFriendsWidgetBlock);
    171 
    172     return _super.apply(this, arguments);
    173   }
    174 
    175   _createClass(bpFriendsWidgetBlock, [{
    176     key: "loop",
    177     value: function loop() {
    178       var friends = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
    179       var container = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
    180       var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'active';
    181 
    182       var tmpl = _get(_getPrototypeOf(bpFriendsWidgetBlock.prototype), "useTemplate", this).call(this, 'bp-friends-item');
    183 
    184       var selector = document.querySelector('#' + container);
    185       var output = '';
    186 
    187       if (friends && friends.length) {
    188         friends.forEach(function (friend) {
    189           if ('active' === type && friend.last_activity) {
    190             /* translators: %s: a human time diff. */
    191             friend.extra = sprintf(__('Active %s', 'buddypress'), friend.last_activity.timediff);
    192           } else if ('popular' === type && friend.total_friend_count) {
    193             var friendsCount = parseInt(friend.total_friend_count, 10);
    194 
    195             if (0 === friendsCount) {
    196               friend.extra = __('No friends', 'buddypress');
    197             } else if (1 === friendsCount) {
    198               friend.extra = __('1 friend', 'buddypress');
    199             } else {
    200               /* translators: %s: total friend count (more than 1). */
    201               friend.extra = sprintf(__('%s friends', 'buddypress'), friend.total_friend_count);
    202             }
    203           } else if ('newest' === type && friend.registered_since) {
    204             /* translators: %s is time elapsed since the registration date happened */
    205             friend.extra = sprintf(__('Registered %s', 'buddypress'), friend.registered_since);
     141class bpFriendsWidgetBlock extends dynamicWidgetBlock {
     142  loop(friends = [], container = '', type = 'active') {
     143    const tmpl = super.useTemplate('bp-friends-item');
     144    const selector = document.querySelector('#' + container);
     145    let output = '';
     146
     147    if (friends && friends.length) {
     148      friends.forEach(friend => {
     149        if ('active' === type && friend.last_activity) {
     150          /* translators: %s: a human time diff. */
     151          friend.extra = sprintf(__('Active %s', 'buddypress'), friend.last_activity.timediff);
     152        } else if ('popular' === type && friend.total_friend_count) {
     153          const friendsCount = parseInt(friend.total_friend_count, 10);
     154
     155          if (0 === friendsCount) {
     156            friend.extra = __('No friends', 'buddypress');
     157          } else if (1 === friendsCount) {
     158            friend.extra = __('1 friend', 'buddypress');
     159          } else {
     160            /* translators: %s: total friend count (more than 1). */
     161            friend.extra = sprintf(__('%s friends', 'buddypress'), friend.total_friend_count);
    206162          }
    207           /* translators: %s: member name */
    208 
     163        } else if ('newest' === type && friend.registered_since) {
     164          /* translators: %s is time elapsed since the registration date happened */
     165          friend.extra = sprintf(__('Registered %s', 'buddypress'), friend.registered_since);
     166        }
     167        /* translators: %s: member name */
    209168
    210           friend.avatar_alt = sprintf(__('Profile picture of %s', 'buddypress'), friend.name);
    211           output += tmpl(friend);
    212         });
    213       } else {
    214         output = '<div class="widget-error">' + __('Sorry, no members were found.', 'buddypress') + '</div>';
    215       }
    216169
    217       selector.innerHTML = output;
     170        friend.avatar_alt = sprintf(__('Profile picture of %s', 'buddypress'), friend.name);
     171        output += tmpl(friend);
     172      });
     173    } else {
     174      output = '<div class="widget-error">' + __('Sorry, no members were found.', 'buddypress') + '</div>';
    218175    }
    219   }, {
    220     key: "start",
    221     value: function start() {
    222       var _this = this;
    223176
    224       this.blocks.forEach(function (block, i) {
    225         var selector = block.selector;
    226         var type = block.query_args.type;
    227         var list = document.querySelector('#' + selector).closest('.bp-dynamic-block-container'); // Get default Block's type friends.
     177    selector.innerHTML = output;
     178  }
    228179
    229         _get(_getPrototypeOf(bpFriendsWidgetBlock.prototype), "getItems", _this).call(_this, type, i); // Listen to Block's Nav item clics
     180  start() {
     181    this.blocks.forEach((block, i) => {
     182      const {
     183        selector
     184      } = block;
     185      const {
     186        type
     187      } = block.query_args;
     188      const list = document.querySelector('#' + selector).closest('.bp-dynamic-block-container'); // Get default Block's type friends.
    230189
     190      super.getItems(type, i); // Listen to Block's Nav item clics
    231191
    232         list.querySelectorAll('.item-options a').forEach(function (navItem) {
    233           navItem.addEventListener('click', function (event) {
    234             event.preventDefault(); // Changes the displayed filter.
     192      list.querySelectorAll('.item-options a').forEach(navItem => {
     193        navItem.addEventListener('click', event => {
     194          event.preventDefault(); // Changes the displayed filter.
    235195
    236             event.target.closest('.item-options').querySelector('.selected').classList.remove('selected');
    237             event.target.classList.add('selected');
    238             var newType = event.target.getAttribute('data-bp-sort');
     196          event.target.closest('.item-options').querySelector('.selected').classList.remove('selected');
     197          event.target.classList.add('selected');
     198          const newType = event.target.getAttribute('data-bp-sort');
    239199
    240             if (newType !== _this.blocks[i].query_args.type) {
    241               _get(_getPrototypeOf(bpFriendsWidgetBlock.prototype), "getItems", _this).call(_this, newType, i);
    242             }
    243           });
     200          if (newType !== this.blocks[i].query_args.type) {
     201            super.getItems(newType, i);
     202          }
    244203        });
    245204      });
    246     }
    247   }]);
     205    });
     206  }
    248207
    249   return bpFriendsWidgetBlock;
    250 }(dynamicWidgetBlock);
     208}
    251209
    252 var settings = window.bpFriendsSettings || {};
    253 var blocks = window.bpFriendsBlocks || {};
    254 var bpFriends = new bpFriendsWidgetBlock(settings, blocks);
     210const settings = window.bpFriendsSettings || {};
     211const blocks = window.bpFriendsBlocks || {};
     212const bpFriends = new bpFriendsWidgetBlock(settings, blocks);
    255213
    256214if ('loading' === document.readyState) {
    257215  document.addEventListener('DOMContentLoaded', bpFriends.start());
  • src/bp-groups/classes/class-bp-groups-component.php

    diff --git src/bp-groups/classes/class-bp-groups-component.php src/bp-groups/classes/class-bp-groups-component.php
    index b272b3bdb..8f771c7d0 100644
    class BP_Groups_Component extends BP_Component { 
    10181018                                                'wp-components',
    10191019                                                'wp-i18n',
    10201020                                                'wp-block-editor',
     1021                                                'wp-server-side-render',
    10211022                                                'bp-block-components',
    10221023                                                'bp-block-data',
    10231024                                        ),
    class BP_Groups_Component extends BP_Component { 
    11071108                                                'wp-components',
    11081109                                                'wp-i18n',
    11091110                                                'wp-block-editor',
    1110                                                 'bp-block-components',
     1111                                                'wp-server-side-render',
    11111112                                        ),
    11121113                                        'style'              => 'bp-dynamic-groups-block',
    11131114                                        'style_url'          => plugins_url( 'css/blocks/dynamic-groups.css', dirname( __FILE__ ) ),
  • src/bp-groups/js/blocks/dynamic-groups.js

    diff --git src/bp-groups/js/blocks/dynamic-groups.js src/bp-groups/js/blocks/dynamic-groups.js
    index ed9e2a31e..e4f636006 100644
    exports.TYPES = void 0; 
    128128/**
    129129 * WordPress dependencies.
    130130 */
    131 var _wp = wp,
    132     __ = _wp.i18n.__;
     131const {
     132  i18n: {
     133    __
     134  }
     135} = wp;
    133136/**
    134137 * Groups ordering types.
    135138 *
    136139 * @type {Array}
    137140 */
    138141
    139 var TYPES = [{
     142const TYPES = [{
    140143  label: __('Newest', 'buddypress'),
    141144  value: 'newest'
    142145}, {
    var _constants = require("./constants"); 
    163166/**
    164167 * WordPress dependencies.
    165168 */
    166 var _wp = wp,
    167     InspectorControls = _wp.blockEditor.InspectorControls,
    168     _wp$components = _wp.components,
    169     Disabled = _wp$components.Disabled,
    170     PanelBody = _wp$components.PanelBody,
    171     RangeControl = _wp$components.RangeControl,
    172     SelectControl = _wp$components.SelectControl,
    173     TextControl = _wp$components.TextControl,
    174     ToggleControl = _wp$components.ToggleControl,
    175     _wp$element = _wp.element,
    176     Fragment = _wp$element.Fragment,
    177     createElement = _wp$element.createElement,
    178     __ = _wp.i18n.__;
    179 /**
    180  * BuddyPress dependencies.
    181  */
    182 
    183 var _bp = bp,
    184     ServerSideRender = _bp.blockComponents.ServerSideRender;
     169const {
     170  blockEditor: {
     171    InspectorControls
     172  },
     173  components: {
     174    Disabled,
     175    PanelBody,
     176    RangeControl,
     177    SelectControl,
     178    TextControl,
     179    ToggleControl
     180  },
     181  element: {
     182    Fragment,
     183    createElement
     184  },
     185  i18n: {
     186    __
     187  },
     188  serverSideRender: ServerSideRender
     189} = wp;
    185190/**
    186191 * Internal dependencies.
    187192 */
    188193
    189 var editDynamicGroupsBlock = function editDynamicGroupsBlock(_ref) {
    190   var attributes = _ref.attributes,
    191       setAttributes = _ref.setAttributes;
    192   var title = attributes.title,
    193       maxGroups = attributes.maxGroups,
    194       groupDefault = attributes.groupDefault,
    195       linkTitle = attributes.linkTitle;
     194const editDynamicGroupsBlock = ({
     195  attributes,
     196  setAttributes
     197}) => {
     198  const {
     199    title,
     200    maxGroups,
     201    groupDefault,
     202    linkTitle
     203  } = attributes;
    196204  return createElement(Fragment, null, createElement(InspectorControls, null, createElement(PanelBody, {
    197205    title: __('Settings', 'buddypress'),
    198206    initialOpen: true
    199207  }, createElement(TextControl, {
    200208    label: __('Title', 'buddypress'),
    201209    value: title,
    202     onChange: function onChange(text) {
     210    onChange: text => {
    203211      setAttributes({
    204212        title: text
    205213      });
    var editDynamicGroupsBlock = function editDynamicGroupsBlock(_ref) { 
    207215  }), createElement(RangeControl, {
    208216    label: __('Max groups to show', 'buddypress'),
    209217    value: maxGroups,
    210     onChange: function onChange(value) {
    211       return setAttributes({
    212         maxGroups: value
    213       });
    214     },
     218    onChange: value => setAttributes({
     219      maxGroups: value
     220    }),
    215221    min: 1,
    216222    max: 10,
    217223    required: true
    var editDynamicGroupsBlock = function editDynamicGroupsBlock(_ref) { 
    219225    label: __('Default groups to show', 'buddypress'),
    220226    value: groupDefault,
    221227    options: _constants.TYPES,
    222     onChange: function onChange(option) {
     228    onChange: option => {
    223229      setAttributes({
    224230        groupDefault: option
    225231      });
    var editDynamicGroupsBlock = function editDynamicGroupsBlock(_ref) { 
    227233  }), createElement(ToggleControl, {
    228234    label: __('Link block title to Groups directory', 'buddypress'),
    229235    checked: !!linkTitle,
    230     onChange: function onChange() {
     236    onChange: () => {
    231237      setAttributes({
    232238        linkTitle: !linkTitle
    233239      });
    exports.default = void 0; 
    251257/**
    252258 * WordPress dependencies.
    253259 */
    254 var _wp = wp,
    255     createBlock = _wp.blocks.createBlock;
     260const {
     261  blocks: {
     262    createBlock
     263  }
     264} = wp;
    256265/**
    257266 * Transforms Legacy Widget to Dynamic Groups Block.
    258267 *
    259268 * @type {Object}
    260269 */
    261270
    262 var transforms = {
     271const transforms = {
    263272  from: [{
    264273    type: 'block',
    265274    blocks: ['core/legacy-widget'],
    266     isMatch: function isMatch(_ref) {
    267       var idBase = _ref.idBase,
    268           instance = _ref.instance;
    269 
     275    isMatch: ({
     276      idBase,
     277      instance
     278    }) => {
    270279      if (!(instance !== null && instance !== void 0 && instance.raw)) {
    271280        return false;
    272281      }
    273282
    274283      return idBase === 'bp_groups_widget';
    275284    },
    276     transform: function transform(_ref2) {
    277       var instance = _ref2.instance;
     285    transform: ({
     286      instance
     287    }) => {
    278288      return createBlock('bp/dynamic-groups', {
    279289        title: instance.raw.title,
    280290        maxGroups: instance.raw.max_groups,
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    298308/**
    299309 * WordPress dependencies.
    300310 */
    301 var _wp = wp,
    302     registerBlockType = _wp.blocks.registerBlockType,
    303     __ = _wp.i18n.__;
     311const {
     312  blocks: {
     313    registerBlockType
     314  },
     315  i18n: {
     316    __
     317  }
     318} = wp;
    304319/**
    305320 * Internal dependencies.
    306321 */
  • src/bp-groups/js/blocks/group.js

    diff --git src/bp-groups/js/blocks/group.js src/bp-groups/js/blocks/group.js
    index 0e3c7aafe..6ffee4cd5 100644
    exports.GROUP_STATI = exports.AVATAR_SIZES = void 0; 
    128128/**
    129129 * WordPress dependencies.
    130130 */
    131 var _wp = wp,
    132     __ = _wp.i18n.__;
     131const {
     132  i18n: {
     133    __
     134  }
     135} = wp;
    133136/**
    134137 * Avatar sizes.
    135138 *
    136139 * @type {Array}
    137140 */
    138141
    139 var AVATAR_SIZES = [{
     142const AVATAR_SIZES = [{
    140143  label: __('None', 'buddypress'),
    141144  value: 'none'
    142145}, {
    var AVATAR_SIZES = [{ 
    153156 */
    154157
    155158exports.AVATAR_SIZES = AVATAR_SIZES;
    156 var GROUP_STATI = {
     159const GROUP_STATI = {
    157160  public: __('Public', 'buddypress'),
    158161  private: __('Private', 'buddypress'),
    159162  hidden: __('Hidden', 'buddypress')
    var _constants = require("./constants"); 
    172175/**
    173176 * WordPress dependencies.
    174177 */
    175 var _wp = wp,
    176     _wp$blockEditor = _wp.blockEditor,
    177     InspectorControls = _wp$blockEditor.InspectorControls,
    178     BlockControls = _wp$blockEditor.BlockControls,
    179     _wp$components = _wp.components,
    180     Placeholder = _wp$components.Placeholder,
    181     Disabled = _wp$components.Disabled,
    182     PanelBody = _wp$components.PanelBody,
    183     SelectControl = _wp$components.SelectControl,
    184     ToggleControl = _wp$components.ToggleControl,
    185     Toolbar = _wp$components.Toolbar,
    186     ToolbarButton = _wp$components.ToolbarButton,
    187     _wp$element = _wp.element,
    188     Fragment = _wp$element.Fragment,
    189     createElement = _wp$element.createElement,
    190     __ = _wp.i18n.__;
     178const {
     179  blockEditor: {
     180    InspectorControls,
     181    BlockControls
     182  },
     183  components: {
     184    Placeholder,
     185    Disabled,
     186    PanelBody,
     187    SelectControl,
     188    ToggleControl,
     189    Toolbar,
     190    ToolbarButton
     191  },
     192  element: {
     193    Fragment,
     194    createElement
     195  },
     196  i18n: {
     197    __
     198  },
     199  serverSideRender: ServerSideRender
     200} = wp;
    191201/**
    192202 * BuddyPress dependencies.
    193203 */
    194204
    195 var _bp = bp,
    196     _bp$blockComponents = _bp.blockComponents,
    197     AutoCompleter = _bp$blockComponents.AutoCompleter,
    198     ServerSideRender = _bp$blockComponents.ServerSideRender,
    199     isActive = _bp.blockData.isActive;
     205const {
     206  blockComponents: {
     207    AutoCompleter
     208  },
     209  blockData: {
     210    isActive
     211  }
     212} = bp;
    200213/**
    201214 * Internal dependencies.
    202215 */
    203216
    204 var getSlugValue = function getSlugValue(item) {
     217const getSlugValue = item => {
    205218  if (item && item.status && _constants.GROUP_STATI[item.status]) {
    206219    return _constants.GROUP_STATI[item.status];
    207220  }
    var getSlugValue = function getSlugValue(item) { 
    209222  return null;
    210223};
    211224
    212 var editGroupBlock = function editGroupBlock(_ref) {
    213   var attributes = _ref.attributes,
    214       setAttributes = _ref.setAttributes;
    215   var isAvatarEnabled = isActive('groups', 'avatar');
    216   var isCoverImageEnabled = isActive('groups', 'cover');
    217   var avatarSize = attributes.avatarSize,
    218       displayDescription = attributes.displayDescription,
    219       displayActionButton = attributes.displayActionButton,
    220       displayCoverImage = attributes.displayCoverImage;
     225const editGroupBlock = ({
     226  attributes,
     227  setAttributes
     228}) => {
     229  const isAvatarEnabled = isActive('groups', 'avatar');
     230  const isCoverImageEnabled = isActive('groups', 'cover');
     231  const {
     232    avatarSize,
     233    displayDescription,
     234    displayActionButton,
     235    displayCoverImage
     236  } = attributes;
    221237
    222238  if (!attributes.itemID) {
    223239    return createElement(Placeholder, {
    var editGroupBlock = function editGroupBlock(_ref) { 
    242258  }, createElement(ToolbarButton, {
    243259    icon: "edit",
    244260    title: __('Select another group', 'buddypress'),
    245     onClick: function onClick() {
     261    onClick: () => {
    246262      setAttributes({
    247263        itemID: 0
    248264      });
    var editGroupBlock = function editGroupBlock(_ref) { 
    253269  }, createElement(ToggleControl, {
    254270    label: __('Display Group\'s home button', 'buddypress'),
    255271    checked: !!displayActionButton,
    256     onChange: function onChange() {
     272    onChange: () => {
    257273      setAttributes({
    258274        displayActionButton: !displayActionButton
    259275      });
    var editGroupBlock = function editGroupBlock(_ref) { 
    262278  }), createElement(ToggleControl, {
    263279    label: __('Display group\'s description', 'buddypress'),
    264280    checked: !!displayDescription,
    265     onChange: function onChange() {
     281    onChange: () => {
    266282      setAttributes({
    267283        displayDescription: !displayDescription
    268284      });
    var editGroupBlock = function editGroupBlock(_ref) { 
    273289    value: avatarSize,
    274290    options: _constants.AVATAR_SIZES,
    275291    help: __('Select "None" to disable the avatar.', 'buddypress'),
    276     onChange: function onChange(option) {
     292    onChange: option => {
    277293      setAttributes({
    278294        avatarSize: option
    279295      });
    var editGroupBlock = function editGroupBlock(_ref) { 
    281297  }), isCoverImageEnabled && createElement(ToggleControl, {
    282298    label: __('Display Cover Image', 'buddypress'),
    283299    checked: !!displayCoverImage,
    284     onChange: function onChange() {
     300    onChange: () => {
    285301      setAttributes({
    286302        displayCoverImage: !displayCoverImage
    287303      });
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    305321/**
    306322 * WordPress dependencies.
    307323 */
    308 var _wp = wp,
    309     registerBlockType = _wp.blocks.registerBlockType,
    310     __ = _wp.i18n.__;
     324const {
     325  blocks: {
     326    registerBlockType
     327  },
     328  i18n: {
     329    __
     330  }
     331} = wp;
    311332/**
    312333 * Internal dependencies.
    313334 */
  • src/bp-groups/js/blocks/groups.js

    diff --git src/bp-groups/js/blocks/groups.js src/bp-groups/js/blocks/groups.js
    index 092956c2f..e6231296e 100644
    parcelRequire = (function (modules, cache, entry, globalName) { 
    117117  }
    118118
    119119  return newRequire;
    120 })({"jEQo":[function(require,module,exports) {
    121 function _arrayLikeToArray(arr, len) {
    122   if (len == null || len > arr.length) len = arr.length;
    123 
    124   for (var i = 0, arr2 = new Array(len); i < len; i++) {
    125     arr2[i] = arr[i];
    126   }
    127 
    128   return arr2;
    129 }
    130 
    131 module.exports = _arrayLikeToArray;
    132 },{}],"o3SL":[function(require,module,exports) {
    133 var arrayLikeToArray = require("./arrayLikeToArray");
    134 
    135 function _arrayWithoutHoles(arr) {
    136   if (Array.isArray(arr)) return arrayLikeToArray(arr);
    137 }
    138 
    139 module.exports = _arrayWithoutHoles;
    140 },{"./arrayLikeToArray":"jEQo"}],"lZpU":[function(require,module,exports) {
    141 function _iterableToArray(iter) {
    142   if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
    143 }
    144 
    145 module.exports = _iterableToArray;
    146 },{}],"Dbv9":[function(require,module,exports) {
    147 var arrayLikeToArray = require("./arrayLikeToArray");
    148 
    149 function _unsupportedIterableToArray(o, minLen) {
    150   if (!o) return;
    151   if (typeof o === "string") return arrayLikeToArray(o, minLen);
    152   var n = Object.prototype.toString.call(o).slice(8, -1);
    153   if (n === "Object" && o.constructor) n = o.constructor.name;
    154   if (n === "Map" || n === "Set") return Array.from(n);
    155   if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
    156 }
    157 
    158 module.exports = _unsupportedIterableToArray;
    159 },{"./arrayLikeToArray":"jEQo"}],"NCaH":[function(require,module,exports) {
    160 function _nonIterableSpread() {
    161   throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    162 }
    163 
    164 module.exports = _nonIterableSpread;
    165 },{}],"I9dH":[function(require,module,exports) {
    166 var arrayWithoutHoles = require("./arrayWithoutHoles");
    167 
    168 var iterableToArray = require("./iterableToArray");
    169 
    170 var unsupportedIterableToArray = require("./unsupportedIterableToArray");
    171 
    172 var nonIterableSpread = require("./nonIterableSpread");
    173 
    174 function _toConsumableArray(arr) {
    175   return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
    176 }
    177 
    178 module.exports = _toConsumableArray;
    179 },{"./arrayWithoutHoles":"o3SL","./iterableToArray":"lZpU","./unsupportedIterableToArray":"Dbv9","./nonIterableSpread":"NCaH"}],"DCTP":[function(require,module,exports) {
    180 function _arrayWithHoles(arr) {
    181   if (Array.isArray(arr)) return arr;
    182 }
    183 
    184 module.exports = _arrayWithHoles;
    185 },{}],"LoeL":[function(require,module,exports) {
    186 function _iterableToArrayLimit(arr, i) {
    187   if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
    188   var _arr = [];
    189   var _n = true;
    190   var _d = false;
    191   var _e = undefined;
    192 
    193   try {
    194     for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
    195       _arr.push(_s.value);
    196 
    197       if (i && _arr.length === i) break;
    198     }
    199   } catch (err) {
    200     _d = true;
    201     _e = err;
    202   } finally {
    203     try {
    204       if (!_n && _i["return"] != null) _i["return"]();
    205     } finally {
    206       if (_d) throw _e;
    207     }
    208   }
    209 
    210   return _arr;
    211 }
    212 
    213 module.exports = _iterableToArrayLimit;
    214 },{}],"MWEO":[function(require,module,exports) {
    215 function _nonIterableRest() {
    216   throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    217 }
    218 
    219 module.exports = _nonIterableRest;
    220 },{}],"DERy":[function(require,module,exports) {
    221 var arrayWithHoles = require("./arrayWithHoles");
    222 
    223 var iterableToArrayLimit = require("./iterableToArrayLimit");
    224 
    225 var unsupportedIterableToArray = require("./unsupportedIterableToArray");
    226 
    227 var nonIterableRest = require("./nonIterableRest");
    228 
    229 function _slicedToArray(arr, i) {
    230   return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
    231 }
    232 
    233 module.exports = _slicedToArray;
    234 },{"./arrayWithHoles":"DCTP","./iterableToArrayLimit":"LoeL","./unsupportedIterableToArray":"Dbv9","./nonIterableRest":"MWEO"}],"jS06":[function(require,module,exports) {
     120})({"jS06":[function(require,module,exports) {
    235121"use strict";
    236122
    237123Object.defineProperty(exports, "__esModule", {
    exports.EXTRA_INFO = exports.GROUP_STATI = exports.AVATAR_SIZES = void 0; 
    242128/**
    243129 * WordPress dependencies.
    244130 */
    245 var _wp = wp,
    246     __ = _wp.i18n.__;
     131const {
     132  i18n: {
     133    __
     134  }
     135} = wp;
    247136/**
    248137 * Avatar sizes.
    249138 *
    250139 * @type {Array}
    251140 */
    252141
    253 var AVATAR_SIZES = [{
     142const AVATAR_SIZES = [{
    254143  label: __('None', 'buddypress'),
    255144  value: 'none'
    256145}, {
    var AVATAR_SIZES = [{ 
    267156 */
    268157
    269158exports.AVATAR_SIZES = AVATAR_SIZES;
    270 var GROUP_STATI = {
     159const GROUP_STATI = {
    271160  public: __('Public', 'buddypress'),
    272161  private: __('Private', 'buddypress'),
    273162  hidden: __('Hidden', 'buddypress')
    var GROUP_STATI = { 
    279168 */
    280169
    281170exports.GROUP_STATI = GROUP_STATI;
    282 var EXTRA_INFO = [{
     171const EXTRA_INFO = [{
    283172  label: __('None', 'buddypress'),
    284173  value: 'none'
    285174}, {
    Object.defineProperty(exports, "__esModule", { 
    301190});
    302191exports.default = void 0;
    303192
    304 var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
    305 
    306 var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
    307 
    308193var _constants = require("./constants");
    309194
    310 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
    311 
    312195/**
    313196 * WordPress dependencies.
    314197 */
    315 var _wp = wp,
    316     _wp$blockEditor = _wp.blockEditor,
    317     InspectorControls = _wp$blockEditor.InspectorControls,
    318     BlockControls = _wp$blockEditor.BlockControls,
    319     _wp$components = _wp.components,
    320     Placeholder = _wp$components.Placeholder,
    321     PanelBody = _wp$components.PanelBody,
    322     SelectControl = _wp$components.SelectControl,
    323     ToggleControl = _wp$components.ToggleControl,
    324     Button = _wp$components.Button,
    325     Dashicon = _wp$components.Dashicon,
    326     Tooltip = _wp$components.Tooltip,
    327     ToolbarGroup = _wp$components.ToolbarGroup,
    328     RangeControl = _wp$components.RangeControl,
    329     _wp$element = _wp.element,
    330     createElement = _wp$element.createElement,
    331     Fragment = _wp$element.Fragment,
    332     useState = _wp$element.useState,
    333     _wp$i18n = _wp.i18n,
    334     __ = _wp$i18n.__,
    335     sprintf = _wp$i18n.sprintf,
    336     _n = _wp$i18n._n,
    337     apiFetch = _wp.apiFetch,
    338     addQueryArgs = _wp.url.addQueryArgs;
     198const {
     199  blockEditor: {
     200    InspectorControls,
     201    BlockControls
     202  },
     203  components: {
     204    Placeholder,
     205    PanelBody,
     206    SelectControl,
     207    ToggleControl,
     208    Button,
     209    Dashicon,
     210    Tooltip,
     211    ToolbarGroup,
     212    RangeControl
     213  },
     214  element: {
     215    createElement,
     216    Fragment,
     217    useState
     218  },
     219  i18n: {
     220    __,
     221    sprintf,
     222    _n
     223  },
     224  apiFetch,
     225  url: {
     226    addQueryArgs
     227  }
     228} = wp;
    339229/**
    340230 * BuddyPress dependencies.
    341231 */
    342232
    343 var _bp = bp,
    344     AutoCompleter = _bp.blockComponents.AutoCompleter,
    345     isActive = _bp.blockData.isActive;
     233const {
     234  blockComponents: {
     235    AutoCompleter
     236  },
     237  blockData: {
     238    isActive
     239  }
     240} = bp;
    346241/**
    347242 * Internal dependencies.
    348243 */
    var _bp = bp, 
    350245/**
    351246 * External dependencies.
    352247 */
    353 var _lodash = lodash,
    354     reject = _lodash.reject,
    355     remove = _lodash.remove,
    356     sortBy = _lodash.sortBy;
     248const {
     249  reject,
     250  remove,
     251  sortBy
     252} = lodash;
    357253
    358 var getSlugValue = function getSlugValue(item) {
     254const getSlugValue = item => {
    359255  if (item && item.status && _constants.GROUP_STATI[item.status]) {
    360256    return _constants.GROUP_STATI[item.status];
    361257  }
    var getSlugValue = function getSlugValue(item) { 
    363259  return null;
    364260};
    365261
    366 var editGroupsBlock = function editGroupsBlock(_ref) {
    367   var attributes = _ref.attributes,
    368       setAttributes = _ref.setAttributes,
    369       isSelected = _ref.isSelected;
    370   var isAvatarEnabled = isActive('groups', 'avatar');
    371   var itemIDs = attributes.itemIDs,
    372       avatarSize = attributes.avatarSize,
    373       displayGroupName = attributes.displayGroupName,
    374       extraInfo = attributes.extraInfo,
    375       layoutPreference = attributes.layoutPreference,
    376       columns = attributes.columns;
    377   var hasGroups = 0 !== itemIDs.length;
    378 
    379   var _useState = useState([]),
    380       _useState2 = (0, _slicedToArray2.default)(_useState, 2),
    381       groups = _useState2[0],
    382       setGroups = _useState2[1];
    383 
    384   var layoutControls = [{
     262const editGroupsBlock = ({
     263  attributes,
     264  setAttributes,
     265  isSelected
     266}) => {
     267  const isAvatarEnabled = isActive('groups', 'avatar');
     268  const {
     269    itemIDs,
     270    avatarSize,
     271    displayGroupName,
     272    extraInfo,
     273    layoutPreference,
     274    columns
     275  } = attributes;
     276  const hasGroups = 0 !== itemIDs.length;
     277  const [groups, setGroups] = useState([]);
     278  const layoutControls = [{
    385279    icon: 'text',
    386280    title: __('List view', 'buddypress'),
    387     onClick: function onClick() {
    388       return setAttributes({
    389         layoutPreference: 'list'
    390       });
    391     },
     281    onClick: () => setAttributes({
     282      layoutPreference: 'list'
     283    }),
    392284    isActive: layoutPreference === 'list'
    393285  }, {
    394286    icon: 'screenoptions',
    395287    title: __('Grid view', 'buddypress'),
    396     onClick: function onClick() {
    397       return setAttributes({
    398         layoutPreference: 'grid'
    399       });
    400     },
     288    onClick: () => setAttributes({
     289      layoutPreference: 'grid'
     290    }),
    401291    isActive: layoutPreference === 'grid'
    402292  }];
    403   var groupsList;
    404   var containerClasses = 'bp-block-groups avatar-' + avatarSize;
    405   var extraInfoOptions = _constants.EXTRA_INFO;
     293  let groupsList;
     294  let containerClasses = 'bp-block-groups avatar-' + avatarSize;
     295  let extraInfoOptions = _constants.EXTRA_INFO;
    406296
    407297  if (layoutPreference === 'grid') {
    408298    containerClasses += ' is-grid columns-' + columns;
    409     extraInfoOptions = _constants.EXTRA_INFO.filter(function (extra) {
     299    extraInfoOptions = _constants.EXTRA_INFO.filter(extra => {
    410300      return 'description' !== extra.value;
    411301    });
    412302  }
    413303
    414   var onSelectedGroup = function onSelectedGroup(_ref2) {
    415     var itemID = _ref2.itemID;
    416 
     304  const onSelectedGroup = ({
     305    itemID
     306  }) => {
    417307    if (itemID && -1 === itemIDs.indexOf(itemID)) {
    418308      setAttributes({
    419         itemIDs: [].concat((0, _toConsumableArray2.default)(itemIDs), [parseInt(itemID, 10)])
     309        itemIDs: [...itemIDs, parseInt(itemID, 10)]
    420310      });
    421311    }
    422312  };
    423313
    424   var onRemoveGroup = function onRemoveGroup(itemID) {
     314  const onRemoveGroup = itemID => {
    425315    if (itemID && -1 !== itemIDs.indexOf(itemID)) {
    426316      setGroups(reject(groups, ['id', itemID]));
    427317      setAttributes({
    428         itemIDs: remove(itemIDs, function (value) {
     318        itemIDs: remove(itemIDs, value => {
    429319          return value !== itemID;
    430320        })
    431321      });
    var editGroupsBlock = function editGroupsBlock(_ref) { 
    434324
    435325  if (hasGroups && itemIDs.length !== groups.length) {
    436326    apiFetch({
    437       path: addQueryArgs("/buddypress/v1/groups", {
     327      path: addQueryArgs(`/buddypress/v1/groups`, {
    438328        populate_extras: true,
    439329        include: itemIDs
    440330      })
    441     }).then(function (items) {
    442       setGroups(sortBy(items, [function (item) {
     331    }).then(items => {
     332      setGroups(sortBy(items, [item => {
    443333        return itemIDs.indexOf(item.id);
    444334      }]));
    445335    });
    446336  }
    447337
    448338  if (groups.length) {
    449     groupsList = groups.map(function (group) {
    450       var hasDescription = false;
    451       var groupItemClasses = 'group-content';
     339    groupsList = groups.map(group => {
     340      let hasDescription = false;
     341      let groupItemClasses = 'group-content';
    452342
    453343      if (layoutPreference === 'list' && 'description' === extraInfo && group.description && group.description.rendered) {
    454344        hasDescription = true;
    var editGroupsBlock = function editGroupsBlock(_ref) { 
    462352        text: __('Remove group', 'buddypress')
    463353      }, createElement(Button, {
    464354        className: "is-right",
    465         onClick: function onClick() {
    466           return onRemoveGroup(group.id);
    467         },
     355        onClick: () => onRemoveGroup(group.id),
    468356        label: __('Remove group', 'buddypress')
    469357      }, createElement(Dashicon, {
    470358        icon: "no"
    var editGroupsBlock = function editGroupsBlock(_ref) { 
    504392  }, createElement(ToggleControl, {
    505393    label: __('Display the group\'s name', 'buddypress'),
    506394    checked: !!displayGroupName,
    507     onChange: function onChange() {
     395    onChange: () => {
    508396      setAttributes({
    509397        displayGroupName: !displayGroupName
    510398      });
    var editGroupsBlock = function editGroupsBlock(_ref) { 
    515403    value: avatarSize,
    516404    options: _constants.AVATAR_SIZES,
    517405    help: __('Select "None" to disable the avatar.', 'buddypress'),
    518     onChange: function onChange(option) {
     406    onChange: option => {
    519407      setAttributes({
    520408        avatarSize: option
    521409      });
    var editGroupsBlock = function editGroupsBlock(_ref) { 
    525413    value: extraInfo,
    526414    options: extraInfoOptions,
    527415    help: __('Select "None" to show no extra information.', 'buddypress'),
    528     onChange: function onChange(option) {
     416    onChange: option => {
    529417      setAttributes({
    530418        extraInfo: option
    531419      });
    var editGroupsBlock = function editGroupsBlock(_ref) { 
    533421  }), layoutPreference === 'grid' && createElement(RangeControl, {
    534422    label: __('Columns', 'buddypress'),
    535423    value: columns,
    536     onChange: function onChange(value) {
    537       return setAttributes({
    538         columns: value
    539       });
    540     },
     424    onChange: value => setAttributes({
     425      columns: value
     426    }),
    541427    min: 2,
    542428    max: 4,
    543429    required: true
    var editGroupsBlock = function editGroupsBlock(_ref) { 
    566452
    567453var _default = editGroupsBlock;
    568454exports.default = _default;
    569 },{"@babel/runtime/helpers/toConsumableArray":"I9dH","@babel/runtime/helpers/slicedToArray":"DERy","./constants":"jS06"}],"jcTh":[function(require,module,exports) {
     455},{"./constants":"jS06"}],"jcTh":[function(require,module,exports) {
    570456"use strict";
    571457
    572458var _edit = _interopRequireDefault(require("./groups/edit"));
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    576462/**
    577463 * WordPress dependencies.
    578464 */
    579 var _wp = wp,
    580     registerBlockType = _wp.blocks.registerBlockType,
    581     __ = _wp.i18n.__;
     465const {
     466  blocks: {
     467    registerBlockType
     468  },
     469  i18n: {
     470    __
     471  }
     472} = wp;
    582473/**
    583474 * Internal dependencies.
    584475 */
  • src/bp-groups/js/dynamic-groups.js

    diff --git src/bp-groups/js/dynamic-groups.js src/bp-groups/js/dynamic-groups.js
    index 4a0839982..801585d38 100644
    parcelRequire = (function (modules, cache, entry, globalName) { 
    118118
    119119  return newRequire;
    120120})({"UOvc":[function(require,module,exports) {
    121 function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
    122 
    123 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    124 
    125 function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    126 
    127 function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
    128 
    129 function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
    130 
    131 function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
    132 
    133 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
    134 
    135 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
    136 
    137 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
    138 
    139 function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
    140 
    141 function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
    142 
    143 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
    144 
    145 function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
    146 
    147121/**
    148122 * WordPress dependencies
    149123 */
    150 var _wp = wp,
    151     _wp$i18n = _wp.i18n,
    152     __ = _wp$i18n.__,
    153     sprintf = _wp$i18n.sprintf;
     124const {
     125  i18n: {
     126    __,
     127    sprintf
     128  }
     129} = wp;
    154130/**
    155131 * BuddyPress dependencies.
    156132 */
    157133
    158 var _bp = bp,
    159     dynamicWidgetBlock = _bp.dynamicWidgetBlock;
     134const {
     135  dynamicWidgetBlock
     136} = bp;
    160137/**
    161138 * Front-end Dynamic Groups Widget Block class.
    162139 *
    163140 * @since 9.0.0
    164141 */
    165142
    166 var bpGroupsWidgetBlock = /*#__PURE__*/function (_dynamicWidgetBlock) {
    167   _inherits(bpGroupsWidgetBlock, _dynamicWidgetBlock);
    168 
    169   var _super = _createSuper(bpGroupsWidgetBlock);
    170 
    171   function bpGroupsWidgetBlock() {
    172     _classCallCheck(this, bpGroupsWidgetBlock);
    173 
    174     return _super.apply(this, arguments);
    175   }
    176 
    177   _createClass(bpGroupsWidgetBlock, [{
    178     key: "loop",
    179     value: function loop() {
    180       var groups = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
    181       var container = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
    182       var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'active';
    183 
    184       var tmpl = _get(_getPrototypeOf(bpGroupsWidgetBlock.prototype), "useTemplate", this).call(this, 'bp-dynamic-groups-item');
    185 
    186       var selector = document.querySelector('#' + container);
    187       var output = '';
    188 
    189       if (groups && groups.length) {
    190         groups.forEach(function (group) {
    191           if ('newest' === type && group.created_since) {
    192             /* translators: %s is time elapsed since the group was created */
    193             group.extra = sprintf(__('Created %s', 'buddypress'), group.created_since);
    194           } else if ('popular' === type && group.total_member_count) {
    195             var membersCount = parseInt(group.total_member_count, 10);
    196 
    197             if (0 === membersCount) {
    198               group.extra = __('No members', 'buddypress');
    199             } else if (1 === membersCount) {
    200               group.extra = __('1 member', 'buddypress');
    201             } else {
    202               /* translators: %s is the number of Group members (more than 1). */
    203               group.extra = sprintf(__('%s members', 'buddypress'), group.total_member_count);
    204             }
     143class bpGroupsWidgetBlock extends dynamicWidgetBlock {
     144  loop(groups = [], container = '', type = 'active') {
     145    const tmpl = super.useTemplate('bp-dynamic-groups-item');
     146    const selector = document.querySelector('#' + container);
     147    let output = '';
     148
     149    if (groups && groups.length) {
     150      groups.forEach(group => {
     151        if ('newest' === type && group.created_since) {
     152          /* translators: %s is time elapsed since the group was created */
     153          group.extra = sprintf(__('Created %s', 'buddypress'), group.created_since);
     154        } else if ('popular' === type && group.total_member_count) {
     155          const membersCount = parseInt(group.total_member_count, 10);
     156
     157          if (0 === membersCount) {
     158            group.extra = __('No members', 'buddypress');
     159          } else if (1 === membersCount) {
     160            group.extra = __('1 member', 'buddypress');
    205161          } else {
    206             /* translators: %s: a human time diff. */
    207             group.extra = sprintf(__('Active %s', 'buddypress'), group.last_activity_diff);
     162            /* translators: %s is the number of Group members (more than 1). */
     163            group.extra = sprintf(__('%s members', 'buddypress'), group.total_member_count);
    208164          }
    209           /* Translators: %s is the group's name. */
    210 
     165        } else {
     166          /* translators: %s: a human time diff. */
     167          group.extra = sprintf(__('Active %s', 'buddypress'), group.last_activity_diff);
     168        }
     169        /* Translators: %s is the group's name. */
    211170
    212           group.avatar_alt = sprintf(__('Group Profile photo of %s', 'buddypress'), group.name);
    213           output += tmpl(group);
    214         });
    215       } else {
    216         output = '<div class="widget-error">' + __('There are no groups to display.', 'buddypress') + '</div>';
    217       }
    218171
    219       selector.innerHTML = output;
     172        group.avatar_alt = sprintf(__('Group Profile photo of %s', 'buddypress'), group.name);
     173        output += tmpl(group);
     174      });
     175    } else {
     176      output = '<div class="widget-error">' + __('There are no groups to display.', 'buddypress') + '</div>';
    220177    }
    221   }, {
    222     key: "start",
    223     value: function start() {
    224       var _this = this;
    225178
    226       this.blocks.forEach(function (block, i) {
    227         var selector = block.selector;
    228         var type = block.query_args.type;
    229         var list = document.querySelector('#' + selector).closest('.bp-dynamic-block-container'); // Get default Block's type groups.
     179    selector.innerHTML = output;
     180  }
    230181
    231         _get(_getPrototypeOf(bpGroupsWidgetBlock.prototype), "getItems", _this).call(_this, type, i); // Listen to Block's Nav item clics
     182  start() {
     183    this.blocks.forEach((block, i) => {
     184      const {
     185        selector
     186      } = block;
     187      const {
     188        type
     189      } = block.query_args;
     190      const list = document.querySelector('#' + selector).closest('.bp-dynamic-block-container'); // Get default Block's type groups.
    232191
     192      super.getItems(type, i); // Listen to Block's Nav item clics
    233193
    234         list.querySelectorAll('.item-options a').forEach(function (navItem) {
    235           navItem.addEventListener('click', function (event) {
    236             event.preventDefault(); // Changes the displayed filter.
     194      list.querySelectorAll('.item-options a').forEach(navItem => {
     195        navItem.addEventListener('click', event => {
     196          event.preventDefault(); // Changes the displayed filter.
    237197
    238             event.target.closest('.item-options').querySelector('.selected').classList.remove('selected');
    239             event.target.classList.add('selected');
    240             var newType = event.target.getAttribute('data-bp-sort');
     198          event.target.closest('.item-options').querySelector('.selected').classList.remove('selected');
     199          event.target.classList.add('selected');
     200          const newType = event.target.getAttribute('data-bp-sort');
    241201
    242             if (newType !== _this.blocks[i].query_args.type) {
    243               _get(_getPrototypeOf(bpGroupsWidgetBlock.prototype), "getItems", _this).call(_this, newType, i);
    244             }
    245           });
     202          if (newType !== this.blocks[i].query_args.type) {
     203            super.getItems(newType, i);
     204          }
    246205        });
    247206      });
    248     }
    249   }]);
     207    });
     208  }
    250209
    251   return bpGroupsWidgetBlock;
    252 }(dynamicWidgetBlock);
     210}
    253211
    254 var settings = window.bpDynamicGroupsSettings || {};
    255 var blocks = window.bpDynamicGroupsBlocks || [];
    256 var bpDynamicGroups = new bpGroupsWidgetBlock(settings, blocks);
     212const settings = window.bpDynamicGroupsSettings || {};
     213const blocks = window.bpDynamicGroupsBlocks || [];
     214const bpDynamicGroups = new bpGroupsWidgetBlock(settings, blocks);
    257215
    258216if ('loading' === document.readyState) {
    259217  document.addEventListener('DOMContentLoaded', bpDynamicGroups.start());
  • src/bp-members/classes/class-bp-members-component.php

    diff --git src/bp-members/classes/class-bp-members-component.php src/bp-members/classes/class-bp-members-component.php
    index 432e3ecce..7bca5d8bb 100644
    class BP_Members_Component extends BP_Component { 
    764764                                                'wp-components',
    765765                                                'wp-i18n',
    766766                                                'wp-block-editor',
     767                                                'wp-server-side-render',
    767768                                                'bp-block-components',
    768769                                                'bp-block-data',
    769770                                        ),
    class BP_Members_Component extends BP_Component { 
    857858                                                'wp-components',
    858859                                                'wp-i18n',
    859860                                                'wp-block-editor',
     861                                                'wp-server-side-render',
    860862                                                'bp-block-data',
    861                                                 'bp-block-components',
    862863                                        ),
    863864                                        'style'              => 'bp-dynamic-members-block',
    864865                                        'style_url'          => plugins_url( 'css/blocks/dynamic-members.css', dirname( __FILE__ ) ),
    class BP_Members_Component extends BP_Component { 
    892893                                                'wp-components',
    893894                                                'wp-i18n',
    894895                                                'wp-block-editor',
    895                                                 'bp-block-components',
     896                                                'wp-server-side-render',
    896897                                        ),
    897898                                        'editor_style'       => 'bp-member-avatar-blocks',
    898899                                        'editor_style_url'   => plugins_url( 'css/blocks/member-avatar-blocks.css', dirname( __FILE__ ) ),
    class BP_Members_Component extends BP_Component { 
    918919                                                'wp-components',
    919920                                                'wp-i18n',
    920921                                                'wp-block-editor',
    921                                                 'bp-block-components',
     922                                                'wp-server-side-render',
    922923                                        ),
    923924                                        'editor_style'       => 'bp-member-avatar-blocks',
    924925                                        'editor_style_url'   => plugins_url( 'css/blocks/member-avatar-blocks.css', dirname( __FILE__ ) ),
  • src/bp-members/js/blocks/active-members.js

    diff --git src/bp-members/js/blocks/active-members.js src/bp-members/js/blocks/active-members.js
    index 1ff2415e1..4cdb55e89 100644
    exports.default = void 0; 
    128128/**
    129129 * WordPress dependencies.
    130130 */
    131 var _wp = wp,
    132     InspectorControls = _wp.blockEditor.InspectorControls,
    133     _wp$components = _wp.components,
    134     Disabled = _wp$components.Disabled,
    135     PanelBody = _wp$components.PanelBody,
    136     RangeControl = _wp$components.RangeControl,
    137     TextControl = _wp$components.TextControl,
    138     _wp$element = _wp.element,
    139     Fragment = _wp$element.Fragment,
    140     createElement = _wp$element.createElement,
    141     __ = _wp.i18n.__;
    142 /**
    143  * BuddyPress dependencies.
    144  */
    145 
    146 var _bp = bp,
    147     ServerSideRender = _bp.blockComponents.ServerSideRender;
    148 
    149 var editActiveMembersBlock = function editActiveMembersBlock(_ref) {
    150   var attributes = _ref.attributes,
    151       setAttributes = _ref.setAttributes;
    152   var title = attributes.title,
    153       maxMembers = attributes.maxMembers;
     131const {
     132  blockEditor: {
     133    InspectorControls
     134  },
     135  components: {
     136    Disabled,
     137    PanelBody,
     138    RangeControl,
     139    TextControl
     140  },
     141  element: {
     142    Fragment,
     143    createElement
     144  },
     145  i18n: {
     146    __
     147  },
     148  serverSideRender: ServerSideRender
     149} = wp;
     150
     151const editActiveMembersBlock = ({
     152  attributes,
     153  setAttributes
     154}) => {
     155  const {
     156    title,
     157    maxMembers
     158  } = attributes;
    154159  return createElement(Fragment, null, createElement(InspectorControls, null, createElement(PanelBody, {
    155160    title: __('Settings', 'buddypress'),
    156161    initialOpen: true
    157162  }, createElement(TextControl, {
    158163    label: __('Title', 'buddypress'),
    159164    value: title,
    160     onChange: function onChange(text) {
     165    onChange: text => {
    161166      setAttributes({
    162167        title: text
    163168      });
    var editActiveMembersBlock = function editActiveMembersBlock(_ref) { 
    165170  }), createElement(RangeControl, {
    166171    label: __('Max members to show', 'buddypress'),
    167172    value: maxMembers,
    168     onChange: function onChange(value) {
    169       return setAttributes({
    170         maxMembers: value
    171       });
    172     },
     173    onChange: value => setAttributes({
     174      maxMembers: value
     175    }),
    173176    min: 1,
    174177    max: 15,
    175178    required: true
    exports.default = void 0; 
    192195/**
    193196 * WordPress dependencies.
    194197 */
    195 var _wp = wp,
    196     createBlock = _wp.blocks.createBlock;
     198const {
     199  blocks: {
     200    createBlock
     201  }
     202} = wp;
    197203/**
    198204 * Transforms Legacy Widget to Active Members Block.
    199205 *
    200206 * @type {Object}
    201207 */
    202208
    203 var transforms = {
     209const transforms = {
    204210  from: [{
    205211    type: 'block',
    206212    blocks: ['core/legacy-widget'],
    207     isMatch: function isMatch(_ref) {
    208       var idBase = _ref.idBase,
    209           instance = _ref.instance;
    210 
     213    isMatch: ({
     214      idBase,
     215      instance
     216    }) => {
    211217      if (!(instance !== null && instance !== void 0 && instance.raw)) {
    212218        return false;
    213219      }
    214220
    215221      return idBase === 'bp_core_recently_active_widget';
    216222    },
    217     transform: function transform(_ref2) {
    218       var instance = _ref2.instance;
     223    transform: ({
     224      instance
     225    }) => {
    219226      return createBlock('bp/active-members', {
    220227        title: instance.raw.title,
    221228        maxMembers: instance.raw.max_members
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    237244/**
    238245 * WordPress dependencies.
    239246 */
    240 var _wp = wp,
    241     registerBlockType = _wp.blocks.registerBlockType,
    242     __ = _wp.i18n.__;
     247const {
     248  blocks: {
     249    registerBlockType
     250  },
     251  i18n: {
     252    __
     253  }
     254} = wp;
    243255/**
    244256 * Internal dependencies.
    245257 */
  • src/bp-members/js/blocks/dynamic-members.js

    diff --git src/bp-members/js/blocks/dynamic-members.js src/bp-members/js/blocks/dynamic-members.js
    index 6f55a264e..54e8d8d9a 100644
    exports.TYPES = void 0; 
    128128/**
    129129 * WordPress dependencies.
    130130 */
    131 var _wp = wp,
    132     __ = _wp.i18n.__;
     131const {
     132  i18n: {
     133    __
     134  }
     135} = wp;
    133136/**
    134137 * Members ordering types.
    135138 *
    136139 * @type {Array}
    137140 */
    138141
    139 var TYPES = [{
     142const TYPES = [{
    140143  label: __('Newest', 'buddypress'),
    141144  value: 'newest'
    142145}, {
    var _constants = require("./constants"); 
    160163/**
    161164 * WordPress dependencies.
    162165 */
    163 var _wp = wp,
    164     InspectorControls = _wp.blockEditor.InspectorControls,
    165     _wp$components = _wp.components,
    166     Disabled = _wp$components.Disabled,
    167     PanelBody = _wp$components.PanelBody,
    168     RangeControl = _wp$components.RangeControl,
    169     SelectControl = _wp$components.SelectControl,
    170     TextControl = _wp$components.TextControl,
    171     ToggleControl = _wp$components.ToggleControl,
    172     _wp$element = _wp.element,
    173     Fragment = _wp$element.Fragment,
    174     createElement = _wp$element.createElement,
    175     __ = _wp.i18n.__;
     166const {
     167  blockEditor: {
     168    InspectorControls
     169  },
     170  components: {
     171    Disabled,
     172    PanelBody,
     173    RangeControl,
     174    SelectControl,
     175    TextControl,
     176    ToggleControl
     177  },
     178  element: {
     179    Fragment,
     180    createElement
     181  },
     182  i18n: {
     183    __
     184  },
     185  serverSideRender: ServerSideRender
     186} = wp;
    176187/**
    177188 * BuddyPress dependencies.
    178189 */
    179190
    180 var _bp = bp,
    181     ServerSideRender = _bp.blockComponents.ServerSideRender,
    182     isActive = _bp.blockData.isActive;
     191const {
     192  blockData: {
     193    isActive
     194  }
     195} = bp;
    183196/**
    184197 * Internal dependencies.
    185198 */
    186199
    187 var editDynamicMembersBlock = function editDynamicMembersBlock(_ref) {
    188   var attributes = _ref.attributes,
    189       setAttributes = _ref.setAttributes;
    190   var title = attributes.title,
    191       maxMembers = attributes.maxMembers,
    192       memberDefault = attributes.memberDefault,
    193       linkTitle = attributes.linkTitle;
    194   var sortTypes = !!isActive('friends') ? _constants.TYPES : _constants.TYPES.filter(function (type) {
    195     return 'popular' !== type.value;
    196   });
     200const editDynamicMembersBlock = ({
     201  attributes,
     202  setAttributes
     203}) => {
     204  const {
     205    title,
     206    maxMembers,
     207    memberDefault,
     208    linkTitle
     209  } = attributes;
     210  const sortTypes = !!isActive('friends') ? _constants.TYPES : _constants.TYPES.filter(type => 'popular' !== type.value);
    197211  return createElement(Fragment, null, createElement(InspectorControls, null, createElement(PanelBody, {
    198212    title: __('Settings', 'buddypress'),
    199213    initialOpen: true
    200214  }, createElement(TextControl, {
    201215    label: __('Title', 'buddypress'),
    202216    value: title,
    203     onChange: function onChange(text) {
     217    onChange: text => {
    204218      setAttributes({
    205219        title: text
    206220      });
    var editDynamicMembersBlock = function editDynamicMembersBlock(_ref) { 
    208222  }), createElement(RangeControl, {
    209223    label: __('Max members to show', 'buddypress'),
    210224    value: maxMembers,
    211     onChange: function onChange(value) {
    212       return setAttributes({
    213         maxMembers: value
    214       });
    215     },
     225    onChange: value => setAttributes({
     226      maxMembers: value
     227    }),
    216228    min: 1,
    217229    max: 10,
    218230    required: true
    var editDynamicMembersBlock = function editDynamicMembersBlock(_ref) { 
    220232    label: __('Default members to show', 'buddypress'),
    221233    value: memberDefault,
    222234    options: sortTypes,
    223     onChange: function onChange(option) {
     235    onChange: option => {
    224236      setAttributes({
    225237        memberDefault: option
    226238      });
    var editDynamicMembersBlock = function editDynamicMembersBlock(_ref) { 
    228240  }), createElement(ToggleControl, {
    229241    label: __('Link block title to Members directory', 'buddypress'),
    230242    checked: !!linkTitle,
    231     onChange: function onChange() {
     243    onChange: () => {
    232244      setAttributes({
    233245        linkTitle: !linkTitle
    234246      });
    exports.default = void 0; 
    252264/**
    253265 * WordPress dependencies.
    254266 */
    255 var _wp = wp,
    256     createBlock = _wp.blocks.createBlock;
     267const {
     268  blocks: {
     269    createBlock
     270  }
     271} = wp;
    257272/**
    258273 * Transforms Legacy Widget to Dynamic Members Block.
    259274 *
    260275 * @type {Object}
    261276 */
    262277
    263 var transforms = {
     278const transforms = {
    264279  from: [{
    265280    type: 'block',
    266281    blocks: ['core/legacy-widget'],
    267     isMatch: function isMatch(_ref) {
    268       var idBase = _ref.idBase,
    269           instance = _ref.instance;
    270 
     282    isMatch: ({
     283      idBase,
     284      instance
     285    }) => {
    271286      if (!(instance !== null && instance !== void 0 && instance.raw)) {
    272287        return false;
    273288      }
    274289
    275290      return idBase === 'bp_core_members_widget';
    276291    },
    277     transform: function transform(_ref2) {
    278       var instance = _ref2.instance;
     292    transform: ({
     293      instance
     294    }) => {
    279295      return createBlock('bp/dynamic-members', {
    280296        title: instance.raw.title,
    281297        maxMembers: instance.raw.max_members,
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    299315/**
    300316 * WordPress dependencies.
    301317 */
    302 var _wp = wp,
    303     registerBlockType = _wp.blocks.registerBlockType,
    304     __ = _wp.i18n.__;
     318const {
     319  blocks: {
     320    registerBlockType
     321  },
     322  i18n: {
     323    __
     324  }
     325} = wp;
    305326/**
    306327 * Internal dependencies.
    307328 */
  • src/bp-members/js/blocks/member.js

    diff --git src/bp-members/js/blocks/member.js src/bp-members/js/blocks/member.js
    index 2e3648a9e..5a9053321 100644
    exports.AVATAR_SIZES = void 0; 
    128128/**
    129129 * WordPress dependencies.
    130130 */
    131 var _wp = wp,
    132     __ = _wp.i18n.__;
     131const {
     132  i18n: {
     133    __
     134  }
     135} = wp;
    133136/**
    134137 * Avatar sizes.
    135138 *
    136139 * @type {Array}
    137140 */
    138141
    139 var AVATAR_SIZES = [{
     142const AVATAR_SIZES = [{
    140143  label: __('None', 'buddypress'),
    141144  value: 'none'
    142145}, {
    var _constants = require("./constants"); 
    160163/**
    161164 * WordPress dependencies.
    162165 */
    163 var _wp = wp,
    164     _wp$blockEditor = _wp.blockEditor,
    165     InspectorControls = _wp$blockEditor.InspectorControls,
    166     BlockControls = _wp$blockEditor.BlockControls,
    167     _wp$components = _wp.components,
    168     Placeholder = _wp$components.Placeholder,
    169     Disabled = _wp$components.Disabled,
    170     PanelBody = _wp$components.PanelBody,
    171     SelectControl = _wp$components.SelectControl,
    172     ToggleControl = _wp$components.ToggleControl,
    173     Toolbar = _wp$components.Toolbar,
    174     ToolbarButton = _wp$components.ToolbarButton,
    175     _wp$element = _wp.element,
    176     Fragment = _wp$element.Fragment,
    177     createElement = _wp$element.createElement,
    178     __ = _wp.i18n.__;
     166const {
     167  blockEditor: {
     168    InspectorControls,
     169    BlockControls
     170  },
     171  components: {
     172    Placeholder,
     173    Disabled,
     174    PanelBody,
     175    SelectControl,
     176    ToggleControl,
     177    Toolbar,
     178    ToolbarButton
     179  },
     180  element: {
     181    Fragment,
     182    createElement
     183  },
     184  i18n: {
     185    __
     186  },
     187  serverSideRender: ServerSideRender
     188} = wp;
    179189/**
    180190 * BuddyPress dependencies.
    181191 */
    182192
    183 var _bp = bp,
    184     _bp$blockComponents = _bp.blockComponents,
    185     AutoCompleter = _bp$blockComponents.AutoCompleter,
    186     ServerSideRender = _bp$blockComponents.ServerSideRender,
    187     isActive = _bp.blockData.isActive;
     193const {
     194  blockComponents: {
     195    AutoCompleter
     196  },
     197  blockData: {
     198    isActive
     199  }
     200} = bp;
    188201/**
    189202 * Internal dependencies.
    190203 */
    191204
    192 var getSlugValue = function getSlugValue(item) {
     205const getSlugValue = item => {
    193206  if (item && item.mention_name) {
    194207    return item.mention_name;
    195208  }
    var getSlugValue = function getSlugValue(item) { 
    197210  return null;
    198211};
    199212
    200 var editMemberBlock = function editMemberBlock(_ref) {
    201   var attributes = _ref.attributes,
    202       setAttributes = _ref.setAttributes;
    203   var isAvatarEnabled = isActive('members', 'avatar');
    204   var isMentionEnabled = isActive('activity', 'mentions');
    205   var isCoverImageEnabled = isActive('members', 'cover');
    206   var avatarSize = attributes.avatarSize,
    207       displayMentionSlug = attributes.displayMentionSlug,
    208       displayActionButton = attributes.displayActionButton,
    209       displayCoverImage = attributes.displayCoverImage;
     213const editMemberBlock = ({
     214  attributes,
     215  setAttributes
     216}) => {
     217  const isAvatarEnabled = isActive('members', 'avatar');
     218  const isMentionEnabled = isActive('activity', 'mentions');
     219  const isCoverImageEnabled = isActive('members', 'cover');
     220  const {
     221    avatarSize,
     222    displayMentionSlug,
     223    displayActionButton,
     224    displayCoverImage
     225  } = attributes;
    210226
    211227  if (!attributes.itemID) {
    212228    return createElement(Placeholder, {
    var editMemberBlock = function editMemberBlock(_ref) { 
    228244  }, createElement(ToolbarButton, {
    229245    icon: "edit",
    230246    title: __('Select another member', 'buddypress'),
    231     onClick: function onClick() {
     247    onClick: () => {
    232248      setAttributes({
    233249        itemID: 0
    234250      });
    var editMemberBlock = function editMemberBlock(_ref) { 
    239255  }, createElement(ToggleControl, {
    240256    label: __('Display Profile button', 'buddypress'),
    241257    checked: !!displayActionButton,
    242     onChange: function onChange() {
     258    onChange: () => {
    243259      setAttributes({
    244260        displayActionButton: !displayActionButton
    245261      });
    var editMemberBlock = function editMemberBlock(_ref) { 
    250266    value: avatarSize,
    251267    options: _constants.AVATAR_SIZES,
    252268    help: __('Select "None" to disable the avatar.', 'buddypress'),
    253     onChange: function onChange(option) {
     269    onChange: option => {
    254270      setAttributes({
    255271        avatarSize: option
    256272      });
    var editMemberBlock = function editMemberBlock(_ref) { 
    258274  }), isCoverImageEnabled && createElement(ToggleControl, {
    259275    label: __('Display Cover Image', 'buddypress'),
    260276    checked: !!displayCoverImage,
    261     onChange: function onChange() {
     277    onChange: () => {
    262278      setAttributes({
    263279        displayCoverImage: !displayCoverImage
    264280      });
    var editMemberBlock = function editMemberBlock(_ref) { 
    267283  }), isMentionEnabled && createElement(ToggleControl, {
    268284    label: __('Display Mention slug', 'buddypress'),
    269285    checked: !!displayMentionSlug,
    270     onChange: function onChange() {
     286    onChange: () => {
    271287      setAttributes({
    272288        displayMentionSlug: !displayMentionSlug
    273289      });
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    291307/**
    292308 * WordPress dependencies.
    293309 */
    294 var _wp = wp,
    295     registerBlockType = _wp.blocks.registerBlockType,
    296     __ = _wp.i18n.__;
     310const {
     311  blocks: {
     312    registerBlockType
     313  },
     314  i18n: {
     315    __
     316  }
     317} = wp;
    297318/**
    298319 * Internal dependencies.
    299320 */
  • src/bp-members/js/blocks/members.js

    diff --git src/bp-members/js/blocks/members.js src/bp-members/js/blocks/members.js
    index a37f593c2..0bfe8fe6f 100644
    parcelRequire = (function (modules, cache, entry, globalName) { 
    117117  }
    118118
    119119  return newRequire;
    120 })({"jEQo":[function(require,module,exports) {
    121 function _arrayLikeToArray(arr, len) {
    122   if (len == null || len > arr.length) len = arr.length;
    123 
    124   for (var i = 0, arr2 = new Array(len); i < len; i++) {
    125     arr2[i] = arr[i];
    126   }
    127 
    128   return arr2;
    129 }
    130 
    131 module.exports = _arrayLikeToArray;
    132 },{}],"o3SL":[function(require,module,exports) {
    133 var arrayLikeToArray = require("./arrayLikeToArray");
    134 
    135 function _arrayWithoutHoles(arr) {
    136   if (Array.isArray(arr)) return arrayLikeToArray(arr);
    137 }
    138 
    139 module.exports = _arrayWithoutHoles;
    140 },{"./arrayLikeToArray":"jEQo"}],"lZpU":[function(require,module,exports) {
    141 function _iterableToArray(iter) {
    142   if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
    143 }
    144 
    145 module.exports = _iterableToArray;
    146 },{}],"Dbv9":[function(require,module,exports) {
    147 var arrayLikeToArray = require("./arrayLikeToArray");
    148 
    149 function _unsupportedIterableToArray(o, minLen) {
    150   if (!o) return;
    151   if (typeof o === "string") return arrayLikeToArray(o, minLen);
    152   var n = Object.prototype.toString.call(o).slice(8, -1);
    153   if (n === "Object" && o.constructor) n = o.constructor.name;
    154   if (n === "Map" || n === "Set") return Array.from(n);
    155   if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
    156 }
    157 
    158 module.exports = _unsupportedIterableToArray;
    159 },{"./arrayLikeToArray":"jEQo"}],"NCaH":[function(require,module,exports) {
    160 function _nonIterableSpread() {
    161   throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    162 }
    163 
    164 module.exports = _nonIterableSpread;
    165 },{}],"I9dH":[function(require,module,exports) {
    166 var arrayWithoutHoles = require("./arrayWithoutHoles");
    167 
    168 var iterableToArray = require("./iterableToArray");
    169 
    170 var unsupportedIterableToArray = require("./unsupportedIterableToArray");
    171 
    172 var nonIterableSpread = require("./nonIterableSpread");
    173 
    174 function _toConsumableArray(arr) {
    175   return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
    176 }
    177 
    178 module.exports = _toConsumableArray;
    179 },{"./arrayWithoutHoles":"o3SL","./iterableToArray":"lZpU","./unsupportedIterableToArray":"Dbv9","./nonIterableSpread":"NCaH"}],"DCTP":[function(require,module,exports) {
    180 function _arrayWithHoles(arr) {
    181   if (Array.isArray(arr)) return arr;
    182 }
    183 
    184 module.exports = _arrayWithHoles;
    185 },{}],"LoeL":[function(require,module,exports) {
    186 function _iterableToArrayLimit(arr, i) {
    187   if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
    188   var _arr = [];
    189   var _n = true;
    190   var _d = false;
    191   var _e = undefined;
    192 
    193   try {
    194     for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
    195       _arr.push(_s.value);
    196 
    197       if (i && _arr.length === i) break;
    198     }
    199   } catch (err) {
    200     _d = true;
    201     _e = err;
    202   } finally {
    203     try {
    204       if (!_n && _i["return"] != null) _i["return"]();
    205     } finally {
    206       if (_d) throw _e;
    207     }
    208   }
    209 
    210   return _arr;
    211 }
    212 
    213 module.exports = _iterableToArrayLimit;
    214 },{}],"MWEO":[function(require,module,exports) {
    215 function _nonIterableRest() {
    216   throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    217 }
    218 
    219 module.exports = _nonIterableRest;
    220 },{}],"DERy":[function(require,module,exports) {
    221 var arrayWithHoles = require("./arrayWithHoles");
    222 
    223 var iterableToArrayLimit = require("./iterableToArrayLimit");
    224 
    225 var unsupportedIterableToArray = require("./unsupportedIterableToArray");
    226 
    227 var nonIterableRest = require("./nonIterableRest");
    228 
    229 function _slicedToArray(arr, i) {
    230   return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
    231 }
    232 
    233 module.exports = _slicedToArray;
    234 },{"./arrayWithHoles":"DCTP","./iterableToArrayLimit":"LoeL","./unsupportedIterableToArray":"Dbv9","./nonIterableRest":"MWEO"}],"gr8I":[function(require,module,exports) {
     120})({"gr8I":[function(require,module,exports) {
    235121"use strict";
    236122
    237123Object.defineProperty(exports, "__esModule", {
    exports.EXTRA_DATA = exports.AVATAR_SIZES = void 0; 
    242128/**
    243129 * WordPress dependencies.
    244130 */
    245 var _wp = wp,
    246     __ = _wp.i18n.__;
     131const {
     132  i18n: {
     133    __
     134  }
     135} = wp;
    247136/**
    248137 * Avatar sizes.
    249138 *
    250139 * @type {Array}
    251140 */
    252141
    253 var AVATAR_SIZES = [{
     142const AVATAR_SIZES = [{
    254143  label: __('None', 'buddypress'),
    255144  value: 'none'
    256145}, {
    var AVATAR_SIZES = [{ 
    267156 */
    268157
    269158exports.AVATAR_SIZES = AVATAR_SIZES;
    270 var EXTRA_DATA = [{
     159const EXTRA_DATA = [{
    271160  label: __('None', 'buddypress'),
    272161  value: 'none'
    273162}, {
    Object.defineProperty(exports, "__esModule", { 
    286175});
    287176exports.default = void 0;
    288177
    289 var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
    290 
    291 var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
    292 
    293178var _constants = require("./constants");
    294179
    295 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
    296 
    297180/**
    298181 * WordPress dependencies.
    299182 */
    300 var _wp = wp,
    301     _wp$blockEditor = _wp.blockEditor,
    302     InspectorControls = _wp$blockEditor.InspectorControls,
    303     BlockControls = _wp$blockEditor.BlockControls,
    304     _wp$components = _wp.components,
    305     Placeholder = _wp$components.Placeholder,
    306     PanelBody = _wp$components.PanelBody,
    307     SelectControl = _wp$components.SelectControl,
    308     ToggleControl = _wp$components.ToggleControl,
    309     Button = _wp$components.Button,
    310     Dashicon = _wp$components.Dashicon,
    311     Tooltip = _wp$components.Tooltip,
    312     ToolbarGroup = _wp$components.ToolbarGroup,
    313     RangeControl = _wp$components.RangeControl,
    314     _wp$element = _wp.element,
    315     createElement = _wp$element.createElement,
    316     Fragment = _wp$element.Fragment,
    317     useState = _wp$element.useState,
    318     _wp$i18n = _wp.i18n,
    319     __ = _wp$i18n.__,
    320     sprintf = _wp$i18n.sprintf,
    321     apiFetch = _wp.apiFetch,
    322     addQueryArgs = _wp.url.addQueryArgs;
     183const {
     184  blockEditor: {
     185    InspectorControls,
     186    BlockControls
     187  },
     188  components: {
     189    Placeholder,
     190    PanelBody,
     191    SelectControl,
     192    ToggleControl,
     193    Button,
     194    Dashicon,
     195    Tooltip,
     196    ToolbarGroup,
     197    RangeControl
     198  },
     199  element: {
     200    createElement,
     201    Fragment,
     202    useState
     203  },
     204  i18n: {
     205    __,
     206    sprintf
     207  },
     208  apiFetch,
     209  url: {
     210    addQueryArgs
     211  }
     212} = wp;
    323213/**
    324214 * BuddyPress dependencies.
    325215 */
    326216
    327 var _bp = bp,
    328     AutoCompleter = _bp.blockComponents.AutoCompleter,
    329     isActive = _bp.blockData.isActive;
     217const {
     218  blockComponents: {
     219    AutoCompleter
     220  },
     221  blockData: {
     222    isActive
     223  }
     224} = bp;
    330225/**
    331226 * Internal dependencies.
    332227 */
    var _bp = bp, 
    334229/**
    335230 * External dependencies.
    336231 */
    337 var _lodash = lodash,
    338     reject = _lodash.reject,
    339     remove = _lodash.remove,
    340     sortBy = _lodash.sortBy;
     232const {
     233  reject,
     234  remove,
     235  sortBy
     236} = lodash;
    341237
    342 var getSlugValue = function getSlugValue(item) {
     238const getSlugValue = item => {
    343239  if (item && item.mention_name) {
    344240    return item.mention_name;
    345241  }
    var getSlugValue = function getSlugValue(item) { 
    347243  return null;
    348244};
    349245
    350 var editMembersBlock = function editMembersBlock(_ref) {
    351   var attributes = _ref.attributes,
    352       setAttributes = _ref.setAttributes,
    353       isSelected = _ref.isSelected;
    354   var isAvatarEnabled = isActive('members', 'avatar');
    355   var isMentionEnabled = isActive('activity', 'mentions');
    356   var itemIDs = attributes.itemIDs,
    357       avatarSize = attributes.avatarSize,
    358       displayMentionSlug = attributes.displayMentionSlug,
    359       displayUserName = attributes.displayUserName,
    360       extraData = attributes.extraData,
    361       layoutPreference = attributes.layoutPreference,
    362       columns = attributes.columns;
    363   var hasMembers = 0 !== itemIDs.length;
    364 
    365   var _useState = useState([]),
    366       _useState2 = (0, _slicedToArray2.default)(_useState, 2),
    367       members = _useState2[0],
    368       setMembers = _useState2[1];
    369 
    370   var layoutControls = [{
     246const editMembersBlock = ({
     247  attributes,
     248  setAttributes,
     249  isSelected
     250}) => {
     251  const isAvatarEnabled = isActive('members', 'avatar');
     252  const isMentionEnabled = isActive('activity', 'mentions');
     253  const {
     254    itemIDs,
     255    avatarSize,
     256    displayMentionSlug,
     257    displayUserName,
     258    extraData,
     259    layoutPreference,
     260    columns
     261  } = attributes;
     262  const hasMembers = 0 !== itemIDs.length;
     263  const [members, setMembers] = useState([]);
     264  const layoutControls = [{
    371265    icon: 'text',
    372266    title: __('List view', 'buddypress'),
    373     onClick: function onClick() {
    374       return setAttributes({
    375         layoutPreference: 'list'
    376       });
    377     },
     267    onClick: () => setAttributes({
     268      layoutPreference: 'list'
     269    }),
    378270    isActive: layoutPreference === 'list'
    379271  }, {
    380272    icon: 'screenoptions',
    381273    title: __('Grid view', 'buddypress'),
    382     onClick: function onClick() {
    383       return setAttributes({
    384         layoutPreference: 'grid'
    385       });
    386     },
     274    onClick: () => setAttributes({
     275      layoutPreference: 'grid'
     276    }),
    387277    isActive: layoutPreference === 'grid'
    388278  }];
    389   var membersList;
    390   var containerClasses = 'bp-block-members avatar-' + avatarSize;
    391   var extraDataOptions = _constants.EXTRA_DATA;
     279  let membersList;
     280  let containerClasses = 'bp-block-members avatar-' + avatarSize;
     281  let extraDataOptions = _constants.EXTRA_DATA;
    392282
    393283  if (layoutPreference === 'grid') {
    394284    containerClasses += ' is-grid columns-' + columns;
    395     extraDataOptions = _constants.EXTRA_DATA.filter(function (extra) {
     285    extraDataOptions = _constants.EXTRA_DATA.filter(extra => {
    396286      return 'latest_update' !== extra.value;
    397287    });
    398288  }
    399289
    400   var onSelectedMember = function onSelectedMember(_ref2) {
    401     var itemID = _ref2.itemID;
    402 
     290  const onSelectedMember = ({
     291    itemID
     292  }) => {
    403293    if (itemID && -1 === itemIDs.indexOf(itemID)) {
    404294      setAttributes({
    405         itemIDs: [].concat((0, _toConsumableArray2.default)(itemIDs), [parseInt(itemID, 10)])
     295        itemIDs: [...itemIDs, parseInt(itemID, 10)]
    406296      });
    407297    }
    408298  };
    409299
    410   var onRemoveMember = function onRemoveMember(itemID) {
     300  const onRemoveMember = itemID => {
    411301    if (itemID && -1 !== itemIDs.indexOf(itemID)) {
    412302      setMembers(reject(members, ['id', itemID]));
    413303      setAttributes({
    414         itemIDs: remove(itemIDs, function (value) {
     304        itemIDs: remove(itemIDs, value => {
    415305          return value !== itemID;
    416306        })
    417307      });
    var editMembersBlock = function editMembersBlock(_ref) { 
    420310
    421311  if (hasMembers && itemIDs.length !== members.length) {
    422312    apiFetch({
    423       path: addQueryArgs("/buddypress/v1/members", {
     313      path: addQueryArgs(`/buddypress/v1/members`, {
    424314        populate_extras: true,
    425315        include: itemIDs
    426316      })
    427     }).then(function (items) {
    428       setMembers(sortBy(items, [function (item) {
     317    }).then(items => {
     318      setMembers(sortBy(items, [item => {
    429319        return itemIDs.indexOf(item.id);
    430320      }]));
    431321    });
    432322  }
    433323
    434324  if (members.length) {
    435     membersList = members.map(function (member) {
    436       var hasActivity = false;
    437       var memberItemClasses = 'member-content';
     325    membersList = members.map(member => {
     326      let hasActivity = false;
     327      let memberItemClasses = 'member-content';
    438328
    439329      if (layoutPreference === 'list' && 'latest_update' === extraData && member.latest_update && member.latest_update.rendered) {
    440330        hasActivity = true;
    var editMembersBlock = function editMembersBlock(_ref) { 
    448338        text: __('Remove member', 'buddypress')
    449339      }, createElement(Button, {
    450340        className: "is-right",
    451         onClick: function onClick() {
    452           return onRemoveMember(member.id);
    453         },
     341        onClick: () => onRemoveMember(member.id),
    454342        label: __('Remove member', 'buddypress')
    455343      }, createElement(Dashicon, {
    456344        icon: "no"
    var editMembersBlock = function editMembersBlock(_ref) { 
    492380  }, createElement(ToggleControl, {
    493381    label: __('Display the user name', 'buddypress'),
    494382    checked: !!displayUserName,
    495     onChange: function onChange() {
     383    onChange: () => {
    496384      setAttributes({
    497385        displayUserName: !displayUserName
    498386      });
    var editMembersBlock = function editMembersBlock(_ref) { 
    501389  }), isMentionEnabled && createElement(ToggleControl, {
    502390    label: __('Display Mention slug', 'buddypress'),
    503391    checked: !!displayMentionSlug,
    504     onChange: function onChange() {
     392    onChange: () => {
    505393      setAttributes({
    506394        displayMentionSlug: !displayMentionSlug
    507395      });
    var editMembersBlock = function editMembersBlock(_ref) { 
    512400    value: avatarSize,
    513401    options: _constants.AVATAR_SIZES,
    514402    help: __('Select "None" to disable the avatar.', 'buddypress'),
    515     onChange: function onChange(option) {
     403    onChange: option => {
    516404      setAttributes({
    517405        avatarSize: option
    518406      });
    var editMembersBlock = function editMembersBlock(_ref) { 
    522410    value: extraData,
    523411    options: extraDataOptions,
    524412    help: __('Select "None" to show no extra information.', 'buddypress'),
    525     onChange: function onChange(option) {
     413    onChange: option => {
    526414      setAttributes({
    527415        extraData: option
    528416      });
    var editMembersBlock = function editMembersBlock(_ref) { 
    530418  }), layoutPreference === 'grid' && createElement(RangeControl, {
    531419    label: __('Columns', 'buddypress'),
    532420    value: columns,
    533     onChange: function onChange(value) {
    534       return setAttributes({
    535         columns: value
    536       });
    537     },
     421    onChange: value => setAttributes({
     422      columns: value
     423    }),
    538424    min: 2,
    539425    max: 4,
    540426    required: true
    var editMembersBlock = function editMembersBlock(_ref) { 
    562448
    563449var _default = editMembersBlock;
    564450exports.default = _default;
    565 },{"@babel/runtime/helpers/toConsumableArray":"I9dH","@babel/runtime/helpers/slicedToArray":"DERy","./constants":"gr8I"}],"XEHU":[function(require,module,exports) {
     451},{"./constants":"gr8I"}],"XEHU":[function(require,module,exports) {
    566452"use strict";
    567453
    568454var _edit = _interopRequireDefault(require("./members/edit"));
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    572458/**
    573459 * WordPress dependencies.
    574460 */
    575 var _wp = wp,
    576     registerBlockType = _wp.blocks.registerBlockType,
    577     __ = _wp.i18n.__;
     461const {
     462  blocks: {
     463    registerBlockType
     464  },
     465  i18n: {
     466    __
     467  }
     468} = wp;
    578469/**
    579470 * Internal dependencies.
    580471 */
  • src/bp-members/js/blocks/online-members.js

    diff --git src/bp-members/js/blocks/online-members.js src/bp-members/js/blocks/online-members.js
    index 21fbf528f..27420d521 100644
    exports.default = void 0; 
    128128/**
    129129 * WordPress dependencies.
    130130 */
    131 var _wp = wp,
    132     InspectorControls = _wp.blockEditor.InspectorControls,
    133     _wp$components = _wp.components,
    134     Disabled = _wp$components.Disabled,
    135     PanelBody = _wp$components.PanelBody,
    136     RangeControl = _wp$components.RangeControl,
    137     TextControl = _wp$components.TextControl,
    138     _wp$element = _wp.element,
    139     Fragment = _wp$element.Fragment,
    140     createElement = _wp$element.createElement,
    141     __ = _wp.i18n.__;
    142 /**
    143  * BuddyPress dependencies.
    144  */
    145 
    146 var _bp = bp,
    147     ServerSideRender = _bp.blockComponents.ServerSideRender;
    148 
    149 var editOnlineMembersBlock = function editOnlineMembersBlock(_ref) {
    150   var attributes = _ref.attributes,
    151       setAttributes = _ref.setAttributes;
    152   var title = attributes.title,
    153       maxMembers = attributes.maxMembers;
     131const {
     132  blockEditor: {
     133    InspectorControls
     134  },
     135  components: {
     136    Disabled,
     137    PanelBody,
     138    RangeControl,
     139    TextControl
     140  },
     141  element: {
     142    Fragment,
     143    createElement
     144  },
     145  i18n: {
     146    __
     147  },
     148  serverSideRender: ServerSideRender
     149} = wp;
     150
     151const editOnlineMembersBlock = ({
     152  attributes,
     153  setAttributes
     154}) => {
     155  const {
     156    title,
     157    maxMembers
     158  } = attributes;
    154159  return createElement(Fragment, null, createElement(InspectorControls, null, createElement(PanelBody, {
    155160    title: __('Settings', 'buddypress'),
    156161    initialOpen: true
    157162  }, createElement(TextControl, {
    158163    label: __('Title', 'buddypress'),
    159164    value: title,
    160     onChange: function onChange(text) {
     165    onChange: text => {
    161166      setAttributes({
    162167        title: text
    163168      });
    var editOnlineMembersBlock = function editOnlineMembersBlock(_ref) { 
    165170  }), createElement(RangeControl, {
    166171    label: __('Max members to show', 'buddypress'),
    167172    value: maxMembers,
    168     onChange: function onChange(value) {
    169       return setAttributes({
    170         maxMembers: value
    171       });
    172     },
     173    onChange: value => setAttributes({
     174      maxMembers: value
     175    }),
    173176    min: 1,
    174177    max: 15,
    175178    required: true
    exports.default = void 0; 
    192195/**
    193196 * WordPress dependencies.
    194197 */
    195 var _wp = wp,
    196     createBlock = _wp.blocks.createBlock;
     198const {
     199  blocks: {
     200    createBlock
     201  }
     202} = wp;
    197203/**
    198204 * Transforms Legacy Widget to Online Members Block.
    199205 *
    200206 * @type {Object}
    201207 */
    202208
    203 var transforms = {
     209const transforms = {
    204210  from: [{
    205211    type: 'block',
    206212    blocks: ['core/legacy-widget'],
    207     isMatch: function isMatch(_ref) {
    208       var idBase = _ref.idBase,
    209           instance = _ref.instance;
    210 
     213    isMatch: ({
     214      idBase,
     215      instance
     216    }) => {
    211217      if (!(instance !== null && instance !== void 0 && instance.raw)) {
    212218        return false;
    213219      }
    214220
    215221      return idBase === 'bp_core_whos_online_widget';
    216222    },
    217     transform: function transform(_ref2) {
    218       var instance = _ref2.instance;
     223    transform: ({
     224      instance
     225    }) => {
    219226      return createBlock('bp/online-members', {
    220227        title: instance.raw.title,
    221228        maxMembers: instance.raw.max_members
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    237244/**
    238245 * WordPress dependencies.
    239246 */
    240 var _wp = wp,
    241     registerBlockType = _wp.blocks.registerBlockType,
    242     __ = _wp.i18n.__;
     247const {
     248  blocks: {
     249    registerBlockType
     250  },
     251  i18n: {
     252    __
     253  }
     254} = wp;
    243255/**
    244256 * Internal dependencies.
    245257 */
  • src/bp-members/js/dynamic-members.js

    diff --git src/bp-members/js/dynamic-members.js src/bp-members/js/dynamic-members.js
    index 827f914c5..076e8ca2b 100644
    parcelRequire = (function (modules, cache, entry, globalName) { 
    118118
    119119  return newRequire;
    120120})({"k5We":[function(require,module,exports) {
    121 function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
    122 
    123 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    124 
    125 function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    126 
    127 function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
    128 
    129 function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
    130 
    131 function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
    132 
    133 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
    134 
    135 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
    136 
    137 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
    138 
    139 function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
    140 
    141 function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
    142 
    143 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
    144 
    145 function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
    146 
    147121/**
    148122 * WordPress dependencies.
    149123 */
    150 var _wp = wp,
    151     _wp$i18n = _wp.i18n,
    152     __ = _wp$i18n.__,
    153     sprintf = _wp$i18n.sprintf;
     124const {
     125  i18n: {
     126    __,
     127    sprintf
     128  }
     129} = wp;
    154130/**
    155131 * BuddyPress dependencies.
    156132 */
    157133
    158 var _bp = bp,
    159     dynamicWidgetBlock = _bp.dynamicWidgetBlock;
     134const {
     135  dynamicWidgetBlock
     136} = bp;
    160137/**
    161138 * Front-end Dynamic Members Widget Block class.
    162139 *
    163140 * @since 9.0.0
    164141 */
    165142
    166 var bpMembersWidgetBlock = /*#__PURE__*/function (_dynamicWidgetBlock) {
    167   _inherits(bpMembersWidgetBlock, _dynamicWidgetBlock);
    168 
    169   var _super = _createSuper(bpMembersWidgetBlock);
    170 
    171   function bpMembersWidgetBlock() {
    172     _classCallCheck(this, bpMembersWidgetBlock);
    173 
    174     return _super.apply(this, arguments);
    175   }
    176 
    177   _createClass(bpMembersWidgetBlock, [{
    178     key: "loop",
    179     value: function loop() {
    180       var members = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
    181       var container = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
    182       var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'active';
    183 
    184       var tmpl = _get(_getPrototypeOf(bpMembersWidgetBlock.prototype), "useTemplate", this).call(this, 'bp-dynamic-members-item');
    185 
    186       var selector = document.querySelector('#' + container);
    187       var output = '';
    188 
    189       if (members && members.length) {
    190         members.forEach(function (member) {
    191           if ('active' === type && member.last_activity) {
    192             /* translators: %s: a human time diff. */
    193             member.extra = sprintf(__('Active %s', 'buddypress'), member.last_activity.timediff);
    194           } else if ('popular' === type && member.total_friend_count) {
    195             var friendsCount = parseInt(member.total_friend_count, 10);
    196 
    197             if (0 === friendsCount) {
    198               member.extra = __('No friends', 'buddypress');
    199             } else if (1 === friendsCount) {
    200               member.extra = __('1 friend', 'buddypress');
    201             } else {
    202               /* translators: %s: total friend count (more than 1). */
    203               member.extra = sprintf(__('%s friends', 'buddypress'), member.total_friend_count);
    204             }
    205           } else if ('newest' === type && member.registered_since) {
    206             /* translators: %s is time elapsed since the registration date happened */
    207             member.extra = sprintf(__('Registered %s', 'buddypress'), member.registered_since);
     143class bpMembersWidgetBlock extends dynamicWidgetBlock {
     144  loop(members = [], container = '', type = 'active') {
     145    const tmpl = super.useTemplate('bp-dynamic-members-item');
     146    const selector = document.querySelector('#' + container);
     147    let output = '';
     148
     149    if (members && members.length) {
     150      members.forEach(member => {
     151        if ('active' === type && member.last_activity) {
     152          /* translators: %s: a human time diff. */
     153          member.extra = sprintf(__('Active %s', 'buddypress'), member.last_activity.timediff);
     154        } else if ('popular' === type && member.total_friend_count) {
     155          const friendsCount = parseInt(member.total_friend_count, 10);
     156
     157          if (0 === friendsCount) {
     158            member.extra = __('No friends', 'buddypress');
     159          } else if (1 === friendsCount) {
     160            member.extra = __('1 friend', 'buddypress');
     161          } else {
     162            /* translators: %s: total friend count (more than 1). */
     163            member.extra = sprintf(__('%s friends', 'buddypress'), member.total_friend_count);
    208164          }
    209           /* translators: %s: member name */
    210 
     165        } else if ('newest' === type && member.registered_since) {
     166          /* translators: %s is time elapsed since the registration date happened */
     167          member.extra = sprintf(__('Registered %s', 'buddypress'), member.registered_since);
     168        }
     169        /* translators: %s: member name */
    211170
    212           member.avatar_alt = sprintf(__('Profile picture of %s', 'buddypress'), member.name);
    213           output += tmpl(member);
    214         });
    215       } else {
    216         output = '<div class="widget-error">' + __('No members found.', 'buddypress') + '</div>';
    217       }
    218171
    219       selector.innerHTML = output;
     172        member.avatar_alt = sprintf(__('Profile picture of %s', 'buddypress'), member.name);
     173        output += tmpl(member);
     174      });
     175    } else {
     176      output = '<div class="widget-error">' + __('No members found.', 'buddypress') + '</div>';
    220177    }
    221   }, {
    222     key: "start",
    223     value: function start() {
    224       var _this = this;
    225178
    226       this.blocks.forEach(function (block, i) {
    227         var selector = block.selector;
    228         var type = block.query_args.type;
    229         var list = document.querySelector('#' + selector).closest('.bp-dynamic-block-container'); // Get default Block's type members.
     179    selector.innerHTML = output;
     180  }
    230181
    231         _get(_getPrototypeOf(bpMembersWidgetBlock.prototype), "getItems", _this).call(_this, type, i); // Listen to Block's Nav item clics
     182  start() {
     183    this.blocks.forEach((block, i) => {
     184      const {
     185        selector
     186      } = block;
     187      const {
     188        type
     189      } = block.query_args;
     190      const list = document.querySelector('#' + selector).closest('.bp-dynamic-block-container'); // Get default Block's type members.
    232191
     192      super.getItems(type, i); // Listen to Block's Nav item clics
    233193
    234         list.querySelectorAll('.item-options a').forEach(function (navItem) {
    235           navItem.addEventListener('click', function (event) {
    236             event.preventDefault(); // Changes the displayed filter.
     194      list.querySelectorAll('.item-options a').forEach(navItem => {
     195        navItem.addEventListener('click', event => {
     196          event.preventDefault(); // Changes the displayed filter.
    237197
    238             event.target.closest('.item-options').querySelector('.selected').classList.remove('selected');
    239             event.target.classList.add('selected');
    240             var newType = event.target.getAttribute('data-bp-sort');
     198          event.target.closest('.item-options').querySelector('.selected').classList.remove('selected');
     199          event.target.classList.add('selected');
     200          const newType = event.target.getAttribute('data-bp-sort');
    241201
    242             if (newType !== _this.blocks[i].query_args.type) {
    243               _get(_getPrototypeOf(bpMembersWidgetBlock.prototype), "getItems", _this).call(_this, newType, i);
    244             }
    245           });
     202          if (newType !== this.blocks[i].query_args.type) {
     203            super.getItems(newType, i);
     204          }
    246205        });
    247206      });
    248     }
    249   }]);
     207    });
     208  }
    250209
    251   return bpMembersWidgetBlock;
    252 }(dynamicWidgetBlock);
     210}
    253211
    254 var settings = window.bpDynamicMembersSettings || {};
    255 var blocks = window.bpDynamicMembersBlocks || {};
    256 var bpDynamicMembers = new bpMembersWidgetBlock(settings, blocks);
     212const settings = window.bpDynamicMembersSettings || {};
     213const blocks = window.bpDynamicMembersBlocks || {};
     214const bpDynamicMembers = new bpMembersWidgetBlock(settings, blocks);
    257215
    258216if ('loading' === document.readyState) {
    259217  document.addEventListener('DOMContentLoaded', bpDynamicMembers.start());
  • src/bp-messages/classes/class-bp-messages-component.php

    diff --git src/bp-messages/classes/class-bp-messages-component.php src/bp-messages/classes/class-bp-messages-component.php
    index 01105f390..9d1656173 100644
    class BP_Messages_Component extends BP_Component { 
    468468                                                'wp-components',
    469469                                                'wp-i18n',
    470470                                                'wp-block-editor',
     471                                                'wp-server-side-render',
    471472                                                'bp-block-data',
    472                                                 'bp-block-components',
    473473                                        ),
    474474                                        'style'              => 'bp-sitewide-notices-block',
    475475                                        'style_url'          => plugins_url( 'css/blocks/sitewide-notices.css', dirname( __FILE__ ) ),
  • src/bp-messages/js/blocks/sitewide-notices.js

    diff --git src/bp-messages/js/blocks/sitewide-notices.js src/bp-messages/js/blocks/sitewide-notices.js
    index 683f80566..31b4a16b2 100644
    exports.default = void 0; 
    128128/**
    129129 * WordPress dependencies.
    130130 */
    131 var _wp = wp,
    132     InspectorControls = _wp.blockEditor.InspectorControls,
    133     _wp$components = _wp.components,
    134     Disabled = _wp$components.Disabled,
    135     PanelBody = _wp$components.PanelBody,
    136     TextControl = _wp$components.TextControl,
    137     _wp$element = _wp.element,
    138     Fragment = _wp$element.Fragment,
    139     createElement = _wp$element.createElement,
    140     __ = _wp.i18n.__;
    141 /**
    142  * BuddyPress dependencies.
    143  */
    144 
    145 var _bp = bp,
    146     ServerSideRender = _bp.blockComponents.ServerSideRender;
    147 
    148 var editSitewideNoticesBlock = function editSitewideNoticesBlock(_ref) {
    149   var attributes = _ref.attributes,
    150       setAttributes = _ref.setAttributes;
    151   var title = attributes.title;
     131const {
     132  blockEditor: {
     133    InspectorControls
     134  },
     135  components: {
     136    Disabled,
     137    PanelBody,
     138    TextControl
     139  },
     140  element: {
     141    Fragment,
     142    createElement
     143  },
     144  i18n: {
     145    __
     146  },
     147  serverSideRender: ServerSideRender
     148} = wp;
     149
     150const editSitewideNoticesBlock = ({
     151  attributes,
     152  setAttributes
     153}) => {
     154  const {
     155    title
     156  } = attributes;
    152157  return createElement(Fragment, null, createElement(InspectorControls, null, createElement(PanelBody, {
    153158    title: __('Settings', 'buddypress'),
    154159    initialOpen: true
    155160  }, createElement(TextControl, {
    156161    label: __('Title', 'buddypress'),
    157162    value: title,
    158     onChange: function onChange(text) {
     163    onChange: text => {
    159164      setAttributes({
    160165        title: text
    161166      });
    exports.default = void 0; 
    179184/**
    180185 * WordPress dependencies.
    181186 */
    182 var _wp = wp,
    183     createBlock = _wp.blocks.createBlock;
     187const {
     188  blocks: {
     189    createBlock
     190  }
     191} = wp;
    184192/**
    185193 * Transforms Legacy Widget to Friends Block.
    186194 *
    187195 * @type {Object}
    188196 */
    189197
    190 var transforms = {
     198const transforms = {
    191199  from: [{
    192200    type: 'block',
    193201    blocks: ['core/legacy-widget'],
    194     isMatch: function isMatch(_ref) {
    195       var idBase = _ref.idBase,
    196           instance = _ref.instance;
    197 
     202    isMatch: ({
     203      idBase,
     204      instance
     205    }) => {
    198206      if (!(instance !== null && instance !== void 0 && instance.raw)) {
    199207        return false;
    200208      }
    201209
    202210      return idBase === 'bp_messages_sitewide_notices_widget';
    203211    },
    204     transform: function transform(_ref2) {
    205       var instance = _ref2.instance;
     212    transform: ({
     213      instance
     214    }) => {
    206215      return createBlock('bp/sitewide-notices', {
    207216        title: instance.raw.title
    208217      });
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de 
    223232/**
    224233 * WordPress dependencies.
    225234 */
    226 var _wp = wp,
    227     registerBlockType = _wp.blocks.registerBlockType,
    228     __ = _wp.i18n.__;
     235const {
     236  blocks: {
     237    registerBlockType
     238  },
     239  i18n: {
     240    __
     241  }
     242} = wp;
    229243/**
    230244 * Internal dependencies.
    231245 */
  • src/bp-messages/js/sitewide-notices.js

    diff --git src/bp-messages/js/sitewide-notices.js src/bp-messages/js/sitewide-notices.js
    index d027afa70..eceea12ef 100644
    parcelRequire = (function (modules, cache, entry, globalName) { 
    118118
    119119  return newRequire;
    120120})({"nIsC":[function(require,module,exports) {
    121 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    122 
    123 function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    124 
    125 function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
    126 
    127121/**
    128122 * Front-end Sitewide notices block class.
    129123 *
    130124 * @since 9.0.0
    131125 */
    132 var bpSitewideNoticeBlock = /*#__PURE__*/function () {
    133   function bpSitewideNoticeBlock(settings) {
    134     _classCallCheck(this, bpSitewideNoticeBlock);
    135 
    136     var path = settings.path,
    137         dismissPath = settings.dismissPath,
    138         root = settings.root,
    139         nonce = settings.nonce;
     126class bpSitewideNoticeBlock {
     127  constructor(settings) {
     128    const {
     129      path,
     130      dismissPath,
     131      root,
     132      nonce
     133    } = settings;
    140134    this.path = path;
    141135    this.dismissPath = dismissPath;
    142136    this.root = root;
    143137    this.nonce = nonce;
    144138  }
    145139
    146   _createClass(bpSitewideNoticeBlock, [{
    147     key: "start",
    148     value: function start() {
    149       var _this = this;
    150 
    151       // Listen to each Block's dismiss button clicks
    152       document.querySelectorAll('.bp-sitewide-notice-block a.dismiss-notice').forEach(function (dismissButton) {
    153         dismissButton.addEventListener('click', function (event) {
    154           event.preventDefault();
    155           fetch(_this.root + _this.dismissPath, {
    156             method: 'POST',
    157             headers: {
    158               'X-WP-Nonce': _this.nonce
    159             }
    160           }).then(function (response) {
    161             return response.json();
    162           }).then(function (data) {
    163             if ('undefined' !== typeof data && 'undefined' !== typeof data.dismissed && data.dismissed) {
    164               document.querySelectorAll('.bp-sitewide-notice-block').forEach(function (elem) {
    165                 elem.remove();
    166               });
    167             }
    168           });
     140  start() {
     141    // Listen to each Block's dismiss button clicks
     142    document.querySelectorAll('.bp-sitewide-notice-block a.dismiss-notice').forEach(dismissButton => {
     143      dismissButton.addEventListener('click', event => {
     144        event.preventDefault();
     145        fetch(this.root + this.dismissPath, {
     146          method: 'POST',
     147          headers: {
     148            'X-WP-Nonce': this.nonce
     149          }
     150        }).then(response => response.json()).then(data => {
     151          if ('undefined' !== typeof data && 'undefined' !== typeof data.dismissed && data.dismissed) {
     152            document.querySelectorAll('.bp-sitewide-notice-block').forEach(elem => {
     153              elem.remove();
     154            });
     155          }
    169156        });
    170157      });
    171     }
    172   }]);
     158    });
     159  }
    173160
    174   return bpSitewideNoticeBlock;
    175 }(); // widget_bp_core_sitewide_messages buddypress widget wp-block-bp-sitewide-notices > bp-sitewide-notice > a.dismiss-notice
     161} // widget_bp_core_sitewide_messages buddypress widget wp-block-bp-sitewide-notices > bp-sitewide-notice > a.dismiss-notice
    176162
    177163
    178 var settings = window.bpSitewideNoticeBlockSettings || {};
    179 var bpSitewideNotice = new bpSitewideNoticeBlock(settings);
     164const settings = window.bpSitewideNoticeBlockSettings || {};
     165const bpSitewideNotice = new bpSitewideNoticeBlock(settings);
    180166
    181167if ('loading' === document.readyState) {
    182168  document.addEventListener('DOMContentLoaded', bpSitewideNotice.start());
  • src/bp-templates/bp-nouveau/includes/functions.php

    diff --git src/bp-templates/bp-nouveau/includes/functions.php src/bp-templates/bp-nouveau/includes/functions.php
    index a01f82e03..a761586ae 100644
    function bp_nouveau_register_primary_nav_widget_block( $blocks = array() ) { 
    15111511                        'wp-components',
    15121512                        'wp-i18n',
    15131513                        'wp-block-editor',
     1514                        'wp-server-side-render',
    15141515                        'bp-block-data',
    1515                         'bp-block-components',
    15161516                ),
    15171517                'editor_style'       => 'bp-primary-nav-block',
    15181518                'editor_style_url'   => $editor_style['uri'],
  • src/js/bp-activity/js/blocks/latest-activities/edit.js

    diff --git src/js/bp-activity/js/blocks/latest-activities/edit.js src/js/bp-activity/js/blocks/latest-activities/edit.js
    index f5ebcaddc..9d0e984e8 100644
    const { 
    1919        i18n: {
    2020                __,
    2121        },
     22        serverSideRender: ServerSideRender,
    2223} = wp;
    2324
    2425/**
    2526 * BuddyPress dependencies.
    2627 */
    2728const {
    28         blockComponents: {
    29                 ServerSideRender,
    30         },
    3129        blockData: {
    3230                currentPostId,
    3331                activityTypes,
  • src/js/bp-blogs/js/blocks/recent-posts/edit.js

    diff --git src/js/bp-blogs/js/blocks/recent-posts/edit.js src/js/bp-blogs/js/blocks/recent-posts/edit.js
    index 921087ac0..67450683c 100644
    const { 
    1919        i18n: {
    2020                __,
    2121        },
     22        serverSideRender: ServerSideRender,
    2223} = wp;
    2324
    24 /**
    25  * BuddyPress dependencies.
    26  */
    27 const {
    28         blockComponents: {
    29                 ServerSideRender,
    30         },
    31 } = bp;
    32 
    3325const editRecentPostsBlock = ( { attributes, setAttributes } ) => {
    3426        const { title, maxPosts, linkTitle } = attributes;
    3527
  • src/js/bp-core/js/block-components/components/index.js

    diff --git src/js/bp-core/js/block-components/components/index.js src/js/bp-core/js/block-components/components/index.js
    index ea14e9b39..926aa0616 100644
     
    22 * BuddyPress components.
    33 */
    44import AutoCompleter from './autocompleter';
    5 import ServerSideRender from './server-side-render';
    65
    76export default {
    87        AutoCompleter,
    9         ServerSideRender,
    108};
  • deleted file src/js/bp-core/js/block-components/components/server-side-render.js

    diff --git src/js/bp-core/js/block-components/components/server-side-render.js src/js/bp-core/js/block-components/components/server-side-render.js
    deleted file mode 100644
    index cba764ff7..000000000
    + -  
    1 /**
    2  * WordPress dependencies.
    3  */
    4 const {
    5         element: {
    6                 createElement,
    7         },
    8 } = wp;
    9 
    10 /**
    11  * Compatibility Server Side Render.
    12  *
    13  * @since 9.0.0
    14  */
    15  export default function ServerSideRender( props ) {
    16         const CompatibiltyServerSideRender = wp.serverSideRender ? wp.serverSideRender : wp.editor.ServerSideRender;
    17 
    18         return (
    19                 <CompatibiltyServerSideRender { ...props } />
    20         );
    21 }
  • src/js/bp-core/js/blocks/login-form/edit.js

    diff --git src/js/bp-core/js/blocks/login-form/edit.js src/js/bp-core/js/blocks/login-form/edit.js
    index 7734dc7d8..36c65c342 100644
    const { 
    1818        i18n: {
    1919                __,
    2020        },
     21        serverSideRender: ServerSideRender,
    2122} = wp;
    2223
    23 /**
    24  * BuddyPress dependencies.
    25  */
    26 const {
    27         blockComponents: {
    28                 ServerSideRender,
    29         },
    30 } = bp;
    31 
    3224const editLoginForm = ( { attributes, setAttributes } ) => {
    3325        const { title,forgotPwdLink } = attributes;
    3426
  • src/js/bp-core/js/blocks/primary-nav/edit.js

    diff --git src/js/bp-core/js/blocks/primary-nav/edit.js src/js/bp-core/js/blocks/primary-nav/edit.js
    index 8aa4b4375..a9553486c 100644
    const { 
    1818        i18n: {
    1919                __,
    2020        },
     21        serverSideRender: ServerSideRender,
    2122} = wp;
    2223
    2324/**
    2425 * BuddyPress dependencies.
    2526 */
    2627const {
    27         blockComponents: {
    28                 ServerSideRender,
    29         },
    3028        blockData: {
    3129                getCurrentWidgetsSidebar,
    3230        }
  • src/js/bp-friends/js/blocks/friends/edit.js

    diff --git src/js/bp-friends/js/blocks/friends/edit.js src/js/bp-friends/js/blocks/friends/edit.js
    index a5928e51b..1ebb2bd17 100644
    const { 
    1919        i18n: {
    2020                __,
    2121        },
     22        serverSideRender: ServerSideRender,
    2223} = wp;
    2324
    2425/**
    2526 * BuddyPress dependencies.
    2627 */
    2728const {
    28         blockComponents: {
    29                 ServerSideRender,
    30         },
    3129        blockData: {
    3230                currentPostId,
    3331        }
  • src/js/bp-groups/js/blocks/dynamic-groups/edit.js

    diff --git src/js/bp-groups/js/blocks/dynamic-groups/edit.js src/js/bp-groups/js/blocks/dynamic-groups/edit.js
    index b1be4d5b5..719c5ee1c 100644
    const { 
    2020        i18n: {
    2121                __,
    2222        },
     23        serverSideRender: ServerSideRender,
    2324} = wp;
    2425
    25 /**
    26  * BuddyPress dependencies.
    27  */
    28 const {
    29         blockComponents: {
    30                 ServerSideRender,
    31         },
    32 } = bp;
    33 
    3426/**
    3527 * Internal dependencies.
    3628 */
  • src/js/bp-groups/js/blocks/group/edit.js

    diff --git src/js/bp-groups/js/blocks/group/edit.js src/js/bp-groups/js/blocks/group/edit.js
    index 0f44b18b2..46cc34917 100644
    const { 
    2222        i18n: {
    2323                __,
    2424        },
     25        serverSideRender: ServerSideRender,
    2526} = wp;
    2627
    2728/**
    const { 
    3031const {
    3132        blockComponents: {
    3233                AutoCompleter,
    33                 ServerSideRender,
    3434        },
    3535        blockData: {
    3636                isActive,
  • src/js/bp-members/js/blocks/active-members/edit.js

    diff --git src/js/bp-members/js/blocks/active-members/edit.js src/js/bp-members/js/blocks/active-members/edit.js
    index 8b3722b22..c814ccc2e 100644
    const { 
    1818        i18n: {
    1919                __,
    2020        },
     21        serverSideRender: ServerSideRender,
    2122} = wp;
    2223
    23 /**
    24  * BuddyPress dependencies.
    25  */
    26 const {
    27         blockComponents: {
    28                 ServerSideRender,
    29         },
    30 } = bp;
    31 
    3224const editActiveMembersBlock = ( { attributes, setAttributes } ) => {
    3325        const { title, maxMembers } = attributes;
    3426
  • src/js/bp-members/js/blocks/dynamic-members/edit.js

    diff --git src/js/bp-members/js/blocks/dynamic-members/edit.js src/js/bp-members/js/blocks/dynamic-members/edit.js
    index 88b5ee297..afe5c3b85 100644
    const { 
    2020        i18n: {
    2121                __,
    2222        },
     23        serverSideRender: ServerSideRender,
    2324} = wp;
    2425
    2526/**
    2627 * BuddyPress dependencies.
    2728 */
    2829const {
    29         blockComponents: {
    30                 ServerSideRender,
    31         },
    3230        blockData: {
    3331                isActive,
    3432        }
  • src/js/bp-members/js/blocks/member/edit.js

    diff --git src/js/bp-members/js/blocks/member/edit.js src/js/bp-members/js/blocks/member/edit.js
    index fbafdb359..c3ebbce4e 100644
    const { 
    2222        i18n: {
    2323                __,
    2424        },
     25        serverSideRender: ServerSideRender,
    2526} = wp;
    2627
    2728/**
    const { 
    3031const {
    3132        blockComponents: {
    3233                AutoCompleter,
    33                 ServerSideRender,
    3434        },