fix(editor): edgeless selected block is missing in the return of getSelectedBlockCommand (#11813)

This commit is contained in:
L-Sun
2025-04-18 13:52:43 +00:00
parent 5fcf34d848
commit f16bcdbe2b
7 changed files with 46 additions and 11 deletions

View File

@@ -65,7 +65,7 @@ export class PageClipboard extends ReadOnlyClipboard {
const e = ctx.get('clipboardState').raw;
e.preventDefault();
this._copySelected(() => {
this._copySelectedInPage(() => {
this.std.command
.chain()
.try<{}>(cmd => [

View File

@@ -84,11 +84,11 @@ export const clipboardConfigs: ExtensionType[] = [
export class ReadOnlyClipboard extends LifeCycleWatcher {
static override key = 'affine-readonly-clipboard';
protected readonly _copySelected = (onCopy?: () => void) => {
protected readonly _copySelectedInPage = (onCopy?: () => void) => {
return this.std.command
.chain()
.with({ onCopy })
.pipe(getSelectedModelsCommand)
.pipe(getSelectedModelsCommand, { types: ['block', 'text', 'image'] })
.pipe(draftSelectedModelsCommand)
.pipe(copySelectedModelsCommand);
};
@@ -118,7 +118,7 @@ export class ReadOnlyClipboard extends LifeCycleWatcher {
const e = ctx.get('clipboardState').raw;
e.preventDefault();
this._copySelected().run();
this._copySelectedInPage().run();
};
override mounted(): void {