@seamly/web-ui 23.0.0-alpha.2 → 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.
- package/build/dist/lib/components.js +58 -75
- package/build/dist/lib/components.js.map +1 -1
- package/build/dist/lib/components.min.js +1 -1
- package/build/dist/lib/components.min.js.map +1 -1
- package/build/dist/lib/hooks.js +55 -72
- package/build/dist/lib/hooks.js.map +1 -1
- package/build/dist/lib/hooks.min.js +1 -1
- package/build/dist/lib/hooks.min.js.map +1 -1
- package/build/dist/lib/index.debug.js +8 -8
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +42 -63
- package/build/dist/lib/index.js.map +1 -1
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/standalone.js +52 -74
- package/build/dist/lib/standalone.js.map +1 -1
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +51 -68
- package/build/dist/lib/style-guide.js.map +1 -1
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.map +1 -1
- package/build/dist/lib/utils.js +63 -99
- package/build/dist/lib/utils.js.map +1 -1
- package/build/dist/lib/utils.min.js +1 -1
- package/build/dist/lib/utils.min.js.map +1 -1
- package/package.json +1 -1
- package/src/javascripts/api/index.ts +2 -18
- package/src/javascripts/domains/config/actions.ts +3 -0
- package/src/javascripts/domains/config/slice.ts +3 -0
- package/src/javascripts/domains/i18n/slice.ts +1 -1
- package/src/javascripts/domains/translations/components/options-dialog/translation-options.tsx +1 -1
- package/src/javascripts/domains/translations/hooks.ts +1 -1
- package/src/javascripts/domains/translations/middleware.ts +4 -10
- package/src/javascripts/domains/translations/slice.ts +2 -2
- package/src/javascripts/style-guide/states.js +4 -0
- package/src/javascripts/style-guide/style-guide-engine.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.debug.min.js","mappings":";
|
|
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":""}
|
package/build/dist/lib/index.js
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
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: "
|
|
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
|
|
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
|
};
|
|
@@ -10593,7 +10576,7 @@ const resetApp = create_debounced_async_thunk('resetApp', (_, {
|
|
|
10593
10576
|
leading: true
|
|
10594
10577
|
});
|
|
10595
10578
|
;// CONCATENATED MODULE: ./src/javascripts/domains/config/slice.ts
|
|
10596
|
-
var
|
|
10579
|
+
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
10597
10580
|
var t = {};
|
|
10598
10581
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
10599
10582
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -10637,7 +10620,7 @@ const updateState = (state, config) => {
|
|
|
10637
10620
|
{
|
|
10638
10621
|
messages
|
|
10639
10622
|
} = _a,
|
|
10640
|
-
partialConfig =
|
|
10623
|
+
partialConfig = __rest(_a, ["messages"]);
|
|
10641
10624
|
let newState = state;
|
|
10642
10625
|
if (Object.keys(partialConfig).length > 0) {
|
|
10643
10626
|
newState = Object.assign(Object.assign({}, newState), partialConfig);
|
|
@@ -10672,6 +10655,7 @@ const configSlice = createSlice({
|
|
|
10672
10655
|
agentParticipant,
|
|
10673
10656
|
userParticipant,
|
|
10674
10657
|
startChatIcon,
|
|
10658
|
+
defaultUserLocale,
|
|
10675
10659
|
defaultContentLocale
|
|
10676
10660
|
}
|
|
10677
10661
|
}) => {
|
|
@@ -10680,6 +10664,7 @@ const configSlice = createSlice({
|
|
|
10680
10664
|
type: 'message',
|
|
10681
10665
|
payload
|
|
10682
10666
|
}));
|
|
10667
|
+
state.context.userLocale = defaultUserLocale;
|
|
10683
10668
|
state.context.contentLocale = defaultContentLocale;
|
|
10684
10669
|
state.agentParticipant = agentParticipant;
|
|
10685
10670
|
state.userParticipant = userParticipant;
|
|
@@ -11020,7 +11005,7 @@ const i18nSlice = createSlice({
|
|
|
11020
11005
|
builder.addCase(resetApp.pending, () => i18n_slice_initialState).addCase(initializeConfig.fulfilled, (state, {
|
|
11021
11006
|
payload
|
|
11022
11007
|
}) => {
|
|
11023
|
-
state.initialLocale = payload.
|
|
11008
|
+
state.initialLocale = payload.defaultUserLocale;
|
|
11024
11009
|
}).addCase(setLocale.pending, state => {
|
|
11025
11010
|
state.isLoading = true;
|
|
11026
11011
|
}).addCase(setLocale.rejected, state => {
|
|
@@ -11808,28 +11793,6 @@ function createOptionsMiddleware({
|
|
|
11808
11793
|
return result;
|
|
11809
11794
|
};
|
|
11810
11795
|
}
|
|
11811
|
-
;// CONCATENATED MODULE: ./src/javascripts/domains/i18n/selectors.ts
|
|
11812
|
-
|
|
11813
|
-
const selectTranslations = createSelector(({
|
|
11814
|
-
i18n
|
|
11815
|
-
}) => i18n, ({
|
|
11816
|
-
translations
|
|
11817
|
-
}) => translations);
|
|
11818
|
-
const selectInitialLocale = createSelector(({
|
|
11819
|
-
i18n
|
|
11820
|
-
}) => i18n, ({
|
|
11821
|
-
initialLocale
|
|
11822
|
-
}) => initialLocale);
|
|
11823
|
-
const selectLocale = createSelector(({
|
|
11824
|
-
i18n
|
|
11825
|
-
}) => i18n, ({
|
|
11826
|
-
userLocale
|
|
11827
|
-
}) => userLocale);
|
|
11828
|
-
const selectIsLoading = createSelector(({
|
|
11829
|
-
i18n
|
|
11830
|
-
}) => i18n, ({
|
|
11831
|
-
isLoading
|
|
11832
|
-
}) => isLoading);
|
|
11833
11796
|
;// CONCATENATED MODULE: ./src/javascripts/domains/translations/slice.ts
|
|
11834
11797
|
|
|
11835
11798
|
|
|
@@ -11934,8 +11897,8 @@ const translationSlice = createSlice({
|
|
|
11934
11897
|
if (!feature) return;
|
|
11935
11898
|
state.isAvailable = feature.enabled === true;
|
|
11936
11899
|
state.languages = [...feature.languages].sort((a, b) => {
|
|
11937
|
-
if (a.locale === payload.
|
|
11938
|
-
if (b.locale === payload.
|
|
11900
|
+
if (a.locale === payload.defaultUserLocale) return -1;
|
|
11901
|
+
if (b.locale === payload.defaultUserLocale) return 1;
|
|
11939
11902
|
return a.nativeName.localeCompare(b.nativeName, undefined, {
|
|
11940
11903
|
sensitivity: 'base'
|
|
11941
11904
|
});
|
|
@@ -11972,7 +11935,6 @@ const {
|
|
|
11972
11935
|
|
|
11973
11936
|
|
|
11974
11937
|
|
|
11975
|
-
|
|
11976
11938
|
const createI18nMiddleware = ({
|
|
11977
11939
|
dispatch,
|
|
11978
11940
|
getState
|
|
@@ -11989,14 +11951,14 @@ const createI18nMiddleware = ({
|
|
|
11989
11951
|
}
|
|
11990
11952
|
}
|
|
11991
11953
|
if (initializeConfig.fulfilled.match(action)) {
|
|
11992
|
-
if (action.payload.
|
|
11993
|
-
dispatch(setLocale(action.payload.
|
|
11954
|
+
if (action.payload.defaultUserLocale) {
|
|
11955
|
+
dispatch(setLocale(action.payload.defaultUserLocale));
|
|
11994
11956
|
return result;
|
|
11995
11957
|
}
|
|
11996
11958
|
}
|
|
11997
11959
|
if (initializeApp.fulfilled.match(action)) {
|
|
11998
|
-
if (action.payload.
|
|
11999
|
-
dispatch(setLocale(action.payload.
|
|
11960
|
+
if (action.payload.userLocale) {
|
|
11961
|
+
dispatch(setLocale(action.payload.userLocale));
|
|
12000
11962
|
}
|
|
12001
11963
|
return result;
|
|
12002
11964
|
}
|
|
@@ -12006,11 +11968,6 @@ const createI18nMiddleware = ({
|
|
|
12006
11968
|
return result;
|
|
12007
11969
|
}
|
|
12008
11970
|
}
|
|
12009
|
-
if (disableTranslation.match(action)) {
|
|
12010
|
-
const initialLocale = selectInitialLocale(getState());
|
|
12011
|
-
dispatch(setLocale(initialLocale));
|
|
12012
|
-
return result;
|
|
12013
|
-
}
|
|
12014
11971
|
return result;
|
|
12015
11972
|
};
|
|
12016
11973
|
};
|
|
@@ -12809,6 +12766,28 @@ function selectTypeHandler(value) {
|
|
|
12809
12766
|
|
|
12810
12767
|
//# sourceMappingURL=icu-message-formatter.es.js.map
|
|
12811
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);
|
|
12812
12791
|
;// CONCATENATED MODULE: ./src/javascripts/domains/i18n/hooks.ts
|
|
12813
12792
|
|
|
12814
12793
|
|
|
@@ -13922,7 +13901,7 @@ function useTranslations() {
|
|
|
13922
13901
|
}, [sendContext]);
|
|
13923
13902
|
const disableTranslations = (0,hooks_.useCallback)(() => {
|
|
13924
13903
|
sendContext({
|
|
13925
|
-
userLocale: config.context.
|
|
13904
|
+
userLocale: config.context.contentLocale
|
|
13926
13905
|
});
|
|
13927
13906
|
dispatch(disableTranslation());
|
|
13928
13907
|
}, [config.context, dispatch, sendContext]);
|
|
@@ -19161,7 +19140,7 @@ const TranslationOptions = ({ onChange, describedById, }) => {
|
|
|
19161
19140
|
const { languages, currentLocale, enableTranslations, disableTranslations } = useTranslations();
|
|
19162
19141
|
const focusSkiplinkTarget = useSkiplinkTargetFocusing();
|
|
19163
19142
|
const handleChange = (locale) => () => {
|
|
19164
|
-
if (locale === currentLocale ||
|
|
19143
|
+
if (locale === currentLocale || contentLocale === locale) {
|
|
19165
19144
|
disableTranslations();
|
|
19166
19145
|
}
|
|
19167
19146
|
else {
|