mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-19 15:26:59 +08:00
feat(editor): add editor store (#9584)
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
type JobMiddleware,
|
||||
type Query,
|
||||
type Schema,
|
||||
Store,
|
||||
} from '@blocksuite/affine/store';
|
||||
import { css, html, nothing, type PropertyValues } from 'lit';
|
||||
import { property, query } from 'lit/decorators.js';
|
||||
@@ -286,7 +287,7 @@ export class TextRenderer extends WithDisposable(ShadowlessElement) {
|
||||
this._doc,
|
||||
html`<div class="ai-answer-text-editor affine-page-viewport">
|
||||
${new BlockStdScope({
|
||||
doc: this._doc,
|
||||
store: new Store({ blocks: this._doc }),
|
||||
extensions: this.options.extensions ?? CustomPageEditorBlockSpecs,
|
||||
}).render()}
|
||||
</div>`
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
import { AffineSchemas } from '@blocksuite/affine/blocks/schemas';
|
||||
import { WithDisposable } from '@blocksuite/affine/global/utils';
|
||||
import type { Blocks } from '@blocksuite/affine/store';
|
||||
import { Schema } from '@blocksuite/affine/store';
|
||||
import { Schema, Store } from '@blocksuite/affine/store';
|
||||
import { css, html, LitElement, nothing } from 'lit';
|
||||
import { property, query } from 'lit/decorators.js';
|
||||
import { createRef, type Ref, ref } from 'lit/directives/ref.js';
|
||||
@@ -208,7 +208,7 @@ export class AISlidesRenderer extends WithDisposable(LitElement) {
|
||||
${ref(this._editorContainer)}
|
||||
>
|
||||
${new BlockStdScope({
|
||||
doc: this._doc,
|
||||
store: new Store({ blocks: this._doc }),
|
||||
extensions:
|
||||
SpecProvider.getInstance().getSpec('edgeless:preview').value,
|
||||
}).render()}
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { ServiceProvider } from '@blocksuite/affine/global/di';
|
||||
import { WithDisposable } from '@blocksuite/affine/global/utils';
|
||||
import { type Blocks, Job, Schema } from '@blocksuite/affine/store';
|
||||
import { type Blocks, Job, Schema, Store } from '@blocksuite/affine/store';
|
||||
import { css, html, LitElement, nothing } from 'lit';
|
||||
import { property, query } from 'lit/decorators.js';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
@@ -175,7 +175,7 @@ export class MiniMindmapPreview extends WithDisposable(LitElement) {
|
||||
})}
|
||||
>
|
||||
${new BlockStdScope({
|
||||
doc: this.doc,
|
||||
store: new Store({ blocks: this.doc }),
|
||||
extensions: MiniMindmapSpecs,
|
||||
}).render()}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user