refactor: component manager usecases (#2354)
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
import { ComponentOrNativeFeature, FeatureIdentifier, ThemeFeatureDescription } from '@standardnotes/snjs'
|
||||
import { UIFeature, FeatureIdentifier, ThemeFeatureDescription } from '@standardnotes/snjs'
|
||||
|
||||
const isDarkModeTheme = (theme: ComponentOrNativeFeature<ThemeFeatureDescription>) =>
|
||||
const isDarkModeTheme = (theme: UIFeature<ThemeFeatureDescription>) =>
|
||||
theme.featureIdentifier === FeatureIdentifier.DarkTheme
|
||||
|
||||
export const sortThemes = (
|
||||
a: ComponentOrNativeFeature<ThemeFeatureDescription>,
|
||||
b: ComponentOrNativeFeature<ThemeFeatureDescription>,
|
||||
) => {
|
||||
export const sortThemes = (a: UIFeature<ThemeFeatureDescription>, b: UIFeature<ThemeFeatureDescription>) => {
|
||||
const aIsLayerable = a.layerable
|
||||
const bIsLayerable = b.layerable
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
GetIframeAndNativeEditors,
|
||||
ComponentArea,
|
||||
GetSuperNoteFeature,
|
||||
ComponentOrNativeFeature,
|
||||
UIFeature,
|
||||
IframeComponentFeatureDescription,
|
||||
} from '@standardnotes/snjs'
|
||||
import { EditorMenuGroup } from '@/Components/NotesOptions/EditorMenuGroup'
|
||||
@@ -30,7 +30,7 @@ const insertNativeEditorsInMap = (map: NoteTypeToEditorRowsMap, application: Web
|
||||
const noteType = editorFeature.note_type
|
||||
map[noteType].push({
|
||||
isEntitled: application.features.getFeatureStatus(editorFeature.identifier) === FeatureStatus.Entitled,
|
||||
uiFeature: new ComponentOrNativeFeature(editorFeature),
|
||||
uiFeature: new UIFeature(editorFeature),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ const insertInstalledComponentsInMap = (map: NoteTypeToEditorRowsMap, applicatio
|
||||
const noteType = editor.noteType
|
||||
|
||||
const editorItem: EditorMenuItem = {
|
||||
uiFeature: new ComponentOrNativeFeature<IframeComponentFeatureDescription>(editor),
|
||||
uiFeature: new UIFeature<IframeComponentFeatureDescription>(editor),
|
||||
isEntitled: application.features.getFeatureStatus(editor.identifier) === FeatureStatus.Entitled,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user