Commit Graph

8201 Commits

Author SHA1 Message Date
Daniel Lockyer
f2ad2f5100 v4.25.0 2021-12-01 15:49:29 +00:00
Sanne de Vries
9ad920e985 Updated media card descriptions in cardmenu 2021-12-01 15:00:59 +00:00
Sanne de Vries
9fcaae4475 Updated callout card class for consistency
No ref

- Swapped "kg-card-callout" for "kg-callout-card"
2021-12-01 14:23:47 +00:00
Sanne de Vries
48742a1b15 Updated audio card placeholder 2021-12-01 14:07:05 +00:00
Fabien egg O'Carroll
bf3c3c2db6 Removed developer requirement from nftCard flag
refs https://github.com/TryGhost/Team/issues/1211

This allows us to disable the flag from the backend
2021-12-01 15:08:49 +02:00
Kevin Ansfield
a7cf374566 Added "Gifs" card to the editor
refs https://github.com/TryGhost/Team/issues/1225

When inserted opens a searchable gif selector, creating an image card when a gif is chosen.

Includes keyboard navigation once open:
- `Tab`/`Shift+Tab` cycles highlighted gif through search result order
- `Up` / `Down` / `Left` / `Right` moves highlight in the respective direction
- `Enter` inserts highlighted gif

For the gifs card to be activated it's necessary to add a Tenor API key (obtained freely from https://tenor.com/gifapi) via your config.production.json file:

```
  ...
  "tenor": {
    "publicReadOnlyApiKey": "YOUR_KEY"
  }
}
```
2021-12-01 12:19:10 +00:00
Rishabh
466a779d74 🐛 Fixed broken tiers dropdown on offer screen after Stripe re-connect
closes https://github.com/TryGhost/Team/issues/1246

- offer screen filters out invalid tiers (without prices) in the dropdown as tiers lose their prices on stripe disconnect/reconnect
- this is a temporary user facing workaround till we start removing offer data on stripe disconnect which will solve this properly
2021-12-01 17:46:16 +05:30
Kevin Ansfield
cbdf3bfa28 Added "Button" card to the editor
refs https://github.com/TryGhost/Team/issues/1210

The button card lets you add a center or left-aligned button-styled link to your posts.
2021-12-01 12:01:46 +00:00
Kevin Ansfield
84b8d1be3b Moved cmd+shift+p shortcut handling into <GhPublishmenu>
refs https://github.com/TryGhost/Team/issues/1169

We want all publish actions to trigger a confirmation modal. Currently that confirmation modal is controlled by `<GhPublishmenu>` which made it difficult to use from the route-induced publish shortcut.

- removed old shortcut mixin approach from the editor route
- added modern keyboard handler to a hidden element that is rendered any time the publish menu is present
2021-12-01 11:51:10 +00:00
Sanne de Vries
80148c64db Updated file card icon in cardmenu 2021-12-01 10:29:17 +00:00
Rishabh
e0eff4436c Updated audio card with basic upload behavior
refs https://github.com/TryGhost/Team/issues/1230

- adds thumbnail upload on audio card
- cleans up card design in edit mode
2021-12-01 14:34:40 +05:30
Rishabh
1b4c556837 Extended uploader component to take custom request method
no refs

By default, the uploader component was always using the `post` method to make upload calls for the files. Since some usecases like uploading media thumbnails need a different request method like `put`, this change allows overriding the request method used in upload.
2021-12-01 14:34:40 +05:30
Peter Zimon
fecbbdd2e7 Updated button URL suggestion copy 2021-11-30 17:10:24 -04:00
Peter Zimon
0a700cd10a Gif browser UI refinements 2021-11-30 17:07:07 -04:00
Kevin Ansfield
927a977257 Fixed focus not fully returning to editor after pressing escape in caption input
no issue

- forced card deselection+reselection so that keys such as `Enter` and `Backspace` work as expected when the card is shown as selected
2021-11-30 18:06:17 +00:00
Kevin Ansfield
ba532aa815 Reverted insertion of blank paragraph when selecting unsplash/gif image
refs e419e4e99f

- the behaviour wasn't desirable in all cases, reverting to the previous behaviour of selecting the card after image selection
2021-11-30 18:02:58 +00:00
Kevin Ansfield
024b27c8dd Fixed error when pressing enter inside a caption
refs e419e4e99f

- added an optional options param to `addParagraphAfterCard` but was missing a default value meaning the destructuring errored when the param wasn't provided
2021-11-30 18:02:58 +00:00
Thibaut Patel
1dac565dbc Fixed the product card bold/italic rendering
refs https://github.com/TryGhost/Team/issues/1233

