@seamly/web-ui 22.2.0 → 22.3.0-beta.1

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 (47) hide show
  1. package/build/dist/lib/components.js +269 -138
  2. package/build/dist/lib/components.js.map +1 -1
  3. package/build/dist/lib/components.min.js +1 -1
  4. package/build/dist/lib/components.min.js.map +1 -1
  5. package/build/dist/lib/hooks.js +217 -41
  6. package/build/dist/lib/hooks.js.map +1 -1
  7. package/build/dist/lib/hooks.min.js +1 -1
  8. package/build/dist/lib/hooks.min.js.map +1 -1
  9. package/build/dist/lib/index.debug.js +43 -21
  10. package/build/dist/lib/index.debug.js.map +1 -1
  11. package/build/dist/lib/index.debug.min.js +1 -1
  12. package/build/dist/lib/index.debug.min.js.LICENSE.txt +12 -4
  13. package/build/dist/lib/index.debug.min.js.map +1 -1
  14. package/build/dist/lib/index.js +257 -133
  15. package/build/dist/lib/index.js.map +1 -1
  16. package/build/dist/lib/index.min.js +1 -1
  17. package/build/dist/lib/index.min.js.map +1 -1
  18. package/build/dist/lib/standalone.js +265 -133
  19. package/build/dist/lib/standalone.js.map +1 -1
  20. package/build/dist/lib/standalone.min.js +1 -1
  21. package/build/dist/lib/standalone.min.js.map +1 -1
  22. package/build/dist/lib/style-guide.js +274 -134
  23. package/build/dist/lib/style-guide.js.map +1 -1
  24. package/build/dist/lib/style-guide.min.js +1 -1
  25. package/build/dist/lib/style-guide.min.js.map +1 -1
  26. package/build/dist/lib/styles.css +1 -1
  27. package/build/dist/lib/utils.js +325 -171
  28. package/build/dist/lib/utils.js.map +1 -1
  29. package/build/dist/lib/utils.min.js +1 -1
  30. package/build/dist/lib/utils.min.js.map +1 -1
  31. package/package.json +1 -1
  32. package/src/javascripts/api/errors/seamly-api-error.ts +0 -1
  33. package/src/javascripts/api/index.ts +16 -8
  34. package/src/javascripts/domains/app/actions.ts +8 -3
  35. package/src/javascripts/domains/interrupt/selectors.ts +3 -2
  36. package/src/javascripts/domains/interrupt/slice.ts +2 -0
  37. package/src/javascripts/domains/redux/create-debounced-async-thunk.ts +109 -0
  38. package/src/javascripts/domains/redux/redux.types.ts +2 -1
  39. package/src/javascripts/domains/store/actions.ts +38 -0
  40. package/src/javascripts/domains/visibility/actions.ts +4 -1
  41. package/src/javascripts/style-guide/states.js +18 -1
  42. package/src/javascripts/ui/components/conversation/event/{card-component.js → card-component.tsx} +6 -4
  43. package/src/javascripts/ui/components/conversation/event/event-participant.js +1 -1
  44. package/src/javascripts/ui/components/core/seamly-event-subscriber.ts +14 -30
  45. package/src/javascripts/ui/components/view/window-view/window-open-button.js +8 -3
  46. package/src/javascripts/ui/hooks/use-session-expired-command.ts +31 -2
  47. package/src/stylesheets/5-components/_message-count.scss +11 -9
@@ -2691,20 +2691,87 @@ const defaultConfig = {
2691
2691
 
2692
2692
  /***/ }),
2693
2693
 
2694
- /***/ 9201:
2694
+ /***/ 526:
2695
2695
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2696
2696
 
