@redocly/theme 0.9.0-beta.5 → 0.9.1

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.
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { FlattenSimpleInterpolation } from 'styled-components';
3
3
  export type ButtonSize = 'small' | 'medium' | 'large' | 'xlarge' | string;
4
- export type ButtonColor = 'primary' | 'secondary' | 'tertiary' | 'default' | string;
4
+ export type ButtonColor = 'primary' | 'secondary' | 'default' | string;
5
5
  export type ButtonVariant = 'outlined' | 'contained';
6
6
  export interface ButtonProps {
7
7
  color?: ButtonColor;
@@ -74,7 +74,7 @@ exports.baseButtonStyles = (0, styled_components_1.css) `
74
74
  }
75
75
  `;
76
76
  const StyledButton = styled_components_1.default.button.attrs(({ color = 'default', extraClass, variant }) => ({
77
- className: `button-color-${color}${variant ? ` ${variant}` : ''}${extraClass ? ` ${extraClass}` : ''}`,
77
+ className: `button-color-${color}${variant ? ` button-variant-${variant}` : ''}${extraClass ? ` ${extraClass}` : ''}`,
78
78
  'data-component-name': 'Button/Button',
79
79
  })) `
80
80
  text-decoration: none;
@@ -131,18 +131,6 @@ const StyledButton = styled_components_1.default.button.attrs(({ color = 'defaul
131
131
  animation: ${getBlink()} 1.2s infinite;
132
132
  `}
133
133
 
134
- ${({ color }) => color === 'tertiary' &&
135
- (0, styled_components_1.css) `
136
- background-color: transparent;
137
- border: none;
138
- color: var(--text-color);
139
-
140
- :hover {
141
- border: none;
142
- background: rgba(255, 255, 255, 0.65);
143
- }
144
- `}
145
-
146
134
  ${({ disabled }) => disabled &&
147
135
  (0, styled_components_1.css) `
148
136
  &,
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import type { TryItSecurityProps } from './TryItSecurity';
3
- export declare function DevOnboardingTryItSecurity(props: TryItSecurityProps): JSX.Element | null;
2
+ import type { TryItSecurityAppsProps } from './TryItSecurityApps';
3
+ export declare function DevOnboardingTryItSecurity(props: TryItSecurityAppsProps): JSX.Element | null;
@@ -28,8 +28,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.DevOnboardingTryItSecurity = void 0;
30
30
  const React = __importStar(require("react"));
31
- const _theme_1 = require("../index.js");
32
31
  const styled_components_1 = __importDefault(require("styled-components"));
32
+ const Button_1 = require("../Button/Button");
33
33
  const usePageData_1 = require("../mocks/hooks/usePageData");
34
34
  const Dropdown_1 = require("./Dropdown");
35
35
  function DevOnboardingTryItSecurity(props) {
@@ -54,6 +54,7 @@ function DevOnboardingTryItSecurity(props) {
54
54
  else {
55
55
  setAppId('');
56
56
  }
57
+ // eslint-disable-next-line react-hooks/exhaustive-deps
57
58
  }, [props.value]);
58
59
  React.useEffect(() => {
59
60
  initialRender.current = false;
@@ -77,7 +78,7 @@ function DevOnboardingTryItSecurity(props) {
77
78
  .finally(() => setLoading(false));
78
79
  });
79
80
  }
80
- }, []);
81
+ }, [apiId, userData === null || userData === void 0 ? void 0 : userData.isAuthenticated]);
81
82
  React.useEffect(() => {
82
83
  sessionStorage.setItem('redocly_onboarding:prevAppId', appId || '');
83
84
  }, [appId]);
@@ -124,7 +125,6 @@ const TryItDropdown = (0, styled_components_1.default)(Dropdown_1.Dropdown) `
124
125
  `;
125
126
  const FormControl = styled_components_1.default.div `
126
127
  width: 100%;
127
- /* font-family: var(--code-font-family); */
128
128
  display: flex;
129
129
  flex-direction: column;
130
130
  margin-bottom: 10px;
@@ -149,7 +149,7 @@ const FormLabel = styled_components_1.default.label `
149
149
  }
150
150
  `}
