Commit Graph

801 Commits

Author SHA1 Message Date
Kevin Ansfield a800dfa485 Dropped ember-useragent dependency
no issue

We made very limited use of the `ua-parser-js` sub-dependency that `ember-useragent` pulls in so it didn't seem worth having the fairly large 17KB import or the associated sub-dependency version resolutions.

- switched the two iOS and Safari detections to use associated Regexes on `navigator.userAgent`
- dropped the "Microsoft Edge not supported" message in the editor
  - old Edge is still not supported but it was been replaced with a Chromium-based version that is supported a while back
  - we can re-introduce a warning if we get any significant reports (there is nothing showing in Sentry for this alert in the last 14 days)
2022-03-07 10:06:35 +00:00
Kevin Ansfield 9e40fdad70 Resolved linter errors in `koenig-toolbar.hbs`
refs https://github.com/TryGhost/Ghost/issues/14101

- switched from the deprecated `{{action}}` helper to the `{{on}}` modifier
2022-02-15 13:46:49 +00:00
Kevin Ansfield 9c9b55c727 🐛 Fixed "Header two" formatting toolbar button not working
closes https://github.com/TryGhost/Ghost/issues/14146
refs https://github.com/TryGhost/Admin/pull/2251

- an action rename was missed when converting the toolbar component to native class syntax
- added test for the h3 toolbar button working
  - fixed `<KoenigEditor>` not assigning the test property that gives tests access to the underlying mobiledoc `editor` instance
