glitchgrab 1.58.1 → 1.58.3
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 +32 -0
- package/dist/index.d.mts +21 -3
- package/dist/index.d.ts +21 -3
- package/dist/index.js +2205 -1281
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2204 -1281
- package/dist/index.mjs.map +1 -1
- package/dist/server.d.mts +41 -3
- package/dist/server.d.ts +41 -3
- package/dist/server.js +49 -15
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +47 -15
- package/dist/server.mjs.map +1 -1
- package/dist/{types-DfVtKZcp.d.mts → types-BpTLWJ1y.d.mts} +8 -0
- package/dist/{types-DfVtKZcp.d.ts → types-BpTLWJ1y.d.ts} +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -715,6 +715,10 @@ hydrateRoot(document, <App />, {
|
|
|
715
715
|
|
|
716
716
|
Next.js does not expose `hydrateRoot` options, so App Router apps should use the `error.tsx` snippets above.
|
|
717
717
|
|
|
718
|
+
### Hydration errors (React #418 family)
|
|
719
|
+
|
|
720
|
+
Nothing to wire. In production the provider catches React #418/#419/#422/#423/#425 with the **component stack** React built for them (Next.js normally throws it away), the server HTML React replaced, any extension or Translate nodes found in the page, and fetch timing. The issue is labelled `gg:hydration` and its title names the element that mismatched. The same mismatch groups into one issue across pages, browsers and deploys. If your site serves source maps (`productionBrowserSourceMaps: true`), Glitchgrab also maps the stack to your source files, so the issue names the nearest component file too.
|
|
721
|
+
|
|
718
722
|
### captureError options
|
|
719
723
|
|
|
720
724
|
```ts
|
|
@@ -1049,9 +1053,36 @@ demos[0].answers; // [{ id: "language", question: "Which language…", answer: "
|
|
|
1049
1053
|
- The dialog needs a `glitchgrab` version newer than 1.57 on the site. An older one
|
|
1050
1054
|
still books, without asking.
|
|
1051
1055
|
|
|
1056
|
+
### Trying new questions before prospects see them
|
|
1057
|
+
|
|
1058
|
+
Questions sent as above go live at once. Send `draft: true` and they are saved as
|
|
1059
|
+
a draft instead: the booking dialog and the WhatsApp chat keep asking the current
|
|
1060
|
+
questions until you publish.
|
|
1061
|
+
|
|
1062
|
+
```ts
|
|
1063
|
+
import { publishBookingQuestions, discardBookingQuestionsDraft } from "glitchgrab/server";
|
|
1064
|
+
|
|
1065
|
+
await updateBookingSettings({ questions, draft: true }); // live dialog unchanged
|
|
1066
|
+
|
|
1067
|
+
// On an admin page (client side), open the real dialog with the draft:
|
|
1068
|
+
const { openBookingPreview } = useGlitchgrab();
|
|
1069
|
+
openBookingPreview(); // "Preview — nothing is booked"; no code is sent
|
|
1070
|
+
|
|
1071
|
+
await publishBookingQuestions(); // the draft goes live
|
|
1072
|
+
// or: await discardBookingQuestionsDraft();
|
|
1073
|
+
```
|
|
1074
|
+
|
|
1075
|
+
- `settings.draftQuestions` is the draft, `null` when there is none.
|
|
1076
|
+
- Sending `questions` without `draft` still goes live straight away — and drops any draft.
|
|
1077
|
+
- `publishBookingQuestions()` with no draft comes back as `{ ok: false, error }`.
|
|
1078
|
+
- Put `openBookingPreview` behind your admin login; it is not for prospects.
|
|
1079
|
+
- The owner can do the same in Glitchgrab → Calls → Booking (Save as draft → Preview → Publish).
|
|
1080
|
+
|
|
1052
1081
|
```ts
|
|
1053
1082
|
getBookingSettings(options?: CallsOptions): Promise<BookingSettingsResult>
|
|
1054
1083
|
updateBookingSettings(changes: BookingSettingsChanges, options?: CallsOptions): Promise<BookingSettingsResult>
|
|
1084
|
+
publishBookingQuestions(options?: CallsOptions): Promise<BookingSettingsResult>
|
|
1085
|
+
discardBookingQuestionsDraft(options?: CallsOptions): Promise<BookingSettingsResult>
|
|
1055
1086
|
|
|
1056
1087
|
type BookingSettingsResult =
|
|
1057
1088
|
| { ok: true; data: { settings: BookingSettings; saved: boolean; calendarConnected: boolean } }
|
|
@@ -1072,6 +1103,7 @@ interface BookingSettings {
|
|
|
1072
1103
|
whatsappCode: string | null;
|
|
1073
1104
|
notifyRecipients: { name: string; phone: string }[]; // extra WhatsApp numbers alerted on a booking, max 5
|
|
1074
1105
|
questions: BookingQuestion[]; // asked before the calendar, max 5
|
|
1106
|
+
draftQuestions: BookingQuestion[] | null; // saved with draft: true, not live; null = no draft
|
|
1075
1107
|
}
|
|
1076
1108
|
|
|
1077
1109
|
interface BookingQuestion {
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { f as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, F as FeedbackButtonProps, g as GlitchgrabSession, C as CaptureErrorOptions, e as GlitchgrabFeedback, a as BreadcrumbType, B as Breadcrumb, b as CapturedContext, D as DeviceInfo, c as FeedbackPayload, d as FeedbackResult, L as LeadInput, h as LeadResult, i as ReportPayload, j as ReportResult } from './types-
|
|
3
|
-
export { G as GlitchgrabConfig, k as ReportSeverity, l as ReportType, m as RuntimeInfo } from './types-
|
|
2
|
+
import { f as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, F as FeedbackButtonProps, g as GlitchgrabSession, C as CaptureErrorOptions, e as GlitchgrabFeedback, a as BreadcrumbType, B as Breadcrumb, b as CapturedContext, D as DeviceInfo, c as FeedbackPayload, d as FeedbackResult, L as LeadInput, h as LeadResult, i as ReportPayload, j as ReportResult } from './types-BpTLWJ1y.mjs';
|
|
3
|
+
export { G as GlitchgrabConfig, k as ReportSeverity, l as ReportType, m as RuntimeInfo } from './types-BpTLWJ1y.mjs';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
|
|
@@ -81,6 +81,24 @@ declare function BookDemoButton({ label, className, children, }: {
|
|
|
81
81
|
}) => ReactNode;
|
|
82
82
|
}): react_jsx_runtime.JSX.Element;
|
|
83
83
|
|
|
84
|
+
declare function BookingDialog({ token, baseUrl, open, onClose, preview, availabilityUrl, }: {
|
|
85
|
+
token: string;
|
|
86
|
+
baseUrl: string;
|
|
87
|
+
open: boolean;
|
|
88
|
+
onClose: () => void;
|
|
89
|
+
/**
|
|
90
|
+
* The owner checking draft questions (#551): loads the draft instead of the
|
|
91
|
+
* live set and never books — the dialog stops before it would post.
|
|
92
|
+
*/
|
|
93
|
+
preview?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Where availability is read from instead of the public SDK route. The
|
|
96
|
+
* Glitchgrab dashboard's Preview passes its own session route, because it
|
|
97
|
+
* holds no `gg_` token for the project. Same response shape.
|
|
98
|
+
*/
|
|
99
|
+
availabilityUrl?: string;
|
|
100
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
101
|
+
|
|
84
102
|
/**
|
|
85
103
|
* Trigger for the built-in feedback dialog (stars + message).
|
|
86
104
|
*
|
|
@@ -404,4 +422,4 @@ declare function computeSignature(params: {
|
|
|
404
422
|
declare function shouldSkipDuplicate(signature: string, windowMs?: number, now?: number): boolean;
|
|
405
423
|
declare function clearDedupCache(): void;
|
|
406
424
|
|
|
407
|
-
export { BookDemoButton, Breadcrumb, BreadcrumbType, CaptureErrorOptions, CapturedContext, DeviceInfo, FeedbackButton, FeedbackButtonProps, FeedbackPayload, type FeedbackQuery, FeedbackResult, GLITCHGRAB_SHORTCUT, GLITCHGRAB_SHORTCUT_MAC, GlitchgrabErrorBoundary, GlitchgrabFeedback, GlitchgrabProvider, GlitchgrabProviderProps, type GlitchgrabReport, GlitchgrabSession, LeadInput, LeadResult, ReportButton, ReportButtonProps, ReportPayload, ReportResult, UseGlitchgrabReturn, addBreadcrumb, captureContext, captureDeviceInfo, captureError, clearAppContext, clearBreadcrumbs, clearDedupCache, computeSignature, enhanceText, fetchGlitchgrabFeedback, fetchGlitchgrabReports, getAppContext, getBreadcrumbs, getShortcutLabel, initBreadcrumbs, matchesShortcut, sanitizeUrl, sendFeedback, sendLead, sendReport, setContext, setContexts, shouldSkipDuplicate, useGlitchgrab, useGlitchgrabActions, useGlitchgrabFeedback, useGlitchgrabReports };
|
|
425
|
+
export { BookDemoButton, BookingDialog, Breadcrumb, BreadcrumbType, CaptureErrorOptions, CapturedContext, DeviceInfo, FeedbackButton, FeedbackButtonProps, FeedbackPayload, type FeedbackQuery, FeedbackResult, GLITCHGRAB_SHORTCUT, GLITCHGRAB_SHORTCUT_MAC, GlitchgrabErrorBoundary, GlitchgrabFeedback, GlitchgrabProvider, GlitchgrabProviderProps, type GlitchgrabReport, GlitchgrabSession, LeadInput, LeadResult, ReportButton, ReportButtonProps, ReportPayload, ReportResult, UseGlitchgrabReturn, addBreadcrumb, captureContext, captureDeviceInfo, captureError, clearAppContext, clearBreadcrumbs, clearDedupCache, computeSignature, enhanceText, fetchGlitchgrabFeedback, fetchGlitchgrabReports, getAppContext, getBreadcrumbs, getShortcutLabel, initBreadcrumbs, matchesShortcut, sanitizeUrl, sendFeedback, sendLead, sendReport, setContext, setContexts, shouldSkipDuplicate, useGlitchgrab, useGlitchgrabActions, useGlitchgrabFeedback, useGlitchgrabReports };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { f as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, F as FeedbackButtonProps, g as GlitchgrabSession, C as CaptureErrorOptions, e as GlitchgrabFeedback, a as BreadcrumbType, B as Breadcrumb, b as CapturedContext, D as DeviceInfo, c as FeedbackPayload, d as FeedbackResult, L as LeadInput, h as LeadResult, i as ReportPayload, j as ReportResult } from './types-
|
|
3
|
-
export { G as GlitchgrabConfig, k as ReportSeverity, l as ReportType, m as RuntimeInfo } from './types-
|
|
2
|
+
import { f as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, F as FeedbackButtonProps, g as GlitchgrabSession, C as CaptureErrorOptions, e as GlitchgrabFeedback, a as BreadcrumbType, B as Breadcrumb, b as CapturedContext, D as DeviceInfo, c as FeedbackPayload, d as FeedbackResult, L as LeadInput, h as LeadResult, i as ReportPayload, j as ReportResult } from './types-BpTLWJ1y.js';
|
|
3
|
+
export { G as GlitchgrabConfig, k as ReportSeverity, l as ReportType, m as RuntimeInfo } from './types-BpTLWJ1y.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
|
|
@@ -81,6 +81,24 @@ declare function BookDemoButton({ label, className, children, }: {
|
|
|
81
81
|
}) => ReactNode;
|
|
82
82
|
}): react_jsx_runtime.JSX.Element;
|
|
83
83
|
|
|
84
|
+
declare function BookingDialog({ token, baseUrl, open, onClose, preview, availabilityUrl, }: {
|
|
85
|
+
token: string;
|
|
86
|
+
baseUrl: string;
|
|
87
|
+
open: boolean;
|
|
88
|
+
onClose: () => void;
|
|
89
|
+
/**
|
|
90
|
+
* The owner checking draft questions (#551): loads the draft instead of the
|
|
91
|
+
* live set and never books — the dialog stops before it would post.
|
|
92
|
+
*/
|
|
93
|
+
preview?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Where availability is read from instead of the public SDK route. The
|
|
96
|
+
* Glitchgrab dashboard's Preview passes its own session route, because it
|
|
97
|
+
* holds no `gg_` token for the project. Same response shape.
|
|
98
|
+
*/
|
|
99
|
+
availabilityUrl?: string;
|
|
100
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
101
|
+
|
|
84
102
|
/**
|
|
85
103
|
* Trigger for the built-in feedback dialog (stars + message).
|
|
86
104
|
*
|
|
@@ -404,4 +422,4 @@ declare function computeSignature(params: {
|
|
|
404
422
|
declare function shouldSkipDuplicate(signature: string, windowMs?: number, now?: number): boolean;
|
|
405
423
|
declare function clearDedupCache(): void;
|
|
406
424
|
|
|
407
|
-
export { BookDemoButton, Breadcrumb, BreadcrumbType, CaptureErrorOptions, CapturedContext, DeviceInfo, FeedbackButton, FeedbackButtonProps, FeedbackPayload, type FeedbackQuery, FeedbackResult, GLITCHGRAB_SHORTCUT, GLITCHGRAB_SHORTCUT_MAC, GlitchgrabErrorBoundary, GlitchgrabFeedback, GlitchgrabProvider, GlitchgrabProviderProps, type GlitchgrabReport, GlitchgrabSession, LeadInput, LeadResult, ReportButton, ReportButtonProps, ReportPayload, ReportResult, UseGlitchgrabReturn, addBreadcrumb, captureContext, captureDeviceInfo, captureError, clearAppContext, clearBreadcrumbs, clearDedupCache, computeSignature, enhanceText, fetchGlitchgrabFeedback, fetchGlitchgrabReports, getAppContext, getBreadcrumbs, getShortcutLabel, initBreadcrumbs, matchesShortcut, sanitizeUrl, sendFeedback, sendLead, sendReport, setContext, setContexts, shouldSkipDuplicate, useGlitchgrab, useGlitchgrabActions, useGlitchgrabFeedback, useGlitchgrabReports };
|
|
425
|
+
export { BookDemoButton, BookingDialog, Breadcrumb, BreadcrumbType, CaptureErrorOptions, CapturedContext, DeviceInfo, FeedbackButton, FeedbackButtonProps, FeedbackPayload, type FeedbackQuery, FeedbackResult, GLITCHGRAB_SHORTCUT, GLITCHGRAB_SHORTCUT_MAC, GlitchgrabErrorBoundary, GlitchgrabFeedback, GlitchgrabProvider, GlitchgrabProviderProps, type GlitchgrabReport, GlitchgrabSession, LeadInput, LeadResult, ReportButton, ReportButtonProps, ReportPayload, ReportResult, UseGlitchgrabReturn, addBreadcrumb, captureContext, captureDeviceInfo, captureError, clearAppContext, clearBreadcrumbs, clearDedupCache, computeSignature, enhanceText, fetchGlitchgrabFeedback, fetchGlitchgrabReports, getAppContext, getBreadcrumbs, getShortcutLabel, initBreadcrumbs, matchesShortcut, sanitizeUrl, sendFeedback, sendLead, sendReport, setContext, setContexts, shouldSkipDuplicate, useGlitchgrab, useGlitchgrabActions, useGlitchgrabFeedback, useGlitchgrabReports };
|