@redocly/openapi-docs 3.12.0-rc.7 → 3.12.0-rc.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.
@@ -1,11 +1,11 @@
1
- import{CheckmarkIcon as o}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon";import{styled as t}from"../../styled-components.js";const r=t.span`
1
+ import{CheckmarkIcon as o}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon";import{styled as t}from"../../styled-components.js";const a=t.span`
2
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  align-items: center;
5
5
  padding: 0;
6
6
  position: relative;
7
7
  width: 100%;
8
- `,a=t.span`
8
+ `,r=t.span`
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
  justify-content: flex-start;
@@ -43,10 +43,14 @@ import{CheckmarkIcon as o}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon"
43
43
  font-size: var(--font-size-base);
44
44
  line-height: var(--line-height-base);
45
45
  font-weight: var(--font-weight-medium);
46
+ display: flex;
47
+ align-items: center;
48
+ gap: var(--spacing-xs);
49
+ justify-content: flex-start;
46
50
  `,m=t(o)`
47
51
  width: 14px;
48
52
  height: 14px;
49
53
  position: absolute;
50
54
  left: -18px;
51
55
  bottom: 3px;
52
- `;export{p as ActionsWrap,s as Header,a as Item,d as PanelItemDescription,r as PanelItemWrap,c as PanelItemsList,m as StyledCheckmarkIcon,l as Title};
56
+ `;export{p as ActionsWrap,s as Header,r as Item,d as PanelItemDescription,a as PanelItemWrap,c as PanelItemsList,m as StyledCheckmarkIcon,l as Title};
@@ -1 +1 @@
1
- import{jsx as e,Fragment as c,jsxs as g}from"react/jsx-runtime";import{useAtomValue as t}from"jotai";import{Panel as o}from"@redocly/theme/components/Panel/Panel";import{Markdown as f}from"@redocly/theme/components/Markdown/Markdown";import{DownloadSpecification as v}from"../Download/index.js";import{Overview as h}from"../Overview/index.js";import{LanguageList as u}from"../Language/index.js";import{ServerList as w}from"../ServerList/index.js";import{globalStoreAtom as x}from"../../jotai/store.js";import{normalizeServers as S}from"../../utils/index.js";import{mergeInMockServer as L}from"../../models/operation.js";import{languageAtom as b}from"../../jotai/app.js";import{useTranslate as j}from"../../hooks/index.js";const R=({item:{infoDefinition:r}})=>{const a=j(),{options:{hideDownloadButtons:i,mockServer:l},parser:{definition:m,definitionUrl:p}}=t(x),{languages:n,activeLanguage:d}=t(b),s=S(p,L(m.servers||[],l));return g(c,{children:[!i&&e(o,{className:"panel-download",header:a("openapi.download.description.title","Download OpenAPI description"),isExpandable:!1,children:e(v,{})}),(r?.license||r?.contact||r?.termsOfService)&&e(o,{className:"panel-overview",header:a("openapi.info.title","Overview"),isExpandable:!1,children:e(f,{children:e(h,{info:r,translate:a})})}),!!n?.length&&e(o,{className:"panel-language-list",header:a("openapi.languages.title","Languages"),isExpandable:!1,children:e(u,{languages:n,activeLanguage:d})}),!!s.length&&e(o,{className:"panel-servers-list",header:a("openapi.servers.title","Servers"),isExpandable:!1,children:e(w,{servers:s,path:"/",translate:a})})]})};export{R as RightPanel};
1
+ import{jsx as e,Fragment as f,jsxs as v}from"react/jsx-runtime";import{useAtomValue as l}from"jotai";import{Panel as i}from"@redocly/theme/components/Panel/Panel";import{Markdown as u}from"@redocly/theme/components/Markdown/Markdown";import{DownloadSpecification as h}from"../Download/index.js";import{Overview as x}from"../Overview/index.js";import{LanguageList as w}from"../Language/index.js";import{ServerList as L}from"../ServerList/index.js";import{globalStoreAtom as S}from"../../jotai/store.js";import{normalizeServers as b}from"../../utils/index.js";import{mergeInMockServer as j}from"../../models/operation.js";import{languageAtom as k}from"../../jotai/app.js";import{useTranslate as A}from"../../hooks/index.js";const U=({item:{infoDefinition:a}})=>{const r=A(),{options:{hideDownloadButtons:m,mockServer:p},parser:{definition:d,definitionUrl:c}}=l(S),{languages:n,activeLanguage:g}=l(k),s=b(c,j(d.servers||[],p)).sort((o,t)=>o["x-isLive"]&&!t["x-isLive"]?-1:!o["x-isLive"]&&t["x-isLive"]?1:0);return v(f,{children:[!m&&e(i,{className:"panel-download",header:r("openapi.download.description.title","Download OpenAPI description"),isExpandable:!1,children:e(h,{})}),(a?.license||a?.contact||a?.termsOfService)&&e(i,{className:"panel-overview",header:r("openapi.info.title","Overview"),isExpandable:!1,children:e(u,{children:e(x,{info:a,translate:r})})}),!!n?.length&&e(i,{className:"panel-language-list",header:r("openapi.languages.title","Languages"),isExpandable:!1,children:e(w,{languages:n,activeLanguage:g})}),!!s.length&&e(i,{className:"panel-servers-list",header:r("openapi.servers.title","Servers"),isExpandable:!1,children:e(L,{servers:s,path:"/",translate:r})})]})};export{U as RightPanel};
@@ -1,4 +1,4 @@
1
- import{jsx as i,jsxs as t}from"react/jsx-runtime";import{CopyButton as v}from"@redocly/theme/components/Buttons/CopyButton";import{PanelItemDescription as x,Title as f}from"../PanelItem/index.js";import{ViewNested as u}from"../ViewNested/index.js";import{Tag as y}from"../common/index.js";import{Markdown as w}from"../Markdown/index.js";import{styled as e}from"../../styled-components.js";const V=({servers:h,path:b,translate:r})=>i(j,{children:h.map(o=>{const a=o.url+b,d=Object.keys(o.variables||{}).length,p=d===1?"variable":"variables",l=`${d||""} ${r(`openapi.${p}`,p)}`;return t("div",{children:[i(x,{children:o.description}),t(k,{children:[i(f,{suppressHydrationWarning:!0,children:a}),i(v,{data:a},a)]}),o.variables&&i(u,{expandText:`${r("openapi.actions.show","Show")} ${l}`,hideText:`${r("openapi.actions.hide","Hide")} ${l}`,expandByDefault:!1,expandable:!0,hideDivider:!0,children:i(S,{children:Object.entries(o.variables||{}).map(([c,n])=>t(T,{children:[i(z,{children:c}),t(s,{children:[r("openapi.default","Default")," ",i(g,{children:n.default})]}),i($,{source:n.description}),n.enum&&t(s,{children:[r("openapi.enum","Enum")," ",i(D,{children:n.enum.map(m=>i(g,{children:m},m))})]})]},c))})})]},o.url)})}),j=e.div`
1
+ import{jsx as i,jsxs as r}from"react/jsx-runtime";import{CopyButton as f}from"@redocly/theme/components/Buttons/CopyButton";import{CheckmarkFilledIcon as u}from"@redocly/theme/icons/CheckmarkFilledIcon/CheckmarkFilledIcon";import{PanelItemDescription as h,Title as y}from"../PanelItem/index.js";import{ViewNested as w}from"../ViewNested/index.js";import{Tag as l}from"../common/index.js";import{Markdown as $}from"../Markdown/index.js";import{styled as o}from"../../styled-components.js";const _=({servers:b,path:v,translate:t})=>i(j,{children:b.map(e=>{const s=e.url+v,p=Object.keys(e.variables||{}).length,c=p===1?"variable":"variables",m=`${p||""} ${t(`openapi.${c}`,c)}`;return r("div",{children:[r(h,{children:[e.description," ",e["x-isLive"]&&r(l,{className:"tag-green",children:[i(u,{}),"Live"]})]}),e["x-labels"]?.length&&i(h,{style:{margin:"var(--spacing-xs) 0"},children:e["x-labels"]?.map(n=>r(l,{className:`tag-${n.color}`,children:[n.label,": ",n.value]},n.value))})||null,r(L,{children:[i(y,{suppressHydrationWarning:!0,children:s}),i(f,{data:s},s)]}),e.variables&&i(w,{expandText:`${t("openapi.actions.show","Show")} ${m}`,hideText:`${t("openapi.actions.hide","Hide")} ${m}`,expandByDefault:!1,expandable:!0,hideDivider:!0,children:i(S,{children:Object.entries(e.variables||{}).map(([n,a])=>r(T,{children:[i(k,{children:n}),r(d,{children:[t("openapi.default","Default")," ",i(x,{children:a.default})]}),i(z,{source:a.description}),a.enum&&r(d,{children:[t("openapi.enum","Enum")," ",i(D,{children:a.enum.map(g=>i(x,{children:g},g))})]})]},n))})})]},e.url)})}),j=o.div`
2
2
  & > div {
3
3
  border-bottom: 1px solid var(--border-color-secondary);
4
4
  margin-bottom: var(--spacing-xs);
@@ -10,7 +10,7 @@ import{jsx as i,jsxs as t}from"react/jsx-runtime";import{CopyButton as v}from"@r
10
10
  margin-bottom: 0;
11
11
  padding-bottom: 0;
12
12
  }
