claw-design 1.0.1

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 (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +72 -0
  3. package/dist/cli/commands/start.d.ts +7 -0
  4. package/dist/cli/commands/start.d.ts.map +1 -0
  5. package/dist/cli/commands/start.js +176 -0
  6. package/dist/cli/commands/start.js.map +1 -0
  7. package/dist/cli/index.d.ts +3 -0
  8. package/dist/cli/index.d.ts.map +1 -0
  9. package/dist/cli/index.js +20 -0
  10. package/dist/cli/index.js.map +1 -0
  11. package/dist/cli/utils/claude.d.ts +21 -0
  12. package/dist/cli/utils/claude.d.ts.map +1 -0
  13. package/dist/cli/utils/claude.js +42 -0
  14. package/dist/cli/utils/claude.js.map +1 -0
  15. package/dist/cli/utils/dev-server.d.ts +14 -0
  16. package/dist/cli/utils/dev-server.d.ts.map +1 -0
  17. package/dist/cli/utils/dev-server.js +57 -0
  18. package/dist/cli/utils/dev-server.js.map +1 -0
  19. package/dist/cli/utils/electron.d.ts +7 -0
  20. package/dist/cli/utils/electron.d.ts.map +1 -0
  21. package/dist/cli/utils/electron.js +36 -0
  22. package/dist/cli/utils/electron.js.map +1 -0
  23. package/dist/cli/utils/output.d.ts +6 -0
  24. package/dist/cli/utils/output.d.ts.map +1 -0
  25. package/dist/cli/utils/output.js +21 -0
  26. package/dist/cli/utils/output.js.map +1 -0
  27. package/dist/cli/utils/port-detect.d.ts +30 -0
  28. package/dist/cli/utils/port-detect.d.ts.map +1 -0
  29. package/dist/cli/utils/port-detect.js +95 -0
  30. package/dist/cli/utils/port-detect.js.map +1 -0
  31. package/dist/cli/utils/preflight.d.ts +20 -0
  32. package/dist/cli/utils/preflight.d.ts.map +1 -0
  33. package/dist/cli/utils/preflight.js +33 -0
  34. package/dist/cli/utils/preflight.js.map +1 -0
  35. package/dist/cli/utils/process.d.ts +23 -0
  36. package/dist/cli/utils/process.d.ts.map +1 -0
  37. package/dist/cli/utils/process.js +57 -0
  38. package/dist/cli/utils/process.js.map +1 -0
  39. package/out/main/index.js +1123 -0
  40. package/out/preload/overlay.cjs +56 -0
  41. package/out/preload/sidebar.cjs +29 -0
  42. package/out/renderer/assets/overlay-Bsx1u_qg.css +449 -0
  43. package/out/renderer/assets/overlay-DZl3I3jq.js +689 -0
  44. package/out/renderer/assets/sidebar-Bt34gvPU.js +563 -0
  45. package/out/renderer/assets/sidebar-BxEPS84k.css +515 -0
  46. package/out/renderer/assets/toast-CLlgwMU_.js +110 -0
  47. package/out/renderer/overlay.html +131 -0
  48. package/out/renderer/sidebar.html +64 -0
  49. package/package.json +67 -0
  50. package/resources/icon.icns +0 -0
  51. package/resources/icon.png +0 -0
  52. package/scripts/postinstall.cjs +56 -0
@@ -0,0 +1,131 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'self' 'unsafe-inline'">
6
+ <title>claw-design overlay</title>
7
+ <script type="module" crossorigin src="./assets/overlay-DZl3I3jq.js"></script>
8
+ <link rel="stylesheet" crossorigin href="./assets/overlay-Bsx1u_qg.css">
9
+ </head>
10
+ <body>
11
+ <!-- Selection rectangle (positioned absolutely by JS) -->
12
+ <div id="claw-selection-rect" class="claw-selection-rect" hidden></div>
13
+
14
+ <!-- Element hover highlight (positioned absolutely by JS) -->
15
+ <div id="claw-element-highlight" class="claw-element-highlight" hidden></div>
16
+
17
+ <!-- Instruction input bar (appears after selection committed) — per D-08, D-09 -->
18
+ <div id="claw-input-bar" class="claw-input-bar" hidden>
19
+ <div class="claw-input-bar__inner">
20
+ <textarea
21
+ id="claw-input-textarea"
22
+ class="claw-input-bar__textarea"
23
+ placeholder="Describe the change you want..."
24
+ aria-label="Change instruction"
25
+ rows="1"
26
+ ></textarea>
27
+ <button
28
+ id="claw-input-submit"
29
+ class="claw-input-bar__submit"
30
+ aria-label="Send instruction"
31
+ disabled
32
+ >
33
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
34
+ <path d="M3 10L17 10M17 10L11 4M17 10L11 16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
35
+ </svg>
36
+ </button>
37
+ </div>
38
+ <div class="claw-input-bar__footer">
39
+ <select id="claw-model-select" class="claw-input-bar__model" aria-label="Claude model">
40
+ <option value="claude-sonnet-4-6">Sonnet</option>
41
+ <option value="claude-opus-4-6">Opus</option>
42
+ <option value="claude-haiku-4-5-20251001">Haiku</option>
43
+ </select>
44
+ <span class="claw-input-bar__hint">Enter to submit &middot; Paste images</span>
45
+ </div>
46
+ </div>
47
+
48
+ <!-- Toast notification container (D-08, D-09, D-10) -->
49
+ <div id="claw-toast-container" class="claw-toast-container" aria-live="polite"></div>
50
+
51
+ <div id="claw-toolbar" class="claw-toolbar">
52
+ <!-- Drag handle (non-interactive indicator) -->
53
+ <div class="claw-toolbar-handle" aria-hidden="true">
54
+ <svg width="18" height="18" viewBox="0 0 18 18" fill="none">
55
+ <circle cx="5" cy="5" r="1.5" fill="currentColor"/>
56
+ <circle cx="9" cy="5" r="1.5" fill="currentColor"/>
57
+ <circle cx="13" cy="5" r="1.5" fill="currentColor"/>
58
+ <circle cx="5" cy="9" r="1.5" fill="currentColor"/>
59
+ <circle cx="9" cy="9" r="1.5" fill="currentColor"/>
60
+ <circle cx="13" cy="9" r="1.5" fill="currentColor"/>
61
+ <circle cx="5" cy="13" r="1.5" fill="currentColor"/>
62
+ <circle cx="9" cy="13" r="1.5" fill="currentColor"/>
63
+ <circle cx="13" cy="13" r="1.5" fill="currentColor"/>
64
+ </svg>
65
+ </div>
66
+
67
+ <!-- Rectangle selection mode trigger -->
68
+ <button id="claw-select-btn" class="claw-toolbar-btn" aria-label="Select region" data-tooltip="Region select">
69
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
70
+ <!-- Dotted selection rectangle -->
71
+ <rect x="2" y="6" width="12" height="12" rx="1" stroke="currentColor" stroke-width="1.5" stroke-dasharray="2 2" fill="none"/>
72
+ <!-- Cursor arrow -->
73
+ <path d="M11 2L11 11.5L13.8 9L16.5 14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
74
+ <path d="M11 2L11 11.5L13.8 9" fill="currentColor"/>
75
+ </svg>
76
+ </button>
77
+
78
+ <!-- Element select mode trigger (per D-02) -->
79
+ <button id="claw-elem-btn" class="claw-toolbar-btn" aria-label="Select element" data-tooltip="Element select">
80
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
81
+ <!-- Pointer cursor with element bounding box (browser inspector icon style) -->
82
+ <rect x="6" y="6" width="12" height="12" rx="1.5" stroke="currentColor" stroke-width="1.5" fill="none"/>
83
+ <path d="M2 2L2 10L4.5 7.5L7 12L8.5 11.2L6 6.5L9 6.5Z" fill="currentColor"/>
84
+ </svg>
85
+ </button>
86
+
87
+ <!-- Viewport divider (D-01) -->
88
+ <div class="claw-toolbar-divider" aria-hidden="true"></div>
89
+
90
+ <!-- Viewport toggle: single button that expands to show preset options -->
91
+ <button id="claw-viewport-toggle-btn" class="claw-toolbar-btn" aria-label="Viewport presets" data-tooltip="Viewports">
92
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
93
+ <rect x="2" y="4" width="16" height="10" rx="1.5" stroke="currentColor" stroke-width="1.5" fill="none"/>
94
+ <path d="M7 16H13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
95
+ <path d="M10 14V16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
96
+ </svg>
97
+ </button>
98
+
99
+ <!-- Collapsible viewport preset buttons (hidden by default) -->
100
+ <div id="claw-viewport-group" class="claw-viewport-group">
101
+ <button id="claw-viewport-desktop-btn" class="claw-toolbar-btn claw-toolbar-btn--active" aria-label="Desktop viewport" data-viewport="desktop" data-tooltip="Desktop (1280 x 800)">
102
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
103
+ <rect x="2" y="4" width="16" height="10" rx="1.5" stroke="currentColor" stroke-width="1.5" fill="none"/>
104
+ <path d="M7 16H13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
105
+ <path d="M10 14V16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
106
+ </svg>
107
+ </button>
108
+ <button id="claw-viewport-tablet-btn" class="claw-toolbar-btn" aria-label="Tablet viewport" data-viewport="tablet" data-tooltip="Tablet (768 x 1024)">
109
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
110
+ <rect x="4" y="2" width="12" height="16" rx="2" stroke="currentColor" stroke-width="1.5" fill="none"/>
111
+ <circle cx="10" cy="16" r="0.75" fill="currentColor"/>
112
+ </svg>
113
+ </button>
114
+ <button id="claw-viewport-mobile-btn" class="claw-toolbar-btn" aria-label="Mobile viewport" data-viewport="mobile" data-tooltip="Mobile (375 x 812)">
115
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
116
+ <rect x="5" y="2" width="10" height="16" rx="2" stroke="currentColor" stroke-width="1.5" fill="none"/>
117
+ <path d="M8.5 16H11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
118
+ </svg>
119
+ </button>
120
+ </div>
121
+ </div>
122
+ <!-- Tooltip element (D-22) -->
123
+ <div id="claw-tooltip" class="claw-tooltip" role="tooltip" hidden></div>
124
+
125
+ <!-- Loading indicator: visible until site finishes loading -->
126
+ <div id="claw-loading" class="claw-loading">
127
+ <div class="claw-loading__spinner" aria-label="Loading site"></div>
128
+ </div>
129
+
130
+ </body>
131
+ </html>
@@ -0,0 +1,64 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self'">
7
+ <title>Sidebar</title>
8
+ <script type="module" crossorigin src="./assets/sidebar-Bt34gvPU.js"></script>
9
+ <link rel="stylesheet" crossorigin href="./assets/sidebar-BxEPS84k.css">
10
+ </head>
11
+ <body>
12
+ <!-- Minimized state: icon + badge -->
13
+ <div id="sidebar-minimized" class="sidebar-minimized" style="display:none;">
14
+ <div id="sidebar-drag-handle" class="sidebar-drag-handle" aria-hidden="true">
15
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
16
+ <circle cx="4" cy="4" r="1.2" fill="currentColor"/>
17
+ <circle cx="10" cy="4" r="1.2" fill="currentColor"/>
18
+ <circle cx="4" cy="7" r="1.2" fill="currentColor"/>
19
+ <circle cx="10" cy="7" r="1.2" fill="currentColor"/>
20
+ <circle cx="4" cy="10" r="1.2" fill="currentColor"/>
21
+ <circle cx="10" cy="10" r="1.2" fill="currentColor"/>
22
+ </svg>
23
+ </div>
24
+ <button id="sidebar-expand-btn" class="sidebar-expand-btn" aria-label="Show task sidebar">
25
+ <!-- Inline SVG: sidebar panel icon, 16x16 -->
26
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
27
+ <rect x="1.5" y="2.5" width="13" height="11" rx="2" stroke="currentColor" stroke-width="1.5" fill="none"/>
28
+ <line x1="6" y1="2.5" x2="6" y2="13.5" stroke="currentColor" stroke-width="1.5"/>
29
+ </svg>
30
+ </button>
31
+ <div id="sidebar-badge" class="sidebar-badge" style="display:none;">
32
+ <span id="sidebar-badge-text">0/0</span>
33
+ </div>
34
+ </div>
35
+
36
+ <!-- Expanded state: full panel -->
37
+ <div id="sidebar-expanded" class="sidebar-expanded" style="display:none;">
38
+ <div class="sidebar-header">
39
+ <div id="sidebar-expanded-drag-handle" class="sidebar-drag-handle" aria-hidden="true">
40
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
41
+ <circle cx="4" cy="4" r="1.2" fill="currentColor"/>
42
+ <circle cx="10" cy="4" r="1.2" fill="currentColor"/>
43
+ <circle cx="4" cy="7" r="1.2" fill="currentColor"/>
44
+ <circle cx="10" cy="7" r="1.2" fill="currentColor"/>
45
+ <circle cx="4" cy="10" r="1.2" fill="currentColor"/>
46
+ <circle cx="10" cy="10" r="1.2" fill="currentColor"/>
47
+ </svg>
48
+ </div>
49
+ <span class="sidebar-header-label">Tasks</span>
50
+ <button id="sidebar-clear-btn" class="sidebar-clear-btn" aria-label="Clear finished tasks" title="Clear finished tasks">Clear</button>
51
+ <button id="sidebar-minimize-btn" class="sidebar-minimize-btn" aria-label="Minimize task sidebar">
52
+ <!-- Inline SVG: chevron pointing right, 14x14 -->
53
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
54
+ <path d="M5 3L9 7L5 11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
55
+ </svg>
56
+ </button>
57
+ </div>
58
+ <div id="sidebar-task-list" class="sidebar-task-list" aria-live="polite">
59
+ <!-- Task rows rendered dynamically by sidebar.ts -->
60
+ </div>
61
+ </div>
62
+
63
+ </body>
64
+ </html>
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "claw-design",
3
+ "productName": "Claw Design",
4
+ "version": "1.0.1",
5
+ "description": "Point at your running website, describe changes in plain English, and watch Claude Code edit the source live",
6
+ "type": "module",
7
+ "main": "./dist/main/index.js",
8
+ "bin": {
9
+ "clawdesign": "./dist/cli/index.js"
10
+ },
11
+ "scripts": {
12
+ "build": "tsc -p tsconfig.cli.json && electron-vite build",
13
+ "build:cli": "tsc -p tsconfig.cli.json",
14
+ "build:electron": "electron-vite build",
15
+ "dev": "electron-vite dev",
16
+ "test": "vitest run",
17
+ "typecheck": "tsc --noEmit",
18
+ "prepublishOnly": "npm run build",
19
+ "postinstall": "node scripts/postinstall.cjs"
20
+ },
21
+ "files": [
22
+ "dist/",
23
+ "out/",
24
+ "resources/",
25
+ "scripts/",
26
+ "LICENSE"
27
+ ],
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/prodoxx/claw-design"
31
+ },
32
+ "keywords": [
33
+ "visual-development",
34
+ "web-development",
35
+ "electron",
36
+ "claude-code",
37
+ "developer-tools",
38
+ "ai-coding",
39
+ "design-to-code"
40
+ ],
41
+ "homepage": "https://github.com/prodoxx/claw-design",
42
+ "author": {
43
+ "name": "prodoxx",
44
+ "url": "https://github.com/prodoxx"
45
+ },
46
+ "engines": {
47
+ "node": ">=20.0.0"
48
+ },
49
+ "dependencies": {
50
+ "@anthropic-ai/claude-agent-sdk": "^0.2.0",
51
+ "commander": "^14.0.0",
52
+ "electron": "^36.0.0",
53
+ "ora": "^9.0.0",
54
+ "picocolors": "^1.1.0",
55
+ "tree-kill": "^1.2.2"
56
+ },
57
+ "devDependencies": {
58
+ "@types/node": "^22.0.0",
59
+ "electron-vite": "^5.0.0",
60
+ "happy-dom": "^20.8.9",
61
+ "jsdom": "^29.0.1",
62
+ "tsx": "^4.21.0",
63
+ "typescript": "~5.7",
64
+ "vitest": "^4.0.0"
65
+ },
66
+ "license": "MIT"
67
+ }
Binary file
Binary file
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Patch Electron.app on macOS so the menu bar, dock tooltip, about dialog,
3
+ * and dock icon all show "Claw Design" instead of "Electron".
4
+ *
5
+ * This modifies files inside node_modules/electron/dist/Electron.app:
6
+ * - Info.plist: CFBundleName and CFBundleDisplayName
7
+ * - Resources/electron.icns: replaced with our custom icon
8
+ *
9
+ * Re-applies on every `npm install` since node_modules is ephemeral.
10
+ */
11
+ 'use strict';
12
+
13
+ if (process.platform !== 'darwin') process.exit(0);
14
+
15
+ const fs = require('fs');
16
+ const path = require('path');
17
+ const { execFileSync } = require('child_process');
18
+
19
+ const electronAppDir = path.join(
20
+ __dirname,
21
+ '..',
22
+ 'node_modules',
23
+ 'electron',
24
+ 'dist',
25
+ 'Electron.app',
26
+ 'Contents',
27
+ );
28
+
29
+ const plistPath = path.join(electronAppDir, 'Info.plist');
30
+
31
+ if (!fs.existsSync(plistPath)) {
32
+ // Electron not yet downloaded (e.g. CI with --ignore-scripts on electron)
33
+ process.exit(0);
34
+ }
35
+
36
+ // 1. Patch bundle name in Info.plist
37
+ const plistBuddy = '/usr/libexec/PlistBuddy';
38
+
39
+ try {
40
+ execFileSync(plistBuddy, ['-c', 'Set :CFBundleName Claw Design', plistPath]);
41
+ execFileSync(plistBuddy, ['-c', 'Set :CFBundleDisplayName Claw Design', plistPath]);
42
+ } catch {
43
+ // Non-fatal -- menu bar will show "Electron" but everything else works
44
+ }
45
+
46
+ // 2. Replace Electron icon with Claw Design icon
47
+ const customIcon = path.join(__dirname, '..', 'resources', 'icon.icns');
48
+ const electronIcon = path.join(electronAppDir, 'Resources', 'electron.icns');
49
+
50
+ try {
51
+ if (fs.existsSync(customIcon) && fs.existsSync(electronIcon)) {
52
+ fs.copyFileSync(customIcon, electronIcon);
53
+ }
54
+ } catch {
55
+ // Non-fatal -- about dialog and dock will show Electron atom icon
56
+ }