refactor: component viewer (#2377)

This commit is contained in:
Mo
2023-07-28 07:08:52 -05:00
committed by GitHub
parent 3de6af445b
commit c7fb0d2aca
9 changed files with 84 additions and 40 deletions

View File

@@ -2,6 +2,7 @@ import {
ComponentArea,
ComponentPermission,
EditorFeatureDescription,
FindNativeFeature,
NativeFeatureIdentifier,
NoteType,
ThemeDockIcon,
@@ -47,6 +48,10 @@ export class UIFeature<F extends UIFeatureDescriptionTypes> implements UIFeature
throw new Error('Cannot cast item to feature description')
}
get isNativeFeature(): boolean {
return FindNativeFeature(this.featureIdentifier) !== undefined
}
get uniqueIdentifier(): NativeFeatureIdentifier | Uuid {
if (isNativeFeature(this.item)) {
const nativeFeature = NativeFeatureIdentifier.create(this.item.identifier)

View File

@@ -17,6 +17,7 @@ export interface UIFeatureInterface<F extends UIFeatureDescriptionTypes> {
get isThemeComponent(): boolean
get asComponent(): ComponentInterface
get asFeatureDescription(): F
get isNativeFeature(): boolean
get uniqueIdentifier(): NativeFeatureIdentifier | Uuid
get featureIdentifier(): string
get noteType(): NoteType