@stoplight/elements 9.0.12-beta-0.3 → 9.0.12-beta-0.4
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/package.json +16 -76
- package/.storybook/main.js +0 -6
- package/.storybook/manager.js +0 -1
- package/.storybook/preview.jsx +0 -3
- package/dist/LICENSE +0 -190
- package/dist/README.md +0 -19
- package/dist/package.json +0 -52
- package/jest.config.js +0 -7
- package/src/__fixtures__/api-descriptions/Instagram.ts +0 -1859
- package/src/__fixtures__/api-descriptions/badgesForSchema.ts +0 -36
- package/src/__fixtures__/api-descriptions/simpleApiWithInternalOperations.ts +0 -253
- package/src/__fixtures__/api-descriptions/simpleApiWithoutDescription.ts +0 -243
- package/src/__fixtures__/api-descriptions/todosApiBundled.ts +0 -430
- package/src/__fixtures__/api-descriptions/zoomApiYaml.ts +0 -6083
- package/src/components/API/APIWithResponsiveSidebarLayout.tsx +0 -125
- package/src/components/API/APIWithSidebarLayout.tsx +0 -158
- package/src/components/API/APIWithStackedLayout.tsx +0 -286
- package/src/components/API/__tests__/utils.test.ts +0 -1323
- package/src/components/API/utils.ts +0 -206
- package/src/containers/API.spec.tsx +0 -122
- package/src/containers/API.stories.tsx +0 -117
- package/src/containers/API.tsx +0 -277
- package/src/containers/story-helper.tsx +0 -53
- package/src/hooks/useExportDocumentProps.spec.tsx +0 -68
- package/src/hooks/useExportDocumentProps.tsx +0 -48
- package/src/index.ts +0 -6
- package/src/styles.css +0 -1
- package/src/utils/oas/__tests__/oas.spec.ts +0 -411
- package/src/utils/oas/index.ts +0 -192
- package/src/utils/oas/oas2.ts +0 -31
- package/src/utils/oas/oas3.ts +0 -54
- package/src/utils/oas/types.ts +0 -34
- package/src/web-components/__stories__/Api.stories.tsx +0 -63
- package/src/web-components/components.ts +0 -26
- package/src/web-components/index.ts +0 -3
- package/tsconfig.build.json +0 -18
- package/tsconfig.json +0 -7
- package/web-components.config.js +0 -1
- /package/{dist/__fixtures__ → __fixtures__}/api-descriptions/Instagram.d.ts +0 -0
- /package/{dist/__fixtures__ → __fixtures__}/api-descriptions/badgesForSchema.d.ts +0 -0
- /package/{dist/__fixtures__ → __fixtures__}/api-descriptions/simpleApiWithInternalOperations.d.ts +0 -0
- /package/{dist/__fixtures__ → __fixtures__}/api-descriptions/simpleApiWithoutDescription.d.ts +0 -0
- /package/{dist/__fixtures__ → __fixtures__}/api-descriptions/todosApiBundled.d.ts +0 -0
- /package/{dist/__fixtures__ → __fixtures__}/api-descriptions/zoomApiYaml.d.ts +0 -0
- /package/{dist/components → components}/API/APIWithResponsiveSidebarLayout.d.ts +0 -0
- /package/{dist/components → components}/API/APIWithSidebarLayout.d.ts +0 -0
- /package/{dist/components → components}/API/APIWithStackedLayout.d.ts +0 -0
- /package/{dist/components → components}/API/utils.d.ts +0 -0
- /package/{dist/containers → containers}/API.d.ts +0 -0
- /package/{dist/containers → containers}/API.spec.d.ts +0 -0
- /package/{dist/containers → containers}/API.stories.d.ts +0 -0
- /package/{dist/containers → containers}/story-helper.d.ts +0 -0
- /package/{dist/hooks → hooks}/useExportDocumentProps.d.ts +0 -0
- /package/{dist/hooks → hooks}/useExportDocumentProps.spec.d.ts +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/index.esm.js → index.esm.js} +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/index.mjs → index.mjs} +0 -0
- /package/{dist/styles.min.css → styles.min.css} +0 -0
- /package/{dist/utils → utils}/oas/index.d.ts +0 -0
- /package/{dist/utils → utils}/oas/oas2.d.ts +0 -0
- /package/{dist/utils → utils}/oas/oas3.d.ts +0 -0
- /package/{dist/utils → utils}/oas/types.d.ts +0 -0
- /package/{dist/web-components → web-components}/components.d.ts +0 -0
- /package/{dist/web-components → web-components}/index.d.ts +0 -0
- /package/{dist/web-components.min.js → web-components.min.js} +0 -0
- /package/{dist/web-components.min.js.LICENSE.txt → web-components.min.js.LICENSE.txt} +0 -0
package/src/utils/oas/types.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { IHttpOperation, IHttpService, IHttpWebhookOperation, NodeType } from '@stoplight/types';
|
|
2
|
-
import { JSONSchema7 } from 'json-schema';
|
|
3
|
-
|
|
4
|
-
export enum NodeTypes {
|
|
5
|
-
Paths = 'paths',
|
|
6
|
-
Path = 'path',
|
|
7
|
-
Operation = 'operation',
|
|
8
|
-
Webhooks = 'webhooks',
|
|
9
|
-
Webhook = 'webhook',
|
|
10
|
-
Components = 'components',
|
|
11
|
-
Models = 'models',
|
|
12
|
-
Model = 'model',
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface ISourceNodeMap {
|
|
16
|
-
type: string;
|
|
17
|
-
match?: string;
|
|
18
|
-
notMatch?: string;
|
|
19
|
-
children?: ISourceNodeMap[];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
type Node<T, D> = {
|
|
23
|
-
type: T;
|
|
24
|
-
uri: string;
|
|
25
|
-
name: string;
|
|
26
|
-
data: D;
|
|
27
|
-
tags: string[];
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export type ServiceNode = Node<NodeType.HttpService, IHttpService> & { children: ServiceChildNode[] };
|
|
31
|
-
export type ServiceChildNode = OperationNode | WebhookNode | SchemaNode;
|
|
32
|
-
export type OperationNode = Node<NodeType.HttpOperation, IHttpOperation>;
|
|
33
|
-
export type WebhookNode = Node<NodeType.HttpWebhook, IHttpWebhookOperation>;
|
|
34
|
-
export type SchemaNode = Node<NodeType.Model, JSONSchema7>;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import '../index';
|
|
2
|
-
|
|
3
|
-
import { parse } from '@stoplight/yaml';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
|
|
6
|
-
import { zoomApiYaml } from '../../__fixtures__/api-descriptions/zoomApiYaml';
|
|
7
|
-
|
|
8
|
-
declare global {
|
|
9
|
-
namespace JSX {
|
|
10
|
-
interface IntrinsicElements {
|
|
11
|
-
'elements-api': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const Template = (props: any) => <elements-api {...props} />;
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
title: 'web-components/API',
|
|
20
|
-
argTypes: {
|
|
21
|
-
apiDescriptionUrl: {
|
|
22
|
-
control: 'text',
|
|
23
|
-
},
|
|
24
|
-
apiDescriptionDocument: { control: 'text' },
|
|
25
|
-
layout: {
|
|
26
|
-
control: { type: 'inline-radio', options: ['sidebar', 'stacked'] },
|
|
27
|
-
defaultValue: 'sidebar',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const TodosAPI = Template.bind({});
|
|
33
|
-
TodosAPI.args = {
|
|
34
|
-
apiDescriptionUrl: 'https://raw.githubusercontent.com/stoplightio/elements/main/demo/src/reference/todo.v1.yaml',
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const TodosAPIWithFixHeight = (props: any) => (
|
|
38
|
-
<div style={{ height: 400 }}>
|
|
39
|
-
<elements-api {...props} />
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
TodosAPIWithFixHeight.args = {
|
|
43
|
-
apiDescriptionUrl: 'https://raw.githubusercontent.com/stoplightio/elements/main/demo/src/reference/todo.v1.yaml',
|
|
44
|
-
};
|
|
45
|
-
TodosAPIWithFixHeight.storyName = 'TodosAPI with fixed height';
|
|
46
|
-
|
|
47
|
-
export const ZoomApi = Template.bind({});
|
|
48
|
-
ZoomApi.args = {
|
|
49
|
-
apiDescriptionUrl: 'https://raw.githubusercontent.com/stoplightio/Public-APIs/master/reference/zoom/openapi.yaml',
|
|
50
|
-
};
|
|
51
|
-
ZoomApi.storyName = 'Complex API with inline `$ref`s';
|
|
52
|
-
|
|
53
|
-
export const APIWithYamlProvidedDirectly = Template.bind({});
|
|
54
|
-
APIWithYamlProvidedDirectly.args = {
|
|
55
|
-
apiDescriptionDocument: zoomApiYaml,
|
|
56
|
-
};
|
|
57
|
-
APIWithYamlProvidedDirectly.storyName = 'API With Yaml Provided Directly';
|
|
58
|
-
|
|
59
|
-
export const APIWithJSONProvidedDirectly = Template.bind({});
|
|
60
|
-
APIWithJSONProvidedDirectly.args = {
|
|
61
|
-
apiDescriptionDocument: JSON.stringify(parse(zoomApiYaml), null, ' '),
|
|
62
|
-
};
|
|
63
|
-
APIWithJSONProvidedDirectly.storyName = 'API With JSON Provided Directly';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { createElementClass } from '@stoplight/elements-core';
|
|
2
|
-
|
|
3
|
-
import { API } from '../index';
|
|
4
|
-
|
|
5
|
-
export const ApiElement = createElementClass(API, {
|
|
6
|
-
apiDescriptionUrl: { type: 'string', defaultValue: '' },
|
|
7
|
-
apiDescriptionDocument: { type: 'string', defaultValue: '' },
|
|
8
|
-
basePath: { type: 'string' },
|
|
9
|
-
staticRouterPath: { type: 'string' },
|
|
10
|
-
router: { type: 'string' },
|
|
11
|
-
layout: { type: 'string' },
|
|
12
|
-
hideTryItPanel: { type: 'boolean' },
|
|
13
|
-
hideTryIt: { type: 'boolean' },
|
|
14
|
-
hideSamples: { type: 'boolean' },
|
|
15
|
-
hideServerInfo: { type: 'boolean' },
|
|
16
|
-
hideSecurityInfo: { type: 'boolean' },
|
|
17
|
-
hideSchemas: { type: 'boolean' },
|
|
18
|
-
hideInternal: { type: 'boolean' },
|
|
19
|
-
hideExport: { type: 'boolean' },
|
|
20
|
-
logo: { type: 'string' },
|
|
21
|
-
tryItCredentialsPolicy: { type: 'string' },
|
|
22
|
-
tryItCorsProxy: { type: 'string' },
|
|
23
|
-
maxRefDepth: { type: 'number' },
|
|
24
|
-
renderExtensionAddon: { type: 'function' },
|
|
25
|
-
outerRouter: { type: 'boolean' },
|
|
26
|
-
});
|
package/tsconfig.build.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"include": [
|
|
4
|
-
"src"
|
|
5
|
-
],
|
|
6
|
-
"exclude": [
|
|
7
|
-
"**/__*__/**"
|
|
8
|
-
],
|
|
9
|
-
"compilerOptions": {
|
|
10
|
-
"baseUrl": "./",
|
|
11
|
-
"outDir": "dist",
|
|
12
|
-
"moduleResolution": "node",
|
|
13
|
-
"paths": {
|
|
14
|
-
"@stoplight/elements-core": ["../elements-core/dist"],
|
|
15
|
-
"@stoplight/elements-core/*": ["../elements-core/dist/*"],
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
package/tsconfig.json
DELETED
package/web-components.config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../../web-components.webpack.config');
|
|
File without changes
|
|
File without changes
|
/package/{dist/__fixtures__ → __fixtures__}/api-descriptions/simpleApiWithInternalOperations.d.ts
RENAMED
|
File without changes
|
/package/{dist/__fixtures__ → __fixtures__}/api-descriptions/simpleApiWithoutDescription.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|