@diegotsi/flint-react 0.6.0 → 1.0.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.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,29 @@ 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
+ /** Called before report submission. Return false to cancel. */
81
+ onBeforeSubmit?: (payload: ReportPayload) => boolean | Promise<boolean>;
82
+ /** Called after successful submission */
83
+ onSuccess?: (result: ReportResult) => void;
84
+ /** Called when submission fails */
85
+ onError?: (error: Error) => void;
86
+ /** Called when the modal opens */
87
+ onOpen?: () => void;
88
+ /** Called when the modal closes */
89
+ onClose?: () => void;
68
90
  }
69
91
  interface ReportPayload {
70
92
  reporterId: string;
71
93
  reporterName: string;
94
+ reporterEmail?: string;
72
95
  description: string;
73
96
  expectedBehavior?: string;
74
97
  stepsToReproduce?: {
@@ -91,8 +114,6 @@ interface ReportResult {
91
114
  duplicateOfId?: string | null;
92
115
  }
93
116
 
94
- declare function FlintWidget(props: FlintWidgetProps): react_jsx_runtime.JSX.Element;
95
-
96
117
  declare type addedNodeMutation = {
97
118
  parentId: number;
98
119
  previousId?: number | null;
@@ -524,12 +545,14 @@ interface Props {
524
545
  getReplayEvents: () => eventWithTime[];
525
546
  getExternalReplayUrl: () => string | undefined;
526
547
  initialSelection?: string;
548
+ enableScreenshot?: boolean;
549
+ statusPageUrl?: string;
550
+ onBeforeSubmit?: (payload: ReportPayload) => boolean | Promise<boolean>;
551
+ onSuccess?: (result: ReportResult) => void;
552
+ onError?: (error: Error) => void;
527
553
  }
528
- declare function FlintModal({ projectKey, serverUrl, user, meta, theme, zIndex, onClose, getEnvironment, getConsoleLogs, getNetworkErrors, getReplayEvents, getExternalReplayUrl, initialSelection, }: Props): react_jsx_runtime.JSX.Element;
554
+ 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
555
 
530
- declare const flint: {
531
- setUser(user: FlintUser | null): void;
532
- setSessionReplay(url: string | (() => string)): void;
533
- };
556
+ declare function FlintWidget(props: FlintWidgetProps): react_jsx_runtime.JSX.Element;
534
557
 
535
- export { FlintModal, type FlintUser, FlintWidget, type FlintWidgetProps, type Locale, type ReportPayload, type ReportResult, type Severity, type Theme, type ThemeOverride, flint };
558
+ export { FlintModal, type FlintUser, FlintWidget, type FlintWidgetProps, type Locale, type ReportPayload, type ReportResult, type Severity, type Theme, type ThemeOverride };