2697
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2698
- /* harmony export */ Z: () => (/* binding */ initializeApp),
2699
- /* harmony export */ m: () => (/* binding */ resetApp)
2700
- /* harmony export */ });
2701
- /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9639);
2702
- /* harmony import */ var api_errors_seamly_session_expired_error__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6821);
2703
- /* harmony import */ var api_errors_seamly_unavailable_error__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7265);
2704
- /* harmony import */ var ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1149);
2705
- /* harmony import */ var domains_config_actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(257);
2706
- /* harmony import */ var domains_i18n_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5409);
2707
- /* harmony import */ var domains_visibility_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9586);
2697
+
2698
+ // EXPORTS
2699
+ __webpack_require__.d(__webpack_exports__, {
2700
+ Z: () => (/* binding */ initializeApp),
2701
+ m: () => (/* binding */ resetApp)
2702
+ });
2703
+
2704
+ // EXTERNAL MODULE: ./node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js + 2 modules
2705
+ var redux_toolkit_esm = __webpack_require__(9639);
2706
+ // EXTERNAL MODULE: ./src/javascripts/api/errors/seamly-session-expired-error.js
2707
+ var seamly_session_expired_error = __webpack_require__(6821);
2708
+ // EXTERNAL MODULE: ./src/javascripts/api/errors/seamly-unavailable-error.js
2709
+ var seamly_unavailable_error = __webpack_require__(7265);
2710
+ // EXTERNAL MODULE: ./src/javascripts/ui/utils/seamly-utils.ts
2711
+ var seamly_utils = __webpack_require__(1149);
2712
+ // EXTERNAL MODULE: ./src/javascripts/domains/config/actions.ts
2713
+ var actions = __webpack_require__(257);
2714
+ // EXTERNAL MODULE: ./src/javascripts/domains/i18n/actions.ts
2715
+ var i18n_actions = __webpack_require__(5409);
2716
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/redux/create-debounced-async-thunk.ts
2717
+
2718
+ /**
2719
+ * A debounced analogue of the `createAsyncThunk` from `@reduxjs/toolkit`
2720
+ * @param typePrefix - a string action type value
2721
+ * @param payloadCreator - a callback function that should return a promise containing the result of some asynchronous logic
2722
+ * @param debounceOptions - the debounce options object
2723
+ */
2724
+ const createDebouncedAsyncThunk = (typePrefix, payloadCreator, debounceOptions) => {
2725
+ const {
2726
+ wait = 300,
2727
+ maxWait = 0,
2728
+ leading = false
2729
+ } = debounceOptions !== null && debounceOptions !== void 0 ? debounceOptions : {};
2730
+ let debounceTimer = null;
2731
+ let maxWaitTimer = null;
2732
+ let resolve;
2733
+ const cancel = () => {
2734
+ if (resolve) {
2735
+ resolve(false);
2736
+ resolve = undefined;
2737
+ }
2738
+ };
2739
+ const invoke = () => {
2740
+ clearTimeout(maxWaitTimer);
2741
+ maxWaitTimer = undefined;
2742
+ if (resolve) {
2743
+ resolve(true);
2744
+ resolve = undefined;
2745
+ }
2746
+ };
2747
+ const debounceExecutionCondition = () => {
2748
+ const immediate = leading && !debounceTimer;
2749
+ // Start debounced condition resolution
2750
+ clearTimeout(debounceTimer);
2751
+ debounceTimer = setTimeout(() => {
2752
+ invoke();
2753
+ debounceTimer = null;
2754
+ }, wait);
2755
+ if (immediate) {
2756
+ return true;
2757
+ }
2758
+ cancel();
2759
+ // Start max wait condition resolution
2760
+ if (maxWait && !maxWaitTimer) {
2761
+ maxWaitTimer = setTimeout(invoke, maxWait);
2762
+ }
2763
+ return new Promise(res => {
2764
+ resolve = res;
2765
+ });
2766
+ };
2767
+ return (0,redux_toolkit_esm/* createAsyncThunk */.hg)(typePrefix, payloadCreator, {
2768
+ condition: debounceExecutionCondition
2769
+ });
2770
+ };
2771
+ /* harmony default export */ const create_debounced_async_thunk = (createDebouncedAsyncThunk);
2772
+ // EXTERNAL MODULE: ./src/javascripts/domains/visibility/actions.ts
2773
+ var visibility_actions = __webpack_require__(9586);
2774
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/app/actions.ts
2708
2775
  var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
