mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
refactor(editor): edgeless text toolbar config extension (#10811)
This commit is contained in:
@@ -137,16 +137,18 @@ abstract class ToolbarContextBase {
|
||||
);
|
||||
}
|
||||
|
||||
getSurfaceModels() {
|
||||
if (this.hasSelectedSurfaceModels) {
|
||||
const elements = this.elementsMap$.peek().get(this.flavour$.peek());
|
||||
return elements ?? [];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
getSurfaceModelsByType<T extends abstract new (...args: any) => any>(
|
||||
klass: T
|
||||
) {
|
||||
if (this.hasSelectedSurfaceModels) {
|
||||
const elements = this.elementsMap$.peek().get(this.flavour$.peek());
|
||||
if (elements?.length) {
|
||||
return elements.filter(e => this.matchModel(e, klass));
|
||||
}
|
||||
}
|
||||
return [];
|
||||
return this.getSurfaceModels().filter(e => this.matchModel(e, klass));
|
||||
}
|
||||
|
||||
getSurfaceBlocksByType<T extends abstract new (...args: any) => any>(
|
||||
|
||||
Reference in New Issue
Block a user