@commercetools-frontend/constants 27.13.0 → 27.15.0

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.
@@ -9,7 +9,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e };
9
9
  var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
10
10
 
11
11
  // NOTE: This string will be replaced on build time with the package version.
12
- var version = "27.13.0";
12
+ var version = "27.15.0";
13
13
 
14
14
  /**
15
15
  * The project key must be between 2 and 36 characters long. It can only contain alphanumeric lowercase characters (a-z, 0-9),
@@ -128,7 +128,8 @@ const MC_API_PROXY_TARGETS = {
128
128
  IMPORT: 'import',
129
129
  EXPORT: 'export',
130
130
  STANDALONE_PRICES_SEARCH: 'standalone-prices-search',
131
- STORES_SEARCGH: 'stores-search'
131
+ STORES_SEARCGH: 'stores-search',
132
+ CATEGORY_AUTOCOMPLETE: 'category-autocomplete'
132
133
  };
133
134
 
134
135
  /** Development-only navbar group header for the local menuLinks cache. */
@@ -192,7 +193,11 @@ const STORAGE_KEYS = {
192
193
  SELECTED_DATA_LOCALE: 'selectedDataLocale',
193
194
  IS_FORCED_MENU_OPEN: 'isForcedMenuOpen',
194
195
  LOGIN_STRATEGY: 'loginStrategy',
195
- ACTIVE_USER_LANGUAGE: 'activeUserLanguage'
196
+ ACTIVE_USER_LANGUAGE: 'activeUserLanguage',
197
+ // Last known `user.language`, used only to guess the locale before
198
+ // `FetchLoggedInUser` resolves. Distinct from ACTIVE_USER_LANGUAGE, which is
199
+ // the staff-bar override.
200
+ LAST_USER_LANGUAGE: 'lastUserLanguage'
196
201
  };
