@screeb/sdk-react 0.4.0 → 0.5.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/cjs/index.cjs +21 -1
- package/dist/cjs/types.d.ts +24 -0
- package/dist/es/index.mjs +21 -1
- package/dist/es/types.d.ts +24 -0
- package/docs/README.md +52 -0
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -331,6 +331,22 @@ var ScreebProvider = function (_a) {
|
|
|
331
331
|
});
|
|
332
332
|
});
|
|
333
333
|
}, []);
|
|
334
|
+
var sessionReplayStop = React__namespace.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
335
|
+
switch (_a.label) {
|
|
336
|
+
case 0: return [4 /*yield*/, ensureScreeb("sessionReplayStop", function () { return Screeb__namespace.sessionReplayStop(); })];
|
|
337
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
338
|
+
}
|
|
339
|
+
}); }); }, []);
|
|
340
|
+
var sessionReplayStart = React__namespace.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
341
|
+
return __generator(this, function (_a) {
|
|
342
|
+
switch (_a.label) {
|
|
343
|
+
case 0: return [4 /*yield*/, ensureScreeb("sessionReplayStart", function () {
|
|
344
|
+
return Screeb__namespace.sessionReplayStart();
|
|
345
|
+
})];
|
|
346
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
}); }, []);
|
|
334
350
|
var targetingCheck = React__namespace.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
335
351
|
switch (_a.label) {
|
|
336
352
|
case 0: return [4 /*yield*/, ensureScreeb("targetingCheck", function () { return Screeb__namespace.targetingCheck(); })];
|
|
@@ -374,6 +390,8 @@ var ScreebProvider = function (_a) {
|
|
|
374
390
|
surveyStart: surveyStart,
|
|
375
391
|
messageClose: messageClose,
|
|
376
392
|
messageStart: messageStart,
|
|
393
|
+
sessionReplayStop: sessionReplayStop,
|
|
394
|
+
sessionReplayStart: sessionReplayStart,
|
|
377
395
|
targetingCheck: targetingCheck,
|
|
378
396
|
targetingDebug: targetingDebug,
|
|
379
397
|
}); }, [
|
|
@@ -392,6 +410,8 @@ var ScreebProvider = function (_a) {
|
|
|
392
410
|
surveyStart,
|
|
393
411
|
messageClose,
|
|
394
412
|
messageStart,
|
|
413
|
+
sessionReplayStop,
|
|
414
|
+
sessionReplayStart,
|
|
395
415
|
targetingCheck,
|
|
396
416
|
targetingDebug,
|
|
397
417
|
]);
|
|
@@ -415,4 +435,4 @@ var useScreeb = function () {
|
|
|
415
435
|
|
|
416
436
|
exports.ScreebProvider = ScreebProvider;
|
|
417
437
|
exports.useScreeb = useScreeb;
|
|
418
|
-
CONSTANTS.version = '0.
|
|
438
|
+
CONSTANTS.version = '0.5.0'
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -331,6 +331,28 @@ export type MessageCloseFunction = () => Promise<unknown>;
|
|
|
331
331
|
* ```
|
|
332
332
|
*/
|
|
333
333
|
export type MessageStartFunction = (messageId: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksMessageStart, language?: string) => Promise<unknown>;
|
|
334
|
+
/**
|
|
335
|
+
* Interrupts a running session replay.
|
|
336
|
+
*
|
|
337
|
+
* @example
|
|
338
|
+
* ```ts
|
|
339
|
+
* const { sessionReplayStop } = useScreeb();
|
|
340
|
+
*
|
|
341
|
+
* sessionReplayStop();
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
344
|
+
export type SessionReplayStopFunction = () => Promise<unknown>;
|
|
345
|
+
/**
|
|
346
|
+
* Starts a session replay.
|
|
347
|
+
*
|
|
348
|
+
* @example
|
|
349
|
+
* ```ts
|
|
350
|
+
* const { sessionReplayStart } = useScreeb();
|
|
351
|
+
*
|
|
352
|
+
* sessionReplayStart();
|
|
353
|
+
* ```
|
|
354
|
+
*/
|
|
355
|
+
export type SessionReplayStartFunction = () => Promise<unknown>;
|
|
334
356
|
/**
|
|
335
357
|
* Forces a targeting check.
|
|
336
358
|
*
|
|
@@ -384,6 +406,8 @@ export type ScreebContextValues = {
|
|
|
384
406
|
surveyStart: SurveyStartFunction;
|
|
385
407
|
messageClose: MessageCloseFunction;
|
|
386
408
|
messageStart: MessageStartFunction;
|
|
409
|
+
sessionReplayStart: SessionReplayStartFunction;
|
|
410
|
+
sessionReplayStop: SessionReplayStopFunction;
|
|
387
411
|
targetingCheck: TargetingCheckFunction;
|
|
388
412
|
targetingDebug: TargetingDebugFunction;
|
|
389
413
|
};
|
package/dist/es/index.mjs
CHANGED
|
@@ -309,6 +309,22 @@ var ScreebProvider = function (_a) {
|
|
|
309
309
|
});
|
|
310
310
|
});
|
|
311
311
|
}, []);
|
|
312
|
+
var sessionReplayStop = React.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
313
|
+
switch (_a.label) {
|
|
314
|
+
case 0: return [4 /*yield*/, ensureScreeb("sessionReplayStop", function () { return Screeb.sessionReplayStop(); })];
|
|
315
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
316
|
+
}
|
|
317
|
+
}); }); }, []);
|
|
318
|
+
var sessionReplayStart = React.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
319
|
+
return __generator(this, function (_a) {
|
|
320
|
+
switch (_a.label) {
|
|
321
|
+
case 0: return [4 /*yield*/, ensureScreeb("sessionReplayStart", function () {
|
|
322
|
+
return Screeb.sessionReplayStart();
|
|
323
|
+
})];
|
|
324
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
}); }, []);
|
|
312
328
|
var targetingCheck = React.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
313
329
|
switch (_a.label) {
|
|
314
330
|
case 0: return [4 /*yield*/, ensureScreeb("targetingCheck", function () { return Screeb.targetingCheck(); })];
|
|
@@ -352,6 +368,8 @@ var ScreebProvider = function (_a) {
|
|
|
352
368
|
surveyStart: surveyStart,
|
|
353
369
|
messageClose: messageClose,
|
|
354
370
|
messageStart: messageStart,
|
|
371
|
+
sessionReplayStop: sessionReplayStop,
|
|
372
|
+
sessionReplayStart: sessionReplayStart,
|
|
355
373
|
targetingCheck: targetingCheck,
|
|
356
374
|
targetingDebug: targetingDebug,
|
|
357
375
|
}); }, [
|
|
@@ -370,6 +388,8 @@ var ScreebProvider = function (_a) {
|
|
|
370
388
|
surveyStart,
|
|
371
389
|
messageClose,
|
|
372
390
|
messageStart,
|
|
391
|
+
sessionReplayStop,
|
|
392
|
+
sessionReplayStart,
|
|
373
393
|
targetingCheck,
|
|
374
394
|
targetingDebug,
|
|
375
395
|
]);
|
|
@@ -392,4 +412,4 @@ var useScreeb = function () {
|
|
|
392
412
|
};
|
|
393
413
|
|
|
394
414
|
export { ScreebProvider, useScreeb };
|
|
395
|
-
CONSTANTS.version = '0.
|
|
415
|
+
CONSTANTS.version = '0.5.0'
|
package/dist/es/types.d.ts
CHANGED
|
@@ -331,6 +331,28 @@ export type MessageCloseFunction = () => Promise<unknown>;
|
|
|
331
331
|
* ```
|
|
332
332
|
*/
|
|
333
333
|
export type MessageStartFunction = (messageId: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksMessageStart, language?: string) => Promise<unknown>;
|
|
334
|
+
/**
|
|
335
|
+
* Interrupts a running session replay.
|
|
336
|
+
*
|
|
337
|
+
* @example
|
|
338
|
+
* ```ts
|
|
339
|
+
* const { sessionReplayStop } = useScreeb();
|
|
340
|
+
*
|
|
341
|
+
* sessionReplayStop();
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
344
|
+
export type SessionReplayStopFunction = () => Promise<unknown>;
|
|
345
|
+
/**
|
|
346
|
+
* Starts a session replay.
|
|
347
|
+
*
|
|
348
|
+
* @example
|
|
349
|
+
* ```ts
|
|
350
|
+
* const { sessionReplayStart } = useScreeb();
|
|
351
|
+
*
|
|
352
|
+
* sessionReplayStart();
|
|
353
|
+
* ```
|
|
354
|
+
*/
|
|
355
|
+
export type SessionReplayStartFunction = () => Promise<unknown>;
|
|
334
356
|
/**
|
|
335
357
|
* Forces a targeting check.
|
|
336
358
|
*
|
|
@@ -384,6 +406,8 @@ export type ScreebContextValues = {
|
|
|
384
406
|
surveyStart: SurveyStartFunction;
|
|
385
407
|
messageClose: MessageCloseFunction;
|
|
386
408
|
messageStart: MessageStartFunction;
|
|
409
|
+
sessionReplayStart: SessionReplayStartFunction;
|
|
410
|
+
sessionReplayStop: SessionReplayStopFunction;
|
|
387
411
|
targetingCheck: TargetingCheckFunction;
|
|
388
412
|
targetingDebug: TargetingDebugFunction;
|
|
389
413
|
};
|
package/docs/README.md
CHANGED
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
- [ScreebContextValues](README.md#screebcontextvalues)
|
|
23
23
|
- [ScreebProps](README.md#screebprops)
|
|
24
24
|
- [ScreebProviderProps](README.md#screebproviderprops)
|
|
25
|
+
- [SessionReplayStartFunction](README.md#sessionreplaystartfunction)
|
|
26
|
+
- [SessionReplayStopFunction](README.md#sessionreplaystopfunction)
|
|
25
27
|
- [SurveyCloseFunction](README.md#surveyclosefunction)
|
|
26
28
|
- [SurveyStartFunction](README.md#surveystartfunction)
|
|
27
29
|
- [TargetingCheckFunction](README.md#targetingcheckfunction)
|
|
@@ -527,6 +529,8 @@ Screeb context API
|
|
|
527
529
|
| `load` | [`LoadFunction`](README.md#loadfunction) |
|
|
528
530
|
| `messageClose` | [`MessageCloseFunction`](README.md#messageclosefunction) |
|
|
529
531
|
| `messageStart` | [`MessageStartFunction`](README.md#messagestartfunction) |
|
|
532
|
+
| `sessionReplayStart` | [`SessionReplayStartFunction`](README.md#sessionreplaystartfunction) |
|
|
533
|
+
| `sessionReplayStop` | [`SessionReplayStopFunction`](README.md#sessionreplaystopfunction) |
|
|
530
534
|
| `surveyClose` | [`SurveyCloseFunction`](README.md#surveyclosefunction) |
|
|
531
535
|
| `surveyStart` | [`SurveyStartFunction`](README.md#surveystartfunction) |
|
|
532
536
|
| `targetingCheck` | [`TargetingCheckFunction`](README.md#targetingcheckfunction) |
|
|
@@ -560,6 +564,54 @@ Properties of Screeb provider
|
|
|
560
564
|
|
|
561
565
|
___
|
|
562
566
|
|
|
567
|
+
### SessionReplayStartFunction
|
|
568
|
+
|
|
569
|
+
Ƭ **SessionReplayStartFunction**: () => `Promise`\<`unknown`\>
|
|
570
|
+
|
|
571
|
+
Starts a session replay.
|
|
572
|
+
|
|
573
|
+
**`Example`**
|
|
574
|
+
|
|
575
|
+
```ts
|
|
576
|
+
const { sessionReplayStart } = useScreeb();
|
|
577
|
+
|
|
578
|
+
sessionReplayStart();
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
#### Type declaration
|
|
582
|
+
|
|
583
|
+
▸ (): `Promise`\<`unknown`\>
|
|
584
|
+
|
|
585
|
+
##### Returns
|
|
586
|
+
|
|
587
|
+
`Promise`\<`unknown`\>
|
|
588
|
+
|
|
589
|
+
___
|
|
590
|
+
|
|
591
|
+
### SessionReplayStopFunction
|
|
592
|
+
|
|
593
|
+
Ƭ **SessionReplayStopFunction**: () => `Promise`\<`unknown`\>
|
|
594
|
+
|
|
595
|
+
Interrupts a running session replay.
|
|
596
|
+
|
|
597
|
+
**`Example`**
|
|
598
|
+
|
|
599
|
+
```ts
|
|
600
|
+
const { sessionReplayStop } = useScreeb();
|
|
601
|
+
|
|
602
|
+
sessionReplayStop();
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
#### Type declaration
|
|
606
|
+
|
|
607
|
+
▸ (): `Promise`\<`unknown`\>
|
|
608
|
+
|
|
609
|
+
##### Returns
|
|
610
|
+
|
|
611
|
+
`Promise`\<`unknown`\>
|
|
612
|
+
|
|
613
|
+
___
|
|
614
|
+
|
|
563
615
|
### SurveyCloseFunction
|
|
564
616
|
|
|
565
617
|
Ƭ **SurveyCloseFunction**: () => `Promise`\<`unknown`\>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@screeb/sdk-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Screeb's browser sdk, optimized for React.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"product discovery",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"test": "echo '@TODO'"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@screeb/sdk-browser": "^0.
|
|
44
|
+
"@screeb/sdk-browser": "^0.4.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@screeb/eslint-config": "^0.1.6",
|