diff --git a/packages/ui-services/src/Import/AegisConverter/AegisToAuthenticatorConverter.ts b/packages/ui-services/src/Import/AegisConverter/AegisToAuthenticatorConverter.ts index 519f8c746..844af9ee9 100644 --- a/packages/ui-services/src/Import/AegisConverter/AegisToAuthenticatorConverter.ts +++ b/packages/ui-services/src/Import/AegisConverter/AegisToAuthenticatorConverter.ts @@ -67,6 +67,7 @@ export class AegisToAuthenticatorConverter implements Converter { text, noteType: NoteType.Authentication, editorIdentifier: NativeFeatureIdentifier.TYPES.TokenVaultEditor, + useSuperIfPossible: false, }), ] } diff --git a/packages/ui-services/src/Import/Converter.ts b/packages/ui-services/src/Import/Converter.ts index d975cfc6a..c4d780824 100644 --- a/packages/ui-services/src/Import/Converter.ts +++ b/packages/ui-services/src/Import/Converter.ts @@ -32,6 +32,7 @@ export type CreateNoteFn = (options: { pinned?: boolean trashed?: boolean editorIdentifier?: NoteContent['editorIdentifier'] + useSuperIfPossible: boolean }) => DecryptedTransferPayload export type CreateTagFn = (options: { diff --git a/packages/ui-services/src/Import/EvernoteConverter/EvernoteConverter.ts b/packages/ui-services/src/Import/EvernoteConverter/EvernoteConverter.ts index 092efbfce..bb68e8fad 100644 --- a/packages/ui-services/src/Import/EvernoteConverter/EvernoteConverter.ts +++ b/packages/ui-services/src/Import/EvernoteConverter/EvernoteConverter.ts @@ -3,7 +3,6 @@ import dayjs from 'dayjs' import customParseFormat from 'dayjs/plugin/customParseFormat' import utc from 'dayjs/plugin/utc' import { GenerateUuid } from '@standardnotes/services' -import { NoteType } from '@standardnotes/features' import MD5 from 'crypto-js/md5' import Base64 from 'crypto-js/enc-base64' import { Converter } from '../Converter' @@ -109,7 +108,7 @@ export class EvernoteConverter implements Converter { updatedAt: updatedAtDate, title: !title ? `Imported note ${index + 1} from Evernote` : title, text, - noteType: NoteType.Super, + useSuperIfPossible: canUseSuper, }) const xmlTags = xmlNote.getElementsByTagName('tag') diff --git a/packages/ui-services/src/Import/GoogleKeepConverter/GoogleKeepConverter.ts b/packages/ui-services/src/Import/GoogleKeepConverter/GoogleKeepConverter.ts index 17f04788f..440de487e 100644 --- a/packages/ui-services/src/Import/GoogleKeepConverter/GoogleKeepConverter.ts +++ b/packages/ui-services/src/Import/GoogleKeepConverter/GoogleKeepConverter.ts @@ -1,5 +1,4 @@ import { DecryptedTransferPayload, NoteContent } from '@standardnotes/models' -import { NoteType } from '@standardnotes/features' import { Converter, CreateNoteFn } from '../Converter' type Content = @@ -125,7 +124,7 @@ export class GoogleKeepConverter implements Converter { updatedAt: date, title: title, text: content, - noteType: NoteType.Super, + useSuperIfPossible: true, }) } @@ -181,7 +180,7 @@ export class GoogleKeepConverter implements Converter { archived: Boolean(parsed.isArchived), trashed: Boolean(parsed.isTrashed), pinned: Boolean(parsed.isPinned), - noteType: NoteType.Super, + useSuperIfPossible: true, }) } catch (e) { console.error(e) diff --git a/packages/ui-services/src/Import/HTMLConverter/HTMLConverter.ts b/packages/ui-services/src/Import/HTMLConverter/HTMLConverter.ts index f8002cba0..8219c7d1f 100644 --- a/packages/ui-services/src/Import/HTMLConverter/HTMLConverter.ts +++ b/packages/ui-services/src/Import/HTMLConverter/HTMLConverter.ts @@ -1,4 +1,3 @@ -import { NoteType } from '@standardnotes/features' import { parseFileName } from '@standardnotes/filepicker' import { Converter } from '../Converter' @@ -33,7 +32,7 @@ export class HTMLConverter implements Converter { updatedAt: updatedAtDate, title: name, text, - noteType: NoteType.Super, + useSuperIfPossible: true, }), ] } diff --git a/packages/ui-services/src/Import/Importer.ts b/packages/ui-services/src/Import/Importer.ts index 7e359a2cb..18b9c184c 100644 --- a/packages/ui-services/src/Import/Importer.ts +++ b/packages/ui-services/src/Import/Importer.ts @@ -98,6 +98,7 @@ export class Importer { trashed, archived, pinned, + useSuperIfPossible, }) => { if (noteType === NoteType.Super && !this.isEntitledToSuper()) { noteType = undefined @@ -111,6 +112,8 @@ export class Importer { editorIdentifier = undefined } + const shouldUseSuper = useSuperIfPossible && this.isEntitledToSuper() + return { created_at: createdAt, created_at_timestamp: createdAt.getTime(), @@ -122,11 +125,11 @@ export class Importer { title, text, references: [], - noteType, + noteType: shouldUseSuper ? NoteType.Super : noteType, trashed, archived, pinned, - editorIdentifier, + editorIdentifier: shouldUseSuper ? NativeFeatureIdentifier.TYPES.SuperEditor : editorIdentifier, }, } } diff --git a/packages/ui-services/src/Import/PlaintextConverter/PlaintextConverter.ts b/packages/ui-services/src/Import/PlaintextConverter/PlaintextConverter.ts index 1dfe2ff17..33e0bf27f 100644 --- a/packages/ui-services/src/Import/PlaintextConverter/PlaintextConverter.ts +++ b/packages/ui-services/src/Import/PlaintextConverter/PlaintextConverter.ts @@ -1,6 +1,5 @@ import { parseFileName } from '@standardnotes/filepicker' import { Converter } from '../Converter' -import { NoteType } from '@standardnotes/features' export class PlaintextConverter implements Converter { constructor() {} @@ -35,7 +34,7 @@ export class PlaintextConverter implements Converter { updatedAt: updatedAtDate, title: name, text: convertMarkdownToSuper(content), - noteType: NoteType.Super, + useSuperIfPossible: true, }), ] } diff --git a/packages/ui-services/src/Import/SimplenoteConverter/SimplenoteConverter.ts b/packages/ui-services/src/Import/SimplenoteConverter/SimplenoteConverter.ts index 1d6b19e38..9a13b4387 100644 --- a/packages/ui-services/src/Import/SimplenoteConverter/SimplenoteConverter.ts +++ b/packages/ui-services/src/Import/SimplenoteConverter/SimplenoteConverter.ts @@ -66,6 +66,7 @@ export class SimplenoteConverter implements Converter { title, text: content, trashed, + useSuperIfPossible: true, }) } diff --git a/packages/ui-services/src/Import/SuperConverter/SuperConverter.ts b/packages/ui-services/src/Import/SuperConverter/SuperConverter.ts index 82d9f53d9..5277d50be 100644 --- a/packages/ui-services/src/Import/SuperConverter/SuperConverter.ts +++ b/packages/ui-services/src/Import/SuperConverter/SuperConverter.ts @@ -1,6 +1,5 @@ import { SuperConverterServiceInterface } from '@standardnotes/files' import { parseFileName } from '@standardnotes/filepicker' -import { NoteType } from '@standardnotes/features' import { Converter } from '../Converter' export class SuperConverter implements Converter { @@ -36,7 +35,7 @@ export class SuperConverter implements Converter { updatedAt: updatedAtDate, title: name, text: content, - noteType: NoteType.Super, + useSuperIfPossible: true, }), ] }