- The content is html so it shouldn't be escaped by handlebars
2021-11-30 18:04:44 +01:00
Thibaut Patel
fc208558dd Added a star-rating input for the product card
refs https://github.com/TryGhost/Team/issues/1245

- This is a proof-of-concept as there are so many ways to implement a star-rating component
- The component is only available when editing the product card
- Uses the unicode star character: ★
- The inspiration is an old article from Lea Verou: https://lea.verou.me/2011/08/accessible-star-rating-widget-with-pure-css/ (minus the clever use of :not(:checked) on something that's not an input to filter-out IE)
- There is currently no way to remove the star rating as it'll get designed this week
2021-11-30 18:02:44 +01:00
djordje vlaisavljevic
f07e5b8c9c Updated product card editor look for 🛹 refs https://github.com/TryGhost/Team/issues/1233 2021-11-30 17:32:02 +01:00
Sanne de Vries
b3e84bfbd8 Updated media card icons in cardmenu 2021-11-30 16:01:40 +00:00
Kevin Ansfield
691308c34e Fixed video card settings panel position when card width changes
closes https://github.com/TryGhost/Team/issues/1244

- moved the `<KoenigSettingsPanel>` usage outside of the `<KoenigCard>` contents so it gets positioned relative to the outer card container rather than the inner card container so it's not affected by the inner card changing width/breaking out of the outer container
2021-11-30 15:32:21 +00:00
Kevin Ansfield
e419e4e99f Added blank paragraph insertion when selecting unsplash/gif image
refs https://github.com/TryGhost/Team/issues/1225

- provides a more obvious continuation point after selecting an image
- added `scrollIntoView` option to `addParagraphAfterCard()` because for large images the cursor in the new paragraph could be pushed out of the visible area
2021-11-30 15:05:41 +00:00
Kevin Ansfield
8e66f6ead5 Fixed editor not having focus after selecting an unsplash/gif image
refs https://github.com/TryGhost/Team/issues/1225

After selecting an image you were left in a state where it looked like the image card is inserted and selected but pressing Cmd+Z, Delete, Enter, etc had no effect.

- added a manual deselect/reselect of the card to make sure it's properly selected and editor has focus
- added a scrollToCard call so the newly inserted card position feels more natural
2021-11-30 13:06:57 +00:00
Kevin Ansfield
9223d0237c Added scroll-into-view behavior when opening gif selector
refs https://github.com/TryGhost/Team/issues/1225

When the gif selector is activated we want to scroll as much of the picker into view as possible.

- updated `scroll-into-view` modifier so it can work on bounding rects as well as offsets for those situations where a scroll parent is not the offset parent
  - only implemented "off bottom" behavior for now as that's all we need for this use-case
  - if the scroll adjustment would mean the top is cut off we readjust so that the top of the element is always visible
2021-11-30 12:51:56 +00:00
Kevin Ansfield
79d9ea82d9 Changed tenor config API key name
refs https://github.com/TryGhost/Team/issues/1237#issuecomment-981770688

- API key names for external services now follow a standard pattern
  - top-level key of the service name
  - public/private and read/write perms inside the name, eg. `publicReadOnlyApiKey`
- updated test to match expected API key name
2021-11-30 11:29:16 +00:00
Kevin Ansfield
506d925462 Fixed syntax error
refs 5b90fe87ad

- closing bracket was accidentally deleted in final post-push cleanup
2021-11-30 10:59:37 +00:00
Kevin Ansfield
5b90fe87ad Adjusted keyboard nav in gif selector to reduce vertical scroll jumps
refs https://github.com/TryGhost/Team/issues/1225

- `TAB` / `SHIFT+TAB` now cycle through gifs in the search return order. It means the highlight gif will not always be in the next column over but it drastically reduces the vertical scroll jumping
- `LEFT` / `RIGHT` now select the gif to the left/right that visually lines up with the top third of the currently highlighted gif and will stop at the grid edges. The result is `UP` / `DOWN` / `LEFT` / `RIGHT` act more like spatial navigation with no unexpected scroll jumps
- switching to only storing the highlighted gif and relying on indexes added to each gif by the `tenor` service when assigning to columns means that column number changes when resizing the viewport are automatically handled
2021-11-30 10:52:47 +00:00
Rishabh
a45e345a95 Added basic version for audio card UI
refs https://github.com/TryGhost/Team/issues/1230

