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

Refactor ToolbarGroup to Typescript #50262

Closed
wants to merge 85 commits into from
Closed

Refactor ToolbarGroup to Typescript #50262

wants to merge 85 commits into from

Conversation

margolisj
Copy link
Contributor

What?

Convert the ToolbarGroup component to TypeScript.

Why?

This PR is needed as part of an effort to convert ToolbarGroup to TypeScript. As mentioned in #35744 .

How?

By adding types to ToolbarGroup.

Testing Instructions

Create or otherwise open a post
Add a block that would have some toolbar controls (e.g. Image)
Expected: Toolbar buttons should fundamentally work the same as before:

@margolisj margolisj requested a review from ajitbohra as a code owner May 2, 2023 18:38
@margolisj
Copy link
Contributor Author

@mirka @ciampo
Still a bug around getting a function to conform to children types provided by ToolbarItem. Types are a bit all over the place as I last worked on this about 2 months ago. Just putting this up for now make sure there isn't anything glaring bad.

@mirka mirka added the [Package] Components /packages/components label May 3, 2023
@mirka mirka requested review from mirka and ciampo and removed request for ajitbohra May 3, 2023 09:54
ndiego and others added 20 commits May 7, 2023 19:24
…tch the global styles controller (#50270)

* Ensuring that the revisions endpoint for global styles revisions matches the permissions for the global styles custom post type controller

* Replacing with the same check as WP_REST_Global_Styles_Controller->get_item_permissions_check, since this is the check against the original global style custom post

* translation domain

* Fixed copy
* Mobile - Adds initial useEditorWrapperStyles hook

* Mobile - Update useEditorWrapperStyles hook to take into account custom marginHorizontal values

* Mobile - useEditorWrapperStyles hook - Remove helper tests and exports

* Mobile - useEditorWrapperStyles - Move max width values from the SCSS styles to the JavaScript side and update tests

* Mobile - useEditorWrapperStyles - Update helpers to use an options object param instead of first level params

* Mobile - useEditorWrapperStyles - Update wrapperStyles logic to unify canvasStyles logic
* Fix site logo preview image size with long filenames

* hardcode width value
* Introduce new PluginTemplateSettingPanel slot

* Apply suggestions from code review

Co-authored-by: George Mamadashvili <[email protected]>

---------

Co-authored-by: George Mamadashvili <[email protected]>
* Better labels for sidebars and close buttons.

* Add back sidebar to the Settings keyboard shortcut description.
* Remove custom padding for tertiary buttons

* changelog
fluiddot and others added 6 commits May 7, 2023 19:24
* Mock `ActionSheetIOS` library

* Add setup picker test helper

* Use `setupPicker` in gallery integration tests

* Add style mock

* Add test to check correct media options picker in Gallery block
… to simplify the code and apply it to the Widgets Editor. (#50344)
* Add focus ring and keydown event to enter site editor

The site editor is an iframe, which doesn't reliably emit focus events. To work around this, when the blur and focus events are emitted on the `useTabNav` from `useWritingFlow` on the iframe editor, the iframe component can set a `.is-focused` classname on the iframe to show a visual outline. The onClick event listener doesn't work on the iframe to handle a spacebar or enter keypress, so we had to add an onKeyDown listener for this as well.

* Set W logo as a Go back to dashboard link when site editor navigation is open

We need the W logo element tag to stay the same between both the navigation open and closed states so that the component doesn't remount and beak the animation. To do this, we have to set an `href` to force the <Button> component to stay as an <a>.

* Use CSS var for border width focus and calc

* Fix missing - (negative) in the offset

* refactor to remove many conditionals

* Refactor how to pass props to Iframe

* Lint js

---------

Co-authored-by: scruffian <[email protected]>
* Fix exec command in CI

Use -T instead of --no-TTY. The latter doesn't work.

Fix unit test that was failing on trunk.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components
Projects
None yet
Development

Successfully merging this pull request may close these issues.