viewgate-wrapper 1.5.1 → 1.6.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.
package/README.md CHANGED
@@ -1,47 +1,79 @@
1
- # viewgate-wrapper
1
+ # ViewGate Wrapper
2
2
 
3
- A React wrapper and Vite plugin for the ViewGate feedback system.
3
+ A React wrapper and Vite plugin for the ViewGate feedback system. It allows clients to leave annotations directly on the UI and developers to apply those changes instantly via AI (MCP Server).
4
4
 
5
- ## Installation
5
+ ## 📦 Installation
6
6
 
7
7
  ```bash
8
8
  npm install viewgate-wrapper
9
9
  ```
10
10
 
11
- ## Usage
11
+ ## 🚀 Getting Started
12
12
 
13
- ### 1. Configure the Vite Plugin
13
+ ### 1. Framework Setup (Required for Smart Source Mapping)
14
14
 
15
- In your `vite.config.ts`:
15
+ To allow the AI to find the exact line of code to edit, you must configure ViewGate for your framework:
16
+
17
+ #### ⚡ Vite
18
+ Add the plugin to your `vite.config.ts`:
16
19
 
17
20
  ```typescript
18
- import { defineConfig } from 'vite';
19
- import react from '@vitejs/plugin-react';
20
21
  import { viewgatePlugin } from 'viewgate-wrapper';
21
22
 
22
23
  export default defineConfig({
23
24
  plugins: [
24
- react(),
25
+ // ...
25
26
  viewgatePlugin()
26
27
  ]
27
28
  });
28
29
  ```
29
30
 
31
+ #### 🌑 Next.js
32
+ If you are using Next.js, you can add our custom loader to your `next.config.js` (Webpack-based):
33
+
34
+ ```javascript
35
+ module.exports = {
36
+ webpack: (config) => {
37
+ config.module.rules.push({
38
+ test: /\.(tsx|jsx)$/,
39
+ use: [
40
+ {
41
+ loader: 'viewgate-wrapper/next-loader',
42
+ },
43
+ ],
44
+ });
45
+ return config;
46
+ },
47
+ };
48
+ ```
49
+ *Note: Full SWC support for Next.js is coming soon.*
50
+
30
51
  ### 2. Wrap your application
31
52
 
32
- In your main entry file (e.g., `main.tsx`):
53
+ In your main entry file (e.g., `main.tsx` or `_app.tsx`):
33
54
 
34
55
  ```tsx
35
56
  import { ViewGate } from 'viewgate-wrapper';
36
57
  import 'viewgate-wrapper/dist/viewgate-wrapper.css';
37
58
 
38
- ReactDOM.createRoot(document.getElementById('root')!).render(
39
- <ViewGate language="es" apiKey="YOUR_API_KEY">
59
+ // ...
60
+ <ViewGate language="es" apiKey="YOUR_PROJECT_API_KEY">
40
61
  <App />
41
62
  </ViewGate>
42
- );
43
63
  ```
44
64
 
65
+ ### 3. Setup the MCP Server (For AI Integration)
66
+
67
+ To allow an AI assistant (like Claude Desktop or Cursor) to apply the feedback changes automatically, you need to configure the MCP server in your local environment:
68
+
69
+ ```bash
70
+ npx viewgate-wrapper setup
71
+ ```
72
+
73
+ **Note:** After running the setup, remember to **refresh or restart** your MCP server in your IDE to load the new tools.
74
+
75
+
45
76
  ## License
46
77
 
47
78
  ISC
79
+
@@ -1 +1 @@
1
- {"version":3,"file":"ViewGateOverlay.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,EAAoC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,wBAAwB,CAAC;AA4FhC,eAAO,MAAM,eAAe,EAAE,EA4e7B,CAAC"}
1
+ {"version":3,"file":"ViewGateOverlay.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,EAAoC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,wBAAwB,CAAC;AA+GhC,eAAO,MAAM,eAAe,EAAE,EA4e7B,CAAC"}
@@ -64,6 +64,11 @@ export interface SemanticReference {
64
64
  componentPath?: string;
65
65
  signature?: string;
66
66
  source?: string;
67
+ attributes?: Record<string, string>;
68
+ metadata?: {
69
+ hint?: string;
70
+ closestSource?: string;
71
+ };
67
72
  }
68
73
  interface ViewGateContextType {
69
74
  addToast: (message: string, type: 'success' | 'error') => void;
@@ -1 +1 @@
1
- {"version":3,"file":"ViewGateProvider.d.ts","sour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