refactor(editor): edgeless attacment toolbar config extension (#10710)

This commit is contained in:
fundon
2025-03-19 00:52:22 +00:00
parent 3cce147c60
commit 251d1d8782
19 changed files with 196 additions and 114 deletions

View File

@@ -30,20 +30,15 @@ export class ViewDropdownMenu extends SignalWatcher(ShadowlessElement) {
@property({ attribute: false })
accessor viewType$!: Signal<string> | ReadonlySignal<string>;
@property({ attribute: false })
accessor toggle: ((e: CustomEvent<boolean>) => void) | undefined;
override render() {
const {
actions,
context,
toggle,
viewType$: { value: viewType },
} = this;
return html`
<editor-menu-button
@toggle=${toggle}
.contentPadding="${'8px'}"
.button=${html`
<editor-icon-button
@@ -67,7 +62,7 @@ export class ViewDropdownMenu extends SignalWatcher(ShadowlessElement) {
action => action.id,
({ id, label, disabled, run }) => html`
<editor-menu-action
aria-label="${label}"
aria-label="${ifDefined(label)}"
data-testid="${`link-to-${id}`}"
?data-selected="${label === viewType}"
?disabled="${ifDefined(