Commit Graph

441 Commits

Author SHA1 Message Date
Aileen Nowak 0bf09d88ed Updated links to ghost.org sites
no issue

Follow-up task of the updated Ghost Docs structure. Updated links reflecting the new structure to prevent unnecessary 404s and redirects.
2021-01-19 13:18:59 +13:00
Rish 426b613dcb 🐛 Fixed email design settings not opening
closes https://github.com/TryGhost/Ghost/issues/12459

- Email design settings don't open in some cases when footer html is set as null, specifically on import
- Patches html cleanup to use empty string in case of null footer value
2020-12-08 15:01:38 +05:30
Kevin Ansfield 56c3efbd97 Fixed email cards missing an edit icon in the toolbar
no issue

- email cards a block cards so have a distinct edit mode, that type of card should always have an edit icon in the toolbar for consistency and ease of use when the double-click or cmd+enter shortcuts aren't known
2020-12-03 10:26:28 +00:00
Sanne de Vries 0c3ed259dd Added descriptive line to each menu item in cardmenu 2020-11-16 17:34:40 +01:00
Fabien 'egg' O'Carroll c58178cb0a
Added support for basic HTML newsletter footer (#1765)
no-issue

This allows users to use basic HTML to customise their newsletter
footer, meaning they can use links, and bold/italic text.
2020-11-16 10:29:32 +00:00
Kevin Ansfield 3f397e1b89 Fixed error when creating a block-editable card in the editor
no issue

The toolbar display/positioning logic was recently changed so that the toolbar is shown when a `saveAsSnippet` action is passed in. However the `_setToolbarProperties` method wasn't taking into account the toolbar element not being present when in editing mode such as when a block-editable card (markdown, html, code) is created.

- remove conditional logic that may change over time and replace it with checks for the toolbar element existing
2020-11-06 18:13:32 +00:00
Kevin Ansfield 5adcf1bf0f 🐛 Fixed snippet icon showing in card toolbar for authors/contributors
no issue

- authors/contributors do not have permission to create snippets so the icon should not be displayed
2020-11-03 13:57:11 +00:00
Sanne de Vries 322d12059a Adjusted cardmenu styling for dark mode
No issue

- Changed snippet icon fill
- Changed section border color
- Deleted white corners on bookmark icon
2020-10-28 14:55:34 +01:00
Sanne de Vries a50a8186c7 Improved hover state styling of snippets in cardmenu
No issue

- Changed delete icon colour and padding
- Changed fill of snippet icon on hover
2020-10-28 13:14:25 +01:00
Kevin Ansfield 6b0618cc0d Changed slash menu filter to match any part of a snippet title
no issue

- extracted item matching into a separate function
- modified item matching to work with arrays (existing exact match behaviour) or functions which can be defined per-item
- changed snippet item `matches` to a function that does a naive match or the typed query to any part of the snippet's title
2020-10-28 08:37:04 +00:00
Kevin Ansfield b2e2d44cc6 Fixed error when clicking snippet icon from card toolbar 2020-10-27 18:32:20 +00:00
Kevin Ansfield 57becd52e0 Fixed toolbar showing when block cards are in edit mode 2020-10-27 18:23:56 +00:00
Kevin Ansfield 728e6e85d5 Fixed squashed card menu display in Safari 2020-10-27 16:28:24 +00:00
Kevin Ansfield 048cbc2967 Added scroll-into-view behaviour for slash menu selection
no issue

- when selecting items with arrow keys in the slash menu, scroll the selected item into view if it's not visible
2020-10-27 16:15:58 +00:00
Kevin Ansfield 714cf92395 Added snippets feature to editor
no issue

Snippets are pieces of saved content that are given a name and made available for easy and quick insertion when editing posts or pages. They can contain rich text, cards, or a combination of both making it faster and less error-prone to re-use pieces of content across multiple posts. Snippet length is not constrained meaning they can also stand in as post type templates alleviating the need to keep drafts around as templates and copy/pasting each time they are used.

Feature changes:
- added "create snippet" icon to selection and card toolbars
- added "Snippets" section to the plus and slash menus
  - for the slash menu, continuing to type after opening the menu will filter by snippet name
- all saved snippets are available to all staff users
- snippets can be deleted by clicking the trash can icon when hovering the mouse over a snippet entry in the plus or slash menus
- creation/deletion of snippets is available to staff users with the owner, admin, or editor role

This commit:
- removed developer experiments guard around snippet UI
2020-10-27 15:01:35 +00:00
Kevin Ansfield 552fdb335f Truncated long card menu labels 2020-10-27 14:48:39 +00:00
Kevin Ansfield 01a0aaf022 Hid snippet management UI from staff users without permissions
no issue

- snippets can only be created and deleted by owners/admins/editors
- added a property in the editor controller to determine if the logged in user has sufficient permissions, then only pass the appropriate save/delete snippet actions to the editor component if the check is passed
- updates koenig menus and toolbars to skip rendering of buttons if the associated action function is not available
2020-10-27 14:42:59 +00:00
Kevin Ansfield f360ef60f2 Fixed card menus closing when clicking on modal background
no issue

- when deleting a snippet we display a confirmation modal, if the background is clicked to dismiss the modal then the menus closed too which is a different behaviour to clicking the close/cancel button inside the dialog
- adjusted the "ignore click" selector in the menus to include all fullscreen modal elements
2020-10-27 08:43:46 +00:00
Kevin Ansfield 57cfdae8f6 Added delete button with confirmation to snippets in card menus
no issue

- show a delete icon when a snippet is hovered in plus/slash menus
- show a confirmation dialog when the delete icon is clicked
- keep menus open whilst displaying the delete confirmation dialog
2020-10-26 17:09:39 +00:00
Kevin Ansfield a3f897f689 Removed Instagram embed entry from the card menu
no issue

- Facebook are changing how Facebook/Instagram embeds work meaning that they won't work in Ghost once the deprecation lands on Oct 24th
2020-10-23 11:40:31 +01:00
Kevin Ansfield 8f6c63ffb6 Changed snippet icon in menus based on snippet contents
no issue

- vary the snippet icon based on the snippet contents: text only, text and cards, cards only
2020-10-23 10:56:32 +01:00
Sanne de Vries f2408162d8 Fixed bottom padding for card menu in Firefox 2020-10-23 11:55:41 +02:00
Sanne de Vries b02f7c0617 Styled new row layout of the cardmenu
No issue

- Adjusted menu width and height
- Improved spacing cards
- Changed font styling
- Added snippet icons
2020-10-23 10:36:31 +02:00
Kevin Ansfield e12e5ee910 Prevented card toolbar showing for embed/bookmark cards in input state
no issue

- it doesn't make sense to create snippets of bookmark/embed cards before they contain any content so we avoid passing the save snippet function through until content exists and the card has left it's input state
2020-10-21 18:27:26 +01:00
Kevin Ansfield 438cf239a7 Changed card/plus menu layout from grid to rows
no issue

- with the addition of snippets the card menu contents height and potential label width are both growing considerably making the grid layout unworkable
2020-10-21 12:34:05 +01:00
Kevin Ansfield e5ae72cbff Added "Create snippet" toolbar icon when cards are selected
no issue

- show the toolbar icon for any `<KoenigCard>` instance that has the `saveAsSnippet` action passed to it
  - currently that's all cards except the HR card because that's a primitive element rather than containing any user-defined content
- add `koenigUi.inputHasFocus` so that card toolbars can be hidden when the snippet input is displayed
2020-10-21 12:16:04 +01:00
Kevin Ansfield 28d95002b5 Fixed error when clicking on snippets in card menu
no issue

- click event was clearing the editor range so it's necessary to reposition the cursor before replacing with the post
2020-10-20 18:10:25 +01:00
Kevin Ansfield 250c7c073b Swapped toolbar snippet icon for the new design 2020-10-19 09:55:26 +01:00
Kevin Ansfield 5ecf3872f5 Renamed snippet.title to snippet.name for consistency
no issue

- all of our models which allow users to name something use `name` as the field descriptor rather than `title` so `snippet.title` was renamed for consistency
- also fixes typo in the plus-menu component that stopped clicking on snippets from working
2020-10-16 10:15:07 +01:00
Kevin Ansfield 5606b9c068 Implemented first iteration of content snippets
closes https://github.com/TryGhost/Team/issues/411

- adds "Create snippet" icon to the editor toolbar
- uses the same link input component design for specifying snippet titles
- snippets are loaded in the background when the editor is accessed
- snippets are listed at the bottom of the card menus of the + and / menus
- clicking a snippet inserts the snippet's contents in place of the current blank section
2020-10-15 18:03:35 +01:00
Kevin Ansfield 43d55e2c60 Fixed usage of {{enable-developer-experiments}} without sub-expression syntax 2020-10-09 15:52:23 +01:00
Kevin Ansfield 0672f14b8e Added {{enable-developer-experiments}} helper
no issue

- removes the need to have component backing classes with the `config` service injected
2020-10-09 11:10:39 +01:00
Kevin Ansfield 68efc5bff3 Resolved "already declared in upper scope" linting warnings
no issue

- fixed all `no-shadow` linter warnings
- changed `no-shadow` eslint rule from `warn` to `error` so we don't re-introduce shadowed variables in the future
2020-10-05 09:56:21 +01:00
Kevin Ansfield 4ac3f3643f Update dependency ember-in-viewport to v3.8.0
no issue

- now that we no longer have the `ember-sticky-element` dependency we're free to upgrade `ember-in-viewport`
- remove package.json resolution so latest version gets installed
- remove ember-in-viewport from renovate ignore config
- update `<GhScrollTrigger>` to match latest `ember-in-viewport` usage and convert to a glimmer component
  - ensure `scrollableArea` is always set so that the trigger doesn't stop working after the first trigger
2020-10-01 10:06:53 +01:00
Kevin Ansfield a0db65f5df Removed ember-sticky-element in favour of native `position: sticky`
no issue

- native `position: sticky` support is now good enough across the board of our supported browser versions to use in place of a JS version for our use cases
- `ember-sticky-element` is preventing the dependency update of `ember-in-viewport` so removing it will allow a lot of our sub-dependencies to be updated
2020-10-01 10:02:27 +01:00
Peter Zimon 25f4b60d9c Fixed image caption design bugs in Koenig
no refs.
- added side padding for alt and caption input fields
- fixed text color bug of alt toggle button
2020-08-27 15:21:11 +02:00
Sanne de Vries 5bcceeb376 Changed order and font color of author and publisher on bookmark card 2020-08-21 11:40:52 +02:00
Kevin Ansfield 754f8483e9 Added number formatting to all pluralized counts
closes https://github.com/TryGhost/Ghost/issues/12110

- adds `{{gh-pluralize}}` helper that wraps the `{{pluralize}}` helper from `ember-inflector` but formats the number using our `{{format-number}}` helper
- updates all uses of `{{pluralize}}` to `{{gh-pluralize}}`
2020-08-10 11:16:03 +01:00
Kevin Ansfield e11fbabdaf Switched over to public {{in-element}} API
no issue

- Ember 3.20.0 introduced `{{in-element}}` as a public API in place of the now-deprecated `{{-in-element}}` private API
- replaced our usage of the private API with the public API
2020-07-20 12:10:17 +01:00
Kevin Ansfield 388053dfd4 Updated image card to store original width/height in payload
no issue

- extract width/height from selected local image when uploading and store in the payload with `src` once upload finishes
- capture width/height from Unsplash and store in the payload after selecting an image
2020-06-15 13:16:37 +01:00
Kevin Ansfield 17cb3ece43 Added display of server-side error message when bookmark request fails
closes https://github.com/TryGhost/Ghost/issues/11212

- store error message that is received from the server and remove the url from the context string for cleaner display
2020-06-08 17:40:33 +01:00
Kevin Ansfield c08faf1a2d Display original url in bookmark card
refs https://github.com/TryGhost/Ghost/issues/11212
credit @devaman https://github.com/TryGhost/Ghost-Admin/pull/1478

- display the original url rather than the fetched url in order to preserve query params and redirects (useful for affiliate links)
2020-06-08 08:21:34 +01:00
Kevin Ansfield 22a24d1d19 Fixed no-shadow linting warnings in text-expansions.js
no issue

- part of gradual cleanup to remove linter warnings
2020-06-05 08:31:46 +01:00
Marco Zehe 52b53d068b
Various A11y post screen fixes (#1584)
refs #11863

* 🐛 Gave various buttons accessible labels

Hidden span elements are not rendered to assistive technologies, so duplicate the text in an aria-label on the button element.

* 🐛 Fixed various accessibility issues in the editor

* Made menus menus and menu item menuitems.
* Added labels to buttons where there were only hidden spans, or no text at all.
* Made separators show up for screen readers.
2020-05-28 16:01:09 +01:00
Kevin Ansfield d6058dbf27 Co-located component template files
no issue

Keeps component JS backing files and template files in the same directory which avoids hunting across directories when working with components. Also lets you see all components when looking at one directory, whereas previously template-only or js-only components may not have been obvious without looking at both directories.

- ran [codemod](https://github.com/ember-codemods/ember-component-template-colocation-migrator/) for app-level components
- manually moved in-repo-addon component templates in `lib/koenig-editor`
- removed all explicit `layout` imports as JS/template associations are now made at build-time removing the need for them
- updated `.embercli` to default to new flat component structure
2020-05-18 13:14:08 +01:00
Kevin Ansfield b071c4e0ff Fixed embed card sizing for Vimeo embeds with larger thumbnails
no issue

- we're adjusting the oembed endpoint to fetch larger thumbnails if possible and that results in Vimeo embed iframes being larger than the editor width which created large blank spaces above/below the video due to the iframe height not adjusting correctly
- in the embed card's resize routine, if we look for an embedded iframe and find a width/height attribute then we can use the aspect ratio to assign the correct height for the outer and inner iframes
2020-04-30 09:07:04 +01:00
Kevin Ansfield 50ac92a41c Added oembed metadata to embed card payloads
refs https://github.com/TryGhost/Ghost/issues/11756

- we'd like to render fallbacks for embed cards in constrained environments such as emails where the `html` contents may not be suitable
- oembed gives us data to be able to create fallbacks this such as a `thumbnail_url`, author information, and sizing but we were not storing it
- this change removes the `html` and `type` data from the response object as the existing top-level payload properties then stores the remainder of the response under a `metadata` property
2020-04-29 10:43:03 +01:00
Kevin Ansfield f81c8f864a Fixed invisible button text when toggling image card alt button
no issue

- `bg-white` was a default style but has a higher specificity than `bg-blue` used when active so the blue background wasn't taking effect
2020-04-28 09:48:00 +01:00
Kevin Ansfield 0c311ab662 Added "Email" card for inserting content that only appears when emailing posts to members
no issue

- any content inside the email card will not appear on the site, instead it will only be shown when using the members system to email the post to your members
- can `{first_name}` or `{first_name, "fallback"}` to personalise the email content for each member
2020-04-27 13:13:00 +01:00
Peter Zimon 5605f8b3e0 Updated email card help link
no issues.
- updated email card to point the help icon to its final page
2020-04-27 11:02:23 +02:00