mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 14:56:59 +08:00
chore(editor): update default width of page block (#10873)
Close [BS-2498](https://linear.app/affine-design/issue/BS-2498/page-block首次切换时默认宽度为800px)
This commit is contained in:
@@ -5,7 +5,11 @@ import { DocsService } from '@affine/core/modules/doc';
|
||||
import { EditorSettingService } from '@affine/core/modules/editor-setting';
|
||||
import { WorkbenchService } from '@affine/core/modules/workbench';
|
||||
import { getAFFiNEWorkspaceSchema } from '@affine/core/modules/workspace';
|
||||
import { type DocMode } from '@blocksuite/affine/model';
|
||||
import {
|
||||
DEFAULT_PAGE_BLOCK_HEIGHT,
|
||||
DEFAULT_PAGE_BLOCK_WIDTH,
|
||||
type DocMode,
|
||||
} from '@blocksuite/affine/model';
|
||||
import type { Workspace } from '@blocksuite/affine/store';
|
||||
import { useServices } from '@toeverything/infra';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
@@ -39,7 +43,10 @@ export const usePageHelper = (docCollection: Workspace) => {
|
||||
) => {
|
||||
appSidebar.setHovering(false);
|
||||
const docProps: DocProps = {
|
||||
note: editorSettingService.editorSetting.get('affine:note'),
|
||||
note: {
|
||||
...editorSettingService.editorSetting.get('affine:note'),
|
||||
xywh: `[0, 0, ${DEFAULT_PAGE_BLOCK_WIDTH}, ${DEFAULT_PAGE_BLOCK_HEIGHT}]`,
|
||||
},
|
||||
};
|
||||
const page = docsService.createDoc({ docProps });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user