mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-31 17:19:56 +08:00
1560880abd
Fixes [BS-1518](https://linear.app/affine-design/issue/BS-1518/拖拽一个-embed-view-的-linked-doc,其-indicator-是错误的)
31 lines
902 B
TypeScript
31 lines
902 B
TypeScript
import { createIdentifier } from '@blocksuite/global/di';
|
|
import type { DeepPartial } from '@blocksuite/global/utils';
|
|
import type { ExtensionType } from '@blocksuite/store';
|
|
import type { Signal } from '@preact/signals-core';
|
|
import { z } from 'zod';
|
|
|
|
import { NodePropsSchema } from '../utils/index.js';
|
|
|
|
export const GeneralSettingSchema = z
|
|
.object({
|
|
edgelessScrollZoom: z.boolean().default(false),
|
|
edgelessDisableScheduleUpdate: z.boolean().default(false),
|
|
})
|
|
.merge(NodePropsSchema);
|
|
|
|
export type EditorSetting = z.infer<typeof GeneralSettingSchema>;
|
|
|
|
export const EditorSettingProvider = createIdentifier<
|
|
Signal<DeepPartial<EditorSetting>>
|
|
>('AffineEditorSettingProvider');
|
|
|
|
export function EditorSettingExtension(
|
|
signal: Signal<DeepPartial<EditorSetting>>
|
|
): ExtensionType {
|
|
return {
|
|
setup: di => {
|
|
di.addImpl(EditorSettingProvider, () => signal);
|
|
},
|
|
};
|
|
}
|