fix(core): wrap code in ai chat (#10108)

[BS-2540](https://linear.app/affine-design/issue/BS-2540/ai-chat-中-code-block-需要默认换行)
This commit is contained in:
donteatfriedrice
2025-02-12 09:43:52 +00:00
parent e350ba4a9c
commit 30612de1ad
12 changed files with 43 additions and 15 deletions

View File

@@ -0,0 +1,11 @@
import type { TransformerMiddleware } from '@blocksuite/store';
export const CODE_BLOCK_WRAP_KEY = 'codeBlockWrap';
export const codeBlockWrapMiddleware = (
wrap: boolean
): TransformerMiddleware => {
return ({ adapterConfigs }) => {
adapterConfigs.set(CODE_BLOCK_WRAP_KEY, String(wrap));
};
};

View File

@@ -1,2 +1,3 @@
export * from './code';
export * from './copy';
export * from './paste';