@redocly/replay 0.0.3 → 0.0.5
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.
- package/dist/replay.cjs +3 -1
- package/dist/replay.js +3 -1
- package/package.json +2 -2
package/dist/replay.cjs
CHANGED
|
@@ -1229,7 +1229,7 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An
|
|
|
1229
1229
|
`;function tO({paramName:n,paramLocation:e}){const t=Ue(),r=a=>{var l;return(l=t.operation.get())==null?void 0:l.parameters.find(c=>c.name===a&&c.in===e)},{description:i,required:s,schema:o}=r(n)||{};return i?b.jsx(w4,{children:b.jsx(as,{content:b.jsx(Lz,{description:typeof i=="string"?i:i.raw,required:!!s,schema:o}),placement:"bottom",children:b.jsx(G.Button,{size:"small",variant:"text",icon:b.jsx(G.InformationIcon,{})})})}):null}function Hz(){const n=kn(),e=Ue(),{request:{queryParameters:t,url:r},isRequestEditable:i}=e,s=()=>{r.set(ow(r.get(),t.get()))},o=(c,u,f)=>{f&&t.merge([Pr()]),u.set(c),s()},a=c=>{t[c].set(Pt),s()},l=()=>{s()};return b.jsx(Df,{keyName:"Parameters",elements:t,onParameterChange:o,onStateChange:l,title:"Query Parameters",environment:n,renderDescription:c=>b.jsx(tO,{paramName:c,paramLocation:"query"}),editable:i.get(),actions:c=>b.jsx(Pi,{onClick:()=>a(c),variant:"text",icon:b.jsx(G.TrashCanIcon,{})})})}function Jz(){const n=kn(),{request:{headers:e},isRequestEditable:t}=Ue();function r(s,o,a){a&&e.merge([Pr()]),o.set(s)}function i(s){e[s].set(Pt)}return b.jsx(Df,{keyName:"Header",elements:e,onParameterChange:r,title:"Header Parameters",environment:n,renderDescription:s=>b.jsx(tO,{paramName:s,paramLocation:"header"}),editable:t.get(),actions:s=>b.jsx(Pi,{onClick:()=>i(s),variant:"text",icon:b.jsx(G.TrashCanIcon,{})})})}function Kz(){const n=kn(),{request:{cookies:e},isRequestEditable:t}=Ue();function r(s,o,a){a&&e.merge([Pr()]),o.set(s)}function i(s){e[s].set(Pt)}return b.jsx(Df,{keyName:"Cookie",elements:e,onParameterChange:r,title:"Cookies",environment:n,renderDescription:s=>b.jsx(tO,{paramName:s,paramLocation:"cookie"}),editable:t.get(),actions:s=>b.jsx(Pi,{onClick:()=>i(s),variant:"text",icon:b.jsx(G.TrashCanIcon,{})})})}const Fi={SECURITY:"Security",BODY:"Body",QUERY:"Query",HEADERS:"Headers",COOKIES:"Cookies"},ks=[{name:Fi.SECURITY,content:jX,icon:b.jsx(G.SecurityIcon,{})},{name:Fi.BODY,content:Sz,icon:b.jsx(G.CodeIcon,{})},{name:Fi.QUERY,content:Hz,icon:b.jsx(G.DataFormatIcon,{})},{name:Fi.HEADERS,content:Jz,icon:b.jsx(G.TableBuiltIcon,{})},{name:Fi.COOKIES,content:Kz,icon:b.jsx(G.CookieIcon,{})}],eL=ks.findIndex(n=>n.name===Fi.BODY),gE=ks.findIndex(n=>n.name===Fi.QUERY),tL=ks.findIndex(n=>n.name===Fi.SECURITY),vS={documentedOAuth2Types:[],grantType:ce.ClientCredentials,[ce.ClientCredentials]:{clientId:"",clientSecret:"",tokenUrl:"",accessToken:""},[ce.AuthorizationCode]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:"",scopes:"",codeVerifier:"",codeChallenge:"",accessToken:""},[ce.Implicit]:{clientId:"",authorizationUrl:"",callbackUrl:"",availableScopes:"",scopes:"",accessToken:""},[ce.Password]:{username:"",password:"",clientId:"",clientSecret:"",tokenUrl:"",accessToken:""}},nL={request:{method:"GET",url:"",securityType:ne.NoAuth,security:{[ne.BasicAuth]:{username:"",password:""},[ne.DigestAuth]:{username:"",password:"",nc:"00000001",realm:void 0,nonce:void 0,opaque:void 0,qop:void 0,algorithm:void 0,cnonce:void 0},[ne.JWT]:{token:""},[ne.APIKey]:{location:xi.Header,name:"",key:""},[ne.OAuth2]:vS,[ne.OpenIDConnect]:{...vS,openIdConnectUrl:"",userInfoUrl:""}},body:Cp(),queryParameters:[Pr()],headers:[Pr()],cookies:[Pr()]},isProcessingRequest:!1,response:null,requestError:null,history:[],saved:[],operation:null,operationUrl:void 0,isLinked:!0,environments:[xI],selectedEnvironmentId:null,corsProxyUrl:void 0,mockServer:void 0,jsonBodyStateExtensions:[],appsLoadingState:Wr.Idle,apps:[],apiId:void 0,requestActiveTabIdx:gE,oAuth2RedirectURI:void 0,isRequestEditable:!0};function Ko(){return structuredClone(nL)}const rL=nw(Ko()),mE=B.createContext(rL),iL=mE.Provider;function Ue(){const n=B.useContext(mE);return rw(n)}const sL=8;function oL(){const{operation:n,requestActiveTabIdx:e}=Ue(),{sendEvent:t}=Rt(),[r,i]=B.useState(ks[e.get()]);B.useEffect(()=>{var a;const o=(a=n.get())==null?void 0:a.body;e.set(o?eL:gE)},[n]),B.useEffect(()=>{i(ks[e.get()])},[e]);const s=o=>{const a=ks[o];e.set(o),t("request_tab_changed",{name:a.name})};return b.jsxs(aL,{children:[b.jsx(lL,{children:ks.map((o,a)=>b.jsx(B.Fragment,{children:r.name===o.name?b.jsx(xS,{icon:o.icon,iconPosition:"left",children:o.name}):b.jsx(xS,{variant:"text",icon:o.icon,onClick:()=>s(a),iconPosition:"left",children:o.name})},o.name))}),b.jsx(cL,{children:b.jsx(r.content,{})})]})}const aL=M.div`
|
|
1230
1230
|
display: flex;
|
|
1231
1231
|
flex-direction: column;
|
|
1232
|
-
padding: var(--spacing-xs)
|
|
1232
|
+
padding: var(--spacing-xs) 0;
|
|
1233
1233
|
gap: var(--spacing-sm);
|
|
1234
1234
|
height: 100%;
|
|
1235
1235
|
overflow: auto;
|
|
@@ -1237,6 +1237,7 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An
|
|
|
1237
1237
|
display: flex;
|
|
1238
1238
|
flex-direction: row;
|
|
1239
1239
|
gap: 2px;
|
|
1240
|
+
padding: 0 var(--spacing-lg);
|
|
1240
1241
|
`,xS=M(G.Button)`
|
|
1241
1242
|
margin: 0;
|
|
1242
1243
|
--button-icon-width: 16px;
|
|
@@ -1244,6 +1245,7 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An
|
|
|
1244
1245
|
`,cL=M.div`
|
|
1245
1246
|
height: 100%;
|
|
1246
1247
|
overflow: auto;
|
|
1248
|
+
padding: 0 var(--spacing-lg);
|
|
1247
1249
|
`;function uL({color:n,className:e,...t}){return b.jsx(fL,{"data-testid":"badge",className:e,$backgroundColor:n,...t})}const fL=M.div`
|
|
1248
1250
|
border: 1px solid var(--border-color-secondary);
|
|
1249
1251
|
border-radius: var(--border-radius);
|
package/dist/replay.js
CHANGED
|
@@ -52626,7 +52626,7 @@ function yG() {
|
|
|
52626
52626
|
const SG = _.div`
|
|
52627
52627
|
display: flex;
|
|
52628
52628
|
flex-direction: column;
|
|
52629
|
-
padding: var(--spacing-xs)
|
|
52629
|
+
padding: var(--spacing-xs) 0;
|
|
52630
52630
|
gap: var(--spacing-sm);
|
|
52631
52631
|
height: 100%;
|
|
52632
52632
|
overflow: auto;
|
|
@@ -52634,6 +52634,7 @@ const SG = _.div`
|
|
|
52634
52634
|
display: flex;
|
|
52635
52635
|
flex-direction: row;
|
|
52636
52636
|
gap: 2px;
|
|
52637
|
+
padding: 0 var(--spacing-lg);
|
|
52637
52638
|
`, LS = _(Xe)`
|
|
52638
52639
|
margin: 0;
|
|
52639
52640
|
--button-icon-width: 16px;
|
|
@@ -52641,6 +52642,7 @@ const SG = _.div`
|
|
|
52641
52642
|
`, CG = _.div`
|
|
52642
52643
|
height: 100%;
|
|
52643
52644
|
overflow: auto;
|
|
52645
|
+
padding: 0 var(--spacing-lg);
|
|
52644
52646
|
`;
|
|
52645
52647
|
function kG({ color: n, className: e, ...t }) {
|
|
52646
52648
|
return /* @__PURE__ */ b.jsx(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/replay",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/replay.cjs",
|
|
6
6
|
"module": "./dist/replay.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
20
20
|
"react-router-dom": "^6.21.1",
|
|
21
21
|
"styled-components": "^5.3.11",
|
|
22
|
-
"@redocly/theme": "0.37.
|
|
22
|
+
"@redocly/theme": "0.37.4"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@codemirror/autocomplete": "^6.15.0",
|