@asyncapi/react-component 2.6.5 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/PluginSlotRenderer.js +21 -0
- package/lib/cjs/components/PluginSlotRenderer.js.map +1 -0
- package/lib/cjs/constants.js +2 -1
- package/lib/cjs/constants.js.map +1 -1
- package/lib/cjs/containers/AsyncApi/AsyncApi.js +2 -2
- package/lib/cjs/containers/AsyncApi/AsyncApi.js.map +1 -1
- package/lib/cjs/containers/AsyncApi/Layout.js +15 -13
- package/lib/cjs/containers/AsyncApi/Layout.js.map +1 -1
- package/lib/cjs/containers/AsyncApi/Standalone.js +99 -3
- package/lib/cjs/containers/AsyncApi/Standalone.js.map +1 -1
- package/lib/cjs/containers/Info/Info.js +9 -1
- package/lib/cjs/containers/Info/Info.js.map +1 -1
- package/lib/cjs/containers/Operations/Operation.js +8 -1
- package/lib/cjs/containers/Operations/Operation.js.map +1 -1
- package/lib/cjs/contexts/usePlugin.js +10 -0
- package/lib/cjs/contexts/usePlugin.js.map +1 -0
- package/lib/cjs/helpers/pluginManager.js +116 -0
- package/lib/cjs/helpers/pluginManager.js.map +1 -0
- package/lib/cjs/index.js +3 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/types.js +6 -1
- package/lib/cjs/types.js.map +1 -1
- package/lib/esm/components/PluginSlotRenderer.js +15 -0
- package/lib/esm/components/PluginSlotRenderer.js.map +1 -0
- package/lib/esm/constants.js +1 -0
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/containers/AsyncApi/AsyncApi.js +2 -2
- package/lib/esm/containers/AsyncApi/AsyncApi.js.map +1 -1
- package/lib/esm/containers/AsyncApi/Layout.js +15 -13
- package/lib/esm/containers/AsyncApi/Layout.js.map +1 -1
- package/lib/esm/containers/AsyncApi/Standalone.js +99 -3
- package/lib/esm/containers/AsyncApi/Standalone.js.map +1 -1
- package/lib/esm/containers/Info/Info.js +9 -1
- package/lib/esm/containers/Info/Info.js.map +1 -1
- package/lib/esm/containers/Operations/Operation.js +9 -2
- package/lib/esm/containers/Operations/Operation.js.map +1 -1
- package/lib/esm/contexts/usePlugin.js +6 -0
- package/lib/esm/contexts/usePlugin.js.map +1 -0
- package/lib/esm/helpers/pluginManager.js +113 -0
- package/lib/esm/helpers/pluginManager.js.map +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/types.js +5 -0
- package/lib/esm/types.js.map +1 -1
- package/lib/types/components/PluginSlotRenderer.d.ts +11 -0
- package/lib/types/components/PluginSlotRenderer.d.ts.map +1 -0
- package/lib/types/constants.d.ts +1 -0
- package/lib/types/constants.d.ts.map +1 -1
- package/lib/types/containers/AsyncApi/AsyncApi.d.ts +5 -1
- package/lib/types/containers/AsyncApi/AsyncApi.d.ts.map +1 -1
- package/lib/types/containers/AsyncApi/Layout.d.ts +2 -0
- package/lib/types/containers/AsyncApi/Layout.d.ts.map +1 -1
- package/lib/types/containers/AsyncApi/Standalone.d.ts +13 -1
- package/lib/types/containers/AsyncApi/Standalone.d.ts.map +1 -1
- package/lib/types/containers/Info/Info.d.ts.map +1 -1
- package/lib/types/containers/Operations/Operation.d.ts.map +1 -1
- package/lib/types/contexts/usePlugin.d.ts +5 -0
- package/lib/types/contexts/usePlugin.d.ts.map +1 -0
- package/lib/types/helpers/pluginManager.d.ts +26 -0
- package/lib/types/helpers/pluginManager.d.ts.map +1 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/types.d.ts +38 -0
- package/lib/types/types.d.ts.map +1 -1
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.js","sourceRoot":"","sources":["../../../../src/containers/Operations/Operation.tsx"],"names":[],"mappings":";;;;;;;;;;;;;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AAE;QACnB,OAAO,6DAAK,CAAC;KACd;IACD,IAAM,YAAY,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;IAErC,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,6DAAK,CAAC;KACd;IAED,IAAM,oBAAoB,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;IAErD,OAAO,CACL,uCAAK,SAAS,EAAC,MAAM;QACnB,uCACE,SAAS,EAAE,mBACT,IAAI,KAAK,mBAAW,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,UACtD,GACP;QACF,uCAAK,SAAS,EAAC,KAAK;YAClB,sCAAI,SAAS,EAAC,SAAS;gBACrB,wCAAM,SAAS,EAAC,gBAAgB,EAAC,KAAK,EAAE,IAAI,gCAErC,CACJ;YACJ,oBAAoB,IAAI,CACvB,uCAAK,SAAS,EAAC,uBAAuB;;gBAEpC,wCAAM,SAAS,EAAC,uDAAuD,IACpE,oBAAoB,CAChB,CACH,CACP;YACA,YAAY,CAAC,cAAc,EAAE,IAAI,CAChC,uCAAK,SAAS,EAAC,MAAM;gBACnB,8BAAC,qBAAQ,QAAE,YAAY,CAAC,WAAW,EAAE,CAAY,CAC7C,CACP;YACD,8BAAC,uBAAU,IAAC,IAAI,EAAC,oCAAoC,EAAC,IAAI,EAAE,KAAK,GAAI,CACjE,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,yBAAyB,6BAiDpC","sourcesContent":["import React, { useState } from 'react';\nimport { ChannelInterface, OperationInterface } from '@asyncapi/parser';\nimport { Message } from '../Messages/Message';\nimport { Security } from '../Servers/Security';\nimport {\n Markdown,\n Schema,\n Bindings,\n Tags,\n Extensions,\n CollapseButton,\n} from '../../components';\nimport { Href } from '../../components/Href';\nimport { useConfig, useSpec } from '../../contexts';\nimport { CommonHelpers, SchemaHelpers } from '../../helpers';\nimport { EXTERAL_DOCUMENTATION_TEXT } from '../../constants';\nimport { PayloadType } from '../../types';\n\ninterface Props {\n type: PayloadType;\n operation: OperationInterface;\n channelName: string;\n channel: ChannelInterface;\n}\n\nexport const Operation: React.FunctionComponent<Props> = (props) => {\n const { type = PayloadType.SEND, operation, channelName, channel } = props;\n const config = useConfig();\n if (!operation || !channel) {\n return null;\n }\n\n // check typeof as fallback for older version than `2.2.0`\n const servers =\n typeof channel.servers === 'function' && channel.servers().all();\n // check typeof as fallback for older version than `2.4.0`\n const security =\n typeof operation.security === 'function' && operation.security();\n const parameters =\n channel.parameters() !== undefined\n ? SchemaHelpers.parametersToSchema(channel.parameters())\n : undefined;\n\n return (\n <div>\n <div className=\"panel-item--center px-8\">\n <OperationInfo {...props} />\n\n {servers && servers.length > 0 ? (\n <div className=\"mt-2 text-sm\">\n <p>Available only on servers:</p>\n <ul className=\"flex flex-wrap leading-normal\">\n {servers.map((server) => (\n <li className=\"inline-block mt-2 mr-2\" key={server.id()}>\n <a\n href={`${window.location.pathname}#${CommonHelpers.getIdentifier(\n 'server-' + server.id(),\n config,\n )}`}\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 cursor-pointer\"\n >\n <span className=\"underline\">{server.id()}</span>\n </a>\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n\n {parameters && (\n <div\n className=\"mt-2\"\n id={CommonHelpers.getIdentifier(\n `operation-${type}-${channelName}-parameters`,\n config,\n )}\n >\n <Schema schemaName=\"Parameters\" schema={parameters} expanded />\n </div>\n )}\n\n {security && (\n <div\n className=\"mt-2\"\n id={CommonHelpers.getIdentifier(\n `operation-${type}-${channelName}-security`,\n config,\n )}\n >\n <Security\n security={security}\n header=\"Additional security requirements\"\n />\n </div>\n )}\n\n {channel.bindings() && (\n <div className=\"mt-2\">\n <Bindings\n name=\"Channel specific information\"\n bindings={channel.bindings()}\n />\n </div>\n )}\n\n <Extensions name=\"Channel Extensions\" item={channel} />\n\n {operation.bindings() && (\n <div className=\"mt-2\">\n <Bindings\n name=\"Operation specific information\"\n bindings={operation.bindings()}\n />\n </div>\n )}\n\n <Extensions name=\"Operation Extensions\" item={operation} />\n\n {operation.tags() && (\n <div className=\"mt-2\">\n <Tags tags={operation.tags()} />\n </div>\n )}\n </div>\n\n <div\n className=\"w-full mt-4\"\n id={CommonHelpers.getIdentifier(\n `operation-${type}-${channelName}-message`,\n config,\n )}\n >\n {operation.messages().length > 1 ? (\n <div className=\"mt-2\">\n <p className=\"px-8\">\n Accepts <strong>one of</strong> the following messages:\n </p>\n <ul>\n {operation\n .messages()\n .all()\n .map((msg, idx) => (\n <li className=\"mt-4\" key={msg.id()}>\n <Message message={msg} index={idx} showExamples />\n </li>\n ))}\n </ul>\n </div>\n ) : (\n <div className=\"mt-2\">\n <p className=\"px-8\">Accepts the following message:</p>\n <div className=\"mt-2\">\n <Message message={operation.messages().all()[0]} showExamples />\n </div>\n </div>\n )}\n </div>\n\n <OperationReplyInfo {...props} />\n </div>\n );\n};\n\nexport const OperationInfo: React.FunctionComponent<Props> = (props) => {\n const { type = PayloadType.SEND, operation, channelName, channel } = props;\n const config = useConfig();\n const operationSummary = operation.summary();\n const externalDocs = operation.externalDocs();\n const operationId = operation.id();\n const specV = useSpec().version();\n const version = specV.localeCompare('2.6.0', undefined, { numeric: true });\n const isAsyncAPIv2 = version === 0;\n const { backgroundColor, typeLabel } =\n CommonHelpers.getOperationDesignInformation({\n type,\n config,\n isAsyncAPIv2,\n });\n return (\n <>\n <div className=\"mb-4\">\n <h3>\n <span\n className={`font-mono text-white uppercase p-1 rounded mr-2 ${backgroundColor}`}\n title={type}\n >\n {typeLabel}\n </span>{' '}\n <span className=\"font-mono text-base\">{channelName}</span>\n </h3>\n </div>\n\n {channel.hasDescription() && (\n <div className=\"mt-2\">\n <Markdown>{channel.description()}</Markdown>\n </div>\n )}\n {operationSummary && (\n <p className=\"text-gray-600 text-sm mt-2\">{operationSummary}</p>\n )}\n {operation.hasDescription() && (\n <div className=\"mt-2\">\n <Markdown>{operation.description()}</Markdown>\n </div>\n )}\n\n {externalDocs && (\n <ul className=\"leading-normal mt-2 mb-4 space-x-2 space-y-2\">\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 {operationId && (\n <div className=\"border bg-gray-100 rounded px-4 py-2 mt-2\">\n <div className=\"text-sm text-gray-700\">\n Operation ID\n <span className=\"bg-orange-600 text-white rounded text-xs ml-2 py-0 px-2\">\n {operationId}\n </span>\n </div>\n </div>\n )}\n </>\n );\n};\n\nexport const OperationReplyInfo: React.FunctionComponent<Props> = (props) => {\n const { type = PayloadType.SEND, operation } = props;\n const [showMessages, setShowMessages] = useState(false);\n const [showChannel, setShowChannel] = useState(false);\n if (type !== PayloadType.REPLY && type !== PayloadType.REQUEST) {\n return <></>;\n }\n const reply = operation.reply();\n if (reply === undefined) {\n return <></>;\n }\n\n const replyMessages = reply.messages();\n const explicitChannel = reply.channel();\n\n const replyAddress = reply.address()?.location();\n\n return (\n <div className=\"panel-item\">\n <div className=\"panel-item--center\">\n <div className=\"font-mono px-8 py-4\">\n <div className=\"border rounded\">\n <div\n className={`w-full ${\n type === PayloadType.REPLY\n ? 'bg-green-600 border-green-600'\n : 'bg-blue-600 border-blue-600'\n } text-sm rounded-t h-8 px-4 border text-white flex items-center`}\n >\n <strong>REPLY INFORMATION</strong>\n </div>\n <div className=\"flex\">\n <div\n className={`w-1 h-11 ${\n type === PayloadType.REPLY ? 'bg-green-600' : 'bg-blue-600'\n } mt-4`}\n />\n <div className=\"p-4\">\n <h3 className=\"text-xs\">\n <span className=\"mr-2\" title={type}>\n REPLY CHANNEL INFORMATION\n </span>\n </h3>\n {explicitChannel?.address() ? (\n <div className=\"text-xs text-gray-700\">\n Reply will be provided via this designated address:{' '}\n <span className=\"border text-orange-600 rounded text-xs ml-2 py-0 px-2\">\n {explicitChannel.address()}{' '}\n </span>\n </div>\n ) : (\n replyAddress != null && (\n <div className=\"text-xs text-gray-700\">\n Reply will be directed to the address specified at this\n location:{' '}\n <span className=\"border text-orange-600 rounded text-xs ml-2 py-0 px-2\">\n {replyAddress}\n </span>\n </div>\n )\n )}\n <div className=\"mt-2\">\n {explicitChannel && (\n <CollapseButton\n onClick={() => setShowChannel((prev) => !prev)}\n expanded={showChannel}\n >\n <span className=\"inline-block py-0.5 mr-1 text-gray-500 text-xs text-center rounded focus:outline-none\">\n View channel details\n </span>\n </CollapseButton>\n )}\n {explicitChannel && (\n <div\n className={`w-full mt-4 ${\n showChannel ? 'block' : 'hidden'\n }`}\n >\n <OperationReplyChannelInfo {...props} />{' '}\n </div>\n )}\n </div>\n </div>\n </div>\n <OperationReplyAddressInfo {...props} />\n {replyMessages.isEmpty() === false && (\n <div className=\"p-4\">\n <CollapseButton\n onClick={() => setShowMessages((prev) => !prev)}\n expanded={showMessages}\n >\n <span className=\"inline-block py-0.5 mr-1 text-gray-500 text-xs text-center rounded focus:outline-none\">\n Expected Reply{' '}\n {replyMessages.length > 1 ? 'Messages' : 'Message'}\n </span>\n </CollapseButton>\n <div\n className={`w-full mt-4 ${showMessages ? 'block' : 'hidden'}`}\n >\n {replyMessages.length > 1 ? (\n <div className=\"mt-2\">\n <ul>\n {replyMessages.all().map((msg, idx) => (\n <li className=\"mt-4\" key={msg.id()}>\n <Message message={msg} index={idx} showExamples />\n </li>\n ))}\n </ul>\n </div>\n ) : (\n <div className=\"mt-2\">\n <div className=\"mt-2\">\n <Message\n message={replyMessages.all()[0]}\n showExamples\n />\n </div>\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n </div>\n\n <Extensions name=\"Operation Reply Extensions\" item={reply} />\n </div>\n </div>\n );\n};\n\nexport const OperationReplyChannelInfo: React.FunctionComponent<Props> = ({\n type = PayloadType.SEND,\n operation,\n}) => {\n const reply = operation.reply();\n const channel = reply?.channel();\n const channelName = channel?.address() ?? '';\n\n const config = useConfig();\n const servers =\n typeof channel?.servers === 'function' && channel.servers().all();\n const parameters =\n channel?.parameters() !== undefined\n ? SchemaHelpers.parametersToSchema(channel.parameters())\n : undefined;\n\n if (!channel) {\n return <></>;\n }\n\n return (\n <div>\n {channel.address() && (\n <div className=\"mt-2 text-xs text-gray-700\">\n Address:{' '}\n <span className=\"border text-orange-600 rounded text-xs py-0 px-2\">\n {channel.address()}\n </span>\n </div>\n )}\n {channel.hasDescription() && (\n <div className=\"mt-2\">\n <Markdown>{channel.description()}</Markdown>\n </div>\n )}\n {servers && servers.length > 0 ? (\n <div className=\"mt-2 text-sm\">\n <p>Available only on servers:</p>\n <ul className=\"flex flex-wrap leading-normal\">\n {servers.map((server) => (\n <li className=\"inline-block mt-2 mr-2\" key={server.id()}>\n <a\n href={`${window.location.pathname}#${CommonHelpers.getIdentifier(\n 'server-' + server.id(),\n config,\n )}`}\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 cursor-pointer\"\n >\n <span className=\"underline\">{server.id()}</span>\n </a>\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n {channel.messages().all().length > 1 ? (\n <div className=\"mt-2\">\n <span className=\"text-xs text-gray-700\">Messages:</span>\n <ul>\n {channel\n .messages()\n .all()\n .map((msg, idx) => (\n <li className=\"mt-4\" key={msg.id()}>\n <Message message={msg} index={idx} showExamples />\n </li>\n ))}\n </ul>\n </div>\n ) : (\n <div className=\"mt-2\">\n <span className=\"text-xs text-gray-700\">Message:</span>\n <div className=\"mt-2\">\n <Message message={channel.messages().all()[0]} showExamples />\n </div>\n </div>\n )}\n {parameters && (\n <div\n className=\"mt-2\"\n id={CommonHelpers.getIdentifier(\n `operation-${type}-${channelName}-parameters`,\n config,\n )}\n >\n <Schema schemaName=\"Parameters\" schema={parameters} expanded />\n </div>\n )}\n {channel.bindings() && (\n <div className=\"mt-2\">\n <Bindings name=\"Bindings\" bindings={channel.bindings()} />\n </div>\n )}\n </div>\n );\n};\n\nexport const OperationReplyAddressInfo: React.FunctionComponent<Props> = ({\n type = PayloadType.SEND,\n operation,\n}) => {\n if (type !== PayloadType.REPLY && type !== PayloadType.REQUEST) {\n return <></>;\n }\n const reply = operation.reply();\n if (!reply?.address) {\n return <></>;\n }\n const replyAddress = reply.address();\n\n if (!replyAddress) {\n return <></>;\n }\n\n const replyAddressLocation = replyAddress.location();\n\n return (\n <div className=\"flex\">\n <div\n className={`w-1 h-11 ${\n type === PayloadType.REPLY ? 'bg-green-600' : 'bg-blue-600'\n } mt-4`}\n />\n <div className=\"p-4\">\n <h3 className=\"text-xs\">\n <span className=\"mr-2 uppercase\" title={type}>\n REPLY address information\n </span>\n </h3>\n {replyAddressLocation && (\n <div className=\"text-xs text-gray-700\">\n REPLY will be sent to the address provided in:\n <span className=\"border text-orange-600 rounded text-xs ml-2 py-0 px-2\">\n {replyAddressLocation}\n </span>\n </div>\n )}\n {replyAddress.hasDescription() && (\n <div className=\"mt-2\">\n <Markdown>{replyAddress.description()}</Markdown>\n </div>\n )}\n <Extensions name=\"Operation Reply Address Extensions\" item={reply} />\n </div>\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Operation.js","sourceRoot":"","sources":["../../../../src/containers/Operations/Operation.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAExC,+CAA8C;AAC9C,gDAA+C;AAC/C,+CAO0B;AAC1B,8CAA6C;AAC7C,2CAAoD;AACpD,yCAA6D;AAC7D,6CAA6D;AAC7D,qCAAsD;AACtD,6DAA4D;AAC5D,0EAAmE;AACnE,sDAAqD;AAS9C,IAAM,SAAS,GAAmC,UAAC,KAAK;IACrD,IAAA,KAA6D,KAAK,KAA3C,EAAvB,IAAI,mBAAG,mBAAW,CAAC,IAAI,KAAA,EAAE,SAAS,GAA2B,KAAK,UA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AAC,YAAY,EAAE;QACjB,OAAO,6DAAK,CAAC;KACd;IAED,IAAM,oBAAoB,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;IAErD,OAAO,CACL,uCAAK,SAAS,EAAC,MAAM;QACnB,uCACE,SAAS,EAAE,mBACT,IAAI,KAAK,mBAAW,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,UACtD,GACP;QACF,uCAAK,SAAS,EAAC,KAAK;YAClB,sCAAI,SAAS,EAAC,SAAS;gBACrB,wCAAM,SAAS,EAAC,gBAAgB,EAAC,KAAK,EAAE,IAAI,gCAErC,CACJ;YACJ,oBAAoB,IAAI,CACvB,uCAAK,SAAS,EAAC,uBAAuB;;gBAEpC,wCAAM,SAAS,EAAC,uDAAuD,IACpE,oBAAoB,CAChB,CACH,CACP;YACA,YAAY,CAAC,cAAc,EAAE,IAAI,CAChC,uCAAK,SAAS,EAAC,MAAM;gBACnB,8BAAC,qBAAQ,QAAE,YAAY,CAAC,WAAW,EAAE,CAAY,CAC7C,CACP;YACD,8BAAC,uBAAU,IAAC,IAAI,EAAC,oCAAoC,EAAC,IAAI,EAAE,KAAK,GAAI,CACjE,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,yBAAyB,6BAiDpC","sourcesContent":["import React, { useState } from 'react';\nimport { ChannelInterface, OperationInterface } from '@asyncapi/parser';\nimport { Message } from '../Messages/Message';\nimport { Security } from '../Servers/Security';\nimport {\n Markdown,\n Schema,\n Bindings,\n Tags,\n Extensions,\n CollapseButton,\n} from '../../components';\nimport { Href } from '../../components/Href';\nimport { useConfig, useSpec } from '../../contexts';\nimport { CommonHelpers, SchemaHelpers } from '../../helpers';\nimport { EXTERAL_DOCUMENTATION_TEXT } from '../../constants';\nimport { PayloadType, PluginSlot } from '../../types';\nimport { PluginManager } from '../../helpers/pluginManager';\nimport { SlotRenderer } from '../../components/PluginSlotRenderer';\nimport { usePlugin } from '../../contexts/usePlugin';\n\ninterface Props {\n type: PayloadType;\n operation: OperationInterface;\n channelName: string;\n channel: ChannelInterface;\n}\n\nexport const Operation: React.FunctionComponent<Props> = (props) => {\n const { type = PayloadType.SEND, operation, channelName, channel } = props;\n const config = useConfig();\n if (!operation || !channel) {\n return null;\n }\n\n // check typeof as fallback for older version than `2.2.0`\n const servers =\n typeof channel.servers === 'function' && channel.servers().all();\n // check typeof as fallback for older version than `2.4.0`\n const security =\n typeof operation.security === 'function' && operation.security();\n const parameters =\n channel.parameters() !== undefined\n ? SchemaHelpers.parametersToSchema(channel.parameters())\n : undefined;\n\n return (\n <div>\n <div className=\"panel-item--center px-8\">\n <OperationInfo {...props} />\n {servers && servers.length > 0 ? (\n <div className=\"mt-2 text-sm\">\n <p>Available only on servers:</p>\n <ul className=\"flex flex-wrap leading-normal\">\n {servers.map((server) => (\n <li className=\"inline-block mt-2 mr-2\" key={server.id()}>\n <a\n href={`${window.location.pathname}#${CommonHelpers.getIdentifier(\n 'server-' + server.id(),\n config,\n )}`}\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 cursor-pointer\"\n >\n <span className=\"underline\">{server.id()}</span>\n </a>\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n\n {parameters && (\n <div\n className=\"mt-2\"\n id={CommonHelpers.getIdentifier(\n `operation-${type}-${channelName}-parameters`,\n config,\n )}\n >\n <Schema schemaName=\"Parameters\" schema={parameters} expanded />\n </div>\n )}\n\n {security && (\n <div\n className=\"mt-2\"\n id={CommonHelpers.getIdentifier(\n `operation-${type}-${channelName}-security`,\n config,\n )}\n >\n <Security\n security={security}\n header=\"Additional security requirements\"\n />\n </div>\n )}\n\n {channel.bindings() && (\n <div className=\"mt-2\">\n <Bindings\n name=\"Channel specific information\"\n bindings={channel.bindings()}\n />\n </div>\n )}\n\n <Extensions name=\"Channel Extensions\" item={channel} />\n\n {operation.bindings() && (\n <div className=\"mt-2\">\n <Bindings\n name=\"Operation specific information\"\n bindings={operation.bindings()}\n />\n </div>\n )}\n\n <Extensions name=\"Operation Extensions\" item={operation} />\n\n {operation.tags() && (\n <div className=\"mt-2\">\n <Tags tags={operation.tags()} />\n </div>\n )}\n </div>\n\n <div\n className=\"w-full mt-4\"\n id={CommonHelpers.getIdentifier(\n `operation-${type}-${channelName}-message`,\n config,\n )}\n >\n {operation.messages().length > 1 ? (\n <div className=\"mt-2\">\n <p className=\"px-8\">\n Accepts <strong>one of</strong> the following messages:\n </p>\n <ul>\n {operation\n .messages()\n .all()\n .map((msg, idx) => (\n <li className=\"mt-4\" key={msg.id()}>\n <Message message={msg} index={idx} showExamples />\n </li>\n ))}\n </ul>\n </div>\n ) : (\n <div className=\"mt-2\">\n <p className=\"px-8\">Accepts the following message:</p>\n <div className=\"mt-2\">\n <Message message={operation.messages().all()[0]} showExamples />\n </div>\n </div>\n )}\n </div>\n\n <OperationReplyInfo {...props} />\n </div>\n );\n};\n\nexport const OperationInfo: React.FunctionComponent<Props> = (props) => {\n const { type = PayloadType.SEND, operation, channelName, channel } = props;\n const config = useConfig();\n const pluginManager = usePlugin();\n const operationSummary = operation.summary();\n const externalDocs = operation.externalDocs();\n const operationId = operation.id();\n const specV = useSpec().version();\n const version = specV.localeCompare('2.6.0', undefined, { numeric: true });\n const isAsyncAPIv2 = version === 0;\n const { backgroundColor, typeLabel } =\n CommonHelpers.getOperationDesignInformation({\n type,\n config,\n isAsyncAPIv2,\n });\n return (\n <>\n <div className=\"mb-4\">\n <h3>\n <span\n className={`font-mono text-white uppercase p-1 rounded mr-2 ${backgroundColor}`}\n title={type}\n >\n {typeLabel}\n </span>{' '}\n <span className=\"font-mono text-base\">{channelName}</span>\n </h3>\n </div>\n\n {channel.hasDescription() && (\n <div className=\"mt-2\">\n <Markdown>{channel.description()}</Markdown>\n </div>\n )}\n {operationSummary && (\n <p className=\"text-gray-600 text-sm mt-2\">{operationSummary}</p>\n )}\n {operation.hasDescription() && (\n <div className=\"mt-2\">\n <Markdown>{operation.description()}</Markdown>\n </div>\n )}\n\n {externalDocs && (\n <ul className=\"leading-normal mt-2 mb-4 space-x-2 space-y-2\">\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 {operationId && (\n <div className=\"border bg-gray-100 rounded px-4 py-2 mt-2\">\n <div className=\"text-sm text-gray-700\">\n Operation ID\n <span className=\"bg-orange-600 text-white rounded text-xs ml-2 py-0 px-2\">\n {operationId}\n </span>\n </div>\n </div>\n )}\n {PluginManager && (\n <SlotRenderer\n slot={PluginSlot.OPERATION}\n context={{\n schema: props,\n }}\n pluginManager={pluginManager}\n />\n )}\n </>\n );\n};\n\nexport const OperationReplyInfo: React.FunctionComponent<Props> = (props) => {\n const { type = PayloadType.SEND, operation } = props;\n const [showMessages, setShowMessages] = useState(false);\n const [showChannel, setShowChannel] = useState(false);\n if (type !== PayloadType.REPLY && type !== PayloadType.REQUEST) {\n return <></>;\n }\n const reply = operation.reply();\n if (reply === undefined) {\n return <></>;\n }\n\n const replyMessages = reply.messages();\n const explicitChannel = reply.channel();\n\n const replyAddress = reply.address()?.location();\n\n return (\n <div className=\"panel-item\">\n <div className=\"panel-item--center\">\n <div className=\"font-mono px-8 py-4\">\n <div className=\"border rounded\">\n <div\n className={`w-full ${\n type === PayloadType.REPLY\n ? 'bg-green-600 border-green-600'\n : 'bg-blue-600 border-blue-600'\n } text-sm rounded-t h-8 px-4 border text-white flex items-center`}\n >\n <strong>REPLY INFORMATION</strong>\n </div>\n <div className=\"flex\">\n <div\n className={`w-1 h-11 ${\n type === PayloadType.REPLY ? 'bg-green-600' : 'bg-blue-600'\n } mt-4`}\n />\n <div className=\"p-4\">\n <h3 className=\"text-xs\">\n <span className=\"mr-2\" title={type}>\n REPLY CHANNEL INFORMATION\n </span>\n </h3>\n {explicitChannel?.address() ? (\n <div className=\"text-xs text-gray-700\">\n Reply will be provided via this designated address:{' '}\n <span className=\"border text-orange-600 rounded text-xs ml-2 py-0 px-2\">\n {explicitChannel.address()}{' '}\n </span>\n </div>\n ) : (\n replyAddress != null && (\n <div className=\"text-xs text-gray-700\">\n Reply will be directed to the address specified at this\n location:{' '}\n <span className=\"border text-orange-600 rounded text-xs ml-2 py-0 px-2\">\n {replyAddress}\n </span>\n </div>\n )\n )}\n <div className=\"mt-2\">\n {explicitChannel && (\n <CollapseButton\n onClick={() => setShowChannel((prev) => !prev)}\n expanded={showChannel}\n >\n <span className=\"inline-block py-0.5 mr-1 text-gray-500 text-xs text-center rounded focus:outline-none\">\n View channel details\n </span>\n </CollapseButton>\n )}\n {explicitChannel && (\n <div\n className={`w-full mt-4 ${\n showChannel ? 'block' : 'hidden'\n }`}\n >\n <OperationReplyChannelInfo {...props} />{' '}\n </div>\n )}\n </div>\n </div>\n </div>\n <OperationReplyAddressInfo {...props} />\n {replyMessages.isEmpty() === false && (\n <div className=\"p-4\">\n <CollapseButton\n onClick={() => setShowMessages((prev) => !prev)}\n expanded={showMessages}\n >\n <span className=\"inline-block py-0.5 mr-1 text-gray-500 text-xs text-center rounded focus:outline-none\">\n Expected Reply{' '}\n {replyMessages.length > 1 ? 'Messages' : 'Message'}\n </span>\n </CollapseButton>\n <div\n className={`w-full mt-4 ${showMessages ? 'block' : 'hidden'}`}\n >\n {replyMessages.length > 1 ? (\n <div className=\"mt-2\">\n <ul>\n {replyMessages.all().map((msg, idx) => (\n <li className=\"mt-4\" key={msg.id()}>\n <Message message={msg} index={idx} showExamples />\n </li>\n ))}\n </ul>\n </div>\n ) : (\n <div className=\"mt-2\">\n <div className=\"mt-2\">\n <Message\n message={replyMessages.all()[0]}\n showExamples\n />\n </div>\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n </div>\n\n <Extensions name=\"Operation Reply Extensions\" item={reply} />\n </div>\n </div>\n );\n};\n\nexport const OperationReplyChannelInfo: React.FunctionComponent<Props> = ({\n type = PayloadType.SEND,\n operation,\n}) => {\n const reply = operation.reply();\n const channel = reply?.channel();\n const channelName = channel?.address() ?? '';\n\n const config = useConfig();\n const servers =\n typeof channel?.servers === 'function' && channel.servers().all();\n const parameters =\n channel?.parameters() !== undefined\n ? SchemaHelpers.parametersToSchema(channel.parameters())\n : undefined;\n\n if (!channel) {\n return <></>;\n }\n\n return (\n <div>\n {channel.address() && (\n <div className=\"mt-2 text-xs text-gray-700\">\n Address:{' '}\n <span className=\"border text-orange-600 rounded text-xs py-0 px-2\">\n {channel.address()}\n </span>\n </div>\n )}\n {channel.hasDescription() && (\n <div className=\"mt-2\">\n <Markdown>{channel.description()}</Markdown>\n </div>\n )}\n {servers && servers.length > 0 ? (\n <div className=\"mt-2 text-sm\">\n <p>Available only on servers:</p>\n <ul className=\"flex flex-wrap leading-normal\">\n {servers.map((server) => (\n <li className=\"inline-block mt-2 mr-2\" key={server.id()}>\n <a\n href={`${window.location.pathname}#${CommonHelpers.getIdentifier(\n 'server-' + server.id(),\n config,\n )}`}\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 cursor-pointer\"\n >\n <span className=\"underline\">{server.id()}</span>\n </a>\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n {channel.messages().all().length > 1 ? (\n <div className=\"mt-2\">\n <span className=\"text-xs text-gray-700\">Messages:</span>\n <ul>\n {channel\n .messages()\n .all()\n .map((msg, idx) => (\n <li className=\"mt-4\" key={msg.id()}>\n <Message message={msg} index={idx} showExamples />\n </li>\n ))}\n </ul>\n </div>\n ) : (\n <div className=\"mt-2\">\n <span className=\"text-xs text-gray-700\">Message:</span>\n <div className=\"mt-2\">\n <Message message={channel.messages().all()[0]} showExamples />\n </div>\n </div>\n )}\n {parameters && (\n <div\n className=\"mt-2\"\n id={CommonHelpers.getIdentifier(\n `operation-${type}-${channelName}-parameters`,\n config,\n )}\n >\n <Schema schemaName=\"Parameters\" schema={parameters} expanded />\n </div>\n )}\n {channel.bindings() && (\n <div className=\"mt-2\">\n <Bindings name=\"Bindings\" bindings={channel.bindings()} />\n </div>\n )}\n </div>\n );\n};\n\nexport const OperationReplyAddressInfo: React.FunctionComponent<Props> = ({\n type = PayloadType.SEND,\n operation,\n}) => {\n if (type !== PayloadType.REPLY && type !== PayloadType.REQUEST) {\n return <></>;\n }\n const reply = operation.reply();\n if (!reply?.address) {\n return <></>;\n }\n const replyAddress = reply.address();\n\n if (!replyAddress) {\n return <></>;\n }\n\n const replyAddressLocation = replyAddress.location();\n\n return (\n <div className=\"flex\">\n <div\n className={`w-1 h-11 ${\n type === PayloadType.REPLY ? 'bg-green-600' : 'bg-blue-600'\n } mt-4`}\n />\n <div className=\"p-4\">\n <h3 className=\"text-xs\">\n <span className=\"mr-2 uppercase\" title={type}>\n REPLY address information\n </span>\n </h3>\n {replyAddressLocation && (\n <div className=\"text-xs text-gray-700\">\n REPLY will be sent to the address provided in:\n <span className=\"border text-orange-600 rounded text-xs ml-2 py-0 px-2\">\n {replyAddressLocation}\n </span>\n </div>\n )}\n {replyAddress.hasDescription() && (\n <div className=\"mt-2\">\n <Markdown>{replyAddress.description()}</Markdown>\n </div>\n )}\n <Extensions name=\"Operation Reply Address Extensions\" item={reply} />\n </div>\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePlugin = exports.PluginContext = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
exports.PluginContext = (0, react_1.createContext)(undefined);
|
|
6
|
+
function usePlugin() {
|
|
7
|
+
return (0, react_1.useContext)(exports.PluginContext);
|
|
8
|
+
}
|
|
9
|
+
exports.usePlugin = usePlugin;
|
|
10
|
+
//# sourceMappingURL=usePlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePlugin.js","sourceRoot":"","sources":["../../../src/contexts/usePlugin.ts"],"names":[],"mappings":";;;AAAA,+BAAkD;AAGrC,QAAA,aAAa,GAAG,IAAA,qBAAa,EACxC,SAAS,CACV,CAAC;AAEF,SAAgB,SAAS;IACvB,OAAO,IAAA,kBAAU,EAAC,qBAAa,CAAC,CAAC;AACnC,CAAC;AAFD,8BAEC","sourcesContent":["import { createContext, useContext } from 'react';\nimport { PluginManager } from '../helpers/pluginManager';\n\nexport const PluginContext = createContext<PluginManager | undefined>(\n undefined,\n);\n\nexport function usePlugin() {\n return useContext(PluginContext);\n}\n"]}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PluginManager = void 0;
|
|
4
|
+
var PluginManager = (function () {
|
|
5
|
+
function PluginManager(initialContext) {
|
|
6
|
+
this.plugins = new Map();
|
|
7
|
+
this.slotComponents = new Map();
|
|
8
|
+
this.eventListeners = new Map();
|
|
9
|
+
this.context = initialContext;
|
|
10
|
+
}
|
|
11
|
+
PluginManager.prototype.register = function (plugin) {
|
|
12
|
+
if (this.plugins.has(plugin.name)) {
|
|
13
|
+
console.warn("Plugin ".concat(plugin.name, " is already registered"));
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
var api = this.createPluginAPI(plugin);
|
|
17
|
+
plugin.install(api);
|
|
18
|
+
this.plugins.set(plugin.name, plugin);
|
|
19
|
+
};
|
|
20
|
+
PluginManager.prototype.unregister = function (pluginName) {
|
|
21
|
+
var plugin = this.plugins.get(pluginName);
|
|
22
|
+
if (!plugin) {
|
|
23
|
+
console.warn("Plugin \"".concat(pluginName, "\" not found"));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
this.plugins.delete(pluginName);
|
|
27
|
+
this.slotComponents.forEach(function (components) {
|
|
28
|
+
var index = components.findIndex(function (c) {
|
|
29
|
+
return c.pluginName === pluginName;
|
|
30
|
+
});
|
|
31
|
+
if (index > -1) {
|
|
32
|
+
components.splice(index, 1);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
PluginManager.prototype.createPluginAPI = function (plugin) {
|
|
37
|
+
var _this = this;
|
|
38
|
+
return {
|
|
39
|
+
registerComponent: function (slot, component, options) {
|
|
40
|
+
var _a;
|
|
41
|
+
if (options === void 0) { options = {}; }
|
|
42
|
+
if (!_this.slotComponents.has(slot)) {
|
|
43
|
+
_this.slotComponents.set(slot, []);
|
|
44
|
+
}
|
|
45
|
+
var priority = (_a = options.priority) !== null && _a !== void 0 ? _a : 100;
|
|
46
|
+
_this.slotComponents.get(slot).push({
|
|
47
|
+
component: component,
|
|
48
|
+
priority: priority,
|
|
49
|
+
label: options.label,
|
|
50
|
+
pluginName: plugin === null || plugin === void 0 ? void 0 : plugin.name,
|
|
51
|
+
});
|
|
52
|
+
_this.slotComponents.get(slot).sort(function (a, b) { return b.priority - a.priority; });
|
|
53
|
+
},
|
|
54
|
+
onSpecLoaded: function (callback) {
|
|
55
|
+
_this.on('specLoaded', callback);
|
|
56
|
+
},
|
|
57
|
+
getContext: function () { return _this.context; },
|
|
58
|
+
on: function (eventName, callback) {
|
|
59
|
+
_this.on(eventName, callback);
|
|
60
|
+
},
|
|
61
|
+
off: function (eventName, callback) {
|
|
62
|
+
_this.off(eventName, callback);
|
|
63
|
+
},
|
|
64
|
+
emit: function (eventName, data) {
|
|
65
|
+
_this.emit(eventName, data);
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
PluginManager.prototype.on = function (eventName, callback) {
|
|
70
|
+
if (!this.eventListeners.has(eventName)) {
|
|
71
|
+
this.eventListeners.set(eventName, new Set());
|
|
72
|
+
}
|
|
73
|
+
this.eventListeners.get(eventName).add(callback);
|
|
74
|
+
};
|
|
75
|
+
PluginManager.prototype.off = function (eventName, callback) {
|
|
76
|
+
var listeners = this.eventListeners.get(eventName);
|
|
77
|
+
if (listeners) {
|
|
78
|
+
listeners.delete(callback);
|
|
79
|
+
if (listeners.size === 0) {
|
|
80
|
+
this.eventListeners.delete(eventName);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
PluginManager.prototype.emit = function (eventName, data) {
|
|
85
|
+
var eventListeners = this.eventListeners.get(eventName);
|
|
86
|
+
if (eventListeners) {
|
|
87
|
+
eventListeners.forEach(function (callback) { return callback(data); });
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
PluginManager.prototype.listeners = function (eventName) {
|
|
91
|
+
var listeners = this.eventListeners.get(eventName);
|
|
92
|
+
return listeners ? Array.from(listeners) : [];
|
|
93
|
+
};
|
|
94
|
+
PluginManager.prototype.eventNames = function () {
|
|
95
|
+
return Array.from(this.eventListeners.keys());
|
|
96
|
+
};
|
|
97
|
+
PluginManager.prototype.getComponentsForSlot = function (slot) {
|
|
98
|
+
var _a;
|
|
99
|
+
return ((_a = this.slotComponents.get(slot)) !== null && _a !== void 0 ? _a : []).map(function (c) { return c.component; });
|
|
100
|
+
};
|
|
101
|
+
PluginManager.prototype.updateContext = function (updates) {
|
|
102
|
+
this.context = updates;
|
|
103
|
+
};
|
|
104
|
+
PluginManager.prototype.getPlugin = function (name) {
|
|
105
|
+
return this.plugins.get(name);
|
|
106
|
+
};
|
|
107
|
+
PluginManager.prototype.listPlugins = function () {
|
|
108
|
+
return Array.from(this.plugins.values()).map(function (p) { return ({
|
|
109
|
+
name: p.name,
|
|
110
|
+
version: p.version,
|
|
111
|
+
}); });
|
|
112
|
+
};
|
|
113
|
+
return PluginManager;
|
|
114
|
+
}());
|
|
115
|
+
exports.PluginManager = PluginManager;
|
|
116
|
+
//# sourceMappingURL=pluginManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginManager.js","sourceRoot":"","sources":["../../../src/helpers/pluginManager.ts"],"names":[],"mappings":";;;AAU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,CAAC;IAED,kCAAU,GAAV;QACE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,4CAAoB,GAApB,UACE,IAAgB;;QAEhB,OAAO,CAAC,MAAA,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,SAAS,EAAX,CAAW,CAAC,CAAC;IACvE,CAAC;IAED,qCAAa,GAAb,UAAc,OAAsB;QAClC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,iCAAS,GAAT,UAAU,IAAY;QACpB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,mCAAW,GAAX;QACE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC;YACnD,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,OAAO,EAAE,CAAC,CAAC,OAAO;SACnB,CAAC,EAHkD,CAGlD,CAAC,CAAC;IACN,CAAC;IACH,oBAAC;AAAD,CAAC,AA3ID,IA2IC;AAEQ,sCAAa","sourcesContent":["import {\n AsyncApiPlugin,\n ComponentSlotProps,\n EventListener,\n MessageBus,\n PluginAPI,\n PluginContext,\n PluginSlot,\n} from '../types';\n\nclass PluginManager implements MessageBus {\n private readonly plugins = new Map<string, AsyncApiPlugin>();\n private readonly slotComponents = new Map<\n PluginSlot,\n {\n component: React.ComponentType<ComponentSlotProps>;\n priority: number;\n label?: string;\n pluginName: string;\n }[]\n >();\n private readonly eventListeners = new Map<string, Set<EventListener>>();\n private context: PluginContext;\n\n constructor(initialContext: PluginContext) {\n this.context = initialContext;\n }\n\n register(plugin: AsyncApiPlugin): void {\n if (this.plugins.has(plugin.name)) {\n console.warn(`Plugin ${plugin.name} is already registered`);\n return;\n }\n\n const api = this.createPluginAPI(plugin);\n plugin.install(api);\n this.plugins.set(plugin.name, plugin);\n }\n\n unregister(pluginName: string): void {\n const plugin = this.plugins.get(pluginName);\n if (!plugin) {\n console.warn(`Plugin \"${pluginName}\" not found`);\n return;\n }\n\n this.plugins.delete(pluginName);\n\n this.slotComponents.forEach((components) => {\n const index = components.findIndex((c) => {\n return c.pluginName === pluginName;\n });\n if (index > -1) {\n components.splice(index, 1);\n }\n });\n }\n\n private createPluginAPI(plugin: AsyncApiPlugin): PluginAPI {\n return {\n registerComponent: (slot, component, options = {}) => {\n if (!this.slotComponents.has(slot)) {\n this.slotComponents.set(slot, []);\n }\n\n const priority = options.priority ?? 100;\n this.slotComponents.get(slot)!.push({\n component,\n priority,\n label: options.label,\n pluginName: plugin?.name,\n });\n\n this.slotComponents.get(slot)!.sort((a, b) => b.priority - a.priority);\n },\n\n onSpecLoaded: (callback) => {\n this.on('specLoaded', callback);\n },\n\n getContext: () => this.context,\n\n on: (eventName, callback) => {\n this.on(eventName, callback);\n },\n\n off: (eventName, callback) => {\n this.off(eventName, callback);\n },\n\n emit: (eventName, data) => {\n this.emit(eventName, data);\n },\n };\n }\n\n on(eventName: string, callback: (data: unknown) => void): void {\n if (!this.eventListeners.has(eventName)) {\n this.eventListeners.set(eventName, new Set());\n }\n this.eventListeners.get(eventName)!.add(callback);\n }\n\n off(eventName: string, callback: (data: unknown) => void): void {\n const listeners = this.eventListeners.get(eventName);\n if (listeners) {\n listeners.delete(callback);\n if (listeners.size === 0) {\n this.eventListeners.delete(eventName);\n }\n }\n }\n\n public emit(eventName: string, data: unknown): void {\n const eventListeners = this.eventListeners.get(eventName);\n if (eventListeners) {\n eventListeners.forEach((callback) => callback(data));\n }\n }\n\n listeners(eventName: string): EventListener[] {\n const listeners = this.eventListeners.get(eventName);\n return listeners ? Array.from(listeners) : [];\n }\n\n eventNames(): string[] {\n return Array.from(this.eventListeners.keys());\n }\n\n getComponentsForSlot(\n slot: PluginSlot,\n ): React.ComponentType<ComponentSlotProps>[] {\n return (this.slotComponents.get(slot) ?? []).map((c) => c.component);\n }\n\n updateContext(updates: PluginContext): void {\n this.context = updates;\n }\n\n getPlugin(name: string): AsyncApiPlugin | undefined {\n return this.plugins.get(name);\n }\n\n listPlugins(): { name: string; version: string }[] {\n return Array.from(this.plugins.values()).map((p) => ({\n name: p.name,\n version: p.version,\n }));\n }\n}\n\nexport { PluginManager };\n"]}
|
package/lib/cjs/index.js
CHANGED
|
@@ -3,10 +3,12 @@ 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 = exports.AsyncApiComponentWP = void 0;
|
|
6
|
+
exports.hljs = exports.AsyncApiComponentWP = exports.PluginSlot = void 0;
|
|
7
7
|
var AsyncApi_1 = __importDefault(require("./containers/AsyncApi/AsyncApi"));
|
|
8
8
|
var Standalone_1 = __importDefault(require("./containers/AsyncApi/Standalone"));
|
|
9
9
|
exports.AsyncApiComponentWP = Standalone_1.default;
|
|
10
|
+
var types_1 = require("./types");
|
|
11
|
+
Object.defineProperty(exports, "PluginSlot", { enumerable: true, get: function () { return types_1.PluginSlot; } });
|
|
10
12
|
var helpers_1 = require("./helpers");
|
|
11
13
|
Object.defineProperty(exports, "hljs", { enumerable: true, get: function () { return helpers_1.hljs; } });
|
|
12
14
|
exports.default = AsyncApi_1.default;
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,4EAA+D;AAC/D,gFAAmE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,4EAA+D;AAC/D,gFAAmE;AAe1D,8BAfF,oBAAmB,CAeE;AAX5B,iCAOiB;AAFf,mGAAA,UAAU,OAAA;AAIZ,qCAAiC;AAEH,qFAFrB,cAAI,OAEqB;AAClC,kBAAe,kBAAiB,CAAC","sourcesContent":["import AsyncApiComponent from './containers/AsyncApi/AsyncApi';\nimport AsyncApiComponentWP from './containers/AsyncApi/Standalone';\n\nexport { AsyncApiProps } from './containers/AsyncApi/AsyncApi';\nexport { ConfigInterface } from './config/config';\nexport {\n FetchingSchemaInterface,\n ExtensionComponentProps,\n AsyncApiPlugin,\n PluginAPI,\n PluginSlot,\n PluginContext,\n} from './types';\n\nimport { hljs } from './helpers';\n\nexport { AsyncApiComponentWP, hljs };\nexport default AsyncApiComponent;\n"]}
|
package/lib/cjs/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PayloadType = exports.isFetchingSchemaInterface = void 0;
|
|
3
|
+
exports.PluginSlot = exports.PayloadType = exports.isFetchingSchemaInterface = void 0;
|
|
4
4
|
function isFetchingSchemaInterface(schema) {
|
|
5
5
|
return schema.url !== undefined;
|
|
6
6
|
}
|
|
@@ -12,4 +12,9 @@ var PayloadType;
|
|
|
12
12
|
PayloadType["REQUEST"] = "request";
|
|
13
13
|
PayloadType["REPLY"] = "reply";
|
|
14
14
|
})(PayloadType = exports.PayloadType || (exports.PayloadType = {}));
|
|
15
|
+
var PluginSlot;
|
|
16
|
+
(function (PluginSlot) {
|
|
17
|
+
PluginSlot["OPERATION"] = "operation";
|
|
18
|
+
PluginSlot["INFO"] = "info";
|
|
19
|
+
})(PluginSlot = exports.PluginSlot || (exports.PluginSlot = {}));
|
|
15
20
|
//# 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":";;;AAeA,SAAgB,yBAAyB,CACvC,MAAmB;IAEnB,OAAQ,MAAkC,CAAC,GAAG,KAAK,SAAS,CAAC;AAC/D,CAAC;AAJD,8DAIC;AAYD,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB","sourcesContent":["import { AsyncAPIDocumentInterface, BaseModel } from '@asyncapi/parser';\n\nexport type PropsSchema =\n | string\n | FetchingSchemaInterface\n | AsyncAPIDocumentInterface\n | object;\n\nexport type NullableAsyncApi = AsyncAPIDocumentInterface | 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?: AsyncAPIDocumentInterface;\n error?: ErrorObject;\n}\n\nexport enum PayloadType {\n SEND = 'send',\n RECEIVE = 'receive',\n REQUEST = 'request',\n REPLY = 'reply',\n}\n\nexport interface MessageExample {\n name?: string;\n summary?: string;\n example: unknown;\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?: unknown;\n validationErrors?: ValidationError[];\n location?: {\n startLine: number;\n startColumn: number;\n startOffset: number;\n };\n refs?: {\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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface ExtensionComponentProps<V = any> {\n propertyName: string;\n propertyValue: V;\n document: AsyncAPIDocumentInterface;\n parent: BaseModel;\n}\n"]}
|
|
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,WAKX;AALD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AAsDD,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,qCAAuB,CAAA;IACvB,2BAAa,CAAA;AACf,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB","sourcesContent":["import { AsyncAPIDocumentInterface, BaseModel } from '@asyncapi/parser';\n\nexport type PropsSchema =\n | string\n | FetchingSchemaInterface\n | AsyncAPIDocumentInterface\n | object;\n\nexport type NullableAsyncApi = AsyncAPIDocumentInterface | 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?: AsyncAPIDocumentInterface;\n error?: ErrorObject;\n}\n\nexport enum PayloadType {\n SEND = 'send',\n RECEIVE = 'receive',\n REQUEST = 'request',\n REPLY = 'reply',\n}\n\nexport interface MessageExample {\n name?: string;\n summary?: string;\n example: unknown;\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?: unknown;\n validationErrors?: ValidationError[];\n location?: {\n startLine: number;\n startColumn: number;\n startOffset: number;\n };\n refs?: {\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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface ExtensionComponentProps<V = any> {\n propertyName: string;\n propertyValue: V;\n document: AsyncAPIDocumentInterface;\n parent: BaseModel;\n}\n\n// Plugin interface\n\nexport enum PluginSlot {\n OPERATION = 'operation',\n INFO = 'info',\n}\n\nexport interface PluginContext {\n schema?: PropsSchema;\n}\n\nexport interface ComponentSlotProps {\n context: PluginContext;\n onClose?: () => void;\n}\n\nexport interface AsyncApiPlugin {\n name: string;\n version: string;\n description?: string;\n\n install(api: PluginAPI): void;\n}\n\nexport type PluginInstance =\n | AsyncApiPlugin\n | React.ComponentType<ComponentSlotProps>;\n\nexport type EventListener = (...args: unknown[]) => void;\n\nexport interface MessageBus {\n on(eventName: string, callback: (data: unknown) => void): void;\n off(eventName: string, callback: (data: unknown) => void): void;\n emit(eventName: string, data: unknown): void;\n listeners(eventName: string): EventListener[];\n eventNames(): string[];\n}\n\nexport interface PluginAPI {\n registerComponent(\n slot: PluginSlot,\n component: React.ComponentType<ComponentSlotProps>,\n options?: { priority?: number; label?: string },\n ): void;\n\n onSpecLoaded(callback: (spec: unknown) => void): void;\n\n getContext(): PluginContext;\n\n on(eventName: string, callback: (data: unknown) => void): void;\n off(eventName: string, callback: (data: unknown) => void): void;\n emit(eventName: string, data: unknown): void;\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
var SlotRenderer = function (_a) {
|
|
3
|
+
var slot = _a.slot, context = _a.context, pluginManager = _a.pluginManager;
|
|
4
|
+
if (!pluginManager) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
var components = pluginManager.getComponentsForSlot(slot);
|
|
8
|
+
if (!components || components.length === 0) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return (React.createElement("div", { className: "asyncapi-react-plugin-slot-".concat(slot), "data-slot": slot }, components.map(function (Component, index) { return (React.createElement(React.Suspense, { key: "".concat(slot, "-").concat(index), fallback: React.createElement("div", null, "Loading plugin...") },
|
|
12
|
+
React.createElement(Component, { context: context }))); })));
|
|
13
|
+
};
|
|
14
|
+
export { SlotRenderer };
|
|
15
|
+
//# sourceMappingURL=PluginSlotRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginSlotRenderer.js","sourceRoot":"","sources":["../../../src/components/PluginSlotRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,IAAM,YAAY,GAAgC,UAAC,EAIlD;QAHC,IAAI,UAAA,EACJ,OAAO,aAAA,EACP,aAAa,mBAAA;IAEb,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IAED,IAAM,UAAU,GAAG,aAAa,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAE5D,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1C,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,6BAAK,SAAS,EAAE,qCAA8B,IAAI,CAAE,eAAa,IAAI,IAClE,UAAU,CAAC,GAAG,CAAC,UAAC,SAAS,EAAE,KAAK,IAAK,OAAA,CACpC,oBAAC,KAAK,CAAC,QAAQ,IACb,GAAG,EAAE,UAAG,IAAI,cAAI,KAAK,CAAE,EACvB,QAAQ,EAAE,qDAA4B;QAEtC,oBAAC,SAAS,IAAC,OAAO,EAAE,OAAO,GAAI,CAChB,CAClB,EAPqC,CAOrC,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import React from 'react';\nimport { PluginManager } from '../helpers/pluginManager';\nimport { PluginContext, PluginSlot } from '../types';\n\ninterface SlotRendererProps {\n slot: PluginSlot;\n context: PluginContext;\n pluginManager?: PluginManager;\n}\n\nconst SlotRenderer: React.FC<SlotRendererProps> = ({\n slot,\n context,\n pluginManager,\n}) => {\n if (!pluginManager) {\n return null;\n }\n\n const components = pluginManager.getComponentsForSlot(slot);\n\n if (!components || components.length === 0) {\n return null;\n }\n\n return (\n <div className={`asyncapi-react-plugin-slot-${slot}`} data-slot={slot}>\n {components.map((Component, index) => (\n <React.Suspense\n key={`${slot}-${index}`}\n fallback={<div>Loading plugin...</div>}\n >\n <Component context={context} />\n </React.Suspense>\n ))}\n </div>\n );\n};\n\nexport { SlotRenderer };\n"]}
|
package/lib/esm/constants.js
CHANGED
|
@@ -66,4 +66,5 @@ export var EXPAND_ERROR_BUTTON_TEXT = 'Expand';
|
|
|
66
66
|
export var COLLAPSE_ERROR_BUTTON_TEXT = 'Collapse';
|
|
67
67
|
export var SECURITY_TEXT = 'Security';
|
|
68
68
|
export var URL_VARIABLES_TEXT = 'URL Variables';
|
|
69
|
+
export var PLUGINEVENTS = ['plugin:ready', 'plugin:error'];
|
|
69
70
|
//# sourceMappingURL=constants.js.map
|
package/lib/esm/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,UAAU,GAAG,UAAU,CAAC;AACrC,MAAM,CAAC,IAAM,kBAAkB,GAC7B,8CAA8C,CAAC;AACjD,MAAM,CAAC,IAAM,iBAAiB,GAAG,cAAc,CAAC;AAChD,MAAM,CAAC,IAAM,eAAe,GAAG,YAAY,CAAC;AAE5C,MAAM,CAAC,IAAM,sBAAsB,GACjC,yDAAyD,CAAC;AAC5D,MAAM,CAAC,IAAM,OAAO,GAAG,SAAS,CAAC;AAEjC,M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MAAM,CAAC,IAAM,mBAAmB,GAAG,SAAS,CAAC;AAE7C,MAAM,CAAC,IAAM,oBAAoB,GAAG,iBAAiB,CAAC;AACtD,MAAM,CAAC,IAAM,qBAAqB,GAAG,kBAAkB,CAAC;AACxD,MAAM,CAAC,IAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAC5D,MAAM,CAAC,IAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD,MAAM,CAAC,IAAM,2BAA2B,GAAG,eAAe,CAAC;AAE3D,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAAC;AAChC,MAAM,CAAC,IAAM,QAAQ,GAAG,KAAK,CAAC;AAC9B,MAAM,CAAC,IAAM,UAAU,GAAG,OAAO,CAAC;AAClC,MAAM,CAAC,IAAM,wBAAwB,GAAG,QAAQ,CAAC;AACjD,MAAM,CAAC,IAAM,0BAA0B,GAAG,UAAU,CAAC;AAErD,MAAM,CAAC,IAAM,aAAa,GAAG,UAAU,CAAC;AAExC,MAAM,CAAC,IAAM,kBAAkB,GAAG,eAAe,CAAC","sourcesContent":["export const CSS_PREFIX = 'asyncapi';\nexport const CONTENT_TYPES_SITE =\n 'https://www.iana.org/assignments/media-types';\nexport const COLLAPSE_ALL_TEXT = 'Collapse All';\nexport const EXPAND_ALL_TEXT = 'Expand All';\n\nexport const VALIDATION_ERRORS_TYPE =\n 'https://github.com/asyncapi/parser-js/validation-errors';\nexport const SERVERS = 'Servers';\n\nexport const ONE_OF_PAYLOADS_TEXT = 'One of those payloads:';\nexport const ANY_OF_PAYLOADS_TEXT = 'Any of those payloads:';\nexport const GENERATED_BADGE_TEXT = 'generated';\nexport const ONE_OF_FOLLOWING_MESSAGES_PUBLISH_TEXT =\n 'You can send one of the following messages:';\nexport const ONE_OF_FOLLOWING_MESSAGES_PUBLISH_SINGLE_TEXT =\n 'You can send the following message:';\nexport const ONE_OF_FOLLOWING_MESSAGES_SUBSCRIBE_TEXT =\n 'You can subscribe to one of the following messages:';\nexport const ONE_OF_FOLLOWING_MESSAGES_SUBSCRIBE_SINGLE_TEXT =\n 'You can subscribe to the following message:';\nexport const RAW_MESSAGE_SUBSCRIBE_TEXT =\n 'You can subscribe to the following message:';\nexport const RAW_MESSAGE_PUBLISH_TEXT = 'You can send the following message:';\n\nexport const CONTACT_TEXT = 'Contact';\nexport const NAM_TEXTE = 'Name';\nexport const URL_TEXT = 'Url';\nexport const EMAIL_TEXT = 'Email';\nexport const LICENSE_TEXT = 'License';\nexport const TERMS_OF_SERVICE_TEXT = 'Terms of service';\nexport const URL_SUPPORT_TEXT = 'Support';\nexport const EMAIL_SUPPORT_TEXT = 'Email support';\nexport const EXTERAL_DOCUMENTATION_TEXT = 'External Docs';\nexport const LOCATION_TEXT = 'Location';\nexport const TYPE_TEXT = 'Type';\nexport const SPECIFICATION_TEXT = 'Specification';\n\nexport const DEPRECATED_TEXT = 'Deprecated';\nexport const PUBLISH_TEXT = 'Publish';\nexport const PUBLISH_LABEL_DEFAULT_TEXT = 'PUB';\nexport const SEND_TEXT = 'Send';\nexport const SEND_LABEL_DEFAULT_TEXT = 'SEND';\nexport const SUBSCRIBE_TEXT = 'Subscribe';\nexport const SUBSCRIBE_LABEL_DEFAULT_TEXT = 'SUB';\nexport const RECEIVE_TEXT = 'Receive';\nexport const RECEIVE_TEXT_LABEL_DEFAULT_TEXT = 'RECEIVE';\nexport const REQUEST_TEXT = 'Request';\nexport const REQUEST_LABEL_DEFAULT_TEXT = 'REQUEST';\nexport const REPLIER_TEXT = 'Reply';\nexport const REPLIER_LABEL_DEFAULT_TEXT = 'REPLY';\nexport const REQUIRED_TEXT = 'Required';\nexport const GENERATED_TEXT = 'Generated';\n\nexport const SERVERS_TEXT = 'Servers';\nexport const OPERATIONS_TEXT = 'Operations';\nexport const MESSAGES_TEXT = 'Messages';\nexport const SCHEMAS_TEXT = 'Schemas';\n\nexport const CHANNELS_TEXT = 'Channels';\nexport const PARAMETERS_TEXT = 'Parameters';\nexport const HEADERS_TEXT = 'Headers';\nexport const MESSAGE_HEADERS_TEXT = 'Message Headers';\nexport const HEADERS_EXAMPLE_TEXT = 'Example of headers';\nexport const TAGS_TEXT = 'Tags';\nexport const PAYLOAD_TEXT = 'Payload';\nexport const MESSAGE_PAYLOAD_TEXT = 'Message Payload';\nexport const PAYLOAD_EXAMPLE_TEXT = 'Example of payload';\nexport const SCHEMA_EXAMPLE_TEXT = 'Example';\n\nexport const SERVER_BINDINGS_TEXT = 'Server Bindings';\nexport const CHANNEL_BINDINGS_TEXT = 'Channel Bindings';\nexport const OPERATION_BINDINGS_TEXT = 'Operation Bindings';\nexport const MESSAGE_BINDINGS_TEXT = 'Message Bindings';\n\nexport const BINDINGS_SCHEMA_OBJECT_TEXT = 'Schema Object';\n\nexport const NONE_TEXT = 'None';\nexport const ANY_TEXT = 'Any';\nexport const ERROR_TEXT = 'Error';\nexport const EXPAND_ERROR_BUTTON_TEXT = 'Expand';\nexport const COLLAPSE_ERROR_BUTTON_TEXT = 'Collapse';\n\nexport const SECURITY_TEXT = 'Security';\n\nexport const URL_VARIABLES_TEXT = 'URL Variables';\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,UAAU,GAAG,UAAU,CAAC;AACrC,MAAM,CAAC,IAAM,kBAAkB,GAC7B,8CAA8C,CAAC;AACjD,MAAM,CAAC,IAAM,iBAAiB,GAAG,cAAc,CAAC;AAChD,MAAM,CAAC,IAAM,eAAe,GAAG,YAAY,CAAC;AAE5C,MAAM,CAAC,IAAM,sBAAsB,GACjC,yDAAyD,CAAC;AAC5D,MAAM,CAAC,IAAM,OAAO,GAAG,SAAS,CAAC;AAEjC,MAAM,CAAC,IAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAC7D,MAAM,CAAC,IAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAC7D,MAAM,CAAC,IAAM,oBAAoB,GAAG,WAAW,CAAC;AAChD,MAAM,CAAC,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IAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAC5D,MAAM,CAAC,IAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD,MAAM,CAAC,IAAM,2BAA2B,GAAG,eAAe,CAAC;AAE3D,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAAC;AAChC,MAAM,CAAC,IAAM,QAAQ,GAAG,KAAK,CAAC;AAC9B,MAAM,CAAC,IAAM,UAAU,GAAG,OAAO,CAAC;AAClC,MAAM,CAAC,IAAM,wBAAwB,GAAG,QAAQ,CAAC;AACjD,MAAM,CAAC,IAAM,0BAA0B,GAAG,UAAU,CAAC;AAErD,MAAM,CAAC,IAAM,aAAa,GAAG,UAAU,CAAC;AAExC,MAAM,CAAC,IAAM,kBAAkB,GAAG,eAAe,CAAC;AAElD,MAAM,CAAC,IAAM,YAAY,GAAG,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC","sourcesContent":["export const CSS_PREFIX = 'asyncapi';\nexport const CONTENT_TYPES_SITE =\n 'https://www.iana.org/assignments/media-types';\nexport const COLLAPSE_ALL_TEXT = 'Collapse All';\nexport const EXPAND_ALL_TEXT = 'Expand All';\n\nexport const VALIDATION_ERRORS_TYPE =\n 'https://github.com/asyncapi/parser-js/validation-errors';\nexport const SERVERS = 'Servers';\n\nexport const ONE_OF_PAYLOADS_TEXT = 'One of those payloads:';\nexport const ANY_OF_PAYLOADS_TEXT = 'Any of those payloads:';\nexport const GENERATED_BADGE_TEXT = 'generated';\nexport const ONE_OF_FOLLOWING_MESSAGES_PUBLISH_TEXT =\n 'You can send one of the following messages:';\nexport const ONE_OF_FOLLOWING_MESSAGES_PUBLISH_SINGLE_TEXT =\n 'You can send the following message:';\nexport const ONE_OF_FOLLOWING_MESSAGES_SUBSCRIBE_TEXT =\n 'You can subscribe to one of the following messages:';\nexport const ONE_OF_FOLLOWING_MESSAGES_SUBSCRIBE_SINGLE_TEXT =\n 'You can subscribe to the following message:';\nexport const RAW_MESSAGE_SUBSCRIBE_TEXT =\n 'You can subscribe to the following message:';\nexport const RAW_MESSAGE_PUBLISH_TEXT = 'You can send the following message:';\n\nexport const CONTACT_TEXT = 'Contact';\nexport const NAM_TEXTE = 'Name';\nexport const URL_TEXT = 'Url';\nexport const EMAIL_TEXT = 'Email';\nexport const LICENSE_TEXT = 'License';\nexport const TERMS_OF_SERVICE_TEXT = 'Terms of service';\nexport const URL_SUPPORT_TEXT = 'Support';\nexport const EMAIL_SUPPORT_TEXT = 'Email support';\nexport const EXTERAL_DOCUMENTATION_TEXT = 'External Docs';\nexport const LOCATION_TEXT = 'Location';\nexport const TYPE_TEXT = 'Type';\nexport const SPECIFICATION_TEXT = 'Specification';\n\nexport const DEPRECATED_TEXT = 'Deprecated';\nexport const PUBLISH_TEXT = 'Publish';\nexport const PUBLISH_LABEL_DEFAULT_TEXT = 'PUB';\nexport const SEND_TEXT = 'Send';\nexport const SEND_LABEL_DEFAULT_TEXT = 'SEND';\nexport const SUBSCRIBE_TEXT = 'Subscribe';\nexport const SUBSCRIBE_LABEL_DEFAULT_TEXT = 'SUB';\nexport const RECEIVE_TEXT = 'Receive';\nexport const RECEIVE_TEXT_LABEL_DEFAULT_TEXT = 'RECEIVE';\nexport const REQUEST_TEXT = 'Request';\nexport const REQUEST_LABEL_DEFAULT_TEXT = 'REQUEST';\nexport const REPLIER_TEXT = 'Reply';\nexport const REPLIER_LABEL_DEFAULT_TEXT = 'REPLY';\nexport const REQUIRED_TEXT = 'Required';\nexport const GENERATED_TEXT = 'Generated';\n\nexport const SERVERS_TEXT = 'Servers';\nexport const OPERATIONS_TEXT = 'Operations';\nexport const MESSAGES_TEXT = 'Messages';\nexport const SCHEMAS_TEXT = 'Schemas';\n\nexport const CHANNELS_TEXT = 'Channels';\nexport const PARAMETERS_TEXT = 'Parameters';\nexport const HEADERS_TEXT = 'Headers';\nexport const MESSAGE_HEADERS_TEXT = 'Message Headers';\nexport const HEADERS_EXAMPLE_TEXT = 'Example of headers';\nexport const TAGS_TEXT = 'Tags';\nexport const PAYLOAD_TEXT = 'Payload';\nexport const MESSAGE_PAYLOAD_TEXT = 'Message Payload';\nexport const PAYLOAD_EXAMPLE_TEXT = 'Example of payload';\nexport const SCHEMA_EXAMPLE_TEXT = 'Example';\n\nexport const SERVER_BINDINGS_TEXT = 'Server Bindings';\nexport const CHANNEL_BINDINGS_TEXT = 'Channel Bindings';\nexport const OPERATION_BINDINGS_TEXT = 'Operation Bindings';\nexport const MESSAGE_BINDINGS_TEXT = 'Message Bindings';\n\nexport const BINDINGS_SCHEMA_OBJECT_TEXT = 'Schema Object';\n\nexport const NONE_TEXT = 'None';\nexport const ANY_TEXT = 'Any';\nexport const ERROR_TEXT = 'Error';\nexport const EXPAND_ERROR_BUTTON_TEXT = 'Expand';\nexport const COLLAPSE_ERROR_BUTTON_TEXT = 'Collapse';\n\nexport const SECURITY_TEXT = 'Security';\n\nexport const URL_VARIABLES_TEXT = 'URL Variables';\n\nexport const PLUGINEVENTS = ['plugin:ready', 'plugin:error'];\n"]}
|
|
@@ -100,9 +100,9 @@ var AsyncApiComponent = (function (_super) {
|
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
102
|
AsyncApiComponent.prototype.render = function () {
|
|
103
|
-
var _a = this.props, schema = _a.schema, config = _a.config;
|
|
103
|
+
var _a = this.props, schema = _a.schema, config = _a.config, plugins = _a.plugins, onPluginEvent = _a.onPluginEvent, onPluginManagerReady = _a.onPluginManagerReady;
|
|
104
104
|
var _b = this.state, asyncapi = _b.asyncapi, error = _b.error;
|
|
105
|
-
return (React.createElement(AsyncApiStandalone, { schema: asyncapi !== null && asyncapi !== void 0 ? asyncapi : schema, config: config, error: error }));
|
|
105
|
+
return (React.createElement(AsyncApiStandalone, { schema: asyncapi !== null && asyncapi !== void 0 ? asyncapi : schema, config: config, error: error, plugins: plugins, onPluginEvent: onPluginEvent, onPluginManagerReady: onPluginManagerReady }));
|
|
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,
|
|
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,GAI1B,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAgB7D;IAAgC,qCAAuC;IAAvE;QAAA,qEAiEC;QAhEC,WAAK,GAAkB;YACrB,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,SAAS;SACjB,CAAC;;IA6DJ,CAAC;IA3DO,6CAAiB,GAAvB;;;;;;6BACM,IAAI,CAAC,KAAK,CAAC,MAAM,EAAjB,cAAiB;wBACb,KAAqB,IAAI,CAAC,KAAK,EAA7B,MAAM,YAAA,EAAE,MAAM,YAAA,CAAgB;wBACtC,WAAM,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,CAAC,EAAA;;wBAArD,SAAqD,CAAC;;;;;;KAEzD;IAEK,8CAAkB,GAAxB,UAAyB,SAAwB;;;;;;wBACzC,SAAS,GAAG,SAAS,CAAC,MAAM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AAE,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,AAjED,CAAgC,SAAS,GAiExC;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 AsyncApiPlugin,\n} from '../../types';\nimport { ConfigInterface } from '../../config';\nimport { SpecificationHelpers, Parser } from '../../helpers';\nimport { PluginManager } from '../../helpers/pluginManager';\n\nexport interface AsyncApiProps {\n schema: PropsSchema;\n config?: Partial<ConfigInterface>;\n plugins?: AsyncApiPlugin[];\n onPluginEvent?: (eventName: string, data: unknown) => void;\n onPluginManagerReady?: (pluginManager: PluginManager) => void;\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, plugins, onPluginEvent, onPluginManagerReady } =\n this.props;\n const { asyncapi, error } = this.state;\n\n return (\n <AsyncApiStandalone\n schema={asyncapi ?? schema}\n config={config}\n error={error}\n plugins={plugins}\n onPluginEvent={onPluginEvent}\n onPluginManagerReady={onPluginManagerReady}\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"]}
|
|
@@ -8,9 +8,10 @@ import { Messages } from '../Messages/Messages';
|
|
|
8
8
|
import { Schemas } from '../Schemas/Schemas';
|
|
9
9
|
import { SpecificationContext, ConfigContext } from '../../contexts';
|
|
10
10
|
import AsyncApiErrorBoundary from '../ApplicationErrorHandler/ErrorBoundary';
|
|
11
|
+
import { PluginContext } from '../../contexts/usePlugin';
|
|
11
12
|
var AsyncApiLayout = function (_a) {
|
|
12
13
|
var _b, _c;
|
|
13
|
-
var asyncapi = _a.asyncapi, config = _a.config;
|
|
14
|
+
var asyncapi = _a.asyncapi, config = _a.config, pluginManager = _a.pluginManager;
|
|
14
15
|
var _d = useState('container:xl'), observerClassName = _d[0], setObserverClassName = _d[1];
|
|
15
16
|
var ref = useResizeObserver({
|
|
16
17
|
onResize: function (_a) {
|
|
@@ -29,18 +30,19 @@ var AsyncApiLayout = function (_a) {
|
|
|
29
30
|
var configShow = (_b = config.show) !== null && _b !== void 0 ? _b : {};
|
|
30
31
|
return (React.createElement(ConfigContext.Provider, { value: config },
|
|
31
32
|
React.createElement(SpecificationContext.Provider, { value: asyncapi },
|
|
32
|
-
React.createElement(
|
|
33
|
-
React.createElement(
|
|
34
|
-
React.createElement(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
React.createElement("div", { className: "relative
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
React.createElement(PluginContext.Provider, { value: pluginManager },
|
|
34
|
+
React.createElement("section", { className: "aui-root" },
|
|
35
|
+
React.createElement(AsyncApiErrorBoundary, null,
|
|
36
|
+
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 },
|
|
37
|
+
configShow.sidebar && React.createElement(Sidebar, null),
|
|
38
|
+
React.createElement("div", { className: "panel--center relative py-8 flex-1" },
|
|
39
|
+
React.createElement("div", { className: "relative z-10" },
|
|
40
|
+
configShow.info && React.createElement(Info, null),
|
|
41
|
+
configShow.servers && React.createElement(Servers, null),
|
|
42
|
+
configShow.operations && React.createElement(Operations, null),
|
|
43
|
+
configShow.messages && React.createElement(Messages, null),
|
|
44
|
+
configShow.schemas && React.createElement(Schemas, null)),
|
|
45
|
+
React.createElement("div", { className: "panel--right absolute top-0 right-0 h-full bg-gray-800" })))))))));
|
|
44
46
|
};
|
|
45
47
|
export default AsyncApiLayout;
|
|
46
48
|
//# sourceMappingURL=Layout.js.map
|
|
@@ -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,EAA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ACJ,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';\n\nimport { ConfigInterface } from '../../config';\nimport { SpecificationContext, ConfigContext } from '../../contexts';\nimport AsyncApiErrorBoundary from '../ApplicationErrorHandler/ErrorBoundary';\nimport { PluginManager } from '../../helpers/pluginManager';\nimport { PluginContext } from '../../contexts/usePlugin';\n\ninterface Props {\n asyncapi: AsyncAPIDocumentInterface;\n config: ConfigInterface;\n pluginManager?: PluginManager;\n}\n\nconst AsyncApiLayout: React.FunctionComponent<Props> = ({\n asyncapi,\n config,\n pluginManager,\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 <= 1536 ? '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 <PluginContext.Provider value={pluginManager}>\n <section className=\"aui-root\">\n <AsyncApiErrorBoundary>\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.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 </AsyncApiErrorBoundary>\n </section>\n </PluginContext.Provider>\n </SpecificationContext.Provider>\n </ConfigContext.Provider>\n );\n};\n\nexport default AsyncApiLayout;\n"]}
|