Skip to content

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 20 Oct 22:19
· 50 commits to main since this release

Code edits itself (ROADMAP task 2). Txt still types its text out.
SVG files become ordinary nodes (ROADMAP task 3).

Added

  • code.code().to(next, seconds) diffs the two sources. Tokens that stay
    slide to their new places, deleted tokens fade and collapse, new tokens
    fade in. Lines below the edit shift. Highlighting stays on the six
    languages and is taken from each side, not from a half-typed string.
  • insert(line, col, text, seconds), remove(((line, col), (line, col)), seconds)
    and replace(range, text, seconds). Lines are 1-based, columns are
    0-based characters, and the range is half-open. .flash() on that tween
    lights the inserted text for a moment.
  • A focus on lines that move rides with them and lands on their new numbers
    when the tween ends.
  • Example code_steps: a function written in a few edits.
  • Svg loads a file (.src(include_bytes!(..)) or .file(path)) and
    expands it into groups, paths and images. .width / .height keep the
    aspect ratio. svg.find("id") is the element with that id, svg.paths()
    is every contour in paint order, and those paths morph through data
    like a path written by hand. Filters, masks and clip paths are skipped
    with a warning.
  • Example svg: a logo drawn on path by path, then one part recolored.

Breaking

  • code.code() is no longer a Signal<String>. .get(), .set() and
    .bind() still work. .to() is a diff, not a typewriter:

    // before — `code()` was a Signal<String>, and `.to()` typed the text
    let src: Signal<String> = code.code();
    src.to(next, 1.0).await;
    
    // after — `.to()` slides tokens; `.get()` / `.set()` / `.bind()` remain
    code.code().to(next, 1.0).await;
    code.insert(2, 0, "    let y = x * 2;\n", 0.6).flash().await;