Changeset 12996
- Timestamp:
- 07/12/2021 11:57:59 PM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-blocks.php
r12747 r12996 12 12 exit; 13 13 } 14 15 /**16 * Add BP Activity blocks specific settings to the BP Blocks Editor ones.17 *18 * @since 7.0.019 *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' ); -
trunk/src/bp-activity/classes/class-bp-activity-component.php
r12747 r12996 498 498 'wp-data', 499 499 'wp-compose', 500 'bp-block-data', 500 501 ), 501 502 ), -
trunk/src/bp-activity/js/blocks/embed-activity.js
r12790 r12996 233 233 RichText = _wp$blockEditor.RichText, 234 234 BlockControls = _wp$blockEditor.BlockControls; 235 /** 236 * BuddyPress dependencies. 237 */ 238 239 var _bp = bp, 240 embedScriptURL = _bp.blockData.embedScriptURL; 235 241 236 242 var EditEmbedActivity = function EditEmbedActivity(_ref) { … … 238 244 setAttributes = _ref.setAttributes, 239 245 isSelected = _ref.isSelected, 240 bpSettings = _ref.bpSettings,241 246 preview = _ref.preview, 242 247 fetching = _ref.fetching; 243 248 var url = attributes.url, 244 249 caption = attributes.caption; 245 var embedScriptURL = bpSettings.embedScriptURL;246 250 247 251 var label = __('BuddyPress Activity URL', 'buddypress'); … … 346 350 var editEmbedActivityBlock = compose([withSelect(function (select, ownProps) { 347 351 var url = ownProps.attributes.url; 348 var editorSettings = select('core/editor').getEditorSettings();349 352 350 353 var _select = select('core'), … … 355 358 var fetching = !!url && isRequestingEmbedPreview(url); 356 359 return { 357 bpSettings: editorSettings.bp.activity || {},358 360 preview: preview, 359 361 fetching: fetching … … 422 424 title: __('Embed an activity', 'buddypress'), 423 425 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 }, 425 431 category: 'buddypress', 426 432 attributes: { -
trunk/src/bp-groups/bp-groups-blocks.php
r12791 r12996 12 12 exit; 13 13 } 14 15 /**16 * Add BP Groups blocks specific settings to the BP Blocks Editor ones.17 *18 * @since 6.0.019 *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 14 38 15 /** … … 265 242 '<div class="item-header-avatar"> 266 243 <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"> 268 245 </a> 269 246 </div>', 270 247 esc_url( $group_link ), 271 248 /* 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 ) ), 273 250 esc_url( 274 251 bp_core_fetch_avatar( -
trunk/src/bp-groups/classes/class-bp-groups-component.php
r12893 r12996 979 979 'wp-components', 980 980 'wp-i18n', 981 'wp-editor',982 'wp-compose',983 'wp-data',984 981 'wp-block-editor', 985 982 'bp-block-components', 983 'bp-block-data', 986 984 ), 987 985 'style' => 'bp-group-block', … … 1020 1018 'wp-components', 1021 1019 'wp-i18n', 1022 'wp-compose',1023 'wp-data',1024 1020 'wp-api-fetch', 1025 1021 'wp-url', 1026 1022 'wp-block-editor', 1027 1023 'bp-block-components', 1024 'bp-block-data', 1028 1025 'lodash', 1029 1026 ), -
trunk/src/bp-groups/js/blocks/group.js
r12746 r12996 185 185 Toolbar = _wp$components.Toolbar, 186 186 ToolbarButton = _wp$components.ToolbarButton, 187 compose = _wp.compose.compose,188 withSelect = _wp.data.withSelect,189 ServerSideRender = _wp.editor.ServerSideRender,190 187 _wp$element = _wp.element, 191 188 Fragment = _wp$element.Fragment, … … 196 193 */ 197 194 198 var AutoCompleter = bp.blockComponents.AutoCompleter; 195 var _bp = bp, 196 _bp$blockComponents = _bp.blockComponents, 197 AutoCompleter = _bp$blockComponents.AutoCompleter, 198 ServerSideRender = _bp$blockComponents.ServerSideRender, 199 isActive = _bp.blockData.isActive; 199 200 /** 200 201 * Internal dependencies. … … 209 210 }; 210 211 211 var editGroup = function editGroup(_ref) {212 var editGroupBlock = function editGroupBlock(_ref) { 212 213 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'); 217 217 var avatarSize = attributes.avatarSize, 218 218 displayDescription = attributes.displayDescription, … … 238 238 } 239 239 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, { 241 243 icon: "edit", 242 244 title: __('Select another group', 'buddypress'), … … 292 294 }; 293 295 294 var editGroupBlock = compose([withSelect(function (select) {295 var editorSettings = select('core/editor').getEditorSettings();296 return {297 bpSettings: editorSettings.bp.groups || {}298 };299 })])(editGroup);300 296 var _default = editGroupBlock; 301 297 exports.default = _default; … … 320 316 title: __('Group', 'buddypress'), 321 317 description: __('BuddyPress Group.', 'buddypress'), 322 icon: 'buddicons-groups', 318 icon: { 319 background: '#fff', 320 foreground: '#d84800', 321 src: 'buddicons-groups' 322 }, 323 323 category: 'buddypress', 324 324 attributes: { -
trunk/src/bp-groups/js/blocks/groups.js
r12749 r12996 327 327 ToolbarGroup = _wp$components.ToolbarGroup, 328 328 RangeControl = _wp$components.RangeControl, 329 compose = _wp.compose.compose,330 withSelect = _wp.data.withSelect,331 329 _wp$element = _wp.element, 332 330 createElement = _wp$element.createElement, … … 343 341 */ 344 342 345 var AutoCompleter = bp.blockComponents.AutoCompleter; 343 var _bp = bp, 344 AutoCompleter = _bp.blockComponents.AutoCompleter, 345 isActive = _bp.blockData.isActive; 346 346 /** 347 347 * Internal dependencies. … … 364 364 }; 365 365 366 var editGroups = function editGroups(_ref) {366 var editGroupsBlock = function editGroupsBlock(_ref) { 367 367 var attributes = _ref.attributes, 368 368 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'); 372 371 var itemIDs = attributes.itemIDs, 373 372 avatarSize = attributes.avatarSize, … … 566 565 }; 567 566 568 var editGroupsBlock = compose([withSelect(function (select) {569 var editorSettings = select('core/editor').getEditorSettings();570 return {571 bpSettings: editorSettings.bp.groups || {}572 };573 })])(editGroups);574 567 var _default = editGroupsBlock; 575 568 exports.default = _default; … … 594 587 title: __('Groups', 'buddypress'), 595 588 description: __('BuddyPress Groups.', 'buddypress'), 596 icon: 'buddicons-groups', 589 icon: { 590 background: '#fff', 591 foreground: '#d84800', 592 src: 'buddicons-groups' 593 }, 597 594 category: 'buddypress', 598 595 attributes: { -
trunk/src/bp-members/bp-members-blocks.php
r12791 r12996 12 12 exit; 13 13 } 14 15 /**16 * Add BP Members blocks specific settings to the BP Blocks Editor ones.17 *18 * @since 6.0.019 *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 14 39 15 /** … … 261 237 '<div class="item-header-avatar"> 262 238 <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" /> 264 240 </a> 265 241 </div>', -
trunk/src/bp-members/classes/class-bp-members-component.php
r12994 r12996 738 738 'wp-components', 739 739 'wp-i18n', 740 'wp-editor',741 'wp-compose',742 'wp-data',743 740 'wp-block-editor', 744 741 'bp-block-components', 742 'bp-block-data', 745 743 ), 746 744 'style' => 'bp-member-block', … … 779 777 'wp-components', 780 778 'wp-i18n', 781 'wp-compose',782 'wp-data',783 779 'wp-api-fetch', 784 780 'wp-url', 785 781 'wp-block-editor', 786 782 'bp-block-components', 783 'bp-block-data', 787 784 'lodash', 788 785 ), -
trunk/src/bp-members/js/blocks/member.js
r12746 r12996 173 173 Toolbar = _wp$components.Toolbar, 174 174 ToolbarButton = _wp$components.ToolbarButton, 175 compose = _wp.compose.compose,176 withSelect = _wp.data.withSelect,177 ServerSideRender = _wp.editor.ServerSideRender,178 175 _wp$element = _wp.element, 179 176 Fragment = _wp$element.Fragment, … … 184 181 */ 185 182 186 var AutoCompleter = bp.blockComponents.AutoCompleter; 183 var _bp = bp, 184 _bp$blockComponents = _bp.blockComponents, 185 AutoCompleter = _bp$blockComponents.AutoCompleter, 186 ServerSideRender = _bp$blockComponents.ServerSideRender, 187 isActive = _bp.blockData.isActive; 187 188 /** 188 189 * Internal dependencies. … … 197 198 }; 198 199 199 var editMember = function editMember(_ref) {200 var editMemberBlock = function editMemberBlock(_ref) { 200 201 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'); 206 206 var avatarSize = attributes.avatarSize, 207 207 displayMentionSlug = attributes.displayMentionSlug, … … 224 224 } 225 225 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, { 227 229 icon: "edit", 228 230 title: __('Select another member', 'buddypress'), … … 278 280 }; 279 281 280 var editMemberBlock = compose([withSelect(function (select) {281 var editorSettings = select('core/editor').getEditorSettings();282 return {283 bpSettings: editorSettings.bp.members || {}284 };285 })])(editMember);286 282 var _default = editMemberBlock; 287 283 exports.default = _default; … … 306 302 title: __('Member', 'buddypress'), 307 303 description: __('BuddyPress Member.', 'buddypress'), 308 icon: 'admin-users', 304 icon: { 305 background: '#fff', 306 foreground: '#d84800', 307 src: 'admin-users' 308 }, 309 309 category: 'buddypress', 310 310 attributes: { -
trunk/src/bp-members/js/blocks/members.js
r12748 r12996 312 312 ToolbarGroup = _wp$components.ToolbarGroup, 313 313 RangeControl = _wp$components.RangeControl, 314 compose = _wp.compose.compose,315 withSelect = _wp.data.withSelect,316 314 _wp$element = _wp.element, 317 315 createElement = _wp$element.createElement, … … 327 325 */ 328 326 329 var AutoCompleter = bp.blockComponents.AutoCompleter; 327 var _bp = bp, 328 AutoCompleter = _bp.blockComponents.AutoCompleter, 329 isActive = _bp.blockData.isActive; 330 330 /** 331 331 * Internal dependencies. … … 348 348 }; 349 349 350 var editMembers = function editMembers(_ref) {350 var editMembersBlock = function editMembersBlock(_ref) { 351 351 var attributes = _ref.attributes, 352 352 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'); 357 356 var itemIDs = attributes.itemIDs, 358 357 avatarSize = attributes.avatarSize, … … 562 561 }; 563 562 564 var editMembersBlock = compose([withSelect(function (select) {565 var editorSettings = select('core/editor').getEditorSettings();566 return {567 bpSettings: editorSettings.bp.members || {}568 };569 })])(editMembers);570 563 var _default = editMembersBlock; 571 564 exports.default = _default; … … 590 583 title: __('Members', 'buddypress'), 591 584 description: __('BuddyPress Members.', 'buddypress'), 592 icon: 'groups', 585 icon: { 586 background: '#fff', 587 foreground: '#d84800', 588 src: 'groups' 589 }, 593 590 category: 'buddypress', 594 591 attributes: { -
trunk/src/js/bp-activity/js/blocks/embed-activity.js
r12747 r12996 20 20 title: __( 'Embed an activity', 'buddypress' ), 21 21 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 }, 23 27 category: 'buddypress', 24 28 attributes: { -
trunk/src/js/bp-activity/js/blocks/embed-activity/edit.js
r12790 r12996 33 33 } = wp; 34 34 35 /** 36 * BuddyPress dependencies. 37 */ 38 const { 39 blockData: { 40 embedScriptURL, 41 } 42 } = bp; 43 35 44 const EditEmbedActivity = ( { 36 45 attributes, 37 46 setAttributes, 38 47 isSelected, 39 bpSettings,40 48 preview, 41 49 fetching 42 50 } ) => { 43 51 const { url, caption } = attributes; 44 const { embedScriptURL } = bpSettings;45 52 const label = __( 'BuddyPress Activity URL', 'buddypress' ); 46 53 const [ value, setURL ] = useState( url ); … … 164 171 withSelect( ( select, ownProps ) => { 165 172 const { url } = ownProps.attributes; 166 const editorSettings = select( 'core/editor' ).getEditorSettings();167 173 const { 168 174 getEmbedPreview, … … 174 180 175 181 return { 176 bpSettings: editorSettings.bp.activity || {},177 182 preview: preview, 178 183 fetching: fetching, -
trunk/src/js/bp-activity/js/blocks/embed-activity/save.js
r12747 r12996 19 19 20 20 return ( 21 22 23 24 25 26 27 28 29 30 31 32 33 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> 34 34 ); 35 35 }; -
trunk/src/js/bp-groups/js/blocks/group.js
r12746 r12996 19 19 title: __( 'Group', 'buddypress' ), 20 20 description: __( 'BuddyPress Group.', 'buddypress' ), 21 icon: 'buddicons-groups', 21 icon: { 22 background: '#fff', 23 foreground: '#d84800', 24 src: 'buddicons-groups', 25 }, 22 26 category: 'buddypress', 23 27 attributes: { -
trunk/src/js/bp-groups/js/blocks/group/edit.js
r12746 r12996 16 16 ToolbarButton, 17 17 }, 18 compose: {19 compose,20 },21 data: {22 withSelect,23 },24 editor: {25 ServerSideRender,26 },27 18 element: { 28 19 Fragment, … … 37 28 * BuddyPress dependencies. 38 29 */ 39 const { AutoCompleter } = bp.blockComponents; 30 const { 31 blockComponents: { 32 AutoCompleter, 33 ServerSideRender, 34 }, 35 blockData: { 36 isActive, 37 } 38 } = bp; 40 39 41 40 /** … … 52 51 } 53 52 54 const editGroup = ( { attributes, setAttributes, bpSettings } ) => { 55 const { isAvatarEnabled, isCoverImageEnabled } = bpSettings; 53 const editGroupBlock = ( { attributes, setAttributes } ) => { 54 const isAvatarEnabled = isActive( 'groups', 'avatar' ); 55 const isCoverImageEnabled = isActive( 'groups', 'cover' ); 56 56 const { avatarSize, displayDescription, displayActionButton, displayCoverImage } = attributes; 57 57 … … 79 79 <Fragment> 80 80 <BlockControls> 81 <Toolbar >81 <Toolbar label={ __( 'Block toolbar', 'buddypress' ) }> 82 82 <ToolbarButton 83 83 icon="edit" … … 152 152 }; 153 153 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 163 154 export default editGroupBlock; -
trunk/src/js/bp-groups/js/blocks/groups.js
r12749 r12996 19 19 title: __( 'Groups', 'buddypress' ), 20 20 description: __( 'BuddyPress Groups.', 'buddypress' ), 21 icon: 'buddicons-groups', 21 icon: { 22 background: '#fff', 23 foreground: '#d84800', 24 src: 'buddicons-groups', 25 }, 22 26 category: 'buddypress', 23 27 attributes: { -
trunk/src/js/bp-groups/js/blocks/groups/edit.js
r12749 r12996 18 18 RangeControl, 19 19 }, 20 compose: {21 compose,22 },23 data: {24 withSelect,25 },26 20 element: { 27 21 createElement, … … 43 37 * BuddyPress dependencies. 44 38 */ 45 const { AutoCompleter } = bp.blockComponents; 39 const { 40 blockComponents: { 41 AutoCompleter, 42 }, 43 blockData: { 44 isActive, 45 } 46 } = bp; 46 47 47 48 /** … … 67 68 } 68 69 69 const editGroups = ( { attributes, setAttributes, isSelected, bpSettings } ) => { 70 const { 71 isAvatarEnabled, 72 } = bpSettings; 70 const editGroupsBlock = ( { attributes, setAttributes, isSelected } ) => { 71 const isAvatarEnabled = isActive( 'groups', 'avatar' ); 73 72 const { 74 73 itemIDs, … … 295 294 }; 296 295 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 307 296 export default editGroupsBlock; -
trunk/src/js/bp-members/js/blocks/member.js
r12746 r12996 19 19 title: __( 'Member', 'buddypress' ), 20 20 description: __( 'BuddyPress Member.', 'buddypress' ), 21 icon: 'admin-users', 21 icon: { 22 background: '#fff', 23 foreground: '#d84800', 24 src: 'admin-users', 25 }, 22 26 category: 'buddypress', 23 27 attributes: { -
trunk/src/js/bp-members/js/blocks/member/edit.js
r12746 r12996 16 16 ToolbarButton, 17 17 }, 18 compose: {19 compose,20 },21 data: {22 withSelect,23 },24 editor: {25 ServerSideRender,26 },27 18 element: { 28 19 Fragment, … … 37 28 * BuddyPress dependencies. 38 29 */ 39 const { AutoCompleter } = bp.blockComponents; 30 const { 31 blockComponents: { 32 AutoCompleter, 33 ServerSideRender, 34 }, 35 blockData: { 36 isActive, 37 } 38 } = bp; 40 39 41 40 /** … … 52 51 } 53 52 54 const editMember = ( { attributes, setAttributes, bpSettings } ) => { 55 const { isAvatarEnabled, isMentionEnabled, isCoverImageEnabled } = bpSettings; 53 const editMemberBlock = ( { attributes, setAttributes } ) => { 54 const isAvatarEnabled = isActive( 'members', 'avatar' ); 55 const isMentionEnabled = isActive( 'activity', 'mentions' ); 56 const isCoverImageEnabled = isActive( 'members', 'cover' ); 56 57 const { avatarSize, displayMentionSlug, displayActionButton, displayCoverImage } = attributes; 57 58 … … 78 79 <Fragment> 79 80 <BlockControls> 80 <Toolbar >81 <Toolbar label={ __( 'Block toolbar', 'buddypress' ) }> 81 82 <ToolbarButton 82 83 icon="edit" … … 153 154 }; 154 155 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 164 156 export default editMemberBlock; -
trunk/src/js/bp-members/js/blocks/members.js
r12748 r12996 19 19 title: __( 'Members', 'buddypress' ), 20 20 description: __( 'BuddyPress Members.', 'buddypress' ), 21 icon: 'groups', 21 icon: { 22 background: '#fff', 23 foreground: '#d84800', 24 src: 'groups', 25 }, 22 26 category: 'buddypress', 23 27 attributes: { -
trunk/src/js/bp-members/js/blocks/members/edit.js
r12748 r12996 18 18 RangeControl, 19 19 }, 20 compose: {21 compose,22 },23 data: {24 withSelect,25 },26 20 element: { 27 21 createElement, … … 42 36 * BuddyPress dependencies. 43 37 */ 44 const { AutoCompleter } = bp.blockComponents; 38 const { 39 blockComponents: { 40 AutoCompleter, 41 }, 42 blockData: { 43 isActive, 44 } 45 } = bp; 45 46 46 47 /** … … 66 67 } 67 68 68 const editMembers = ( { attributes, setAttributes, isSelected, bpSettings } ) => { 69 const { 70 isAvatarEnabled, 71 isMentionEnabled, 72 } = bpSettings; 69 const editMembersBlock = ( { attributes, setAttributes, isSelected } ) => { 70 const isAvatarEnabled = isActive( 'members', 'avatar' ); 71 const isMentionEnabled = isActive( 'activity', 'mentions' ); 73 72 const { 74 73 itemIDs, … … 314 313 }; 315 314 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 326 315 export default editMembersBlock;
Note: See TracChangeset
for help on using the changeset viewer.