@seamly/web-ui 20.1.0 → 20.2.0-alpha.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 (59) hide show
  1. package/build/dist/lib/index.debug.js +41 -41
  2. package/build/dist/lib/index.debug.min.js +1 -1
  3. package/build/dist/lib/index.js +517 -501
  4. package/build/dist/lib/index.min.js +1 -1
  5. package/build/dist/lib/standalone.js +595 -579
  6. package/build/dist/lib/standalone.min.js +1 -1
  7. package/build/dist/lib/style-guide.js +6918 -6912
  8. package/build/dist/lib/style-guide.min.js +1 -1
  9. package/build/dist/lib/styles.css +1 -1
  10. package/package.json +1 -1
  11. package/src/javascripts/api/index.js +12 -5
  12. package/src/javascripts/domains/app/actions.js +6 -2
  13. package/src/javascripts/domains/config/reducer.js +2 -2
  14. package/src/javascripts/domains/forms/reducer.js +1 -1
  15. package/src/javascripts/domains/i18n/reducer.js +1 -1
  16. package/src/javascripts/domains/interrupt/reducer.js +1 -1
  17. package/src/javascripts/domains/translations/components/chat-status.js +1 -4
  18. package/src/javascripts/domains/translations/components/options-dialog/index.js +2 -5
  19. package/src/javascripts/domains/translations/hooks.js +1 -5
  20. package/src/javascripts/domains/translations/middleware.js +2 -5
  21. package/src/javascripts/domains/translations/reducer.js +2 -2
  22. package/src/javascripts/domains/visibility/actions.js +1 -1
  23. package/src/javascripts/style-guide/components/app.js +1 -1
  24. package/src/javascripts/style-guide/components/static-core.js +4 -1
  25. package/src/javascripts/ui/components/conversation/conversation.js +2 -2
  26. package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +1 -1
  27. package/src/javascripts/ui/components/conversation/event/cta.js +1 -1
  28. package/src/javascripts/ui/components/conversation/event/image.js +1 -1
  29. package/src/javascripts/ui/components/conversation/event/text.js +2 -2
  30. package/src/javascripts/ui/components/conversation/loader.js +1 -1
  31. package/src/javascripts/ui/components/conversation/message-container.js +1 -1
  32. package/src/javascripts/ui/components/core/seamly-activity-monitor.js +1 -1
  33. package/src/javascripts/ui/components/core/seamly-core.js +2 -2
  34. package/src/javascripts/ui/components/core/seamly-file-upload.js +1 -1
  35. package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +1 -1
  36. package/src/javascripts/ui/components/core/seamly-live-region.js +2 -2
  37. package/src/javascripts/ui/components/entry/entry-container.js +2 -2
  38. package/src/javascripts/ui/components/entry/text-entry/hooks.js +4 -1
  39. package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +1 -1
  40. package/src/javascripts/ui/components/form-controls/select.js +1 -1
  41. package/src/javascripts/ui/components/layout/agent-info.js +1 -1
  42. package/src/javascripts/ui/components/layout/header.js +1 -1
  43. package/src/javascripts/ui/components/options/options-button.js +1 -1
  44. package/src/javascripts/ui/components/options/options.js +1 -1
  45. package/src/javascripts/ui/components/options/transcript/index.js +1 -1
  46. package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +1 -1
  47. package/src/javascripts/ui/components/widgets/lightbox.js +1 -1
  48. package/src/javascripts/ui/hooks/file-upload-hooks.js +3 -2
  49. package/src/javascripts/ui/hooks/focus-helper-hooks.js +2 -2
  50. package/src/javascripts/ui/hooks/seamly-entry-hooks.js +1 -1
  51. package/src/javascripts/ui/hooks/seamly-option-hooks.js +1 -1
  52. package/src/javascripts/ui/hooks/use-seamly-chat.js +2 -2
  53. package/src/javascripts/ui/hooks/use-seamly-commands.js +7 -7
  54. package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +4 -4
  55. package/src/javascripts/ui/hooks/use-seamly-resume-conversation-prompt.js +2 -2
  56. package/src/javascripts/ui/hooks/use-single-file-upload.js +1 -1
  57. package/src/stylesheets/5-components/_chat-status.scss +4 -0
  58. package/webpack/config.package.js +7 -0
  59. package/src/.DS_Store +0 -0
@@ -16964,6 +16964,29 @@ const setLocale = i18n_utils_createThunk('setLocale', async (locale, {
16964
16964
  return api.getTranslations(locale);
16965
16965
  });
16966
16966
  });
16967
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/utils.js
16968
+
16969
+ const {
16970
+ createActions: utils_createActions,
16971
+ createReducer: translations_utils_createReducer,
16972
+ selectState: translations_utils_selectState
16973
+ } = createDomain('translations');
16974
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/actions.js
16975
+
16976
+ const [enable, disable] = utils_createActions('translate', {
16977
+ enable: locale => ({
16978
+ locale
16979
+ }),
16980
+ disable: () => ({})
16981
+ });
16982
+ const [enableEvent, disableEvent] = utils_createActions('event', {
16983
+ enable: payloadId => ({
16984
+ payloadId
16985
+ }),
16986
+ disable: payloadId => ({
16987
+ payloadId
16988
+ })
16989
+ });
16967
16990
  ;// CONCATENATED MODULE: ./src/javascripts/domains/app/utils.js
16968
16991
 
