Skip to content

Add a framework-independent SDK for editing on a caller-owned canvas - #370

Open
karote00 wants to merge 16 commits into
mainfrom
codex/react-canvas
Open

karote00 wants to merge 16 commits into
mainfrom
codex/react-canvas

Conversation

@karote00

Copy link
Copy Markdown
Owner

Applications can now pass their own HTML canvas to await createCanvas(target) from @asyra/canvas. The SDK draws on that element, handles rectangle drawing, selection and Undo/Redo, and leaves layout and controls to the host application. It has no frontend framework dependency.

The 2D renderer borrows the supplied surface throughout startup and teardown. Each target gets its own document and history. Destroying the editor releases its listeners and GPU resources so the application can initialize another editor on the same element.

Flow design and verification

The embedding plan and canvas Inspector cover the embed step from target validation through disposal. Revision 2 records the passing packed-consumer check.

  • Built all 17 prerequisite and SDK tasks. Installed the SDK tarball in a clean JavaScript consumer and verified its TypeScript API and production build.
  • In Chrome, drew and selected a rectangle on the supplied element, verified its outline and Undo/Redo visually, exercised two independent canvases, and restored a saved document on the original canvas after teardown.
  • Passed 57 focused Core, Render and Pixi tests, including existing container startup and disposal behavior. All 19 framework packages passed the four-phase clean-consumer check. The dependency audit passed.

Task context

{
  "version": 1,
  "mode": "plan-task",
  "objective": "Deliver and verify the browser SDK on an application-owned HTML canvas",
  "base": {
    "ref": "origin/main",
    "sha": "85779c182a355c79201258342e358322e26dbb77"
  },
  "prerequisites": [],
  "plan": {
    "path": "docs/ai/framework/plans/canvas-embedding-plan.md",
    "section": "# Caller-owned canvas SDK",
    "closeoutOwner": "Canvas SDK task coordinator"
  }
}

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant