@promakeai/inspector 1.1.0 → 1.1.2

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,240 +1,232 @@
1
- # @promakeai/inspector
2
-
3
- Visual element inspector React component with AI prompt support.
4
-
5
- ## Features
6
-
7
- - 🎯 Visual element selection
8
- - ✏️ Text editing
9
- - 🖼️ Image URL editing
10
- - 🎨 Style editing (colors, spacing, typography, display, borders)
11
- - 🔍 Element stack navigation (select overlapping elements)
12
- - 🌐 i18n support via labels
13
- - 🎨 Customizable theme
14
- - 📱 Responsive design
15
- - ⚡ **React version independent** - Works with React 18, 19, and any future versions
16
- - 🎨 **No external UI dependencies** - All components built in-house for maximum compatibility
17
-
18
- ## Installation
19
-
20
- ```bash
21
- npm install @promakeai/inspector
22
- # or
23
- yarn add @promakeai/inspector
24
- # or
25
- pnpm add @promakeai/inspector
26
- # or
27
- bun add @promakeai/inspector
28
- ```
29
-
30
- ## Peer Dependencies
31
-
32
- Only React is required:
33
-
34
- ```json
35
- {
36
- "react": ">=18.0.0"
37
- }
38
- ```
39
-
40
- **That's it!** No need for:
41
-
42
- - ❌ React version matching
43
- - ❌ Dependency deduplication
44
- - ❌ Version resolution conflicts
45
- - ❌ Additional UI library installations
46
-
47
- ## Usage
48
-
49
- ### 1. Add Vite Plugin (Optional - for component tracking)
50
-
51
- ```typescript
52
- // vite.config.ts
53
- import { defineConfig } from "vite";
54
- import react from "@vitejs/plugin-react";
55
- import { inspectorDebugger } from "@promakeai/inspector/plugin";
56
-
57
- export default defineConfig({
58
- plugins: [
59
- inspectorDebugger({ enabled: true }), // Must be BEFORE react() plugin
60
- react(),
61
- ],
62
- });
63
- ```
64
-
65
- **⚠️ Important:** `inspectorDebugger` must be placed **before** the `react()` plugin to properly track components.
66
-
67
- **Note:** The Vite plugin is optional but recommended for better component tracking.
68
-
69
- ### 2. Use Inspector Component
70
-
71
- ```tsx
72
- import { Inspector } from "@promakeai/inspector";
73
- import "@promakeai/inspector/style.css";
74
-
75
- function App() {
76
- return (
77
- <>
78
- <YourApp />
79
- <Inspector />
80
- </>
81
- );
82
- }
83
- ```
84
-
85
- The Inspector will inspect the current page and allow you to edit elements visually.
86
-
87
- **Customization (Optional):**
88
-
89
- You can customize labels and theme via the inspector store or by listening to inspector events. See the Hook API section below for programmatic control.
90
-
91
- ### 3. Programmatic Control (Advanced)
92
-
93
- Access the inspector store for programmatic control:
94
-
95
- ```tsx
96
- import { Inspector } from "@promakeai/inspector";
97
- import { useInspectorStore } from "@promakeai/inspector";
98
-
99
- function App() {
100
- const { setTheme, setLabels } = useInspectorStore();
101
-
102
- useEffect(() => {
103
- // Customize theme
104
- setTheme({
105
- primaryColor: "rgb(58, 18, 189)",
106
- backgroundColor: "#ffffff",
107
- textColor: "#000000",
108
- });
109
-
110
- // Customize labels
111
- setLabels({
112
- editText: "Edit Text",
113
- editImage: "Edit Image",
114
- editStyle: "Edit Style",
115
- });
116
- }, []);
117
-
118
- return (
119
- <>
120
- <YourApp />
121
- <Inspector />
122
- </>
123
- );
124
- }
125
- ```
126
-
127
- ## Configuration
128
-
129
- ### Inspector Store
130
-
131
- The Inspector component uses Zustand for state management. All configuration is done through the store:
132
-
133
- ```tsx
134
- import { useInspectorStore } from "@promakeai/inspector";
135
-
136
- const { theme, labels, setTheme, setLabels } = useInspectorStore();
137
- ```
138
-
139
- **Note:** The `<Inspector />` component accepts no props. All customization is done via the store.
140
-
141
- ### Theme Options
142
-
143
- ```typescript
144
- interface InspectorTheme {
145
- primaryColor?: string;
146
- backgroundColor?: string;
147
- textColor?: string;
148
- borderColor?: string;
149
- buttonColor?: string;
150
- buttonTextColor?: string;
151
- inputBackgroundColor?: string;
152
- // ... and more
153
- }
154
- ```
155
-
156
- ### Label Options
157
-
158
- All UI text can be customized via the `labels` prop. See TypeScript types for complete list.
159
-
160
- ## Browser Support
161
-
162
- - Chrome/Edge 90+
163
- - Firefox 88+
164
- - Safari 14+
165
-
166
- ## Troubleshooting
167
-
168
- ### Styles not working?
169
-
170
- Make sure to import the CSS:
171
-
172
- ```tsx
173
- import "@promakeai/inspector/style.css";
174
- ```
175
-
176
- ### Inspector not appearing?
177
-
178
- 1. Check that the inspector root element is rendered
179
- 2. Open browser console for any errors
180
- 3. Clear Vite cache: `rm -rf node_modules/.vite`
181
-
182
- ### Elements not selectable?
183
-
184
- 1. Make sure elements don't have `pointer-events: none`
185
- 2. Check z-index conflicts with your app (inspector uses z-index 2147483640+)
186
- 3. Verify elements are not inside shadow DOM
187
-
188
- ## React Version Compatibility
189
-
190
- This package is built with **zero external UI dependencies**, making it compatible with:
191
-
192
- - ✅ React 18.x
193
- - ✅ React 19.x
194
- - ✅ React 19 Canary
195
- - ✅ Future React versions
196
-
197
- **No version conflicts, ever!** All UI components are custom-built pure React components.
198
-
199
- ## Migration from v1.0.6
200
-
201
- If you're upgrading from v1.0.6 or earlier:
202
-
203
- 1. **Remove old Vite config workarounds:**
204
-
205
- ```diff
206
- - resolve: {
207
- - dedupe: ["react", "react-dom"],
208
- - },
209
- - optimizeDeps: {
210
- - exclude: ["@promakeai/inspector"],
211
- - needsInterop: [],
212
- - },
213
- ```
214
-
215
- 2. **That's it!** The package now works out of the box with any React version.
216
-
217
- ## License
218
-
219
- MIT
220
-
221
- ## Contributing
222
-
223
- Issues and PRs welcome at [GitHub repository URL]
224
-
225
- ## Changelog
226
-
227
- ### v1.0.8
228
-
229
- - ✨ Removed all Radix UI dependencies
230
- - ✨ Built custom Select and ColorPicker components
231
- - ✨ React version independent (18+)
232
- - Fixed dropdown positioning issues
233
- - ✨ Improved Select label display
234
- - ✨ Smaller bundle size
235
- - 🐛 Fixed ControlBox overflow issues
236
- - 🐛 Fixed color picker positioning
237
-
238
- ### v1.0.7
239
-
240
- - Previous version with Radix UI dependencies
1
+ # @promakeai/inspector
2
+
3
+ Visual element inspector React component with AI prompt support.
4
+
5
+ ## Features
6
+
7
+ - 🎯 Visual element selection
8
+ - ✏️ Text editing
9
+ - 🖼️ Image URL editing
10
+ - 🎨 Style editing (colors, spacing, typography, display, borders)
11
+ - 🔍 Element stack navigation (select overlapping elements)
12
+ - 🌐 i18n support via labels
13
+ - 🎨 Customizable theme
14
+ - 📱 Responsive design
15
+ - ⚡ **React version independent** - Works with React 18, 19, and any future versions
16
+ - 🎨 **No external UI dependencies** - All components built in-house for maximum compatibility
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ npm install @promakeai/inspector
22
+ # or
23
+ yarn add @promakeai/inspector
24
+ # or
25
+ pnpm add @promakeai/inspector
26
+ # or
27
+ bun add @promakeai/inspector
28
+ ```
29
+
30
+ ## Peer Dependencies
31
+
32
+ Only React is required:
33
+
34
+ ```json
35
+ {
36
+ "react": ">=18.0.0"
37
+ }
38
+ ```
39
+
40
+ **That's it!** No need for:
41
+
42
+ - ❌ React version matching
43
+ - ❌ Dependency deduplication
44
+ - ❌ Version resolution conflicts
45
+ - ❌ Additional UI library installations
46
+
47
+ ## Usage
48
+
49
+ ### 1. Add Vite Plugin (Optional - for component tracking)
50
+
51
+ ```typescript
52
+ // vite.config.ts
53
+ import { defineConfig } from "vite";
54
+ import react from "@vitejs/plugin-react";
55
+ import { inspectorDebugger } from "@promakeai/inspector/plugin";
56
+
57
+ export default defineConfig({
58
+ plugins: [
59
+ inspectorDebugger({ enabled: true }), // Must be BEFORE react() plugin
60
+ react(),
61
+ ],
62
+ });
63
+ ```
64
+
65
+ **⚠️ Important:** `inspectorDebugger` must be placed **before** the `react()` plugin to properly track components.
66
+
67
+ **Note:** The Vite plugin is optional but recommended for better component tracking.
68
+
69
+ ### 2. Use Inspector Component
70
+
71
+ ```tsx
72
+ import { Inspector } from "@promakeai/inspector";
73
+ import "@promakeai/inspector/style.css";
74
+
75
+ function App() {
76
+ return (
77
+ <>
78
+ <YourApp />
79
+ <Inspector />
80
+ </>
81
+ );
82
+ }
83
+ ```
84
+
85
+ The Inspector will inspect the current page and allow you to edit elements visually.
86
+
87
+ **Customization (Optional):**
88
+
89
+ You can customize labels and theme via the inspector store or by listening to inspector events. See the Hook API section below for programmatic control.
90
+
91
+ ### 3. Programmatic Control (Advanced)
92
+
93
+ Access the inspector store for programmatic control:
94
+
95
+ ```tsx
96
+ import { Inspector } from "@promakeai/inspector";
97
+ import { useInspectorStore } from "@promakeai/inspector";
98
+
99
+ function App() {
100
+ const { setTheme, setLabels } = useInspectorStore();
101
+
102
+ useEffect(() => {
103
+ // Customize theme
104
+ setTheme({
105
+ primaryColor: "rgb(58, 18, 189)",
106
+ backgroundColor: "#ffffff",
107
+ textColor: "#000000",
108
+ });
109
+
110
+ // Customize labels
111
+ setLabels({
112
+ editText: "Edit Text",
113
+ editImage: "Edit Image",
114
+ editStyle: "Edit Style",
115
+ });
116
+ }, []);
117
+
118
+ return (
119
+ <>
120
+ <YourApp />
121
+ <Inspector />
122
+ </>
123
+ );
124
+ }
125
+ ```
126
+
127
+ ## Configuration
128
+
129
+ ### Inspector Store
130
+
131
+ The Inspector component uses Zustand for state management. All configuration is done through the store:
132
+
133
+ ```tsx
134
+ import { useInspectorStore } from "@promakeai/inspector";
135
+
136
+ const { theme, labels, setTheme, setLabels } = useInspectorStore();
137
+ ```
138
+
139
+ **Note:** The `<Inspector />` component accepts no props. All customization is done via the store.
140
+
141
+ ### Theme Options
142
+
143
+ ```typescript
144
+ interface InspectorTheme {
145
+ primaryColor?: string;
146
+ backgroundColor?: string;
147
+ textColor?: string;
148
+ borderColor?: string;
149
+ buttonColor?: string;
150
+ buttonTextColor?: string;
151
+ inputBackgroundColor?: string;
152
+ // ... and more
153
+ }
154
+ ```
155
+
156
+ ### Label Options
157
+
158
+ All UI text can be customized via the `labels` prop. See TypeScript types for complete list.
159
+
160
+ ## Browser Support
161
+
162
+ - Chrome/Edge 90+
163
+ - Firefox 88+
164
+ - Safari 14+
165
+
166
+ ## Troubleshooting
167
+
168
+ ### Styles not working?
169
+
170
+ Make sure to import the CSS:
171
+
172
+ ```tsx
173
+ import "@promakeai/inspector/style.css";
174
+ ```
175
+
176
+ ### Inspector not appearing?
177
+
178
+ 1. Check that the inspector root element is rendered
179
+ 2. Open browser console for any errors
180
+ 3. Clear Vite cache: `rm -rf node_modules/.vite`
181
+
182
+ ### Elements not selectable?
183
+
184
+ 1. Make sure elements don't have `pointer-events: none`
185
+ 2. Check z-index conflicts with your app (inspector uses z-index 2147483640+)
186
+ 3. Verify elements are not inside shadow DOM
187
+
188
+ ## React Version Compatibility
189
+
190
+ This package is built with **zero external UI dependencies**, making it compatible with:
191
+
192
+ - ✅ React 18.x
193
+ - ✅ React 19.x
194
+ - ✅ React 19 Canary
195
+ - ✅ Future React versions
196
+
197
+ **No version conflicts, ever!** All UI components are custom-built pure React components.
198
+
199
+ ## Migration from v1.0.6
200
+
201
+ If you're upgrading from v1.0.6 or earlier:
202
+
203
+ 1. **Remove old Vite config workarounds:**
204
+
205
+ ```diff
206
+ - resolve: {
207
+ - dedupe: ["react", "react-dom"],
208
+ - },
209
+ - optimizeDeps: {
210
+ - exclude: ["@promakeai/inspector"],
211
+ - needsInterop: [],
212
+ - },
213
+ ```
214
+
215
+ 2. **That's it!** The package now works out of the box with any React version.
216
+
217
+ ## Changelog
218
+
219
+ ### v1.1.0
220
+
221
+ - ✨ Removed all Radix UI dependencies
222
+ - ✨ Built custom Select and ColorPicker components
223
+ - React version independent (18+)
224
+ - ✨ Fixed dropdown positioning issues
225
+ - ✨ Improved Select label display
226
+ - ✨ Smaller bundle size
227
+ - 🐛 Fixed ControlBox overflow issues
228
+ - 🐛 Fixed color picker positioning
229
+
230
+ ### v1.0.7
231
+
232
+ - Previous version with Radix UI dependencies
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ControlBox/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAKtE,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,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AG,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9D,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AA6BD,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,OAAO,EACP,WAAW,EACX,SAAS,EACT,aAAa,EACb,WAAW,EACX,OAAO,EACP,cAAc,EACd,YAAiB,EACjB,eAAe,EACf,MAAM,EAAE,YAAY,GACrB,EAAE,eAAe,2CA+UjB"}