Lexical iOS is an extensible text editor framework that integrates the APIs and philosophies from Lexical Web with a Swift API built on top of TextKit.
by facebookSwift
Last 12 weeks · 25 commits
4 of 6 standards met
Two fixes that allow editor states containing code blocks to round-trip through EditorState.fromJSON: CodeNode and LineBreakNode are built-in node types with public NodeTypes and full rendering support, but neither was present in Editor's default registeredNodes map. As a result, deserializing any editor state that contains a code block (or a bare line break) could not reconstruct those nodes. Register them alongside the other built-ins (root, text, element, heading, paragraph, quote). CodeNode's Decodable init required a "language" key. Editor states produced by other Lexical implementations (e.g. lexical-web) omit "language" when no language is set, so decoding threw keyNotFound. Use decodeIfPresent with an empty-string default so a missing language is tolerated.
Instead of appending a separate indent attribute for each block-level ancestor, accumulate all indent values into a single totalIndent and emit one .indent_internal attribute. This prevents child node indent values (e.g. ParagraphNode's 0) from overwriting parent indent values (e.g. QuoteNode's 1) during attribute merging. Adds regression test testParagraphInsideQuoteRetainsIndent verifying that text inside a QuoteNode receives the correct headIndent and firstLineHeadIndent from the quote's indent level. This brings the quote node behavior of lexical-ios to match the behavior of lexical web.
Summary This PR adds comprehensive Swift DocC documentation comments () to all public and open methods in . It also adds a dedicated DocC topic guide file () to improve API documentation for Lexical iOS developers. Changes Included Added DocC documentation () for methods, initializers, properties, and mutators in . Added containing DocC topic groupings.
Repository: facebook/lexical-ios. Description: Lexical iOS is an extensible text editor framework that integrates the APIs and philosophies from Lexical Web with a Swift API built on top of TextKit. Stars: 658, Forks: 63. Primary language: Swift. Languages: Swift (100%). License: MIT. Latest release: 0.2.0 (2y ago). Open PRs: 11, open issues: 21. Last activity: 1w ago. Community health: 75%. Top contributors: mansimransingh, patelneal, drodriguez, NSProgrammer, Wilfred, amyworrall, balrajOla, damirstuhec, darichey, ebgraham and others.