-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Experimental Link creation interface #17846
Merged
Merged
Changes from 1 commit
Commits
Show all changes
113 commits
Select commit
Hold shift + click to select a range
8dbc2bd
Initial component file structure
getdave ee008be
Implement basic icon and toggle mechanic
getdave e685003
Adds basic search input
getdave 70049ad
Update input to utilise LinkEditor component autocomplete
getdave 98e6aa5
Add ability to customise placeholder
getdave 85a6317
Update to utilise URLInput directly for greater flexibility
getdave 8ec1488
Add example search results and test coverage
getdave 140cc90
Update class naming convention to match guidelines
getdave d64608e
Adds render prop to enable custom suggestions rendering
getdave 30e0eb6
Update to utilise URLInput render prop to customise search suggestion…
getdave 53ce517
Update to add post type to the fetchLinkSuggestions responsive mapping
getdave b53c13c
Fix to ensure search suggestion interaction states are perceivable
getdave 6d7259a
Update suggestion render prop to provide component props as arguments
getdave 4f32429
Update to match with design visual and provide more accessible markup
getdave 4971e30
Adds settings area. Fixes missing reset icon.
getdave 4aea19c
Fix search items to be buttons with correct style and layout
getdave d554b65
Adds overflow scrolling to search results
getdave 26c4c1b
Fix to stop scroll shadow overlaying scrollbars
getdave e778a04
Add bespoke settings area and tweak styles
getdave 3ca482e
Update to allow URLs to be conditionally handled as a suggestion
getdave aec9f39
Updates to conditionally use an entity or url based search results fe…
getdave 70bd877
Fix bug whereby fetchSearchSuggestions wasn’t called
getdave 58220f8
Remove default toggle UI and implement Popover close
getdave 5eeb819
Adds search text “highlighting” in results list
getdave d355133
Move TextHighlight component to its own file
getdave 2044065
Fix bug where update to value prop didn’t cause suggestions to reset.
getdave b256d55
Update to remove internal handling of open/closed state
getdave b55f557
Fix React violation by returning only the text for non matches
getdave 2133fb1
Update existing tests to match new implementation
getdave 70c5c04
Add link reset test
getdave 4a031ed
Adds test which uncovers major bug in the implementation
getdave 5b5164c
Tweak critical test to be more explicit about what is expected
getdave 664daad
Fix bug to make determining search handler use the latest input value
getdave 9780959
Add loading spinner and associated test coverage
getdave 5c3bf35
Fix bug where value could be empty
getdave c962dc6
Adds basic editing / view state switching
getdave d4c0a70
Add keydown callback to URLInput
getdave 8cff4c2
Select link on ENTER keydown event
getdave b4a3f66
Utilise LinkViewer to render edit state and decode urls for display
getdave fbe49e7
Only display link settings when a link is selected
getdave fa0dd36
Adds current link view styles
getdave f5a7e65
Makes settings toggle controlled by parent component
getdave a88826e
Update visuals to match updated design
getdave ec9e2ad
Add standardised min width to popover
getdave 11ca79f
Temporary hack to include Link UI in Playground for testing
getdave 779d440
Update to utilise isURL util from @wordpress/url package
getdave 4941bb8
Update to utilise isURL util from @wordpress/url package
getdave 452ec55
Removes URLPopover dependency
getdave 5484a7c
Extract settings drawer to sub component
getdave 37de5d9
Refactor search items into a component
getdave ba32148
Refactor Input and Search to component
getdave 33467f3
Fix missing selected state on search suggestions
getdave 553be99
Tweak line height on search suggestion url path
getdave ad46c87
Augment test for URL-like by testing for “www.”
getdave 26c292f
Fix to stop url overflows and wrapping on to multiple lines
getdave 17be2f8
Uppcase URL in type indicator within search results list
getdave 13f5ce1
Avoid reading out slug/URL for entity results
getdave 556088a
Ensures i18n of change button
getdave 1cdd939
Always offer URL result in search suggestions as default
getdave 2588b9e
Fix loading spinner position and dim results during loading
getdave a065936
Fix scroll shadows to use valid alpha transparent values in gradient
getdave 98836fd
Adds instructional text in place of URL for suggestions that are URLs
getdave 5254015
Update prop names for consistency
getdave 811ad11
Update line length to improve readability
getdave 9cd6d18
Update to avoid need to utilise partialRight util from lodash
getdave bdb6217
Updates key to avoid usage of index
getdave d0a348b
Update to remote isFunction check in favour of direct check
getdave da212f0
Update to handle mailto and tel protocols and internal links
getdave 19d5e64
url-input: handle onKeyPress type event
retrofox 548279b
link-control: add className prop
retrofox a844800
link-control: add README file
retrofox fd3a6ef
Remove unnecessary use of useCallback
getdave b314c49
Fix current automated tests
getdave 5aeb531
Improves URL handling test to run for multiple URL value variations
getdave 1a7c285
Updates to display the URL type in the search results
getdave 63201c9
Refactor tests to assert against all valid protocol formats and link …
getdave 4918184
Adds test to cover display of fallback URL search result for search v…
getdave cd29ab5
Adds tests to check URL suggestions don’t display for non-URLs.
getdave 2d8befb
url-input: remove unneeded `suggestion` const
retrofox d8895d5
url-input: always trigger onKeyDown event
retrofox 2413016
link-control: delegate handling keydown event
retrofox e3042c8
link-control: add onKeyDown and onKeyPress handlers
retrofox 0a9d558
link-control: playground -> close once onClose
retrofox 89e92fb
link-control: propagate onClose() event
retrofox ff57160
link-control: playground -> hanldling close by ESCAPE key
retrofox 48e5f44
Fix to only render settings draw if settings are defined
getdave 4e811db
Remove redundant commented out test
getdave 43c30b2
Update to render with a “current link” if one is provided.
getdave 158ea3e
Render playground with currentLink active
getdave 4981a71
Adds test to cover currentLink prop
getdave f1c54a6
Remove selected state from Playground
getdave 797fd6c
Adds tests to cover selecting and changing links
getdave e5e44e6
Remove async function in place of direct Promise usage and add test c…
getdave 5ba4b65
Add test to cover keyboard handling
getdave d5abad2
Remove unecessary dep from effect
getdave 5c1ec22
Fix URLInput to pass the actual suggestion object not the index
getdave 4d5b455
Fix keyboard handling so hitting `ENTER` will select an item as the c…
getdave b8a01bd
Updates keyboard interaction test to include URL entry
getdave 7df9aa5
Minor: reword test description
getdave b6edb73
Fix missing key prop regression
getdave b435b49
DRY up conditionals
getdave 8c5ed79
link-control: set a default experimental link suggestions searcher if…
retrofox 1fffe8e
link-control: handling key events
retrofox 1c1614d
url-input: remove onKeyDown prop
retrofox 0cdf706
url-input: remove calling onKeyDown prop
retrofox 2f80347
url-input: rollback some changes
retrofox b93a0db
Mark Link Creation Interface as Experimental (#18110)
marekhrabe 5b6715d
Remove unused prop from docs
getdave 280db32
Update props ordering and readme docs
obenland ba985eb
Revert playground changes
obenland 7d35791
Rename InputSearch to SearchInput
obenland e7585b8
Remove disabling of jsx-key lint rule
talldan 8450bb1
Change fake id value to something that will not clash with post ids
talldan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove default toggle UI and implement Popover close
The LinkControl will be mostly where another element triggers the UI to appear. As a result we don’t want to force a toggle element on the developer. Rather we will expose an API to allow the consuming component to toggle the visibility of the LinkControl
- Loading branch information
commit 58220f84d2de6969e29cf03dd0b06c5f9608553a
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this was due to refactoring, but this doesn't seem to need
async
as far as I can tell. The use inPromise.all
below seems unnecessary.