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

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.
@@ -6830,7 +6830,9 @@ const seamly_unavailable_error_1 = __importDefault(__webpack_require__(9060));
6830
6830
 
6831
6831
  const actions_1 = __webpack_require__(60915);
6832
6832
 
6833
- const actions_2 = __webpack_require__(65234);
6833
+ const actions_2 = __webpack_require__(30059);
6834
+
6835
+ const actions_3 = __webpack_require__(65234);
6834
6836
 
6835
6837
  const seamly_utils_1 = __webpack_require__(45740);
6836
6838
 
@@ -6840,7 +6842,8 @@ exports.initializeApp = (0, toolkit_1.createAsyncThunk)('initializeApp', (_, _re
6840
6842
  api,
6841
6843
  config
6842
6844
  },
6843
- rejectWithValue
6845
+ rejectWithValue,
6846
+ dispatch
6844
6847
  } = _ref;
6845
6848
  return __awaiter(void 0, void 0, void 0, function* () {
6846
6849
  var _a, _b, _c, _d;
@@ -6880,6 +6883,7 @@ exports.initializeApp = (0, toolkit_1.createAsyncThunk)('initializeApp', (_, _re
6880
6883
  });
6881
6884
  }
6882
6885
 
6886
+ dispatch((0, actions_2.setLocale)(locale));
6883
6887
  return {
6884
6888
  initialState: undefined,
6885
6889
  locale,
@@ -6920,7 +6924,7 @@ exports.resetApp = (0, toolkit_1.createAsyncThunk)('resetApp', (_, _ref2) => {
6920
6924
  dispatch((0, actions_1.resetConfig)());
6921
6925
  yield dispatch((0, actions_1.initializeConfig)());
6922
6926
  yield dispatch((0, exports.initializeApp)());
6923
- dispatch((0, actions_2.initializeVisibility)());
6927
+ dispatch((0, actions_3.initializeVisibility)());
6924
6928
  });
6925
6929
  });
6926
6930
 
