@seamly/web-ui 19.1.2 → 19.1.5

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.
@@ -18083,9 +18083,6 @@ var is_array_default = /*#__PURE__*/__webpack_require__.n(is_array);
18083
18083
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/bind.js
18084
18084
  var bind = __webpack_require__(4103);
18085
18085
  var bind_default = /*#__PURE__*/__webpack_require__.n(bind);
18086
- // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js
18087
- var object_keys = __webpack_require__(6902);
18088
- var keys_default = /*#__PURE__*/__webpack_require__.n(object_keys);
18089
18086
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols.js
18090
18087
  var get_own_property_symbols = __webpack_require__(4310);
18091
18088
  var get_own_property_symbols_default = /*#__PURE__*/__webpack_require__.n(get_own_property_symbols);
@@ -18134,6 +18131,9 @@ var values_default = /*#__PURE__*/__webpack_require__.n(values);
18134
18131
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/some.js
18135
18132
  var some = __webpack_require__(7149);
18136
18133
  var some_default = /*#__PURE__*/__webpack_require__.n(some);
18134
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js
18135
+ var object_keys = __webpack_require__(6902);
18136
+ var keys_default = /*#__PURE__*/__webpack_require__.n(object_keys);
18137
18137
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/object/get-own-property-symbols.js
18138
18138
  var object_get_own_property_symbols = __webpack_require__(3263);
18139
18139
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/instance/index-of.js
@@ -22884,6 +22884,15 @@ class SeamlyBaseError extends Error {
22884
22884
  }
22885
22885
 
22886
22886
  this.originalError = originalError;
22887
+
22888
+ if (originalError !== null && originalError !== void 0 && originalError.payload) {
22889
+ this.originalEvent = originalError;
22890
+ this.originalError = originalError.payload.error;
22891
+ }
22892
+
22893
+ if (originalError !== null && originalError !== void 0 && originalError.error) {
22894
+ this.originalError = originalError.error;
22895
+ }
22887
22896
  }
22888
22897
 
22889
22898
  }
