@seamly/web-ui 23.0.0-alpha.1 → 23.0.0-alpha.3

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 (39) hide show
  1. package/build/dist/lib/components.js +63 -76
  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 +60 -73
  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 +9 -9
  10. package/build/dist/lib/index.debug.min.js +1 -1
  11. package/build/dist/lib/index.debug.min.js.map +1 -1
  12. package/build/dist/lib/index.js +47 -64
  13. package/build/dist/lib/index.js.map +1 -1
  14. package/build/dist/lib/index.min.js +1 -1
  15. package/build/dist/lib/index.min.js.map +1 -1
  16. package/build/dist/lib/standalone.js +57 -75
  17. package/build/dist/lib/standalone.js.map +1 -1
  18. package/build/dist/lib/standalone.min.js +1 -1
  19. package/build/dist/lib/standalone.min.js.map +1 -1
  20. package/build/dist/lib/style-guide.js +56 -69
  21. package/build/dist/lib/style-guide.js.map +1 -1
  22. package/build/dist/lib/style-guide.min.js +1 -1
  23. package/build/dist/lib/style-guide.min.js.map +1 -1
  24. package/build/dist/lib/utils.js +68 -100
  25. package/build/dist/lib/utils.js.map +1 -1
  26. package/build/dist/lib/utils.min.js +1 -1
  27. package/build/dist/lib/utils.min.js.map +1 -1
  28. package/package.json +1 -1
  29. package/src/javascripts/api/index.ts +2 -18
  30. package/src/javascripts/domains/app/actions.ts +5 -2
  31. package/src/javascripts/domains/config/actions.ts +3 -0
  32. package/src/javascripts/domains/config/slice.ts +3 -0
  33. package/src/javascripts/domains/i18n/slice.ts +1 -1
  34. package/src/javascripts/domains/translations/components/options-dialog/translation-options.tsx +1 -1
  35. package/src/javascripts/domains/translations/hooks.ts +1 -1
  36. package/src/javascripts/domains/translations/middleware.ts +5 -9
  37. package/src/javascripts/domains/translations/slice.ts +2 -2
  38. package/src/javascripts/style-guide/states.js +4 -0
  39. package/src/javascripts/style-guide/style-guide-engine.js +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.debug.min.js","mappings":";mz34BAAAA,EAAOC,QAAUC,QAAQ,4CCAzBF,EAAOC,QAAUC,QAAQ,kDCAzBF,EAAOC,QAAUC,QAAQ,uDCAzBF,EAAOC,QAAUC,QAAQ,kioUCCrBC,yBAA2B,CAAC,EAGhC,SAASC,oBAAoBC,GAE5B,IAAIC,EAAeH,yBAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaL,QAGrB,IAAID,EAASG,yBAAyBE,GAAY,CAGjDJ,QAAS,CAAC,GAOX,OAHAO,oBAAoBH,GAAUI,KAAKT,EAAOC,QAASD,EAAQA,EAAOC,QAASG,qBAGpEJ,EAAOC,OACf,CCrBAG,oBAAoBM,EAAKV,IACxB,IAAIW,EAASX,GAAUA,EAAOY,WAC7B,IAAOZ,EAAiB,QACxB,IAAM,EAEP,OADAI,oBAAoBS,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdP,oBAAoBS,EAAI,CAACZ,EAASc,KACjC,IAAI,IAAIC,KAAOD,EACXX,oBAAoBa,EAAEF,EAAYC,KAASZ,oBAAoBa,EAAEhB,EAASe,IAC5EE,OAAOC,eAAelB,EAASe,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDZ,oBAAoBkB,EAAI,WACvB,GAA0B,iBAAfC,WAAyB,OAAOA,WAC3C,IACC,OAAOC,MAAQ,IAAIC,SAAS,cAAb,EAChB,CAAE,MAAOC,GACR,GAAsB,iBAAXC,OAAqB,OAAOA,MACxC,CACA,CAPuB,GCAxBvB,oBAAoBa,EAAI,CAACW,EAAKC,IAAUX,OAAOY,UAAUC,eAAetB,KAAKmB,EAAKC,GCClFzB,oBAAoB4B,EAAK/B,IACH,oBAAXgC,QAA0BA,OAAOC,aAC1ChB,OAAOC,eAAelB,EAASgC,OAAOC,YAAa,CAAEC,MAAO,WAE7DjB,OAAOC,eAAelB,EAAS,aAAc,CAAEkC,OAAO,GAAO,QCL9D,IAAIC,EACAhC,oBAAoBkB,EAAEe,gBAAeD,EAAYhC,oBAAoBkB,EAAEgB,SAAW,IACtF,IAAIC,EAAWnC,oBAAoBkB,EAAEiB,SACrC,IAAKH,GAAaG,IACbA,EAASC,gBACZJ,EAAYG,EAASC,cAAcC,MAC/BL,GAAW,CACf,IAAIM,EAAUH,EAASI,qBAAqB,UAC5C,GAAGD,EAAQE,OAEV,IADA,IAAIC,EAAIH,EAAQE,OAAS,EAClBC,GAAK,IAAMT,GAAWA,EAAYM,EAAQG,KAAKJ,GAExD,CAID,IAAKL,EAAW,MAAM,IAAIU,MAAM,yDAChCV,EAAYA,EAAUW,QAAQ,OAAQ,IAAIA,QAAQ,QAAS,IAAIA,QAAQ,YAAa,KACpF3C,oBAAoB4C,EAAIZ,MCfxB,IAAIa,oBAAsB7C,oBAAoB","sources":["webpack:///external commonjs2 \"preact\"","webpack:///external commonjs2 \"preact/compat\"","webpack:///external commonjs2 \"preact/hooks\"","webpack:///external commonjs2 \"preact/jsx-runtime\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/global","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///webpack/runtime/publicPath","webpack:///webpack/startup"],"sourcesContent":["module.exports = require(\"preact\");","module.exports = require(\"preact/compat\");","module.exports = require(\"preact/hooks\");","module.exports = require(\"preact/jsx-runtime\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// startup\n// Load entry module and return exports\n// This entry module can't be inlined because the eval devtool is used.\nvar __webpack_exports__ = __webpack_require__(\"./src/javascripts/index.ts\");\n"],"names":["module","exports","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","call","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","this","Function","e","window","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","value","scriptUrl","importScripts","location","document","currentScript","src","scripts","getElementsByTagName","length","i","Error","replace","p","__webpack_exports__"],"sourceRoot":""}
