@streamlayer/react 0.2.10 → 0.2.11

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.
Files changed (3) hide show
  1. package/main.cjs +224 -21
  2. package/main.js +224 -21
  3. package/package.json +14 -11
package/main.cjs CHANGED
@@ -37,6 +37,209 @@ __export(main_exports, {
37
37
  });
38
38
  module.exports = __toCommonJS(main_exports);
39
39
 
40
+ // node_modules/.pnpm/@esbuild-plugins+node-globals-polyfill@0.2.3_esbuild@0.19.5/node_modules/@esbuild-plugins/node-globals-polyfill/process.js
41
+ function defaultSetTimout() {
42
+ throw new Error("setTimeout has not been defined");
43
+ }
44
+ function defaultClearTimeout() {
45
+ throw new Error("clearTimeout has not been defined");
46
+ }
47
+ var cachedSetTimeout = defaultSetTimout;
48
+ var cachedClearTimeout = defaultClearTimeout;
49
+ if (typeof globalThis.setTimeout === "function") {
50
+ cachedSetTimeout = setTimeout;
51
+ }
52
+ if (typeof globalThis.clearTimeout === "function") {
53
+ cachedClearTimeout = clearTimeout;
54
+ }
55
+ function runTimeout(fun) {
56
+ if (cachedSetTimeout === setTimeout) {
57
+ return setTimeout(fun, 0);
58
+ }
59
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
60
+ cachedSetTimeout = setTimeout;
61
+ return setTimeout(fun, 0);
62
+ }
63
+ try {
64
+ return cachedSetTimeout(fun, 0);
65
+ } catch (e) {
66
+ try {
67
+ return cachedSetTimeout.call(null, fun, 0);
68
+ } catch (e2) {
69
+ return cachedSetTimeout.call(this, fun, 0);
70
+ }
71
+ }
72
+ }
73
+ function runClearTimeout(marker) {
74
+ if (cachedClearTimeout === clearTimeout) {
75
+ return clearTimeout(marker);
76
+ }
77
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
78
+ cachedClearTimeout = clearTimeout;
79
+ return clearTimeout(marker);
80
+ }
81
+ try {
82
+ return cachedClearTimeout(marker);
83
+ } catch (e) {
84
+ try {
85
+ return cachedClearTimeout.call(null, marker);
86
+ } catch (e2) {
87
+ return cachedClearTimeout.call(this, marker);
88
+ }
89
+ }
90
+ }
91
+ var queue = [];
92
+ var draining = false;
93
+ var currentQueue;
94
+ var queueIndex = -1;
95
+ function cleanUpNextTick() {
96
+ if (!draining || !currentQueue) {
97
+ return;
98
+ }
99
+ draining = false;
100
+ if (currentQueue.length) {
101
+ queue = currentQueue.concat(queue);
102
+ } else {
103
+ queueIndex = -1;
104
+ }
105
+ if (queue.length) {
106
+ drainQueue();
107
+ }
108
+ }
109
+ function drainQueue() {
110
+ if (draining) {
111
+ return;
112
+ }
113
+ var timeout = runTimeout(cleanUpNextTick);
114
+ draining = true;
115
+ var len = queue.length;
116
+ while (len) {
117
+ currentQueue = queue;
118
+ queue = [];
119
+ while (++queueIndex < len) {
120
+ if (currentQueue) {
121
+ currentQueue[queueIndex].run();
122
+ }
123
+ }
124
+ queueIndex = -1;
125
+ len = queue.length;
126
+ }
127
+ currentQueue = null;
128
+ draining = false;
129
+ runClearTimeout(timeout);
130
+ }
131
+ function nextTick(fun) {
132
+ var args = new Array(arguments.length - 1);
133
+ if (arguments.length > 1) {
134
+ for (var i = 1; i < arguments.length; i++) {
135
+ args[i - 1] = arguments[i];
136
+ }
137
+ }
138
+ queue.push(new Item(fun, args));
139
+ if (queue.length === 1 && !draining) {
140
+ runTimeout(drainQueue);
141
+ }
142
+ }
143
+ function Item(fun, array) {
144
+ this.fun = fun;
145
+ this.array = array;
146
+ }
147
+ Item.prototype.run = function() {
148
+ this.fun.apply(null, this.array);
149
+ };
150
+ var title = "browser";
151
+ var platform = "browser";
152
+ var browser = true;
153
+ var env = {};
154
+ var argv = [];
155
+ var version = "";
156
+ var versions = {};
157
+ var release = {};
158
+ var config = {};
159
+ function noop() {
160
+ }
161
+ var on = noop;
162
+ var addListener = noop;
163
+ var once = noop;
164
+ var off = noop;
165
+ var removeListener = noop;
166
+ var removeAllListeners = noop;
167
+ var emit = noop;
168
+ function binding(name) {
169
+ throw new Error("process.binding is not supported");
170
+ }
171
+ function cwd() {
172
+ return "/";
173
+ }
174
+ function chdir(dir) {
175
+ throw new Error("process.chdir is not supported");
176
+ }
177
+ function umask() {
178
+ return 0;
179
+ }
180
+ var performance = globalThis.performance || {};
181
+ var performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function() {
182
+ return (/* @__PURE__ */ new Date()).getTime();
183
+ };
184
+ function hrtime(previousTimestamp) {
185
+ var clocktime = performanceNow.call(performance) * 1e-3;
186
+ var seconds = Math.floor(clocktime);
187
+ var nanoseconds = Math.floor(clocktime % 1 * 1e9);
188
+ if (previousTimestamp) {
189
+ seconds = seconds - previousTimestamp[0];
190
+ nanoseconds = nanoseconds - previousTimestamp[1];
191
+ if (nanoseconds < 0) {
192
+ seconds--;
193
+ nanoseconds += 1e9;
194
+ }
195
+ }
196
+ return [seconds, nanoseconds];
197
+ }
198
+ var startTime = /* @__PURE__ */ new Date();
199
+ function uptime() {
200
+ var currentTime = /* @__PURE__ */ new Date();
201
+ var dif = currentTime - startTime;
202
+ return dif / 1e3;
203
+ }
204
+ var process = {
205
+ nextTick,
206
+ title,
207
+ browser,
208
+ env,
209
+ argv,
210
+ version,
211
+ versions,
212
+ on,
213
+ addListener,
214
+ once,
215
+ off,
216
+ removeListener,
217
+ removeAllListeners,
218
+ emit,
219
+ binding,
220
+ cwd,
221
+ chdir,
222
+ umask,
223
+ hrtime,
224
+ platform,
225
+ release,
226
+ config,
227
+ uptime
228
+ };
229
+ var defines = {};
230
+ Object.keys(defines).forEach((key) => {
231
+ const segs = key.split(".");
232
+ let target = process;
233
+ for (let i = 0; i < segs.length; i++) {
234
+ const seg = segs[i];
235
+ if (i === segs.length - 1) {
236
+ target[seg] = defines[key];
237
+ } else {
238
+ target = target[seg] || (target[seg] = {});
239
+ }
240
+ }
241
+ });
242
+
40
243
  // packages/react-ui/src/lib/gamification/inapp/index.tsx
