Skip to content

Commit

Permalink
ToolsPanel: refactor Storybook examples to TypeScript, fix types in…
Browse files Browse the repository at this point in the history
…consistencies (#47944)

* Rename files

* Fix imports

* Allow panelId to be null across all types

* `ToolsPanel`: mark `hasInnerWrapper` and `shouldRenderPlaceholderItems` as optional, assign `false` default value

* `ToolsPanelItem`: mark `resetAllFilter` as optional, assign `noop` default value

* `ToolsPanelItem`: change `isShownByDefault` to be optional, assign default `false` value

* Storybook examples: add component and state types

* Storybook example: ignore unsolved errors, add TODO notes

* Add Storybook meta object

* Fix type errors in Storybook examples

* Remove extraneous `isFirstToolsPanelItemShownByDefault` prop from Story args

* CHANGELOG

* Fix resetAll prop forwarding typo

* Update `ResetAllFilter` type to receive and return data. Update READMEs

* Update READMEs to sync `resetAll` and `resetAllFilter` types and descriptions

* Remove @ts-ignore comments after updating the `ResetAllFilter` type

* Remove unnecessary `ToolsPanelWithItemGroupSlot` story

* update `resetAll` prop descritption in types JSDocs

* Fix ToolsPanel component exports

* Draft ToolsPanel JSDoc example comment

---------

Co-authored-by: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com>
  • Loading branch information
ciampo and aaronrobertshaw authored Feb 13, 2023
1 parent 378290a commit a0ef113
Show file tree
Hide file tree
Showing 10 changed files with 300 additions and 375 deletions.
2 changes: 2 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bug Fix

- `ToolsPanel`: fix type inconsistencies between types, docs and normal component usage ([47944](https://github.com/WordPress/gutenberg/pull/47944)).
- `SelectControl`: Fix styling when `multiple` prop is enabled ([#47893](https://github.com/WordPress/gutenberg/pull/43213)).

### Enhancements
Expand All @@ -29,6 +30,7 @@
- `ToolsPanel`: Allow display of optional items when values are updated externally to item controls ([47727](https://github.com/WordPress/gutenberg/pull/47727)).
- `ToolsPanel`: Ensure display of optional items when values are updated externally and multiple blocks selected ([47864](https://github.com/WordPress/gutenberg/pull/47864)).
- `Navigator`: add more pattern matching tests, refine existing tests ([47910](https://github.com/WordPress/gutenberg/pull/47910)).
- `ToolsPanel`: Refactor Storybook examples to TypeScript ([47944](https://github.com/WordPress/gutenberg/pull/47944)).

## 23.3.0 (2023-02-01)

Expand Down
Loading

0 comments on commit a0ef113

Please sign in to comment.