@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.
Files changed (72) hide show
  1. package/README.md +22 -15
  2. package/dist/cli.js +217 -109
  3. package/dist/client/assets/index--eM7ukq5.js +284 -0
  4. package/dist/client/assets/index-1q-WwsbN.css +1 -0
  5. package/dist/client/assets/index-A_L26x1h.js +164 -0
  6. package/dist/client/assets/index-B6jN1q8m.js +221 -0
  7. package/dist/client/assets/index-B7jQZQIh.js +164 -0
  8. package/dist/client/assets/index-BCq28ejx.js +274 -0
  9. package/dist/client/assets/index-BSe1-ayg.js +221 -0
  10. package/dist/client/assets/index-BoqOSsiL.js +164 -0
  11. package/dist/client/assets/index-BrTweOBw.css +1 -0
  12. package/dist/client/assets/index-BvlvZBFo.js +164 -0
  13. package/dist/client/assets/index-C0W09LqU.js +274 -0
  14. package/dist/client/assets/index-C8zdCN9Y.css +1 -0
  15. package/dist/client/assets/index-CNoLX-EE.css +1 -0
  16. package/dist/client/assets/index-CT_MpeRK.css +1 -0
  17. package/dist/client/assets/index-Caw3C8nD.js +164 -0
  18. package/dist/client/assets/index-CiJuTDXP.css +1 -0
  19. package/dist/client/assets/index-D1sfJ6Vs.js +274 -0
  20. package/dist/client/assets/index-D4qADRtt.js +221 -0
  21. package/dist/client/assets/index-DLNdLnNZ.css +1 -0
  22. package/dist/client/assets/index-DOOYG-7t.js +221 -0
  23. package/dist/client/assets/index-DOo00IKO.js +164 -0
  24. package/dist/client/assets/index-DT_WVyln.js +274 -0
  25. package/dist/client/assets/index-Dd5ywdn8.css +1 -0
  26. package/dist/client/assets/index-DevUtWzq.js +274 -0
  27. package/dist/client/assets/index-DnmW8VmS.js +274 -0
  28. package/dist/client/assets/index-Ndu6k3-t.css +1 -0
  29. package/dist/client/assets/index-WBV2EURP.js +284 -0
  30. package/dist/client/assets/index-lOuYsLDH.css +1 -0
  31. package/dist/client/assets/index-nMHvJQPa.css +1 -0
  32. package/dist/client/assets/index-s0F6GbJf.js +164 -0
  33. package/dist/client/assets/index-xf9QDxu1.css +1 -0
  34. package/dist/client/index.html +2 -2
  35. package/package.json +4 -1
  36. package/dist/client/assets/index-B5g8qgFW.css +0 -1
  37. package/dist/client/assets/index-BB9cuIlF.js +0 -111
  38. package/dist/client/assets/index-BH-ji2K7.js +0 -150
  39. package/dist/client/assets/index-BH4MtIeE.js +0 -150
  40. package/dist/client/assets/index-BIpQhd8p.js +0 -150
  41. package/dist/client/assets/index-BRJOTqhn.js +0 -130
  42. package/dist/client/assets/index-Bb8QmYLf.css +0 -1
  43. package/dist/client/assets/index-Bbi0p5WW.js +0 -150
  44. package/dist/client/assets/index-BdWkGSfZ.js +0 -130
  45. package/dist/client/assets/index-BnRqJ-Bb.js +0 -150
  46. package/dist/client/assets/index-BneJISnX.js +0 -150
  47. package/dist/client/assets/index-C9_QxP1g.css +0 -1
  48. package/dist/client/assets/index-CBjuhHfq.js +0 -150
  49. package/dist/client/assets/index-CEFmdeB7.css +0 -1
  50. package/dist/client/assets/index-CQpCDasO.js +0 -131
  51. package/dist/client/assets/index-CRUCeIYi.css +0 -1
  52. package/dist/client/assets/index-CUSGVUIj.js +0 -150
  53. package/dist/client/assets/index-CZJQ3vJi.js +0 -150
  54. package/dist/client/assets/index-CdshIoQY.css +0 -1
  55. package/dist/client/assets/index-Cne4pc0S.css +0 -1
  56. package/dist/client/assets/index-Cps9lJoI.css +0 -1
  57. package/dist/client/assets/index-Cs7mKzsY.css +0 -1
  58. package/dist/client/assets/index-D-bUCwC3.css +0 -1
  59. package/dist/client/assets/index-D11nArXR.css +0 -1
  60. package/dist/client/assets/index-D2DhQd-K.js +0 -51
  61. package/dist/client/assets/index-D3ju6tgw.css +0 -1
  62. package/dist/client/assets/index-DG2JRz0f.js +0 -150
  63. package/dist/client/assets/index-DO-UYUx0.js +0 -150
  64. package/dist/client/assets/index-DOb58Ii1.js +0 -111
  65. package/dist/client/assets/index-DVd7DS_W.css +0 -1
  66. package/dist/client/assets/index-DZNHUm4M.js +0 -130
  67. package/dist/client/assets/index-Di7zgczR.css +0 -1
  68. package/dist/client/assets/index-DlUCyHdA.css +0 -1
  69. package/dist/client/assets/index-FTflg87d.js +0 -130
  70. package/dist/client/assets/index-U5_kmGxX.js +0 -150
  71. package/dist/client/assets/index-_4EXPfyt.css +0 -1
  72. 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 (only supported framework currently)
8
+ - **Next.js** >= 14 (App Router)
9
9
  - **React** >= 18
10
- - **Tailwind CSS** v3 or v4 (only supported styling system for class writes)
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
- This does two things in development (at compile time only — your source files are not modified):
33
+ In development, this:
34
34
 
35
- - Injects `data-source` attributes into every JSX element at build time, mapping each element to its source file, line, and column. These only exist in the compiled output.
36
- - Auto-mounts the `<CodeSurface />` selection overlay component in your root layout.
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 start CodeSurface from your project root:
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 editor opens at `http://localhost:4400`. Your app loads inside an iframe no proxy, no middleware.
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 Tailwind classes
84
- 3. Edit values — changes are written directly to your source files as Tailwind utility classes
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
- Changes are written as Tailwind classes (e.g. `text-sm`, `bg-blue-500`). When no matching utility exists, arbitrary value syntax is used (e.g. `text-[14px]`).
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
- - **Box shadows** — shadow token definitions in CSS or `@theme` blocks
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 only for class writes** — CSS variable and plain CSS token editing works, but className writes produce Tailwind utility classes
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 for auto-mounting
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