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

Navigation: Improve UX on adding links #19686

Merged
merged 10 commits into from Jan 31, 2020
Merged

Conversation

@jeryj
Copy link
Contributor

jeryj commented Jan 15, 2020

Closes #19481

Description

The link control covers up the submenu link + when adding submenu link items. It means that to access the + to add another submenu link, you have to:

  • click off of the link to close the link control,
  • then reclick the top navigation item you were working with (because clicking off it closes the submenu list)
  • click the +

This PR will be a WIP on testing out different methods. The first one is to move the focus back to wherever it came from after a link is selected on the link control. This means most of the time it ends up on the link text, but if you edit the link from the Link button in the toolbar, it will return there after you make a change.

This is very much a WIP. Currently a kind of playground and discussion for UX iterations on this.

How has this been tested?

Manually

Screenshots

return focus on link change

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
@jeryj jeryj changed the title WIP Navigation: Improve UX on adding links Navigation: Improve UX on adding links Jan 15, 2020
@jeryj jeryj self-assigned this Jan 15, 2020
@shaunandrews

This comment has been minimized.

Copy link

shaunandrews commented Jan 16, 2020

This feels nice and more natural. I wonder, could we try selecting the label text rather than just putting the cursor focus at the end? Especially for URLs, I can imagine wanting to completely replace the label by typing right away.

@jeryj

This comment has been minimized.

Copy link
Contributor Author

jeryj commented Jan 16, 2020

@shaunandrews I like this interaction a lot more as well. I'll try the auto select of the label. I can see how it would be useful to have that, but I could also see how you may not realize it's selected, press a key, and be a bit annoyed it just deleted your label.

@jeryj

This comment has been minimized.

Copy link
Contributor Author

jeryj commented Jan 16, 2020

@shaunandrews The latest is selecting the entire label text (with the cursor/caret at the end of the text). Selecting text hides the caret though, so it doesn't make it totally obvious what's going on. I personally prefer the caret just placed at the far end of the text so you can delete or add from there.

To quickly change between modes (selecting the label vs placing the caret at the end of the text) go to packages/block-library/src/navigation-link/edit.js and set line 71 to false:

const _experimentalSelectLabelContentOnChange = true; // true selects the text, false places the caret at the end
@shaunandrews

This comment has been minimized.

Copy link

shaunandrews commented Jan 17, 2020

Very cool. I like highlighting the text when adding a link, it feels really natural to me. However, it doesn't seem to work in Safari.

highlight in safari

Here's how it looks in Chrome:

highlight in chrome

@karmatosed

This comment has been minimized.

Copy link
Member

karmatosed commented Jan 17, 2020

I think this is a definite improvement. Let me remove the feedback label as we seem to have it for design - great iteration.

@jeryj jeryj added this to 👀 PRs to review in Navigation block via automation Jan 17, 2020
@jeryj jeryj force-pushed the fix/improve-adding-submenu-links branch from 0ffd97c to cc5cd14 Jan 21, 2020
@jeryj

This comment has been minimized.

Copy link
Contributor Author

jeryj commented Jan 21, 2020

I have this code in a much better spot. Works in Safari now as well. I've tested Firefox, Safari, and Chrome. Note that the + on adding submenu items is gone due to a new bug of some kind unrelated to this commit: #19788

@jeryj jeryj requested review from WunderBart, retrofox, frontdevde and getdave Jan 21, 2020
@jeryj jeryj force-pushed the fix/improve-adding-submenu-links branch from 6154fd7 to c283b46 Jan 22, 2020
@obenland

This comment has been minimized.

Copy link
Member

obenland commented Jan 22, 2020

I like highlighting the text when adding a link

Interesting, I feel the opposite way. To me it feels like I'm supposed to replace it with something (because why else would the text be highlighted?).

How about not setting the cursor at all and just having the navigation-item be focused?

@jeryj

This comment has been minimized.

Copy link
Contributor Author

jeryj commented Jan 22, 2020

To me it feels like I'm supposed to replace it with something (because why else would the text be highlighted?).

I agree with this take for when you select a page from the list. I like the highlighting when you type in a URL though.

I imagine I could add a check to see if it's a URL vs an item chosen from the suggestions.

@jeryj jeryj requested review from nerrad and ntwb as code owners Jan 22, 2020
@jeryj

This comment has been minimized.

Copy link
Contributor Author

jeryj commented Jan 22, 2020

I've updated a few things:

  1. When entering text/url from the add link popover (so, not choosing an option from the suggestions), it will automatically add whatever you entered in the field.
  2. If this text looks url-like, the label text will be automatically selected
  3. If this text does NOT look url-like, it will place the caret at the end of the text

focus vs select text

@apeatling

This comment has been minimized.

Copy link
Contributor

apeatling commented Jan 23, 2020

Not sure why the other reviewers were removed above, seems like a Github bug.

@jeryj

This comment has been minimized.

Copy link
Contributor Author

jeryj commented Jan 23, 2020

I rebased and then it wouldn't let me push without a pull. That ended up bringing in all the changes from others as new changes from the other files (111 of them 😳) That may have triggered an automatic review process. I then reverted and force pushed, since that stuff wasn't relevant here.

