You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

vite-plugin-react-click-to-component

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-react-click-to-component - npm Package Compare versions

Comparing version

to
3.0.0

index.cjs

9

client.js

@@ -60,3 +60,3 @@ // src/client.ts

currentTarget = event.target;
event.target.dataset.clickToComponentTarget = "true";
event.target.dataset["clickToComponentTarget"] = "true";
});

@@ -108,3 +108,3 @@ window.addEventListener("contextmenu", (event) => {

item.addEventListener("click", () => {
fetch(`/__open-in-editor?file=${encodeURIComponent(layer.path)}`);
void fetch(`/__open-in-editor?file=${encodeURIComponent(layer.path)}`);
cleanUp();

@@ -130,3 +130,3 @@ });

if (current)
delete current.dataset.clickToComponentTarget;
delete current.dataset["clickToComponentTarget"];
currentTarget = void 0;

@@ -141,3 +141,2 @@ };

var getLayersForElement = (element) => {
var _a;
let instance = getReactInstanceForElement(element);

@@ -148,3 +147,3 @@ const layers = [];

if (path) {
const name = typeof instance.type === "string" ? instance.type : (_a = instance.type.displayName) != null ? _a : instance.type.name;
const name = typeof instance.type === "string" ? instance.type : instance.type.displayName ?? instance.type.name;
layers.push({ name, path });

@@ -151,0 +150,0 @@ }

{
"name": "vite-plugin-react-click-to-component",
"description": "Option+Right Click in your browser to open the source in your editor",
"version": "2.0.0",
"version": "3.0.0",
"author": "Arnaud Barré (https://github.com/ArnaudBarre)",
"license": "MIT",
"repository": "github:ArnaudBarre/vite-plugin-react-click-to-component",
"main": "index.js",
"type": "module",
"main": "index.cjs",
"types": "index.d.mts",
"module": "index.mjs",
"exports": {
".": {
"types": "./index.d.mts",
"require": "./index.cjs",
"import": "./index.mjs"
}
},
"keywords": [

@@ -18,4 +28,4 @@ "vite",

"react": ">=16",
"vite": "^2 || ^3 || ^4"
"vite": "^4 || ^5"
}
}

@@ -5,3 +5,3 @@ # vite-plugin-react-click-to-component [![npm](https://img.shields.io/npm/v/vite-plugin-react-click-to-component)](https://www.npmjs.com/package/vite-plugin-react-click-to-component)

Light version of [ericclemmons/click-to-component](https://github.com/ericclemmons/click-to-component) that uses Vite's launch editor middleware to open the source code in your currently running editor.
![demo](https://media.webtoo.ls/media_attachments/files/109/913/790/489/646/235/original/58f3d38bb221f42e.jpg)

@@ -25,1 +25,5 @@ ## Installation

```
## Inspiration
This plugin is a light version of [ericclemmons/click-to-component](https://github.com/ericclemmons/click-to-component) that uses Vite's launch editor middleware to open the source code in your currently running editor. This also benefits from Vite's transformIndexHtml hook so that you don't need to modify your source code.