Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion src/block-components/linking/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const _Linking = () => {
return <div
className="stk-linking-wrapper"
>
<Tooltip position="bottom" text={
<Tooltip placement="bottom" text={
<>
{ __( 'When linked, styling this block would also style other linked blocks in adjacent columns.', i18n ) }
<br />
Expand Down
1 change: 1 addition & 0 deletions src/block/map/location-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const LocationControl = props => {
onChange={ value => {
props.onTextChange( value )
} }
__next40pxDefaultSize
/>
)
}
Expand Down
5 changes: 5 additions & 0 deletions src/components/advanced-autosuggest-control/editor.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
.ugb-advanced-autosuggest-control {
margin-bottom: 16px;

.stk-inspector-control__reset-button {
transform: translateY(-3px);
}
}
.ugb-advanced-autosuggest-control__select {
> * {
position: relative;
}
input {
width: 100%;
height: 40px; // Follow new WP standard.
}
.react-autosuggest__suggestions-container {
position: absolute;
Expand Down
1 change: 1 addition & 0 deletions src/components/advanced-focal-point-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const AdvancedFocalPointControl = props => {
{ ...propsToPass }
value={ value || FOCAL_DEFAULT_VALUE }
onChange={ typeof props.onChange === 'undefined' ? onChange : props.onChange }
__nextHasNoMarginBottom
/>
<ResetButton
allowReset={ props.allowReset }
Expand Down
1 change: 1 addition & 0 deletions src/components/advanced-range-control/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
flex: 1;
display: flex;
align-items: center;
height: 40px; // Follow new WP standard.
.components-range-control {
flex: 1;
margin: 0 !important;
Expand Down
4 changes: 4 additions & 0 deletions src/components/advanced-range-control/range-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ const StackableRangeControl = memo( props => {
? props.sliderMax
: ( props.max === Infinity ? 100 : props.max ) // Dont' allow Infinity on the slider since it will not move.
}
__next40pxDefaultSize
__nextHasNoMarginBottom
/>
{ withInputField && isNumberControlSupported && (
<NumberControl
Expand All @@ -177,6 +179,8 @@ const StackableRangeControl = memo( props => {
value={ value }
placeholder={ placeholderValue }
type="text"
__next40pxDefaultSize
__nextHasNoMarginBottom
/>
) }
{ _children }
Expand Down
2 changes: 2 additions & 0 deletions src/components/advanced-select-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const AdvancedSelectControl = memo( props => {
role="listbox"
value={ typeof props.value === 'undefined' ? value : props.value }
onChange={ typeof props.onChange === 'undefined' ? onChange : props.onChange }
__nextHasNoMarginBottom
__next40pxDefaultSize
/>
<ResetButton
allowReset={ props.allowReset }
Expand Down
2 changes: 2 additions & 0 deletions src/components/advanced-text-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ const AdvancedTextControl = memo( props => {
value={ internalValue }
onChange={ internalOnChange }
className={ classnames( propsToPass.className, 'ugb-advanced-text-control' ) }
__nextHasNoMarginBottom
__next40pxDefaultSize
/>
</DynamicContentControl>
<ResetButton
Expand Down
2 changes: 1 addition & 1 deletion src/components/advanced-toggle-control/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

.stk-toggle-control .components-base-control__field {
display: flex;
align-items: center;
align-items: flex-start;
.components-form-toggle {
margin-inline-end: 12px;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/advanced-toggle-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const AdvancedToggleControl = memo( props => {
id={ id }
help={ helpLabel }
className={ className }
allowReset={ true }
allowReset={ props.allowReset }
value={ checked }
showReset={ props.defaultValue ? checked !== props.defaultValue : checked }
onChange={ onChange }
Expand All @@ -72,7 +72,7 @@ const AdvancedToggleControl = memo( props => {

AdvancedToggleControl.defaultProps = {
className: '',
allowReset: false,
allowReset: true,
showReset: null,
defaultValue: '',

Expand Down
2 changes: 2 additions & 0 deletions src/components/base-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ const BaseControl = props => {
<_BaseControl
help={ props.help }
className={ className }
__nextHasNoMarginBottom
__next40pxDefaultSize
>
{ props.hasLabel &&
<BaseControlMultiLabel
Expand Down
5 changes: 4 additions & 1 deletion src/components/base-control2/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ $right-space: 28px;
margin: 0 !important;
font-size: 13px !important;
}
&:not(:empty) {
height: 24px; // Prevent the label from changing sizes if toggle disappears.
}
}
&.stk-control-label--bold {
margin-bottom: 16px;
Expand Down Expand Up @@ -49,7 +52,7 @@ $right-space: 28px;
.stk-control__reset-button {
position: absolute;
right: -28px;
top: 4px;
top: 7px;
margin: 0;
width: 24px !important;
padding: 0 !important;
Expand Down
1 change: 1 addition & 0 deletions src/components/base-control2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const BaseControl = props => {
<GutBaseControl
help={ props.help }
className={ className }
__nextHasNoMarginBottom
>
<VisualGuide { ...props.visualGuide }>
<div className={ labelClassName }>
Expand Down
1 change: 1 addition & 0 deletions src/components/button-icon-popover-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const ButtonIconPopoverControl = memo( props => {
label={ props.label }
checked={ props.checked }
onChange={ props.onToggle }
__nextHasNoMarginBottom
/>
) }
<div className="ugb-button-icon-control__wrapper">
Expand Down
1 change: 1 addition & 0 deletions src/components/code-textarea-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const CodeTextareaControl = props => {
<BaseControl
help={ props.help }
className={ classnames( 'stk-code-textarea-control', props.className ) }
__nextHasNoMarginBottom
>
<BaseControlMultiLabel
label={ props.label }
Expand Down
2 changes: 1 addition & 1 deletion src/components/color-palette-control/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}

.stk-control__reset-button {
margin-top: 6px;
margin-top: 1px;
}

&:has(.components-button[aria-disabled="true"]) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/color-scheme-preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const ColorSchemePresetPicker = ( {
label, presets, onPresetClick,
} ) => {
return (
<BaseControl label={ label } className="stk-preset-color-schemes__control">
<BaseControl label={ label } className="stk-preset-color-schemes__control" __nextHasNoMarginBottom>
<div className="stk-preset-color-schemes__preset-wrapper">
{ presets.map( ( colors, index ) => {
return <ColorSchemePreview
Expand Down
1 change: 1 addition & 0 deletions src/components/design-separator-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const DesignSeparatorControl = props => {
id="ugb-design-separator-control"
label={ label }
help={ help }
__nextHasNoMarginBottom
>
<DesignControl
options={ options }
Expand Down
7 changes: 7 additions & 0 deletions src/components/dynamic-content-control/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,10 @@
}
}
}

// Dynamic content fields in the popover are too close together.
.stackable-dynamic-content__popover-content {
.components-base-control {
margin-bottom: 16px;
}
}
2 changes: 2 additions & 0 deletions src/components/dynamic-content-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,8 @@ const DynamicContentControl = ( {
<TextControl
value={ otherProps.placeholder }
disabled={ true }
__nextHasNoMarginBottom
__next40pxDefaultSize
/>
) }
<DynamicContentButton { ...otherProps } />
Expand Down
5 changes: 2 additions & 3 deletions src/components/four-number-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import Button from '../button'
/**
* WordPress dependencies
*/
import {
BaseControl, Dashicon,
} from '@wordpress/components'
import { BaseControl, Dashicon } from '@wordpress/components'
import { __ } from '@wordpress/i18n'

/**
Expand Down Expand Up @@ -147,6 +145,7 @@ class FourNumberControl extends Component {
<BaseControl
help={ this.props.help }
className={ classnames( 'ugb-four-number-control', this.props.className ) }
__nextHasNoMarginBottom
>
<BaseControlMultiLabel
label={ this.props.label }
Expand Down
1 change: 1 addition & 0 deletions src/components/four-range-control/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
position: relative;
display: flex;
align-items: center;
margin-top: 4px;
}
.ugb-four-range-control__icon {
height: 20px;
Expand Down
1 change: 1 addition & 0 deletions src/components/help-tooltip/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const HelpTooltip = props => {
className="ugb-help-tooltip__checkbox"
checked={ ! props.tooltipsEnabled }
onChange={ checked => props.onTooltipsEnabledChange( ! checked ) }
__nextHasNoMarginBottom
/>
}
</PanelBody>
Expand Down
4 changes: 2 additions & 2 deletions src/components/icon-search-popover/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
flex-basis: calc(100% - 50px);
}
.components-button.ugb-icon-popover__settings-button.ugb-button-component {
width: 36px;
height: 30px;
width: 40px;
height: 40px;
margin-left: 8px;
}
.components-range-control__upload,
Expand Down
2 changes: 2 additions & 0 deletions src/components/icon-search-popover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ const IconSearchPopover = props => {
value={ value }
onChange={ setValue }
placeholder={ __( 'Type to search icon', i18n ) }
__nextHasNoMarginBottom
__next40pxDefaultSize
/>
{ isPro &&
<Button
Expand Down
1 change: 1 addition & 0 deletions src/components/image-alt-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const ImageAltControl = props => {
{ __( 'Leave empty if the image is purely decorative.', i18n ) }
</>
}
__nextHasNoMarginBottom
/>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/image-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const ImageControl = props => {

return (
<div className="ugb-image-control">
<BaseControl help={ props.help }>
<BaseControl help={ props.help } __nextHasNoMarginBottom>
<BaseControlMultiLabel
label={ props.label }
screens={ props.screens }
Expand Down
4 changes: 4 additions & 0 deletions src/components/modal-design-library/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export const ModalDesignLibrary = props => {
}, 100 )
props.onClose()
} }
__nextHasNoMarginBottom
/>
) }
<Button
Expand Down Expand Up @@ -246,10 +247,12 @@ export const ModalDesignLibrary = props => {
onChange={ value => {
setEnableBackground( value )
} }
__nextHasNoMarginBottom
/>
<BaseControl
label={ __( 'Background Scheme', i18n ) }
className="ugb-modal-design-library__color-scheme-label"
__nextHasNoMarginBottom
>
<Dropdown
className="ugb-modal-design-library__color-scheme-dropdown"
Expand Down Expand Up @@ -316,6 +319,7 @@ export const ModalDesignLibrary = props => {
<BaseControl
label={ __( 'Container Scheme', i18n ) }
className="ugb-modal-design-library__color-scheme-label"
__nextHasNoMarginBottom
>
<Dropdown
popoverProps={ popoverProps }
Expand Down
1 change: 1 addition & 0 deletions src/components/resizer-tooltip/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ const ResizerTooltip = props => {
<BaseControl
help={ props.help }
className={ classnames( 'stk-control stk--no-padding', props.className ) }
__nextHasNoMarginBottom
>
<div className="stk-control-label">
<div className="components-base-control__label"><h3>{ sprintf( __( '%s Size', i18n ), props.label ) }</h3></div>
Expand Down
1 change: 1 addition & 0 deletions src/components/small-number-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const SmallNumberControl = props => {
type="number"
className="ugb-small-number-control"
{ ...props }
__next40pxDefaultSize
/>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/sortable-picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const SortablePicker = props => {
)

return (
<BaseControl className={ classNames } label={ props.label }>
<BaseControl className={ classNames } label={ props.label } __nextHasNoMarginBottom>
{ enableAddItem && <Dropdown
popoverProps={ addItemPopoverProps }
renderToggle={ ( { onToggle, isOpen } ) => (
Expand Down
2 changes: 1 addition & 1 deletion src/deprecated/v2/higher-order/with-google-font/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const withGoogleFont = createHigherOrderComponent(
WrappedComponent => {
const NewComponent = props => {
const isEditingTemplate = useSelect( select =>
select( 'core/edit-post' )?.isEditingTemplate?.()
select( 'core/editor' )?.getCurrentPostType?.() === 'wp_template' || false
)

// Reload the Google Fonts in the editor when switching to and from page template editing.
Expand Down
11 changes: 7 additions & 4 deletions src/plugins/global-settings/color-schemes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ import ColorSchemePicker from './color-scheme-picker'
*/
import { i18n, showProNotice } from 'stackable'
import {
PanelAdvancedSettings, HelpTooltip,
AdvancedSelectControl, SectionSettings,
AdvancedSelectControl,
AdvancedToggleControl,
HelpTooltip,
PanelAdvancedSettings,
ProControlButton,
SectionSettings,
} from '~stackable/components'
import { useBlockColorSchemes } from '~stackable/hooks'

Expand All @@ -22,7 +25,6 @@ import { useBlockColorSchemes } from '~stackable/hooks'
import { addFilter } from '@wordpress/hooks'
import { Fragment, useState } from '@wordpress/element'
import { __ } from '@wordpress/i18n'
import { ToggleControl } from '@wordpress/components'
import { useSelect, dispatch } from '@wordpress/data'
import { models } from '@wordpress/api'

Expand Down Expand Up @@ -145,10 +147,11 @@ addFilter( 'stackable.global-settings.inspector.global-colors.toggle-controls',

return <>
{ output }
<ToggleControl
<AdvancedToggleControl
label={ __( 'Show Global Color Schemes', i18n ) }
checked={ ! hideColorSchemeColors }
onChange={ value => onChange( ! value ) }
allowReset={ false }
/>

</>
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/global-settings/colors/editor-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const renderGlobalStyles = ( newColors, isEditingTemplate, setStyles ) => {
export const GlobalColorStyles = () => {
const { colors, isEditingTemplate } = useSelect( select => ( {
colors: select( 'stackable/global-colors' ).getSettings().stackableColors || [],
isEditingTemplate: select( 'core/edit-post' )?.isEditingTemplate?.() || false,
isEditingTemplate: select( 'core/editor' )?.getCurrentPostType?.() === 'wp_template' || false,
} ) )
const [ styles, setStyles ] = useState( '' )

Expand Down
Loading
Loading