@diegotsi/flint-react 0.6.0 → 1.0.1

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.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ export { flint } from '@flint/core';
2
3
 
3
4
  type Severity = "P1" | "P2" | "P3" | "P4";
4
5
  interface EnvironmentInfo {
@@ -33,6 +34,7 @@ interface ThemeOverride {
33
34
  interface FlintUser {
34
35
  id: string;
35
36
  name: string;
37
+ email?: string;
36
38
  }
37
39
  interface FlintExtraFields {
38
40
  /** Session replay URL from Datadog RUM, FullStory, LogRocket, etc. Pass a function for lazy evaluation. */
@@ -58,6 +60,8 @@ interface FlintWidgetProps {
58
60
  theme?: Theme;
59
61
  /** Custom z-index for the widget. Default: 9999 */
60
62
  zIndex?: number;
63
+ /** URL of the admin/status page for reporters to track their bugs */
64
+ statusPageUrl?: string;
61
65
  /**
62
66
  * Datadog site hostname for auto-generating RUM Session Replay deep links.
63
67
  * When set, the widget auto-detects `window.DD_RUM` and generates a direct
@@ -65,10 +69,33 @@ interface FlintWidgetProps {
65
69
  * Examples: "app.datadoghq.com", "app.datadoghq.eu", "app.us5.datadoghq.com"
66
70
  */
67
71
  datadogSite?: string;
72
+ /** Enable session replay recording. Default: true */
73
+ enableReplay?: boolean;
74
+ /** Enable screenshot capture. Default: true */
75
+ enableScreenshot?: boolean;
76
+ /** Enable console log collection. Default: true */
77
+ enableConsole?: boolean;
78
+ /** Enable network error collection. Default: true */
79
+ enableNetwork?: boolean;
80
+ /** Enable frustration detection (rage clicks, dead clicks, error loops). Default: false */
81
+ enableFrustration?: boolean;
82
+ /** Auto-submit bug report on frustration detection. Default: false */
83
+ autoReportFrustration?: boolean;
84
+ /** Called before report submission. Return false to cancel. */
85
+ onBeforeSubmit?: (payload: ReportPayload) => boolean | Promise<boolean>;
86
+ /** Called after successful submission */
87
+ onSuccess?: (result: ReportResult) => void;
88
+ /** Called when submission fails */
89
+ onError?: (error: Error) => void;
90
+ /** Called when the modal opens */
91
+ onOpen?: () => void;
92
+ /** Called when the modal closes */
93
+ onClose?: () => void;
68
94
  }
69
95
  interface ReportPayload {
70
96
  reporterId: string;
71
97
  reporterName: string;
98
+ reporterEmail?: string;
72
99
  description: string;
73
100
  expectedBehavior?: string;
74
101
  stepsToReproduce?: {
@@ -91,8 +118,6 @@ interface ReportResult {
91
118
  duplicateOfId?: string | null;
92
119
  }
93
120
 
94
- declare function FlintWidget(props: FlintWidgetProps): react_jsx_runtime.JSX.Element;
95
-
96
121
  declare type addedNodeMutation = {
97
122
  parentId: number;
98
123
  previousId?: number | null;
@@ -524,12 +549,14 @@ interface Props {
524
549
  getReplayEvents: () => eventWithTime[];
525
550
  getExternalReplayUrl: () => string | undefined;
526
551
  initialSelection?: string;
552
+ enableScreenshot?: boolean;
553
+ statusPageUrl?: string;
554
+ onBeforeSubmit?: (payload: ReportPayload) => boolean | Promise<boolean>;
555
+ onSuccess?: (result: ReportResult) => void;
556
+ onError?: (error: Error) => void;
527
557
  }
528
- declare function FlintModal({ projectKey, serverUrl, user, meta, theme, zIndex, onClose, getEnvironment, getConsoleLogs, getNetworkErrors, getReplayEvents, getExternalReplayUrl, initialSelection, }: Props): react_jsx_runtime.JSX.Element;
558
+ declare function FlintModal({ projectKey, serverUrl, user, meta, theme, zIndex, onClose, getEnvironment, getConsoleLogs, getNetworkErrors, getReplayEvents, getExternalReplayUrl, initialSelection, enableScreenshot, statusPageUrl, onBeforeSubmit, onSuccess, onError, }: Props): react_jsx_runtime.JSX.Element;
529
559
 
530
- declare const flint: {
531
- setUser(user: FlintUser | null): void;
532
- setSessionReplay(url: string | (() => string)): void;
533
- };
560
+ declare function FlintWidget(props: FlintWidgetProps): react_jsx_runtime.JSX.Element;
534
561
 
535
- export { FlintModal, type FlintUser, FlintWidget, type FlintWidgetProps, type Locale, type ReportPayload, type ReportResult, type Severity, type Theme, type ThemeOverride, flint };
562
+ export { FlintModal, type FlintUser, FlintWidget, type FlintWidgetProps, type Locale, type ReportPayload, type ReportResult, type Severity, type Theme, type ThemeOverride };