Skip to content

Commit

Permalink
remove isSelected
Browse files Browse the repository at this point in the history
  • Loading branch information
mxkae committed Jun 10, 2024
1 parent 0503b0a commit dc7c45a
Show file tree
Hide file tree
Showing 42 changed files with 2,859 additions and 2,977 deletions.
82 changes: 40 additions & 42 deletions src/block/accordion/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,51 +125,49 @@ const Edit = props => {

return (
<>
{ isSelected && (
<>
<InspectorTabs />
<>
<InspectorTabs />

<InspectorStyleControls>
<PanelAdvancedSettings
title={ __( 'General', i18n ) }
id="general"
initialOpen={ true }
>
<AdvancedToggleControl
label={ __( 'Open at the start', i18n ) }
attribute="startOpen"
/>
<AdvancedToggleControl
label={ __( 'Close adjacent on open', i18n ) }
attribute="onlyOnePanelOpen"
helpTooltip={ {
video: 'accordion-adjacent-open',
title: __( 'Close adjacent on open', i18n ),
description: __( 'Automatically closes adjacent accordion panels when clicked.', i18n ),
} }
/>
<AdvancedToggleControl
label={ __( 'Enable FAQ Schema', i18n ) }
attribute="enableFAQ"
/>
</PanelAdvancedSettings>
</InspectorStyleControls>
<InspectorStyleControls>
<PanelAdvancedSettings
title={ __( 'General', i18n ) }
id="general"
initialOpen={ true }
>
<AdvancedToggleControl
label={ __( 'Open at the start', i18n ) }
attribute="startOpen"
/>
<AdvancedToggleControl
label={ __( 'Close adjacent on open', i18n ) }
attribute="onlyOnePanelOpen"
helpTooltip={ {
video: 'accordion-adjacent-open',
title: __( 'Close adjacent on open', i18n ),
description: __( 'Automatically closes adjacent accordion panels when clicked.', i18n ),
} }
/>
<AdvancedToggleControl
label={ __( 'Enable FAQ Schema', i18n ) }
attribute="enableFAQ"
/>
</PanelAdvancedSettings>
</InspectorStyleControls>

<Alignment.InspectorControls />
<BlockDiv.InspectorControls backgroundMediaAllowVideo={ false } />
<Advanced.InspectorControls />
<Transform.InspectorControls />
<EffectsAnimations.InspectorControls />
<CustomAttributes.InspectorControls />
<CustomCSS.InspectorControls mainBlockClass="stk-block-accordion" />
<Responsive.InspectorControls />
<ConditionalDisplay.InspectorControls />
<Alignment.InspectorControls />
<BlockDiv.InspectorControls backgroundMediaAllowVideo={ false } />
<Advanced.InspectorControls />
<Transform.InspectorControls />
<EffectsAnimations.InspectorControls />
<CustomAttributes.InspectorControls />
<CustomCSS.InspectorControls mainBlockClass="stk-block-accordion" />
<Responsive.InspectorControls />
<ConditionalDisplay.InspectorControls />

<InspectorStyleControls>
<InspectorBottomTip />
</InspectorStyleControls>
</>
) }
<InspectorStyleControls>
<InspectorBottomTip />
</InspectorStyleControls>
</>

<BlockStyles
version={ VERSION }
Expand Down
45 changes: 21 additions & 24 deletions src/block/blockquote/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const Edit = props => {
const {
clientId,
className,
isSelected,
} = props

useGeneratedCss( props.attributes )
Expand All @@ -78,29 +77,27 @@ const Edit = props => {

return (
<>
{ isSelected && (
<>
<InspectorTabs />

<Alignment.InspectorControls />
<BlockDiv.InspectorControls />
<ContainerDiv.InspectorControls
sizeSelector=".stk-block-content"
hasContentVerticalAlign={ true }
/>
<Advanced.InspectorControls />
<Transform.InspectorControls />
<EffectsAnimations.InspectorControls />
<CustomAttributes.InspectorControls />
<CustomCSS.InspectorControls mainBlockClass="stk-block-blockquote" />
<Responsive.InspectorControls />
<ConditionalDisplay.InspectorControls />

<InspectorStyleControls>
<InspectorBottomTip />
</InspectorStyleControls>
</>
) }
<>
<InspectorTabs />

<Alignment.InspectorControls />
<BlockDiv.InspectorControls />
<ContainerDiv.InspectorControls
sizeSelector=".stk-block-content"
hasContentVerticalAlign={ true }
/>
<Advanced.InspectorControls />
<Transform.InspectorControls />
<EffectsAnimations.InspectorControls />
<CustomAttributes.InspectorControls />
<CustomCSS.InspectorControls mainBlockClass="stk-block-blockquote" />
<Responsive.InspectorControls />
<ConditionalDisplay.InspectorControls />

<InspectorStyleControls>
<InspectorBottomTip />
</InspectorStyleControls>
</>

<BlockDiv
blockHoverClass={ props.blockHoverClass }
Expand Down
121 changes: 59 additions & 62 deletions src/block/button-group/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ const Edit = props => {
className,
attributes,
clientId,
isSelected,
setAttributes,
} = props

Expand Down Expand Up @@ -151,67 +150,65 @@ const Edit = props => {

return (
<>
{ isSelected && (
<>
<InspectorTabs />

<BlockDiv.InspectorControls />

<BlockControls>
<AlignmentToolbar
value={ attributes.contentAlign }
onChange={ contentAlign => setAttributes( { contentAlign } ) }
alignmentControls={ TOOLBAR_ALIGN_OPTIONS }
/>
</BlockControls>
<InspectorLayoutControls>
<AlignButtonsControl
label={ sprintf( __( '%s Alignment', i18n ), __( 'Content', i18n ) ) }
attribute="contentAlign"
responsive="all"
controls={ contentAlignControls }
/>
<AdvancedToolbarControl
label={ sprintf( __( '%s Alignment', i18n ), __( 'Button', i18n ) ) }
controls={ deviceType === 'Desktop' ? ALIGNMENT_CONTROLS_DESKTOP : ALIGNMENT_CONTROLS_TABLET_MOBILE }
attribute="buttonAlign"
responsive="all"
/>
<AdvancedToggleControl
label={ __( 'Full Width Buttons', i18n ) }
attribute="buttonFullWidth"
defaultValue={ false }
/>
<FlexGapControls />
<AdvancedSelectControl
label={ __( 'Flex Wrap', i18n ) }
attribute="flexWrap"
options={ [
{
label: __( 'No Wrap', i18n ),
value: '',
},
{
label: __( 'Wrap', i18n ),
value: 'wrap',
},
{
label: __( 'Wrap Reverse', i18n ),
value: 'wrap-reverse',
},
] }
responsive="all"
/>
</InspectorLayoutControls>
<Advanced.InspectorControls />
<Transform.InspectorControls />
<EffectsAnimations.InspectorControls />
<CustomAttributes.InspectorControls />
<CustomCSS.InspectorControls mainBlockClass="stk-block-button-group" />
<Responsive.InspectorControls />
<ConditionalDisplay.InspectorControls />
</>
) }
<>
<InspectorTabs />

<BlockDiv.InspectorControls />

<BlockControls>
<AlignmentToolbar
value={ attributes.contentAlign }
onChange={ contentAlign => setAttributes( { contentAlign } ) }
alignmentControls={ TOOLBAR_ALIGN_OPTIONS }
/>
</BlockControls>
<InspectorLayoutControls>
<AlignButtonsControl
label={ sprintf( __( '%s Alignment', i18n ), __( 'Content', i18n ) ) }
attribute="contentAlign"
responsive="all"
controls={ contentAlignControls }
/>
<AdvancedToolbarControl
label={ sprintf( __( '%s Alignment', i18n ), __( 'Button', i18n ) ) }
controls={ deviceType === 'Desktop' ? ALIGNMENT_CONTROLS_DESKTOP : ALIGNMENT_CONTROLS_TABLET_MOBILE }
attribute="buttonAlign"
responsive="all"
/>
<AdvancedToggleControl
label={ __( 'Full Width Buttons', i18n ) }
attribute="buttonFullWidth"
defaultValue={ false }
/>
<FlexGapControls />
<AdvancedSelectControl
label={ __( 'Flex Wrap', i18n ) }
attribute="flexWrap"
options={ [
{
label: __( 'No Wrap', i18n ),
value: '',
},
{
label: __( 'Wrap', i18n ),
value: 'wrap',
},
{
label: __( 'Wrap Reverse', i18n ),
value: 'wrap-reverse',
},
] }
responsive="all"
/>
</InspectorLayoutControls>
<Advanced.InspectorControls />
<Transform.InspectorControls />
<EffectsAnimations.InspectorControls />
<CustomAttributes.InspectorControls />
<CustomCSS.InspectorControls mainBlockClass="stk-block-button-group" />
<Responsive.InspectorControls />
<ConditionalDisplay.InspectorControls />
</>

<BlockDiv
blockHoverClass={ props.blockHoverClass }
Expand Down
71 changes: 34 additions & 37 deletions src/block/button/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const Edit = props => {
attributes,
setAttributes,
clientId,
isSelected,
} = props

useGeneratedCss( props.attributes )
Expand Down Expand Up @@ -78,43 +77,41 @@ const Edit = props => {

return (
<>
{ isSelected && (
<>
<BlockControls>
<AlignmentToolbar
value={ attributes.contentAlign }
onChange={ contentAlign => setAttributes( { contentAlign } ) }
/>
</BlockControls>

<InspectorTabs hasLayoutPanel={ false } />

<BlockStyle.InspectorControls styles={ blockStyles }>
<Button.InspectorControls.HoverEffects />
</BlockStyle.InspectorControls>
<Button.InspectorControls
blockState={ props.blockState }
borderSelector=".stk-button"
hasFullWidth={ true }
<>
<BlockControls>
<AlignmentToolbar
value={ attributes.contentAlign }
onChange={ contentAlign => setAttributes( { contentAlign } ) }
/>
<Typography.InspectorControls
{ ...props }
hasTextTag={ false }
initialOpen={ false }
hasColor={ false }
/>

<BlockDiv.InspectorControls initialOpen="spacing" />

<Advanced.InspectorControls />
<Transform.InspectorControls />
<EffectsAnimations.InspectorControls />
<CustomAttributes.InspectorControls />
<CustomCSS.InspectorControls mainBlockClass="stk-block-button" />
<Responsive.InspectorControls />
<ConditionalDisplay.InspectorControls />
</>
) }
</BlockControls>

<InspectorTabs hasLayoutPanel={ false } />

<BlockStyle.InspectorControls styles={ blockStyles }>
<Button.InspectorControls.HoverEffects />
</BlockStyle.InspectorControls>
<Button.InspectorControls
blockState={ props.blockState }
borderSelector=".stk-button"
hasFullWidth={ true }
/>
<Typography.InspectorControls
{ ...props }
hasTextTag={ false }
initialOpen={ false }
hasColor={ false }
/>

<BlockDiv.InspectorControls initialOpen="spacing" />

<Advanced.InspectorControls />
<Transform.InspectorControls />
<EffectsAnimations.InspectorControls />
<CustomAttributes.InspectorControls />
<CustomCSS.InspectorControls mainBlockClass="stk-block-button" />
<Responsive.InspectorControls />
<ConditionalDisplay.InspectorControls />
</>

<ButtonStyles
version={ VERSION }
Expand Down
Loading

0 comments on commit dc7c45a

Please sign in to comment.