refactor(editor): edgeless toolbar lock and unlock actions (#10878)

This commit is contained in:
fundon
2025-03-20 02:08:16 +00:00
parent bd9b78f7d2
commit 07a64eb004
5 changed files with 277 additions and 79 deletions

View File

@@ -139,7 +139,13 @@ abstract class ToolbarContextBase {
getSurfaceModels() {
if (this.hasSelectedSurfaceModels) {
const elements = this.elementsMap$.peek().get(this.flavour$.peek());
const flavour = this.flavour$.peek();
const elementsMap = this.elementsMap$.peek();
const elements = ['affine:surface', 'affine:surface:locked'].includes(
flavour
)
? Array.from(elementsMap.values()).flat()
: elementsMap.get(flavour);
return elements ?? [];
}
return [];