@redocly/openapi-docs 3.24.0-next.0 → 3.24.0-next.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,13 @@
1
- import{jsx as l,jsxs as a}from"react/jsx-runtime";import{memo as s}from"react";import{FieldLabel as o,DefaultValue as p,FieldValueLabel as d,ExpandableExample as m}from"../common/index.js";import{styled as x}from"../../styled-components.js";function f({value:e,label:n,raw:t,type:r="other"}){if(e===void 0)return null;const i=t?String(e):JSON.stringify(e);return a(c,{children:[a(o,{children:[" ",n," "]}),r==="default"?l(p,{children:i}):r==="example"?l(m,{value:i}):l(d,{children:i})]})}const j=s(f),c=x.div`
1
+ import{jsx as r,jsxs as a}from"react/jsx-runtime";import{memo as p}from"react";import{useAtomValue as m}from"jotai";import{JsonViewer as f}from"@redocly/theme/components/JsonViewer/JsonViewer";import{FieldLabel as x,DefaultValue as c,FieldValueLabel as u,ExpandableExample as b}from"../common/index.js";import{globalOptionsAtom as g}from"../../jotai/store.js";import{styled as n}from"../../styled-components.js";function h({value:e,label:s,raw:i,type:l="other"}){const{jsonSamplesExpandLevel:t}=m(g);if(e===void 0)return null;const d=!i&&typeof e=="object"&&e!==null,o=i?String(e):JSON.stringify(e);return a(j,{children:[a(x,{children:[" ",s," "]}),l==="default"?r(c,{children:o}):l==="example"?d?r(V,{data:e,expandLevel:t,controls:!1}):r(b,{value:o}):r(u,{children:o})]})}const D=p(h),j=n.div`
2
2
  margin-top: var(--spacing-xxs);
3
3
  display: flex;
4
4
  align-items: baseline;
5
5
  gap: var(--spacing-xxs);
6
6
  flex-wrap: wrap;
