@stoplight/elements-core 7.4.1 → 7.5.3
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/Article/Article.stories.d.ts +1 -0
- package/components/Docs/HttpOperation/Body.d.ts +2 -1
- package/components/Docs/HttpOperation/Parameters.d.ts +0 -5
- package/components/Docs/Sections.d.ts +4 -1
- package/components/MosaicTableOfContents/types.d.ts +0 -1
- package/components/TryIt/Mocking/mocking-utils.d.ts +1 -2
- 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 +1 -0
- package/index.esm.js +325 -212
- package/index.js +321 -210
- package/index.mjs +325 -212
- package/package.json +5 -5
- package/styles.min.css +1 -1
- package/types.d.ts +3 -1
- package/utils/http-spec/IServer.d.ts +1 -1
- package/utils/string.d.ts +1 -0
|
@@ -2,3 +2,4 @@ declare const meta: import("@storybook/react").Meta<import("..").DocsComponentPr
|
|
|
2
2
|
export default meta;
|
|
3
3
|
export declare const Basic: import("@storybook/react").Story<import("..").DocsComponentProps<string | import("@stoplight/markdown/ast-types/mdast").Root> & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
4
4
|
export declare const KitchenSink: import("@storybook/react").Story<import("..").DocsComponentProps<string | import("@stoplight/markdown/ast-types/mdast").Root> & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
5
|
+
export declare const MultipleTryIts: import("@storybook/react").Story<import("..").DocsComponentProps<string | import("@stoplight/markdown/ast-types/mdast").Root> & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
@@ -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,12 @@
|
|
|
1
|
-
import { PanelProps } from '@stoplight/mosaic';
|
|
1
|
+
import { HeadingProps, PanelProps } from '@stoplight/mosaic';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
export interface ISectionTitle {
|
|
4
4
|
title: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
size?: HeadingProps['size'];
|
|
5
7
|
}
|
|
6
8
|
export declare const SectionTitle: React.FC<ISectionTitle>;
|
|
9
|
+
export declare const SectionSubtitle: React.FC<ISectionTitle>;
|
|
7
10
|
declare type SubSectionPanelProps = {
|
|
8
11
|
title: React.ReactNode;
|
|
9
12
|
hasContent?: boolean;
|
|
@@ -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 {};
|
|
@@ -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
|
@@ -28,4 +28,5 @@ export { Divider, Group, ITableOfContentsTree, Item, ParsedNode, RoutingProps, T
|
|
|
28
28
|
export { isHttpOperation, isHttpService } from './utils/guards';
|
|
29
29
|
export { ReferenceResolver } from './utils/ref-resolving/ReferenceResolver';
|
|
30
30
|
export { createResolvedObject } from './utils/ref-resolving/resolvedObject';
|
|
31
|
+
export { slugify } from './utils/string';
|
|
31
32
|
export { createElementClass } from './web-components/createElementClass';
|