@redocly/redoc-reef 0.141.0-next.10 → 0.141.0-next.12

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,38 @@
1
1
  # @redocly/redoc-reef
2
2
 
3
+ ## 0.141.0-next.12
4
+
5
+ ### Minor Changes
6
+
7
+ - f6a39b0a772: Renamed the MCP server credential tools to `create-anonymous-session`, `manage-api-credentials`, and `remove-api-credentials`.
8
+ - bdc8b09beb8: Removed the unused `SearchAiResponse` component from `@redocly/theme`. A custom theme that imports it no longer builds; import `SearchAiMessageContent` instead, which renders the AI search answer with its tool calls, citations and resources.
9
+
10
+ ### Patch Changes
11
+
12
+ - c725911e90f: Fixed an issue where OpenAPI docs pages displayed an empty space above the first heading when the project's styles displayed hidden SVG elements.
13
+ For example: `svg[aria-hidden="true"] { display: inline; }`.
14
+ - 51f0b0ecff0: Fixed catalog entity links that could open the wrong catalog or show a "Not found" page when an entity type's catalog was hidden.
15
+ Links in catalog cards, tables, relation graphs, and domain and owner properties open entities in the correct catalog.
16
+ - Updated dependencies [c725911e90f]
17
+ - Updated dependencies [51f0b0ecff0]
18
+ - Updated dependencies [3892e2b2e75]
19
+ - Updated dependencies [bdc8b09beb8]
20
+ - @redocly/theme@0.73.0-next.8
21
+ - @redocly/api-docs@0.6.0-next.12
22
+
23
+ ## 0.141.0-next.11
24
+
25
+ ### Patch Changes
26
+
27
+ - 805a2c44363: Fixed an issue where the version list in the sidebar stayed open after a click outside it.
28
+ - Updated dependencies [d4a818d3842]
29
+ - Updated dependencies [d4a818d3842]
30
+ - Updated dependencies [9b0d28400c3]
31
+ - Updated dependencies [805a2c44363]
32
+ - @redocly/api-docs@0.6.0-next.11
33
+ - @redocly/theme@0.73.0-next.7
34
+ - @redocly/portal-plugin-mock-server@0.26.0-next.4
35
+
3
36
  ## 0.141.0-next.10
4
37
 
5
38
  ### Patch Changes
@@ -1,7 +1,7 @@
1
- import type { OutgoingMessage } from '../../types';
1
+ import type { PreviewMessage } from '@redocly/platform-utils';
2
2
  export declare class PostMessageConnection {
3
3
  #private;
4
4
  constructor(source: any, origin: string);
5
- send(message: OutgoingMessage): void;
5
+ send(message: PreviewMessage): void;
6
6
  }
7
7
  //# sourceMappingURL=PostMessageConnection.d.ts.map
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { PropsWithChildren } from 'react';
3
- import type { OutgoingMessage } from '../../types';
3
+ import type { PreviewMessage } from '@redocly/platform-utils';
4
4
  type PostMessageProviderValue = {
5
- sendMessage: (message: OutgoingMessage) => void;
5
+ sendMessage: (message: PreviewMessage) => void;
6
6
  };