16969
16992
  const {
@@ -16977,6 +17000,43 @@ const {
16977
17000
 
16978
17001
  const selectUserHasResponded = createSelector(app_utils_selectState, state => state.userHasResponded);
16979
17002
 
17003
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/utils.js
17004
+
17005
+
17006
+ const {
17007
+ createAction: visibility_utils_createAction,
17008
+ createActions: visibility_utils_createActions,
17009
+ createThunk: visibility_utils_createThunk,
17010
+ createReducer: visibility_utils_createReducer,
17011
+ selectState: visibility_utils_selectState
17012
+ } = createDomain('visibility');
17013
+ const calculateVisibility = ({
17014
+ hasResponded,
17015
+ previousVisibility,
17016
+ requestedVisibility,
17017
+ config
17018
+ }) => {
17019
+ const {
17020
+ defaults,
17021
+ layoutMode,
17022
+ hideOnNoUserResponse
17023
+ } = config;
17024
+ const {
17025
+ visible: defaultVisibility
17026
+ } = defaults || {}; // Requesting open should override the responded check.
17027
+
17028
+ if (layoutMode === 'window' && hideOnNoUserResponse && requestedVisibility !== visibilityStates.open) {
17029
+ return hasResponded ? requestedVisibility || previousVisibility || visibilityStates.open : visibilityStates.hidden;
17030
+ }
17031
+
17032
+ const baseVisibility = visibilityStates.minimized;
17033
+ return requestedVisibility || previousVisibility || defaultVisibility || baseVisibility;
17034
+ };
17035
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/selectors.js
17036
+
17037
+
17038
+ const selectVisibility = createSelector(visibility_utils_selectState, state => state.visibility);
17039
+
16980
17040
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/seamly-state-hooks.js
16981
17041
 
16982
17042
 
@@ -17099,43 +17159,6 @@ const useSeamlyLayoutMode = () => {
17099
17159
  isResolving: !layoutMode
17100
17160
  };
17101
17161
  };
17102
- ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/utils.js
17103
-
17104
-
17105
- const {
17106
- createAction: visibility_utils_createAction,
17107
- createActions: utils_createActions,
17108
- createThunk: visibility_utils_createThunk,
17109
- createReducer: visibility_utils_createReducer,
17110
- selectState: visibility_utils_selectState
17111
- } = createDomain('visibility');
17112
- const calculateVisibility = ({
17113
- hasResponded,
17114
- previousVisibility,
17115
- requestedVisibility,
17116
- config
17117
- }) => {
17118
- const {
17119
- defaults,
17120
- layoutMode,
17121
- hideOnNoUserResponse
17122
- } = config;
17123
- const {
17124
- visible: defaultVisibility
17125
- } = defaults || {}; // Requesting open should override the responded check.
17126
-
17127
- if (layoutMode === 'window' && hideOnNoUserResponse && requestedVisibility !== visibilityStates.open) {
17128
- return hasResponded ? requestedVisibility || previousVisibility || visibilityStates.open : visibilityStates.hidden;
17129
- }
17130
-
17131
- const baseVisibility = visibilityStates.minimized;
17132
- return requestedVisibility || previousVisibility || defaultVisibility || baseVisibility;
17133
- };
17134
- ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/selectors.js
17135
-
17136
-
17137
- const selectVisibility = createSelector(visibility_utils_selectState, state => state.visibility);
17138
-
17139
17162
  ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/actions.js
17140
17163
 
17141
17164
 
@@ -17314,6 +17337,7 @@ const clear = interrupt_utils_createAction('clear');
17314
17337
 
17315
17338
 
17316
17339
 
17340
+
17317
17341
  const setHasResponded = app_utils_createAction('setHasResponded', hasResponded => ({
17318
17342
  hasResponded
17319
17343
  }));
@@ -17356,7 +17380,7 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
17356
17380
 
17357
17381
  if (agentParticipant !== null && agentParticipant !== void 0 && agentParticipant.name) {
17358
17382
  dispatch({
17359
- type: seamlyActions.SET_HEADER_TITLE,
17383
+ type: seamlyActions.SET_HEADER_SUB_TITLE,
17360
17384
  title: agentParticipant.name
17361
17385
  });
17362
17386
  }
@@ -17365,6 +17389,8 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
17365
17389
  }
17366
17390
 