2709
2776
  function adopt(value) {
2710
2777
  return value instanceof P ? value : new P(function (resolve) {
@@ -2739,7 +2806,8 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
2739
2806
 
2740
2807
 
2741
2808
 
2742
- const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .createAsyncThunk */ .hg)('initializeApp', (_, {
2809
+
2810
+ const initializeApp = (0,redux_toolkit_esm/* createAsyncThunk */.hg)('initializeApp', (_, {
2743
2811
  extra: {
2744
2812
  api,
2745
2813
  config
@@ -2760,7 +2828,7 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2760
2828
  } else {
2761
2829
  if ((_c = config === null || config === void 0 ? void 0 : config.context) === null || _c === void 0 ? void 0 : _c.topic) {
2762
2830
  api.send('action', {
2763
- type: ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_0__/* .actionTypes */ .Hp.setTopic,
2831
+ type: seamly_utils/* actionTypes */.Hp.setTopic,
2764
2832
  body: {
2765
2833
  name: config.context.topic,
2766
2834
  // Separate fallback message is not needed here. Only an attached service will use this, but none will
@@ -2772,7 +2840,7 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2772
2840
  if ((_d = config === null || config === void 0 ? void 0 : config.context) === null || _d === void 0 ? void 0 : _d.translationLocale) {
2773
2841
  locale = config.context.translationLocale;
2774
2842
  api.send('action', {
2775
- type: ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_0__/* .actionTypes */ .Hp.setTranslation,
2843
+ type: seamly_utils/* actionTypes */.Hp.setTranslation,
2776
2844
  body: {
2777
2845
  enabled: true,
2778
2846
  locale
@@ -2786,8 +2854,8 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2786
2854
  };
2787
2855
  }
2788
2856
  } catch (e) {
2789
- if (e instanceof api_errors_seamly_session_expired_error__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z) {
2790
- const err = new api_errors_seamly_session_expired_error__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z();
2857
+ if (e instanceof seamly_session_expired_error/* default */.Z) {
2858
+ const err = new seamly_session_expired_error/* default */.Z();
2791
2859
  return rejectWithValue({
2792
2860
  name: err.name,
2793
2861
  message: err.message,
@@ -2796,7 +2864,7 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2796
2864
  action: err.action
2797
2865
  });
2798
2866
  }
2799
- const err = new api_errors_seamly_unavailable_error__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z();
2867
+ const err = new seamly_unavailable_error/* default */.Z();
2800
2868
  return rejectWithValue({
2801
2869
  name: err.name,
2802
2870
  message: err.message,
@@ -2804,26 +2872,29 @@ const initializeApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .create
2804
2872
  });
2805
2873
  }
2806
2874
  }));
2807
- const resetApp = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .createAsyncThunk */ .hg)('resetApp', (_, {
2875
+ const resetApp = create_debounced_async_thunk('resetApp', (_, {
2808
2876
  dispatch,
2809
2877
  extra: {
2810
2878
  api
2811
2879
  }
2812
2880
  }) => __awaiter(void 0, void 0, void 0, function* () {
2813
2881
  yield api.disconnect();
2814
- yield api.clearStore();
2815
- dispatch((0,domains_config_actions__WEBPACK_IMPORTED_MODULE_1__/* .resetConfig */ .I)());
2816
- yield dispatch((0,domains_config_actions__WEBPACK_IMPORTED_MODULE_1__/* .initializeConfig */ .t)());
2882
+ api.clearStore();
2883
+ dispatch((0,actions/* resetConfig */.I)());
2884
+ yield dispatch((0,actions/* initializeConfig */.t)());
2817
2885
  try {
2818
2886
  const {
2819
2887
  locale
2820
2888
  } = yield dispatch(initializeApp()).unwrap();
2821
- yield dispatch((0,domains_i18n_actions__WEBPACK_IMPORTED_MODULE_2__/* .setLocale */ .i)(locale));
2822
- } catch (rejectedValueOrSerializedError) {
2889
+ yield dispatch((0,i18n_actions/* setLocale */.i)(locale));
2890
+ } catch (e) {
2823
2891
  // nothing to do
2824
2892
  }
2825
- dispatch((0,domains_visibility_actions__WEBPACK_IMPORTED_MODULE_3__/* .initializeVisibility */ .Z)());
2826
- }));
2893
+ dispatch((0,visibility_actions/* initializeVisibility */.Z)());
2894
+ }), {
2895
+ wait: 2000,
2896
+ leading: true
2897
+ });
2827
2898
 
2828
2899
  /***/ }),
2829
2900
 
@@ -2851,7 +2922,7 @@ const selectUserHasResponded = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__/
2851
2922
  /* harmony export */ });
2852
2923
  /* unused harmony export appSlice */
2853
2924
  /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9639);
2854
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9201);
2925
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(526);
2855
2926
 
2856
2927
 
2857
2928
  const initialState = {
@@ -3232,7 +3303,7 @@ function createErrorsMiddleware({
3232
3303
  /* harmony export */ });
3233
3304
  /* unused harmony export formsSlice */
3234
3305
  /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9639);
3235
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9201);
3306
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(526);
3236
3307
 
3237
3308
 
3238
3309
  const initialFormState = {
@@ -4242,11 +4313,13 @@ const selectHasError = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__/* .creat
4242
4313
  /* harmony export */ uc: () => (/* binding */ setInterrupt)
4243
4314
  /* harmony export */ });
4244
4315
  /* unused harmony exports interruptSlice, clearInterrupt */
4245
- /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9639);
4246
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9201);
4316
+ /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9639);
4317
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(526);
4247
4318
  /* harmony import */ var domains_config_actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(257);
