@designtools/codesurface 0.1.3 → 0.1.8
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 +22 -15
- package/dist/cli.js +217 -109
- package/dist/client/assets/index--eM7ukq5.js +284 -0
- package/dist/client/assets/index-1q-WwsbN.css +1 -0
- package/dist/client/assets/index-A_L26x1h.js +164 -0
- package/dist/client/assets/index-B6jN1q8m.js +221 -0
- package/dist/client/assets/index-B7jQZQIh.js +164 -0
- package/dist/client/assets/index-BCq28ejx.js +274 -0
- package/dist/client/assets/index-BSe1-ayg.js +221 -0
- package/dist/client/assets/index-BoqOSsiL.js +164 -0
- package/dist/client/assets/index-BrTweOBw.css +1 -0
- package/dist/client/assets/index-BvlvZBFo.js +164 -0
- package/dist/client/assets/index-C0W09LqU.js +274 -0
- package/dist/client/assets/index-C8zdCN9Y.css +1 -0
- package/dist/client/assets/index-CNoLX-EE.css +1 -0
- package/dist/client/assets/index-CT_MpeRK.css +1 -0
- package/dist/client/assets/index-Caw3C8nD.js +164 -0
- package/dist/client/assets/index-CiJuTDXP.css +1 -0
- package/dist/client/assets/index-D1sfJ6Vs.js +274 -0
- package/dist/client/assets/index-D4qADRtt.js +221 -0
- package/dist/client/assets/index-DLNdLnNZ.css +1 -0
- package/dist/client/assets/index-DOOYG-7t.js +221 -0
- package/dist/client/assets/index-DOo00IKO.js +164 -0
- package/dist/client/assets/index-DT_WVyln.js +274 -0
- package/dist/client/assets/index-Dd5ywdn8.css +1 -0
- package/dist/client/assets/index-DevUtWzq.js +274 -0
- package/dist/client/assets/index-DnmW8VmS.js +274 -0
- package/dist/client/assets/index-Ndu6k3-t.css +1 -0
- package/dist/client/assets/index-WBV2EURP.js +284 -0
- package/dist/client/assets/index-lOuYsLDH.css +1 -0
- package/dist/client/assets/index-nMHvJQPa.css +1 -0
- package/dist/client/assets/index-s0F6GbJf.js +164 -0
- package/dist/client/assets/index-xf9QDxu1.css +1 -0
- package/dist/client/index.html +2 -2
- package/package.json +4 -1
- package/dist/client/assets/index-B5g8qgFW.css +0 -1
- package/dist/client/assets/index-BB9cuIlF.js +0 -111
- package/dist/client/assets/index-BH-ji2K7.js +0 -150
- package/dist/client/assets/index-BH4MtIeE.js +0 -150
- package/dist/client/assets/index-BIpQhd8p.js +0 -150
- package/dist/client/assets/index-BRJOTqhn.js +0 -130
- package/dist/client/assets/index-Bb8QmYLf.css +0 -1
- package/dist/client/assets/index-Bbi0p5WW.js +0 -150
- package/dist/client/assets/index-BdWkGSfZ.js +0 -130
- package/dist/client/assets/index-BnRqJ-Bb.js +0 -150
- package/dist/client/assets/index-BneJISnX.js +0 -150
- package/dist/client/assets/index-C9_QxP1g.css +0 -1
- package/dist/client/assets/index-CBjuhHfq.js +0 -150
- package/dist/client/assets/index-CEFmdeB7.css +0 -1
- package/dist/client/assets/index-CQpCDasO.js +0 -131
- package/dist/client/assets/index-CRUCeIYi.css +0 -1
- package/dist/client/assets/index-CUSGVUIj.js +0 -150
- package/dist/client/assets/index-CZJQ3vJi.js +0 -150
- package/dist/client/assets/index-CdshIoQY.css +0 -1
- package/dist/client/assets/index-Cne4pc0S.css +0 -1
- package/dist/client/assets/index-Cps9lJoI.css +0 -1
- package/dist/client/assets/index-Cs7mKzsY.css +0 -1
- package/dist/client/assets/index-D-bUCwC3.css +0 -1
- package/dist/client/assets/index-D11nArXR.css +0 -1
- package/dist/client/assets/index-D2DhQd-K.js +0 -51
- package/dist/client/assets/index-D3ju6tgw.css +0 -1
- package/dist/client/assets/index-DG2JRz0f.js +0 -150
- package/dist/client/assets/index-DO-UYUx0.js +0 -150
- package/dist/client/assets/index-DOb58Ii1.js +0 -111
- package/dist/client/assets/index-DVd7DS_W.css +0 -1
- package/dist/client/assets/index-DZNHUm4M.js +0 -130
- package/dist/client/assets/index-Di7zgczR.css +0 -1
- package/dist/client/assets/index-DlUCyHdA.css +0 -1
- package/dist/client/assets/index-FTflg87d.js +0 -130
- package/dist/client/assets/index-U5_kmGxX.js +0 -150
- package/dist/client/assets/index-_4EXPfyt.css +0 -1
- package/dist/client/assets/index-gow3pju2.css +0 -1
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@ A CLI-launched visual design layer for React applications. Select elements in yo
|
|
|
5
5
|
## Requirements
|
|
6
6
|
|
|
7
7
|
- Node.js >= 18
|
|
8
|
-
- **Next.js** >= 14 (
|
|
8
|
+
- **Next.js** >= 14 (App Router)
|
|
9
9
|
- **React** >= 18
|
|
10
|
-
- **Tailwind CSS** v3
|
|
10
|
+
- A supported styling system: **Tailwind CSS** v3/v4, **CSS Custom Properties**, **Bootstrap**, or plain CSS
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
@@ -30,10 +30,10 @@ const nextConfig = {
|
|
|
30
30
|
export default withDesigntools(nextConfig);
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
In development, this:
|
|
34
34
|
|
|
35
|
-
-
|
|
36
|
-
- Auto-mounts the `<CodeSurface />` selection overlay component
|
|
35
|
+
- Adds a Babel pass that injects `data-source="file:line:col"` attributes into every JSX element, mapping each element to its source location. These only exist in the compiled output — your source files are not modified.
|
|
36
|
+
- Auto-mounts the `<CodeSurface />` selection overlay component into your root layout (`app/layout.tsx` or `src/app/layout.tsx`).
|
|
37
37
|
|
|
38
38
|
Neither is included in production builds.
|
|
39
39
|
|
|
@@ -58,17 +58,19 @@ Components without `data-slot` can still be selected and edited at the element l
|
|
|
58
58
|
|
|
59
59
|
### 3. Run it
|
|
60
60
|
|
|
61
|
-
Start your Next.js dev server, then
|
|
61
|
+
Start your Next.js dev server, then run CodeSurface from your project root:
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
|
-
# Terminal 1
|
|
64
|
+
# Terminal 1: start your app
|
|
65
65
|
npm run dev
|
|
66
66
|
|
|
67
|
-
# Terminal 2
|
|
67
|
+
# Terminal 2: start the editor
|
|
68
68
|
npx codesurface
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
The
|
|
71
|
+
The CLI auto-detects your dev server on port 3000 (also scanning 3001 and 3002 in case Next.js picked a different port). The editor opens at `http://localhost:4400`.
|
|
72
|
+
|
|
73
|
+
Your app loads inside an iframe — no proxy, no middleware.
|
|
72
74
|
|
|
73
75
|
### CLI options
|
|
74
76
|
|
|
@@ -77,28 +79,33 @@ The editor opens at `http://localhost:4400`. Your app loads inside an iframe —
|
|
|
77
79
|
| `--port` | `3000` | Port your dev server runs on |
|
|
78
80
|
| `--tool-port` | `4400` | Port for the editor UI |
|
|
79
81
|
|
|
82
|
+
Both ports auto-increment if the default is busy.
|
|
83
|
+
|
|
80
84
|
## How it works
|
|
81
85
|
|
|
82
86
|
1. Click an element in the iframe to select it
|
|
83
|
-
2. The editor panel shows its computed styles and
|
|
84
|
-
3. Edit values — changes are written directly to your source files
|
|
87
|
+
2. The editor panel shows its computed styles, Tailwind classes, and source location
|
|
88
|
+
3. Edit values — changes are written directly to your source files
|
|
85
89
|
4. Your dev server picks up the file change and hot-reloads
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
For Tailwind projects, changes are written as utility classes (e.g. `text-sm`, `bg-blue-500`). When no matching utility exists, arbitrary value syntax is used (e.g. `text-[14px]`).
|
|
88
92
|
|
|
89
93
|
## What it can edit
|
|
90
94
|
|
|
91
95
|
- **Element styles** — layout, spacing, typography, colors, borders, shadows, opacity
|
|
92
96
|
- **Design tokens** — CSS custom properties in your stylesheets
|
|
93
97
|
- **Component variants** — base classes and variant mappings (works with CVA)
|
|
94
|
-
- **
|
|
98
|
+
- **Shadows** — shadow token definitions in CSS or Tailwind `@theme` blocks
|
|
99
|
+
- **Gradients** — gradient token definitions
|
|
100
|
+
- **Spacing** — spacing scale tokens
|
|
101
|
+
- **Borders** — border radius and border width tokens
|
|
95
102
|
|
|
96
103
|
## Limitations
|
|
97
104
|
|
|
98
105
|
- **Next.js only** — framework detection exists for Remix and Vite but they are untested
|
|
99
|
-
- **Tailwind
|
|
106
|
+
- **Tailwind for class writes** — CSS variable and plain CSS token editing works, but `className` writes produce Tailwind utility classes
|
|
100
107
|
- **Development only** — the plugin and overlays are stripped from production builds
|
|
101
|
-
- **App Router** — the auto-mount targets `app/layout.tsx` (or `src/app/layout.tsx`). Pages Router is not supported
|
|
108
|
+
- **App Router only** — the auto-mount targets `app/layout.tsx` (or `src/app/layout.tsx`). Pages Router is not supported
|
|
102
109
|
|
|
103
110
|
## License
|
|
104
111
|
|