@screeb/sdk-react 0.5.0 → 0.6.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.
@@ -302,11 +302,11 @@ var ScreebProvider = function (_a) {
302
302
  case 1: return [2 /*return*/, _a.sent()];
303
303
  }
304
304
  }); }); }, []);
305
- var surveyStart = React__namespace.useCallback(function (surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language) { return __awaiter(void 0, void 0, void 0, function () {
305
+ var surveyStart = React__namespace.useCallback(function (surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language, selectors) { return __awaiter(void 0, void 0, void 0, function () {
306
306
  return __generator(this, function (_a) {
307
307
  switch (_a.label) {
308
308
  case 0: return [4 /*yield*/, ensureScreeb("surveyStart", function () {
309
- return Screeb__namespace.surveyStart(surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language);
309
+ return Screeb__namespace.surveyStart(surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language, selectors);
310
310
  })];
311
311
  case 1: return [2 /*return*/, _a.sent()];
312
312
  }
@@ -435,4 +435,4 @@ var useScreeb = function () {
435
435
 
436
436
  exports.ScreebProvider = ScreebProvider;
437
437
  exports.useScreeb = useScreeb;
438
- CONSTANTS.version = '0.5.0'
438
+ CONSTANTS.version = '0.6.0'
@@ -294,14 +294,20 @@ export type SurveyCloseFunction = () => Promise<unknown>;
294
294
  * '<UUID>',
295
295
  * '<UUID>',
296
296
  * false,
297
- * {
297
+ * { // optional
298
298
  * color: "green",
299
299
  * article_id: 42
300
- * }
300
+ * },
301
+ * { // optional
302
+ * version: "1.0.0",
303
+ * onSurveyShowed: (payload) => console.log("Survey showed", payload),
304
+ * },
305
+ * "en", // optional
306
+ * "#screeb-survey-container" // optional
301
307
  * );
302
308
  * ```
303
309
  */
304
- export type SurveyStartFunction = (surveyId: string, distributionId?: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string) => Promise<unknown>;
310
+ export type SurveyStartFunction = (surveyId: string, distributionId?: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string, selectors?: string | string[]) => Promise<unknown>;
305
311
  /**
306
312
  * Interrupts a running message.
307
313
  *
package/dist/es/index.mjs CHANGED
@@ -280,11 +280,11 @@ var ScreebProvider = function (_a) {
280
280
  case 1: return [2 /*return*/, _a.sent()];
281
281
  }
282
282
  }); }); }, []);
283
- var surveyStart = React.useCallback(function (surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language) { return __awaiter(void 0, void 0, void 0, function () {
283
+ var surveyStart = React.useCallback(function (surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language, selectors) { return __awaiter(void 0, void 0, void 0, function () {
284
284
  return __generator(this, function (_a) {
285
285
  switch (_a.label) {
286
286
  case 0: return [4 /*yield*/, ensureScreeb("surveyStart", function () {
287
- return Screeb.surveyStart(surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language);
287
+ return Screeb.surveyStart(surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language, selectors);
288
288
  })];
289
289
  case 1: return [2 /*return*/, _a.sent()];
290
290
  }
@@ -412,4 +412,4 @@ var useScreeb = function () {
412
412
  };
413
413
 
414
414
  export { ScreebProvider, useScreeb };
415
- CONSTANTS.version = '0.5.0'
415
+ CONSTANTS.version = '0.6.0'
@@ -294,14 +294,20 @@ export type SurveyCloseFunction = () => Promise<unknown>;
294
294
  * '<UUID>',
295
295
  * '<UUID>',
296
296
  * false,
297
- * {
297
+ * { // optional
298
298
  * color: "green",
299
299
  * article_id: 42
300
- * }
300
+ * },
301
+ * { // optional
302
+ * version: "1.0.0",
303
+ * onSurveyShowed: (payload) => console.log("Survey showed", payload),
304
+ * },
305
+ * "en", // optional
306
+ * "#screeb-survey-container" // optional
301
307
  * );
302
308
  * ```
303
309
  */
304
- export type SurveyStartFunction = (surveyId: string, distributionId?: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string) => Promise<unknown>;
310
+ export type SurveyStartFunction = (surveyId: string, distributionId?: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string, selectors?: string | string[]) => Promise<unknown>;
305
311
  /**
306
312
  * Interrupts a running message.
307
313
  *
package/docs/README.md CHANGED
@@ -638,7 +638,7 @@ ___
638
638
 
639
639
  ### SurveyStartFunction
640
640
 
641
- Ƭ **SurveyStartFunction**: (`surveyId`: `string`, `distributionId?`: `string`, `allowMultipleResponses?`: `boolean`, `hiddenFields?`: `PropertyRecord`, `hooks?`: `HooksSurveyStart`, `language?`: `string`) => `Promise`\<`unknown`\>
641
+ Ƭ **SurveyStartFunction**: (`surveyId`: `string`, `distributionId?`: `string`, `allowMultipleResponses?`: `boolean`, `hiddenFields?`: `PropertyRecord`, `hooks?`: `HooksSurveyStart`, `language?`: `string`, `selectors?`: `string` \| `string`[]) => `Promise`\<`unknown`\>
642
642
 
643
643
  Starts a survey by its ID.
644
644
 
@@ -651,16 +651,22 @@ surveyStart(
651
651
  '<UUID>',
652
652
  '<UUID>',
653
653
  false,
654
- {
654
+ { // optional
655
655
  color: "green",
656
656
  article_id: 42
657
- }
657
+ },
658
+ { // optional
659
+ version: "1.0.0",
660
+ onSurveyShowed: (payload) => console.log("Survey showed", payload),
661
+ },
662
+ "en", // optional
663
+ "#screeb-survey-container" // optional
658
664
  );
659
665
  ```
660
666
 
661
667
  #### Type declaration
662
668
 
663
- ▸ (`surveyId`, `distributionId?`, `allowMultipleResponses?`, `hiddenFields?`, `hooks?`, `language?`): `Promise`\<`unknown`\>
669
+ ▸ (`surveyId`, `distributionId?`, `allowMultipleResponses?`, `hiddenFields?`, `hooks?`, `language?`, `selectors?`): `Promise`\<`unknown`\>
664
670
 
665
671
  ##### Parameters
666
672
 
@@ -672,6 +678,7 @@ surveyStart(
672
678
  | `hiddenFields?` | `PropertyRecord` |
673
679
  | `hooks?` | `HooksSurveyStart` |
674
680
  | `language?` | `string` |
681
+ | `selectors?` | `string` \| `string`[] |
675
682
 
676
683
  ##### Returns
677
684
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@screeb/sdk-react",
3
- "version": "0.5.0",
3
+ "version": "0.6.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.4.0"
44
+ "@screeb/sdk-browser": "^0.5.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@screeb/eslint-config": "^0.1.6",