4248
4319
  /* harmony import */ var domains_i18n_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5409);
4249
- /* harmony import */ var domains_visibility_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9586);
4320
+ /* harmony import */ var domains_store_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2770);
4321
+ /* harmony import */ var domains_visibility_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9586);
4322
+
4250
4323
 
4251
4324
 
4252
4325
 
@@ -4255,7 +4328,7 @@ const selectHasError = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__/* .creat
4255
4328
  const initialState = {
4256
4329
  error: undefined
4257
4330
  };
4258
- const interruptSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .createSlice */ .oM)({
4331
+ const interruptSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_5__/* .createSlice */ .oM)({
4259
4332
  name: 'interrupt',
4260
4333
  initialState,
4261
4334
  reducers: {
@@ -4265,7 +4338,7 @@ const interruptSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .creat
4265
4338
  clearInterrupt: () => initialState
4266
4339
  },
4267
4340
  extraReducers: builder => {
4268
- builder.addCase(domains_config_actions__WEBPACK_IMPORTED_MODULE_1__/* .initializeConfig */ .t.pending, () => initialState).addMatcher((0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__/* .isAnyOf */ .Q)(domains_app_actions__WEBPACK_IMPORTED_MODULE_0__/* .initializeApp */ .Z.rejected, domains_config_actions__WEBPACK_IMPORTED_MODULE_1__/* .initializeConfig */ .t.rejected, domains_i18n_actions__WEBPACK_IMPORTED_MODULE_2__/* .setLocale */ .i.rejected, domains_visibility_actions__WEBPACK_IMPORTED_MODULE_3__/* .setVisibility */ .i.rejected, domains_visibility_actions__WEBPACK_IMPORTED_MODULE_3__/* .initializeVisibility */ .Z.rejected), (state, {
4341
+ builder.addCase(domains_config_actions__WEBPACK_IMPORTED_MODULE_1__/* .initializeConfig */ .t.pending, () => initialState).addMatcher((0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_5__/* .isAnyOf */ .Q)(domains_app_actions__WEBPACK_IMPORTED_MODULE_0__/* .initializeApp */ .Z.rejected, domains_config_actions__WEBPACK_IMPORTED_MODULE_1__/* .initializeConfig */ .t.rejected, domains_i18n_actions__WEBPACK_IMPORTED_MODULE_2__/* .setLocale */ .i.rejected, domains_visibility_actions__WEBPACK_IMPORTED_MODULE_4__/* .setVisibility */ .i.rejected, domains_visibility_actions__WEBPACK_IMPORTED_MODULE_4__/* .initializeVisibility */ .Z.rejected, domains_store_actions__WEBPACK_IMPORTED_MODULE_3__/* .getConversation */ .c.rejected), (state, {
4269
4342
  payload
4270
4343
  }) => {
4271
4344
  state.error = payload;
@@ -4280,6 +4353,77 @@ const {
4280
4353
 
4281
4354
  /***/ }),
4282
4355
 
4356
+ /***/ 2770:
4357
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4358
+
4359
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4360
+ /* harmony export */ c: () => (/* binding */ getConversation)
4361
+ /* harmony export */ });
4362
+ /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9639);
4363
+ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
4364
+ function adopt(value) {
4365
+ return value instanceof P ? value : new P(function (resolve) {
4366
+ resolve(value);
4367
+ });
4368
+ }
4369
+ return new (P || (P = Promise))(function (resolve, reject) {
4370
+ function fulfilled(value) {
4371
+ try {
4372
+ step(generator.next(value));
4373
+ } catch (e) {
4374
+ reject(e);
4375
+ }
4376
+ }
4377
+ function rejected(value) {
4378
+ try {
4379
+ step(generator["throw"](value));
4380
+ } catch (e) {
4381
+ reject(e);
4382
+ }
4383
+ }
4384
+ function step(result) {
4385
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
4386
+ }
4387
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
4388
+ });
4389
+ };
4390
+
4391
+ const getConversation = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__/* .createAsyncThunk */ .hg)('getConversation', (_, {
4392
+ extra: {
4393
+ api
4394
+ },
4395
+ rejectWithValue
4396
+ }) => __awaiter(void 0, void 0, void 0, function* () {
4397
+ try {
4398
+ return api.getConversation();
4399
+ } catch (error) {
4400
+ return rejectWithValue({
4401
+ name: error === null || error === void 0 ? void 0 : error.name,
4402
+ message: error === null || error === void 0 ? void 0 : error.message,
4403
+ langKey: error === null || error === void 0 ? void 0 : error.langKey,
4404
+ action: error === null || error === void 0 ? void 0 : error.action,
4405
+ originalEvent: error === null || error === void 0 ? void 0 : error.originalEvent,
4406
+ originalError: error === null || error === void 0 ? void 0 : error.originalError
4407
+ });
4408
+ }
4409
+ }), {
4410
+ condition(payload, {
4411
+ getState
4412
+ }) {
4413
+ var _a;
4414
+ const {
4415
+ state: {
4416
+ events
4417
+ }
4418
+ } = getState();
4419
+ const lastEvent = events[events.length - 1];
4420
+ const payloadLastEventId = (_a = payload === null || payload === void 0 ? void 0 : payload.lastEvent) === null || _a === void 0 ? void 0 : _a.id;
4421
+ return lastEvent && payloadLastEventId !== lastEvent.payload.id;
4422
+ }
4423
+ });
4424
+
4425
+ /***/ }),
4426
+
4283
4427
  /***/ 7271:
4284
4428
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4285
4429
 
@@ -4303,8 +4447,8 @@ var errors = __webpack_require__(9792);
4303
4447
  var forms_slice = __webpack_require__(3939);
4304
4448
  // EXTERNAL MODULE: ./node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js + 2 modules
4305
4449
  var redux_toolkit_esm = __webpack_require__(9639);
4306
- // EXTERNAL MODULE: ./src/javascripts/domains/app/actions.ts
4307
- var actions = __webpack_require__(9201);
4450
+ // EXTERNAL MODULE: ./src/javascripts/domains/app/actions.ts + 1 modules
4451
+ var actions = __webpack_require__(526);
4308
4452
  // EXTERNAL MODULE: ./src/javascripts/domains/config/actions.ts
4309
4453
  var config_actions = __webpack_require__(257);
4310
4454
  // EXTERNAL MODULE: ./src/javascripts/domains/i18n/actions.ts
@@ -4567,7 +4711,7 @@ const useAppDispatch = es/* useDispatch */.I0;
4567
4711
  /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9639);
