mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
feat(electron): multi tabs support (#7440)
use https://www.electronjs.org/docs/latest/api/web-contents-view to serve different tab views added tabs view manager in electron to handle multi-view actions and events. fix AF-1111 fix AF-999 fix PD-1459 fix AF-964 PD-1458
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const _appConfigSchema = z.object({
|
||||
export const appConfigSchema = z.object({
|
||||
/** whether to show onboarding first */
|
||||
onBoarding: z.boolean().optional().default(true),
|
||||
});
|
||||
export type AppConfigSchema = z.infer<typeof _appConfigSchema>;
|
||||
export const defaultAppConfig = _appConfigSchema.parse({});
|
||||
|
||||
export type AppConfigSchema = z.infer<typeof appConfigSchema>;
|
||||
export const defaultAppConfig = appConfigSchema.parse({});
|
||||
|
||||
const _storage: Record<number, any> = {};
|
||||
let _inMemoryId = 0;
|
||||
@@ -48,7 +49,7 @@ class Storage<T extends object> {
|
||||
}
|
||||
|
||||
get(): T;
|
||||
get(key: keyof T): T[keyof T];
|
||||
get<K extends keyof T>(key: K): T[K];
|
||||
/**
|
||||
* get config, if key is provided, return the value of the key
|
||||
* @param key
|
||||
|
||||
@@ -105,6 +105,7 @@ export function setupEditorFlags(docCollection: DocCollection) {
|
||||
|
||||
type SetStateAction<Value> = Value | ((prev: Value) => Value);
|
||||
|
||||
// todo(@pengx17): use global state instead
|
||||
const appSettingEffect = atomEffect(get => {
|
||||
const settings = get(appSettingBaseAtom);
|
||||
// some values in settings should be synced into electron side
|
||||
|
||||
@@ -8,4 +8,4 @@ export { Framework } from './framework';
|
||||
export { createIdentifier } from './identifier';
|
||||
export type { ResolveOptions } from './provider';
|
||||
export { FrameworkProvider } from './provider';
|
||||
export type { GeneralIdentifier } from './types';
|
||||
export type { GeneralIdentifier, Identifier } from './types';
|
||||
|
||||
Reference in New Issue
Block a user