Skip to content

Commit 6971645

Browse files
authored
Merge pull request #43 from liip/fix-deprecation-warnings
Release 2.2.0: Fix deprecation warnings / Improve InnerBlocks handling
2 parents 0d3a2f4 + a786d6e commit 6971645

36 files changed

+5124
-2289
lines changed
40.3 KB
Binary file not shown.

README.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,41 @@
44

55
This plugin adds Bootstrap components and layout options as Gutenberg blocks.
66

7-
The following blocks are currently available:
7+
## Available blocks
88

9-
* Container
10-
* Grid (Row / Column)
11-
* Button
9+
### Container
10+
11+
#### Options
12+
13+
* Fluid: If enabled the container will use the full available width, spanning the entire width of the viewport.
14+
* Fluid Breakpoint: Used to enable [responsive containers](https://getbootstrap.com/docs/4.4/layout/overview/#responsive). This feature only work with Bootstrap v4.4+. The container will use 100% of the width until the specified breakpoint is reached, after which the defined max-widths will apply for each of the higher breakpoints.
15+
* Margin After: Define a margin which should be added after the container.
16+
17+
### Row
18+
19+
#### Options
20+
21+
* Template: Choose from a predefined template for the inner `column` blocks.
22+
* No Gutters: Disable gutters between columns.
23+
* Alignment: Horizontal alignment of inner `column` blocks.
24+
* Vertical Alignment: Vertical alignment of inner `column` blocks.
25+
26+
### Column
27+
28+
#### Options
29+
30+
* Sizes for all breakpoints (xl, lg, md, sm, xs): How much space the column should use for the given breakpoint.
31+
* Equal width for all breakpoints (xl, lg, md, sm, xs): If enabled column will spread width evenly with other columns.
32+
* Background Color: Set background color to column.
33+
* Center content: Center content vertically in column. This option is only needed if a background color is set. Otherwise use the **Alignment** option of the otuer `row` block.
34+
* Padding: Define padding inside the column.
35+
36+
### Button
37+
38+
#### Options
39+
40+
* Style: Choose the styling of the button.
41+
* Alignment: Horizontal alignment of the button.
1242

1343
## Further Information
1444

build/editor.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/index.asset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => '55f1fe700a808a0fd1eddc297cdb72fb');
1+
<?php return array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => '8abd10a9ebae5707ce70cf31f11dedee');

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e-tests/button/button-block.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe( 'button block', () => {
6363
await clickButton( 'Align text center' );
6464
expect(
6565
await page.$(
66-
'[data-type="wp-bootstrap-blocks/button"][data-alignment="center"]'
66+
'.block-editor-block-list__block[data-type="wp-bootstrap-blocks/button"][data-alignment="center"]'
6767
)
6868
).not.toBeNull();
6969

e2e-tests/column/__snapshots__/column-block.spec.js.snap

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,83 +2,55 @@
22

33
exports[`column block Should be possible to change column size 1`] = `
44
"<!-- wp:wp-bootstrap-blocks/row -->
5-
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6,\\"equalWidthLg\\":true} -->
6-
<!-- wp:paragraph -->
7-
<p></p>
8-
<!-- /wp:paragraph -->
9-
<!-- /wp:wp-bootstrap-blocks/column -->
5+
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6,\\"equalWidthLg\\":true} /-->
106
117
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6} /-->
128
<!-- /wp:wp-bootstrap-blocks/row -->"
139
`;
1410

1511
exports[`column block Should be possible to change column size 2`] = `
1612
"<!-- wp:wp-bootstrap-blocks/row -->
17-
<!-- wp:wp-bootstrap-blocks/column {\\"sizeXl\\":2,\\"sizeMd\\":6,\\"equalWidthLg\\":true} -->
18-
<!-- wp:paragraph -->
19-
<p></p>
20-
<!-- /wp:paragraph -->
21-
<!-- /wp:wp-bootstrap-blocks/column -->
13+
<!-- wp:wp-bootstrap-blocks/column {\\"sizeXl\\":2,\\"sizeMd\\":6,\\"equalWidthLg\\":true} /-->
2214
2315
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6} /-->
2416
<!-- /wp:wp-bootstrap-blocks/row -->"
2517
`;
2618

2719
exports[`column block Should be possible to select background color 1`] = `
2820
"<!-- wp:wp-bootstrap-blocks/row -->
29-
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6,\\"bgColor\\":\\"secondary\\"} -->
30-
<!-- wp:paragraph -->
31-
<p></p>
32-
<!-- /wp:paragraph -->
33-
<!-- /wp:wp-bootstrap-blocks/column -->
21+
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6,\\"bgColor\\":\\"secondary\\"} /-->
3422
3523
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6} /-->
3624
<!-- /wp:wp-bootstrap-blocks/row -->"
3725
`;
3826

3927
exports[`column block Should be possible to select background color 2`] = `
4028
"<!-- wp:wp-bootstrap-blocks/row -->
41-
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6,\\"bgColor\\":\\"secondary\\",\\"centerContent\\":true} -->
42-
<!-- wp:paragraph -->
43-
<p></p>
44-
<!-- /wp:paragraph -->
45-
<!-- /wp:wp-bootstrap-blocks/column -->
29+
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6,\\"bgColor\\":\\"secondary\\",\\"centerContent\\":true} /-->
4630
4731
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6} /-->
4832
<!-- /wp:wp-bootstrap-blocks/row -->"
4933
`;
5034

5135
exports[`column block Should be possible to select padding 1`] = `
5236
"<!-- wp:wp-bootstrap-blocks/row -->
53-
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6,\\"padding\\":\\"p-2\\"} -->
54-
<!-- wp:paragraph -->
55-
<p></p>
56-
<!-- /wp:paragraph -->
57-
<!-- /wp:wp-bootstrap-blocks/column -->
37+
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6,\\"padding\\":\\"p-2\\"} /-->
5838
5939
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6} /-->
6040
<!-- /wp:wp-bootstrap-blocks/row -->"
6141
`;
6242

6343
exports[`column block Should reset centerContent if bgColor gets removed 1`] = `
6444
"<!-- wp:wp-bootstrap-blocks/row -->
65-
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6,\\"bgColor\\":\\"secondary\\",\\"centerContent\\":true} -->
66-
<!-- wp:paragraph -->
67-
<p></p>
68-
<!-- /wp:paragraph -->
69-
<!-- /wp:wp-bootstrap-blocks/column -->
45+
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6,\\"bgColor\\":\\"secondary\\",\\"centerContent\\":true} /-->
7046
7147
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6} /-->
7248
<!-- /wp:wp-bootstrap-blocks/row -->"
7349
`;
7450

7551
exports[`column block Should reset centerContent if bgColor gets removed 2`] = `
7652
"<!-- wp:wp-bootstrap-blocks/row -->
77-
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6} -->
78-
<!-- wp:paragraph -->
79-
<p></p>
80-
<!-- /wp:paragraph -->
81-
<!-- /wp:wp-bootstrap-blocks/column -->
53+
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6} /-->
8254
8355
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6} /-->
8456
<!-- /wp:wp-bootstrap-blocks/row -->"

e2e-tests/column/__snapshots__/column-filters.spec.js.snap

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,23 @@
22

33
exports[`column block filters wp_bootstrap_blocks_column_default_attributes should override default attributes 1`] = `
44
"<!-- wp:wp-bootstrap-blocks/row -->
5-
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6} -->
6-
<!-- wp:paragraph -->
7-
<p></p>
8-
<!-- /wp:paragraph -->
9-
<!-- /wp:wp-bootstrap-blocks/column -->
5+
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6} /-->
106
117
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6} /-->
128
<!-- /wp:wp-bootstrap-blocks/row -->"
139
`;
1410

1511
exports[`column block filters wpBootstrapBlocks.column.bgColorOptions should add background color 1`] = `
1612
"<!-- wp:wp-bootstrap-blocks/row -->
17-
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6,\\"bgColor\\":\\"brand\\"} -->
18-
<!-- wp:paragraph -->
19-
<p></p>
20-
<!-- /wp:paragraph -->
21-
<!-- /wp:wp-bootstrap-blocks/column -->
13+
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6,\\"bgColor\\":\\"brand\\"} /-->
2214
2315
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6} /-->
2416
<!-- /wp:wp-bootstrap-blocks/row -->"
2517
`;
2618

2719
exports[`column block filters wpBootstrapBlocks.column.paddingOptions should add padding option 1`] = `
2820
"<!-- wp:wp-bootstrap-blocks/row -->
29-
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6,\\"padding\\":\\"p-8\\"} -->
30-
<!-- wp:paragraph -->
31-
<p></p>
32-
<!-- /wp:paragraph -->
33-
<!-- /wp:wp-bootstrap-blocks/column -->
21+
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6,\\"padding\\":\\"p-8\\"} /-->
3422
3523
<!-- wp:wp-bootstrap-blocks/column {\\"sizeMd\\":6} /-->
3624
<!-- /wp:wp-bootstrap-blocks/row -->"

