no issue
- if the character used to define a special markup is different such as in the text replacement editor, pressing Backspace was not inserting the correct characters
refs 6f5c2a9557
- we previously set a fixed mobiledoc spec version in blank documents but when the editor was serializing to a json string after editing it was bumping the spec version
- makes the specific version a constant to be used when serializing any mobiledoc
no issue
- adds "Email" card to the card menus when developer experiments is turned on
- adds `<KoenigTextReplacementHtmlInput>` implementing most of Koenig except:
- uses html as it's input/output format
- replaces backtick "code" formatting with `{replacement}`
- no headings
- no cards at all
- minimal toolbar but all formatting is still available using markdown text expansions or keyboard shortcuts
no issue
- the card wrapper component was registering an event handler for keyboard events when entering edit mode. This was a problem because those events were also picking up the initial ctrl/cmd+enter and then immediately toggling back out of edit mode
- added a 20ms timeout for registering the event handlers so that they're not working cross-purposes
no issue
- when the mobiledoc spec changes due to a mobiledoc-kit version bump, any posts created with that version will fail to load in the editor if a rollback to an earlier Ghost version occurs
- use an explicit version to avoid the problem - we should only be bumping the mobiledoc spec version if we start using features from that version and mark it as a breaking change
closes https://github.com/TryGhost/Ghost/issues/10240
- intercept known macOS content-modifying keyboard shortcuts and simulate the "normal" keyboard events that they map to
- `ctrl+h`: `Backspace`
- `ctrl+d`: `Delete`
closes https://github.com/TryGhost/Ghost/issues/10090
- when mobiledoc-kit replaces the selection the caret window selection is temporarily set to the whole editor element which was causing our scroll-cursor-into-view routine to scroll incorrectly
- adding the guard allows the first replacement cursor change to be ignored but the second cursor change to be picked up which will do nothing if the text is on-screen, or scroll if it's off screen as normal
closes https://github.com/TryGhost/Ghost/issues/9792
- use `getClientRects()` to get separate rectangles for each line of a link and use the mouse position to find the closest one so that the toolbar can be positioned relative to that link section on that line rather than always in the middle of the editor canvas
- pass the rectangle used for positioning the link toolbar through to the link input component so that there is no jumping of position when clicking the edit button
no issue
- removes number of clicks required to insert images, especially when using the `/image` shortcut
- strips `triggerBrowse` property from the payload after inserting to avoid triggering file browse when a post with blank image cards is rendered/re-rendered
no issue
- the `willDestroyElement` hook is referencing event handlers that aren't used in the bookmark card
- stopped setting `type` in the card payload as it's not used anywhere (possible hangover from when bookmarks were a type of embed card)
no issue
- convert relative links to absolute based on the configured blog url when displaying URLs in the link toolbar and when manually setting a relative link
- converting to absolute in the editor prevents the in-memory mobiledoc getting out of sync with the server response when it converts relative urls to absolute
requires https://github.com/TryGhost/Ghost/pull/11024
With the bookmark card you can present links in a much richer format, similar to Twitter cards. If the URL points to a page with right meta information it can show the page title, excerpt, author, publisher and even a preview image.
Bookmark cards can be created in two ways:
1. pasting a link as the first thing in blank paragraph - we'll check to see if we can create an embed, if we can't then we'll create a bookmark card instead
2. manually selecting the bookmark card from the (+) menu or by typing "/bookmark<kbd>Enter</kbd>" or "/bookmark {url}<kbd>Enter</kbd>" for short (you might want to do this if you want the bookmark version instead of a full embed)
Pressing <kbd>Ctrl/Cmd+Z</kbd> after pasting will convert the bookmark card back to a link if that's preferred, alternatively a URL can be pasted with <kbd>Ctrl/Cmd+Shift+V</kbd> to avoid any automatic transformation to an embed/bookmark.
---
- adds "bookmark" card that functions similarly to the embed card
- if the oembed API request returns `type: "bookmark"` then the metadata is used to create a bookmark card
no issue
- adds an "Alt" button that is displayed in the caption input whilst an image card is selected, clicking it toggles between the rich-text caption input and a plain-text alt text input
no issue
- adjust drag handlers in the editor and gallery card to handle drag/drop of image cards as well as straight images
- adjust drag handlers in the gallery card to handle image inserts as well as re-orders
- add `onDragEnd` event/action to the Koenig drag-n-drop handler so that containers can perform cleanup if one of their draggables was successfully dropped into a different container
- change ghost element when dragging an image card to be an image rather than a card icon
- allow `createGhostElement` function passed in when registering a drag-n-drop container to fall back to the default behaviour by returning a falsy value
no issue
- update dependency `eslint-plugin-ghost` to v0.3.0
- includes new rules from `eslint-plugin-ember` 6.3.0-6.7.0
- fixed linting failures for new rules
refs. https://github.com/TryGhost/Team/issues/205
Major update to Ghost Admin UI including:
- improved general consistency (typography, colors and contrast, UI components, icons)
- new design for post and pages lists, improved discoverability of filters
- search moved to modal
- account menu is decoupled from ghost logo
- further usability fixes
no issue
- `@tryghost/kg-parser-plugins` contains the parser plugins used by the editor and was extracted so that they can be used in server-side html-to-mobiledoc conversion
no issue
- `cleanBasicHtml` has been extracted to an external package so that it can be used inside the extracted `@tryghost/kg-parser-plugins` package server-side
no issue
- Added a language indicator when in rendered mode and a language input when in edit mode
- Allow code card language to be set with <code>```lang</code>+<kbd>Space/Enter</kbd> expansion
- previously <code>\`\`\`</code> would immediately create a code card, the <kbd>Space/Enter</kbd> is now necessary for the insertion to occur
- lang is optional <code>\`\`\`</code>+<kbd>Space/Enter</kbd> will insert a code card with no language selected
- requires <kbd>Enter</kbd> to be pressed to finalise the expansion and insert the card
- added hook for text expansions to skip newline creation for when they are triggered with <kbd>Enter</kbd>
- Set the code card editor's language mode based on selected language
- set the CodeMirror mode based on the code card payload language
- add a basic map of language short codes to their respective CodeMirror modes
- observe `mode` property in `{{gh-cm-editor}}` so that the mode is properly set when it's changed after initial render
closes https://github.com/TryGhost/Ghost/issues/9847
- the text expansion is triggered twice in this situation, the first time with `""` and the second with `"/"`. The second trigger was trying to match cards to `"/"` which returned an empty card set
- added a quick workaround that ensures we never include a leading `/` in the card selection query
no issue
- added `page` model
- removed `page` param from Post model
- added pages screen with associated links
- added `:type` param to editor screens to work with the right models
- removed post<->page toggle and associated tour item
closes https://github.com/TryGhost/Ghost/issues/10399
- added a data attribute `data-koenig-dnd-disabled` which will prevent the element or any of it's children from initiating a koenig drag event
- applied the data attribute to `{{koenig-basic-html-input}}`'s outer tag so that captions never initiate a card re-order
- disabled card re-ordering when a card is in edit mode
- allows text selection within a markdown/html card without triggering the card re-order behaviour
- clicking another card will exit edit mode and re-enable drag before the drag behaviour is initiated so you can still re-order other cards if you've left a card in edit mode
no issue
- the polyfill is no longer required for latest browsers (tested on Chrome, FF, and Safari)
- Edge may have problems but it's not currently supported
- reduces build size. Before/after:
- `vendor.min.js: 3.29 MB (706 KB gzipped)`
- `vendor.min.js: 3.2 MB (672.92 KB gzipped)`
no issue
- add vertical drop position indicator handling to `koenig-drag-drop-handler` service
- fixed issues with nested drag-and-drop containers
- register card drag/drop handler in `koenig-editor`
- add drag icon creation
no issue
- clear the cached `insertIndex` when hiding the drop position indicator
- update the gallery card's `_isDropAllowed` function to return `false` if the `droppabeIndex` (`insertIndex`) doesn't exist
no issue
- when dragging an image, if you dragged out of the gallery then back in directly over the space between images then no indicator was shown
- switch to using padding around images rather than margin so that the mouse can be detected over the gap. Added classes to the image overlays to account for the change in sizing
no issue
- first pass at implementation of drag-and-drop re-ordering of images within a gallery
- adds a `koenig-drag-drop-handler` service that allows consumers (editor and cards) to hook into drag and drop behaviour without interfering with each other and allows for future possibilities such as dragging images between galleries or into/out of galleries