41
244
  var import_react = require("react");
42
245
 
@@ -120,7 +323,7 @@ var CloseIcon = import_styled.default.img`
120
323
 
121
324
  // packages/react-ui/src/lib/gamification/inapp/index.tsx
122
325
  var import_jsx_runtime = require("@emotion/react/jsx-runtime");
123
- var InApp = ({ title = "", icon, color, openVoiting, closeInApp }) => {
326
+ var InApp = ({ title: title2 = "", icon, color, openVoiting, closeInApp }) => {
124
327
  const _closeInApp = (0, import_react.useCallback)(
125
328
  (e) => {
126
329
  e.stopPropagation();
@@ -131,7 +334,7 @@ var InApp = ({ title = "", icon, color, openVoiting, closeInApp }) => {
131
334
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Container, { onClick: openVoiting, children: [
132
335
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconWrap, { style: color ? { backgroundColor: color } : {}, children: !!icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { alt: "in-app-icon", src: icon }) }),
133
336
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Content, { children: [
134
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleWrap, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Title, { id: "in-app-title", children: title }) }),
337
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleWrap, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Title, { id: "in-app-title", children: title2 }) }),
135
338
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CloseBtnWrap, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CloseBtn, { onClick: _closeInApp, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CloseIcon, { alt: "close-in-app-icon", src: icon_exit_default }) }) })
136
339
  ] })
137
340
  ] });
@@ -643,9 +846,9 @@ var Indicator = import_styled7.default.div`
643
846
 
