@redocly/openapi-docs 3.12.0-next.3 → 3.12.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.
- package/dist/redocly-openapi-docs.min.js +3 -3
- package/lib/components/Markdown/Markdown.d.ts +1 -1
- package/lib/components/Markdown/Markdown.js +1 -1
- package/lib/components/Markdown/types.d.ts +11 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/services/config-options/types.d.ts +2 -10
- package/package.json +4 -4
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { MarkdownProps } from './types.js';
|
|
3
|
-
export declare const Markdown: ({ source, ast, htmlWrap, ...props }: MarkdownProps) => ReactElement | null;
|
|
3
|
+
export declare const Markdown: ({ source, ast, htmlWrap, markdocOptions: markdocOptionsProps, ...props }: MarkdownProps) => ReactElement | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as l,Fragment as A}from"react/jsx-runtime";import g,{Fragment as h}from"react";import e from"@markdoc/markdoc";import{useAtomValue as b}from"jotai";import y from"dompurify";import{Markdown as _,isString as z}from"@redocly/theme";import{globalOptionsAtom as R}from"../../jotai/store.js";const S=["OpenApiResponse","OpenApiRequestBody"],T=({source:n,ast:m,htmlWrap:c,markdocOptions:f,...d})=>{const a=b(R);if(!n&&!m)return null;const s=Object.keys(a?.markdocOptions||{}).length?a?.markdocOptions:f,i=s&&{tags:s?.tags,nodes:s?.nodes,partials:s?.partials,variables:s?.variables,functions:s?.functions},u=s&&{components:s?.components};let r;if(n)if(z(n)){const t=a?.unstable_hooks?.sanitize?a.unstable_hooks?.sanitize?.(n):a?.sanitize?y.sanitize(n):n,o=e.parse(t);r=e.transform(o,i)}else{const t=e.Ast.fromJSON(typeof n.result=="object"?JSON.stringify(n.result):n.result);Array.isArray(t)?r=e.transform(t,i):r=e.transform(t,i)}else m&&(r=e.transform(m,i));const p=t=>{const o=e.renderers.react(t,g,u);return l(_,{...d,children:o,as:"div"})};if(!c)return p(r);const O=t=>t.attributes?.htmlWrap!==!1&&!S.includes(t?.name),k=(t,o)=>t?c(p(o)):p(o);return r=Array.isArray(r)?r:r.children,l(A,{children:r.map((t,o)=>l(h,{children:k(O(t),t)},t?.attributes?.id||o))})};export{T as Markdown};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ReactElement } from 'react';
|
|
2
|
-
import type { Node } from '@markdoc/markdoc';
|
|
1
|
+
import type { ReactElement, ComponentType } from 'react';
|
|
2
|
+
import type { Node, Schema, ConfigFunction } from '@markdoc/markdoc';
|
|
3
3
|
export type MarkdownProps = {
|
|
4
4
|
sanitize?: boolean;
|
|
5
5
|
base?: boolean;
|
|
@@ -7,4 +7,13 @@ export type MarkdownProps = {
|
|
|
7
7
|
ast?: Node[];
|
|
8
8
|
className?: string;
|
|
9
9
|
htmlWrap?: (part: ReactElement) => ReactElement;
|
|
10
|
+
markdocOptions?: MarkdocOptions;
|
|
11
|
+
};
|
|
12
|
+
export type MarkdocOptions = {
|
|
13
|
+
tags: Record<string, Schema>;
|
|
14
|
+
nodes: Record<string, Schema>;
|
|
15
|
+
components: Record<string, ComponentType>;
|
|
16
|
+
variables?: Record<string, any>;
|
|
17
|
+
partials?: Record<string, any>;
|
|
18
|
+
functions?: Record<string, ConfigFunction>;
|
|
10
19
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export { safeSlugify } from './utils/string.js';
|
|
|
24
24
|
export { JsonPointer } from './utils/JsonPointer.js';
|
|
25
25
|
export { isOperationName } from './utils/openapi.js';
|
|
26
26
|
export { pathIncludesLink, normalizePath } from './utils/path.js';
|
|
27
|
+
export { saveTextBeforeHeading } from './utils/saveTextBeforeHeading.js';
|
|
27
28
|
export { OpenAPIParser } from './services/OpenAPIParser.js';
|
|
28
29
|
export { buildContentItems } from './services/menu/builder.js';
|
|
29
30
|
export { normalizeOptions } from './services/config-options/normalizeOptions.js';
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useAtomValue as
|
|
1
|
+
import{useAtomValue as e}from"jotai";import{globalOptionsAtom as o}from"./jotai/store.js";import{simplifyAstStructure as n}from"./utils/simplifyAstStructure.js";import{getOperation as x}from"./models/operation.js";import{getServerEnvName as l}from"./utils/environments.js";import{getTagOrGroup as d}from"./models/group.js";import{generateDeepLink as c}from"./components/common/LinkToField.js";import{RequestSamples as g}from"./components/RequestSamples/RequestSamples.js";import{ResponseSamples as P}from"./components/ResponseSamples/ResponseSamples.js";import{RedocSchema as I}from"./components/pluggable/RedocSchema.js";import{RedocExample as w}from"./components/pluggable/RedocExample.js";import{RedoclyOpenAPIDocs as v}from"./components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js";import{StoreProvider as E}from"./components/RedoclyOpenAPIDocs/Providers.js";import{getMarkdownHeaderId as A}from"./components/RedoclyOpenAPIDocs/utils.js";import{safeSlugify as b}from"./utils/string.js";import{JsonPointer as L}from"./utils/JsonPointer.js";import{isOperationName as V}from"./utils/openapi.js";import{pathIncludesLink as F,normalizePath as H}from"./utils/path.js";import{saveTextBeforeHeading as z}from"./utils/saveTextBeforeHeading.js";import{OpenAPIParser as G}from"./services/OpenAPIParser.js";import{buildContentItems as _}from"./services/menu/builder.js";import{normalizeOptions as K}from"./services/config-options/normalizeOptions.js";import{makeDeepLink as U}from"./services/history/helpers.js";function p(){return e(o)}import{EmbeddedReplay as X}from"./components/Replay/EmbeddedReplay.js";import{convertOperationToReplayValue as Z}from"./components/Replay/utils.js";import{SectionContainer as ee}from"./components/SectionContent/index.js";import{Row as re}from"./components/common/panels.js";import{RightPanelContainer as pe}from"./components/SectionContent/index.js";import{Overview as ae}from"./components/Overview/index.js";import{SamplesMiddlePanel as fe,Section as xe,SamplesPanel as ie}from"./components/common/panels.js";import{Heading as se}from"./components/common/OperationItemTitle.js";import{Dropdown as ue}from"./components/common/Dropdown/index.js";import{Markdown as Se}from"./components/Markdown/index.js";import{FieldValueLabel as Oe,FieldLabel as Pe}from"./components/common/Fields/index.js";import{CodeBlockPanel as Ie}from"./components/common/index.js";import{OperationSamplesPanel as we}from"./components/OperationItem/OperationItem.js";import{ExternalDocumentation as ve}from"./components/ExternalDocumentation/index.js";import{PropertyDetails as Ee}from"./components/PropertyDetails/PropertyDetails.js";import{addMarkdownItems as Ae}from"./services/menu/markdown.js";import{getValueFromMdParsedExtension as be}from"./utils/helpers.js";import{ContentItem as Le}from"./components/ContentItem/index.js";import{ExampleSwitch as Ve}from"./components/Samples/ExampleSwitch.js";import{CustomBadges as Fe}from"./components/common/Badges.js";import{useDownloadInfo as Ne}from"./components/Download/useDownloadInfo.js";import{SECTION_ATTR as qe}from"./constants.js";export{Ie as CodeBlockPanel,Le as ContentItem,Fe as CustomBadges,ue as Dropdown,X as EmbeddedReplay,Ve as ExampleSwitch,ve as ExternalDocumentation,Pe as FieldLabel,Oe as FieldValueLabel,se as Heading,L as JsonPointer,Se as Markdown,G as OpenAPIParser,we as OperationSamplesPanel,ae as Overview,Ee as PropertyDetails,w as RedocExample,I as RedocSchema,v as RedoclyOpenAPIDocs,g as RequestSamples,P as ResponseSamples,pe as RightPanelContainer,re as Row,qe as SECTION_ATTR,fe as SamplesMiddlePanel,ie as SamplesPanel,xe as Section,ee as SectionContainer,E as StoreProvider,Ae as addMarkdownItems,_ as buildContentItems,Z as convertOperationToReplayValue,c as generateDeepLink,A as getMarkdownHeaderId,x as getOperation,l as getServerEnvName,d as getTagOrGroup,be as getValueFromMdParsedExtension,V as isOperationName,U as makeDeepLink,K as normalizeOptions,H as normalizePath,F as pathIncludesLink,b as safeSlugify,z as saveTextBeforeHeading,n as simplifyAstStructure,Ne as useDownloadInfo,p as useOpenapiDocsOptions};
|
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
import type { ComponentType } from 'react';
|
|
2
|
-
import type { Schema, ConfigFunction } from '@markdoc/markdoc/dist/src/types';
|
|
3
1
|
import type { CodeSamplesConfig } from '../code-samples/index.js';
|
|
4
2
|
import type { HooksConfig, Unstable_ExternalCodeSample } from '../types.js';
|
|
5
3
|
import type { Events } from '../../events/index.js';
|
|
6
4
|
import type { LayoutVariant } from '@redocly/theme';
|
|
7
5
|
import type { OperationModel } from '../../models/types.js';
|
|
8
6
|
import type { DownloadUrlsConfig } from '../../components/Download/types.js';
|
|
7
|
+
import type { MarkdocOptions } from '../../components/Markdown/types.js';
|
|
9
8
|
export interface Options {
|
|
10
9
|
scrollYOffset: () => number;
|
|
11
10
|
hideLoading: boolean;
|
|
12
|
-
markdocOptions?:
|
|
13
|
-
tags: Record<string, Schema>;
|
|
14
|
-
nodes: Record<string, Schema>;
|
|
15
|
-
components: Record<string, ComponentType>;
|
|
16
|
-
variables?: Record<string, any>;
|
|
17
|
-
partials?: Record<string, any>;
|
|
18
|
-
functions?: Record<string, ConfigFunction>;
|
|
19
|
-
};
|
|
11
|
+
markdocOptions?: MarkdocOptions;
|
|
20
12
|
hideSidebar: boolean;
|
|
21
13
|
feedback: Record<string, any>;
|
|
22
14
|
unstable_hooks: HooksConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-docs",
|
|
3
|
-
"version": "3.12.0-next.
|
|
3
|
+
"version": "3.12.0-next.5",
|
|
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/config": "0.26.
|
|
40
|
-
"@redocly/replay": "0.15.0-next.
|
|
39
|
+
"@redocly/config": "0.26.3",
|
|
40
|
+
"@redocly/replay": "0.15.0-next.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@jest/globals": "29.5.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"typescript": "5.6.2",
|
|
75
75
|
"url": "~0.11.0",
|
|
76
76
|
"vite": "^6.3.5",
|
|
77
|
-
"@redocly/theme": "0.56.0-next.
|
|
77
|
+
"@redocly/theme": "0.56.0-next.2"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"start": "npm run copy-highlight-hook && vite",
|