1
+ {"version":3,"file":"index.debug.min.js","mappings":";4q14BAAAA,EAAOC,QAAUC,QAAQ,4CCAzBF,EAAOC,QAAUC,QAAQ,kDCAzBF,EAAOC,QAAUC,QAAQ,uDCAzBF,EAAOC,QAAUC,QAAQ,kioUCCrBC,yBAA2B,CAAC,EAGhC,SAASC,oBAAoBC,GAE5B,IAAIC,EAAeH,yBAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaL,QAGrB,IAAID,EAASG,yBAAyBE,GAAY,CAGjDJ,QAAS,CAAC,GAOX,OAHAO,oBAAoBH,GAAUI,KAAKT,EAAOC,QAASD,EAAQA,EAAOC,QAASG,qBAGpEJ,EAAOC,OACf,CCrBAG,oBAAoBM,EAAKV,IACxB,IAAIW,EAASX,GAAUA,EAAOY,WAC7B,IAAOZ,EAAiB,QACxB,IAAM,EAEP,OADAI,oBAAoBS,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdP,oBAAoBS,EAAI,CAACZ,EAASc,KACjC,IAAI,IAAIC,KAAOD,EACXX,oBAAoBa,EAAEF,EAAYC,KAASZ,oBAAoBa,EAAEhB,EAASe,IAC5EE,OAAOC,eAAelB,EAASe,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDZ,oBAAoBkB,EAAI,WACvB,GAA0B,iBAAfC,WAAyB,OAAOA,WAC3C,IACC,OAAOC,MAAQ,IAAIC,SAAS,cAAb,EAChB,CAAE,MAAOC,GACR,GAAsB,iBAAXC,OAAqB,OAAOA,MACxC,CACA,CAPuB,GCAxBvB,oBAAoBa,EAAI,CAACW,EAAKC,IAAUX,OAAOY,UAAUC,eAAetB,KAAKmB,EAAKC,GCClFzB,oBAAoB4B,EAAK/B,IACH,oBAAXgC,QAA0BA,OAAOC,aAC1ChB,OAAOC,eAAelB,EAASgC,OAAOC,YAAa,CAAEC,MAAO,WAE7DjB,OAAOC,eAAelB,EAAS,aAAc,CAAEkC,OAAO,GAAO,QCL9D,IAAIC,EACAhC,oBAAoBkB,EAAEe,gBAAeD,EAAYhC,oBAAoBkB,EAAEgB,SAAW,IACtF,IAAIC,EAAWnC,oBAAoBkB,EAAEiB,SACrC,IAAKH,GAAaG,IACbA,EAASC,gBACZJ,EAAYG,EAASC,cAAcC,MAC/BL,GAAW,CACf,IAAIM,EAAUH,EAASI,qBAAqB,UAC5C,GAAGD,EAAQE,OAEV,IADA,IAAIC,EAAIH,EAAQE,OAAS,EAClBC,GAAK,IAAMT,GAAWA,EAAYM,EAAQG,KAAKJ,GAExD,CAID,IAAKL,EAAW,MAAM,IAAIU,MAAM,yDAChCV,EAAYA,EAAUW,QAAQ,OAAQ,IAAIA,QAAQ,QAAS,IAAIA,QAAQ,YAAa,KACpF3C,oBAAoB4C,EAAIZ,MCfxB,IAAIa,oBAAsB7C,oBAAoB","sources":["webpack:///external commonjs2 \"preact\"","webpack:///external commonjs2 \"preact/compat\"","webpack:///external commonjs2 \"preact/hooks\"","webpack:///external commonjs2 \"preact/jsx-runtime\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/global","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///webpack/runtime/publicPath","webpack:///webpack/startup"],"sourcesContent":["module.exports = require(\"preact\");","module.exports = require(\"preact/compat\");","module.exports = require(\"preact/hooks\");","module.exports = require(\"preact/jsx-runtime\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// startup\n// Load entry module and return exports\n// This entry module can't be inlined because the eval devtool is used.\nvar __webpack_exports__ = __webpack_require__(\"./src/javascripts/index.ts\");\n"],"names":["module","exports","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","call","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","this","Function","e","window","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","value","scriptUrl","importScripts","location","document","currentScript","src","scripts","getElementsByTagName","length","i","Error","replace","p","__webpack_exports__"],"sourceRoot":""}
@@ -4122,14 +4122,6 @@ var api_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet ||
4122
4122
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4123
4123
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
4124
4124
  };