17367
17391
  try {
17392
+ var _config$context2;
17393
+
17368
17394
  if (api.hasConversation()) {
17369
17395
  var _initialState$transla;
17370
17396
 
@@ -17378,6 +17404,9 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
17378
17404
  if ('userResponded' in initialState) {
17379
17405
  dispatch(setHasResponded(initialState.userResponded));
17380
17406
  }
17407
+ } else if (config !== null && config !== void 0 && (_config$context2 = config.context) !== null && _config$context2 !== void 0 && _config$context2.translationLocale) {
17408
+ locale = config.context.translationLocale;
17409
+ dispatch(enable(locale));
17381
17410
  }
17382
17411
  } catch (e) {
17383
17412
  if (e instanceof SeamlySessionExpiredError) {
@@ -18641,6 +18670,34 @@ const useFileUploads = () => {
18641
18670
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/trim.js
18642
18671
  var trim = __webpack_require__(5843);
18643
18672
  var trim_default = /*#__PURE__*/__webpack_require__.n(trim);
18673
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/utility-hooks.js
18674
+
18675
+
18676
+
18677
+ const useForceUpdate = () => {
18678
+ // This is an escape hatch mentioned in the React docs:
18679
+ // https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
18680
+
18681
+ /* eslint-disable-next-line no-unused-vars */
18682
+ const [ignored, forceUpdate] = hooks_module_p(x => x + 1, 0);
18683
+ return hooks_module_A(() => {
18684
+ set_timeout_default()(() => {
18685
+ forceUpdate();
18686
+ });
18687
+ }, []);
18688
+ };
18689
+ const useGeneratedId = () => {
18690
+ const [id] = l(() => randomId());
18691
+ return id;
18692
+ };
18693
+ const useStableCallback = callback => {
18694
+ const callbackRef = hooks_module_s();
18695
+ callbackRef.current = callback;
18696
+ const isFunction = typeof callback === 'function';
18697
+ return hooks_module_d(() => {
18698
+ return isFunction ? (...args) => callbackRef.current(...args) : undefined;
18699
+ }, [isFunction]);
18700
+ };
18644
18701
  ;// CONCATENATED MODULE: ./src/javascripts/domains/interrupt/selectors.js
18645
18702
 
18646
18703
 
@@ -18883,34 +18940,6 @@ const visibility_reducer_initialState = {
18883
18940
 
18884
18941
 
18885
18942
 
18886
- ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/utility-hooks.js
18887
-
18888
-
18889
-
18890
- const useForceUpdate = () => {
18891
- // This is an escape hatch mentioned in the React docs:
18892
- // https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
18893
-
18894
- /* eslint-disable-next-line no-unused-vars */
18895
- const [ignored, forceUpdate] = hooks_module_p(x => x + 1, 0);
18896
- return hooks_module_A(() => {
18897
- set_timeout_default()(() => {
18898
- forceUpdate();
18899
- });
18900
- }, []);
18901
- };
18902
- const useGeneratedId = () => {
18903
- const [id] = l(() => randomId());
18904
- return id;
18905
- };
18906
- const useStableCallback = callback => {
18907
- const callbackRef = hooks_module_s();
18908
- callbackRef.current = callback;
18909
- const isFunction = typeof callback === 'function';
18910
- return hooks_module_d(() => {
18911
- return isFunction ? (...args) => callbackRef.current(...args) : undefined;
18912
- }, [isFunction]);
18913
- };
18914
18943
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-seamly-commands.js
18915
18944
 
18916
18945
 
@@ -19742,29 +19771,6 @@ const app_reducer_initialState = {
19742
19771
 
19743
19772
 
19744
19773
 
19745
- ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/utils.js
19746
-
19747
- const {
19748
- createActions: translations_utils_createActions,
19749
- createReducer: translations_utils_createReducer,
19750
- selectState: translations_utils_selectState
19751
- } = createDomain('translations');
19752
- ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/actions.js
19753
-
19754
- const [enable, disable] = translations_utils_createActions('translate', {
19755
- enable: locale => ({
19756
- locale
19757
- }),
19758
- disable: () => ({})
19759
- });
19760
- const [enableEvent, disableEvent] = translations_utils_createActions('event', {
19761
- enable: payloadId => ({
19762
- payloadId
19763
- }),
19764
- disable: payloadId => ({
19765
- payloadId
19766
- })
19767
- });
19768
19774
  ;// CONCATENATED MODULE: ./src/javascripts/domains/redux/utils.js
19769
19775
 
19770
19776
 
@@ -20754,8 +20760,7 @@ function updateFormControl(state, formId, name, controlState) {
20754
20760
 
20755
20761
 
20756
20762
 
20757
- ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/form-utils.js
20758
-
20763
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/form-controls/form.js
20759
20764
 
20760
20765
 
20761
20766
 
@@ -20766,226 +20771,32 @@ function updateFormControl(state, formId, name, controlState) {
20766
20771
 
20767
20772
 
20768
20773
 
20774
+ const form_excluded = ["className", "disableValidationClasses"];
20769
20775
 
20776
+ function form_ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); if (enumerableOnly) { symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
20770
20777
 
20771
- function form_utils_ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
20778
+ function form_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; for_each_default()(_context = form_ownKeys(Object(source), true)).call(_context, function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if ((get_own_property_descriptors_default())) { define_properties_default()(target, get_own_property_descriptors_default()(source)); } else { var _context2; for_each_default()(_context2 = form_ownKeys(Object(source))).call(_context2, function (key) { define_property_default()(target, key, get_own_property_descriptor_default()(source, key)); }); } } return target; }
20772
20779
 
20773
- function form_utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context4; _forEachInstanceProperty(_context4 = form_utils_ownKeys(Object(source), true)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context5; _forEachInstanceProperty(_context5 = form_utils_ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
20774
20780
 
20775
- const formActions = {
20776
- REGISTER_FORM: 'REGISTER_FORM',
20777
- DE_REGISTER_FORM: 'DE_REGISTER_FORM',
20778
- REGISTER: 'REGISTER',
20779
- DE_REGISTER: 'DEREGISTER',
20780
- SET_VALUE: 'SET_VALUE',
20781
- SET_VALIDITY: 'SET_VALIDITY',
20782
- SET_STATE: 'SET_STATE',
20783
- SET_SUBMITTED: 'SET_SUBMITTED',
20784
- SET_PERSIST_FORM_DATA: 'SET_PERSIST_FORM_DATA'
20785
- };
20786
- const {
20787
- REGISTER_FORM,
20788
- DE_REGISTER_FORM,
20789
- REGISTER,
20790
- DE_REGISTER,
20791
- SET_VALUE,
20792
- SET_VALIDITY,
20793
- SET_STATE,
20794
- SET_SUBMITTED,
20795
- SET_PERSIST_FORM_DATA
20796
- } = formActions;
20797
- const getValidator = (fn, errorText, compareValue = null) => ({
20798
- fn,
20799
- errorText,
20800
- compareValue
20801
- });
20802
- const formReducer = (state, action) => {
20803
- var _context, _context2, _context3;
20804
20781
 
20805
- const {
20806
- formId,
20807
- name,
20808
- controlId,
20809
- value,
20810
- data,
20811
- validity,
20812
- errorText,
20813
- hasSubmitted,
20814
- persistData
20815
- } = action;
20816
20782
 
20817
- const setControls = controls => form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20818
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20819
- controls: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), controls)
20820
- })
20821
- });
20822
20783
 
20823
- switch (action.type) {
20824
- case REGISTER_FORM:
20825
- return form_utils_objectSpread({
20826
- [formId]: {
20827
- controls: {},
20828
- validity: true,
20829
- hasSubmitted: false,
20830
- persistData: false
20831
- }
20832
- }, state);
20784
+ function Form(_ref) {
20785
+ let {
20786
+ className: givenClassName,
20787
+ disableValidationClasses
20788
+ } = _ref,
20789
+ props = _objectWithoutProperties(_ref, form_excluded);
20833
20790
 
20834
- case DE_REGISTER_FORM:
20835
- const removedFormState = form_utils_objectSpread({}, state);
20791
+ const {
20792
+ handleSubmit,
20793
+ isValid,
20794
+ isSubmitted
20795
+ } = useForm();
20796
+ const formClasses = ['form'];
20836
20797
 
20837
- delete removedFormState[formId];
20838
- return removedFormState;
20839
-
20840
- case REGISTER:
20841
- const {
20842
- value: existingValue,
20843
- validity: existingValidity,
20844
- errorText: existingErrorText
20845
- } = state[formId].controls[name] || {};
20846
- return setControls({
20847
- [name]: {
20848
- controlId,
20849
- value: existingValue || value,
20850
- validity: existingValidity !== false,
20851
- errorText: existingErrorText || ''
20852
- }
20853
- });
20854
-
20855
- case DE_REGISTER:
20856
- const relatedForm = state[formId];
20857
-
20858
- if (!relatedForm) {
20859
- return state;
20860
- }
20861
-
20862
- const newControls = form_utils_objectSpread({}, relatedForm.controls);
20863
-
20864
- delete newControls[action.name];
20865
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20866
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, relatedForm), {}, {
20867
- controls: newControls
20868
- })
20869
- });
20870
-
20871
- case SET_VALUE:
20872
- return setControls({
20873
- [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
20874
- value
20875
- })
20876
- });
20877
-
20878
- case SET_VALIDITY:
20879
- const newControlValidities = form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), {}, {
20880
- [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
20881
- validity,
20882
- errorText
20883
- })
20884
- });
20885
-
20886
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20887
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20888
- controls: newControlValidities,
20889
- validity: _everyInstanceProperty(_context = _mapInstanceProperty(_context2 = _Object$keys(newControlValidities)).call(_context2, key => newControlValidities[key].validity)).call(_context, v => v)
20890
- })
20891
- });
20892
-
20893
- case SET_STATE:
20894
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20895
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20896
- controls: _reduceInstanceProperty(_context3 = _Object$keys(data)).call(_context3, (acc, key) => {
20897
- return form_utils_objectSpread(form_utils_objectSpread({}, acc), {}, {
20898
- [key]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[key]), {}, {
20899
- value: data[key],
20900
- validity: true,
20901
- errorText: ''
20902
- })
20903
- });
20904
- }, form_utils_objectSpread({}, state.controls))
20905
- })
20906
- });
20907
-
20908
- case SET_SUBMITTED:
20909
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20910
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20911
- hasSubmitted
20912
- })
20913
- });
20914
-
20915
- case SET_PERSIST_FORM_DATA:
20916
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20917
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20918
- persistData
20919
- })
20920
- });
20921
-
20922
- default:
20923
- return state;
20924
- }
20925
- };
20926
- ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/validations.js
20927
-
20928
- const validateFileSize = (fileList, maxSize) => {
20929
- let isValid = true;
20930
-
20931
- for (let i = 0; i < fileList.length; i++) {
20932
- if (fileList[i].size > maxSize) {
20933
- isValid = false;
20934
- }
20935
- }
20936
-
20937
- return isValid;
20938
- };
20939
- const fileListObjectIsNotEmpty = fileListObj => !!(fileListObj !== null && fileListObj !== void 0 && fileListObj.length) > 0;
20940
- /* eslint-disable no-control-regex */
20941
-
20942
- const isEmailString = val => {
20943
- const regex = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
20944
-
20945
- const trimmedVal = val && trim_default()(val).call(val);
20946
-
20947
- return !!(trimmedVal && trimmedVal.match(regex));
20948
- };
20949
- /* eslint-enable no-control-regex */
20950
-
20951
- const isNotEmptyString = val => !!val;
20952
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/form-controls/form.js
20953
-
20954
-
20955
-
20956
-
20957
-
20958
-
20959
-
20960
-
20961
-
20962
-
20963
- const form_excluded = ["className", "disableValidationClasses"];
20964
-
20965
- function form_ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); if (enumerableOnly) { symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
20966
-
20967
- function form_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; for_each_default()(_context = form_ownKeys(Object(source), true)).call(_context, function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if ((get_own_property_descriptors_default())) { define_properties_default()(target, get_own_property_descriptors_default()(source)); } else { var _context2; for_each_default()(_context2 = form_ownKeys(Object(source))).call(_context2, function (key) { define_property_default()(target, key, get_own_property_descriptor_default()(source, key)); }); } } return target; }
20968
-
20969
-
20970
-
20971
-
20972
-
20973
- function Form(_ref) {
20974
- let {
20975
- className: givenClassName,
20976
- disableValidationClasses
20977
- } = _ref,
20978
- props = _objectWithoutProperties(_ref, form_excluded);
20979
-
20980
- const {
20981
- handleSubmit,
20982
- isValid,
20983
- isSubmitted
20984
- } = useForm();
20985
- const formClasses = ['form'];
20986
-
20987
- if (!disableValidationClasses && isSubmitted) {
20988
- formClasses.push('form--submitted');
20798
+ if (!disableValidationClasses && isSubmitted) {
20799
+ formClasses.push('form--submitted');
20989
20800
 
20990
20801
  if (isValid) {
20991
20802
  formClasses.push('form--valid');
@@ -21175,54 +20986,249 @@ function TranslationsOptionsDialogForm({
21175
20986
  const languageName = hooks_module_d(() => {
21176
20987
  var _languages$find;
21177
20988
 
21178
- return languages === null || languages === void 0 ? void 0 : (_languages$find = find_default()(languages).call(languages, lang => lang.locale === currentLocale)) === null || _languages$find === void 0 ? void 0 : _languages$find.nativeName;
21179
- }, [languages, currentLocale]);
21180
- const options = hooks_module_d(() => {
21181
- var _context;
20989
+ return languages === null || languages === void 0 ? void 0 : (_languages$find = find_default()(languages).call(languages, lang => lang.locale === currentLocale)) === null || _languages$find === void 0 ? void 0 : _languages$find.nativeName;
20990
+ }, [languages, currentLocale]);
20991
+ const options = hooks_module_d(() => {
20992
+ var _context;
20993
+
20994
+ return [{
20995
+ value: '',
20996
+ label: t('translations.settings.defaultOptionLabel')
20997
+ }, ...map_default()(_context = filter_default()(languages).call(languages, language => language.locale.toLowerCase() !== String(uiLocale).toLowerCase())).call(_context, language => ({
20998
+ value: language.locale,
20999
+ label: language.nativeName
21000
+ }))];
21001
+ }, [t, languages, uiLocale]);
21002
+ return jsxRuntime_module_e(form_controls_form, {
21003
+ noValidate: "true",
21004
+ className: css_className('options__form'),
21005
+ children: [jsxRuntime_module_e("p", {
21006
+ className: css_className('options__description'),
21007
+ id: descriptionId,
21008
+ children: t('translations.settings.description')
21009
+ }), isActive ? jsxRuntime_module_e(d, {
21010
+ children: [jsxRuntime_module_e("h3", {
21011
+ children: t('translations.settings.currentTranslationLabel')
21012
+ }), jsxRuntime_module_e("p", {
21013
+ className: css_className('options__active-language'),
21014
+ children: languageName
21015
+ })]
21016
+ }) : jsxRuntime_module_e(form_controls_select, {
21017
+ name: controlName,
21018
+ type: "text",
21019
+ className: css_className('input__select'),
21020
+ "aria-describedby": descriptionId,
21021
+ labelClass: css_className('label'),
21022
+ labelText: t('translations.settings.inputLabel'),
21023
+ options: options,
21024
+ defaultValue: currentLocale || ''
21025
+ }), jsxRuntime_module_e("div", {
21026
+ className: css_className('options__actions'),
21027
+ children: jsxRuntime_module_e("button", {
21028
+ type: "submit",
21029
+ className: css_className('button', 'button--primary', 'options__submit'),
21030
+ children: isActive ? t('translations.settings.endButtonText') : t('translations.settings.startButtonText')
21031
+ })
21032
+ })]
21033
+ });
21034
+ }
21035
+
21036
+ /* harmony default export */ var options_dialog_form = (TranslationsOptionsDialogForm);
21037
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/form-utils.js
21038
+
21039
+
21040
+
21041
+
21042
+
21043
+
21044
+
21045
+
21046
+
21047
+
21048
+
21049
+
21050
+
21051
+ function form_utils_ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
21052
+
21053
+ function form_utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context4; _forEachInstanceProperty(_context4 = form_utils_ownKeys(Object(source), true)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context5; _forEachInstanceProperty(_context5 = form_utils_ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
21054
+
21055
+ const formActions = {
21056
+ REGISTER_FORM: 'REGISTER_FORM',
21057
+ DE_REGISTER_FORM: 'DE_REGISTER_FORM',
21058
+ REGISTER: 'REGISTER',
21059
+ DE_REGISTER: 'DEREGISTER',
21060
+ SET_VALUE: 'SET_VALUE',
21061
+ SET_VALIDITY: 'SET_VALIDITY',
21062
+ SET_STATE: 'SET_STATE',
21063
+ SET_SUBMITTED: 'SET_SUBMITTED',
21064
+ SET_PERSIST_FORM_DATA: 'SET_PERSIST_FORM_DATA'
21065
+ };
21066
+ const {
21067
+ REGISTER_FORM,
21068
+ DE_REGISTER_FORM,
21069
+ REGISTER,
21070
+ DE_REGISTER,
21071
+ SET_VALUE,
21072
+ SET_VALIDITY,
21073
+ SET_STATE,
21074
+ SET_SUBMITTED,
21075
+ SET_PERSIST_FORM_DATA
21076
+ } = formActions;
21077
+ const getValidator = (fn, errorText, compareValue = null) => ({
21078
+ fn,
21079
+ errorText,
21080
+ compareValue
21081
+ });
21082
+ const formReducer = (state, action) => {
21083
+ var _context, _context2, _context3;
21084
+
21085
+ const {
21086
+ formId,
21087
+ name,
21088
+ controlId,
21089
+ value,
21090
+ data,
21091
+ validity,
21092
+ errorText,
21093
+ hasSubmitted,
21094
+ persistData
21095
+ } = action;
21096
+
21097
+ const setControls = controls => form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21098
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21099
+ controls: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), controls)
21100
+ })
21101
+ });
21102
+
21103
+ switch (action.type) {
21104
+ case REGISTER_FORM:
21105
+ return form_utils_objectSpread({
21106
+ [formId]: {
21107
+ controls: {},
21108
+ validity: true,
21109
+ hasSubmitted: false,
21110
+ persistData: false
21111
+ }
21112
+ }, state);
21113
+
21114
+ case DE_REGISTER_FORM:
21115
+ const removedFormState = form_utils_objectSpread({}, state);
21116
+
21117
+ delete removedFormState[formId];
21118
+ return removedFormState;
21119
+
21120
+ case REGISTER:
21121
+ const {
21122
+ value: existingValue,
21123
+ validity: existingValidity,
21124
+ errorText: existingErrorText
21125
+ } = state[formId].controls[name] || {};
21126
+ return setControls({
21127
+ [name]: {
21128
+ controlId,
21129
+ value: existingValue || value,
21130
+ validity: existingValidity !== false,
21131
+ errorText: existingErrorText || ''
21132
+ }
21133
+ });
21134
+
21135
+ case DE_REGISTER:
21136
+ const relatedForm = state[formId];
21137
+
21138
+ if (!relatedForm) {
21139
+ return state;
21140
+ }
21141
+
21142
+ const newControls = form_utils_objectSpread({}, relatedForm.controls);
21143
+
21144
+ delete newControls[action.name];
21145
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21146
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, relatedForm), {}, {
21147
+ controls: newControls
21148
+ })
21149
+ });
21150
+
21151
+ case SET_VALUE:
21152
+ return setControls({
21153
+ [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
21154
+ value
21155
+ })
21156
+ });
21157
+
21158
+ case SET_VALIDITY:
21159
+ const newControlValidities = form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), {}, {
21160
+ [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
21161
+ validity,
21162
+ errorText
21163
+ })
21164
+ });
21165
+
21166
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21167
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21168
+ controls: newControlValidities,
21169
+ validity: _everyInstanceProperty(_context = _mapInstanceProperty(_context2 = _Object$keys(newControlValidities)).call(_context2, key => newControlValidities[key].validity)).call(_context, v => v)
21170
+ })
21171
+ });
21172
+
21173
+ case SET_STATE:
21174
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21175
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21176
+ controls: _reduceInstanceProperty(_context3 = _Object$keys(data)).call(_context3, (acc, key) => {
21177
+ return form_utils_objectSpread(form_utils_objectSpread({}, acc), {}, {
21178
+ [key]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[key]), {}, {
21179
+ value: data[key],
21180
+ validity: true,
21181
+ errorText: ''
21182
+ })
21183
+ });
21184
+ }, form_utils_objectSpread({}, state.controls))
21185
+ })
21186
+ });
21187
+
21188
+ case SET_SUBMITTED:
21189
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21190
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21191
+ hasSubmitted
21192
+ })
21193
+ });
21194
+
21195
+ case SET_PERSIST_FORM_DATA:
21196
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21197
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21198
+ persistData
21199
+ })
21200
+ });
21201
+
21202
+ default:
21203
+ return state;
21204
+ }
21205
+ };
21206
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/validations.js
21207
+
21208
+ const validateFileSize = (fileList, maxSize) => {
21209
+ let isValid = true;
21210
+
21211
+ for (let i = 0; i < fileList.length; i++) {
21212
+ if (fileList[i].size > maxSize) {
21213
+ isValid = false;
21214
+ }
21215
+ }
21216
+
21217
+ return isValid;
21218
+ };
21219
+ const fileListObjectIsNotEmpty = fileListObj => !!(fileListObj !== null && fileListObj !== void 0 && fileListObj.length) > 0;
21220
+ /* eslint-disable no-control-regex */
21221
+
21222
+ const isEmailString = val => {
21223
+ const regex = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
21224
+
21225
+ const trimmedVal = val && trim_default()(val).call(val);
21182
21226
 
21183
- return [{
21184
- value: '',
21185
- label: t('translations.settings.defaultOptionLabel')
21186
- }, ...map_default()(_context = filter_default()(languages).call(languages, language => language.locale.toLowerCase() !== String(uiLocale).toLowerCase())).call(_context, language => ({
21187
- value: language.locale,
21188
- label: language.nativeName
21189
- }))];
21190
- }, [t, languages, uiLocale]);
21191
- return jsxRuntime_module_e(form_controls_form, {
21192
- noValidate: "true",
21193
- className: css_className('options__form'),
21194
- children: [jsxRuntime_module_e("p", {
21195
- className: css_className('options__description'),
21196
- id: descriptionId,
21197
- children: t('translations.settings.description')
21198
- }), isActive ? jsxRuntime_module_e(d, {
21199
- children: [jsxRuntime_module_e("h3", {
21200
- children: t('translations.settings.currentTranslationLabel')
21201
- }), jsxRuntime_module_e("p", {
21202
- className: css_className('options__active-language'),
21203
- children: languageName
21204
- })]
21205
- }) : jsxRuntime_module_e(form_controls_select, {
21206
- name: controlName,
21207
- type: "text",
21208
- className: css_className('input__select'),
21209
- "aria-describedby": descriptionId,
21210
- labelClass: css_className('label'),
21211
- labelText: t('translations.settings.inputLabel'),
21212
- options: options,
21213
- defaultValue: currentLocale || ''
21214
- }), jsxRuntime_module_e("div", {
21215
- className: css_className('options__actions'),
21216
- children: jsxRuntime_module_e("button", {
21217
- type: "submit",
21218
- className: css_className('button', 'button--primary', 'options__submit'),
21219
- children: isActive ? t('translations.settings.endButtonText') : t('translations.settings.startButtonText')
21220
- })
21221
- })]
21222
- });
21223
- }
21227
+ return !!(trimmedVal && trimmedVal.match(regex));
21228
+ };
21229
+ /* eslint-enable no-control-regex */
21224
21230
 