151
151
  `;
152
- const UseKeyButton = (0, styled_components_1.default)(_theme_1.Button) `
152
+ const UseKeyButton = (0, styled_components_1.default)(Button_1.Button) `
153
153
  width: 100px;
154
154
  align-self: flex-end;
155
155
  margin-top: 16px;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export type TryItSecurityAppsProps = {
3
+ apiId?: string;
4
+ value?: string;
5
+ onChange: (newSecretKey: string) => void;
6
+ };
7
+ export declare function TryItSecurityApps(props: TryItSecurityAppsProps): JSX.Element | null;
@@ -3,13 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.TryItSecurity = void 0;
6
+ exports.TryItSecurityApps = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const hooks_1 = require("../mocks/hooks");
9
9
  const DevOnboardingTryItSecurity_1 = require("./DevOnboardingTryItSecurity");
10
- function TryItSecurity(props) {
10
+ function TryItSecurityApps(props) {
11
11
  const { hasDeveloperOnboarding } = (0, hooks_1.useGlobalData)() || {};
12
12
  return hasDeveloperOnboarding && props.apiId ? react_1.default.createElement(DevOnboardingTryItSecurity_1.DevOnboardingTryItSecurity, Object.assign({}, props)) : null;
13
13
  }
14
- exports.TryItSecurity = TryItSecurity;
15
- //# sourceMappingURL=TryItSecurity.js.map
14
+ exports.TryItSecurityApps = TryItSecurityApps;
15
+ //# sourceMappingURL=TryItSecurityApps.js.map
@@ -1 +1 @@
1
- export * from './TryItSecurity';
1
+ export * from './TryItSecurityApps';
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./TryItSecurity"), exports);
17
+ __exportStar(require("./TryItSecurityApps"), exports);
18
18
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,4 @@
1
1
  interface SidebarProps {
2
- hasNavbar: boolean;
3
2
  opened?: boolean;
4
3
  animate?: boolean;
5
4
  }
@@ -22,16 +22,12 @@ exports.Sidebar = styled_components_1.default.aside.attrs(() => ({
22
22
  flex-direction: column;
23
23
  width: 100%;
24
24
  -webkit-font-smoothing: antialiased;
25
-
26
- ${({ hasNavbar }) => `
27
- top: ${hasNavbar ? 'var(--navbar-height)' : '0'};
28
- height: calc(100vh ${hasNavbar ? '- var(--navbar-height)' : ''});
29
- `};
25
+ top: var(--navbar-height);
30
26
 
31
27
  ${({ opened, animate }) => `
32
28
  opacity: ${opened ? '1' : '0'};
33
29
  pointer-events: ${opened ? 'auto' : 'none'};