@@ -24640,45 +24649,48 @@ function useTranslationsContainer() {
24640
24649
 
24641
24650
 
24642
24651
 
24643
- function translations_middleware_createMiddleware() {
24644
- return ({
24645
- dispatch,
24646
- getState
24647
- }) => next => action => {
24648
- var _action$history, _action$history$trans, _action$initialState, _action$initialState$, _action$event, _action$event$payload, _action$event$payload2;
24652
+ function translations_middleware_createMiddleware({
24653
+ dispatch,
24654
+ getState
24655
+ }) {
24656
+ return next => {
24657
+ return action => {
24658
+ var _action$history, _action$history$trans, _action$initialState, _action$initialState$, _action$event, _action$event$payload, _action$event$payload2;
24649
24659
 
24650
- const result = next(action);
24660
+ const result = next(action);
24651
24661
 
24652
- switch (action.type) {
24653
- case String(seamlyActions.SET_HISTORY):
24654
- if ((_action$history = action.history) !== null && _action$history !== void 0 && (_action$history$trans = _action$history.translation) !== null && _action$history$trans !== void 0 && _action$history$trans.enabled) {
24655
- dispatch(enable(action.history.translation.locale));
24656
- }
24662
+ switch (action.type) {
24663
+ case String(seamlyActions.SET_HISTORY):
24664
+ if ((_action$history = action.history) !== null && _action$history !== void 0 && (_action$history$trans = _action$history.translation) !== null && _action$history$trans !== void 0 && _action$history$trans.enabled) {
24665
+ dispatch(enable(action.history.translation.locale));
24666
+ dispatch(setLocale(action.history.translation.locale));
24667
+ }
24657
24668
 
24658
- break;
24669
+ break;
24659
24670
 
24660
- case String(seamlyActions.SET_INITIAL_STATE):
24661
- if ((_action$initialState = action.initialState) !== null && _action$initialState !== void 0 && (_action$initialState$ = _action$initialState.translation) !== null && _action$initialState$ !== void 0 && _action$initialState$.enabled) {
24662
- dispatch(enable(action.initialState.translation.locale));
24663
- dispatch(setLocale(action.locale));
24664
- }
24671
+ case String(seamlyActions.SET_INITIAL_STATE):
24672
+ if ((_action$initialState = action.initialState) !== null && _action$initialState !== void 0 && (_action$initialState$ = _action$initialState.translation) !== null && _action$initialState$ !== void 0 && _action$initialState$.enabled) {
24673
+ dispatch(enable(action.initialState.translation.locale));
24674
+ dispatch(setLocale(action.locale));
24675
+ }
24665
24676
 
24666
- break;
24677
+ break;
24667
24678
 
24668
- case String(seamlyActions.ADD_EVENT):
24669
- if (action.event.type === 'info' && ((_action$event = action.event) === null || _action$event === void 0 ? void 0 : (_action$event$payload = _action$event.payload) === null || _action$event$payload === void 0 ? void 0 : (_action$event$payload2 = _action$event$payload.body) === null || _action$event$payload2 === void 0 ? void 0 : _action$event$payload2.subtype) === 'new_translation' && action.event.payload.body.translationEnabled) {
24670
- dispatch(setLocale(action.event.payload.body.translationLocale));
24671
- }
24679
+ case String(seamlyActions.ADD_EVENT):
24680
+ if (action.event.type === 'info' && ((_action$event = action.event) === null || _action$event === void 0 ? void 0 : (_action$event$payload = _action$event.payload) === null || _action$event$payload === void 0 ? void 0 : (_action$event$payload2 = _action$event$payload.body) === null || _action$event$payload2 === void 0 ? void 0 : _action$event$payload2.subtype) === 'new_translation' && action.event.payload.body.translationEnabled) {
24681
+ dispatch(setLocale(action.event.payload.body.translationLocale));
24682
+ }
24672
24683
 
24673
- break;
24684
+ break;
24674
24685
 
24675
- case String(disable):
24676
- const initialLocale = selectInitialLocale(getState());
24677
- dispatch(setLocale(initialLocale));
24678
- break;
24679
- }
24686
+ case String(disable):
24687
+ const initialLocale = selectInitialLocale(getState());
24688
+ dispatch(setLocale(initialLocale));
24689
+ break;
24690
+ }
24680
24691
 
24681
- return result;
24692
+ return result;
24693
+ };
24682
24694
  };
24683
24695
  }
24684
24696
  ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/reducer.js
@@ -29611,7 +29623,7 @@ function slide_objectSpread(target) { for (var i = 1; i < arguments.length; i++)
29611
29623
  function CarouselMessageSlide({
29612
29624
  item: slide,
29613
29625
  items,
29614
- currentIndex,
29626
+ index,
29615
29627
  isActive
29616
29628
  }) {
29617
29629
  const {
@@ -29622,7 +29634,7 @@ function CarouselMessageSlide({
29622
29634
  role: "group",
29623
29635
  "aria-roledescription": "slide",
29624
29636
  "aria-label": t('carousel.slide.label', {
29625
- index: currentIndex + 1,
29637
+ index: index + 1,
29626
29638
  total: items.length
29627
29639
  }),
29628
29640
  children: jsxRuntime_module_e(card_component, slide_objectSpread(slide_objectSpread({}, slide), {}, {
@@ -29648,6 +29660,12 @@ const defaultGetItemKey = (item, idx, prefix) => `${prefix}${idx}`;
29648
29660
 
29649
29661
  const defaultGetItemLabel = item => item.label;
29650
29662
 
29663
+ const preventScroll = ({
29664
+ target
29665
+ }) => {
29666
+ target.scrollLeft = 0;
29667
+ };
29668
+
29651
29669
  function CarouselComponent({
29652
29670
  currentIndex: originalIndex,
29653
29671
  onChange,
@@ -29686,6 +29704,7 @@ function CarouselComponent({
29686
29704
  "aria-roledescription": "carousel",
29687
29705
  children: [jsxRuntime_module_e("div", {
29688
29706
  className: css_className('carousel__slides-wrapper'),
29707
+ onScroll: preventScroll,
29689
29708
  children: jsxRuntime_module_e("div", {
29690
29709
  id: carouselItemsId,
29691
29710
  className: css_className('carousel__slides'),
@@ -29705,6 +29724,7 @@ function CarouselComponent({
29705
29724
  item: item,
29706
29725
  items: items,
29707
29726
  currentIndex: currentIndex,
29727
+ index: idx,
29708
29728
  isActive: isActive
29709
29729
  })
29710
29730
  }, getItemKey(item, idx, 'item-'));
@@ -29737,6 +29757,7 @@ function CarouselComponent({
29737
29757
 
29738
29758
 
29739
29759
 
29760
+
29740
29761
  const getItemKey = (item, idx, prefix = '') => `${prefix}${item.title}:${idx}`;
29741
29762
 
29742
29763
  const getItemLabel = item => item.title;
@@ -29744,7 +29765,8 @@ const getItemLabel = item => item.title;
29744
29765
  const CarouselMessage = ({
29745
29766
  event
29746
29767
  }) => {
29747
- const slides = event.payload.body.cards;
29768
+ const [body] = useTranslatedEventData(event);
29769
+ const slides = body.cards;
29748
29770
  return jsxRuntime_module_e(message_container, {
29749
29771
  event: event,
29750
29772
  modifiers: 'type-carousel',
@@ -31981,30 +32003,33 @@ function errors_createMiddleware({
31981
32003
  return ({
31982
32004
  getState
31983
32005
  }) => {
31984
- const handleError = error => {
32006
+ const handleError = action => {
31985
32007
  const {
31986
32008
  errorCallback,
31987
32009
  namespace,
31988
32010
  api,
31989
32011
  layoutMode
31990
32012
  } = selectConfig(getState());
31991
- errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(error, {
32013
+ errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
31992
32014
  namespace,
31993
32015
  api,
31994
32016
  layoutMode,
31995
- conversationUrl: seamlyApi.getConversationUrl()
32017
+ conversationUrl: seamlyApi.getConversationUrl(),
32018
+ action: action.type ? action : undefined
31996
32019
  });
31997
32020
  };
31998
32021
 
31999
32022
  return next => action => {
32000
32023
  try {
32001
32024
  if (action.error) {
32002
- handleError(action.error);
32025
+ handleError(action);
32003
32026
  }
32004
32027
 
32005
32028
  return next(action);
32006
32029
  } catch (error) {
32007
- handleError(error);
32030
+ handleError({
32031
+ error
32032
+ });
32008
32033
  throw error;
32009
32034
  }
32010
32035
  };
@@ -33659,7 +33684,8 @@ class ConversationProducer {
33659
33684
  this.emit({
33660
33685
  type: 'error',
33661
33686
  payload: {
33662
- type: 'seamly_offline'
33687
+ type: 'seamly_offline',
33688
+ error: err
33663
33689
  }
33664
33690
  });
33665
33691
  });
@@ -33731,7 +33757,8 @@ class ConversationProducer {
33731
33757
  this.emit({
33732
33758
  type: 'error',
33733
33759
  payload: {
33734
- type: 'join_channel_erred'
33760
+ type: 'join_channel_erred',
33761
+ error: err
33735
33762
  }
33736
33763
  });
33737
33764
  this.emit({
@@ -34504,7 +34531,7 @@ function store_createStore({
34504
34531
  api
34505
34532
  }), options_middleware_createMiddleware({
34506
34533
  api
34507
- }), translations_middleware_createMiddleware()]
34534
+ }), translations_middleware_createMiddleware]
34508
34535
  });
34509
34536
  return store;
34510
34537
  }
@@ -34810,8 +34837,11 @@ class ExternalApi {
34810
34837
  return this.appConfig(userConfig);
34811
34838
  }
34812
34839
 
34840
+ const defaults = external_api_objectSpread(external_api_objectSpread({}, this.appConfig.defaults), userConfig.defaults);
34841
+
34813
34842
  return external_api_objectSpread(external_api_objectSpread(external_api_objectSpread({}, this.appConfig), userConfig), {}, {
34814
- api: external_api_objectSpread(external_api_objectSpread({}, this.appConfig.api), userConfig.api)
34843
+ api: external_api_objectSpread(external_api_objectSpread({}, this.appConfig.api), userConfig.api),
34844
+ defaults: keys_default()(defaults).length ? defaults : undefined
34815
34845
  });
34816
34846
  }
34817
34847