truecanvas 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -2
- package/dist/chunk-M7B3W7EP.js +659 -0
- package/dist/{chunk-XWQ5MS24.js → chunk-OVYSWA2F.js} +27 -7
- package/dist/cli.js +899 -213
- package/dist/core/index.d.ts +14 -1
- package/dist/core/index.js +1 -1
- package/dist/editor/assets/{Menu-DXPm0EXo.css → Menu-BJ3OmqzH.css} +1 -1
- package/dist/editor/assets/{hub-UhU8yp5F.js → hub-B5hqZCM2.js} +1 -1
- package/dist/editor/assets/{main-UtSaCfnK.js → main-woTyWmya.js} +5 -5
- package/dist/editor/hub.html +3 -3
- package/dist/editor/index.html +3 -3
- package/dist/share/index.d.ts +36 -0
- package/dist/share/index.js +6 -0
- package/package.json +5 -1
- /package/dist/editor/assets/{Menu-BFifVcgz.js → Menu-C0Ti-6T2.js} +0 -0
package/README.md
CHANGED
|
@@ -18,9 +18,10 @@ Truecanvas renders your actual `.tsx` components on an infinite canvas and write
|
|
|
18
18
|
|
|
19
19
|
- **Real components.** Layers are instances of your components, with a props panel generated from their TypeScript types.
|
|
20
20
|
- **Code is the document.** A canvas is a `.canvas.tsx` file. Edits are minimal patches that keep your formatting, so diffs stay reviewable.
|
|
21
|
-
- **Agent-first.**
|
|
21
|
+
- **Agent-first.** 45 MCP tools to read the tree, insert JSX, set props and classes, create frames and variants, and take screenshots.
|
|
22
22
|
- **Design on real pages.** Link any Next.js page as a frame: editing its layers edits `page.tsx` and its layouts.
|
|
23
23
|
- **Components and libraries.** Turn a selection into a component, edit main components, install icon sets (Lucide, Tabler, Phosphor, Heroicons, Radix) and add shadcn/ui components.
|
|
24
|
+
- **Share with clients.** One click freezes a page into a private link on your own domain: clients look and comment in their browser, nothing to install, and their comments land on your canvas for you or your agent to answer.
|
|
24
25
|
- **Git built in.** Per-frame change summaries, branches, commits, pull requests with before/after images, visual compare and comments that travel with branches.
|
|
25
26
|
- **Motion, devices, themes.** Scroll reveals and text animations, iPhone/Pixel/iPad presets with device chrome, and per-frame light and dark themes.
|
|
26
27
|
- **Lightweight.** Frames render through your existing dev server. Headless Chromium only starts when an agent asks for a screenshot.
|
|
@@ -91,7 +92,35 @@ export default function ChatCanvas() {
|
|
|
91
92
|
2. Each frame loads `/truecanvas/<canvas>` from your dev server, where a small runtime maps what's under the pointer back to that position.
|
|
92
93
|
3. Your gestures and your agent's MCP calls become the same commands. The server patches the source and your dev server hot-reloads the frame.
|
|
93
94
|
|
|
94
|
-
|
|
95
|
+
## MCP tools
|
|
96
|
+
|
|
97
|
+
| | Tools |
|
|
98
|
+
| --- | --- |
|
|
99
|
+
| Read | `list_canvases` `get_canvas` `get_node` `get_selection` `list_components` `get_component` `get_design_tokens` `list_comments` |
|
|
100
|
+
| Edit | `insert_jsx` `replace_node` `set_props` `set_text` `set_class_name` `move_node` `duplicate_nodes` `delete_nodes` `wrap_nodes` `undo` `redo` |
|
|
101
|
+
| Frames and pages | `create_frame` `update_frame` `create_variants_frame` `create_canvas` `rename_canvas` `delete_canvas` `import_page` `explore_copy` `apply_to_page` |
|
|
102
|
+
| Components and libraries | `create_component` `open_component` `list_libraries` `install_library` `search_icons` `insert_icon` `add_shadcn_components` |
|
|
103
|
+
| Look and show | `share_canvas` `screenshot_frame` `focus` `play_frame` `add_animation` `remove_animation` `add_background` `apply_preset` `reply_comment` `resolve_comment` |
|
|
104
|
+
|
|
105
|
+
Node ids are the JSX tag's `line:col` and change after edits; every write returns the fresh ids. Catalog components are imported automatically.
|
|
106
|
+
|
|
107
|
+
## Collaborate
|
|
108
|
+
|
|
109
|
+
Canvases, comments and linked pages are files in your repo, so design changes are branched, reviewed and merged like code. From the Git panel you can branch, commit with a per-frame summary, open a pull request with before/after images, and compare against any branch or commit. Comments are saved with the canvas and agents can read and resolve them.
|
|
110
|
+
|
|
111
|
+
The **Truecanvas window** (`npx truecanvas open`) manages several projects in tabs, clones from GitHub and reviews pull requests on the canvas.
|
|
112
|
+
|
|
113
|
+
## Share with clients
|
|
114
|
+
|
|
115
|
+
**Share** (top right in the editor), `npx truecanvas share <canvas>`, or your agent's `share_canvas` renders every frame through your app and freezes it into static HTML and CSS: no scripts, so a link can never call your API or leak a session. It's published to your own review site as a new version of that page's link. Clients open it in any browser, with an optional password, and pin comments on the frames. Their threads sync into the canvas's comments while Truecanvas runs; your replies and your agent's (`reply_comment`, `resolve_comment`) go back to the link, under your studio's name. Comments you start in Truecanvas stay internal. `--revoke` takes a link down and `--delete` removes it with its comments.
|
|
116
|
+
|
|
117
|
+
The review site is `packages/review`, a small Next.js app you deploy once to your Vercel account:
|
|
118
|
+
|
|
119
|
+
1. Create a Vercel project from this repo with **Root Directory** `packages/review`, and add a private **Blob** store and **Upstash for Redis** (both have free tiers).
|
|
120
|
+
2. Set `REVIEW_TOKEN` (a long random string), and optionally `BRAND_NAME` and `BRAND_LOGO` (a logo URL) for your studio's branding.
|
|
121
|
+
3. Add your domain (for example `review.your-studio.com`), then connect Truecanvas: `npx truecanvas share setup https://review.your-studio.com`.
|
|
122
|
+
|
|
123
|
+
Without a review site, Share still makes a local preview of what clients would see.
|
|
95
124
|
|
|
96
125
|
## Configuration
|
|
97
126
|
|