197
202
  const HTTP_SECURITY_HEADER_KEYS = {
198
203
  'Content-Security-Policy': 'Content-Security-Policy',
@@ -245,7 +250,12 @@ const PERFORMANCE_MARKS = {
245
250
  INTL_READY: `${PERFORMANCE_MARK_PREFIX}intl-ready`,
246
251
  CONTENT_RENDERED: `${PERFORMANCE_MARK_PREFIX}content-rendered`,
247
252
  HYDRATION_USER: `${PERFORMANCE_MARK_PREFIX}hydration-user`,
248
- HYDRATION_PROJECT: `${PERFORMANCE_MARK_PREFIX}hydration-project`
253
+ HYDRATION_PROJECT: `${PERFORMANCE_MARK_PREFIX}hydration-project`,
254
+ // Whether the parse-time locale hint resolved to the same catalogue as
255
+ // `user.language`. Both map through `mapLocaleToIntlLocale`, so only a
256
+ // bucket crossing counts as a miss.
257
+ LOCALE_HINT_HIT: `${PERFORMANCE_MARK_PREFIX}locale-hint-hit`,
258
+ LOCALE_HINT_MISS: `${PERFORMANCE_MARK_PREFIX}locale-hint-miss`
249
259
  };
250
260
 
251
261
  /*
@@ -9,7 +9,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e };
9
9
  var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
10
10
 
11
11
  // NOTE: This string will be replaced on build time with the package version.
12
- var version = "27.13.0";
12
+ var version = "27.15.0";
13
13
 
14
14
  /**
15
15
  * The project key must be between 2 and 36 characters long. It can only contain alphanumeric lowercase characters (a-z, 0-9),
@@ -128,7 +128,8 @@ const MC_API_PROXY_TARGETS = {
128
128
  IMPORT: 'import',
129
129
  EXPORT: 'export',
130
130
  STANDALONE_PRICES_SEARCH: 'standalone-prices-search',
131
- STORES_SEARCGH: 'stores-search'
131
+ STORES_SEARCGH: 'stores-search',
132
+ CATEGORY_AUTOCOMPLETE: 'category-autocomplete'
132
133
  };
133
134
 
134
135
  /** Development-only navbar group header for the local menuLinks cache. */
@@ -192,7 +193,11 @@ const STORAGE_KEYS = {
192
193
  SELECTED_DATA_LOCALE: 'selectedDataLocale',
193
194
  IS_FORCED_MENU_OPEN: 'isForcedMenuOpen',
194
195
  LOGIN_STRATEGY: 'loginStrategy',
195
- ACTIVE_USER_LANGUAGE: 'activeUserLanguage'
196
+ ACTIVE_USER_LANGUAGE: 'activeUserLanguage',
197
+ // Last known `user.language`, used only to guess the locale before
198
+ // `FetchLoggedInUser` resolves. Distinct from ACTIVE_USER_LANGUAGE, which is
199
+ // the staff-bar override.
200
+ LAST_USER_LANGUAGE: 'lastUserLanguage'
196
201
  };
197
202
  const HTTP_SECURITY_HEADER_KEYS = {
198
203
  'Content-Security-Policy': 'Content-Security-Policy',
@@ -245,7 +250,12 @@ const PERFORMANCE_MARKS = {
245
250
  INTL_READY: `${PERFORMANCE_MARK_PREFIX}intl-ready`,
246
251
  CONTENT_RENDERED: `${PERFORMANCE_MARK_PREFIX}content-rendered`,
247
252
  HYDRATION_USER: `${PERFORMANCE_MARK_PREFIX}hydration-user`,
248
- HYDRATION_PROJECT: `${PERFORMANCE_MARK_PREFIX}hydration-project`
253
+ HYDRATION_PROJECT: `${PERFORMANCE_MARK_PREFIX}hydration-project`,
254
+ // Whether the parse-time locale hint resolved to the same catalogue as
255
+ // `user.language`. Both map through `mapLocaleToIntlLocale`, so only a
256
+ // bucket crossing counts as a miss.
257
+ LOCALE_HINT_HIT: `${PERFORMANCE_MARK_PREFIX}locale-hint-hit`,
258
+ LOCALE_HINT_MISS: `${PERFORMANCE_MARK_PREFIX}locale-hint-miss`
249
259
  };
250
260
 
251
261
  /*
@@ -1,7 +1,7 @@
1
1
  import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
2
2
 
3
3
  // NOTE: This string will be replaced on build time with the package version.
4
- var version = "27.13.0";
4
+ var version = "27.15.0";
5
5
 
6
6
  /**
7
7
  * The project key must be between 2 and 36 characters long. It can only contain alphanumeric lowercase characters (a-z, 0-9),
@@ -120,7 +120,8 @@ const MC_API_PROXY_TARGETS = {
120
120
  IMPORT: 'import',
121
121
  EXPORT: 'export',
122
122
  STANDALONE_PRICES_SEARCH: 'standalone-prices-search',
123
- STORES_SEARCGH: 'stores-search'
123
+ STORES_SEARCGH: 'stores-search',
124
+ CATEGORY_AUTOCOMPLETE: 'category-autocomplete'
124
125
  };
125
126
 
126
127
  /** Development-only navbar group header for the local menuLinks cache. */
@@ -184,7 +185,11 @@ const STORAGE_KEYS = {
184
185
  SELECTED_DATA_LOCALE: 'selectedDataLocale',
185
186
  IS_FORCED_MENU_OPEN: 'isForcedMenuOpen',
186
187
  LOGIN_STRATEGY: 'loginStrategy',
187
- ACTIVE_USER_LANGUAGE: 'activeUserLanguage'
188
+ ACTIVE_USER_LANGUAGE: 'activeUserLanguage',
189
+ // Last known `user.language`, used only to guess the locale before
190
+ // `FetchLoggedInUser` resolves. Distinct from ACTIVE_USER_LANGUAGE, which is
191
+ // the staff-bar override.
192
+ LAST_USER_LANGUAGE: 'lastUserLanguage'
188
193
  };
189
194
  const HTTP_SECURITY_HEADER_KEYS = {
190
195
  'Content-Security-Policy': 'Content-Security-Policy',
@@ -237,7 +242,12 @@ const PERFORMANCE_MARKS = {
237
242
  INTL_READY: `${PERFORMANCE_MARK_PREFIX}intl-ready`,
238
243
  CONTENT_RENDERED: `${PERFORMANCE_MARK_PREFIX}content-rendered`,
239
244
  HYDRATION_USER: `${PERFORMANCE_MARK_PREFIX}hydration-user`,
240
- HYDRATION_PROJECT: `${PERFORMANCE_MARK_PREFIX}hydration-project`
245
+ HYDRATION_PROJECT: `${PERFORMANCE_MARK_PREFIX}hydration-project`,
246
+ // Whether the parse-time locale hint resolved to the same catalogue as
247
+ // `user.language`. Both map through `mapLocaleToIntlLocale`, so only a
248
+ // bucket crossing counts as a miss.
249
+ LOCALE_HINT_HIT: `${PERFORMANCE_MARK_PREFIX}locale-hint-hit`,
250
+ LOCALE_HINT_MISS: `${PERFORMANCE_MARK_PREFIX}locale-hint-miss`
241
251
  };
242
252
 
243
253
  /*
@@ -152,6 +152,7 @@ export declare const MC_API_PROXY_TARGETS: {
152
152
  readonly EXPORT: "export";
153
153
  readonly STANDALONE_PRICES_SEARCH: "standalone-prices-search";
154
154
  readonly STORES_SEARCGH: "stores-search";
155
+ readonly CATEGORY_AUTOCOMPLETE: "category-autocomplete";
155
156
  };
156
157
  export type TMcApiProxyTargets = (typeof MC_API_PROXY_TARGETS)[keyof typeof MC_API_PROXY_TARGETS];
157
158
  export type TLocalizedField = {
@@ -229,6 +230,19 @@ export type ApplicationRuntimeEnvironment = {
229
230
  servedByProxy: boolean;
230
231
  ldClientSideId?: string;
231
232
  trackingSentry?: string;
233
+ /**
234
+ * Renders the shell chrome (grid, AppBar, NavBar) before the locale data is
235
+ * available, instead of holding it behind `ConfigureIntlProvider`.
236
+ *
237
+ * Read from `window.app` rather than a feature flag on purpose: the flag
238
+ * provider (`SetupFlopFlipProvider`) is mounted below the locale boundary
239
+ * this switch decides, so no flag is readable at that point.
240
+ *
241
+ * Keep this off until the proxy prefetch endpoints are deployed. Without
242
+ * prefetched `user.language`, non-English users see a brief English flash
243
+ * before the real locale resolves.
244
+ */
245
+ enableEarlyShellRendering?: boolean;
232
246
  __DEVELOPMENT__?: ApplicationRuntimeEnvironmentForDevelopment;
233
247
  };
234
248
  export interface ApplicationWindow extends Window {
@@ -281,6 +295,7 @@ export declare const STORAGE_KEYS: {
281
295
  readonly IS_FORCED_MENU_OPEN: "isForcedMenuOpen";
282
296
  readonly LOGIN_STRATEGY: "loginStrategy";
283
297
  readonly ACTIVE_USER_LANGUAGE: "activeUserLanguage";
298
+ readonly LAST_USER_LANGUAGE: "lastUserLanguage";
284
299
  };
285
300
  export declare const HTTP_SECURITY_HEADER_KEYS: {
286
301
  readonly 'Content-Security-Policy': "Content-Security-Policy";
@@ -323,5 +338,7 @@ export declare const PERFORMANCE_MARKS: {
323
338
  readonly CONTENT_RENDERED: "mc:content-rendered";
324
339
  readonly HYDRATION_USER: "mc:hydration-user";
325
340
  readonly HYDRATION_PROJECT: "mc:hydration-project";
341
+ readonly LOCALE_HINT_HIT: "mc:locale-hint-hit";
342
+ readonly LOCALE_HINT_MISS: "mc:locale-hint-miss";
326
343
  };
327
344
  export type TPerformanceMark = (typeof PERFORMANCE_MARKS)[keyof typeof PERFORMANCE_MARKS];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/constants",
3
- "version": "27.13.0",
3
+ "version": "27.15.0",
4
4
  "description": "Shared constants for MC applications",
5
5
  "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
6
6
  "repository": {