refactor: move frame manager and panel to separate packages (#10324)

### TL;DR
Moved frame management functionality from `blocksuite/blocks` to `@blocksuite/affine-block-frame` package.

### What changed?
- Relocated `frame-manager.ts` from `blocksuite/blocks` to `@blocksuite/affine-block-frame`
- Added new dependencies to block-frame package: `@blocksuite/affine-block-surface` and `yjs`
- Updated imports across multiple components to reference frame manager from its new location
- Moved utility functions `areSetsEqual` and `isFrameBlock` into frame-manager file
- Replaced direct EdgelessRootService references with GfxController in frame panel components

### How to test?
1. Verify frame functionality works in edgeless mode
2. Test frame creation, selection, and manipulation
3. Confirm frame navigation and presentation modes operate correctly
4. Check that frame panel and toolbar interactions remain functional

### Why make this change?
This refactoring improves code organization by consolidating frame-related functionality into a dedicated package, making the codebase more modular and easier to maintain. It also reduces dependencies between packages and provides clearer boundaries for frame-related features.
This commit is contained in:
Saul-Mirone
2025-02-20 13:06:39 +00:00
parent 64cc99354e
commit 007bbabce4
43 changed files with 252 additions and 135 deletions

View File

@@ -131,6 +131,7 @@ export const PackageList = [
location: 'blocksuite/affine/block-frame',
name: '@blocksuite/affine-block-frame',
workspaceDependencies: [
'blocksuite/affine/block-surface',
'blocksuite/affine/components',
'blocksuite/affine/model',
'blocksuite/affine/shared',
@@ -273,6 +274,21 @@ export const PackageList = [
'blocksuite/framework/store',
],
},
{
location: 'blocksuite/affine/fragment-frame-panel',
name: '@blocksuite/affine-fragment-frame-panel',
workspaceDependencies: [
'blocksuite/affine/block-frame',
'blocksuite/affine/block-surface',
'blocksuite/affine/components',
'blocksuite/affine/model',
'blocksuite/affine/shared',
'blocksuite/framework/block-std',
'blocksuite/framework/global',
'blocksuite/framework/inline',
'blocksuite/framework/store',
],
},
{
location: 'blocksuite/affine/model',
name: '@blocksuite/affine-model',
@@ -379,6 +395,7 @@ export const PackageList = [
'blocksuite/affine/block-surface-ref',
'blocksuite/affine/block-table',
'blocksuite/affine/components',
'blocksuite/affine/fragment-frame-panel',
'blocksuite/affine/model',
'blocksuite/affine/shared',
'blocksuite/affine/widget-drag-handle',
@@ -762,6 +779,7 @@ export type PackageName =
| '@blocksuite/affine-block-table'
| '@blocksuite/affine-components'
| '@blocksuite/data-view'
| '@blocksuite/affine-fragment-frame-panel'
| '@blocksuite/affine-model'
| '@blocksuite/affine-shared'
| '@blocksuite/affine-widget-drag-handle'