glitchgrab 1.10.0 → 1.12.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 CHANGED
@@ -118,9 +118,12 @@ function MyComponent() {
118
118
  // Report with a specific type
119
119
  await report("FEATURE_REQUEST", "Add dark mode support");
120
120
 
121
- // Open the Report Bug modal programmatically (captures screenshot + shows dialog)
121
+ // Open the Report Bug modal (captures screenshot + shows dialog)
122
122
  openReportDialog();
123
123
 
124
+ // Open with pre-filled description
125
+ openReportDialog({ description: "Error on /settings: Something went wrong" });
126
+
124
127
  // Add custom breadcrumbs for debugging context
125
128
  addBreadcrumb("User clicked checkout", { cartSize: "3" });
126
129
  }
package/dist/index.d.mts CHANGED
@@ -14,6 +14,7 @@ interface GlitchgrabConfig {
14
14
  maxBreadcrumbs?: number;
15
15
  }
16
16
  type ReportType = "BUG" | "FEATURE_REQUEST" | "QUESTION" | "OTHER";
17
+ type ReportSeverity = "low" | "medium" | "high";
17
18
  interface ReportPayload {
18
19
  token: string;
19
20
  source: "SDK_AUTO" | "SDK_USER_REPORT";
@@ -93,6 +94,10 @@ interface ReportButtonProps {
93
94
  className?: string;
94
95
  /** Allow reporting feature requests, questions, not just bugs */
95
96
  types?: ReportType[];
97
+ /** Dialog variant: "classic" (single screen) or "stepper" (3-step wizard). Default: "classic" */
98
+ variant?: "classic" | "stepper";
99
+ /** Show severity picker in stepper mode for BUG type. Default: true */
100
+ showSeverity?: boolean;
96
101
  }
97
102
  interface UseGlitchgrabReturn {
98
103
  /** Report a bug programmatically */
@@ -102,7 +107,10 @@ interface UseGlitchgrabReturn {
102
107
  /** Add a custom breadcrumb */
103
108
  addBreadcrumb: (message: string, data?: Record<string, string>) => void;
104
109
  /** Open the ReportButton modal programmatically (captures screenshot + shows dialog) */
105
- openReportDialog: () => void;
110
+ openReportDialog: (options?: {
111
+ description?: string;
112
+ type?: ReportType;
113
+ }) => void;
106
114
  /** The token being used */
107
115
  token: string;
108
116
  /** The base URL of the Glitchgrab API */
@@ -129,7 +137,7 @@ interface UseGlitchgrabReturn {
129
137
  declare function useGlitchgrab(): UseGlitchgrabReturn;
130
138
  declare function GlitchgrabProvider(props: GlitchgrabProviderProps): react_jsx_runtime.JSX.Element;
131
139
 
132
- declare function ReportButton({ position, label, className, children, }: ReportButtonProps & {
140
+ declare function ReportButton({ position, label, className, variant, showSeverity, types, children, }: ReportButtonProps & {
133
141
  /** Render prop — receives { onClick, capturing } so you can use your own trigger button */
134
142
  children?: (props: {
135
143
  onClick: () => void;
@@ -166,6 +174,8 @@ interface GlitchgrabReport {
166
174
  reporterPhone: string | null;
167
175
  pageUrl: string | null;
168
176
  createdAt: string;
177
+ /** Number of comments on the linked GitHub issue (0 if no issue) */
178
+ commentCount: number;
169
179
  issue: {
170
180
  githubNumber: number;
171
181
  githubUrl: string;
@@ -259,4 +269,4 @@ declare function captureContext(visitedPages: string[]): CapturedContext;
259
269
  */
260
270
  declare function sendReport(payload: ReportPayload, baseUrl?: string): Promise<ReportResult | null>;
261
271
 
262
- export { type Breadcrumb, type BreadcrumbType, type CapturedContext, type DeviceInfo, type GlitchgrabConfig, GlitchgrabErrorBoundary, GlitchgrabProvider, type GlitchgrabProviderProps, type GlitchgrabSession, ReportButton, type ReportButtonProps, type ReportPayload, type ReportResult, type ReportType, type UseGlitchgrabReturn, addBreadcrumb, captureContext, captureDeviceInfo, clearBreadcrumbs, fetchGlitchgrabReports, getBreadcrumbs, initBreadcrumbs, sanitizeUrl, sendReport, useGlitchgrab, useGlitchgrabActions, useGlitchgrabReports };
272
+ export { type Breadcrumb, type BreadcrumbType, type CapturedContext, type DeviceInfo, type GlitchgrabConfig, GlitchgrabErrorBoundary, GlitchgrabProvider, type GlitchgrabProviderProps, type GlitchgrabReport, type GlitchgrabSession, ReportButton, type ReportButtonProps, type ReportPayload, type ReportResult, type ReportSeverity, type ReportType, type UseGlitchgrabReturn, addBreadcrumb, captureContext, captureDeviceInfo, clearBreadcrumbs, fetchGlitchgrabReports, getBreadcrumbs, initBreadcrumbs, sanitizeUrl, sendReport, useGlitchgrab, useGlitchgrabActions, useGlitchgrabReports };
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ interface GlitchgrabConfig {
14
14
  maxBreadcrumbs?: number;
15
15
  }
16
16
  type ReportType = "BUG" | "FEATURE_REQUEST" | "QUESTION" | "OTHER";
17
+ type ReportSeverity = "low" | "medium" | "high";
17
18
  interface ReportPayload {
18
19
  token: string;
19
20
  source: "SDK_AUTO" | "SDK_USER_REPORT";
@@ -93,6 +94,10 @@ interface ReportButtonProps {
93
94
  className?: string;
94
95
  /** Allow reporting feature requests, questions, not just bugs */
95
96
  types?: ReportType[];
97
+ /** Dialog variant: "classic" (single screen) or "stepper" (3-step wizard). Default: "classic" */
98
+ variant?: "classic" | "stepper";
99
+ /** Show severity picker in stepper mode for BUG type. Default: true */
100
+ showSeverity?: boolean;
96
101
  }
97
102
  interface UseGlitchgrabReturn {
98
103
  /** Report a bug programmatically */
@@ -102,7 +107,10 @@ interface UseGlitchgrabReturn {
102
107
  /** Add a custom breadcrumb */
103
108
  addBreadcrumb: (message: string, data?: Record<string, string>) => void;
104
109
  /** Open the ReportButton modal programmatically (captures screenshot + shows dialog) */
105
- openReportDialog: () => void;
110
+ openReportDialog: (options?: {
111
+ description?: string;
112
+ type?: ReportType;
113
+ }) => void;
106
114
  /** The token being used */
107
115
  token: string;
108
116
  /** The base URL of the Glitchgrab API */
@@ -129,7 +137,7 @@ interface UseGlitchgrabReturn {
129
137
  declare function useGlitchgrab(): UseGlitchgrabReturn;
130
138
  declare function GlitchgrabProvider(props: GlitchgrabProviderProps): react_jsx_runtime.JSX.Element;
131
139
 
132
- declare function ReportButton({ position, label, className, children, }: ReportButtonProps & {
140
+ declare function ReportButton({ position, label, className, variant, showSeverity, types, children, }: ReportButtonProps & {
133
141
  /** Render prop — receives { onClick, capturing } so you can use your own trigger button */
134
142
  children?: (props: {
135
143
  onClick: () => void;
@@ -166,6 +174,8 @@ interface GlitchgrabReport {
166
174
  reporterPhone: string | null;
167
175
  pageUrl: string | null;
168
176
  createdAt: string;
177
+ /** Number of comments on the linked GitHub issue (0 if no issue) */
178
+ commentCount: number;
169
179
  issue: {
170
180
  githubNumber: number;
171
181
  githubUrl: string;
@@ -259,4 +269,4 @@ declare function captureContext(visitedPages: string[]): CapturedContext;
259
269
  */
260
270
  declare function sendReport(payload: ReportPayload, baseUrl?: string): Promise<ReportResult | null>;
261
271
 
262
- export { type Breadcrumb, type BreadcrumbType, type CapturedContext, type DeviceInfo, type GlitchgrabConfig, GlitchgrabErrorBoundary, GlitchgrabProvider, type GlitchgrabProviderProps, type GlitchgrabSession, ReportButton, type ReportButtonProps, type ReportPayload, type ReportResult, type ReportType, type UseGlitchgrabReturn, addBreadcrumb, captureContext, captureDeviceInfo, clearBreadcrumbs, fetchGlitchgrabReports, getBreadcrumbs, initBreadcrumbs, sanitizeUrl, sendReport, useGlitchgrab, useGlitchgrabActions, useGlitchgrabReports };
272
+ export { type Breadcrumb, type BreadcrumbType, type CapturedContext, type DeviceInfo, type GlitchgrabConfig, GlitchgrabErrorBoundary, GlitchgrabProvider, type GlitchgrabProviderProps, type GlitchgrabReport, type GlitchgrabSession, ReportButton, type ReportButtonProps, type ReportPayload, type ReportResult, type ReportSeverity, type ReportType, type UseGlitchgrabReturn, addBreadcrumb, captureContext, captureDeviceInfo, clearBreadcrumbs, fetchGlitchgrabReports, getBreadcrumbs, initBreadcrumbs, sanitizeUrl, sendReport, useGlitchgrab, useGlitchgrabActions, useGlitchgrabReports };