@jeryj

This comment has been minimized.

Copy link
Contributor Author

jeryj commented Jan 23, 2020

@WordPress/gutenberg-core I believe this merge is ready to go, but I don't want to merge it via the command line unless I absolutely have to :) Do y'all have advice on the best way forwards here?

/**
* Focus the navigation link label text and select it.
*/
function selectLabelText( ) {

This comment has been minimized.

Copy link
@youknowriad

youknowriad Jan 24, 2020

Contributor

I feel we already have a way to do this using selectors/actions without messing with refs, selection... right @ellatrix ?

This comment has been minimized.

Copy link
@ellatrix

ellatrix Jan 24, 2020

Member

Yes, if you have access to the value (if HTML you need to convert to rich text value), the block client ID and attribute key.

This comment has been minimized.

Copy link
@ellatrix

ellatrix Jan 24, 2020

Member

Why does it need to be selected?

This comment has been minimized.

Copy link
@jeryj

jeryj Jan 24, 2020

Author Contributor

It's not about getting the value, but to actually select/highlight the text so that someone can start typing delete the label value. This was discussed here: #19686 (comment)

Can I focus the input on the DOM and highlight/select it without using refs? I'm very new to React and Gutenberg, so any direction is helpful and appreciated :)

}
return label;
// If there's no label, add the URL.
return escape( normalizedURL );
} )(),

This comment has been minimized.

Copy link
@youknowriad

youknowriad Jan 24, 2020

Contributor

Very weird code style, but this was here before anyway.

This comment has been minimized.

Copy link
@jeryj

jeryj Jan 24, 2020

Author Contributor

Yeah, just trying to sneak in what I needed in the way that made the most sense :) I'm happy to redo it if you think it'd be cleaner a different way.

Copy link
Contributor

youknowriad left a comment

Are we certain about this UX? It seems a bit weird to me to ignore the post-link insertion options (like openInNewTab)?

@jeryj

This comment has been minimized.

Copy link
Contributor Author

jeryj commented Jan 24, 2020

@youknowriad It seemed to be the best of the current options, as there was no way to continue adding links due to the appenders being covered up by the popover. The only way to close the popover was to click to a top-level or sibling.

It's definitely not 100% perfect, but we did appear to have some consensus that this UX flow was a significant improvement over the current one in regards to creating navigation items, and specifically submenu items.

@shaunandrews shaunandrews mentioned this pull request Jan 24, 2020
0 of 1 task complete
@apeatling

This comment has been minimized.

Copy link
Contributor

apeatling commented Jan 28, 2020

Are we certain about this UX? It seems a bit weird to me to ignore the post-link insertion options (like openInNewTab)?

It's possible to get back to these via the sidebar, or hitting the link button in the block toolbar. I do think it makes these options less obvious, but the disruption to the flow of adding more links this popover causes is worse.

@aduth

This comment has been minimized.

Copy link
Member

aduth commented Jan 28, 2020

A bit of related commentary at: #19885 (comment)

Some ideas for parallel improvements to the current (previous) implementation:

  • I intuitively expect to be able to press Escape after selecting a link to be able to close the Popover. This currently doesn't work correctly. (See #19931)
  • From that point, I might expect to be able to insert a new link simply by pressing Enter, rather than needing to explicitly click on the "+" button.
@jeryj jeryj force-pushed the fix/improve-adding-submenu-links branch from 121fc89 to 8a7b40e Jan 29, 2020
@jeryj jeryj force-pushed the fix/improve-adding-submenu-links branch from 8a7b40e to 9971226 Jan 31, 2020
jeryj added 3 commits Jan 31, 2020
…, as the focus should now be on the navigation link text with the Link Control closed
@jeryj jeryj merged commit 06bd266 into master Jan 31, 2020
1 check passed
1 check passed
Travis CI - Pull Request Build Passed
Details
Navigation block automation moved this from 👀 PRs to review to ✅ Done Jan 31, 2020
@jeryj jeryj deleted the fix/improve-adding-submenu-links branch Jan 31, 2020
@aduth

This comment has been minimized.

Copy link
Member

aduth commented Feb 1, 2020

Noting that my comment at #19462 (comment) has quite a bit of overlap with the changes here. In that comment, I discuss the problems associated with a user flow where pressing Enter upon editing a link would move focus back to the block. In a paragraph block, that would have the result of making it impossible to toggle "Opens in New Tab" without using a cursor (i.e. by keyboard, assistive technologies). I worried that might have been introduced here, but it seems to be fine because the "Link" button in the Navigation Link block's toolbar will always open the link popup.

But, ideally these workflows are consistent for editing links either in a paragraph, or for the Navigation Link block.

Currently, I foresee the following inconsistencies:

  • My leaning for addressing this in the paragraph block is that Enter should keep the popover open and focused. This would basically be the complete opposite of the changes introduced in this pull request (i.e. it was the previous behavior, if I understand correctly).
  • Conventions in other applications might lead a user to think that Cmd+K in a Navigation Link block would put them immediately into the editing mode. Right now, Cmd+K will shift focus into the Popover, but in its "View" mode. While this can serve as a solution to allow "Open in New Tab" to be accessible by keyboard, it might be contrary to what a user's expectations are.
  • A paragraph block's "Link" button will behave as removing the active link. The same button in the Navigation Link block will show the link popover instead. This could be okay, considering that it makes less sense to remove a link from a Navigation Link block than it does to remove a link from a selected text in a paragraph.
