@asyncapi/react-component 1.0.0-next.4 → 1.0.0-next.40
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/README.md +74 -3
- package/browser/index.js +8 -6
- package/browser/standalone/index.js +45 -0
- package/browser/standalone/without-parser.js +41 -0
- package/browser/without-parser.js +6 -6
- package/lib/cjs/components/Bindings.js +12 -4
- package/lib/cjs/components/Bindings.js.map +1 -1
- package/lib/cjs/components/CollapseButton.js +7 -7
- package/lib/cjs/components/CollapseButton.js.map +1 -1
- package/lib/cjs/components/Extensions.js +4 -3
- package/lib/cjs/components/Extensions.js.map +1 -1
- package/lib/cjs/components/Href.js +2 -1
- package/lib/cjs/components/Href.js.map +1 -1
- package/lib/cjs/components/JSONSnippet.js +17 -0
- package/lib/cjs/components/JSONSnippet.js.map +1 -0
- package/lib/cjs/components/Markdown.js +4 -4
- package/lib/cjs/components/Markdown.js.map +1 -1
- package/lib/cjs/components/Schema.js +67 -26
- package/lib/cjs/components/Schema.js.map +1 -1
- package/lib/cjs/components/Tag.js +3 -2
- package/lib/cjs/components/Tag.js.map +1 -1
- package/lib/cjs/components/Tags.js +2 -1
- package/lib/cjs/components/Tags.js.map +1 -1
- package/lib/cjs/components/index.js +6 -2
- package/lib/cjs/components/index.js.map +1 -1
- package/lib/cjs/config/config.js.map +1 -1
- package/lib/cjs/config/default.js +1 -0
- package/lib/cjs/config/default.js.map +1 -1
- package/lib/cjs/config/index.js +5 -1
- package/lib/cjs/config/index.js.map +1 -1
- package/lib/cjs/constants.js +3 -48
- package/lib/cjs/constants.js.map +1 -1
- package/lib/cjs/containers/AsyncApi/AsyncApi.js +8 -2
- package/lib/cjs/containers/AsyncApi/AsyncApi.js.map +1 -1
- package/lib/cjs/containers/AsyncApi/Layout.js +33 -21
- package/lib/cjs/containers/AsyncApi/Layout.js.map +1 -1
- package/lib/cjs/containers/AsyncApi/Standalone.js +7 -1
- package/lib/cjs/containers/AsyncApi/Standalone.js.map +1 -1
- package/lib/cjs/containers/Error/Error.js +5 -4
- package/lib/cjs/containers/Error/Error.js.map +1 -1
- package/lib/cjs/containers/Info/Info.js +5 -4
- package/lib/cjs/containers/Info/Info.js.map +1 -1
- package/lib/cjs/containers/Messages/Message.js +20 -7
- package/lib/cjs/containers/Messages/Message.js.map +1 -1
- package/lib/cjs/containers/Messages/MessageExample.js +21 -14
- package/lib/cjs/containers/Messages/MessageExample.js.map +1 -1
- package/lib/cjs/containers/Messages/Messages.js +11 -7
- package/lib/cjs/containers/Messages/Messages.js.map +1 -1
- package/lib/cjs/containers/Operations/Operation.js +64 -33
- package/lib/cjs/containers/Operations/Operation.js.map +1 -1
- package/lib/cjs/containers/Operations/Operations.js +9 -6
- package/lib/cjs/containers/Operations/Operations.js.map +1 -1
- package/lib/cjs/containers/Schemas/Schema.js +21 -0
- package/lib/cjs/containers/Schemas/Schema.js.map +1 -0
- package/lib/cjs/containers/Schemas/Schemas.js +28 -0
- package/lib/cjs/containers/Schemas/Schemas.js.map +1 -0
- package/lib/cjs/containers/Servers/Security.js +138 -0
- package/lib/cjs/containers/Servers/Security.js.map +1 -0
- package/lib/cjs/containers/Servers/Server.js +11 -7
- package/lib/cjs/containers/Servers/Server.js.map +1 -1
- package/lib/cjs/containers/Servers/Servers.js +7 -4
- package/lib/cjs/containers/Servers/Servers.js.map +1 -1
- package/lib/cjs/containers/Sidebar/Sidebar.js +55 -35
- package/lib/cjs/containers/Sidebar/Sidebar.js.map +1 -1
- package/lib/cjs/contexts/index.js +6 -1
- package/lib/cjs/contexts/index.js.map +1 -1
- package/lib/cjs/contexts/useConfig.js +10 -0
- package/lib/cjs/contexts/useConfig.js.map +1 -0
- package/lib/cjs/contexts/useSpec.js +7 -3
- package/lib/cjs/contexts/useSpec.js.map +1 -1
- package/lib/cjs/helpers/common.js +17 -0
- package/lib/cjs/helpers/common.js.map +1 -0
- package/lib/cjs/helpers/index.js +7 -4
- package/lib/cjs/helpers/index.js.map +1 -1
- package/lib/cjs/helpers/marked.js +34 -0
- package/lib/cjs/helpers/marked.js.map +1 -0
- package/lib/cjs/helpers/message.js +33 -5
- package/lib/cjs/helpers/message.js.map +1 -1
- package/lib/cjs/helpers/parser.js +4 -4
- package/lib/cjs/helpers/parser.js.map +1 -1
- package/lib/cjs/helpers/schema.js +141 -114
- package/lib/cjs/helpers/schema.js.map +1 -1
- package/lib/cjs/helpers/server.js +49 -0
- package/lib/cjs/helpers/server.js.map +1 -1
- package/lib/cjs/helpers/specification.js +3 -0
- package/lib/cjs/helpers/specification.js.map +1 -1
- package/lib/cjs/index.js +3 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/types.js +4 -51
- package/lib/cjs/types.js.map +1 -1
- package/lib/cjs/without-parser.js +3 -0
- package/lib/cjs/without-parser.js.map +1 -1
- package/lib/esm/components/Bindings.js +10 -3
- package/lib/esm/components/Bindings.js.map +1 -1
- package/lib/esm/components/CollapseButton.js +5 -6
- package/lib/esm/components/CollapseButton.js.map +1 -1
- package/lib/esm/components/Extensions.js +2 -2
- package/lib/esm/components/Extensions.js.map +1 -1
- package/lib/esm/components/Href.js.map +1 -1
- package/lib/esm/components/JSONSnippet.js +10 -0
- package/lib/esm/components/JSONSnippet.js.map +1 -0
- package/lib/esm/components/Markdown.js +2 -3
- package/lib/esm/components/Markdown.js.map +1 -1
- package/lib/esm/components/Schema.js +61 -25
- package/lib/esm/components/Schema.js.map +1 -1
- package/lib/esm/components/Tag.js +1 -1
- package/lib/esm/components/Tag.js.map +1 -1
- package/lib/esm/components/Tags.js.map +1 -1
- package/lib/esm/components/index.js +1 -1
- package/lib/esm/components/index.js.map +1 -1
- package/lib/esm/config/config.js.map +1 -1
- package/lib/esm/config/default.js +1 -0
- package/lib/esm/config/default.js.map +1 -1
- package/lib/esm/config/index.js.map +1 -1
- package/lib/esm/constants.js +1 -47
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/containers/AsyncApi/AsyncApi.js +2 -0
- package/lib/esm/containers/AsyncApi/AsyncApi.js.map +1 -1
- package/lib/esm/containers/AsyncApi/Layout.js +28 -20
- package/lib/esm/containers/AsyncApi/Layout.js.map +1 -1
- package/lib/esm/containers/AsyncApi/Standalone.js +2 -0
- package/lib/esm/containers/AsyncApi/Standalone.js.map +1 -1
- package/lib/esm/containers/Error/Error.js +3 -3
- package/lib/esm/containers/Error/Error.js.map +1 -1
- package/lib/esm/containers/Info/Info.js +2 -2
- package/lib/esm/containers/Info/Info.js.map +1 -1
- package/lib/esm/containers/Messages/Message.js +18 -6
- package/lib/esm/containers/Messages/Message.js.map +1 -1
- package/lib/esm/containers/Messages/MessageExample.js +13 -12
- package/lib/esm/containers/Messages/MessageExample.js.map +1 -1
- package/lib/esm/containers/Messages/Messages.js +10 -7
- package/lib/esm/containers/Messages/Messages.js.map +1 -1
- package/lib/esm/containers/Operations/Operation.js +62 -33
- package/lib/esm/containers/Operations/Operation.js.map +1 -1
- package/lib/esm/containers/Operations/Operations.js +7 -5
- package/lib/esm/containers/Operations/Operations.js.map +1 -1
- package/lib/esm/containers/Schemas/Schema.js +14 -0
- package/lib/esm/containers/Schemas/Schema.js.map +1 -0
- package/lib/esm/containers/Schemas/Schemas.js +21 -0
- package/lib/esm/containers/Schemas/Schemas.js.map +1 -0
- package/lib/esm/containers/Servers/Security.js +131 -0
- package/lib/esm/containers/Servers/Security.js.map +1 -0
- package/lib/esm/containers/Servers/Server.js +10 -7
- package/lib/esm/containers/Servers/Server.js.map +1 -1
- package/lib/esm/containers/Servers/Servers.js +5 -3
- package/lib/esm/containers/Servers/Servers.js.map +1 -1
- package/lib/esm/containers/Sidebar/Sidebar.js +34 -22
- package/lib/esm/containers/Sidebar/Sidebar.js.map +1 -1
- package/lib/esm/contexts/index.js +1 -0
- package/lib/esm/contexts/index.js.map +1 -1
- package/lib/esm/contexts/useConfig.js +6 -0
- package/lib/esm/contexts/useConfig.js.map +1 -0
- package/lib/esm/contexts/useSpec.js +2 -2
- package/lib/esm/contexts/useSpec.js.map +1 -1
- package/lib/esm/helpers/common.js +14 -0
- package/lib/esm/helpers/common.js.map +1 -0
- package/lib/esm/helpers/index.js +2 -3
- package/lib/esm/helpers/index.js.map +1 -1
- package/lib/esm/helpers/marked.js +27 -0
- package/lib/esm/helpers/marked.js.map +1 -0
- package/lib/esm/helpers/message.js +32 -4
- package/lib/esm/helpers/message.js.map +1 -1
- package/lib/esm/helpers/parser.js.map +1 -1
- package/lib/esm/helpers/schema.js +140 -113
- package/lib/esm/helpers/schema.js.map +1 -1
- package/lib/esm/helpers/server.js +49 -0
- package/lib/esm/helpers/server.js.map +1 -1
- package/lib/esm/helpers/specification.js +5 -2
- package/lib/esm/helpers/specification.js.map +1 -1
- package/lib/esm/index.js +2 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/types.js +2 -46
- package/lib/esm/types.js.map +1 -1
- package/lib/esm/without-parser.js +2 -0
- package/lib/esm/without-parser.js.map +1 -1
- package/lib/types/components/Bindings.d.ts.map +1 -1
- package/lib/types/components/CollapseButton.d.ts +1 -0
- package/lib/types/components/CollapseButton.d.ts.map +1 -1
- package/lib/types/components/Extensions.d.ts.map +1 -1
- package/lib/types/components/JSONSnippet.d.ts +7 -0
- package/lib/types/components/JSONSnippet.d.ts.map +1 -0
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Schema.d.ts +3 -2
- package/lib/types/components/Schema.d.ts.map +1 -1
- package/lib/types/components/index.d.ts +1 -1
- package/lib/types/components/index.d.ts.map +1 -1
- package/lib/types/config/config.d.ts +1 -0
- package/lib/types/config/config.d.ts.map +1 -1
- package/lib/types/config/default.d.ts.map +1 -1
- package/lib/types/constants.d.ts +1 -26
- package/lib/types/constants.d.ts.map +1 -1
- package/lib/types/containers/AsyncApi/Layout.d.ts.map +1 -1
- package/lib/types/containers/Messages/Message.d.ts +1 -0
- package/lib/types/containers/Messages/Message.d.ts.map +1 -1
- package/lib/types/containers/Messages/MessageExample.d.ts +2 -1
- package/lib/types/containers/Messages/MessageExample.d.ts.map +1 -1
- package/lib/types/containers/Messages/Messages.d.ts.map +1 -1
- package/lib/types/containers/Operations/Operation.d.ts +1 -0
- package/lib/types/containers/Operations/Operation.d.ts.map +1 -1
- package/lib/types/containers/Operations/Operations.d.ts.map +1 -1
- package/lib/types/containers/Schemas/Schema.d.ts +9 -0
- package/lib/types/containers/Schemas/Schema.d.ts.map +1 -0
- package/lib/types/containers/Schemas/Schemas.d.ts +3 -0
- package/lib/types/containers/Schemas/Schemas.d.ts.map +1 -0
- package/lib/types/containers/Servers/Security.d.ts +10 -0
- package/lib/types/containers/Servers/Security.d.ts.map +1 -0
- package/lib/types/containers/Servers/Server.d.ts.map +1 -1
- package/lib/types/containers/Servers/Servers.d.ts.map +1 -1
- package/lib/types/containers/Sidebar/Sidebar.d.ts.map +1 -1
- package/lib/types/contexts/index.d.ts +1 -0
- package/lib/types/contexts/index.d.ts.map +1 -1
- package/lib/types/contexts/useConfig.d.ts +5 -0
- package/lib/types/contexts/useConfig.d.ts.map +1 -0
- package/lib/types/contexts/useSpec.d.ts +1 -3
- package/lib/types/contexts/useSpec.d.ts.map +1 -1
- package/lib/types/helpers/common.d.ts +5 -0
- package/lib/types/helpers/common.d.ts.map +1 -0
- package/lib/types/helpers/index.d.ts +2 -3
- package/lib/types/helpers/index.d.ts.map +1 -1
- package/lib/types/helpers/marked.d.ts +4 -0
- package/lib/types/helpers/marked.d.ts.map +1 -0
- package/lib/types/helpers/message.d.ts +3 -2
- package/lib/types/helpers/message.d.ts.map +1 -1
- package/lib/types/helpers/schema.d.ts +8 -3
- package/lib/types/helpers/schema.d.ts.map +1 -1
- package/lib/types/helpers/server.d.ts +6 -1
- package/lib/types/helpers/server.d.ts.map +1 -1
- package/lib/types/helpers/specification.d.ts.map +1 -1
- package/lib/types/index.d.ts +2 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/types.d.ts +10 -303
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/without-parser.d.ts +2 -0
- package/lib/types/without-parser.d.ts.map +1 -1
- package/package.json +37 -14
- package/styles/default.css +903 -642
- package/styles/default.min.css +4 -2
- package/lib/cjs/components/Code.js +0 -15
- package/lib/cjs/components/Code.js.map +0 -1
- package/lib/cjs/containers/Servers/ServerSecurity.js +0 -101
- package/lib/cjs/containers/Servers/ServerSecurity.js.map +0 -1
- package/lib/cjs/helpers/bemClasses.js +0 -49
- package/lib/cjs/helpers/bemClasses.js.map +0 -1
- package/lib/cjs/helpers/formatJsonHighlight.js +0 -61
- package/lib/cjs/helpers/formatJsonHighlight.js.map +0 -1
- package/lib/cjs/helpers/toKebabCase.js +0 -15
- package/lib/cjs/helpers/toKebabCase.js.map +0 -1
- package/lib/esm/components/Code.js +0 -9
- package/lib/esm/components/Code.js.map +0 -1
- package/lib/esm/containers/Servers/ServerSecurity.js +0 -95
- package/lib/esm/containers/Servers/ServerSecurity.js.map +0 -1
- package/lib/esm/helpers/bemClasses.js +0 -46
- package/lib/esm/helpers/bemClasses.js.map +0 -1
- package/lib/esm/helpers/formatJsonHighlight.js +0 -57
- package/lib/esm/helpers/formatJsonHighlight.js.map +0 -1
- package/lib/esm/helpers/toKebabCase.js +0 -11
- package/lib/esm/helpers/toKebabCase.js.map +0 -1
- package/lib/types/components/Code.d.ts +0 -7
- package/lib/types/components/Code.d.ts.map +0 -1
- package/lib/types/containers/Servers/ServerSecurity.d.ts +0 -8
- package/lib/types/containers/Servers/ServerSecurity.d.ts.map +0 -1
- package/lib/types/helpers/bemClasses.d.ts +0 -14
- package/lib/types/helpers/bemClasses.d.ts.map +0 -1
- package/lib/types/helpers/formatJsonHighlight.d.ts +0 -2
- package/lib/types/helpers/formatJsonHighlight.d.ts.map +0 -1
- package/lib/types/helpers/toKebabCase.d.ts +0 -2
- package/lib/types/helpers/toKebabCase.d.ts.map +0 -1
package/lib/cjs/types.js
CHANGED
|
@@ -1,60 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
BindingsType["http"] = "http";
|
|
7
|
-
BindingsType["ws"] = "ws";
|
|
8
|
-
BindingsType["kafka"] = "kafka";
|
|
9
|
-
BindingsType["amqp"] = "amqp";
|
|
10
|
-
BindingsType["amqp1"] = "amqp1";
|
|
11
|
-
BindingsType["mqtt"] = "mqtt";
|
|
12
|
-
BindingsType["mqtt5"] = "mqtt5";
|
|
13
|
-
BindingsType["nats"] = "nats";
|
|
14
|
-
BindingsType["jms"] = "jms";
|
|
15
|
-
BindingsType["sns"] = "sns";
|
|
16
|
-
BindingsType["sqs"] = "sqs";
|
|
17
|
-
BindingsType["stomp"] = "stomp";
|
|
18
|
-
BindingsType["redis"] = "redis";
|
|
19
|
-
})(BindingsType = exports.BindingsType || (exports.BindingsType = {}));
|
|
20
|
-
function isRawMessage(message) {
|
|
21
|
-
return !message.oneOf;
|
|
3
|
+
exports.PayloadType = exports.isFetchingSchemaInterface = void 0;
|
|
4
|
+
function isFetchingSchemaInterface(schema) {
|
|
5
|
+
return schema.url !== undefined;
|
|
22
6
|
}
|
|
23
|
-
exports.
|
|
7
|
+
exports.isFetchingSchemaInterface = isFetchingSchemaInterface;
|
|
24
8
|
var PayloadType;
|
|
25
9
|
(function (PayloadType) {
|
|
26
10
|
PayloadType["PUBLISH"] = "publish";
|
|
27
11
|
PayloadType["SUBSCRIBE"] = "subscribe";
|
|
28
12
|
})(PayloadType = exports.PayloadType || (exports.PayloadType = {}));
|
|
29
|
-
function isOneOfPayload(payload) {
|
|
30
|
-
return !!payload && payload.oneOf !== undefined;
|
|
31
|
-
}
|
|
32
|
-
exports.isOneOfPayload = isOneOfPayload;
|
|
33
|
-
function isAnyOfPayload(payload) {
|
|
34
|
-
return !!payload && payload.anyOf !== undefined;
|
|
35
|
-
}
|
|
36
|
-
exports.isAnyOfPayload = isAnyOfPayload;
|
|
37
|
-
var SecuritySchemeType;
|
|
38
|
-
(function (SecuritySchemeType) {
|
|
39
|
-
SecuritySchemeType["userPassword"] = "User / Password";
|
|
40
|
-
SecuritySchemeType["apiKey"] = "API key";
|
|
41
|
-
SecuritySchemeType["X509"] = "X509";
|
|
42
|
-
SecuritySchemeType["symmetricEncryption"] = "Symmetric Encryption";
|
|
43
|
-
SecuritySchemeType["asymmetricEncryption"] = "Asymmetric Encryption";
|
|
44
|
-
SecuritySchemeType["httpApiKey"] = "HTTP API key";
|
|
45
|
-
SecuritySchemeType["http"] = "HTTP";
|
|
46
|
-
SecuritySchemeType["oauth2"] = "OAuth2";
|
|
47
|
-
SecuritySchemeType["openIdConnect"] = "Open ID";
|
|
48
|
-
})(SecuritySchemeType = exports.SecuritySchemeType || (exports.SecuritySchemeType = {}));
|
|
49
|
-
var OAuthFlowsType;
|
|
50
|
-
(function (OAuthFlowsType) {
|
|
51
|
-
OAuthFlowsType["implicit"] = "Implicit";
|
|
52
|
-
OAuthFlowsType["password"] = "Password";
|
|
53
|
-
OAuthFlowsType["clientCredentials"] = "Client Credentials";
|
|
54
|
-
OAuthFlowsType["authorizationCode"] = "Authorization Code";
|
|
55
|
-
})(OAuthFlowsType = exports.OAuthFlowsType || (exports.OAuthFlowsType = {}));
|
|
56
|
-
function isFetchingSchemaInterface(schema) {
|
|
57
|
-
return schema.url !== undefined;
|
|
58
|
-
}
|
|
59
|
-
exports.isFetchingSchemaInterface = isFetchingSchemaInterface;
|
|
60
13
|
//# sourceMappingURL=types.js.map
|
package/lib/cjs/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAeA,SAAgB,yBAAyB,CACvC,MAAmB;IAEnB,OAAQ,MAAkC,CAAC,GAAG,KAAK,SAAS,CAAC;AAC/D,CAAC;AAJD,8DAIC;AAYD,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;AACzB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB","sourcesContent":["import { AsyncAPIDocument } from '@asyncapi/parser';\n\nexport type PropsSchema =\n | string\n | FetchingSchemaInterface\n | AsyncAPIDocument\n | object;\n\nexport type NullableAsyncApi = AsyncAPIDocument | null;\n\nexport interface AsyncApiState {\n validatedSchema: NullableAsyncApi;\n error?: ErrorObject;\n}\n\nexport function isFetchingSchemaInterface(\n schema: PropsSchema,\n): schema is FetchingSchemaInterface {\n return (schema as FetchingSchemaInterface).url !== undefined;\n}\n\nexport interface FetchingSchemaInterface {\n url: string;\n requestOptions?: RequestInit;\n}\n\nexport interface ParserReturn {\n asyncapi?: AsyncAPIDocument;\n error?: ErrorObject;\n}\n\nexport enum PayloadType {\n PUBLISH = 'publish',\n SUBSCRIBE = 'subscribe',\n}\n\nexport interface MessageExample {\n name?: string;\n summary?: string;\n example: any;\n}\n\nexport interface ValidationError {\n title: string;\n location: {\n jsonPointer: string;\n startLine: number;\n startColumn: number;\n startOffset: number;\n endLine: number;\n endColumn: number;\n endOffset: number;\n };\n}\n\nexport interface ErrorObject {\n type: string;\n title: string;\n detail?: string;\n parsedJSON?: any;\n validationErrors?: ValidationError[];\n location?: {\n startLine: number;\n startColumn: number;\n startOffset: number;\n };\n refs?: Array<{\n title: string;\n jsonPointer: string;\n startLine: number;\n startColumn: number;\n startOffset: number;\n endLine: number;\n endColumn: number;\n endOffset: number;\n }>;\n}\n"]}
|
|
@@ -3,6 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.hljs = void 0;
|
|
6
7
|
var Standalone_1 = __importDefault(require("./containers/AsyncApi/Standalone"));
|
|
8
|
+
var helpers_1 = require("./helpers");
|
|
9
|
+
Object.defineProperty(exports, "hljs", { enumerable: true, get: function () { return helpers_1.hljs; } });
|
|
7
10
|
exports.default = Standalone_1.default;
|
|
8
11
|
//# sourceMappingURL=without-parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"without-parser.js","sourceRoot":"","sources":["../../src/without-parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"without-parser.js","sourceRoot":"","sources":["../../src/without-parser.ts"],"names":[],"mappings":";;;;;;AAAA,gFAAiE;AAEjE,qCAAiC;AAExB,qFAFA,cAAI,OAEA;AACb,kBAAe,oBAAiB,CAAC","sourcesContent":["import AsyncApiComponent from './containers/AsyncApi/Standalone';\n\nimport { hljs } from './helpers';\n\nexport { hljs };\nexport default AsyncApiComponent;\n"]}
|
|
@@ -2,11 +2,18 @@ import React from 'react';
|
|
|
2
2
|
import { Schema } from './Schema';
|
|
3
3
|
import { SchemaHelpers } from '../helpers';
|
|
4
4
|
export var Bindings = function (_a) {
|
|
5
|
-
var _b = _a.name, name = _b === void 0 ? '
|
|
5
|
+
var _b = _a.name, name = _b === void 0 ? 'Binding specific information' : _b, bindings = _a.bindings;
|
|
6
6
|
if (!bindings || !Object.keys(bindings).length) {
|
|
7
7
|
return null;
|
|
8
8
|
}
|
|
9
|
-
var
|
|
10
|
-
|
|
9
|
+
var renderedBindings = Object.entries(bindings).map(function (_a) {
|
|
10
|
+
var bindingName = _a[0], binding = _a[1];
|
|
11
|
+
var schema = SchemaHelpers.jsonToSchema(binding);
|
|
12
|
+
var schemaName = (React.createElement("div", { className: "inline-block text-sm" },
|
|
13
|
+
React.createElement("span", null, name),
|
|
14
|
+
React.createElement("span", { className: "bg-teal-500 font-bold no-underline text-white uppercase rounded mx-2 px-2 py-1 text-xs" }, bindingName)));
|
|
15
|
+
return (schema && (React.createElement(Schema, { schemaName: schemaName, schema: schema, key: bindingName, onlyTitle: true })));
|
|
16
|
+
});
|
|
17
|
+
return React.createElement(React.Fragment, null, renderedBindings);
|
|
11
18
|
};
|
|
12
19
|
//# sourceMappingURL=Bindings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bindings.js","sourceRoot":"","sources":["../../../src/components/Bindings.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAO3C,MAAM,CAAC,IAAM,QAAQ,GAAmC,UAAC,EAGxD;QAFC,
|
|
1
|
+
{"version":3,"file":"Bindings.js","sourceRoot":"","sources":["../../../src/components/Bindings.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAO3C,MAAM,CAAC,IAAM,QAAQ,GAAmC,UAAC,EAGxD;QAFC,YAAqC,EAArC,IAAI,mBAAG,8BAA8B,KAAA,EACrC,QAAQ,cAAA;IAER,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE;QAC9C,OAAO,IAAI,CAAC;KACb;IAED,IAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CACnD,UAAC,EAAsB;YAArB,WAAW,QAAA,EAAE,OAAO,QAAA;QACpB,IAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACnD,IAAM,UAAU,GAAG,CACjB,6BAAK,SAAS,EAAC,sBAAsB;YACnC,kCAAO,IAAI,CAAQ;YACnB,8BAAM,SAAS,EAAC,wFAAwF,IACrG,WAAW,CACP,CACH,CACP,CAAC;QACF,OAAO,CACL,MAAM,IAAI,CACR,oBAAC,MAAM,IACL,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,IAAI,GACf,CACH,CACF,CAAC;IACJ,CAAC,CACF,CAAC;IACF,OAAO,0CAAG,gBAAgB,CAAI,CAAC;AACjC,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Schema } from './Schema';\n\nimport { SchemaHelpers } from '../helpers';\n\ninterface Props {\n name?: string;\n bindings: any;\n}\n\nexport const Bindings: React.FunctionComponent<Props> = ({\n name = 'Binding specific information',\n bindings,\n}) => {\n if (!bindings || !Object.keys(bindings).length) {\n return null;\n }\n\n const renderedBindings = Object.entries(bindings).map(\n ([bindingName, binding]) => {\n const schema = SchemaHelpers.jsonToSchema(binding);\n const schemaName = (\n <div className=\"inline-block text-sm\">\n <span>{name}</span>\n <span className=\"bg-teal-500 font-bold no-underline text-white uppercase rounded mx-2 px-2 py-1 text-xs\">\n {bindingName}\n </span>\n </div>\n );\n return (\n schema && (\n <Schema\n schemaName={schemaName}\n schema={schema}\n key={bindingName}\n onlyTitle={true}\n />\n )\n );\n },\n );\n return <>{renderedBindings}</>;\n};\n"]}
|
|
@@ -21,12 +21,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import React from 'react';
|
|
24
|
+
import { HiChevronRight } from 'react-icons/hi';
|
|
24
25
|
export var CollapseButton = function (_a) {
|
|
25
|
-
var chevronProps = _a.chevronProps, children = _a.children, rest = __rest(_a, ["chevronProps", "children"]);
|
|
26
|
-
return (React.createElement("button", __assign({}, rest, { className: "focus:outline-none "
|
|
27
|
-
children,
|
|
28
|
-
React.createElement(
|
|
29
|
-
'') }),
|
|
30
|
-
React.createElement("polygon", { points: "17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 " }))));
|
|
26
|
+
var chevronProps = _a.chevronProps, _b = _a.expanded, expanded = _b === void 0 ? false : _b, children = _a.children, rest = __rest(_a, ["chevronProps", "expanded", "children"]);
|
|
27
|
+
return (React.createElement("button", __assign({}, rest, { className: "focus:outline-none ".concat(rest.className), type: "button" }),
|
|
28
|
+
React.createElement("div", { className: "inline-block" }, children),
|
|
29
|
+
React.createElement(HiChevronRight, __assign({}, chevronProps, { className: "inline-block align-baseline cursor-pointer ml-0.5 -mb-1 w-5 h-5 transform transition-transform duration-150 ease-linear ".concat(expanded ? '-rotate-90' : '', " ").concat((chevronProps === null || chevronProps === void 0 ? void 0 : chevronProps.className) || '') }))));
|
|
31
30
|
};
|
|
32
31
|
//# sourceMappingURL=CollapseButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapseButton.js","sourceRoot":"","sources":["../../../src/components/CollapseButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAA8C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CollapseButton.js","sourceRoot":"","sources":["../../../src/components/CollapseButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAA8C,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAOhD,MAAM,CAAC,IAAM,cAAc,GAAmC,UAAC,EAK9D;IAJC,IAAA,YAAY,kBAAA,EACZ,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,QAAQ,cAAA,EACL,IAAI,cAJsD,wCAK9D,CADQ;IACH,OAAA,CACJ,2CACM,IAAI,IACR,SAAS,EAAE,6BAAsB,IAAI,CAAC,SAAS,CAAE,EACjD,IAAI,EAAC,QAAQ;QAEb,6BAAK,SAAS,EAAC,cAAc,IAAE,QAAQ,CAAO;QAC9C,oBAAC,cAAc,eACT,YAAY,IAChB,SAAS,EAAE,kIACT,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,cAC1B,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,SAAS,KAAI,EAAE,CAAE,IACnC,CACK,CACV,CAAA;CAAA,CAAC","sourcesContent":["import React, { ButtonHTMLAttributes, SVGAttributes } from 'react';\nimport { HiChevronRight } from 'react-icons/hi';\n\ninterface Props extends ButtonHTMLAttributes<HTMLButtonElement> {\n chevronProps?: SVGAttributes<SVGElement>;\n expanded?: boolean;\n}\n\nexport const CollapseButton: React.FunctionComponent<Props> = ({\n chevronProps,\n expanded = false,\n children,\n ...rest\n}) => (\n <button\n {...rest}\n className={`focus:outline-none ${rest.className}`}\n type=\"button\"\n >\n <div className=\"inline-block\">{children}</div>\n <HiChevronRight\n {...chevronProps}\n className={`inline-block align-baseline cursor-pointer ml-0.5 -mb-1 w-5 h-5 transform transition-transform duration-150 ease-linear ${\n expanded ? '-rotate-90' : ''\n } ${chevronProps?.className || ''}`}\n />\n </button>\n);\n"]}
|
|
@@ -8,7 +8,7 @@ export var Extensions = function (_a) {
|
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
10
|
var schema = SchemaHelpers.jsonToSchema(extensions);
|
|
11
|
-
return (React.createElement("div", { className: "mt-2" },
|
|
12
|
-
React.createElement(Schema, { schemaName: name, schema: schema })));
|
|
11
|
+
return (schema && (React.createElement("div", { className: "mt-2" },
|
|
12
|
+
React.createElement(Schema, { schemaName: name, schema: schema, onlyTitle: true }))));
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=Extensions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Extensions.js","sourceRoot":"","sources":["../../../src/components/Extensions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAO3C,MAAM,CAAC,IAAM,UAAU,GAAmC,UAAC,EAG1D;QAFC,YAAmB,EAAnB,IAAI,mBAAG,YAAY,KAAA,EACnB,IAAI,UAAA;IAEJ,IAAM,UAAU,GAAG,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3D,IAAI,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE;QAClD,OAAO,IAAI,CAAC;KACb;IAED,IAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACtD,OAAO,CACL,6BAAK,SAAS,EAAC,MAAM;QACnB,oBAAC,MAAM,IAAC,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAI,
|
|
1
|
+
{"version":3,"file":"Extensions.js","sourceRoot":"","sources":["../../../src/components/Extensions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAO3C,MAAM,CAAC,IAAM,UAAU,GAAmC,UAAC,EAG1D;QAFC,YAAmB,EAAnB,IAAI,mBAAG,YAAY,KAAA,EACnB,IAAI,UAAA;IAEJ,IAAM,UAAU,GAAG,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3D,IAAI,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE;QAClD,OAAO,IAAI,CAAC;KACb;IAED,IAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACtD,OAAO,CACL,MAAM,IAAI,CACR,6BAAK,SAAS,EAAC,MAAM;QACnB,oBAAC,MAAM,IAAC,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,GAAI,CACzD,CACP,CACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Schema } from './Schema';\n\nimport { SchemaHelpers } from '../helpers';\n\ninterface Props {\n name?: string;\n item: any;\n}\n\nexport const Extensions: React.FunctionComponent<Props> = ({\n name = 'Extensions',\n item,\n}) => {\n const extensions = SchemaHelpers.getCustomExtensions(item);\n if (!extensions || !Object.keys(extensions).length) {\n return null;\n }\n\n const schema = SchemaHelpers.jsonToSchema(extensions);\n return (\n schema && (\n <div className=\"mt-2\">\n <Schema schemaName={name} schema={schema} onlyTitle={true} />\n </div>\n )\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Href.js","sourceRoot":"","sources":["../../../src/components/Href.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,CAAC,IAAM,IAAI,GAAmC,UAAC,EAKpD;QAJC,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,SAAS,eAAA,EACT,QAAQ,cAAA;IACJ,OAAA,CACJ,2BACE,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,8BAA8B,IAEjC,QAAQ,CACP,CACL;AAVK,CAUL,CAAC"}
|
|
1
|
+
{"version":3,"file":"Href.js","sourceRoot":"","sources":["../../../src/components/Href.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,CAAC,IAAM,IAAI,GAAmC,UAAC,EAKpD;QAJC,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,SAAS,eAAA,EACT,QAAQ,cAAA;IACJ,OAAA,CACJ,2BACE,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,8BAA8B,IAEjC,QAAQ,CACP,CACL;AAVK,CAUL,CAAC","sourcesContent":["import React from 'react';\n\ninterface Props {\n href: string;\n title?: string;\n className?: string;\n}\n\nexport const Href: React.FunctionComponent<Props> = ({\n href,\n title,\n className,\n children,\n}) => (\n <a\n href={href}\n title={title}\n className={className}\n target=\"_blank\"\n rel=\"nofollow noopener noreferrer\"\n >\n {children}\n </a>\n);\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Markdown } from './index';
|
|
3
|
+
export var JSONSnippet = function (_a) {
|
|
4
|
+
var snippet = _a.snippet;
|
|
5
|
+
if (typeof snippet === 'object') {
|
|
6
|
+
snippet = '```json\n' + JSON.stringify(snippet, undefined, 2) + '\n```';
|
|
7
|
+
}
|
|
8
|
+
return React.createElement(Markdown, null, snippet);
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=JSONSnippet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JSONSnippet.js","sourceRoot":"","sources":["../../../src/components/JSONSnippet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAMnC,MAAM,CAAC,IAAM,WAAW,GAAmC,UAAC,EAAW;QAAT,OAAO,aAAA;IACnE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAE/B,OAAO,GAAG,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC;KACzE;IAED,OAAO,oBAAC,QAAQ,QAAE,OAAO,CAAY,CAAC;AACxC,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Markdown } from './index';\n\ninterface Props {\n snippet: string | object;\n}\n\nexport const JSONSnippet: React.FunctionComponent<Props> = ({ snippet }) => {\n if (typeof snippet === 'object') {\n // change code to markdown's json code block\n snippet = '```json\\n' + JSON.stringify(snippet, undefined, 2) + '\\n```';\n }\n\n return <Markdown>{snippet}</Markdown>;\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { sanitize } from 'isomorphic-dompurify';
|
|
3
|
-
import
|
|
3
|
+
import { renderMarkdown } from '../helpers';
|
|
4
4
|
export var Markdown = function (_a) {
|
|
5
5
|
var children = _a.children;
|
|
6
6
|
if (!children) {
|
|
@@ -9,7 +9,6 @@ export var Markdown = function (_a) {
|
|
|
9
9
|
if (typeof children !== 'string') {
|
|
10
10
|
return React.createElement(React.Fragment, null, children);
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
return (React.createElement("div", { className: "prose max-w-max text-sm", dangerouslySetInnerHTML: { __html: sanitize(html) } }));
|
|
12
|
+
return (React.createElement("div", { className: "prose max-w-none text-sm", dangerouslySetInnerHTML: { __html: sanitize(renderMarkdown(children)) } }));
|
|
14
13
|
};
|
|
15
14
|
//# sourceMappingURL=Markdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.js","sourceRoot":"","sources":["../../../src/components/Markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Markdown.js","sourceRoot":"","sources":["../../../src/components/Markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,IAAM,QAAQ,GAA4B,UAAC,EAAY;QAAV,QAAQ,cAAA;IAC1D,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAChC,OAAO,0CAAG,QAAQ,CAAI,CAAC;KACxB;IAED,OAAO,CACL,6BACE,SAAS,EAAC,0BAA0B,EACpC,uBAAuB,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,EAAE,GACvE,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { sanitize } from 'isomorphic-dompurify';\n\nimport { renderMarkdown } from '../helpers';\n\nexport const Markdown: React.FunctionComponent = ({ children }) => {\n if (!children) {\n return null;\n }\n if (typeof children !== 'string') {\n return <>{children}</>;\n }\n\n return (\n <div\n className=\"prose max-w-none text-sm\"\n dangerouslySetInnerHTML={{ __html: sanitize(renderMarkdown(children)) }}\n />\n );\n};\n"]}
|
|
@@ -1,30 +1,66 @@
|
|
|
1
|
-
import React, { useState, useContext } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useContext } from 'react';
|
|
2
2
|
import { Href, CollapseButton, Markdown, Extensions } from './index';
|
|
3
3
|
import { SchemaHelpers } from '../helpers';
|
|
4
|
-
var SchemaContext = React.createContext({
|
|
4
|
+
var SchemaContext = React.createContext({
|
|
5
|
+
reverse: false,
|
|
6
|
+
deepExpanded: false,
|
|
7
|
+
});
|
|
5
8
|
export var Schema = function (_a) {
|
|
6
|
-
var schemaName = _a.schemaName, schema = _a.schema, _b = _a.required, required = _b === void 0 ? false : _b, _c = _a.
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
9
|
+
var schemaName = _a.schemaName, schema = _a.schema, _b = _a.required, required = _b === void 0 ? false : _b, _c = _a.isPatternProperty, isPatternProperty = _c === void 0 ? false : _c, _d = _a.isProperty, isProperty = _d === void 0 ? false : _d, _e = _a.isCircular, isCircular = _e === void 0 ? false : _e, dependentRequired = _a.dependentRequired, _f = _a.expanded, propExpanded = _f === void 0 ? false : _f, _g = _a.onlyTitle, onlyTitle = _g === void 0 ? false : _g;
|
|
10
|
+
var _h = useContext(SchemaContext), reverse = _h.reverse, deepExpanded = _h.deepExpanded;
|
|
11
|
+
var _j = useState(propExpanded), expanded = _j[0], setExpanded = _j[1];
|
|
12
|
+
var _k = useState(false), deepExpand = _k[0], setDeepExpand = _k[1];
|
|
13
|
+
useEffect(function () {
|
|
14
|
+
setDeepExpand(deepExpanded);
|
|
15
|
+
}, [deepExpanded, setDeepExpand]);
|
|
16
|
+
useEffect(function () {
|
|
17
|
+
setExpanded(deepExpand);
|
|
18
|
+
}, [deepExpand, setExpanded]);
|
|
19
|
+
if (!schema ||
|
|
20
|
+
(typeof schemaName === 'string' &&
|
|
21
|
+
((schemaName === null || schemaName === void 0 ? void 0 : schemaName.startsWith('x-parser-')) ||
|
|
22
|
+
(schemaName === null || schemaName === void 0 ? void 0 : schemaName.startsWith('x-schema-private-'))))) {
|
|
10
23
|
return null;
|
|
11
24
|
}
|
|
12
|
-
var uid = schema.uid();
|
|
13
25
|
var dependentSchemas = SchemaHelpers.getDependentSchemas(schema);
|
|
14
26
|
var constraints = SchemaHelpers.humanizeConstraints(schema);
|
|
15
|
-
var isExpandable = SchemaHelpers.isExpandable(schema) || dependentSchemas;
|
|
16
27
|
var externalDocs = schema.externalDocs();
|
|
17
28
|
var renderType = schema.ext(SchemaHelpers.extRenderType) !== false;
|
|
18
29
|
var rawValue = schema.ext(SchemaHelpers.extRawValue) === true;
|
|
19
30
|
var parameterLocation = schema.ext(SchemaHelpers.extParameterLocation);
|
|
20
|
-
|
|
31
|
+
var isExpandable = SchemaHelpers.isExpandable(schema) || dependentSchemas;
|
|
32
|
+
var schemaType = SchemaHelpers.toSchemaType(schema);
|
|
33
|
+
isCircular =
|
|
34
|
+
isCircular ||
|
|
35
|
+
schema.isCircular() ||
|
|
36
|
+
schema.ext('x-parser-circular') ||
|
|
37
|
+
false;
|
|
38
|
+
var uid = schema.uid();
|
|
39
|
+
var schemaItems = schema.items();
|
|
40
|
+
if (schemaItems && !Array.isArray(schemaItems)) {
|
|
41
|
+
isCircular =
|
|
42
|
+
isCircular ||
|
|
43
|
+
schemaItems.isCircular() ||
|
|
44
|
+
schemaItems.ext('x-parser-circular') ||
|
|
45
|
+
false;
|
|
46
|
+
if (isCircular &&
|
|
47
|
+
typeof schemaItems.circularSchema === 'function') {
|
|
48
|
+
schemaType = SchemaHelpers.toSchemaType(schemaItems.circularSchema());
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else if (isCircular &&
|
|
52
|
+
typeof schema.circularSchema === 'function') {
|
|
53
|
+
schemaType = SchemaHelpers.toSchemaType(schema.circularSchema());
|
|
54
|
+
}
|
|
55
|
+
var styledSchemaName = isProperty ? 'italic' : '';
|
|
56
|
+
var renderedSchemaName = typeof schemaName === 'string' ? (React.createElement("span", { className: "break-words text-sm ".concat(styledSchemaName) }, schemaName)) : (schemaName);
|
|
57
|
+
return (React.createElement(SchemaContext.Provider, { value: { reverse: !reverse, deepExpanded: deepExpand } },
|
|
21
58
|
React.createElement("div", null,
|
|
22
59
|
React.createElement("div", { className: "flex py-2" },
|
|
23
|
-
React.createElement("div", { className: "
|
|
24
|
-
isExpandable && !isCircular ? (React.createElement(
|
|
25
|
-
|
|
26
|
-
} },
|
|
27
|
-
React.createElement("span", { className: "break-words text-sm " + (isProperty ? 'italic' : '') }, schemaName))) : (React.createElement("span", { className: "break-words text-sm " + (isProperty ? 'italic' : '') }, schemaName)),
|
|
60
|
+
React.createElement("div", { className: "".concat(onlyTitle ? '' : 'min-w-1/4', " mr-2") },
|
|
61
|
+
isExpandable && !isCircular ? (React.createElement(React.Fragment, null,
|
|
62
|
+
React.createElement(CollapseButton, { onClick: function () { return setExpanded(function (prev) { return !prev; }); }, expanded: expanded }, renderedSchemaName),
|
|
63
|
+
React.createElement("button", { type: "button", onClick: function () { return setDeepExpand(function (prev) { return !prev; }); }, className: "ml-1 text-sm text-gray-500" }, deepExpand ? 'Collapse all' : 'Expand all'))) : (React.createElement("span", { className: "break-words text-sm ".concat(isProperty ? 'italic' : '') }, schemaName)),
|
|
28
64
|
isPatternProperty && (React.createElement("div", { className: "text-gray-500 text-xs italic" }, "(pattern property)")),
|
|
29
65
|
required && React.createElement("div", { className: "text-red-600 text-xs" }, "required"),
|
|
30
66
|
dependentRequired && (React.createElement(React.Fragment, null,
|
|
@@ -36,14 +72,12 @@ export var Schema = function (_a) {
|
|
|
36
72
|
rawValue ? (React.createElement("div", null,
|
|
37
73
|
React.createElement("div", { className: "text-sm" }, schema.const()))) : (React.createElement("div", null,
|
|
38
74
|
React.createElement("div", null,
|
|
39
|
-
renderType && (React.createElement("div", { className: "capitalize text-sm text-teal-500 font-bold inline-block mr-2" }, isCircular
|
|
40
|
-
? '[CIRCULAR]'
|
|
41
|
-
: SchemaHelpers.toSchemaType(schema))),
|
|
75
|
+
renderType && (React.createElement("div", { className: "capitalize text-sm text-teal-500 font-bold inline-block mr-2" }, isCircular ? "".concat(schemaType, " [CIRCULAR]") : schemaType)),
|
|
42
76
|
React.createElement("div", { className: "inline-block" },
|
|
43
77
|
schema.format() && (React.createElement("span", { className: "bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs" },
|
|
44
78
|
"format: ",
|
|
45
79
|
schema.format())),
|
|
46
|
-
schema.pattern() !== undefined && (React.createElement("span", { className: "bg-yellow-600 font-bold no-underline text-white rounded
|
|
80
|
+
schema.pattern() !== undefined && (React.createElement("span", { className: "bg-yellow-600 font-bold no-underline text-white rounded mr-2 p-1 text-xs" },
|
|
47
81
|
"must match: ",
|
|
48
82
|
schema.pattern())),
|
|
49
83
|
schema.contentMediaType() !== undefined && (React.createElement("span", { className: "bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs" },
|
|
@@ -79,9 +113,9 @@ export var Schema = function (_a) {
|
|
|
79
113
|
schema.examples() && (React.createElement("ul", { className: "text-xs" },
|
|
80
114
|
"Examples values:",
|
|
81
115
|
' ',
|
|
82
|
-
schema.examples().map(function (e, idx) { return (React.createElement("li", { key: idx, className: "border inline-block text-orange-600 rounded ml-1 py-0 px-2" },
|
|
116
|
+
schema.examples().map(function (e, idx) { return (React.createElement("li", { key: idx, className: "border inline-block text-orange-600 rounded ml-1 py-0 px-2 break-all" },
|
|
83
117
|
React.createElement("span", null, SchemaHelpers.prettifyValue(e)))); }))))))),
|
|
84
|
-
isCircular || !isExpandable ? null : (React.createElement("div", { className: "rounded p-4 py-2
|
|
118
|
+
isCircular || !isExpandable ? null : (React.createElement("div", { className: "rounded p-4 py-2 border bg-gray-100 ".concat(reverse ? 'bg-gray-200' : '', " ").concat(expanded ? 'block' : 'hidden') },
|
|
85
119
|
React.createElement(SchemaProperties, { schema: schema }),
|
|
86
120
|
React.createElement(SchemaItems, { schema: schema }),
|
|
87
121
|
schema.oneOf() &&
|
|
@@ -115,15 +149,15 @@ var SchemaProperties = function (_a) {
|
|
|
115
149
|
}
|
|
116
150
|
var required = schema.required() || [];
|
|
117
151
|
var patternProperties = schema.patternProperties();
|
|
118
|
-
var circularProps = schema.
|
|
152
|
+
var circularProps = schema.ext('x-parser-circular-props') || [];
|
|
119
153
|
return (React.createElement(React.Fragment, null,
|
|
120
154
|
Object.entries(properties).map(function (_a) {
|
|
121
155
|
var propertyName = _a[0], property = _a[1];
|
|
122
|
-
return (React.createElement(Schema, { schema: property, schemaName: propertyName, required: required.includes(propertyName), isCircular: circularProps.includes(propertyName),
|
|
156
|
+
return (React.createElement(Schema, { schema: property, schemaName: propertyName, required: required.includes(propertyName), isProperty: true, isCircular: circularProps.includes(propertyName), dependentRequired: SchemaHelpers.getDependentRequired(propertyName, schema), key: propertyName }));
|
|
123
157
|
}),
|
|
124
158
|
Object.entries(patternProperties).map(function (_a) {
|
|
125
159
|
var propertyName = _a[0], property = _a[1];
|
|
126
|
-
return (React.createElement(Schema, { schema: property, schemaName: propertyName,
|
|
160
|
+
return (React.createElement(Schema, { schema: property, schemaName: propertyName, isPatternProperty: true, isProperty: true, isCircular: circularProps.includes(propertyName), key: propertyName }));
|
|
127
161
|
})));
|
|
128
162
|
};
|
|
129
163
|
var AdditionalProperties = function (_a) {
|
|
@@ -156,11 +190,13 @@ var SchemaItems = function (_a) {
|
|
|
156
190
|
return null;
|
|
157
191
|
}
|
|
158
192
|
var items = schema.items();
|
|
159
|
-
if (items &&
|
|
193
|
+
if (items &&
|
|
194
|
+
!Array.isArray(items) &&
|
|
195
|
+
Object.keys(items.properties() || {}).length) {
|
|
160
196
|
return React.createElement(SchemaProperties, { schema: items });
|
|
161
197
|
}
|
|
162
198
|
else if (Array.isArray(items)) {
|
|
163
|
-
return (React.createElement(React.Fragment, null, items.map(function (item, idx) { return (React.createElement(Schema, { schema: item, schemaName: idx + 1
|
|
199
|
+
return (React.createElement(React.Fragment, null, items.map(function (item, idx) { return (React.createElement(Schema, { schema: item, schemaName: "".concat(idx + 1, " item:"), key: idx })); })));
|
|
164
200
|
}
|
|
165
201
|
return React.createElement(Schema, { schema: items, schemaName: "Items:" });
|
|
166
202
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../../src/components/Schema.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAa3C,IAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AAE9D,MAAM,CAAC,IAAM,MAAM,GAAmC,UAAC,EAStD;QARC,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,yBAAyB,EAAzB,iBAAiB,mBAAG,KAAK,KAAA,EACzB,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,iBAAiB,uBAAA,EACjB,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA;IAER,IAAA,OAAO,GAAK,UAAU,CAAC,aAAa,CAAC,QAA9B,CAA+B;IACxC,IAAA,KAAsB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;IACD,OAAO,oBAAC,MAAM,IAAC,UAAU,EAAC,mBAAmB,EAAC,MAAM,EAAE,eAAe,GAAI,CAAC;AAC5E,CAAC,CAAC","sourcesContent":["import React, { useState, useEffect, useContext } from 'react';\nimport { Schema as SchemaType } from '@asyncapi/parser';\n\nimport { Href, CollapseButton, Markdown, Extensions } from './index';\nimport { SchemaHelpers } from '../helpers';\n\ninterface Props {\n schemaName?: React.ReactNode;\n schema?: SchemaType;\n required?: boolean;\n isPatternProperty?: boolean;\n isProperty?: boolean;\n isCircular?: boolean;\n dependentRequired?: string[];\n expanded?: boolean;\n onlyTitle?: boolean;\n}\n\nconst SchemaContext = React.createContext({\n reverse: false,\n deepExpanded: false,\n});\n\nexport const Schema: React.FunctionComponent<Props> = ({\n schemaName,\n schema,\n required = false,\n isPatternProperty = false,\n isProperty = false,\n isCircular = false,\n dependentRequired,\n expanded: propExpanded = false,\n onlyTitle = false,\n}) => {\n const { reverse, deepExpanded } = useContext(SchemaContext);\n const [expanded, setExpanded] = useState(propExpanded);\n const [deepExpand, setDeepExpand] = useState(false);\n\n useEffect(() => {\n setDeepExpand(deepExpanded);\n }, [deepExpanded, setDeepExpand]);\n\n useEffect(() => {\n setExpanded(deepExpand);\n }, [deepExpand, setExpanded]);\n\n if (\n !schema ||\n (typeof schemaName === 'string' &&\n (schemaName?.startsWith('x-parser-') ||\n schemaName?.startsWith('x-schema-private-')))\n ) {\n return null;\n }\n\n const dependentSchemas = SchemaHelpers.getDependentSchemas(schema);\n\n const constraints = SchemaHelpers.humanizeConstraints(schema);\n const externalDocs = schema.externalDocs();\n\n const renderType = schema.ext(SchemaHelpers.extRenderType) !== false;\n const rawValue = schema.ext(SchemaHelpers.extRawValue) === true;\n const parameterLocation = schema.ext(SchemaHelpers.extParameterLocation);\n const isExpandable = SchemaHelpers.isExpandable(schema) || dependentSchemas;\n\n let schemaType = SchemaHelpers.toSchemaType(schema);\n isCircular =\n isCircular ||\n schema.isCircular() ||\n schema.ext('x-parser-circular') ||\n false;\n const uid = schema.uid();\n\n const schemaItems = schema.items();\n if (schemaItems && !Array.isArray(schemaItems)) {\n /**\n * fallback for older logic for circular references:\n *\n * checking uid for circular items\n * `x-parser-circular` extension is added to every schema which has circular `items` field,\n * so we must check that `items` is schema (not array of schemas) and infer UID of schema to display which schema is circular (by the name of schema)\n */\n isCircular =\n isCircular ||\n schemaItems.isCircular() ||\n schemaItems.ext('x-parser-circular') ||\n false;\n if (\n isCircular &&\n typeof (schemaItems as any).circularSchema === 'function'\n ) {\n schemaType = SchemaHelpers.toSchemaType(\n (schemaItems as any).circularSchema(),\n );\n }\n } else if (\n isCircular &&\n typeof (schema as any).circularSchema === 'function'\n ) {\n schemaType = SchemaHelpers.toSchemaType((schema as any).circularSchema());\n }\n\n const styledSchemaName = isProperty ? 'italic' : '';\n const renderedSchemaName =\n typeof schemaName === 'string' ? (\n <span className={`break-words text-sm ${styledSchemaName}`}>\n {schemaName}\n </span>\n ) : (\n schemaName\n );\n\n return (\n <SchemaContext.Provider\n value={{ reverse: !reverse, deepExpanded: deepExpand }}\n >\n <div>\n <div className=\"flex py-2\">\n <div className={`${onlyTitle ? '' : 'min-w-1/4'} mr-2`}>\n {isExpandable && !isCircular ? (\n <>\n <CollapseButton\n onClick={() => setExpanded(prev => !prev)}\n expanded={expanded}\n >\n {renderedSchemaName}\n </CollapseButton>\n <button\n type=\"button\"\n onClick={() => setDeepExpand(prev => !prev)}\n className=\"ml-1 text-sm text-gray-500\"\n >\n {deepExpand ? 'Collapse all' : 'Expand all'}\n </button>\n </>\n ) : (\n <span\n className={`break-words text-sm ${isProperty ? 'italic' : ''}`}\n >\n {schemaName}\n </span>\n )}\n {isPatternProperty && (\n <div className=\"text-gray-500 text-xs italic\">\n (pattern property)\n </div>\n )}\n {required && <div className=\"text-red-600 text-xs\">required</div>}\n {dependentRequired && (\n <>\n <div className=\"text-gray-500 text-xs\">\n required when defined:\n </div>\n <div className=\"text-red-600 text-xs\">\n {dependentRequired.join(', ')}\n </div>\n </>\n )}\n {schema.deprecated() && (\n <div className=\"text-red-600 text-xs\">deprecated</div>\n )}\n {schema.writeOnly() && (\n <div className=\"text-gray-500 text-xs\">write-only</div>\n )}\n {schema.readOnly() && (\n <div className=\"text-gray-500 text-xs\">read-only</div>\n )}\n </div>\n {rawValue ? (\n <div>\n <div className=\"text-sm\">{schema.const()}</div>\n </div>\n ) : (\n <div>\n <div>\n {renderType && (\n <div className=\"capitalize text-sm text-teal-500 font-bold inline-block mr-2\">\n {isCircular ? `${schemaType} [CIRCULAR]` : schemaType}\n </div>\n )}\n <div className=\"inline-block\">\n {schema.format() && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n format: {schema.format()}\n </span>\n )}\n\n {/* related to string */}\n {schema.pattern() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded mr-2 p-1 text-xs\">\n must match: {schema.pattern()}\n </span>\n )}\n {schema.contentMediaType() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n media type: {schema.contentMediaType()}\n </span>\n )}\n {schema.contentEncoding() !== undefined && (\n <span className=\"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\">\n encoding: {schema.contentEncoding()}\n </span>\n )}\n\n {/* constraints */}\n {!!constraints.length &&\n constraints.map(c => (\n <span\n className=\"bg-purple-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs\"\n key={c}\n >\n {c}\n </span>\n ))}\n\n {uid && !uid.startsWith('<anonymous-') && (\n <span className=\"border text-orange-600 rounded mr-2 p-1 text-xs\">\n uid: {uid}\n </span>\n )}\n </div>\n\n {schema.hasDescription() && (\n <div>\n <Markdown>{schema.description()}</Markdown>\n </div>\n )}\n\n {schema.default() !== undefined && (\n <div className=\"text-xs\">\n Default value:\n <span className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\">\n {SchemaHelpers.prettifyValue(schema.default())}\n </span>\n </div>\n )}\n {schema.const() !== undefined && (\n <div className=\"text-xs\">\n Const:\n <span className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\">\n {SchemaHelpers.prettifyValue(schema.const())}\n </span>\n </div>\n )}\n {schema.enum() && (\n <ul className=\"text-xs\">\n Allowed values:{' '}\n {schema.enum().map((e, idx) => (\n <li\n key={idx}\n className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2\"\n >\n <span>{SchemaHelpers.prettifyValue(e)}</span>\n </li>\n ))}\n </ul>\n )}\n {parameterLocation && (\n <div className=\"text-xs\">\n Parameter location:{' '}\n <span className=\"border text-orange-600 rounded mr-2 p-1 text-xs\">\n {parameterLocation}\n </span>\n </div>\n )}\n {externalDocs && (\n <span className=\"border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-2 py-0\">\n <Href\n href={externalDocs.url()}\n title={externalDocs.description() || ''}\n >\n Documentation\n </Href>\n </span>\n )}\n {schema.examples() && (\n <ul className=\"text-xs\">\n Examples values:{' '}\n {schema.examples().map((e, idx) => (\n <li\n key={idx}\n className=\"border inline-block text-orange-600 rounded ml-1 py-0 px-2 break-all\"\n >\n <span>{SchemaHelpers.prettifyValue(e)}</span>\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n )}\n </div>\n\n {isCircular || !isExpandable ? null : (\n <div\n className={`rounded p-4 py-2 border bg-gray-100 ${\n reverse ? 'bg-gray-200' : ''\n } ${expanded ? 'block' : 'hidden'}`}\n >\n <SchemaProperties schema={schema} />\n <SchemaItems schema={schema} />\n\n {schema.oneOf() &&\n schema\n .oneOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Adheres to:' : 'Or to:'}\n />\n ))}\n {schema.anyOf() &&\n schema\n .anyOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Can adhere to:' : 'Or to:'}\n />\n ))}\n {schema.allOf() &&\n schema\n .allOf()\n .map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={idx === 0 ? 'Consists of:' : 'And with:'}\n />\n ))}\n {schema.not() && (\n <Schema schema={schema.not()} schemaName=\"Cannot adhere to:\" />\n )}\n\n {schema.propertyNames() && (\n <Schema\n schema={schema.propertyNames()}\n schemaName=\"Property names must adhere to:\"\n />\n )}\n {schema.contains() && (\n <Schema\n schema={schema.contains()}\n schemaName=\"Array must contain at least one of:\"\n />\n )}\n\n {schema.if() && (\n <Schema schema={schema.if()} schemaName=\"If schema adheres to:\" />\n )}\n {schema.then() && (\n <Schema\n schema={schema.then()}\n schemaName=\"Then must adhere to:\"\n />\n )}\n {schema.else() && (\n <Schema schema={schema.else()} schemaName=\"Otherwise:\" />\n )}\n\n {dependentSchemas && (\n <Schema\n schema={dependentSchemas}\n schemaName=\"Dependent schemas:\"\n />\n )}\n\n <Extensions item={schema} />\n\n <AdditionalProperties schema={schema} />\n <AdditionalItems schema={schema} />\n </div>\n )}\n </div>\n </SchemaContext.Provider>\n );\n};\n\ninterface SchemaPropertiesProps {\n schema: SchemaType;\n}\n\nconst SchemaProperties: React.FunctionComponent<SchemaPropertiesProps> = ({\n schema,\n}) => {\n const properties = schema.properties() || {};\n if (!Object.keys(properties)) {\n return null;\n }\n\n const required = schema.required() || [];\n const patternProperties = schema.patternProperties();\n const circularProps = schema.ext('x-parser-circular-props') || [];\n\n return (\n <>\n {Object.entries(properties).map(([propertyName, property]) => (\n <Schema\n schema={property}\n schemaName={propertyName}\n required={required.includes(propertyName)}\n isProperty={true}\n isCircular={circularProps.includes(propertyName)}\n dependentRequired={SchemaHelpers.getDependentRequired(\n propertyName,\n schema,\n )}\n key={propertyName}\n />\n ))}\n {Object.entries(patternProperties).map(([propertyName, property]) => (\n <Schema\n schema={property}\n schemaName={propertyName}\n isPatternProperty={true}\n isProperty={true}\n isCircular={circularProps.includes(propertyName)}\n key={propertyName}\n />\n ))}\n </>\n );\n};\n\ninterface AdditionalPropertiesProps {\n schema: SchemaType;\n}\n\nconst AdditionalProperties: React.FunctionComponent<AdditionalPropertiesProps> = ({\n schema,\n}) => {\n if (schema.ext(SchemaHelpers.extRenderAdditionalInfo) === false) {\n return null;\n }\n\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('object')) {\n return null;\n }\n\n const additionalProperties = schema.additionalProperties();\n if (additionalProperties === true || additionalProperties === undefined) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional properties are allowed.\n </p>\n );\n }\n if (additionalProperties === false) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional properties are <strong>NOT</strong> allowed.\n </p>\n );\n }\n return (\n <Schema schemaName=\"Additional properties:\" schema={additionalProperties} />\n );\n};\n\ninterface SchemaItemsProps {\n schema: SchemaType;\n}\n\nconst SchemaItems: React.FunctionComponent<SchemaItemsProps> = ({ schema }) => {\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('array')) {\n return null;\n }\n const items = schema.items();\n\n // object in items\n if (\n items &&\n !Array.isArray(items) &&\n Object.keys(items.properties() || {}).length\n ) {\n return <SchemaProperties schema={items} />;\n } else if (Array.isArray(items)) {\n return (\n <>\n {items.map((item, idx) => (\n <Schema schema={item} schemaName={`${idx + 1} item:`} key={idx} />\n ))}\n </>\n );\n }\n return <Schema schema={items} schemaName=\"Items:\" />;\n};\n\ninterface AdditionalItemsProps {\n schema: SchemaType;\n}\n\nconst AdditionalItems: React.FunctionComponent<AdditionalItemsProps> = ({\n schema,\n}) => {\n if (schema.ext(SchemaHelpers.extRenderAdditionalInfo) === false) {\n return null;\n }\n\n let type = schema.type();\n type = Array.isArray(type) ? type : [type];\n if (!type.includes('array')) {\n return null;\n }\n if (!Array.isArray(schema.items())) {\n return null;\n }\n\n const additionalItems = schema.additionalItems() as any;\n if (additionalItems === true || additionalItems === undefined) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional items are allowed.\n </p>\n );\n }\n if (additionalItems === false) {\n return (\n <p className=\"mt-2 text-xs text-gray-700\">\n Additional items are <strong>NOT</strong> allowed.\n </p>\n );\n }\n return <Schema schemaName=\"Additional items:\" schema={additionalItems} />;\n};\n"]}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Href } from './Href';
|
|
3
3
|
export var Tag = function (_a) {
|
|
4
4
|
var tag = _a.tag;
|
|
5
|
-
var name = "#"
|
|
5
|
+
var name = "#".concat(tag.name());
|
|
6
6
|
var description = tag.description() || '';
|
|
7
7
|
var externalDocs = tag.externalDocs();
|
|
8
8
|
var element = (React.createElement("div", { title: description, className: "border border-solid border-blue-300 hover:bg-blue-300 hover:text-blue-600 text-blue-500 font-bold no-underline text-xs rounded px-3 py-1" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../../src/components/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAM9B,MAAM,CAAC,IAAM,GAAG,GAAmC,UAAC,EAAO;QAAL,GAAG,SAAA;IACvD,IAAM,IAAI,GAAG,
|
|
1
|
+
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../../src/components/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAM9B,MAAM,CAAC,IAAM,GAAG,GAAmC,UAAC,EAAO;QAAL,GAAG,SAAA;IACvD,IAAM,IAAI,GAAG,WAAI,GAAG,CAAC,IAAI,EAAE,CAAE,CAAC;IAC9B,IAAM,WAAW,GAAG,GAAG,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;IAC5C,IAAM,YAAY,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC;IAExC,IAAM,OAAO,GAAG,CACd,6BACE,KAAK,EAAE,WAAW,EAClB,SAAS,EAAC,0IAA0I;QAEpJ,8BAAM,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,IAAG,IAAI,CAAQ,CAC3D,CACP,CAAC;IAEF,IAAI,YAAY,EAAE;QAChB,OAAO,CACL,oBAAC,IAAI,IAAC,IAAI,EAAE,YAAY,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,WAAW,IAC/C,OAAO,CACH,CACR,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Tag as TagType } from '@asyncapi/parser';\n\nimport { Href } from './Href';\n\ninterface Props {\n tag: TagType;\n}\n\nexport const Tag: React.FunctionComponent<Props> = ({ tag }) => {\n const name = `#${tag.name()}`;\n const description = tag.description() || '';\n const externalDocs = tag.externalDocs();\n\n const element = (\n <div\n title={description}\n className=\"border border-solid border-blue-300 hover:bg-blue-300 hover:text-blue-600 text-blue-500 font-bold no-underline text-xs rounded px-3 py-1\"\n >\n <span className={externalDocs ? 'underline' : ''}>{name}</span>\n </div>\n );\n\n if (externalDocs) {\n return (\n <Href href={externalDocs.url()} title={description}>\n {element}\n </Href>\n );\n }\n return element;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tags.js","sourceRoot":"","sources":["../../../src/components/Tags.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAM5B,MAAM,CAAC,IAAM,IAAI,GAAmC,UAAC,EAAQ;QAAN,IAAI,UAAA;IACzD,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;QACzB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,4BAAI,SAAS,EAAC,+BAA+B,IAC1C,IAAI,CAAC,GAAG,CAAC,UAAA,GAAG,IAAI,OAAA,CACf,4BAAI,SAAS,EAAC,wBAAwB,EAAC,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE;QACpD,oBAAC,GAAG,IAAC,GAAG,EAAE,GAAG,GAAI,CACd,CACN,EAJgB,CAIhB,CAAC,CACC,CACN,CAAC;AACJ,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"Tags.js","sourceRoot":"","sources":["../../../src/components/Tags.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAM5B,MAAM,CAAC,IAAM,IAAI,GAAmC,UAAC,EAAQ;QAAN,IAAI,UAAA;IACzD,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;QACzB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,4BAAI,SAAS,EAAC,+BAA+B,IAC1C,IAAI,CAAC,GAAG,CAAC,UAAA,GAAG,IAAI,OAAA,CACf,4BAAI,SAAS,EAAC,wBAAwB,EAAC,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE;QACpD,oBAAC,GAAG,IAAC,GAAG,EAAE,GAAG,GAAI,CACd,CACN,EAJgB,CAIhB,CAAC,CACC,CACN,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Tag as TagType } from '@asyncapi/parser';\n\nimport { Tag } from './Tag';\n\ninterface Props {\n tags?: TagType[];\n}\n\nexport const Tags: React.FunctionComponent<Props> = ({ tags }) => {\n if (!tags || !tags.length) {\n return null;\n }\n\n return (\n <ul className=\"flex flex-wrap leading-normal\">\n {tags.map(tag => (\n <li className=\"inline-block mt-2 mr-2\" key={tag.name()}>\n <Tag tag={tag} />\n </li>\n ))}\n </ul>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC","sourcesContent":["export * from './Bindings';\nexport * from './CollapseButton';\nexport * from './JSONSnippet';\nexport * from './Extensions';\nexport * from './Href';\nexport * from './Markdown';\nexport * from './Schema';\nexport * from './Tag';\nexport * from './Tags';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"","sourcesContent":["export interface ConfigInterface {\n schemaID?: string;\n show?: ShowConfig;\n sidebar?: SideBarConfig;\n parserOptions?: any;\n}\n\nexport interface ShowConfig {\n sidebar?: boolean;\n info?: boolean;\n servers?: boolean;\n operations?: boolean;\n messages?: boolean;\n schemas?: boolean;\n errors?: boolean;\n}\n\nexport interface SideBarConfig {\n showOperations?: 'byDefault' | 'bySpecTags' | 'byOperationsTags';\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/config/default.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,IAAM,aAAa,GAAoB;IAC5C,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACJ,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,IAAI;KACb;IACD,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/config/default.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,IAAM,aAAa,GAAoB;IAC5C,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACJ,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;KACb;IACD,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC","sourcesContent":["import { ConfigInterface } from './config';\n\nexport const defaultConfig: ConfigInterface = {\n schemaID: '',\n show: {\n sidebar: false,\n info: true,\n servers: true,\n operations: true,\n messages: true,\n schemas: true,\n errors: true,\n },\n sidebar: {\n showOperations: 'byOperationsTags',\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC","sourcesContent":["export * from './config';\nexport * from './default';\n"]}
|