@spotlightjs/overlay 0.0.21 → 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/sentry-spotlight.d.ts +1 -1
- package/dist/sentry-spotlight.js +10879 -10975
- package/dist/sentry-spotlight.js.map +1 -1
- package/dist/sentry-spotlight.umd.cjs +92 -92
- package/dist/sentry-spotlight.umd.cjs.map +1 -1
- package/dist/src/components/Badge.d.ts +2 -0
- package/dist/{components → src/components}/Trigger.d.ts +2 -4
- package/dist/src/constants.d.ts +5 -0
- package/dist/{index.d.ts → src/index.d.ts} +1 -1
- package/dist/{integrations → src/integrations}/integration.d.ts +2 -1
- package/dist/src/integrations/sentry/components/HiddenItemsButton.d.ts +4 -0
- package/dist/{integrations → src/integrations}/sentry/data/sentryDataCache.d.ts +14 -0
- package/dist/src/integrations/sentry/data/useSentryHelpers.d.ts +3 -0
- package/dist/src/integrations/sentry/utils/sdkToPlatform.d.ts +4 -0
- package/dist/src/lib/useSpotlightContext.d.ts +7 -0
- package/dist/{types.d.ts → src/types.d.ts} +9 -3
- package/package.json +7 -4
- /package/dist/{App.d.ts → src/App.d.ts} +0 -0
- /package/dist/{components → src/components}/CardList.d.ts +0 -0
- /package/dist/{components → src/components}/Debugger.d.ts +0 -0
- /package/dist/{components → src/components}/Overview.d.ts +0 -0
- /package/dist/{components → src/components}/SidePanel.d.ts +0 -0
- /package/dist/{components → src/components}/Tabs.d.ts +0 -0
- /package/dist/{integrations/sentry → src}/components/Time.d.ts +0 -0
- /package/dist/{integrations/sentry → src}/components/TimeSince.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/console/console-tab.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/console/index.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/console/types.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/DateTime.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/EventBreadcrumbs.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/EventContexts.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/EventDetails.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/EventList.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/Events/Error/Frame.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/Events/Error.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/Events/Event.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/PlatformIcon.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/SdkList.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/SpanDetails.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/SpanTree.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/Tags.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/TraceDetails.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/components/TraceList.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/data/sentryEventsContext.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/data/useSentryEvents.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/data/useSentrySdks.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/data/useSentryTraces.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/index.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/sentry-integration.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/tabs/ErrorsTab.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/tabs/SdksTab.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/tabs/TracesTab.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/types.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/utils/bytes.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/utils/duration.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/sentry/utils/traces.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/vite-inspect/index.d.ts +0 -0
- /package/dist/{integrations → src/integrations}/vite-inspect/vite-inspect.d.ts +0 -0
- /package/dist/{lib → src/lib}/classNames.d.ts +0 -0
- /package/dist/{lib → src/lib}/eventTarget.d.ts +0 -0
- /package/dist/{lib → src/lib}/logger.d.ts +0 -0
- /package/dist/{lib → src/lib}/useKeyPress.d.ts +0 -0
- /package/dist/{lib → src/lib}/uuid.d.ts +0 -0
- /package/dist/{sidecar.d.ts → src/sidecar.d.ts} +0 -0
- /package/dist/{integrations → test/integrations}/sentry/data/sentryDataCache.test.d.ts +0 -0
- /package/dist/{integrations → test/integrations}/sentry/index.test.d.ts +0 -0
- /package/dist/{integrations → test/integrations}/sentry/utils/traces.test.d.ts +0 -0
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { NotificationCount } from '../types';
|
|
2
|
-
export declare const DEFAULT_ANCHOR = "bottomRight";
|
|
3
|
-
export type Anchor = 'bottomRight' | 'bottomLeft' | 'centerRight' | 'centerLeft' | 'topLeft' | 'topRight';
|
|
1
|
+
import { NotificationCount, type AnchorConfig } from '../types';
|
|
4
2
|
export default function Trigger({ isOpen, setOpen, notificationCount, anchor, }: {
|
|
5
3
|
isOpen: boolean;
|
|
6
4
|
setOpen: (value: boolean) => void;
|
|
7
5
|
notificationCount: NotificationCount;
|
|
8
|
-
anchor?:
|
|
6
|
+
anchor?: AnchorConfig;
|
|
9
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -33,4 +33,4 @@ export declare function onSevereEvent(cb: (count: number) => void): Promise<void
|
|
|
33
33
|
* e.g. trigger("sentry.showError", {eventId});
|
|
34
34
|
*/
|
|
35
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>;
|
|
36
|
+
export declare function init({ openOnInit, showTriggerButton, injectImmediately, sidecarUrl, anchor, debug, integrations, experiments, }?: SpotlightOverlayOptions): Promise<void>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type ComponentType } from 'react';
|
|
2
|
-
import { NotificationCount } from '../types';
|
|
2
|
+
import { type ExperimentsConfig, type NotificationCount } from '../types';
|
|
3
3
|
export type SpotlightContext = {
|
|
4
4
|
open: (path: string | undefined) => void;
|
|
5
5
|
close: () => void;
|
|
6
|
+
experiments: ExperimentsConfig;
|
|
6
7
|
};
|
|
7
8
|
export type Integration<T = any> = {
|
|
8
9
|
/**
|
|
@@ -12,6 +12,7 @@ declare class SentryDataCache {
|
|
|
12
12
|
protected tracesById: {
|
|
13
13
|
[id: string]: Trace;
|
|
14
14
|
};
|
|
15
|
+
protected localTraceIds: Set<string>;
|
|
15
16
|
protected subscribers: Map<string, Subscription>;
|
|
16
17
|
constructor(initial?: (SentryEvent & {
|
|
17
18
|
event_id?: string;
|
|
@@ -29,6 +30,19 @@ declare class SentryDataCache {
|
|
|
29
30
|
getEventsByTrace(traceId: string, spanId?: string | null): SentryEvent[];
|
|
30
31
|
getSpanById(traceId: string, spanId: string): Span | undefined;
|
|
31
32
|
subscribe(...args: Subscription): () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Mark a traceId as being seen in the local session.
|
|
35
|
+
*
|
|
36
|
+
* @param traceId
|
|
37
|
+
*/
|
|
38
|
+
trackLocalTrace(traceId: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Determine if a traceId was seen in the local session.
|
|
41
|
+
*
|
|
42
|
+
* A result of `null` means "unknown", which implies there is no known
|
|
43
|
+
* information about any session-initiated traces.
|
|
44
|
+
*/
|
|
45
|
+
isTraceLocal(traceId: string): boolean | null;
|
|
32
46
|
}
|
|
33
47
|
declare const _default: SentryDataCache;
|
|
34
48
|
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { type SpotlightContext } from '../integrations/integration';
|
|
3
|
+
export declare const SpotlightContextProvider: React.FC<{
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
context: SpotlightContext;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const useSpotlightContext: () => SpotlightContext;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { type Integration } from './integrations/integration';
|
|
2
|
+
export type ExperimentName = 'sentry:focus-local-events';
|
|
3
|
+
export type ExperimentsConfig = Record<ExperimentName, boolean>;
|
|
4
|
+
export type AnchorConfig = 'bottomRight' | 'bottomLeft' | 'centerRight' | 'centerLeft' | 'topLeft' | 'topRight';
|
|
3
5
|
export type SpotlightOverlayOptions = {
|
|
4
6
|
/**
|
|
5
7
|
* Array of Spotlight integrations to enable when the Overlay initializes.
|
|
@@ -53,7 +55,7 @@ export type SpotlightOverlayOptions = {
|
|
|
53
55
|
*
|
|
54
56
|
* @default "bottomRight"
|
|
55
57
|
*/
|
|
56
|
-
anchor?:
|
|
58
|
+
anchor?: AnchorConfig;
|
|
57
59
|
/**
|
|
58
60
|
* If set to `true`, the Spotlight overlay will log additional debug messages to the console.
|
|
59
61
|
*
|
|
@@ -64,6 +66,10 @@ export type SpotlightOverlayOptions = {
|
|
|
64
66
|
* TODO: Remove? No longer needed with new approach
|
|
65
67
|
*/
|
|
66
68
|
defaultEventId?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Experimental configuration.
|
|
71
|
+
*/
|
|
72
|
+
experiments?: ExperimentsConfig;
|
|
67
73
|
};
|
|
68
74
|
export type NotificationCount = {
|
|
69
75
|
/**
|
package/package.json
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spotlightjs/overlay",
|
|
3
3
|
"description": "The overlay of Spotlight to add debug interface to your web app.",
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
10
|
"main": "./dist/sentry-spotlight.js",
|
|
11
|
+
"types": "./dist/sentry-spotlight.d.ts",
|
|
11
12
|
"exports": {
|
|
12
13
|
".": {
|
|
14
|
+
"types": "./dist/sentry-spotlight.d.ts",
|
|
13
15
|
"import": "./dist/sentry-spotlight.js",
|
|
14
16
|
"require": "./dist/sentry-spotlight.umd.cjs"
|
|
15
17
|
}
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
28
30
|
"eslint-plugin-react-refresh": "^0.4.3",
|
|
29
31
|
"typescript": "^5.0.2",
|
|
30
|
-
"vite": "^4.
|
|
32
|
+
"vite": "^4.5.1",
|
|
31
33
|
"vite-plugin-dts": "^3.5.2",
|
|
32
34
|
"vite-plugin-svgr": "^3.2.0",
|
|
33
35
|
"vitest": "^0.34.6",
|
|
@@ -35,7 +37,7 @@
|
|
|
35
37
|
"@sentry/utils": "^7.77.0",
|
|
36
38
|
"autoprefixer": "^10.4.15",
|
|
37
39
|
"dayjs": "^1.11.9",
|
|
38
|
-
"platformicons": "^5.
|
|
40
|
+
"platformicons": "^5.8.3",
|
|
39
41
|
"postcss": "^8.4.28",
|
|
40
42
|
"react": "^18.2.0",
|
|
41
43
|
"react-dom": "^18.2.0",
|
|
@@ -43,7 +45,8 @@
|
|
|
43
45
|
"sql-formatter": "^12.2.4",
|
|
44
46
|
"tailwindcss": "^3.3.3",
|
|
45
47
|
"usehooks-ts": "^2.9.1",
|
|
46
|
-
"
|
|
48
|
+
"magic-string": "^0.30.5",
|
|
49
|
+
"@spotlightjs/tsconfig": "1.0.0"
|
|
47
50
|
},
|
|
48
51
|
"volta": {
|
|
49
52
|
"extends": "../../package.json"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|