@seamly/web-ui 23.0.0-alpha.1 → 23.0.0-alpha.2
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 +9 -5
- 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 +7 -3
- 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 +4 -4
- 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 +10 -6
- 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 +10 -6
- 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 +10 -6
- 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 +10 -6
- 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/domains/app/actions.ts +5 -2
- package/src/javascripts/domains/translations/components/options-dialog/translation-options.tsx +2 -2
- package/src/javascripts/domains/translations/middleware.ts +3 -1
|
@@ -1911,12 +1911,14 @@ const initializeApp = (0,redux_toolkit_modern/* createAsyncThunk */.aw)('initial
|
|
|
1911
1911
|
rejectWithValue
|
|
1912
1912
|
}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1913
1913
|
var _a, _b, _c;
|
|
1914
|
-
|
|
1915
|
-
|
|
1914
|
+
let contentLocale = (_a = config === null || config === void 0 ? void 0 : config.context) === null || _a === void 0 ? void 0 : _a.contentLocale;
|
|
1915
|
+
let userLocale = (_b = config === null || config === void 0 ? void 0 : config.context) === null || _b === void 0 ? void 0 : _b.userLocale;
|
|
1916
1916
|
const environment = config.api.sendEnvironment !== false ? api.getEnvironment() : config.api.sendEnvironment;
|
|
1917
1917
|
try {
|
|
1918
1918
|
if (api.hasConversation()) {
|
|
1919
1919
|
const initialState = yield api.getConversationIntitialState();
|
|
1920
|
+
contentLocale = initialState.context.contentLocale || contentLocale;
|
|
1921
|
+
userLocale = initialState.context.userLocale || userLocale;
|
|
1920
1922
|
api.sendContext(Object.assign(Object.assign({}, initialState.context), {
|
|
1921
1923
|
environment
|
|
1922
1924
|
}));
|
|
@@ -3763,7 +3765,9 @@ const middleware_createI18nMiddleware = ({
|
|
|
3763
3765
|
}
|
|
3764
3766
|
}
|
|
3765
3767
|
if (initializeApp.fulfilled.match(action)) {
|
|
3766
|
-
|
|
3768
|
+
if (action.payload.contentLocale) {
|
|
3769
|
+
dispatch(setLocale(action.payload.contentLocale));
|
|
3770
|
+
}
|
|
3767
3771
|
return result;
|
|
3768
3772
|
}
|
|
3769
3773
|
if (addEvent.match(action)) {
|
|
@@ -18260,12 +18264,12 @@ const TranslationOption = ({ label, checked, description, onChange, id, itemClas
|
|
|
18260
18264
|
|
|
18261
18265
|
const isChecked = (language, currentLocale, isOriginal) => currentLocale === language.locale || (!currentLocale && isOriginal);
|
|
18262
18266
|
const TranslationOptions = ({ onChange, describedById, }) => {
|
|
18263
|
-
const { context: { contentLocale }, } = (0,config_hooks/* useConfig */.EV)();
|
|
18267
|
+
const { context: { userLocale, contentLocale }, } = (0,config_hooks/* useConfig */.EV)();
|
|
18264
18268
|
const { t } = (0,hooks/* useI18n */.g)();
|
|
18265
18269
|
const { languages, currentLocale, enableTranslations, disableTranslations } = (0,translations_hooks/* useTranslations */.A1)();
|
|
18266
18270
|
const focusSkiplinkTarget = (0,focus_helper_hooks/* useSkiplinkTargetFocusing */.e6)();
|
|
18267
18271
|
const handleChange = (locale) => () => {
|
|
18268
|
-
if (locale === currentLocale ||
|
|
18272
|
+
if (locale === currentLocale || userLocale === locale) {
|
|
18269
18273
|
disableTranslations();
|
|
18270
18274
|
}
|
|
18271
18275
|
else {
|