@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.
@@ -13823,7 +13823,7 @@ class API {
13823
13823
  return {
13824
13824
  clientName: "@seamly/web-ui",
13825
13825
  clientVariant: api_classPrivateFieldGet(this, _API_layoutMode, "f"),
13826
- clientVersion: "23.0.0-alpha.1",
13826
+ clientVersion: "23.0.0-alpha.2",
13827
13827
  currentUrl: window.location.toString(),
13828
13828
  screenResolution: `${window.screen.width}x${window.screen.height}`,
13829
13829
  timezone: getTimeZone(),
@@ -19820,12 +19820,14 @@ const initializeApp = createAsyncThunk('initializeApp', (_, {
19820
19820
  rejectWithValue
19821
19821
  }) => app_actions_awaiter(void 0, void 0, void 0, function* () {
19822
19822
  var _a, _b, _c;
19823
- const contentLocale = (_a = config === null || config === void 0 ? void 0 : config.context) === null || _a === void 0 ? void 0 : _a.contentLocale;
19824
- const userLocale = (_b = config === null || config === void 0 ? void 0 : config.context) === null || _b === void 0 ? void 0 : _b.userLocale;
19823
+ let contentLocale = (_a = config === null || config === void 0 ? void 0 : config.context) === null || _a === void 0 ? void 0 : _a.contentLocale;
19824
+ let userLocale = (_b = config === null || config === void 0 ? void 0 : config.context) === null || _b === void 0 ? void 0 : _b.userLocale;
19825
19825
  const environment = config.api.sendEnvironment !== false ? api.getEnvironment() : config.api.sendEnvironment;
19826
19826
  try {
19827
19827
  if (api.hasConversation()) {
19828
19828
  const initialState = yield api.getConversationIntitialState();
19829
+ contentLocale = initialState.context.contentLocale || contentLocale;
19830
+ userLocale = initialState.context.userLocale || userLocale;
19829
19831
  api.sendContext(assign_default()(assign_default()({}, initialState.context), {
19830
19832
  environment
19831
19833
  }));
@@ -21354,7 +21356,9 @@ const createI18nMiddleware = ({
21354
21356
  }
21355
21357
  }
21356
21358
  if (initializeApp.fulfilled.match(action)) {
21357
- dispatch(setLocale(action.payload.contentLocale));
21359
+ if (action.payload.contentLocale) {
21360
+ dispatch(setLocale(action.payload.contentLocale));
21361
+ }
21358
21362
  return result;
21359
21363
  }
21360
21364
  if (addEvent.match(action)) {
@@ -28607,12 +28611,12 @@ const TranslationOption = ({ label, checked, description, onChange, id, itemClas
28607
28611
 
28608
28612
  const isChecked = (language, currentLocale, isOriginal) => currentLocale === language.locale || (!currentLocale && isOriginal);
28609
28613
  const TranslationOptions = ({ onChange, describedById, }) => {
28610
- const { context: { contentLocale }, } = useConfig();
28614
+ const { context: { userLocale, contentLocale }, } = useConfig();
28611
28615
  const { t } = useI18n();
28612
28616
  const { languages, currentLocale, enableTranslations, disableTranslations } = useTranslations();
28613
28617
  const focusSkiplinkTarget = useSkiplinkTargetFocusing();
28614
28618
  const handleChange = (locale) => () => {
28615
- if (locale === currentLocale || contentLocale === locale) {
28619
+ if (locale === currentLocale || userLocale === locale) {
28616
28620
  disableTranslations();
28617
28621
  }
28618
28622
  else {