@popmelt.com/core 0.5.22 → 0.6.1

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 CHANGED
@@ -1,38 +1,30 @@
1
1
  <p align="center">
2
- <img src="src/assets/bar - popmelt.png" alt="Comment and zhuzh, then hand off." width="360" style="border-radius: 12px;" />
2
+ <img src="src/assets/bar - popmelt.png" alt="Popmelt" width="360" style="border-radius: 12px;" />
3
3
  </p>
4
4
 
5
5
  # Popmelt
6
6
 
7
7
  ## What is it?
8
8
 
9
- Popmelt is a design collaboration layer for AI models like Codex or Claude Code. It combines the best parts of collaborative design tools like Figma with the best way to design products today: in code, with AI, right in your browser.
9
+ Popmelt is a design collaboration layer for AI coding agents. Drop it into any React, Vite, or Astro codebase and get a full design-feedback loop: draw on your running UI, pin feedback to elements, adjust style and layout directly, and hand off annotated screenshots with full technical context in a keystroke.
10
10
 
11
- It's a good fit for anyone involved in UI Design and Engineering for the web: it doesn't require deep technical expertise to use, and it won't get in your way if you *do* have that knowledge and want to use it.
12
-
13
- Drop it into any React codebase and get a full design-feedback loop: draw on your running UI, pin feedback to elements, adjust style and layout directly, and give your AI the visual and technical context it needs to execute your vision in a keystroke.
11
+ It works with AI CLI tools like [Claude Code](https://code.claude.com/docs/en/cli-reference) and [Codex](https://developers.openai.com/codex/cli/),
14
12
 
15
13
  <p align="center">
16
- <img src="src/assets/annotations.jpg" alt="Popmelt annotations on a running app" width="720" style="border-radius: 6px;" />
14
+ <img src="src/assets/bar - annotations.png" alt="Popmelt annotations on a running app" width="720" style="border-radius: 6px;" />
17
15
  </p>
18
16
 
19
- **Popmelt is free to use and completely local**. It runs inside your codebase, with your existing AI CLI tools ([Claude Code](https://code.claude.com/docs/en/cli-reference), [Codex](https://developers.openai.com/codex/cli/)) handling code changes behind the scenes. You don't need an account to use it and we never see your data.
20
-
21
- ## Why does it exist?
22
-
23
- We're experienced product engineers and early adopters of AI coding models. We know their strengths, we know their weaknesses, and we've learned how to squeeze the best performance out of each generation. Popmelt was built to streamline our way of working, and we're proud to make it available to the design and engineering community.
17
+ **Popmelt is free to use and completely local**. It runs inside your codebase, with your existing AI CLI tools handling code changes behind the scenes. You don't need an account to use it and we never see your data.
24
18
 
19
+ ## Quick start
25
20
 
26
- ## How do I set it up?
27
-
28
- If you're a human, we recommend asking your AI to handle installation for you. We cover the basics below, but your AI should be able to integrate it into whatever setup you throw at it as long as it supports Node and React.
21
+ ### Install
29
22
 
30
23
  ```bash
31
24
  npm install @popmelt.com/core
32
25
  ```
33
26
 
34
- Peer dependencies: `react >=18`, `react-dom >=18`, `lucide-react >=0.400` (toolbar icons).
35
-
27
+ Peer dependencies: `react >=18`, `react-dom >=18`, `lucide-react >=0.400`.
36
28
 
37
29
  ### Frontend
38
30
 
@@ -40,16 +32,21 @@ Wrap your app in `PopmeltProvider`. In development, double-tap Cmd/Ctrl to open
40
32
 
41
33
  ```tsx
42
34
  import { PopmeltProvider } from '@popmelt.com/core';
35
+ import { useRouter } from 'next/navigation';
43
36
 
44
37
  export default function App() {
38
+ const router = useRouter();
39
+
45
40
  return (
46
- <PopmeltProvider>
41
+ <PopmeltProvider navigate={router.push}>
47
42
  {/* your app */}
48
43
  </PopmeltProvider>
49
44
  );
50
45
  }
51
46
  ```
52
47
 
48
+ The `navigate` prop enables multi-page annotation support. Pass your framework's router push function (e.g. `router.push` in Next.js, `navigate` in React Router).
49
+
53
50
  ### Backend
54
51
 
55
52
  Start the bridge server so Popmelt can talk to Claude/Codex. Use the plugin for your framework:
@@ -102,14 +99,11 @@ npx @popmelt.com/core wrap -- vite
102
99
 
103
100
  Open your app in the browser and double-tap Cmd (or Ctrl) to toggle the toolbar. Draw, type, point at things, hit Cmd+Enter. Your AI sees your annotated screenshot and code context and gets to work.
104
101
 
105
- ## How do I use it?
106
-
107
- ### Annotation tools
102
+ ## Annotation tools
108
103
 
109
104
  | Tool | Shortcut | What it does |
110
105
  |------|----------|-------------|
111
106
  | **Comment** | `C` | Click any element to pin a comment. Captures tag, classes, React component name, and ancestor context. |
112
- | **Handle** | `H` | Drag padding, gap, border-radius, font-size, and line-height handles directly on elements. Shift to snap to a scale. |
113
107
  | **Rectangle** | `R` | Draw a rectangle to highlight a region. Auto-prompts for a text label. |
114
108
  | **Oval** | `O` | Draw an ellipse. |
115
109
  | **Line** | `L` | Draw a straight line. |
@@ -122,7 +116,8 @@ Open your app in the browser and double-tap Cmd (or Ctrl) to toggle the toolbar.
122
116
  <img src="src/assets/bar - text.png" alt="Text tool guidance" width="360" style="border-radius: 12px;" />
123
117
  </p>
124
118
 
125
- ### Handle tool
119
+
120
+ ## Handle tool
126
121
 
127
122
  Switch to the Handle tool (`H`) and hover any element to see draggable handles for its spatial properties:
128
123
 
@@ -134,29 +129,48 @@ Switch to the Handle tool (`H`) and hover any element to see draggable handles f
134
129
 
135
130
  All changes apply as inline styles instantly. Hold Cmd/Alt and swipe on a flex container to cycle `justify-content` or `flex-direction`; hold Shift and swipe to cycle `align-items`. Cmd+Z / Cmd+Shift+Z to undo/redo any change.
136
131
 
137
- Right-click any element in Handle mode to open the **style panel** for full control over layout (flex/grid direction, alignment, gap, sizing), typography (size, weight, line-height, letter-spacing, color), backgrounds, borders, and effects. Every modification is tracked and included in the feedback sent to your AI.
132
+ Right-click any element in Handle mode to open the **style panel** for full control over layout, typography, backgrounds, borders, and effects. Every modification is tracked and included in the feedback sent to your AI.
138
133
 
139
134
  <p align="center">
140
135
  <img src="src/assets/bar - handle.png" alt="Handle tool guidance" width="360" style="border-radius: 12px;" />
141
136
  </p>
142
137
 
143
- ### AI Collaboration
144
138
 
145
- Cmd+Enter captures an annotated screenshot with your annotations baked in, bundles it with structured feedback (element selectors, style diffs, annotation text), and sends it to Claude or Codex via a local bridge server. Your AI reads the screenshot, sees exactly what you marked up, and edits your code. Cmd+C copies the screenshot to your clipboard instead.
146
139
 
147
- - **Threaded conversations** — follow-up annotations on the same element continue the existing thread. Your AI sees prior context without re-explaining.
148
- - **Questions** — if your AI needs clarification, it asks. A badge appears on the annotation; reply inline and the conversation continues.
149
- - **Provider switching** toggle between Claude (Opus/Sonnet) and Codex at any time. Popmelt handles both.
140
+ ## Model pane
141
+
142
+ Popmelt maintains a design model for your project, a structured record of components, tokens, and rules.
143
+
144
+ Switch to the Model tool (`M`) and hover any element to see component boundaries. Click to promote a component or token into your model. Popmelt classifies the scope of each promotion (instance vs pattern, element vs component vs token) so your AI understands what's a one-off tweak and what's a system-level change.
145
+
146
+ Every annotation and resolution is stored in your project, creating a searchable history of what changed and why. You can use this record to track evolution of your design vision, and your AI can use it to make better decisions and avoid past mistake
147
+
148
+ Your AI references the design model when making changes, keeping its output consistent with your established patterns.
150
149
 
151
150
  <p align="center">
152
- <img src="src/assets/bar - model.png" alt="Model switcher guidance" width="360" style="border-radius: 12px;" />
151
+ <img src="src/assets/bar - model.png" alt="Model tool guidance" width="360" style="border-radius: 12px;" />
153
152
  </p>
154
153
 
155
- ### Persistence
156
154
 
157
- Annotations and style modifications save to localStorage automatically. Cmd+Backspace clears unsent annotations and modifications.
155
+ ## Annotation counter
156
+
157
+ The toolbar shows a count of active annotations. Click the counter to cycle through them; scroll to change the annotation color; hover to see a route-grouped navigation list of all annotations across pages.
158
+
159
+ ## AI Collaboration
160
+
161
+ Press Cmd+Enter to capture an annotated screenshot, bundle it with structured feedback (element selectors, style diffs, annotation text), and send it to your AI. Cmd+C copies the screenshot to your clipboard instead. Toggle between Claude (Opus/Sonnet) and Codex at any time.
162
+
163
+ ### Threaded conversations
158
164
 
159
- Thread history persists to `.popmelt/threads.json` in your project root for cross-session continuity.
165
+ Follow-up annotations on the same element continue the existing thread — your AI sees prior context without re-explaining. If your AI needs clarification, a question badge appears on the annotation; reply inline and the conversation continues.
166
+
167
+ ### Multi-page annotations
168
+
169
+ Annotate across multiple pages in a single session. Popmelt captures per-page screenshots and stitches them into a single submission so your AI understands the full scope of your feedback. Pass a `navigate` prop to `PopmeltProvider` to enable this.
170
+
171
+ ### Resolution lifecycle
172
+
173
+ When your AI resolves an annotation, it's marked with a status badge. Resolved annotations show a checkmark; annotations that need your review get a flag. Dismissed annotations gray out. The lifecycle keeps your canvas clean as you iterate.
160
174
 
161
175
  ## API
162
176
 
@@ -164,8 +178,9 @@ Thread history persists to `.popmelt/threads.json` in your project root for cros
164
178
 
165
179
  ```tsx
166
180
  <PopmeltProvider
167
- enabled={true} // default: process.env.NODE_ENV === 'development'
168
- bridgeUrl="http://localhost:1111" // default
181
+ enabled={true} // default: process.env.NODE_ENV === 'development'
182
+ bridgeUrl="http://localhost:1111" // default
183
+ navigate={router.push} // optional: enables multi-page annotations
169
184
  >
170
185
  ```
171
186
 
@@ -205,6 +220,6 @@ const { isEnabled } = usePopmelt();
205
220
 
206
221
  **If you need a custom license** for your use case, contact [reb@popmelt.com](mailto:reb@popmelt.com) with a brief outline of your desired terms.
207
222
 
208
- <p style="background: #efefef; padding: 4px; display: inline-flex">
209
- <img src="src/assets/popmelt-logo.svg" alt="Comment and zhuzh, then hand off." width="64" />
223
+ <p align="center">
224
+ <img src="src/assets/popmelt-logo.svg" alt="Popmelt" width="64" />
210
225
  </p>