644
847
  // packages/react-ui/src/lib/gamification/user-statistics/components/statistics/index.tsx
645
848
  var import_jsx_runtime7 = require("@emotion/react/jsx-runtime");
646
- var Statistics = ({ indicator, title }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Container4, { children: [
849
+ var Statistics = ({ indicator, title: title2 }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Container4, { children: [
647
850
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Indicator, { children: indicator }),
648
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: title })
851
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: title2 })
649
852
  ] });
650
853
 
651
854
  // packages/react-ui/src/lib/gamification/user-statistics/components/rank/styles.tsx
@@ -671,8 +874,8 @@ var Indicator2 = import_styled8.default.div`
671
874
 
672
875
  // packages/react-ui/src/lib/gamification/user-statistics/components/rank/index.tsx
673
876
  var import_jsx_runtime8 = require("@emotion/react/jsx-runtime");
674
- var Rank = ({ indicator, title }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Container5, { children: [
675
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Title4, { children: title }),
877
+ var Rank = ({ indicator, title: title2 }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Container5, { children: [
878
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Title4, { children: title2 }),
676
879
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Indicator2, { children: indicator })
677
880
  ] });
678
881
 
@@ -927,7 +1130,7 @@ var import_jsx_runtime10 = require("@emotion/react/jsx-runtime");
927
1130
  var VotingOption = ({
928
1131
  icon,
929
1132
  id,
930
- title,
1133
+ title: title2,
931
1134
  questionId,
932
1135
  disabled,
933
1136
  percentage,
@@ -943,7 +1146,7 @@ var VotingOption = ({
943
1146
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ButtonPct, { style: { width: `${percentage}%` } }),
944
1147
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Button, { disabled, onClick: () => onVote(questionId, id), children: [
945
1148
  icon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon2, { alt: "option-icon", src: icon }),
946
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Title5, { children: title }),
1149
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Title5, { children: title2 }),
947
1150
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Indicators, { children: [
948
1151
  hasCorrectAnswer && correct && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CheckIconWrap, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CheckIcon, { alt: "icon-correct", src: answered ? icon_check_white_default : icon_check_default }) }),
949
1152
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Percentage, { children: [
@@ -966,7 +1169,7 @@ var VotingOption = ({
966
1169
  },
967
1170
  children: [
968
1171
  icon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon2, { alt: "option-icon", src: icon }),
969
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Title5, { children: title }),
1172
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Title5, { children: title2 }),
970
1173
  questionAnswered && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Indicators, { children: [
971
1174
  hasCorrectAnswer && correct && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CheckIconWrap, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CheckIcon, { alt: "icon-correct", src: answered ? icon_check_white_default : icon_check_default }) }),
972
1175
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Percentage, { children: [
@@ -1046,7 +1249,7 @@ var FeedbackDescription = import_styled11.default.div`
1046
1249
  // packages/react-ui/src/lib/gamification/vote/index.tsx
1047
1250
  var import_jsx_runtime11 = require("@emotion/react/jsx-runtime");
