Skip to content

InkKit 0.0.18

Choose a tag to compare

@aicayzer aicayzer released this 14 Oct 19:06
· 149 commits to main since this release
e8f79b7

InkKit 0.0.18 makes typing in long notes and in source mode fast, keeps tables, lists and pasted content saving as authored, and adds an entry point for builds without diagrams.

  • Faster typing. Typing in a long note with links, lists, code or tables no longer serializes the whole document on each keystroke. With 4,000 paragraphs that contain a link, one character takes about 10 ms instead of about 650 ms. Source mode takes typed text without parsing it, and the formatted document takes it in when you leave source mode.
  • A build without diagrams. @aicayzer/inkkit/core has the same exports as the main entry and never imports Mermaid, so a host that does not draw diagrams bundles a page about a sixth of the size. Import from one entry throughout the app.
  • Tables. A space beside formatted text or an image in a cell saves as a space, not  . A cell's authored line breaks, empty cells and rows with more cells than the header keep their source when another cell is edited. insertImages() places images inline in a table cell.
  • Lists. A new or moved bullet list beside an authored list with the same marker saves, and a list item that opens with a code fence keeps its first line.
  • Paste and drop. Spaces that WebKit wraps in converted-space spans paste as ordinary spaces, and a pasted link keeps only safe schemes. Dropped HTML imports with the same rules as pasted HTML.
  • Notes that failed to open or save. A note with an empty fenced code block opens and saves. An edit that would end an author comment early for an HTML renderer is refused.
  • Diagrams and colors. Class and state diagrams accept annotations. Code colors follow the editor color scheme, and --inkkit-diagram-background, --inkkit-diagram-text-color and --inkkit-diagram-error-color style the diagram preview card.
  • Caret view. After heading navigation in source mode, the caret is fully in view (#94).
  • Milkdown is updated to 7.22.3.

The public API is additive: the core entry and the three tokens above. One behavior changes for hosts that use undo across modes: source edits are steps on the text while in source mode, and leaving source mode makes them one step of the formatted history. See the API reference.

Verification includes 1,322 unit tests, 132 Chromium and 89 targeted WebKit browser tests, 45 native WKWebView scenarios on the exact candidate archive (all passed, including #94) and clean packed and registry consumers. The native print group passed 9 of 10 scenarios on the unmodified test page; the tenth prints one page because the test page's own fixed-height scrolling container clips the print, which also happens with every package from 0.0.8 and is tracked in #136. With a print rule on the test page it passes 10 of 10. Emulated and synthetic composition tests do not establish every operating-system input method.