21225
- /* harmony default export */ var options_dialog_form = (TranslationsOptionsDialogForm);
21231
+ const isNotEmptyString = val => !!val;
21226
21232
  ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/components/options-dialog/index.js
21227
21233
 
21228
21234
 
@@ -21854,36 +21860,6 @@ const Interrupt = ({
21854
21860
  };
21855
21861
 
21856
21862
  /* harmony default export */ var interrupt = (Interrupt);
21857
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/privacy-disclaimer.js
21858
-
21859
-
21860
-
21861
-
21862
-
21863
-
21864
- const PrivacyDisclaimer = () => {
21865
- const {
21866
- t
21867
- } = useI18n();
21868
- const {
21869
- showDisclaimer
21870
- } = useConfig();
21871
- return showDisclaimer && jsxRuntime_module_e("div", {
21872
- className: css_className('disclaimer'),
21873
- tabIndex: "0",
21874
- children: [jsxRuntime_module_e("h2", {
21875
- className: css_className('disclaimer__title'),
21876
- children: t('disclaimer.title')
21877
- }), jsxRuntime_module_e("div", {
21878
- className: css_className('disclaimer__message'),
21879
- dangerouslySetInnerHTML: {
21880
- __html: t('disclaimer.content')
21881
- }
21882
- })]
21883
- });
21884
- };
21885
-
21886
- /* harmony default export */ var privacy_disclaimer = (PrivacyDisclaimer);
21887
21863
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/component-context.js
21888
21864
 
21889
21865
  const ComponentContext = D({});
@@ -27781,6 +27757,95 @@ const Cta = ({
27781
27757
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/fill.js
27782
27758
  var fill = __webpack_require__(4494);
27783
27759
  var fill_default = /*#__PURE__*/__webpack_require__.n(fill);
27760
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js
27761
+
27762
+
27763
+
27764
+
27765
+ function CarouselPagination({
27766
+ items,
27767
+ currentIndex,
27768
+ onChange,
27769
+ getItemKey,
27770
+ getItemLabel
27771
+ }) {
27772
+ const itemCount = items.length;
27773
+ const handlePaginate = hooks_module_A(event => {
27774
+ const slideIndex = Number(event.target.dataset.item || '0');
27775
+ const nextIndex = Math.min(itemCount - 1, Math.max(0, slideIndex));
27776
+
27777
+ if (nextIndex !== currentIndex) {
27778
+ onChange(nextIndex);
27779
+ }
27780
+ }, [itemCount, currentIndex, onChange]);
27781
+ return jsxRuntime_module_e("div", {
27782
+ className: css_className('carousel-pagination__wrapper'),
27783
+ role: "group",
27784
+ children: jsxRuntime_module_e("ul", {
27785
+ className: css_className('carousel-pagination'),
27786
+ children: map_default()(items).call(items, (item, idx) => {
27787
+ const isActive = currentIndex === idx;
27788
+ return jsxRuntime_module_e("li", {
27789
+ className: css_className('carousel-pagination__item', isActive ? 'is-active' : undefined),
27790
+ children: jsxRuntime_module_e("button", {
27791
+ className: css_className('carousel-pagination__button'),
27792
+ type: "button",
27793
+ onClick: handlePaginate,
27794
+ "data-item": idx,
27795
+ "aria-disabled": isActive ? 'true' : undefined,
27796
+ "aria-label": getItemLabel(item, idx)
27797
+ })
27798
+ }, getItemKey(item, idx, 'pagination-item-'));
27799
+ })
27800
+ })
27801
+ });
27802
+ }
27803
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
27804
+
27805
+
27806
+
27807
+
27808
+
27809
+ function CarouselControls({
27810
+ items,
27811
+ currentIndex,
27812
+ onChange,
27813
+ children
27814
+ }) {
27815
+ const {
27816
+ t
27817
+ } = useI18n();
27818
+ const itemCount = items.length;
27819
+
27820
+ const handlePrevious = () => {
27821
+ onChange((currentIndex - 1 + itemCount) % itemCount);
27822
+ };
27823
+
27824
+ const handleNext = () => {
27825
+ onChange((currentIndex + 1) % itemCount);
27826
+ };
27827
+
27828
+ return jsxRuntime_module_e("div", {
27829
+ className: css_className('carousel-controls'),
27830
+ children: [jsxRuntime_module_e("button", {
27831
+ className: css_className('button', 'button--previous'),
27832
+ "aria-label": t('carousel.controls.previous'),
27833
+ onClick: handlePrevious,
27834
+ children: jsxRuntime_module_e(icon, {
27835
+ name: "arrowLeft",
27836
+ size: "16"
27837
+ })
27838
+ }), children, jsxRuntime_module_e("button", {
27839
+ className: css_className('button', 'button--next'),
27840
+ "aria-label": t('carousel.controls.next'),
27841
+ onClick: handleNext,
27842
+ children: jsxRuntime_module_e(icon, {
27843
+ name: "arrowRight",
27844
+ size: "16"
27845
+ })
27846
+ })]
27847
+ });
27848
+ }
27784
27849
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.js
27785
27850
 
27786
27851
 
@@ -27908,129 +27973,40 @@ const CardComponent = ({
27908
27973
 
27909
27974
 
27910
27975
 
27911
-
27912
-
27913
-
27914
-
27915
-
27916
- function slide_ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); if (enumerableOnly) { symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
27917
-
27918
- function slide_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; for_each_default()(_context = slide_ownKeys(Object(source), true)).call(_context, function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if ((get_own_property_descriptors_default())) { define_properties_default()(target, get_own_property_descriptors_default()(source)); } else { var _context2; for_each_default()(_context2 = slide_ownKeys(Object(source))).call(_context2, function (key) { define_property_default()(target, key, get_own_property_descriptor_default()(source, key)); }); } } return target; }
27919
-
27920
-
27921
-
27922
-
27923
-
27924
- function CarouselMessageSlide({
27925
- item: slide,
27926
- items,
27927
- index,
27928
- isActive
27929
- }) {
27930
- const {
27931
- t
27932
- } = useI18n();
27933
- return jsxRuntime_module_e("div", {
27934
- className: css_className('carousel-item', `carousel-item--${slide.type}`),
27935
- role: "group",
27936
- "aria-roledescription": "slide",
27937
- "aria-label": t('carousel.slide.label', {
27938
- index: index + 1,
27939
- total: items.length
27940
- }),
27941
- children: jsxRuntime_module_e(card_component, slide_objectSpread(slide_objectSpread({}, slide), {}, {
27942
- isCarouselItem: true,
27943
- hasFocus: isActive
27944
- }))
27945
- });
27946
- }
27947
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js
27948
-
27949
-
27950
-
27951
-
27952
- function CarouselPagination({
27953
- items,
27954
- currentIndex,
27955
- onChange,
27956
- getItemKey,
27957
- getItemLabel
27958
- }) {
27959
- const itemCount = items.length;
27960
- const handlePaginate = hooks_module_A(event => {
27961
- const slideIndex = Number(event.target.dataset.item || '0');
27962
- const nextIndex = Math.min(itemCount - 1, Math.max(0, slideIndex));
27963
-
27964
- if (nextIndex !== currentIndex) {
27965
- onChange(nextIndex);
27966
- }
27967
- }, [itemCount, currentIndex, onChange]);
27968
- return jsxRuntime_module_e("div", {
27969
- className: css_className('carousel-pagination__wrapper'),
27970
- role: "group",
27971
- children: jsxRuntime_module_e("ul", {
27972
- className: css_className('carousel-pagination'),
27973
- children: map_default()(items).call(items, (item, idx) => {
27974
- const isActive = currentIndex === idx;
27975
- return jsxRuntime_module_e("li", {
27976
- className: css_className('carousel-pagination__item', isActive ? 'is-active' : undefined),
27977
- children: jsxRuntime_module_e("button", {
27978
- className: css_className('carousel-pagination__button'),
27979
- type: "button",
27980
- onClick: handlePaginate,
27981
- "data-item": idx,
27982
- "aria-disabled": isActive ? 'true' : undefined,
27983
- "aria-label": getItemLabel(item, idx)
27984
- })
27985
- }, getItemKey(item, idx, 'pagination-item-'));
27986
- })
27987
- })
27988
- });
27989
- }
27990
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
27991
-
27992
-
27993
-
27994
-
27995
-
27996
- function CarouselControls({
27976
+
27977
+
27978
+
27979
+
27980
+
27981
+ function slide_ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); if (enumerableOnly) { symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
27982
+
27983
+ function slide_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; for_each_default()(_context = slide_ownKeys(Object(source), true)).call(_context, function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if ((get_own_property_descriptors_default())) { define_properties_default()(target, get_own_property_descriptors_default()(source)); } else { var _context2; for_each_default()(_context2 = slide_ownKeys(Object(source))).call(_context2, function (key) { define_property_default()(target, key, get_own_property_descriptor_default()(source, key)); }); } } return target; }
27984
+
27985
+
27986
+
27987
+
27988
+
27989
+ function CarouselMessageSlide({
27990
+ item: slide,
27997
27991
  items,
27998
- currentIndex,
27999
- onChange,
28000
- children
27992
+ index,
27993
+ isActive
28001
27994
  }) {
28002
27995
  const {
28003
27996
  t
28004
27997
  } = useI18n();
28005
- const itemCount = items.length;
28006
-
28007
- const handlePrevious = () => {
28008
- onChange((currentIndex - 1 + itemCount) % itemCount);
28009
- };
28010
-
28011
- const handleNext = () => {
28012
- onChange((currentIndex + 1) % itemCount);
28013
- };
28014
-
28015
27998
  return jsxRuntime_module_e("div", {
28016
- className: css_className('carousel-controls'),
28017
- children: [jsxRuntime_module_e("button", {
28018
- className: css_className('button', 'button--previous'),
28019
- "aria-label": t('carousel.controls.previous'),
28020
- onClick: handlePrevious,
28021
- children: jsxRuntime_module_e(icon, {
28022
- name: "arrowLeft",
28023
- size: "16"
28024
- })
28025
- }), children, jsxRuntime_module_e("button", {
28026
- className: css_className('button', 'button--next'),
28027
- "aria-label": t('carousel.controls.next'),
28028
- onClick: handleNext,
28029
- children: jsxRuntime_module_e(icon, {
28030
- name: "arrowRight",
28031
- size: "16"
28032
- })
28033
- })]
27999
+ className: css_className('carousel-item', `carousel-item--${slide.type}`),
28000
+ role: "group",
28001
+ "aria-roledescription": "slide",
28002
+ "aria-label": t('carousel.slide.label', {
28003
+ index: index + 1,
28004
+ total: items.length
28005
+ }),
28006
+ children: jsxRuntime_module_e(card_component, slide_objectSpread(slide_objectSpread({}, slide), {}, {
28007
+ isCarouselItem: true,
28008
+ hasFocus: isActive
28009
+ }))
28034
28010
  });
28035
28011
  }
28036
28012
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/index.js
@@ -28401,6 +28377,36 @@ const ComponentFilter = ({
28401
28377
  };
28402
28378
 
28403
28379
  /* harmony default export */ var component_filter = (ComponentFilter);
28380
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/privacy-disclaimer.js
28381
+
28382
+
28383
+
28384
+
28385
+
28386
+
28387
+ const PrivacyDisclaimer = () => {
28388
+ const {
28389
+ t
28390
+ } = useI18n();
28391
+ const {
28392
+ showDisclaimer
28393
+ } = useConfig();
28394
+ return showDisclaimer && jsxRuntime_module_e("div", {
28395
+ className: css_className('disclaimer'),
28396
+ tabIndex: "0",
28397
+ children: [jsxRuntime_module_e("h2", {
28398
+ className: css_className('disclaimer__title'),
28399
+ children: t('disclaimer.title')
28400
+ }), jsxRuntime_module_e("div", {
28401
+ className: css_className('disclaimer__message'),
28402
+ dangerouslySetInnerHTML: {
28403
+ __html: t('disclaimer.content')
28404
+ }
28405
+ })]
28406
+ });
28407
+ };
28408
+
28409
+ /* harmony default export */ var privacy_disclaimer = (PrivacyDisclaimer);
28404
28410
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/conversation.js
28405
28411
 
28406
28412
 
@@ -30407,53 +30413,6 @@ const View = () => {
30407
30413
  };
30408
30414
 
30409
30415
  /* harmony default export */ var view = (View);
30410
- ;// CONCATENATED MODULE: ./src/javascripts/domains/errors/index.js
30411
-
30412
-
30413
- const {
30414
- createAction: errors_createAction
30415
- } = createDomain('errors');
30416
- const catchError = errors_createAction('catch-error', error => ({
30417
- error
30418
- }));
30419
- function errors_createMiddleware({
30420
- api: seamlyApi
30421
- }) {
30422
- return ({
30423
- getState
30424
- }) => {
30425
- const handleError = action => {
30426
- const {
30427
- errorCallback,
30428
- namespace,
30429
- api,
30430
- layoutMode
30431
- } = selectConfig(getState());
30432
- errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
30433
- namespace,
30434
- api,
30435
- layoutMode,
30436
- conversationUrl: seamlyApi.getConversationUrl(),
30437
- action: action.type ? action : undefined
30438
- });
30439
- };
30440
-
30441
- return next => action => {
30442
- try {
30443
- if (action.error) {
30444
- handleError(action);
30445
- }
30446
-
30447
- return next(action);
30448
- } catch (error) {
30449
- handleError({
30450
- error
30451
- });
30452
- throw error;
30453
- }
30454
- };
30455
- };
30456
- }
30457
30416
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-instance-functions-loader.js
30458
30417
 
30459
30418
 
@@ -31345,6 +31304,53 @@ const SeamlyFileUpload = ({
31345
31304
  };
31346
31305
 
31347
31306
  /* harmony default export */ var seamly_file_upload = (SeamlyFileUpload);
31307
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/errors/index.js
31308
+
31309
+
31310
+ const {
31311
+ createAction: errors_createAction
31312
+ } = createDomain('errors');
31313
+ const catchError = errors_createAction('catch-error', error => ({
31314
+ error
31315
+ }));
31316
+ function errors_createMiddleware({
31317
+ api: seamlyApi
31318
+ }) {
31319
+ return ({
31320
+ getState
31321
+ }) => {
31322
+ const handleError = action => {
31323
+ const {
31324
+ errorCallback,
31325
+ namespace,
31326
+ api,
31327
+ layoutMode
31328
+ } = selectConfig(getState());
31329
+ errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
31330
+ namespace,
31331
+ api,
31332
+ layoutMode,
31333
+ conversationUrl: seamlyApi.getConversationUrl(),
31334
+ action: action.type ? action : undefined
31335
+ });
31336
+ };
31337
+
31338
+ return next => action => {
31339
+ try {
31340
+ if (action.error) {
31341
+ handleError(action);
31342
+ }
31343
+
31344
+ return next(action);
31345
+ } catch (error) {
31346
+ handleError({
31347
+ error
31348
+ });
31349
+ throw error;
31350
+ }
31351
+ };
31352
+ };
31353
+ }
31348
31354
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-core.js
31349
31355
 
31350
31356
 
@@ -31457,43 +31463,11 @@ function objectStore(key, storageProvider) {
31457
31463
 
31458
31464
  };
31459
31465
  }
31466
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-names.js
31467
+ var get_own_property_names = __webpack_require__(8604);
31460
31468
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/json/stringify.js
31461
31469
  var stringify = __webpack_require__(9340);
31462
31470
  var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);
31463
- ;// CONCATENATED MODULE: ./src/javascripts/lib/store/providers/session-storage.js
31464
-
31465
-
31466
- function store(key) {
31467
- const KEY = 'cvco.' + key;
31468
- return {
31469
- get() {
31470
- var _context;
31471
-
31472
- const candidates = [KEY, slice_default()(_context = KEY.split('.')).call(_context, 0, -1).join('.')];
31473
- let val;
31474
-
31475
- do {
31476
- val = sessionStorage.getItem(candidates[0]);
31477
- } while (candidates.shift() && !val);
31478
-
31479
- return JSON.parse(val);
31480
- },
31481
-
31482
- set(value) {
31483
- if (!value) {
31484
- return;
31485
- }
31486
-
31487
- sessionStorage.setItem(KEY, stringify_default()(value));
31488
- }
31489
-
31490
- };
31491
- }
31492
- // EXTERNAL MODULE: ./src/javascripts/lib/debug.js
31493
- var debug = __webpack_require__(1905);
31494
- var debug_default = /*#__PURE__*/__webpack_require__.n(debug);
31495
- // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-names.js
31496
- var get_own_property_names = __webpack_require__(8604);
31497
31471
  ;// CONCATENATED MODULE: ./node_modules/phoenix/priv/static/phoenix.esm.js
31498
31472
 
31499
31473
 
@@ -32995,6 +32969,9 @@ const splitUrlParams = url => {
32995
32969
  };
32996
32970
 
32997
32971
  /* harmony default export */ var split_url_params = (splitUrlParams);
32972
+ // EXTERNAL MODULE: ./src/javascripts/lib/debug.js
32973
+ var debug = __webpack_require__(1905);
32974
+ var debug_default = /*#__PURE__*/__webpack_require__.n(debug);
32998
32975
  ;// CONCATENATED MODULE: ./src/javascripts/api/producer.js
32999
32976
 
33000
32977
 
@@ -33166,6 +33143,35 @@ class ConversationProducer {
33166
33143
  }
33167
33144
 
33168
33145
  }
