@stoplight/elements-core 8.1.4 → 8.3.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/__fixtures__/articles/schema-with-refs.d.ts +1 -1
- package/components/Docs/Article/Article.stories.d.ts +4 -0
- package/components/Docs/Docs.d.ts +9 -0
- package/components/Docs/HttpOperation/Callbacks.d.ts +2 -0
- package/components/Docs/HttpOperation/HttpOperation.stories.d.ts +2 -0
- package/components/Docs/HttpService/HttpService.stories.d.ts +2 -0
- package/components/Docs/Model/Model.stories.d.ts +2 -0
- package/components/Docs/NodeVendorExtensions.d.ts +7 -0
- package/components/Docs/story-helper.d.ts +2 -0
- package/components/Docs/story-renderer-helper.d.ts +3 -0
- package/components/RequestSamples/RequestSamples.d.ts +2 -0
- package/components/RequestSamples/RequestSamples.stories.d.ts +1 -0
- package/components/RequestSamples/extractCodeSamples.d.ts +7 -0
- package/components/RequestSamples/index.d.ts +1 -0
- package/components/RequestSamples/requestSampleConfigs.d.ts +5 -7
- package/components/TableOfContents/constants.d.ts +3 -0
- package/constants.d.ts +3 -0
- package/context/Options.d.ts +2 -2
- package/index.d.ts +2 -1
- package/index.esm.js +202 -65
- package/index.js +206 -64
- package/index.mjs +202 -65
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const schemaWithRefs = "---\ntitle: Schema with refs\n---\n\n# Schema with refs (Swr)\n\n### Schema\n\nThis is bundled schema with refs\n\n```json jsonSchema\n{\n \"title\": \"DerefTest\",\n \"type\": \"object\",\n \"description\": \"Dereferencing test object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"inner\": {\n \"description\": \"Inner object\",\n \"title\": \"Inner\",\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"referencedObject\": {\n \"$ref\": \"#/properties/referencedObject\",\n \"description\": \"Inner referenced object\"\n }\n },\n \"required\": [\n \"id\",\n \"bookingRate\"\n ]\n },\n \"referencedObject\": {\n \"description\": \"Referenced object\",\n \"title\": \"ReferencedObject\",\n \"type\": \"object\",\n \"required\": [\n \"property1\",\n \"property2\",\n \"property3\"\n ],\n \"properties\": {\n \"property1\": {\n \"type\": \"integer\",\n \"description\": \"Property 1\"\n },\n \"property2\": {\n \"type\": \"string\",\n \"description\": \"Property 2\"\n },\n \"property3\": {\n \"type\": \"boolean\",\n \"description\": \"Property 3\"\n }\n }\n }\n },\n \"required\": [\n \"id\",\n \"inner\",\n \"referencedObject\"\n ]\n}\n```";
|
|
1
|
+
export declare const schemaWithRefs = "---\ntitle: Schema with refs\n---\n\n# Schema with refs (Swr)\n\n### Schema\n\nThis is bundled schema with refs\n\n```json jsonSchema\n{\n \"title\": \"DerefTest\",\n \"type\": \"object\",\n \"description\": \"Dereferencing test object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"inner\": {\n \"description\": \"Inner object\",\n \"title\": \"Inner\",\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"referencedObject\": {\n \"$ref\": \"#/properties/referencedObject\",\n \"description\": \"Inner referenced object\"\n }\n },\n \"required\": [\n \"id\",\n \"bookingRate\"\n ]\n },\n \"referencedObject\": {\n \"description\": \"Referenced object\",\n \"title\": \"ReferencedObject\",\n \"type\": \"object\",\n \"required\": [\n \"property1\",\n \"property2\",\n \"property3\"\n ],\n \"properties\": {\n \"property1\": {\n \"type\": \"integer\",\n \"description\": \"Property 1\"\n },\n \"property2\": {\n \"type\": \"string\",\n \"description\": \"Property 2\"\n },\n \"property3\": {\n \"type\": \"boolean\",\n \"description\": \"Property 3\"\n },\n \"property4\": {\n \"type\": \"string\",\n \"enum\": [\n \"BUSINESS\",\n \"PERSONAL\",\n \"OTHER\"\n ],\n \"x-enum-descriptions\": {\n \"BUSINESS\": \"Enum description for BUSINESS\",\n \"PERSONAL\": \"Enum description for PERSONAL\",\n \"OTHER\": \"Enum description for OTHER\"\n }\n }\n }\n }\n },\n \"required\": [\n \"id\",\n \"inner\",\n \"referencedObject\"\n ]\n}\n```";
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
declare const meta: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, {
|
|
2
2
|
data: any;
|
|
3
|
+
renderExtensionAddon?: import("..").ExtensionAddonRenderer | undefined;
|
|
3
4
|
} & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
4
5
|
export default meta;
|
|
5
6
|
export declare const Basic: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
|
|
6
7
|
data: any;
|
|
8
|
+
renderExtensionAddon?: import("..").ExtensionAddonRenderer | undefined;
|
|
7
9
|
} & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
8
10
|
export declare const KitchenSink: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
|
|
9
11
|
data: any;
|
|
12
|
+
renderExtensionAddon?: import("..").ExtensionAddonRenderer | undefined;
|
|
10
13
|
} & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
11
14
|
export declare const MultipleTryIts: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
|
|
12
15
|
data: any;
|
|
16
|
+
renderExtensionAddon?: import("..").ExtensionAddonRenderer | undefined;
|
|
13
17
|
} & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SchemaNode } from '@stoplight/json-schema-tree';
|
|
1
2
|
import type { NodeHasChangedFn, NodeType } from '@stoplight/types';
|
|
2
3
|
import { Location } from 'history';
|
|
3
4
|
import * as React from 'react';
|
|
@@ -5,6 +6,13 @@ import { ParsedNode } from '../../types';
|
|
|
5
6
|
import { ReferenceResolver } from '../../utils/ref-resolving/ReferenceResolver';
|
|
6
7
|
import { ExportButtonProps } from './HttpService/ExportButton';
|
|
7
8
|
declare type NodeUnsupportedFn = (err: 'dataEmpty' | 'invalidType' | Error) => void;
|
|
9
|
+
export declare type VendorExtensionsData = Record<string, unknown>;
|
|
10
|
+
export declare type ExtensionRowProps = {
|
|
11
|
+
schemaNode: SchemaNode;
|
|
12
|
+
nestingLevel: number;
|
|
13
|
+
vendorExtensions: VendorExtensionsData;
|
|
14
|
+
};
|
|
15
|
+
export declare type ExtensionAddonRenderer = (props: ExtensionRowProps) => React.ReactNode;
|
|
8
16
|
interface BaseDocsProps {
|
|
9
17
|
className?: string;
|
|
10
18
|
uri?: string;
|
|
@@ -27,6 +35,7 @@ interface BaseDocsProps {
|
|
|
27
35
|
};
|
|
28
36
|
nodeHasChanged?: NodeHasChangedFn<React.ReactNode>;
|
|
29
37
|
nodeUnsupported?: NodeUnsupportedFn;
|
|
38
|
+
renderExtensionAddon?: ExtensionAddonRenderer;
|
|
30
39
|
}
|
|
31
40
|
export interface DocsProps extends BaseDocsProps {
|
|
32
41
|
nodeType: NodeType;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IHttpCallbackOperation } from '@stoplight/types';
|
|
2
|
+
import { ExtensionAddonRenderer } from '../Docs';
|
|
2
3
|
export interface CallbacksProps {
|
|
3
4
|
callbacks: IHttpCallbackOperation[];
|
|
4
5
|
isCompact?: boolean;
|
|
@@ -6,6 +7,7 @@ export interface CallbacksProps {
|
|
|
6
7
|
export interface CallbackProps {
|
|
7
8
|
data: IHttpCallbackOperation;
|
|
8
9
|
isCompact?: boolean;
|
|
10
|
+
renderExtensionAddon?: ExtensionAddonRenderer;
|
|
9
11
|
}
|
|
10
12
|
export declare const Callbacks: {
|
|
11
13
|
({ callbacks, isCompact }: CallbacksProps): JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
declare const meta: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, {
|
|
2
2
|
data: any;
|
|
3
|
+
renderExtensionAddon?: import("..").ExtensionAddonRenderer | undefined;
|
|
3
4
|
} & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
4
5
|
export default meta;
|
|
5
6
|
export declare const Story: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
|
|
6
7
|
data: any;
|
|
8
|
+
renderExtensionAddon?: import("..").ExtensionAddonRenderer | undefined;
|
|
7
9
|
} & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
declare const meta: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, {
|
|
2
2
|
data: any;
|
|
3
|
+
renderExtensionAddon?: import("..").ExtensionAddonRenderer | undefined;
|
|
3
4
|
} & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
4
5
|
export default meta;
|
|
5
6
|
export declare const Story: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
|
|
6
7
|
data: any;
|
|
8
|
+
renderExtensionAddon?: import("..").ExtensionAddonRenderer | undefined;
|
|
7
9
|
} & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
declare const meta: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, {
|
|
2
2
|
data: any;
|
|
3
|
+
renderExtensionAddon?: import("..").ExtensionAddonRenderer | undefined;
|
|
3
4
|
} & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
4
5
|
export default meta;
|
|
5
6
|
export declare const Story: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
|
|
6
7
|
data: any;
|
|
8
|
+
renderExtensionAddon?: import("..").ExtensionAddonRenderer | undefined;
|
|
7
9
|
} & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { INode } from '@stoplight/types';
|
|
2
|
+
import type { JSONSchema7 } from 'json-schema';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export declare type NodeVendorExtensionsProps = {
|
|
5
|
+
data: INode | JSONSchema7;
|
|
6
|
+
};
|
|
7
|
+
export declare const NodeVendorExtensions: React.NamedExoticComponent<NodeVendorExtensionsProps>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ErrorBoundaryProps } from '@stoplight/react-error-boundary';
|
|
2
2
|
import type { Meta, StoryFn } from '@storybook/react';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import { ExtensionAddonRenderer } from './Docs';
|
|
4
5
|
declare type DocsProps = {
|
|
5
6
|
data: any;
|
|
7
|
+
renderExtensionAddon?: ExtensionAddonRenderer;
|
|
6
8
|
} & ErrorBoundaryProps;
|
|
7
9
|
declare type storyOptions = DocsProps & {
|
|
8
10
|
layoutOptions?: object;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Request } from 'har-format';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { CodeSample } from './extractCodeSamples';
|
|
3
4
|
export interface RequestSamplesProps {
|
|
4
5
|
request: Request;
|
|
6
|
+
customCodeSamples?: CodeSample[];
|
|
5
7
|
embeddedInMd?: boolean;
|
|
6
8
|
}
|
|
7
9
|
export declare const RequestSamples: React.NamedExoticComponent<RequestSamplesProps>;
|
|
@@ -2,3 +2,4 @@ import { RequestSamplesProps } from './RequestSamples';
|
|
|
2
2
|
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, RequestSamplesProps>;
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare const HoistedStory: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, RequestSamplesProps>;
|
|
5
|
+
export declare const RequestSampleWithCustomCodes: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, RequestSamplesProps>;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { CodeViewerLanguage } from '@stoplight/mosaic-code-viewer';
|
|
2
2
|
import { Dictionary } from '@stoplight/types';
|
|
3
|
-
declare type SupportedLanguage = string;
|
|
4
|
-
declare type SupportedLibrary = string;
|
|
5
|
-
interface LibraryConfig {
|
|
3
|
+
export declare type SupportedLanguage = string;
|
|
4
|
+
export declare type SupportedLibrary = string;
|
|
5
|
+
export interface LibraryConfig {
|
|
6
6
|
httpSnippetLibrary: string;
|
|
7
7
|
}
|
|
8
|
-
interface LanguageConfig {
|
|
8
|
+
export interface LanguageConfig {
|
|
9
9
|
mosaicCodeViewerLanguage: CodeViewerLanguage;
|
|
10
10
|
httpSnippetLanguage: string;
|
|
11
11
|
libraries?: Dictionary<LibraryConfig, SupportedLibrary>;
|
|
12
12
|
}
|
|
13
|
-
declare type RequestSampleConfigs = Dictionary<LanguageConfig, SupportedLanguage>;
|
|
13
|
+
export declare type RequestSampleConfigs = Dictionary<LanguageConfig, SupportedLanguage>;
|
|
14
14
|
export declare const requestSampleConfigs: RequestSampleConfigs;
|
|
15
|
-
export declare const getConfigFor: (language: string, library: string) => LanguageConfig & Partial<LibraryConfig>;
|
|
16
|
-
export {};
|
package/constants.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ export declare const HttpMethodColors: {
|
|
|
11
11
|
readonly put: "warning";
|
|
12
12
|
readonly patch: "warning";
|
|
13
13
|
readonly delete: "danger";
|
|
14
|
+
readonly head: "#9061F9";
|
|
15
|
+
readonly options: "#0D5AA7";
|
|
16
|
+
readonly trace: "#0D0B28";
|
|
14
17
|
};
|
|
15
18
|
export declare const HttpCodeColor: {
|
|
16
19
|
readonly 0: "red";
|
package/context/Options.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { DocsProps } from '../components/Docs';
|
|
3
|
-
export declare type ElementsOptionsContextProps = Pick<DocsProps, 'nodeHasChanged'>;
|
|
3
|
+
export declare type ElementsOptionsContextProps = Pick<DocsProps, 'nodeHasChanged' | 'renderExtensionAddon'>;
|
|
4
4
|
export declare const ElementsOptionsContext: React.Context<ElementsOptionsContextProps>;
|
|
5
5
|
export declare const useOptionsCtx: () => ElementsOptionsContextProps;
|
|
6
6
|
export declare type ProviderProps = Partial<ElementsOptionsContextProps> & {
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
};
|
|
9
|
-
export declare function ElementsOptionsProvider({ children, nodeHasChanged }: ProviderProps): JSX.Element;
|
|
9
|
+
export declare function ElementsOptionsProvider({ children, nodeHasChanged, renderExtensionAddon }: ProviderProps): JSX.Element;
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Docs, DocsProps, ParsedDocs } from './components/Docs';
|
|
1
|
+
export { Docs, DocsProps, ExtensionAddonRenderer, ExtensionRowProps, ParsedDocs } from './components/Docs';
|
|
2
2
|
export { DeprecatedBadge } from './components/Docs/HttpOperation/Badges';
|
|
3
3
|
export { ExportButton, ExportButtonProps } from './components/Docs/HttpService/ExportButton';
|
|
4
4
|
export { ResponsiveSidebarLayout } from './components/Layout/ResponsiveSidebarLayout';
|
|
@@ -17,6 +17,7 @@ export { TryIt, TryItProps, TryItWithRequestSamples, TryItWithRequestSamplesProp
|
|
|
17
17
|
export { HttpMethodColors, NodeTypeColors, NodeTypeIconDefs, NodeTypePrettyName } from './constants';
|
|
18
18
|
export { MockingProvider } from './containers/MockingProvider';
|
|
19
19
|
export { InlineRefResolverProvider } from './context/InlineRefResolver';
|
|
20
|
+
export { ElementsOptionsProvider } from './context/Options';
|
|
20
21
|
export { PersistenceContextProvider, withPersistenceBoundary } from './context/Persistence';
|
|
21
22
|
export { RouterTypeContext } from './context/RouterType';
|
|
22
23
|
export { withMosaicProvider } from './hoc/withMosaicProvider';
|