Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Perfect for designers, developers, and content creators who want to boost produc
* Resizable sidebar width for a personalized layout
* Dismissible notifications for a distraction-free interface
* Scroll directly to selected elements in the Edit Form panel
* Add a first found element on Enter
* Customizable settings page to adjust sidebar appearance and behavior:
* Hide element descriptions in the Add Element panel
* Reduce spacing between elements for a compact view
Expand Down
4 changes: 3 additions & 1 deletion assets/js/editor/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '../../scss/editor/main.scss'
import { extendInlineShortcodeView } from './utils'
import { extendInlineShortcodeView, addSearchInputListener } from './utils'
import { SidebarForWPBakery } from './sidebar'
import { PageStructure } from './page-structure'
import { Notifications } from './notifications'
Expand All @@ -16,5 +16,7 @@ $(document).ready(() => {
}
new Notifications()
new SidebarForWPBakery()

addSearchInputListener()
})
})
33 changes: 32 additions & 1 deletion assets/js/editor/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { vc } = window
const { vc, jQuery, _ } = window
const $ = jQuery

/**
* Extends the InlineShortcodeView class to trigger an event after removing a shortcode.
Expand All @@ -11,3 +12,33 @@ export function extendInlineShortcodeView () {
vc.events.trigger('afterRemoveShortcode')
}
}

/**
* Adds event listener to Add Element's search input to trigger click on the first visible element when Enter key is pressed.
*/
export function addSearchInputListener () {
const $searchInput = $('#vc_elements_name_filter')
const keyupHandler = function (e) {
const filterValue = $(this).val().trim()

if (filterValue.length) {
const $visibleElements = $('.wpb-layout-element-button.vc_visible:not(.vc_inappropriate)')
const $firstVisibleElement = $visibleElements.first().find('[data-vc-clickable]')
$firstVisibleElement.addClass('snfw-highlighted')
if (e.key === 'Tab' || e.keyCode === 9) {
e.preventDefault()
$visibleElements.find('.snfw-highlighted').removeClass('snfw-highlighted')
// next sibling
$($visibleElements[1]).find('[data-vc-clickable]').focus()
}
if (13 === (e.keyCode || e.which)) {
$visibleElements.find('.snfw-highlighted').removeClass('snfw-highlighted')
$firstVisibleElement.click()
}
}
}

if ($searchInput) {
$searchInput.on('keydown', _.debounce(keyupHandler, 300))
}
}
63 changes: 41 additions & 22 deletions assets/scss/editor/components/compact-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
.wpb_element_label,
.vc_css-editor .vc_settings label{
font-weight: 500;
font-size: 13px;
font-size: 12px;
}

.vc_description {
Expand All @@ -36,12 +36,30 @@
}

.vc_edit_form_elements input,
.vc_edit_form_elements select {
.vc_edit_form_elements select,
.wpb_button_group-buttons,
.wpb-form-select + .select2-container.select2-container--default .select2-selection--single,
.wpb-form-select-search + .select2-container.select2-container--default .select2-selection--single {
height: 34px;
font-size: 13px;
line-height: 1;
}

.wpb_button_group-buttons,
.wpb-form-select + .select2-container.select2-container--default .select2-selection--single,
.wpb-form-select-search + .select2-container.select2-container--default .select2-selection--single {
min-height: 34px;
}

.wpb-form-select + .select2-container.select2-container--default .select2-selection--single,
.wpb-form-select-search + .select2-container.select2-container--default .select2-selection--single {
padding: 8px;
}

.wpb_button_group-button {
height: 24px;
}

.vc_edit_form_elements input[type="checkbox"],
.vc_edit_form_elements input[type="radio"],
.vc_checkbox input[type="checkbox"]:checked::before {
Expand All @@ -56,8 +74,8 @@
}

.vc_css-editor input {
height: 20px;
width: 30px;
height: 30px;
width: 40px;
font-size: 10px;
line-height: 1;
}
Expand Down Expand Up @@ -91,9 +109,10 @@
font-size: 12px;
}

.vc-iconpicker-wrapper .fip-vc-theme-grey.vc-icons-selector .selector,
.vc-icons-selector .selector {
width: 90px;
height: 30px;
height: 34px;
}

.vc-icons-selector .selected-icon {
Expand All @@ -115,27 +134,27 @@
left: 38px;
}

