claude-dev-server 1.1.4 → 1.2.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.
@@ -0,0 +1,47 @@
1
+ // Inspect bridge script - injected into dev server iframe
2
+ // This script enables element inspection in the left iframe and communicates with the parent window
3
+
4
+ (function() {
5
+ window.addEventListener('message', function(e) {
6
+ if (e.data.type === 'enableInspect') {
7
+ window.__CLAUDE_INSPECT__ = true;
8
+ document.body.style.cursor = 'crosshair';
9
+ } else if (e.data.type === 'disableInspect') {
10
+ window.__CLAUDE_INSPECT__ = false;
11
+ document.body.style.cursor = '';
12
+ }
13
+ });
14
+
15
+ document.addEventListener('click', function(e) {
16
+ if (window.__CLAUDE_INSPECT__) {
17
+ e.preventDefault();
18
+ e.stopPropagation();
19
+ const el = e.target;
20
+ // Send element info to parent
21
+ window.parent.postMessage({
22
+ type: 'inspectElement',
23
+ element: {
24
+ tagName: el.tagName,
25
+ id: el.id,
26
+ className: el.className,
27
+ // Try to get React fiber
28
+ reactFiber: el.__reactFiber__ || el.__reactInternalInstance__
29
+ }
30
+ }, '*');
31
+ }
32
+ }, true);
33
+
34
+ document.addEventListener('mousemove', function(e) {
35
+ if (window.__CLAUDE_INSPECT__) {
36
+ window.parent.postMessage({
37
+ type: 'highlightElement',
38
+ rect: e.target.getBoundingClientRect(),
39
+ element: {
40
+ tagName: e.target.tagName,
41
+ id: e.target.id,
42
+ className: e.target.className
43
+ }
44
+ }, '*');
45
+ }
46
+ }, true);
47
+ })();