Commit Graph

4102 Commits

Author SHA1 Message Date
Kevin Ansfield e64b9ccf7f Koenig - Fix misaligned toolbar arrow in Night Shift
refs https://github.com/TryGhost/Ghost/issues/9623
2018-06-15 10:35:31 +01:00
Kevin Ansfield b84ecbe021 Version bump to 1.24.4 2018-06-14 17:07:20 +01:00
Kevin Ansfield fd9fe42296 🎨 Koenig - Keep posts free of blank cards
refs https://github.com/TryGhost/Ghost/issues/9623
- add new `deleteIfEmpty` option when defining cards
- add `.cleanup()` method to `{{koenig-editor}}` that will remove any blank cards
- pass `{{koenig-editor}}` instance up to the editor controller when it is initialised
- call `.cleanup()` in the editor controller when performing full saves, when leaving the editor with a draft, and when opening the editor with a draft
2018-06-14 16:55:02 +01:00
Kevin Ansfield 27e4d638a0 🐛 Koenig - Fixed jump to bottom of story when deleting a list
refs https://github.com/TryGhost/Ghost/issues/9623
- the `BACKSPACE` key command was checking to see if the current section is the first section but failed to take into account that lists are their own section lists
2018-06-14 13:09:49 +01:00
Kevin Ansfield d8d436cef6 Koenig - Fix error when pressing Enter in title when first section is a list
refs https://github.com/TryGhost/Ghost/issues/9623
- ensure we're grabbing the correct section list, listItem.parent.sections is a list of the list items rather than all document sections
2018-06-14 13:01:54 +01:00
Kevin Ansfield ad3a411270 Koenig - Fix PSM meta/twitter/facebook pane errors on new posts
refs https://github.com/TryGhost/Ghost/issues/9623
- do not assume that a markdown card exists when generating the SEO description preview
2018-06-14 12:38:43 +01:00
Kevin Ansfield 38925db0f4 Koenig - Deselect cards when a click happens outside of the editor canvas
refs https://github.com/TryGhost/Ghost/issues/9623
- move click handler registration from `onEnterEdit` to `onSelect`
- add guard against deselecting for clicks on the editor canvas
  - prevents card being deselected when the click would have placed the cursor in a position that selected the card
  - requires editor instance to be passed through to `{{koenig-card}}` in all card components
2018-06-14 12:21:22 +01:00
Kevin Ansfield 57a66f7cdc 🐛 Koenig - Fix embedding of multiple FB Videos
refs https://github.com/TryGhost/Ghost/issues/9623
- wrap all embeds in an `<iframe>` so that their scripts are isolated (fixes FB Video)
- add `MutationObserver` implementation to adjust iframe height as embed's content is loaded
- add `noframe.js` to resize embedded iframes such as YouTube videos
2018-06-13 17:13:33 +01:00
Kevin Ansfield f9b08d8d64 🎨 Koenig - Focus URL input after creating embed card
refs https://github.com/TryGhost/Ghost/issues/9623
2018-06-13 11:14:34 +01:00
Kevin Ansfield 8d5c8c99b5 Koenig - Extract card caption input into component
refs https://github.com/TryGhost/Ghost/issues/9623
- add new `{{koenig-caption-input}}` component
- yield koenig-caption-input instance from the `{{koenig-card}}` component
- remove duplicated caption logic from image and embed cards
- remove placeholder when caption input has focus
2018-06-12 18:10:23 +01:00
Kevin Ansfield b0bca6e428 Version bump to 1.24.3 2018-06-12 16:56:24 +01:00
Kevin Ansfield 7967ee3894 Koenig - Embed card
refs https://github.com/TryGhost/Ghost/issues/9623
requires https://github.com/TryGhost/Ghost/pull/9666
- `{{koenig-card-embed}}`
    - URL input
    - perform oembed lookup & fetch on <kbd>Enter</kbd>
    - remove card if enter pressed with empty URL
    - show error message on server error
        - "retry" returns to input bar
        - "paste as link" removes card and outputs link
        - "X" removes card
    - force embedded <script> tags to run
    - wrap embed html with `.koenig-embed-{video,photo,rich}` class
