fix: super note improvements (#1991)

* fix: super note previews

* fix; checkmark size

* fix: top padding

* fix: prevent delete shortcut

* fix: spellcheck control

* fix: only embed file if uploaded to current note

* fix: ability to create new tag from editor autocomplete

* feat: protected file embed handling

* fix: event payload
This commit is contained in:
Mo
2022-11-10 09:35:53 -06:00
committed by GitHub
parent 0cbc23f740
commit 2dbc89594e
25 changed files with 261 additions and 90 deletions

View File

@@ -20,6 +20,7 @@ import {
} from '@standardnotes/snjs'
import { action, computed, makeObservable, observable } from 'mobx'
import { AbstractViewController } from './Abstract/AbstractViewController'
import { CrossControllerEvent } from './CrossControllerEvent'
import { FilesController } from './FilesController'
import { ItemListController } from './ItemList/ItemListController'
import { NavigationController } from './Navigation/NavigationController'
@@ -262,24 +263,35 @@ export class LinkingController extends AbstractViewController {
this.reloadAllLinks()
}
linkItemToSelectedItem = async (itemToLink: LinkableItem) => {
linkItemToSelectedItem = async (itemToLink: LinkableItem): Promise<boolean> => {
const cannotLinkItem = !this.isEntitledToNoteLinking && itemToLink instanceof SNNote
if (cannotLinkItem) {
void this.publishCrossControllerEventSync(CrossControllerEvent.DisplayPremiumModal, {
featureName: 'Note linking',
})
return false
}
await this.ensureActiveItemIsInserted()
const activeItem = this.activeItem
if (!activeItem) {
return
return false
}
await this.linkItems(activeItem, itemToLink)
return true
}
createAndAddNewTag = async (title: string) => {
createAndAddNewTag = async (title: string): Promise<SNTag> => {
await this.ensureActiveItemIsInserted()
const activeItem = this.activeItem
const newTag = await this.application.mutator.findOrCreateTag(title)
if (activeItem) {
await this.addTagToItem(newTag, activeItem)
}
return newTag
}
addTagToItem = async (tag: SNTag, item: FileItem | SNNote) => {