13
- `,S=e.div`
13
+ `,S=o.div`
14
14
  padding-left: var(--spacing-xxs);
15
15
  & > div {
16
16
  border-bottom: 1px solid var(--border-color-secondary);
@@ -28,32 +28,32 @@ import{jsx as i,jsxs as t}from"react/jsx-runtime";import{CopyButton as v}from"@r
28
28
  margin-bottom: 0;
29
29
  padding-bottom: 0;
30
30
  }
31
- `,T=e.div`
31
+ `,T=o.div`
32
32
  display: flex;
33
33
  flex-direction: column;
34
34
  flex-wrap: wrap;
35
- `,$=e(w)`
35
+ `,z=o($)`
36
36
  font-size: var(--font-size-sm);
37
37
  line-height: var(--line-height-sm);
38
38
  color: var(--text-color-primary);
39
- `,s=e.span`
39
+ `,d=o.span`
40
40
  display: flex;
41
41
  gap: var(--spacing-xxs);
42
42
  font-size: var(--font-size-sm);
43
43
  line-height: var(--line-height-sm);
44
44
  color: var(--text-color-primary);
45
- `,z=e(s)`
45
+ `,k=o(d)`
46
46
  padding-bottom: var(--spacing-xxs);
47
47
  font-weight: var(--font-weight-semibold);
