blockout-editor 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Blockout editor
2
+ Copyright (c) 2026 Yash Gidwani (github.com/ux-yash). All rights reserved.
3
+
4
+ You may install this package and use it, as it is, in your own projects. That is the
5
+ only permission given.
6
+
7
+ You may not copy it (beyond installing it), change it, make works based on it, publish
8
+ it, share it, sublicense it or sell it, in whole or in part, without the copyright
9
+ holder's written permission.
10
+
11
+ Parts of engine.js are adapted from Scootch (https://github.com/saniaio/scootch),
12
+ copyright (c) 2026 Sania Saleh, under the MIT License; that notice is in NOTICE.md and
13
+ at the top of engine.js, and those parts stay under it.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17
+ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
19
+ OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
+ OTHER DEALINGS IN THE SOFTWARE.
package/NOTICE.md ADDED
@@ -0,0 +1,26 @@
1
+ # Third-party notices
2
+
3
+ The editor's engine (`engine.js`) adapts the token reading and the cascade logic of Scootch
4
+ (https://github.com/saniaio/scootch), under this licence:
5
+
6
+ MIT License
7
+
8
+ Copyright (c) 2026 Sania Saleh
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,121 @@
1
- # Temporary Holding Version
1
+ # Blockout editor
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Blockout's editor in your app's dev page. Pick anything on the page and change it live: its spacing, size, layout,
4
+ type, fill and border, each checked against your own design tokens (written with one, matching one, or rogue). Drag a
5
+ margin, padding or gap on the page to change it; it snaps to your spacing tokens (hold ⌘ to go between them). Then send
6
+ what you changed, with a note, to Claude Code, which writes it into your code.
7
+
8
+ It is the same editor as Blockout's file view, laid out as Figma: the page's layers docked on the left, the design panel (position, auto layout, appearance, typography, fill, stroke, effects) on the right. Drag a field's label to scrub it, type arithmetic (`16 + 8`, `*2`), and undo with ⌘Z. It runs in development
9
+ only.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install -D blockout-editor
15
+ ```
16
+
17
+
18
+ ### Next.js (App Router)
19
+
20
+ In the root layout, inside `<body>`:
21
+
22
+ ```jsx
23
+ import { BlockoutEditor } from "blockout-editor/react";
24
+
25
+ <BlockoutEditor />
26
+ ```
27
+
28
+ Then `app/api/blockout-notes/route.js`, so notes save into your project:
29
+
30
+ ```js
31
+ export { GET, POST, PATCH, DELETE } from "blockout-editor/next";
32
+ ```
33
+
34
+ ### Vite (React, Vue, Svelte, Astro)
35
+
36
+ In a React app, render `<BlockoutEditor />` from `blockout-editor/react` next to `<App />`. Anywhere else, start it from
37
+ your entry file in development:
38
+
39
+ ```js
40
+ if (import.meta.env.DEV) import("blockout-editor").then((m) => m.startEditor());
41
+ ```
42
+
43
+ And the notes route, in `vite.config.js`:
44
+
45
+ ```js
46
+ import blockoutNotes from "blockout-editor/vite";
47
+
48
+ export default { plugins: [blockoutNotes()] };
49
+ ```
50
+
51
+ Add `.notes/` to `.gitignore`.
52
+
53
+ ### A plain HTML page (no bundler)
54
+
55
+ Copy `blockout-editor.js` (in the package) next to the page and add one line:
56
+
57
+ ```html
58
+ <script src="blockout-editor.js" defer></script>
59
+ ```
60
+
61
+ `data-blockout`, `data-notes` and `data-open` on that tag set the options. A static file server has no notes route,
62
+ so Send to Claude Code puts the change request on your clipboard instead, to paste into Claude Code.
63
+
64
+ ## Using it
65
+
66
+ The **Edit** button sits in the page's bottom right corner. It opens the panel: click anything to pick it.
67
+
68
+ - **V** starts and stops editing, **Esc** lets go of what is picked, then puts the editor away.
69
+ - **Enter** goes into what is picked, **⇧Enter** out of it.
70
+ - **⇧R** shows rulers; drag a guide out of one, and back onto it to remove it.
71
+ - As in Figma: a click picks, a double-click goes in, and on text, types in it (Esc when done); ⌘-click picks the deepest; Tab moves between siblings; ⌥ shows distances; drag the handles to resize; drag or use the arrows to move a layer in its layout; Delete deletes.
72
+ - Zoom out (pinch, ⌘-scroll, ⌘−) for the canvas: your page as a frame, with Tablet and Phone frames beside it (each your dev page at that width). Edit in any frame and the others follow; ⌘0 goes back to the page, with the edits.
73
+ - Hold **Space** to use the page as usual for a moment. Links, buttons and hover looks hold still while editing (the
74
+ settings change that).
75
+
76
+ **Send to Claude Code** saves a note in `.notes/blockout-notes.json`: your words, the element you picked (its CSS path and, in
77
+ a React dev build, its components), and every style you changed on the page, from → to.
78
+
79
+ ## Claude Code: `sc`
80
+
81
+ Put this line in your project's instructions (CLAUDE.md, AGENTS.md or the like):
82
+
83
+ ```text
84
+ When I say "sc": read .notes/blockout-notes.json, make each open note's changes in the code (with the project's own tokens and
85
+ classes, not inline styles; keep the app consistent: when the element shares a component, class or pattern with others, decide whether the change is meant for all of them or this one only, and say which), then mark each one resolved with a one-line reply saying what changed.
86
+ ```
87
+
88
+ Or give Claude Code the notes as tools, from the app's folder:
89
+
90
+ ```bash
91
+ claude mcp add blockout-editor -- npx blockout-editor mcp
92
+ ```
93
+
94
+ Its tools are `list_notes`, `reply_to_note` and `resolve_note`.
95
+
96
+ ## Your tokens
97
+
98
+ The editor reads every custom property in your stylesheets and sorts them by name: spacing (`--space-*`, `--spacing-*`,
99
+ `--gap-*`, `--size-*`), font sizes (`--font-size-*`, `--text-*`), line heights, weights, tracking, radii, border widths,
100
+ colours (any token whose value is a colour) and type styles (classes like `.text-body` that set the font).
101
+
102
+ ## What leaves your computer
103
+
104
+ Nothing of your page. The panel loads from Blockout (`startEditor({ blockout })` points it elsewhere), and your page
105
+ tells it what to draw in the browser: values, token names and element labels. Notes go to your own dev server. Only a
106
+ page on your own computer (localhost) can show Blockout's panel.
107
+
108
+ ## Options
109
+
110
+ `startEditor({ blockout, notesApi, open, button })` and `<BlockoutEditor blockout notesApi open button />`:
111
+
112
+ - `blockout`: where Blockout is. Default `https://blockout-cyan.vercel.app`.
113
+ - `notesApi`: the notes route. Default `/api/blockout-notes`.
114
+ - `open`: start with the panel open.
115
+ - `button`: `{ right, bottom }`, the Edit button's distance from the bottom right corner in px (default 16 each), to keep it clear of your app's own corner buttons.
116
+
117
+ See `NOTICE.md` for the open-source work the editor builds on.
118
+
119
+ ## Licence
120
+
121
+ Copyright (c) 2026 Yash Gidwani. All rights reserved: you may install and use it as it is; you may not copy, change or redistribute it. See `LICENSE`; parts adapted from Scootch stay under their MIT licence (`NOTICE.md`).