agent-ui-annotation 0.4.0 → 0.5.0
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 +93 -7
- package/dist/adapters/angular/annotation.module.d.ts +1 -1
- package/dist/adapters/angular/annotation.module.d.ts.map +1 -1
- package/dist/adapters/react/AgentUIAnnotation.d.ts +4 -1
- package/dist/adapters/react/AgentUIAnnotation.d.ts.map +1 -1
- package/dist/adapters/react/AgentUIAnnotation.js +55 -51
- package/dist/adapters/react/AgentUIAnnotation.js.map +1 -1
- package/dist/adapters/svelte/index.js +56 -54
- package/dist/adapters/svelte/index.js.map +1 -1
- package/dist/adapters/svelte/types.d.ts +4 -1
- package/dist/adapters/svelte/types.d.ts.map +1 -1
- package/dist/adapters/vanilla/index.d.ts +19 -17
- package/dist/adapters/vanilla/index.d.ts.map +1 -1
- package/dist/adapters/vanilla/index.js +35 -34
- package/dist/adapters/vanilla/index.js.map +1 -1
- package/dist/adapters/vue/AgentUIAnnotation.vue.d.ts +9 -7
- package/dist/adapters/vue/AgentUIAnnotation.vue.d.ts.map +1 -1
- package/dist/adapters/vue/index.js +42 -39
- package/dist/adapters/vue/index.js.map +1 -1
- package/dist/adapters/vue/types.d.ts +4 -1
- package/dist/adapters/vue/types.d.ts.map +1 -1
- package/dist/adapters/vue/useAgentUIAnnotation.d.ts.map +1 -1
- package/dist/agent-ui-annotation.js +15 -15
- package/dist/agent-ui-annotation.js.map +1 -1
- package/dist/annotation-element-Cp1_--4M.js +4277 -0
- package/dist/annotation-element-Cp1_--4M.js.map +1 -0
- package/dist/core/annotations/annotation.d.ts +66 -0
- package/dist/core/annotations/annotation.d.ts.map +1 -0
- package/dist/core/annotations/index.d.ts +7 -0
- package/dist/core/annotations/index.d.ts.map +1 -0
- package/dist/core/annotations/output.d.ts +14 -0
- package/dist/core/annotations/output.d.ts.map +1 -0
- package/dist/core/annotations/persistence.d.ts +42 -0
- package/dist/core/annotations/persistence.d.ts.map +1 -0
- package/dist/core/controller.d.ts +17 -15
- package/dist/core/controller.d.ts.map +1 -1
- package/dist/core/dom/events.d.ts.map +1 -1
- package/dist/core/dom/hover-detection.d.ts.map +1 -1
- package/dist/core/i18n/types.d.ts +5 -5
- package/dist/core/i18n/types.d.ts.map +1 -1
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/state.d.ts +5 -5
- package/dist/core/state.d.ts.map +1 -1
- package/dist/core/types.d.ts +68 -36
- package/dist/core/types.d.ts.map +1 -1
- package/dist/element/annotation-element.d.ts +58 -19
- package/dist/element/annotation-element.d.ts.map +1 -1
- package/dist/element/styles.d.ts +2 -2
- package/dist/element/styles.d.ts.map +1 -1
- package/dist/element/templates/marker.d.ts +3 -3
- package/dist/element/templates/marker.d.ts.map +1 -1
- package/dist/element/templates/popup.d.ts +2 -2
- package/dist/element/templates/popup.d.ts.map +1 -1
- package/dist/element/templates/toolbar.d.ts +3 -3
- package/dist/element/templates/toolbar.d.ts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/package.json +10 -6
- package/dist/annotation-element-CJm7-qrT.js +0 -3476
- package/dist/annotation-element-CJm7-qrT.js.map +0 -1
- package/dist/core/scopes/index.d.ts +0 -7
- package/dist/core/scopes/index.d.ts.map +0 -1
- package/dist/core/scopes/output.d.ts +0 -14
- package/dist/core/scopes/output.d.ts.map +0 -1
- package/dist/core/scopes/persistence.d.ts +0 -42
- package/dist/core/scopes/persistence.d.ts.map +0 -1
- package/dist/core/scopes/scope.d.ts +0 -55
- package/dist/core/scopes/scope.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -46,6 +46,13 @@ import { createAnnotation } from 'agent-ui-annotation';
|
|
|
46
46
|
|
|
47
47
|
const annotation = createAnnotation({
|
|
48
48
|
theme: 'auto',
|
|
49
|
+
// Add custom context to every annotation
|
|
50
|
+
onBeforeAnnotationCreate: (data) => ({
|
|
51
|
+
context: {
|
|
52
|
+
route: window.location.pathname,
|
|
53
|
+
timestamp: new Date().toISOString(),
|
|
54
|
+
},
|
|
55
|
+
}),
|
|
49
56
|
onAnnotationCreate: (annotation) => console.log('Created:', annotation),
|
|
50
57
|
onCopy: (markdown) => console.log('Copied:', markdown),
|
|
51
58
|
});
|
|
@@ -74,6 +81,9 @@ function App() {
|
|
|
74
81
|
<AgentUIAnnotation
|
|
75
82
|
theme="auto"
|
|
76
83
|
outputLevel="standard"
|
|
84
|
+
onBeforeAnnotationCreate={(data) => ({
|
|
85
|
+
context: { route: window.location.pathname },
|
|
86
|
+
})}
|
|
77
87
|
onAnnotationCreate={(annotation) => console.log('Created:', annotation)}
|
|
78
88
|
onCopy={(markdown) => console.log('Copied:', markdown)}
|
|
79
89
|
/>
|
|
@@ -86,10 +96,14 @@ function App() {
|
|
|
86
96
|
```vue
|
|
87
97
|
<script setup lang="ts">
|
|
88
98
|
import { AgentUIAnnotation, useAgentUIAnnotation } from 'agent-ui-annotation/vue';
|
|
89
|
-
import type { Annotation } from 'agent-ui-annotation/vue';
|
|
99
|
+
import type { Annotation, BeforeAnnotationCreateResult } from 'agent-ui-annotation/vue';
|
|
90
100
|
|
|
91
101
|
const { ref: annotationRef, activate, copyOutput } = useAgentUIAnnotation();
|
|
92
102
|
|
|
103
|
+
function handleBeforeCreate(): BeforeAnnotationCreateResult {
|
|
104
|
+
return { context: { route: window.location.pathname } };
|
|
105
|
+
}
|
|
106
|
+
|
|
93
107
|
function handleCreate(annotation: Annotation) {
|
|
94
108
|
console.log('Created:', annotation);
|
|
95
109
|
}
|
|
@@ -104,6 +118,7 @@ function handleCopy(markdown: string) {
|
|
|
104
118
|
ref="annotationRef"
|
|
105
119
|
theme="auto"
|
|
106
120
|
output-level="standard"
|
|
121
|
+
:on-before-annotation-create="handleBeforeCreate"
|
|
107
122
|
@annotation-create="handleCreate"
|
|
108
123
|
@copy="handleCopy"
|
|
109
124
|
/>
|
|
@@ -117,10 +132,13 @@ function handleCopy(markdown: string) {
|
|
|
117
132
|
```svelte
|
|
118
133
|
<script lang="ts">
|
|
119
134
|
import { AgentUIAnnotation } from 'agent-ui-annotation/svelte';
|
|
120
|
-
import type { Annotation } from 'agent-ui-annotation/svelte';
|
|
135
|
+
import type { Annotation, BeforeAnnotationCreateResult } from 'agent-ui-annotation/svelte';
|
|
121
136
|
|
|
122
137
|
let annotation: AgentUIAnnotation;
|
|
123
138
|
|
|
139
|
+
const onBeforeAnnotationCreate = (): BeforeAnnotationCreateResult => ({
|
|
140
|
+
context: { route: window.location.pathname },
|
|
141
|
+
});
|
|
124
142
|
const onAnnotationCreate = (a: Annotation) => console.log('Created:', a);
|
|
125
143
|
const onCopy = (content: string) => console.log('Copied:', content);
|
|
126
144
|
</script>
|
|
@@ -129,6 +147,7 @@ function handleCopy(markdown: string) {
|
|
|
129
147
|
bind:this={annotation}
|
|
130
148
|
theme="auto"
|
|
131
149
|
outputLevel="standard"
|
|
150
|
+
{onBeforeAnnotationCreate}
|
|
132
151
|
{onAnnotationCreate}
|
|
133
152
|
{onCopy}
|
|
134
153
|
/>
|
|
@@ -156,9 +175,16 @@ export class App {
|
|
|
156
175
|
|
|
157
176
|
constructor() {
|
|
158
177
|
afterNextRender(() => {
|
|
159
|
-
this.annotationRef()?.nativeElement
|
|
160
|
-
|
|
161
|
-
|
|
178
|
+
const element = this.annotationRef()?.nativeElement;
|
|
179
|
+
if (element) {
|
|
180
|
+
// Add custom context to annotations
|
|
181
|
+
element.setBeforeCreateHook((data) => ({
|
|
182
|
+
context: { route: window.location.pathname },
|
|
183
|
+
}));
|
|
184
|
+
element.addEventListener('annotation:create', (e: Event) => {
|
|
185
|
+
console.log('Created:', (e as CustomEvent).detail.annotation);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
162
188
|
});
|
|
163
189
|
}
|
|
164
190
|
|
|
@@ -194,12 +220,50 @@ When active, clicks are blocked from triggering buttons/links while annotating (
|
|
|
194
220
|
|-------|-------------|
|
|
195
221
|
| Compact | `1. **button "Save"**: Change color to blue` |
|
|
196
222
|
| Standard | Element + path + comment with headers |
|
|
197
|
-
| Detailed | + classes, position, nearby context |
|
|
198
|
-
| Forensic | + full DOM path, computed styles, accessibility info |
|
|
223
|
+
| Detailed | + classes, position, nearby context, custom context |
|
|
224
|
+
| Forensic | + full DOM path, computed styles, accessibility info, custom context |
|
|
199
225
|
|
|
200
226
|
### Persistence
|
|
201
227
|
Annotations are saved to localStorage and persist across page reloads (7-day retention).
|
|
202
228
|
|
|
229
|
+
### Custom Context Hook
|
|
230
|
+
|
|
231
|
+
The `onBeforeAnnotationCreate` hook lets you inject custom context (route info, user data, app state) into annotations before they're created. You can also modify the comment or cancel annotation creation.
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
// Add route and user context to every annotation
|
|
235
|
+
const annotation = createAnnotation({
|
|
236
|
+
onBeforeAnnotationCreate: (data) => ({
|
|
237
|
+
context: {
|
|
238
|
+
route: window.location.pathname,
|
|
239
|
+
params: Object.fromEntries(new URLSearchParams(window.location.search)),
|
|
240
|
+
userId: getCurrentUserId(),
|
|
241
|
+
timestamp: new Date().toISOString(),
|
|
242
|
+
},
|
|
243
|
+
}),
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
// Conditionally cancel annotation creation
|
|
247
|
+
const annotation = createAnnotation({
|
|
248
|
+
onBeforeAnnotationCreate: (data) => {
|
|
249
|
+
// Don't annotate elements inside specific containers
|
|
250
|
+
if (data.element.closest('.no-annotate')) {
|
|
251
|
+
return { cancel: true };
|
|
252
|
+
}
|
|
253
|
+
return { context: { route: window.location.pathname } };
|
|
254
|
+
},
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
// Modify the comment
|
|
258
|
+
const annotation = createAnnotation({
|
|
259
|
+
onBeforeAnnotationCreate: (data) => ({
|
|
260
|
+
comment: `[${window.location.pathname}] ${data.comment}`,
|
|
261
|
+
}),
|
|
262
|
+
});
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
The custom context appears in the markdown output at detailed and forensic levels.
|
|
266
|
+
|
|
203
267
|
## Internationalization (i18n)
|
|
204
268
|
|
|
205
269
|
agent-ui-annotation supports multiple languages with built-in English and Simplified Chinese translations.
|
|
@@ -336,6 +400,7 @@ interface AnnotationOptions {
|
|
|
336
400
|
theme?: 'light' | 'dark' | 'auto';
|
|
337
401
|
outputLevel?: 'compact' | 'standard' | 'detailed' | 'forensic';
|
|
338
402
|
annotationColor?: string;
|
|
403
|
+
onBeforeAnnotationCreate?: BeforeAnnotationCreateHook; // Hook to add context/modify/cancel
|
|
339
404
|
onAnnotationCreate?: (annotation: Annotation) => void;
|
|
340
405
|
onAnnotationUpdate?: (annotation: Annotation) => void;
|
|
341
406
|
onAnnotationDelete?: (id: string) => void;
|
|
@@ -343,6 +408,27 @@ interface AnnotationOptions {
|
|
|
343
408
|
onCopy?: (content: string, level: OutputLevel) => void;
|
|
344
409
|
}
|
|
345
410
|
|
|
411
|
+
// Hook types for onBeforeAnnotationCreate
|
|
412
|
+
interface BeforeAnnotationCreateData {
|
|
413
|
+
element: Element; // The DOM element being annotated
|
|
414
|
+
elementInfo: ElementInfo; // Collected element information
|
|
415
|
+
comment: string; // User's comment
|
|
416
|
+
selectedText: string | null; // Selected text on page (if any)
|
|
417
|
+
isMultiSelect: boolean; // Whether part of multi-select batch
|
|
418
|
+
clickX: number; // Click X coordinate
|
|
419
|
+
clickY: number; // Click Y coordinate
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
interface BeforeAnnotationCreateResult {
|
|
423
|
+
context?: Record<string, unknown>; // Custom data to attach
|
|
424
|
+
comment?: string; // Override the comment
|
|
425
|
+
cancel?: boolean; // Set true to cancel creation
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
type BeforeAnnotationCreateHook = (
|
|
429
|
+
data: BeforeAnnotationCreateData
|
|
430
|
+
) => BeforeAnnotationCreateResult | Promise<BeforeAnnotationCreateResult> | void | Promise<void>;
|
|
431
|
+
|
|
346
432
|
// i18n is configured separately via initI18n()
|
|
347
433
|
interface I18nOptions {
|
|
348
434
|
locale?: string; // e.g., 'en', 'zh-CN'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { I18nOptions } from '../../core/i18n';
|
|
2
|
-
export type { Annotation, AnnotationId, OutputLevel, ThemeMode, Settings, PartialTranslationStrings, I18nOptions } from '../../core/types';
|
|
2
|
+
export type { Annotation, AnnotationId, OutputLevel, ThemeMode, Settings, PartialTranslationStrings, I18nOptions, BeforeAnnotationCreateHook, BeforeAnnotationCreateData, BeforeAnnotationCreateResult } from '../../core/types';
|
|
3
3
|
export { AnnotationElement } from '../../element/annotation-element';
|
|
4
4
|
export { initI18n } from '../../core/i18n';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation.module.d.ts","sourceRoot":"","sources":["../../../src/adapters/angular/annotation.module.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"annotation.module.d.ts","sourceRoot":"","sources":["../../../src/adapters/angular/annotation.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAGH,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAM7D,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,yBAAyB,EAAE,WAAW,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AACjO,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,CAAC,EAAE,WAAW,QAK9D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React, FC } from 'react';
|
|
2
|
-
import { Annotation, AnnotationId, OutputLevel, ThemeMode } from '../../core/types';
|
|
2
|
+
import { Annotation, AnnotationId, OutputLevel, ThemeMode, BeforeAnnotationCreateHook, BeforeAnnotationCreateData, BeforeAnnotationCreateResult } from '../../core/types';
|
|
3
3
|
import { AnnotationElement } from '../../element/annotation-element';
|
|
4
4
|
declare global {
|
|
5
5
|
namespace JSX {
|
|
@@ -23,6 +23,8 @@ export interface AgentUIAnnotationProps {
|
|
|
23
23
|
annotationColor?: string;
|
|
24
24
|
/** Whether the tool is disabled */
|
|
25
25
|
disabled?: boolean;
|
|
26
|
+
/** Hook called before creating an annotation - can add context, modify comment, or cancel */
|
|
27
|
+
onBeforeAnnotationCreate?: BeforeAnnotationCreateHook;
|
|
26
28
|
/** Callback when an annotation is created */
|
|
27
29
|
onAnnotationCreate?: (annotation: Annotation) => void;
|
|
28
30
|
/** Callback when an annotation is updated */
|
|
@@ -61,4 +63,5 @@ export declare function useAgentUIAnnotation(): {
|
|
|
61
63
|
clearAll: () => void;
|
|
62
64
|
};
|
|
63
65
|
export default AgentUIAnnotation;
|
|
66
|
+
export type { BeforeAnnotationCreateHook, BeforeAnnotationCreateData, BeforeAnnotationCreateResult };
|
|
64
67
|
//# sourceMappingURL=AgentUIAnnotation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentUIAnnotation.d.ts","sourceRoot":"","sources":["../../../src/adapters/react/AgentUIAnnotation.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,EAAkC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"AgentUIAnnotation.d.ts","sourceRoot":"","sources":["../../../src/adapters/react/AgentUIAnnotation.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,EAAkC,KAAK,EAAE,EAAE,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Ref as b, useEffect as O, useCallback as u } from "react";
|
|
2
|
+
import { r as R } from "../../annotation-element-Cp1_--4M.js";
|
|
3
3
|
R();
|
|
4
|
-
const
|
|
4
|
+
const H = ({
|
|
5
5
|
theme: c = "auto",
|
|
6
|
-
outputLevel:
|
|
7
|
-
annotationColor:
|
|
8
|
-
disabled:
|
|
6
|
+
outputLevel: v = "standard",
|
|
7
|
+
annotationColor: f,
|
|
8
|
+
disabled: m = !1,
|
|
9
|
+
onBeforeAnnotationCreate: d,
|
|
9
10
|
onAnnotationCreate: s,
|
|
10
11
|
onAnnotationUpdate: l,
|
|
11
|
-
onAnnotationDelete:
|
|
12
|
-
onAnnotationsClear:
|
|
13
|
-
onCopy:
|
|
14
|
-
className:
|
|
12
|
+
onAnnotationDelete: e,
|
|
13
|
+
onAnnotationsClear: r,
|
|
14
|
+
onCopy: i,
|
|
15
|
+
className: k
|
|
15
16
|
}) => {
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
const t =
|
|
17
|
+
const E = b(null);
|
|
18
|
+
return O(() => {
|
|
19
|
+
const t = E.current;
|
|
20
|
+
t && t.setBeforeCreateHook(d ?? null);
|
|
21
|
+
}, [d]), O(() => {
|
|
22
|
+
const t = E.current;
|
|
19
23
|
if (!t) return;
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
s == null || s(
|
|
23
|
-
}, g = (n) => {
|
|
24
|
-
const r = n.detail;
|
|
25
|
-
l == null || l(r.annotation);
|
|
24
|
+
const g = (n) => {
|
|
25
|
+
const a = n.detail;
|
|
26
|
+
s == null || s(a.annotation);
|
|
26
27
|
}, o = (n) => {
|
|
27
|
-
const
|
|
28
|
-
|
|
28
|
+
const a = n.detail;
|
|
29
|
+
l == null || l(a.annotation);
|
|
29
30
|
}, L = (n) => {
|
|
30
|
-
const
|
|
31
|
-
e == null || e(
|
|
31
|
+
const a = n.detail;
|
|
32
|
+
e == null || e(a.id);
|
|
32
33
|
}, p = (n) => {
|
|
33
|
-
const
|
|
34
|
-
|
|
34
|
+
const a = n.detail;
|
|
35
|
+
r == null || r(a.annotations);
|
|
36
|
+
}, h = (n) => {
|
|
37
|
+
const a = n.detail;
|
|
38
|
+
i == null || i(a.content, a.level);
|
|
35
39
|
};
|
|
36
|
-
return t.addEventListener("annotation:create",
|
|
37
|
-
t.removeEventListener("annotation:create",
|
|
40
|
+
return t.addEventListener("annotation:create", g), t.addEventListener("annotation:update", o), t.addEventListener("annotation:delete", L), t.addEventListener("annotation:clear", p), t.addEventListener("annotation:copy", h), () => {
|
|
41
|
+
t.removeEventListener("annotation:create", g), t.removeEventListener("annotation:update", o), t.removeEventListener("annotation:delete", L), t.removeEventListener("annotation:clear", p), t.removeEventListener("annotation:copy", h);
|
|
38
42
|
};
|
|
39
|
-
}, [s, l,
|
|
40
|
-
ref:
|
|
43
|
+
}, [s, l, e, r, i]), I.createElement("agent-ui-annotation", {
|
|
44
|
+
ref: E,
|
|
41
45
|
theme: c,
|
|
42
|
-
"output-level":
|
|
43
|
-
"annotation-color":
|
|
44
|
-
disabled:
|
|
45
|
-
class:
|
|
46
|
+
"output-level": v,
|
|
47
|
+
"annotation-color": f,
|
|
48
|
+
disabled: m ? "" : void 0,
|
|
49
|
+
class: k
|
|
46
50
|
});
|
|
47
51
|
};
|
|
48
52
|
function j() {
|
|
49
|
-
const c =
|
|
53
|
+
const c = b(null), v = u(() => {
|
|
50
54
|
var e;
|
|
51
55
|
(e = c.current) == null || e.activate();
|
|
52
|
-
}, []),
|
|
56
|
+
}, []), f = u(() => {
|
|
53
57
|
var e;
|
|
54
58
|
(e = c.current) == null || e.deactivate();
|
|
55
|
-
}, []),
|
|
59
|
+
}, []), m = u(() => {
|
|
56
60
|
var e;
|
|
57
61
|
(e = c.current) == null || e.toggle();
|
|
58
|
-
}, []),
|
|
59
|
-
var
|
|
60
|
-
return ((
|
|
61
|
-
}, []),
|
|
62
|
-
var
|
|
63
|
-
return ((
|
|
64
|
-
}, []),
|
|
62
|
+
}, []), d = u(async (e) => {
|
|
63
|
+
var r;
|
|
64
|
+
return ((r = c.current) == null ? void 0 : r.copyOutput(e)) ?? !1;
|
|
65
|
+
}, []), s = u((e) => {
|
|
66
|
+
var r;
|
|
67
|
+
return ((r = c.current) == null ? void 0 : r.getOutput(e)) ?? "";
|
|
68
|
+
}, []), l = u(() => {
|
|
65
69
|
var e;
|
|
66
70
|
(e = c.current) == null || e.clearAll();
|
|
67
71
|
}, []);
|
|
68
72
|
return {
|
|
69
73
|
ref: c,
|
|
70
|
-
activate:
|
|
71
|
-
deactivate:
|
|
72
|
-
toggle:
|
|
73
|
-
copyOutput:
|
|
74
|
-
getOutput:
|
|
75
|
-
clearAll:
|
|
74
|
+
activate: v,
|
|
75
|
+
deactivate: f,
|
|
76
|
+
toggle: m,
|
|
77
|
+
copyOutput: d,
|
|
78
|
+
getOutput: s,
|
|
79
|
+
clearAll: l
|
|
76
80
|
};
|
|
77
81
|
}
|
|
78
82
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
H as AgentUIAnnotation,
|
|
84
|
+
H as default,
|
|
81
85
|
j as useAgentUIAnnotation
|
|
82
86
|
};
|
|
83
87
|
//# sourceMappingURL=AgentUIAnnotation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentUIAnnotation.js","sources":["../../../src/adapters/react/AgentUIAnnotation.tsx"],"sourcesContent":["/**\n * React adapter for agent-ui-annotation\n */\n\nimport React, { useEffect, useRef, useCallback, type FC } from 'react';\nimport type { Annotation, AnnotationId, OutputLevel, ThemeMode } from '../../core/types';\nimport { registerAnnotationElement, type AnnotationElement } from '../../element/annotation-element';\n\n// Ensure custom element is registered\nregisterAnnotationElement();\n\n// Extend JSX types for the custom element\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n 'agent-ui-annotation': React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLElement> & {\n theme?: string;\n 'output-level'?: string;\n 'annotation-color'?: string;\n disabled?: string;\n ref?: React.Ref<AnnotationElement>;\n },\n HTMLElement\n >;\n }\n }\n}\n\nexport interface AgentUIAnnotationProps {\n /** Theme mode */\n theme?: ThemeMode;\n /** Output detail level */\n outputLevel?: OutputLevel;\n /** Annotation marker color */\n annotationColor?: string;\n /** Whether the tool is disabled */\n disabled?: boolean;\n /** Callback when an annotation is created */\n onAnnotationCreate?: (annotation: Annotation) => void;\n /** Callback when an annotation is updated */\n onAnnotationUpdate?: (annotation: Annotation) => void;\n /** Callback when an annotation is deleted */\n onAnnotationDelete?: (id: AnnotationId) => void;\n /** Callback when all annotations are cleared */\n onAnnotationsClear?: (annotations: Annotation[]) => void;\n /** Callback when output is copied */\n onCopy?: (content: string, level: OutputLevel) => void;\n /** Additional class name */\n className?: string;\n}\n\nexport interface AgentUIAnnotationRef {\n activate: () => void;\n deactivate: () => void;\n toggle: () => void;\n copyOutput: (level?: OutputLevel) => Promise<boolean>;\n getOutput: (level?: OutputLevel) => string;\n clearAll: () => void;\n}\n\n/**\n * React component wrapper for agent-ui-annotation\n */\nexport const AgentUIAnnotation: FC<AgentUIAnnotationProps> = ({\n theme = 'auto',\n outputLevel = 'standard',\n annotationColor,\n disabled = false,\n onAnnotationCreate,\n onAnnotationUpdate,\n onAnnotationDelete,\n onAnnotationsClear,\n onCopy,\n className,\n}) => {\n const ref = useRef<AnnotationElement>(null);\n\n // Handle events\n useEffect(() => {\n const element = ref.current;\n if (!element) return;\n\n const handleCreate = (e: Event) => {\n const detail = (e as CustomEvent).detail as { annotation: Annotation };\n onAnnotationCreate?.(detail.annotation);\n };\n\n const handleUpdate = (e: Event) => {\n const detail = (e as CustomEvent).detail as { annotation: Annotation };\n onAnnotationUpdate?.(detail.annotation);\n };\n\n const handleDelete = (e: Event) => {\n const detail = (e as CustomEvent).detail as { id: AnnotationId };\n onAnnotationDelete?.(detail.id);\n };\n\n const handleClear = (e: Event) => {\n const detail = (e as CustomEvent).detail as { annotations: Annotation[] };\n onAnnotationsClear?.(detail.annotations);\n };\n\n const handleCopy = (e: Event) => {\n const detail = (e as CustomEvent).detail as { content: string; level: OutputLevel };\n onCopy?.(detail.content, detail.level);\n };\n\n element.addEventListener('annotation:create', handleCreate);\n element.addEventListener('annotation:update', handleUpdate);\n element.addEventListener('annotation:delete', handleDelete);\n element.addEventListener('annotation:clear', handleClear);\n element.addEventListener('annotation:copy', handleCopy);\n\n return () => {\n element.removeEventListener('annotation:create', handleCreate);\n element.removeEventListener('annotation:update', handleUpdate);\n element.removeEventListener('annotation:delete', handleDelete);\n element.removeEventListener('annotation:clear', handleClear);\n element.removeEventListener('annotation:copy', handleCopy);\n };\n }, [onAnnotationCreate, onAnnotationUpdate, onAnnotationDelete, onAnnotationsClear, onCopy]);\n\n return React.createElement('agent-ui-annotation', {\n ref,\n theme,\n 'output-level': outputLevel,\n 'annotation-color': annotationColor,\n disabled: disabled ? '' : undefined,\n class: className,\n });\n};\n\n/**\n * Hook for using agent-ui-annotation imperatively\n */\nexport function useAgentUIAnnotation(): {\n ref: React.RefObject<AnnotationElement | null>;\n activate: () => void;\n deactivate: () => void;\n toggle: () => void;\n copyOutput: (level?: OutputLevel) => Promise<boolean>;\n getOutput: (level?: OutputLevel) => string;\n clearAll: () => void;\n} {\n const ref = useRef<AnnotationElement | null>(null);\n\n const activate = useCallback(() => {\n ref.current?.activate();\n }, []);\n\n const deactivate = useCallback(() => {\n ref.current?.deactivate();\n }, []);\n\n const toggle = useCallback(() => {\n ref.current?.toggle();\n }, []);\n\n const copyOutput = useCallback(async (level?: OutputLevel) => {\n return ref.current?.copyOutput(level) ?? false;\n }, []);\n\n const getOutput = useCallback((level?: OutputLevel) => {\n return ref.current?.getOutput(level) ?? '';\n }, []);\n\n const clearAll = useCallback(() => {\n ref.current?.clearAll();\n }, []);\n\n return {\n ref,\n activate,\n deactivate,\n toggle,\n copyOutput,\n getOutput,\n clearAll,\n };\n}\n\nexport default AgentUIAnnotation;\n"],"names":["registerAnnotationElement","AgentUIAnnotation","theme","outputLevel","annotationColor","disabled","onAnnotationCreate","onAnnotationUpdate","onAnnotationDelete","onAnnotationsClear","onCopy","className","ref","useRef","useEffect","element","handleCreate","e","detail","handleUpdate","handleDelete","handleClear","handleCopy","React","useAgentUIAnnotation","activate","useCallback","_a","deactivate","toggle","copyOutput","level","getOutput","clearAll"],"mappings":";;AASAA,EAAA;
|
|
1
|
+
{"version":3,"file":"AgentUIAnnotation.js","sources":["../../../src/adapters/react/AgentUIAnnotation.tsx"],"sourcesContent":["/**\n * React adapter for agent-ui-annotation\n */\n\nimport React, { useEffect, useRef, useCallback, type FC } from 'react';\nimport type { Annotation, AnnotationId, OutputLevel, ThemeMode, BeforeAnnotationCreateHook, BeforeAnnotationCreateData, BeforeAnnotationCreateResult } from '../../core/types';\nimport { registerAnnotationElement, type AnnotationElement } from '../../element/annotation-element';\n\n// Ensure custom element is registered\nregisterAnnotationElement();\n\n// Extend JSX types for the custom element\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n 'agent-ui-annotation': React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLElement> & {\n theme?: string;\n 'output-level'?: string;\n 'annotation-color'?: string;\n disabled?: string;\n ref?: React.Ref<AnnotationElement>;\n },\n HTMLElement\n >;\n }\n }\n}\n\nexport interface AgentUIAnnotationProps {\n /** Theme mode */\n theme?: ThemeMode;\n /** Output detail level */\n outputLevel?: OutputLevel;\n /** Annotation marker color */\n annotationColor?: string;\n /** Whether the tool is disabled */\n disabled?: boolean;\n /** Hook called before creating an annotation - can add context, modify comment, or cancel */\n onBeforeAnnotationCreate?: BeforeAnnotationCreateHook;\n /** Callback when an annotation is created */\n onAnnotationCreate?: (annotation: Annotation) => void;\n /** Callback when an annotation is updated */\n onAnnotationUpdate?: (annotation: Annotation) => void;\n /** Callback when an annotation is deleted */\n onAnnotationDelete?: (id: AnnotationId) => void;\n /** Callback when all annotations are cleared */\n onAnnotationsClear?: (annotations: Annotation[]) => void;\n /** Callback when output is copied */\n onCopy?: (content: string, level: OutputLevel) => void;\n /** Additional class name */\n className?: string;\n}\n\nexport interface AgentUIAnnotationRef {\n activate: () => void;\n deactivate: () => void;\n toggle: () => void;\n copyOutput: (level?: OutputLevel) => Promise<boolean>;\n getOutput: (level?: OutputLevel) => string;\n clearAll: () => void;\n}\n\n/**\n * React component wrapper for agent-ui-annotation\n */\nexport const AgentUIAnnotation: FC<AgentUIAnnotationProps> = ({\n theme = 'auto',\n outputLevel = 'standard',\n annotationColor,\n disabled = false,\n onBeforeAnnotationCreate,\n onAnnotationCreate,\n onAnnotationUpdate,\n onAnnotationDelete,\n onAnnotationsClear,\n onCopy,\n className,\n}) => {\n const ref = useRef<AnnotationElement>(null);\n\n // Set up the before create hook\n useEffect(() => {\n const element = ref.current;\n if (!element) return;\n\n element.setBeforeCreateHook(onBeforeAnnotationCreate ?? null);\n }, [onBeforeAnnotationCreate]);\n\n // Handle events\n useEffect(() => {\n const element = ref.current;\n if (!element) return;\n\n const handleCreate = (e: Event) => {\n const detail = (e as CustomEvent).detail as { annotation: Annotation };\n onAnnotationCreate?.(detail.annotation);\n };\n\n const handleUpdate = (e: Event) => {\n const detail = (e as CustomEvent).detail as { annotation: Annotation };\n onAnnotationUpdate?.(detail.annotation);\n };\n\n const handleDelete = (e: Event) => {\n const detail = (e as CustomEvent).detail as { id: AnnotationId };\n onAnnotationDelete?.(detail.id);\n };\n\n const handleClear = (e: Event) => {\n const detail = (e as CustomEvent).detail as { annotations: Annotation[] };\n onAnnotationsClear?.(detail.annotations);\n };\n\n const handleCopy = (e: Event) => {\n const detail = (e as CustomEvent).detail as { content: string; level: OutputLevel };\n onCopy?.(detail.content, detail.level);\n };\n\n element.addEventListener('annotation:create', handleCreate);\n element.addEventListener('annotation:update', handleUpdate);\n element.addEventListener('annotation:delete', handleDelete);\n element.addEventListener('annotation:clear', handleClear);\n element.addEventListener('annotation:copy', handleCopy);\n\n return () => {\n element.removeEventListener('annotation:create', handleCreate);\n element.removeEventListener('annotation:update', handleUpdate);\n element.removeEventListener('annotation:delete', handleDelete);\n element.removeEventListener('annotation:clear', handleClear);\n element.removeEventListener('annotation:copy', handleCopy);\n };\n }, [onAnnotationCreate, onAnnotationUpdate, onAnnotationDelete, onAnnotationsClear, onCopy]);\n\n return React.createElement('agent-ui-annotation', {\n ref,\n theme,\n 'output-level': outputLevel,\n 'annotation-color': annotationColor,\n disabled: disabled ? '' : undefined,\n class: className,\n });\n};\n\n/**\n * Hook for using agent-ui-annotation imperatively\n */\nexport function useAgentUIAnnotation(): {\n ref: React.RefObject<AnnotationElement | null>;\n activate: () => void;\n deactivate: () => void;\n toggle: () => void;\n copyOutput: (level?: OutputLevel) => Promise<boolean>;\n getOutput: (level?: OutputLevel) => string;\n clearAll: () => void;\n} {\n const ref = useRef<AnnotationElement | null>(null);\n\n const activate = useCallback(() => {\n ref.current?.activate();\n }, []);\n\n const deactivate = useCallback(() => {\n ref.current?.deactivate();\n }, []);\n\n const toggle = useCallback(() => {\n ref.current?.toggle();\n }, []);\n\n const copyOutput = useCallback(async (level?: OutputLevel) => {\n return ref.current?.copyOutput(level) ?? false;\n }, []);\n\n const getOutput = useCallback((level?: OutputLevel) => {\n return ref.current?.getOutput(level) ?? '';\n }, []);\n\n const clearAll = useCallback(() => {\n ref.current?.clearAll();\n }, []);\n\n return {\n ref,\n activate,\n deactivate,\n toggle,\n copyOutput,\n getOutput,\n clearAll,\n };\n}\n\nexport default AgentUIAnnotation;\n\n// Re-export hook types for convenience\nexport type { BeforeAnnotationCreateHook, BeforeAnnotationCreateData, BeforeAnnotationCreateResult };\n"],"names":["registerAnnotationElement","AgentUIAnnotation","theme","outputLevel","annotationColor","disabled","onBeforeAnnotationCreate","onAnnotationCreate","onAnnotationUpdate","onAnnotationDelete","onAnnotationsClear","onCopy","className","ref","useRef","useEffect","element","handleCreate","e","detail","handleUpdate","handleDelete","handleClear","handleCopy","React","useAgentUIAnnotation","activate","useCallback","_a","deactivate","toggle","copyOutput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AAAe,EAAa;AAAA,EACf,GAAG,CAAA,CAAE;AAEL,SAAO;AAAA,IACL,KAAAf;AAAA,IACA,UAAAa;AAAA,IACA,YAAAG;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAE;AAAA,IACA,UAAAC;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,109 +1,111 @@
|
|
|
1
1
|
import "svelte/internal/disclose-version";
|
|
2
2
|
import * as e from "svelte/internal/client";
|
|
3
|
-
import { onMount as
|
|
4
|
-
import { r as
|
|
5
|
-
import {
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
e.push(
|
|
9
|
-
let f = e.prop(
|
|
10
|
-
const
|
|
11
|
-
var
|
|
3
|
+
import { onMount as O } from "svelte";
|
|
4
|
+
import { r as B } from "../../annotation-element-Cp1_--4M.js";
|
|
5
|
+
import { a as P } from "../../annotation-element-Cp1_--4M.js";
|
|
6
|
+
var b = e.from_html("<agent-ui-annotation></agent-ui-annotation>", 2);
|
|
7
|
+
function D(a, n) {
|
|
8
|
+
e.push(n, !0);
|
|
9
|
+
let f = e.prop(n, "theme", 3, "auto"), v = e.prop(n, "outputLevel", 3, "standard"), r = e.prop(n, "disabled", 3, !1), i = e.state(void 0);
|
|
10
|
+
const d = (t) => {
|
|
11
|
+
var l;
|
|
12
12
|
const o = t.detail;
|
|
13
|
-
(
|
|
13
|
+
(l = n.onAnnotationCreate) == null || l.call(n, o.annotation);
|
|
14
14
|
}, u = (t) => {
|
|
15
|
-
var
|
|
15
|
+
var l;
|
|
16
16
|
const o = t.detail;
|
|
17
|
-
(
|
|
18
|
-
}, v = (t) => {
|
|
19
|
-
var i;
|
|
20
|
-
const o = t.detail;
|
|
21
|
-
(i = a.onAnnotationDelete) == null || i.call(a, o.id);
|
|
17
|
+
(l = n.onAnnotationUpdate) == null || l.call(n, o.annotation);
|
|
22
18
|
}, g = (t) => {
|
|
23
|
-
var
|
|
19
|
+
var l;
|
|
20
|
+
const o = t.detail;
|
|
21
|
+
(l = n.onAnnotationDelete) == null || l.call(n, o.id);
|
|
22
|
+
}, s = (t) => {
|
|
23
|
+
var l;
|
|
24
24
|
const o = t.detail;
|
|
25
|
-
(
|
|
25
|
+
(l = n.onAnnotationsClear) == null || l.call(n, o.annotations);
|
|
26
26
|
}, m = (t) => {
|
|
27
|
-
var
|
|
27
|
+
var l;
|
|
28
28
|
const o = t.detail;
|
|
29
|
-
(
|
|
29
|
+
(l = n.onCopy) == null || l.call(n, o.content, o.level);
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const t = e.get(
|
|
31
|
+
O(() => {
|
|
32
|
+
B();
|
|
33
|
+
const t = e.get(i);
|
|
34
34
|
if (!t) return;
|
|
35
|
-
t.addEventListener("annotation:
|
|
35
|
+
n.onBeforeAnnotationCreate && t.setBeforeCreateHook(n.onBeforeAnnotationCreate), t.addEventListener("annotation:create", d), t.addEventListener("annotation:update", u), t.addEventListener("annotation:delete", g), t.addEventListener("annotation:clear", s), t.addEventListener("annotation:copy", m);
|
|
36
36
|
const o = e.effect_root(() => {
|
|
37
37
|
e.user_effect(() => {
|
|
38
|
-
|
|
38
|
+
r() && e.get(i) && e.get(i).deactivate();
|
|
39
|
+
}), e.user_effect(() => {
|
|
40
|
+
e.get(i) && e.get(i).setBeforeCreateHook(n.onBeforeAnnotationCreate ?? null);
|
|
39
41
|
});
|
|
40
42
|
});
|
|
41
43
|
return () => {
|
|
42
|
-
t.removeEventListener("annotation:
|
|
44
|
+
t.removeEventListener("annotation:create", d), t.removeEventListener("annotation:update", u), t.removeEventListener("annotation:delete", g), t.removeEventListener("annotation:clear", s), t.removeEventListener("annotation:copy", m), o();
|
|
43
45
|
};
|
|
44
46
|
});
|
|
45
47
|
function _() {
|
|
46
48
|
var t;
|
|
47
|
-
(t = e.get(
|
|
49
|
+
(t = e.get(i)) == null || t.activate();
|
|
48
50
|
}
|
|
49
51
|
function A() {
|
|
50
52
|
var t;
|
|
51
|
-
(t = e.get(
|
|
53
|
+
(t = e.get(i)) == null || t.deactivate();
|
|
52
54
|
}
|
|
53
55
|
function E() {
|
|
54
56
|
var t;
|
|
55
|
-
(t = e.get(
|
|
57
|
+
(t = e.get(i)) == null || t.toggle();
|
|
56
58
|
}
|
|
57
|
-
async function
|
|
59
|
+
async function C(t) {
|
|
58
60
|
var o;
|
|
59
|
-
return ((o = e.get(
|
|
61
|
+
return ((o = e.get(i)) == null ? void 0 : o.copyOutput(t)) ?? !1;
|
|
60
62
|
}
|
|
61
|
-
function
|
|
63
|
+
function L(t) {
|
|
62
64
|
var o;
|
|
63
|
-
return ((o = e.get(
|
|
65
|
+
return ((o = e.get(i)) == null ? void 0 : o.getOutput(t)) ?? "";
|
|
64
66
|
}
|
|
65
|
-
function
|
|
67
|
+
function h() {
|
|
66
68
|
var t;
|
|
67
|
-
(t = e.get(
|
|
69
|
+
(t = e.get(i)) == null || t.clearAll();
|
|
68
70
|
}
|
|
69
|
-
var
|
|
71
|
+
var y = {
|
|
70
72
|
activate: _,
|
|
71
73
|
deactivate: A,
|
|
72
74
|
toggle: E,
|
|
73
|
-
copyOutput:
|
|
74
|
-
getOutput:
|
|
75
|
-
clearAll:
|
|
76
|
-
}, c =
|
|
77
|
-
return e.template_effect(() => e.set_custom_element_data(c, "theme", f())), e.template_effect(() => e.set_custom_element_data(c, "output-level",
|
|
75
|
+
copyOutput: C,
|
|
76
|
+
getOutput: L,
|
|
77
|
+
clearAll: h
|
|
78
|
+
}, c = b();
|
|
79
|
+
return e.template_effect(() => e.set_custom_element_data(c, "theme", f())), e.template_effect(() => e.set_custom_element_data(c, "output-level", v())), e.template_effect(() => e.set_custom_element_data(c, "annotation-color", n.annotationColor)), e.template_effect(() => e.set_custom_element_data(c, "disabled", r() ? "" : void 0)), e.bind_this(c, (t) => e.set(i, t), () => e.get(i)), e.append(a, c), e.pop(y);
|
|
78
80
|
}
|
|
79
|
-
function
|
|
80
|
-
let
|
|
81
|
+
function H() {
|
|
82
|
+
let a = null;
|
|
81
83
|
return {
|
|
82
84
|
get ref() {
|
|
83
|
-
return
|
|
85
|
+
return a;
|
|
84
86
|
},
|
|
85
87
|
set ref(u) {
|
|
86
|
-
|
|
88
|
+
a = u;
|
|
87
89
|
},
|
|
88
90
|
activate: () => {
|
|
89
|
-
|
|
91
|
+
a == null || a.activate();
|
|
90
92
|
},
|
|
91
93
|
deactivate: () => {
|
|
92
|
-
|
|
94
|
+
a == null || a.deactivate();
|
|
93
95
|
},
|
|
94
96
|
toggle: () => {
|
|
95
|
-
|
|
97
|
+
a == null || a.toggle();
|
|
96
98
|
},
|
|
97
|
-
copyOutput: async (u) => (
|
|
98
|
-
getOutput: (u) => (
|
|
99
|
+
copyOutput: async (u) => (a == null ? void 0 : a.copyOutput(u)) ?? Promise.resolve(!1),
|
|
100
|
+
getOutput: (u) => (a == null ? void 0 : a.getOutput(u)) ?? "",
|
|
99
101
|
clearAll: () => {
|
|
100
|
-
|
|
102
|
+
a == null || a.clearAll();
|
|
101
103
|
}
|
|
102
104
|
};
|
|
103
105
|
}
|
|
104
106
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
D as AgentUIAnnotation,
|
|
108
|
+
P as AnnotationElement,
|
|
109
|
+
H as useAgentUIAnnotation
|
|
108
110
|
};
|
|
109
111
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/adapters/svelte/AgentUIAnnotation.svelte","../../../src/adapters/svelte/useAgentUIAnnotation.ts"],"sourcesContent":["<!--\n Svelte 5 component wrapper for agent-ui-annotation\n-->\n<script lang=\"ts\">\nimport { onMount } from 'svelte';\nimport type { Annotation, AnnotationId, OutputLevel, ThemeMode } from '../../core/types';\nimport { registerAnnotationElement, type AnnotationElement } from '../../element/annotation-element';\n\ninterface Props {\n /** Theme mode */\n theme?: ThemeMode;\n /** Output detail level */\n outputLevel?: OutputLevel;\n /** Annotation marker color */\n annotationColor?: string;\n /** Whether the tool is disabled */\n disabled?: boolean;\n /** Callback when annotation is created */\n onAnnotationCreate?: (annotation: Annotation) => void;\n /** Callback when annotation is updated */\n onAnnotationUpdate?: (annotation: Annotation) => void;\n /** Callback when annotation is deleted */\n onAnnotationDelete?: (id: AnnotationId) => void;\n /** Callback when all annotations are cleared */\n onAnnotationsClear?: (annotations: Annotation[]) => void;\n /** Callback when output is copied */\n onCopy?: (content: string, level: OutputLevel) => void;\n}\n\nlet {\n theme = 'auto',\n outputLevel = 'standard',\n annotationColor,\n disabled = false,\n onAnnotationCreate,\n onAnnotationUpdate,\n onAnnotationDelete,\n onAnnotationsClear,\n onCopy,\n}: Props = $props();\n\nlet elementRef: AnnotationElement | undefined = $state();\n\n// Event handlers\nconst handleCreate = (e: Event) => {\n const detail = (e as CustomEvent).detail as { annotation: Annotation };\n onAnnotationCreate?.(detail.annotation);\n};\n\nconst handleUpdate = (e: Event) => {\n const detail = (e as CustomEvent).detail as { annotation: Annotation };\n onAnnotationUpdate?.(detail.annotation);\n};\n\nconst handleDelete = (e: Event) => {\n const detail = (e as CustomEvent).detail as { id: AnnotationId };\n onAnnotationDelete?.(detail.id);\n};\n\nconst handleClear = (e: Event) => {\n const detail = (e as CustomEvent).detail as { annotations: Annotation[] };\n onAnnotationsClear?.(detail.annotations);\n};\n\nconst handleCopy = (e: Event) => {\n const detail = (e as CustomEvent).detail as { content: string; level: OutputLevel };\n onCopy?.(detail.content, detail.level);\n};\n\nonMount(() => {\n // Register custom element on first mount\n registerAnnotationElement();\n\n const element = elementRef;\n if (!element) return;\n\n element.addEventListener('annotation:
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/adapters/svelte/AgentUIAnnotation.svelte","../../../src/adapters/svelte/useAgentUIAnnotation.ts"],"sourcesContent":["<!--\n Svelte 5 component wrapper for agent-ui-annotation\n-->\n<script lang=\"ts\">\nimport { onMount } from 'svelte';\nimport type { Annotation, AnnotationId, OutputLevel, ThemeMode, BeforeAnnotationCreateHook } from '../../core/types';\nimport { registerAnnotationElement, type AnnotationElement } from '../../element/annotation-element';\n\ninterface Props {\n /** Theme mode */\n theme?: ThemeMode;\n /** Output detail level */\n outputLevel?: OutputLevel;\n /** Annotation marker color */\n annotationColor?: string;\n /** Whether the tool is disabled */\n disabled?: boolean;\n /** Hook called before creating an annotation - can add context, modify comment, or cancel */\n onBeforeAnnotationCreate?: BeforeAnnotationCreateHook;\n /** Callback when annotation is created */\n onAnnotationCreate?: (annotation: Annotation) => void;\n /** Callback when annotation is updated */\n onAnnotationUpdate?: (annotation: Annotation) => void;\n /** Callback when annotation is deleted */\n onAnnotationDelete?: (id: AnnotationId) => void;\n /** Callback when all annotations are cleared */\n onAnnotationsClear?: (annotations: Annotation[]) => void;\n /** Callback when output is copied */\n onCopy?: (content: string, level: OutputLevel) => void;\n}\n\nlet {\n theme = 'auto',\n outputLevel = 'standard',\n annotationColor,\n disabled = false,\n onBeforeAnnotationCreate,\n onAnnotationCreate,\n onAnnotationUpdate,\n onAnnotationDelete,\n onAnnotationsClear,\n onCopy,\n}: Props = $props();\n\nlet elementRef: AnnotationElement | undefined = $state();\n\n// Event handlers\nconst handleCreate = (e: Event) => {\n const detail = (e as CustomEvent).detail as { annotation: Annotation };\n onAnnotationCreate?.(detail.annotation);\n};\n\nconst handleUpdate = (e: Event) => {\n const detail = (e as CustomEvent).detail as { annotation: Annotation };\n onAnnotationUpdate?.(detail.annotation);\n};\n\nconst handleDelete = (e: Event) => {\n const detail = (e as CustomEvent).detail as { id: AnnotationId };\n onAnnotationDelete?.(detail.id);\n};\n\nconst handleClear = (e: Event) => {\n const detail = (e as CustomEvent).detail as { annotations: Annotation[] };\n onAnnotationsClear?.(detail.annotations);\n};\n\nconst handleCopy = (e: Event) => {\n const detail = (e as CustomEvent).detail as { content: string; level: OutputLevel };\n onCopy?.(detail.content, detail.level);\n};\n\nonMount(() => {\n // Register custom element on first mount\n registerAnnotationElement();\n\n const element = elementRef;\n if (!element) return;\n\n // Set the before create hook if provided\n if (onBeforeAnnotationCreate) {\n element.setBeforeCreateHook(onBeforeAnnotationCreate);\n }\n\n element.addEventListener('annotation:create', handleCreate);\n element.addEventListener('annotation:update', handleUpdate);\n element.addEventListener('annotation:delete', handleDelete);\n element.addEventListener('annotation:clear', handleClear);\n element.addEventListener('annotation:copy', handleCopy);\n\n // Watch disabled prop changes via effect inside onMount\n const stopEffect = $effect.root(() => {\n $effect(() => {\n if (disabled && elementRef) {\n elementRef.deactivate();\n }\n });\n\n // Watch onBeforeAnnotationCreate prop changes\n $effect(() => {\n if (elementRef) {\n elementRef.setBeforeCreateHook(onBeforeAnnotationCreate ?? null);\n }\n });\n });\n\n return () => {\n element.removeEventListener('annotation:create', handleCreate);\n element.removeEventListener('annotation:update', handleUpdate);\n element.removeEventListener('annotation:delete', handleDelete);\n element.removeEventListener('annotation:clear', handleClear);\n element.removeEventListener('annotation:copy', handleCopy);\n stopEffect();\n };\n});\n\n// Exported methods\nexport function activate() {\n elementRef?.activate();\n}\n\nexport function deactivate() {\n elementRef?.deactivate();\n}\n\nexport function toggle() {\n elementRef?.toggle();\n}\n\nexport async function copyOutput(level?: OutputLevel): Promise<boolean> {\n return elementRef?.copyOutput(level) ?? false;\n}\n\nexport function getOutput(level?: OutputLevel): string {\n return elementRef?.getOutput(level) ?? '';\n}\n\nexport function clearAll() {\n elementRef?.clearAll();\n}\n</script>\n\n<agent-ui-annotation\n bind:this={elementRef}\n theme={theme}\n output-level={outputLevel}\n annotation-color={annotationColor}\n disabled={disabled ? '' : undefined}\n></agent-ui-annotation>\n","/**\n * Svelte 5 hook for agent-ui-annotation\n */\n\nimport type { OutputLevel } from '../../core/types';\nimport type { AgentUIAnnotationExpose } from './types';\n\n/**\n * Hook for using agent-ui-annotation imperatively in Svelte 5\n *\n * @example\n * ```svelte\n * <script>\n * import { AgentUIAnnotation, useAgentUIAnnotation } from 'agent-ui-annotation/svelte'\n *\n * const annotation = useAgentUIAnnotation()\n * </script>\n *\n * <AgentUIAnnotation bind:this={annotation.ref} />\n * <button onclick={() => annotation.activate()}>Start</button>\n * <button onclick={() => annotation.copyOutput()}>Copy</button>\n * ```\n */\nexport function useAgentUIAnnotation() {\n let component: AgentUIAnnotationExpose | null = null;\n\n const activate = () => {\n component?.activate();\n };\n\n const deactivate = () => {\n component?.deactivate();\n };\n\n const toggle = () => {\n component?.toggle();\n };\n\n const copyOutput = async (level?: OutputLevel): Promise<boolean> => {\n return component?.copyOutput(level) ?? Promise.resolve(false);\n };\n\n const getOutput = (level?: OutputLevel): string => {\n return component?.getOutput(level) ?? '';\n };\n\n const clearAll = () => {\n component?.clearAll();\n };\n\n return {\n get ref() {\n return component;\n },\n set ref(value: AgentUIAnnotationExpose | null) {\n component = value;\n },\n activate,\n deactivate,\n toggle,\n copyOutput,\n getOutput,\n clearAll,\n };\n}\n"],"names":["theme","outputLevel","disabled","elementRef","$","handleCreate","e","detail","_a","$$props","handleUpdate","handleDelete","handleClear","handleCopy","onMount","registerAnnotationElement","element","stopEffect","activate","deactivate","toggle","copyOutput","level","getOutput","clearAll","agent_ui_annotation","root","$$value","useAgentUIAnnotation","component","value"],"mappings":";;;;;;iBAGA;;AA6BE,MAAAA,0BAAQ,MAAM,GACdC,gCAAc,UAAU,GAExBC,6BAAW,EAAK,GASdC,IAA4CC,EAAA,MAAM,MAAA;QAGhDC,IAAY,CAAIC,MAAa;;UAC3BC,IAAUD,EAAkB;AACb,KAAAE,IAAAC,EAAA,uBAAA,QAAAD,EAAA,KAAAC,GAAAF,EAAO;AAAA,EAC9B,GAEMG,IAAY,CAAIJ,MAAa;;UAC3BC,IAAUD,EAAkB;AACb,KAAAE,IAAAC,EAAA,uBAAA,QAAAD,EAAA,KAAAC,GAAAF,EAAO;AAAA,EAC9B,GAEMI,IAAY,CAAIL,MAAa;;UAC3BC,IAAUD,EAAkB;AACb,KAAAE,IAAAC,EAAA,uBAAA,QAAAD,EAAA,KAAAC,GAAAF,EAAO;AAAA,EAC9B,GAEMK,IAAW,CAAIN,MAAa;;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