@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/sidecar.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  import React from 'react';
2
2
  import { Integration, IntegrationData } from './integrations/integration';
3
- import { TriggerButtonCount } from './types';
4
- export declare function connectToSidecar(sidecar: string, contentTypeToIntegrations: Map<string, Integration<unknown>[]>, setIntegrationData: React.Dispatch<React.SetStateAction<IntegrationData<unknown>>>, setOnline: React.Dispatch<React.SetStateAction<boolean>>, setTriggerButtonCount: React.Dispatch<React.SetStateAction<TriggerButtonCount>>): () => void;
3
+ export declare function connectToSidecar(sidecarUrl: string, contentTypeToIntegrations: Map<string, Integration<unknown>[]>, setIntegrationData: React.Dispatch<React.SetStateAction<IntegrationData<unknown>>>, setOnline: React.Dispatch<React.SetStateAction<boolean>>): () => void;
package/dist/types.d.ts CHANGED
@@ -1,6 +1,80 @@
1
- export type TriggerButtonCount = {
2
- general: number;
3
- severe: number;
1
+ import { Anchor } from './components/Trigger';
2
+ import { Integration } from './integrations/integration';
3
+ export type SpotlightOverlayOptions = {
4
+ /**
5
+ * Array of Spotlight integrations to enable when the Overlay initializes.
6
+ *
7
+ * Usage:
8
+ * ```js
9
+ * integrations: [sentry(), myIntegration()]
10
+ * ```
11
+ *
12
+ * @default [sentry()]
13
+ */
14
+ integrations?: Integration[];
15
+ /**
16
+ * Set a URL to a custom Spotlight Sidecar instance. The Spotlight overlay
17
+ * will use this URL instead of the default URL to connect to the sidecar
18
+ * and to listen to incoming events.
19
+ *
20
+ * @default "http://localhost:8969/stream"
21
+ */
22
+ sidecarUrl?: string;
23
+ /**
24
+ * If set to `true`, the Spotlight overlay Window will be opened immediately
25
+ * after calling the init function.
26
+ *
27
+ * @default false - only the Spotlight button is visible.
28
+ */
29
+ openOnInit?: boolean;
30
+ /**
31
+ * By default, Spotlight waits until the host page is loaded before injecting the
32
+ * Spotlight Overlay. Depending on how and when the init call is made, the load
33
+ * event might have already happened.
34
+ *
35
+ * Setting injectImmediately to `true`, will inject the UI synchronously with the
36
+ * `init` call, regardless of the host page's load state.
37
+ *
38
+ * Use this option, if you called `init()` but the Spotlight Overlay UI is not visible.
39
+ *
40
+ * @default false
41
+ */
42
+ injectImmediately?: boolean;
43
+ /**
44
+ * If set to `false`, the Spotlight button will not be visible.
45
+ * This is useful if Spotlight is integrated into an existing UI,
46
+ * such as the Astro Dev Overlay.
47
+ *
48
+ * @default true
49
+ */
50
+ showTriggerButton?: boolean;
51
+ /**
52
+ * Set this option to define where the spotlight button should be anchored.
53
+ *
54
+ * @default "bottomRight"
55
+ */
56
+ anchor?: Anchor;
57
+ /**
58
+ * If set to `true`, the Spotlight overlay will log additional debug messages to the console.
59
+ *
60
+ * @default false
61
+ */
62
+ debug?: boolean;
63
+ /**
64
+ * TODO: Remove? No longer needed with new approach
65
+ */
66
+ defaultEventId?: string;
67
+ };
68
+ export type NotificationCount = {
69
+ /**
70
+ * Numbers of notifications
71
+ */
72
+ count: number;
73
+ /**
74
+ * Indicating that among the notification count, there's at least one severe notification.
75
+ * (This has impact on the UI, e.g. the notification count badge will be red)
76
+ */
77
+ severe?: boolean;
4
78
  };
5
79
  export type WindowWithSpotlight = Window & {
6
80
  __spotlight?: {
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": "0.0.19",
4
+ "version": "0.0.21",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "files": [
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "scripts": {
52
52
  "dev": "vite build --watch",
53
- "build": "tsc && vite build",
53
+ "build": "NODE_ENV=production tsc && vite build",
54
54
  "build:watch": "vite build --watch",
55
55
  "preview": "vite preview",
56
56
  "test": "vitest",