mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-09 05:05:52 +08:00
chore: merge blocksuite source code (#9213)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import { createIdentifier } from '@blocksuite/global/di';
|
||||
import type { DeepPartial } from '@blocksuite/global/utils';
|
||||
import type { Signal } from '@preact/signals-core';
|
||||
import type { z } from 'zod';
|
||||
|
||||
import { NodePropsSchema } from '../utils/index.js';
|
||||
|
||||
export const EditorSettingSchema = NodePropsSchema;
|
||||
|
||||
export type EditorSetting = z.infer<typeof EditorSettingSchema>;
|
||||
|
||||
export const EditorSettingProvider = createIdentifier<
|
||||
Signal<DeepPartial<EditorSetting>>
|
||||
>('AffineEditorSettingProvider');
|
||||
|
||||
export function EditorSettingExtension(
|
||||
signal: Signal<DeepPartial<EditorSetting>>
|
||||
): ExtensionType {
|
||||
return {
|
||||
setup: di => {
|
||||
di.addImpl(EditorSettingProvider, () => signal);
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user