@asyncapi/react-component 1.4.8 → 1.4.10
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/browser/index.js +1 -1
- package/browser/standalone/index.js +1 -1
- package/browser/standalone/without-parser.js +1 -1
- package/browser/without-parser.js +1 -1
- package/lib/cjs/components/Bindings.js.map +1 -1
- package/lib/cjs/components/CollapseButton.js +3 -2
- package/lib/cjs/components/CollapseButton.js.map +1 -1
- package/lib/cjs/components/Extensions.js.map +1 -1
- package/lib/cjs/components/Schema.js +31 -34
- package/lib/cjs/components/Schema.js.map +1 -1
- package/lib/cjs/components/Tag.js +2 -1
- package/lib/cjs/components/Tag.js.map +1 -1
- package/lib/cjs/components/Tags.js.map +1 -1
- package/lib/cjs/config/config.js.map +1 -1
- package/lib/cjs/containers/AsyncApi/AsyncApi.js +3 -3
- package/lib/cjs/containers/AsyncApi/AsyncApi.js.map +1 -1
- package/lib/cjs/containers/AsyncApi/Layout.js +5 -4
- package/lib/cjs/containers/AsyncApi/Layout.js.map +1 -1
- package/lib/cjs/containers/AsyncApi/Standalone.js +9 -56
- package/lib/cjs/containers/AsyncApi/Standalone.js.map +1 -1
- package/lib/cjs/containers/Error/Error.js +2 -2
- 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 +1 -1
- package/lib/cjs/containers/Messages/Message.js.map +1 -1
- package/lib/cjs/containers/Messages/MessageExample.js +5 -3
- package/lib/cjs/containers/Messages/MessageExample.js.map +1 -1
- package/lib/cjs/containers/Messages/Messages.js +1 -5
- package/lib/cjs/containers/Messages/Messages.js.map +1 -1
- package/lib/cjs/containers/Operations/Operation.js +7 -4
- package/lib/cjs/containers/Operations/Operation.js.map +1 -1
- package/lib/cjs/containers/Operations/Operations.js +1 -3
- package/lib/cjs/containers/Operations/Operations.js.map +1 -1
- package/lib/cjs/containers/Schemas/Schemas.js +1 -5
- package/lib/cjs/containers/Schemas/Schemas.js.map +1 -1
- package/lib/cjs/containers/Servers/Security.js +5 -10
- package/lib/cjs/containers/Servers/Security.js.map +1 -1
- package/lib/cjs/containers/Servers/Server.js.map +1 -1
- package/lib/cjs/containers/Servers/Servers.js +1 -3
- package/lib/cjs/containers/Servers/Servers.js.map +1 -1
- package/lib/cjs/containers/Sidebar/Sidebar.js +15 -18
- package/lib/cjs/containers/Sidebar/Sidebar.js.map +1 -1
- package/lib/cjs/contexts/useSpec.js.map +1 -1
- package/lib/cjs/helpers/bindingsHelpers.js.map +1 -1
- package/lib/cjs/helpers/common.js +4 -8
- package/lib/cjs/helpers/common.js.map +1 -1
- package/lib/cjs/helpers/marked.js.map +1 -1
- package/lib/cjs/helpers/message.js +1 -1
- package/lib/cjs/helpers/message.js.map +1 -1
- package/lib/cjs/helpers/parser.js.map +1 -1
- package/lib/cjs/helpers/schema.js +6 -16
- package/lib/cjs/helpers/schema.js.map +1 -1
- package/lib/cjs/helpers/server.js.map +1 -1
- package/lib/cjs/helpers/sidebar.js.map +1 -1
- package/lib/cjs/helpers/specification.js +3 -3
- package/lib/cjs/helpers/specification.js.map +1 -1
- package/lib/cjs/types.js.map +1 -1
- package/lib/esm/components/Bindings.js.map +1 -1
- package/lib/esm/components/CollapseButton.js +3 -2
- package/lib/esm/components/CollapseButton.js.map +1 -1
- package/lib/esm/components/Extensions.js.map +1 -1
- package/lib/esm/components/Schema.js +31 -34
- package/lib/esm/components/Schema.js.map +1 -1
- package/lib/esm/components/Tag.js +2 -1
- package/lib/esm/components/Tag.js.map +1 -1
- package/lib/esm/components/Tags.js.map +1 -1
- package/lib/esm/config/config.js.map +1 -1
- package/lib/esm/containers/AsyncApi/AsyncApi.js +3 -3
- package/lib/esm/containers/AsyncApi/AsyncApi.js.map +1 -1
- package/lib/esm/containers/AsyncApi/Layout.js +5 -4
- package/lib/esm/containers/AsyncApi/Layout.js.map +1 -1
- package/lib/esm/containers/AsyncApi/Standalone.js +9 -56
- package/lib/esm/containers/AsyncApi/Standalone.js.map +1 -1
- package/lib/esm/containers/Error/Error.js +2 -2
- package/lib/esm/containers/Error/Error.js.map +1 -1
- package/lib/esm/containers/Info/Info.js +5 -4
- package/lib/esm/containers/Info/Info.js.map +1 -1
- package/lib/esm/containers/Messages/Message.js +1 -1
- package/lib/esm/containers/Messages/Message.js.map +1 -1
- package/lib/esm/containers/Messages/MessageExample.js +5 -3
- package/lib/esm/containers/Messages/MessageExample.js.map +1 -1
- package/lib/esm/containers/Messages/Messages.js +1 -5
- package/lib/esm/containers/Messages/Messages.js.map +1 -1
- package/lib/esm/containers/Operations/Operation.js +7 -4
- package/lib/esm/containers/Operations/Operation.js.map +1 -1
- package/lib/esm/containers/Operations/Operations.js +1 -3
- package/lib/esm/containers/Operations/Operations.js.map +1 -1
- package/lib/esm/containers/Schemas/Schemas.js +1 -5
- package/lib/esm/containers/Schemas/Schemas.js.map +1 -1
- package/lib/esm/containers/Servers/Security.js +5 -10
- package/lib/esm/containers/Servers/Security.js.map +1 -1
- package/lib/esm/containers/Servers/Server.js.map +1 -1
- package/lib/esm/containers/Servers/Servers.js +1 -3
- package/lib/esm/containers/Servers/Servers.js.map +1 -1
- package/lib/esm/containers/Sidebar/Sidebar.js +15 -18
- package/lib/esm/containers/Sidebar/Sidebar.js.map +1 -1
- package/lib/esm/contexts/useSpec.js.map +1 -1
- package/lib/esm/helpers/bindingsHelpers.js.map +1 -1
- package/lib/esm/helpers/common.js +4 -8
- package/lib/esm/helpers/common.js.map +1 -1
- package/lib/esm/helpers/marked.js.map +1 -1
- package/lib/esm/helpers/message.js +1 -1
- package/lib/esm/helpers/message.js.map +1 -1
- package/lib/esm/helpers/parser.js.map +1 -1
- package/lib/esm/helpers/schema.js +6 -16
- package/lib/esm/helpers/schema.js.map +1 -1
- package/lib/esm/helpers/server.js.map +1 -1
- package/lib/esm/helpers/sidebar.js.map +1 -1
- package/lib/esm/helpers/specification.js +3 -3
- package/lib/esm/helpers/specification.js.map +1 -1
- package/lib/esm/types.js.map +1 -1
- package/lib/types/components/Bindings.d.ts.map +1 -1
- package/lib/types/components/Extensions.d.ts.map +1 -1
- package/lib/types/components/Schema.d.ts.map +1 -1
- package/lib/types/config/config.d.ts.map +1 -1
- package/lib/types/containers/AsyncApi/AsyncApi.d.ts +0 -1
- package/lib/types/containers/AsyncApi/AsyncApi.d.ts.map +1 -1
- package/lib/types/containers/AsyncApi/Standalone.d.ts +2 -2
- package/lib/types/containers/AsyncApi/Standalone.d.ts.map +1 -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.map +1 -1
- package/lib/types/containers/Operations/Operations.d.ts.map +1 -1
- package/lib/types/containers/Schemas/Schemas.d.ts.map +1 -1
- package/lib/types/containers/Servers/Security.d.ts.map +1 -1
- package/lib/types/containers/Servers/Servers.d.ts.map +1 -1
- package/lib/types/contexts/useSpec.d.ts.map +1 -1
- package/lib/types/helpers/bindingsHelpers.d.ts.map +1 -1
- package/lib/types/helpers/common.d.ts.map +1 -1
- package/lib/types/helpers/marked.d.ts.map +1 -1
- package/lib/types/helpers/message.d.ts.map +1 -1
- package/lib/types/helpers/parser.d.ts.map +1 -1
- package/lib/types/helpers/schema.d.ts.map +1 -1
- package/lib/types/helpers/server.d.ts.map +1 -1
- package/lib/types/helpers/sidebar.d.ts +1 -1
- package/lib/types/helpers/sidebar.d.ts.map +1 -1
- package/lib/types/helpers/specification.d.ts +1 -1
- package/lib/types/helpers/specification.d.ts.map +1 -1
- package/lib/types/types.d.ts +4 -4
- package/lib/types/types.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../../src/components/Schema.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,U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YAAA;IAEN,IACE,CAAA,MAAA,MAAM;SACH,UAAU,EAAE;SACZ,GAAG,CAAC,aAAa,CAAC,uBAAuB,CAAC,0CACzC,KAAK,EAAE,MAAK,KAAK,EACrB;QACA,OAAO,IAAI,CAAC;KACb;IAED,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAC3B,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACjD,OAAO,IAAI,CAAC;KACb;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE;QAClC,OAAO,IAAI,CAAC;KACb;IAED,IAAM,eAAe,GAAG,MAAM,CAAC,eAAe,EAAS,CAAC;IACxD,IAAI,eAAe,KAAK,IAAI,IAAI,eAAe,KAAK,SAAS,EAAE;QAC7D,OAAO,CACL,2BAAG,SAAS,EAAC,4BAA4B,oCAErC,CACL,CAAC;KACH;IACD,IAAI,eAAe,KAAK,KAAK,EAAE;QAC7B,OAAO,CACL,2BAAG,SAAS,EAAC,4BAA4B;;YAClB,0CAAoB;wBACvC,CACL,CAAC;KACH;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 { SchemaInterface } from '@asyncapi/parser';\n\nimport { Href, CollapseButton, Markdown, Extensions } from './index';\nimport { SchemaHelpers } from '../helpers';\n\ninterface Props {\n schemaName?: React.ReactNode;\n schema?: SchemaInterface;\n required?: boolean;\n isPatternProperty?: boolean;\n isProperty?: boolean;\n isCircular?: boolean;\n dependentRequired?: string[];\n expanded?: boolean;\n onlyTitle?: boolean;\n isArray?: 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 isArray = false,\n}) => {\n const { reverse, deepExpanded } = useContext(SchemaContext);\n const [expanded, setExpanded] = useState(propExpanded || isArray);\n const [deepExpand, setDeepExpand] = useState(false);\n\n useEffect(() => {\n if (!isArray) {\n setDeepExpand(deepExpanded);\n }\n }, [deepExpanded, setDeepExpand]);\n\n useEffect(() => {\n if (!isArray) {\n setExpanded(deepExpand);\n }\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 rawValueExt = schema.extensions().get(SchemaHelpers.extRawValue);\n const rawValue = rawValueExt?.value() === true;\n\n const parameterLocationExt = schema\n .extensions()\n .get(SchemaHelpers.extParameterLocation);\n const parameterLocation = parameterLocationExt?.value() === true;\n\n const schemaType = SchemaHelpers.toSchemaType(schema);\n const isExpandable = SchemaHelpers.isExpandable(schema) || dependentSchemas;\n\n isCircular = isCircular || schema.isCircular() || false;\n const uid = schema.$id();\n const styledSchemaName = isProperty ? 'italic' : '';\n const renderedSchemaName =\n typeof schemaName === 'string' ? (\n <span className={`break-anywhere 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 && !isArray ? (\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-anywhere text-sm ${\n isProperty ? 'italic' : ''\n }`}\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\">\n {SchemaHelpers.prettifyValue(schema.const(), false)}\n </div>\n </div>\n ) : (\n <div>\n <div>\n <div className=\"capitalize text-sm text-teal-500 font-bold inline-block mr-2\">\n {isCircular ? `${schemaType} [CIRCULAR]` : schemaType}\n </div>\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.description() !== undefined && (\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} isArray={isArray} />\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={SchemaHelpers.applicatorSchemaName(\n idx,\n 'Adheres to',\n 'Or to',\n s.title(),\n )}\n />\n ))}\n {schema.anyOf() &&\n schema\n .anyOf()\n ?.map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={SchemaHelpers.applicatorSchemaName(\n idx,\n 'Can adhere to',\n 'Or to',\n s.title(),\n )}\n />\n ))}\n {schema.allOf() &&\n schema\n .allOf()\n ?.map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={SchemaHelpers.applicatorSchemaName(\n idx,\n 'Consists of',\n 'And of',\n s.title(),\n )}\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: SchemaInterface;\n isArray: boolean;\n}\n\nconst SchemaProperties: React.FunctionComponent<SchemaPropertiesProps> = ({\n schema,\n isArray,\n}) => {\n const properties = schema.properties();\n if (properties === undefined || !Object.keys(properties)) {\n return null;\n }\n\n const required = schema.required() || [];\n const patternProperties = schema.patternProperties();\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={property.isCircular()}\n dependentRequired={SchemaHelpers.getDependentRequired(\n propertyName,\n schema,\n )}\n key={propertyName}\n />\n ))}\n {Object.entries(patternProperties || {}).map(\n ([propertyName, property]) => (\n <Schema\n schema={property}\n schemaName={propertyName}\n isPatternProperty={true}\n isProperty={true}\n isCircular={property.isCircular()}\n key={propertyName}\n />\n ),\n )}\n </>\n );\n};\n\ninterface AdditionalPropertiesProps {\n schema: SchemaInterface;\n}\n\nconst AdditionalProperties: React.FunctionComponent<AdditionalPropertiesProps> = ({\n schema,\n}) => {\n if (\n schema\n .extensions()\n .get(SchemaHelpers.extRenderAdditionalInfo)\n ?.value() === false\n ) {\n return null;\n }\n\n const type = schema.type();\n if (type === undefined || !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: SchemaInterface;\n}\n\nconst SchemaItems: React.FunctionComponent<SchemaItemsProps> = ({ schema }) => {\n const type = schema.type();\n if (type === undefined || !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 <Schema schema={items} isArray={true} />;\n } else if (Array.isArray(items)) {\n return (\n <>\n {items.map((item, idx) => (\n <Schema\n schema={item}\n isArray={true}\n schemaName={`${idx + 1} item:`}\n key={idx}\n />\n ))}\n </>\n );\n }\n return <Schema schema={items} isArray={true} schemaName=\"Items:\" />;\n};\n\ninterface AdditionalItemsProps {\n schema: SchemaInterface;\n}\n\nconst AdditionalItems: React.FunctionComponent<AdditionalItemsProps> = ({\n schema,\n}) => {\n if (\n schema\n .extensions()\n .get(SchemaHelpers.extRenderAdditionalInfo)\n ?.value() === false\n ) {\n return null;\n }\n\n const type = schema.type();\n if (type === undefined || !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"]}
|
|
1
|
+
{"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../../src/components/Schema.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAe3C,IAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;IACxC,OAAO,EAAE,KAAK;IACd,YAAY,EAAE,KAAK;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,IAAM,MAAM,GAAmC,UAAC,EAYtD;;QAXC,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,yBAAyB,EAA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AAI,eAAe,KAAK,SAAS,EAAE;QAC7D,OAAO,CACL,2BAAG,SAAS,EAAC,4BAA4B,oCAErC,CACL,CAAC;KACH;IACD,IAAI,eAAe,KAAK,KAAK,EAAE;QAC7B,OAAO,CACL,2BAAG,SAAS,EAAC,4BAA4B;;YAClB,0CAAoB;wBACvC,CACL,CAAC;KACH;IAED,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 { SchemaInterface } from '@asyncapi/parser';\n\nimport { Href, CollapseButton, Markdown, Extensions } from './index';\nimport { SchemaHelpers } from '../helpers';\n\ninterface Props {\n schemaName?: React.ReactNode;\n schema?: SchemaInterface;\n required?: boolean;\n isPatternProperty?: boolean;\n isProperty?: boolean;\n isCircular?: boolean;\n dependentRequired?: string[];\n expanded?: boolean;\n onlyTitle?: boolean;\n isArray?: 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 isArray = false,\n // eslint-disable-next-line sonarjs/cognitive-complexity\n}) => {\n const { reverse, deepExpanded } = useContext(SchemaContext);\n const [expanded, setExpanded] = useState(propExpanded || isArray);\n const [deepExpand, setDeepExpand] = useState(false);\n\n useEffect(() => {\n if (!isArray) {\n setDeepExpand(deepExpanded);\n }\n }, [isArray, deepExpanded, setDeepExpand]);\n\n useEffect(() => {\n if (!isArray) {\n setExpanded(deepExpand);\n }\n }, [isArray, 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 rawValueExt = schema.extensions().get(SchemaHelpers.extRawValue);\n const rawValue = rawValueExt?.value() === true;\n\n const parameterLocationExt = schema\n .extensions()\n .get(SchemaHelpers.extParameterLocation);\n const parameterLocation = parameterLocationExt?.value() === true;\n\n const schemaType = SchemaHelpers.toSchemaType(schema);\n const isExpandable = SchemaHelpers.isExpandable(schema) || dependentSchemas;\n\n isCircular = isCircular || schema.isCircular() || false;\n const uid = schema.$id();\n const styledSchemaName = isProperty ? 'italic' : '';\n const renderedSchemaName =\n typeof schemaName === 'string' ? (\n <span className={`break-anywhere 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 && !isArray ? (\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-anywhere text-sm ${\n isProperty ? 'italic' : ''\n }`}\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\">\n {SchemaHelpers.prettifyValue(schema.const(), false)}\n </div>\n </div>\n ) : (\n <div>\n <div>\n <div className=\"capitalize text-sm text-teal-500 font-bold inline-block mr-2\">\n {isCircular ? `${schemaType} [CIRCULAR]` : schemaType}\n </div>\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.description() !== undefined && (\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\n .oneOf()\n ?.map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={SchemaHelpers.applicatorSchemaName(\n idx,\n 'Adheres to',\n 'Or to',\n s.title(),\n )}\n />\n ))}\n {schema\n .anyOf()\n ?.map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={SchemaHelpers.applicatorSchemaName(\n idx,\n 'Can adhere to',\n 'Or to',\n s.title(),\n )}\n />\n ))}\n {schema\n .allOf()\n ?.map((s, idx) => (\n <Schema\n key={idx}\n schema={s}\n schemaName={SchemaHelpers.applicatorSchemaName(\n idx,\n 'Consists of',\n 'And of',\n s.title(),\n )}\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: SchemaInterface;\n}\n\nconst SchemaProperties: React.FunctionComponent<SchemaPropertiesProps> = ({\n schema,\n}) => {\n const properties = schema.properties();\n if (properties === undefined || !Object.keys(properties)) {\n return null;\n }\n\n const required = schema.required() ?? [];\n const patternProperties = schema.patternProperties();\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\n isCircular={property.isCircular()}\n dependentRequired={SchemaHelpers.getDependentRequired(\n propertyName,\n schema,\n )}\n key={propertyName}\n />\n ))}\n {Object.entries(patternProperties ?? {}).map(\n ([propertyName, property]) => (\n <Schema\n schema={property}\n schemaName={propertyName}\n isPatternProperty\n isProperty\n isCircular={property.isCircular()}\n key={propertyName}\n />\n ),\n )}\n </>\n );\n};\n\ninterface AdditionalPropertiesProps {\n schema: SchemaInterface;\n}\n\nconst AdditionalProperties: React.FunctionComponent<\n AdditionalPropertiesProps\n> = ({ schema }) => {\n if (\n schema.extensions().get(SchemaHelpers.extRenderAdditionalInfo)?.value() ===\n false\n ) {\n return null;\n }\n\n const type = schema.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: SchemaInterface;\n}\n\nconst SchemaItems: React.FunctionComponent<SchemaItemsProps> = ({ schema }) => {\n const type = schema.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 <Schema schema={items} isArray />;\n } else if (Array.isArray(items)) {\n return (\n <>\n {items.map((item, idx) => (\n <Schema\n schema={item}\n isArray\n schemaName={`${idx + 1} item:`}\n key={idx}\n />\n ))}\n </>\n );\n }\n return <Schema schema={items} isArray schemaName=\"Items:\" />;\n};\n\ninterface AdditionalItemsProps {\n schema: SchemaInterface;\n}\n\nconst AdditionalItems: React.FunctionComponent<AdditionalItemsProps> = ({\n schema,\n}) => {\n if (\n schema.extensions().get(SchemaHelpers.extRenderAdditionalInfo)?.value() ===\n false\n ) {\n return null;\n }\n\n const type = schema.type();\n if (!type?.includes('array')) {\n return null;\n }\n if (!Array.isArray(schema.items())) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\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 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n return <Schema schemaName=\"Additional items:\" schema={additionalItems} />;\n};\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Href } from './Href';
|
|
3
3
|
export var Tag = function (_a) {
|
|
4
|
+
var _b;
|
|
4
5
|
var tag = _a.tag;
|
|
5
6
|
var name = "#".concat(tag.name());
|
|
6
|
-
var description = tag.description()
|
|
7
|
+
var description = (_b = tag.description()) !== null && _b !== void 0 ? _b : '';
|
|
7
8
|
var externalDocs = tag.externalDocs();
|
|
8
9
|
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" },
|
|
9
10
|
React.createElement("span", { className: externalDocs ? 'underline' : '' }, name)));
|
|
@@ -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
|
|
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,MAAA,GAAG,CAAC,WAAW,EAAE,mCAAI,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 { TagInterface } from '@asyncapi/parser';\n\nimport { Href } from './Href';\n\ninterface Props {\n tag: TagInterface;\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,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAA,EAAE;QACjB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,4BAAI,SAAS,EAAC,+BAA+B,IAC1C,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,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,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAA,EAAE;QACjB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,4BAAI,SAAS,EAAC,+BAA+B,IAC1C,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,UAAC,GAAG,IAAK,OAAA,CACvB,4BAAI,SAAS,EAAC,wBAAwB,EAAC,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE;QACpD,oBAAC,GAAG,IAAC,GAAG,EAAE,GAAG,GAAI,CACd,CACN,EAJwB,CAIxB,CAAC,CACC,CACN,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { TagsInterface } from '@asyncapi/parser';\n\nimport { Tag } from './Tag';\n\ninterface Props {\n tags?: TagsInterface;\n}\n\nexport const Tags: React.FunctionComponent<Props> = ({ tags }) => {\n if (!tags?.length) {\n return null;\n }\n\n return (\n <ul className=\"flex flex-wrap leading-normal\">\n {tags.all().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":"config.js","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"","sourcesContent":["export interface ConfigInterface {\n schemaID?: string;\n show?: ShowConfig;\n expand?: ExpandConfig;\n sidebar?: SideBarConfig;\n parserOptions?: any;\n publishLabel?: string;\n subscribeLabel?: string;\n sendLabel?: string;\n receiveLabel?: string;\n requestLabel?: string;\n replyLabel?: string;\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 ExpandConfig {\n messageExamples?: boolean;\n}\n\nexport interface SideBarConfig {\n showServers?: 'byDefault' | 'bySpecTags' | 'byServersTags';\n showOperations?: 'byDefault' | 'bySpecTags' | 'byOperationsTags';\n}\n"]}
|
|
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 expand?: ExpandConfig;\n sidebar?: SideBarConfig;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parserOptions?: any;\n publishLabel?: string;\n subscribeLabel?: string;\n sendLabel?: string;\n receiveLabel?: string;\n requestLabel?: string;\n replyLabel?: string;\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 ExpandConfig {\n messageExamples?: boolean;\n}\n\nexport interface SideBarConfig {\n showServers?: 'byDefault' | 'bySpecTags' | 'byServersTags';\n showOperations?: 'byDefault' | 'bySpecTags' | 'byOperationsTags';\n}\n"]}
|
|
@@ -55,8 +55,8 @@ import { isFetchingSchemaInterface, } from '../../types';
|
|
|
55
55
|
import { SpecificationHelpers, Parser } from '../../helpers';
|
|
56
56
|
var AsyncApiComponent = (function (_super) {
|
|
57
57
|
__extends(AsyncApiComponent, _super);
|
|
58
|
-
function AsyncApiComponent(
|
|
59
|
-
var _this = _super.
|
|
58
|
+
function AsyncApiComponent() {
|
|
59
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
60
60
|
_this.state = {
|
|
61
61
|
asyncapi: undefined,
|
|
62
62
|
error: undefined,
|
|
@@ -102,7 +102,7 @@ var AsyncApiComponent = (function (_super) {
|
|
|
102
102
|
AsyncApiComponent.prototype.render = function () {
|
|
103
103
|
var _a = this.props, schema = _a.schema, config = _a.config;
|
|
104
104
|
var _b = this.state, asyncapi = _b.asyncapi, error = _b.error;
|
|
105
|
-
return (React.createElement(AsyncApiStandalone, { schema: asyncapi
|
|
105
|
+
return (React.createElement(AsyncApiStandalone, { schema: asyncapi !== null && asyncapi !== void 0 ? asyncapi : schema, config: config, error: error }));
|
|
106
106
|
};
|
|
107
107
|
AsyncApiComponent.prototype.parseSchema = function (schema, parserOptions) {
|
|
108
108
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncApi.js","sourceRoot":"","sources":["../../../../src/containers/AsyncApi/AsyncApi.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,OAAO,kBAAkB,MAAM,cAAc,CAAC;AAE9C,OAAO,EACL,yBAAyB,GAG1B,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAY7D;IAAgC,qCAAuC;
|
|
1
|
+
{"version":3,"file":"AsyncApi.js","sourceRoot":"","sources":["../../../../src/containers/AsyncApi/AsyncApi.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,OAAO,kBAAkB,MAAM,cAAc,CAAC;AAE9C,OAAO,EACL,yBAAyB,GAG1B,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,oBAAoB,EAAE,MAAM,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AAmB,EAAE,aAAmB;;;;;;wBAC1D,UAAU,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;wBACnE,IAAI,UAAU,EAAE;4BACd,IAAI,CAAC,QAAQ,CAAC;gCACZ,QAAQ,EAAE,UAAU;6BACrB,CAAC,CAAC;4BACH,WAAO;yBACR;6BAEG,yBAAyB,CAAC,MAAM,CAAC,EAAjC,cAAiC;wBACb,WAAM,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,EAAA;;wBAAhE,aAAa,GAAG,SAAgD;wBACtE,IAAI,CAAC,QAAQ,CAAC;4BACZ,QAAQ,EAAE,aAAa,CAAC,QAAQ;4BAChC,KAAK,EAAE,aAAa,CAAC,KAAK;yBAC3B,CAAC,CAAC;wBACH,WAAO;4BAGM,WAAM,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,EAAA;;wBAAlD,MAAM,GAAG,SAAyC;wBACxD,IAAI,CAAC,QAAQ,CAAC;4BACZ,QAAQ,EAAE,MAAM,CAAC,QAAQ;4BACzB,KAAK,EAAE,MAAM,CAAC,KAAK;yBACpB,CAAC,CAAC;;;;;KACJ;IACH,wBAAC;AAAD,CAAC,AA7DD,CAAgC,SAAS,GA6DxC;AAED,eAAe,iBAAiB,CAAC","sourcesContent":["import React, { Component } from 'react';\nimport { AsyncAPIDocumentInterface } from '@asyncapi/parser';\n\nimport AsyncApiStandalone from './Standalone';\n\nimport {\n isFetchingSchemaInterface,\n ErrorObject,\n PropsSchema,\n} from '../../types';\nimport { ConfigInterface } from '../../config';\nimport { SpecificationHelpers, Parser } from '../../helpers';\n\nexport interface AsyncApiProps {\n schema: PropsSchema;\n config?: Partial<ConfigInterface>;\n}\n\ninterface AsyncAPIState {\n asyncapi?: AsyncAPIDocumentInterface;\n error?: ErrorObject;\n}\n\nclass AsyncApiComponent extends Component<AsyncApiProps, AsyncAPIState> {\n state: AsyncAPIState = {\n asyncapi: undefined,\n error: undefined,\n };\n\n async componentDidMount() {\n if (this.props.schema) {\n const { schema, config } = this.props;\n await this.parseSchema(schema, config?.parserOptions);\n }\n }\n\n async componentDidUpdate(prevProps: AsyncApiProps) {\n const oldSchema = prevProps.schema;\n const newSchema = this.props.schema;\n\n if (oldSchema !== newSchema) {\n const { config } = this.props;\n await this.parseSchema(newSchema, config?.parserOptions);\n }\n }\n\n render() {\n const { schema, config } = this.props;\n const { asyncapi, error } = this.state;\n\n return (\n <AsyncApiStandalone\n schema={asyncapi ?? schema}\n config={config}\n error={error}\n />\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private async parseSchema(schema: PropsSchema, parserOptions?: any) {\n const parsedSpec = SpecificationHelpers.retrieveParsedSpec(schema);\n if (parsedSpec) {\n this.setState({\n asyncapi: parsedSpec,\n });\n return;\n }\n\n if (isFetchingSchemaInterface(schema)) {\n const parsedFromUrl = await Parser.parseFromUrl(schema, parserOptions);\n this.setState({\n asyncapi: parsedFromUrl.asyncapi,\n error: parsedFromUrl.error,\n });\n return;\n }\n\n const parsed = await Parser.parse(schema, parserOptions);\n this.setState({\n asyncapi: parsed.asyncapi,\n error: parsed.error,\n });\n }\n}\n\nexport default AsyncApiComponent;\n"]}
|
|
@@ -9,8 +9,9 @@ import { Schemas } from '../Schemas/Schemas';
|
|
|
9
9
|
import { Error } from '../Error/Error';
|
|
10
10
|
import { SpecificationContext, ConfigContext } from '../../contexts';
|
|
11
11
|
var AsyncApiLayout = function (_a) {
|
|
12
|
-
var
|
|
13
|
-
var
|
|
12
|
+
var _b, _c;
|
|
13
|
+
var asyncapi = _a.asyncapi, config = _a.config, _d = _a.error, error = _d === void 0 ? null : _d;
|
|
14
|
+
var _e = useState('container:xl'), observerClassName = _e[0], setObserverClassName = _e[1];
|
|
14
15
|
var ref = useResizeObserver({
|
|
15
16
|
onResize: function (_a) {
|
|
16
17
|
var width = _a.width;
|
|
@@ -25,11 +26,11 @@ var AsyncApiLayout = function (_a) {
|
|
|
25
26
|
});
|
|
26
27
|
},
|
|
27
28
|
}).ref;
|
|
28
|
-
var configShow = config.show
|
|
29
|
+
var configShow = (_b = config.show) !== null && _b !== void 0 ? _b : {};
|
|
29
30
|
return (React.createElement(ConfigContext.Provider, { value: config },
|
|
30
31
|
React.createElement(SpecificationContext.Provider, { value: asyncapi },
|
|
31
32
|
React.createElement("section", { className: "aui-root" },
|
|
32
|
-
React.createElement("div", { className: "".concat(observerClassName, " relative md:flex bg-white leading-normal"), id: config.schemaID
|
|
33
|
+
React.createElement("div", { className: "".concat(observerClassName, " relative md:flex bg-white leading-normal"), id: (_c = config.schemaID) !== null && _c !== void 0 ? _c : undefined, ref: ref },
|
|
33
34
|
configShow.sidebar && React.createElement(Sidebar, null),
|
|
34
35
|
React.createElement("div", { className: "panel--center relative py-8 flex-1" },
|
|
35
36
|
React.createElement("div", { className: "relative z-10" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../../../src/containers/AsyncApi/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AASrE,IAAM,cAAc,GAAmC,UAAC,EAIvD
|
|
1
|
+
{"version":3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EH,IAAM,UAAU,GAAG,MAAA,MAAM,CAAC,IAAI,mCAAI,EAAE,CAAC;IACrC,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM;QACnC,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ;YAC5C,iCAAS,SAAS,EAAC,UAAU;gBAC3B,6BACE,SAAS,EAAE,UAAG,iBAAiB,8CAA2C,EAC1E,EAAE,EAAE,MAAA,MAAM,CAAC,QAAQ,mCAAI,SAAS,EAChC,GAAG,EAAE,GAAG;oBAEP,UAAU,CAAC,OAAO,IAAI,oBAAC,OAAO,OAAG;oBAClC,6BAAK,SAAS,EAAC,oCAAoC;wBACjD,6BAAK,SAAS,EAAC,eAAe;4BAC3B,UAAU,CAAC,MAAM,IAAI,KAAK,IAAI,oBAAC,KAAK,IAAC,KAAK,EAAE,KAAK,GAAI;4BACrD,UAAU,CAAC,IAAI,IAAI,oBAAC,IAAI,OAAG;4BAC3B,UAAU,CAAC,OAAO,IAAI,oBAAC,OAAO,OAAG;4BACjC,UAAU,CAAC,UAAU,IAAI,oBAAC,UAAU,OAAG;4BACvC,UAAU,CAAC,QAAQ,IAAI,oBAAC,QAAQ,OAAG;4BACnC,UAAU,CAAC,OAAO,IAAI,oBAAC,OAAO,OAAG,CAC9B;wBACN,6BAAK,SAAS,EAAC,wDAAwD,GAAG,CACtE,CACF,CACE,CACoB,CACT,CAC1B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport { AsyncAPIDocumentInterface } from '@asyncapi/parser';\nimport useResizeObserver from 'use-resize-observer';\n\nimport { Sidebar } from '../Sidebar/Sidebar';\nimport { Info } from '../Info/Info';\nimport { Servers } from '../Servers/Servers';\nimport { Operations } from '../Operations/Operations';\nimport { Messages } from '../Messages/Messages';\nimport { Schemas } from '../Schemas/Schemas';\nimport { Error } from '../Error/Error';\n\nimport { ConfigInterface } from '../../config';\nimport { SpecificationContext, ConfigContext } from '../../contexts';\nimport { ErrorObject } from '../../types';\n\ninterface Props {\n asyncapi: AsyncAPIDocumentInterface;\n config: ConfigInterface;\n error?: ErrorObject;\n}\n\nconst AsyncApiLayout: React.FunctionComponent<Props> = ({\n asyncapi,\n config,\n error = null,\n}) => {\n const [observerClassName, setObserverClassName] = useState('container:xl');\n\n const { ref } = useResizeObserver<HTMLDivElement>({\n onResize: ({ width }) => {\n requestAnimationFrame(() => {\n if (width === undefined) {\n return;\n }\n\n const possibleClassName =\n width <= 1280 ? 'container:xl' : 'container:base';\n if (possibleClassName !== observerClassName) {\n setObserverClassName(possibleClassName);\n }\n });\n },\n });\n\n const configShow = config.show ?? {};\n return (\n <ConfigContext.Provider value={config}>\n <SpecificationContext.Provider value={asyncapi}>\n <section className=\"aui-root\">\n <div\n className={`${observerClassName} relative md:flex bg-white leading-normal`}\n id={config.schemaID ?? undefined}\n ref={ref}\n >\n {configShow.sidebar && <Sidebar />}\n <div className=\"panel--center relative py-8 flex-1\">\n <div className=\"relative z-10\">\n {configShow.errors && error && <Error error={error} />}\n {configShow.info && <Info />}\n {configShow.servers && <Servers />}\n {configShow.operations && <Operations />}\n {configShow.messages && <Messages />}\n {configShow.schemas && <Schemas />}\n </div>\n <div className=\"panel--right absolute top-0 right-0 h-full bg-gray-800\" />\n </div>\n </div>\n </section>\n </SpecificationContext.Provider>\n </ConfigContext.Provider>\n );\n};\n\nexport default AsyncApiLayout;\n"]}
|
|
@@ -24,42 +24,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
24
|
};
|
|
25
25
|
return __assign.apply(this, arguments);
|
|
26
26
|
};
|
|
27
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
28
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
29
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
30
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
31
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
32
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
33
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
37
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
38
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
39
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
40
|
-
function step(op) {
|
|
41
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
42
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
43
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
44
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
45
|
-
switch (op[0]) {
|
|
46
|
-
case 0: case 1: t = op; break;
|
|
47
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
48
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
49
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
50
|
-
default:
|
|
51
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
52
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
53
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
54
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
55
|
-
if (t[2]) _.ops.pop();
|
|
56
|
-
_.trys.pop(); continue;
|
|
57
|
-
}
|
|
58
|
-
op = body.call(thisArg, _);
|
|
59
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
60
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
27
|
import React, { Component } from 'react';
|
|
64
28
|
import { SpecificationHelpers } from '../../helpers';
|
|
65
29
|
import { defaultConfig } from '../../config';
|
|
@@ -80,33 +44,22 @@ var AsyncApiComponent = (function (_super) {
|
|
|
80
44
|
return _this;
|
|
81
45
|
}
|
|
82
46
|
AsyncApiComponent.prototype.componentDidMount = function () {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this.updateState(this.props.schema);
|
|
87
|
-
}
|
|
88
|
-
return [2];
|
|
89
|
-
});
|
|
90
|
-
});
|
|
47
|
+
if (!this.state.asyncapi) {
|
|
48
|
+
this.updateState(this.props.schema);
|
|
49
|
+
}
|
|
91
50
|
};
|
|
92
51
|
AsyncApiComponent.prototype.componentDidUpdate = function (prevProps) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (oldSchema !== newSchema) {
|
|
99
|
-
this.updateState(newSchema);
|
|
100
|
-
}
|
|
101
|
-
return [2];
|
|
102
|
-
});
|
|
103
|
-
});
|
|
52
|
+
var oldSchema = prevProps.schema;
|
|
53
|
+
var newSchema = this.props.schema;
|
|
54
|
+
if (oldSchema !== newSchema) {
|
|
55
|
+
this.updateState(newSchema);
|
|
56
|
+
}
|
|
104
57
|
};
|
|
105
58
|
AsyncApiComponent.prototype.render = function () {
|
|
106
59
|
var _a;
|
|
107
60
|
var _b = this.props, config = _b.config, propError = _b.error;
|
|
108
61
|
var _c = this.state, asyncapi = _c.asyncapi, stateError = _c.error;
|
|
109
|
-
var error = propError
|
|
62
|
+
var error = propError !== null && propError !== void 0 ? propError : stateError;
|
|
110
63
|
var concatenatedConfig = __assign(__assign(__assign({}, defaultConfig), config), { show: __assign(__assign({}, defaultConfig.show), (!!config && config.show)), expand: __assign(__assign({}, defaultConfig.expand), (!!config && config.expand)), sidebar: __assign(__assign({}, defaultConfig.sidebar), (!!config && config.sidebar)) });
|
|
111
64
|
if (!asyncapi) {
|
|
112
65
|
if (!error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Standalone.js","sourceRoot":"","sources":["../../../../src/containers/AsyncApi/Standalone.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Standalone.js","sourceRoot":"","sources":["../../../../src/containers/AsyncApi/Standalone.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EAAmB,aAAa,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,cAAc,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAavC;IAAgC,qCAAuC;IAMrE,2BAAY,KAAoB;QAAhC,YACE,kBAAM,KAAK,CAAC,SAMb;QAZD,WAAK,GAAkB;YACrB,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,SAAS;SACjB,CAAC;QAKA,IAAM,UAAU,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACzE,IAAI,UAAU,EAAE;YACd,KAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;SACvC;;IACH,CAAC;IAED,6CAAiB,GAAjB;QACE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YACxB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SACrC;IACH,CAAC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C,IAAM,UAAU,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QACnE,IAAI,CAAC,UAAU,EAAE;YACf,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;YACvC,OAAO;SACR;QACD,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;IAC1C,CAAC;IACH,wBAAC;AAAD,CAAC,AA5ED,CAAgC,SAAS,GA4ExC;AAED,eAAe,iBAAiB,CAAC","sourcesContent":["import React, { Component } from 'react';\nimport { AsyncAPIDocumentInterface } from '@asyncapi/parser';\n\nimport { SpecificationHelpers } from '../../helpers';\nimport { ErrorObject, PropsSchema } from '../../types';\nimport { ConfigInterface, defaultConfig } from '../../config';\n\nimport AsyncApiLayout from './Layout';\nimport { Error } from '../Error/Error';\n\nexport interface AsyncApiProps {\n schema: PropsSchema;\n config?: Partial<ConfigInterface>;\n error?: ErrorObject;\n}\n\ninterface AsyncAPIState {\n asyncapi?: AsyncAPIDocumentInterface;\n error?: ErrorObject;\n}\n\nclass AsyncApiComponent extends Component<AsyncApiProps, AsyncAPIState> {\n state: AsyncAPIState = {\n asyncapi: undefined,\n error: undefined,\n };\n\n constructor(props: AsyncApiProps) {\n super(props);\n\n const parsedSpec = SpecificationHelpers.retrieveParsedSpec(props.schema);\n if (parsedSpec) {\n this.state = { asyncapi: parsedSpec };\n }\n }\n\n componentDidMount() {\n if (!this.state.asyncapi) {\n this.updateState(this.props.schema);\n }\n }\n\n componentDidUpdate(prevProps: AsyncApiProps) {\n const oldSchema = prevProps.schema;\n const newSchema = this.props.schema;\n\n if (oldSchema !== newSchema) {\n this.updateState(newSchema);\n }\n }\n\n render() {\n const { config, error: propError } = this.props;\n const { asyncapi, error: stateError } = this.state;\n\n const error = propError ?? stateError;\n const concatenatedConfig: ConfigInterface = {\n ...defaultConfig,\n ...config,\n show: {\n ...defaultConfig.show,\n ...(!!config && config.show),\n },\n expand: {\n ...defaultConfig.expand,\n ...(!!config && config.expand),\n },\n sidebar: {\n ...defaultConfig.sidebar,\n ...(!!config && config.sidebar),\n },\n };\n\n if (!asyncapi) {\n if (!error) {\n return null;\n }\n return concatenatedConfig.show?.errors && <Error error={error} />;\n }\n\n return (\n <AsyncApiLayout\n asyncapi={asyncapi}\n config={concatenatedConfig}\n error={error}\n />\n );\n }\n\n private updateState(schema: PropsSchema) {\n const parsedSpec = SpecificationHelpers.retrieveParsedSpec(schema);\n if (!parsedSpec) {\n this.setState({ asyncapi: undefined });\n return;\n }\n this.setState({ asyncapi: parsedSpec });\n }\n}\n\nexport default AsyncApiComponent;\n"]}
|
|
@@ -6,7 +6,7 @@ var renderErrors = function (errors) {
|
|
|
6
6
|
}
|
|
7
7
|
return errors
|
|
8
8
|
.map(function (singleError, index) {
|
|
9
|
-
if (!singleError ||
|
|
9
|
+
if (!(singleError === null || singleError === void 0 ? void 0 : singleError.title) || !singleError.location) {
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
12
|
return (React.createElement("div", { key: index, className: "flex" },
|
|
@@ -25,7 +25,7 @@ export var Error = function (_a) {
|
|
|
25
25
|
React.createElement("div", { className: "panel-item--center p-8" },
|
|
26
26
|
React.createElement("section", { className: "shadow rounded bg-gray-200 border-red-500 border-l-8" },
|
|
27
27
|
React.createElement("h2", { className: "p-2" }, title ? "".concat(ERROR_TEXT, ": ").concat(title) : ERROR_TEXT),
|
|
28
|
-
validationErrors
|
|
28
|
+
(validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.length) ? (React.createElement("div", { className: "bg-gray-800 text-white text-xs p-2" },
|
|
29
29
|
React.createElement("pre", null, renderErrors(validationErrors)))) : null)),
|
|
30
30
|
React.createElement("div", { className: "panel-item--right" })));
|
|
31
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Error.js","sourceRoot":"","sources":["../../../../src/containers/Error/Error.tsx"],"names":[],"mappings":"AAA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ACL,6BAAK,SAAS,EAAC,YAAY;QACzB,6BAAK,SAAS,EAAC,wBAAwB;YACrC,iCAAS,SAAS,EAAC,sDAAsD;gBACvE,4BAAI,SAAS,EAAC,KAAK,IAChB,KAAK,CAAC,CAAC,CAAC,UAAG,UAAU,eAAK,KAAK,CAAE,CAAC,CAAC,CAAC,UAAU,CAC5C;gBACJ,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,EAAC,CAAC,CAAC,CAC1B,6BAAK,SAAS,EAAC,oCAAoC;oBACjD,iCAAM,YAAY,CAAC,gBAAgB,CAAC,CAAO,CACvC,CACP,CAAC,CAAC,CAAC,IAAI,CACA,CACN;QACN,6BAAK,SAAS,EAAC,mBAAmB,GAAG,CACjC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { ERROR_TEXT } from '../../constants';\nimport { ErrorObject, ValidationError } from '../../types';\n\nconst renderErrors = (errors: ValidationError[]): React.ReactNode => {\n if (!errors) {\n return null;\n }\n\n return errors\n .map((singleError: ValidationError, index: number) => {\n if (!singleError?.title || !singleError.location) {\n return null;\n }\n return (\n <div key={index} className=\"flex\">\n <span>{`${singleError.location.startLine}.`}</span>\n <code className=\"whitespace-pre-wrap break-all ml-2\">\n {singleError.title}\n </code>\n </div>\n );\n })\n .filter(Boolean);\n};\n\ninterface Props {\n error: ErrorObject;\n}\n\nexport const Error: React.FunctionComponent<Props> = ({ error }) => {\n if (!error) {\n return null;\n }\n const { title, validationErrors } = error;\n\n return (\n <div className=\"panel-item\">\n <div className=\"panel-item--center p-8\">\n <section className=\"shadow rounded bg-gray-200 border-red-500 border-l-8\">\n <h2 className=\"p-2\">\n {title ? `${ERROR_TEXT}: ${title}` : ERROR_TEXT}\n </h2>\n {validationErrors?.length ? (\n <div className=\"bg-gray-800 text-white text-xs p-2\">\n <pre>{renderErrors(validationErrors)}</pre>\n </div>\n ) : null}\n </section>\n </div>\n <div className=\"panel-item--right\" />\n </div>\n );\n};\n"]}
|
|
@@ -3,6 +3,7 @@ import { Href, Markdown, Tags } from '../../components';
|
|
|
3
3
|
import { useSpec } from '../../contexts';
|
|
4
4
|
import { TERMS_OF_SERVICE_TEXT, CONTENT_TYPES_SITE, URL_SUPPORT_TEXT, EXTERAL_DOCUMENTATION_TEXT, } from '../../constants';
|
|
5
5
|
export var Info = function () {
|
|
6
|
+
var _a, _b, _c, _d, _e, _f;
|
|
6
7
|
var asyncapi = useSpec();
|
|
7
8
|
var info = asyncapi.info();
|
|
8
9
|
if (!info) {
|
|
@@ -14,7 +15,7 @@ export var Info = function () {
|
|
|
14
15
|
var termsOfService = info.termsOfService();
|
|
15
16
|
var defaultContentType = asyncapi.defaultContentType();
|
|
16
17
|
var contact = info.contact();
|
|
17
|
-
var showInfoList = license
|
|
18
|
+
var showInfoList = (_c = (_b = (_a = license !== null && license !== void 0 ? license : termsOfService) !== null && _a !== void 0 ? _a : defaultContentType) !== null && _b !== void 0 ? _b : contact) !== null && _c !== void 0 ? _c : externalDocs;
|
|
18
19
|
return (React.createElement("div", { className: "panel-item" },
|
|
19
20
|
React.createElement("div", { className: "panel-item--center px-8 text-left", id: "introduction" },
|
|
20
21
|
React.createElement("div", { className: "text-4xl" },
|
|
@@ -22,7 +23,7 @@ export var Info = function () {
|
|
|
22
23
|
"\u00A0",
|
|
23
24
|
info.version()),
|
|
24
25
|
showInfoList && (React.createElement("ul", { className: "flex flex-wrap mt-2 leading-normal" },
|
|
25
|
-
license && (React.createElement("li", { className: "inline-block mt-2 mr-2" }, license.url() ? (React.createElement(Href, { 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-3 py-1", href: license.url()
|
|
26
|
+
license && (React.createElement("li", { className: "inline-block mt-2 mr-2" }, license.url() ? (React.createElement(Href, { 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-3 py-1", href: (_d = license.url()) !== null && _d !== void 0 ? _d : '' },
|
|
26
27
|
React.createElement("span", null, license.name()))) : (React.createElement("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-3 py-1" }, license.name())))),
|
|
27
28
|
termsOfService && (React.createElement("li", { className: "inline-block mt-2 mr-2" },
|
|
28
29
|
React.createElement(Href, { 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-3 py-1", href: termsOfService },
|
|
@@ -35,8 +36,8 @@ export var Info = function () {
|
|
|
35
36
|
React.createElement("span", null, EXTERAL_DOCUMENTATION_TEXT)))),
|
|
36
37
|
contact && (React.createElement(React.Fragment, null,
|
|
37
38
|
contact.url() && (React.createElement("li", { className: "inline-block mt-2 mr-2" },
|
|
38
|
-
React.createElement(Href, { className: "border border-solid border-purple-300 hover:bg-purple-300 hover:text-purple-600 text-purple-500 font-bold no-underline text-xs uppercase rounded px-3 py-1", href: contact.url()
|
|
39
|
-
React.createElement("span", null, contact.name()
|
|
39
|
+
React.createElement(Href, { className: "border border-solid border-purple-300 hover:bg-purple-300 hover:text-purple-600 text-purple-500 font-bold no-underline text-xs uppercase rounded px-3 py-1", href: (_e = contact.url()) !== null && _e !== void 0 ? _e : '' },
|
|
40
|
+
React.createElement("span", null, (_f = contact.name()) !== null && _f !== void 0 ? _f : URL_SUPPORT_TEXT)))),
|
|
40
41
|
contact.email() && (React.createElement("li", { className: "inline-block mt-2 mr-2" },
|
|
41
42
|
React.createElement(Href, { className: "border border-solid border-purple-300 hover:bg-purple-300 hover:text-purple-600 text-purple-500 font-bold no-underline text-xs uppercase rounded px-3 py-1", href: "mailto:".concat(contact.email()) },
|
|
42
43
|
React.createElement("span", null, contact.email())))))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Info.js","sourceRoot":"","sources":["../../../../src/containers/Info/Info.tsx"],"names":[],"mappings":"AAAA,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AAE;wBAExB,kCAAO,0BAA0B,CAAQ,CACpC,CACJ,CACN;gBACA,OAAO,IAAI,CACV;oBACG,OAAO,CAAC,GAAG,EAAE,IAAI,CAChB,4BAAI,SAAS,EAAC,wBAAwB;wBACpC,oBAAC,IAAI,IACH,SAAS,EAAC,4JAA4J,EACtK,IAAI,EAAE,MAAA,OAAO,CAAC,GAAG,EAAE,mCAAI,EAAE;4BAEzB,kCAAO,MAAA,OAAO,CAAC,IAAI,EAAE,mCAAI,gBAAgB,CAAQ,CAC5C,CACJ,CACN;oBACA,OAAO,CAAC,KAAK,EAAE,IAAI,CAClB,4BAAI,SAAS,EAAC,wBAAwB;wBACpC,oBAAC,IAAI,IACH,SAAS,EAAC,4JAA4J,EACtK,IAAI,EAAE,iBAAU,OAAO,CAAC,KAAK,EAAE,CAAE;4BAEjC,kCAAO,OAAO,CAAC,KAAK,EAAE,CAAQ,CACzB,CACJ,CACN,CACA,CACJ;gBACA,MAAM,IAAI,CACT,4BAAI,SAAS,EAAC,wBAAwB;oBACpC,8BAAM,SAAS,EAAC,oJAAoJ;;wBAC7J,MAAM,CACN,CACJ,CACN,CACE,CACN;YAEA,IAAI,CAAC,cAAc,EAAE,IAAI,CACxB,6BAAK,SAAS,EAAC,MAAM;gBACnB,oBAAC,QAAQ,QAAE,IAAI,CAAC,WAAW,EAAE,CAAY,CACrC,CACP;YAEA,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,IAAI,CACpC,6BAAK,SAAS,EAAC,MAAM;gBACnB,oBAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,GAAI,CAClC,CACP,CACG;QAEN,6BAAK,SAAS,EAAC,mBAAmB,GAAG,CACjC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Href, Markdown, Tags } from '../../components';\nimport { useSpec } from '../../contexts';\nimport {\n TERMS_OF_SERVICE_TEXT,\n CONTENT_TYPES_SITE,\n URL_SUPPORT_TEXT,\n EXTERAL_DOCUMENTATION_TEXT,\n} from '../../constants';\n\nexport const Info: React.FunctionComponent = () => {\n const asyncapi = useSpec();\n\n const info = asyncapi.info();\n if (!info) {\n return null;\n }\n\n const specId = asyncapi.info().id();\n const externalDocs = asyncapi.info().externalDocs();\n const license = info.license();\n const termsOfService = info.termsOfService();\n const defaultContentType = asyncapi.defaultContentType();\n const contact = info.contact();\n\n const showInfoList =\n license ?? termsOfService ?? defaultContentType ?? contact ?? externalDocs;\n\n return (\n <div className=\"panel-item\">\n <div className=\"panel-item--center px-8 text-left\" id=\"introduction\">\n <div className=\"text-4xl\">\n {info.title()} {info.version()}\n </div>\n\n {showInfoList && (\n <ul className=\"flex flex-wrap mt-2 leading-normal\">\n {license && (\n <li className=\"inline-block mt-2 mr-2\">\n {license.url() ? (\n <Href\n 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-3 py-1\"\n href={license.url() ?? ''}\n >\n <span>{license.name()}</span>\n </Href>\n ) : (\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-3 py-1\">\n {license.name()}\n </span>\n )}\n </li>\n )}\n {termsOfService && (\n <li className=\"inline-block mt-2 mr-2\">\n <Href\n 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-3 py-1\"\n href={termsOfService}\n >\n <span>{TERMS_OF_SERVICE_TEXT}</span>\n </Href>\n </li>\n )}\n {defaultContentType && (\n <li className=\"inline-block mt-2 mr-2\">\n <Href\n 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-3 py-1\"\n href={`${CONTENT_TYPES_SITE}/${defaultContentType}`}\n >\n <span>{defaultContentType}</span>\n </Href>\n </li>\n )}\n {externalDocs && (\n <li className=\"inline-block mt-2 mr-2\">\n <Href\n 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-3 py-1\"\n href={externalDocs.url()}\n >\n <span>{EXTERAL_DOCUMENTATION_TEXT}</span>\n </Href>\n </li>\n )}\n {contact && (\n <>\n {contact.url() && (\n <li className=\"inline-block mt-2 mr-2\">\n <Href\n className=\"border border-solid border-purple-300 hover:bg-purple-300 hover:text-purple-600 text-purple-500 font-bold no-underline text-xs uppercase rounded px-3 py-1\"\n href={contact.url() ?? ''}\n >\n <span>{contact.name() ?? URL_SUPPORT_TEXT}</span>\n </Href>\n </li>\n )}\n {contact.email() && (\n <li className=\"inline-block mt-2 mr-2\">\n <Href\n className=\"border border-solid border-purple-300 hover:bg-purple-300 hover:text-purple-600 text-purple-500 font-bold no-underline text-xs uppercase rounded px-3 py-1\"\n href={`mailto:${contact.email()}`}\n >\n <span>{contact.email()}</span>\n </Href>\n </li>\n )}\n </>\n )}\n {specId && (\n <li className=\"inline-block mt-2 mr-2\">\n <span className=\"border border-solid border-blue-300 hover:bg-blue-300 hover:text-blue-600 text-blue-500 font-bold no-underline text-xs uppercase rounded px-3 py-1\">\n ID: {specId}\n </span>\n </li>\n )}\n </ul>\n )}\n\n {info.hasDescription() && (\n <div className=\"mt-4\">\n <Markdown>{info.description()}</Markdown>\n </div>\n )}\n\n {asyncapi.info().tags().length > 0 && (\n <div className=\"mt-4\">\n <Tags tags={asyncapi.info().tags()} />\n </div>\n )}\n </div>\n\n <div className=\"panel-item--right\" />\n </div>\n );\n};\n"]}
|
|
@@ -18,7 +18,7 @@ export var Message = function (_a) {
|
|
|
18
18
|
var correlationId = message.correlationId();
|
|
19
19
|
var contentType = message.contentType();
|
|
20
20
|
var externalDocs = message.externalDocs();
|
|
21
|
-
var showInfoList = contentType
|
|
21
|
+
var showInfoList = contentType !== null && contentType !== void 0 ? contentType : externalDocs;
|
|
22
22
|
return (React.createElement("div", { className: "panel-item" },
|
|
23
23
|
React.createElement("div", { className: "panel-item--center px-8" },
|
|
24
24
|
React.createElement("div", { className: "shadow rounded bg-gray-200 p-4 border" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../../../src/containers/Messages/Message.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,UAAU,GACX,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC;AASzB,MAAM,CAAC,IAAM,OAAO,GAAmC,UAAC,EAKvD;QAJC,OAAO,aAAA,EACP,WAAW,iBAAA,EACX,KAAK,WAAA,EACL,oBAAoB,EAApB,YAAY,mBAAG,KAAK,KAAA;IAEpB,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,IAAI,CAAC;KACb;IAGD,IAAM,SAAS,GAAG,OAAO,OAAO,CAAC,EAAE,KAAK,UAAU,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;IACnE,IAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAC9B,IAAM,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAClC,IAAM,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAClC,IAAM,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAClC,IAAM,aAAa,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAE9C,IAAM,WAAW,GAAG,O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,IAAI,IAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAI,CAC1B,CACP,CACG,CACF;QAEL,YAAY,IAAI,CACf,6BAAK,SAAS,EAAC,wBAAwB;YACrC,oBAAC,cAAc,IAAC,OAAO,EAAE,OAAO,GAAI,CAChC,CACP,CACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { MessageInterface } from '@asyncapi/parser';\n\nimport { MessageExample } from './MessageExample';\nimport {\n Href,\n Markdown,\n Schema,\n Bindings,\n Tags,\n Extensions,\n} from '../../components';\n\nimport { useConfig } from '../../contexts';\nimport { CommonHelpers } from '../../helpers';\nimport {\n CONTENT_TYPES_SITE,\n EXTERAL_DOCUMENTATION_TEXT,\n} from '../../constants';\n\ninterface Props {\n message: MessageInterface;\n messageName?: string;\n index?: number | string;\n showExamples?: boolean;\n}\n\nexport const Message: React.FunctionComponent<Props> = ({\n message,\n messageName,\n index,\n showExamples = false,\n}) => {\n const config = useConfig();\n\n if (!message) {\n return null;\n }\n\n // check typeof as fallback for older version than `2.4.0`\n const messageId = typeof message.id === 'function' && message.id();\n const title = message.title();\n const summary = message.summary();\n const payload = message.payload();\n const headers = message.headers();\n const correlationId = message.correlationId();\n\n const contentType = message.contentType();\n const externalDocs = message.externalDocs();\n const showInfoList = contentType ?? externalDocs;\n\n return (\n <div className=\"panel-item\">\n <div className=\"panel-item--center px-8\">\n <div className=\"shadow rounded bg-gray-200 p-4 border\">\n <div>\n {index !== undefined && (\n <span className=\"text-gray-700 font-bold mr-2\">#{index}</span>\n )}\n {title && <span className=\"text-gray-700 mr-2\">{title}</span>}\n <span className=\"border text-orange-600 rounded text-xs py-0 px-2\">\n {messageId}\n </span>\n </div>\n\n {summary && <p className=\"text-gray-600 text-sm\">{summary}</p>}\n\n {showInfoList && (\n <ul className=\"leading-normal mt-2 mb-4 space-x-2 space-y-2\">\n {contentType && (\n <li className=\"inline-block\">\n <Href\n 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-3 py-1\"\n href={`${CONTENT_TYPES_SITE}/${contentType}`}\n >\n <span>{contentType}</span>\n </Href>\n </li>\n )}\n {externalDocs && (\n <li className=\"inline-block\">\n <Href\n 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-3 py-1\"\n href={externalDocs.url()}\n >\n <span>{EXTERAL_DOCUMENTATION_TEXT}</span>\n </Href>\n </li>\n )}\n </ul>\n )}\n\n {messageId && (\n <div className=\"border bg-gray-100 rounded px-4 py-2 mt-2\">\n <div className=\"text-sm text-gray-700\">\n Message ID\n <span className=\"border text-orange-600 rounded text-xs ml-2 py-0 px-2\">\n {messageId}\n </span>\n </div>\n </div>\n )}\n\n {correlationId && (\n <div className=\"border bg-gray-100 rounded px-4 py-2 mt-2\">\n <div className=\"text-sm text-gray-700\">\n Correlation ID\n <span className=\"border text-orange-600 rounded text-xs ml-2 py-0 px-2\">\n {correlationId.location()}\n </span>\n </div>\n\n {correlationId.hasDescription() && (\n <div className=\"mt-2\">\n <Markdown>{correlationId.description()}</Markdown>\n </div>\n )}\n </div>\n )}\n\n {message.hasDescription() && (\n <div className=\"mt-2\">\n <Markdown>{message.description()}</Markdown>\n </div>\n )}\n\n {payload && (\n <div\n className=\"mt-2\"\n id={\n messageName\n ? CommonHelpers.getIdentifier(\n `message-${messageName}-payload`,\n config,\n )\n : undefined\n }\n >\n <Schema schemaName=\"Payload\" schema={payload} />\n </div>\n )}\n {headers && (\n <div\n className=\"mt-2\"\n id={\n messageName\n ? CommonHelpers.getIdentifier(\n `message-${messageName}-headers`,\n config,\n )\n : undefined\n }\n >\n <Schema schemaName=\"Headers\" schema={headers} />\n </div>\n )}\n\n {message.bindings().length > 0 && (\n <div className=\"mt-2\">\n <Bindings\n name=\"Message specific information\"\n bindings={message.bindings()}\n />\n </div>\n )}\n\n <Extensions item={message} />\n\n {message.tags().length > 0 && (\n <div className=\"mt-2\">\n <Tags tags={message.tags()} />\n </div>\n )}\n </div>\n </div>\n\n {showExamples && (\n <div className=\"panel-item--right px-8\">\n <MessageExample message={message} />\n </div>\n )}\n </div>\n );\n};\n"]}
|