feat: Markdown, Rich text, Code, and Checklist note types have been moved to the new Plugins preferences pane. Previous notes created using these types will not experience any disruption. To create new notes using these types, you can reinstall them from the Plugins preferences screen. It is recommended to use the Super note type in place of these replaced note types. (#2630)

This commit is contained in:
Mo
2023-11-29 10:18:55 -06:00
committed by GitHub
parent bd971d5473
commit c43b593c60
58 changed files with 1106 additions and 680 deletions

View File

@@ -5,11 +5,11 @@ describe('note type', () => {
it('should return the correct note type for editor identifier', () => {
expect(noteTypeForEditorIdentifier(NativeFeatureIdentifier.TYPES.PlainEditor)).toEqual(NoteType.Plain)
expect(noteTypeForEditorIdentifier(NativeFeatureIdentifier.TYPES.SuperEditor)).toEqual(NoteType.Super)
expect(noteTypeForEditorIdentifier(NativeFeatureIdentifier.TYPES.MarkdownProEditor)).toEqual(NoteType.Markdown)
expect(noteTypeForEditorIdentifier(NativeFeatureIdentifier.TYPES.PlusEditor)).toEqual(NoteType.RichText)
expect(noteTypeForEditorIdentifier(NativeFeatureIdentifier.TYPES.CodeEditor)).toEqual(NoteType.Code)
expect(noteTypeForEditorIdentifier(NativeFeatureIdentifier.TYPES.DeprecatedMarkdownProEditor)).toEqual(NoteType.Markdown)
expect(noteTypeForEditorIdentifier(NativeFeatureIdentifier.TYPES.DeprecatedPlusEditor)).toEqual(NoteType.RichText)
expect(noteTypeForEditorIdentifier(NativeFeatureIdentifier.TYPES.DeprecatedCodeEditor)).toEqual(NoteType.Code)
expect(noteTypeForEditorIdentifier(NativeFeatureIdentifier.TYPES.SheetsEditor)).toEqual(NoteType.Spreadsheet)
expect(noteTypeForEditorIdentifier(NativeFeatureIdentifier.TYPES.TaskEditor)).toEqual(NoteType.Task)
expect(noteTypeForEditorIdentifier(NativeFeatureIdentifier.TYPES.DeprecatedTaskEditor)).toEqual(NoteType.Task)
expect(noteTypeForEditorIdentifier(NativeFeatureIdentifier.TYPES.TokenVaultEditor)).toEqual(NoteType.Authentication)
expect(noteTypeForEditorIdentifier('org.third.party')).toEqual(NoteType.Unknown)
})

View File

@@ -32,11 +32,7 @@ export class NativeFeatureIdentifier extends ValueObject<NativeFeatureIdentifier
PlainEditor: 'com.standardnotes.plain-text',
SuperEditor: 'com.standardnotes.super-editor',
CodeEditor: 'org.standardnotes.code-editor',
MarkdownProEditor: 'org.standardnotes.advanced-markdown-editor',
PlusEditor: 'org.standardnotes.plus-editor',
SheetsEditor: 'org.standardnotes.standard-sheets',
TaskEditor: 'org.standardnotes.simple-task-editor',
TokenVaultEditor: 'org.standardnotes.token-vault',
Clipper: 'org.standardnotes.clipper',
@@ -44,6 +40,10 @@ export class NativeFeatureIdentifier extends ValueObject<NativeFeatureIdentifier
Vaults: 'org.standardnotes.vaults',
SharedVaults: 'org.standardnotes.shared-vaults',
DeprecatedCodeEditor: 'org.standardnotes.code-editor',
DeprecatedMarkdownProEditor: 'org.standardnotes.advanced-markdown-editor',
DeprecatedPlusEditor: 'org.standardnotes.plus-editor',
DeprecatedTaskEditor: 'org.standardnotes.simple-task-editor',
DeprecatedMarkdownVisualEditor: 'org.standardnotes.markdown-visual-editor',
DeprecatedBoldEditor: 'org.standardnotes.bold-editor',
DeprecatedMarkdownBasicEditor: 'org.standardnotes.simple-markdown-editor',

View File

@@ -2,4 +2,6 @@ import { ComponentFeatureDescription } from './ComponentFeatureDescription'
export type ThirdPartyFeatureDescription = ComponentFeatureDescription & {
url: string
version: string
download_url?: string
}

View File

@@ -10,6 +10,66 @@ import { ComponentAction } from '../Component/ComponentAction'
import { ComponentArea } from '../Component/ComponentArea'
export function GetDeprecatedFeatures(): AnyFeatureDescription[] {
const code = FillIframeEditorDefaults({
name: 'Code',
spellcheckControl: true,
identifier: NativeFeatureIdentifier.TYPES.DeprecatedCodeEditor,
permission_name: PermissionName.DeprecatedCodeEditor,
note_type: NoteType.Code,
file_type: 'txt',
interchangeable: true,
deprecated: true,
index_path: 'index.html',
description:
'Syntax highlighting and convenient keyboard shortcuts for over 120 programming' +
' languages. Ideal for code snippets and procedures.',
thumbnail_url: 'https://assets.standardnotes.com/screenshots/models/editors/code.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const plus = FillIframeEditorDefaults({
name: 'Rich Text',
note_type: NoteType.RichText,
file_type: 'html',
identifier: NativeFeatureIdentifier.TYPES.DeprecatedPlusEditor,
permission_name: PermissionName.DeprecatedPlusEditor,
spellcheckControl: true,
deprecated: true,
description:
'From highlighting to custom font sizes and colors, to tables and lists, this editor is perfect for crafting any document.',
thumbnail_url: 'https://assets.standardnotes.com/screenshots/models/editors/plus-editor.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const markdown = FillIframeEditorDefaults({
name: 'Markdown',
identifier: NativeFeatureIdentifier.TYPES.DeprecatedMarkdownProEditor,
note_type: NoteType.Markdown,
file_type: 'md',
permission_name: PermissionName.DeprecatedMarkdownProEditor,
spellcheckControl: true,
deprecated: true,
description:
'A fully featured Markdown editor that supports live preview, a styling toolbar, and split pane support.',
thumbnail_url: 'https://assets.standardnotes.com/screenshots/models/editors/adv-markdown.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const task = FillIframeEditorDefaults({
name: 'Checklist',
identifier: NativeFeatureIdentifier.TYPES.DeprecatedTaskEditor,
note_type: NoteType.Task,
spellcheckControl: true,
file_type: 'md',
interchangeable: false,
deprecated: true,
permission_name: PermissionName.DeprecatedTaskEditor,
description:
'A great way to manage short-term and long-term to-do"s. You can mark tasks as completed, change their order, and edit the text naturally in place.',
thumbnail_url: 'https://assets.standardnotes.com/screenshots/models/editors/task-editor.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const bold: EditorFeatureDescription = FillIframeEditorDefaults({
name: 'Alternative Rich Text',
identifier: NativeFeatureIdentifier.TYPES.DeprecatedBoldEditor,
@@ -118,5 +178,5 @@ export function GetDeprecatedFeatures(): AnyFeatureDescription[] {
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
return [bold, markdownBasic, markdownMinimist, markdownMath, markdownAlt, filesafe]
return [code, plus, markdown, task, bold, markdownBasic, markdownMinimist, markdownMath, markdownAlt, filesafe]
}

View File

@@ -6,62 +6,6 @@ import { RoleName } from '@standardnotes/domain-core'
import { IframeComponentFeatureDescription } from '../Feature/IframeComponentFeatureDescription'
export function IframeEditors(): IframeComponentFeatureDescription[] {
const code = FillIframeEditorDefaults({
name: 'Code',
spellcheckControl: true,
identifier: NativeFeatureIdentifier.TYPES.CodeEditor,
permission_name: PermissionName.CodeEditor,
note_type: NoteType.Code,
file_type: 'txt',
interchangeable: true,
index_path: 'index.html',
description:
'Syntax highlighting and convenient keyboard shortcuts for over 120 programming' +
' languages. Ideal for code snippets and procedures.',
thumbnail_url: 'https://assets.standardnotes.com/screenshots/models/editors/code.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const plus = FillIframeEditorDefaults({
name: 'Rich Text',
note_type: NoteType.RichText,
file_type: 'html',
identifier: NativeFeatureIdentifier.TYPES.PlusEditor,
permission_name: PermissionName.PlusEditor,
spellcheckControl: true,
description:
'From highlighting to custom font sizes and colors, to tables and lists, this editor is perfect for crafting any document.',
thumbnail_url: 'https://assets.standardnotes.com/screenshots/models/editors/plus-editor.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const markdown = FillIframeEditorDefaults({
name: 'Markdown',
identifier: NativeFeatureIdentifier.TYPES.MarkdownProEditor,
note_type: NoteType.Markdown,
file_type: 'md',
permission_name: PermissionName.MarkdownProEditor,
spellcheckControl: true,
description:
'A fully featured Markdown editor that supports live preview, a styling toolbar, and split pane support.',
thumbnail_url: 'https://assets.standardnotes.com/screenshots/models/editors/adv-markdown.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const task = FillIframeEditorDefaults({
name: 'Checklist',
identifier: NativeFeatureIdentifier.TYPES.TaskEditor,
note_type: NoteType.Task,
spellcheckControl: true,
file_type: 'md',
interchangeable: false,
permission_name: PermissionName.TaskEditor,
description:
'A great way to manage short-term and long-term to-do"s. You can mark tasks as completed, change their order, and edit the text naturally in place.',
thumbnail_url: 'https://assets.standardnotes.com/screenshots/models/editors/task-editor.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const tokenvault = FillIframeEditorDefaults({
name: 'Authenticator',
note_type: NoteType.Authentication,
@@ -88,5 +32,5 @@ export function IframeEditors(): IframeComponentFeatureDescription[] {
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
return [code, plus, markdown, task, tokenvault, spreadsheets]
return [tokenvault, spreadsheets]
}

View File

@@ -2,7 +2,7 @@ export enum PermissionName {
AccountSwitcher = 'app:account-switcher',
AutobiographyTheme = 'theme:autobiography',
BoldEditor = 'editor:bold',
CodeEditor = 'editor:code-editor',
DeprecatedCodeEditor = 'editor:code-editor',
ComponentFilesafe = 'component:filesafe',
ComponentFolders = 'component:folders',
DailyEmailBackup = 'server:daily-email-backup',
@@ -16,20 +16,20 @@ export enum PermissionName {
MarkdownBasicEditor = 'editor:markdown-basic',
MarkdownMathEditor = 'editor:markdown-math',
MarkdownMinimistEditor = 'editor:markdown-minimist',
MarkdownProEditor = 'editor:markdown-pro',
DeprecatedMarkdownProEditor = 'editor:markdown-pro',
MarkdownVisualEditor = 'editor:markdown-visual',
MidnightTheme = 'theme:midnight',
NoteHistory30Days = 'server:note-history-30-days',
NoteHistory365Days = 'server:note-history-365-days',
NoteHistoryUnlimited = 'server:note-history-unlimited',
PlainEditor = 'editor:plain',
PlusEditor = 'editor:plus',
DeprecatedPlusEditor = 'editor:plus',
SheetsEditor = 'editor:sheets',
SignInAlerts = 'server:sign-in-alerts',
SmartFilters = 'app:smart-filters',
SolarizedDarkTheme = 'theme:solarized-dark',
TagNesting = 'app:tag-nesting',
TaskEditor = 'editor:task-editor',
DeprecatedTaskEditor = 'editor:task-editor',
ThemeDynamic = 'theme:dynamic',
TitaniumTheme = 'theme:titanium',
TokenVaultEditor = 'editor:token-vault',