.vc_css-editor .vc_layout-onion .vc_border,
.vc_css-editor .vc_layout-onion .vc_padding,
.vc_css-editor .vc_layout-onion .vc_content {
margin: 36px;
}
// .vc_css-editor .vc_layout-onion .vc_border,
// .vc_css-editor .vc_layout-onion .vc_padding,
// .vc_css-editor .vc_layout-onion .vc_content {
// margin: 36px;
// }

.vc_css-editor .vc_layout-onion input.vc_bottom {
bottom: 3px
}
// .vc_css-editor .vc_layout-onion input.vc_bottom {
// bottom: 3px
// }

.vc_css-editor .vc_layout-onion input.vc_top {
top: 3px
}
// .vc_css-editor .vc_layout-onion input.vc_top {
// top: -10px
// }

.vc_css-editor .vc_layout-onion input.vc_left {
left: 3px
}
// .vc_css-editor .vc_layout-onion input.vc_left {
// left: 3px
// }

.vc_css-editor .vc_layout-onion input.vc_right {
right: 3px
}
// .vc_css-editor .vc_layout-onion input.vc_right {
// right: 3px
// }

.pickr .pcr-button {
height: 26px;
Expand Down
11 changes: 7 additions & 4 deletions assets/scss/editor/components/dark-mode/navbar.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
@use "sass:color";

$ui-background-color: #001424;

@mixin navbar {
.vc_navbar,
.vc_ui-panel-header-container {
.vc_ui-panel-header-container,
.vc_navbar .vc_dropdown.open .vc_dropdown-toggle,
.vc_navbar .vc_dropdown .vc_dropdown-list {
background-color: $ui-background-color;
}

.vc_navbar-border-right {
border-color: $ui-background-color;
}

.vc_navbar a.vc_icon-btn:not([disabled]):hover {
.vc_navbar a.vc_icon-btn:not([disabled]):hover,
#vc_navbar a.vc_icon-btn.vc_active,
.vc_navbar .vc_dropdown .vc_dropdown-list a.active,
.vc_navbar .vc_dropdown .vc_dropdown-list a:hover {
background-color: color.adjust($ui-background-color, $lightness: 10%);
}
}
31 changes: 29 additions & 2 deletions assets/scss/editor/components/dark-mode/panels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,16 @@
}

// Add element panel
.vc_add-element-container .wpb-content-layouts li:hover {
background-color: color.adjust($background-color, $lightness: -10%);
.vc_add-element-container .wpb-content-layouts li:hover,
.vc_add-element-container .wpb-content-layouts a.snfw-highlighted,
.vc_add-element-container .wpb-content-layouts a:focus,
.vc_ui-template-card::before {
background-color: color.adjust($background-color, $lightness: 10%);
}

.vc_general.vc_ui-tabs-line .vc_ui-tabs-line-trigger:hover,
.vc_general.vc_ui-tabs-line .vc_ui-tabs-line-trigger:focus {
background-color: color.adjust($ui-background-color, $lightness: 10%);
}

.vc_add-element-container .wpb-content-layouts:not(.wpb-teasers-grid) a {
Expand All @@ -87,10 +95,17 @@

#vc_elements_name_filter {
&, &:focus {
background-color: color.adjust($background-color, $lightness: -5%);
color: $color;
border: 1px solid color.adjust($background-color, $lightness: 10%);
}
}

.vc_add-element-container .wpb-content-layouts .wpb-element-title,
.vc_ui-template-card-name {
color: $color;
}

// Row layout editor
.vc_layout-panel-switcher .vc_layout-btn {
background-color: $background-color !important;
Expand Down Expand Up @@ -123,7 +138,9 @@
// Template library panel
#vc_templates_name_filter {
&, &:focus {
background-color: color.adjust($background-color, $lightness: -5%);
color: $color;
border: 1px solid color.adjust($background-color, $lightness: 10%);
}
}

Expand Down Expand Up @@ -190,4 +207,14 @@
border-color: color.adjust($background-color, $lightness: 10%);
color: $color;
}

// Settings panel
a.vc_post-custom-layout:hover,
a.vc_post-custom-layout.vc-active-post-custom-layout {
background-color: color.adjust($background-color, $lightness: 30%);
}

.vc_layout-label {
color: $color;
}
}
40 changes: 38 additions & 2 deletions assets/scss/editor/components/dark-mode/params.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,23 @@
.vc_cta3-colored-dropdown .classic,
.vc_shortcode-param[data-param_type="dropdown"] select.wpb_vc_param_value,
.vc_shortcode-param[data-param_type="dropdown"] select.wpb_vc_param_value option,
.wpb-form-select + .select2-container.select2-container--default .select2-selection--single,
.wpb-form-select-search + .select2-container.select2-container--default .select2-selection--single,
.wpb_el_type_attach_images .gallery_widget_add_images,
.wpb_el_type_attach_image .gallery_widget_add_images,
.vc_css-editor .vc_settings .vc_background-image .vc_add-image {
background-color: color.adjust($background-color, $lightness: -5%);
background-color: color.adjust($background-color, $lightness: -5%) !important;;
color: $color !important;;
border: 1px solid color.adjust($background-color, $lightness: 10%) !important;

&:focus {
border: 1px solid color.adjust(#005FB1, $lightness: 10%) !important;
}
}

.wpb-form-select + .select2-container.select2-container--default .select2-selection--single .select2-selection__rendered,
.wpb-form-select-search + .select2-container.select2-container--default .select2-selection--single .select2-selection__rendered {
color: $color;
border: 1px solid color.adjust($background-color, $lightness: 10%);
}

// Buttons
Expand All @@ -40,6 +51,27 @@
background-color: color.adjust($background-color, $lightness: -10%);
}

.vc_param_type_number_chevron,
.wpb_linked_fields_toggle,
.vc_wrapper-param-type-button_group.wpb_el_type_button_group .wpb_button_group-button--icon .wpb_button_group-icon {
color: $color;
}

.vc_wrapper-param-type-button_group.wpb_el_type_button_group .wpb_button_group-buttons,
.wpb_button_group-buttons {
background-color: color.adjust($background-color, $lightness: -5%);
border: 1px solid color.adjust($background-color, $lightness: 10%);
}

.vc_wrapper-param-type-button_group.wpb_el_type_button_group .wpb_button_group-button--text .wpb_button_group-text {
color: $color;
}

// Colorpicker
.pcr-app.wpb-pickr {
background-color: color.adjust($background-color, $lightness: 5%);
}

// Design options
.vc_css-editor .vc_layout-onion {
label {
Expand All @@ -53,6 +85,10 @@
.vc_margin .vc_border .vc_padding {
background-color: color.adjust($background-color, $lightness: 10%);
}

.vc_margin .vc_border .vc_padding .vc_content {
background-color: color.adjust($background-color, $lightness: 15%);
}
}

// Iconpicker
Expand Down
1 change: 1 addition & 0 deletions assets/scss/editor/components/dark-mode/variables.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
$background-color: #1e1e1e;
$color: #eee;
$ui-background-color: #2e2e2e;
1 change: 1 addition & 0 deletions assets/scss/editor/components/navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
right: initial;
bottom: 0;
width: var(--vc-navbar-width);
height: 100%;
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.25);
z-index: 99999;
}
Expand Down
24 changes: 24 additions & 0 deletions assets/scss/editor/components/panels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,27 @@
.vc_ui-panel-content.vc_properties-list-init {
margin: auto !important;
}

