@redocly/redoc-reef 0.134.0-next.0 → 0.134.0-next.2

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/client/app/hooks/useRouteChangeTracker.js +1 -1
  3. package/dist/client/app/utils/loadAndNavigate.js +1 -1
  4. package/dist/client/providers/hooks.js +1 -1
  5. package/dist/client/templates/asyncapi-docs/helpers.d.ts +3 -13
  6. package/dist/compiled/svgo/svgo-node.js +55 -49
  7. package/dist/constants/common.d.ts +1 -0
  8. package/dist/constants/common.js +1 -1
  9. package/dist/markdoc/tags/index.d.ts +30 -0
  10. package/dist/markdoc/types.d.ts +2 -2
  11. package/dist/server/api-routes/run-api-routes-worker.js +1 -1
  12. package/dist/server/config/env-config.d.ts +6 -0
  13. package/dist/server/config/env-schema.d.ts +149 -2
  14. package/dist/server/config/env-schema.js +1 -1
  15. package/dist/server/config/env-schemas/feature-flags.d.ts +12 -0
  16. package/dist/server/config/env-schemas/feature-flags.js +1 -1
  17. package/dist/server/constants/feedback.d.ts +2 -0
  18. package/dist/server/constants/feedback.js +1 -1
  19. package/dist/server/plugins/analytics/ga/browser-hooks.js +1 -1
  20. package/dist/server/plugins/analytics/ga/index.js +1 -1
  21. package/dist/server/plugins/markdown/attribute-resolvers/resolve-link.js +1 -1
  22. package/dist/server/plugins/markdown/index.d.ts +1 -1
  23. package/dist/server/plugins/markdown/index.js +1 -1
  24. package/dist/server/plugins/markdown/search/create-render-tag-fn.d.ts +4 -0
  25. package/dist/server/plugins/markdown/search/create-render-tag-fn.js +1 -0
  26. package/dist/server/plugins/markdown/search/get-ai-search-documents.js +7 -8
  27. package/dist/server/plugins/markdown/search/join-section-content.d.ts +3 -0
  28. package/dist/server/plugins/markdown/search/join-section-content.js +2 -0
  29. package/dist/server/plugins/markdown/search/nodes/heading-node.d.ts +1 -7
  30. package/dist/server/plugins/markdown/search/nodes/section-node.d.ts +2 -14
  31. package/dist/server/plugins/markdown/search/nodes/section-node.js +1 -1
  32. package/dist/server/plugins/markdown/search/nodes/tag-node.d.ts +1 -7
  33. package/dist/server/plugins/markdown/search/walk-sections.d.ts +3 -1
  34. package/dist/server/plugins/markdown/search/walk-sections.js +1 -1
  35. package/dist/server/plugins/markdown/utils/resolve-markdown-template.d.ts +13 -0
  36. package/dist/server/plugins/markdown/utils/resolve-markdown-template.js +1 -0
  37. package/dist/server/plugins/openapi-docs/search/get-ai-search-documents.d.ts +2 -2
  38. package/dist/server/plugins/openapi-docs/search/get-ai-search-documents.js +30 -30
  39. package/dist/server/plugins/search/ai-indexer/prepare-semantic-documents.js +3 -1
  40. package/dist/server/plugins/sidebars/index.js +2 -2
  41. package/dist/server/store.d.ts +2 -31
  42. package/dist/server/store.js +1 -1
  43. package/dist/server/types/plugins/common.d.ts +5 -0
  44. package/dist/server/types/plugins/markdown.d.ts +3 -0
  45. package/dist/server/utils/globs.d.ts +2 -1
  46. package/dist/server/utils/globs.js +1 -1
  47. package/dist/server/utils/is-api-download-link.d.ts +2 -0
  48. package/dist/server/utils/is-api-download-link.js +1 -0
  49. package/dist/server/utils/llmstxt/agent-feedback-llms-footer.d.ts +3 -0
  50. package/dist/server/utils/llmstxt/agent-feedback-llms-footer.js +2 -0
  51. package/dist/server/utils/shared-data.js +1 -1
  52. package/dist/server/web-server/routes/auth.js +1 -1
  53. package/dist/server/web-server/routes/feedback.d.ts +16 -0
  54. package/dist/server/web-server/routes/feedback.js +1 -1
  55. package/dist/server/web-server/utils/feedback-ip.d.ts +2 -0
  56. package/dist/server/web-server/utils/feedback-ip.js +1 -0
  57. package/dist/server/web-server/utils/get-client-ip.d.ts +1 -0
  58. package/dist/server/web-server/utils/get-client-ip.js +1 -1
  59. package/dist/utils/auth/is-auth-route-path.js +1 -0
  60. package/package.json +9 -9
  61. package/dist/client/utils/auth/is-auth-route-path.js +0 -1
  62. /package/dist/{client/utils → utils}/auth/is-auth-route-path.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # @redocly/redoc-reef
