@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
package/build/dist/lib/utils.js
CHANGED
|
@@ -1919,12 +1919,14 @@ const initializeApp = (0,redux_toolkit_modern/* createAsyncThunk */.aw)('initial
|
|
|
1919
1919
|
rejectWithValue
|
|
1920
1920
|
}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1921
1921
|
var _a, _b, _c;
|
|
1922
|
-
|
|
1923
|
-
|
|
1922
|
+
let contentLocale = (_a = config === null || config === void 0 ? void 0 : config.context) === null || _a === void 0 ? void 0 : _a.contentLocale;
|
|
1923
|
+
let userLocale = (_b = config === null || config === void 0 ? void 0 : config.context) === null || _b === void 0 ? void 0 : _b.userLocale;
|
|
1924
1924
|
const environment = config.api.sendEnvironment !== false ? api.getEnvironment() : config.api.sendEnvironment;
|
|
1925
1925
|
try {
|
|
1926
1926
|
if (api.hasConversation()) {
|
|
1927
1927
|
const initialState = yield api.getConversationIntitialState();
|
|
1928
|
+
contentLocale = initialState.context.contentLocale || contentLocale;
|
|
1929
|
+
userLocale = initialState.context.userLocale || userLocale;
|
|
1928
1930
|
api.sendContext(Object.assign(Object.assign({}, initialState.context), {
|
|
1929
1931
|
environment
|
|
1930
1932
|
}));
|
|
@@ -3776,7 +3778,9 @@ const createI18nMiddleware = ({
|
|
|
3776
3778
|
}
|
|
3777
3779
|
}
|
|
3778
3780
|
if (actions/* initializeApp */.m.fulfilled.match(action)) {
|
|
3779
|
-
|
|
3781
|
+
if (action.payload.contentLocale) {
|
|
3782
|
+
dispatch((0,i18n_actions/* setLocale */.K)(action.payload.contentLocale));
|
|
3783
|
+
}
|
|
3780
3784
|
return result;
|
|
3781
3785
|
}
|
|
3782
3786
|
if (store_slice/* addEvent */.Ux.match(action)) {
|
|
@@ -13808,7 +13812,7 @@ class API {
|
|
|
13808
13812
|
return {
|
|
13809
13813
|
clientName: "@seamly/web-ui",
|
|
13810
13814
|
clientVariant: __classPrivateFieldGet(this, _API_layoutMode, "f"),
|
|
13811
|
-
clientVersion: "23.0.0-alpha.
|
|
13815
|
+
clientVersion: "23.0.0-alpha.2",
|
|
13812
13816
|
currentUrl: window.location.toString(),
|
|
13813
13817
|
screenResolution: `${window.screen.width}x${window.screen.height}`,
|
|
13814
13818
|
timezone: getTimeZone(),
|
|
@@ -18680,12 +18684,12 @@ const TranslationOption = ({ label, checked, description, onChange, id, itemClas
|
|
|
18680
18684
|
|
|
18681
18685
|
const isChecked = (language, currentLocale, isOriginal) => currentLocale === language.locale || (!currentLocale && isOriginal);
|
|
18682
18686
|
const TranslationOptions = ({ onChange, describedById, }) => {
|
|
18683
|
-
const { context: { contentLocale }, } = (0,hooks/* useConfig */.EV)();
|
|
18687
|
+
const { context: { userLocale, contentLocale }, } = (0,hooks/* useConfig */.EV)();
|
|
18684
18688
|
const { t } = (0,i18n_hooks/* useI18n */.g)();
|
|
18685
18689
|
const { languages, currentLocale, enableTranslations, disableTranslations } = (0,translations_hooks/* useTranslations */.A1)();
|
|
18686
18690
|
const focusSkiplinkTarget = (0,focus_helper_hooks/* useSkiplinkTargetFocusing */.e6)();
|
|
18687
18691
|
const handleChange = (locale) => () => {
|
|
18688
|
-
if (locale === currentLocale ||
|
|
18692
|
+
if (locale === currentLocale || userLocale === locale) {
|
|
18689
18693
|
disableTranslations();
|
|
18690
18694
|
}
|
|
18691
18695
|
else {
|