@redocly/theme 0.34.0 → 0.35.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.
@@ -1,173 +1,2 @@
1
- import type { REDOCLY_TEAMS_RBAC } from '../constants';
2
- type Rbac = Record<string, string> | undefined;
3
- export type ResolvedNavLinkItem = {
4
- type: 'link';
5
- metadata?: Record<string, unknown>;
6
- link: string;
7
- label: string;
8
- labelTranslationKey?: string;
9
- items?: ResolvedNavItem[];
10
- sidebar?: ResolvedNavItem[];
11
- external?: boolean;
12
- target?: '_self' | '_blank';
13
- languageInsensitive?: boolean;
14
- version?: string;
15
- isDefault?: boolean;
16
- versionFolderId?: string;
17
- httpVerb?: string;
18
- separatorLine?: boolean;
19
- routeSlug?: string;
20
- fsPath?: string;
21
- active?: boolean;
22
- icon?: string;
23
- srcSet?: string;
24
- [REDOCLY_TEAMS_RBAC]?: Rbac;
25
- };
26
- export type ResolvedNavGroupItem = {
27
- type: 'group';
28
- metadata?: Record<string, unknown>;
29
- link?: string;
30
- label?: string;
31
- labelTranslationKey?: string;
32
- items?: ResolvedNavItem[];
33
- sidebar?: ResolvedNavItem[];
34
- external?: boolean;
35
- target?: '_self' | '_blank';
36
- expanded?: string;
37
- selectFirstItemOnExpand?: boolean;
38
- languageInsensitive?: boolean;
39
- version?: string;
40
- isDefault?: boolean;
41
- versionFolderId?: string;
42
- menuStyle?: MenuStyle;
43
- separatorLine?: boolean;
44
- routeSlug?: string;
45
- fsPath?: string;
46
- active?: boolean;
47
- icon?: string;
48
- srcSet?: string;
49
- [REDOCLY_TEAMS_RBAC]?: Rbac;
50
- };
51
- export type ResolvedNavItem = ResolvedNavLinkItem | ResolvedNavGroupItem | {
52
- type: 'separator';
53
- metadata?: Record<string, unknown>;
54
- label?: string;
55
- labelTranslationKey?: string;
56
- routeSlug?: never;
57
- fsPath?: never;
58
- version?: string;
59
- isDefault?: boolean;
60
- versionFolderId?: string;
61
- separatorLine?: boolean;
62
- link?: undefined;
63
- items?: ResolvedNavItem[];
64
- sidebar?: ResolvedNavItem[];
65
- icon?: string;
66
- srcSet?: string;
67
- languageInsensitive?: boolean;
68
- [REDOCLY_TEAMS_RBAC]?: Rbac;
69
- } | {
70
- type: 'error';
71
- version?: string;
72
- isDefault?: boolean;
73
- versionFolderId?: string;
74
- metadata?: Record<string, unknown>;
75
- routeSlug?: never;
76
- fsPath?: never;
77
- label: string;
78
- labelTranslationKey?: string;
79
- link?: undefined;
80
- items?: ResolvedNavItem[];
81
- sidebar?: ResolvedNavItem[];
82
- icon?: string;
83
- srcSet?: string;
84
- languageInsensitive?: boolean;
85
- [REDOCLY_TEAMS_RBAC]?: Rbac;
86
- };
87
- export type ResolvedNavItemWithLink = (ResolvedNavLinkItem | ResolvedNavGroupItem) & {
88
- link: string;
89
- };
90
- export interface PageProps {
91
- seo?: {
92
- title?: string;
93
- };
94
- frontmatter?: Omit<PageProps, 'frontmatter'> & {
95
- settings?: any;
96
- };
97
- disableAutoScroll?: boolean;
98
- lastModified?: string | null;
99
- [k: string]: any;
100
- }
101
- export interface PageStaticData {
102
- props?: PageProps;
103
- [k: string]: unknown;
104
- }
105
- export type UserData = {
106
- isAuthenticated: boolean;
107
- name: string;
108
- picture: string;
109
- };
110
- export interface PageData {
111
- templateId: string;
112
- sharedDataIds: Record<string, string>;
113
- props: PageProps;
114
- versions?: Version[];
115
- userData: UserData;
116
- }
117
- export declare enum MenuStyle {
118
- Drilldown = "drilldown"
119
- }
120
- export type NavItem = {
121
- page?: string;
122
- directory?: string;
123
- group?: string;
124
- groupTranslationKey?: string;
125
- label?: string;
126
- labelTranslationKey?: string;
127
- href?: never;
128
- items?: NavItem[];
129
- separator?: string;
130
- separatorTranslationKey?: string;
131
- separatorLine?: boolean;
132
- version?: string;
133
- menuStyle?: MenuStyle;
134
- external?: boolean;
135
- target?: '_self' | '_blank';
136
- expanded?: boolean | 'always';
137
- selectFirstItemOnExpand?: boolean;
138
- flatten?: boolean;
139
- };
140
- export interface LogoConfig {
141
- image?: string;
142
- srcSet?: string;
143
- altText?: string;
144
- link?: string;
145
- favicon?: string;
146
- }
147
- export type Version = {
148
- version: string;
149
- label: string;
150
- link: string;
151
- default: boolean;
152
- active: boolean;
153
- notExists?: boolean;
154
- folderId: string;
155
- };
156
- export type VersionConfigItem = {
157
- version: string;
158
- name?: string;
159
- };
160
- export type VersionsConfigType = {
161
- versions: VersionConfigItem[];
162
- default?: string;
163
- };
164
- export type VersionedFolderConfig = {
165
- versionedFiles: Map<string, Set<string>>;
166
- defaultVersion?: string;
167
- versions: VersionConfigItem[];
168
- hasVersionsConfig?: boolean;
169
- };
170
- export type NavGroup = ResolvedNavItem[] | undefined | string | boolean | number;
171
- export type NavGroupRecord = Record<string, NavGroup>;
172
- export type ResolvedConfigLinks = NavGroup | NavGroupRecord;
173
- export {};
1
+ import type { ResolvedNavItem, ResolvedNavItemWithLink, ResolvedNavLinkItem, ResolvedNavGroupItem, ResolvedConfigLinks, NavGroupRecord, LogoConfig, Version, PageStaticData } from '@redocly/config';
2
+ export type { ResolvedNavItem, ResolvedNavItemWithLink, ResolvedNavLinkItem, ResolvedNavGroupItem, ResolvedConfigLinks, NavGroupRecord, LogoConfig, Version, PageStaticData };
@@ -1,8 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MenuStyle = void 0;
4
- var MenuStyle;
5
- (function (MenuStyle) {
6
- MenuStyle["Drilldown"] = "drilldown";
7
- })(MenuStyle || (exports.MenuStyle = MenuStyle = {}));
8
3
  //# sourceMappingURL=nav.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -66,13 +66,13 @@