4125
- var __rest = undefined && undefined.__rest || function (s, e) {
4126
- var t = {};
4127
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
4128
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
4129
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
4130
- }
4131
- return t;
4132
- };
4133
4125
  var _API_instances, _API_ready, _API_externalId, _API_conversationAuthToken, _API_layoutMode, _API_config, _API_getAccessToken, _API_setAccessToken, _API_setConversationUrl, _API_getChannelTopic, _API_setChannelTopic, _API_getLocale, _API_getUrlPrefix, _API_updateUrls, _API_createConversation;
4134
4126
 
4135
4127
 
@@ -4219,7 +4211,7 @@ class API {
4219
4211
  _API_config.set(this, void 0);
4220
4212
  this.conversation = new conversation_connector();
4221
4213
  _API_getLocale.set(this, locale => locale || this.locale);
4222
- this.store = objectStore(`${namespace}.connection${context.contentLocale ? `.${context.contentLocale}` : ''}`, config.storageProvider || store);
4214
+ this.store = objectStore(`${namespace}.connection${context.userLocale ? `.${context.userLocale}` : ''}`, config.storageProvider || store);
4223
4215
  this.connectionInfo = {
4224
4216
  apiKey: config.key,
4225
4217
  domain: config.domain || DOMAIN,
@@ -4485,7 +4477,6 @@ class API {
4485
4477
  this.conversation.pushToChannel(command, buildPayload(command, payload), 10000);
4486
4478
  }
4487
4479
  sendContext(context) {
4488
- var _a, _b;
4489
4480
  const {
4490
4481
  contentLocale,
4491
4482
  userLocale,
@@ -4518,23 +4509,13 @@ class API {
4518
4509
  if (Object.keys(payload).length === 0 && payload.constructor === Object) {
4519
4510
  return;
4520
4511
  }
4521
- // Destructure the server locale from the payload
4522
- const {
4523
- contentLocale: _
4524
- } = payload,
4525
- restPayload = __rest(payload, ["contentLocale"]);
4526
- const localContentLocale = (_a = api_classPrivateFieldGet(this, _API_config, "f").context) === null || _a === void 0 ? void 0 : _a.contentLocale;
4527
- const localUserLocale = (_b = api_classPrivateFieldGet(this, _API_config, "f").context) === null || _b === void 0 ? void 0 : _b.userLocale;
4528
- this.send('context', Object.assign(Object.assign({}, localContentLocale ? {
4529
- contentLocale: localContentLocale,
4530
- userLocale: localUserLocale
4531
- } : {}), restPayload), false);
4512
+ this.send('context', payload, false);
4532
4513
  }
4533
4514
  getEnvironment() {
4534
4515
  return {
4535
4516
  clientName: "@seamly/web-ui",
4536
4517
  clientVariant: api_classPrivateFieldGet(this, _API_layoutMode, "f"),
4537
- clientVersion: "23.0.0-alpha.1",
4518
+ clientVersion: "22.3.6",
4538
4519
  currentUrl: window.location.toString(),
4539
4520
  screenResolution: `${window.screen.width}x${window.screen.height}`,
4540
4521
  timezone: getTimeZone(),
@@ -8989,7 +8970,7 @@ const initializeConfig = createAsyncThunk('initializeConfig', (_, {
8989
8970
  },
8990
8971
  rejectWithValue
8991
8972
  }) => actions_awaiter(void 0, void 0, void 0, function* () {
8992
- var _a;
8973
+ var _a, _b;
8993
8974
  try {
8994
8975
  const {
8995
8976
  features,
@@ -8999,7 +8980,8 @@ const initializeConfig = createAsyncThunk('initializeConfig', (_, {
8999
8980
  userParticipant,
9000
8981
  startChatIcon
9001
8982
  } = yield api.getConfig();
9002
- const defaultContentLocale = ((_a = config === null || config === void 0 ? void 0 : config.context) === null || _a === void 0 ? void 0 : _a.contentLocale) || defaultLocale;
8983
+ const defaultUserLocale = ((_a = config === null || config === void 0 ? void 0 : config.context) === null || _a === void 0 ? void 0 : _a.userLocale) || defaultLocale;
8984
+ const defaultContentLocale = ((_b = config === null || config === void 0 ? void 0 : config.context) === null || _b === void 0 ? void 0 : _b.contentLocale) || defaultLocale;
9003
8985
  const {
9004
8986
  connectWhenInView
9005
8987
  } = config;
@@ -9010,6 +8992,7 @@ const initializeConfig = createAsyncThunk('initializeConfig', (_, {
9010
8992
  agentParticipant,
9011
8993
  userParticipant,
9012
8994
  startChatIcon,
8995
+ defaultUserLocale,
9013
8996
  defaultContentLocale,
9014
8997
  connectWhenInView
9015
8998
  };
@@ -10517,12 +10500,14 @@ const initializeApp = createAsyncThunk('initializeApp', (_, {
10517
10500
  rejectWithValue
10518
10501
  }) => app_actions_awaiter(void 0, void 0, void 0, function* () {
10519
10502
  var _a, _b, _c;
10520
- const contentLocale = (_a = config === null || config === void 0 ? void 0 : config.context) === null || _a === void 0 ? void 0 : _a.contentLocale;
10521
- const userLocale = (_b = config === null || config === void 0 ? void 0 : config.context) === null || _b === void 0 ? void 0 : _b.userLocale;
10503
+ let contentLocale = (_a = config === null || config === void 0 ? void 0 : config.context) === null || _a === void 0 ? void 0 : _a.contentLocale;
10504
+ let userLocale = (_b = config === null || config === void 0 ? void 0 : config.context) === null || _b === void 0 ? void 0 : _b.userLocale;
10522
10505
  const environment = config.api.sendEnvironment !== false ? api.getEnvironment() : config.api.sendEnvironment;
10523
10506
  try {
10524
10507
  if (api.hasConversation()) {
10525
10508
  const initialState = yield api.getConversationIntitialState();
10509
+ contentLocale = initialState.context.contentLocale || contentLocale;
10510
+ userLocale = initialState.context.userLocale || userLocale;
10526
10511
  api.sendContext(Object.assign(Object.assign({}, initialState.context), {
10527
10512
  environment
10528
10513
  }));
@@ -10591,7 +10576,7 @@ const resetApp = create_debounced_async_thunk('resetApp', (_, {
10591
10576
  leading: true
10592
10577
  });
10593
10578
  ;// CONCATENATED MODULE: ./src/javascripts/domains/config/slice.ts
10594
- var slice_rest = undefined && undefined.__rest || function (s, e) {
10579
+ var __rest = undefined && undefined.__rest || function (s, e) {
10595
10580
  var t = {};
10596
10581
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
10597
10582
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -10635,7 +10620,7 @@ const updateState = (state, config) => {
10635
10620
  {
10636
10621
  messages
10637
10622
  } = _a,
10638
- partialConfig = slice_rest(_a, ["messages"]);
10623
+ partialConfig = __rest(_a, ["messages"]);
10639
10624
  let newState = state;
10640
10625
  if (Object.keys(partialConfig).length > 0) {
10641
10626
  newState = Object.assign(Object.assign({}, newState), partialConfig);
@@ -10670,6 +10655,7 @@ const configSlice = createSlice({
10670
10655
  agentParticipant,
10671
10656
  userParticipant,
10672
10657
  startChatIcon,
10658
+ defaultUserLocale,
10673
10659
  defaultContentLocale
10674
10660
  }
10675
10661
  }) => {
@@ -10678,6 +10664,7 @@ const configSlice = createSlice({
10678
10664
  type: 'message',
10679
10665
  payload
10680
10666
  }));
10667
+ state.context.userLocale = defaultUserLocale;
10681
10668
  state.context.contentLocale = defaultContentLocale;
10682
10669
  state.agentParticipant = agentParticipant;
10683
10670
  state.userParticipant = userParticipant;
@@ -11018,7 +11005,7 @@ const i18nSlice = createSlice({
11018
11005
  builder.addCase(resetApp.pending, () => i18n_slice_initialState).addCase(initializeConfig.fulfilled, (state, {
11019
11006
  payload
11020
11007
  }) => {
11021
- state.initialLocale = payload.defaultContentLocale;
11008
+ state.initialLocale = payload.defaultUserLocale;
11022
11009
  }).addCase(setLocale.pending, state => {
11023
11010
  state.isLoading = true;
11024
11011
  }).addCase(setLocale.rejected, state => {
@@ -11806,28 +11793,6 @@ function createOptionsMiddleware({
11806
11793
  return result;
11807
11794
  };
11808
11795
  }
11809
- ;// CONCATENATED MODULE: ./src/javascripts/domains/i18n/selectors.ts
11810
-
11811
- const selectTranslations = createSelector(({
11812
- i18n
11813
- }) => i18n, ({
11814
- translations
11815
- }) => translations);
11816
- const selectInitialLocale = createSelector(({
11817
- i18n
11818
- }) => i18n, ({
11819
- initialLocale
11820
- }) => initialLocale);
11821
- const selectLocale = createSelector(({
11822
- i18n
11823
- }) => i18n, ({
11824
- userLocale
11825
- }) => userLocale);
11826
- const selectIsLoading = createSelector(({
11827
- i18n
11828
- }) => i18n, ({
11829
- isLoading
11830
- }) => isLoading);
11831
11796
  ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/slice.ts
11832
11797
 
11833
11798
 
@@ -11932,8 +11897,8 @@ const translationSlice = createSlice({
11932
11897
  if (!feature) return;
11933
11898
  state.isAvailable = feature.enabled === true;
11934
11899
  state.languages = [...feature.languages].sort((a, b) => {
11935
- if (a.locale === payload.defaultContentLocale) return -1;
11936
- if (b.locale === payload.defaultContentLocale) return 1;
11900
+ if (a.locale === payload.defaultUserLocale) return -1;
11901
+ if (b.locale === payload.defaultUserLocale) return 1;
11937
11902
  return a.nativeName.localeCompare(b.nativeName, undefined, {
11938
11903
  sensitivity: 'base'
11939
11904
  });
@@ -11970,7 +11935,6 @@ const {
11970
11935
 
11971
11936
 
11972
11937
 
11973
-
11974
11938
  const createI18nMiddleware = ({
11975
11939
  dispatch,
11976
11940
  getState
@@ -11987,13 +11951,15 @@ const createI18nMiddleware = ({
11987
11951
  }
11988
11952
  }
11989
11953
  if (initializeConfig.fulfilled.match(action)) {
11990
- if (action.payload.defaultContentLocale) {
11991
- dispatch(setLocale(action.payload.defaultContentLocale));
11954
+ if (action.payload.defaultUserLocale) {
11955
+ dispatch(setLocale(action.payload.defaultUserLocale));
11992
11956
  return result;
11993
11957
  }
11994
11958
  }
11995
11959
  if (initializeApp.fulfilled.match(action)) {
11996
- dispatch(setLocale(action.payload.contentLocale));
11960
+ if (action.payload.userLocale) {
11961
+ dispatch(setLocale(action.payload.userLocale));
11962
+ }
11997
11963
  return result;
11998
11964
  }
11999
11965
  if (addEvent.match(action)) {
@@ -12002,11 +11968,6 @@ const createI18nMiddleware = ({
12002
11968
  return result;
12003
11969
  }
12004
11970
  }
12005
- if (disableTranslation.match(action)) {
12006
- const initialLocale = selectInitialLocale(getState());
12007
- dispatch(setLocale(initialLocale));
12008
- return result;
12009
- }
12010
11971
  return result;
12011
11972
  };
12012
11973
  };
@@ -12805,6 +12766,28 @@ function selectTypeHandler(value) {
12805
12766
 
12806
12767
  //# sourceMappingURL=icu-message-formatter.es.js.map
12807
12768
 
12769
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/i18n/selectors.ts
12770
+
12771
+ const selectTranslations = createSelector(({
12772
+ i18n
12773
+ }) => i18n, ({
12774
+ translations
12775
+ }) => translations);
12776
+ const selectInitialLocale = createSelector(({
12777
+ i18n
12778
+ }) => i18n, ({
12779
+ initialLocale
12780
+ }) => initialLocale);
12781
+ const selectLocale = createSelector(({
12782
+ i18n
12783
+ }) => i18n, ({
12784
+ userLocale
12785
+ }) => userLocale);
12786
+ const selectIsLoading = createSelector(({
12787
+ i18n
12788
+ }) => i18n, ({
12789
+ isLoading
12790
+ }) => isLoading);
12808
12791
  ;// CONCATENATED MODULE: ./src/javascripts/domains/i18n/hooks.ts
12809
12792
 
12810
12793
 
@@ -13918,7 +13901,7 @@ function useTranslations() {
13918
13901
  }, [sendContext]);
13919
13902
  const disableTranslations = (0,hooks_.useCallback)(() => {
13920
13903
  sendContext({
13921
- userLocale: config.context.userLocale
13904
+ userLocale: config.context.contentLocale
13922
13905
  });
13923
13906
  dispatch(disableTranslation());
13924
13907
  }, [config.context, dispatch, sendContext]);
@@ -19152,7 +19135,7 @@ const TranslationOption = ({ label, checked, description, onChange, id, itemClas
19152
19135
 
19153
19136
  const isChecked = (language, currentLocale, isOriginal) => currentLocale === language.locale || (!currentLocale && isOriginal);
19154
19137
  const TranslationOptions = ({ onChange, describedById, }) => {
19155
- const { context: { contentLocale }, } = useConfig();
19138
+ const { context: { userLocale, contentLocale }, } = useConfig();
19156
19139
  const { t } = useI18n();
19157
19140
  const { languages, currentLocale, enableTranslations, disableTranslations } = useTranslations();
19158
19141
  const focusSkiplinkTarget = useSkiplinkTargetFocusing();