@redocly/api-docs 0.1.0-next.3 → 0.1.0-next.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.
@@ -1 +1 @@
1
- import{encodeBackSlashes as l,tryDecodeURIComponent as o}from"./string.js";import{joinWithSeparator as c,normalizePath as s}from"./url.js";import{resolveRouteByPathname as d}from"./routing.js";function a(e){const t=[];for(const[n,r]of Object.entries(e))r!==void 0&&t.push(`${n}=${r}`);return t.join("&")}function x(e,t){return e=l(e).replace(/^\/+/,""),(`/${e}#`+c(e,t)).toLowerCase()}function $(e,t,n){const r=x(t,n);return s(c(e,r))}function m(e){const t=e.startsWith("#")?e.slice(1):e;return o(t).toLowerCase()}function L(e){const t=o(e),n=t.indexOf("#");return n>=0?t.slice(n+1):""}function A(e){return a({t:e.t,in:e.in,c:e.c,cb:e.cb,ct:e.ct,path:e.path})}function R(e,t,n){let r=e;return n&&(r=`${r}&c=${n}`),t&&(r=c(r,t)),r}function b(e){const{section:t,messageKey:n,subsection:r}=e;if(!n)return t;let i=`${t}&m=${n}`;return r&&(i+=`&t=${r}`),i}function C(e){return a({t:e.t,path:e.path,arg:e.arg,rt:e.rt})}function S(e,t){return!e||!t?!1:o(e.startsWith("#")?e.slice(1):e).toLowerCase().includes(`path=${t.toLowerCase()}.`)}function D(e){return e&&L(e)||void 0}function O(e,t){const n=[...e??[]];return n.length>0?n[n.length-1]+=t:n.push(t),n}const g=/&(?:oneof|d)=\d+/g;function W(e){return e.replace(g,"")}function v(e){return e.replace(/\[\]/g,"")}function z(e){return(e??[]).filter(t=>t.includes("&")).map(t=>t.slice(t.indexOf("&")))}function E(e,t){return e?o(e.startsWith("#")?e.slice(1):e).toLowerCase().match(new RegExp(`(?:^|[&/])${t}=([^/&]+)`))?.[1]:void 0}function h(e){const t=["#tag","#operation","#paths"];for(const n of t)if(e.includes(n))return e.replace(n,"").toLowerCase();return""}function H(e,t,n){const r=m(e);if(!r)return;const i=s(c(t,r));if(d(n,i))return i;const u=h(e);if(u){const f=n.allRoutes.find(p=>p.path.toLowerCase().endsWith(u));if(f)return f.path}}export{O as appendVariantSuffix,b as buildAsyncApiSuffix,$ as buildDeepLinkUrl,C as buildGraphqlSuffix,A as buildOpenApiFieldSuffix,R as buildOpenApiSectionSuffix,L as deepLinkToId,E as extractDeepLinkParamFromHash,D as getDeepLinkId,h as getLegacyHash,m as hashToElementId,S as isGraphqlDeepLinkAncestor,x as makeDeepLink,H as resolveLegacyHashToRoute,a as serializeFieldParams,v as stripArrayMarkers,W as stripVariantMarkers,z as variantMarkersOnly};
1
+ import{encodeBackSlashes as h,tryDecodeURIComponent as s}from"./string.js";import{joinWithSeparator as i,normalizePath as f}from"./url.js";import{resolveRouteByPathname as L}from"./routing.js";function p(t){const e=[];for(const[n,r]of Object.entries(t))r!==void 0&&e.push(`${n}=${r}`);return e.join("&")}function $(t,e){return t=h(t).replace(/^\/+/,""),(`/${t}#`+i(t,e)).toLowerCase()}function y(t,e,n){const r=$(e,n);return f(i(t,r))}function d(t){const e=t.startsWith("#")?t.slice(1):t;return s(e).toLowerCase()}function k(t){const e=s(t),n=e.indexOf("#");return n>=0?e.slice(n+1):""}function N(t){return p({t:t.t,in:t.in,c:t.c,cb:t.cb,ct:t.ct,path:t.path})}function _(t,e,n){let r=t;return n&&(r=`${r}&c=${n}`),e&&(r=i(r,e)),r}function K(t){const{section:e,messageKey:n,subsection:r}=t;if(!n)return e;let o=`${e}&m=${n}`;return r&&(o+=`&t=${r}`),o}function B(t){return p({t:t.t,path:t.path,arg:t.arg,rt:t.rt})}function D(t,e){return!t||!e?!1:s(t.startsWith("#")?t.slice(1):t).toLowerCase().includes(`path=${e.toLowerCase()}.`)}function P(t){return t&&k(t)||void 0}function F(t,e){const n=[...t??[]];return n.length>0?n[n.length-1]+=e:n.push(e),n}const S=/&(?:oneof|d)=\d+/g;function M(t){return t.replace(S,"")}function v(t){return t.replace(/\[\]/g,"")}function z(t){return(t??[]).filter(e=>e.includes("&")).map(e=>e.slice(e.indexOf("&")))}function H(t,e){return t?s(t.startsWith("#")?t.slice(1):t).toLowerCase().match(new RegExp(`(?:^|[&/])${e}=([^/&]+)`))?.[1]:void 0}const m="callbacks",u=`${m}/`,A="callback-request",b="callback-response",g=[`/${A}`,`/${b}`];function a(t){const e=t.indexOf("path=");return e===-1?t:t.slice(0,e)}function I(t){return t.replace(`/${u}`,"/")}function x(t,e){const n=`cb=${e}`;return t.endsWith(n)||t.includes(`${n}&`)}function E(t,e){const n=`/${e}`;return t.endsWith(n)||t.includes(`${n}/`)}function w(t,e){return t===e||t.startsWith(`${e}/`)}function j(t,e,n){if(!t||!e||!n)return!1;const r=d(t);if(!w(r,e))return!1;const o=a(r),c=n.toLowerCase();return x(o,c)||E(o,c)}function q(t,e,n){const r=a(t),o=n.toLowerCase();return r.startsWith(i(e,`${u}${o}/`))||r.startsWith(i(e,`${o}/`))||x(r,o)}function G(t,e){const n=a(t).slice(e.length);return!(n.startsWith(`/${u}`)||n.includes("cb=")||g.some(o=>n.includes(o)))}function O(t){const e=["#tag","#operation","#paths"];for(const n of e)if(t.includes(n))return t.replace(n,"").toLowerCase();return""}function U(t,e,n){const r=d(t);if(!r)return;const o=f(i(e,r));if(L(n,o))return o;const c=O(t);if(c){const l=n.allRoutes.find(C=>C.path.toLowerCase().endsWith(c));if(l)return l.path}}export{m as CALLBACKS_SECTION,A as CALLBACK_REQUEST_SECTION,b as CALLBACK_RESPONSE_SECTION,F as appendVariantSuffix,K as buildAsyncApiSuffix,y as buildDeepLinkUrl,B as buildGraphqlSuffix,N as buildOpenApiFieldSuffix,_ as buildOpenApiSectionSuffix,k as deepLinkToId,H as extractDeepLinkParamFromHash,P as getDeepLinkId,O as getLegacyHash,w as hashIsForItem,q as hashIsInsideCallback,G as hashIsOutsideCallbacks,j as hashTargetsCallback,d as hashToElementId,D as isGraphqlDeepLinkAncestor,$ as makeDeepLink,U as resolveLegacyHashToRoute,p as serializeFieldParams,v as stripArrayMarkers,I as stripCallbacksSegment,M as stripVariantMarkers,z as variantMarkersOnly};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/api-docs",
3
- "version": "0.1.0-next.3",
3
+ "version": "0.1.0-next.5",
4
4
  "description": "Redocly API Documentation Library",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -48,8 +48,8 @@
48
48
  "web-vitals": "3.3.1",
49
49
  "@redocly/config": "0.53.1",
50
50
  "@redocly/redoc-opentelemetry": "0.2.2",
51
- "@redocly/replay": "0.27.0-next.9",
52
- "@redocly/theme": "^0.68.0-next.7",
51
+ "@redocly/replay": "0.27.0-next.10",
52
+ "@redocly/theme": "^0.68.0-next.8",
53
53
  "@redocly/allof-merge": "0.6.9"
54
54
  },
55
55
  "devDependencies": {