48
- `,D=e.span`
48
+ `,D=o.span`
49
49
  display: flex;
50
50
  gap: var(--spacing-xxs);
51
51
  flex-wrap: wrap;
52
- `,g=e(y)`
52
+ `,x=o(l)`
53
53
  font-size: var(--font-size-sm);
54
54
  line-height: var(--line-height-sm);
55
- `,k=e.div`
55
+ `,L=o.div`
56
56
  display: flex;
57
57
  justify-content: space-between;
58
58
  align-items: center;
59
- `;export{V as ServerList};
59
+ `;export{_ as ServerList};
@@ -7,7 +7,7 @@ import{Button as t}from"@redocly/theme/components/Button/Button";import{styled a
7
7
  color: var(--schema-type-text-color);
8
8
  `,d=r(o)`
9
9
  color: var(--schema-type-text-color);
10
- `,m=r(o)`
10
+ `,p=r(o)`
11
11
  color: var(--schema-type-title-text-color);
12
12
  word-break: break-word;
13
13
  `,c=r(o).attrs({as:"div"})`
@@ -16,7 +16,7 @@ import{Button as t}from"@redocly/theme/components/Button/Button";import{styled a
16
16
  line-height: var(--schema-labels-line-height);
17
17
  font-weight: normal;
18
18
  display: block;
19
- `,p=r(o)`
19
+ `,m=r(o)`
20
20
  color: var(--schema-property-required-label-text-color);
21
21
  font-size: var(--font-size-base);
22
22
  line-height: var(--line-height-base);
@@ -32,6 +32,8 @@ import{Button as t}from"@redocly/theme/components/Button/Button";import{styled a
32
32
  color: var(--text-color-secondary);
33
33
  display: inline-flex;
34
34
  word-break: var(--code-word-break);
35
+ align-items: center;
36
+ gap: var(--spacing-xxs);
35
37
  `,v=r(e)`
36
38
  color: var(--schema-property-access-label-text-color);
37
39
  background-color: var(--bg-color);
@@ -89,4 +91,4 @@ import{Button as t}from"@redocly/theme/components/Button/Button";import{styled a
89
91
  padding: 0;
90
92
  font-size: var(--font-size-sm);
91
93
  line-height: var(--line-height-sm);
92
- `;export{v as AccessLabel,b as AdditionalPropertiesLabel,u as ConstraintItem,x as DefaultValue,g as EnumValue,l as ExampleValue,f as ExtensionValue,o as FieldLabel,a as FieldValueLabel,c as PropertyLabel,h as RecursiveLabel,p as RequiredLabel,e as Tag,y as ToggleButton,d as TypeName,i as TypePrefix,m as TypeTitle};
94
+ `;export{v as AccessLabel,b as AdditionalPropertiesLabel,u as ConstraintItem,x as DefaultValue,g as EnumValue,l as ExampleValue,f as ExtensionValue,o as FieldLabel,a as FieldValueLabel,c as PropertyLabel,h as RecursiveLabel,m as RequiredLabel,e as Tag,y as ToggleButton,d as TypeName,i as TypePrefix,p as TypeTitle};
@@ -3,6 +3,7 @@ export interface OpenAPIDefinition {
3
3
  openapi: string;
4
4
  info: OpenAPIInfo;
5
5
  servers?: OpenAPIServer[];
6
+ 'x-servers'?: OpenAPIServer[];
6
7
  paths: OpenAPIPaths;
7
8
  components?: OpenAPIComponents;
8
9
  security?: OpenAPISecurityRequirement[];
@@ -46,6 +47,12 @@ export interface OpenAPIServer extends ParsedDescription {
46
47
  url: string;
47
48
  description?: string;
48
49
  variables?: OpenAPIServerVariables;
50
+ 'x-isLive'?: boolean;
51
+ 'x-labels'?: {
52
+ label?: string;
53
+ color?: string;
54
+ value: string;
55
+ }[];
49
56
  }
50
57
  export interface OpenAPIServerVariables {
51
58
  [name: string]: OpenAPIServerVariable;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-docs",
3
- "version": "3.12.0-rc.7",
3
+ "version": "3.12.0-rc.9",
4
4
  "description": "Redocly OpenAPI Docs",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -36,8 +36,8 @@
36
36
  "url-template": "^2.0.8",
37
37
  "util": "~0.12.5",
38
38
  "web-vitals": "3.3.1",
39
- "@redocly/config": "0.26.3-rc.1",
40
- "@redocly/replay": "0.15.0-rc.3"
39
+ "@redocly/replay": "0.15.0-rc.3",
40
+ "@redocly/config": "0.26.3-rc.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@jest/globals": "29.5.0",