2
2
 
3
+ ## 0.134.0-next.2
4
+
5
+ ### Minor Changes
6
+
7
+ - 369752b7a65: Added `renderForLlms` to custom Markdoc tag schemas to control output for LLMs.
8
+
9
+ ### Patch Changes
10
+
11
+ - 901291dbd68: Fixed an issue where in rare cases, clicking on a link on a Markdown page, could trigger navigation twice, taking the user to the first link on the target page.
12
+ - 140606ccd0c: Fixed issue where the link checker incorrectly reported valid authentication links as broken.
13
+ - 43168a71e27: Fixed an issue where IP addresses associated with submitted feedback were inaccurate due to proxy or CDN chains.
14
+ - Updated dependencies [369752b7a65]
15
+ - Updated dependencies [45d17147cbc]
16
+ - Updated dependencies [082d73f2c3c]
17
+ - @redocly/theme@0.66.0-next.2
18
+ - @redocly/realm-asyncapi-sdk@0.12.0-next.2
19
+ - @redocly/openapi-docs@3.22.0-next.2
20
+ - @redocly/asyncapi-docs@1.11.0-next.2
21
+ - @redocly/graphql-docs@1.11.0-next.2
22
+ - @redocly/portal-plugin-mock-server@0.19.0-next.2
23
+
24
+ ## 0.134.0-next.1
25
+
26
+ ### Minor Changes
27
+
28
+ - cdaa525bfa0: Added support for the `template` Markdown setting to specify page templates with glob patterns.
29
+
30
+ ### Patch Changes
31
+
32
+ - 4342629ff3: Updated `@redocly/openapi-core` to version `2.31.0`.
33
+ - 5c6b5acc90: Updated `@redocly/openapi-core` to version `2.31.2`.
34
+ - 7e8563e8a3: Fixed a bug where Google Analytics recorded duplicate page views for routes with and without a trailing slash.
35
+ - 0f296111b7: Fixed an issue where sidebar entries were duplicated when multiple sidebar files existed in a versioned directory.
36
+ - Updated dependencies [4342629ff3]
37
+ - Updated dependencies [21803efd07]
38
+ - Updated dependencies [5c6b5acc90]
39
+ - Updated dependencies [13b090c01d6]
40
+ - @redocly/openapi-docs@3.22.0-next.1
41
+ - @redocly/realm-asyncapi-sdk@0.12.0-next.1
42
+ - @redocly/theme@0.66.0-next.1
43
+ - @redocly/portal-plugin-mock-server@0.19.0-next.1
44
+ - @redocly/asyncapi-docs@1.11.0-next.1
45
+ - @redocly/graphql-docs@1.11.0-next.1
46
+
3
47
  ## 0.134.0-next.0
4
48
 
5
49
  ### Minor Changes
