Skip to content

Commit

Permalink
Search Block: Add button, label, and width options (#24666)
Browse files Browse the repository at this point in the history
* Add support in the editor for button position, and changing the button to an icon.

* Add search label toggle option.

* Use updated icons.

* Update icons, and add resizing of the search form.

* Add width sidebar input field

* First pass at basic front end rendering support for button only, width, and label toggle settings.

* Add front end rendering support for new attribute classnames, and icon button.

* Add styles for button inside selection on front end.

* Remove duplicated editor styles

* Better preservation of visuals when moving from the previous version of the block.

* Do not show the drag handle when the block is not selected.

* Remove bounds restriction on resize as this breaks when the parent is a dynamic width.

* Group all button options in the block toolbar together.

* Add support for setting percentage widths.

* Add missing widthUnit attribute.

* Make sure that the search block cannot be resized beyond the width of its parent.

* Fix e2e tests for search block.

* Update button labels to sentence case to match other core blocks.

* Convert px usage to em.

* Fix missed px to em converts

* Fix PHP lint issues.

* Replace tab with space for line alignment.
  • Loading branch information
apeatling authored Sep 3, 2020
1 parent 6a190cd commit b575047
Show file tree
Hide file tree
Showing 8 changed files with 627 additions and 55 deletions.
23 changes: 21 additions & 2 deletions packages/block-library/src/search/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,35 @@
"label": {
"type": "string"
},
"showLabel": {
"type": "bool",
"default": true
},
"placeholder": {
"type": "string",
"default": ""
},
"width": {
"type": "number"
},
"widthUnit": {
"type": "string"
},
"buttonText": {
"type": "string"
},
"buttonPosition": {
"type": "string",
"default": "button-outside"
},
"buttonUseIcon": {
"type": "bool",
"default": false
}
},
"supports": {
"align": true,
"html": false
"align": [ "left", "center", "right" ],
"html": false,
"lightBlockWrapper": true
}
}
Loading

0 comments on commit b575047

Please sign in to comment.