web-remarq 0.5.0 → 0.7.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.cts CHANGED
@@ -22,6 +22,16 @@ interface ElementFingerprint {
22
22
  detectedSource: string | null;
23
23
  detectedComponent: string | null;
24
24
  }
25
+ type AnnotationStatus = 'pending' | 'in_progress' | 'fixed_unverified' | 'verified' | 'dismissed';
26
+ type Actor = 'designer' | 'agent' | 'developer';
27
+ type AnnotationEventType = 'created' | 'acknowledged' | 'fix_claimed' | 'verified' | 'rejected' | 'dismissed' | 'reopened' | 'migrated';
28
+ interface AnnotationEvent {
29
+ type: AnnotationEventType;
30
+ actor: Actor | null;
31
+ actorName?: string;
32
+ timestamp: number;
33
+ reason?: string;
34
+ }
25
35
  interface Annotation {
26
36
  id: string;
27
37
  comment: string;
@@ -30,7 +40,8 @@ interface Annotation {
30
40
  viewport: string;
31
41
  viewportBucket: number;
32
42
  timestamp: number;
33
- status: 'pending' | 'resolved';
43
+ status: AnnotationStatus;
44
+ lifecycle: AnnotationEvent[];
34
45
  }
35
46
  interface AnnotationStore {
36
47
  version: 1;
@@ -43,6 +54,7 @@ interface WebRemarqOptions {
43
54
  dataAttribute?: string;
44
55
  position?: ToolbarPosition;
45
56
  shortcuts?: boolean;
57
+ storage?: StorageAdapter;
46
58
  }
47
59
  interface ImportResult {
48
60
  total: number;
@@ -68,14 +80,21 @@ interface AgentAnnotationSource {
68
80
  column: number;
69
81
  component: string | null;
70
82
  }
83
+ interface AgentLifecycleEvent {
84
+ type: AnnotationEventType;
85
+ actor: Actor | null;
86
+ timestamp: number;
87
+ reason?: string;
88
+ }
71
89
  interface AgentAnnotation {
72
90
  id: string;
73
91
  route: string;
74
92
  comment: string;
75
- status: 'pending' | 'resolved';
93
+ status: AnnotationStatus;
76
94
  timestamp: number;
77
95
  source: AgentAnnotationSource | null;
78
96
  searchHints: AgentSearchHints;
97
+ lifecycle: AgentLifecycleEvent[];
79
98
  }
80
99
  interface AgentExport {
81
100
  version: 1;
@@ -83,7 +102,25 @@ interface AgentExport {
83
102
  viewportBucket: number;
84
103
  annotations: AgentAnnotation[];
85
104
  }
105
+ interface StorageChangeEvent {
106
+ type: 'add' | 'update' | 'remove' | 'clear';
107
+ annotation?: Annotation;
108
+ id?: string;
109
+ }
110
+ interface StorageAdapter {
111
+ load(): Promise<AnnotationStore | null>;
112
+ save(annotation: Annotation): Promise<void>;
113
+ remove(id: string): Promise<void>;
114
+ clear(): Promise<void>;
115
+ subscribe?(callback: (event: StorageChangeEvent) => void): () => void;
116
+ readonly isMemoryOnly?: boolean;
117
+ }
86
118
 
119
+ interface TransitionOpts {
120
+ actor?: Actor;
121
+ actorName?: string;
122
+ reason?: string;
123
+ }
87
124
  declare const WebRemarq: {
88
125
  init(opts?: WebRemarqOptions): void;
89
126
  destroy(): void;
@@ -93,6 +130,26 @@ declare const WebRemarq: {
93
130
  import(file: File): Promise<ImportResult>;
94
131
  getAnnotations(route?: string): Annotation[];
95
132
  clearAll(): void;
133
+ acknowledge(id: string, opts?: TransitionOpts): void;
134
+ claimFix(id: string, opts?: TransitionOpts): void;
135
+ verify(id: string, opts?: TransitionOpts): void;
136
+ reject(id: string, opts?: TransitionOpts): void;
137
+ dismiss(id: string, opts?: TransitionOpts): void;
138
+ reopen(id: string, opts?: TransitionOpts): void;
139
+ /** @deprecated Use verify() instead. */
140
+ markResolved(id: string): void;
96
141
  };
97
142
 
98
- export { type AgentAnnotation, type AgentExport, type Annotation, type AnnotationStore, type CSSModuleClass, type ElementFingerprint, type ImportResult, type ToolbarPosition, WebRemarq, type WebRemarqOptions };
143
+ declare class LocalStorageAdapter implements StorageAdapter {
144
+ isMemoryOnly: boolean;
145
+ private extraFields;
146
+ private memoryStore;
147
+ load(): Promise<AnnotationStore | null>;
148
+ save(annotation: Annotation): Promise<void>;
149
+ remove(id: string): Promise<void>;
150
+ clear(): Promise<void>;
151
+ private ensureStore;
152
+ private persist;
153
+ }
154
+
155
+ export { type Actor, type AgentAnnotation, type AgentExport, type AgentLifecycleEvent, type Annotation, type AnnotationEvent, type AnnotationEventType, type AnnotationStatus, type AnnotationStore, type CSSModuleClass, type ElementFingerprint, type ImportResult, LocalStorageAdapter, type StorageAdapter, type StorageChangeEvent, type ToolbarPosition, WebRemarq, type WebRemarqOptions };
package/dist/index.d.ts CHANGED
@@ -22,6 +22,16 @@ interface ElementFingerprint {
22
22
  detectedSource: string | null;
23
23
  detectedComponent: string | null;
24
24
  }
25
+ type AnnotationStatus = 'pending' | 'in_progress' | 'fixed_unverified' | 'verified' | 'dismissed';
26
+ type Actor = 'designer' | 'agent' | 'developer';
27
+ type AnnotationEventType = 'created' | 'acknowledged' | 'fix_claimed' | 'verified' | 'rejected' | 'dismissed' | 'reopened' | 'migrated';
28
+ interface AnnotationEvent {
29
+ type: AnnotationEventType;
30
+ actor: Actor | null;
31
+ actorName?: string;
32
+ timestamp: number;
33
+ reason?: string;
34
+ }
25
35
  interface Annotation {
26
36
  id: string;
27
37
  comment: string;
@@ -30,7 +40,8 @@ interface Annotation {
30
40
  viewport: string;
31
41
  viewportBucket: number;
32
42
  timestamp: number;
33
- status: 'pending' | 'resolved';
43
+ status: AnnotationStatus;
44
+ lifecycle: AnnotationEvent[];
34
45
  }
35
46
  interface AnnotationStore {
36
47
  version: 1;
@@ -43,6 +54,7 @@ interface WebRemarqOptions {
43
54
  dataAttribute?: string;
44
55
  position?: ToolbarPosition;
45
56
  shortcuts?: boolean;
57
+ storage?: StorageAdapter;
46
58
  }
47
59
  interface ImportResult {
48
60
  total: number;
@@ -68,14 +80,21 @@ interface AgentAnnotationSource {
68
80
  column: number;
69
81
  component: string | null;
70
82
  }
83
+ interface AgentLifecycleEvent {
84
+ type: AnnotationEventType;
85
+ actor: Actor | null;
86
+ timestamp: number;
87
+ reason?: string;
88
+ }
71
89
  interface AgentAnnotation {
72
90
  id: string;
73
91
  route: string;
74
92
  comment: string;
75
- status: 'pending' | 'resolved';
93
+ status: AnnotationStatus;
76
94
  timestamp: number;
77
95
  source: AgentAnnotationSource | null;
78
96
  searchHints: AgentSearchHints;
97
+ lifecycle: AgentLifecycleEvent[];
79
98
  }
80
99
  interface AgentExport {
81
100
  version: 1;
@@ -83,7 +102,25 @@ interface AgentExport {
83
102
  viewportBucket: number;
84
103
  annotations: AgentAnnotation[];
85
104
  }
105
+ interface StorageChangeEvent {
106
+ type: 'add' | 'update' | 'remove' | 'clear';
107
+ annotation?: Annotation;
108
+ id?: string;
109
+ }
110
+ interface StorageAdapter {
111
+ load(): Promise<AnnotationStore | null>;
112
+ save(annotation: Annotation): Promise<void>;
113
+ remove(id: string): Promise<void>;
114
+ clear(): Promise<void>;
115
+ subscribe?(callback: (event: StorageChangeEvent) => void): () => void;
116
+ readonly isMemoryOnly?: boolean;
117
+ }
86
118
 
119
+ interface TransitionOpts {
120
+ actor?: Actor;
121
+ actorName?: string;
122
+ reason?: string;
123
+ }
87
124
  declare const WebRemarq: {
88
125
  init(opts?: WebRemarqOptions): void;
89
126
  destroy(): void;
@@ -93,6 +130,26 @@ declare const WebRemarq: {
93
130
  import(file: File): Promise<ImportResult>;
94
131
  getAnnotations(route?: string): Annotation[];
95
132
  clearAll(): void;
133
+ acknowledge(id: string, opts?: TransitionOpts): void;
134
+ claimFix(id: string, opts?: TransitionOpts): void;
135
+ verify(id: string, opts?: TransitionOpts): void;
136
+ reject(id: string, opts?: TransitionOpts): void;
137
+ dismiss(id: string, opts?: TransitionOpts): void;
138
+ reopen(id: string, opts?: TransitionOpts): void;
139
+ /** @deprecated Use verify() instead. */
140
+ markResolved(id: string): void;
96
141
  };
97
142
 
98
- export { type AgentAnnotation, type AgentExport, type Annotation, type AnnotationStore, type CSSModuleClass, type ElementFingerprint, type ImportResult, type ToolbarPosition, WebRemarq, type WebRemarqOptions };
143
+ declare class LocalStorageAdapter implements StorageAdapter {
144
+ isMemoryOnly: boolean;
145
+ private extraFields;
146
+ private memoryStore;
147
+ load(): Promise<AnnotationStore | null>;
148
+ save(annotation: Annotation): Promise<void>;
149
+ remove(id: string): Promise<void>;
150
+ clear(): Promise<void>;
151
+ private ensureStore;
152
+ private persist;
153
+ }
154
+
155
+ export { type Actor, type AgentAnnotation, type AgentExport, type AgentLifecycleEvent, type Annotation, type AnnotationEvent, type AnnotationEventType, type AnnotationStatus, type AnnotationStore, type CSSModuleClass, type ElementFingerprint, type ImportResult, LocalStorageAdapter, type StorageAdapter, type StorageChangeEvent, type ToolbarPosition, WebRemarq, type WebRemarqOptions };