4568
4712
  /* harmony import */ var ui_utils_general_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(822);
4569
4713
  /* harmony import */ var ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1149);
4570
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9201);
4714
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(526);
4571
4715
  /* harmony import */ var domains_config_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(257);
4572
4716
  /* harmony import */ var lib_id__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8527);
4573
4717
 
@@ -5400,7 +5544,7 @@ const useTranslationProposal = () => {
5400
5544
  /* harmony export */ });
5401
5545
  /* unused harmony exports translationsInitialState, translationSlice, setTranslationProposalPrompt */
5402
5546
  /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9639);
5403
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9201);
5547
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(526);
5404
5548
  /* harmony import */ var domains_config_actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(257);
5405
5549
  /* harmony import */ var domains_store_slice__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8801);
5406
5550
 
@@ -5617,8 +5761,9 @@ const setVisibility = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_6__/* .create
5617
5761
  if (previousVisibility === calculatedVisibility) {
5618
5762
  return undefined;
5619
5763
  }
5764
+ const visibility = api.store.get(_constants__WEBPACK_IMPORTED_MODULE_4__/* .StoreKey */ .K);
5620
5765
  // Store the user-requested visibility in order to reinitialize after refresh
5621
- api.store.set(_constants__WEBPACK_IMPORTED_MODULE_4__/* .StoreKey */ .K, Object.assign(Object.assign({}, api.store.get(_constants__WEBPACK_IMPORTED_MODULE_4__/* .StoreKey */ .K) || {}), {
5766
+ api.store.set(_constants__WEBPACK_IMPORTED_MODULE_4__/* .StoreKey */ .K, Object.assign(Object.assign({}, visibility || {}), {
5622
5767
  [layoutMode]: requestedVisibility
5623
5768
  }));
5624
5769
  if (requestedVisibility) {
@@ -6065,10 +6210,17 @@ var live_region_hooks = __webpack_require__(5136);
6065
6210
  var seamly_state_hooks = __webpack_require__(2140);
6066
6211
  // EXTERNAL MODULE: ./src/javascripts/domains/interrupt/hooks.ts
6067
6212
  var interrupt_hooks = __webpack_require__(5889);
6213
+ // EXTERNAL MODULE: ./src/javascripts/domains/interrupt/slice.ts
6214
+ var slice = __webpack_require__(6160);
6215
+ // EXTERNAL MODULE: ./src/javascripts/domains/store/index.ts + 4 modules
6216
+ var store = __webpack_require__(7271);
6068
6217
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-session-expired-command.ts
6069
6218
 
6070
6219
 
6071
6220
 
6221
+
6222
+
6223
+
6072
6224
  function use_session_expired_command_useSessionExpiredCommand() {
6073
6225
  const {
6074
6226
  meta: {
@@ -6076,13 +6228,35 @@ function use_session_expired_command_useSessionExpiredCommand() {
6076
6228
  action
6077
6229
  }
6078
6230
  } = useInterrupt();
6231
+ const dispatch = useAppDispatch();
6079
6232
  const seamlyCommands = useSeamlyCommands();
6080
6233
  const isExpiredError = (originalError === null || originalError === void 0 ? void 0 : originalError.name) === 'SeamlySessionExpiredError';
6234
+ const limit = useRef(0);
6235
+ const limitTimer = useRef(null);
6081
6236
  useEffect(() => {
6082
6237
  if (isExpiredError && seamlyCommands[action]) {
6238
+ if (limit.current >= 10) {
6239
+ limitTimer.current = setTimeout(() => {
6240
+ limit.current = 0;
6241
+ }, 10000);
6242
+ const error = new SeamlyGeneralError();
6243
+ dispatch(setInterrupt({
6244
+ name: error.name,
6245
+ message: error.message,
6246
+ langKey: error.langKey,
6247
+ originalEvent: error.originalEvent,
6248
+ originalError: error.originalError,
6249
+ action: error.action
6250
+ }));
6251
+ return () => {};
6252
+ }
6253
+ limit.current += 1;
6083
6254
  seamlyCommands[action]();
6084
6255
  }
6085
- }, [action, seamlyCommands, isExpiredError]);
6256
+ return () => {
6257
+ if (limitTimer.current) clearTimeout(limitTimer.current);
6258
+ };
6259
+ }, [action, seamlyCommands, isExpiredError, dispatch]);
6086
6260
  }
6087
6261
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-seamly-chat.ts
6088
6262
  var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
@@ -6788,7 +6962,7 @@ const EventParticipant = ({
6788
6962
  })
6789
6963
  }));
