@redocly/openapi-docs 3.14.0-next.3 → 3.14.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.
- package/dist/redocly-openapi-docs.min.js +667 -667
- package/lib/components/Replay/Replay.js +1 -1
- package/lib/constants.d.ts +4 -0
- package/lib/constants.js +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,Fragment as M,jsxs as z}from"react/jsx-runtime";import{lazy as J,memo as K,Suspense as W,useCallback as m,useRef as w,useState as H}from"react";import{useAtom as u,useAtomValue as p}from"jotai";import Q from"deepmerge";const X=J(async()=>import("@redocly/replay").then(e=>({default:e.ReplayOverlay})));import{Button as Y}from"@redocly/theme/components/Button/Button";import{useFocusTrap as Z,useModalScrollLock as $}from"@redocly/theme/core/openapi";import{RocketIcon as ee}from"@redocly/theme/icons/RocketIcon/RocketIcon";import{CircleDashIcon as te}from"@redocly/theme/icons/CircleDashIcon/CircleDashIcon";import{Portal as oe}from"@redocly/theme/components/Portal/Portal";import{useConfigureReplay as re}from"@redocly/theme/ext/useConfigureReplay";import{globalOptionsAtom as ne,globalStoreAtom as ae}from"../../jotai/store.js";import{allOperationsAtom as se,replayStateAtom as ie}from"../../jotai/replay.js";import{allOperations as le,getDefaultOperationStore as me}from"../../jotai/operation.js";import{LOADING_STATE as n}from"../../constants.js";import{environmentAtom as pe,userClaimsAtom as ce}from"../../jotai/app.js";import{convertOperationToReplayValueForRedoc as fe}from"./utils.js";import{useTranslate as ue,useTelemetry as de}from"../../hooks/index.js";import{JsonPointer as ye}from"../../utils/index.js";import{getDefaultCollectorUrl as he}from"../../utils/telemetry.js";import{createTryItOpenEvent as Oe,createTryItSentEvent as Ie}from"../../events/index.js";import{joinWithSeparator as Re}from"../../services/history/helpers.js";function ge({operation:e,corsProxyUrl:b,fullOpenApi:d}){const y=ue(),L=de(),h=w(null),{mockServer:P,oAuth2RedirectURI:q,routingBasePath:c}=p(ne),O=p(se),{parser:
|
|
1
|
+
import{jsx as o,Fragment as M,jsxs as z}from"react/jsx-runtime";import{lazy as J,memo as K,Suspense as W,useCallback as m,useRef as w,useState as H}from"react";import{useAtom as u,useAtomValue as p}from"jotai";import Q from"deepmerge";const X=J(async()=>import("@redocly/replay").then(e=>({default:e.ReplayOverlay})));import{Button as Y}from"@redocly/theme/components/Button/Button";import{useFocusTrap as Z,useModalScrollLock as $}from"@redocly/theme/core/openapi";import{RocketIcon as ee}from"@redocly/theme/icons/RocketIcon/RocketIcon";import{CircleDashIcon as te}from"@redocly/theme/icons/CircleDashIcon/CircleDashIcon";import{Portal as oe}from"@redocly/theme/components/Portal/Portal";import{useConfigureReplay as re}from"@redocly/theme/ext/useConfigureReplay";import{globalOptionsAtom as ne,globalStoreAtom as ae}from"../../jotai/store.js";import{allOperationsAtom as se,replayStateAtom as ie}from"../../jotai/replay.js";import{allOperations as le,getDefaultOperationStore as me}from"../../jotai/operation.js";import{LOADING_STATE as n}from"../../constants.js";import{environmentAtom as pe,userClaimsAtom as ce}from"../../jotai/app.js";import{convertOperationToReplayValueForRedoc as fe}from"./utils.js";import{useTranslate as ue,useTelemetry as de}from"../../hooks/index.js";import{JsonPointer as ye}from"../../utils/index.js";import{getDefaultCollectorUrl as he}from"../../utils/telemetry.js";import{createTryItOpenEvent as Oe,createTryItSentEvent as Ie}from"../../events/index.js";import{joinWithSeparator as Re}from"../../services/history/helpers.js";function ge({operation:e,corsProxyUrl:b,fullOpenApi:d}){const y=ue(),L=de(),h=w(null),{mockServer:P,oAuth2RedirectURI:q,routingBasePath:c}=p(ne),O=p(se),{parser:E,options:{events:a}}=p(ae),I=p(ce),[s,N]=H(!1),[l,R]=u(ie),[g,v]=u(le),[[,V],A]=u(pe),{config:j,refresh:S}=re({userClaims:I,operation:{name:e.name,path:e.path,operationId:e.operationId||"",href:e.href,method:e.httpVerb},servers:e.servers},s);Z(h),$(s);const x=m(()=>S(),[S]),k=m(({operations:t,environment:i,environments:f})=>{const _=t.reduce((D,r)=>{r.requestValues.body=r.requestValues.body instanceof URLSearchParams?Object.fromEntries(r.requestValues.body.entries()):r.requestValues.body;const{path:F,method:B}=r.apiPath,C=ye.compile(["paths",F,B]);return D[C]=Q(me(C),r),D},{});v({...g,..._}),A({environment:i,environments:f})},[g,v,A]),T=()=>{if(l!==n.LOADING){if(!s&&(L.sendOpenapiDocsTryItOpenedMessage(),a?.tryItOpen&&e)){const t=Oe({operation:e});a.tryItOpen(t)}N(!s)}l===n.NOT_LOADED&&R(n.LOADING)},G=m(t=>{if(a?.tryItSent&&e){const i=Ie({operation:e,isSuccess:t});a.tryItSent(i)}},[a,e]),U=m(t=>{if(!t)return;const i=O.find(f=>f.operationId===t);return Re(c,i?.href)},[O,c]);return d?z(M,{children:[o(Y,{onClick:T,variant:"primary",iconPosition:"left",icon:l===n.LOADING?o(te,{}):o(ee,{}),children:l===n.LOADING?y("openapi.loading","Loading..."):y("openapi.tryIt","Try it")}),s&&o(W,{children:o(oe,{mountId:"api-content",children:o("div",{ref:h,children:o(X,{activeOperationId:e.operationId||e.pointer,api:d,onRequestChange:k,onClose:T,onLoad:()=>R(n.LOADED),settings:{corsProxyUrl:b,mockServer:P,selectedEnvironment:V,apiId:E?.definition.info?.["x-metadata"]?.apiId,oAuth2RedirectURI:q,disableCollectionsTab:!0,storageKey:c,telemetry:{tracerName:"try-it",collectorUrl:he()},convertOperationToReplayValue:fe(I,j),getOperationUrl:U,onRequestReset:x},onRequestSent:G})})})})]}):null}const Me=K(ge);export{Me as Replay};
|
package/lib/constants.d.ts
CHANGED
|
@@ -23,3 +23,7 @@ export declare const LOADING_STATE: {
|
|
|
23
23
|
LOADED: string;
|
|
24
24
|
};
|
|
25
25
|
export declare const REDOCLY_CONFIG_FILE = "redocly.yaml";
|
|
26
|
+
export declare const DISABLE_DEEP_LINK_IF_FIELDS_EXIST: string[];
|
|
27
|
+
export declare const SEARCH_LIMIT = 100;
|
|
28
|
+
export declare const HIGHLIGHTED_TEXT_MAX_LENGTH = 150;
|
|
29
|
+
export declare const SEARCH_INDEX_FIELDS: string[];
|
package/lib/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var o;(function(t){t.ON_DEEP_LINK_CLICK="onDeepLinkClick",t.HOOKS="hooks"})(o||(o={}));var E;(function(t){t.OCTET_STREAM="application/octet-stream",t.MULTIPART="multipart/form-data",t.URL_ENCODED="application/x-www-form-urlencoded",t.JSON="application/json",t.XML="application/xml"})(E||(E={}));const p="data-section-id",r="data-field-id",_=0,e="^ {0,3}<!-- ReDoc-Inject:\\s+?<({component}).*?/?>\\s+?-->\\s*$",n="(?:^ {0,3}<({component})([\\s\\S]*?)>([\\s\\S]*?)</\\2>|^ {0,3}<({component})([\\s\\S]*?)(?:/>|\\n{2,}))",c="(?:"+e+"|"+n+")",a="other",D="webhooks",s={NOT_LOADED:"NOT_LOADED",LOADING:"LOADING",LOADED:"LOADED"},L="redocly.yaml",O=["title"],T=100,A=150,I=["text","title","path","httpPath","parameters[]:name","parameters[]:description","parameters[]:place","parameters[]:path"];export{c as COMPONENT_REGEXP,a as DEFAULT_TAG_SLUG,D as DEFAULT_WEBHOOKS_TAG_NAME,O as DISABLE_DEEP_LINK_IF_FIELDS_EXIST,r as FIELD_ATTR,_ as GROUP_DEPTH,A as HIGHLIGHTED_TEXT_MAX_LENGTH,e as LEGACY_REGEXP,s as LOADING_STATE,n as MDX_COMPONENT_REGEXP,E as MediaTypes,L as REDOCLY_CONFIG_FILE,I as SEARCH_INDEX_FIELDS,T as SEARCH_LIMIT,p as SECTION_ATTR,o as WindowReferenceOptions};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.14.0-next.
|
|
3
|
+
"version": "3.14.0-next.4",
|
|
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/
|
|
40
|
-
"@redocly/
|
|
39
|
+
"@redocly/config": "0.31.0",
|
|
40
|
+
"@redocly/replay": "0.17.0-next.4"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@jest/globals": "29.5.0",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"typescript": "5.6.2",
|
|
76
76
|
"url": "~0.11.0",
|
|
77
77
|
"vite": "^6.3.5",
|
|
78
|
-
"@redocly/theme": "0.58.0-next.
|
|
78
|
+
"@redocly/theme": "0.58.0-next.3"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"start": "npm run copy-highlight-hook && vite",
|