@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
|
@@ -2754,7 +2754,7 @@ class API {
|
|
|
2754
2754
|
return {
|
|
2755
2755
|
clientName: "@seamly/web-ui",
|
|
2756
2756
|
clientVariant: api_classPrivateFieldGet(this, _API_layoutMode, "f"),
|
|
2757
|
-
clientVersion: "23.0.0-alpha.
|
|
2757
|
+
clientVersion: "23.0.0-alpha.2",
|
|
2758
2758
|
currentUrl: window.location.toString(),
|
|
2759
2759
|
screenResolution: `${window.screen.width}x${window.screen.height}`,
|
|
2760
2760
|
timezone: getTimeZone(),
|
|
@@ -8737,12 +8737,14 @@ const initializeApp = createAsyncThunk('initializeApp', (_, {
|
|
|
8737
8737
|
rejectWithValue
|
|
8738
8738
|
}) => app_actions_awaiter(void 0, void 0, void 0, function* () {
|
|
8739
8739
|
var _a, _b, _c;
|
|
8740
|
-
|
|
8741
|
-
|
|
8740
|
+
let contentLocale = (_a = config === null || config === void 0 ? void 0 : config.context) === null || _a === void 0 ? void 0 : _a.contentLocale;
|
|
8741
|
+
let userLocale = (_b = config === null || config === void 0 ? void 0 : config.context) === null || _b === void 0 ? void 0 : _b.userLocale;
|
|
8742
8742
|
const environment = config.api.sendEnvironment !== false ? api.getEnvironment() : config.api.sendEnvironment;
|
|
8743
8743
|
try {
|
|
8744
8744
|
if (api.hasConversation()) {
|
|
8745
8745
|
const initialState = yield api.getConversationIntitialState();
|
|
8746
|
+
contentLocale = initialState.context.contentLocale || contentLocale;
|
|
8747
|
+
userLocale = initialState.context.userLocale || userLocale;
|
|
8746
8748
|
api.sendContext(Object.assign(Object.assign({}, initialState.context), {
|
|
8747
8749
|
environment
|
|
8748
8750
|
}));
|
|
@@ -10213,7 +10215,9 @@ const createI18nMiddleware = ({
|
|
|
10213
10215
|
}
|
|
10214
10216
|
}
|
|
10215
10217
|
if (initializeApp.fulfilled.match(action)) {
|
|
10216
|
-
|
|
10218
|
+
if (action.payload.contentLocale) {
|
|
10219
|
+
dispatch(setLocale(action.payload.contentLocale));
|
|
10220
|
+
}
|
|
10217
10221
|
return result;
|
|
10218
10222
|
}
|
|
10219
10223
|
if (addEvent.match(action)) {
|
|
@@ -17372,12 +17376,12 @@ const TranslationOption = ({ label, checked, description, onChange, id, itemClas
|
|
|
17372
17376
|
|
|
17373
17377
|
const isChecked = (language, currentLocale, isOriginal) => currentLocale === language.locale || (!currentLocale && isOriginal);
|
|
17374
17378
|
const TranslationOptions = ({ onChange, describedById, }) => {
|
|
17375
|
-
const { context: { contentLocale }, } = useConfig();
|
|
17379
|
+
const { context: { userLocale, contentLocale }, } = useConfig();
|
|
17376
17380
|
const { t } = useI18n();
|
|
17377
17381
|
const { languages, currentLocale, enableTranslations, disableTranslations } = useTranslations();
|
|
17378
17382
|
const focusSkiplinkTarget = useSkiplinkTargetFocusing();
|
|
17379
17383
|
const handleChange = (locale) => () => {
|
|
17380
|
-
if (locale === currentLocale ||
|
|
17384
|
+
if (locale === currentLocale || userLocale === locale) {
|
|
17381
17385
|
disableTranslations();
|
|
17382
17386
|
}
|
|
17383
17387
|
else {
|