6790
6964
  }
6791
- if (showName) {
6965
+ if (showName && participantName) {
6792
6966
  authorInfo.push((0,preact_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
6793
6967
  className: (0,lib_css__WEBPACK_IMPORTED_MODULE_3__/* .className */ .o)('message__author-name'),
6794
6968
  children: participantName
@@ -7504,7 +7678,7 @@ const useSeamlyActivityEventHandler = () => (0,preact_hooks__WEBPACK_IMPORTED_MO
7504
7678
  /* harmony import */ var config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9787);
7505
7679
  /* harmony import */ var ui_components_core_seamly_api_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2871);
7506
7680
  /* harmony import */ var ui_utils_seamly_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1149);
7507
- /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9201);
7681
+ /* harmony import */ var domains_app_actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(526);
7508
7682
  /* harmony import */ var domains_app_hooks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3423);
7509
7683
  /* harmony import */ var domains_app_slice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1322);
7510
7684
  /* harmony import */ var domains_config_hooks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(6134);
@@ -10168,108 +10342,61 @@ const ComponentContext = (0,external_preact_.createContext)({});
10168
10342
  var message_container = __webpack_require__(2480);
10169
10343
  // EXTERNAL MODULE: ./src/javascripts/domains/translations/hooks.ts + 1 modules
10170
10344
  var translations_hooks = __webpack_require__(4398);
10171
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.js
10345
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.tsx
10172
10346
 
10173
10347
 
10174
10348
 
10175
10349
 
10176
10350
 
