Ghost/ghost/admin/lib/koenig-editor/addon
Kevin Ansfield 516ad8297a Added media selector pattern to editor and used it for gifs
refs https://github.com/TryGhost/Team/issues/1225

Re-using the existing pattern of creating an image card and having it launch an image selector was proving to have a lot of edge cases when we wanted a more streamlined in-line image selector for gifs.

- added a new `'selector'` type to card definitions
  - requires a `selectorComponent` argument that is the name of a component that renders the media and handles search
  - updated card components to open the selector component when respective menu item is activated
  - updated slash menu to instantly trigger the selector component when the slash command matches a card and is followed by a space so that searches continue inside the selector
- added `<KoenigMediaSelector>` component that wraps the card-definition provided component and handles escape key, clicks outside of the editor, and provides a stripped down API to the child component for selecting/closing
- added `<KoenigMediaSelectorTenor>` which mostly replicates the `<GhTenor>` component but has different styling and uses the provided media selector API
2021-11-23 09:20:30 +00:00
..
components Added media selector pattern to editor and used it for gifs 2021-11-23 09:20:30 +00:00
helpers Hid gifs card when tenor API config is not available 2021-11-16 12:14:21 +00:00
lib Resolved "already declared in upper scope" linting warnings 2020-10-05 09:56:21 +01:00
options Added media selector pattern to editor and used it for gifs 2021-11-23 09:20:30 +00:00
services Removed prototype button atom 2021-07-23 09:21:03 +01:00
utils Moved the localstorage utils to be where it's used 2021-11-16 18:18:19 +01:00