feat: add scroll wheel zoom setting (#9476)

### Changed
Add `scroll wheel to zoom` setting option, when the option enables, user can zoom in and out with scroll wheel without pressing the cmd/ctrl key.
This commit is contained in:
doouding
2025-01-03 06:09:10 +00:00
parent 0699205721
commit cb5d7eaabc
13 changed files with 155 additions and 36 deletions

View File

@@ -2,13 +2,17 @@ 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 { z } from 'zod';
import { NodePropsSchema } from '../utils/index.js';
export const EditorSettingSchema = NodePropsSchema;
export const GeneralSettingSchema = z
.object({
edgelessScrollZoom: z.boolean().default(false),
})
.merge(NodePropsSchema);
export type EditorSetting = z.infer<typeof EditorSettingSchema>;
export type EditorSetting = z.infer<typeof GeneralSettingSchema>;
export const EditorSettingProvider = createIdentifier<
Signal<DeepPartial<EditorSetting>>