e2e-tests/column/column-filters.spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,9 @@ describe( 'column block filters', () => {
9797
// Background color should be selected
9898
await openSidebarPanelWithTitle( 'Background color' );
9999
// There is no way to see which color of a color palette is selected. That's why we check the data attribute value.
100-
// TODO since e2e-test-utils 4.x (or WordPress 5.4) the elements list always has one prepended element -> that's why we raise the index by 1 (in this case index 1 instead of 0)
101100
const columnData = await getDataValuesOfElement(
102-
'[data-type="wp-bootstrap-blocks/column"]',
103-
1
101+
'.block-editor-block-list__block[data-type="wp-bootstrap-blocks/column"]',
102+
0
104103
);
105104
expect( columnData.bgColor ).toMatch( 'primary' );
106105
expect(
Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`container block Container block should be initialized with default attributes 1`] = `
4-
"<!-- wp:wp-bootstrap-blocks/container -->
5-
<!-- wp:paragraph -->
6-
<p></p>
7-
<!-- /wp:paragraph -->
8-
<!-- /wp:wp-bootstrap-blocks/container -->"
9-
`;
3+
exports[`container block Container block should be initialized with default attributes 1`] = `"<!-- wp:wp-bootstrap-blocks/container /-->"`;
104

11-
exports[`container block Should be possible to enable fluid option 1`] = `
12-
"<!-- wp:wp-bootstrap-blocks/container {\\"isFluid\\":true} -->
13-
<!-- wp:paragraph -->
14-
<p></p>
15-
<!-- /wp:paragraph -->
16-
<!-- /wp:wp-bootstrap-blocks/container -->"
17-
`;
5+
exports[`container block Should be possible to enable fluid option 1`] = `"<!-- wp:wp-bootstrap-blocks/container {\\"isFluid\\":true} /-->"`;
186

19-
exports[`container block Should be possible to enable fluid option 2`] = `
20-
"<!-- wp:wp-bootstrap-blocks/container {\\"isFluid\\":true,\\"fluidBreakpoint\\":\\"lg\\"} -->
21-
<!-- wp:paragraph -->
22-
<p></p>
23-
<!-- /wp:paragraph -->
24-
<!-- /wp:wp-bootstrap-blocks/container -->"
25-
`;
7+
exports[`container block Should be possible to enable fluid option 2`] = `"<!-- wp:wp-bootstrap-blocks/container {\\"isFluid\\":true,\\"fluidBreakpoint\\":\\"lg\\"} /-->"`;

0 commit comments

Comments
 (0)