weevar 1.1.0 → 1.2.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 +143 -32
- package/dist/react.dev.js +1 -1
- package/dist/react.dev.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
# Weevar
|
|
2
2
|
|
|
3
|
-
A dev
|
|
3
|
+
A dev-only overlay for React apps that lets you **rearrange layout** and **edit styles** in the browser—then turns those changes into structured prompts for AI coding assistants.
|
|
4
4
|
|
|
5
|
-
Weevar
|
|
5
|
+
Weevar runs locally while your dev server is active. Nothing ships to production until you apply the generated prompts to your source code.
|
|
6
6
|
|
|
7
|
+
**Current version:** see the tray footer (`v1.2.0` at time of this release).
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## What Weevar does
|
|
12
|
+
|
|
13
|
+
| Capability | Description |
|
|
14
|
+
|------------|-------------|
|
|
15
|
+
| **Layout moves** | Drag elements to reorder within a container or move them across sections. Live DOM preview with flex-order hints. |
|
|
16
|
+
| **Style edits** | Select an element and adjust typography, box model, borders, radius, opacity, layout (flex/grid), and more in the edit tray. |
|
|
17
|
+
| **Prompt generation** | Copy a short or detailed prompt describing every edit in your session—layout and style combined. |
|
|
18
|
+
| **Session controls** | Undo, redo, and clear edits; batched prompts preserve order and relative indices. |
|
|
19
|
+
|
|
20
|
+
Runtime changes are **preview-only**. Refreshing the page restores your source-defined UI. Prompts are how edits become permanent in code.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Quick start
|
|
25
|
+
|
|
26
|
+
### 1. Install
|
|
9
27
|
|
|
10
28
|
```bash
|
|
11
29
|
npm install weevar
|
|
12
30
|
```
|
|
13
31
|
|
|
14
|
-
|
|
32
|
+
### 2. Mount the overlay
|
|
15
33
|
|
|
16
34
|
```tsx
|
|
17
35
|
import { Weevar } from "weevar/react";
|
|
@@ -26,7 +44,9 @@ export function Root() {
|
|
|
26
44
|
}
|
|
27
45
|
```
|
|
28
46
|
|
|
29
|
-
### Vite
|
|
47
|
+
### 3. Add the Vite plugin (recommended)
|
|
48
|
+
|
|
49
|
+
The plugin injects `data-wv-source` attributes so prompts include accurate file and line anchors.
|
|
30
50
|
|
|
31
51
|
```ts
|
|
32
52
|
import { defineConfig } from "vite";
|
|
@@ -38,57 +58,148 @@ export default defineConfig({
|
|
|
38
58
|
});
|
|
39
59
|
```
|
|
40
60
|
|
|
41
|
-
Run
|
|
61
|
+
### 4. Run dev and toggle Weevar
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm run dev
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Press **⌘⇧E** (Mac) or **Ctrl+Shift+E** (Windows/Linux), or click the dock trigger.
|
|
68
|
+
|
|
69
|
+
---
|
|
42
70
|
|
|
43
71
|
## Requirements
|
|
44
72
|
|
|
45
73
|
- **Node.js** `>= 18.18`
|
|
46
|
-
-
|
|
47
|
-
- **Development mode**
|
|
48
|
-
- **Bundler integration**
|
|
74
|
+
- **React** and **React DOM** `>= 17`
|
|
75
|
+
- **Development mode** — a dev server (Vite, Next dev, etc.), not a production build
|
|
76
|
+
- **Bundler integration** recommended for best prompt accuracy (`weevar/vite`, or `weevar/swc` / `weevar/webpack-loader`)
|
|
49
77
|
|
|
50
|
-
|
|
78
|
+
See [Install guide](https://github.com/Pro-Gee/Weevar/blob/main/docs/INSTALL.md) for Next.js, Webpack, and config file options.
|
|
51
79
|
|
|
52
|
-
|
|
53
|
-
2. Turn on the overlay (shortcut below).
|
|
54
|
-
3. Click and drag elements to rearrange them.
|
|
55
|
-
4. See the layout update instantly.
|
|
80
|
+
---
|
|
56
81
|
|
|
57
|
-
|
|
82
|
+
## Workflow
|
|
58
83
|
|
|
59
|
-
|
|
84
|
+
1. **Toggle Weevar** on your running dev app.
|
|
85
|
+
2. **Overview (`O`)** — see session stats and open documentation.
|
|
86
|
+
3. **Pointer / edit mode (`W`)** — click an element on the page:
|
|
87
|
+
- **Drag** the selection handle to reorder or move layout.
|
|
88
|
+
- **Edit tray** — adjust styles; commits are recorded in the session.
|
|
89
|
+
4. **Hold Alt** (with an element selected) and hover another element to **measure spacing** between them.
|
|
90
|
+
5. **Prompt (`P`)** — generate and copy the batched prompt for your AI tool.
|
|
91
|
+
6. **Paste** the prompt into Cursor, Claude Code, Codex, or another assistant to update source files.
|
|
60
92
|
|
|
61
|
-
|
|
93
|
+
---
|
|
62
94
|
|
|
63
|
-
|
|
64
|
-
- Move elements between sections.
|
|
65
|
-
- Experiment with layout structure visually.
|
|
95
|
+
## Layout editing
|
|
66
96
|
|
|
67
|
-
|
|
97
|
+
- **Reorder** — drag within the same flex/grid/block parent; drop zones show insertion index.
|
|
98
|
+
- **Cross-container move** — drag into another valid layout parent; prompts include source/destination parents and child indices.
|
|
99
|
+
- **Container moves** — moving a parent (e.g. a `.carousel-scroll` wrapper) generates prompts that instruct agents to move the **full subtree**, not individual text nodes inside it.
|
|
68
100
|
|
|
69
|
-
|
|
101
|
+
Prompts use **DOM-first refs** when classes exist (e.g. `<div.carousel-scroll> (4 element children)`) plus `{src:…; dom:…; h:…}` anchor blocks for deterministic edits.
|
|
70
102
|
|
|
71
|
-
|
|
103
|
+
---
|
|
72
104
|
|
|
73
|
-
|
|
74
|
-
- “Move this to the right but keep it aligned.”
|
|
75
|
-
- “Reorder these cards.”
|
|
105
|
+
## Style editing
|
|
76
106
|
|
|
77
|
-
|
|
107
|
+
When you select an element in pointer mode, the **edit tray** opens with controls matched to element type:
|
|
78
108
|
|
|
79
|
-
|
|
109
|
+
| Category | Typical elements | Controls |
|
|
110
|
+
|----------|------------------|----------|
|
|
111
|
+
| **text** | `p`, `h1`–`h6`, `span`, `button`, … | Font size, weight, alignment, colour, line height, letter spacing |
|
|
112
|
+
| **image** | `img` | Object fit, width, height |
|
|
113
|
+
| **svg** | `svg` and descendants | Width, height, fill, stroke |
|
|
114
|
+
| **stack** | Flex/grid containers, multi-child wrappers | Layout type, direction, gap, grid columns, alignment, plus box/colour controls |
|
|
115
|
+
| **generic** | Everything else | Colour, background, display, width, height |
|
|
116
|
+
|
|
117
|
+
**Box controls** include padding, margin, border (style, weight, colour, per-side weights), corner radius (uniform or per-corner), opacity, and **W/H sizing** with **Fixed**, **Fill container** (`100%`), or **Hug content** (`auto`).
|
|
118
|
+
|
|
119
|
+
Style commits merge on the same element within a session. Prompts list each CSS property as `` `property` before → after ``.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Prompts
|
|
124
|
+
|
|
125
|
+
### Short vs detailed
|
|
126
|
+
|
|
127
|
+
Configure in **Settings → Prompt Style**:
|
|
128
|
+
|
|
129
|
+
- **Short** — compact numbered steps; ideal for chat paste.
|
|
130
|
+
- **Detailed** — Markdown sections, property tables for styles, constraints, optional Tailwind suggestions.
|
|
131
|
+
|
|
132
|
+
### Target tool
|
|
133
|
+
|
|
134
|
+
**Settings → Target Tool** tailors output for **Claude Code**, **Codex**, or **Generic** assistants.
|
|
135
|
+
|
|
136
|
+
### Batched sessions
|
|
80
137
|
|
|
81
|
-
|
|
138
|
+
Multiple layout moves and style tweaks produce one ordered prompt. Headers look like:
|
|
139
|
+
|
|
140
|
+
`11 changes (9 style updates, 2 layout moves) (apply in order; …)`
|
|
141
|
+
|
|
142
|
+
Each step’s indices are relative to the state **after prior steps** are applied.
|
|
143
|
+
|
|
144
|
+
### Tailwind
|
|
145
|
+
|
|
146
|
+
If the Vite plugin detects Tailwind in your project, detailed style prompts can include a **Tailwind suggestion** column. Override via `weevar.config.json` — see [Usage](https://github.com/Pro-Gee/Weevar/blob/main/docs/USAGE.md).
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Keyboard shortcuts
|
|
151
|
+
|
|
152
|
+
| Shortcut | Action |
|
|
153
|
+
|----------|--------|
|
|
154
|
+
| **⌘⇧E** / **Ctrl+Shift+E** | Toggle Weevar overlay |
|
|
155
|
+
| **O** | Overview tray |
|
|
156
|
+
| **W** | Pointer / edit mode |
|
|
157
|
+
| **P** | Generate prompt |
|
|
158
|
+
| **U** | Undo last edit |
|
|
159
|
+
| **R** | Redo |
|
|
160
|
+
| **D** | Clear session |
|
|
161
|
+
| **Alt** (held) | Spacing measure between selected and hovered elements |
|
|
162
|
+
| **Esc** | Cancel drag / dismiss overlays |
|
|
163
|
+
|
|
164
|
+
Shortcuts are ignored while focus is in an input or textarea (edit tray fields).
|
|
165
|
+
|
|
166
|
+
Custom toggle keybind:
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
<Weevar keybind={{ key: "e", meta: true, shift: true }} />
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Package exports
|
|
175
|
+
|
|
176
|
+
| Import | Purpose |
|
|
177
|
+
|--------|---------|
|
|
178
|
+
| `weevar/react` | `<Weevar />` overlay (dev entry; production resolves to no-op) |
|
|
179
|
+
| `weevar/vite` | Vite plugin — source injection + `virtual:weevar-config` |
|
|
180
|
+
| `weevar/swc` | SWC integration |
|
|
181
|
+
| `weevar/webpack-loader` | Webpack loader |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Production safety
|
|
186
|
+
|
|
187
|
+
The published **`weevar/react`** production export is a **no-op** — the overlay does not mount in production builds. Always verify your production bundle as part of release checks.
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Documentation
|
|
82
192
|
|
|
83
193
|
- [Install](https://github.com/Pro-Gee/Weevar/blob/main/docs/INSTALL.md)
|
|
84
194
|
- [Usage](https://github.com/Pro-Gee/Weevar/blob/main/docs/USAGE.md)
|
|
85
195
|
- [Troubleshooting](https://github.com/Pro-Gee/Weevar/blob/main/docs/TROUBLESHOOTING.md)
|
|
86
196
|
- [Compatibility](https://github.com/Pro-Gee/Weevar/blob/main/docs/COMPATIBILITY.md)
|
|
87
197
|
- [Security](https://github.com/Pro-Gee/Weevar/blob/main/docs/SECURITY.md)
|
|
198
|
+
- [Changelog](https://github.com/Pro-Gee/Weevar/blob/main/CHANGELOG.md)
|
|
88
199
|
- [Weevar.com](https://weevar.com)
|
|
89
200
|
|
|
90
|
-
|
|
201
|
+
---
|
|
91
202
|
|
|
92
|
-
|
|
203
|
+
## License
|
|
93
204
|
|
|
94
|
-
|
|
205
|
+
MIT — © 2026 Gideon Adeyemi
|
package/dist/react.dev.js
CHANGED
package/dist/react.dev.mjs
CHANGED