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

Keyboard shortcut to toggle block level HTML editing #9723 #19152

Closed
wants to merge 109 commits into from
Closed

Keyboard shortcut to toggle block level HTML editing #9723 #19152

wants to merge 109 commits into from

Conversation

dmahendrakar
Copy link
Contributor

@dmahendrakar dmahendrakar commented Dec 15, 2019

Description

Adds keyboard short cut for block level HTML editing - Fixes #9723

How has this been tested?

Added snapshot test.

Screenshots

Screen Shot 2019-12-15 at 2 44 08 AM

Screen Shot 2019-12-15 at 2 44 56 AM

Screen Shot 2019-12-15 at 3 27 48 AM

Types of changes

New feature (non-breaking change which adds functionality)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .

@dmahendrakar
Copy link
Contributor Author

dmahendrakar commented Dec 15, 2019

Working atop @MarkDavidTurner's stale pr #11941. Thank you @MarkDavidTurner!
Few changes from the above pr include-

  • Used onToggleBlockMode instead of onToggleEditor to be consistent with WordPress function naming.
  • Used access('m') instead on primaryAlt('v') as it's closest to global block mode toggle secondary( 'm' ). Alternate option is ctrl('m') @talldan is that a better option?
  • Handled ignore toggle when reusable block.
  • Used same help text as in Global shortcuts for consistency. Help text could be verbose - "Switch between Visual Editor and Code Editor for selected block." but I chose against it as it's already implicit being under Block shortcuts section.

@gziolo gziolo added [Type] Enhancement A suggestion for improvement. [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository labels Dec 15, 2019
@dmahendrakar
Copy link
Contributor Author

dmahendrakar commented Dec 15, 2019

I found one issue when manually testing the feature. It breaks for case of group of blocks - when I try to edit the html, save and toggle off block mode I get block-invalid-warning -
Screen Shot 2019-12-15 at 10 49 54 AM

The 'After conversion' section on right has un-intented changes (/div added in <!-- wp:column --> element). Is that a bug? Can someone explain why or give me pointers to debug this issue?

Tammie Lister and others added 19 commits December 16, 2019 11:36
The select tool doesn't let you select text. It's only until you click twice on the same block, press Enter, or select the Edit tool, that you edit text again. Therefore the text-beam cursor is inaccurate.

This PR changes that cursor to the default arrow cursor.
* Image Block: Revert circle mask, add "rounded"

Fixes #16130, notably a followup to the issue outlined in #16130 (comment).

The "circle mask" variation has the benefit of creating a perfect circle out of any shape image. However it doesn't change the dimensions of the image, so the tradeoff is that the image footprint is still large, and resize handles now float in air.

This PR changes it to a "rounded" style, which sets a very high border radius ensuring that the smallest sides on a rectangular image are perfectly rounded, creating a pill-shape. When the image is perfectly square, the variation will be perfectly circular. This ensures that the variation is useful both when images are rectangular, it ensures the resize handles are appropriately placed, it fixes an issue where Microsoft Edge did not render the mask properly, and it indicates to the user that if they want a perfect circle, they can upload a square image, or change the dimensions in the sidebar.

* Add back-compat.
…#19037)

This avoids showing the option when it won't do anything.
* Add end 2 end tests InnerBlocks renderAppender

* Fixed intermittent problem.

* Address reviews
Adds an image size selector to the gallery block that allows users to choose the size of the images. It defaults to the large size.
* Expanding on sentance case to everywhere else

So far we have only done this in the tooltips and in menus. If sentance case of right approach we should consider taking this across all areas.

Included in this:

- Side panel
- Block library
- Settings

There may be areas missed, but gives a starting view to see if everyone agrees to go forward with this across everything. If we do, then we need a patch for core.

Expands on #16764

* Catch a few missed

* Update tag

* Test catches

Fixes test issues.

* Catches the test fails for sentance case.

* Test fix

* Update index.js

* Catch some more test fails

* Test fixes

* Override WP labels for post and page types

… to conform to sentence-style capitalisation across the editor UI.

(This is a quick commit to show the idea. Do expand on it and polish.)

From Slack: "If we used this it would have to be properly marked [e.g.
@todo] and commented so that before the next core release we could
revisit these labels as a whole."

* gutenberg_override_posttype_labels: small fixes
* Edit Site: Bootstrap package.

* Edit Site: Link package.

* Edit Site: Load assets in new Edit Site Page.

* Edit Site: Render basic editor.
* Add tests for adding navigation blocks using two different methods

* Avoid showing placeholder until pages are loaded

* Fixes for tests

* Revert "Avoid showing placeholder until pages are loaded"

This reverts commit 0dd1a36.

* Fix various issues with tests

* Handle console warning

* Use a mocked response from the pages endpoint

* Also mock the search response

* Try fixing e2e tests when run on travis CI.

* Update button label
* Add an additional warning for the FSE experiment setting

* Updated warning text

* Update the copy some more
…#19122)

* Block Editor: Get categories from the store directly in the inserter

* Block Editor: Extract searchItems into its own file

* Improve the way terms are matched in the block inserter
@dmahendrakar
Copy link
Contributor Author

Opened another pr for the same: #19329

@dmahendrakar dmahendrakar deleted the add/keyboard-shortcut-for-block-level-HTML-editing branch December 26, 2019 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keyboard shortcut to switch to HTML editing on a block level