@epiqueras epiqueras added this to the Gutenberg 7.4 milestone Feb 3, 2020
hypest added a commit that referenced this pull request Feb 10, 2020
* Use Select: Fix render queue. (#19286)

* Use Select: Fix render queue issues.

* Use Select: Make `isMounted` more informative.

* Framework: Reset lockfile changes to dependencies

Co-authored-by: Andrew Duthie <andrew@andrewduthie.com>

* Project Management: Run pull request automation on closed (#19742)

* Try/group block custom text color (#19181)

* Add text color selector to group block to allow setting a text colour that applies to all children of the group to avoid having to set text colour on every individual child

* Block Editor: Handle LinkControl submission via form handler (#19651)

* Block Editor: Handle LinkControl submission via form handler

* E2E Tests: Unskip intermittent buttons test failure

* Added conditions and new translation strings for BlockMover (#19757)

* Added conditions and new translation strings for BlockMover

* Moved translator comments into sprintf function

* Storybook: Add Placeholder component story (#19734)

* Add Placeholder story for storybook

* Update storybook test snapshot

* Project Management: Fix pull request merge automation errors (#19768)

* Framework: Use fixed version of checkout action

Avoid unintended breaking changes. To a lesser extent, helps clarify that this tag refers to the _version of the action_, not the branch being checked out.

* Framework: Configure PR automation checkout to master branch

* Add post requests documentation for apiFetch (#19759)

* Multi-select: don't focus first selected block (#19762)

* Multi-select: don't focus first selected block

* Move CopyHandler outside WritingFlow

* Fix click appender

* Remove useless line

* Update: Readme.txt Link to changelog instead of adding it inline(#19761)

* Fix: Media & Text: "Crop image to fill entire column" reset on image change (#19765)

* Build: Include JSON files in zip archive (#19772)

* Build: Include JSON files

* Zip build script: Include json files in `build/block-library/blocks/`

Co-Authored-By: Jorge Bernal <jorge@automattic.com>

Co-authored-by: Jorge Bernal <jbernal@gmail.com>

* Makes appenders visible only for the current selection (#19598)

* makes appenders visible only for the current selection

* adds smaller footprint to appenders in navigation, only shows them if item has descendants

* align appender to level of the menu item, remove useless CSS

* Core-data: do not publish outdated state to subscribers during updates (#19752)

* Core-data: do not publish outdated state to subscribers during updates

Calling `saveEntityRecord` with an update does the following:

1. Calls `getEntityRecord` to fetch the current persisted state of the entity record
2. Calls `receiveEntityRecords` with the new up-to-date state to render the updates
3. Sends an API fetch with the update patch to persist the update
4. Calls `receiveEntityRecords` again with the new up-to-date *persisted*
state

The issue here, is that point 1 (Calling `getEntityRecord`) not only fetches
the persisted state, but it also internally calls `receiveEntityRecords` itself .
This results in the persisted outdated server state to be rendered
on the UI, causing a flickering effect, that jumps pack when point 2
takes turn.

This commit removes the call to getEntityRecord, and instead, it just
calls receiveEntityRecords with the local up-to-date state of the entity
record. This fixes the flickering issue.

* Core-data: update tests to match saveEntityRecord yeilded actions

Given `saveEntityRecord` no longer selects `getEntityRecord`,
which itself triggers a SELECT action, two SELECTs are no longer
yielded. This commit removes the expectation of these two SELECTs.

* Core-data: Introduce getEntityRecordNoResolver selector

To allow saveEntityRecord access the latest local full version
of an entity without issung an API request. This prevents
propogating outdating states to subscribers when
saveEntityRecord is called.

See: #19752 (comment)

* Address review comments at #19752:

1. Capitalize alll added comment messages
2. Alias getEntityRecord with getEntityRecordNoResolver instead of copying it
3. Use describe.each instaed of looping manually in selectors tests

* Add WordPress primitives package (#19781)

* navigation-link: set page id in the attrs (#18641)

* Project management: Add step that updates CHANGELOG files before npm releases (#19764)

* Navigation Block: Add submenu chevron w/ setting (#19601)

* Initialize setting in the nav block settings panel

* Add submenu icon

* Register "showSubmenuIcon" attributes

* Add submenu icon to front-end of the page

* Update submenu icon setting description

* Don't use <span> for RichText element

* Isolate NavigationLink icons

* Clean up a little

* Use <span> for NavigationLink contents

* Rename `$level_zero` to `$is_level_zero`

* Add missing spaces

* Update submenu icon selector in style.scss

* Add comment about span-wrapping

* Fix phpcs errors

* Remove unused styles

* Fix failing e2e tests

* Update failing snapshots

* Embed: Fix failure placeholder alignment/sizing (#19673)

* Fix error message sizing + alignment in Embed Placeholder

* Fix Table placeholder input vs button alignment

* Adjust spacing between error message and buttons

* Fix card component sub-component example code (#19802)

* Introduce the Icons package (#17055)

* Expose @wordpress/icons to react-native (#19810)

* Block popover: allow scrolling over (#19769)

* Block popover: allow scrolling over

* Clean up

* Fix overlapping inserter popover

* Better comment

* Multi select: keep selection after move (#19784)

* Multi select: keep selection after move

* Add e2e test

* Change e2e test

* Address feedback

* Fix snapshots

* Bump plugin version to 7.3.0

* Navigation: Select parent navigation block on handleCreateFromExistingPages() action (#19817)

* Paragraph block: remove dead CSS (#19821)

* Bundle the icons package instead of using it as an external (#19809)

* Move a dozen of block icons to the icons package (#19808)

* Chore: Improve package-lock.json configuration

* Add mkevins and pinarol as code owners for gallery block (#19829)

* Added shippedProposals (#19065)

* Added shippedProposals

* Setting shippedProposals during init

* Rich text: remove is-selected class (#19822)

* Rich text: prefix is-selected class

* Adjust more cases

* Remove the class

* Move more block SVGs to the icons package (#19834)

* Block: use context to provide selected element (#19782)

* Block: use context to provide selected element

* Include multi selection nodes

* Add comment

* Popover: clean up requestAnimationFrame (#19771)

* Popover: clean up requestAnimationFrame

* Cancel the last request before a new request

* Update: Removed editor store usage from native mobile block ed… (#18794)

* Navigation: Manage navigation link appender visibility based on current selection (#19846)

Show the navigation link appender when the selected item has descendants and is selected, or if it's the parent of the selected block.

* Remove editor dependency from the block library (#16160)

* Add AnglePicker Component; Add useDragging hook (#19637)

This commit adds a component to pick angles and a hook to make dragging things easier to implement.
Some components will be refactored to use the new hook e.g: the custom gradient picker.

* Testing: Use deterministic selectors for incremented IDs (#19844)

* Innerblock Templates Docs Link Typo Issue Fixed (#19813)

* Innerblock Templates Docs Link Typo Issue Fixed

* Innerblock Templates Docs Link Typo Issue Fixed

* Rich text: enable if multi selection is aborted (#19839)

* Block Directory: Refactor the reducer by breaking out the block management actions into their own reducer. (#19330)

* Block Directory: Refactory the reducer by break out the block management actions into their own reducer.

* Moved hasPermission into its own reducer.
* Also remove the 'items' list as it's not being used

* Update the getInstalledBlockTypes selector to point to the new reducer that manages installs.

* Update typo in test.

* Remove the lodash dependency in the selectors. It isn\'t necessary.

* Fix panel header styles (#19842)

* Move more block icons to the icons package (#19838)

* Bump @babel/preset-env to 7.8.3 (Optional Chaining!) (#19831)

* Bump babel to 7.8.3

* Added test for optional chaining

* Bump other babel packages.

* Fix

* Changelog
Update CHANGELOG.md

* Update package-lock.json

Co-authored-by: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>

* Style improvements for template previews (#19763)

* First scaffold for template previews (mobile only)

* WIP: managed to make the preview show, saving as a checkpoint

- BlockEditorProvider needs an update so it uses the subRegistry
- We need a better way to only render the picker on the main block list
- We need to make the bottom sheet full height, and adapt the block preview accordingly

* Set a fixed height for the template preview

* Move template picker to the toolbar

* Read only block list

* Lint fixes

* Made scrolling sort of working with read only block list

* A longer template to test scrolling

* Replace BottomSheet with Modal for previews

* Allow closing previews with back button on Android

* Revert changes to BlockList that were required for bottom sheet integration

* Revert changes to BottomSheet

* Add usage example for ModalHeaderBar

* Improve accessibility of template preview

* Improve accessibility of ModalHeaderBar

* Remove unused imports

* Added missing web file

* RNMobile - Page template picker: apply layout from the preview

* RNMobile - Layout preview: apply action

* RNMobile - Page templates - set layout action

* Remove mobile action from docs

* New components for modal header buttons

* Fix alignment of modal header buttons

* Fix metrics for iOS modal header

* Add subtitle to preview header

* Use named color for modal header button

* Updated modal title color and weight

* Make Apply button bolder on iOS

* Make Apply button bolder on iOS

* Fix vertical alignment for close button

* Allow modal rotation on iOS

* Fix modal background on dark mode

* Fixed dark mode for template previews

* Revert changes to editor store after bad merge

* Add material close icon for modal header

* Tweak modal title colors

* Lint fixes

Co-authored-by: Gerardo Pacheco <gerardo.pacheco@automattic.com>

* [RNMobile] Release v1.21.0 to master (#19854)

* Adding empty function to RichText children call. (#19818)

This fixes a crash originated on this PR:
#19536
`

* Disable gallery image size options on mobile (#19828)

* Revert "Disable gallery image size options on mobile (#19828)"

This reverts commit 47b74aa.

Co-authored-by: Matthew Kevins <mkevins@users.noreply.github.com>

* Packages: New create-block package for block scaffolding (#19773)

* Packages: New create-block package for block scaffolding

* Promote action handler to async to make implementation simpler

* Pass the prop for selection color. (#19635)

* Do not use the deprecated package editor for InnerBlocks component (#19869)

* Remove dead is-hovered selectors (#19870)

* Move is-navigate-mode class to WritingFlow (#19868)

* [RNmobile] Upgrade to RN 0.61.5 (#19369)

* `focusable` replaced `clickable

See facebook/react-native#25274

* Provide a native colors.native.scss

* Upgrade React Native version in Gutenberg web repo

* Jest doesn't have hasteImplModulePath anymore

* Work around other regressions. Will revert when those fixed

* Bump react-native version to 0.61.5

* Update babel-jest to try fixing babel-plugin-jest-hoist jest.mock issue

* Update jest to try fixing babel-plugin-jest-hoist jest.mock issue

* Pin xmldom to older version to bypass license file ambiguity

With newer versions, the license check script doesn't recognise that the
package is dual licenced and is reporting it as incompatible.

This commit pins the package to an older version. There is no functional
difference between the two versions, see
xmldom/xmldom@v0.1.27...v0.1.30

* Revert "Provide a native colors.native.scss"

This reverts commit b05f1e4.

This shouldn't be needed anymore after
wordpress-mobile/gutenberg-mobile#1683

* Revert "Pin xmldom to older version to bypass license file ambiguity"

This reverts commit 7e3c2b5.

* Cater for lowercase OR in licenses types

Props to @pento for the solution
#19369 (comment)

* Update package-lock.json via npm v6.13.6

* Check for the same "or" format as we're splitting

Otherwise, the 'or' in `GPL-2.0-or-later` causes an infinite recursion.
See error in https://travis-ci.com/WordPress/gutenberg/jobs/278348885.

* Update package-lock.json after running run check-local-changes

* Fix package-lock.json conflicts by keeping Jest to 24.9.0, Babel to
7.8.3

* Update package-lock by running npm install

* Update README.md (#19876)

Fix typo

* Multi selection: fix intermittent e2e failure (#19865)

* Move more block icons to the icons library (#19862)

* Paragraph block: remove min-height (#19835)

* Paragraph block: remove min-height

* Use lineheight to set drop cap min height

* Framework: Fix server-registered fixtures script (#19884)

* Env: Format run output only for terminal display

* Framework: Fix server-registered fixtures script

* Testing: Regenerate server-registered fixtures

* Testing: Regenerate navigation block fixture

* Env: Fix CHANGELOG typo "or"

* Shortcode Design Review (#19852)

* Update style of shortcode based on design review

* Fix title colors

* Update component to components in CONTRIBUTING.md (#19914)

* Apply sentence case formatting to PanelBody titles (#19901)

* Color Settings -> Color settings

* Block PanelBody titles: Settings -> settings

* Clarify when isEligible function is called (#19899)

Added a note that isEligible is only used for valid blocks and is not called for invalid blocks.

* Block Editor: Refactor ObserveTyping as function component (#19881)

* Block Editor: Refactor ObserveTyping as function component

* Block Editor: ObserveTyping: Avoid persisting event

* Remove unnecessary import from playground (#19893)

* Documentation: Organize Contributors Guide (#19853)

* Simplify CONTRIBUTING.md to be just guidelines

We don't need to include too much here because the real information for
contributing is in the handbook. This page is a standard page for Github
repos, so trimming it down to just a few links to sections in the
handbook.

Plus the policies for code of conduct and GPL.

* Add design contribution from CONTRIBUTING.md to design page

* Cleanup and organize Contributors Guide

* Use consistent Contributors Guide title

* Move Principles and catch-all docs to Project Overview section

* Switch background to more relevant repository management

* Apply suggestions from code review

Thanks for the fixes 👍

Co-Authored-By: Chris Van Patten <hello@chrisvanpatten.com>

* Fix extra newlines

* Standardize on Contributor Guide, matches core handbook

* Update manifest

Co-authored-by: Chris Van Patten <hello@chrisvanpatten.com>

* [RNMobile] Correct isMobile condition in nested Media&Text (#19778)

* Correct isMobile condition in nested Media&Text

* Do not export BREAKPOINTS

* Blocks: Match blocks in the inserter using keywords from patterns (#19243)

* Blocks: Match blocks in the inserter using keywords from patterns

* Ensure that matched patterns with the search term are marked

* Introduce scopes for block patterns

* Make it possible to apply initial attributes and inner blocks directly from the inserter

* Update block preview in the inserter to use attributes from the variation

* Change the way patterns are handled in the inserter

* Update packages/block-editor/src/components/block-types-list/index.js

Co-Authored-By: Miguel Fonseca <miguelcsf@gmail.com>

* Improve the way patterns are added to the inserter

* Rename pattern label to patter title to align with block types

* Inserter: Don't auto-add block if it has variations

Co-authored-by: Miguel Fonseca <miguelcsf@gmail.com>

* Block editor: Alt+F10 shouldn't scroll to top (#19896)

* Add e2e test

* Leave fixed position until position can be set

* Multi-selection: fix clearing with side click (#19787)

* Multi-selection: fix clearing with side click

* Add e2e test

* [RNMobile] fix show appender and separator in Group block (#19908)

* fix appender to duplicate separator line

* Add docs for LocalAutosaveMonitor and __experimentalUpdateLocalAutosaveInterval (#19915)

* [RNMobile] Add media edit icon to image block (#19723)

* Creates a MediaEdit component that shows a picker

* Add Gridicon's customize icon

* Show a button in images block that displays a picker

* Fix lint issues

* Fix no-shadow error

* Fix the name of the params

* When "Edit" is selected, request the Media Editor

* Fix lint issues

* Change media editor ID to a constant

* When "Replace" is tapped, show all available media options

* Fix lint issues

* Avoid destructuring

* Block Library: Handle Popover onClose for LinkControl (#19885)

* Block Library: Handle Popover onClose for LinkControl

* E2E Tests: Verify link popover Escape handling

* Disable Autocomplete in shortcode block (#19848)

* Disable Autocomplete in shortcode block

* RichText API: Limit `prefix` transformations to Paragraph (#19727)

… and any consumer of RichText that provides experimental prop
`__unstableAllowPrefixTransformations.`

* Block Editor: LinkControl: Resolve error when undefined value, "view" state (#19856)

* Block Editor: LinkControl: Resolve error when undefined value, "view" state

* Block Editor: LinkControl: Document only url, title, opensInNewTab value properties

* Block Editor: LinkControl: Change documented example to reference known value property

* [RNMobile] Revert change to fix Action Sheet (#19934)

* Revert "Avoid destructuring"

This reverts commit e113310.

* Fix the var name

* Add background color support to Columns block (#17813)

* Add attributes

* Update edit function

* Update save function

* Add .has-background style

* Improve has-background and backgroundColor.class checks

* Try passing the columns block e2e test

* Refactor to use __experimentalUseColors

* Normalize has-background padding with variables

* Remove extra bit

* Fix RTL styling for Media Text block (#18764)

* Add proper !rtl ignore comments to maintain styling on RTL

* Tweak comment

* Add direction: ltr (not ignored) to the content container

* change order of composing style in svg primitive (#19927)

* Add Prettier formatting script (#18048)

* Add Prettier NPM dependency to packages/scripts and top-level

* Scripts: export the fromProjectRoot function from scripts/utils module

* Scripts: Add Prettier formatting script

* ESLint config: use default (linebreak before ternary op) config for operator-linebreak rule

* ESLint: disable formatting rules in the recommended config

Adds `eslint-config-prettier` to the recommended config and creates an alternative
`recommended-with-formatting` config for project that want to keep ESLint formatting
rules and opt-out of Prettier.

* Scripts: the format-js script checks if Prettier is present and has top-level config

Prettier presence in a `wp-scripts`-powered project is optional, and the `format-js` script
checks if it's there and if it's indeed the fork (`wp-prettier`). Will report error otherwise.

Also, require a top-level Prettier config to be present. We can't default to the one inside
`wp-scripts`, because IDE and editor integrations won't find it there and will use the Prettier
defaults.

* Bump the minimum required version of npm to 6.9.0

* Add ESLint config changes notice to changelog

* Update package-lock.json

* Regenerate package-lock.json

Co-authored-by: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>

* Components: FontSizePicker: Adjust Select Button sizing (#19479)

* Documentation: fix typo "Th" to "The" (#19833)

* [RNMobile] Long-press on inserter to show options for "add above" and "add below" (#18791)

* Add onLongPress prop to Button

* Show inserter menu on long press

* Make onLongPress a prop of toggle

* Make withSelect of Inserter return destinationRootClientId

* Insert default block before the selected one on long press

* Add add canReplaceBlock key to the insertionPoint state

* Hide a block in list only if it can be replaced

* Move insertion index logic from menu to inserter

* Update selector tests for newly added key in state

* Add insertionIndexAfter and isAnyBlockSelected props with selector

* Update docs for newly added key in state

* Add insertionType to component state and map to insertion index

* Refactor insertion index logic

* Show BottomSheet on long press to choose to insert before or after

* Update UI strings to be title case

* Hide cancel button from Bottom Sheet on Android

* Add icons to Bottom Sheet options on Android

* Add “Replace Current Block” option to menu on long-press

* Scroll to newly added block if it doesn't trigger keyboard to open

* Change “Replace Current Block” menu icon on Android

* Use shorter syntax for setState

* Rename getShouldReplaceBlock method to shouldReplaceBlock

* Revert "Scroll to newly added block if it doesn't trigger keyboard to open"

This reverts commit 9c1c71d.

* Revert “Add canReplaceBlock key to the insertionPoint state"

* Remove Block show/hide logic from BlockList

* Update Inserter local state to store block insertion information

* Make InserterMenu add/remove unmodified default block during replace

* Handle replacing last remaining block

* Fix Inserter test

* Fix code style issue

* Move insertion options into getInsertionOptions function

* Add comment about removing last block case

* Use findByProps instead of toJSON when testing Inserter

* Docs: Add details for format-js to @wordpress/scripts package (#19946)

* Docs: Add details for format-js to @wordpress/scripts package

* Update README.md

* Update packages/eslint-plugin/CHANGELOG.md

Co-Authored-By: Marcus Kazmierczak <marcus@mkaz.com>

Co-authored-by: Marcus Kazmierczak <marcus@mkaz.com>

* Fix: Crash when creating a hierarchical post without title (#19936)

* Fix: Color Gradients component was not able to handle only gra… (#19925)

* Add markdownlint script to lint docs markup (#19855)

* Add markdownlint script to lint docs markup

Adds a new script `lint-md-docs` that runs markdownlint to lint markdown
files for proper syntax. A default `.markdownlint.json` config is
included, it will require some testing to tune.

Fixes #12426

* Clarify naming of lint-md scripts js and docs

- Updates lint-md scripts to lint-md-js for linting source included in the document and lint-md-docs for
linting the markup of the document itself.

- Update scripts changelog
- Update readme with commands

* Apply suggestions from code review

Co-Authored-By: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>

* Fix URL for markdownlint CLI

* Add -i check, details around ignore on CLI

* Check for additional project config files

* Update script commands to all for lint:*

* Local changes applied to package-lock.json

* Update packages/scripts/README.md

Co-Authored-By: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>

* Apply suggestions from code review

Thanks for the review and updates 👍

Co-Authored-By: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>

Co-authored-by: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>

* Use require.resolve() instead of <rootDir> in @wordpress/jest-preset-default (#19957)

* use require.resolve() instead of <rootDir>

* formatted

* added changelog entry (#19958)

* Move the insert dashicon to the icons package (#19943)

* Replace all occurences of the yes dashicon with the check icon from the icons package (#19926)

* Build: Include block.json files in the build output (#19786)

* Block Editor: LinkControl: Prevent focus loss in edit mode toggle (#19931)

* Block Editor: LinkControl: Prevent focus loss in edit mode toggle

* Block Library: Remove custom focus loss protection

Previously used effect lifecycle to anticipate and respond to focus loss. Now, focus loss is prevented by LinkControl.

See: 722a4d6

* Block Editor: Rephrase and move forced input rendering comment

* Block Editor: Ensure isEndingEditWithFocus always assigned as boolean

* Move Alignment, movers and trash icons to the icons package (#19944)

* Navigation Block: Move the link description panel below the SEO panel because this is likely to be used signficantly less than the SEO panel. (#19917)

* Update hover and focus selectors for Move to Trash to ensure they're always red (#19974)

- Updates the selectors in .editor-post-trash to use similar
  specificity as .components-button.is-link for the hover
  and focus states to ensure that they are always red.

* Create block: Code quality improvements for the block scaffolding (#19867)

* Create block: Code quality improvements for the block scaffolding

* Improve the strucutre and handling of templates
Props to @aduth for the proposal: #19773 (comment).

* Ensure that package-lock.json file is refreshed with the changes from master

* Docs: Add a note about version and help options

* Code style: Run Prettier formatting on the package files

* Create block: Align .editorconfig with Gutenberg settings

* Fix: Use the description provided to fill the `description` field in `package.json` file in ESNext template

* Fix: Ensure that values provided for slug and namespace get converted to lower case

* Fix: Simplify the logic for transforming slug to title

* Update packages/create-block/lib/templates.js

Co-Authored-By: Andrew Duthie <andrew@andrewduthie.com>

Co-authored-by: Andrew Duthie <andrew@andrewduthie.com>

* Code quality: Enable linting for JS files starting with .

* Popover: fix typo in removing event listener (#19978)

* Eslint Plugin: Lint code formatting. (#19963)

* Eslint Plugin: Lint code formatting.

* Gutenberg: Add code formatting pre-commit hook.

* Eslint Plugin: Update docs.

* Gutenberg: Format code.

* Storybook: Update snapshots.

* [RNMobile] Show the media edit icon only if the block is selected (#19961)

* Only shows the media edit icon if the block is selected

Also, matches the style of the native gallery block buttons

* Fix lint

* Fix: Admin menu collapses for 960px width but editor doesn't (#19970)

* Chore: Fix differences in package-lock.json file

* RichText: try using hooks for wrapper component (#19095)

* Components: Apply width-based modifier classes to Placeholder only when width is known (#19825)

* Components: Apply `is-small` modifier class to Placeholder only when width known

* E2E Tests: Wait for placeholder error display in embed tests

* Testing: Update snapshots for Placeholder class assignment

* Eslint: set line width to 80 (#19992)

* Update config

* npm run lint-js:fix

* Move eslint comments

* Update snapshots

* Editor: Remove post title escaping (#19955)

* Add: Global styles css variables generation mechanism (#19883)

* Navigation: Change UX to move focus to navigation link label and close the LinkControl (#19686)

* When adding a link via the LinkControl, selects/highlights nav link label text if it's url-like. Focuses if not. Automatically adds url-like labels as the label.

* Adds @wordpress/dom to package-lock.json

* Removed test for awaiting for Link Control focus after pressing Enter, as the focus should now be on the navigation link text with the Link Control closed

* Lib: Limit `pre_render_block` extension. (#19989)

* Lib: Limit `pre_render_block` extension.

* Update lib/compat.php

Co-Authored-By: Andrew Duthie <andrew@andrewduthie.com>

Co-authored-by: Andrew Duthie <andrew@andrewduthie.com>

* Fix, update, and sort _rc_ `hasProjectFile` filenames (#19994)

* Update and fix `hasProjectFile` filenames

* Sort `hasProjectFile` filenames

* Update CHANGELOG.md

* Docs: Include CHANGELOG entries from the relocated create-wordpress-block package

* Blocks: Rename patterns to variations in the Block API (#19966)

* Blocks: Rename patterns to variations in the Block API

* Fix: Remove ESLint errors and warnings related to block variations

* [Mobile] Fix gallery upload sync (#19941)

* Invoke mediaUploadSync for gallery in React hook

* Use integer type explicitly for gallery image id

* Set state before attributes on upload success in gallery image

* Use ref hook for concurrency in media placeholder

* Extract dedup function and add comments in media placeholder

* Fix lint

* Use explicit radix with parseInt

Co-Authored-By: Gerardo Pacheco <gerardo.pacheco@automattic.com>

* Import useRef from @wordpress/element

* Fix lint

* Fix lint / prettier

Co-authored-by: Gerardo Pacheco <gerardo.pacheco@automattic.com>

* [Mobile] Fix blank image size labels on mobile (#19800) (#20045)

* Fix blank image size labels on mobile

* Use name instead of label in default imageSizes

* [RNMobile] Enable Dismiss on PlainText in Android (#20095)

* Add flag for determining if running on Android

* Enable Dismiss button on PlainText. Enable show keyboard in Android on PlainText mount

* Enable Dismiss button on PlainText. Enable show keyboard in Android on PlainText mount

Co-authored-by: Enrique Piqueras <epiqueras@users.noreply.github.com>
Co-authored-by: Andrew Duthie <andrew@andrewduthie.com>
Co-authored-by: Glen Davies <glendaviesnz@users.noreply.github.com>
Co-authored-by: Christopher Reece <momotofu@users.noreply.github.com>
Co-authored-by: Marcus Kazmierczak <marcus@mkaz.com>
Co-authored-by: Ella van Durpe <ella@automattic.com>
Co-authored-by: Jorge Costa <jorge.costa@developer.pt>
Co-authored-by: Bernie Reiter <ockham@raz.or.at>
Co-authored-by: Jorge Bernal <jbernal@gmail.com>
Co-authored-by: andrei draganescu <me@andreidraganescu.info>
Co-authored-by: Omar Alshaker <omar@omaralshaker.com>
Co-authored-by: Riad Benguella <benguella@gmail.com>
Co-authored-by: Damián Suárez <rdsuarez@gmail.com>
Co-authored-by: Grzegorz (Greg) Ziółkowski <grzegorz@gziolo.pl>
Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
Co-authored-by: Jon Quach <hello@jonquach.com>
Co-authored-by: Edi Amin <to.ediamin@gmail.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Jerry Jones <jones.jeremydavid@gmail.com>
Co-authored-by: Matthew Kevins <mkevins@users.noreply.github.com>
Co-authored-by: Abdelmajid HAMDANI <abdel.hamdani213@gmail.com>
Co-authored-by: Delowar Hossain <delowardev@gmail.com>
Co-authored-by: Steven Dufresne <steve.dufresne@automattic.com>
Co-authored-by: Adam Boro <adam@adamboro.com>
Co-authored-by: Kukhyeon Heo <sainthkh@naver.com>
Co-authored-by: Gerardo Pacheco <gerardo.pacheco@automattic.com>
Co-authored-by: etoledom <etoledom@icloud.com>
Co-authored-by: Sérgio Estêvão <sergioestevao@gmail.com>
Co-authored-by: Florian TIAR <florian.tiar@theculturetrip.com>
Co-authored-by: Chip <chip.snyder3@gmail.com>
Co-authored-by: Haz <hazdiego@gmail.com>
Co-authored-by: Rich Tabor <hello@themebeans.com>
Co-authored-by: Benjamin Intal <bfintal@gmail.com>
Co-authored-by: Rostislav Wolný <rwolny@gmail.com>
Co-authored-by: Chris Van Patten <hello@chrisvanpatten.com>
Co-authored-by: Luke Walczak <lukasz.walczak.pwr@gmail.com>
Co-authored-by: Miguel Fonseca <miguelcsf@gmail.com>
Co-authored-by: jbinda <jakub.binda@gmail.com>
Co-authored-by: Leandro Alonso <contato@leandroalonso.com>
Co-authored-by: Jarda Snajdr <jsnajdr@gmail.com>
Co-authored-by: Martin Posselt <nekomajin@gmx.de>
Co-authored-by: Ceyhun Ozugur <ceyhunozugur@gmail.com>
Co-authored-by: James Newell <jameslnewell@users.noreply.github.com>
Co-authored-by: Andy Peatling <apeatling@users.noreply.github.com>
Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com>
Co-authored-by: Stephen Edgar <stephen@netweb.com.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.