@popmelt.com/core 0.20.3 → 0.21.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/dist/index.d.mts CHANGED
@@ -1,8 +1,10 @@
1
1
  import * as react from 'react';
2
2
  import { PropsWithChildren } from 'react';
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-DzjWdlAk.mjs';
3
+ import { P as PopmeltOptions, C as CommentMeta } from './options-5yRxW1AX.mjs';
4
+ export { a as CommentMetaContext, b as CommentMetaValue, G as GetCommentMeta, c as PopmeltExtension, d as PopmeltExtensionRuntime } from './options-5yRxW1AX.mjs';
5
+ import { I as ImageSubjectAdapterOptions, V as VideoSubjectAdapterOptions } from './video-adapter-CCLbp86L.mjs';
6
+ 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-DzjWdlAk.mjs';
4
7
  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 PopmeltSubjectOutlinePoint, j as PopmeltSubjectTrackingAnchor, k as PopmeltSurfaceSnapshot, R as ReactSourceLocation, l as StyleChange, m as ToolType, V as VideoObjectContext } from './subjects-DzjWdlAk.mjs';
5
- import { I as ImageRecognitionProvider, V as VideoTrackingProvider, a as VideoSegmentationProvider, b as ImageSubjectAdapterOptions, c as VideoSubjectAdapterOptions } from './video-adapter-C5qDzl4Q.mjs';
6
8
 
7
9
  /** Client-side envelope used for persisted and streaming bridge events. */
8
10
  type BridgeEvent = {
@@ -11,55 +13,6 @@ type BridgeEvent = {
11
13
  timestamp: number;
12
14
  };
13
15
 
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
- /** Read-only inspection uses the same collector without submitting a comment. */
22
- purpose?: 'inspection';
23
- timestamp: number;
24
- url: string;
25
- pathname: string;
26
- annotations: readonly Readonly<Annotation>[];
27
- } | {
28
- kind: 'reply';
29
- timestamp: number;
30
- url: string;
31
- pathname: string;
32
- threadId: string;
33
- reply: string;
34
- annotations: readonly Readonly<Annotation>[];
35
- };
36
- type GetCommentMeta = (context: CommentMetaContext) => CommentMeta | undefined | Promise<CommentMeta | undefined>;
37
-
38
- type PopmeltExtensionRuntime = {
39
- /** Optional perception contribution for Core's built-in image adapter. */
40
- imageRecognition?: ImageRecognitionProvider;
41
- /** Optional perception contribution for Core's built-in video adapter. */
42
- videoTracking?: VideoTrackingProvider;
43
- /** Optional point-prompted perception for Core's built-in video adapter. */
44
- videoSegmentation?: VideoSegmentationProvider;
45
- /** Optional non-DOM subject adapters contributed by the extension. */
46
- subjectAdapters?: readonly PopmeltSubjectAdapter[];
47
- /** Release extension-owned resources. */
48
- dispose?(): void | Promise<void>;
49
- };
50
- type PopmeltExtension = {
51
- /** Stable package-level identity used to reconcile extension configuration. */
52
- id: string;
53
- /** Stable signature for configuration changes that require reactivation. */
54
- configurationKey: string;
55
- /** Activate lazily after the Core provider mounts in the browser. */
56
- activate(): PopmeltExtensionRuntime;
57
- };
58
-
59
- type ImageAnnotationOptions = Omit<ImageSubjectAdapterOptions, 'id'>;
60
-
61
- type VideoAnnotationOptions = Omit<VideoSubjectAdapterOptions, 'id'>;
62
-
63
16
  type PopmeltContextValue = {
64
17
  isEnabled: boolean;
65
18
  registerSubjectAdapter(adapter: PopmeltSubjectAdapter): () => void;
@@ -73,27 +26,13 @@ declare global {
73
26
  }
74
27
  }
75
28
 
76
- type PopmeltProviderProps = PropsWithChildren<{
77
- enabled?: boolean;
78
- bridgeUrl?: string;
79
- /** Stable project id generated by the framework plugin/bridge startup. */
80
- projectId?: string | null;
81
- /** Framework router push — used for multi-page screenshot capture.
82
- * Pass your SPA router's navigate function (e.g. Next.js `router.push`). */
83
- navigate?: (url: string) => void | Promise<unknown>;
84
- /** Optional non-DOM renderer adapters, such as Three.js scene subjects. */
85
- subjectAdapters?: readonly PopmeltSubjectAdapter[];
86
- /** Optional packages that contribute perception or additional subject surfaces. */
87
- extensions?: readonly PopmeltExtension[];
88
- /** Manual image annotation is enabled by default; false disables the built-in adapter. */
89
- imageAnnotation?: boolean | ImageAnnotationOptions;
90
- /** Manual video annotation is on by default; See may contribute tracking. */
91
- videoAnnotation?: boolean | VideoAnnotationOptions;
92
- /** Capture application-owned JSON context with each submitted human turn. */
93
- getCommentMeta?: GetCommentMeta;
94
- }>;
29
+ type PopmeltProviderProps = PropsWithChildren<PopmeltOptions>;
95
30
  declare function PopmeltProvider({ children, enabled, ...props }: PopmeltProviderProps): react.JSX.Element;
96
31
 
32
+ type ImageAnnotationOptions = Omit<ImageSubjectAdapterOptions, 'id'>;
33
+
34
+ type VideoAnnotationOptions = Omit<VideoSubjectAdapterOptions, 'id'>;
35
+
97
36
  type AnnotationData = {
98
37
  id: string;
99
38
  type: string;
@@ -127,4 +66,4 @@ type FeedbackData = {
127
66
  meta?: CommentMeta;
128
67
  };
129
68
 
130
- 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 };
69
+ export { Annotation, type BridgeEvent, CommentMeta, ElementInfo, type FeedbackData, type ImageAnnotationOptions, PopmeltProvider, type PopmeltProviderProps, PopmeltSubjectAdapter, StyleModification, type VideoAnnotationOptions, usePopmelt };