7
- `;export{j as FieldDetail};
7
+ `,V=n(f)`
8
+ flex-basis: 100%;
9
+ min-width: 0;
10
+ border: 1px solid var(--border-color-secondary);
11
+ border-radius: var(--border-radius);
12
+ overflow: hidden;
13
+ `;export{D as FieldDetail};
@@ -1,18 +1,18 @@
1
- import{Fragment as C,jsx as e,jsxs as s}from"react/jsx-runtime";import{memo as S,useMemo as L}from"react";import{useAtomValue as N}from"jotai";import{LinkIcon as j}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{RecursiveLabel as x,Tag as g,AccessLabel as q,RequiredLabel as A,StyledBadge as M,CustomBadges as R,renderBadge as y}from"../common/index.js";import{ExternalDocumentation as V}from"../ExternalDocumentation/index.js";import{Markdown as $}from"../Markdown/index.js";import{FieldDetail as m}from"./FieldDetail.js";import{Extensions as _}from"./Extensions.js";import{EnumValues as I}from"./EnumValues.js";import{Examples as O,getSerializedValue as G}from"./Examples.js";import{globalOptionsAtom as H}from"../../jotai/store.js";import{SchemaTypeInfo as n}from"./SchemaTypeInfo.js";import{LinkToField as J}from"../common/LinkToField.js";import{Pattern as K}from"./Pattern.js";import{getAccessModeLabelText as Q}from"../RenderHook/index.js";import{useTranslate as U}from"../../hooks/index.js";import{styled as i}from"../../styled-components.js";import{splitBadgesByPosition as W}from"../../utils/index.js";function X({field:r,renderDiscriminatorSwitch:v,deepLink:c,fieldParentsName:b=[]}){const t=U(),{hidePropertiesPrefix:w,hideSchemaTitles:D}=N(H),{schema:a,description:P,example:d,deprecated:B,examples:p,kind:f,required:F,name:l,badges:k}=r,z=r.in==="header",E=L(()=>{if(d!==void 0||p!==void 0){if(p!==void 0)return e(O,{field:r});{const o=!!r.in;return e(m,{label:`${t("openapi.example","Example")}:`,value:G(r,r.example),raw:o})}}else return null},[d,p,r,t]),h=Q(r.schema),{before:u,after:T}=W(k);return s(C,{children:[s(Y,{children:[l&&s(ee,{children:[c&&e(J,{to:c}),e(ae,{children:e(R,{badges:u,children:s(re,{children:[!w&&b.map(o=>o+".\u200B"),e(te,{className:"schema-name",children:l})]})})})]}),!l&&u.map(y),e(n,{type:a.typePrefix+a.displayType}),e(n,{type:a.displayFormat&&`(${a.displayFormat})`}),e(n,{type:a.contentEncoding}),e(n,{type:a.title&&!D?`(${a.title})`:""}),a.constraints?.map(o=>e(n,{type:o},o)),B&&e(M,{deprecated:!0,children:t("openapi.badges.deprecated","Deprecated")}),e(K,{pattern:a.pattern}),f==="additionalProperties"&&e(g,{children:t("openapi.additionalProperties","additional property")}),f==="patternProperties"&&e(g,{children:t("openapi.patternProperties","pattern property")}),h&&e(q,{children:h}),F&&e(A,{children:t("openapi.required","required")}),a.isCircular&&e(x,{children:t("openapi.recursive","Recursive")}),T.map(y)]}),a.isComplex&&e(x,{children:t("openapi.complex","Complex")}),e(Z,{source:P}),e(m,{raw:z,type:"default",label:t("openapi.default","Default"),value:a.default}),e(I,{type:a.type,values:a["x-enumDescriptions"]||a.enum}),E,e(_,{extensions:{...r.extensions,...a.extensions}}),a.externalDocs&&e(V,{externalDocs:a.externalDocs,compact:!0}),v?.(),e(m,{label:t("openapi.value","Value"),value:r.const||void 0})]})}const Pe=S(X),Y=i.div`
1
+ import{Fragment as j,jsx as e,jsxs as s}from"react/jsx-runtime";import{memo as L,useMemo as N}from"react";import{useAtomValue as V}from"jotai";import{LinkIcon as q}from"@redocly/theme/icons/LinkIcon/LinkIcon";import{RecursiveLabel as g,Tag as y,AccessLabel as A,RequiredLabel as M,StyledBadge as R,CustomBadges as $,renderBadge as v}from"../common/index.js";import{ExternalDocumentation as _}from"../ExternalDocumentation/index.js";import{Markdown as I}from"../Markdown/index.js";import{FieldDetail as c}from"./FieldDetail.js";import{Extensions as O}from"./Extensions.js";import{EnumValues as G}from"./EnumValues.js";import{Examples as H,getSerializedValue as J}from"./Examples.js";import{globalOptionsAtom as K}from"../../jotai/store.js";import{SchemaTypeInfo as n}from"./SchemaTypeInfo.js";import{LinkToField as Q}from"../common/LinkToField.js";import{Pattern as U}from"./Pattern.js";import{getAccessModeLabelText as W}from"../RenderHook/index.js";import{useTranslate as X}from"../../hooks/index.js";import{styled as i}from"../../styled-components.js";import{splitBadgesByPosition as Y}from"../../utils/index.js";function Z({field:r,renderDiscriminatorSwitch:b,deepLink:d,fieldParentsName:w=[]}){const t=X(),{hidePropertiesPrefix:D,hideSchemaTitles:P}=V(K),{schema:a,description:B,example:f,deprecated:F,examples:p,kind:u,required:k,name:l,badges:z}=r,E=r.in==="header",S=N(()=>{if(f!==void 0||p!==void 0){if(p!==void 0)return e(H,{field:r});{const o=!!r.in,m=J(r,r.example),C=!o&&typeof m=="object"&&m!==null;return e(c,{label:`${t("openapi.example","Example")}:`,value:m,raw:o,type:C?"example":void 0})}}else return null},[f,p,r,t]),h=W(r.schema),{before:x,after:T}=Y(z);return s(j,{children:[s(ee,{children:[l&&s(re,{children:[d&&e(Q,{to:d}),e(te,{children:e($,{badges:x,children:s(oe,{children:[!D&&w.map(o=>o+".\u200B"),e(ie,{className:"schema-name",children:l})]})})})]}),!l&&x.map(v),e(n,{type:a.typePrefix+a.displayType}),e(n,{type:a.displayFormat&&`(${a.displayFormat})`}),e(n,{type:a.contentEncoding}),e(n,{type:a.title&&!P?`(${a.title})`:""}),a.constraints?.map(o=>e(n,{type:o},o)),F&&e(R,{deprecated:!0,children:t("openapi.badges.deprecated","Deprecated")}),e(U,{pattern:a.pattern}),u==="additionalProperties"&&e(y,{children:t("openapi.additionalProperties","additional property")}),u==="patternProperties"&&e(y,{children:t("openapi.patternProperties","pattern property")}),h&&e(A,{children:h}),k&&e(M,{children:t("openapi.required","required")}),a.isCircular&&e(g,{children:t("openapi.recursive","Recursive")}),T.map(v)]}),a.isComplex&&e(g,{children:t("openapi.complex","Complex")}),e(ae,{source:B}),e(c,{raw:E,type:"default",label:t("openapi.default","Default"),value:a.default}),e(G,{type:a.type,values:a["x-enumDescriptions"]||a.enum}),S,e(O,{extensions:{...r.extensions,...a.extensions}}),a.externalDocs&&e(_,{externalDocs:a.externalDocs,compact:!0}),b?.(),e(c,{label:t("openapi.value","Value"),value:r.const||void 0})]})}const Fe=L(Z),ee=i.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  gap: calc(var(--spacing-xxs) / 4) var(--spacing-xxs);
5
5
  flex-wrap: wrap;
6
6
  margin-bottom: 2px;
7
7
  position: relative;
8
- `,Z=i($)`
8
+ `,ae=i(I)`
9
9
  font-size: var(--font-size-base);
10
10
  line-height: var(--line-height-base);
11
11
 
12
12
  article p:last-child {
13
13
  margin-bottom: 0;
14
14
  }
15
- `,ee=i.span`
15
+ `,re=i.span`
16
16
  position: relative;
17
17
  font-family: var(--font-family-monospaced);
18
18
  line-height: var(--line-height-base);
@@ -28,24 +28,24 @@ import{Fragment as C,jsx as e,jsxs as s}from"react/jsx-runtime";import{memo as S
28
28
  }
29
29
 
30
30
  &:hover {
31
- ${j} {
31
+ ${q} {
32
32
  opacity: 1;
33
33
  visibility: visible;
34
34
  background-color: var(--bg-color);
35
35
  }
36
36
  }
37
- `,ae=i.span`
37
+ `,te=i.span`
38
38
  display: inline-flex;
39
39
  align-items: center;
40
40
  gap: var(--spacing-xxs);
41
41
  flex-wrap: wrap;
42
42
  max-width: 100%;
43
- `,re=i.span`
43
+ `,oe=i.span`
44
44
  display: inline;
45
- `,te=i.span`
45
+ `,ie=i.span`
46
46
  font-family: var(--font-family-monospaced);
47
47
  font-weight: var(--font-weight-semibold);
48
48
  font-size: var(--schemas-property-name-font-size);
49
49
  line-height: var(--schemas-property-name-line-height);
50
50
  color: var(--color-primary-text, var(--schema-name-color-legacy));
51
- `;export{Pe as FieldDetails};
51
+ `;export{Fe as FieldDetails};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-docs",
3
- "version": "3.24.0-next.0",
3
+ "version": "3.24.0-next.1",
4
4
  "description": "Redocly OpenAPI Docs",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -41,7 +41,7 @@
41
41
  "web-vitals": "3.3.1",
42
42
  "@redocly/config": "0.52.0",
43
43
  "@redocly/redoc-opentelemetry": "0.2.2",
44
- "@redocly/replay": "0.27.0-next.0"
44
+ "@redocly/replay": "0.27.0-next.1"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@shikijs/transformers": "3.21.0",