2022-02-15 13:23:37 +00:00
Gabriel Csapo 15f0aa7355
[chore] migrate to eslint@8 and run --fix (#2256)
closes https://github.com/TryGhost/Admin/pull/2107

- updated related babel dependencies
- bumped eslint
- ran `yarn lint:js --fix`
- added eslint ignore comments for some required non-camel-case properties
2022-02-10 10:41:36 +00:00
Kevin Ansfield 9463e7af64 Dropped ember-concurrency-decorators dependency
no issue

- since `ember-concurrency@2.0` it's possible to use the standard imports as decorators removing the need for the extra `ember-concurrency-decorators` dependency and imports
2022-02-09 10:49:38 +00:00
Gabriel Csapo 22975bab61
[chore] migrates koenig-editor files to native classes (#2251)
refs https://github.com/TryGhost/Ghost/issues/14101

- continuing migration to native classes with use of `@classic` decorator
2022-02-09 09:19:45 +00:00
Kevin Ansfield 88deb86f16 🐛 Fixed Ctrl+Enter-to-edit keyboard shortcut not working on Windows for some editor cards
no issue

- Callout, Email, Email CTA, Header, Product, and Toggle cards all had the same typo in the Ctrl/Cmd+Enter keyboard handling
2022-02-07 16:55:01 +00:00
Kevin Ansfield 4b786fcc4e Collapsed @service injection definitions to single-line style
no issue

- find+replace to make service injection style consistent and take up much less space at the top of files that used multi-line syntax
2022-02-03 19:04:43 +00:00
Kevin Ansfield 1aaa1bac9d Ran native classes codemod for lib/koenig-editor/addon/components
refs https://github.com/TryGhost/Ghost/issues/14101

- ran native classes codemod for koenig-editor in-repo-addon components
- added `ember-classic-decorator` to addon's package.json to fix errors when importing

Some files failed to convert automatically:
```
❯ grep -rL "@classic\|default class" lib/koenig-editor/addon/components/**/*.js
lib/koenig-editor/addon/components/koenig-alt-input.js
lib/koenig-editor/addon/components/koenig-card-image.js
lib/koenig-editor/addon/components/koenig-editor.js
lib/koenig-editor/addon/components/koenig-toolbar.js
```
2022-02-03 18:57:21 +00:00
Gabriel Csapo f7abf1f0dd
[chore] run the no-implicit-this codemod (#2244)
refs https://github.com/TryGhost/Admin/pull/2238

Follow up to #2238, this should remove the existing no-implicit-this lint errors and any new violations should be flagged right away.

* run the no-implicit-this codemod
* updated todos
2022-02-02 17:09:02 +00:00
Kevin Ansfield 733e67c996 Fixed template linting error in koenig-card-email.hbs
refs c9fc10edfc

- template change triggered a linting rule
- fixed and ran `yarn lint:hbs --update-todo`
2022-02-02 16:48:09 +00:00
Kevin Ansfield c9fc10edfc Fixed `noreferer` typos
no issue

- should be `noreferrer`, caused duplication by ember-template-lint auto fixing
2022-02-02 16:20:01 +00:00
Gabriel Csapo e7d29054d6
[chore] adds ember-template-lint and fixes all fixable issues (#2238)
no issue

- This will help with the octane migration and you can still run the lint rules even when they are todos. (Checkout the docs at 158b119667/docs/todos.md) The good news is any new code will be checked against the recommended config.
- I fixed all the auto fixable things we could get in this PR as well
2022-02-02 16:09:43 +00:00
Kevin Ansfield 0a505431ad Added `infobox` to matches list for callout card
no issue

- extra term for matching the callout card so you can start typing `/infobox` and get the card you were looking for
2022-01-31 13:46:07 +00:00
Kevin Ansfield 765ed242a9 🎨 Made /-menu card searching case-insensitive
no issue

- allows typing "Button" to match the "button" card
- useful on mobile where words can be auto-capitalized
2022-01-31 13:37:25 +00:00
Kevin Ansfield c17d72f988 🐛 Fixed editor cards not being usable by contributors
no issue

- a recent Ember upgrade has slightly changed behaviour for template conditionals meaning helpers used in the right-hand side of a conditional can be called when the conditional evaluates to falsy
- this caused an error to be thrown by the editor when creating cards as a contributor because the `{{fn}}` helper is called with a null/undefined `saveCardAsSnippetIfPossible` function which will throw an error
- wrapped the function in the `{{optional}}` helper (https://github.com/DockYard/ember-composable-helpers#optional) which will return a "noop" function allowing the template to evaluate without errors
2022-01-31 13:28:26 +00:00
Peter Zimon 74c9fb9774
Remove alpha flag for Editor settings panel (#2230) 2022-01-31 13:33:59 +01:00
Kevin Ansfield 1eb2f2a100 Cleaned up `headerCard` labs flag
refs https://github.com/TryGhost/Team/issues/1258

- removed labs flag and conditionals as feature is GA
2022-01-04 14:58:19 +00:00
Kevin Ansfield 0392f6314b Cleaned up `fileCard` labs flag
refs https://github.com/TryGhost/Team/issues/1258

- removed labs flag and conditionals as feature is GA
2022-01-04 14:57:01 +00:00
Kevin Ansfield b92c478f3c Cleaned up `audioCard` labs flag
refs https://github.com/TryGhost/Team/issues/1258

- removed labs flag and conditionals
2022-01-04 13:08:50 +00:00
Kevin Ansfield 20baede18f Cleaned up `productCard` labs flag
refs https://github.com/TryGhost/Team/issues/1258

- removed labs flag and conditionals
2022-01-04 13:04:26 +00:00
Kevin Ansfield f922a9c56e Cleaned up `accordionCard` labs flag
refs https://github.com/TryGhost/Team/issues/1258

- removed labs flag and conditionals
2022-01-04 13:03:08 +00:00
Kevin Ansfield 02de424763 Cleaned up `videoCard` labs flag
refs https://github.com/TryGhost/Team/issues/1258

- removed labs flag and conditionals
2022-01-04 12:57:42 +00:00
Kevin Ansfield 5cf00b8a68 Cleaned up `calloutCard` labs flag
refs https://github.com/TryGhost/Team/issues/1258

- removed labs flag and conditionals
2022-01-04 12:56:25 +00:00
Kevin Ansfield a9a942ef9e Cleaned up `nftCard` labs flag
refs https://github.com/TryGhost/Team/issues/1258

- removed labs flag and conditionals
2022-01-04 12:55:04 +00:00
Kevin Ansfield c32192ee20 🐛 Fixed Spotify and Soundcloud embeds having overly long containers in editor
closes https://github.com/TryGhost/Team/issues/871

- when determining the size of the iframe containing a nested iframe in the embed card we were incorrectly treating a `100%` width attribute as a `100px` attribute and ending up with a completely incorrect ratio calculation
- added a conditional to ignore %-width attributes when calculating a ratio for a nested iframe
- if we have a nested iframe with a %-width but a fixed height, use that fixed height for the outer container iframe
2022-01-04 10:00:21 +00:00
Kevin Ansfield b5baf14034 Removed unnecessary koenig-media-selector-tenor export file
no issue

- the associated addon component was deleted a while back but the app export file was missed
2022-01-04 09:29:24 +00:00
Thibaut Patel c1e967db72 Renamed the header styles
refs https://github.com/TryGhost/Team/issues/1253

- The naming is easier to understand for theme developers
2021-12-16 18:22:08 +01:00
Peter Zimon 074032f895 Updated header card placeholders 2021-12-16 16:11:50 +01:00
James Morris ca30a59587 Fixed a merge with the header card settings
refs https://github.com/TryGhost/Team/issues/1253
2021-12-16 14:39:50 +00:00
Thibaut Patel 11471b60bd Removed width and alignment configuration from the header card
refs https://github.com/TryGhost/Team/issues/1253

- We're simplifying the header card from a design point of view to ease integration with themes
2021-12-16 15:10:57 +01:00
Peter Zimon 6b2c7e0da1 Refined header image styles 2021-12-16 12:59:03 +01:00
Peter Zimon 60faf49d9f Put back header style options 2021-12-16 12:26:15 +01:00
Peter Zimon 8737a0a690 Updated style picker for header 2021-12-16 12:25:01 +01:00
Thibaut Patel a4f1236846 Updated the header card file selector
refs https://github.com/TryGhost/Team/issues/1253

- Selecting the `image` style opens the file selector right away
- Avoids an extra click to the user
- Moved `GhFileInput` so that it's always rendered, which enables triggering it right when selecting the `image` style
2021-12-16 11:09:14 +01:00
Peter Zimon 3b223a9c53 Added 'upload' term to file card menu access 2021-12-16 10:08:44 +01:00
Sanne de Vries 58be583ab2 🐛 Fixed audio file duration missing digit in editor
Closes https://github.com/TryGhost/Ghost/issues/13894
2021-12-16 09:17:45 +01:00
Naz c06b002001 Added support for additional wav MIME types
refs f882ebc58e
refs https://github.com/TryGhost/Toolbox/issues/95

- The `audio/x-wav`, `audio/wav`, and `audio/wave` are also commonly used MIME types for the .wav files.
2021-12-16 11:11:43 +04:00
James Morris a3e7323ca9 Little tweaks for header settings panel and added add icon
refs https://github.com/TryGhost/Team/issues/1253
2021-12-15 19:09:17 +00:00
djordje vlaisavljevic 5e806820f9 Updated before/after card editor template
refs https://github.com/TryGhost/Team/issues/1249
2021-12-15 20:06:00 +01:00
djordje vlaisavljevic 9d07999224 Updated before/after card editor template
refs https://github.com/TryGhost/Team/issues/1249
2021-12-15 20:03:03 +01:00
Fabien egg O'Carroll 419974046e Updated slider for before/after to match frontend
refs https://github.com/TryGhost/Team/issues/1249

Adds a new element to use as the slider handle to match how we're doing
it in the frontend
2021-12-15 20:27:39 +02:00
Thibaut Patel 85f7effc62 Updated the header card
refs https://github.com/TryGhost/Team/issues/1253

- added a default `cardWidth`
2021-12-15 18:28:41 +01:00
Thibaut Patel 033fb41b90 Updated the header card
refs https://github.com/TryGhost/Team/issues/1253

- removed the accent class in the edit mode
2021-12-15 18:26:47 +01:00
Thibaut Patel d26267b8c0 Updated the header card
refs https://github.com/TryGhost/Team/issues/1253

- added the card width back (only regular or full options)
- removed the accent class from the button
- fixed a bug happening when the subheader was empty
2021-12-15 18:25:05 +01:00
Peter Zimon d6f7e55f5e Updated file card Koenig styles 2021-12-15 17:45:04 +01:00
djordje vlaisavljevic 4ca2d90c6c Added icon for before/after card
refs https://github.com/TryGhost/Team/issues/1249
2021-12-15 16:23:35 +01:00
djordje vlaisavljevic ebb176db30 Updated editor styles for before/after card
refs https://github.com/TryGhost/Team/issues/1249
2021-12-15 11:10:05 +01:00
Fabien egg O'Carroll aaf9c99172 Added replace image functionality
refs https://github.com/TryGhost/Team/issues/1249

This can resuse the image selection as after a successful upload the
image is replaced.
2021-12-15 12:06:46 +02:00
Thibaut Patel c00d72a5e3 Updated header card class names
refs https://github.com/TryGhost/Team/issues/1253
2021-12-15 10:02:17 +01:00