gleap 19.1.0 → 19.2.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/build/browser/index.js +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/cjs/index.js +1 -1
- package/build/cjs/index.js.map +1 -1
- package/build/embed/survey-embed.js +1 -0
- package/build/esm/index.mjs +1 -1
- package/build/esm/index.mjs.map +1 -1
- package/index.d.ts +72 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -276,7 +276,78 @@ export namespace Gleap {
|
|
|
276
276
|
feedbackFlow: string,
|
|
277
277
|
showBackButton?: boolean
|
|
278
278
|
): void;
|
|
279
|
-
|
|
279
|
+
type SurveyFormat = "card" | "full" | "page";
|
|
280
|
+
interface ShowSurveyOptions {
|
|
281
|
+
/** card = corner popover (bottom sheet on phones), full = full screen, page = inline in `container`. Default: card. */
|
|
282
|
+
format?: SurveyFormat;
|
|
283
|
+
/** Values for the survey's hidden fields. */
|
|
284
|
+
fields?: Record<string, string>;
|
|
285
|
+
/** Signed personal-link token: attaches the response to that contact. */
|
|
286
|
+
personalToken?: string;
|
|
287
|
+
/** Page format: answer with the keyboard while focus is on the host page. */
|
|
288
|
+
keyboard?: boolean;
|
|
289
|
+
/** Element (or CSS selector) the page format renders into. Default: document.body. */
|
|
290
|
+
container?: HTMLElement | string;
|
|
291
|
+
/** Continue a started response where it was left. */
|
|
292
|
+
resume?: boolean;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Shows a survey. The legacy format strings ("survey", "survey_full", "survey_web") keep working.
|
|
296
|
+
*/
|
|
297
|
+
function showSurvey(
|
|
298
|
+
surveyId: string,
|
|
299
|
+
formatOrOptions?: "survey" | "survey_full" | "survey_web" | string | ShowSurveyOptions
|
|
300
|
+
): void;
|
|
301
|
+
/** Surveys 2.0 events (reported by the survey renderer; not fired for legacy surveys). */
|
|
302
|
+
interface SurveyShownEvent {
|
|
303
|
+
surveyId: string;
|
|
304
|
+
version: number;
|
|
305
|
+
format: SurveyFormat;
|
|
306
|
+
responseId: string;
|
|
307
|
+
/** true when a started response was continued (resume). */
|
|
308
|
+
resumed: boolean;
|
|
309
|
+
}
|
|
310
|
+
interface SurveyStepViewedEvent {
|
|
311
|
+
surveyId: string;
|
|
312
|
+
version: number;
|
|
313
|
+
responseId: string;
|
|
314
|
+
/** Zero-based position of the question in the survey. */
|
|
315
|
+
stepIndex: number;
|
|
316
|
+
/** Question (block) key. */
|
|
317
|
+
key: string;
|
|
318
|
+
[key: string]: any;
|
|
319
|
+
}
|
|
320
|
+
interface SurveyAnsweredEvent {
|
|
321
|
+
surveyId: string;
|
|
322
|
+
version: number;
|
|
323
|
+
responseId: string;
|
|
324
|
+
[key: string]: any;
|
|
325
|
+
}
|
|
326
|
+
interface SurveyCompletedEvent {
|
|
327
|
+
surveyId: string;
|
|
328
|
+
version: number;
|
|
329
|
+
responseId: string;
|
|
330
|
+
endingId: string;
|
|
331
|
+
/** Answers keyed by question key. */
|
|
332
|
+
answers: Record<string, any>;
|
|
333
|
+
}
|
|
334
|
+
interface SurveyClosedEvent {
|
|
335
|
+
surveyId: string;
|
|
336
|
+
version: number;
|
|
337
|
+
responseId?: string;
|
|
338
|
+
/** Response status when closed (e.g. "in_progress", "completed"); none when nothing was answered. */
|
|
339
|
+
status?: string;
|
|
340
|
+
}
|
|
341
|
+
/** The survey is visible. */
|
|
342
|
+
function on(event: "survey-shown", callback: (data: SurveyShownEvent) => void): void;
|
|
343
|
+
/** A question became visible. */
|
|
344
|
+
function on(event: "survey-step-viewed", callback: (data: SurveyStepViewedEvent) => void): void;
|
|
345
|
+
/** An answer was saved. */
|
|
346
|
+
function on(event: "survey-answered", callback: (data: SurveyAnsweredEvent) => void): void;
|
|
347
|
+
/** The last question was answered and an ending is shown. `outbound-sent` keeps firing as before. */
|
|
348
|
+
function on(event: "survey-completed", callback: (data: SurveyCompletedEvent) => void): void;
|
|
349
|
+
/** The survey was closed (by the user or after its ending). */
|
|
350
|
+
function on(event: "survey-closed", callback: (data: SurveyClosedEvent) => void): void;
|
|
280
351
|
function on(
|
|
281
352
|
event:
|
|
282
353
|
| "initialized"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "JavaScript and TypeScript SDK for Gleap, an Intercom alternative with AI customer support, live chat, in-app bug reporting and customer feedback.",
|
|
3
3
|
"name": "gleap",
|
|
4
|
-
"version": "19.
|
|
4
|
+
"version": "19.2.0",
|
|
5
5
|
"main": "build/cjs/index.js",
|
|
6
6
|
"module": "build/esm/index.mjs",
|
|
7
7
|
"exports": {
|