no issue
- adds `eslint-plugin-sort-imports-es6-autofix` dependency
- implements ESLint's base `sort-imports` rule but has a distinction in that `import {foo} from 'bar';` is considered `multiple` rather than `single`
- fixes ESLint's autofix behaviour so `eslint --fix` will actually fix the sort order
- updates all unordered import rules by using `eslint --fix`
With the increased number of `import` statements since Ember+ecosystem started moving towards es6 modules I've found it frustrating at times trying to search through randomly ordered import statements. Recently I've been sorting imports manually when I've added new code or touched old code so I thought I'd add an ESLint rule to codify it.
refs https://github.com/TryGhost/Ghost/issues/5422
- handles errors and warnings from returned from the server and improves visual display
- adds a reset so that errors are cleared when leaving the labs screen
- removes the unnecessary "Import failed" alert - we already show the errors on the screen, no point bugging the user even further
no issue
- the synchronous settings service keeps an internal reference to the settings model, when everything in the store is unloaded during an import that reference breaks and will throw errors when accessing areas of the app that read values from it. This change adds an explicit reload of the settings model during import so that later navigation doesn't break.
no issue
- removes transition on `all` properties in favour of an explicit list, fixes the buttons flickering after the modal appears and the outline/text being visible when the modal disappears
- simplifies the liquid-fire transition so that elements being removed at slightly different times doesn't cause flickering when the modal is removed
closesTryGhost/Ghost#8360
- when changing the publish time of an already scheduled post in the publish menu and leaving the menu with clicking outside of the menu, the time wouldn't reset properly and be shown in the PSM. With the usage of an `isClosing` property which is passed to the underlying `gh-publishmenu-scheduling` component, we prevent the changed time from being saved and reset it properly instead.
refs #706
- bumping to `autoprefixer@7.0.1` in #673 caused `cssnano` to fail on production builds
- upgrading to latest autoprefixer didn't result in any wins
- reverting to `autoprefixer@6.7.7` for now, we may need other dependencies to bump their `postcss` support before it can be upgraded
refs TryGhost/Ghost#8455
- ensure `uploadUrls` and `errors` are cleared in `gh-uploader` when new uploads are started
- yield `isUploading` in `gh-uploader` component
- replace image upload modals in settings/general with in-page uploads
closesTryGhost/Ghost#8443
- Fixes a bug where the keyboard shortcut `cmd+s` would cause a `Maximum call stack size` error and not save.
- Wherever there is a `save` button, the keyboard shortcut to save works now.
closes https://github.com/TryGhost/Ghost/issues/8461
- adds toggle spellcheck button to the `gh-markdown-editor` toolbar
- adds custom styles to fake a spellcheck icon
- updates `simplemde` fork
- adds `spellcheck` to the list of toolbar buttons that don't have their `active` class removed based on cursor position
- removes bundled `marked` dependency that we no longer use
closes https://github.com/TryGhost/Ghost/issues/8463
- move generic text input handling into `text-input` mixin so it applies to text inputs and textareas
- adds `autoExpand` property to `gh-textarea` that accepts a selector to watch for resize changes, if the property is set then auto-expanding behaviour is triggered any time the textarea value is changed or when the selector element is resized (this prevents change in textarea width from toggling nav or split screen mode resulting in textarea content being hidden or the textarea being taller than it's contents)
- adds `ember-element-resize-detector` addon to allow watching of element resizes rather than window resizes (this was already included as a sub-dependency via `ember-light-table`->`ember-scrollable`->`ember-element-resize-detector`)
closesTryGhost/Ghost#7134
Overhaul of the user settings page to make it more consistent with other settings panels.
The hardly readable validation for user "Full Name" is redundant as well, as the input field for it now has the same styles as the other input fields.
refs https://github.com/TryGhost/Ghost/issues/8296
- permit Facebook usernames with less than 5 chars
- brands are allowed to have Page names with less than 5 chars (ex: facebook.com/nike)
- current/former employees are allowed to have usernames with less than 5 chars (ex: facebook.com/zuck)
✨ use markdown-it for markdown previews
no issue
- replaces SimpleMDE's default `marked` rendering with `markdown-it`
- add ember-browserify and markdown-it plugins
closesTryGhost/Ghost#8143
- uses new soft limits in validation:
- post title to 255
- meta title (post and tag) to 300
- meta description (post and tag) to 500
no issue
- when entering preview mode (not split-screen preview) the toolbar buttons are now disabled. This is usually built in to SimpleMDE but that wasn't working because we've moved the location of the toolbar in the DOM
- hides the markdown editor when entering preview mode to prevent the markdown code appearing at the bottom of the preview when the markdown length is longer than the preview length
no issue
- adds a hidden file input to the `gh-markdown-editor` component
- when the editor image toolbar button is clicked, capture the current selection (it gets during the file upload), trigger the file dialog then when files are selected initiate the same upload+insert process as drag/drop image uploads
no issue
- fix visible scroll bars were rendered to the right and bottom of the internal editor area in certain browser/OS configurations
- disable the preview button when in split-screen mode as it's not any use there
- exit SimpleMDE preview mode if it's active when entering split-screen mode
no issue
* fix title input padding and placeholder weight
* 🔥 remove unused showdown-ghost dependency
* implement full screen mode via CSS rather than autonav toggle
* implement custom split pane editor preview
- replace SimpleMDE's split pane handling with our own so that we have more control over the element positioning, toggling of our custom fullscreen code, and so that the preview pane can be scrolled separately as per our old editor
* use forked version of simplemde that has the latest CodeMirror compiled
- SimpleMDE hasn't been updated for 11 months and the version of CodeMirror is baked into the SimpleMDE code, to get an up to date version I've forked and re-compiled
- pull in the unminified SimpleMDE source so that it's easier to debug in development, our asset compilation steps will take care of minifying it for production
* fix gh-markdown-editor teardown
no issue
* move "save on first change" behaviour into editor controller
* allow TAB events to be specified in keyEvents hash of gh-input
* replace mobiledoc-kit/gh-koenig with a SimpleMDE based editor
- remove `gh-koenig` in-repo-addon from `package.json` so that test files etc aren't loaded
- remove `mobiledoc-kit` dependencies
- extends `gh-editor` to handle file drag/drop
- adds `gh-uploader` and `gh-progress-bar` components to handle file uploads in a more composable manner
- adds `gh-simplemde` component that wraps SimpleMDE
no issue
* split key commands and text expansions into separate files for easier file searches
* basic formatting, added a few comments
* move editor title input into addon
- the editor and title are now tightly integrated so that it's possible to use up/down cursor navigation so it makes more sense to keep them together
- start of a deeper component restructure so that we don't need to leak properties/actions to parent components
* first pass at refactor of gh-koenig and koenig-title-input
- remove need for editor reference to be held outside of the `gh-koenig` component by yielding it from the component so that the integrated title element can sit inside the container's scope
- refactor `gh-koenig` to more closely match the default ember mobiledoc addon
- fixes runloop issues by starting/ending a manual runloop
- refactored the mutation observer and event handlers in `koenig-title-input` so that we're not doing unecessary work on every render/key press
- rename CSS classes to be more specific (these may still need more separation between `.gh` and `.kg` later)
- `.editor-holder` to `.gh-koenig-container`
- `.surface` to `.gh-koenig-surface`
* fix tests and start testing refactor
* move gh-koenig integration tests into addon, remove empty test files
* first-pass at component template cleanup
* first pass at koenig-toolbar-button refactor
- Added cursor events to hover state to indicate possibility of editing images by clicking on them
- Added min-width to images inside image uploader to prevent SVG images from collapsing and being invisible as a result
closesTryGhost/Ghost#8202
- added wordcount for mobiledoc text and html/markdown cards (cards will only update word count when leaving edit state)
- word count is only displayed on wide screens
no issue
When calculating if the editor should scroll to keep the cursor on screen upon selection change the editor would appear to scroll to random locations.
The issue stemmed from the fact that the getPositionFromRange method took into account the scroll offset when figuring out the pixel position of a range. So, if the editor was vertically scrolled the scrollTop was added to the cursor position which the editor would assume meant that the cursor was offscreen when it wasn't.
This fix creates a new method getPositionOnScreenFromRange which finds the position of an element on screen and ignores the scroll offset.
closes https://github.com/TryGhost/Ghost/issues/8312
- all new cards created now enter in selected mode and if enabled edit mode.
- if deleting cards places the cursor in an empty section the '+' menu is placed AFTER the card is deleted which ensures it's placed in the correct location
closes https://github.com/TryGhost/Ghost/issues/8353
- if a user pastes or inserts HTML into the title in some other way (modifying the dom, having a plugin mutate the dom, etc) then strip the HTML and insure that the title is always unstyled and plain text