vite-plugin-ai-annotator 1.14.2 → 1.14.4
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 +44 -4
- package/dist/annotator/inspection.d.ts +1 -3
- package/dist/annotator-toolbar.d.ts +1 -1
- package/dist/annotator-toolbar.js +144 -196
- package/dist/nuxt-module.d.ts +5 -0
- package/dist/nuxt-module.js +1528 -0
- package/dist/nuxt-module.js.map +7 -0
- package/dist/rpc/define.d.ts +2 -6
- package/package.json +18 -4
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ Works with all Vite-supported frameworks:
|
|
|
28
28
|
- 🅰️ **Angular** - Recognizes components and directives
|
|
29
29
|
- 🟠 **Svelte** - Identifies components and stores
|
|
30
30
|
- 📄 **Vanilla JS** - Works with plain HTML/CSS/JS
|
|
31
|
+
- 🟦 **Nuxt.js** - Full support via Nuxt module (Nuxt 3+)
|
|
31
32
|
|
|
32
33
|
## Installation
|
|
33
34
|
|
|
@@ -44,13 +45,15 @@ Then ask Claude: *"Set up ai-annotator for my project"* - it handles the rest!
|
|
|
44
45
|
|
|
45
46
|
### Option 2: Manual Setup
|
|
46
47
|
|
|
47
|
-
####
|
|
48
|
+
#### For Vite Projects
|
|
49
|
+
|
|
50
|
+
##### Step 1: Install the package
|
|
48
51
|
|
|
49
52
|
```bash
|
|
50
53
|
bun add -d vite-plugin-ai-annotator
|
|
51
54
|
```
|
|
52
55
|
|
|
53
|
-
|
|
56
|
+
##### Step 2: Add to your Vite config
|
|
54
57
|
|
|
55
58
|
```typescript
|
|
56
59
|
import { defineConfig } from 'vite';
|
|
@@ -63,7 +66,33 @@ export default defineConfig({
|
|
|
63
66
|
});
|
|
64
67
|
```
|
|
65
68
|
|
|
66
|
-
####
|
|
69
|
+
#### For Nuxt.js Projects (Nuxt 3+)
|
|
70
|
+
|
|
71
|
+
##### Step 1: Install the package
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
bun add -d vite-plugin-ai-annotator
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
##### Step 2: Add to your `nuxt.config.ts`
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
export default defineNuxtConfig({
|
|
81
|
+
modules: [
|
|
82
|
+
'vite-plugin-ai-annotator/nuxt'
|
|
83
|
+
],
|
|
84
|
+
// Optional: Configure the annotator
|
|
85
|
+
aiAnnotator: {
|
|
86
|
+
port: 7318,
|
|
87
|
+
autoSetupMcp: true,
|
|
88
|
+
verbose: false,
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**That's it!** Nuxt handles the rest automatically.
|
|
94
|
+
|
|
95
|
+
#### Configure MCP (Vite and Nuxt)
|
|
67
96
|
|
|
68
97
|
**Option A: Auto Setup (Recommended)**
|
|
69
98
|
|
|
@@ -75,6 +104,17 @@ annotator({
|
|
|
75
104
|
})
|
|
76
105
|
```
|
|
77
106
|
|
|
107
|
+
For Nuxt, configure in `nuxt.config.ts`:
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
export default defineNuxtConfig({
|
|
111
|
+
modules: ['vite-plugin-ai-annotator/nuxt'],
|
|
112
|
+
aiAnnotator: {
|
|
113
|
+
autoSetupMcp: true,
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
```
|
|
117
|
+
|
|
78
118
|
This automatically creates/updates `.mcp.json`, `.cursor/mcp.json`, and `.vscode/mcp.json` based on your project.
|
|
79
119
|
|
|
80
120
|
**Option B: Manual Setup**
|
|
@@ -83,7 +123,7 @@ This automatically creates/updates `.mcp.json`, `.cursor/mcp.json`, and `.vscode
|
|
|
83
123
|
claude mcp add annotator -- npx vite-plugin-ai-annotator mcp -s http://localhost:7318
|
|
84
124
|
```
|
|
85
125
|
|
|
86
|
-
#### Step
|
|
126
|
+
#### Step 3: Start your dev server
|
|
87
127
|
|
|
88
128
|
```bash
|
|
89
129
|
bun dev
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Inspection Manager for mouse inspection mode handling
|
|
3
|
-
* Supports
|
|
4
|
-
* Also supports text selection for annotating specific text content
|
|
3
|
+
* Supports single-click element selection and text selection for annotating
|
|
5
4
|
*/
|
|
6
5
|
export interface InspectionManager {
|
|
7
6
|
enterInspectionMode(): void;
|
|
@@ -11,7 +10,6 @@ export interface InspectionManager {
|
|
|
11
10
|
}
|
|
12
11
|
export interface InspectionCallbacks {
|
|
13
12
|
onElementSelect?: (element: Element) => void;
|
|
14
|
-
onMultiSelect?: (elements: Element[]) => void;
|
|
15
13
|
onTextSelect?: (range: Range, commonAncestor: Element) => void;
|
|
16
14
|
shouldIgnoreElement?: (element: Element) => boolean;
|
|
17
15
|
isElementSelected?: (element: Element) => boolean;
|
|
@@ -22,6 +22,7 @@ export declare class AnnotatorToolbar extends LitElement {
|
|
|
22
22
|
private tooltipCleanup;
|
|
23
23
|
private toastTimeout;
|
|
24
24
|
private clickListenerTimeout;
|
|
25
|
+
private skipNextClickOutside;
|
|
25
26
|
private socket;
|
|
26
27
|
private rpc;
|
|
27
28
|
private selectionManager;
|
|
@@ -48,7 +49,6 @@ export declare class AnnotatorToolbar extends LitElement {
|
|
|
48
49
|
private injectJS;
|
|
49
50
|
private getConsoleLogs;
|
|
50
51
|
private handleElementSelected;
|
|
51
|
-
private handleMultiSelect;
|
|
52
52
|
private handleTextSelected;
|
|
53
53
|
private removeSelectedElement;
|
|
54
54
|
private showCommentPopoverForElement;
|