@redocly/config 0.4.0 → 0.82.2-rc.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.
@@ -36,8 +36,10 @@ export type ResolvedNavLinkItem = {
36
36
  version?: string;
37
37
  isDefault?: boolean;
38
38
  versionFolderId?: string;
39
+ badges?: ItemBadge[];
39
40
  httpVerb?: string;
40
41
  separatorLine?: boolean;
42
+ linePosition?: 'top' | 'bottom';
41
43
  routeSlug?: string;
42
44
  active?: boolean;
43
45
  icon?: string;
@@ -50,6 +52,11 @@ export type ResolvedNavLinkItem = {
50
52
  linkedSidebars?: string[];
51
53
  languageInsensitive?: boolean;
52
54
  };
55
+ export type ItemBadge = {
56
+ name: string;
57
+ color?: string;
58
+ position?: 'before' | 'after';
59
+ };
53
60
  export type ResolvedNavGroupItem = {
54
61
  type: 'group';
55
62
  fsPath?: string;
@@ -68,6 +75,7 @@ export type ResolvedNavGroupItem = {
68
75
  versionFolderId?: string;
69
76
  menuStyle?: MenuStyle;
70
77
  separatorLine?: boolean;
78
+ linePosition?: 'top' | 'bottom';
71
79
  routeSlug?: string;
72
80
  active?: boolean;
73
81
  icon?: string;
@@ -90,6 +98,7 @@ export type ResolvedNavItem = ResolvedNavLinkItem | ResolvedNavGroupItem | {
90
98
  version?: string;
91
99
  isDefault?: boolean;
92
100
  versionFolderId?: string;
101
+ variant?: 'primary' | 'secondary';
93
102
  separatorLine?: boolean;
94
103
  linePosition?: 'top' | 'bottom';
95
104
  link?: undefined;
@@ -98,12 +107,12 @@ export type ResolvedNavItem = ResolvedNavLinkItem | ResolvedNavGroupItem | {
98
107
  linkedSidebars?: string[];
99
108
  icon?: string;
100
109
  srcSet?: string;
110
+ languageInsensitive?: boolean;
101
111
  [REDOCLY_TEAMS_RBAC]?: RbacScopeItems;
102
112
  [REDOCLY_ROUTE_RBAC]?: {
103
113
  slug?: string;
104
114
  fsPath?: string;
105
115
  };
106
- languageInsensitive?: boolean;
107
116
  } | {
108
117
  type: 'error';
109
118
  fsPath?: never;
@@ -118,20 +127,20 @@ export type ResolvedNavItem = ResolvedNavLinkItem | ResolvedNavGroupItem | {
118
127
  items?: ResolvedNavItem[];
119
128
  sidebar?: ResolvedNavItem[];
120
129
  linkedSidebars?: string[];
130
+ icon?: string;
131
+ srcSet?: string;
132
+ languageInsensitive?: boolean;
121
133
  [REDOCLY_TEAMS_RBAC]?: RbacScopeItems;
122
134
  [REDOCLY_ROUTE_RBAC]?: {
123
135
  slug?: string;
124
136
  fsPath?: string;
125
137
  };
126
- icon?: string;
127
- srcSet?: string;
128
- languageInsensitive?: boolean;
129
138
  };
130
139
  export type ResolvedNavItemWithLink = (ResolvedNavLinkItem | ResolvedNavGroupItem) & {
131
140
  link: string;
132
141
  };
133
142
  export type ResolvedSidebar = {
134
- relatedNavbarItem?: Breadcrumb;
143
+ relatedNavbarItem?: BreadcrumbItem;
135
144
  items: ResolvedNavItem[];
136
145
  };
137
146
  export interface PageProps {
@@ -166,6 +175,7 @@ export interface PageStaticData {
166
175
  export type UserData = {
167
176
  isAuthenticated: boolean;
168
177
  name: string;
178
+ email?: string;
169
179
  picture: string;
170
180
  logoutDisabled?: boolean;
171
181
  };
@@ -251,8 +261,8 @@ export type OpenAPIOptions = {
251
261
  layout?: LayoutVariant;
252
262
  collapsedSidebar?: boolean;
253
263
  };
254
- export type MenuStyle = 'drilldown';
255
- export type Breadcrumb = {
264
+ export type MenuStyle = 'drilldown' | 'drilldown-header';
265
+ export type BreadcrumbItem = {
256
266
  label: string;
257
267
  link?: string;
258
268
  };
@@ -0,0 +1,5 @@
1
+ type Removed<T, Drop> = T extends Record<string, any> ? T extends ArrayLike<any> ? Array<Removed<T[number], Drop>> : {
2
+ [K in Exclude<keyof T, Drop>]: Removed<T[K], Drop>;
3
+ } : T;
4
+ export declare function removePropertyRecursively<TObject extends object, TProp extends string>(object: TObject, propToRemove: TProp): Removed<TObject, TProp>;
5
+ export {};
@@ -0,0 +1,22 @@
1
+ export function removePropertyRecursively(object, propToRemove) {
2
+ return Object.fromEntries(Object.entries(object)
3
+ .map(([key, value]) => {
4
+ if (key === propToRemove) {
5
+ return undefined;
6
+ }
7
+ if (typeof value !== 'object' || !value) {
8
+ return [key, value];
9
+ }
10
+ if (Array.isArray(value)) {
11
+ return [
12
+ key,
13
+ value.map((arrayItem) => typeof arrayItem === 'object'
14
+ ? removePropertyRecursively(arrayItem, propToRemove)
15
+ : arrayItem),
16
+ ];
17
+ }
18
+ return [key, removePropertyRecursively(value, propToRemove)];
19
+ })
20
+ .filter(Boolean));
21
+ }
22
+ //# sourceMappingURL=remove-property-recursively.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-property-recursively.js","sourceRoot":"","sources":["../src/remove-property-recursively.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,yBAAyB,CACvC,MAAe,EACf,YAAmB;IAEnB,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SACnB,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACpB,IAAI,GAAG,KAAK,YAAY,EAAE;YACxB,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,EAAE;YACvC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SACrB;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACxB,OAAO;gBACL,GAAG;gBACH,KAAK,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CACtB,OAAO,SAAS,KAAK,QAAQ;oBAC3B,CAAC,CAAC,yBAAyB,CAAC,SAAS,EAAE,YAAY,CAAC;oBACpD,CAAC,CAAC,SAAS,CACd;aACF,CAAC;SACH;QAED,OAAO,CAAC,GAAG,EAAE,yBAAyB,CAAC,KAAgC,EAAE,YAAY,CAAC,CAAC,CAAC;IAC1F,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAwB,CACf,CAAC;AAC/B,CAAC"}