- adds basic audio card edit mode UI with upload functionality
2021-11-30 13:52:14 +05:30
Renovate Bot
5f9d091e9a Update dependency eslint-plugin-ghost to v2.9.0 2021-11-29 20:30:16 +00:00
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
djordje vlaisavljevic
92165f56d2 Added initial Product card editor styles refs https://github.com/TryGhost/Team/issues/1233 2021-11-29 19:22:53 +01: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
renovate[bot]
765ce05277 Update dependency ember-assign-helper to v0.4.0 (#2158)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-29 12:50:07 +00:00
renovate[bot]
16e4381e59 Update dependency @joeattardi/emoji-button to v4.6.2 (#2156)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-29 12:49:23 +00:00
renovate[bot]
6539bd4c46 Update dependency @tryghost/helpers to v1.1.54 (#2147)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-29 12:48:46 +00:00
Kevin Ansfield
01e698f42f Added copy/paste support for alternative blockquote styles
refs https://github.com/TryGhost/Team/issues/1239

- bumps `@tryghost/kg-parser-plugins` to support transforming `<blockquote class="kg-blockquote-alt">` to an `aside` section when copy/pasting from rendered front-end html
- bumped `@tryghost/kg-clean-basic-html` to avoid referencing multiple versions in yarn.lock
2021-11-29 11:46:53 +00:00
Kevin Ansfield
7bbe83786d Removed empty card test files 2021-11-29 09:42:14 +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
Renovate Bot
703ee85a7c Lock file maintenance 2021-11-29 00:41:37 +00:00
Daniel Lockyer
4f184445c3 v4.24.0 2021-11-26 16:00:26 +00:00
Renovate Bot
8bfcbf1331 Update dependency eslint-plugin-ghost to v2.8.0 2021-11-25 17:15:00 +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
Peter Zimon
7dcb11e741 GIF browser refinements 2021-11-25 13:22:27 +01:00
Daniel Lockyer
551e26b895 Merged v4.23.0 into main
v4.23.0
2021-11-25 12:17:20 +01:00
Daniel Lockyer
68372746a6 v4.23.0 2021-11-25 11:16:29 +00:00
Rishabh
90bc78d0be Updated name validation for offer to restrict to 40 chars
refs https://github.com/TryGhost/Team/issues/1236

Stripe allows coupon names to be only upto 40 chars long, while Ghost allowed them to be 191 chars. This change updates the admin validation to restrict name to 40 chars to match Stripe limit
2021-11-25 11:37:35 +01: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
6d72325867 Added quoteStyles labs flag and toggle
refs https://github.com/TryGhost/Team/issues/1239

- we're experimenting with an additional quote style that can be toggled between using the toolbar quote button
2021-11-24 16:36:44 +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
Rishabh
7cd09eee96 Updated name validation for offer to restrict to 40 chars
refs https://github.com/TryGhost/Team/issues/1236

Stripe allows coupon names to be only upto 40 chars long, while Ghost allowed them to be 191 chars. This change updates the admin validation to restrict name to 40 chars to match Stripe limit
2021-11-24 18:18:22 +05:30
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
illiteratewriter
a41c159f2a 🐛 Fixed currency dropdown background in dark mode (#2109)
closes https://github.com/TryGhost/Ghost/issues/13598

- dark mode was showing incorrect colors for dropdown
2021-11-23 08:50:41 +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
Thibaut Patel
98da36ce2a Added productCard feature flag
refs https://github.com/TryGhost/Team/issues/1233

- flag for the product card development
2021-11-22 11:50:40 +01:00
renovate[bot]
9139809e9b Update dependency @tryghost/timezone-data to v0.2.53 (#2148)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-22 09:49:45 +00:00
renovate[bot]
625ab86963 Update dependency @tryghost/limit-service to v1 (#2122)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-22 09:48:43 +00:00
renovate[bot]
b2a78d0a19 Update dependency @sentry/ember to v6.15.0 (#2145)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-22 09:48:27 +00:00
renovate[bot]
d6a4ec374f Update dependency ember-keyboard to v6.0.4 (#2152)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-22 09:47:42 +00:00
Sanne de Vries
4e767c90f8 Fixed links not displaying in accent-color callout cards
Refs https://github.com/TryGhost/Team/issues/1206
2021-11-22 10:43:58 +01:00
djordje vlaisavljevic
9227b8b3c9 Updated accordion editor styles 2021-11-19 18:35:27 +01:00
djordje vlaisavljevic
f4cc458551 Updated accordion editor styles 2021-11-19 18:35:27 +01:00
Kevin Ansfield
3a4d1ecf60 Fixed error when searching tenor
no issue

- when removing zoom support from the tenor connector a call to `closeZoom()` when searching was missed
2021-11-19 17:31:35 +00:00
Peter Zimon
59e1fc5b6d Fixed copy for GIF card menu 2021-11-19 17:33:25 +01:00
Daniel Lockyer
d55e2846c6 v4.22.4 2021-11-19 16:00:31 +00: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
Fabien O'Carroll
e4a258950c Handled changes to NFT card class names
refs https://github.com/TryGhost/Team/issues/1211

Since we remove the kg-nft-card class from the anchor tag, we needed to
update the HTML parser to work with the new structure.
2021-11-19 12:14:10 +02: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
Kevin Ansfield
2f110c2e8e Fixed caption inputs inheriting callout card placeholder style 2021-11-19 09:58:47 +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
djordje vlaisavljevic
d83d6124ba Updated accordion editor view 2021-11-18 21:51:56 +01:00
djordje vlaisavljevic
520a8bad04 Added accordion plus menu icon 2021-11-18 21:49:18 +01:00
Kevin Ansfield
3fcbd75efb Fixed callout card text input placeholder
no issue

- updated placeholder styles so they work with the basic input as well as the textarea input inside the editor
2021-11-18 19:54:30 +00:00
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
renovate[bot]
e0a68a94f8 Update dependency ember-ajax to v5.1.1 (#2151)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-18 13:36:34 +00:00
renovate[bot]
5b2740b500 Pin dependency @joeattardi/emoji-button to 4.6.0 (#2149)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-18 13:35:25 +00:00
renovate[bot]
99bc760bf7 Update dependency @tryghost/string to v0.1.21 (#2141)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-18 13:34:11 +00:00
renovate[bot]
6986d664a4 Update dependency @tryghost/kg-clean-basic-html to v2.2.1 (#2140)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-18 13:33:57 +00:00
renovate[bot]
623dc7da02 Update dependency @tryghost/color-utils to v0.1.5 (#2138)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-18 13:33:38 +00:00
Fabien O'Carroll
ce01e35097 Updated parsing of NFT card HTML
refs https://github.com/TryGhost/Team/issues/1211

This adds handling for the data=payload attriute on Ghost NFT cards as
ell as parsing for the default OpenSea Embed and the Substack NFT Card.
2021-11-18 14:31:38 +02: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
Sanne de Vries
74f808f934 Update emoji picker in callout card 2021-11-18 09:23:33 +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
Kevin Ansfield
0c4f9c8c6a 🐛 Fixed Casper not being installable from themes list
no issue

- fixed typo in the install-theme modal that meant we weren't correctly identifying Casper as the default theme meaning an attempt to install it was made instead of activating it
2021-11-17 22:49:00 +00:00
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
Peter Zimon
7cf9775ee5 Fixed button hover text color 2021-11-17 11:46:57 +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
Sanne de Vries
a87cfe0ebc Fixed emoji hover state in callout
Refs https://github.com/TryGhost/Team/issues/1206
2021-11-16 19:57:05 +01: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
5f7c79d04e Fixed "Attempted to handle event deleteRecord on <page:x> .." error
refs https://github.com/TryGhost/Team/issues/1121

Double-clicking the delete button in the confirmation modal could trigger a second attempt to delete the post/page when it had already been deleted resulting in an ugly/incomprehensible error bubbling up.

- added `{drop:true}` to the task instance so it can't be called again whilst it's currently running
- added a guard for `isDeleted` so we don't attempt to destroy an already deleted record
- added a `true` return so the button indicates a successful state rather than an error state whilst the modal is closing
2021-11-16 17:59:59 +00: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
Sanne de Vries
8f6b1aa61a Updated callout card
Refs https://github.com/TryGhost/Team/issues/1206

- Replaced background and swatch colors to semi-transparent so that it works with light and dark mode
- Updated emoji-picker dark mode
- Removed text contrast adjustment for accent background
2021-11-16 18:32:27 +01: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
Kevin Ansfield
96a810e6c7 Removed text contrast adjustment for accent buttons
no issue

- the front-end only supports white text on accent color backgrounds so we shouldn't have any auto contrast selection for text in Admin for consistency and to give a hint that a chosen accent color is too light
2021-11-16 17:01:52 +00: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
Peter Zimon
1aea3c7c42 Refined link dropdown line-height 2021-11-16 17:05:44 +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