mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat(core): add edgelessTheme property and edgelessDefault theme setting (#8614)
close AF-1430 AF-1471 https://github.com/user-attachments/assets/d997ac6c-ce94-4fa4-ab34-29b36c7796ea
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
"@affine/debug": "workspace:*",
|
||||
"@affine/env": "workspace:*",
|
||||
"@affine/templates": "workspace:*",
|
||||
"@blocksuite/affine": "0.17.23",
|
||||
"@blocksuite/affine": "0.17.25",
|
||||
"@datastructures-js/binary-search-tree": "^5.3.2",
|
||||
"foxact": "^0.2.33",
|
||||
"fractional-indexing": "^3.2.0",
|
||||
|
||||
@@ -10,6 +10,7 @@ export * from './modules/feature-flag';
|
||||
export * from './modules/global-context';
|
||||
export * from './modules/lifecycle';
|
||||
export * from './modules/storage';
|
||||
export * from './modules/theme';
|
||||
export * from './modules/workspace';
|
||||
export * from './orm';
|
||||
export * from './storage';
|
||||
@@ -26,6 +27,7 @@ import {
|
||||
configureGlobalStorageModule,
|
||||
configureTestingGlobalStorage,
|
||||
} from './modules/storage';
|
||||
import { configureAppThemeModule } from './modules/theme';
|
||||
import {
|
||||
configureTestingWorkspaceProvider,
|
||||
configureWorkspaceModule,
|
||||
@@ -39,6 +41,7 @@ export function configureInfraModules(framework: Framework) {
|
||||
configureGlobalContextModule(framework);
|
||||
configureLifecycleModule(framework);
|
||||
configureFeatureFlagModule(framework);
|
||||
configureAppThemeModule(framework);
|
||||
}
|
||||
|
||||
export function configureTestingInfraModules(framework: Framework) {
|
||||
|
||||
@@ -39,4 +39,10 @@ export const BUILT_IN_CUSTOM_PROPERTY_TYPE = [
|
||||
show: 'always-hide',
|
||||
index: 'a0000006',
|
||||
},
|
||||
{
|
||||
id: 'edgelessTheme',
|
||||
type: 'edgelessTheme',
|
||||
show: 'always-hide',
|
||||
index: 'a0000007',
|
||||
},
|
||||
] as DocCustomPropertyInfo[];
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import { Entity } from '../../../framework';
|
||||
import { LiveData } from '../../../livedata';
|
||||
|
||||
export class AppTheme extends Entity {
|
||||
theme$ = new LiveData<string | undefined>(undefined);
|
||||
}
|
||||
9
packages/common/infra/src/modules/theme/index.ts
Normal file
9
packages/common/infra/src/modules/theme/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export { AppThemeService } from './services/theme';
|
||||
|
||||
import type { Framework } from '../../framework';
|
||||
import { AppTheme } from './entities/theme';
|
||||
import { AppThemeService } from './services/theme';
|
||||
|
||||
export function configureAppThemeModule(framework: Framework) {
|
||||
framework.service(AppThemeService).entity(AppTheme);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { Service } from '../../../framework';
|
||||
import { AppTheme } from '../entities/theme';
|
||||
|
||||
export class AppThemeService extends Service {
|
||||
appTheme = this.framework.createEntity(AppTheme);
|
||||
}
|
||||
Reference in New Issue
Block a user