Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AFK surf Open agent InlineEditor Test Page

From Leeroopedia
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'));

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment