@seamly/web-ui 19.1.1 → 19.1.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.
@@ -14497,6 +14497,15 @@ class SeamlyBaseError extends Error {
14497
14497
  }
14498
14498
 
14499
14499
  this.originalError = originalError;
14500
+
14501
+ if (originalError !== null && originalError !== void 0 && originalError.payload) {
14502
+ this.originalEvent = originalError;
14503
+ this.originalError = originalError.payload.error;
14504
+ }
14505
+
14506
+ if (originalError !== null && originalError !== void 0 && originalError.error) {
14507
+ this.originalError = originalError.error;
14508
+ }
14500
14509
  }
14501
14510
 
14502
14511
  }
@@ -20907,7 +20916,7 @@ function slide_defineProperty(obj, key, value) { if (key in obj) { Object.define
20907
20916
  function CarouselMessageSlide({
20908
20917
  item: slide,
20909
20918
  items,
20910
- currentIndex,
20919
+ index,
20911
20920
  isActive
20912
20921
  }) {
20913
20922
  const {
@@ -20918,7 +20927,7 @@ function CarouselMessageSlide({
20918
20927
  role: "group",
20919
20928
  "aria-roledescription": "slide",
20920
20929
  "aria-label": t('carousel.slide.label', {
20921
- index: currentIndex + 1,
20930
+ index: index + 1,
20922
20931
  total: items.length
20923
20932
  }),
20924
20933
  children: (0,jsx_runtime_namespaceObject.jsx)(card_component, slide_objectSpread(slide_objectSpread({}, slide), {}, {
@@ -20942,6 +20951,12 @@ const defaultGetItemKey = (item, idx, prefix) => `${prefix}${idx}`;
20942
20951
 
20943
20952
  const defaultGetItemLabel = item => item.label;
20944
20953
 
20954
+ const preventScroll = ({
20955
+ target
20956
+ }) => {
20957
+ target.scrollLeft = 0;
20958
+ };
20959
+
20945
20960
  function CarouselComponent({
20946
20961
  currentIndex: originalIndex,
20947
20962
  onChange,
@@ -20978,6 +20993,7 @@ function CarouselComponent({
20978
20993
  "aria-roledescription": "carousel",
20979
20994
  children: [(0,jsx_runtime_namespaceObject.jsx)("div", {
20980
20995
  className: css_className('carousel__slides-wrapper'),
20996
+ onScroll: preventScroll,
20981
20997
  children: (0,jsx_runtime_namespaceObject.jsx)("div", {
20982
20998
  id: carouselItemsId,
20983
20999
  className: css_className('carousel__slides'),
@@ -20997,6 +21013,7 @@ function CarouselComponent({
20997
21013
  item: item,
20998
21014
  items: items,
20999
21015
  currentIndex: currentIndex,
21016
+ index: idx,
21000
21017
  isActive: isActive
21001
21018
  })
21002
21019
  }, getItemKey(item, idx, 'item-'));
@@ -21029,6 +21046,7 @@ function CarouselComponent({
21029
21046
 
21030
21047
 
21031
21048
 
21049
+
21032
21050
  const getItemKey = (item, idx, prefix = '') => `${prefix}${item.title}:${idx}`;
21033
21051
 
21034
21052
  const getItemLabel = item => item.title;
@@ -21036,7 +21054,8 @@ const getItemLabel = item => item.title;
21036
21054
  const CarouselMessage = ({
21037
21055
  event
21038
21056
  }) => {
21039
- const slides = event.payload.body.cards;
21057
+ const [body] = useTranslatedEventData(event);
21058
+ const slides = body.cards;
21040
21059
  return (0,jsx_runtime_namespaceObject.jsx)(message_container, {
21041
21060
  event: event,
21042
21061
  modifiers: 'type-carousel',
@@ -23218,30 +23237,33 @@ function errors_createMiddleware({
23218
23237
  return ({
23219
23238
  getState
23220
23239
  }) => {
23221
- const handleError = error => {
23240
+ const handleError = action => {
23222
23241
  const {
23223
23242
  errorCallback,
23224
23243
  namespace,
23225
23244
  api,
23226
23245
  layoutMode
23227
23246
  } = selectConfig(getState());
23228
- errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(error, {
23247
+ errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
23229
23248
  namespace,
23230
23249
  api,
23231
23250
  layoutMode,
23232
- conversationUrl: seamlyApi.getConversationUrl()
23251
+ conversationUrl: seamlyApi.getConversationUrl(),
23252
+ action: action.type ? action : undefined
23233
23253
  });
23234
23254
  };
23235
23255
 
23236
23256
  return next => action => {
23237
23257
  try {
23238
23258
  if (action.error) {
23239
- handleError(action.error);
23259
+ handleError(action);
23240
23260
  }
23241
23261
 
23242
23262
  return next(action);
23243
23263
  } catch (error) {
23244
- handleError(error);
23264
+ handleError({
23265
+ error
23266
+ });
23245
23267
  throw error;
23246
23268
  }
23247
23269
  };
@@ -24532,11 +24554,12 @@ var Socket = class {
24532
24554
  }
24533
24555
 
24534
24556
  onConnClose(event) {
24557
+ let closeCode = event && event.code;
24535
24558
  if (this.hasLogger()) this.log("transport", "close", event);
24536
24559
  this.triggerChanError();
24537
24560
  clearTimeout(this.heartbeatTimer);
24538
24561
 
24539
- if (!this.closeWasClean) {
24562
+ if (!this.closeWasClean && closeCode !== 1e3) {
24540
24563
  this.reconnectTimer.scheduleTimeout();
24541
24564
  }
24542
24565
 
@@ -24767,7 +24790,8 @@ class ConversationProducer {
24767
24790
  this.emit({
24768
24791
  type: 'error',
24769
24792
  payload: {
24770
- type: 'seamly_offline'
24793
+ type: 'seamly_offline',
24794
+ error: err
24771
24795
  }
24772
24796
  });
24773
24797
  });
@@ -24839,7 +24863,8 @@ class ConversationProducer {
24839
24863
  this.emit({
24840
24864
  type: 'error',
24841
24865
  payload: {
24842
- type: 'join_channel_erred'
24866
+ type: 'join_channel_erred',
24867
+ error: err
24843
24868
  }
24844
24869
  });
24845
24870
  this.emit({
@@ -25846,8 +25871,11 @@ class ExternalApi {
25846
25871
  return this.appConfig(userConfig);
25847
25872
  }
25848
25873
 
25874
+ const defaults = external_api_objectSpread(external_api_objectSpread({}, this.appConfig.defaults), userConfig.defaults);
25875
+
25849
25876
  return external_api_objectSpread(external_api_objectSpread(external_api_objectSpread({}, this.appConfig), userConfig), {}, {
25850
- api: external_api_objectSpread(external_api_objectSpread({}, this.appConfig.api), userConfig.api)
25877
+ api: external_api_objectSpread(external_api_objectSpread({}, this.appConfig.api), userConfig.api),
25878
+ defaults: Object.keys(defaults).length ? defaults : undefined
25851
25879
  });
25852
25880
  }
25853
25881