@screeb/sdk-react 0.1.13 → 0.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.
@@ -299,11 +299,11 @@ var ScreebProvider = function (_a) {
299
299
  case 1: return [2 /*return*/, _a.sent()];
300
300
  }
301
301
  }); }); }, []);
302
- var surveyStart = React__namespace.useCallback(function (surveyId, allowMultipleResponses, hiddenFields, hooks, language) { return __awaiter(void 0, void 0, void 0, function () {
302
+ var surveyStart = React__namespace.useCallback(function (surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language) { return __awaiter(void 0, void 0, void 0, function () {
303
303
  return __generator(this, function (_a) {
304
304
  switch (_a.label) {
305
305
  case 0: return [4 /*yield*/, ensureScreeb("surveyStart", function () {
306
- return Screeb__namespace.surveyStart(surveyId, allowMultipleResponses, hiddenFields, hooks, language);
306
+ return Screeb__namespace.surveyStart(surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language);
307
307
  })];
308
308
  case 1: return [2 /*return*/, _a.sent()];
309
309
  }
@@ -394,4 +394,4 @@ var useScreeb = function () {
394
394
 
395
395
  exports.ScreebProvider = ScreebProvider;
396
396
  exports.useScreeb = useScreeb;
397
- CONSTANTS.version = '0.1.13'
397
+ CONSTANTS.version = '0.2.0'
@@ -292,6 +292,7 @@ export type SurveyCloseFunction = () => Promise<unknown>;
292
292
  *
293
293
  * surveyStart(
294
294
  * '<UUID>',
295
+ * '<UUID>',
295
296
  * false,
296
297
  * {
297
298
  * color: "green",
@@ -300,7 +301,7 @@ export type SurveyCloseFunction = () => Promise<unknown>;
300
301
  * );
301
302
  * ```
302
303
  */
303
- export type SurveyStartFunction = (surveyId: string, allowMultipleResponses: boolean, hiddenFields: PropertyRecord, hooks?: Hooks, language?: string) => Promise<unknown>;
304
+ export type SurveyStartFunction = (surveyId: string, distributionId: string, allowMultipleResponses: boolean, hiddenFields: PropertyRecord, hooks?: Hooks, language?: string) => Promise<unknown>;
304
305
  /**
305
306
  * Interrupts a running message.
306
307
  *
@@ -381,6 +382,8 @@ export type ScreebContextValues = {
381
382
  load: LoadFunction;
382
383
  surveyClose: SurveyCloseFunction;
383
384
  surveyStart: SurveyStartFunction;
385
+ messageClose: MessageCloseFunction;
386
+ messageStart: MessageStartFunction;
384
387
  targetingCheck: TargetingCheckFunction;
385
388
  targetingDebug: TargetingDebugFunction;
386
389
  };
package/dist/es/index.mjs CHANGED
@@ -277,11 +277,11 @@ var ScreebProvider = function (_a) {
277
277
  case 1: return [2 /*return*/, _a.sent()];
278
278
  }
279
279
  }); }); }, []);
280
- var surveyStart = React.useCallback(function (surveyId, allowMultipleResponses, hiddenFields, hooks, language) { return __awaiter(void 0, void 0, void 0, function () {
280
+ var surveyStart = React.useCallback(function (surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language) { return __awaiter(void 0, void 0, void 0, function () {
281
281
  return __generator(this, function (_a) {
282
282
  switch (_a.label) {
283
283
  case 0: return [4 /*yield*/, ensureScreeb("surveyStart", function () {
284
- return Screeb.surveyStart(surveyId, allowMultipleResponses, hiddenFields, hooks, language);
284
+ return Screeb.surveyStart(surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language);
285
285
  })];
286
286
  case 1: return [2 /*return*/, _a.sent()];
287
287
  }
@@ -371,4 +371,4 @@ var useScreeb = function () {
371
371
  };
372
372
 
373
373
  export { ScreebProvider, useScreeb };
374
- CONSTANTS.version = '0.1.13'
374
+ CONSTANTS.version = '0.2.0'
@@ -292,6 +292,7 @@ export type SurveyCloseFunction = () => Promise<unknown>;
292
292
  *
293
293
  * surveyStart(
294
294
  * '<UUID>',
295
+ * '<UUID>',
295
296
  * false,
296
297
  * {
297
298
  * color: "green",
@@ -300,7 +301,7 @@ export type SurveyCloseFunction = () => Promise<unknown>;
300
301
  * );
301
302
  * ```
302
303
  */
303
- export type SurveyStartFunction = (surveyId: string, allowMultipleResponses: boolean, hiddenFields: PropertyRecord, hooks?: Hooks, language?: string) => Promise<unknown>;
304
+ export type SurveyStartFunction = (surveyId: string, distributionId: string, allowMultipleResponses: boolean, hiddenFields: PropertyRecord, hooks?: Hooks, language?: string) => Promise<unknown>;
304
305
  /**
305
306
  * Interrupts a running message.
306
307
  *
@@ -381,6 +382,8 @@ export type ScreebContextValues = {
381
382
  load: LoadFunction;
382
383
  surveyClose: SurveyCloseFunction;
383
384
  surveyStart: SurveyStartFunction;
385
+ messageClose: MessageCloseFunction;
386
+ messageStart: MessageStartFunction;
384
387
  targetingCheck: TargetingCheckFunction;
385
388
  targetingDebug: TargetingDebugFunction;
386
389
  };
package/docs/README.md CHANGED
@@ -524,6 +524,8 @@ Screeb context API
524
524
  | `identityReset` | [`IdentityResetFunction`](README.md#identityresetfunction) |
525
525
  | `init` | [`InitFunction`](README.md#initfunction) |
526
526
  | `load` | [`LoadFunction`](README.md#loadfunction) |
527
+ | `messageClose` | [`MessageCloseFunction`](README.md#messageclosefunction) |
528
+ | `messageStart` | [`MessageStartFunction`](README.md#messagestartfunction) |
527
529
  | `surveyClose` | [`SurveyCloseFunction`](README.md#surveyclosefunction) |
528
530
  | `surveyStart` | [`SurveyStartFunction`](README.md#surveystartfunction) |
529
531
  | `targetingCheck` | [`TargetingCheckFunction`](README.md#targetingcheckfunction) |
@@ -583,7 +585,7 @@ ___
583
585
 
584
586
  ### SurveyStartFunction
585
587
 
586
- Ƭ **SurveyStartFunction**: (`surveyId`: `string`, `allowMultipleResponses`: `boolean`, `hiddenFields`: `PropertyRecord`, `hooks?`: `Hooks`, `language?`: `string`) => `Promise`\<`unknown`\>
588
+ Ƭ **SurveyStartFunction**: (`surveyId`: `string`, `distributionId`: `string`, `allowMultipleResponses`: `boolean`, `hiddenFields`: `PropertyRecord`, `hooks?`: `Hooks`, `language?`: `string`) => `Promise`\<`unknown`\>
587
589
 
588
590
  Starts a survey by its ID.
589
591
 
@@ -593,6 +595,7 @@ Starts a survey by its ID.
593
595
  const { surveyStart } = useScreeb();
594
596
 
595
597
  surveyStart(
598
+ '<UUID>',
596
599
  '<UUID>',
597
600
  false,
598
601
  {
@@ -604,13 +607,14 @@ surveyStart(
604
607
 
605
608
  #### Type declaration
606
609
 
607
- ▸ (`surveyId`, `allowMultipleResponses`, `hiddenFields`, `hooks?`, `language?`): `Promise`\<`unknown`\>
610
+ ▸ (`surveyId`, `distributionId`, `allowMultipleResponses`, `hiddenFields`, `hooks?`, `language?`): `Promise`\<`unknown`\>
608
611
 
609
612
  ##### Parameters
610
613
 
611
614
  | Name | Type |
612
615
  | :------ | :------ |
613
616
  | `surveyId` | `string` |
617
+ | `distributionId` | `string` |
614
618
  | `allowMultipleResponses` | `boolean` |
615
619
  | `hiddenFields` | `PropertyRecord` |
616
620
  | `hooks?` | `Hooks` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@screeb/sdk-react",
3
- "version": "0.1.13",
3
+ "version": "0.2.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.1.18"
44
+ "@screeb/sdk-browser": "^0.2.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@screeb/eslint-config": "^0.1.6",