@redocly/api-docs 0.2.0-next.3 → 0.2.0-next.4

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.
@@ -8,4 +8,4 @@ import{jsx as i,jsxs as p}from"react/jsx-runtime";import{useCallback as f,useEff
8
8
  :hover {
9
9
  background-color: var(--dropdown-menu-item-bg-color-hover);
10
10
  }
11
- `;function gr({servers:o,method:n,path:t}){const[y,s]=$(L),{events:v}=h(_),d=H(),c=y[0],a=h(O),x=!["get","post","put","delete","patch","head","options","trace","query","x-query"].includes(n.toLowerCase()),u=D({httpVerb:n.toLowerCase(),isAdditionalOperation:x}),l=g(()=>o.map(r=>{const e=w(r.url);return{...r,resolvedUrl:q(r),envUrl:e,envName:String(T({...r,url:e}))}}),[o]),N=g(()=>{const r=l.find(e=>e.url===c.server||e.resolvedUrl===c.server||e.envUrl===c.server);return r?r.resolvedUrl:l[0]?.resolvedUrl??""},[c.server,l]);P(()=>{if(!c.server&&l.length>0){const e=(a?l.find(m=>m.envName===a):void 0)??l[0];s({...!a&&{environment:e.envName},environments:{[e.envName]:{server:e.envUrl}}})}},[]);const k=f(r=>{r.stopPropagation()},[]),A=f(r=>()=>{if(o.length<=1)return;const e=r.envName;d.sendSwitchServersClickedMessage([{id:"switchServersButton",object:"button",uri:"urn:redocly:redoc:ui:button:switchServersButton",server:e}]),s({environment:e,environments:{[e]:{server:r.envUrl}}}),v?.targetServerSwitch?.(R({operation:{id:`${n}:${t}`,path:t,httpVerb:n,name:`${n.toUpperCase()} ${t}`},serverUrl:r.url}))},[o.length,s,d,v,n,t]),E=t.includes("{$");if(o.length<=1||E)return p(G,{children:[i(U,{color:u,children:n}),i(C,{children:t})]});const b=p(F,{variant:"ghost",children:[i(U,{color:u,children:n}),i(C,{children:t})]}),j=l.map(r=>{const e=w(r.resolvedUrl),m=J(e,t);return i(K,{onAction:A(r),children:i(z,{header:r.name||r.description||e,title:m,actions:[i(Q,{data:m,toasterPlacement:"left",onCopyClick:k},m)],active:r.resolvedUrl===N,withCheckmark:!0})},r.url)});return i(V,{trigger:b,withArrow:!0,alignment:"start",children:i(W,{children:j})})}export{gr as ServerDropdown};
11
+ `;function gr({servers:o,method:n,path:t}){const[y,s]=$(L),{events:v}=h(_),d=H(),c=y[0],a=h(O),x=!["get","post","put","delete","patch","head","options","trace","query","x-query"].includes(n.toLowerCase()),u=D({httpVerb:n.toLowerCase(),isAdditionalOperation:x}),l=g(()=>o.map(r=>{const e=w(r.url);return{...r,resolvedUrl:q(r),envUrl:e,envName:String(T({...r,url:e}))}}),[o]),N=g(()=>{const r=l.find(e=>e.url===c.server||e.resolvedUrl===c.server||e.envUrl===c.server);return r?r.resolvedUrl:l[0]?.resolvedUrl??""},[c.server,l]);P(()=>{if(!c.server&&l.length>0){const e=(a?l.find(m=>m.envName===a):void 0)??l[0];s({...!a&&{environment:e.envName},environments:{[e.envName]:{server:e.envUrl}}})}},[]);const k=f(r=>{r.stopPropagation()},[]),A=f(r=>()=>{if(o.length<=1)return;const e=r.envName;d.sendSwitchServersClickedMessage([{id:"switchServersButton",object:"button",uri:"urn:redocly:redoc:ui:button:switchServersButton",server:e}]),s({environment:e,environments:{[e]:{server:r.envUrl}}}),v?.targetServerSwitch?.(R({operation:{id:`${n}:${t}`,path:t,httpVerb:n,name:`${n.toUpperCase()} ${t}`},serverUrl:r.url}))},[o.length,s,d,v,n,t]),E=t.includes("{$");if(o.length===0||E)return p(G,{children:[i(U,{color:u,children:n}),i(C,{children:t})]});const b=p(F,{variant:"ghost",children:[i(U,{color:u,children:n}),i(C,{children:t})]}),j=l.map(r=>{const e=w(r.resolvedUrl),m=J(e,t);return i(K,{onAction:A(r),children:i(z,{header:r.name||r.description||e,title:m,actions:[i(Q,{data:m,toasterPlacement:"left",onCopyClick:k},m)],active:r.resolvedUrl===N,withCheckmark:!0})},r.url)});return i(V,{trigger:b,withArrow:!0,alignment:"start",children:i(W,{children:j})})}export{gr as ServerDropdown};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/api-docs",
3
- "version": "0.2.0-next.3",
3
+ "version": "0.2.0-next.4",
4
4
  "description": "Redocly API Documentation Library",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@markdoc/markdoc": "0.5.2",
34
- "@redocly/openapi-core": "2.45.0",
34
+ "@redocly/openapi-core": "2.47.0",
35
35
  "dompurify": "3.4.13",
36
36
  "fast-xml-parser": "5.7.3",
37
37
  "graphql": "16.14.2",
@@ -51,8 +51,8 @@
51
51
  "@redocly/allof-merge": "0.6.9",
52
52
  "@redocly/config": "0.53.1",
53
53
  "@redocly/redoc-opentelemetry": "0.2.2",
54
- "@redocly/replay": "0.28.0-next.3",
55
- "@redocly/theme": "^0.69.0-next.3"
54
+ "@redocly/replay": "0.28.0-next.4",
55
+ "@redocly/theme": "^0.69.0-next.4"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@testing-library/jest-dom": "6.6.3",