Skip to:
Content

BuddyPress.org

Ticket #8513: 8513.patch

File 8513.patch, 30.7 KB (added by imath, 4 years ago)
  • src/bp-activity/bp-activity-blocks.php

    diff --git src/bp-activity/bp-activity-blocks.php src/bp-activity/bp-activity-blocks.php
    index 655362a92..116badd6a 100644
     
    1111if ( ! defined( 'ABSPATH' ) ) {
    1212        exit;
    1313}
    14 
    15 /**
    16  * Add BP Activity blocks specific settings to the BP Blocks Editor ones.
    17  *
    18  * @since 7.0.0
    19  *
    20  * @param array $bp_editor_settings BP blocks editor settings.
    21  * @return array BP Activity blocks editor settings.
    22  */
    23 function bp_activity_editor_settings( $bp_editor_settings = array() ) {
    24         return array_merge(
    25                 $bp_editor_settings,
    26                 array(
    27                         'activity' => array(
    28                                 'embedScriptURL' => includes_url( 'js/wp-embed.min.js' ),
    29                         ),
    30                 )
    31         );
    32 }
    33 add_filter( 'bp_blocks_editor_settings', 'bp_activity_editor_settings' );
  • 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 d44879fd3..398550378 100644
    class BP_Activity_Component extends BP_Component { 
    497497                                                'wp-block-editor',
    498498                                                'wp-data',
    499499                                                'wp-compose',
     500                                                'bp-block-data',
    500501                                        ),
    501502                                ),
    502503                        )
  • 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 520118032..5f481a7a1 100644
    var _wp = wp, 
    232232    _wp$blockEditor = _wp.blockEditor,
    233233    RichText = _wp$blockEditor.RichText,
    234234    BlockControls = _wp$blockEditor.BlockControls;
     235/**
     236 * BuddyPress dependencies.
     237 */
     238
     239var _bp = bp,
     240    embedScriptURL = _bp.blockData.embedScriptURL;
    235241
    236242var EditEmbedActivity = function EditEmbedActivity(_ref) {
    237243  var attributes = _ref.attributes,
    238244      setAttributes = _ref.setAttributes,
    239245      isSelected = _ref.isSelected,
    240       bpSettings = _ref.bpSettings,
    241246      preview = _ref.preview,
    242247      fetching = _ref.fetching;
    243248  var url = attributes.url,
    244249      caption = attributes.caption;
    245   var embedScriptURL = bpSettings.embedScriptURL;
    246250
    247251  var label = __('BuddyPress Activity URL', 'buddypress');
    248252
    var EditEmbedActivity = function EditEmbedActivity(_ref) { 
    345349
    346350var editEmbedActivityBlock = compose([withSelect(function (select, ownProps) {
    347351  var url = ownProps.attributes.url;
    348   var editorSettings = select('core/editor').getEditorSettings();
    349352
    350353  var _select = select('core'),
    351354      getEmbedPreview = _select.getEmbedPreview,
    var editEmbedActivityBlock = compose([withSelect(function (select, ownProps) { 
    354357  var preview = !!url && getEmbedPreview(url);
    355358  var fetching = !!url && isRequestingEmbedPreview(url);
    356359  return {
    357     bpSettings: editorSettings.bp.activity || {},
    358360    preview: preview,
    359361    fetching: fetching
    360362  };
    var _wp = wp, 
    421423registerBlockType('bp/embed-activity', {
    422424  title: __('Embed an activity', 'buddypress'),
    423425  description: __('Add a block that displays the activity content pulled from this or other community sites.', 'buddypress'),
    424   icon: 'buddicons-activity',
     426  icon: {
     427    background: '#fff',
     428    foreground: '#d84800',
     429    src: 'buddicons-activity'
     430  },
    425431  category: 'buddypress',
    426432  attributes: {
    427433    url: {
  • src/bp-groups/bp-groups-blocks.php

    diff --git src/bp-groups/bp-groups-blocks.php src/bp-groups/bp-groups-blocks.php
    index 063868ee5..c3c08fb39 100644
    if ( ! defined( 'ABSPATH' ) ) { 
    1212        exit;
    1313}
    1414
    15 /**
    16  * Add BP Groups blocks specific settings to the BP Blocks Editor ones.
    17  *
    18  * @since 6.0.0
    19  *
    20  * @param array $bp_editor_settings BP blocks editor settings.
    21  * @return array BP Groups blocks editor settings.
    22  */
    23 function bp_groups_editor_settings( $bp_editor_settings = array() ) {
    24         $bp = buddypress();
    25 
    26         return array_merge(
    27                 $bp_editor_settings,
    28                 array(
    29                         'groups' => array(
    30                                 'isAvatarEnabled'     => $bp->avatar && $bp->avatar->show_avatars && ! bp_disable_group_avatar_uploads(),
    31                                 'isCoverImageEnabled' => bp_is_active( 'groups', 'cover_image' ),
    32                         ),
    33                 )
    34         );
    35 }
    36 add_filter( 'bp_blocks_editor_settings', 'bp_groups_editor_settings' );
    37 
    3815/**
    3916 * Callback function to render the BP Group Block.
    4017 *
    function bp_groups_render_groups_block( $attributes = array() ) { 
    264241                        $output .= sprintf(
    265242                                '<div class="item-header-avatar">
    266243                                        <a href="%1$s">
    267                                                 <img class="avatar" alt="%2$s" src="%3$s" />
     244                                                <img loading="lazy" src="%2$s" alt="%3$s" class="avatar">
    268245                                        </a>
    269246                                </div>',
    270247                                esc_url( $group_link ),
    271248                                /* Translators: %s is the group's name. */
    272                                 sprintf( esc_attr__( 'Group Profile photo of %s', 'buddypress' ), $group->display_name ),
     249                                sprintf( esc_attr__( 'Group Profile photo of %s', 'buddypress' ), esc_html( $group->name ) ),
    273250                                esc_url(
    274251                                        bp_core_fetch_avatar(
    275252                                                array(
  • 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 d15a7cb58..d40a5c7b7 100644
    class BP_Groups_Component extends BP_Component { 
    978978                                                'wp-element',
    979979                                                'wp-components',
    980980                                                'wp-i18n',
    981                                                 'wp-editor',
    982                                                 'wp-compose',
    983                                                 'wp-data',
    984981                                                'wp-block-editor',
    985982                                                'bp-block-components',
     983                                                'bp-block-data',
    986984                                        ),
    987985                                        'style'              => 'bp-group-block',
    988986                                        'style_url'          => plugins_url( 'css/blocks/group.css', dirname( __FILE__ ) ),
    class BP_Groups_Component extends BP_Component { 
    10191017                                                'wp-element',
    10201018                                                'wp-components',
    10211019                                                'wp-i18n',
    1022                                                 'wp-compose',
    1023                                                 'wp-data',
    10241020                                                'wp-api-fetch',
    10251021                                                'wp-url',
    10261022                                                'wp-block-editor',
    10271023                                                'bp-block-components',
     1024                                                'bp-block-data',
    10281025                                                'lodash',
    10291026                                        ),
    10301027                                        'style'              => 'bp-groups-block',
  • src/bp-groups/js/blocks/group.js

    diff --git src/bp-groups/js/blocks/group.js src/bp-groups/js/blocks/group.js
    index 2ab5dac6d..0e3c7aafe 100644
    var _wp = wp, 
    184184    ToggleControl = _wp$components.ToggleControl,
    185185    Toolbar = _wp$components.Toolbar,
    186186    ToolbarButton = _wp$components.ToolbarButton,
    187     compose = _wp.compose.compose,
    188     withSelect = _wp.data.withSelect,
    189     ServerSideRender = _wp.editor.ServerSideRender,
    190187    _wp$element = _wp.element,
    191188    Fragment = _wp$element.Fragment,
    192189    createElement = _wp$element.createElement,
    var _wp = wp, 
    195192 * BuddyPress dependencies.
    196193 */
    197194
    198 var AutoCompleter = bp.blockComponents.AutoCompleter;
     195var _bp = bp,
     196    _bp$blockComponents = _bp.blockComponents,
     197    AutoCompleter = _bp$blockComponents.AutoCompleter,
     198    ServerSideRender = _bp$blockComponents.ServerSideRender,
     199    isActive = _bp.blockData.isActive;
    199200/**
    200201 * Internal dependencies.
    201202 */
    var getSlugValue = function getSlugValue(item) { 
    208209  return null;
    209210};
    210211
    211 var editGroup = function editGroup(_ref) {
     212var editGroupBlock = function editGroupBlock(_ref) {
    212213  var attributes = _ref.attributes,
    213       setAttributes = _ref.setAttributes,
    214       bpSettings = _ref.bpSettings;
    215   var isAvatarEnabled = bpSettings.isAvatarEnabled,
    216       isCoverImageEnabled = bpSettings.isCoverImageEnabled;
     214      setAttributes = _ref.setAttributes;
     215  var isAvatarEnabled = isActive('groups', 'avatar');
     216  var isCoverImageEnabled = isActive('groups', 'cover');
    217217  var avatarSize = attributes.avatarSize,
    218218      displayDescription = attributes.displayDescription,
    219219      displayActionButton = attributes.displayActionButton,
    var editGroup = function editGroup(_ref) { 
    237237    }));
    238238  }
    239239
    240   return createElement(Fragment, null, createElement(BlockControls, null, createElement(Toolbar, null, createElement(ToolbarButton, {
     240  return createElement(Fragment, null, createElement(BlockControls, null, createElement(Toolbar, {
     241    label: __('Block toolbar', 'buddypress')
     242  }, createElement(ToolbarButton, {
    241243    icon: "edit",
    242244    title: __('Select another group', 'buddypress'),
    243245    onClick: function onClick() {
    var editGroup = function editGroup(_ref) { 
    291293  })));
    292294};
    293295
    294 var editGroupBlock = compose([withSelect(function (select) {
    295   var editorSettings = select('core/editor').getEditorSettings();
    296   return {
    297     bpSettings: editorSettings.bp.groups || {}
    298   };
    299 })])(editGroup);
    300296var _default = editGroupBlock;
    301297exports.default = _default;
    302298},{"./constants":"atl5"}],"pvse":[function(require,module,exports) {
    var _wp = wp, 
    319315registerBlockType('bp/group', {
    320316  title: __('Group', 'buddypress'),
    321317  description: __('BuddyPress Group.', 'buddypress'),
    322   icon: 'buddicons-groups',
     318  icon: {
     319    background: '#fff',
     320    foreground: '#d84800',
     321    src: 'buddicons-groups'
     322  },
    323323  category: 'buddypress',
    324324  attributes: {
    325325    itemID: {
  • src/bp-groups/js/blocks/groups.js

    diff --git src/bp-groups/js/blocks/groups.js src/bp-groups/js/blocks/groups.js
    index 6c119771c..30ac54b00 100644
    var _wp = wp, 
    326326    Tooltip = _wp$components.Tooltip,
    327327    ToolbarGroup = _wp$components.ToolbarGroup,
    328328    RangeControl = _wp$components.RangeControl,
    329     compose = _wp.compose.compose,
    330     withSelect = _wp.data.withSelect,
    331329    _wp$element = _wp.element,
    332330    createElement = _wp$element.createElement,
    333331    Fragment = _wp$element.Fragment,
    var _wp = wp, 
    342340 * BuddyPress dependencies.
    343341 */
    344342
    345 var AutoCompleter = bp.blockComponents.AutoCompleter;
     343var _bp = bp,
     344    AutoCompleter = _bp.blockComponents.AutoCompleter,
     345    isActive = _bp.blockData.isActive;
    346346/**
    347347 * Internal dependencies.
    348348 */
    var getSlugValue = function getSlugValue(item) { 
    363363  return null;
    364364};
    365365
    366 var editGroups = function editGroups(_ref) {
     366var editGroupsBlock = function editGroupsBlock(_ref) {
    367367  var attributes = _ref.attributes,
    368368      setAttributes = _ref.setAttributes,
    369       isSelected = _ref.isSelected,
    370       bpSettings = _ref.bpSettings;
    371   var isAvatarEnabled = bpSettings.isAvatarEnabled;
     369      isSelected = _ref.isSelected;
     370  var isAvatarEnabled = isActive('groups', 'avatar');
    372371  var itemIDs = attributes.itemIDs,
    373372      avatarSize = attributes.avatarSize,
    374373      displayGroupName = attributes.displayGroupName,
    var editGroups = function editGroups(_ref) { 
    565564  })));
    566565};
    567566
    568 var editGroupsBlock = compose([withSelect(function (select) {
    569   var editorSettings = select('core/editor').getEditorSettings();
    570   return {
    571     bpSettings: editorSettings.bp.groups || {}
    572   };
    573 })])(editGroups);
    574567var _default = editGroupsBlock;
    575568exports.default = _default;
    576569},{"@babel/runtime/helpers/toConsumableArray":"I9dH","@babel/runtime/helpers/slicedToArray":"xkYc","./constants":"jS06"}],"jcTh":[function(require,module,exports) {
    var _wp = wp, 
    593586registerBlockType('bp/groups', {
    594587  title: __('Groups', 'buddypress'),
    595588  description: __('BuddyPress Groups.', 'buddypress'),
    596   icon: 'buddicons-groups',
     589  icon: {
     590    background: '#fff',
     591    foreground: '#d84800',
     592    src: 'buddicons-groups'
     593  },
    597594  category: 'buddypress',
    598595  attributes: {
    599596    itemIDs: {
  • src/bp-members/bp-members-blocks.php

    diff --git src/bp-members/bp-members-blocks.php src/bp-members/bp-members-blocks.php
    index 11886548b..50b49bc55 100644
    if ( ! defined( 'ABSPATH' ) ) { 
    1212        exit;
    1313}
    1414
    15 /**
    16  * Add BP Members blocks specific settings to the BP Blocks Editor ones.
    17  *
    18  * @since 6.0.0
    19  *
    20  * @param array $bp_editor_settings BP blocks editor settings.
    21  * @return array BP Members blocks editor settings.
    22  */
    23 function bp_members_editor_settings( $bp_editor_settings = array() ) {
    24         $bp = buddypress();
    25 
    26         return array_merge(
    27                 $bp_editor_settings,
    28                 array(
    29                         'members' => array(
    30                                 'isMentionEnabled'    => bp_is_active( 'activity' ) && bp_activity_do_mentions(),
    31                                 'isAvatarEnabled'     => $bp->avatar && $bp->avatar->show_avatars,
    32                                 'isCoverImageEnabled' => bp_is_active( 'members', 'cover_image' ),
    33                         ),
    34                 )
    35         );
    36 }
    37 add_filter( 'bp_blocks_editor_settings', 'bp_members_editor_settings' );
    38 
    3915/**
    4016 * Callback function to render the BP Member Block.
    4117 *
    function bp_members_render_members_block( $attributes = array() ) { 
    260236                        $output .= sprintf(
    261237                                '<div class="item-header-avatar">
    262238                                        <a href="%1$s">
    263                                                 <img class="avatar" alt="%2$s" src="%3$s" />
     239                                                <img loading="lazy" class="avatar" alt="%2$s" src="%3$s" />
    264240                                        </a>
    265241                                </div>',
    266242                                esc_url( $member_link ),
  • 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 312a0ceca..280485e33 100644
    class BP_Members_Component extends BP_Component { 
    737737                                                'wp-element',
    738738                                                'wp-components',
    739739                                                'wp-i18n',
    740                                                 'wp-editor',
    741                                                 'wp-compose',
    742                                                 'wp-data',
    743740                                                'wp-block-editor',
    744741                                                'bp-block-components',
     742                                                'bp-block-data',
    745743                                        ),
    746744                                        'style'              => 'bp-member-block',
    747745                                        'style_url'          => plugins_url( 'css/blocks/member.css', dirname( __FILE__ ) ),
    class BP_Members_Component extends BP_Component { 
    778776                                                'wp-element',
    779777                                                'wp-components',
    780778                                                'wp-i18n',
    781                                                 'wp-compose',
    782                                                 'wp-data',
    783779                                                'wp-api-fetch',
    784780                                                'wp-url',
    785781                                                'wp-block-editor',
    786782                                                'bp-block-components',
     783                                                'bp-block-data',
    787784                                                'lodash',
    788785                                        ),
    789786                                        'style'              => 'bp-members-block',
  • src/bp-members/js/blocks/member.js

    diff --git src/bp-members/js/blocks/member.js src/bp-members/js/blocks/member.js
    index fa606072d..2e3648a9e 100644
    var _wp = wp, 
    172172    ToggleControl = _wp$components.ToggleControl,
    173173    Toolbar = _wp$components.Toolbar,
    174174    ToolbarButton = _wp$components.ToolbarButton,
    175     compose = _wp.compose.compose,
    176     withSelect = _wp.data.withSelect,
    177     ServerSideRender = _wp.editor.ServerSideRender,
    178175    _wp$element = _wp.element,
    179176    Fragment = _wp$element.Fragment,
    180177    createElement = _wp$element.createElement,
    var _wp = wp, 
    183180 * BuddyPress dependencies.
    184181 */
    185182
    186 var AutoCompleter = bp.blockComponents.AutoCompleter;
     183var _bp = bp,
     184    _bp$blockComponents = _bp.blockComponents,
     185    AutoCompleter = _bp$blockComponents.AutoCompleter,
     186    ServerSideRender = _bp$blockComponents.ServerSideRender,
     187    isActive = _bp.blockData.isActive;
    187188/**
    188189 * Internal dependencies.
    189190 */
    var getSlugValue = function getSlugValue(item) { 
    196197  return null;
    197198};
    198199
    199 var editMember = function editMember(_ref) {
     200var editMemberBlock = function editMemberBlock(_ref) {
    200201  var attributes = _ref.attributes,
    201       setAttributes = _ref.setAttributes,
    202       bpSettings = _ref.bpSettings;
    203   var isAvatarEnabled = bpSettings.isAvatarEnabled,
    204       isMentionEnabled = bpSettings.isMentionEnabled,
    205       isCoverImageEnabled = bpSettings.isCoverImageEnabled;
     202      setAttributes = _ref.setAttributes;
     203  var isAvatarEnabled = isActive('members', 'avatar');
     204  var isMentionEnabled = isActive('activity', 'mentions');
     205  var isCoverImageEnabled = isActive('members', 'cover');
    206206  var avatarSize = attributes.avatarSize,
    207207      displayMentionSlug = attributes.displayMentionSlug,
    208208      displayActionButton = attributes.displayActionButton,
    var editMember = function editMember(_ref) { 
    223223    }));
    224224  }
    225225
    226   return createElement(Fragment, null, createElement(BlockControls, null, createElement(Toolbar, null, createElement(ToolbarButton, {
     226  return createElement(Fragment, null, createElement(BlockControls, null, createElement(Toolbar, {
     227    label: __('Block toolbar', 'buddypress')
     228  }, createElement(ToolbarButton, {
    227229    icon: "edit",
    228230    title: __('Select another member', 'buddypress'),
    229231    onClick: function onClick() {
    var editMember = function editMember(_ref) { 
    277279  })));
    278280};
    279281
    280 var editMemberBlock = compose([withSelect(function (select) {
    281   var editorSettings = select('core/editor').getEditorSettings();
    282   return {
    283     bpSettings: editorSettings.bp.members || {}
    284   };
    285 })])(editMember);
    286282var _default = editMemberBlock;
    287283exports.default = _default;
    288284},{"./constants":"AE3e"}],"TmUL":[function(require,module,exports) {
    var _wp = wp, 
    305301registerBlockType('bp/member', {
    306302  title: __('Member', 'buddypress'),
    307303  description: __('BuddyPress Member.', 'buddypress'),
    308   icon: 'admin-users',
     304  icon: {
     305    background: '#fff',
     306    foreground: '#d84800',
     307    src: 'admin-users'
     308  },
    309309  category: 'buddypress',
    310310  attributes: {
    311311    itemID: {
  • src/bp-members/js/blocks/members.js

    diff --git src/bp-members/js/blocks/members.js src/bp-members/js/blocks/members.js
    index 51995673a..61f8c6b9e 100644
    var _wp = wp, 
    311311    Tooltip = _wp$components.Tooltip,
    312312    ToolbarGroup = _wp$components.ToolbarGroup,
    313313    RangeControl = _wp$components.RangeControl,
    314     compose = _wp.compose.compose,
    315     withSelect = _wp.data.withSelect,
    316314    _wp$element = _wp.element,
    317315    createElement = _wp$element.createElement,
    318316    Fragment = _wp$element.Fragment,
    var _wp = wp, 
    326324 * BuddyPress dependencies.
    327325 */
    328326
    329 var AutoCompleter = bp.blockComponents.AutoCompleter;
     327var _bp = bp,
     328    AutoCompleter = _bp.blockComponents.AutoCompleter,
     329    isActive = _bp.blockData.isActive;
    330330/**
    331331 * Internal dependencies.
    332332 */
    var getSlugValue = function getSlugValue(item) { 
    347347  return null;
    348348};
    349349
    350 var editMembers = function editMembers(_ref) {
     350var editMembersBlock = function editMembersBlock(_ref) {
    351351  var attributes = _ref.attributes,
    352352      setAttributes = _ref.setAttributes,
    353       isSelected = _ref.isSelected,
    354       bpSettings = _ref.bpSettings;
    355   var isAvatarEnabled = bpSettings.isAvatarEnabled,
    356       isMentionEnabled = bpSettings.isMentionEnabled;
     353      isSelected = _ref.isSelected;
     354  var isAvatarEnabled = isActive('members', 'avatar');
     355  var isMentionEnabled = isActive('activity', 'mentions');
    357356  var itemIDs = attributes.itemIDs,
    358357      avatarSize = attributes.avatarSize,
    359358      displayMentionSlug = attributes.displayMentionSlug,
    var editMembers = function editMembers(_ref) { 
    561560  })));
    562561};
    563562
    564 var editMembersBlock = compose([withSelect(function (select) {
    565   var editorSettings = select('core/editor').getEditorSettings();
    566   return {
    567     bpSettings: editorSettings.bp.members || {}
    568   };
    569 })])(editMembers);
    570563var _default = editMembersBlock;
    571564exports.default = _default;
    572565},{"@babel/runtime/helpers/toConsumableArray":"I9dH","@babel/runtime/helpers/slicedToArray":"xkYc","./constants":"gr8I"}],"XEHU":[function(require,module,exports) {
    var _wp = wp, 
    589582registerBlockType('bp/members', {
    590583  title: __('Members', 'buddypress'),
    591584  description: __('BuddyPress Members.', 'buddypress'),
    592   icon: 'groups',
     585  icon: {
     586    background: '#fff',
     587    foreground: '#d84800',
     588    src: 'groups'
     589  },
    593590  category: 'buddypress',
    594591  attributes: {
    595592    itemIDs: {
  • src/js/bp-activity/js/blocks/embed-activity.js

    diff --git src/js/bp-activity/js/blocks/embed-activity.js src/js/bp-activity/js/blocks/embed-activity.js
    index 22a57eeaa..c690550e7 100644
    import saveEmbedActivityBlock from './embed-activity/save'; 
    1919registerBlockType( 'bp/embed-activity', {
    2020        title: __( 'Embed an activity', 'buddypress' ),
    2121        description: __( 'Add a block that displays the activity content pulled from this or other community sites.', 'buddypress' ),
    22         icon: 'buddicons-activity',
     22        icon: {
     23                background: '#fff',
     24                foreground: '#d84800',
     25                src: 'buddicons-activity',
     26        },
    2327        category: 'buddypress',
    2428        attributes: {
    2529                url: {
  • src/js/bp-activity/js/blocks/embed-activity/edit.js

    diff --git src/js/bp-activity/js/blocks/embed-activity/edit.js src/js/bp-activity/js/blocks/embed-activity/edit.js
    index 50c225b61..125fac0b9 100644
    const { 
    3232        }
    3333} = wp;
    3434
     35/**
     36 * BuddyPress dependencies.
     37 */
     38 const {
     39        blockData: {
     40                embedScriptURL,
     41        }
     42} = bp;
     43
    3544const EditEmbedActivity = ( {
    3645        attributes,
    3746        setAttributes,
    3847        isSelected,
    39         bpSettings,
    4048        preview,
    4149        fetching
    4250} ) => {
    4351        const { url, caption } = attributes;
    44         const { embedScriptURL } = bpSettings;
    4552        const label = __( 'BuddyPress Activity URL', 'buddypress' );
    4653        const [ value, setURL ] = useState( url );
    4754        const [ isEditingURL, setIsEditingURL ] = useState( ! url );
    const EditEmbedActivity = ( { 
    163170const editEmbedActivityBlock = compose( [
    164171        withSelect( ( select, ownProps ) => {
    165172                const { url } = ownProps.attributes;
    166                 const editorSettings = select( 'core/editor' ).getEditorSettings();
    167173                const {
    168174                        getEmbedPreview,
    169175                        isRequestingEmbedPreview,
    const editEmbedActivityBlock = compose( [ 
    173179                const fetching = !! url && isRequestingEmbedPreview( url );
    174180
    175181                return {
    176                         bpSettings: editorSettings.bp.activity || {},
    177182                        preview: preview,
    178183                        fetching: fetching,
    179184                };
  • src/js/bp-activity/js/blocks/embed-activity/save.js

    diff --git src/js/bp-activity/js/blocks/embed-activity/save.js src/js/bp-activity/js/blocks/embed-activity/save.js
    index 2b4c59e14..cf7ae8317 100644
    const saveEmbedActivityBlock = ( { attributes } ) => { 
    1818        }
    1919
    2020        return (
    21                 <figure className="wp-block-embed is-type-bp-activity">
    22                         <div className="wp-block-embed__wrapper">
    23                         {
    24                                 `\n${ url }\n` /* URL needs to be on its own line. */
    25                         }
    26                         </div>
    27                         { ! RichText.isEmpty( caption ) && (
    28                                 <RichText.Content
    29                                         tagName="figcaption"
    30                                         value={ caption }
    31                                 />
    32                         ) }
    33                 </figure>
     21        <figure className="wp-block-embed is-type-bp-activity">
     22                <div className="wp-block-embed__wrapper">
     23                {
     24                        `\n${ url }\n` /* URL needs to be on its own line. */
     25                }
     26                </div>
     27                { ! RichText.isEmpty( caption ) && (
     28                        <RichText.Content
     29                                tagName="figcaption"
     30                                value={ caption }
     31                        />
     32                ) }
     33        </figure>
    3434        );
    3535};
    3636
  • src/js/bp-groups/js/blocks/group.js

    diff --git src/js/bp-groups/js/blocks/group.js src/js/bp-groups/js/blocks/group.js
    index f8cb17edb..c6e0c1404 100644
    import editGroupBlock from './group/edit'; 
    1818registerBlockType( 'bp/group', {
    1919        title: __( 'Group', 'buddypress' ),
    2020        description: __( 'BuddyPress Group.', 'buddypress' ),
    21         icon: 'buddicons-groups',
     21        icon: {
     22                background: '#fff',
     23                foreground: '#d84800',
     24                src: 'buddicons-groups',
     25        },
    2226        category: 'buddypress',
    2327        attributes: {
    2428                itemID: {
  • 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 8418fb488..0f44b18b2 100644
    const { 
    1515                Toolbar,
    1616                ToolbarButton,
    1717        },
    18         compose: {
    19                 compose,
    20         },
    21         data: {
    22                 withSelect,
    23         },
    24         editor: {
    25                 ServerSideRender,
    26         },
    2718        element: {
    2819                Fragment,
    2920                createElement,
    const { 
    3627/**
    3728 * BuddyPress dependencies.
    3829 */
    39 const { AutoCompleter } = bp.blockComponents;
     30const {
     31        blockComponents: {
     32                AutoCompleter,
     33                ServerSideRender,
     34        },
     35        blockData: {
     36                isActive,
     37        }
     38} = bp;
    4039
    4140/**
    4241 * Internal dependencies.
    const getSlugValue = ( item ) => { 
    5150        return null;
    5251}
    5352
    54 const editGroup = ( { attributes, setAttributes, bpSettings } ) => {
    55         const { isAvatarEnabled, isCoverImageEnabled } = bpSettings;
     53const editGroupBlock = ( { attributes, setAttributes } ) => {
     54        const isAvatarEnabled = isActive( 'groups', 'avatar' );
     55        const isCoverImageEnabled = isActive( 'groups', 'cover' );
    5656        const { avatarSize, displayDescription, displayActionButton, displayCoverImage } = attributes;
    5757
    5858        if ( ! attributes.itemID ) {
    const editGroup = ( { attributes, setAttributes, bpSettings } ) => { 
    7878        return (
    7979                <Fragment>
    8080                        <BlockControls>
    81                                 <Toolbar>
     81                                <Toolbar label={ __( 'Block toolbar', 'buddypress' ) }>
    8282                                        <ToolbarButton
    8383                                                icon="edit"
    8484                                                title={ __( 'Select another group', 'buddypress' ) }
    const editGroup = ( { attributes, setAttributes, bpSettings } ) => { 
    151151        );
    152152};
    153153
    154 const editGroupBlock = compose( [
    155         withSelect( ( select ) => {
    156                 const editorSettings = select( 'core/editor' ).getEditorSettings();
    157                 return {
    158                         bpSettings: editorSettings.bp.groups || {},
    159                 };
    160         } ),
    161 ] )( editGroup );
    162 
    163154export default editGroupBlock;
  • src/js/bp-groups/js/blocks/groups.js

    diff --git src/js/bp-groups/js/blocks/groups.js src/js/bp-groups/js/blocks/groups.js
    index 78008d746..9102e5daa 100644
    import editGroupsBlock from './groups/edit'; 
    1818registerBlockType( 'bp/groups', {
    1919        title: __( 'Groups', 'buddypress' ),
    2020        description: __( 'BuddyPress Groups.', 'buddypress' ),
    21         icon: 'buddicons-groups',
     21        icon: {
     22                background: '#fff',
     23                foreground: '#d84800',
     24                src: 'buddicons-groups',
     25        },
    2226        category: 'buddypress',
    2327        attributes: {
    2428                itemIDs: {
  • src/js/bp-groups/js/blocks/groups/edit.js

    diff --git src/js/bp-groups/js/blocks/groups/edit.js src/js/bp-groups/js/blocks/groups/edit.js
    index 3a32fbd48..27abf0351 100644
    const { 
    1717                ToolbarGroup,
    1818                RangeControl,
    1919        },
    20         compose: {
    21                 compose,
    22         },
    23         data: {
    24                 withSelect,
    25         },
    2620        element: {
    2721                createElement,
    2822                Fragment,
    const { 
    4236/**
    4337 * BuddyPress dependencies.
    4438 */
    45 const { AutoCompleter } = bp.blockComponents;
     39const {
     40        blockComponents: {
     41                AutoCompleter,
     42        },
     43        blockData: {
     44                isActive,
     45        }
     46} = bp;
    4647
    4748/**
    4849 * Internal dependencies.
    const getSlugValue = ( item ) => { 
    6667        return null;
    6768}
    6869
    69 const editGroups = ( { attributes, setAttributes, isSelected, bpSettings } ) => {
    70         const {
    71                 isAvatarEnabled,
    72         } = bpSettings;
     70const editGroupsBlock = ( { attributes, setAttributes, isSelected } ) => {
     71        const isAvatarEnabled = isActive( 'groups', 'avatar' );
    7372        const {
    7473                itemIDs,
    7574                avatarSize,
    const editGroups = ( { attributes, setAttributes, isSelected, bpSettings } ) => 
    294293        );
    295294};
    296295
    297 const editGroupsBlock = compose( [
    298         withSelect( ( select ) => {
    299                 const editorSettings = select( 'core/editor' ).getEditorSettings();
    300 
    301                 return {
    302                         bpSettings: editorSettings.bp.groups || {},
    303                 };
    304         } ),
    305 ] )( editGroups );
    306 
    307296export default editGroupsBlock;
  • src/js/bp-members/js/blocks/member.js

    diff --git src/js/bp-members/js/blocks/member.js src/js/bp-members/js/blocks/member.js
    index 744066afe..f762e956e 100644
    import editMemberBlock from './member/edit'; 
    1818registerBlockType( 'bp/member', {
    1919        title: __( 'Member', 'buddypress' ),
    2020        description: __( 'BuddyPress Member.', 'buddypress' ),
    21         icon: 'admin-users',
     21        icon: {
     22                background: '#fff',
     23                foreground: '#d84800',
     24                src: 'admin-users',
     25        },
    2226        category: 'buddypress',
    2327        attributes: {
    2428                itemID: {
  • 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 fd92ae979..fbafdb359 100644
    const { 
    1515                Toolbar,
    1616                ToolbarButton,
    1717        },
    18         compose: {
    19                 compose,
    20         },
    21         data: {
    22                 withSelect,
    23         },
    24         editor: {
    25                 ServerSideRender,
    26         },
    2718        element: {
    2819                Fragment,
    2920                createElement,
    const { 
    3627/**
    3728 * BuddyPress dependencies.
    3829 */
    39 const { AutoCompleter } = bp.blockComponents;
     30const {
     31        blockComponents: {
     32                AutoCompleter,
     33                ServerSideRender,
     34        },
     35        blockData: {
     36                isActive,
     37        }
     38} = bp;
    4039
    4140/**
    4241 * Internal dependencies.
    const getSlugValue = ( item ) => { 
    5150        return null;
    5251}
    5352
    54 const editMember = ( { attributes, setAttributes, bpSettings } ) => {
    55         const { isAvatarEnabled, isMentionEnabled, isCoverImageEnabled } = bpSettings;
     53const editMemberBlock = ( { attributes, setAttributes } ) => {
     54        const isAvatarEnabled = isActive( 'members', 'avatar' );
     55        const isMentionEnabled = isActive( 'activity', 'mentions' );
     56        const isCoverImageEnabled = isActive( 'members', 'cover' );
    5657        const { avatarSize, displayMentionSlug, displayActionButton, displayCoverImage } = attributes;
    5758
    5859        if ( ! attributes.itemID ) {
    const editMember = ( { attributes, setAttributes, bpSettings } ) => { 
    7778        return (
    7879                <Fragment>
    7980                        <BlockControls>
    80                                 <Toolbar>
     81                                <Toolbar label={ __( 'Block toolbar', 'buddypress' ) }>
    8182                                        <ToolbarButton
    8283                                                icon="edit"
    8384                                                title={ __( 'Select another member', 'buddypress' ) }
    const editMember = ( { attributes, setAttributes, bpSettings } ) => { 
    152153        );
    153154};
    154155
    155 const editMemberBlock = compose( [
    156         withSelect( ( select ) => {
    157                 const editorSettings = select( 'core/editor' ).getEditorSettings();
    158                 return {
    159                         bpSettings: editorSettings.bp.members || {},
    160                 };
    161         } ),
    162 ] )( editMember );
    163 
    164156export default editMemberBlock;
  • src/js/bp-members/js/blocks/members.js

    diff --git src/js/bp-members/js/blocks/members.js src/js/bp-members/js/blocks/members.js
    index 09461b043..5c1a21db5 100644
    import editMembersBlock from './members/edit'; 
    1818registerBlockType( 'bp/members', {
    1919        title: __( 'Members', 'buddypress' ),
    2020        description: __( 'BuddyPress Members.', 'buddypress' ),
    21         icon: 'groups',
     21        icon: {
     22                background: '#fff',
     23                foreground: '#d84800',
     24                src: 'groups',
     25        },
    2226        category: 'buddypress',
    2327        attributes: {
    2428                itemIDs: {
  • src/js/bp-members/js/blocks/members/edit.js

    diff --git src/js/bp-members/js/blocks/members/edit.js src/js/bp-members/js/blocks/members/edit.js
    index ee48cd6d1..329d9f62b 100644
    const { 
    1717                ToolbarGroup,
    1818                RangeControl,
    1919        },
    20         compose: {
    21                 compose,
    22         },
    23         data: {
    24                 withSelect,
    25         },
    2620        element: {
    2721                createElement,
    2822                Fragment,
    const { 
    4135/**
    4236 * BuddyPress dependencies.
    4337 */
    44 const { AutoCompleter } = bp.blockComponents;
     38const {
     39        blockComponents: {
     40                AutoCompleter,
     41        },
     42        blockData: {
     43                isActive,
     44        }
     45} = bp;
    4546
    4647/**
    4748 * Internal dependencies.
    const getSlugValue = ( item ) => { 
    6566        return null;
    6667}
    6768
    68 const editMembers = ( { attributes, setAttributes, isSelected, bpSettings } ) => {
    69         const {
    70                 isAvatarEnabled,
    71                 isMentionEnabled,
    72         } = bpSettings;
     69const editMembersBlock = ( { attributes, setAttributes, isSelected } ) => {
     70        const isAvatarEnabled = isActive( 'members', 'avatar' );
     71        const isMentionEnabled = isActive( 'activity', 'mentions' );
    7372        const {
    7473                itemIDs,
    7574                avatarSize,
    const editMembers = ( { attributes, setAttributes, isSelected, bpSettings } ) => 
    313312        );
    314313};
    315314
    316 const editMembersBlock = compose( [
    317         withSelect( ( select ) => {
    318                 const editorSettings = select( 'core/editor' ).getEditorSettings();
    319 
    320                 return {
    321                         bpSettings: editorSettings.bp.members || {},
    322                 };
    323         } ),
    324 ] )( editMembers );
    325 
    326315export default editMembersBlock;