Commit Graph

8072 Commits

Author SHA1 Message Date
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
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