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

Experimental Link creation interface #17846

Merged
merged 113 commits into from
Oct 30, 2019
Merged

Experimental Link creation interface #17846

merged 113 commits into from
Oct 30, 2019

Commits on Oct 8, 2019

  1. Configuration menu
    Copy the full SHA
    8dbc2bd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ee008be View commit details
    Browse the repository at this point in the history
  3. Adds basic search input

    getdave committed Oct 8, 2019
    Configuration menu
    Copy the full SHA
    e685003 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    70049ad View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    98e6aa5 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    85a6317 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8ec1488 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2019

  1. Configuration menu
    Copy the full SHA
    140cc90 View commit details
    Browse the repository at this point in the history
  2. Adds render prop to enable custom suggestions rendering

    Previously it wasn’t possible to customise the render of the search suggestions. By providing an optional render prop we now have full control over this if required.
    getdave committed Oct 9, 2019
    Configuration menu
    Copy the full SHA
    d64608e View commit details
    Browse the repository at this point in the history
  3. Update to utilise URLInput render prop to customise search suggestion…

    …s render
    
    Previously we relied on our own render of suggestions but this wasn’t hooked up to all the accessibility enhancements afforded by URLInput. By utilising the render prop exposed by URLInput to customise the rendering of suggestions, we can have the best of both worlds.
    getdave committed Oct 9, 2019
    Configuration menu
    Copy the full SHA
    30e0eb6 View commit details
    Browse the repository at this point in the history
  4. Update to add post type to the fetchLinkSuggestions responsive mapping

    This is required to display the type of entitity in the search results for LinkControl
    getdave committed Oct 9, 2019
    Configuration menu
    Copy the full SHA
    53ce517 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b53c13c View commit details
    Browse the repository at this point in the history
  6. Update suggestion render prop to provide component props as arguments

    Previously when using the `renderSuggestions` render prop the user had to know how to put together the correct props on the correct elements in their custom render. By passing the default props for the listing element and the item element we can relieve the user of this burden by allowing them to spread the props onto the appropriate elements in their render without having to know how they are created.
    getdave committed Oct 9, 2019
    Configuration menu
    Copy the full SHA
    6d7259a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4f32429 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4971e30 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2019

  1. Configuration menu
    Copy the full SHA
    4aea19c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d554b65 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    26c4c1b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e778a04 View commit details
    Browse the repository at this point in the history
  5. Update to allow URLs to be conditionally handled as a suggestion

    Previously when a URL was entered it was deemed that no suggestions should or could be found and so the process of fetching suggestions was short circuited. Add additional prop to optionally allow developers to have URL-like values handled as suggestions.
    getdave committed Oct 10, 2019
    Configuration menu
    Copy the full SHA
    3ca482e View commit details
    Browse the repository at this point in the history
  6. Updates to conditionally use an entity or url based search results fe…

    …tcher
    
    If the current value of the input is a URL then we conditionally pass a different handler for search results to the URLInput component. For URL based values we immediately return a “suggestion” object with values matching those entered by the user. Non URL based values are handled as previously.
    getdave committed Oct 10, 2019
    Configuration menu
    Copy the full SHA
    aec9f39 View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2019

  1. Fix bug whereby fetchSearchSuggestions wasn’t called

    Remove ambiguity by calling the search handler directly rather than proxying through another function and having to apply it immediately.
    getdave committed Oct 11, 2019
    Configuration menu
    Copy the full SHA
    70bd877 View commit details
    Browse the repository at this point in the history
  2. 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
    getdave committed Oct 11, 2019
    Configuration menu
    Copy the full SHA
    58220f8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5eeb819 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d355133 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2044065 View commit details
    Browse the repository at this point in the history
  6. Update to remove internal handling of open/closed state

    This state is now expected to be handled by the consuming component chosing whether or not to render the component. It has no concept of open or closed.
    getdave committed Oct 11, 2019
    Configuration menu
    Copy the full SHA
    b256d55 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b55f557 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2133fb1 View commit details
    Browse the repository at this point in the history
  9. Add link reset test

    getdave committed Oct 11, 2019
    Configuration menu
    Copy the full SHA
    70c5c04 View commit details
    Browse the repository at this point in the history
  10. Adds test which uncovers major bug in the implementation

    Basically this test has revealed that due to the way we’re detecting and handling URL-like values the wrong data fetcher function gets passed to the URLInput component for the first input `change` event.
    
    For example if you paste `https://make.wordpress.com` directly into the input then it is determined to be a URL but because the current fetcher function for the current render is still the handler that deals with entity searches the correct results are not displayed. Adding another character to trigger a re-render will cause the UI to update to the expected state, but this is a major bug.
    getdave committed Oct 11, 2019
    Configuration menu
    Copy the full SHA
    4a031ed View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    5b5164c View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2019

  1. Fix bug to make determining search handler use the latest input value

    Previously we relied on parent component state to choose which search handler to use for the current input term. However, the state was always 1 tick behind so the previous search handler got used. Updating this to use the real time value of the input passed onChange ensures we select the correct search fetcher when the component re-renders.
    getdave committed Oct 14, 2019
    Configuration menu
    Copy the full SHA
    664daad View commit details
    Browse the repository at this point in the history
  2. Add loading spinner and associated test coverage

    Spinner was technically always rendered but it wasn’t visible due to CSS styling. Fix and also cover with tests.
    getdave committed Oct 14, 2019
    Configuration menu
    Copy the full SHA
    9780959 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5c3bf35 View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2019

  1. Configuration menu
    Copy the full SHA
    c962dc6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d4c0a70 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8cff4c2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b4a3f66 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fbe49e7 View commit details
    Browse the repository at this point in the history
  6. Adds current link view styles

    getdave committed Oct 15, 2019
    Configuration menu
    Copy the full SHA
    fa0dd36 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f5a7e65 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2019

  1. Configuration menu
    Copy the full SHA
    a88826e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ec9e2ad View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    11ca79f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    779d440 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4941bb8 View commit details
    Browse the repository at this point in the history
  6. Removes URLPopover dependency

    Attempts to remove unwanted deps on other components. We now utilise Popover directly and suffer no consequences as we are not making use of any bespoke features provided by URLPopover.
    getdave committed Oct 16, 2019
    Configuration menu
    Copy the full SHA
    452ec55 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5484a7c View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2019

  1. Configuration menu
    Copy the full SHA
    37de5d9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ba32148 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    33467f3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    553be99 View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2019

  1. Configuration menu
    Copy the full SHA
    ad46c87 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    26c292f View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2019

  1. Configuration menu
    Copy the full SHA
    17be2f8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    13f5ce1 View commit details
    Browse the repository at this point in the history
  3. Ensures i18n of change button

    getdave committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    556088a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1cdd939 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2588b9e View commit details
    Browse the repository at this point in the history
  6. Fix scroll shadows to use valid alpha transparent values in gradient

    Fixes broken shadows in Safari which didn’t recognise transparent as a value to transition to in a gradient.
    getdave committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    a065936 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2019

  1. Configuration menu
    Copy the full SHA
    98836fd View commit details
    Browse the repository at this point in the history
  2. Update prop names for consistency

    getdave committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    5254015 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    811ad11 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9cd6d18 View commit details
    Browse the repository at this point in the history
  5. Updates key to avoid usage of index

    We cannot assume the suggestion `id` will be unique. This is because at the moment the search results are `Post`s. However in the future we may also need to include `Category` terms and the term IDs could easily clash with the Post IDs as they are in different DB tables.
    
    Using the `type` to differentiate the key.
    
    Addresses #17846 (comment)
    getdave committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    bdb6217 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d0a348b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    da212f0 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    19d5e64 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    548279b View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a844800 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2019

  1. Configuration menu
    Copy the full SHA
    fd3a6ef View commit details
    Browse the repository at this point in the history
  2. Fix current automated tests

    getdave committed Oct 24, 2019
    Configuration menu
    Copy the full SHA
    b314c49 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5aeb531 View commit details
    Browse the repository at this point in the history
  4. Updates to display the URL type in the search results

    Previously only true `http` URLs were formatted with the correct type and the instructional text. Fixes so that all types of manual URL entry are correctly shown as such in the search results.
    
    Adds test to cover mailto variant of this.
    getdave committed Oct 24, 2019
    Configuration menu
    Copy the full SHA
    1a7c285 View commit details
    Browse the repository at this point in the history
  5. Refactor tests to assert against all valid protocol formats and link …

    …variants
    
    This now includes tel, mailto and internal links.
    getdave committed Oct 24, 2019
    Configuration menu
    Copy the full SHA
    63201c9 View commit details
    Browse the repository at this point in the history
  6. Adds test to cover display of fallback URL search result for search v…

    …alues that are potentially URLS
    getdave committed Oct 24, 2019
    Configuration menu
    Copy the full SHA
    4918184 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    cd29ab5 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2d8befb View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    d8895d5 View commit details
    Browse the repository at this point in the history
  10. link-control: delegate handling keydown event

    Instead of this, let's propagate the onKeyDown and onKeyPress events to the parent component
    retrofox committed Oct 24, 2019
    Configuration menu
    Copy the full SHA
    2413016 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e3042c8 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    0a9d558 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    89e92fb View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    ff57160 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    48e5f44 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    4e811db View commit details
    Browse the repository at this point in the history
  17. Update to render with a “current link” if one is provided.

    Previously if you passed in a current link the component would still render with a search box as thought nothing was selected.
    
    Updates so that if `currentLink` is provided the UI reflects that by showing the “selected” item and no search input.
    getdave committed Oct 24, 2019
    Configuration menu
    Copy the full SHA
    43c30b2 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    158ea3e View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2019

  1. Configuration menu
    Copy the full SHA
    4981a71 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f1c54a6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    797fd6c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e5e44e6 View commit details
    Browse the repository at this point in the history
  5. Add test to cover keyboard handling

    Note: this uncovered a bug whereby keyboard handling of “selecting” the link you want to use is broken. This needs to be fixed.
    getdave committed Oct 25, 2019
    Configuration menu
    Copy the full SHA
    5ba4b65 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d5abad2 View commit details
    Browse the repository at this point in the history
  7. Fix URLInput to pass the actual suggestion object not the index

    If the full object is not provided then consuming components have no way of accessing the details of the selected suggestion thereby rendering it useless.
    getdave committed Oct 25, 2019
    Configuration menu
    Copy the full SHA
    5c1ec22 View commit details
    Browse the repository at this point in the history
  8. Fix keyboard handling so hitting ENTER will select an item as the c…

    …urrent link
    
    Builds on previous commit.
    getdave committed Oct 25, 2019
    Configuration menu
    Copy the full SHA
    4d5b455 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b8a01bd View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    7df9aa5 View commit details
    Browse the repository at this point in the history
  11. Fix missing key prop regression

    Previously `buildSuggestionItemProps` was including a key. However the implementation of `LinkControl` changed so that this was not required. However we forgot to reinstate on `URLInput`. This update ensures a key prop is set on the default output.
    
    Note that disabling of the autofocus linting was already in place:
    
    https://github.com/WordPress/gutenberg/blob/04e142e9cbd06a45c4ea297ec573d389955c13be/packages/block-editor/src/components/url-input/index.js#L239
    
    Addresses #17846 (comment)
    getdave committed Oct 25, 2019
    Configuration menu
    Copy the full SHA
    b6edb73 View commit details
    Browse the repository at this point in the history
  12. DRY up conditionals

    getdave committed Oct 25, 2019
    Configuration menu
    Copy the full SHA
    b435b49 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2019

  1. Configuration menu
    Copy the full SHA
    8c5ed79 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1fffe8e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1c1614d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0cdf706 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2f80347 View commit details
    Browse the repository at this point in the history
  6. Mark Link Creation Interface as Experimental (#18110)

    * mark main component as experimental
    
    * mark new URLInput props as experimental
    
    * add experimental onKeyPress
    
    * remove key handlers
    
    * Updates to use alias on experimental props
    
    Addresses #18110 (comment)
    marekhrabe authored and getdave committed Oct 28, 2019
    Configuration menu
    Copy the full SHA
    b93a0db View commit details
    Browse the repository at this point in the history
  7. Remove unused prop from docs

    getdave committed Oct 28, 2019
    Configuration menu
    Copy the full SHA
    5b6715d View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2019

  1. Update props ordering and readme docs

    Also fixes eslint errors that kept me from committing the original changes
    obenland committed Oct 29, 2019
    Configuration menu
    Copy the full SHA
    280db32 View commit details
    Browse the repository at this point in the history
  2. Revert playground changes

    obenland committed Oct 29, 2019
    Configuration menu
    Copy the full SHA
    ba985eb View commit details
    Browse the repository at this point in the history
  3. Rename InputSearch to SearchInput

    Props @talldan
    
    I really hope those changes I had to make in `search-input.js` don't break anything.
    obenland committed Oct 29, 2019
    Configuration menu
    Copy the full SHA
    7d35791 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2019

  1. Configuration menu
    Copy the full SHA
    e7585b8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8450bb1 View commit details
    Browse the repository at this point in the history