@seamly/web-ui 20.8.0-beta.1 → 20.8.0-beta.4

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.
@@ -6643,7 +6643,9 @@ const seamly_unavailable_error_1 = __importDefault(__webpack_require__(9060));
6643
6643
 
6644
6644
  const actions_1 = __webpack_require__(915);
6645
6645
 
6646
- const actions_2 = __webpack_require__(5234);
6646
+ const actions_2 = __webpack_require__(59);
6647
+
6648
+ const actions_3 = __webpack_require__(5234);
6647
6649
 
6648
6650
  const seamly_utils_1 = __webpack_require__(5740);
6649
6651
 
@@ -6652,7 +6654,8 @@ exports.initializeApp = (0, toolkit_1.createAsyncThunk)('initializeApp', (_, {
6652
6654
  api,
6653
6655
  config
6654
6656
  },
6655
- rejectWithValue
6657
+ rejectWithValue,
6658
+ dispatch
6656
6659
  }) => __awaiter(void 0, void 0, void 0, function* () {
6657
6660
  var _a, _b, _c, _d;
6658
6661
 
@@ -6691,6 +6694,7 @@ exports.initializeApp = (0, toolkit_1.createAsyncThunk)('initializeApp', (_, {
6691
6694
  });
6692
6695
  }
6693
6696
 
6697
+ dispatch((0, actions_2.setLocale)(locale));
6694
6698
  return {
6695
6699
  initialState: undefined,
6696
6700
  locale,
@@ -6728,7 +6732,7 @@ exports.resetApp = (0, toolkit_1.createAsyncThunk)('resetApp', (_, {
6728
6732
  dispatch((0, actions_1.resetConfig)());
6729
6733
  yield dispatch((0, actions_1.initializeConfig)());
6730
6734
  yield dispatch((0, exports.initializeApp)());
6731
- dispatch((0, actions_2.initializeVisibility)());
6735
+ dispatch((0, actions_3.initializeVisibility)());
6732
6736
  }));
6733
6737
 
6734
6738
  /***/ }),
@@ -8350,7 +8354,7 @@ exports.storeSlice = (0, toolkit_1.createSlice)({
8350
8354
  let newFeatures = Object.assign({}, state.options.features);
8351
8355
  const newFeaturesHasUpload = newFeatures.hasOwnProperty(seamly_utils_1.featureKeys.uploads); // Only set uploads if it was initialised by the account config.
8352
8356
 
8353
- if (newFeaturesHasUpload && lastParticipantEvent.type === 'message') {
8357
+ if (newFeaturesHasUpload && (lastParticipantEvent === null || lastParticipantEvent === void 0 ? void 0 : lastParticipantEvent.type) === 'message') {
8354
8358
  const {
8355
8359
  payload: lastParticipantEventPayload
8356
8360
  } = lastParticipantEvent;
@@ -8374,7 +8378,7 @@ exports.storeSlice = (0, toolkit_1.createSlice)({
8374
8378
  state.serviceInfo = Object.assign(Object.assign({}, state.serviceInfo), {
8375
8379
  activeServiceSessionId
8376
8380
  });
8377
- state.serviceData = serviceData || {};
8381
+ state.serviceData = Object.assign(Object.assign({}, state.serviceData), serviceData);
8378
8382
  state.options = Object.assign(Object.assign({}, state.options), {
8379
8383
  features: newFeatures || {}
8380
8384
  });
@@ -8798,9 +8802,7 @@ exports.disableEventsTranslation = exports.enableEventsTranslation = exports.dis
8798
8802
 
8799
8803
  const toolkit_1 = __webpack_require__(575);
8800
8804
 
8801
- const actions_1 = __webpack_require__(4134);
8802
-
8803
- const actions_2 = __webpack_require__(915);
8805
+ const actions_1 = __webpack_require__(915);
8804
8806
 
8805
8807
  const slice_1 = __webpack_require__(1153);
8806
8808
 
@@ -8890,15 +8892,7 @@ exports.translationSlice = (0, toolkit_1.createSlice)({
8890
8892
  }
8891
8893
  },
8892
8894
  extraReducers: builder => {
8893
- builder.addCase(actions_1.initializeApp.fulfilled, (state, {
8894
- payload
8895
- }) => {
8896
- var _a, _b;
8897
-
8898
- if (!((_b = (_a = payload.config) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.translationLocale)) return;
8899
- state.isActive = true;
8900
- state.currentLocale = payload.locale;
8901
- }).addCase(actions_2.initializeConfig.fulfilled, (state, {
8895
+ builder.addCase(actions_1.initializeConfig.fulfilled, (state, {
8902
8896
  payload
8903
8897
  }) => {
8904
8898
  var _a;
@@ -11866,7 +11860,7 @@ class API {
11866
11860
  return {
11867
11861
  clientName: "@seamly/web-ui",
11868
11862
  clientVariant: this.layoutMode,
11869
- clientVersion: "20.8.0-beta.1",
11863
+ clientVersion: "20.7.0",
11870
11864
  currentUrl: window.location.toString(),
11871
11865
  screenResolution: `${window.screen.width}x${window.screen.height}`,
11872
11866
  timezone: getTimeZone(),
@@ -22128,6 +22122,7 @@ const useSeamlyActivityEventHandler = () => (0,preact_hooks__WEBPACK_IMPORTED_MO
22128
22122
 
22129
22123
 
22130
22124
  const useSeamlyChat = () => {
22125
+ const events = (0,_seamly_state_hooks__WEBPACK_IMPORTED_MODULE_9__.useEvents)();
22131
22126
  const {
22132
22127
  t
22133
22128
  } = (0,domains_i18n_hooks__WEBPACK_IMPORTED_MODULE_0__.useI18n)();
@@ -22142,7 +22137,6 @@ const useSeamlyChat = () => {
22142
22137
  } = (0,domains_visibility_hooks__WEBPACK_IMPORTED_MODULE_3__.useVisibility)();
22143
22138
  const showInlineView = (0,react_redux__WEBPACK_IMPORTED_MODULE_5__.useSelector)(_domains_visibility_selectors__WEBPACK_IMPORTED_MODULE_6__.selectShowInlineView);
22144
22139
  const dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_5__.useDispatch)();
22145
- const events = (0,_seamly_state_hooks__WEBPACK_IMPORTED_MODULE_9__.useEvents)();
22146
22140
  const spinnerTimeout = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_4__.useRef)(null);
22147
22141
  const {
22148
22142
  start,
@@ -22157,7 +22151,6 @@ const useSeamlyChat = () => {
22157
22151
  const {
22158
22152
  sendAssertive
22159
22153
  } = (0,_live_region_hooks__WEBPACK_IMPORTED_MODULE_7__/* .useLiveRegion */ .t)();
22160
- const hasEvents = events.length > 0;
22161
22154
  (0,preact_hooks__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
22162
22155
  if (isVisible) {
22163
22156
  // Wait for the live containers to stabilise in the DOM before injecting
@@ -22191,13 +22184,21 @@ const useSeamlyChat = () => {
22191
22184
  spinnerTimeout.current = setTimeout(() => {
22192
22185
  dispatch((0,domains_store_slice__WEBPACK_IMPORTED_MODULE_1__.setIsLoading)(true));
22193
22186
  }, 500);
22187
+ return () => {
22188
+ clearTimeout(spinnerTimeout.current);
22189
+ };
22194
22190
  }, [dispatch]);
22195
22191
  (0,preact_hooks__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
22196
- if (hasEvents) {
22197
- clearTimeout(spinnerTimeout.current);
22198
- dispatch((0,domains_store_slice__WEBPACK_IMPORTED_MODULE_1__.setIsLoading)(false));
22192
+ if (events.length) {
22193
+ spinnerTimeout.current = setTimeout(() => {
22194
+ dispatch((0,domains_store_slice__WEBPACK_IMPORTED_MODULE_1__.setIsLoading)(false));
22195
+ }, 5000);
22199
22196
  }
22200
- }, [hasEvents, dispatch]);
22197
+
22198
+ return () => {
22199
+ clearTimeout(spinnerTimeout.current);
22200
+ };
22201
+ }, [events, dispatch]);
22201
22202
  (0,preact_hooks__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
22202
22203
  // This is needed to reset the ref to allow connect and start to happen again.
22203
22204
  // Mostly due to Interrupt situations and a reset being called.