10177
-
10178
- const CardComponent = ({
10179
- id,
10180
- action,
10181
- buttonText,
10182
- description,
10183
- hasFocus,
10184
- image,
10185
- title,
10186
- isCarouselItem
10187
- }) => {
10188
- const cardRef = (0,hooks_.useRef)(null);
10189
- const {
10190
- sendMessage,
10191
- sendAction,
10192
- emitEvent
10193
- } = (0,seamly_hooks/* useSeamlyCommands */.bs)();
10194
- const descriptionId = (0,seamly_hooks/* useGeneratedId */.I8)();
10195
- const isMounted = (0,hooks_.useRef)();
10196
- const CardActionComponent = action.type === seamly_utils/* cardTypes */.wh.navigate ? 'a' : 'button';
10197
- const emitCardEvent = (0,hooks_.useCallback)(() => emitEvent(`action.${seamly_utils/* actionTypes */.Hp.clickCard}`, {
10198
- type: seamly_utils/* actionTypes */.Hp.clickCta,
10199
- originMessage: id,
10200
- action
10201
- }), [emitEvent, id, action]);
10202
- const handleClick = (0,hooks_.useCallback)(() => {
10203
- emitCardEvent();
10204
- if (action.type === seamly_utils/* cardTypes */.wh.ask) {
10205
- sendMessage({
10206
- body: action.ask
10207
- });
10208
- } else if (action.type === seamly_utils/* cardTypes */.wh.topic) {
10209
- const {
10210
- topic: name,
10211
- fallbackMessage
10212
- } = action;
10213
- sendAction({
10214
- type: seamly_utils/* actionTypes */.Hp.setTopic,
10215
- body: {
10216
- name,
10217
- fallbackMessage
10351
+ const CardComponent = ({ id, action, buttonText, description, hasFocus, image, title, isCarouselItem, }) => {
10352
+ const cardRef = (0,hooks_.useRef)(null);
10353
+ const { sendMessage, sendAction, emitEvent } = (0,seamly_hooks/* useSeamlyCommands */.bs)();
10354
+ const descriptionId = (0,seamly_hooks/* useGeneratedId */.I8)();
10355
+ const isMounted = (0,hooks_.useRef)(false);
10356
+ const CardActionComponent = action.type === seamly_utils/* cardTypes */.wh.navigate ? 'a' : 'button';
10357
+ const emitCardEvent = (0,hooks_.useCallback)(() => emitEvent(`action.${seamly_utils/* actionTypes */.Hp.clickCard}`, {
10358
+ type: seamly_utils/* actionTypes */.Hp.clickCta,
10359
+ originMessage: id,
10360
+ action,
10361
+ }), [emitEvent, id, action]);
10362
+ const handleClick = (0,hooks_.useCallback)(() => {
10363
+ emitCardEvent();
10364
+ if (action.type === seamly_utils/* cardTypes */.wh.ask) {
10365
+ sendMessage({ body: action.ask });
10218
10366
  }
10219
- });
10220
- }
10221
- }, [sendMessage, action, sendAction, emitCardEvent]);
10222
- const actionProps = (0,hooks_.useMemo)(() => action.type === seamly_utils/* cardTypes */.wh.navigate ? {
10223
- href: action.link,
10224
- rel: 'noopener noreferrer',
10225
- target: action.newTab ? '_blank' : '_self',
10226
- onClick: emitCardEvent
10227
- } : {
10228
- onClick: handleClick
10229
- }, [action, handleClick, emitCardEvent]);
10230
- (0,hooks_.useEffect)(() => {
10231
- if (isCarouselItem) {
10232
- if (hasFocus && isMounted.current) {
10233
- window.requestAnimationFrame(() => cardRef.current.focus());
10234
- } else {
10235
- cardRef.current.blur();
10236
- }
10237
- }
10238
- isMounted.current = true;
10239
- }, [hasFocus, isCarouselItem]);
10240
- return (0,jsx_runtime_.jsxs)("div", {
10241
- className: (0,css/* className */.o)('card__wrapper'),
10242
- id: id,
10243
- tabIndex: "-1" // set tabIndex of -1 so card can be focussed
10244
- ,
10245
- ref: cardRef,
10246
- children: [(0,jsx_runtime_.jsx)("img", {
10247
- className: (0,css/* className */.o)('card__image'),
10248
- src: image,
10249
- alt: ""
10250
- }), (0,jsx_runtime_.jsxs)("div", {
10251
- className: (0,css/* className */.o)('card__content'),
10252
- id: id,
10253
- children: [title && (0,jsx_runtime_.jsx)("h2", {
10254
- className: (0,css/* className */.o)('card__title'),
10255
- children: title
10256
- }), description && (0,jsx_runtime_.jsx)("div", {
10257
- className: (0,css/* className */.o)('card__description'),
10258
- dangerouslySetInnerHTML: {
10259
- __html: description
10367
+ else if (action.type === seamly_utils/* cardTypes */.wh.topic) {
10368
+ const { topic: name, fallbackMessage } = action;
10369
+ sendAction({
10370
+ type: seamly_utils/* actionTypes */.Hp.setTopic,
10371
+ body: { name, fallbackMessage },
10372
+ });
10260
10373
  }
10261
- }), (0,jsx_runtime_.jsx)(CardActionComponent, {
10262
- tabIndex: isCarouselItem && !hasFocus ? '-1' : undefined // disable to prevent tabbing through cards
10263
- ,
10264
- className: (0,css/* className */.o)('button', 'button--primary'),
10265
- "aria-describedby": descriptionId,
10266
- ...actionProps,
10267
- children: buttonText
10268
- })]
10269
- })]
10270
- });
10374
+ }, [sendMessage, action, sendAction, emitCardEvent]);
10375
+ const actionProps = (0,hooks_.useMemo)(() => action.type === seamly_utils/* cardTypes */.wh.navigate
10376
+ ? {
10377
+ href: action.link,
10378
+ rel: 'noopener noreferrer',
10379
+ target: action.newTab ? '_blank' : '_self',
10380
+ onClick: emitCardEvent,
10381
+ }
10382
+ : {
10383
+ onClick: handleClick,
10384
+ }, [action, handleClick, emitCardEvent]);
10385
+ (0,hooks_.useEffect)(() => {
10386
+ if (isCarouselItem) {
10387
+ if (hasFocus && isMounted.current) {
10388
+ window.requestAnimationFrame(() => cardRef.current.focus());
10389
+ }
10390
+ else {
10391
+ cardRef.current.blur();
10392
+ }
10393
+ }
10394
+ isMounted.current = true;
10395
+ }, [hasFocus, isCarouselItem]);
10396
+ return ((0,jsx_runtime_.jsxs)("div", { className: (0,css/* className */.o)('card__wrapper'), id: id, tabIndex: -1, ref: cardRef, children: [image ? ((0,jsx_runtime_.jsx)("img", { className: (0,css/* className */.o)('card__image'), src: image, alt: "" })) : null, (0,jsx_runtime_.jsxs)("div", { className: (0,css/* className */.o)('card__content'), id: id, children: [title && (0,jsx_runtime_.jsx)("h2", { className: (0,css/* className */.o)('card__title'), children: title }), description && ((0,jsx_runtime_.jsx)("div", { className: (0,css/* className */.o)('card__description'), dangerouslySetInnerHTML: { __html: description } })), (0,jsx_runtime_.jsx)(CardActionComponent, Object.assign({ tabIndex: isCarouselItem && !hasFocus ? -1 : undefined, className: (0,css/* className */.o)('button', 'button--primary'), "aria-describedby": descriptionId }, actionProps, { children: buttonText }))] })] }));
10271
10397
  };
10272
10398
  /* harmony default export */ const card_component = (CardComponent);
10399
+
10273
10400
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-message.js
10274
10401
 
10275
10402
 
@@ -16013,10 +16140,14 @@ const WindowOpenButton = ({
16013
16140
  "aria-label": ariaLabel,
16014
16141
  "aria-hidden": isOpen,
16015
16142
  onClick: handleClick,
16016
- children: [(0,jsx_runtime_.jsx)("span", {
16017
- className: (0,css/* className */.o)('message-count'),
16018
- "aria-hidden": "true",
16019
- children: !!count && count
16143
+ children: [(0,jsx_runtime_.jsx)(in_out_transition, {
16144
+ isActive: !!count,
16145
+ transitionStartState: transitionStartStates.notRendered,
16146
+ children: (0,jsx_runtime_.jsx)("span", {
16147
+ className: (0,css/* className */.o)('message-count'),
16148
+ "aria-hidden": "true",
16149
+ children: count
16150
+ })
16020
16151
  }), (0,jsx_runtime_.jsx)(ButtonIcon, {})]
16021
16152
  })
16022
16153
  });