mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 18:26:05 +08:00
feat(editor): type safe draft model and transformer (#10486)
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
getSelectedModelsCommand,
|
||||
} from '@blocksuite/affine-shared/commands';
|
||||
import type { BlockStdScope } from '@blocksuite/block-std';
|
||||
import { toDraftModel } from '@blocksuite/store';
|
||||
|
||||
export interface QuickActionConfig {
|
||||
id: string;
|
||||
@@ -45,7 +46,9 @@ export const quickActionConfig: QuickActionConfig[] = [
|
||||
std.selection.clear();
|
||||
|
||||
const doc = std.store;
|
||||
const autofill = getTitleFromSelectedModels(selectedModels);
|
||||
const autofill = getTitleFromSelectedModels(
|
||||
selectedModels.map(toDraftModel)
|
||||
);
|
||||
promptDocTitle(std, autofill)
|
||||
.then(title => {
|
||||
if (title === null) return;
|
||||
|
||||
Reference in New Issue
Block a user