@redocly/redoc-reef 0.141.0-next.15 → 0.141.0-next.16

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @redocly/redoc-reef
2
2
 
3
+ ## 0.141.0-next.16
4
+
5
+ ### Minor Changes
6
+
7
+ - 9e40868bd9d: Added a key cap style for the `<kbd>` HTML element in Markdown pages to make keyboard shortcuts stand out from inline code.
8
+
9
+ ### Patch Changes
10
+
11
+ - 8740b0da28a: Fixed an issue where links to a page whose URL ends in a dotted name, such as an API schema named `pets.v1.Pet`, were broken.
12
+ - Updated dependencies [9e40868bd9d]
13
+ - @redocly/theme@0.73.0-next.12
14
+ - @redocly/api-docs@0.6.0-next.16
15
+
3
16
  ## 0.141.0-next.15
4
17
 
5
18
  ### Patch Changes
@@ -1 +1 @@
1
- import l from"node:path";import{API_DOCS_TEMPLATE_ID as O,ASYNC_API_DOCS_TEMPLATE_ID as y,GRAPHQL_TEMPLATE_ID as M,OPENAPI_DOCS_TEMPLATE_ID as U}from"../../../../constants/common.js";import{isLocalLink as C}from"../../../../utils/path/is-local-link.js";import{normalizeRouteSlug as P}from"../../../../utils/path/normalize-route-slug.js";import{removeFragment as B}from"../../../../utils/path/remove-fragment.js";import{getInnerText as W}from"../../../../markdoc/helpers/get-inner-text.js";import{getNodeAttribute as j}from"../../../../markdoc/helpers/get-node-attribute.js";import{setNodeAttributeValue as p}from"../../../../markdoc/helpers/set-node-attribute-value.js";import{isAuthRoutePath as $}from"../../../../utils/auth/is-auth-route-path.js";import{isApiDownloadLink as b}from"../../../utils/is-api-download-link.js";import{isTranslationFallback as V}from"../../../fs/utils/is-translation-fallback.js";import{removeL10nPrefix as z}from"../../../fs/utils/remove-l10n-prefix.js";import{parseBaseName as G}from"../../../utils/content/parse-base-name.js";import{MdResolveError as A}from"./md-resolve-error.js";import{getLinkOriginalAttrName as N}from"./utils.js";import{isOpenApiURL as q}from"../../api-docs/utils/is-api-doc.js";import{isMarkdownPage as H}from"../is-markdown-page.js";import{copyStaticFile as K}from"../../../utils/fs.js";async function ht(i,s,u,{actions:I,context:m}){const{contentDir:T,outdir:v,getRouteByFsPath:d,getRouteBySlug:k,hasRouteOrRedirectBySlug:w}=I,x=N(s),o=i[x]||j(i,s);if(i[x]=o,!C(o)||b(o)||$(o))return;const[Q,t="",R,L]=/^([^?#]+)?([^#]+)?(.+)?/.exec(o)||[],g=i.type==="image"?"IMAGE":"LINK",h=String(i.attributes.title||i.attributes.alt||W([i])||""),c=B(u);if(i.type!=="image"){const{isOpenapiDetected:e,isOpenapiValid:r}=await q(t,c,I,m);if(e&&!r)throw new A(`OpenAPI route ${o} does not exist`,{rawLink:o,link:t,title:h,brokenLinkType:g})}if(l.extname(t)===""){if(t.startsWith("/")){const e=P(t),r=w(e)?t:_(e,k);if(!r)throw new A(`Route ${t} does not exist`,{rawLink:o,link:t,title:h,brokenLinkType:g});p(i,s,r+(R||"")+(L||""))}if(!o.startsWith("#")&&!t.startsWith("/")&&H(c)){const e=d(c)?.slug;if(!e)return;const{isIndexFile:r}=G(c),a=r?P(l.posix.join(e,t)):P(l.posix.join(e,"../",t)),E=w(P(a))?a:_(a,k);if(!E)throw new A(`Route ${t} does not exist`,{rawLink:o,link:a,title:h,brokenLinkType:g});p(i,s,E+(R||"")+(L||""))}return}const n=t.startsWith("/")?t.substring(1):l.posix.join(l.posix.dirname(c),decodeURI(t)),D=t.startsWith("/")?l.posix.join("static",t.substring(1)):"",S=m.fs.exists(n),F=m.fs.exists(D),f=d(n);if(!S&&!f&&!F)throw p(i,s,"#"),new A(`File ${n} does not exist`,{rawLink:o,link:n,title:h,brokenLinkType:g});if(f){const e=[U,M,y].includes(f.templateId);p(i,s,(e?f.baseSlug:f.slug)+(L||""))}else if(S){const e=m.fs.getFileInfo(n),r=V(e)?m.fs.getFileInfo(z(n)):e;if(!r||r.isVirtual)return;const a=await K(T,r.realRelativePath,v);p(i,s,a)}}function _(i,s){const u=s(i.toLowerCase());return u?.templateId===O?u.slug:void 0}export{ht as resolveLink};
1
+ import p from"node:path";import{API_DOCS_TEMPLATE_ID as O,ASYNC_API_DOCS_TEMPLATE_ID as U,GRAPHQL_TEMPLATE_ID as M,OPENAPI_DOCS_TEMPLATE_ID as C}from"../../../../constants/common.js";import{isLocalLink as W}from"../../../../utils/path/is-local-link.js";import{normalizeRouteSlug as P}from"../../../../utils/path/normalize-route-slug.js";import{removeFragment as B}from"../../../../utils/path/remove-fragment.js";import{getInnerText as $}from"../../../../markdoc/helpers/get-inner-text.js";import{getNodeAttribute as j}from"../../../../markdoc/helpers/get-node-attribute.js";import{setNodeAttributeValue as f}from"../../../../markdoc/helpers/set-node-attribute-value.js";import{isAuthRoutePath as V}from"../../../../utils/auth/is-auth-route-path.js";import{isApiDownloadLink as b}from"../../../utils/is-api-download-link.js";import{isTranslationFallback as z}from"../../../fs/utils/is-translation-fallback.js";import{removeL10nPrefix as G}from"../../../fs/utils/remove-l10n-prefix.js";import{parseBaseName as q}from"../../../utils/content/parse-base-name.js";import{MdResolveError as A}from"./md-resolve-error.js";import{getLinkOriginalAttrName as H}from"./utils.js";import{isOpenApiURL as K}from"../../api-docs/utils/is-api-doc.js";import{isMarkdownPage as E}from"../is-markdown-page.js";import{copyStaticFile as N}from"../../../utils/fs.js";async function ht(t,r,a,{actions:u,context:n}){const{contentDir:T,outdir:D,getRouteByFsPath:L,getRouteBySlug:I,hasRouteOrRedirectBySlug:k}=u,R=H(r),s=t[R]||j(t,r);if(t[R]=s,!W(s)||b(s)||V(s))return;const[Q,e="",w,g]=/^([^?#]+)?([^#]+)?(.+)?/.exec(s)||[],h=t.type==="image"?"IMAGE":"LINK",d=String(t.attributes.title||t.attributes.alt||$([t])||""),m=B(a);if(t.type!=="image"){const{isOpenapiDetected:i,isOpenapiValid:o}=await K(e,m,u,n);if(i&&!o)throw new A(`OpenAPI route ${s} does not exist`,{rawLink:s,link:e,title:d,brokenLinkType:h})}if(p.extname(e)===""){if(e.startsWith("/")){const i=P(e),o=k(i)?e:x(i,I);if(!o)throw new A(`Route ${e} does not exist`,{rawLink:s,link:e,title:d,brokenLinkType:h});f(t,r,o+(w||"")+(g||""))}if(!s.startsWith("#")&&!e.startsWith("/")&&E(m)){const i=_(e,m,L);if(!i)return;const o=k(P(i))?i:x(i,I);if(!o)throw new A(`Route ${e} does not exist`,{rawLink:s,link:i,title:d,brokenLinkType:h});f(t,r,o+(w||"")+(g||""))}return}const l=e.startsWith("/")?e.substring(1):p.posix.join(p.posix.dirname(m),decodeURI(e)),v=e.startsWith("/")?p.posix.join("static",e.substring(1)):"",S=n.fs.exists(l),y=n.fs.exists(v),c=L(l);if(!S&&!c&&!y){const i=t.type==="image"?void 0:_(e,m,L),o=i&&(k(i)?i:x(i,I));if(o){f(t,r,o+(w||"")+(g||""));return}throw f(t,r,"#"),new A(`File ${l} does not exist`,{rawLink:s,link:l,title:d,brokenLinkType:h})}if(c){const i=[C,M,U].includes(c.templateId);f(t,r,(i?c.baseSlug:c.slug)+(g||""))}else if(S){const i=n.fs.getFileInfo(l),o=z(i)?n.fs.getFileInfo(G(l)):i;if(!o||o.isVirtual)return;const F=await N(T,o.realRelativePath,D);f(t,r,F)}}function _(t,r,a){if(t.startsWith("/"))return P(t);if(!E(r))return;const u=a(r)?.slug;if(!u)return;const{isIndexFile:n}=q(r);return P(p.posix.join(u,n?"":"../",t))}function x(t,r){const a=r(t.toLowerCase());return a?.templateId===O?a.slug:void 0}export{ht as resolveLink};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/redoc-reef",
3
- "version": "0.141.0-next.15",
3
+ "version": "0.141.0-next.16",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,14 +33,14 @@
33
33
  "@opentelemetry/sdk-trace-web": "2.8.0",
34
34
  "@opentelemetry/semantic-conventions": "1.40.0",
35
35
  "@redocly/ajv": "8.18.0",
36
- "@redocly/api-docs": "0.6.0-next.15",
36
+ "@redocly/api-docs": "0.6.0-next.16",
37
37
  "@redocly/config": "0.75.0",
38
38
  "@redocly/markdoc": "0.7.1",
39
39
  "@redocly/openapi-core": "2.78.0",
40
40
  "@redocly/portal-legacy-ui": "0.19.0",
41
41
  "@redocly/portal-plugin-mock-server": "0.26.0-next.4",
42
42
  "@redocly/realm-asyncapi-sdk": "0.18.0-next.1",
43
- "@redocly/theme": "0.73.0-next.11",
43
+ "@redocly/theme": "0.73.0-next.12",
44
44
  "@shikijs/transformers": "3.21.0",
45
45
  "@tanstack/react-query": "5.62.3",
46
46
  "@tanstack/react-table": "8.21.3",