mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
refactor(editor): rename store api (#9518)
This commit is contained in:
@@ -47,7 +47,7 @@ export class NoteRenderer
|
||||
}
|
||||
|
||||
addNote() {
|
||||
const collection = this.host?.std.collection;
|
||||
const collection = this.host?.std.workspace;
|
||||
if (!collection) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ export class LinkCell extends BaseCellRenderer<string> {
|
||||
override render() {
|
||||
const linkText = this.value ?? '';
|
||||
const docName =
|
||||
this.docId && this.std?.collection.getDoc(this.docId)?.meta?.title;
|
||||
this.docId && this.std?.workspace.getDoc(this.docId)?.meta?.title;
|
||||
return html`
|
||||
<div class="affine-database-link" @click="${this._onClick}">
|
||||
${docName
|
||||
|
||||
@@ -19,7 +19,7 @@ export const titlePurePropertyConfig = titleColumnType.modelConfig<Text>({
|
||||
cellToJson: ({ value, dataSource }) => {
|
||||
const host = dataSource.contextGet(HostContextKey);
|
||||
if (host) {
|
||||
const collection = host.std.collection;
|
||||
const collection = host.std.workspace;
|
||||
const deltas = value.deltas$.value;
|
||||
const text = deltas
|
||||
.map(delta => {
|
||||
|
||||
@@ -98,7 +98,7 @@ abstract class BaseTextCell extends BaseCellRenderer<Text> {
|
||||
if (!this.docId$.value) {
|
||||
return this.value;
|
||||
}
|
||||
const doc = this.host?.std.collection.getDoc(this.docId$.value);
|
||||
const doc = this.host?.std.workspace.getDoc(this.docId$.value);
|
||||
const root = doc?.root as RootBlockModel;
|
||||
return root.title;
|
||||
});
|
||||
|
||||
@@ -19,7 +19,7 @@ export function addProperty(
|
||||
id?: string;
|
||||
}
|
||||
): string {
|
||||
const id = column.id ?? model.doc.collection.idGenerator();
|
||||
const id = column.id ?? model.doc.workspace.idGenerator();
|
||||
if (model.columns.some(v => v.id === id)) {
|
||||
return id;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ export function deleteView(model: DatabaseBlockModel, id: string) {
|
||||
}
|
||||
|
||||
export function duplicateView(model: DatabaseBlockModel, id: string): string {
|
||||
const newId = model.doc.collection.idGenerator();
|
||||
const newId = model.doc.workspace.idGenerator();
|
||||
model.doc.transact(() => {
|
||||
const index = model.views.findIndex(v => v.id === id);
|
||||
const view = model.views[index];
|
||||
|
||||
Reference in New Issue
Block a user