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: useBlockTools hook #58979

Merged
merged 12 commits into from Feb 28, 2024
Merged

Refactor: useBlockTools hook #58979

merged 12 commits into from Feb 28, 2024

Commits on Feb 28, 2024

  1. Create useHasBlockToolbar to see if toolbar should render

    This hook is intended to be used to see if there will be a toolbar available or not for rendering.
    jeryj committed Feb 28, 2024
    Copy the full SHA
    5a2b603 View commit details
    Browse the repository at this point in the history
  2. Refactor hooks to more reliably determine if block toolbar is showing

    The logic for if the block toolbar is showing or not was spread throughout the codebase in several areas:
    - block-toolbar/index.js checked if it should render based on if a toolbar was enabled for the block and if there were block controls in the slots
    - block-tools/index.js determined if the popover should render based on cascading rules if the inserter popover or block select mode popover were showing (and other rules)
    - use-can-block-toolbar-be-focused made an approximation of if the block toolbar would be showing or not, but fell short in some areas such as when a block toolbar should have been rendered, but there were no block tools available.
    
    Rather than continuing to approximate across the codebase, this commit helps unify it so there is a source of truth for if it will be showing or not.
    jeryj committed Feb 28, 2024
    Copy the full SHA
    55a9e7d View commit details
    Browse the repository at this point in the history
  3. Fix #57288

    jeryj committed Feb 28, 2024
    Copy the full SHA
    2cf7dea View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    d9427e9 View commit details
    Browse the repository at this point in the history
  5. Fix bug with multiple selection

    jeryj committed Feb 28, 2024
    Copy the full SHA
    96335d7 View commit details
    Browse the repository at this point in the history
  6. Use const for useHasBlockToolbar check in block toolbar

    Co-authored-by: Andrei Draganescu <me@andreidraganescu.info>
    jeryj and draganescu committed Feb 28, 2024
    Copy the full SHA
    b6b7544 View commit details
    Browse the repository at this point in the history
  7. Will -> Should word change

    Co-authored-by: Andrei Draganescu <me@andreidraganescu.info>
    jeryj and draganescu committed Feb 28, 2024
    Copy the full SHA
    2c4a758 View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    9f8bc36 View commit details
    Browse the repository at this point in the history
  9. Add zoom-out mode check to showFixedToolbar, remove unnecessary check…

    …s from edit headers
    jeryj committed Feb 28, 2024
    Copy the full SHA
    41466cb View commit details
    Browse the repository at this point in the history
  10. Copy the full SHA
    551d1a0 View commit details
    Browse the repository at this point in the history
  11. Copy the full SHA
    d5bac66 View commit details
    Browse the repository at this point in the history
  12. fix bug from trunk rebase

    jeryj committed Feb 28, 2024
    Copy the full SHA
    161454f View commit details
    Browse the repository at this point in the history