@popmelt.com/core 0.18.1 → 0.18.2

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/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { PropsWithChildren } from 'react';
3
- import { P as PopmeltSubjectAdapter, A as Annotation, E as ElementInfo, a as AnnotationAttachment, S as SubjectFeedbackAttachment, b as StyleModification, T as TextModification, D as DomModification, c as SpacingTokenChange } from './subjects-CeqtFged.mjs';
3
+ import { A as Annotation, P as PopmeltSubjectAdapter, E as ElementInfo, a as AnnotationAttachment, S as SubjectFeedbackAttachment, b as StyleModification, T as TextModification, D as DomModification, c as SpacingTokenChange } from './subjects-CeqtFged.mjs';
4
4
  export { d as AnnotationType, B as BridgeStatus, C as ClaudeResponse, I as ImageObjectContext, O as OpaqueTargetReference, e as Point, f as PopmeltSubject, g as PopmeltSubjectBounds, h as PopmeltSubjectCreationSession, i as PopmeltSubjectTrackingAnchor, j as PopmeltSurfaceSnapshot, R as ReactSourceLocation, k as StyleChange, l as ToolType, V as VideoObjectContext } from './subjects-CeqtFged.mjs';
5
5
  import { I as ImageRecognitionProvider, V as VideoTrackingProvider, a as ImageSubjectAdapterOptions, b as VideoSubjectAdapterOptions } from './video-adapter-Gq8saCDn.mjs';
6
6
 
@@ -11,6 +11,28 @@ type BridgeEvent = {
11
11
  timestamp: number;
12
12
  };
13
13
 
14
+ type CommentMetaValue = null | boolean | number | string | CommentMetaValue[] | {
15
+ [key: string]: CommentMetaValue;
16
+ };
17
+ /** User-owned, JSON-serializable context captured with a human comment turn. */
18
+ type CommentMeta = Record<string, CommentMetaValue>;
19
+ type CommentMetaContext = {
20
+ kind: 'annotation';
21
+ timestamp: number;
22
+ url: string;
23
+ pathname: string;
24
+ annotations: readonly Readonly<Annotation>[];
25
+ } | {
26
+ kind: 'reply';
27
+ timestamp: number;
28
+ url: string;
29
+ pathname: string;
30
+ threadId: string;
31
+ reply: string;
32
+ annotations: readonly Readonly<Annotation>[];
33
+ };
34
+ type GetCommentMeta = (context: CommentMetaContext) => CommentMeta | undefined | Promise<CommentMeta | undefined>;
35
+
14
36
  type PopmeltExtensionRuntime = {
15
37
  /** Optional perception contribution for Core's built-in image adapter. */
16
38
  imageRecognition?: ImageRecognitionProvider;
@@ -63,8 +85,10 @@ type PopmeltProviderProps = PropsWithChildren<{
63
85
  imageAnnotation?: boolean | ImageAnnotationOptions;
64
86
  /** Manual video annotation is on by default; See may contribute tracking. */
65
87
  videoAnnotation?: boolean | VideoAnnotationOptions;
88
+ /** Capture application-owned JSON context with each submitted human turn. */
89
+ getCommentMeta?: GetCommentMeta;
66
90
  }>;
67
- declare function PopmeltProvider({ children, enabled, bridgeUrl, projectId: projectIdProp, navigate: navigateProp, subjectAdapters, extensions, imageAnnotation, videoAnnotation, }: PopmeltProviderProps): react.JSX.Element;
91
+ declare function PopmeltProvider({ children, enabled, bridgeUrl, projectId: projectIdProp, navigate: navigateProp, subjectAdapters, extensions, imageAnnotation, videoAnnotation, getCommentMeta, }: PopmeltProviderProps): react.JSX.Element;
68
92
 
69
93
  type AnnotationData = {
70
94
  id: string;
@@ -96,6 +120,7 @@ type FeedbackData = {
96
120
  domModifications?: DomModification[];
97
121
  inspectedElement?: ElementInfo;
98
122
  spacingTokenChanges?: SpacingTokenChange[];
123
+ meta?: CommentMeta;
99
124
  };
100
125
 
101
- export { Annotation, type BridgeEvent, ElementInfo, type FeedbackData, type ImageAnnotationOptions, type PopmeltExtension, type PopmeltExtensionRuntime, PopmeltProvider, type PopmeltProviderProps, PopmeltSubjectAdapter, StyleModification, type VideoAnnotationOptions, usePopmelt };
126
+ export { Annotation, type BridgeEvent, type CommentMeta, type CommentMetaContext, type CommentMetaValue, ElementInfo, type FeedbackData, type GetCommentMeta, type ImageAnnotationOptions, type PopmeltExtension, type PopmeltExtensionRuntime, PopmeltProvider, type PopmeltProviderProps, PopmeltSubjectAdapter, StyleModification, type VideoAnnotationOptions, usePopmelt };