refactor(editor): playground doc collection typing migration (#9593)

This commit is contained in:
doodlewind
2025-01-09 03:07:43 +00:00
parent 5ff2254c83
commit e269cce141
19 changed files with 48 additions and 84 deletions

View File

@@ -30,7 +30,7 @@ import {
import { type SerializedXYWH, SignalWatcher } from '@blocksuite/global/utils';
import type { DeltaInsert } from '@blocksuite/inline';
import type { AffineEditorContainer } from '@blocksuite/presets';
import { type DocCollection, Text } from '@blocksuite/store';
import { Text, type Workspace } from '@blocksuite/store';
import { setBasePath } from '@shoelace-style/shoelace/dist/utilities/base-path.js';
import { css, html, nothing } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';
@@ -158,7 +158,9 @@ export class CollabDebugMenu extends SignalWatcher(ShadowlessElement) {
const zipTransformer = this.rootService.transformers.zip;
await zipTransformer.exportDocs(
this.collection,
[...this.collection.docs.values()].map(collection => collection.getDoc())
Array.from(this.collection.docs.values()).map(collection =>
collection.getStore()
)
);
}
@@ -611,7 +613,7 @@ export class CollabDebugMenu extends SignalWatcher(ShadowlessElement) {
private accessor _docMode: DocMode = 'page';
@property({ attribute: false })
accessor collection!: DocCollection;
accessor collection!: Workspace;
@property({ attribute: false })
accessor docsPanel!: DocsPanel;