- add embed cards to the (+) and /-menus
    - "section" support in the card menus
    - refactor to use single card menu map and content component for both menus
    - update /-menu keyboard movement to handle sections
- add parameter support to /-menu commands
  - `/embed {url}` will insert embed card and automatically fetch oembed for supplied url
2018-06-12 14:07:50 +01:00
Kevin Ansfield f58d462c90 🐛 Koenig - Disable Grammarly to fix high CPU usage
refs https://github.com/TryGhost/Ghost/issues/9623
- see mobiledoc-kit [caveats](https://github.com/bustle/mobiledoc-kit#caveats) and [associated grammarly issue](https://github.com/bustle/mobiledoc-kit/issues/422)
2018-06-11 18:48:43 +01:00
Kevin Ansfield dae7a2a42a Version bump to 1.24.2 2018-06-11 13:23:02 +01:00
Zimo f3aef508c9 Adding placeholder illustration for Koenig image empty state 2018-06-11 13:29:39 +02:00
Kevin Ansfield 75193d4042 Re-create yarn.lock
no issue
- bumps sub-dependency versions
2018-06-11 12:03:24 +01:00
Kevin Ansfield 646cbb557e Bump dependencies
no issue
- bump non-breaking dependencies
2018-06-11 11:32:08 +01:00
Zimo cabeb4ef78 Koenig - Night Shift support
refs https://github.com/TryGhost/Ghost/issues/9623
- bump `ghost-spirit` dependency to include dark mode support
- import Spirit's dark mode file in `app-dark.css`
2018-06-07 09:48:27 +01:00
kirrg001 6506020ca2 Version bump to 1.24.1 2018-06-07 10:21:01 +02:00
Kevin Ansfield 27725c3a0f 🐛 Koenig - Fixed scroll jump when card is selected
refs https://github.com/TryGhost/Ghost/issues/9623
- if a card is selected, skip the "keep cursor in view" routine
2018-06-06 14:51:52 +01:00
Kevin Ansfield b77d11b248 Bump eslint-plugin-ghost
no issue
- allow `++` and `--` in `for` loops
2018-06-06 13:50:22 +01:00
kirrg001 3fef1aa8cd Version bump to 1.24.0 2018-06-05 19:04:58 +02:00
Zimo 71c6830c3e Adding embed card icons 2018-06-05 13:08:05 +02:00
ean a18d8d3e59 Fixed tab not focusing role select in Invite User modal (#1020)
closes #7132
- removed `tabindex` from role selection on invite user field
- removing the tabindex defaults the tabindex to "-1"
2018-06-04 17:51:09 +01:00
Kevin Ansfield 4bf815dba4 Fixed autofocus not working on modal inputs
refs https://github.com/TryGhost/Ghost/issues/7132
- apply generic `autofocus` support to anything rendered through `liquid-wormhole`
    - overrides `liquid-wormhole`'s default `wormhole` transition, adding a check for a `<input autofocus>` element and calling focus on it once the default transition and liquid-wormhole element swap has completed
- autofocus search input in Unsplash modal
2018-06-04 17:48:57 +01:00
Kevin Ansfield 8e3b7fa5ad Revert liquid-fire@0.29.3 bump
no issue
- broke modal transitions, modal was hidden until the transition finished
2018-06-04 15:54:24 +01:00
Kevin Ansfield 2e65779c82
Bump dependencies (#1022)
no issue
- bump deps with non-breaking changes
- swap manual styles for Spirit's `pointer-events` classes in Koenig
2018-06-04 14:35:36 +01:00
Kevin Ansfield 06209794c9 🐛 Fixed broken scrolling/scroll bars in Code Injection inputs
closes https://github.com/TryGhost/Ghost/issues/9635
- CodeMirror expects default CSS box-sizing rather than `border-box` so it's scroll calculations were thrown off
- reset the `box-sizing` properties on CM elements
- remove now unnecessary  `.CodeMirror-scroll` patches that we'd put in place to cover broken scroll behaviour
- move all non-layout-specific CM styles into a `components/codemirror.css` file
2018-06-04 13:29:28 +01:00
Kevin Ansfield 7089e6a74d Improved delete subscriber icon visibility in Night Shift
refs https://github.com/TryGhost/Ghost-Admin/pull/989
- changed the delete subscriber icon to match the colour of the rest of the table contents (thanks @CriticalRespawn)
- replaced manual colour hex code values with respective colour var in `app-dark.css`
2018-06-04 11:29:23 +01:00
Abdullah Samman a6efb425c4 Fixed broken loading state on transition between posts in editor (#1021)
closes https://github.com/TryGhost/Ghost/issues/9582
- clear the `post` model on the `editor` controller when swapping models to avoid the editor contents and the editor loading state being displayed simultaneously
2018-06-04 09:46:49 +01:00
Kevin Ansfield 38ae7bf738 Remove errant console.log 2018-06-01 18:17:09 +01:00
Kevin Ansfield 8989bf1b2f Koenig - ^superscript^ and ~subscript~ text expansion support
refs https://github.com/TryGhost/Ghost/issues/9623
- added additional text expansions for `^sup^` and `~sub~` that also work inside of words
- added sub and sub expansions to the special formats list so that <kbd>Backspace</kbd> undoes the expansion
2018-06-01 17:53:15 +01:00
Kevin Ansfield 20503ee66a Koenig - Do not show image toolbar until image is uploaded
refs https://github.com/TryGhost/Ghost/issues/9623
- update `{{koenig-card}}` to show the toolbar immediately if it has changed
- update `{{koenig-card-image}}` to only add toolbar items when an image is present
2018-05-31 09:45:58 +01:00
Kevin Ansfield eeee87fd0c Koenig - Drag & drop image card creation + upload
refs https://github.com/TryGhost/Ghost/issues/9623
- add `dropTargetSelector` property so that `{{koenig-editor}}` can attach drag/drop events to a larger area
- add drag/drop event handlers to `{{koenig-editor}}`
    - ignore drops that occur on cards in edit mode (cards should handle drop events themselves if required)
    - extract image files from the drop event and use them to create image cards
- extract image card creation from image files into a helper function
2018-05-30 17:14:39 +01:00
Kevin Ansfield 93161319f5 Version bump to 1.23.1 2018-05-29 16:14:04 +01:00
Kevin Ansfield b174f2df14 Koenig - Create image cards when pasting image files
refs https://github.com/TryGhost/Ghost/issues/9623
- detect pastes that contain image files and insert a card for each, setting `payload.files` to the `File` instance grabbed from the clipboard
- update the `addComponent` hook to ensure the `payload.files` array is preserved, browsers do not allow `File` instances to be copied
- update `{{koenig-card-image}}` to look for a `payload.files` value to auto-upload it via it's internal `{{gh-uploader}}`
- NOTE: browser support for accessing image files on paste varies:
    - Safari: will paste all images
    - Chrome: will only paste the first image
    - Firefox: will not paste any images
2018-05-29 15:23:50 +01:00
Kevin Ansfield 83d7211053 Koenig - Fixed "set on destroyed object" error
refs https://github.com/TryGhost/Ghost/issues/9623
- the `{{koenig-toolbar}} `didReceiveAttrs` hook was triggering an async action when the component was being destroyed so a guard is needed around the call to `set` in the `_hideToolbar` method
2018-05-28 16:54:16 +01:00
Kevin Ansfield bc309a06fb 🐛 Koenig - Fixed pasting content into a container card (HTML, markdown, code)
refs https://github.com/TryGhost/Ghost/issues/9623
- pasting inside a container card such as markdown or HTML would paste content into the card and duplicate that content outside of the card, exiting the card's edit mode in the process
- use the same "addressable" check that mobiledoc-kit's event manager uses
2018-05-28 11:28:25 +01:00
Kevin Ansfield 29e762427d Koenig - Fixed non-clickable area at top of editor
refs https://github.com/TryGhost/Ghost/issues/9623
2018-05-24 13:33:26 +01:00
Kevin Ansfield 36a4c7dde9
Koenig - Keep cursor on screen when typing or moving via keyboard (#1012)
refs https://github.com/TryGhost/Ghost/issues/9505
- when cursor changes through the normal `cursorDidChange` or through certain programmatic changes we trigger a check to see if the cursor is out of the viewport and scroll it into view if necessary
- disable our scroll-into-view routine if the mouse button or shift key is down so that we don't interfere with default browser behaviour which works well in that situation
- for scroll-into-view at the bottom there are two slightly different methods
    - if the cursor is near the bottom of the document we scroll so that the bottom padding of the editor is visible
    - if the cursor is mid-document then we scroll just enough to bring the cursor into the viewport
2018-05-24 13:30:50 +01:00
Kevin Ansfield 0f8ef2bb63 Koenig - Allow `> ` expansion to convert existing text to blockquotes
refs https://github.com/TryGhost/Ghost/issues/9623
- match `> ` behaviour to `# ` behaviour so entering it at the beginning of an existing paragraph will convert that paragraph to a blockquote
2018-05-23 16:49:18 +01:00
Kevin Ansfield 1ffed70e1b 🎨 Koenig - Ease removal of formatting on first section
refs https://github.com/TryGhost/Ghost/issues/9623
- pressing <kbd>Backspace</kbd> on an empty paragraph when it is the first and only section will now remove any heading or blockquote formatting that paragraph had
2018-05-23 15:45:10 +01:00
Kevin Ansfield f98a23a902 Koenig - Fix card selection after exiting blank container card
refs https://github.com/TryGhost/Ghost/issues/9623
- it's necessary to pass a cursor movement to `deleteCard` for card selection after the delete to work
- default to `CURSOR_AFTER` as it's the more typical direction compared to `NO_CURSOR_MOVEMENT`
2018-05-23 15:12:30 +01:00
Kevin Ansfield 6cbf03f7f4 Koenig - Fixed card deselection when cursor exits top of doc
refs https://github.com/TryGhost/Ghost/issues/9623
- add a `exitCursorAtTop` action to `{{koenig-editor}}` that will deselect any cards before calling the closure action
- check if the we're on a card section when pressing UP or LEFT so that the cursor being before/after the card doesn't trip up the logic
2018-05-23 14:49:39 +01:00
Kevin Ansfield c81b39e942 Koenig - Remove trailing paragraph on paste workaround
refs https://github.com/TryGhost/Ghost/issues/9623
- now that we're not creating unnecessary undo states, pasting cards with an immediate Cmd+Z works fine so we don't need to create a trailing paragraph as a partial workaround
2018-05-23 14:25:54 +01:00
Kevin Ansfield f232d3b984 🐛 Koenig - Fixed creation of unnecessary undo states
refs https://github.com/TryGhost/Ghost/issues/9623
- only use `editor.run` calls when performing edits, do not use them when only moving the cursor/selection
2018-05-23 14:20:03 +01:00
Kevin Ansfield 5462081cbe Koenig - Fixed card creation from plus menu
refs f3f3526818
- perform a check for a click originating on the plus menu in `{{koenig-card}}` to avoid an immediate deselection as soon as an editable card is created
- removed unnecessary `.koenig-plus-menu` class in favour of `[data-kg="plus-menu"]` selector
2018-05-23 14:11:42 +01:00
Kevin Ansfield e167222332 Koenig - Fix card tests (missing action placeholders) 2018-05-23 11:59:20 +01:00
Kevin Ansfield f3f3526818 🎨 Koenig - Exit edit mode of a card when clicking outside the card
refs https://github.com/TryGhost/Ghost/issues/9623
- register window click handler in `{{koenig-card}}` whilst card is in edit mode
  - deselect card when a click is registered
  - ignore any clicks inside the card
  - ignore any clicks that originate inside of a modal
- pass our `deselectCard` action through to all cards
2018-05-23 11:38:30 +01:00
Kevin Ansfield 25c44731fd Version bump to 1.23.0 2018-05-22 20:29:46 +01:00