@spotlightjs/overlay 0.0.19 → 0.0.21
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/App.d.ts +3 -11
- package/dist/components/Debugger.d.ts +3 -2
- package/dist/components/Overview.d.ts +4 -1
- package/dist/components/Tabs.d.ts +13 -2
- package/dist/components/Trigger.d.ts +3 -3
- package/dist/index.d.ts +12 -14
- package/dist/integrations/console/index.d.ts +3 -1
- package/dist/integrations/integration.d.ts +11 -15
- package/dist/integrations/sentry/components/Events/Error.d.ts +1 -1
- package/dist/integrations/sentry/components/Events/Event.d.ts +10 -0
- package/dist/integrations/sentry/components/Tags.d.ts +5 -0
- package/dist/integrations/sentry/data/sentryDataCache.d.ts +1 -0
- package/dist/integrations/sentry/index.d.ts +15 -5
- package/dist/integrations/sentry/types.d.ts +1 -0
- package/dist/lib/useKeyPress.d.ts +3 -2
- package/dist/sentry-spotlight.js +6569 -6465
- package/dist/sentry-spotlight.js.map +1 -0
- package/dist/sentry-spotlight.umd.cjs +84 -83
- package/dist/sentry-spotlight.umd.cjs.map +1 -0
- package/dist/sidecar.d.ts +1 -2
- package/dist/types.d.ts +77 -3
- package/package.json +2 -2
package/dist/App.d.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
fullScreen?: boolean;
|
|
5
|
-
showTriggerButton?: boolean;
|
|
6
|
-
defaultEventId?: string;
|
|
7
|
-
integrations?: Integration[];
|
|
8
|
-
sidecar: string;
|
|
9
|
-
anchor?: Anchor;
|
|
10
|
-
};
|
|
11
|
-
export default function App({ fullScreen, showTriggerButton, defaultEventId, integrations, sidecar, anchor, }: AppProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { SpotlightOverlayOptions } from './types';
|
|
2
|
+
type AppProps = Omit<SpotlightOverlayOptions, 'debug' | 'injectImmediately'> & Required<Pick<SpotlightOverlayOptions, 'sidecarUrl'>>;
|
|
3
|
+
export default function App({ openOnInit, showTriggerButton, integrations, sidecarUrl, anchor, }: AppProps): import("react/jsx-runtime").JSX.Element;
|
|
12
4
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Integration, IntegrationData } from '../integrations/integration';
|
|
2
|
-
|
|
2
|
+
import { NotificationCount } from '../types';
|
|
3
|
+
export default function Debugger({ integrations, isOpen, setOpen, integrationData, isOnline, setTriggerButtonCount: setNotificationCount, }: {
|
|
3
4
|
integrations: Integration[];
|
|
4
5
|
isOpen: boolean;
|
|
5
6
|
setOpen: (value: boolean) => void;
|
|
6
|
-
defaultEventId?: string;
|
|
7
7
|
integrationData: IntegrationData<unknown>;
|
|
8
8
|
isOnline: boolean;
|
|
9
|
+
setTriggerButtonCount: (count: NotificationCount) => void;
|
|
9
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Integration, IntegrationData } from '../integrations/integration';
|
|
2
|
-
|
|
2
|
+
import { NotificationCount } from '../types';
|
|
3
|
+
export default function Overview({ integrations, integrationData, setTriggerButtonCount, setOpen, }: {
|
|
3
4
|
integrations: Integration[];
|
|
4
5
|
integrationData: IntegrationData<unknown>;
|
|
6
|
+
setTriggerButtonCount: (count: NotificationCount) => void;
|
|
7
|
+
setOpen: (value: boolean) => void;
|
|
5
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,11 +4,22 @@ export type Props = {
|
|
|
4
4
|
* Array of tabs to display.
|
|
5
5
|
*/
|
|
6
6
|
tabs: IntegrationTab<unknown>[];
|
|
7
|
+
} & (NestedTabsProps | TopLevelTabsProps);
|
|
8
|
+
type NestedTabsProps = {
|
|
7
9
|
/**
|
|
8
10
|
* Whether the tabs are nested inside another tab.
|
|
9
11
|
* If `nested` is `true`, links will be set relative to the parent
|
|
10
12
|
* tab route instead of absolute to the root.
|
|
11
13
|
*/
|
|
12
|
-
nested
|
|
14
|
+
nested: true;
|
|
15
|
+
setOpen?: undefined;
|
|
13
16
|
};
|
|
14
|
-
|
|
17
|
+
type TopLevelTabsProps = {
|
|
18
|
+
nested?: false;
|
|
19
|
+
/**
|
|
20
|
+
* Setter to control the open state of the overlay
|
|
21
|
+
*/
|
|
22
|
+
setOpen: (value: boolean) => void;
|
|
23
|
+
};
|
|
24
|
+
export default function Tabs({ tabs, nested, setOpen }: Props): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NotificationCount } from '../types';
|
|
2
2
|
export declare const DEFAULT_ANCHOR = "bottomRight";
|
|
3
3
|
export type Anchor = 'bottomRight' | 'bottomLeft' | 'centerRight' | 'centerLeft' | 'topLeft' | 'topRight';
|
|
4
|
-
export default function Trigger({ isOpen, setOpen,
|
|
4
|
+
export default function Trigger({ isOpen, setOpen, notificationCount, anchor, }: {
|
|
5
5
|
isOpen: boolean;
|
|
6
6
|
setOpen: (value: boolean) => void;
|
|
7
|
-
|
|
7
|
+
notificationCount: NotificationCount;
|
|
8
8
|
anchor?: Anchor;
|
|
9
9
|
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Integration } from './integrations/integration.ts';
|
|
1
|
+
import { SpotlightOverlayOptions } from './types.ts';
|
|
3
2
|
export { default as console } from './integrations/console/index.ts';
|
|
4
3
|
export { default as sentry } from './integrations/sentry/index.ts';
|
|
5
4
|
export { default as viteInspect } from './integrations/vite-inspect/index.ts';
|
|
6
5
|
/**
|
|
7
6
|
* Open the Spotlight debugger Window
|
|
8
7
|
*/
|
|
9
|
-
export declare function openSpotlight(): Promise<void>;
|
|
8
|
+
export declare function openSpotlight(path?: string | undefined): Promise<void>;
|
|
10
9
|
/**
|
|
11
10
|
* Close the Spotlight debugger Window
|
|
12
11
|
*/
|
|
@@ -25,14 +24,13 @@ export declare function onOpen(cb: () => void): Promise<void>;
|
|
|
25
24
|
* A count of the number of collected severe events is passed to the callback.
|
|
26
25
|
*/
|
|
27
26
|
export declare function onSevereEvent(cb: (count: number) => void): Promise<void>;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Trigger an event in Spotlight.
|
|
29
|
+
*
|
|
30
|
+
* This is primarily useful for handling an uncaught error/crash, and forcing the debugger
|
|
31
|
+
* to render vs a native error handler.
|
|
32
|
+
*
|
|
33
|
+
* e.g. trigger("sentry.showError", {eventId});
|
|
34
|
+
*/
|
|
35
|
+
export declare function trigger(eventName: string, payload: unknown): Promise<void>;
|
|
36
|
+
export declare function init({ openOnInit, showTriggerButton, injectImmediately, sidecarUrl, anchor, debug, integrations, }?: SpotlightOverlayOptions): Promise<void>;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ComponentType } from 'react';
|
|
2
|
+
import { NotificationCount } from '../types';
|
|
3
|
+
export type SpotlightContext = {
|
|
4
|
+
open: (path: string | undefined) => void;
|
|
5
|
+
close: () => void;
|
|
6
|
+
};
|
|
2
7
|
export type Integration<T = any> = {
|
|
3
8
|
/**
|
|
4
9
|
* Name of the integration
|
|
@@ -23,7 +28,7 @@ export type Integration<T = any> = {
|
|
|
23
28
|
*
|
|
24
29
|
* Use this hook to setup any global state, instrument handlers, etc.
|
|
25
30
|
*/
|
|
26
|
-
setup?: () => void | Promise<void
|
|
31
|
+
setup?: (context: SpotlightContext) => void | Promise<void> | TeardownFunction;
|
|
27
32
|
/**
|
|
28
33
|
* Hook called whenever spotlight forwards a new raw event to this integration.
|
|
29
34
|
*
|
|
@@ -49,11 +54,11 @@ export type IntegrationTab<T> = {
|
|
|
49
54
|
* If this property is set, a count badge will be displayed
|
|
50
55
|
* next to the tab title with the specified value.
|
|
51
56
|
*/
|
|
52
|
-
notificationCount?:
|
|
57
|
+
notificationCount?: NotificationCount;
|
|
53
58
|
/**
|
|
54
59
|
* JSX content of the tab. Go crazy, this is all yours!
|
|
55
60
|
*/
|
|
56
|
-
content?:
|
|
61
|
+
content?: ComponentType<{
|
|
57
62
|
processedEvents: T[];
|
|
58
63
|
}>;
|
|
59
64
|
onSelect?: () => void;
|
|
@@ -63,16 +68,6 @@ export type ProcessedEventContainer<T> = {
|
|
|
63
68
|
* The processed event data to be passed to your tabs.
|
|
64
69
|
*/
|
|
65
70
|
event: T;
|
|
66
|
-
/**
|
|
67
|
-
* A level indicating the impact or severity of the processed event. Set this to
|
|
68
|
-
* 'severe' if the event is critical and users should be aware of it (e.g. a thrown error).
|
|
69
|
-
*
|
|
70
|
-
* If this is set to 'severe', a red notification count badge will be displayed
|
|
71
|
-
* next to the spotlight trigger button in the UI.
|
|
72
|
-
*
|
|
73
|
-
* @default value is 'default'
|
|
74
|
-
*/
|
|
75
|
-
severity?: Severity;
|
|
76
71
|
};
|
|
77
72
|
export type Severity = 'default' | 'severe';
|
|
78
73
|
export type IntegrationData<T> = Record<string, ProcessedEventContainer<T>[]>;
|
|
@@ -94,5 +89,6 @@ export type RawEventContext = {
|
|
|
94
89
|
*/
|
|
95
90
|
data: string;
|
|
96
91
|
};
|
|
97
|
-
|
|
92
|
+
type TeardownFunction = () => void | Promise<() => void>;
|
|
93
|
+
export declare function initIntegrations(integrations: Integration<any>[] | undefined, context: SpotlightContext): Promise<[Integration[], TeardownFunction[]]>;
|
|
98
94
|
export {};
|
|
@@ -5,6 +5,6 @@ export declare function ErrorTitle({ event }: {
|
|
|
5
5
|
export declare function ErrorSummary({ event }: {
|
|
6
6
|
event: SentryErrorEvent;
|
|
7
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export
|
|
8
|
+
export declare function Error({ event }: {
|
|
9
9
|
event: SentryErrorEvent;
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SentryErrorEvent, SentryEvent } from '../../types';
|
|
2
|
+
export declare function EventTitle({ event }: {
|
|
3
|
+
event: SentryErrorEvent | SentryEvent;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function EventSummary({ event }: {
|
|
6
|
+
event: SentryErrorEvent | SentryEvent;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default function Event({ event }: {
|
|
9
|
+
event: SentryErrorEvent | SentryEvent;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,6 +6,7 @@ type TraceSubscription = ['trace', (trace: Trace) => void];
|
|
|
6
6
|
type Subscription = OnlineSubscription | EventSubscription | TraceSubscription;
|
|
7
7
|
declare class SentryDataCache {
|
|
8
8
|
protected events: SentryEvent[];
|
|
9
|
+
protected eventIds: Set<string>;
|
|
9
10
|
protected sdks: Sdk[];
|
|
10
11
|
protected traces: Trace[];
|
|
11
12
|
protected tracesById: {
|
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
import type { Envelope } from '@sentry/types';
|
|
2
|
-
import type { RawEventContext
|
|
2
|
+
import type { RawEventContext } from '../integration';
|
|
3
3
|
import ErrorsTab from './tabs/ErrorsTab';
|
|
4
4
|
import SdksTab from './tabs/SdksTab';
|
|
5
|
+
import TracesTab from './tabs/TracesTab';
|
|
5
6
|
type SentryIntegrationOptions = {
|
|
6
7
|
sidecarUrl?: string;
|
|
7
8
|
};
|
|
8
9
|
export default function sentryIntegration(options?: SentryIntegrationOptions): {
|
|
9
10
|
name: string;
|
|
10
11
|
forwardedContentType: string[];
|
|
11
|
-
setup: () => void;
|
|
12
|
+
setup: ({ open }: import("../integration").SpotlightContext) => () => void;
|
|
12
13
|
processEvent: (event: RawEventContext) => {
|
|
13
14
|
event: Envelope;
|
|
14
|
-
severity: Severity;
|
|
15
15
|
};
|
|
16
16
|
tabs: () => ({
|
|
17
17
|
id: string;
|
|
18
18
|
title: string;
|
|
19
|
-
notificationCount:
|
|
19
|
+
notificationCount: {
|
|
20
|
+
count: number;
|
|
21
|
+
severe: boolean;
|
|
22
|
+
};
|
|
20
23
|
content: typeof ErrorsTab;
|
|
24
|
+
} | {
|
|
25
|
+
id: string;
|
|
26
|
+
title: string;
|
|
27
|
+
notificationCount: {
|
|
28
|
+
count: number;
|
|
29
|
+
severe?: undefined;
|
|
30
|
+
};
|
|
31
|
+
content: typeof TracesTab;
|
|
21
32
|
} | {
|
|
22
33
|
id: string;
|
|
23
34
|
title: string;
|
|
@@ -27,6 +38,5 @@ export default function sentryIntegration(options?: SentryIntegrationOptions): {
|
|
|
27
38
|
};
|
|
28
39
|
export declare function processEnvelope({ data }: RawEventContext): {
|
|
29
40
|
event: Envelope;
|
|
30
|
-
severity: Severity;
|
|
31
41
|
};
|
|
32
42
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* useKeyPress
|
|
3
|
-
* @param {string}
|
|
3
|
+
* @param {string[]} keys - an array of keys to respond to, compared against event.key
|
|
4
4
|
* @param {function} action - the action to perform on key press
|
|
5
|
+
* @param {boolean} propagate - whether to stop event propagation (default is false)
|
|
5
6
|
*/
|
|
6
|
-
export default function useKeyPress(
|
|
7
|
+
export default function useKeyPress(keys: string[], action: () => void, propagate?: boolean): void;
|