@screeb/sdk-react 0.1.8 → 0.1.9

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.
@@ -41,6 +41,17 @@ PERFORMANCE OF THIS SOFTWARE.
41
41
  /* global Reflect, Promise, SuppressedError, Symbol */
42
42
 
43
43
 
44
+ var __assign = function() {
45
+ __assign = Object.assign || function __assign(t) {
46
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
47
+ s = arguments[i];
48
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
49
+ }
50
+ return t;
51
+ };
52
+ return __assign.apply(this, arguments);
53
+ };
54
+
44
55
  function __rest(s, e) {
45
56
  var t = {};
46
57
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -127,6 +138,7 @@ var log = function (level, message) {
127
138
 
128
139
  var isSSR = typeof window === "undefined";
129
140
 
141
+ var CONSTANTS = { version: "0.0.0-dev" };
130
142
  var isInitialized = false;
131
143
  var ScreebProvider = function (_a) {
132
144
  var websiteId = _a.websiteId, userId = _a.userId, userProperties = _a.userProperties, hooks = _a.hooks, children = _a.children, _b = _a.shouldLoad, shouldLoad = _b === void 0 ? !isSSR : _b, _c = _a.autoInit, autoInit = _c === void 0 ? false : _c, options = _a.options, rest = __rest(_a, ["websiteId", "userId", "userProperties", "hooks", "children", "shouldLoad", "autoInit", "options"]);
@@ -266,7 +278,7 @@ var ScreebProvider = function (_a) {
266
278
  switch (_a.label) {
267
279
  case 0:
268
280
  if (!!isLoaded.current) return [3 /*break*/, 3];
269
- Screeb__namespace.load(options);
281
+ Screeb__namespace.load(__assign({ sdkName: "sdk-react", sdkVersion: CONSTANTS.version }, options));
270
282
  isLoaded.current = true;
271
283
  if (!autoInit) return [3 /*break*/, 3];
272
284
  if (!websiteId) return [3 /*break*/, 2];
@@ -362,3 +374,4 @@ var useScreeb = function () {
362
374
 
363
375
  exports.ScreebProvider = ScreebProvider;
364
376
  exports.useScreeb = useScreeb;
377
+ CONSTANTS.version = '0.1.9'
@@ -1,4 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { ScreebContextValues, ScreebProviderProps } from "./types";
3
+ export declare const CONSTANTS: {
4
+ version: string;
5
+ };
3
6
  export declare const ScreebProvider: React.FC<React.PropsWithChildren<ScreebProviderProps>>;
4
7
  export declare const useScreebContext: () => ScreebContextValues;
package/dist/es/index.mjs CHANGED
@@ -19,6 +19,17 @@ PERFORMANCE OF THIS SOFTWARE.
19
19
  /* global Reflect, Promise, SuppressedError, Symbol */
20
20
 
21
21
 
22
+ var __assign = function() {
23
+ __assign = Object.assign || function __assign(t) {
24
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
25
+ s = arguments[i];
26
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
27
+ }
28
+ return t;
29
+ };
30
+ return __assign.apply(this, arguments);
31
+ };
32
+
22
33
  function __rest(s, e) {
23
34
  var t = {};
24
35
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -105,6 +116,7 @@ var log = function (level, message) {
105
116
 
106
117
  var isSSR = typeof window === "undefined";
107
118
 
119
+ var CONSTANTS = { version: "0.0.0-dev" };
108
120
  var isInitialized = false;
109
121
  var ScreebProvider = function (_a) {
110
122
  var websiteId = _a.websiteId, userId = _a.userId, userProperties = _a.userProperties, hooks = _a.hooks, children = _a.children, _b = _a.shouldLoad, shouldLoad = _b === void 0 ? !isSSR : _b, _c = _a.autoInit, autoInit = _c === void 0 ? false : _c, options = _a.options, rest = __rest(_a, ["websiteId", "userId", "userProperties", "hooks", "children", "shouldLoad", "autoInit", "options"]);
@@ -244,7 +256,7 @@ var ScreebProvider = function (_a) {
244
256
  switch (_a.label) {
245
257
  case 0:
246
258
  if (!!isLoaded.current) return [3 /*break*/, 3];
247
- Screeb.load(options);
259
+ Screeb.load(__assign({ sdkName: "sdk-react", sdkVersion: CONSTANTS.version }, options));
248
260
  isLoaded.current = true;
249
261
  if (!autoInit) return [3 /*break*/, 3];
250
262
  if (!websiteId) return [3 /*break*/, 2];
@@ -339,3 +351,4 @@ var useScreeb = function () {
339
351
  };
340
352
 
341
353
  export { ScreebProvider, useScreeb };
354
+ CONSTANTS.version = '0.1.9'
@@ -1,4 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { ScreebContextValues, ScreebProviderProps } from "./types";
3
+ export declare const CONSTANTS: {
4
+ version: string;
5
+ };
3
6
  export declare const ScreebProvider: React.FC<React.PropsWithChildren<ScreebProviderProps>>;
4
7
  export declare const useScreebContext: () => ScreebContextValues;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@screeb/sdk-react",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Screeb's browser sdk, optimized for React.",
5
5
  "keywords": [
6
6
  "product discovery",
@@ -41,12 +41,12 @@
41
41
  "test": "echo '@TODO'"
42
42
  },
43
43
  "dependencies": {
44
- "@screeb/sdk-browser": "^0.1.14"
44
+ "@screeb/sdk-browser": "^0.1.15"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@screeb/eslint-config": "^0.1.6",
48
48
  "@screeb/sdk-browser": "^0.1.6",
49
- "@screeb/typescript-config": "^0.1.9",
49
+ "@screeb/typescript-config": "^0.1.10",
50
50
  "@types/jest": "^29.5.5",
51
51
  "@types/node": "^20.8.4",
52
52
  "@types/react": "^18.2.28",