34
-
30
+
35
31
  & > * {
36
32
  transform: ${opened ? 'translate(0, 0)' : 'translate(0, 40px)'};
37
33
  transition: ${animate ? 'transform 0.65s ease, opacity 0.25s ease;' : 'none'};
@@ -9,7 +9,6 @@ interface SidebarLayoutProps {
9
9
  footer?: React.ReactNode;
10
10
  header?: React.ReactNode;
11
11
  growContent?: boolean;
12
- hasNavbar: boolean;
13
12
  }
14
- export declare function SidebarLayout({ versions, menu, footer, header, growContent, hasNavbar, }: SidebarLayoutProps): JSX.Element | null;
13
+ export declare function SidebarLayout({ versions, menu, footer, header, growContent, }: SidebarLayoutProps): JSX.Element | null;
15
14
  export {};
@@ -14,7 +14,7 @@ const MobileSidebarButton_1 = require("../Sidebar/MobileSidebarButton");
14
14
  const MenuContainer_1 = require("../Sidebar/MenuContainer");
15
15
  const SidebarSearch_1 = require("../Search/SidebarSearch");
16
16
  const useThemeConfig_1 = require("../hooks/useThemeConfig");
17
- function SidebarLayout({ versions, menu, footer, header, growContent, hasNavbar, }) {
17
+ function SidebarLayout({ versions, menu, footer, header, growContent, }) {
18
18
  const [isOpen, setIsOpen] = (0, useMobileMenu_1.useMobileMenu)();
19
19
  const toggleMenu = () => setIsOpen(!isOpen);
20
20
  const { search, sidebar } = (0, useThemeConfig_1.useThemeConfig)();
@@ -24,7 +24,7 @@ function SidebarLayout({ versions, menu, footer, header, growContent, hasNavbar,
24
24
  return (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/SidebarLayout" },
25
25
  react_1.default.createElement(MobileSidebarButton_1.MobileSidebarButton, { opened: isOpen, onClick: toggleMenu }),
26
26
  !(search === null || search === void 0 ? void 0 : search.hide) && (search === null || search === void 0 ? void 0 : search.placement) === 'sidebar' ? react_1.default.createElement(SidebarSearch_1.SidebarSearch, null) : null,
27
- react_1.default.createElement(Sidebar_1.Sidebar, { animate: true, opened: isOpen, hasNavbar: hasNavbar },
27
+ react_1.default.createElement(Sidebar_1.Sidebar, { animate: true, opened: isOpen },
28
28
  header ? react_1.default.createElement(HeaderWrapper_1.HeaderWrapper, null, header) : null,
29
29
  versions,
30
30
  react_1.default.createElement(MenuContainer_1.MenuContainer, { growContent: growContent }, menu),
package/lib/config.d.ts CHANGED
@@ -1,4 +1,88 @@
1
1
  import { z } from 'zod';
2
+ declare const MarkdownConfig: z.ZodDefault<z.ZodObject<{
3
+ frontMatterKeysToResolve: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4
+ lastUpdatedBlock: z.ZodOptional<z.ZodDefault<z.ZodObject<z.extendShape<{
5
+ format: z.ZodOptional<z.ZodDefault<z.ZodEnum<["timeago", "iso", "long", "short"]>>>;
6
+ locale: z.ZodOptional<z.ZodDefault<z.ZodString>>;
7
+ }, {
8
+ hide: z.ZodOptional<z.ZodBoolean>;
9
+ }>, "strip", z.ZodTypeAny, {
10
+ hide?: boolean | undefined;
11
+ format?: "timeago" | "iso" | "long" | "short" | undefined;
12
+ locale?: string | undefined;
13
+ }, {
14
+ hide?: boolean | undefined;
15
+ format?: "timeago" | "iso" | "long" | "short" | undefined;
16
+ locale?: string | undefined;
17
+ }>>>;
18
+ toc: z.ZodDefault<z.ZodOptional<z.ZodObject<z.extendShape<{
19
+ header: z.ZodOptional<z.ZodDefault<z.ZodString>>;
20
+ depth: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
21
+ }, {
22
+ hide: z.ZodOptional<z.ZodBoolean>;
23
+ }>, "strip", z.ZodTypeAny, {
24
+ hide?: boolean | undefined;
25
+ header?: string | undefined;
26
+ depth?: number | undefined;
27
+ }, {
28
+ hide?: boolean | undefined;
29
+ header?: string | undefined;
30
+ depth?: number | undefined;
31
+ }>>>;
32
+ editPage: z.ZodOptional<z.ZodDefault<z.ZodObject<z.extendShape<{
33
+ baseUrl: z.ZodOptional<z.ZodString>;
34
+ icon: z.ZodOptional<z.ZodString>;
35
+ text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
36
+ }, {
37
+ hide: z.ZodOptional<z.ZodBoolean>;
38
+ }>, "strip", z.ZodTypeAny, {
39
+ hide?: boolean | undefined;
40
+ baseUrl?: string | undefined;
41
+ icon?: string | undefined;
42
+ text: string;
43
+ }, {
44
+ hide?: boolean | undefined;
45
+ baseUrl?: string | undefined;
46
+ icon?: string | undefined;
47
+ text?: string | undefined;
48
+ }>>>;
49
+ }, "strict", z.ZodTypeAny, {
50
+ frontMatterKeysToResolve?: string[] | undefined;
51
+ lastUpdatedBlock?: {
52
+ hide?: boolean | undefined;
53
+ format?: "timeago" | "iso" | "long" | "short" | undefined;
54
+ locale?: string | undefined;
55
+ } | undefined;
56
+ editPage?: {
57
+ hide?: boolean | undefined;
58
+ baseUrl?: string | undefined;
59
+ icon?: string | undefined;
60
+ text: string;
61
+ } | undefined;
62
+ toc: {
63
+ hide?: boolean | undefined;
64
+ header?: string | undefined;
65
+ depth?: number | undefined;
66
+ };
67
+ }, {
68
+ frontMatterKeysToResolve?: string[] | undefined;
69
+ lastUpdatedBlock?: {
70
+ hide?: boolean | undefined;
71
+ format?: "timeago" | "iso" | "long" | "short" | undefined;
72
+ locale?: string | undefined;
73
+ } | undefined;
74
+ toc?: {
75
+ hide?: boolean | undefined;
76
+ header?: string | undefined;
77
+ depth?: number | undefined;
78
+ } | undefined;
79
+ editPage?: {
80
+ hide?: boolean | undefined;
81
+ baseUrl?: string | undefined;
82
+ icon?: string | undefined;
83
+ text?: string | undefined;
84
+ } | undefined;
85
+ }>>;
2
86
  export declare const ThemeConfig: z.ZodDefault<z.ZodObject<{
3
87
  imports: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
4
88
  logo: z.ZodOptional<z.ZodObject<{
@@ -417,9 +501,9 @@ export declare const ThemeConfig: z.ZodDefault<z.ZodObject<{
417
501
  text: string;
418
502
  }, {
419
503
  hide?: boolean | undefined;
420
- text?: string | undefined;
421
504
  baseUrl?: string | undefined;
422
505
  icon?: string | undefined;
506
+ text?: string | undefined;
423
507
  }>>>;
424
508
  }, "strict", z.ZodTypeAny, {
425
509
  frontMatterKeysToResolve?: string[] | undefined;
@@ -453,9 +537,9 @@ export declare const ThemeConfig: z.ZodDefault<z.ZodObject<{
453
537
  } | undefined;
454
538
  editPage?: {
455
539
  hide?: boolean | undefined;
456
- text?: string | undefined;
457
540
  baseUrl?: string | undefined;
458
541
  icon?: string | undefined;
542
+ text?: string | undefined;
459
543
  } | undefined;
460
544
  }>>>;
461
545
  openapi: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, {}, {}>>;
@@ -479,6 +563,23 @@ export declare const ThemeConfig: z.ZodDefault<z.ZodObject<{
479
563
  logoutRedirect?: string | undefined;
480
564
  }>>>;
481
565
  }, "passthrough", z.ZodTypeAny, {
566
+ links?: {
567
+ type?: string | undefined;
568
+ crossorigin?: string | undefined;
569
+ fetchpriority?: string | undefined;
570
+ integrity?: string | undefined;
571
+ referrerpolicy?: string | undefined;
572
+ as?: string | undefined;
573
+ hreflang?: string | undefined;
574
+ imagesizes?: string | undefined;
575
+ imagesrcset?: string | undefined;
576
+ media?: string | undefined;
577
+ prefetch?: string | undefined;
578
+ rel?: string | undefined;
579
+ sizes?: string | undefined;
580
+ title?: string | undefined;
581
+ href: string;
582
+ }[] | undefined;
482
583
  imports?: string[] | undefined;
483
584
  logo?: {
484
585
  image?: string | undefined;
@@ -526,23 +627,6 @@ export declare const ThemeConfig: z.ZodDefault<z.ZodObject<{
526
627
  src: string;
527
628
  }[] | undefined;
528
629
  } | undefined;
529
- links?: {
530
- type?: string | undefined;
531
- crossorigin?: string | undefined;
532
- fetchpriority?: string | undefined;
533
- integrity?: string | undefined;
534
- referrerpolicy?: string | undefined;
535
- as?: string | undefined;
536
- hreflang?: string | undefined;
537
- imagesizes?: string | undefined;
538
- imagesrcset?: string | undefined;
539
- media?: string | undefined;
540
- prefetch?: string | undefined;
541
- rel?: string | undefined;
542
- sizes?: string | undefined;
543
- title?: string | undefined;
544
- href: string;
545
- }[] | undefined;
546
630
  feedback?: {
547
631
  hide?: boolean | undefined;
548
632
  settings?: string | undefined;
@@ -611,6 +695,23 @@ export declare const ThemeConfig: z.ZodDefault<z.ZodObject<{
611
695
  logoutRedirect?: string | undefined;
612
696
  };
613
697
  }, {
698
+ links?: {
699
+ type?: string | undefined;
700
+ crossorigin?: string | undefined;
701
+ fetchpriority?: string | undefined;
702
+ integrity?: string | undefined;
703
+ referrerpolicy?: string | undefined;
704
+ as?: string | undefined;
705
+ hreflang?: string | undefined;
706
+ imagesizes?: string | undefined;
707
+ imagesrcset?: string | undefined;
708
+ media?: string | undefined;
709
+ prefetch?: string | undefined;
710
+ rel?: string | undefined;
711
+ sizes?: string | undefined;
712
+ title?: string | undefined;
713
+ href: string;
714
+ }[] | undefined;
614
715
  imports?: string[] | undefined;
615
716
  logo?: {
616
717
  image?: string | undefined;
@@ -658,23 +759,6 @@ export declare const ThemeConfig: z.ZodDefault<z.ZodObject<{
658
759
  src: string;
659
760
  }[] | undefined;
660
761
  } | undefined;
661
- links?: {
662
- type?: string | undefined;
663
- crossorigin?: string | undefined;
664
- fetchpriority?: string | undefined;
665
- integrity?: string | undefined;
666
- referrerpolicy?: string | undefined;
667
- as?: string | undefined;
668
- hreflang?: string | undefined;
669
- imagesizes?: string | undefined;
670
- imagesrcset?: string | undefined;
671
- media?: string | undefined;
672
- prefetch?: string | undefined;
673
- rel?: string | undefined;
674
- sizes?: string | undefined;
675
- title?: string | undefined;
676
- href: string;
677
- }[] | undefined;
678
762
  feedback?: {
679
763
  type?: string | undefined;
680
764
  hide?: boolean | undefined;
@@ -728,9 +812,9 @@ export declare const ThemeConfig: z.ZodDefault<z.ZodObject<{
728
812
  } | undefined;
729
813
  editPage?: {
730
814
  hide?: boolean | undefined;
731
- text?: string | undefined;
732
815
  baseUrl?: string | undefined;
733
816
  icon?: string | undefined;
817
+ text?: string | undefined;
734
818
  } | undefined;
735
819
  } | undefined;
736
820
  openapi?: {} | undefined;
@@ -759,3 +843,5 @@ export type ThemeUIConfig = Omit<ThemeConfig, 'navbar' | 'footer' | 'links' | 's
759
843
  shortcuts?: string[];
760
844
  };
761
845
  };
846
+ export type MarkdownConfig = z.infer<typeof MarkdownConfig>;
847
+ export {};
package/lib/config.js CHANGED
@@ -47,6 +47,37 @@ const LinksConfig = zod_1.z
47
47
  type: zod_1.z.string().optional(),
48
48
  })
49
49
  .passthrough();
50
+ const MarkdownConfig = zod_1.z
51
+ .object({
52
+ frontMatterKeysToResolve: zod_1.z.array(zod_1.z.string()).default(['image', 'links']).optional(),
53
+ lastUpdatedBlock: zod_1.z
54
+ .object({
55
+ format: zod_1.z.enum(['timeago', 'iso', 'long', 'short']).default('timeago').optional(),
56
+ locale: zod_1.z.string().default('en-US').optional(),
57
+ })
58
+ .extend(HideConfig.shape)
59
+ .default({})
60
+ .optional(),
61
+ toc: zod_1.z
62
+ .object({
63
+ header: zod_1.z.string().default('On this page').optional(),
64
+ depth: zod_1.z.number().default(3).optional(),
65
+ })
66
+ .extend(HideConfig.shape)
67
+ .optional()
68
+ .default({}),
69
+ editPage: zod_1.z
70
+ .object({
71
+ baseUrl: zod_1.z.string().optional(),
72
+ icon: zod_1.z.string().optional(),
73
+ text: zod_1.z.string().optional().default('Edit this page'),
74
+ })
75
+ .extend(HideConfig.shape)
76
+ .default({})
77
+ .optional(),
78
+ })
79
+ .strict()
80
+ .default({});
50
81
  exports.ThemeConfig = zod_1.z
51
82
  .object({
52
83
  imports: zod_1.z.array(zod_1.z.string()).default([]).optional(),
@@ -141,38 +172,7 @@ exports.ThemeConfig = zod_1.z
141
172
  .strict()
142
173
  .default({})
143
174
  .optional(),
144
- markdown: zod_1.z
145
- .object({
146
- frontMatterKeysToResolve: zod_1.z.array(zod_1.z.string()).default(['image', 'links']).optional(),
147
- lastUpdatedBlock: zod_1.z
148
- .object({
149
- format: zod_1.z.enum(['timeago', 'iso', 'long', 'short']).default('timeago').optional(),
150
- locale: zod_1.z.string().default('en-US').optional(),
151
- })
152
- .extend(HideConfig.shape)
153
- .default({})
154
- .optional(),
155
- toc: zod_1.z
156
- .object({
157
- header: zod_1.z.string().default('On this page').optional(),
158
- depth: zod_1.z.number().default(3).optional(),
159
- })
160
- .extend(HideConfig.shape)
161
- .optional()
162
- .default({}),
163
- editPage: zod_1.z
164
- .object({
165
- baseUrl: zod_1.z.string().optional(),
166
- icon: zod_1.z.string().optional(),
167
- text: zod_1.z.string().optional().default('Edit this page'),
168
- })
169
- .extend(HideConfig.shape)
170
- .default({})
171
- .optional(),
172
- })
173
- .strict()
174
- .default({})
175
- .optional(),
175
+ markdown: MarkdownConfig.optional(),
176
176
  openapi: zod_1.z.object({}).passthrough().optional(),
177
177
  graphql: zod_1.z.object({}).passthrough().optional(),
178
178
  analytics: zod_1.z.any().optional(),
@@ -876,6 +876,7 @@ const apiReferencePanels = (0, styled_components_1.css) `
876
876
  .panel-request-samples,
877
877
  .panel-response-samples,
878
878
  .panel-callback-samples {
879
+ --text-color: var(--panel-samples-text-color);
879
880
  --panel-text-color: var(--panel-samples-text-color); // @presenter Color
880
881
  --panel-font-family-local: var(--panel-samples-font-family);
881
882
  --panel-font-size-local: var(--panel-samples-font-size);
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useGlobalData = void 0;
4
4
  function useGlobalData() {
5
- console.log('>>>> mock');
6
5
  return {};
7
6
  }
8
7
  exports.useGlobalData = useGlobalData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.9.0-beta.5",
3
+ "version": "0.9.1",
4
4
  "description": "Shared UI components lib",
5
5
  "author": "team@redocly.com",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -92,16 +92,16 @@
92
92
  "ts-jest": "^29.0.3",
93
93
  "ts-node": "^10.7.0",
94
94
  "ts-node-dev": "^2.0.0",
95
- "tsc-alias": "^1.7.0",
95
+ "tsc-alias": "^1.8.2",
96
96
  "tsconfig-paths-webpack-plugin": "^3.5.2",
97
97
  "typescript": "^4.8.4",
98
98
  "webpack": "^5.72.0",
99
99
  "zod": ">=3.19.1"
100
100
  },
101
101
  "dependencies": {
102
+ "highlight-words-core": "^1.2.2",
102
103
  "hotkeys-js": "^3.10.1",
103
- "timeago.js": "^4.0.2",
104
- "highlight-words-core": "^1.2.2"
104
+ "timeago.js": "^4.0.2"
105
105
  },
106
106
  "nx": {
107
107
  "namedInputs": {
@@ -6,7 +6,7 @@ import type { FlattenSimpleInterpolation, Keyframes } from 'styled-components';
6
6
  import { Link } from '@portal/Link';
7
7
 
8
8
  export type ButtonSize = 'small' | 'medium' | 'large' | 'xlarge' | string;
9
- export type ButtonColor = 'primary' | 'secondary' | 'tertiary' | 'default' | string;
9
+ export type ButtonColor = 'primary' | 'secondary' | 'default' | string;
10
10
  export type ButtonVariant = 'outlined' | 'contained';
11
11
 
12
12
  export interface ButtonProps {
@@ -69,7 +69,7 @@ export const baseButtonStyles = css`
69
69
 
70
70
  const StyledButton = styled.button.attrs(
71
71
  ({ color = 'default', extraClass, variant }: ButtonProps) => ({
72
- className: `button-color-${color}${variant ? ` ${variant}` : ''}${
72
+ className: `button-color-${color}${variant ? ` button-variant-${variant}` : ''}${
73
73
  extraClass ? ` ${extraClass}` : ''
74
74
  }`,
75
75
  'data-component-name': 'Button/Button',
@@ -131,19 +131,6 @@ const StyledButton = styled.button.attrs(
131
131
  animation: ${getBlink()} 1.2s infinite;
132
132
  `}
133
133
 
134
- ${({ color }) =>
135
- color === 'tertiary' &&
136
- css`
137
- background-color: transparent;
138
- border: none;
139
- color: var(--text-color);
140
-
141
- :hover {
142
- border: none;
143
- background: rgba(255, 255, 255, 0.65);
144
- }
145
- `}
146
-
147
134
  ${({ disabled }) =>
148
135
  disabled &&
149
136
  css`
@@ -1,6 +1,8 @@
1
1
  import React, { memo } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
+ // FIXME!!!
5
+
4
6
  interface ClearButtonProps {
5
7
  className?: string;
6
8
  style?: React.CSSProperties;
@@ -1,14 +1,14 @@
1
1
  import * as React from 'react';
2
- import { Button } from '@theme';
3
2
  import styled from 'styled-components';
4
3
 
5
- import type { TryItSecurityProps } from './TryItSecurity';
4
+ import type { TryItSecurityAppsProps } from './TryItSecurityApps';
6
5
 
6
+ import { Button } from '@theme/Button/Button';
7
7
  import { usePageData } from '@portal/hooks/usePageData';
8
8
 
9
9
  import { Dropdown } from './Dropdown';
10
10
 
11
- export function DevOnboardingTryItSecurity(props: TryItSecurityProps) {
11
+ export function DevOnboardingTryItSecurity(props: TryItSecurityAppsProps) {
12
12
  const apiId = (props as any).apiId;
13
13
 
14
14
  // @ts-ignore
@@ -33,6 +33,7 @@ export function DevOnboardingTryItSecurity(props: TryItSecurityProps) {
33
33
  } else {
34
34
  setAppId('');
35
35
  }
36
+ // eslint-disable-next-line react-hooks/exhaustive-deps
36
37
  }, [props.value]);
37
38
 
38
39
  React.useEffect(() => {
@@ -56,7 +57,7 @@ export function DevOnboardingTryItSecurity(props: TryItSecurityProps) {
56
57
  .finally(() => setLoading(false));
57
58
  });
58
59
  }
59
- }, []);
60
+ }, [apiId, userData?.isAuthenticated]);
60
61
 
61
62
  React.useEffect(() => {
62
63
  sessionStorage.setItem('redocly_onboarding:prevAppId', appId || '');
@@ -125,7 +126,6 @@ const TryItDropdown = styled(Dropdown)`
125
126
 
126
127
  const FormControl = styled.div`
127
128
  width: 100%;
128
- /* font-family: var(--code-font-family); */
129
129
  display: flex;
130
130
  flex-direction: column;
131
131
  margin-bottom: 10px;
@@ -4,13 +4,13 @@ import { useGlobalData } from '@portal/hooks';
4
4
 
5
5
  import { DevOnboardingTryItSecurity } from './DevOnboardingTryItSecurity';
6
6
 
7
- export type TryItSecurityProps = {
7
+ export type TryItSecurityAppsProps = {
8
8
  apiId?: string;
9
9
  value?: string;
10
10
  onChange: (newSecretKey: string) => void;
11
11
  };
12
12
 
13
- export function TryItSecurity(props: TryItSecurityProps) {
13
+ export function TryItSecurityApps(props: TryItSecurityAppsProps) {
14
14
  const { hasDeveloperOnboarding } = useGlobalData() || {};
15
15
 
16
16
  return hasDeveloperOnboarding && props.apiId ? <DevOnboardingTryItSecurity {...props} /> : null;
@@ -1 +1 @@
1
- export * from './TryItSecurity';
1
+ export * from './TryItSecurityApps';
@@ -1,7 +1,6 @@
1
1
  import styled from 'styled-components';
2
2
 
3
3
  interface SidebarProps {
4
- hasNavbar: boolean;
5
4
  opened?: boolean;
6
5
  animate?: boolean;
7
6
  }
@@ -23,16 +22,12 @@ export const Sidebar = styled.aside.attrs(() => ({
23
22
  flex-direction: column;
24
23
  width: 100%;
25
24
  -webkit-font-smoothing: antialiased;
26
-
27
- ${({ hasNavbar }) => `
28
- top: ${hasNavbar ? 'var(--navbar-height)' : '0'};
29
- height: calc(100vh ${hasNavbar ? '- var(--navbar-height)' : ''});
30
- `};
25
+ top: var(--navbar-height);
31
26
 
32
27
  ${({ opened, animate }) => `
33
28
  opacity: ${opened ? '1' : '0'};
34
29
  pointer-events: ${opened ? 'auto' : 'none'};
35
-
30
+
36
31
  & > * {
37
32
  transform: ${opened ? 'translate(0, 0)' : 'translate(0, 40px)'};
38
33
  transition: ${animate ? 'transform 0.65s ease, opacity 0.25s ease;' : 'none'};
@@ -20,8 +20,6 @@ interface SidebarLayoutProps {
20
20
  footer?: React.ReactNode;
21
21
  header?: React.ReactNode;
22
22
  growContent?: boolean;
23
-
24
- hasNavbar: boolean;
25
23
  }
26
24
 
27
25
  export function SidebarLayout({
@@ -30,7 +28,6 @@ export function SidebarLayout({
30
28
  footer,
31
29
  header,
32
30
  growContent,
33
- hasNavbar,
34
31
  }: SidebarLayoutProps): JSX.Element | null {
35
32
  const [isOpen, setIsOpen] = useMobileMenu();
36
33
  const toggleMenu = () => setIsOpen(!isOpen);
@@ -45,7 +42,7 @@ export function SidebarLayout({
45
42
  <MobileSidebarButton opened={isOpen} onClick={toggleMenu} />
46
43
 
47
44
  {!search?.hide && search?.placement === 'sidebar' ? <SidebarSearch /> : null}
48
- <Sidebar animate={true} opened={isOpen} hasNavbar={hasNavbar}>
45
+ <Sidebar animate={true} opened={isOpen}>
49
46
  {header ? <HeaderWrapper>{header}</HeaderWrapper> : null}
50
47
  {versions}
51
48
  <MenuContainer growContent={growContent}>{menu}</MenuContainer>
package/src/config.ts CHANGED
@@ -50,6 +50,38 @@ const LinksConfig = z
50
50
  })
51
51
  .passthrough();
52
52
 
53
+ const MarkdownConfig = z
54
+ .object({
55
+ frontMatterKeysToResolve: z.array(z.string()).default(['image', 'links']).optional(),
56
+ lastUpdatedBlock: z
57
+ .object({
58
+ format: z.enum(['timeago', 'iso', 'long', 'short']).default('timeago').optional(),
59
+ locale: z.string().default('en-US').optional(),
60
+ })
61
+ .extend(HideConfig.shape)
62
+ .default({})
63
+ .optional(),
64
+ toc: z
65
+ .object({
66
+ header: z.string().default('On this page').optional(),
67
+ depth: z.number().default(3).optional(),
68
+ })
69
+ .extend(HideConfig.shape)
70
+ .optional()
71
+ .default({}),
72
+ editPage: z
73
+ .object({
74
+ baseUrl: z.string().optional(),
75
+ icon: z.string().optional(),
76
+ text: z.string().optional().default('Edit this page'),
77
+ })
78
+ .extend(HideConfig.shape)
79
+ .default({})
80
+ .optional(),
81
+ })
82
+ .strict()
83
+ .default({});
84
+
53
85
  export const ThemeConfig = z
54
86
  .object({
55
87
  imports: z.array(z.string()).default([]).optional(),
@@ -150,38 +182,7 @@ export const ThemeConfig = z
150
182
  .strict()
151
183
  .default({})
152
184
  .optional(),
153
- markdown: z
154
- .object({
155
- frontMatterKeysToResolve: z.array(z.string()).default(['image', 'links']).optional(),
156
- lastUpdatedBlock: z
157
- .object({
158
- format: z.enum(['timeago', 'iso', 'long', 'short']).default('timeago').optional(),
159
- locale: z.string().default('en-US').optional(),
160
- })
161
- .extend(HideConfig.shape)
162
- .default({})
163
- .optional(),
164
- toc: z
165
- .object({
166
- header: z.string().default('On this page').optional(),
167
- depth: z.number().default(3).optional(),
168
- })
169
- .extend(HideConfig.shape)
170
- .optional()
171
- .default({}),
172
- editPage: z
173
- .object({
174
- baseUrl: z.string().optional(),
175
- icon: z.string().optional(),
176
- text: z.string().optional().default('Edit this page'),
177
- })
178
- .extend(HideConfig.shape)
179
- .default({})
180
- .optional(),
181
- })
182
- .strict()
183
- .default({})
184
- .optional(),
185
+ markdown: MarkdownConfig.optional(),
185
186
  openapi: z.object({}).passthrough().optional(),
186
187
  graphql: z.object({}).passthrough().optional(),
187
188
  analytics: z.any().optional(),
@@ -215,3 +216,5 @@ export type ThemeUIConfig = Omit<ThemeConfig, 'navbar' | 'footer' | 'links' | 's
215
216
  shortcuts?: string[];
216
217
  };
217
218
  };
219
+
220
+ export type MarkdownConfig = z.infer<typeof MarkdownConfig>;
@@ -884,6 +884,7 @@ const apiReferencePanels = css`
884
884
  .panel-request-samples,
885
885
  .panel-response-samples,
886
886
  .panel-callback-samples {
887
+ --text-color: var(--panel-samples-text-color);
887
888
  --panel-text-color: var(--panel-samples-text-color); // @presenter Color
888
889
  --panel-font-family-local: var(--panel-samples-font-family);
889
890
  --panel-font-size-local: var(--panel-samples-font-size);
@@ -1,4 +1,3 @@
1
1
  export function useGlobalData(): Record<string, unknown> {
2
- console.log('>>>> mock');
3
2
  return {};
4
3
  }
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- export type TryItSecurityProps = {
3
- apiId?: string;
4
- value?: string;
5
- onChange: (newSecretKey: string) => void;
6
- };
7
- export declare function TryItSecurity(props: TryItSecurityProps): JSX.Element | null;