Skip to content

Commit

Permalink
* BS > Modal block added for creating popups - ADDED
Browse files Browse the repository at this point in the history
* Most blocks now show better previews - ADDED
* Parent and allowedBlocks params added to some blocks to remove them from main list when they can only be nested - CHANGED
* Some blocks such as Navbar will now auto add child element dummy data on insert for faster building - ADDED
* Some blocks such as tabs were not working in editor with certain AyeCode UI setting - FIXED
  • Loading branch information
Stiofan committed Jun 6, 2024
1 parent 9f26ac1 commit c01530f
Show file tree
Hide file tree
Showing 30 changed files with 5,736 additions and 4,958 deletions.
2 changes: 1 addition & 1 deletion assets/css/block-editor.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion assets/css/block-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
transform: translate(-50%, 0%);
}

.modal {
@at-root .modal:has(.wp-block-blockstrap-blockstrap-widget-modal.is-selected),
.modal:has(.wp-block-blockstrap-blockstrap-widget-modal.has-child-selected) {
display: block;
position: relative;
opacity: 1 !important;
}
}


/* show responsive menu if selected */
@media ( max-width: 840px ) {
.wp-block-blockstrap-blockstrap-widget-navbar {
Expand All @@ -21,4 +31,3 @@
background: #f8f9fa !important;
}
}

