@sentry-internal/feedback
Advanced tools
Comparing version 0.0.1-alpha.8 to 0.0.1-alpha.9
@@ -8,17 +8,41 @@ export declare const DEFAULT_THEME: { | ||
foreground: string; | ||
border: string; | ||
boxShadow: string; | ||
success: string; | ||
error: string; | ||
border: string; | ||
boxShadow: string; | ||
submitBackground: string; | ||
submitBackgroundHover: string; | ||
submitBorder: string; | ||
submitForeground: string; | ||
cancelBackground: string; | ||
cancelBackgroundHover: string; | ||
cancelBorder: string; | ||
cancelForeground: string; | ||
inputBackground: string; | ||
inputForeground: string; | ||
inputBorder: string; | ||
inputBorderFocus: string; | ||
}; | ||
dark: { | ||
fontFamily: string; | ||
fontSize: string; | ||
background: string; | ||
backgroundHover: string; | ||
foreground: string; | ||
border: string; | ||
success: string; | ||
error: string; | ||
border: string; | ||
fontFamily: string; | ||
fontSize: string; | ||
boxShadow: string; | ||
submitBackground: string; | ||
submitBackgroundHover: string; | ||
submitBorder: string; | ||
submitForeground: string; | ||
cancelBackground: string; | ||
cancelBackgroundHover: string; | ||
cancelBorder: string; | ||
cancelForeground: string; | ||
inputBackground: string; | ||
inputForeground: string; | ||
inputBorder: string; | ||
inputBorderFocus: string; | ||
}; | ||
@@ -25,0 +49,0 @@ }; |
import { Integration } from '@sentry/types'; | ||
import { CreateWidgetOptionOverrides, FeedbackConfigurationWithDefaults, FeedbackInternalOptions, Widget } from './types'; | ||
import { FeedbackInternalOptions, OptionalFeedbackConfiguration, Widget } from './types'; | ||
import { createShadowHost } from './widget/createShadowHost'; | ||
type FeedbackConfiguration = Partial<FeedbackConfigurationWithDefaults>; | ||
/** | ||
@@ -43,3 +42,3 @@ * Feedback integration. When added as an integration to the SDK, it will | ||
private _hasInsertedActorStyles; | ||
constructor({ id, autoInject, showEmail, showName, useSentryUser, isAnonymous, isEmailRequired, isNameRequired, themeDark, themeLight, colorScheme, buttonLabel, cancelButtonLabel, submitButtonLabel, formTitle, emailPlaceholder, emailLabel, messagePlaceholder, messageLabel, namePlaceholder, nameLabel, successMessageText, onActorClick, onDialogClose, onDialogOpen, onSubmitError, onSubmitSuccess, }?: FeedbackConfiguration); | ||
constructor({ id, showBranding, autoInject, showEmail, showName, useSentryUser, isAnonymous, isEmailRequired, isNameRequired, themeDark, themeLight, colorScheme, buttonLabel, cancelButtonLabel, submitButtonLabel, formTitle, emailPlaceholder, emailLabel, messagePlaceholder, messageLabel, namePlaceholder, nameLabel, successMessageText, onActorClick, onDialogClose, onDialogOpen, onSubmitError, onSubmitSuccess, }?: OptionalFeedbackConfiguration); | ||
/** | ||
@@ -52,7 +51,7 @@ * Setup and initialize replay container | ||
*/ | ||
attachTo(el: Element | string, optionOverrides: CreateWidgetOptionOverrides): Widget | null; | ||
attachTo(el: Element | string, optionOverrides: OptionalFeedbackConfiguration): Widget | null; | ||
/** | ||
* Creates a new widget. Accepts partial options to override any options passed to constructor. | ||
*/ | ||
createWidget(optionOverrides: CreateWidgetOptionOverrides): Widget | null; | ||
createWidget(optionOverrides: OptionalFeedbackConfiguration): Widget | null; | ||
/** | ||
@@ -79,3 +78,2 @@ * Removes a single widget | ||
} | ||
export {}; | ||
//# sourceMappingURL=integration.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { Primitive } from '@sentry/types'; | ||
import { Event, Primitive } from '@sentry/types'; | ||
import { ActorComponent } from '../widget/Actor'; | ||
@@ -7,2 +7,15 @@ import { DialogComponent } from '../widget/Dialog'; | ||
} | undefined; | ||
/** | ||
* NOTE: These types are still considered Beta and subject to change. | ||
* @hidden | ||
*/ | ||
export interface FeedbackEvent extends Event { | ||
feedback: { | ||
message: string; | ||
url: string; | ||
contact_email?: string; | ||
name?: string; | ||
replay_id?: string; | ||
}; | ||
} | ||
export interface SendFeedbackData { | ||
@@ -40,2 +53,6 @@ feedback: { | ||
/** | ||
* Show the Sentry branding | ||
*/ | ||
showBranding: boolean; | ||
/** | ||
* Auto-inject default Feedback actor button to the DOM when integration is | ||
@@ -165,8 +182,14 @@ * added. | ||
} | ||
export interface FeedbackConfigurationWithDefaults extends FeedbackGeneralConfiguration, FeedbackThemeConfiguration, FeedbackTextConfiguration, FeedbackCallbacks { | ||
/** | ||
* The integration's internal `options` member where every value should be set | ||
*/ | ||
export interface FeedbackInternalOptions extends FeedbackGeneralConfiguration, FeedbackThemeConfiguration, FeedbackTextConfiguration, FeedbackCallbacks { | ||
} | ||
/** | ||
* The integration's internal `options` member | ||
* Partial configuration that overrides default configuration values | ||
*/ | ||
export type FeedbackInternalOptions = FeedbackConfigurationWithDefaults; | ||
export interface OptionalFeedbackConfiguration extends Pick<Partial<FeedbackInternalOptions>, Exclude<keyof Partial<FeedbackInternalOptions>, 'themeLight' | 'themeDark'>> { | ||
themeLight?: Partial<FeedbackTheme>; | ||
themeDark?: Partial<FeedbackTheme>; | ||
} | ||
export interface FeedbackTheme { | ||
@@ -209,4 +232,51 @@ /** | ||
error: string; | ||
/** | ||
* Background color for the submit button | ||
*/ | ||
submitBackground: string; | ||
/** | ||
* Background color when hovering over the submit button | ||
*/ | ||
submitBackgroundHover: string; | ||
/** | ||
* Border style for the submit button | ||
*/ | ||
submitBorder: string; | ||
/** | ||
* Foreground color for the submit button | ||
*/ | ||
submitForeground: string; | ||
/** | ||
* Background color for the cancel button | ||
*/ | ||
cancelBackground: string; | ||
/** | ||
* Background color when hovering over the cancel button | ||
*/ | ||
cancelBackgroundHover: string; | ||
/** | ||
* Border style for the cancel button | ||
*/ | ||
cancelBorder: string; | ||
/** | ||
* Foreground color for the cancel button | ||
*/ | ||
cancelForeground: string; | ||
/** | ||
* Background color for form inputs | ||
*/ | ||
inputBackground: string; | ||
/** | ||
* Foreground color for form inputs | ||
*/ | ||
inputForeground: string; | ||
/** | ||
* Border styles for form inputs | ||
*/ | ||
inputBorder: string; | ||
/** | ||
* Border styles for form inputs when focused | ||
*/ | ||
inputBorderFocus: string; | ||
} | ||
export type CreateWidgetOptionOverrides = Partial<FeedbackConfigurationWithDefaults>; | ||
export interface FeedbackThemes { | ||
@@ -213,0 +283,0 @@ dark: FeedbackTheme; |
@@ -1,2 +0,1 @@ | ||
import { TransportMakeRequestResponse } from '@sentry/types'; | ||
import { FeedbackFormData, SendFeedbackOptions } from '../types'; | ||
@@ -7,3 +6,3 @@ import { DialogComponent } from '../widget/Dialog'; | ||
*/ | ||
export declare function handleFeedbackSubmit(dialog: DialogComponent | null, feedback: FeedbackFormData, options?: SendFeedbackOptions): Promise<TransportMakeRequestResponse | void>; | ||
export declare function handleFeedbackSubmit(dialog: DialogComponent | null, feedback: FeedbackFormData, options?: SendFeedbackOptions): Promise<Response | false>; | ||
//# sourceMappingURL=handleFeedbackSubmit.d.ts.map |
import { Scope } from '@sentry/core'; | ||
import { Client, FeedbackEvent } from '@sentry/types'; | ||
import { Client } from '@sentry/types'; | ||
import { FeedbackEvent } from '../types'; | ||
interface PrepareFeedbackEventParams { | ||
@@ -4,0 +5,0 @@ client: Client; |
@@ -1,7 +0,6 @@ | ||
import { TransportMakeRequestResponse } from '@sentry/types'; | ||
import { SendFeedbackData } from '../types'; | ||
/** | ||
* Send feedback using transport | ||
* Send feedback using `fetch()` | ||
*/ | ||
export declare function sendFeedbackRequest({ feedback: { message, email, name, replay_id, url }, }: SendFeedbackData): Promise<void | TransportMakeRequestResponse>; | ||
export declare function sendFeedbackRequest({ feedback: { message, email, name, replay_id, url }, }: SendFeedbackData): Promise<Response | null>; | ||
//# sourceMappingURL=sendFeedbackRequest.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { FeedbackComponent, FeedbackConfigurationWithDefaults } from '../types'; | ||
export interface ActorProps extends Pick<FeedbackConfigurationWithDefaults, 'buttonLabel'> { | ||
import { FeedbackComponent, FeedbackInternalOptions } from '../types'; | ||
export interface ActorProps extends Pick<FeedbackInternalOptions, 'buttonLabel'> { | ||
onClick?: (e: MouseEvent) => void; | ||
@@ -4,0 +4,0 @@ } |
@@ -1,5 +0,4 @@ | ||
import { FeedbackComponent } from '../types'; | ||
import { FeedbackComponent, FeedbackInternalOptions } from '../types'; | ||
import { FormComponentProps } from './Form'; | ||
export interface DialogProps extends FormComponentProps { | ||
formTitle: string; | ||
export interface DialogProps extends FormComponentProps, Pick<FeedbackInternalOptions, 'formTitle' | 'showBranding' | 'colorScheme'> { | ||
onClosed?: () => void; | ||
@@ -32,3 +31,3 @@ } | ||
*/ | ||
export declare function Dialog({ formTitle, showName, showEmail, isAnonymous, defaultName, defaultEmail, onClosed, onCancel, onSubmit, ...textLabels }: DialogProps): DialogComponent; | ||
export declare function Dialog({ formTitle, showBranding, showName, showEmail, colorScheme, isAnonymous, defaultName, defaultEmail, onClosed, onCancel, onSubmit, ...textLabels }: DialogProps): DialogComponent; | ||
//# sourceMappingURL=Dialog.d.ts.map |
{ | ||
"name": "@sentry-internal/feedback", | ||
"version": "0.0.1-alpha.8", | ||
"version": "0.0.1-alpha.9", | ||
"description": "Sentry SDK integration for user feedback", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
969984
7903