refactor(editor): remove gfx tool global type (#12116)

Closes: BS-2650
This commit is contained in:
Saul-Mirone
2025-05-04 13:53:26 +00:00
parent f3b5c36cf7
commit 30a2e5b4fb
95 changed files with 664 additions and 521 deletions

View File

@@ -62,13 +62,8 @@ export class EmbedCardCreateModal extends SignalWatcher(
}
this.createOptions.onSave(url);
gfx.tool.setTool(
// @ts-expect-error FIXME: resolve after gfx tool refactor
'default'
);
}
this.onConfirm();
this.onConfirm({ mode });
this.remove();
};
@@ -176,7 +171,7 @@ export class EmbedCardCreateModal extends SignalWatcher(
accessor input!: HTMLInputElement;
@property({ attribute: false })
accessor onConfirm!: () => void;
accessor onConfirm!: (options: { mode: 'edgeless' | 'page' }) => void;
@property({ attribute: false })
accessor titleText!: string;
@@ -195,7 +190,8 @@ export async function toggleEmbedCardCreateModal(
| {
mode: 'edgeless';
onSave: (url: string) => void;
}
},
onConfirm: (options: { mode: 'page' | 'edgeless' }) => void
): Promise<void> {
host.selection.clear();
@@ -208,7 +204,10 @@ export async function toggleEmbedCardCreateModal(
document.body.append(embedCardCreateModal);
return new Promise(resolve => {
embedCardCreateModal.onConfirm = () => resolve();
embedCardCreateModal.onConfirm = options => {
onConfirm(options);
resolve();
};
});
}