@screeb/sdk-react 0.3.0 → 0.4.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.
@@ -318,16 +318,19 @@ var ScreebProvider = function (_a) {
318
318
  case 1: return [2 /*return*/, _a.sent()];
319
319
  }
320
320
  }); }); }, []);
321
- var messageStart = React__namespace.useCallback(function (messageId, hiddenFields, hooks, language) { return __awaiter(void 0, void 0, void 0, function () {
322
- return __generator(this, function (_a) {
323
- switch (_a.label) {
324
- case 0: return [4 /*yield*/, ensureScreeb("messageStart", function () {
325
- return Screeb__namespace.messageStart(messageId, hiddenFields, hooks, language);
326
- })];
327
- case 1: return [2 /*return*/, _a.sent()];
328
- }
321
+ var messageStart = React__namespace.useCallback(function (messageId, allowMultipleResponses, hiddenFields, hooks, language) {
322
+ if (allowMultipleResponses === void 0) { allowMultipleResponses = true; }
323
+ return __awaiter(void 0, void 0, void 0, function () {
324
+ return __generator(this, function (_a) {
325
+ switch (_a.label) {
326
+ case 0: return [4 /*yield*/, ensureScreeb("messageStart", function () {
327
+ return Screeb__namespace.messageStart(messageId, allowMultipleResponses, hiddenFields, hooks, language);
328
+ })];
329
+ case 1: return [2 /*return*/, _a.sent()];
330
+ }
331
+ });
329
332
  });
330
- }); }, []);
333
+ }, []);
331
334
  var targetingCheck = React__namespace.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
332
335
  switch (_a.label) {
333
336
  case 0: return [4 /*yield*/, ensureScreeb("targetingCheck", function () { return Screeb__namespace.targetingCheck(); })];
@@ -412,4 +415,4 @@ var useScreeb = function () {
412
415
 
413
416
  exports.ScreebProvider = ScreebProvider;
414
417
  exports.useScreeb = useScreeb;
415
- CONSTANTS.version = '0.3.0'
418
+ CONSTANTS.version = '0.4.0'
@@ -330,7 +330,7 @@ export type MessageCloseFunction = () => Promise<unknown>;
330
330
  * );
331
331
  * ```
332
332
  */
333
- export type MessageStartFunction = (messageId: string, hiddenFields: PropertyRecord, hooks?: HooksMessageStart, language?: string) => Promise<unknown>;
333
+ export type MessageStartFunction = (messageId: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksMessageStart, language?: string) => Promise<unknown>;
334
334
  /**
335
335
  * Forces a targeting check.
336
336
  *
package/dist/es/index.mjs CHANGED
@@ -296,16 +296,19 @@ var ScreebProvider = function (_a) {
296
296
  case 1: return [2 /*return*/, _a.sent()];
297
297
  }
298
298
  }); }); }, []);
299
- var messageStart = React.useCallback(function (messageId, hiddenFields, hooks, language) { return __awaiter(void 0, void 0, void 0, function () {
300
- return __generator(this, function (_a) {
301
- switch (_a.label) {
302
- case 0: return [4 /*yield*/, ensureScreeb("messageStart", function () {
303
- return Screeb.messageStart(messageId, hiddenFields, hooks, language);
304
- })];
305
- case 1: return [2 /*return*/, _a.sent()];
306
- }
299
+ var messageStart = React.useCallback(function (messageId, allowMultipleResponses, hiddenFields, hooks, language) {
300
+ if (allowMultipleResponses === void 0) { allowMultipleResponses = true; }
301
+ return __awaiter(void 0, void 0, void 0, function () {
302
+ return __generator(this, function (_a) {
303
+ switch (_a.label) {
304
+ case 0: return [4 /*yield*/, ensureScreeb("messageStart", function () {
305
+ return Screeb.messageStart(messageId, allowMultipleResponses, hiddenFields, hooks, language);
306
+ })];
307
+ case 1: return [2 /*return*/, _a.sent()];
308
+ }
309
+ });
307
310
  });
308
- }); }, []);
311
+ }, []);
309
312
  var targetingCheck = React.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
310
313
  switch (_a.label) {
311
314
  case 0: return [4 /*yield*/, ensureScreeb("targetingCheck", function () { return Screeb.targetingCheck(); })];
@@ -389,4 +392,4 @@ var useScreeb = function () {
389
392
  };
390
393
 
391
394
  export { ScreebProvider, useScreeb };
392
- CONSTANTS.version = '0.3.0'
395
+ CONSTANTS.version = '0.4.0'
@@ -330,7 +330,7 @@ export type MessageCloseFunction = () => Promise<unknown>;
330
330
  * );
331
331
  * ```
332
332
  */
333
- export type MessageStartFunction = (messageId: string, hiddenFields: PropertyRecord, hooks?: HooksMessageStart, language?: string) => Promise<unknown>;
333
+ export type MessageStartFunction = (messageId: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksMessageStart, language?: string) => Promise<unknown>;
334
334
  /**
335
335
  * Forces a targeting check.
336
336
  *
package/docs/README.md CHANGED
@@ -465,7 +465,7 @@ ___
465
465
 
466
466
  ### MessageStartFunction
467
467
 
468
- Ƭ **MessageStartFunction**: (`messageId`: `string`, `hiddenFields`: `PropertyRecord`, `hooks?`: `HooksMessageStart`, `language?`: `string`) => `Promise`\<`unknown`\>
468
+ Ƭ **MessageStartFunction**: (`messageId`: `string`, `allowMultipleResponses?`: `boolean`, `hiddenFields?`: `PropertyRecord`, `hooks?`: `HooksMessageStart`, `language?`: `string`) => `Promise`\<`unknown`\>
469
469
 
470
470
  Starts a message by its ID.
471
471
 
@@ -486,14 +486,15 @@ messageStart(
486
486
 
487
487
  #### Type declaration
488
488
 
489
- ▸ (`messageId`, `hiddenFields`, `hooks?`, `language?`): `Promise`\<`unknown`\>
489
+ ▸ (`messageId`, `allowMultipleResponses?`, `hiddenFields?`, `hooks?`, `language?`): `Promise`\<`unknown`\>
490
490
 
491
491
  ##### Parameters
492
492
 
493
493
  | Name | Type |
494
494
  | :------ | :------ |
495
495
  | `messageId` | `string` |
496
- | `hiddenFields` | `PropertyRecord` |
496
+ | `allowMultipleResponses?` | `boolean` |
497
+ | `hiddenFields?` | `PropertyRecord` |
497
498
  | `hooks?` | `HooksMessageStart` |
498
499
  | `language?` | `string` |
499
500
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@screeb/sdk-react",
3
- "version": "0.3.0",
3
+ "version": "0.4.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.2.2"
44
+ "@screeb/sdk-browser": "^0.3.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@screeb/eslint-config": "^0.1.6",