NEURALNG
EDITOR PACKAGEBETA

Editor

AI-native structured rich-text editing powered by Tiptap, ProseMirror and Yjs, with deterministic JSON values and explicit application ownership boundaries.

Structured JSONProvider-neutral AICollaboration ready

STANDALONE PACKAGE

Install and import

Editor is intentionally separate from Core. Its npm package embeds its Tiptap, ProseMirror, Floating UI and Yjs runtime dependencies.

app.ts TypeScript
npm install @neural-ng/editor

import { NeuralEditor, type NeuralEditorDocument } from '@neural-ng/editor';

@Component({ imports: [NeuralEditor] })

Structured value and Signal Forms

The canonical model is always NeuralEditorDocument. HTML and text are derived, never alternate model modes.

0 characters 0 words
Persist JSON with a schema version; sanitize derived HTML at its final rendering boundary.
Editor is ready for structured input.

Rich text and structured content

The default schema includes headings, marks, alignment, colors, highlights, lists, tasks, quotes, code, links, images and tables.

Every Angular Forms API

Signal Forms, Reactive Forms and template-driven Forms share the same immutable document value.

SIGNAL FORMS
REACTIVE FORMS
NGMODEL

Custom toolbar

Typed template context exposes the supported controller without leaking the raw Tiptap instance.

Structured operations and AI review

Stable node IDs and revision-bound atomic operations make changes reviewable. Editor emits AI requests but never calls a model provider; proposals remain non-destructive until explicit acceptance.

ai-review.ts TypeScript
const request = controller.requestAi('rewrite', { instruction: 'Make this concise.' });
// Application calls its provider, then supplies structured operations.
controller.previewAiProposal(proposal);
controller.acceptAiProposal(); // explicit user approval

Yjs collaboration and review

Pass an application-owned Y.Doc and optional transport adapter. Presence, comments, suggesting-mode tracked changes and snapshots share the canonical document contract.

collaboration.html HTML
<neural-editor [collaboration]="{ document: yDoc }" [collaborationUser]="currentUser" enableComments trackedChangesMode="suggesting" enableSnapshots />

Persistence and derived output

Persist schema-versioned JSON. Serializers generate portable HTML or text; the application owns storage, upload and final output sanitization.

persistence.ts TypeScript
const stored = { schemaVersion: 1, document: document() };
const html = editorDocumentToHtml(stored.document);
const text = editorDocumentToText(stored.document);
// Sanitize derived HTML again at the final rendering boundary.

States

Editor composes with Field and supports disabled, readonly, required, invalid, pending, touched, dirty and toolbar-free reading surfaces.

Unstyled and typed class slots

Schema, commands, Forms and semantics remain while consumer classes own toolbar, editable surface and counters.

0 characters 0 words