KiCanvas vendored bundle for the Embedder VS Code extension.

Source: KiCode (https://github.com/sajadghorbani/KiCode) master @ 6bdaea0789b218cb432f5041c61aa53050777f41
Upstream: KiCanvas (https://github.com/theacodes/kicanvas) main @ b031159eb74aaa7eef2b026fd85d35bc05ff2095
Vendored: 2026-04-28
License: MIT (see LICENSE.md alongside)

Local patches (Embedder, updated 2026-08-14). Applied identically to both vendored copies
(packages/jarvis/src/renderer/assets/kicanvas/kicanvas.js and
packages/vscode/media/kicanvas/kicanvas.js).

  1. ENG-3475 S-expression tokenizer: accept `|<base64>|` byte-strings (KiCad `(data
     |...|)` used by `embedded_files` for embedded 3D STEP models). Added a
     byte-string state to the `Vn` generator; content is emitted as a STRING
     token and ignored by the parser. Previously threw "Unexpected character
     at index N: |", aborting the whole parse.
  2. ENG-3475 Matrix3.transform: coerce a non-finite (NaN) transform result to 0 instead
     of throwing in Vec2.set. A single degenerate footprint/polygon transform
     (seen on KiCad 10 boards) no longer aborts the entire board paint.
  3. URL-backed source basenames: decode the final URL path segment before
     indexing it. VS Code webview URIs percent-encode characters such as `+`,
     spaces, Unicode, `#`, and `?`; hierarchical sheet references retain the
     literal filename. Without normalization, KiCanvas misses the supplied
     source and attempts a forbidden relative webview fetch.
  4. ENG-3658 schematic properties: parse KiCad 10's property-level `(hide yes)`
     flag, normalize the older effects-level hide flag, and skip hidden
     properties in PropertyPainter. Supplier and BOM metadata remains in the
     schematic without rendering at the component anchor. The effects-level
     hide is OR-merged after `Object.assign(this, r)` so an explicit
     property-level `(hide no)` cannot unhide a field the effects flag hides.
  5. Parser warnings: report only the unsupported element name instead of
     stringifying the complete containing S-expression. Large KiCad 10
     schematics otherwise block the renderer while producing repeated
     multi-megabyte warning strings.
  6. Single-page embeds: allow `kicanvas-embed[nohierarchy]` to load only its
     explicitly supplied files without recursively parsing hierarchical child
     sheets. Project embeds retain the upstream recursive-loading behavior.
  7. KiCad 10.99 affine footprint transforms: parse the new `(transform (translate ...)
     (rotate ...) (scale ...))` placement emitted since KiCad commit eb60d889, normalize
     invalid scale values to 1, preserve legacy `(at ...)` support, and apply the full
     translate-rotate-scale matrix while painting footprint-local geometry.

Re-apply these patches after any future re-vendoring/rebuild of the bundle.
