From e340d55f7e421e3005764a23b6afb7e9af37f540 Mon Sep 17 00:00:00 2001 From: sina_sajjadi Date: Tue, 1 Sep 2026 07:26:35 +0330 Subject: [PATCH] feat: initial commit for standalone click-to-component tool --- .babelrc.example | 10 + README.md | 221 ++++++++++++ add-data-locator.cjs | 40 +++ client/dev-click-to-component.tsx | 577 ++++++++++++++++++++++++++++++ package.json | 20 ++ read.md | 221 ++++++++++++ server/route.ts | 67 ++++ 7 files changed, 1156 insertions(+) create mode 100644 .babelrc.example create mode 100644 README.md create mode 100644 add-data-locator.cjs create mode 100644 client/dev-click-to-component.tsx create mode 100644 package.json create mode 100644 read.md create mode 100644 server/route.ts diff --git a/.babelrc.example b/.babelrc.example new file mode 100644 index 0000000..c2e7775 --- /dev/null +++ b/.babelrc.example @@ -0,0 +1,10 @@ +{ + "presets": ["next/babel"], + "env": { + "development": { + "plugins": [ + "./add-data-locator.cjs" + ] + } + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..fdfb2c8 --- /dev/null +++ b/README.md @@ -0,0 +1,221 @@ +# ⚡ Click-to-Component + +A zero-config, high-precision component inspector and **Click-to-Component** developer tool for Next.js and React applications. + +Hover over any UI element on your web page while holding Alt (or Option) to highlight component boundaries in real time, and **click to instantly jump to the exact file, line, and column in your IDE** (Antigravity IDE, VS Code, Cursor, WebStorm, Sublime Text, etc.). + +--- + +## ✨ Features + +- 🎯 **Direct IDE Jump**: Opens your active IDE and focuses the exact file and cursor position (`file.tsx:line:col`). +- 🔍 **Live Hover Highlighting**: Holding Alt outlines the component under your mouse with dynamic bounding box tracking and smooth scroll support. +- 🔀 **Dual Hierarchy Modes**: + - **Outer Component Mode (Alt)**: Selects the outer component or section container. + - **Inner Leaf Mode (Alt + Ctrl / Cmd)**: Drills down directly to the exact innermost child element (e.g. ``, ``). + - **Live Dynamic Toggle**: Press or release Ctrl while hovering to switch between Outer and Inner mode in real time! +- 🏷️ **Smart Component Badge**: Displays the JSX tag name (e.g. `
`, ` + + )} + + ); +} + +export default DevClickToComponent; diff --git a/package.json b/package.json new file mode 100644 index 0000000..fb1f533 --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "click-to-component", + "version": "1.0.0", + "description": "Seamless click-to-component and hover inspector for Next.js & React to open source code directly in your IDE.", + "main": "client/dev-click-to-component.tsx", + "keywords": [ + "click-to-component", + "react", + "nextjs", + "inspector", + "devtools", + "developer-experience", + "ide", + "antigravity", + "vscode", + "cursor" + ], + "author": "", + "license": "MIT" +} diff --git a/read.md b/read.md new file mode 100644 index 0000000..fdfb2c8 --- /dev/null +++ b/read.md @@ -0,0 +1,221 @@ +# ⚡ Click-to-Component + +A zero-config, high-precision component inspector and **Click-to-Component** developer tool for Next.js and React applications. + +Hover over any UI element on your web page while holding Alt (or Option) to highlight component boundaries in real time, and **click to instantly jump to the exact file, line, and column in your IDE** (Antigravity IDE, VS Code, Cursor, WebStorm, Sublime Text, etc.). + +--- + +## ✨ Features + +- 🎯 **Direct IDE Jump**: Opens your active IDE and focuses the exact file and cursor position (`file.tsx:line:col`). +- 🔍 **Live Hover Highlighting**: Holding Alt outlines the component under your mouse with dynamic bounding box tracking and smooth scroll support. +- 🔀 **Dual Hierarchy Modes**: + - **Outer Component Mode (Alt)**: Selects the outer component or section container. + - **Inner Leaf Mode (Alt + Ctrl / Cmd)**: Drills down directly to the exact innermost child element (e.g. ``, ``). + - **Live Dynamic Toggle**: Press or release Ctrl while hovering to switch between Outer and Inner mode in real time! +- 🏷️ **Smart Component Badge**: Displays the JSX tag name (e.g. `
`, `