@@ -1 +1 @@
1
- import{useLocation as u,useNavigate as d,useNavigationType as l}from"react-router-dom";import{useEffect as v,useState as P}from"react";import{useThemeConfig as w}from"@redocly/theme/core/hooks";import{removeTrailingSlash as E}from"../../../utils/url/remove-trailing-slash";import{onRouteChange as M}from"../../runtime/generated/browser-plugins.js";import{resolveRouteBySlug as y}from"../utils/resolveRouteBySlug.js";import{usePageData as b}from"./usePageData.js";import{usePostMessage as C}from"../../providers/post-message/use-post-message.js";import{isInIframe as T}from"../../utils/utils.js";import{waitForContentScripts as I}from"../../ScriptLoader.js";import{telemetry as N}from"../telemetry/index.js";const U=()=>{const e=u(),n=d(),a=l(),r=b(),[t,i]=P(),m=w(),{sendMessage:h}=C();v(()=>{I().then(()=>{if(e.pathname!==t?.pathname||e.search!==t.search){M({location:e,prevLocation:t},m);const o=`${window.origin}${e.pathname+e.search+e.hash}`,s=t?`${window.origin}${t.pathname+t.search+t.hash}`:void 0;N.sendPageViewedMessage([{object:"page",uri:o,referrer:s||document.referrer||void 0}])}});const c=!!t;i(e);const{pathname:p,hash:g,state:f}=e;if(e?.pathname.endsWith("/")&&e?.pathname!=="/"){const o=E(e.pathname);n({pathname:o,search:e.search,hash:e.hash},{replace:!0})}(process.env.NODE_ENV==="development"||T())&&c&&y(p+g,r?.templateId).then(o=>{const s=a==="POP"?"browser":f?.origin;s&&h({type:"route-updated",origin:s,...o})}).catch(o=>console.log("Resolve route by slug failed with error: ",o.message))},[e,a])};export{U as useRouteChangeTracker};
1
+ import{useLocation as f,useNavigate as d,useNavigationType as l}from"react-router-dom";import{useEffect as v,useState as P}from"react";import{useThemeConfig as w}from"@redocly/theme/core/hooks";import{normalizeRouteSlug as E}from"../../../utils/path/normalize-route-slug";import{onRouteChange as M}from"../../runtime/generated/browser-plugins.js";import{resolveRouteBySlug as y}from"../utils/resolveRouteBySlug.js";import{usePageData as b}from"./usePageData.js";import{usePostMessage as C}from"../../providers/post-message/use-post-message.js";import{isInIframe as R}from"../../utils/utils.js";import{waitForContentScripts as I}from"../../ScriptLoader.js";import{telemetry as N}from"../telemetry/index.js";const U=()=>{const e=f(),r=d(),a=l(),n=b(),[t,i]=P(),m=w(),{sendMessage:h}=C();v(()=>{if(e?.pathname.endsWith("/")&&e?.pathname!=="/"){r({pathname:E(e.pathname),search:e.search,hash:e.hash},{replace:!0,state:e.state});return}I().then(()=>{if(e.pathname!==t?.pathname||e.search!==t.search){M({location:e,prevLocation:t},m);const o=`${window.origin}${e.pathname+e.search+e.hash}`,s=t?`${window.origin}${t.pathname+t.search+t.hash}`:void 0;N.sendPageViewedMessage([{object:"page",uri:o,referrer:s||document.referrer||void 0}])}});const c=!!t;i(e);const{pathname:p,hash:g,state:u}=e;(process.env.NODE_ENV==="development"||R())&&c&&y(p+g,n?.templateId).then(o=>{const s=a==="POP"?"browser":u?.origin;s&&h({type:"route-updated",origin:s,...o})}).catch(o=>console.log("Resolve route by slug failed with error: ",o.message))},[e,a])};export{U as useRouteChangeTracker};
@@ -1 +1 @@
1
- import{isLocalLink as f}from"../../../utils/path/is-local-link.js";import{isAuthRoutePath as m}from"../../utils/auth/is-auth-route-path.js";import{withLoadProgress as u}from"./withLoadProgress";import{scrollToAnchor as p}from"./scroll-to-anchor";let s;async function A({navigate:i,to:o,origin:a="browser",options:c}){o===""&&(o="/"),s=o;const{pathname:n,hash:d,search:t}=new URL(o,window.location.origin+window.location.pathname),r=decodeURIComponent(d),l=decodeURIComponent(window.location.hash);if(m(n)){window.location.href=o;return}const w=window.__LOADER,e=await u(w.tryLoad(n,void 0,t));if(e?.redirectTo){if(!f(e.redirectTo)){window.location.href=e.redirectTo;return}return A({navigate:i,to:e.redirectTo,origin:a,options:c})}if(e&&s===o){if((n!==window.location.pathname||t!==window.location.search||r!==l)&&i({pathname:n,search:t,hash:r},{...c,state:{origin:a},unstable_flushSync:!0}),e.props?.disableAutoScroll)return;requestAnimationFrame(()=>{if(r){const h=r.slice(1);p(h)}else window.scrollTo(0,0)})}}export{A as loadAndNavigate};
1
+ import{isLocalLink as f}from"../../../utils/path/is-local-link.js";import{isAuthRoutePath as m}from"../../../utils/auth/is-auth-route-path.js";import{withLoadProgress as u}from"./withLoadProgress";import{scrollToAnchor as p}from"./scroll-to-anchor";let s;async function A({navigate:i,to:o,origin:a="browser",options:c}){o===""&&(o="/"),s=o;const{pathname:n,hash:d,search:t}=new URL(o,window.location.origin+window.location.pathname),r=decodeURIComponent(d),l=decodeURIComponent(window.location.hash);if(m(n)){window.location.href=o;return}const w=window.__LOADER,e=await u(w.tryLoad(n,void 0,t));if(e?.redirectTo){if(!f(e.redirectTo)){window.location.href=e.redirectTo;return}return A({navigate:i,to:e.redirectTo,origin:a,options:c})}if(e&&s===o){if((n!==window.location.pathname||t!==window.location.search||r!==l)&&i({pathname:n,search:t,hash:r},{...c,state:{origin:a},unstable_flushSync:!0}),e.props?.disableAutoScroll)return;requestAnimationFrame(()=>{if(r){const h=r.slice(1);p(h)}else window.scrollTo(0,0)})}}export{A as loadAndNavigate};
@@ -1 +1 @@
1
- import{useEffect as c,useState as s}from"react";import{useNavigate as l}from"react-router-dom";import{isLocalLink as m}from"../../utils/path/is-local-link.js";import{isJsProtocolLink as a}from"../../utils/path/is-js-protocol-link.js";import{isAssetsLink as u}from"../../utils/path/is-assets-link.js";import{isHostnameOnDomain as f}from"../app/utils/isHostnameOnDomain.js";import{loadAndNavigate as d}from"../app/utils/loadAndNavigate.js";import{isForcedNavigationLinkClick as p}from"../utils/utils.js";export*from"./page-data/hooks.js";function E(){const e=l();c(()=>{const t=n=>{const i=n.target;if(i.tagName!=="A"||p(n,i.getAttribute("target")||""))return;const r=i.getAttribute("href");!m(r)||u(r)||a(r)||(n.preventDefault(),d({navigate:e,to:r||""}))};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t)}},[e])}function b(){const[e,t]=s(null);return c(()=>{if(process.env.NODE_ENV==="development"&&typeof window<"u"&&!o("localhost")&&!o("127.0.0.1")&&!o("")&&!o("redocly-local.com")&&!o("editor.redocly.xyz")&&!o("apps.codespaces.githubusercontent.com")&&!o("blueharvest.cloud")&&!o("bhstage.cloud")&&!o("cloud.redocly.com")&&!o("cloud.eu.redocly.com")&&!o("cba.au.redocly.com"))return t("Development mode is only allowed in localhost")},[typeof window]),e}function o(e){return f(window.location.hostname,e)}export{E as useRouterForLocalLinks,b as useRunningEnvironmentCheck};
1
+ import{useEffect as c,useState as s}from"react";import{useNavigate as l}from"react-router-dom";import{isLocalLink as u}from"../../utils/path/is-local-link.js";import{isJsProtocolLink as a}from"../../utils/path/is-js-protocol-link.js";import{isAssetsLink as m}from"../../utils/path/is-assets-link.js";import{isHostnameOnDomain as f}from"../app/utils/isHostnameOnDomain.js";import{loadAndNavigate as d}from"../app/utils/loadAndNavigate.js";import{isForcedNavigationLinkClick as p}from"../utils/utils.js";export*from"./page-data/hooks.js";function E(){const o=l();c(()=>{const r=t=>{if(t.defaultPrevented)return;const i=t.target;if(i.tagName!=="A"||p(t,i.getAttribute("target")||""))return;const n=i.getAttribute("href");!u(n)||m(n)||a(n)||(t.preventDefault(),d({navigate:o,to:n||""}))};return document.addEventListener("click",r),()=>{document.removeEventListener("click",r)}},[o])}function b(){const[o,r]=s(null);return c(()=>{if(process.env.NODE_ENV==="development"&&typeof window<"u"&&!e("localhost")&&!e("127.0.0.1")&&!e("")&&!e("redocly-local.com")&&!e("editor.redocly.xyz")&&!e("apps.codespaces.githubusercontent.com")&&!e("blueharvest.cloud")&&!e("bhstage.cloud")&&!e("cloud.redocly.com")&&!e("cloud.eu.redocly.com")&&!e("cba.au.redocly.com"))return r("Development mode is only allowed in localhost")},[typeof window]),o}function e(o){return f(window.location.hostname,o)}export{E as useRouterForLocalLinks,b as useRunningEnvironmentCheck};
@@ -3,22 +3,12 @@ export declare function useCollectMarkdocOptions({ markdown }: PageProps): {
3
3
  partials: Record<string, import("@markdoc/markdoc").Node | import("@markdoc/markdoc").Node[]> | undefined;
4
4
  variables?: Record<string, any>;
5
5
  tags: {
6
- [x: string]: (import("@markdoc/markdoc").Schema<Readonly<Partial<{
7
- nodes: Partial<Record<import("@markdoc/markdoc").NodeType, import("@markdoc/markdoc").Schema<Partial</*elided*/ any>, string>>>;
8
- tags: Record<string, import("@markdoc/markdoc").Schema>;
9
- variables: Record<string, any>;
10
- functions: Record<string, import("@markdoc/markdoc").ConfigFunction>;
11
- partials: Record<string, any>;
12
- validation?: {
13
- parents?: import("@markdoc/markdoc").Node[];
14
- validateFunctions?: boolean;
15
- environment?: string;
16
- };
17
- }>>, string> & {
6
+ [x: string]: import("@redocly/theme/markdoc/tags/types").MarkdocTagSchema | (import("@markdoc/markdoc").Schema & {
18
7
  attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
19
8
  resolver?: string;
20
9
  }>;
21
- }) | (import("@markdoc/markdoc").Schema & {
10
+ renderForLlms?: import("@redocly/theme/markdoc/tags/types").RenderForLlmsFn;
11
+ } & {
22
12
  dynamicComponentLib?: string;
23
13
  });
24
14
  };