@stoplight/elements-core 7.3.11 → 7.5.1
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/components/Docs/HttpOperation/Badges.d.ts +0 -6
- package/components/Docs/HttpOperation/Body.d.ts +2 -1
- package/components/Docs/HttpOperation/Parameters.d.ts +0 -5
- package/components/Docs/HttpService/SecuritySchemes.d.ts +2 -2
- package/components/Docs/Sections.d.ts +7 -3
- package/components/MarkdownViewer/CustomComponents/CodeComponent.d.ts +2 -1
- package/components/MarkdownViewer/CustomComponents/Provider.d.ts +2 -2
- package/components/MosaicTableOfContents/types.d.ts +0 -1
- package/components/NonIdealState.d.ts +2 -2
- package/components/TryIt/Mocking/mocking-utils.d.ts +1 -2
- package/components/TryIt/Mocking/useMockingOptions.d.ts +1 -1
- package/components/TryIt/Servers/ServersDropdown.d.ts +8 -0
- package/components/TryIt/build-request.d.ts +1 -1
- package/components/TryIt/chosenServer.d.ts +18 -0
- package/components/TryIt/index.d.ts +1 -0
- package/constants.d.ts +2 -0
- package/context/Persistence.d.ts +4 -1
- package/hooks/useRouter.d.ts +7 -5
- package/index.d.ts +3 -1
- package/index.esm.js +480 -342
- package/index.js +532 -372
- package/index.mjs +480 -342
- package/package.json +7 -11
- package/styles.min.css +1 -1
- package/types.d.ts +4 -1
- package/utils/http-spec/IServer.d.ts +1 -1
- package/utils/securitySchemes.d.ts +2 -0
- package/utils/string.d.ts +1 -0
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { HttpSecurityScheme } from '@stoplight/types';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
export declare const DeprecatedBadge: React.FC;
|
|
4
3
|
export declare const InternalBadge: React.FC<{
|
|
5
4
|
isHttpService?: boolean;
|
|
6
5
|
}>;
|
|
7
|
-
export declare const SecurityBadge: React.FC<{
|
|
8
|
-
scheme: HttpSecurityScheme;
|
|
9
|
-
httpServiceUri?: string;
|
|
10
|
-
includeKey?: boolean;
|
|
11
|
-
}>;
|
|
12
6
|
export declare const VersionBadge: React.FC<{
|
|
13
7
|
value: string;
|
|
14
8
|
backgroundColor?: string;
|
|
@@ -3,7 +3,8 @@ export interface BodyProps {
|
|
|
3
3
|
body: IHttpOperationRequestBody;
|
|
4
4
|
onChange: (requestBodyIndex: number) => void;
|
|
5
5
|
}
|
|
6
|
+
export declare const isBodyEmpty: (body?: IHttpOperationRequestBody | undefined) => boolean;
|
|
6
7
|
export declare const Body: {
|
|
7
|
-
({ body
|
|
8
|
+
({ body, onChange }: BodyProps): JSX.Element | null;
|
|
8
9
|
displayName: string;
|
|
9
10
|
};
|
|
@@ -6,9 +6,4 @@ interface ParametersProps {
|
|
|
6
6
|
parameters?: IHttpParam[];
|
|
7
7
|
}
|
|
8
8
|
export declare const Parameters: React.FunctionComponent<ParametersProps>;
|
|
9
|
-
interface IParameterProps {
|
|
10
|
-
parameter: IHttpParam;
|
|
11
|
-
parameterType: ParameterType;
|
|
12
|
-
}
|
|
13
|
-
export declare const Parameter: React.FunctionComponent<IParameterProps>;
|
|
14
9
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { HttpSecurityScheme
|
|
1
|
+
import { HttpSecurityScheme } from '@stoplight/types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
interface SecuritySchemesProps {
|
|
4
4
|
schemes: HttpSecurityScheme[];
|
|
5
5
|
defaultScheme?: string;
|
|
6
|
+
defaultCollapsed?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const SecuritySchemes: React.FC<SecuritySchemesProps>;
|
|
8
|
-
export declare function getOAuthFlowDescription(title: string, flow: IOauth2Flow): string;
|
|
9
9
|
export {};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import { HeadingProps, PanelProps } from '@stoplight/mosaic';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
export interface ISectionTitle {
|
|
3
4
|
title: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
size?: HeadingProps['size'];
|
|
4
7
|
}
|
|
5
8
|
export declare const SectionTitle: React.FC<ISectionTitle>;
|
|
6
|
-
|
|
9
|
+
export declare const SectionSubtitle: React.FC<ISectionTitle>;
|
|
10
|
+
declare type SubSectionPanelProps = {
|
|
7
11
|
title: React.ReactNode;
|
|
8
12
|
hasContent?: boolean;
|
|
9
13
|
rightComponent?: React.ReactNode;
|
|
10
|
-
}
|
|
11
|
-
export declare const SubSectionPanel: React.FC<SubSectionPanelProps
|
|
14
|
+
};
|
|
15
|
+
export declare const SubSectionPanel: React.FC<SubSectionPanelProps & Pick<PanelProps, 'defaultIsOpen' | 'onChange'>>;
|
|
12
16
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { DefaultSMDComponents } from '@stoplight/markdown-viewer';
|
|
1
2
|
import { IHttpOperation, IHttpRequest } from '@stoplight/types';
|
|
2
3
|
import { CustomComponentMapping } from './Provider';
|
|
3
4
|
declare type PartialHttpRequest = Pick<IHttpRequest, 'method' | 'url'> & Partial<IHttpRequest>;
|
|
5
|
+
export { DefaultSMDComponents };
|
|
4
6
|
export declare const CodeComponent: CustomComponentMapping['code'];
|
|
5
7
|
export declare function parseHttpRequest(data: PartialHttpRequest): IHttpOperation;
|
|
6
|
-
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CustomComponentMapping as MDVCustomComponentMapping
|
|
1
|
+
import { CustomComponentMapping as MDVCustomComponentMapping } from '@stoplight/markdown-viewer';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
export declare type CustomComponentMapping = MDVCustomComponentMapping;
|
|
4
|
-
export { DefaultSMDComponents };
|
|
5
4
|
interface MarkdownComponentsProviderProps {
|
|
6
5
|
value: Partial<CustomComponentMapping> | undefined;
|
|
7
6
|
}
|
|
8
7
|
export declare const MarkdownComponentsProvider: React.FC<MarkdownComponentsProviderProps>;
|
|
8
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IIconProps } from '@stoplight/mosaic';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare type NonIdealStateProps = {
|
|
4
4
|
description?: React.ReactNode;
|
|
5
|
-
icon?:
|
|
5
|
+
icon?: IIconProps['icon'];
|
|
6
6
|
title?: React.ReactNode;
|
|
7
7
|
};
|
|
8
8
|
export declare const NonIdealState: React.FC<NonIdealStateProps>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IHttpOperation } from '@stoplight/types';
|
|
2
2
|
export declare type MockingOptions = {
|
|
3
|
-
isEnabled: boolean;
|
|
4
3
|
code?: string;
|
|
5
4
|
example?: string;
|
|
6
5
|
dynamic?: boolean;
|
|
@@ -14,6 +13,6 @@ export declare type MockData = {
|
|
|
14
13
|
url: string;
|
|
15
14
|
header?: Record<'Prefer', string>;
|
|
16
15
|
};
|
|
17
|
-
export declare function getMockData(url: string | undefined, httpOperation: IHttpOperation, {
|
|
16
|
+
export declare function getMockData(url: string | undefined, httpOperation: IHttpOperation, { code, dynamic, example }: MockingOptions): MockData | undefined;
|
|
18
17
|
export declare function buildPreferHeader({ code, example, dynamic }: PreferHeaderProps, httpOperation: IHttpOperation): Record<'Prefer', string> | undefined;
|
|
19
18
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MockingOptions } from './mocking-utils';
|
|
2
|
-
export declare const useMockingOptions: () => [MockingOptions, (update: MockingOptions | ((prev: MockingOptions) => MockingOptions)) => void];
|
|
2
|
+
export declare const useMockingOptions: () => [MockingOptions, (update: MockingOptions | ((prev: MockingOptions) => MockingOptions)) => void | Promise<void>];
|
|
@@ -10,7 +10,7 @@ interface BuildRequestInput {
|
|
|
10
10
|
bodyInput?: BodyParameterValues | string;
|
|
11
11
|
mockData?: MockData;
|
|
12
12
|
auth?: HttpSecuritySchemeWithValues;
|
|
13
|
-
chosenServer?: IServer;
|
|
13
|
+
chosenServer?: IServer | null;
|
|
14
14
|
credentials?: 'omit' | 'include' | 'same-origin';
|
|
15
15
|
corsProxy?: string;
|
|
16
16
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IServer } from '@stoplight/types';
|
|
2
|
+
export declare const chosenServerAtom: import("jotai").Atom<IServer | null | undefined> & {
|
|
3
|
+
write: (get: {
|
|
4
|
+
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
5
|
+
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
6
|
+
<Value_2>(atom: import("jotai").Atom<Value_2>): Value_2;
|
|
7
|
+
} & {
|
|
8
|
+
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, unstable_promise: true): Value_3 | Promise<Value_3>;
|
|
9
|
+
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, unstable_promise: true): Value_4 | Promise<Value_4>;
|
|
10
|
+
<Value_5>(atom: import("jotai").Atom<Value_5>, unstable_promise: true): Value_5 | Promise<Value_5>;
|
|
11
|
+
}, set: {
|
|
12
|
+
<Value_6>(atom: import("jotai").WritableAtom<Value_6, undefined>): void | Promise<void>;
|
|
13
|
+
<Value_7, Update>(atom: import("jotai").WritableAtom<Value_7, Update>, update: Update): void | Promise<void>;
|
|
14
|
+
}, update: IServer | ((prev: IServer | null | undefined) => IServer | null | undefined) | null | undefined) => void | Promise<void>;
|
|
15
|
+
onMount?: (<S extends (update?: IServer | ((prev: IServer | null | undefined) => IServer | null | undefined) | null | undefined) => void | Promise<void>>(setAtom: S) => void | (() => void)) | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
init: IServer | null | undefined;
|
|
18
|
+
};
|
package/constants.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IconDefinition } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
+
import { IntentVals } from '@stoplight/mosaic';
|
|
2
3
|
import { Dictionary, HttpSecurityScheme, NodeType } from '@stoplight/types';
|
|
3
4
|
export declare const NodeTypeColors: Dictionary<string, NodeType>;
|
|
4
5
|
export declare const NodeTypePrettyName: Dictionary<string, NodeType>;
|
|
@@ -86,3 +87,4 @@ export declare const HttpCodeDescriptions: {
|
|
|
86
87
|
};
|
|
87
88
|
export declare const badgeDefaultBackgroundColor = "#293742";
|
|
88
89
|
export declare const badgeDefaultColor = "#FFFFFF";
|
|
90
|
+
export declare const CodeToIntentMap: Record<number, IntentVals>;
|
package/context/Persistence.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare const PersistenceContextProvider:
|
|
2
|
+
export declare const PersistenceContextProvider: ({ initialValues, scope, children, }: import("react").PropsWithChildren<{
|
|
3
|
+
initialValues?: Iterable<readonly [import("jotai").Atom<unknown>, unknown]> | undefined;
|
|
4
|
+
scope?: import("jotai/core/atom").Scope | undefined;
|
|
5
|
+
}>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("jotai/core/contexts").ScopeContainer>>;
|
|
3
6
|
export declare function withPersistenceBoundary<T>(WrappedComponent: React.ComponentType<T>): React.FC<T>;
|
package/hooks/useRouter.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { RouterType } from '../types';
|
|
3
|
+
interface RouterProps {
|
|
4
|
+
basename?: string;
|
|
5
|
+
location?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const useRouter: (router: RouterType, basePath: string, staticRouterPath?: string | undefined) => {
|
|
4
8
|
Router: React.ComponentType<{}>;
|
|
5
|
-
routerProps:
|
|
6
|
-
basename?: string | undefined;
|
|
7
|
-
};
|
|
9
|
+
routerProps: RouterProps;
|
|
8
10
|
};
|
|
9
11
|
export {};
|
package/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export { DeprecatedBadge } from './components/Docs/HttpOperation/Badges';
|
|
|
3
3
|
export { ExportButton, ExportButtonProps } from './components/Docs/HttpService/ExportButton';
|
|
4
4
|
export { SidebarLayout } from './components/Layout/SidebarLayout';
|
|
5
5
|
export { Logo } from './components/Logo';
|
|
6
|
-
export {
|
|
6
|
+
export { DefaultSMDComponents } from './components/MarkdownViewer/CustomComponents/CodeComponent';
|
|
7
|
+
export { CustomComponentMapping, MarkdownComponentsProvider, } from './components/MarkdownViewer/CustomComponents/Provider';
|
|
7
8
|
export { ReactRouterMarkdownLink } from './components/MarkdownViewer/CustomComponents/ReactRouterLink';
|
|
8
9
|
export { TableOfContents } from './components/MosaicTableOfContents';
|
|
9
10
|
export { CustomLinkComponent, TableOfContentsItem, TableOfContentsNode, TableOfContentsNodeGroup, } from './components/MosaicTableOfContents/types';
|
|
@@ -27,4 +28,5 @@ export { Divider, Group, ITableOfContentsTree, Item, ParsedNode, RoutingProps, T
|
|
|
27
28
|
export { isHttpOperation, isHttpService } from './utils/guards';
|
|
28
29
|
export { ReferenceResolver } from './utils/ref-resolving/ReferenceResolver';
|
|
29
30
|
export { createResolvedObject } from './utils/ref-resolving/resolvedObject';
|
|
31
|
+
export { slugify } from './utils/string';
|
|
30
32
|
export { createElementClass } from './web-components/createElementClass';
|