1 change: 1 addition & 0 deletions blocks/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ registerBlockType( 'blockstrap/blockstrap-widget-accordion-item', { title: 'BS >
registerBlockType( 'blockstrap/blockstrap-widget-contact', { title: 'BS > Contact Form' } );
registerBlockType( 'blockstrap/blockstrap-widget-rating', { title: 'BS > Rating' } );
registerBlockType( 'blockstrap/blockstrap-widget-scroll-top', { title: 'BS > Scroll Top' } );
registerBlockType( 'blockstrap/blockstrap-widget-modal', { title: 'BS > Modal' } );
*/


Expand Down
3 changes: 2 additions & 1 deletion blocks/class-blockstrap-widget-accordion-item.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public function __construct() {
'anchor' => false,
'customClassName' => false,
),
'parent' => array('blockstrap/blockstrap-widget-accordion'),
'block-output' => array(
array(
'element' => 'div',
Expand All @@ -44,7 +45,7 @@ public function __construct() {
array(
'element' => 'div',
'if_className' => 'props.attributes.state === "closed" ? "accordion-collapse collapse" : "accordion-collapse collapse show"',
'if_x' => '( typeof parentBlocks !== "undefined" && parentBlocks[parentBlocks.length - 1].attributes.anchor ) ? props.setAttributes({parent_anchor: parentBlocks[parentBlocks.length - 1].attributes.anchor}) : ""', // required
'if_x' => '( typeof parentBlocks !== "undefined" && parentBlocks[parentBlocks.length - 1]?.attributes?.length && parentBlocks[parentBlocks.length - 1].attributes.anchor ) ? props.setAttributes({parent_anchor: parentBlocks[parentBlocks.length - 1].attributes.anchor}) : ""', // required
'if_id' => '"collapse-"+props.attributes.anchor',
'if_"aria-labelledby"' => '"heading-"+props.attributes.anchor',
'if_"data-bs-parent"' => 'props.attributes.parent_anchor ? "#"+props.attributes.parent_anchor : ""',
Expand Down
4 changes: 3 additions & 1 deletion blocks/class-blockstrap-widget-accordion.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class BlockStrap_Widget_Accordion extends WP_Super_Duper
*/
public function __construct()
{
$aui_settings = is_admin() ? get_option('ayecode-ui-settings') : [];
$aui_settings = is_admin() ? get_option( 'ayecode-ui-settings', array()) : array();
$aui_settings = apply_filters( 'ayecode-ui-settings', $aui_settings, array(), array() );
$bs5 = ! empty($aui_settings['bs_ver']) && '5' === $aui_settings['bs_ver'] ? 'bs-' : '';

$options = [
Expand All @@ -25,6 +26,7 @@ public function __construct()
'block-category' => 'layout',
'block-keywords' => "['accordion','list','content']",
'block-supports' => ['customClassName' => false],
'allowed-blocks' => array('blockstrap/blockstrap-widget-accordion-item'),
'block-output' => [
[
'element' => 'innerBlocksProps',
Expand Down
4 changes: 1 addition & 3 deletions blocks/class-blockstrap-widget-breadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ className: '',
'description' => esc_html__( 'A bootstrap breadcrumb output.', 'blockstrap-page-builder-blocks' ),
),
'example' => array(
'attributes' => array(
'after_text' => 'Earth',
),
'viewportWidth' => 300
),
'no_wrap' => true,
'block_group_tabs' => array(
Expand Down
8 changes: 3 additions & 5 deletions blocks/class-blockstrap-widget-button.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ className: '',
'description' => esc_html__( 'A bootstrap button, badge or iconbox.', 'blockstrap-page-builder-blocks' ),
),
'example' => array(
'attributes' => array(
'after_text' => 'Earth',
),
'viewportWidth' => 200
),
'no_wrap' => true,
'block_group_tabs' => array(
Expand Down Expand Up @@ -132,7 +130,7 @@ public function set_arguments() {
'type' => 'text',
'title' => __( 'Custom URL', 'blockstrap-page-builder-blocks' ),
'desc' => __( 'Add custom link URL', 'blockstrap-page-builder-blocks' ),
'placeholder' => __( 'https://example.com', 'blockstrap-page-builder-blocks' ),
'placeholder' => __( 'https://example.com or #contact-form', 'blockstrap-page-builder-blocks' ),
'default' => '',
'desc_tip' => true,
'group' => __( 'Link', 'blockstrap-page-builder-blocks' ),
Expand All @@ -141,7 +139,7 @@ public function set_arguments() {

$arguments['lightbox_notice'] = array(
'type' => 'notice',
'desc' => __( 'Enter the BS > Contact form ID prefixed by a `#` eg: #contact-form', 'blockstrap-page-builder-blocks' ),
'desc' => __( 'Enter the BS > Contact or BS > Modal form ID prefixed by a `#` eg: #contact-form', 'blockstrap-page-builder-blocks' ),
'status' => 'info',
'group' => __( 'Link', 'blockstrap-page-builder-blocks' ),
'element_require' => '[%type%]=="lightbox"',
Expand Down
12 changes: 9 additions & 3 deletions blocks/class-blockstrap-widget-container.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,15 @@ public function __construct() {
'description' => esc_html__( 'A container for content', 'blockstrap-page-builder-blocks' ),
),
'example' => array(
'attributes' => array(
'after_text' => 'Earth',
),
'viewportWidth' => 300,
'innerBlocks' => array(
array(
'name' => 'core/paragraph',
'attributes' => array(
'content' => esc_html__( 'A container for content', 'blockstrap-page-builder-blocks' ),
)
)
)
),
'no_wrap' => true,
'block_group_tabs' => array(
Expand Down
6 changes: 1 addition & 5 deletions blocks/class-blockstrap-widget-gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ public function __construct() {
'classname' => 'bs-image',
'description' => esc_html__( 'An image gallery.', 'blockstrap-page-builder-blocks' ),
),
'example' => array(
'attributes' => array(
'after_text' => 'Earth',
),
),
'example' => false,
'no_wrap' => true,
'block_group_tabs' => array(
'content' => array(
Expand Down
6 changes: 5 additions & 1 deletion blocks/class-blockstrap-widget-icon-box.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ className: '',
),
'example' => array(
'attributes' => array(
'after_text' => 'Earth',
'icon_class' => 'fas fa-ship',
'icon_type' => 'iconbox-translucent',
'iconbox_size' => 'medium',
'icon_color' => 'success',
),
'viewportWidth' => 300
),
'no_wrap' => true,
'block_group_tabs' => array(
Expand Down
Loading

0 comments on commit c01530f

Please sign in to comment.