Repository navigation
Tags
Tags
chore(swift): version packages (0.1.2) (#23) Merging this releases lexical-swift **0.1.2**: the Swift Release workflow then publishes the mirror, the tag and the GitHub release. Conforms to upstream Lexical **0.53.0** (`UPSTREAM_VERSION`). ### Patch Changes - The TextKit reconciler applies an update's edits to its rendered text in one pass instead of splicing the text once per edit, so restyling a whole document (select all and bold, on 5,000 blocks) is about 40% faster. The edits sent to the text storage are unchanged. - Code blocks look like the web playground's: the default theme's `code` style draws a background, padding and a line-number gutter with a right border, in light and dark mode, and sets a tab size of 2. `TextKitStyle` gains `paddingTop`, `paddingBottom`, `gutter` (`TextKitGutter`) and `tabSize` for themes that want the same for their own blocks. - Horizontal rules show on macOS and iOS: they rendered nothing, because `HorizontalRuleNode` has no view of its own. The views now draw one from the theme's new `horizontalRule` (`TextKitRule`), which the default theme sets to the web playground's 2-point #ccc line with 1em margins, outlined in blue while the rule is selected, without the selection highlight or iOS's handles. - On macOS the pointer is a pointing hand over links, as the playground theme's `cursor: pointer` shows it on the web. `TextKitStyle` and `TextKitTextAttributes` gain `cursor` (`TextKitCursor`) for themes that want it for other text.
chore(swift): version packages (0.1.1) (#4)
Merging this releases lexical-swift **0.1.1**: the Swift Release workflow then publishes the mirror, the tag and the GitHub release.
Conforms to upstream Lexical **0.53.0** (`UPSTREAM_VERSION`).
### Patch Changes
- The caret at the end of the text is as tall as the font on macOS and iOS, as it is everywhere else, instead of as tall as the whole line.
- On macOS the caret on an empty last block moves as soon as the block's indent or list marker changes (a paragraph that becomes a list item, a list item that becomes a paragraph), instead of once something is typed.
- A theme's `lineHeightMultiple` lays lines out as CSS `line-height` does on macOS and iOS: each line is that many times the font size, with its text centered in it rather than at the line's bottom, and the caret is as tall as the font instead of the line. The playground's text, quotes and list markers so sit as they do on the web.
- Node, editor and editor-state fields, the `JSMap` storage and the per-thread context skip Swift's dynamic exclusivity checks, which every node read and write paid for. Updates and loads are faster; behavior is unchanged.
- `JSMap`, `JSSet` and `JSONObject` hash string keys with a fast hash of their UTF-8 bytes instead of SipHash, which made node-map lookups a large share of every update and load. String keys now compare by code units, as a JS `Map` or object does: two keys that are canonically equivalent but encoded differently (`"\u{E9}"` and `"e\u{301}"`) are distinct, where they used to collapse into one.
- `getWritable()` on a node already marked dirty in the current pass returns it without marking it and its ancestors again. Setting several properties of one node, as importing JSON does, is faster; the dirty nodes an update reports are unchanged.
- `JSONValue.parse` (and so `parseEditorState`) is about five times faster: it reads the text's UTF-8 instead of copying it to UTF-16, decodes strings without escapes in one step, and keeps a `JSONObject`'s entries in one ordered array, which it searches linearly up to 16 keys. Parsed values, key order and error messages are unchanged; error positions are still UTF-16 offsets.
- On iOS, quote bars and list markers stay beside their text while the editor is pulled down past its top.
- The TextKit reconciler skips the unchanged children around an inserted, removed or moved block instead of walking and reconciling every child of its parent. Enter and joining paragraphs in a 5,000-block document now take about 4 ms (release), under the 8 ms target.
- Restyling a block's text after a commit walks only that block, not every text run in the document. Enter and joining paragraphs in a 5,000-block document went from about 23 ms to 12 ms (release).
- The selection highlight covers only the selected text on macOS and iOS, as in a browser: no longer the list markers, indents and quote bars before it, the rest of each line after it, or the line-height's spacing above and below.
- A TextKit render resolves each element's style chain and each distinct text and paragraph look once per update instead of once per run and block, and a full render no longer restyles the runs its one edit already styles. Loading a large document renders about a third faster; rendered attributes are unchanged.
- `LexicalNSTextView` no longer flashes a triple click's selection across the line's whole width: the paragraph selection it shows while the mouse is down stops before the newline, as `UITextView`'s does.