@stoplight/elements-core 7.4.1 → 7.5.0

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.
@@ -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: { contents, description }, onChange }: BodyProps): JSX.Element | null;
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,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare type TableOfContentsProps = {
3
2
  tree: TableOfContentsItem[];
4
3
  activeId: string;
@@ -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, { isEnabled, code, dynamic, example }: MockingOptions): MockData | undefined;
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 {};
@@ -0,0 +1,8 @@
1
+ import { IServer } from '@stoplight/types';
2
+ export declare type ServersDropdownProps = {
3
+ servers: IServer[];
4
+ };
5
+ export declare const ServersDropdown: {
6
+ ({ servers }: ServersDropdownProps): JSX.Element;
7
+ displayName: string;
8
+ };
@@ -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
+ };
@@ -1,2 +1,3 @@
1
+ export { chosenServerAtom } from './chosenServer';
1
2
  export * from './TryIt';
2
3
  export * from './TryItWithRequestSamples';
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>;
@@ -1,3 +1,6 @@
1
1
  import * as React from 'react';
2
- export declare const PersistenceContextProvider: React.FC;
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>;
@@ -1,9 +1,11 @@
1
1
  import * as React from 'react';
2
- declare type RouterType = 'history' | 'memory' | 'hash';
3
- export declare const useRouter: (router: RouterType, basePath: string) => {
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';