Implementation:AFK surf Open agent InlineEditor Test Page
| Knowledge Sources | |
|---|---|
| Domains | Playground, Inline_Editor |
| Last Updated | 2026-10-25 00:00 GMT |
Overview
Concrete `InlineEditorExample` playground page that mounts a standalone `InlineEditor` over a Yjs text with a Shoelace toolbar toggling bold/italic/underline/strike/code/embed/reset and undo/redo via `Y.UndoManager`.
Description
The playground/examples/inline/test-page.ts module exports a `@customElement('inline-test-page')` element. It constructs an `InlineEditor` over a `Y.Text`, registers `baseTextAttributes` and an `AttributeRenderer`, wires `inlineTextStyles` to map attributes to inline styles, and binds toolbar buttons to `toggleStyle`/`resetText` plus `undoManager.undo`/`redo`. `effects()` is called to register std effects.
Usage
Mount `<inline-test-page>` in the inline playground example to exercise the `InlineEditor` API.
Code Reference
Source Location
- Repository: AFK_surf_Open_agent
- File: blocksuite/playground/examples/inline/test-page.ts
- Lines: 1-445
Signature
@customElement('inline-test-page')
export class InlineEditorExample extends ShadowlessElement {
accessor inlineEditor: InlineEditor;
override render(): unknown;
}
declare global { interface HTMLElementTagNameMap { 'inline-test-page': InlineEditorExample; } }
Import
import './test-page.js';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none — self-contained) | — | — | Mounts its own Yjs text |
Outputs
| Name | Type | Description |
|---|---|---|
| render | TemplateResult | Inline editor + toolbar |
Usage Examples
Mount the inline test page
import './test-page.js';
document.body.append(document.createElement('inline-test-page'));