1048
1251
  var Vote = ({
1049
- title,
1252
+ title: title2,
1050
1253
  questionId,
1051
1254
  options,
1052
1255
  questionAnswered,
@@ -1065,7 +1268,7 @@ var Vote = ({
1065
1268
  toggleIsLoadingSubmitAnswer(false);
1066
1269
  }, [options, toggleIsLoadingSubmitAnswer]);
1067
1270
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Container8, { children: [
1068
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Title6, { children: title }),
1271
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Title6, { children: title2 }),
1069
1272
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Options, { children: [
1070
1273
  isLoadingSubmitAnswer && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Loader, { children: "Loading..." }),
1071
1274
  options.map((props) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
@@ -1637,10 +1840,10 @@ var AbstractFeature = class {
1637
1840
  settings;
1638
1841
  listeners = /* @__PURE__ */ new Set();
1639
1842
  settingsKey;
1640
- constructor({ settings, ...config }, source) {
1641
- this.settingsKey = FeatureTypes[config.type];
1843
+ constructor({ settings, ...config2 }, source) {
1844
+ this.settingsKey = FeatureTypes[config2.type];
1642
1845
  this.status = (0, import_nanostores3.atom)("suspended" /* Suspended */);
1643
- this.config = new MapStore(createMapStore(config), `feature:config:${this.settingsKey}`);
1846
+ this.config = new MapStore(createMapStore(config2), `feature:config:${this.settingsKey}`);
1644
1847
  if (this.settingsKey !== void 0 && settings?.overlaySettings.case === this.settingsKey) {
1645
1848
  this.settings = new MapStore(
1646
1849
  createMapStore(settings.overlaySettings.value),
@@ -1666,10 +1869,10 @@ var AbstractFeature = class {
1666
1869
  disabled = () => {
1667
1870
  this.status.set("suspended" /* Suspended */);
1668
1871
  };
1669
- setFeatureConfig = ({ settings, ...config }) => {
1872
+ setFeatureConfig = ({ settings, ...config2 }) => {
1670
1873
  let configKey;
1671
- for (configKey in config) {
1672
- this.config.setValue(configKey, config[configKey]);
1874
+ for (configKey in config2) {
1875
+ this.config.setValue(configKey, config2[configKey]);
1673
1876
  }
1674
1877
  if (settings?.overlaySettings.case === this.settingsKey) {
1675
1878
  const newSettings = settings.overlaySettings.value;
@@ -1684,11 +1887,11 @@ var AbstractFeature = class {
1684
1887
  }
1685
1888
  }
1686
1889
  };
1687
- update = (config, source) => {
1890
+ update = (config2, source) => {
1688
1891
  if (this.source === "STREAM" /* STREAM */ && source === "ORGANIZATION" /* ORGANIZATION */) {
1689
1892
  return;
1690
1893
  }
1691
- this.setFeatureConfig(config);
1894
+ this.setFeatureConfig(config2);
1692
1895
  this.source = source;
1693
1896
  };
1694
1897
  fireEvent(event) {
@@ -2470,8 +2673,8 @@ var Gamification = class extends AbstractFeature {
2470
2673
  onbordingComplete;
2471
2674
  notifications;
2472
2675
  transport;
2473
- constructor(config, source, instance) {
2474
- super(config, source);
2676
+ constructor(config2, source, instance) {
2677
+ super(config2, source);
2475
2678
  this.leaderboardId = new SingleStore(
2476
2679
  createSingleStore(this.settings.getValue("pinnedLeaderboardId")),
2477
2680
  "pinnedLeaderboardId"
package/main.js CHANGED
@@ -4,6 +4,209 @@ var __export = (target, all) => {
4
4
  __defProp(target, name, { get: all[name], enumerable: true });
5
5
  };
6
6
 
7
+ // node_modules/.pnpm/@esbuild-plugins+node-globals-polyfill@0.2.3_esbuild@0.19.5/node_modules/@esbuild-plugins/node-globals-polyfill/process.js
8
+ function defaultSetTimout() {
9
+ throw new Error("setTimeout has not been defined");
10
+ }
11
+ function defaultClearTimeout() {
12
+ throw new Error("clearTimeout has not been defined");
13
+ }
14
+ var cachedSetTimeout = defaultSetTimout;
15
+ var cachedClearTimeout = defaultClearTimeout;
16
+ if (typeof globalThis.setTimeout === "function") {
17
+ cachedSetTimeout = setTimeout;
18
+ }
19
+ if (typeof globalThis.clearTimeout === "function") {
20
+ cachedClearTimeout = clearTimeout;
21
+ }
22
+ function runTimeout(fun) {
23
+ if (cachedSetTimeout === setTimeout) {
24
+ return setTimeout(fun, 0);
25
+ }
26
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
27
+ cachedSetTimeout = setTimeout;
28
+ return setTimeout(fun, 0);
29
+ }
30
+ try {
31
+ return cachedSetTimeout(fun, 0);
32
+ } catch (e) {
33
+ try {
34
+ return cachedSetTimeout.call(null, fun, 0);
35
+ } catch (e2) {
36
+ return cachedSetTimeout.call(this, fun, 0);
37
+ }
38
+ }
39
+ }
40
+ function runClearTimeout(marker) {
41
+ if (cachedClearTimeout === clearTimeout) {
42
+ return clearTimeout(marker);
43
+ }
44
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
45
+ cachedClearTimeout = clearTimeout;
46
+ return clearTimeout(marker);
47
+ }
48
+ try {
49
+ return cachedClearTimeout(marker);
50
+ } catch (e) {
51
+ try {
52
+ return cachedClearTimeout.call(null, marker);
53
+ } catch (e2) {
54
+ return cachedClearTimeout.call(this, marker);
55
+ }
56
+ }
57
+ }
58
+ var queue = [];
59
+ var draining = false;
60
+ var currentQueue;
61
+ var queueIndex = -1;
62
+ function cleanUpNextTick() {
63
+ if (!draining || !currentQueue) {
64
+ return;
65
+ }
66
+ draining = false;
67
+ if (currentQueue.length) {
68
+ queue = currentQueue.concat(queue);
69
+ } else {
70
+ queueIndex = -1;
71
+ }
72
+ if (queue.length) {
73
+ drainQueue();
74
+ }
75
+ }
76
+ function drainQueue() {
77
+ if (draining) {
78
+ return;
79
+ }
80
+ var timeout = runTimeout(cleanUpNextTick);
81
+ draining = true;
82
+ var len = queue.length;
83
+ while (len) {
84
+ currentQueue = queue;
85
+ queue = [];
86
+ while (++queueIndex < len) {
87
+ if (currentQueue) {
88
+ currentQueue[queueIndex].run();
89
+ }
90
+ }
91
+ queueIndex = -1;
92
+ len = queue.length;
93
+ }
94
+ currentQueue = null;
95
+ draining = false;
96
+ runClearTimeout(timeout);
97
+ }
98
+ function nextTick(fun) {
99
+ var args = new Array(arguments.length - 1);
100
+ if (arguments.length > 1) {
101
+ for (var i = 1; i < arguments.length; i++) {
102
+ args[i - 1] = arguments[i];
103
+ }
104
+ }
105
+ queue.push(new Item(fun, args));
106
+ if (queue.length === 1 && !draining) {
107
+ runTimeout(drainQueue);
108
+ }
109
+ }
110
+ function Item(fun, array) {
111
+ this.fun = fun;
112
+ this.array = array;
113
+ }
114
+ Item.prototype.run = function() {
115
+ this.fun.apply(null, this.array);
116
+ };
117
+ var title = "browser";
118
+ var platform = "browser";
119
+ var browser = true;
120
+ var env = {};
121
+ var argv = [];
122
+ var version = "";
123
+ var versions = {};
124
+ var release = {};
125
+ var config = {};
126
+ function noop() {
127
+ }
128
+ var on = noop;
129
+ var addListener = noop;
130
+ var once = noop;
131
+ var off = noop;
132
+ var removeListener = noop;
133
+ var removeAllListeners = noop;
134
+ var emit = noop;
135
+ function binding(name) {
136
+ throw new Error("process.binding is not supported");
137
+ }
138
+ function cwd() {
139
+ return "/";
140
+ }
141
+ function chdir(dir) {
142
+ throw new Error("process.chdir is not supported");
143
+ }
144
+ function umask() {
145
+ return 0;
146
+ }
147
+ var performance = globalThis.performance || {};
148
+ var performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function() {
149
+ return (/* @__PURE__ */ new Date()).getTime();
150
+ };
151
+ function hrtime(previousTimestamp) {
152
+ var clocktime = performanceNow.call(performance) * 1e-3;
153
+ var seconds = Math.floor(clocktime);
154
+ var nanoseconds = Math.floor(clocktime % 1 * 1e9);
155
+ if (previousTimestamp) {
156
+ seconds = seconds - previousTimestamp[0];
157
+ nanoseconds = nanoseconds - previousTimestamp[1];
158
+ if (nanoseconds < 0) {
159
+ seconds--;
160
+ nanoseconds += 1e9;
161
+ }
162
+ }
163
+ return [seconds, nanoseconds];
164
+ }
165
+ var startTime = /* @__PURE__ */ new Date();
166
+ function uptime() {
167
+ var currentTime = /* @__PURE__ */ new Date();
168
+ var dif = currentTime - startTime;
169
+ return dif / 1e3;
170
+ }
171
+ var process = {
172
+ nextTick,
173
+ title,
174
+ browser,
175
+ env,
176
+ argv,
177
+ version,
178
+ versions,
179
+ on,
180
+ addListener,
181
+ once,
182
+ off,
183
+ removeListener,
184
+ removeAllListeners,
185
+ emit,
186
+ binding,
187
+ cwd,
188
+ chdir,
189
+ umask,
190
+ hrtime,
191
+ platform,
192
+ release,
193
+ config,
194
+ uptime
195
+ };
196
+ var defines = {};
197
+ Object.keys(defines).forEach((key) => {
198
+ const segs = key.split(".");
199
+ let target = process;
200
+ for (let i = 0; i < segs.length; i++) {
201
+ const seg = segs[i];
202
+ if (i === segs.length - 1) {
203
+ target[seg] = defines[key];
204
+ } else {
205
+ target = target[seg] || (target[seg] = {});
206
+ }
207
+ }
208
+ });
209
+
7
210
  // packages/react-ui/src/lib/gamification/inapp/index.tsx
8
211
  import { useCallback } from "react";
9
212
 
@@ -87,7 +290,7 @@ var CloseIcon = styled.img`
87
290
 
88
291
  // packages/react-ui/src/lib/gamification/inapp/index.tsx
89
292
  import { jsx, jsxs } from "@emotion/react/jsx-runtime";
90
- var InApp = ({ title = "", icon, color, openVoiting, closeInApp }) => {
293
+ var InApp = ({ title: title2 = "", icon, color, openVoiting, closeInApp }) => {
91
294
  const _closeInApp = useCallback(
92
295
  (e) => {
93
296
  e.stopPropagation();
@@ -98,7 +301,7 @@ var InApp = ({ title = "", icon, color, openVoiting, closeInApp }) => {
98
301
  return /* @__PURE__ */ jsxs(Container, { onClick: openVoiting, children: [
99
302
  /* @__PURE__ */ jsx(IconWrap, { style: color ? { backgroundColor: color } : {}, children: !!icon && /* @__PURE__ */ jsx(Icon, { alt: "in-app-icon", src: icon }) }),
100
303
  /* @__PURE__ */ jsxs(Content, { children: [
101
- /* @__PURE__ */ jsx(TitleWrap, { children: /* @__PURE__ */ jsx(Title, { id: "in-app-title", children: title }) }),
304
+ /* @__PURE__ */ jsx(TitleWrap, { children: /* @__PURE__ */ jsx(Title, { id: "in-app-title", children: title2 }) }),
102
305
  /* @__PURE__ */ jsx(CloseBtnWrap, { children: /* @__PURE__ */ jsx(CloseBtn, { onClick: _closeInApp, children: /* @__PURE__ */ jsx(CloseIcon, { alt: "close-in-app-icon", src: icon_exit_default }) }) })
103
306
  ] })
104
307
  ] });
@@ -610,9 +813,9 @@ var Indicator = styled7.div`
610
813
 
611
814
  // packages/react-ui/src/lib/gamification/user-statistics/components/statistics/index.tsx
612
815
  import { jsx as jsx7, jsxs as jsxs6 } from "@emotion/react/jsx-runtime";
613
- var Statistics = ({ indicator, title }) => /* @__PURE__ */ jsxs6(Container4, { children: [
816
+ var Statistics = ({ indicator, title: title2 }) => /* @__PURE__ */ jsxs6(Container4, { children: [
614
817
  /* @__PURE__ */ jsx7(Indicator, { children: indicator }),
615
- /* @__PURE__ */ jsx7("p", { children: title })
818
+ /* @__PURE__ */ jsx7("p", { children: title2 })
616
819
  ] });
617
820
 
618
821
  // packages/react-ui/src/lib/gamification/user-statistics/components/rank/styles.tsx
@@ -638,8 +841,8 @@ var Indicator2 = styled8.div`
638
841
 
639
842
  // packages/react-ui/src/lib/gamification/user-statistics/components/rank/index.tsx
640
843
  import { jsx as jsx8, jsxs as jsxs7 } from "@emotion/react/jsx-runtime";
641
- var Rank = ({ indicator, title }) => /* @__PURE__ */ jsxs7(Container5, { children: [
642
- /* @__PURE__ */ jsx8(Title4, { children: title }),
844
+ var Rank = ({ indicator, title: title2 }) => /* @__PURE__ */ jsxs7(Container5, { children: [
845
+ /* @__PURE__ */ jsx8(Title4, { children: title2 }),
643
846
  /* @__PURE__ */ jsx8(Indicator2, { children: indicator })
644
847
  ] });
645
848
 
@@ -894,7 +1097,7 @@ import { jsx as jsx10, jsxs as jsxs9 } from "@emotion/react/jsx-runtime";
894
1097
  var VotingOption = ({
895
1098
  icon,
896
1099
  id,
897
- title,
1100
+ title: title2,
898
1101
  questionId,
899
1102
  disabled,
900
1103
  percentage,
@@ -910,7 +1113,7 @@ var VotingOption = ({
910
1113
  /* @__PURE__ */ jsx10(ButtonPct, { style: { width: `${percentage}%` } }),
911
1114
  /* @__PURE__ */ jsxs9(Button, { disabled, onClick: () => onVote(questionId, id), children: [
912
1115
  icon && /* @__PURE__ */ jsx10(Icon2, { alt: "option-icon", src: icon }),
913
- /* @__PURE__ */ jsx10(Title5, { children: title }),
1116
+ /* @__PURE__ */ jsx10(Title5, { children: title2 }),
914
1117
  /* @__PURE__ */ jsxs9(Indicators, { children: [
915
1118
  hasCorrectAnswer && correct && /* @__PURE__ */ jsx10(CheckIconWrap, { children: /* @__PURE__ */ jsx10(CheckIcon, { alt: "icon-correct", src: answered ? icon_check_white_default : icon_check_default }) }),
916
1119
  /* @__PURE__ */ jsxs9(Percentage, { children: [
@@ -933,7 +1136,7 @@ var VotingOption = ({
933
1136
  },
934
1137
  children: [
935
1138
  icon && /* @__PURE__ */ jsx10(Icon2, { alt: "option-icon", src: icon }),
936
- /* @__PURE__ */ jsx10(Title5, { children: title }),
1139
+ /* @__PURE__ */ jsx10(Title5, { children: title2 }),
937
1140
  questionAnswered && /* @__PURE__ */ jsxs9(Indicators, { children: [
938
1141
  hasCorrectAnswer && correct && /* @__PURE__ */ jsx10(CheckIconWrap, { children: /* @__PURE__ */ jsx10(CheckIcon, { alt: "icon-correct", src: answered ? icon_check_white_default : icon_check_default }) }),
939
1142
  /* @__PURE__ */ jsxs9(Percentage, { children: [
@@ -1013,7 +1216,7 @@ var FeedbackDescription = styled11.div`
1013
1216
  // packages/react-ui/src/lib/gamification/vote/index.tsx
1014
1217
  import { jsx as jsx11, jsxs as jsxs10 } from "@emotion/react/jsx-runtime";
1015
1218
  var Vote = ({
1016
- title,
1219
+ title: title2,
1017
1220
  questionId,
1018
1221
  options,
1019
1222
  questionAnswered,
@@ -1032,7 +1235,7 @@ var Vote = ({
1032
1235
  toggleIsLoadingSubmitAnswer(false);
1033
1236
  }, [options, toggleIsLoadingSubmitAnswer]);
1034
1237
  return /* @__PURE__ */ jsxs10(Container8, { children: [
1035
- /* @__PURE__ */ jsx11(Title6, { children: title }),
1238
+ /* @__PURE__ */ jsx11(Title6, { children: title2 }),
1036
1239
  /* @__PURE__ */ jsxs10(Options, { children: [
1037
1240
  isLoadingSubmitAnswer && /* @__PURE__ */ jsx11(Loader, { children: "Loading..." }),
1038
1241
  options.map((props) => /* @__PURE__ */ jsx11(
@@ -1604,10 +1807,10 @@ var AbstractFeature = class {
1604
1807
  settings;
1605
1808
  listeners = /* @__PURE__ */ new Set();
1606
1809
  settingsKey;
1607
- constructor({ settings, ...config }, source) {
1608
- this.settingsKey = FeatureTypes[config.type];
1810
+ constructor({ settings, ...config2 }, source) {
1811
+ this.settingsKey = FeatureTypes[config2.type];
1609
1812
  this.status = atom("suspended" /* Suspended */);
1610
- this.config = new MapStore(createMapStore(config), `feature:config:${this.settingsKey}`);
1813
+ this.config = new MapStore(createMapStore(config2), `feature:config:${this.settingsKey}`);
1611
1814
  if (this.settingsKey !== void 0 && settings?.overlaySettings.case === this.settingsKey) {
1612
1815
  this.settings = new MapStore(
1613
1816
  createMapStore(settings.overlaySettings.value),
@@ -1633,10 +1836,10 @@ var AbstractFeature = class {
1633
1836
  disabled = () => {
1634
1837
  this.status.set("suspended" /* Suspended */);
1635
1838
  };
1636
- setFeatureConfig = ({ settings, ...config }) => {
1839
+ setFeatureConfig = ({ settings, ...config2 }) => {
1637
1840
  let configKey;
1638
- for (configKey in config) {
1639
- this.config.setValue(configKey, config[configKey]);
1841
+ for (configKey in config2) {
1842
+ this.config.setValue(configKey, config2[configKey]);
1640
1843
  }
1641
1844
  if (settings?.overlaySettings.case === this.settingsKey) {
1642
1845
  const newSettings = settings.overlaySettings.value;
@@ -1651,11 +1854,11 @@ var AbstractFeature = class {
1651
1854
  }
1652
1855
  }
1653
1856
  };
1654
- update = (config, source) => {
1857
+ update = (config2, source) => {
1655
1858
  if (this.source === "STREAM" /* STREAM */ && source === "ORGANIZATION" /* ORGANIZATION */) {
1656
1859
  return;
1657
1860
  }
1658
- this.setFeatureConfig(config);
1861
+ this.setFeatureConfig(config2);
1659
1862
  this.source = source;
1660
1863
  };
1661
1864
  fireEvent(event) {
@@ -2441,8 +2644,8 @@ var Gamification = class extends AbstractFeature {
2441
2644
  onbordingComplete;
2442
2645
  notifications;
2443
2646
  transport;
2444
- constructor(config, source, instance) {
2445
- super(config, source);
2647
+ constructor(config2, source, instance) {
2648
+ super(config2, source);
2446
2649
  this.leaderboardId = new SingleStore(
2447
2650
  createSingleStore(this.settings.getValue("pinnedLeaderboardId")),
2448
2651
  "pinnedLeaderboardId"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "type": "module",
5
5
  "author": "Renat Berezovsky (gh:BrRenat)",
6
6
  "main": "./main.cjs",
@@ -21,34 +21,37 @@
21
21
  "peerDependencies": {
22
22
  "@emotion/react": "11.11.1",
23
23
  "@emotion/styled": "11.11.0",
24
+ "@nanostores/react": "^0.7.1",
25
+ "@streamlayer/react-ui": "*",
26
+ "@streamlayer/sdk-web": "*",
24
27
  "react": "18.2.0",
25
- "react-dom": "18.2.0",
26
28
  "react-digit-input": "^2.1.0",
27
- "@streamlayer/react-ui": "*",
28
- "@nanostores/react": "^0.7.1",
29
- "@streamlayer/sdk-web": "*"
29
+ "react-dom": "18.2.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@emotion/react": "11.11.1",
33
- "@emotion/styled": "11.11.0",
34
- "@nanostores/react": "^0.7.1",
35
- "react": "18.2.0",
36
- "react-dom": "18.2.0",
37
- "react-router-dom": "6.16.0",
38
32
  "@babel/preset-react": "^7.14.5",
39
33
  "@babel/preset-typescript": "^7.23.0",
40
34
  "@emotion/babel-plugin": "11.11.0",
35
+ "@emotion/react": "11.11.1",
36
+ "@emotion/styled": "11.11.0",
37
+ "@esbuild-plugins/node-globals-polyfill": "^0.2.3",
38
+ "@esbuild-plugins/node-modules-polyfill": "^0.2.2",
39
+ "@nanostores/react": "^0.7.1",
41
40
  "@nrwl/esbuild": "^16.10.0",
42
41
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
43
42
  "@svgr/webpack": "^8.0.1",
44
43
  "@testing-library/react": "14.0.0",
45
44
  "@types/react": "18.2.28",
46
45
  "@types/react-dom": "18.2.13",
46
+ "esbuild-plugin-polyfill-node": "^0.3.0",
47
47
  "esbuild-plugin-svgr": "^2.1.0",
48
48
  "eslint-plugin-jsx-a11y": "6.7.1",
49
49
  "eslint-plugin-react": "7.33.2",
50
50
  "eslint-plugin-react-hooks": "4.6.0",
51
+ "react": "18.2.0",
52
+ "react-dom": "18.2.0",
51
53
  "react-refresh": "^0.14.0",
54
+ "react-router-dom": "6.16.0",
52
55
  "url-loader": "^4.1.1"
53
56
  }
54
57
  }