66
66
  "npm-run-all": "4.1.5",
67
67
  "react-refresh": "0.14.0",
68
68
  "react-router-dom": "6.21.1",
69
- "rimraf": "^5.0.5",
69
+ "rimraf": "5.0.5",
70
70
  "storybook": "7.6.4",
71
71
  "storybook-addon-pseudo-states": "2.1.2",
72
72
  "storybook-design-token": "3.0.0-beta.6",
73
73
  "styled-components": "5.3.11",
74
74
  "styled-system": "5.1.5",
75
- "ts-jest": "29.1.1",
75
+ "ts-jest": "29.1.2",
76
76
  "ts-node": "10.9.1",
77
77
  "ts-node-dev": "2.0.0",
78
78
  "tsc-alias": "1.8.3",
@@ -83,13 +83,13 @@
83
83
  "@redocly/portal-types": "1.2.1"
84
84
  },
85
85
  "dependencies": {
86
- "@redocly/ajv": "^8.11.0",
87
86
  "copy-to-clipboard": "^3.3.3",
88
87
  "highlight-words-core": "^1.2.2",
89
88
  "hotkeys-js": "^3.10.1",
90
89
  "react-calendar": "4.2.1",
91
90
  "react-date-picker": "10.0.3",
92
- "timeago.js": "^4.0.2"
91
+ "timeago.js": "^4.0.2",
92
+ "@redocly/config": "0.1.0"
93
93
  },
94
94
  "scripts": {
95
95
  "start": "npm-run-all --parallel storybook storybook:tokens:watch",
@@ -1,6 +1,4 @@
1
- export enum MenuStyle {
2
- Drilldown = 'drilldown',
3
- }
1
+ import type { MenuStyle } from '@redocly/config';
4
2
 
5
3
  export interface ItemState extends NavItem {
6
4
  items: ItemState[];
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { LayoutVariant } from '@redocly/config';
2
3
 
3
4
  import { ChangeViewButton } from '@theme/components/SidebarActions/ChangeViewButton';
4
5
  import { ToggleRightPanelButton } from '@theme/components/SidebarActions/ToggleRightPanelButton';
@@ -9,10 +10,7 @@ import {
9
10
  } from '@theme/components/SidebarActions/styled';
10
11
  import { telemetry } from '@portal/telemetry';
11
12
 
12
- export enum LayoutVariant {
13
- STACKED = 'stacked',
14
- THREE_PANEL = 'three-panel',
15
- }
13
+ export { LayoutVariant };
16
14
 
17
15
  interface SidebarActionsProps {
18
16
  showChangeLayoutButton: boolean;