33146
+ ;// CONCATENATED MODULE: ./src/javascripts/lib/store/providers/session-storage.js
33147
+
33148
+
33149
+ function store(key) {
33150
+ const KEY = 'cvco.' + key;
33151
+ return {
33152
+ get() {
33153
+ var _context;
33154
+
33155
+ const candidates = [KEY, slice_default()(_context = KEY.split('.')).call(_context, 0, -1).join('.')];
33156
+ let val;
33157
+
33158
+ do {
33159
+ val = sessionStorage.getItem(candidates[0]);
33160
+ } while (candidates.shift() && !val);
33161
+
33162
+ return JSON.parse(val);
33163
+ },
33164
+
33165
+ set(value) {
33166
+ if (!value) {
33167
+ return;
33168
+ }
33169
+
33170
+ sessionStorage.setItem(KEY, stringify_default()(value));
33171
+ }
33172
+
33173
+ };
33174
+ }
33169
33175
  ;// CONCATENATED MODULE: ./src/javascripts/api/event-producer.js
33170
33176
  class EventProducer {
33171
33177
  constructor(name) {
@@ -33288,10 +33294,11 @@ class API {
33288
33294
  * @param {boolean} config.sendEnvironment
33289
33295
  * @param {string} layoutMode
33290
33296
  * @param {string} namespace
33291
- * @param {Object} [context={ channelName: undefined, variables: undefined, locale: undefined }]
33297
+ * @param {Object} [context={ channelName: undefined, variables: undefined, locale: undefined, translationLocale: undefined }]
33292
33298
  * @param {string} context.channelName
33293
33299
  * @param {object} context.variables
33294
33300
  * @param {string} context.locale
33301
+ * @param {string} context.translationLocale
33295
33302
  * @memberof API
33296
33303
  */
33297
33304
  constructor({
@@ -33628,6 +33635,7 @@ class API {
33628
33635
  sendContext(context = {}) {
33629
33636
  const {
33630
33637
  locale,
33638
+ translationLocale,
33631
33639
  variables
33632
33640
  } = context;
33633
33641
  const payload = {};
@@ -33640,6 +33648,14 @@ class API {
33640
33648
  payload.locale = locale;
33641
33649
  }
33642
33650
 
33651
+ if (translationLocale) {
33652
+ if (typeof translationLocale !== 'string') {
33653
+ throw new Error('Translation locale must be a string');
33654
+ }
33655
+
33656
+ payload.translationLocale = translationLocale;
33657
+ }
33658
+
33643
33659
  if (variables) {
33644
33660
  if (typeof variables !== 'object') {
33645
33661
  throw new Error('Variables must be an object');
@@ -33664,9 +33680,9 @@ class API {
33664
33680
 
33665
33681
  getEnvironment() {
33666
33682
  return {
33667
- clientName: PACKAGE_NAME,
33683
+ clientName: "@seamly/web-ui",
33668
33684
  clientVariant: this.layoutMode,
33669
- clientVersion: PACKAGE_VERSION,
33685
+ clientVersion: "20.2.0-alpha.1",
33670
33686
  currentUrl: window.location.toString(),
33671
33687
  screenResolution: `${window.screen.width}x${window.screen.height}`,
33672
33688
  timezone: getTimeZone(),