.snfw-highlighted {
background-color: #F0F0F1;
}


// after wpb 9.0
.vc_ui-panel-header .vc_ui-panel-header-header {
.vc_ui-panel-header-actions {
width: 90%;
}

.vc_ui-panel-header-actions .wpb-search-input {
width: 100%
}

.vc_ui-panel-minimize-button {
display: none;
}

.vc-c-icon-search {
font-size: 14px;
}
}
2 changes: 1 addition & 1 deletion includes/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function sidebar_nav_for_wpbakery_settings_init() {
'sidebar_nav_for_wpbakery_disable_description',
'<div class="sfw-label">
<span class="sfw-title">' . esc_html__( 'Disable elements\' description', 'sidebar-navigation-for-wpbakery' ) . '</span>
<span class="sfw-tooltip" aria-label="' . esc_attr__( 'Hides the descriptions under WPBakery elements in the Add Element panel.', 'sidebar-navigation-for-wpbakery' ) . '">❔</span>
<span class="sfw-tooltip" aria-label="' . esc_attr__( 'Hides the descriptions under WPBakery elements in the Add Element panel. NOTE: After WPBakery 9.0 descriptions are removed by default.', 'sidebar-navigation-for-wpbakery' ) . '">❔</span>
</div>',
'sidebar_nav_for_wpbakery_disable_description_callback',
'sidebar-navigation-for-wpbakery',
Expand Down
Loading
Loading