@spectosh/browser 0.2.5 → 0.3.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/README.md +3 -1
- package/dist/point-B777VT29.js +1418 -0
- package/dist/point-rS_lg9Ro.cjs +252 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +35 -28
- package/dist/specto-browser.cjs +1 -1
- package/dist/specto-browser.js +1 -2
- package/dist/src-BfP2ol_O.cjs +138 -0
- package/dist/{src-D-1ogCCr.js → src-oKUp2jmR.js} +1460 -1204
- package/package.json +7 -5
- package/src/index.js +19 -3
- package/src/point/context.js +61 -0
- package/src/point/describe.js +241 -0
- package/src/point/entry.js +475 -0
- package/src/point/index.js +858 -0
- package/src/point/trigger.js +198 -0
- package/src/point/voice.js +131 -0
- package/src/react.js +9 -3
- package/src/recorder.js +103 -25
- package/src/scrub.js +15 -0
- package/types/index.d.ts +40 -1
- package/types/react.d.ts +3 -1
- package/dist/src-DyiwhKUe.cjs +0 -138
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// Types for @spectosh/browser — the Specto session
|
|
1
|
+
// Types for @spectosh/browser — the Specto recorder (session replay) and
|
|
2
|
+
// Point, the cursor mode people use to mark what is broken.
|
|
2
3
|
|
|
3
4
|
export interface RecordingOptions {
|
|
4
5
|
/**
|
|
@@ -19,6 +20,8 @@ export interface RecordingOptions {
|
|
|
19
20
|
sampleRate?: number
|
|
20
21
|
/** `'required'`: record and store nothing until `grantConsent()`. */
|
|
21
22
|
consent?: 'granted' | 'required'
|
|
23
|
+
/** 'respect': never record visitors sending Do-Not-Track or Global Privacy Control; by default the project's setting decides */
|
|
24
|
+
privacySignals?: 'respect'
|
|
22
25
|
/** Capture console output (default true). */
|
|
23
26
|
console?: boolean
|
|
24
27
|
/** Devtools-style request details: headers, sizes, timing (default true). Bodies are never captured. */
|
|
@@ -27,6 +30,12 @@ export interface RecordingOptions {
|
|
|
27
30
|
traces?: boolean
|
|
28
31
|
/** More origins to send `traceparent` to (their CORS must allow the header). */
|
|
29
32
|
traceOrigins?: string[]
|
|
33
|
+
/** Your build's version (a git SHA or tag): bugs name the release that introduced them. */
|
|
34
|
+
release?: string
|
|
35
|
+
/** `false` leaves Point out on this page, whatever the project's settings say. */
|
|
36
|
+
point?: boolean
|
|
37
|
+
/** The "Report a problem" button on this page, over Settings → Point: false hides it. */
|
|
38
|
+
launcher?: LauncherOptions | false
|
|
30
39
|
/** Called as events are captured. */
|
|
31
40
|
onUpdate?: (info: { total: number; kind: string }) => void
|
|
32
41
|
/** Called for upload outcomes (ack, drop, stop, rotate). */
|
|
@@ -73,6 +82,34 @@ export interface Recorder {
|
|
|
73
82
|
* project's host confirms the key and its settings arrive.
|
|
74
83
|
*/
|
|
75
84
|
export function startRecording(options: RecordingOptions): Recorder
|
|
85
|
+
/** The open Point, while it is open. */
|
|
86
|
+
export interface PointSession {
|
|
87
|
+
/** Send what is marked now. */
|
|
88
|
+
send(): Promise<void>
|
|
89
|
+
/** Leave without sending. */
|
|
90
|
+
close(): void
|
|
91
|
+
/** Markers placed so far. */
|
|
92
|
+
readonly markers: number
|
|
93
|
+
readonly state: 'armed' | 'marking' | 'flow' | 'sent'
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Open Point from your own UI (a "Report a problem" menu item) — no gesture
|
|
97
|
+
* needed, and whoever your app shows it to may use it. Resolves with the
|
|
98
|
+
* open Point, or null when the project turned Point off or recording never
|
|
99
|
+
* started. Its code loads on first use.
|
|
100
|
+
*/
|
|
101
|
+
/** Opens Point from your own UI; `via` says where from in the report ('api' by default, 'error' from an error page). */
|
|
102
|
+
export function openPoint(via?: 'api' | 'error'): Promise<PointSession | null> | null
|
|
103
|
+
export interface LauncherOptions {
|
|
104
|
+
position?: 'bottom-right' | 'bottom-left' | 'edge'
|
|
105
|
+
/** Pixels from the corner: [x, y]. CSS works too: #specto-point-entry { --specto-launcher-x / -y / -z } */
|
|
106
|
+
offset?: [number, number]
|
|
107
|
+
label?: string
|
|
108
|
+
/** '#RRGGBB' */
|
|
109
|
+
color?: string
|
|
110
|
+
}
|
|
111
|
+
/** Changes the launcher on this page (e.g. per route); false hides it. */
|
|
112
|
+
export function setLauncher(options: LauncherOptions | false | undefined): void
|
|
76
113
|
/** Attach your user id (and a few flat traits) to the session. */
|
|
77
114
|
export function identify(id: string | number, traits?: Traits): void
|
|
78
115
|
/** Record a custom product event on the session's timeline. */
|
|
@@ -105,6 +142,8 @@ declare const Specto: {
|
|
|
105
142
|
captureError: typeof captureError
|
|
106
143
|
sessionUrl: typeof sessionUrl
|
|
107
144
|
stopRecording: typeof stopRecording
|
|
145
|
+
openPoint: typeof openPoint
|
|
146
|
+
setLauncher: typeof setLauncher
|
|
108
147
|
grantConsent: typeof grantConsent
|
|
109
148
|
revokeConsent: typeof revokeConsent
|
|
110
149
|
optOut: typeof optOut
|
package/types/react.d.ts
CHANGED
|
@@ -37,8 +37,10 @@ export function useSpecto(): SpectoApi
|
|
|
37
37
|
export interface SpectoErrorBoundaryProps {
|
|
38
38
|
children?: ReactNode
|
|
39
39
|
/** Shown instead of the children after an error; or a render function. */
|
|
40
|
-
fallback?: ReactNode | ((args: { error: unknown; reset: () => void }) => ReactNode)
|
|
40
|
+
fallback?: ReactNode | ((args: { error: unknown; reset: () => void; report: () => void }) => ReactNode)
|
|
41
41
|
onError?: (error: unknown, info: ReactErrorInfo) => void
|
|
42
|
+
/** A "Show us what happened" button under the fallback that opens Point; a string sets its label. */
|
|
43
|
+
reportButton?: boolean | string
|
|
42
44
|
}
|
|
43
45
|
/** Reports what it catches — with the component stack — to Specto. */
|
|
44
46
|
export class SpectoErrorBoundary extends Component<SpectoErrorBoundaryProps, { error: unknown }> {}
|