@@ -8817,7 +8821,7 @@ exports.storeSlice = (0, toolkit_1.createSlice)({
8817
8821
 
8818
8822
  const newFeaturesHasUpload = newFeatures.hasOwnProperty(seamly_utils_1.featureKeys.uploads); // Only set uploads if it was initialised by the account config.
8819
8823
 
8820
- if (newFeaturesHasUpload && lastParticipantEvent.type === 'message') {
8824
+ if (newFeaturesHasUpload && (lastParticipantEvent === null || lastParticipantEvent === void 0 ? void 0 : lastParticipantEvent.type) === 'message') {
8821
8825
  const {
8822
8826
  payload: lastParticipantEventPayload
8823
8827
  } = lastParticipantEvent;
@@ -8841,7 +8845,7 @@ exports.storeSlice = (0, toolkit_1.createSlice)({
8841
8845
  state.serviceInfo = _Object$assign(_Object$assign({}, state.serviceInfo), {
8842
8846
  activeServiceSessionId
8843
8847
  });
8844
- state.serviceData = serviceData || {};
8848
+ state.serviceData = _Object$assign(_Object$assign({}, state.serviceData), serviceData);
8845
8849
  state.options = _Object$assign(_Object$assign({}, state.options), {
8846
8850
  features: newFeatures || {}
8847
8851
  });
@@ -9336,9 +9340,7 @@ exports.disableEventsTranslation = exports.enableEventsTranslation = exports.dis
9336
9340
 
9337
9341
  const toolkit_1 = __webpack_require__(40575);
9338
9342
 
9339
- const actions_1 = __webpack_require__(64134);
9340
-
9341
- const actions_2 = __webpack_require__(60915);
9343
+ const actions_1 = __webpack_require__(60915);
9342
9344
 
9343
9345
  const slice_1 = __webpack_require__(11153);
9344
9346
 
@@ -9440,31 +9442,21 @@ exports.translationSlice = (0, toolkit_1.createSlice)({
9440
9442
  }
9441
9443
  },
9442
9444
  extraReducers: builder => {
9443
- builder.addCase(actions_1.initializeApp.fulfilled, (state, _ref5) => {
9445
+ builder.addCase(actions_1.initializeConfig.fulfilled, (state, _ref5) => {
9444
9446
  let {
9445
9447
  payload
9446
9448
  } = _ref5;
9447
9449
 
9448
- var _a, _b;
9449
-
9450
- if (!((_b = (_a = payload.config) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.translationLocale)) return;
9451
- state.isActive = true;
9452
- state.currentLocale = payload.locale;
9453
- }).addCase(actions_2.initializeConfig.fulfilled, (state, _ref6) => {
9454
- let {
9455
- payload
9456
- } = _ref6;
9457
-
9458
9450
  var _a;
9459
9451
 
9460
9452
  const feature = (_a = payload === null || payload === void 0 ? void 0 : payload.features) === null || _a === void 0 ? void 0 : _a.translation;
9461
9453
  if (!feature) return;
9462
9454
  state.isAvailable = feature.enabled === true;
9463
9455
  state.languages = feature.languages;
9464
- }).addCase(slice_1.addEvent, (state, _ref7) => {
9456
+ }).addCase(slice_1.addEvent, (state, _ref6) => {
9465
9457
  let {
9466
9458
  payload
9467
- } = _ref7;
9459
+ } = _ref6;
9468
9460
 
9469
9461
  if (state.translatedEventGroups[state.lastGroupId]) {
9470
9462
  state.translatedEventGroups[state.lastGroupId].push(payload.payload.id);
@@ -12656,7 +12648,7 @@ class API {
12656
12648
  return {
12657
12649
  clientName: "@seamly/web-ui",
12658
12650
  clientVariant: this.layoutMode,
12659
- clientVersion: "20.8.0-beta.1",
12651
+ clientVersion: "20.7.0",
12660
12652
  currentUrl: window.location.toString(),
12661
12653
  screenResolution: `${window.screen.width}x${window.screen.height}`,
12662
12654
  timezone: getTimeZone(),
@@ -23887,7 +23879,6 @@ const useSeamlyChat = () => {
23887
23879
  } = (0,domains_visibility_hooks__WEBPACK_IMPORTED_MODULE_4__.useVisibility)();
23888
23880
  const showInlineView = (0,react_redux__WEBPACK_IMPORTED_MODULE_6__.useSelector)(_domains_visibility_selectors__WEBPACK_IMPORTED_MODULE_7__.selectShowInlineView);
23889
23881
  const dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_6__.useDispatch)();
23890
- const events = (0,_seamly_state_hooks__WEBPACK_IMPORTED_MODULE_10__.useEvents)();
23891
23882
  const spinnerTimeout = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_5__.useRef)(null);
23892
23883
  const {
23893
23884
  start,
@@ -23902,7 +23893,6 @@ const useSeamlyChat = () => {
23902
23893
  const {
23903
23894
  sendAssertive
23904
23895
  } = (0,_live_region_hooks__WEBPACK_IMPORTED_MODULE_8__/* .useLiveRegion */ .t)();
23905
- const hasEvents = events.length > 0;
23906
23896
  (0,preact_hooks__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => {
23907
23897
  if (isVisible) {
23908
23898
  // Wait for the live containers to stabilise in the DOM before injecting
@@ -23936,13 +23926,10 @@ const useSeamlyChat = () => {
23936
23926
  spinnerTimeout.current = _babel_runtime_corejs3_core_js_stable_set_timeout__WEBPACK_IMPORTED_MODULE_0___default()(() => {
23937
23927
  dispatch((0,domains_store_slice__WEBPACK_IMPORTED_MODULE_2__.setIsLoading)(true));
23938
23928
  }, 500);
23939
- }, [dispatch]);
23940
- (0,preact_hooks__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => {
23941
- if (hasEvents) {
23929
+ return () => {
23942
23930
  clearTimeout(spinnerTimeout.current);
23943
- dispatch((0,domains_store_slice__WEBPACK_IMPORTED_MODULE_2__.setIsLoading)(false));
23944
- }
23945
- }, [hasEvents, dispatch]);
23931
+ };
23932
+ }, [dispatch]);
23946
23933
  (0,preact_hooks__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => {
23947
23934
  // This is needed to reset the ref to allow connect and start to happen again.
23948
23935
  // Mostly due to Interrupt situations and a reset being called.