CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-tiptap--extension-typography

Typography extension for Tiptap that automatically converts common text input patterns into proper typographic characters.

73

0.85x
Overview
Eval results
Files

task.mdevals/scenario-2/

Document Content Manager

A utility that manages rich text document content with support for loading, replacing, and transforming document data.

Capabilities

Load document from JSON

  • When provided with valid JSON document data, it loads the content into the editor @test
  • When provided with an empty JSON document, it loads an empty editor state @test

Replace entire document

  • When replacing content with new HTML, it updates the entire document @test
  • When replacing with plain text, it converts the text to a proper document structure @test

Clear document content

  • When clearing the document, it removes all content and resets to an empty state @test

Export document content

  • When exporting to JSON, it returns the document in JSON format @test
  • When exporting to HTML, it returns the document as HTML string @test

Implementation

@generates

API

/**
 * Creates a document content manager
 */
export function createDocumentManager(): DocumentManager;

/**
 * Document manager interface for managing rich text content
 */
export interface DocumentManager {
  /**
   * Loads document content from JSON format
   * @param json - The JSON document data
   */
  loadFromJSON(json: any): void;

  /**
   * Replaces the entire document with new content
   * @param content - The new content (HTML string, JSON, or plain text)
   * @param format - The format of the content ('html', 'json', or 'text')
   */
  replaceContent(content: string | any, format: 'html' | 'json' | 'text'): void;

  /**
   * Clears all content from the document
   */
  clearDocument(): void;

  /**
   * Exports the document to JSON format
   * @returns The document as JSON
   */
  exportToJSON(): any;

  /**
   * Exports the document to HTML format
   * @returns The document as HTML string
   */
  exportToHTML(): string;

  /**
   * Destroys the document manager and cleans up resources
   */
  destroy(): void;
}

Dependencies { .dependencies }

@tiptap/core { .dependency }

Provides rich text editor functionality for managing document content.

Install with Tessl CLI

npx tessl i tessl/npm-tiptap--extension-typography

tile.json