@spotlightjs/overlay 1.6.0 → 1.7.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/src/App.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { SpotlightOverlayOptions } from './types';
2
2
  type AppProps = Omit<SpotlightOverlayOptions, 'debug' | 'injectImmediately'> & Required<Pick<SpotlightOverlayOptions, 'sidecarUrl'>>;
3
- export default function App({ openOnInit, showTriggerButton, integrations, sidecarUrl, anchor, fullPage, }: AppProps): import("react/jsx-runtime").JSX.Element;
3
+ export default function App({ openOnInit, showTriggerButton, integrations, sidecarUrl, anchor, fullPage, showClearEventsButton, }: AppProps): import("react/jsx-runtime").JSX.Element;
4
4
  export {};
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
1
  import { Integration, IntegrationData } from '../integrations/integration';
3
2
  import { NotificationCount } from '../types';
4
- export default function Debugger({ integrations, isOpen, setOpen, integrationData, isOnline, setTriggerButtonCount: setNotificationCount, fullPage, setReloadSpotlight, }: {
3
+ export default function Debugger({ integrations, isOpen, setOpen, integrationData, isOnline, setTriggerButtonCount: setNotificationCount, fullPage, showClearEventsButton, }: {
5
4
  integrations: Integration[];
6
5
  isOpen: boolean;
7
6
  setOpen: (value: boolean) => void;
@@ -9,5 +8,5 @@ export default function Debugger({ integrations, isOpen, setOpen, integrationDat
9
8
  isOnline: boolean;
10
9
  setTriggerButtonCount: (count: NotificationCount) => void;
11
10
  fullPage: boolean;
12
- setReloadSpotlight: React.Dispatch<React.SetStateAction<number>>;
11
+ showClearEventsButton: boolean;
13
12
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,10 @@
1
+ import { React, ReactDOM } from './react-instance.tsx';
1
2
  import { SpotlightOverlayOptions } from './types.ts';
2
3
  export { default as console } from './integrations/console/index.ts';
3
4
  export { default as hydrationError } from './integrations/hydration-error/index.ts';
4
5
  export { default as sentry } from './integrations/sentry/index.ts';
5
6
  export { default as viteInspect } from './integrations/vite-inspect/index.ts';
7
+ export { React, ReactDOM };
6
8
  /**
7
9
  * Open the Spotlight debugger Window
8
10
  */
@@ -34,4 +36,4 @@ export declare function onSevereEvent(cb: (count: number) => void): Promise<void
34
36
  * e.g. trigger("sentry.showError", {eventId});
35
37
  */
36
38
  export declare function trigger(eventName: string, payload: unknown): Promise<void>;
37
- export declare function init({ openOnInit, showTriggerButton, injectImmediately, sidecarUrl, anchor, debug, integrations, experiments, fullPage, }?: SpotlightOverlayOptions): Promise<void>;
39
+ export declare function init({ openOnInit, showTriggerButton, injectImmediately, sidecarUrl, anchor, debug, integrations, experiments, fullPage, showClearEventsButton, }?: SpotlightOverlayOptions): Promise<void>;
@@ -41,6 +41,12 @@ export type Integration<T = any> = {
41
41
  * The returned object will be passed to your tabs function.
42
42
  */
43
43
  processEvent?: (eventContext: RawEventContext) => ProcessedEventContainer<T> | undefined;
44
+ /**
45
+ * To reset the integration.
46
+ *
47
+ * @returns void
48
+ */
49
+ reset?: () => void;
44
50
  };
45
51
  export type IntegrationTab<T> = {
46
52
  /**
@@ -1,10 +1,10 @@
1
- import { SentryErrorEvent, SentryEvent } from '../../types';
1
+ import { SentryEvent } from '../../types';
2
2
  export declare function EventTitle({ event }: {
3
- event: SentryErrorEvent | SentryEvent;
3
+ event: SentryEvent;
4
4
  }): import("react/jsx-runtime").JSX.Element;
5
5
  export declare function EventSummary({ event }: {
6
- event: SentryErrorEvent | SentryEvent;
6
+ event: SentryEvent;
7
7
  }): import("react/jsx-runtime").JSX.Element;
8
8
  export default function Event({ event }: {
9
- event: SentryErrorEvent | SentryEvent;
9
+ event: SentryEvent;
10
10
  }): import("react/jsx-runtime").JSX.Element;
@@ -36,6 +36,7 @@ export default function sentryIntegration(options?: SentryIntegrationOptions): {
36
36
  content: typeof PerformanceTab;
37
37
  notificationCount?: undefined;
38
38
  })[];
39
+ reset: () => void;
39
40
  };
40
41
  export declare function processEnvelope({ data }: RawEventContext): {
41
42
  event: Envelope;
@@ -39,7 +39,7 @@ export type Breadcrumb = {
39
39
  type CommonEventAttrs = {
40
40
  event_id: string;
41
41
  timestamp: number;
42
- message?: string;
42
+ message?: SentryFormattedMessage;
43
43
  breadcrumbs?: Breadcrumb[] | {
44
44
  values: Breadcrumb[];
45
45
  };
@@ -76,8 +76,12 @@ export type Contexts = {
76
76
  export type Tags = {
77
77
  [key: string]: string;
78
78
  };
79
+ export type SentryFormattedMessage = string | {
80
+ formatted: string;
81
+ params?: [];
82
+ };
79
83
  export type SentryErrorEvent = CommonEventAttrs & {
80
- type?: 'error' | 'event' | 'default';
84
+ type?: 'error' | 'event' | 'message' | 'default';
81
85
  exception: EventException;
82
86
  };
83
87
  export type Span = {
@@ -96,7 +100,7 @@ export type Span = {
96
100
  };
97
101
  export type SentryTransactionEvent = CommonEventAttrs & {
98
102
  type: 'transaction';
99
- spans: Span[];
103
+ spans?: Span[];
100
104
  start_timestamp: string;
101
105
  contexts: Contexts & {
102
106
  trace: TraceContext;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ export { React, ReactDOM };
@@ -77,6 +77,13 @@ export type SpotlightOverlayOptions = {
77
77
  * This is useful for replaceing error page or in when directly rendered as an html page
78
78
  */
79
79
  fullPage?: boolean;
80
+ /**
81
+ * If set to `false`, spotlight overlay will not have Clear Events button.
82
+ * This is useful to clear data in spotlight.
83
+ *
84
+ * @default true
85
+ */
86
+ showClearEventsButton?: boolean;
80
87
  };
81
88
  export type NotificationCount = {
82
89
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotlightjs/overlay",
3
3
  "description": "The overlay of Spotlight to add debug interface to your web app.",
4
- "version": "1.6.0",
4
+ "version": "1.7.0",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "files": [