@redocly/theme 0.30.7 → 0.30.9

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.
@@ -32,6 +32,7 @@ const styled_components_1 = __importDefault(require("styled-components"));
32
32
  const timeago_js_1 = require("timeago.js");
33
33
  const useThemeConfig_1 = require("../../hooks/useThemeConfig");
34
34
  const hooks_1 = require("../../mocks/hooks");
35
+ const constants_1 = require("../../types/portal/src/shared/constants");
35
36
  const FORMATS = {
36
37
  timeago: (date, locale) => (0, timeago_js_1.format)(date, locale),
37
38
  iso: (date) => date.toISOString().split('T')[0],
@@ -47,7 +48,9 @@ function LastUpdated(props) {
47
48
  }
48
49
  const lastModified = props.lastModified;
49
50
  const format = props.format || lastUpdatedBlock.format || 'timeago';
50
- const locale = props.locale || lastUpdatedBlock.locale || currentLocale || 'en-US';
51
+ const locale = props.locale ||
52
+ lastUpdatedBlock.locale ||
53
+ (currentLocale !== constants_1.DEFAULT_LOCALE_PLACEHOLDER ? currentLocale || 'en-US' : 'en-US');
51
54
  const isoDate = lastModified.toISOString().split('T')[0];
52
55
  const lastUpdatedString = FORMATS[format](lastModified, locale);
53
56
  const translationKey = format === 'timeago' ? 'theme.page.lastUpdated.timeago' : 'theme.page.lastUpdated.on';
@@ -28,6 +28,7 @@ exports.LogoContainer = styled_components_1.default.div.attrs({
28
28
  img {
29
29
  max-width: 100%;
30
30
  max-height: 100%;
31
+ height: 100%;
31
32
  }
32
33
  `;
33
34
  //# sourceMappingURL=NavbarLogo.js.map
@@ -12,7 +12,6 @@ exports.logo = (0, styled_components_1.css) `
12
12
  --navbar-logo-margin: 16px; // @presenter Spacing
13
13
  --navbar-logo-max-width: 285px; // @presenter Spacing
14
14
  --navbar-logo-max-height: 285px; // @presenter Spacing
15
-
16
15
  // @tokens End
17
16
  `;
18
17
  //# sourceMappingURL=styledVariables.js.map
@@ -1,6 +1,7 @@
1
1
  export declare const DEFAULT_THEME_NAME = "@redocly/theme";
2
2
  export declare const USER_THEME_ALIAS = "@theme";
3
3
  export declare const REDOCLY_TEAMS_RBAC = "redocly::teams-rbac";
4
+ export declare const DEFAULT_LOCALE_PLACEHOLDER = "default_locale";
4
5
  export type REQUIRED_OIDC_SCOPES = string[];
5
6
  export type DEFAULT_COOKIE_EXPIRATION = number;
6
7
  export declare enum FEEDBACK_TYPES {
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FsErrors = exports.ExternalRoutes = exports.DEV_LOGIN_SLUG = exports.FEEDBACK_TYPES = exports.REDOCLY_TEAMS_RBAC = exports.USER_THEME_ALIAS = exports.DEFAULT_THEME_NAME = void 0;
3
+ exports.FsErrors = exports.ExternalRoutes = exports.DEV_LOGIN_SLUG = exports.FEEDBACK_TYPES = exports.DEFAULT_LOCALE_PLACEHOLDER = exports.REDOCLY_TEAMS_RBAC = exports.USER_THEME_ALIAS = exports.DEFAULT_THEME_NAME = void 0;
4
4
  exports.DEFAULT_THEME_NAME = '@redocly/theme';
5
5
  exports.USER_THEME_ALIAS = '@theme';
6
6
  exports.REDOCLY_TEAMS_RBAC = 'redocly::teams-rbac';
7
+ exports.DEFAULT_LOCALE_PLACEHOLDER = 'default_locale';
7
8
  var FEEDBACK_TYPES;
8
9
  (function (FEEDBACK_TYPES) {
9
10
  FEEDBACK_TYPES["RATING"] = "rating";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.30.7",
3
+ "version": "0.30.9",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -5,6 +5,8 @@ import { format } from 'timeago.js';
5
5
  import { useThemeConfig } from '@theme/hooks/useThemeConfig';
6
6
  import { useI18nConfig, useTranslate } from '@portal/hooks';
7
7
 
8
+ import { DEFAULT_LOCALE_PLACEHOLDER } from '../../types/portal/src/shared/constants';
9
+
8
10
  const FORMATS = {
9
11
  timeago: (date: Date, locale: string) => format(date, locale),
10
12
  iso: (date: Date) => date.toISOString().split('T')[0],
@@ -32,7 +34,10 @@ export function LastUpdated(props: LastUpdatedProps): JSX.Element | null {
32
34
 
33
35
  const lastModified = props.lastModified;
34
36
  const format = props.format || lastUpdatedBlock.format || 'timeago';
35
- const locale = props.locale || lastUpdatedBlock.locale || currentLocale || 'en-US';
37
+ const locale =
38
+ props.locale ||
39
+ lastUpdatedBlock.locale ||
40
+ (currentLocale !== DEFAULT_LOCALE_PLACEHOLDER ? currentLocale || 'en-US' : 'en-US');
36
41
 
37
42
  const isoDate = lastModified.toISOString().split('T')[0];
38
43
 
@@ -43,5 +43,6 @@ export const LogoContainer = styled.div.attrs({
43
43
  img {
44
44
  max-width: 100%;
45
45
  max-height: 100%;
46
+ height: 100%;
46
47
  }
47
48
  `;
@@ -10,6 +10,5 @@ export const logo = css`
10
10
  --navbar-logo-margin: 16px; // @presenter Spacing
11
11
  --navbar-logo-max-width: 285px; // @presenter Spacing
12
12
  --navbar-logo-max-height: 285px; // @presenter Spacing
13
-
14
13
  // @tokens End
15
14
  `;
@@ -1,6 +1,7 @@
1
1
  export const DEFAULT_THEME_NAME = '@redocly/theme';
2
2
  export const USER_THEME_ALIAS = '@theme';
3
3
  export const REDOCLY_TEAMS_RBAC = 'redocly::teams-rbac';
4
+ export const DEFAULT_LOCALE_PLACEHOLDER = 'default_locale'
4
5
  export type REQUIRED_OIDC_SCOPES = string[];
5
6
  export type DEFAULT_COOKIE_EXPIRATION = number;
6
7
  export enum FEEDBACK_TYPES {