chore(editor): remove edgeless element toolbar (#10900)

This commit is contained in:
fundon
2025-03-20 02:08:21 +00:00
parent 831f290f84
commit 8b995ea420
71 changed files with 330 additions and 6449 deletions
@@ -373,8 +373,16 @@ export class AffineToolbarWidget extends WidgetComponent {
// Triggered only when not in editing state.
disposables.add(
context.gfx.selection.slots.updated.subscribe(selections => {
// TODO(@fundon): should remove it when edgeless element toolbar is removed
if (context.isEdgelessMode) return;
// Should remove selections when clicking on frame navigator
if (context.isPageMode) {
if (
std.host.contains(std.range.value?.commonAncestorContainer ?? null)
) {
std.range.clear();
}
context.reset();
return;
}
const elementIds = selections
.map(s => (s.editing || s.inoperable ? [] : s.elements))
@@ -232,7 +232,7 @@ export function renderToolbar(
`${flavour}:${key}`,
html`
<editor-menu-button
class="more-menu"
aria-label="more-menu"
.contentPadding="${'8px'}"
.button=${html`
<editor-icon-button aria-label="More" .tooltip="${'More'}">
@@ -319,7 +319,9 @@ function renderActionItem(action: ToolbarAction, context: ToolbarContext) {
@click=${() => action.run?.(context)}
>
${action.icon}
${action.label ? html`<span class="label">${action.label}</span>` : null}
${action.showLabel && action.label
? html`<span class="label">${action.label}</span>`
: null}
</editor-icon-button>
`;
}