Commit Graph

599 Commits

Author SHA1 Message Date
Kevin Ansfield
fccfcc3320 Added scroll-into-view behavior for highlighted gifs
refs https://github.com/TryGhost/Team/issues/1225

- added `scroll-into-view` modifier that will scroll an element into view putting it at the top or bottom of the viewport depending on which direction scroll is required
- used the `scroll-into-view` modifier to scroll the highlighted gif into view
2021-11-29 19:33:35 +00:00
Kevin Ansfield
66e6502cd2 Added first iteration of gif selector keyboard navigation
refs https://github.com/TryGhost/Team/issues/1225

Behaviour:
- `TAB`
  - highlights first gif if pressed whist search has focus
  - moves highlight to right, wrapping to next row, stops at final gif
- `SHIFT+TAB`
  - moves highlight to the left, wrapping to previous row
  - focuses the search bar if pressed whilst first gif is highlighted
- `ENTER`
  - highlights first gif if pressed whilst search has focus
  - inserts the highlighted gif
- `UP`
  - moves highlight up through current column
  - focuses the search bar if pressed when gif in top row is highlighted
- `DOWN`
  - highlights first gif if pressed whilst search has focus
  - moves highlight down through current column, stops at final gif in column
- `LEFT`
  - moves highlight to the left, wrapping to previous row
  - focuses the search bar if pressed whilst first gif is highlighted
- `RIGHT`
  - moves highlight to the right, wrapping to next row, stops at final gif
2021-11-29 18:28:19 +00:00
Kevin Ansfield
aa9a9c9598 Removed unused tenor components from earlier iterations
refs https://github.com/TryGhost/Team/issues/1225

- iterations of earlier approaches (modal-image-selector, and kg-media-selector) for the gif selector were kept around whilst we narrowed down the interaction patterns, we've settled on the inline-image-selector pattern introduced in 3f3b66b668 meaning the others are no longer needed
2021-11-29 18:28:19 +00:00
Thibaut Patel
ad90ad0236 Updated the product card first version
refs https://github.com/TryGhost/Team/issues/1233

- added a way to remove the product image
2021-11-29 18:29:33 +01:00
Thibaut Patel
93dba3cb9a Updated the first version of the product card
refs https://github.com/TryGhost/Team/issues/1233

