@designfever/web-review-kit 0.7.3 → 0.8.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.
@@ -1,8 +1,8 @@
1
- type ReviewItemKind = 'note' | 'area';
1
+ type ReviewItemKind = 'dom' | 'area';
2
2
  type ReviewItemScope = 'mobile' | 'tablet' | 'desktop' | 'wide' | 'dom';
3
3
  type ReviewWorkflowStatus = 'todo' | 'doing' | 'review' | 'hold' | 'done';
4
4
  type ReviewItemStatus = 'open' | 'resolved' | ReviewWorkflowStatus;
5
- type ReviewMode = 'idle' | 'note' | 'element' | 'area';
5
+ type ReviewMode = 'idle' | 'element' | 'area';
6
6
  type ReviewSource = 'local' | 'supabase' | (string & {});
7
7
  type ReviewSubmitStatus = 'idle' | 'submitting' | 'submitted' | 'failed';
8
8
  type ReviewViewportScope = Exclude<ReviewItemScope, 'dom'>;
@@ -44,6 +44,61 @@ interface ReviewAssigneeOption {
44
44
  value: string;
45
45
  label: string;
46
46
  }
47
+ type ReviewExternalLinkIcon = 'external' | 'github' | 'issue' | 'jira' | 'sheet' | (string & {});
48
+ interface ReviewExternalLink {
49
+ label: string;
50
+ url: string;
51
+ title?: string;
52
+ icon?: ReviewExternalLinkIcon;
53
+ }
54
+ type ReviewAttachmentKind = 'file' | 'image' | 'capture' | (string & {});
55
+ interface ReviewAttachment {
56
+ id?: string;
57
+ url: string;
58
+ name: string;
59
+ mime: string;
60
+ size: number;
61
+ kind?: ReviewAttachmentKind;
62
+ width?: number;
63
+ height?: number;
64
+ metadata?: Record<string, unknown>;
65
+ createdAt?: string;
66
+ }
67
+ interface ReviewAttachmentUploadInput {
68
+ file: File | Blob;
69
+ name?: string;
70
+ mime?: string;
71
+ kind?: ReviewAttachmentKind;
72
+ item?: ReviewItem;
73
+ metadata?: Record<string, unknown>;
74
+ }
75
+ type ReviewAttachmentUploadErrorReason = 'quota-exceeded' | 'storage-full' | 'unsupported-type' | 'permission-denied' | 'upload-failed' | (string & {});
76
+ interface ReviewAttachmentUploadError extends Error {
77
+ reason: ReviewAttachmentUploadErrorReason;
78
+ }
79
+ interface ReviewViewportCaptureInput {
80
+ routeKey: string;
81
+ pageUrl: string;
82
+ originalUrl?: string;
83
+ viewport: ViewportSize;
84
+ captureRegion?: RelativeSelection;
85
+ devicePixelRatio?: number;
86
+ scroll: {
87
+ x: number;
88
+ y: number;
89
+ };
90
+ marker?: ReviewMarker;
91
+ selection?: ReviewSelection;
92
+ timestamp: string;
93
+ }
94
+ interface ReviewViewportCaptureResult {
95
+ file: Blob;
96
+ name?: string;
97
+ mime?: string;
98
+ width?: number;
99
+ height?: number;
100
+ metadata?: Record<string, unknown>;
101
+ }
47
102
  interface ReviewPoint {
48
103
  x: number;
49
104
  y: number;
@@ -81,8 +136,10 @@ interface ReviewItem {
81
136
  anchor?: DomAnchor;
82
137
  marker?: ReviewMarker;
83
138
  selection?: ReviewSelection;
139
+ attachments?: ReviewAttachment[];
84
140
  externalIssueId?: string;
85
141
  externalIssueUrl?: string;
142
+ externalLinks?: ReviewExternalLink[];
86
143
  submittedAt?: string;
87
144
  submitStatus?: ReviewSubmitStatus;
88
145
  submitError?: string;
@@ -102,6 +159,7 @@ interface WebReviewKitAdapter {
102
159
  list(query: ReviewItemQuery): Promise<ReviewItem[]>;
103
160
  create(item: ReviewItem): Promise<ReviewItem>;
104
161
  update(id: string, patch: Partial<Omit<ReviewItem, 'id' | 'createdAt'>>): Promise<ReviewItem>;
162
+ uploadAttachment?(input: ReviewAttachmentUploadInput): Promise<ReviewAttachment>;
105
163
  remove(id: string): Promise<void>;
106
164
  }
107
165
  interface LocalAdapterOptions {
@@ -163,6 +221,7 @@ interface WebReviewKitOptions {
163
221
  onModeChange?: (mode: ReviewMode) => void;
164
222
  ui?: {
165
223
  panel?: boolean;
224
+ markers?: 'inline' | 'external';
166
225
  };
167
226
  modules?: {
168
227
  qa?: boolean;
@@ -189,6 +248,7 @@ interface WebReviewKitTarget {
189
248
  getViewportRect?: () => Pick<DOMRect, 'left' | 'top' | 'width' | 'height'>;
190
249
  getOverlayRect?: () => Pick<DOMRect, 'left' | 'top' | 'width' | 'height'>;
191
250
  getComposerHost?: () => HTMLElement | null | undefined;
251
+ captureViewport?: (input: ReviewViewportCaptureInput) => Promise<ReviewViewportCaptureResult>;
192
252
  }
193
253
 
194
- export type { DomAnchor as D, LocalAdapterOptions as L, NumberedReviewItem as N, ReviewWorkflowStatus as R, SupabaseReviewAdapterOptions as S, ViewportSize as V, WebReviewKitAdapter as W, ReviewItemStatus as a, WebReviewKitOptions as b, WebReviewKitController as c, ReviewViewportPreset as d, ReviewItem as e, ReviewItemScope as f, DomAnchorCandidate as g, DomAnchorStrategy as h, DomSourceHint as i, RelativeSelection as j, ReviewAssigneeOption as k, ReviewItemKind as l, ReviewItemQuery as m, ReviewMarker as n, ReviewMode as o, ReviewPoint as p, ReviewRulerConfig as q, ReviewSelection as r, ReviewSource as s, ReviewSubmitStatus as t, ReviewViewportScope as u, SupabaseReviewClient as v, WebReviewKitTarget as w, ReviewFieldsConfig as x };
254
+ export type { ReviewSubmitStatus as A, ReviewViewportScope as B, SupabaseReviewClient as C, DomAnchor as D, WebReviewKitTarget as E, ReviewFieldsConfig as F, LocalAdapterOptions as L, NumberedReviewItem as N, ReviewWorkflowStatus as R, SupabaseReviewAdapterOptions as S, ViewportSize as V, WebReviewKitAdapter as W, ReviewItemStatus as a, WebReviewKitOptions as b, WebReviewKitController as c, ReviewViewportPreset as d, ReviewItem as e, ReviewItemScope as f, DomAnchorCandidate as g, DomAnchorStrategy as h, DomSourceHint as i, RelativeSelection as j, ReviewAssigneeOption as k, ReviewAttachment as l, ReviewAttachmentKind as m, ReviewAttachmentUploadError as n, ReviewAttachmentUploadErrorReason as o, ReviewAttachmentUploadInput as p, ReviewExternalLink as q, ReviewExternalLinkIcon as r, ReviewItemKind as s, ReviewItemQuery as t, ReviewMarker as u, ReviewMode as v, ReviewPoint as w, ReviewRulerConfig as x, ReviewSelection as y, ReviewSource as z };
@@ -1,8 +1,8 @@
1
- type ReviewItemKind = 'note' | 'area';
1
+ type ReviewItemKind = 'dom' | 'area';
2
2
  type ReviewItemScope = 'mobile' | 'tablet' | 'desktop' | 'wide' | 'dom';
3
3
  type ReviewWorkflowStatus = 'todo' | 'doing' | 'review' | 'hold' | 'done';
4
4
  type ReviewItemStatus = 'open' | 'resolved' | ReviewWorkflowStatus;
5
- type ReviewMode = 'idle' | 'note' | 'element' | 'area';
5
+ type ReviewMode = 'idle' | 'element' | 'area';
6
6
  type ReviewSource = 'local' | 'supabase' | (string & {});
7
7
  type ReviewSubmitStatus = 'idle' | 'submitting' | 'submitted' | 'failed';
8
8
  type ReviewViewportScope = Exclude<ReviewItemScope, 'dom'>;
@@ -44,6 +44,61 @@ interface ReviewAssigneeOption {
44
44
  value: string;
45
45
  label: string;
46
46
  }
47
+ type ReviewExternalLinkIcon = 'external' | 'github' | 'issue' | 'jira' | 'sheet' | (string & {});
48
+ interface ReviewExternalLink {
49
+ label: string;
50
+ url: string;
51
+ title?: string;
52
+ icon?: ReviewExternalLinkIcon;
53
+ }
54
+ type ReviewAttachmentKind = 'file' | 'image' | 'capture' | (string & {});
55
+ interface ReviewAttachment {
56
+ id?: string;
57
+ url: string;
58
+ name: string;
59
+ mime: string;
60
+ size: number;
61
+ kind?: ReviewAttachmentKind;
62
+ width?: number;
63
+ height?: number;
64
+ metadata?: Record<string, unknown>;
65
+ createdAt?: string;
66
+ }
67
+ interface ReviewAttachmentUploadInput {
68
+ file: File | Blob;
69
+ name?: string;
70
+ mime?: string;
71
+ kind?: ReviewAttachmentKind;
72
+ item?: ReviewItem;
73
+ metadata?: Record<string, unknown>;
74
+ }
75
+ type ReviewAttachmentUploadErrorReason = 'quota-exceeded' | 'storage-full' | 'unsupported-type' | 'permission-denied' | 'upload-failed' | (string & {});
76
+ interface ReviewAttachmentUploadError extends Error {
77
+ reason: ReviewAttachmentUploadErrorReason;
78
+ }
79
+ interface ReviewViewportCaptureInput {
80
+ routeKey: string;
81
+ pageUrl: string;
82
+ originalUrl?: string;
83
+ viewport: ViewportSize;
84
+ captureRegion?: RelativeSelection;
85
+ devicePixelRatio?: number;
86
+ scroll: {
87
+ x: number;
88
+ y: number;
89
+ };
90
+ marker?: ReviewMarker;
91
+ selection?: ReviewSelection;
92
+ timestamp: string;
93
+ }
94
+ interface ReviewViewportCaptureResult {
95
+ file: Blob;
96
+ name?: string;
97
+ mime?: string;
98
+ width?: number;
99
+ height?: number;
100
+ metadata?: Record<string, unknown>;
101
+ }
47
102
  interface ReviewPoint {
48
103
  x: number;
49
104
  y: number;
@@ -81,8 +136,10 @@ interface ReviewItem {
81
136
  anchor?: DomAnchor;
82
137
  marker?: ReviewMarker;
83
138
  selection?: ReviewSelection;
139
+ attachments?: ReviewAttachment[];
84
140
  externalIssueId?: string;
85
141
  externalIssueUrl?: string;
142
+ externalLinks?: ReviewExternalLink[];
86
143
  submittedAt?: string;
87
144
  submitStatus?: ReviewSubmitStatus;
88
145
  submitError?: string;
@@ -102,6 +159,7 @@ interface WebReviewKitAdapter {
102
159
  list(query: ReviewItemQuery): Promise<ReviewItem[]>;
103
160
  create(item: ReviewItem): Promise<ReviewItem>;
104
161
  update(id: string, patch: Partial<Omit<ReviewItem, 'id' | 'createdAt'>>): Promise<ReviewItem>;
162
+ uploadAttachment?(input: ReviewAttachmentUploadInput): Promise<ReviewAttachment>;
105
163
  remove(id: string): Promise<void>;
106
164
  }
107
165
  interface LocalAdapterOptions {
@@ -163,6 +221,7 @@ interface WebReviewKitOptions {
163
221
  onModeChange?: (mode: ReviewMode) => void;
164
222
  ui?: {
165
223
  panel?: boolean;
224
+ markers?: 'inline' | 'external';
166
225
  };
167
226
  modules?: {
168
227
  qa?: boolean;
@@ -189,6 +248,7 @@ interface WebReviewKitTarget {
189
248
  getViewportRect?: () => Pick<DOMRect, 'left' | 'top' | 'width' | 'height'>;
190
249
  getOverlayRect?: () => Pick<DOMRect, 'left' | 'top' | 'width' | 'height'>;
191
250
  getComposerHost?: () => HTMLElement | null | undefined;
251
+ captureViewport?: (input: ReviewViewportCaptureInput) => Promise<ReviewViewportCaptureResult>;
192
252
  }
193
253
 
194
- export type { DomAnchor as D, LocalAdapterOptions as L, NumberedReviewItem as N, ReviewWorkflowStatus as R, SupabaseReviewAdapterOptions as S, ViewportSize as V, WebReviewKitAdapter as W, ReviewItemStatus as a, WebReviewKitOptions as b, WebReviewKitController as c, ReviewViewportPreset as d, ReviewItem as e, ReviewItemScope as f, DomAnchorCandidate as g, DomAnchorStrategy as h, DomSourceHint as i, RelativeSelection as j, ReviewAssigneeOption as k, ReviewItemKind as l, ReviewItemQuery as m, ReviewMarker as n, ReviewMode as o, ReviewPoint as p, ReviewRulerConfig as q, ReviewSelection as r, ReviewSource as s, ReviewSubmitStatus as t, ReviewViewportScope as u, SupabaseReviewClient as v, WebReviewKitTarget as w, ReviewFieldsConfig as x };
254
+ export type { ReviewSubmitStatus as A, ReviewViewportScope as B, SupabaseReviewClient as C, DomAnchor as D, WebReviewKitTarget as E, ReviewFieldsConfig as F, LocalAdapterOptions as L, NumberedReviewItem as N, ReviewWorkflowStatus as R, SupabaseReviewAdapterOptions as S, ViewportSize as V, WebReviewKitAdapter as W, ReviewItemStatus as a, WebReviewKitOptions as b, WebReviewKitController as c, ReviewViewportPreset as d, ReviewItem as e, ReviewItemScope as f, DomAnchorCandidate as g, DomAnchorStrategy as h, DomSourceHint as i, RelativeSelection as j, ReviewAssigneeOption as k, ReviewAttachment as l, ReviewAttachmentKind as m, ReviewAttachmentUploadError as n, ReviewAttachmentUploadErrorReason as o, ReviewAttachmentUploadInput as p, ReviewExternalLink as q, ReviewExternalLinkIcon as r, ReviewItemKind as s, ReviewItemQuery as t, ReviewMarker as u, ReviewMode as v, ReviewPoint as w, ReviewRulerConfig as x, ReviewSelection as y, ReviewSource as z };