refactor: merge themes into components (#2388)

This commit is contained in:
Mo
2023-08-06 08:52:19 -05:00
committed by GitHub
parent 1d60af0243
commit d2f8a36f19
33 changed files with 117 additions and 150 deletions

View File

@@ -1,6 +1,6 @@
import { HeadlessSuperConverter } from '@/Components/SuperEditor/Tools/HeadlessSuperConverter'
import {
SNComponent,
ComponentItem,
ComponentMutator,
AppDataField,
ApplicationService,
@@ -26,7 +26,7 @@ export class DesktopManager
implements DesktopManagerInterface, DesktopClientRequiresWebMethods
{
updateObservers: {
callback: (component: SNComponent) => void
callback: (component: ComponentItem) => void
}[] = []
dataLoaded = false
@@ -204,7 +204,7 @@ export class DesktopManager
).getValue()
for (const observer of this.updateObservers) {
observer.callback(updatedComponent as SNComponent)
observer.callback(updatedComponent as ComponentItem)
}
}
}

View File

@@ -1,8 +1,8 @@
import { WebApplication } from '@/Application/WebApplication'
import { ContentType } from '@standardnotes/domain-core'
import {
SNComponentManager,
SNComponent,
ComponentManager,
ComponentItem,
SNTag,
SNNote,
Deferred,
@@ -16,7 +16,7 @@ import { NoteViewController } from './NoteViewController'
describe('note view controller', () => {
let application: WebApplication
let componentManager: SNComponentManager
let componentManager: ComponentManager
beforeEach(() => {
application = {
@@ -35,7 +35,7 @@ describe('note view controller', () => {
Object.defineProperty(application, 'sync', { value: {} as jest.Mocked<SyncServiceInterface> })
application.sync.sync = jest.fn().mockReturnValue(Promise.resolve())
componentManager = {} as jest.Mocked<SNComponentManager>
componentManager = {} as jest.Mocked<ComponentManager>
Object.defineProperty(application, 'componentManager', { value: componentManager })
})
@@ -68,7 +68,7 @@ describe('note view controller', () => {
application.items.getDisplayableComponents = jest.fn().mockReturnValue([
{
identifier: NativeFeatureIdentifier.TYPES.MarkdownProEditor,
} as SNComponent,
} as ComponentItem,
])
application.componentManager.getDefaultEditorIdentifier = jest

View File

@@ -1,5 +1,5 @@
import { FunctionComponent, useState } from 'react'
import { ComponentInterface, ComponentMutator, SNComponent } from '@standardnotes/snjs'
import { ComponentInterface, ComponentMutator, ComponentItem } from '@standardnotes/snjs'
import { SubtitleLight } from '@/Components/Preferences/PreferencesComponents/Content'
import Switch from '@/Components/Switch/Switch'
import Button from '@/Components/Button/Button'
@@ -28,7 +28,7 @@ interface PackageEntryProps {
}
const PackageEntry: FunctionComponent<PackageEntryProps> = ({ application, extension, uninstall }) => {
const [offlineOnly, setOfflineOnly] = useState(extension instanceof SNComponent ? extension.offlineOnly : false)
const [offlineOnly, setOfflineOnly] = useState(extension instanceof ComponentItem ? extension.offlineOnly : false)
const [extensionName, setExtensionName] = useState(extension.displayName)
const toggleOfflineOnly = () => {

View File

@@ -45,7 +45,7 @@ const PackagesPreferencesSection: FunctionComponent<Props> = ({
application.alerts
.confirm(
'Are you sure you want to uninstall this plugin? Note that plugins managed by your subscription will automatically be re-installed on application restart.',
'Uninstall Extension?',
'Uninstall Plugin?',
'Uninstall',
ButtonType.Danger,
'Cancel',

View File

@@ -1,3 +1,3 @@
import { ComponentInterface, SNActionsExtension, ThemeInterface } from '@standardnotes/snjs'
import { ComponentInterface, SNActionsExtension } from '@standardnotes/snjs'
export type AnyPackageType = ComponentInterface | ThemeInterface | SNActionsExtension
export type AnyPackageType = ComponentInterface | SNActionsExtension