- Moved to in-line editing for the title/description
- Only the button is clickable. The button dissapears if the text/href isn't defined
- Added an image (the image can't be deleted for now)
2021-11-29 17:50:56 +01:00
Kevin Ansfield
09cae883a8 Added drag/drop and paste support for video files
refs https://github.com/TryGhost/Team/issues/1229

- generalized `insertImageCards()` to `insertCardsFromFiles()` and added support for video cards
- added `canInsertCardsFromFiles()` function so the editor can check before starting an editor run loop and generating an undo point
2021-11-29 13:38:31 +00:00
Kevin Ansfield
7e4a277163 Extracted insertImageCards function into utils file
no issue

- preparation for adding additional files->cards utility functions for video/audio/file cards
2021-11-29 13:13:07 +00:00
Kevin Ansfield
d3bd7e8767 Added mimeType to video metadata extraction
refs https://github.com/TryGhost/Team/issues/1229

- `mimeType` was specified in the payload but it had been missed when extracting/setting the video metadata
2021-11-29 13:09:39 +00:00
Kevin Ansfield
3231abd0ae Added beginnings of the video card
refs https://github.com/TryGhost/Team/issues/1229

- mostly mirrors image card functionality but rebuilt with more modern syntax
- when uploading a video the size and duration is extracted along with a screen capture of the video from 0.5s in, the screen capture is uploaded once the video finishes because we need to use the uploaded video url as a reference to attach it as a thumbnail via the API
- the captured screenshot is currently what's shown in the card

To be implemented:
- "incomplete" state when video has been uploaded but not a thumbnail
- uploader in settings panel to change the video thumbnail
- play button overlay _or_ switch to `<video>` so it can be previewed
2021-11-29 09:28:10 +00:00
Kevin Ansfield
30b9718359 Added insertOnSpace attribute to card definitions
refs https://github.com/TryGhost/Team/issues/1225

- if set, typing `/card-name<space>` will instantly insert the card. Useful for cards that will trigger a media browser or similar where continuing to type will search with card-specific autocomplete
2021-11-25 16:13:55 +00:00
Kevin Ansfield
91191fea48 Added toggling between blockquote/aside/p via quote toolbar button
refs https://github.com/TryGhost/Team/issues/1239

- added new action for toggling quote sections that will loop through blockquote/aside/p when clicked
- copied `kg-quote.svg` to `kg-quote-2.svg` ready for alternate icon designs
2021-11-25 10:22:44 +00:00
Kevin Ansfield
7ff73753c8 🐛 Fixed /unsplash search term not including all words
no issue

- card definitions allow multiple params split by spaces in /menu commands but that meant for search terms that included spaces only the first word was being captured
- updated the param handling so the last param specified includes all remaining words in the slash command
2021-11-24 22:41:18 +00:00
Kevin Ansfield
0f517ad4e6 Added scroll-into-view behaviour for inline image selector
refs https://github.com/TryGhost/Team/issues/1225

- added `scrollToCard` action to `koenig-editor` and passed it through to all card components curried to already include the card as an argument
  - action selects the card which places the cursor on it, then triggers our existing cursor scroll-into-view behaviour with an option to allow scrolling a card into view
- updated our cursor scroll-into-view behaviour so if the cursor is large (eg, when it covers a card's height) we make sure the top of the cursor is kept in view rather than the bottom
  - ensures that on small-height screens, opening the gif selector doesn't result in it's search bar being scrolled off screen
2021-11-24 20:02:10 +00:00
Kevin Ansfield
5116c86557 Fixed error when cleaning up empty image card
refs https://github.com/TryGhost/Team/issues/1225

- deleting an empty image card in the initial cleanup phase triggers the `onDeselect` action in the card but at that point the card's section no longer exists in the editor post model which was causing errors when attempting to replace it's section with an empty paragraph
2021-11-24 19:55:40 +00:00
Kevin Ansfield
c1cae814e2 Fixed hover outline on inline image selector
refs https://github.com/TryGhost/Team/issues/1225

- static outline was removed but we were still showing an outline when hovered
- added `media-card-placeholder` kg-style case that is the same as `media-card` but without the `kg-card-hover` class
2021-11-24 19:30:20 +00:00
Kevin Ansfield
bfa90a3b2b Removed selected-card outline from inline gif selector
refs https://github.com/TryGhost/Team/issues/1225

- when we're showing a placeholder style image selector we shouldn't show the extra green border around the browser, they should have their own borders and not look exactly like a card
2021-11-24 18:51:46 +00:00
Kevin Ansfield
dbf242a149 Fixed gif selection through inline gif selector
refs https://github.com/TryGhost/Team/issues/1225

- updated `selector-tenor` component to use the correct passed-in action
- fixed focus moving to top of the editor after selecting a gif or unsplash image
2021-11-24 18:48:49 +00:00
Kevin Ansfield
8996bf62a2 Fixed linting error 2021-11-24 16:20:09 +00:00
Kevin Ansfield
3f3b66b668 Added image card placeholder-style image selector and switched gifs card
refs https://github.com/TryGhost/Team/issues/1225

- the `imageSelector` options in the image card have been expanded to have both a `component` and a `type` property. If the `type` is set to "placeholder" the related image selector component will be rendered in place of the default upload placeholder
  - updated `isEmpty()` so the card is always cleaned up if no src has been selected - prevents image selectors popping up when opening a post if it was saved whilst the image selector was open
  - updated close-selector behaviour to exit back to a blank paragraph so a different image embed type can be selected easily instead of leaving an image card that you then have to delete, create a new paragraph, and choose the embed type
- added `koenig-image-card/selector-tenor` child component
  - the same as `koenig-media-selector-tenor` except with the "Escape" key handling added
  - added as a separate component for now to allow for easy switching until we're settled on the selector type we want
2021-11-24 16:17:02 +00:00
Kevin Ansfield
67a10184dc Added scroll-into-view when opening media selector
refs https://github.com/TryGhost/Team/issues/1225

- when opening the media selector and the bottom is cut off, scroll the whole selector into view so it's bottom is 20px away from the viewport bottom
- if the adjusted scroll would hide the top of the selector, make sure the top is 20px from the viewport top leaving the bottom cut off
2021-11-23 16:35:44 +00:00
Peter Zimon
591d5442e5 GIF browser refinements 2021-11-23 16:03:53 +01:00
Kevin Ansfield
d510883be5 Fixed scroll jump when media selector opens
refs https://github.com/TryGhost/Team/issues/1225

- if there's not enough space at the end of the editor canvas to fit the selector the browser adds extra space and pushes the scroll up making things feel janky
- added a scroll position reset as soon as the selector renders so nothing jumps around, the canvas just extends so it's possible to scroll the full selector into view
2021-11-23 09:20:30 +00:00
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
Kevin Ansfield
ddc799cdc1 Fixed selecting emoji in callout card deselecting card
no issue

emoji-button uses focus-trap (https://www.npmjs.com/package/focus-trap) to gain/keep focus and allow clicks on the background to close the picker. Unfortunately when deactivating the focus-trap it attempts to return focus but it ends up putting the cursor back at the beginning of the post, deselecting the card and causing scroll jump.

- changed the `<div>` we were using as a button to trigger the emoji picker to `<button>` so that it's focusable meaning `focus-trap` returns focus there when the picker closes keeping focus inside the card
2021-11-23 00:30:21 +00:00
Thibaut Patel
0285f02fb6 Added first pass of product card
refs https://github.com/TryGhost/Team/issues/1233

- adds card that contains a a title, description wrapped in a link
- this hasn't been designed yet so I didn't add any css
2021-11-22 12:38:46 +01:00
Peter Zimon
59e1fc5b6d Fixed copy for GIF card menu 2021-11-19 17:33:25 +01:00
Rishabh
0f460a646b Fixed lint 2021-11-19 19:41:02 +05:30
Rishabh
3b49732cbb Added first pass of upload cards
refs https://github.com/TryGhost/Team/issues/1229
refs https://github.com/TryGhost/Team/issues/1230
refs https://github.com/TryGhost/Team/issues/1231
2021-11-19 19:34:17 +05:30
Kevin Ansfield
c35cdae491 Fixed callout card emoji picker clicks exiting card's edit mode
refs https://github.com/TryGhost/Team/issues/1206

Clicking inside the emoji picker was causing focus to be lost which then deselected the card causing an annoying jump between rendered/edit mode whilst working on the card's content. A secondary issue was the picker sticking around after you intentionally clicked elsewhere in the document to leave edit mode.

- before initiating the emoji-button instance, create a container that's appended at the bottom of the document body and that prevents any click events on elements inside the container from bubbling up and causing focus changes. Updated the emoji-button instance to render the picker inside that container
- added a call to hide the picker any time the card leaves edit mode
2021-11-19 12:16:08 +00:00
Kevin Ansfield
34e34618c3 Added soft-break support to callout card editor
refs https://github.com/TryGhost/Team/issues/1206

- added `@allowBr` argument to `<KoenigBasicHtmlInput>` and used it in the callout card
  - when enabled, adds `soft-break` atom and parser, enables `<br>` support in `cleanBasicHtml()`
2021-11-19 10:10:23 +00:00
Peter Zimon
d1afdd3b6b Replaced GIF icon 2021-11-19 10:32:43 +01:00
Rishabh
2846cc6989 Removed indicator icon from toggle card
refs https://github.com/TryGhost/Team/issues/1209
2021-11-19 12:21:46 +05:30
Rishabh
461f84660c Updated icon for toggle card
refs https://github.com/TryGhost/Team/issues/1209
2021-11-19 12:11:50 +05:30
Kevin Ansfield
9655b76610 Added cleanup of emoji picker
no issue

- housekeeping when the callout card component is destroyed
2021-11-18 18:57:22 +00:00
Kevin Ansfield
d1e1c8b11c Fixed "Enter" in callout card throwing an error if text has been changed
no issue

- we had some code in `<KoenigEditor>` that was automatically saving a card when exiting edit mode based on some flawed logic, this meant we were making multiple editor updates simultaneously resulting in usage+change of the upstream `post` model within the same render loop (add paragraph code deselected the card, starts adding new paragraph, the deselection triggered the exit-edit mode which then caused a simultaneous post update)
  - passed card env through to `<KoenigEditor>` so that it can compare current payload state against the "saved" payload state to determine if it should save when leaving edit mode
- renamed `_textReplacementEditor` to `_calloutTextEditor` to better match it's usage
- removed unnecessary `onNewline` handling, it wasn't being called because we overrode `ENTER` key
2021-11-18 18:57:21 +00:00
Kevin Ansfield
0295cf2707 Fixed callout card display in non-edit mode
no issue

- switching to `<KoenigBasicHtmlInput>` means that the payload is no longer wrapped in `<p>` tags because the callout should not be a multi-paragraph input
2021-11-18 18:56:23 +00:00
Peter Zimon
b3f74c1d88 GIF card refinements 2021-11-18 19:08:01 +01:00
Peter Zimon
9150af46e6 Removed Button indicator icon 2021-11-18 17:53:51 +01:00
Peter Zimon
5c5fd1cff4 Added NFT icon to card menu 2021-11-18 17:38:28 +01:00
Peter Zimon
07b1ac62dd NFT card refinements 2021-11-18 17:29:16 +01:00
Peter Zimon
f69930f0af Added Opensea logo to NFT cards 2021-11-18 17:29:16 +01:00
Thibaut Patel
ca70c5e0dc Moved the callout editor to KoenigBasicHtmlInput
refs https://github.com/TryGhost/Team/issues/1206

- The KoenigBasicHtmlTextarea wasn't an option as the `Enter` key was binded to a line return. And we want to use the `Enter` key to switch to the next paragraph outside of the callout card.
2021-11-18 16:12:39 +01:00
Fabien O'Carroll
8dd02d2ed3 Removed unused NFT Card files
https://github.com/TryGhost/Team/issues/1211

These were added before we made the NFT card a subset of the Embed card.
2021-11-18 14:29:23 +02:00
Kevin Ansfield
c4643314f3 Fixed issues with special formats not closing properly in <KoenigBasicHtmlInput>
no issue

- added missing special markup definitions for formats that are allowed via markdown text expansions
2021-11-18 12:24:56 +00:00
Kevin Ansfield
72ce1648a2 Fixed function name typo
refs 3d55bc2797
2021-11-18 11:59:22 +00:00
Kevin Ansfield
3d55bc2797 Fixed <KoenigBasicHtmlTextarea> using <KoenigTextReplacementInput> text expansions
no issue

- text-replacement-input text expansions were customised to not use backticks for code and to have special format handling for `{}`
- switched to it's own set of text expansions that cover the standard expansions used in the main editor except for headings and card replacements
2021-11-18 11:57:41 +00:00
Kevin Ansfield
ca89bc9522 Added code formatting key command support to <KoenigBasicHtmlTextarea>
no issue

- the component was still using the text-replacement component's key commands which didn't include code formatting because code in text-replacement component is re-purposed for replacement string highlights
2021-11-18 11:28:41 +00:00
Thibaut Patel
8d1c1731eb Restore the latest callout emoji when toggled off/on
refs https://github.com/TryGhost/Team/issues/1206

- Store the latest emoji locally in the component
- Create a defaultEmoji method to ease retrieving the right emoji
- Use the default emoji when toggling the emoji back on in the card
- Still use 💡 as the default callout emoji
2021-11-18 11:16:31 +01:00
Thibaut Patel
3024868250 Exit callout/toggle cards on pressing enter
refs https://github.com/TryGhost/Team/issues/1206

-  When editing, pressing enter exists the edit mode and adds a new paragraph after the card.
2021-11-18 11:00:18 +01:00
djordje vlaisavljevic
43d1981d73 Updated Accordion card styles in editor 2021-11-18 09:58:32 +01:00
Rishabh
e4b3beee75 Updated focus to toggle card heading in edit mode
refs https://github.com/TryGhost/Team/issues/1209
2021-11-18 11:47:02 +05:30
Thibaut Patel
e6fa0bc449 Removed the default editor placeholder on edit
refs https://github.com/TryGhost/Team/issues/1206

- Because we allow <br> in the editor, the editor placeholder was remaining when editing (<p><br></p>). This clean the editor placeholder.
2021-11-17 18:26:34 +01:00
Thibaut Patel
042a772ebe Fixed an error on the KoenigBasicHtmlTextarea
refs https://github.com/TryGhost/Team/issues/1206

- Backspace was triggering the error due to undefined `SPECIAL_MARKUPS`
2021-11-17 16:30:27 +01:00
Peter Zimon
67ec0318a2 NFT card refinements 2021-11-17 14:05:55 +01:00
Thibaut Patel
9cddf73ad6 Added an active class on the callout emoji picker
refs https://github.com/TryGhost/Team/issues/1206

- Enables changing the emoji picker button style conditionally
2021-11-17 12:38:28 +01:00
djordje vlaisavljevic
afe40c8792 Update Accordion editor styles 2021-11-17 12:14:10 +01:00
Kevin Ansfield
9a961a87a2 Fixed nft embed outline and missing snippet toolbar icon
refs https://github.com/TryGhost/Team/issues/1211

- the outline and snippet availability were toggled on `payload.html` presence which isn't set for nft embeds. Switched to toggling on `payload.type` instead as per the main rendered/blank slate conditional
2021-11-17 09:52:10 +00:00
Rishabh
4837249d89 Fixed paste not working in toggle card heading
refs https://github.com/TryGhost/Team/issues/1209
2021-11-17 15:12:31 +05:30
Sanne de Vries
69a7788f20 Added generic class to callout card
No ref

- The card needs the .kg-card class to be spaced correctly in themes
2021-11-17 08:56:18 +01:00
Fabien O'Carroll
6ef642a5e8 Updated NFT card handling in the editor
refs https://github.com/TryGhost/Team/issues/1211

Using `type` rather than `card_type` since that's been replaced in the
API.

Moves the rendering of the card in the template so that we get
access to the caption editor, and selectable card (rather than the
anchor tag redirecting us to OpenSea)

Updates the `isEmpty` property to take into account NFT cards.
2021-11-16 21:35:27 +02:00
Thibaut Patel
24d27f96f0 Fixed vanishing empty callout when changing emoji
refs https://github.com/TryGhost/Team/issues/1206

- Updated to consider a callout card empty only when both the emoji and the text is empty
2021-11-16 19:17:04 +01:00
Kevin Ansfield
45fec25930 Updated tenor API config keys and added contentfilter support
refs https://github.com/TryGhost/Team/issues/1217

- tenor API config is now an object that lives at `config.tenor`
- updated gifs card gating to use the new config object
- added passthrough of `contentfilter` param from config when making Tenor API requests
2021-11-16 17:44:37 +00:00
Thibaut Patel
5696ee53fc Moved the localstorage utils to be where it's used
refs https://github.com/TryGhost/Team/issues/1206

- Fixes the previous commit (78540cabfd)
2021-11-16 18:18:19 +01:00
Thibaut Patel
78540cabfd Save the latest callout card emoji
refs https://github.com/TryGhost/Team/issues/1206

- Re-use the saved emoji as the default for future callout cards
- Introduced a localstorage util that ignores errors. Ignoring errors avoids issues with browsers that don't support localstorage
2021-11-16 18:10:27 +01:00
Thibaut Patel
a09d5ca14d Allow line-returns in callout card
refs https://github.com/TryGhost/Team/issues/1206

- Uses the `softReturn` parser to maintain line returns when editing the callout card
2021-11-16 17:11:00 +01:00
Thibaut Patel
568c523ff2 Allow line-returns in callout card
refs https://github.com/TryGhost/Team/issues/1206

- This only solves partially the line-returns being eaten by the editor. When editing a card with a line return, it will be removed.
2021-11-16 15:04:56 +01:00
Sanne de Vries
3ec39ae255 Styled emoji picker in callout card 2021-11-16 13:34:44 +01:00
Kevin Ansfield
cdf0565d3b Hid gifs card when tenor API config is not available
refs https://github.com/TryGhost/Team/issues/1220

- added array support to `{{card-is-available}}` helper where every key needs to be present for the card to be available
- changed gifs card `isAvailable` property to require both the feature flag and the tenor api key to be set in config
2021-11-16 12:14:21 +00:00
Peter Zimon
527043a89d Set Button alignment to center 2021-11-16 09:04:35 +01:00
Peter Zimon
77c2a9eba7 Button refinements 2021-11-16 08:59:28 +01:00
Sanne de Vries
430989d722 Updated callout card dark-mode 2021-11-15 20:48:02 +01:00
Thibaut Patel
8e3bce3c49 Updated the html textarea editor code shortcut
refs https://github.com/TryGhost/Team/issues/1206

- the editor will behave like the main Ghost editor and will wrap text between backticks with a <code> tag
2021-11-15 18:48:24 +01:00
Kevin Ansfield
04fe62012d Dropped deprecated {{action}} usage in callout card and removed
no issue

- `{{action}}` is deprecated and is only available for backwards compatibility with action hashes in non-Glimmer components
- for event handlers we should be using the `{{on}}` modifier to use `addEventListener` on an element rather than directly attaching JS functions using `onclick=` attributes to avoid subtle DOM event ordering bugs
2021-11-15 17:37:29 +00:00
Thibaut Patel
be60693189 Partially revert changes from previous commit
refs 35db77e342

- This wasn't affecting HTML replacement so it had no reason to go
2021-11-15 18:31:09 +01:00
Thibaut Patel
35db77e342 Removed email-specific code from the html textarea
refs https://github.com/TryGhost/Team/issues/1206

- prevents text in curly brakets from being wrapped into a <code> tag
- updated the callout card to this generic textarea editor instead of the email-specific editor
2021-11-15 17:58:01 +01:00
Kevin Ansfield
5268ad1f77 Swapped feature card setting for isAvailable
no issue

- the number of properties that cards have in their definition was growing so it made sense to drop the single-use `feature` property in favor of the `isAvailable` property that can perform the same functionality
2021-11-15 16:43:44 +00:00
Kevin Ansfield
4ca14b8eee 🐛 Fixed Unsplash image selector being available in editor when disabled
closes https://github.com/TryGhost/Team/issues/1223

It's possible to disable the Unsplash integration from the integration settings but when disabled the image selector was still available for post feature images and as an editor embed option.

- adds `isAvailable` property to card definitions, if it's set it should be a string that matches a config/setting that determines the card's availability
  - unsplash card updated to use `'settings.unsplash'` as it's `isAvailable` property
- adds conditional to `<GhEditorFeatureImage>` so the Unsplash selector is only shown when enabled to bring it inline with the `<GhImageUploader>` component that was used previously for post feature images
2021-11-15 16:38:57 +00:00
Fabien O'Carroll
747e6c9533 Handled missing html property for NFT Oembed response
refs https://github.com/TryGhost/Team/issues/1211

Since we have switched to rendering the NFT card outside of the OEmbed
response we no longer include a html property. This check would throw
for missing HTML so we've updated it to not include NFT cards
2021-11-15 15:49:42 +02:00
Fabien O'Carroll
b8dd7c6af2 Revert "Added support for no-iframed embeds"
This reverts commit 8e29e8de79.
2021-11-15 15:49:42 +02:00
Fabien O'Carroll
dad82ec463 Revert "Fixed embeds without iframe resizing iframe"
This reverts commit 85c8674299.
2021-11-15 15:49:42 +02:00
Thibaut Patel
82ccb36338 Added an emoji picker for the callout card
refs https://github.com/TryGhost/Team/issues/1206

- Uses https://emoji-button.js.org/ for the emoji panel and search
- Displayed when the callout card emoji is clicked
2021-11-15 14:19:20 +01:00
Sanne de Vries
e2f149ca45 Updated callout icon in card menu
Refs https://github.com/TryGhost/Team/issues/1206
2021-11-15 13:47:36 +01:00
Fabien O'Carroll
0f839a9d27 Added child component for NFT Embeds
refs https://github.com/TryGhost/Team/issues/1211

We've moved the rendering of HTML outside of the OEmbed endpoint - so
the Admin needs to handle constructing the HTML from the OEmbed response
metadata.
2021-11-15 11:02:27 +02:00
Fabien O'Carroll
85c8674299 Fixed embeds without iframe resizing iframe
refs https://github.com/TryGhost/Admin/commit/8e29e8de7

The listener for resize is added on the first render of the component,
so we cannot check for the existence of the iframe then.
2021-11-15 11:01:37 +02:00
Kevin Ansfield
cd6d167f77 Added repositioning of settings panel when it's size adjusts
refs https://github.com/TryGhost/Team/issues/1219

- added optional `adjustOnResize` argument to `{{movable}}` modifier
  - when the movable element's size changes (based on a `ResizeObserver` event) the passed in action is called with the element and the current x/y position
  - having this handled via the `{{movable}}` modifier is needed because that's what knows about any CSS translations that are present and allows the drag position to remain in sync with any resize-related adjustments
  - return value of the action is expected to be a new `{x, y}` tuple
- used `adjustOnResize` in the `<KoenigSettingsPanel>` component so that any time the settings panel grows and causes part of it to be off-screen we re-position so that the whole panel is kept on-screen
2021-11-12 18:45:03 +00:00
Kevin Ansfield
6853b964f8 First iteration of gifs image selector + card
refs https://github.com/TryGhost/Team/issues/1217

- adds `tenor` service that acts as a coordinator for the Tenor API similar to the `unsplash` service
- adds `<GhTenor>` component that renders an image search and select modal using the `tenor` service
- swapped the gifs card over to use the `tenor` image selector so it opens the tenor modal instead of the unsplash modal
2021-11-12 16:10:26 +00:00
Rishabh
b4415830e6 Refined design for toggle card in edit mode
refs https://github.com/TryGhost/Team/issues/1209
2021-11-12 16:31:39 +05:30
Rishabh
5e01b94bb1 Fixed default tag override not working on edits for html input component
no refs

- we added a default tag override for basic html input component, but the edit mode was still using `p` as the tag irrespective of default set, which caused switching back to p tag when editing the component
2021-11-12 16:31:39 +05:30
Rishabh
57b318de52 Added new html textarea component
refs https://github.com/TryGhost/Team/issues/1209

- adds new `KoenigHtmlTextarea` component for entering multi line html in cards
- updates accordion card to use html text area component
2021-11-12 16:31:39 +05:30
Kevin Ansfield
6190feb0b9 Added gifs card to card menu
refs https://github.com/TryGhost/Team/issues/1217

- behind the `gifsCard` feature flag
- currently maps to the unsplash image selector whilst we're building out an alternative selector
2021-11-12 10:09:36 +00:00
Sanne de Vries
549f89084f Updated callout-card color picker
Refs https://github.com/TryGhost/Team/issues/1206

- Replaced select component for color palette picker
- Added support for brand color
2021-11-11 15:48:14 +01:00
djordje vlaisavljevic
8f73a4e39b Updated Accordion card container and styles 2021-11-11 15:18:29 +01:00
Peter Zimon
e106188d39 Updated Button card menu icon 2021-11-11 14:26:21 +01:00
Fabien O'Carroll
8e29e8de79 Added support for no-iframed embeds
refs https://github.com/TryGhost/Team/issues/1211

This is to allow us to style the NFT embed card in the Admin
2021-11-11 13:46:26 +02:00
Rishabh
d3cfa14498 Allowed custom default tag for html input component
no refs

- allows custom html tag to be passed in to basic html input component
- updates accordion heading input to use basic html input with h4 tag
2021-11-11 16:49:04 +05:30
Rishabh
697420957c Refined toggle card design in edit mode
refs https://github.com/TryGhost/Team/issues/1209
2021-11-11 16:49:04 +05:30
Peter Zimon
6a8976a683 Updated copy for Button card tooltip 2021-11-11 12:05:36 +01:00
Kevin Ansfield
49d32c4ca4 Added "incomplete" state for button card
refs https://github.com/TryGhost/Team/issues/1210

- when rendered, show button as greyed out if either text or url is missing
  - show "Add button URL" in tooltip if the url is missing
  - show "Add button text" in button if the text is missing
- adds wrapper element so the tooltip is not greyed out
2021-11-11 09:24:20 +00:00
Thibaut Patel
276841a523 Added background color config for the callout card
refs https://github.com/TryGhost/Team/issues/1205

- Stored in the payload as an hexadecimal (or variable) value
- chosen with a dropdown through a pre-selected list of colors (or the publication accent color)
2021-11-10 18:31:00 +01:00
Thibaut Patel
075d529e65 Added an emoji toggle for the callout card
refs https://github.com/TryGhost/Team/issues/1205

- Uses the KoenigSettingsPanel to display a toggle
- The Emoji is set to an empty string when disabled
- And arbitrarily set to 💡 by default when toggled back on
2021-11-10 15:51:16 +01:00