-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(editor): extract edgeless legacy slots (#9363)
- Loading branch information
1 parent
7127220
commit 3ae3ae9
Showing
24 changed files
with
167 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,9 @@ | |
}, | ||
{ | ||
"path": "../block-embed" | ||
}, | ||
{ | ||
"path": "../block-surface" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,9 @@ | |
}, | ||
{ | ||
"path": "../shared" | ||
}, | ||
{ | ||
"path": "../block-surface" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,9 @@ | |
}, | ||
{ | ||
"path": "../block-embed" | ||
}, | ||
{ | ||
"path": "../block-surface" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './crud-extension'; | ||
export * from './legacy-slot-extension'; |
40 changes: 40 additions & 0 deletions
40
blocksuite/affine/block-surface/src/extensions/legacy-slot-extension.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import type { FrameBlockModel } from '@blocksuite/affine-model'; | ||
import type { ExtensionType } from '@blocksuite/block-std'; | ||
import { createIdentifier } from '@blocksuite/global/di'; | ||
import { Slot } from '@blocksuite/global/utils'; | ||
|
||
export const EdgelessLegacySlotIdentifier = createIdentifier<{ | ||
readonlyUpdated: Slot<boolean>; | ||
navigatorSettingUpdated: Slot<{ | ||
hideToolbar?: boolean; | ||
blackBackground?: boolean; | ||
fillScreen?: boolean; | ||
}>; | ||
navigatorFrameChanged: Slot<FrameBlockModel>; | ||
fullScreenToggled: Slot; | ||
|
||
elementResizeStart: Slot; | ||
elementResizeEnd: Slot; | ||
toggleNoteSlicer: Slot; | ||
|
||
toolbarLocked: Slot<boolean>; | ||
}>('AffineEdgelessLegacySlotService'); | ||
|
||
export const EdgelessLegacySlotExtension: ExtensionType = { | ||
setup: di => { | ||
di.addImpl(EdgelessLegacySlotIdentifier, () => ({ | ||
readonlyUpdated: new Slot<boolean>(), | ||
navigatorSettingUpdated: new Slot<{ | ||
hideToolbar?: boolean; | ||
blackBackground?: boolean; | ||
fillScreen?: boolean; | ||
}>(), | ||
navigatorFrameChanged: new Slot<FrameBlockModel>(), | ||
fullScreenToggled: new Slot(), | ||
elementResizeStart: new Slot(), | ||
elementResizeEnd: new Slot(), | ||
toggleNoteSlicer: new Slot(), | ||
toolbarLocked: new Slot<boolean>(), | ||
})); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.