feat: add Super note type to list of note types (#2086)

This commit is contained in:
Mo
2022-12-05 09:38:42 -06:00
committed by GitHub
parent 1d22365086
commit caf2c4a876
20 changed files with 148 additions and 87 deletions

View File

@@ -72,7 +72,7 @@ const insertInstalledComponentsInMap = (
})
}
const createGroupsFromMap = (map: NoteTypeToEditorRowsMap, application: WebApplication): EditorMenuGroup[] => {
const createGroupsFromMap = (map: NoteTypeToEditorRowsMap, _application: WebApplication): EditorMenuGroup[] => {
const groups: EditorMenuGroup[] = [
{
icon: 'plain-text',
@@ -80,6 +80,13 @@ const createGroupsFromMap = (map: NoteTypeToEditorRowsMap, application: WebAppli
title: 'Plain text',
items: map[NoteType.Plain],
},
{
icon: SuperEditorMetadata.icon,
iconClassName: SuperEditorMetadata.iconClassName,
title: SuperEditorMetadata.name,
items: map[NoteType.Super],
featured: true,
},
{
icon: 'rich-text',
iconClassName: 'text-accessory-tint-1',
@@ -124,16 +131,6 @@ const createGroupsFromMap = (map: NoteTypeToEditorRowsMap, application: WebAppli
},
]
if (application.features.isExperimentalFeatureEnabled(FeatureIdentifier.SuperEditor)) {
groups.splice(1, 0, {
icon: SuperEditorMetadata.icon,
iconClassName: SuperEditorMetadata.iconClassName,
title: SuperEditorMetadata.name,
items: map[NoteType.Super],
featured: true,
})
}
return groups
}
@@ -146,7 +143,16 @@ const createBaselineMap = (application: WebApplication): NoteTypeToEditorRowsMap
noteType: NoteType.Plain,
},
],
[NoteType.Super]: [],
[NoteType.Super]: [
{
name: SuperEditorMetadata.name,
isEntitled: application.features.getFeatureStatus(FeatureIdentifier.SuperEditor) === FeatureStatus.Entitled,
noteType: NoteType.Super,
isLabs: true,
description:
'A new way to edit notes. Type / to bring up the block selection menu, or @ to embed images or link other tags and notes. Type - then space to start a list, or [] then space to start a checklist. Drag and drop an image or file to embed it in your note.',
},
],
[NoteType.RichText]: [],
[NoteType.Markdown]: [],
[NoteType.Task]: [],
@@ -156,14 +162,6 @@ const createBaselineMap = (application: WebApplication): NoteTypeToEditorRowsMap
[NoteType.Unknown]: [],
}
if (application.features.isExperimentalFeatureEnabled(FeatureIdentifier.SuperEditor)) {
map[NoteType.Super].push({
name: SuperEditorMetadata.name,
isEntitled: true,
noteType: NoteType.Super,
})
}
return map
}