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 CHANGED
@@ -1,17 +1,35 @@
1
1
  # Weevar
2
2
 
3
- A dev tool that lets you rearrange your UI visually in the browser—then turns those changes into prompts for AI to implement in code.
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 is **development-only**: it runs as an overlay in your React app while you work locally. Nothing ships to production by until you push.
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
- ## Installation
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
- Mount in your app root:
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 your dev server and press **⌘⇧E** (Mac) or **Ctrl+Shift+E** (Windows/Linux) to toggle the overlay.
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
- - A **React** app (`react` / `react-dom` **>= 17**)
47
- - **Development mode** (run your usual dev server—e.g. Vite, Next devnot a production build)
48
- - **Bundler integration** is recommended for the best experience (see **Vite** below); other setups may need extra configuration—see the [Install](https://github.com/Pro-Gee/Weevar/blob/main/docs/INSTALL.md) guide.
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
- ## How it works
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
- 1. Run your app in dev mode.
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
- When you’re done, the tool generates a prompt.
82
+ ## Workflow
58
83
 
59
- Paste that into your AI coding tool, and it updates your code.
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
- ## What you can do right now
93
+ ---
62
94
 
63
- - Reorder elements within a layout.
64
- - Move elements between sections.
65
- - Experiment with layout structure visually.
95
+ ## Layout editing
66
96
 
67
- This version is focused on **layout and structure** only.
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
- ## Why this is useful
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
- Explaining layout changes is harder than it sounds:
103
+ ---
72
104
 
73
- - “Put this under that.”
74
- - “Move this to the right but keep it aligned.”
75
- - “Reorder these cards.”
105
+ ## Style editing
76
106
 
77
- Instead of describing it, you move things directly and let Weevar translate that into a structured prompt.
107
+ When you select an element in pointer mode, the **edit tray** opens with controls matched to element type:
78
108
 
79
- ## Documentation
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
- Full guides live in the repository:
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
- ## License
201
+ ---
91
202
 
92
- © 2026 Gideon Adeyemi. All rights reserved.
203
+ ## License
93
204
 
94
- licensed under the MIT License.
205
+ MIT © 2026 Gideon Adeyemi
package/dist/react.dev.js CHANGED
@@ -1660,7 +1660,7 @@ function readRadiusValues(el) {
1660
1660
  }
1661
1661
 
1662
1662
  // src/version.ts
1663
- var WEEVAR_VERSION = "1.1.0";
1663
+ var WEEVAR_VERSION = "1.2.0";
1664
1664
  function weevarVersionLabel() {
1665
1665
  return `v${WEEVAR_VERSION}`;
1666
1666
  }
@@ -1640,7 +1640,7 @@ function readRadiusValues(el) {
1640
1640
  }
1641
1641
 
1642
1642
  // src/version.ts
1643
- var WEEVAR_VERSION = "1.1.0";
1643
+ var WEEVAR_VERSION = "1.2.0";
1644
1644
  function weevarVersionLabel() {
1645
1645
  return `v${WEEVAR_VERSION}`;
1646
1646
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weevar",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Dev overlay: manipulate live UI and copy structured prompts for AI assistants",
5
5
  "homepage": "https://weevar.com",
6
6
  "repository": {