usepilot 0.0.1 → 0.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
@@ -2,16 +2,84 @@
2
2
 
3
3
  **Take the controls from your coding agent and edit your UI in the browser.**
4
4
 
5
- Pilot is a dev-only design overlay for your real app. Select an element, search
6
- a property the way you'd type a Tailwind class, adjust it in a visual editor and
7
- see the change live. Then hand it back to your agent as plain-CSS intent, which
8
- it translates into your project's own conventions (Tailwind, CSS modules,
9
- design tokens…).
5
+ Pilot is a dev-only design overlay for your real app. Select an element,
6
+ search a property the way you'd type a Tailwind class (`pt`, `gap-x`,
7
+ `size`), adjust it in a visual editor and see the change live. Then copy your
8
+ changes as a prompt for your coding agent: plain-CSS intent it translates into
9
+ your project's own conventions (Tailwind classes, CSS modules, design tokens…).
10
+ Pilot never edits your files.
10
11
 
11
- Coming soon.
12
+ > Early preview (0.x). Things will change between versions.
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ npm install -D usepilot
18
+ ```
19
+
20
+ Load it in development only. Pilot runs in its own Shadow DOM, so it doesn't
21
+ touch your app's styles or framework.
22
+
23
+ **Vite (React, Vue, Svelte, plain…)**: in your app's entry file (`main.tsx`,
24
+ `main.ts`…):
25
+
26
+ ```ts
27
+ if (import.meta.env.DEV) import("usepilot/auto");
28
+ ```
29
+
30
+ **Next.js (App Router)**: a small client component, rendered in your root
31
+ layout:
32
+
33
+ ```tsx
34
+ // app/pilot.tsx
35
+ "use client";
36
+ import { useEffect } from "react";
37
+
38
+ export function Pilot() {
39
+ useEffect(() => {
40
+ if (process.env.NODE_ENV === "development") import("usepilot/auto");
41
+ }, []);
42
+ return null;
43
+ }
44
+ ```
45
+
46
+ ```tsx
47
+ // app/layout.tsx: inside <body>
48
+ <Pilot />
49
+ ```
50
+
51
+ **Anything else**: import `usepilot/auto` from code that only runs in the
52
+ browser, in development.
53
+
54
+ ## Use
55
+
56
+ 1. **Launch**: press **Option+P** (Alt+P) on any page of your app.
57
+ 2. **Select**: click the cursor in the toolbar, then any element.
58
+ 3. **Search and edit**: type a property (`p`, `pt`, `w`, `gap`, `display`,
59
+ `aspect`…), Tab into its editor, type or drag a value. Cmd/Ctrl+Z undoes.
60
+ Type `from-768 ` first to make the change for some viewport widths only.
61
+ 4. **Copy prompt**: the second toolbar button copies your changes as a
62
+ prompt. Paste it to your coding agent.
63
+ 5. **Clear changes**: once the agent has applied them, the eraser removes your
64
+ changes so you see the real result (Cmd/Ctrl+Z brings them back).
65
+
66
+ Your changes survive reloads in the same browser tab. Quit with the toolbar's
67
+ last button.
68
+
69
+ ## Options
70
+
71
+ ```ts
72
+ import { mountPilot } from "usepilot";
73
+
74
+ mountPilot({
75
+ shortcut: "alt+p", // or "ctrl+shift+e", or false
76
+ launch: false, // true: open on load
77
+ nameAttributes: ["data-block"], // attributes your project names elements with
78
+ });
79
+ ```
12
80
 
13
81
  ## License
14
82
 
15
83
  [FSL-1.1-MIT](./LICENSE.md): free to use, modify and share, including at work,
16
- for anything except a competing commercial product. Each version becomes MIT two
17
- years after its release.
84
+ for anything except a competing commercial product. Each version becomes MIT
85
+ two years after its release.