Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: timeline block issues #2799

Closed
wants to merge 10 commits into from
Closed
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 src/block-components/block-div/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const Edit = props => {
initialOpen={ initialOpen === 'spacing' }
>
<SizeControls.Layout
{ ...props }
attrNameTemplate="block%s"
blockEl={ blockEl }
visualGuide={ {
Expand Down
5 changes: 3 additions & 2 deletions src/block-components/helpers/size/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Layout = props => {

return (
<>
<AdvancedRangeControl
{ props.hasMinHeight && <AdvancedRangeControl
label={ labelHeight }
attribute={ getAttrName( 'height' ) }
responsive="all"
Expand All @@ -46,7 +46,7 @@ const Layout = props => {
description: __( 'Adjusts the minimum allowable height of the block', i18n ),
} }
visualGuide={ props.visualGuide }
/>
/> }

{ props.hasContentVerticalAlign &&
<AdvancedToolbarControl
Expand Down Expand Up @@ -107,6 +107,7 @@ const Layout = props => {

Layout.defaultProps = {
attrNameTemplate: '%s',
hasMinHeight: true,
hasContentVerticalAlign: true,
visualGuide: null,
labels: {},
Expand Down
1 change: 0 additions & 1 deletion src/block/carousel/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ const Edit = props => {
<ColorPaletteControl
label={ sprintf( __( '%s Color', i18n ), __( 'Active Dot', i18n ) ) }
attribute="dotsActiveColor"
hasTransparent={ true }
/>
<AdvancedRangeControl
label={ sprintf( __( '%s Size', i18n ), __( 'Dot', i18n ) ) }
Expand Down
7 changes: 5 additions & 2 deletions src/block/column/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import { applyFilters } from '@wordpress/hooks'

const Edit = props => {
const {
hasInnerBlocks, isOnlyBlock,
hasInnerBlocks, isOnlyBlock, parentBlock,
} = useBlockContext()

const {
Expand All @@ -66,6 +66,9 @@ const Edit = props => {
const [ columnClass, columnWrapperClass ] = getColumnClasses( props.attributes )
const blockAlignmentClass = getAlignmentClasses( props.attributes )

const nonZeroColumnSpacingBlocks = [ 'stackable/timeline' ]
const useZeroColumnSpacing = ! nonZeroColumnSpacingBlocks.includes( parentBlock.name )

const ALLOWED_INNER_BLOCKS = applyFilters( 'stackable.block.column.allowed-inner-blocks', undefined, props )

const blockClassNames = classnames( [
Expand Down Expand Up @@ -99,7 +102,7 @@ const Edit = props => {
defaultLocked={ true }
min={ [ 0, 0 ] }
sliderMax={ [ 200, 30 ] }
placeholder={ isOnlyBlock ? '0' : '12' }
placeholder={ isOnlyBlock && useZeroColumnSpacing ? '0' : '12' }
helpTooltip={ {
video: 'inner-block-padding',
description: __( 'Sets the paddings between the column content and the border.', i18n ),
Expand Down
15 changes: 15 additions & 0 deletions src/block/timeline/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"apiVersion": 2,
"name": "stackable/timeline",
"title": "Timeline",
"description": "Show events in chronological order",
"category": "stackable",
"usesContext": [ "postId", "postType", "queryId" , "stackable/innerBlockOrientation" ],
"keywords": [
"history",
"milestone"
],
"textdomain": "stackable-ultimate-gutenberg-blocks",
"stk-type": "special",
"stk-demo": "https://wpstackable.com/timeline-block/?utm_source=welcome&utm_medium=settings&utm_campaign=view_demo&utm_content=demolink"
}
Loading