mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
This PR refactored the turbo renderer architecture to support multiple block layout types. - New base class `BlockLayoutPainter` and `BlockLayoutProvider` are introduced for writing extendable per-block layout querying and painting logic. - Paragraph-specific lines are all moved into dedicated classes (`ParagraphLayoutProvider` and `ParagraphLayoutPainter`) under the `/variants/paragraph` dir. - The `renderer-utils.ts` doesn't contain paragraph-specific logic now. - The `text-utils.ts` is also now scoped for paragraph only. - Worker messages are now strongly typed. Upcoming PR should further implement the block registration system using extension API. The `variants` dir could still exist, since there will be similar rendering logic that can be reused among block types (i.e., between paragraph block and list block).
48 lines
1.3 KiB
JSON
48 lines
1.3 KiB
JSON
{
|
|
"name": "@blocksuite/affine-block-paragraph",
|
|
"description": "Paragraph block for BlockSuite.",
|
|
"type": "module",
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"test:unit": "nx vite:test --run --passWithNoTests",
|
|
"test:unit:coverage": "nx vite:test --run --coverage",
|
|
"test:e2e": "playwright test"
|
|
},
|
|
"sideEffects": false,
|
|
"keywords": [],
|
|
"author": "toeverything",
|
|
"license": "MIT",
|
|
"dependencies": {
|
|
"@blocksuite/affine-components": "workspace:*",
|
|
"@blocksuite/affine-gfx-turbo-renderer": "workspace:*",
|
|
"@blocksuite/affine-model": "workspace:*",
|
|
"@blocksuite/affine-rich-text": "workspace:*",
|
|
"@blocksuite/affine-shared": "workspace:*",
|
|
"@blocksuite/block-std": "workspace:*",
|
|
"@blocksuite/global": "workspace:*",
|
|
"@blocksuite/inline": "workspace:*",
|
|
"@blocksuite/store": "workspace:*",
|
|
"@floating-ui/dom": "^1.6.13",
|
|
"@lit/context": "^1.1.2",
|
|
"@preact/signals-core": "^1.8.0",
|
|
"@toeverything/theme": "^1.1.12",
|
|
"@types/mdast": "^4.0.4",
|
|
"lit": "^3.2.0",
|
|
"minimatch": "^10.0.1",
|
|
"rxjs": "^7.8.1",
|
|
"zod": "^3.23.8"
|
|
},
|
|
"exports": {
|
|
".": "./src/index.ts",
|
|
"./effects": "./src/effects.ts",
|
|
"./turbo-painter": "./src/turbo/paragraph-painter.worker.ts"
|
|
},
|
|
"files": [
|
|
"src",
|
|
"dist",
|
|
"!src/__tests__",
|
|
"!dist/__tests__"
|
|
],
|
|
"version": "0.20.0"
|
|
}
|