7
7
  type PostMessageProviderProps = PropsWithChildren<{
8
8
  enabled: boolean;
@@ -1,4 +1,4 @@
1
1
  export declare function usePostMessage(): {
2
- sendMessage: (message: import("../../types").OutgoingMessage) => void;
2
+ sendMessage: (message: import("@redocly/platform-utils").PreviewMessage) => void;
3
3
  };
4
4
  //# sourceMappingURL=use-post-message.d.ts.map
@@ -1,4 +1,3 @@
1
- export type * from './post-message';
2
1
  export type * from './dev-login';
3
2
  export * from './sidebar';
4
3
  export type * from './catalog';
@@ -45,7 +45,6 @@ declare function loadEnvConfig(): {
45
45
  REDOCLY_SSR_WORKERS_MAX?: number | undefined;
46
46
  NEW_CATALOG_ENABLED: boolean | undefined;
47
47
  NEW_SCORECARDS_ENABLED: boolean | undefined;
48
- ENABLE_COMMENTS?: string | undefined;
49
48
  REDOCLY_EXP_DISABLE_MD_VALIDATION: boolean | undefined;
50
49
  ENABLE_SOURCE_MAPS: boolean | undefined;
51
50
  PLAN_GATES?: string | undefined;
@@ -127,7 +126,6 @@ export declare const envConfig: {
127
126
  REDOCLY_SSR_WORKERS_MAX?: number | undefined;
128
127
  NEW_CATALOG_ENABLED: boolean | undefined;
129
128
  NEW_SCORECARDS_ENABLED: boolean | undefined;
130
- ENABLE_COMMENTS?: string | undefined;
131
129
  REDOCLY_EXP_DISABLE_MD_VALIDATION: boolean | undefined;
132
130
  ENABLE_SOURCE_MAPS: boolean | undefined;
133
131
  PLAN_GATES?: string | undefined;
@@ -76,7 +76,6 @@ export declare const envSchema: z.ZodObject<{
76
76
  false: "false";
77
77
  true: "true";
78
78
  }>>, z.ZodTransform<boolean | undefined, "false" | "true" | undefined>>;
79
- ENABLE_COMMENTS: z.ZodOptional<z.ZodString>;
80
79
  REDOCLY_EXP_DISABLE_MD_VALIDATION: z.ZodPipe<z.ZodOptional<z.ZodEnum<{
81
80
  false: "false";
82
81
  true: "true";
@@ -11,7 +11,6 @@ export declare const featureFlagsSchema: z.ZodObject<{
11
11
  false: "false";
12
12
  true: "true";
13
13
  }>>, z.ZodTransform<boolean | undefined, "false" | "true" | undefined>>;
14
- ENABLE_COMMENTS: z.ZodOptional<z.ZodString>;
15
14
  REDOCLY_EXP_DISABLE_MD_VALIDATION: z.ZodPipe<z.ZodOptional<z.ZodEnum<{
16
15
  false: "false";
17
16
  true: "true";
@@ -1 +1 @@
1
- import{z as _}from"zod";import{envBooleanStringOptional as E}from"../../utils/envs/env-boolean-string.js";const o=_.object({NEW_CATALOG_ENABLED:E(),NEW_SCORECARDS_ENABLED:E(),ENABLE_COMMENTS:_.string().optional(),REDOCLY_EXP_DISABLE_MD_VALIDATION:E(),ENABLE_SOURCE_MAPS:E(),PLAN_GATES:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED:E(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT:_.string().optional(),REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED:E(),REDOCLY_EXP_REPLAY_ASYNCAPI_ENABLED:E()});export{o as featureFlagsSchema};
1
+ import{z as _}from"zod";import{envBooleanStringOptional as E}from"../../utils/envs/env-boolean-string.js";const D=_.object({NEW_CATALOG_ENABLED:E(),NEW_SCORECARDS_ENABLED:E(),REDOCLY_EXP_DISABLE_MD_VALIDATION:E(),ENABLE_SOURCE_MAPS:E(),PLAN_GATES:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_ENABLED:E(),REDOCLY_EXP_LLMSTXT_AGENT_FEEDBACK_URL:_.string().optional(),REDOCLY_EXP_LLMSTXT_AGENT_ENDPOINT:_.string().optional(),REDOCLY_EXP_REPLAY_GRAPHQL_ENABLED:E(),REDOCLY_EXP_REPLAY_ASYNCAPI_ENABLED:E()});export{D as featureFlagsSchema};
@@ -1,3 +1,3 @@
1
- import{context as m}from"esbuild";import{mkdirSync as j,writeFileSync as Y,existsSync as b}from"node:fs";import*as l from"node:path";import{RUNTIME_RESOURCES_DIR as M,TELEMETRY_ENABLED as k}from"../constants/common.js";import{fromCurrentDir as r}from"../utils/paths.js";import{NodeBrowserPlugin as C}from"./plugins/node-browser.js";import{PortalImport as a}from"./plugins/portal-import.js";import{ThemesResolver as u}from"./plugins/themes-resolver.js";import{AssetsResolver as E}from"./plugins/assets-resolver.js";import{EsbuildErrorCollector as R}from"./plugins/esbuild-compile-resolver.js";import{ServerPropsResolver as _}from"./plugins/server-props-resolver.js";import{StyledComponentsSSR as d}from"./plugins/styled-components-ssr.js";import{DependencyResolver as v}from"./plugins/dependency-resolver.js";import{YamlLoader as f}from"./plugins/yaml-loader.js";import{ApiRequestHandlersResolver as T}from"./plugins/api-request-handlers-resolver.js";import{McpToolHandlersResolver as P}from"./plugins/mcp-tool-handlers-resolver.js";import{MiddlewareResolver as S}from"./plugins/middleware-resolver.js";import{OnRebuild as D}from"./plugins/on-rebuild.js";import{getPublicEnvVariables as V}from"../utils/envs/get-public-env-variables.js";import{PORTAL_VERSION as A}from"../version.js";import{AsyncApiPatch as L}from"./plugins/async-api-patch.js";import{telemetryTraceStep as I}from"../../cli/telemetry/helpers/trace-step.js";import{initServerRebuildTrigger as $}from"./generate.js";const y={bundle:!0,format:"esm",chunkNames:"chunks/[name]-[hash]"};function N(e){const o=l.join(e,"tsconfig.json");return b(o)?o:void 0}const p=new Set;async function pe(){await Promise.all([...p].map(e=>e.dispose())),p.clear()}async function me(e,o,t="production",n){return await I("com.redocly.build.createClientCompiler",async()=>{const c=V(),i={};Object.entries(c).map(([g,h])=>i[`process.env.${g}`]=JSON.stringify(h));const s=[...n?[D(n)]:[],C({path:"path-browserify",fs:"{}",tty:"tty-browserify",os:"os-browserify",http:"stream-http",https:"stream-http",readline:"{}",crypto:"{}",stream:"{}",zlib:"{}","https-proxy-agent":"{}"}),u(e,e.contentDir),E(e,e.contentDir),R(e,e.contentDir),_(e),v(),a(),f(),L(),d()],w=[r(import.meta.url,"../../client/browser-entry.js"),r(import.meta.url,"../../client/user-tags-entry.js")],O=await m({...y,entryPoints:w,outdir:l.join(o,M),sourcemap:t!=="production"&&process.env.ENABLE_SOURCE_MAPS==="true",plugins:s,tsconfig:N(e.contentDir),mainFields:["browser","module","main"],metafile:t!=="production",minify:t==="production",splitting:!0,external:["constants","zlib","stream","https","vm","module","worker_threads","child_process","@swc/core"],inject:[process.env.INSPECT_MODE==="true"?r(import.meta.url,"../../client/inspect-mode-hooks.js"):"",r(import.meta.url,"./web-shim.js")].filter(Boolean),define:{...i,"process.env.NODE_ENV":`"${t}"`,"process.env.REDOCLY_FIRST_PARTY":'"true"',...process.env.REDOCLY_INTERNAL_DEV!==void 0&&{"process.env.REDOCLY_INTERNAL_DEV":`"${process.env.REDOCLY_INTERNAL_DEV}"`},"process.env.SERVER_EDITOR_APP_URL":`"${process.env.SERVER_EDITOR_APP_URL}"`,"process.env.ENABLE_COMMENTS":`"${process.env.ENABLE_COMMENTS}"`,"process.env.REDOCLY_TELEMETRY":k?'"on"':'"off"',"process.env.REDOCLY_PORTAL_VERSION":`"${A}"`,"process.env":`{"NODE_ENV": "${t}"}`,"process.platform":'"browser"',"process.browser":"true","module.hot":"false",global:"{}",...process.env.REDOCLY_PREFIX_PATHS&&{"process.env.REDOCLY_PREFIX_PATHS":`"${process.env.REDOCLY_PREFIX_PATHS}"`},...process.env.INSPECT_MODE==="true"&&{"process.env.INSPECT_MODE":`${process.env.INSPECT_MODE}`},...process.env.MAIN_API_URL&&{"process.env.MAIN_API_URL":`"${process.env.MAIN_API_URL}"`}},logLevel:"silent"});return p.add(O),O})}async function le(e,o,t="development",n){j(o,{recursive:!0}),$(o),Y(l.join(o,"package.json"),JSON.stringify({name:"@redocly/portal/server-cache",type:"module"}));const c=[...n?[D(n)]:[],u(e,e.contentDir),E(e,e.contentDir),R(e,e.contentDir),_(e),T(e),P(e),S(e),v(),a(),f(),L(),d()],i=[{in:r(import.meta.url,"../../client/server-entry.js"),out:"server-entry"},{in:r(import.meta.url,"../../client/user-tags-entry.js"),out:"user-tags-entry"},{in:r(import.meta.url,"../../client/server-props-entry.js"),out:"server-props-entry"},{in:r(import.meta.url,"../../client/api-request-handlers-entry.js"),out:"api-request-handlers-entry"},{in:r(import.meta.url,"../../client/api-docs-builder-entry.js"),out:"api-docs-builder-entry"},{in:r(import.meta.url,"../workers/mcp-tool-worker.js"),out:"mcp-tool-worker"},{in:r(import.meta.url,"../../client/mcp-tool-handlers-entry.js"),out:"mcp-tool-handlers-entry"},{in:r(import.meta.url,"../../client/middleware-entry.js"),out:"middleware-entry"}],s=await m({...y,entryPoints:i,outdir:o,plugins:c,sourcemap:t!=="production"&&process.env.ENABLE_SOURCE_MAPS==="true",minify:t==="production",tsconfig:N(e.contentDir),mainFields:["module","main"],splitting:!0,external:["react","react-router","@dr.pogodin/react-helmet","@swc/core","pnpapi","canvas"],banner:{js:`import { createRequire as topLevelCreateRequire } from 'module';
2
- const require = topLevelCreateRequire(import.meta.url);`},platform:"node",define:{"process.env.NODE_ENV":`"${t}"`,"process.env.REDOCLY_FIRST_PARTY":'"true"',...process.env.REDOCLY_INTERNAL_DEV!==void 0&&{"process.env.REDOCLY_INTERNAL_DEV":`"${process.env.REDOCLY_INTERNAL_DEV}"`},"module.hot":"false"},logLevel:"silent"});return p.add(s),s}async function ae(e,o,t="production",n){return await I("com.redocly.build.createServerCompiler",async()=>{const c=[...n?[D(n)]:[],C({"node-fetch":"{}",webpack:"{}"}),u(e,e.contentDir),E(e,e.contentDir),R(e,e.contentDir),_(e),T(e),P(e),S(e),v(),a(),f(),L(),d()],i=[{in:r(import.meta.url,"../node-bundle-entry.js"),out:"index"},{in:r(import.meta.url,"../../client/user-tags-entry.js"),out:"user-tags-entry"},{in:r(import.meta.url,"../../client/api-docs-builder-entry.js"),out:"api-docs-builder-entry"},{in:r(import.meta.url,"../workers/api-routes-worker.js"),out:"api-routes-worker"},{in:r(import.meta.url,"../workers/scorecards-worker.js"),out:"scorecards-worker"},{in:r(import.meta.url,"../workers/mcp-tool-worker.js"),out:"mcp-tool-worker"}],s=await m({...y,entryPoints:i,outExtension:{".js":".mjs"},outdir:o,platform:"node",plugins:c,tsconfig:N(e.contentDir),mainFields:["module","main"],metafile:t!=="production",minify:t==="production",splitting:!1,define:{"process.env.NODE_ENV":`"${t}"`,"process.env.REDOCLY_FIRST_PARTY":'"true"',...process.env.REDOCLY_INTERNAL_DEV!==void 0&&{"process.env.REDOCLY_INTERNAL_DEV":`"${process.env.REDOCLY_INTERNAL_DEV}"`},"process.env.REDOCLY_EXECUTION_MODE":'"runtime"',"process.env.REDOCLY_PORTAL_VERSION":`"${A}"`,"module.hot":"false",...process.env.REDOCLY_PREFIX_PATHS&&{"process.env.REDOCLY_PREFIX_PATHS":`"${process.env.REDOCLY_PREFIX_PATHS}"`}},banner:{js:`import { createRequire as topLevelCreateRequire } from 'module';
1
+ import{context as m}from"esbuild";import{mkdirSync as j,writeFileSync as Y,existsSync as b}from"node:fs";import*as l from"node:path";import{RUNTIME_RESOURCES_DIR as k,TELEMETRY_ENABLED as V}from"../constants/common.js";import{fromCurrentDir as r}from"../utils/paths.js";import{NodeBrowserPlugin as C}from"./plugins/node-browser.js";import{PortalImport as a}from"./plugins/portal-import.js";import{ThemesResolver as u}from"./plugins/themes-resolver.js";import{AssetsResolver as E}from"./plugins/assets-resolver.js";import{EsbuildErrorCollector as R}from"./plugins/esbuild-compile-resolver.js";import{ServerPropsResolver as d}from"./plugins/server-props-resolver.js";import{StyledComponentsSSR as _}from"./plugins/styled-components-ssr.js";import{DependencyResolver as v}from"./plugins/dependency-resolver.js";import{YamlLoader as f}from"./plugins/yaml-loader.js";import{ApiRequestHandlersResolver as T}from"./plugins/api-request-handlers-resolver.js";import{McpToolHandlersResolver as P}from"./plugins/mcp-tool-handlers-resolver.js";import{MiddlewareResolver as I}from"./plugins/middleware-resolver.js";import{OnRebuild as D}from"./plugins/on-rebuild.js";import{getPublicEnvVariables as M}from"../utils/envs/get-public-env-variables.js";import{PORTAL_VERSION as S}from"../version.js";import{AsyncApiPatch as y}from"./plugins/async-api-patch.js";import{telemetryTraceStep as A}from"../../cli/telemetry/helpers/trace-step.js";import{initServerRebuildTrigger as $}from"./generate.js";const L={bundle:!0,format:"esm",chunkNames:"chunks/[name]-[hash]"};function N(e){const o=l.join(e,"tsconfig.json");return b(o)?o:void 0}const p=new Set;async function pe(){await Promise.all([...p].map(e=>e.dispose())),p.clear()}async function me(e,o,t="production",n){return await A("com.redocly.build.createClientCompiler",async()=>{const c=M(),i={};Object.entries(c).map(([g,h])=>i[`process.env.${g}`]=JSON.stringify(h));const s=[...n?[D(n)]:[],C({path:"path-browserify",fs:"{}",tty:"tty-browserify",os:"os-browserify",http:"stream-http",https:"stream-http",readline:"{}",crypto:"{}",stream:"{}",zlib:"{}","https-proxy-agent":"{}"}),u(e,e.contentDir),E(e,e.contentDir),R(e,e.contentDir),d(e),v(),a(),f(),y(),_()],w=[r(import.meta.url,"../../client/browser-entry.js"),r(import.meta.url,"../../client/user-tags-entry.js")],O=await m({...L,entryPoints:w,outdir:l.join(o,k),sourcemap:t!=="production"&&process.env.ENABLE_SOURCE_MAPS==="true",plugins:s,tsconfig:N(e.contentDir),mainFields:["browser","module","main"],metafile:t!=="production",minify:t==="production",splitting:!0,external:["constants","zlib","stream","https","vm","module","worker_threads","child_process","@swc/core"],inject:[process.env.INSPECT_MODE==="true"?r(import.meta.url,"../../client/inspect-mode-hooks.js"):"",r(import.meta.url,"./web-shim.js")].filter(Boolean),define:{...i,"process.env.NODE_ENV":`"${t}"`,"process.env.REDOCLY_FIRST_PARTY":'"true"',...process.env.REDOCLY_INTERNAL_DEV!==void 0&&{"process.env.REDOCLY_INTERNAL_DEV":`"${process.env.REDOCLY_INTERNAL_DEV}"`},"process.env.SERVER_EDITOR_APP_URL":`"${process.env.SERVER_EDITOR_APP_URL}"`,"process.env.REDOCLY_TELEMETRY":V?'"on"':'"off"',"process.env.REDOCLY_PORTAL_VERSION":`"${S}"`,"process.env":`{"NODE_ENV": "${t}"}`,"process.platform":'"browser"',"process.browser":"true","module.hot":"false",global:"{}",...process.env.REDOCLY_PREFIX_PATHS&&{"process.env.REDOCLY_PREFIX_PATHS":`"${process.env.REDOCLY_PREFIX_PATHS}"`},...process.env.INSPECT_MODE==="true"&&{"process.env.INSPECT_MODE":`${process.env.INSPECT_MODE}`},...process.env.MAIN_API_URL&&{"process.env.MAIN_API_URL":`"${process.env.MAIN_API_URL}"`}},logLevel:"silent"});return p.add(O),O})}async function le(e,o,t="development",n){j(o,{recursive:!0}),$(o),Y(l.join(o,"package.json"),JSON.stringify({name:"@redocly/portal/server-cache",type:"module"}));const c=[...n?[D(n)]:[],u(e,e.contentDir),E(e,e.contentDir),R(e,e.contentDir),d(e),T(e),P(e),I(e),v(),a(),f(),y(),_()],i=[{in:r(import.meta.url,"../../client/server-entry.js"),out:"server-entry"},{in:r(import.meta.url,"../../client/user-tags-entry.js"),out:"user-tags-entry"},{in:r(import.meta.url,"../../client/server-props-entry.js"),out:"server-props-entry"},{in:r(import.meta.url,"../../client/api-request-handlers-entry.js"),out:"api-request-handlers-entry"},{in:r(import.meta.url,"../../client/api-docs-builder-entry.js"),out:"api-docs-builder-entry"},{in:r(import.meta.url,"../workers/mcp-tool-worker.js"),out:"mcp-tool-worker"},{in:r(import.meta.url,"../../client/mcp-tool-handlers-entry.js"),out:"mcp-tool-handlers-entry"},{in:r(import.meta.url,"../../client/middleware-entry.js"),out:"middleware-entry"}],s=await m({...L,entryPoints:i,outdir:o,plugins:c,sourcemap:t!=="production"&&process.env.ENABLE_SOURCE_MAPS==="true",minify:t==="production",tsconfig:N(e.contentDir),mainFields:["module","main"],splitting:!0,external:["react","react-router","@dr.pogodin/react-helmet","@swc/core","pnpapi","canvas"],banner:{js:`import { createRequire as topLevelCreateRequire } from 'module';
2
+ const require = topLevelCreateRequire(import.meta.url);`},platform:"node",define:{"process.env.NODE_ENV":`"${t}"`,"process.env.REDOCLY_FIRST_PARTY":'"true"',...process.env.REDOCLY_INTERNAL_DEV!==void 0&&{"process.env.REDOCLY_INTERNAL_DEV":`"${process.env.REDOCLY_INTERNAL_DEV}"`},"module.hot":"false"},logLevel:"silent"});return p.add(s),s}async function ae(e,o,t="production",n){return await A("com.redocly.build.createServerCompiler",async()=>{const c=[...n?[D(n)]:[],C({"node-fetch":"{}",webpack:"{}"}),u(e,e.contentDir),E(e,e.contentDir),R(e,e.contentDir),d(e),T(e),P(e),I(e),v(),a(),f(),y(),_()],i=[{in:r(import.meta.url,"../node-bundle-entry.js"),out:"index"},{in:r(import.meta.url,"../../client/user-tags-entry.js"),out:"user-tags-entry"},{in:r(import.meta.url,"../../client/api-docs-builder-entry.js"),out:"api-docs-builder-entry"},{in:r(import.meta.url,"../workers/api-routes-worker.js"),out:"api-routes-worker"},{in:r(import.meta.url,"../workers/scorecards-worker.js"),out:"scorecards-worker"},{in:r(import.meta.url,"../workers/mcp-tool-worker.js"),out:"mcp-tool-worker"}],s=await m({...L,entryPoints:i,outExtension:{".js":".mjs"},outdir:o,platform:"node",plugins:c,tsconfig:N(e.contentDir),mainFields:["module","main"],metafile:t!=="production",minify:t==="production",splitting:!1,define:{"process.env.NODE_ENV":`"${t}"`,"process.env.REDOCLY_FIRST_PARTY":'"true"',...process.env.REDOCLY_INTERNAL_DEV!==void 0&&{"process.env.REDOCLY_INTERNAL_DEV":`"${process.env.REDOCLY_INTERNAL_DEV}"`},"process.env.REDOCLY_EXECUTION_MODE":'"runtime"',"process.env.REDOCLY_PORTAL_VERSION":`"${S}"`,"module.hot":"false",...process.env.REDOCLY_PREFIX_PATHS&&{"process.env.REDOCLY_PREFIX_PATHS":`"${process.env.REDOCLY_PREFIX_PATHS}"`}},banner:{js:`import { createRequire as topLevelCreateRequire } from 'module';
3
3
  const require = topLevelCreateRequire(import.meta.url);`},logLevel:"silent"});return p.add(s),s})}export{me as createClientCompiler,ae as createNodeBundleCompiler,le as createServerCompiler,pe as stopAllCompilers};
@@ -1 +1 @@
1
- import{EXECUTE_TOOL_NAME as o}from"../constants.js";import{buildExecuteDescription as i}from"../prompts.js";const e="Execute code";function s(t){return t.readOnlyHint?"Query the docs with code":e}const a={name:o,title:e,description:i(!1),schema:{type:"object",required:["code","description"],additionalProperties:!1,properties:{code:{type:"string",description:"JavaScript to run in the sandbox. Return a value to receive it as the result.",minLength:1},description:{type:"string",description:"A short, human-readable summary of what this code does.",minLength:1},sessionHandle:{type:"string",description:"Handle returned by createAnonymousSession. Required when an API needs credentials. This parameter is only offered when createAnonymousSession is available, so pass it whenever you have called that tool.",minLength:1}}},outputSchema:{type:"object",properties:{result:{description:"The value the code returned, as JSON"},error:{type:"string",description:"Why the code failed. Set only on a failed call"}}}};export{a as EXECUTE_TOOL_SCHEMA,s as executeToolTitle};
1
+ import{EXECUTE_TOOL_NAME as o}from"../constants.js";import{buildExecuteDescription as i}from"../prompts.js";const e="Execute code";function s(t){return t.readOnlyHint?"Query the docs with code":e}const a={name:o,title:e,description:i(!1),schema:{type:"object",required:["code","description"],additionalProperties:!1,properties:{code:{type:"string",description:"JavaScript to run in the sandbox. Return a value to receive it as the result.",minLength:1},description:{type:"string",description:"A short, human-readable summary of what this code does.",minLength:1},sessionHandle:{type:"string",description:"Handle returned by `create-anonymous-session`. Required when an API needs credentials. This parameter is only offered when `create-anonymous-session` is available, so pass it whenever you have called that tool.",minLength:1}}},outputSchema:{type:"object",properties:{result:{description:"The value the code returned, as JSON"},error:{type:"string",description:"Why the code failed. Set only on a failed call"}}}};export{a as EXECUTE_TOOL_SCHEMA,s as executeToolTitle};
@@ -1,2 +1,2 @@
1
- import{MANAGE_API_CREDENTIALS_TOOL_NAME as P}from"../../constants.js";import{acceptedCredentialsLink as k,buildCredentialsAcceptedHint as w,buildUpstreamCredentialFallback as S,buildUpstreamCredentialInputRequired as I,credentialElicitationAnswer as E,dedupeElicitation as C,isStatelessRequest as j,schemeLabelOf as q,supportsUrlElicitation as T}from"../../gateway-mcp/elicitation.js";import{getCallableApis as u,isFetchCapable as H}from"../../gateway-mcp/callable-apis.js";import{secretStore as R}from"../../gateway-mcp/secret-store.js";import{MISSING_SESSION_HANDLE_MESSAGE as U,resolveSecretSubject as $}from"../../gateway-mcp/subject.js";import{upstreamAuthKey as L}from"../../gateway-mcp/upstream-auth.js";import{resolveUpstreamApiAuth as N}from"../../gateway-mcp/upstream-auth-scheme.js";import{apiTitleKey as O,countApiTitles as _}from"../../docs-mcp/utils/api-titles.js";function Q(e){return!!e.elicitationEnabled&&H(e)}function V(e){const s=u(e),t=s.map(r=>r.relativePath),i=[...t,...M(s)];return{name:P,title:"Manage API credentials",description:["Get a secure link where the user sets, replaces, or removes the credentials this server sends to a documented API.","Call it when the user wants to change or clear an API key, or when a tool result tells you the stored credentials were rejected.","The link covers every credential the API accepts, so scheme is optional - pass it only when a tool result names the scheme that was rejected.","It returns a link for the user to open - never ask for the secret in the conversation and never pass it as an argument."].join(`
2
- `),annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},schema:{type:"object",required:["api"],additionalProperties:!1,properties:{api:{type:"string",description:`The API to manage credentials for: its \`filePath\` or the \`name\` from \`listApis\`.${t.length>0?` The file paths are: ${t.join(", ")}.`:""}`,minLength:1,...i.length>0?{enum:i}:{}},scheme:{type:"string",description:"Name of the security scheme to manage the credential for, as named in the API description (a tool result that reports a rejected credential names it). Omit it to let the link cover every scheme the API accepts.",minLength:1},sessionHandle:{type:"string",description:"Handle returned by createAnonymousSession. Required while the caller is anonymous, so the credentials are stored against the same subject the API calls use.",minLength:1}}}}}function M(e){const s=_(e);return e.map(t=>t.name).filter(t=>s.get(O(t))===1)}function X(e,s){return async(t,i)=>{const r=$(e.user,typeof t.sessionHandle=="string"?t.sessionHandle:void 0);if(r.kind==="invalid")return m(r.message);if(r.kind==="anonymous")return m(U);const{subject:c}=r,p=typeof t.api=="string"?t.api:"",n=u(e).find(l=>l.relativePath===p||l.name===p);if(!n){const l=u(e).map(b=>b.relativePath).join(", ");return m(`Unknown api "${p}". Credentials can only be managed for the APIs this server can call: ${l||"none"}.`)}const d=E(i.mcpReq.inputResponses);if(d==="accepted"){const l=await k(i.mcpReq.requestState(),{kv:await s.getKv(),subject:c,baseUrl:e.baseUrl??"",apis:[n.relativePath]});return{content:[{type:"text",text:w(n.name,l?.url)}],isError:!1}}if(d==="declined")return{content:[{type:"text",text:`The user declined the credentials prompt for the "${n.name}" API, so this call minted no link.`}],isError:!1};const a=await N(e,n.relativePath),o=typeof t.scheme=="string"?t.scheme:void 0,y=Object.keys(a.schemes);if(o&&!a.schemes[o])return m(`Unknown scheme "${o}" for api "${n.relativePath}". The security schemes this server can store credentials for are: ${y.join(", ")}.`);const h=o??a.defaultScheme,f=o?q(a.schemes,o):void 0,A=await s.getKv(),v={subject:c,baseUrl:e.baseUrl??"",target:{api:n.relativePath,name:n.name,scheme:h,...f?{schemeLabel:f}:{}},auth:a.schemes[h],apiAuth:a,kv:A,hasExistingSecret:await R.hasSecret(A,c,n.relativePath,h),reason:{kind:"requested"}};if(j(i.mcpReq)&&T(s.getClientCapabilities()))return await I(v);const g=L({api:n.relativePath,scheme:h});return{content:[{type:"text",text:await C(`${c}:${g}`,()=>S(v))}],isError:!1}}}function m(e){return{content:[{type:"text",text:e}],isError:!0}}export{Q as isManageApiCredentialsToolAvailable,X as manageApiCredentials,V as manageApiCredentialsSchema};
1
+ import{MANAGE_API_CREDENTIALS_TOOL_NAME as P}from"../../constants.js";import{acceptedCredentialsLink as k,buildCredentialsAcceptedHint as w,buildUpstreamCredentialFallback as I,buildUpstreamCredentialInputRequired as S,credentialElicitationAnswer as E,dedupeElicitation as C,isStatelessRequest as j,schemeLabelOf as q,supportsUrlElicitation as T}from"../../gateway-mcp/elicitation.js";import{getCallableApis as u,isFetchCapable as H}from"../../gateway-mcp/callable-apis.js";import{secretStore as R}from"../../gateway-mcp/secret-store.js";import{MISSING_SESSION_HANDLE_MESSAGE as U,resolveSecretSubject as $}from"../../gateway-mcp/subject.js";import{upstreamAuthKey as L}from"../../gateway-mcp/upstream-auth.js";import{resolveUpstreamApiAuth as N}from"../../gateway-mcp/upstream-auth-scheme.js";import{apiTitleKey as O,countApiTitles as _}from"../../docs-mcp/utils/api-titles.js";function Q(e){return!!e.elicitationEnabled&&H(e)}function V(e){const s=u(e),t=s.map(r=>r.relativePath),i=[...t,...M(s)];return{name:P,title:"Manage API credentials",description:["Get a secure link where the user sets, replaces, or removes the credentials this server sends to a documented API.","Call it when the user wants to change or clear an API key, or when a tool result tells you the stored credentials were rejected.","The link covers every credential the API accepts, so scheme is optional - pass it only when a tool result names the scheme that was rejected.","It returns a link for the user to open - never ask for the secret in the conversation and never pass it as an argument."].join(`
2
+ `),annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},schema:{type:"object",required:["api"],additionalProperties:!1,properties:{api:{type:"string",description:`The API to manage credentials for: its \`filePath\` or the \`name\` from \`listApis\`.${t.length>0?` The file paths are: ${t.join(", ")}.`:""}`,minLength:1,...i.length>0?{enum:i}:{}},scheme:{type:"string",description:"Name of the security scheme to manage the credential for, as named in the API description (a tool result that reports a rejected credential names it). Omit it to let the link cover every scheme the API accepts.",minLength:1},sessionHandle:{type:"string",description:"Handle returned by `create-anonymous-session`. Required while the caller is anonymous, so the credentials are stored against the same subject the API calls use.",minLength:1}}}}}function M(e){const s=_(e);return e.map(t=>t.name).filter(t=>s.get(O(t))===1)}function X(e,s){return async(t,i)=>{const r=$(e.user,typeof t.sessionHandle=="string"?t.sessionHandle:void 0);if(r.kind==="invalid")return m(r.message);if(r.kind==="anonymous")return m(U);const{subject:c}=r,p=typeof t.api=="string"?t.api:"",n=u(e).find(l=>l.relativePath===p||l.name===p);if(!n){const l=u(e).map(b=>b.relativePath).join(", ");return m(`Unknown api "${p}". Credentials can only be managed for the APIs this server can call: ${l||"none"}.`)}const d=E(i.mcpReq.inputResponses);if(d==="accepted"){const l=await k(i.mcpReq.requestState(),{kv:await s.getKv(),subject:c,baseUrl:e.baseUrl??"",apis:[n.relativePath]});return{content:[{type:"text",text:w(n.name,l?.url)}],isError:!1}}if(d==="declined")return{content:[{type:"text",text:`The user declined the credentials prompt for the "${n.name}" API, so this call minted no link.`}],isError:!1};const a=await N(e,n.relativePath),o=typeof t.scheme=="string"?t.scheme:void 0,y=Object.keys(a.schemes);if(o&&!a.schemes[o])return m(`Unknown scheme "${o}" for api "${n.relativePath}". The security schemes this server can store credentials for are: ${y.join(", ")}.`);const h=o??a.defaultScheme,f=o?q(a.schemes,o):void 0,A=await s.getKv(),v={subject:c,baseUrl:e.baseUrl??"",target:{api:n.relativePath,name:n.name,scheme:h,...f?{schemeLabel:f}:{}},auth:a.schemes[h],apiAuth:a,kv:A,hasExistingSecret:await R.hasSecret(A,c,n.relativePath,h),reason:{kind:"requested"}};if(j(i.mcpReq)&&T(s.getClientCapabilities()))return await S(v);const g=L({api:n.relativePath,scheme:h});return{content:[{type:"text",text:await C(`${c}:${g}`,()=>I(v))}],isError:!1}}}function m(e){return{content:[{type:"text",text:e}],isError:!0}}export{Q as isManageApiCredentialsToolAvailable,X as manageApiCredentials,V as manageApiCredentialsSchema};
@@ -13,9 +13,9 @@ export declare const MCP_PROTOCOL_VERSION = "2025-11-25";
13
13
  export declare const SSE_KEEPALIVE_INTERVAL_MS = 15000;
14
14
  export declare const DEFAULT_DOCS_MCP_SERVER_NAME = "Docs MCP server";
15
15
  export declare const SUPPORTED_MCP_SCOPES: readonly ['openid', 'profile', 'email', 'offline_access'];
16
- export declare const CREATE_ANONYMOUS_SESSION_TOOL_NAME = "createAnonymousSession";
16
+ export declare const CREATE_ANONYMOUS_SESSION_TOOL_NAME = "create-anonymous-session";
17
17
  export declare const SUBMIT_FEEDBACK_TOOL_NAME = "submit-feedback";
18
- export declare const MANAGE_API_CREDENTIALS_TOOL_NAME = "manageApiCredentials";
18
+ export declare const MANAGE_API_CREDENTIALS_TOOL_NAME = "manage-api-credentials";
19
19
  export declare const READ_ONLY_ANNOTATIONS: ToolAnnotations;
20
20
  export declare const CUSTOM_MCP_TOOLS_META_DIR = "custom-mcp-tools-meta";
21
21
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- import{LATEST_PROTOCOL_VERSION as o}from"@modelcontextprotocol/server";const t={Docs:"docs"},r={InternalError:-32603,ServerError:-32e3,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602},_=o,s=15e3,E="Docs MCP server",n=["openid","profile","email","offline_access"],O="createAnonymousSession",c="submit-feedback",S="manageApiCredentials",A={readOnlyHint:!0,destructiveHint:!1,openWorldHint:!1},p="custom-mcp-tools-meta";export{O as CREATE_ANONYMOUS_SESSION_TOOL_NAME,p as CUSTOM_MCP_TOOLS_META_DIR,E as DEFAULT_DOCS_MCP_SERVER_NAME,S as MANAGE_API_CREDENTIALS_TOOL_NAME,_ as MCP_PROTOCOL_VERSION,r as McpErrorCodes,t as McpServerType,A as READ_ONLY_ANNOTATIONS,s as SSE_KEEPALIVE_INTERVAL_MS,c as SUBMIT_FEEDBACK_TOOL_NAME,n as SUPPORTED_MCP_SCOPES};
1
+ import{LATEST_PROTOCOL_VERSION as o}from"@modelcontextprotocol/server";const t={Docs:"docs"},r={InternalError:-32603,ServerError:-32e3,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602},s=o,_=15e3,E="Docs MCP server",n=["openid","profile","email","offline_access"],O="create-anonymous-session",c="submit-feedback",S="manage-api-credentials",p={readOnlyHint:!0,destructiveHint:!1,openWorldHint:!1},A="custom-mcp-tools-meta";export{O as CREATE_ANONYMOUS_SESSION_TOOL_NAME,A as CUSTOM_MCP_TOOLS_META_DIR,E as DEFAULT_DOCS_MCP_SERVER_NAME,S as MANAGE_API_CREDENTIALS_TOOL_NAME,s as MCP_PROTOCOL_VERSION,r as McpErrorCodes,t as McpServerType,p as READ_ONLY_ANNOTATIONS,_ as SSE_KEEPALIVE_INTERVAL_MS,c as SUBMIT_FEEDBACK_TOOL_NAME,n as SUPPORTED_MCP_SCOPES};
@@ -2,7 +2,7 @@ import type { McpToolContext, McpToolHandler } from '../../../types.js';
2
2
  export type CreateAnonymousSessionArgs = Record<string, never>;
3
3
  export declare function isAnonymousSessionToolAvailable(context: McpToolContext): boolean;
4
4
  declare const _default: {
5
- createAnonymousSession: {
5
+ "create-anonymous-session": {
6
6
  execute: McpToolHandler<CreateAnonymousSessionArgs>;
7
7
  isAvailable: typeof isAnonymousSessionToolAvailable;
8
8
  };
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- createAnonymousSession: {
2
+ "create-anonymous-session": {
3
3
  execute: import("../../types.js").McpToolHandler<import("./core/create-anonymous-session.js").CreateAnonymousSessionArgs>;
4
4
  isAvailable: typeof import("./core/create-anonymous-session.js").isAnonymousSessionToolAvailable;
5
5
  };
@@ -1,8 +1,8 @@
1
1
  import type { ApiFunctionsUser } from '@redocly/config';
2
2
  export declare const ANONYMOUS_SUBJECT_PREFIX = "anon:";
3
3
  export declare const USER_SUBJECT_PREFIX = "user:";
4
- export declare const MISSING_SESSION_HANDLE_MESSAGE = "This API requires credentials and the caller is anonymous; call createAnonymousSession first, then retry with sessionHandle";
5
- export declare const MALFORMED_SESSION_HANDLE_MESSAGE = "The sessionHandle is not a valid handle; call createAnonymousSession to obtain one";
4
+ export declare const MISSING_SESSION_HANDLE_MESSAGE = "This API requires credentials and the caller is anonymous; call `create-anonymous-session` first, then retry with sessionHandle";
5
+ export declare const MALFORMED_SESSION_HANDLE_MESSAGE = "The sessionHandle is not a valid handle; call `create-anonymous-session` to obtain one";
6
6
  export type SubjectResolution = {
7
7
  kind: 'resolved';
8
8
  subject: string;
@@ -1 +1 @@
1
- import{randomBytes as r}from"node:crypto";const i=32,S=/^[A-Za-z0-9_-]{43}$/,c=1440*60,u=10080*60,s="anon:",d="user:",f="This API requires credentials and the caller is anonymous; call createAnonymousSession first, then retry with sessionHandle",a="The sessionHandle is not a valid handle; call createAnonymousSession to obtain one";function N(){return r(i).toString("base64url")}function E(e){return S.test(e)}function l(e){if(!e?.isAuthenticated)return;const n=e.claims,o=(typeof n?.sub=="string"&&n.sub?n.sub:void 0)??(e.email||void 0);if(o)return`${d}${e.idpId??"local"}:${o}`}function A(e,n){const t=l(e);return t?{kind:"resolved",subject:t}:n===void 0?{kind:"anonymous"}:E(n)?{kind:"resolved",subject:`${s}${n}`}:{kind:"invalid",message:a}}function T(e){return e.startsWith(s)?c:u}export{s as ANONYMOUS_SUBJECT_PREFIX,a as MALFORMED_SESSION_HANDLE_MESSAGE,f as MISSING_SESSION_HANDLE_MESSAGE,d as USER_SUBJECT_PREFIX,N as createSessionHandle,E as isValidSessionHandle,A as resolveSecretSubject,T as secretTtlSeconds,l as userSubject};
1
+ import{randomBytes as r}from"node:crypto";const i=32,S=/^[A-Za-z0-9_-]{43}$/,c=1440*60,u=10080*60,o="anon:",a="user:",f="This API requires credentials and the caller is anonymous; call `create-anonymous-session` first, then retry with sessionHandle",d="The sessionHandle is not a valid handle; call `create-anonymous-session` to obtain one";function N(){return r(i).toString("base64url")}function E(e){return S.test(e)}function l(e){if(!e?.isAuthenticated)return;const n=e.claims,s=(typeof n?.sub=="string"&&n.sub?n.sub:void 0)??(e.email||void 0);if(s)return`${a}${e.idpId??"local"}:${s}`}function T(e,n){const t=l(e);return t?{kind:"resolved",subject:t}:n===void 0?{kind:"anonymous"}:E(n)?{kind:"resolved",subject:`${o}${n}`}:{kind:"invalid",message:d}}function A(e){return e.startsWith(o)?c:u}export{o as ANONYMOUS_SUBJECT_PREFIX,d as MALFORMED_SESSION_HANDLE_MESSAGE,f as MISSING_SESSION_HANDLE_MESSAGE,a as USER_SUBJECT_PREFIX,N as createSessionHandle,E as isValidSessionHandle,T as resolveSecretSubject,A as secretTtlSeconds,l as userSubject};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/redoc-reef",
3
- "version": "0.141.0-next.10",
3
+ "version": "0.141.0-next.12",
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.10",
37
- "@redocly/config": "0.74.0",
36
+ "@redocly/api-docs": "0.6.0-next.12",
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
- "@redocly/portal-plugin-mock-server": "0.26.0-next.3",
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.6",
43
+ "@redocly/theme": "0.73.0-next.8",
44
44
  "@shikijs/transformers": "3.21.0",
45
45
  "@tanstack/react-query": "5.62.3",
46
46
  "@tanstack/react-table": "8.21.3",
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export declare function scrollToElement(path: string, pointer?: string): void;
3
- export declare function ReviewComments(): React.JSX.Element;
4
- //# sourceMappingURL=ReviewComments.d.ts.map
@@ -1,7 +0,0 @@
1
- import v,{useCallback as m,useEffect as b,useMemo as E,useRef as y}from"react";import{safeLoad as w,Kind as p}from"yaml-ast-parser";import{Helmet as N}from"@dr.pogodin/react-helmet";import{Source as P}from"@redocly/openapi-core";import{isBrowser as h}from"../../../utils/env/is-browser";import{usePageSharedData as k}from"../../providers/page-data/hooks";import{usePostMessage as S}from"../../providers/post-message/use-post-message";const f="___selected",A=10,C=h()&&window.location.search.includes("review-comments=true");function g(t){const[o="",i=""]=t.split("#"),[r,e]=i.split("-").map(n=>n.slice(1));return{fileName:o,fromLine:Number(r),toLine:Number(e)||Number(r)}}function O(t,o){Array.from(document.getElementsByClassName(f)).forEach(r=>{r.classList.remove(f)});let i;if(o)i=document.querySelectorAll(`[data-pointer="${o}"]`);else if(t){const{fileName:r,fromLine:e,toLine:n}=g(t);i=Array.from(document.querySelectorAll("[data-source]")).find(a=>{const d=a.attributes.getNamedItem("data-source")?.value||"",{fileName:c,fromLine:s,toLine:u}=g(d);return c===r&&e<=u&&n>=s})}if(i){let r=i,e=r.offsetTop;if(i instanceof NodeList){r=i[0],i.forEach(a=>{a.classList.add(f)});const l=window.pageYOffset||document.documentElement.scrollTop;e=r.getBoundingClientRect().top+l}r.classList.add(f);const n=document.querySelector("nav")?.offsetHeight||0;window.scrollTo({top:e-n-A,behavior:"smooth"})}}function T(t){return decodeURIComponent(t.replace(/~1/g,"/").replace(/~0/g,"~"))}function $(t){return t.substr(2).split("/").map(T)}function M(t,o,i){const r=$(o);if(t===void 0)return;let e=t;for(const n of r)if(e.kind===p.MAP){const l=e.mappings.find(a=>a.key.value===n);if(!l||(e=l,!l?.value))break;e=l.value}else if(e.kind===p.SEQ){const l=e.items[parseInt(n,10)];if(!l)break;e=l}if(i){const n=e.parent;return!n||n.kind===p.SEQ?e:n.kind===p.MAPPING?n.key:e}else return e}function D(t,o,i){let r=1,e=1,n={line:1,col:1};for(let a=0;a<i-1;a++){if(a===o-1&&(n={line:r,col:e+1}),t[a]===`
2
- `){r++,e=1,a===o-1&&(n={line:r,col:e}),t[a+1]==="\r"&&a++;continue}e++}const l=o===i?{...n}:{line:r,col:e+1};return{start:n,end:l}}function I(t){if(t.pointer===void 0)return t;const{source:o,pointer:i,reportOnKey:r}=t,e=o.getAst(w),n=M(e,i,!!r);return{...t,pointer:void 0,...D(o.body,n?.startPosition??1,n?.endPosition??1)}}function L(t){let o=t.target;for(;o&&!o.attributes["data-source"]&&!o.attributes["data-pointer"];)o=o.parentElement;return o}function Q(){const t=k("openAPIDocsStore"),o=E(()=>!t||!t.source?{file:"",source:null}:{source:new P(t.source.absolutePath,t.source.content),file:t.source.relativePath},[t]),{sendMessage:i}=S(),r=m(c=>{const s=c.attributes["data-pointer"].value;if(!o.source)return{file:""};const u=I({pointer:`#${s}`,source:o.source});return{file:`${o.file}#L${u.start.line}${u.end?`-L${u.end.line}`:""}`,pointer:s}},[o]),e=m(c=>({file:c.attributes["data-source"].value}),[]),n=m(c=>{c.preventDefault();const s=L(c);let u={file:""};s.attributes["data-source"]&&(u=e(s)),s.attributes["data-pointer"]&&(u=r(s)),i({type:"add-review-comment",...u})},[r,e,i]),l=m(c=>{c.target.classList.remove(f),i({type:"review-hover-lines",file:""}),c.target.removeEventListener("click",n)},[n,i]),a=m(c=>{const s=L(c);if(s&&s!==d.current){s.classList.add(f);let u={file:""};s.attributes["data-source"]&&(u=e(s)),s.attributes["data-pointer"]&&(u=r(s)),i({type:"review-hover-lines",...u}),s.addEventListener("mouseleave",l,{once:!0}),s.addEventListener("click",n)}d.current=s},[n,l,e,r,i]),d=y(null);return b(()=>{if(C)return document.body.addEventListener("mousemove",a),()=>{document.body.removeEventListener("mousemove",a)}},[a]),v.createElement(N,null,v.createElement("style",null,`
3
- .${f} {
4
- outline: 2px solid #1677ff;
5
- cursor: pointer;
6
- }
7
- `))}export{Q as ReviewComments,O as scrollToElement};
@@ -1,68 +0,0 @@
1
- import type { HistoryOrigin } from '@redocly/theme/core/utils';
2
- import type { ColorMode } from '@redocly/theme/core/types';
3
- export type RouteUpdateIncomingMessage = {
4
- type: 'route-update';
5
- path: string;
6
- line?: number;
7
- url?: string;
8
- };
9
- export type LocationUpdateIncomingMessage = {
10
- type: 'location-update';
11
- action: 'back' | 'forward' | 'reload';
12
- };
13
- export type InitializeIncomingMessage = {
14
- type: 'initialize';
15
- };
16
- export type ScrollUpdateIncomingMessage = {
17
- type: 'scroll-update';
18
- position: {
19
- absolute: number;
20
- relative: number;
21
- };
22
- };
23
- export type EditorScrollUpdateIncomingMessage = {
24
- type: 'editor-scroll-update';
25
- percentScrolled: number;
26
- sequenceNumber: number;
27
- };
28
- export type ColorSchemaUpdateIncomingMessage = {
29
- type: 'color-schema-update';
30
- colorSchema: ColorMode;
31
- };
32
- export type IncomingMessage = RouteUpdateIncomingMessage | InitializeIncomingMessage | LocationUpdateIncomingMessage | ScrollUpdateIncomingMessage | EditorScrollUpdateIncomingMessage | ColorSchemaUpdateIncomingMessage;
33
- export type OutgoingMessage = InitializedOutgoingMessage | RouteUpdatedOutgoingMessage | AddReviewCommentOutgoingMessage | ReviewHoverLinesOutgoingMessage | ScrollOutgoingMessage | EditorScrollOutgoingMessage;
34
- type InitializedOutgoingMessage = {
35
- type: 'initialized';
36
- initialRoute?: {
37
- file: string;
38
- url: string;
39
- };
40
- };
41
- type RouteUpdatedOutgoingMessage = {
42
- type: 'route-updated';
43
- file: string;
44
- url: string;
45
- origin: HistoryOrigin;
46
- };
47
- type AddReviewCommentOutgoingMessage = {
48
- type: 'add-review-comment';
49
- file: string;
50
- };
51
- type ReviewHoverLinesOutgoingMessage = {
52
- type: 'review-hover-lines';
53
- file: string;
54
- };
55
- type ScrollOutgoingMessage = {
56
- type: 'scroll-updated';
57
- position: {
58
- absolute: number;
59
- relative: number;
60
- };
61
- };
62
- type EditorScrollOutgoingMessage = {
63
- type: 'editor-scroll-updated';
64
- percentScrolled: number;
65
- sequenceNumber: number;
66
- };
67
- export {};
68
- //# sourceMappingURL=post-message.d.ts.map
File without changes