diff --git a/apps/studio/package.json b/apps/studio/package.json index f76cd2701..b0cc65305 100644 --- a/apps/studio/package.json +++ b/apps/studio/package.json @@ -26,8 +26,8 @@ "@asyncapi/avro-schema-parser": "^3.0.2", "@asyncapi/converter": "^1.3.1", "@asyncapi/openapi-schema-parser": "^3.0.4", - "@asyncapi/parser": "^3.0.0-next-major-spec.2", - "@asyncapi/react-component": "^1.0.0-next.54", + "@asyncapi/parser": "^3.0.0-next-major-spec.3", + "@asyncapi/react-component": "^1.0.2", "@asyncapi/specs": "^6.0.0-next-major-spec.6", "@ebay/nice-modal-react": "^1.2.10", "@headlessui/react": "^1.7.4", diff --git a/apps/studio/src/components/Sidebar.tsx b/apps/studio/src/components/Sidebar.tsx index dd117a943..feaf9d41a 100644 --- a/apps/studio/src/components/Sidebar.tsx +++ b/apps/studio/src/components/Sidebar.tsx @@ -89,7 +89,7 @@ export const Sidebar: FunctionComponent = () => { onClick: () => updateState('secondaryPanel', 'template'), icon: , tooltip: 'HTML preview', - enabled: !isV3 + enabled: true }, // visuliser { diff --git a/apps/studio/src/components/Template/HTMLWrapper.tsx b/apps/studio/src/components/Template/HTMLWrapper.tsx index afb944cbe..8bff5431a 100644 --- a/apps/studio/src/components/Template/HTMLWrapper.tsx +++ b/apps/studio/src/components/Template/HTMLWrapper.tsx @@ -4,12 +4,12 @@ import { AsyncApiComponentWP } from '@asyncapi/react-component'; import { useServices } from '../../services'; import { appState, useDocumentsState, useSettingsState, useOtherState, otherState } from '../../state'; -import { OldAsyncAPIDocument as AsyncAPIDocument, convertToOldAPI } from '@asyncapi/parser/cjs'; +import { AsyncAPIDocumentInterface } from '@asyncapi/parser/cjs'; interface HTMLWrapperProps {} export const HTMLWrapper: React.FunctionComponent = () => { - const [parsedSpec, setParsedSpec] = useState(null); + const [parsedSpec, setParsedSpec] = useState(null); const { navigationSvc } = useServices(); const document = useDocumentsState(state => state.documents['asyncapi']?.document) || null; @@ -22,15 +22,13 @@ export const HTMLWrapper: React.FunctionComponent = () => { useEffect(() => { if (autoRendering || parsedSpec === null) { - const oldDocument = document !== null ? convertToOldAPI(document) : null; - setParsedSpec(oldDocument); + setParsedSpec(document); } }, [document]); // eslint-disable-line useEffect(() => { if (templateRerender) { - const oldDocument = document !== null ? convertToOldAPI(document) : null; - setParsedSpec(oldDocument); + setParsedSpec(document); otherState.setState({ templateRerender: false }); } }, [templateRerender]); // eslint-disable-line @@ -43,14 +41,6 @@ export const HTMLWrapper: React.FunctionComponent = () => { ); } - if (document?.version() === '3.0.0') { - return ( -
-

Documentation preview is not supported yet for v3.0.0 specifications.

-
- ); - } - return ( parsedSpec && (
diff --git a/package-lock.json b/package-lock.json index 9c8dd4e61..bdf51e2e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -500,8 +500,8 @@ "@asyncapi/avro-schema-parser": "^3.0.2", "@asyncapi/converter": "^1.3.1", "@asyncapi/openapi-schema-parser": "^3.0.4", - "@asyncapi/parser": "^3.0.0-next-major-spec.2", - "@asyncapi/react-component": "^1.0.0-next.54", + "@asyncapi/parser": "^3.0.0-next-major-spec.3", + "@asyncapi/react-component": "^1.0.2", "@asyncapi/specs": "^6.0.0-next-major-spec.6", "@ebay/nice-modal-react": "^1.2.10", "@headlessui/react": "^1.7.4", @@ -607,9 +607,9 @@ } }, "apps/studio/node_modules/@asyncapi/parser": { - "version": "3.0.0-next-major-spec.2", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.2.tgz", - "integrity": "sha512-/gJgCYNYlUSDJhySK3IagjiyFfnwEsAZd5rTe396CB+HxJ6yDWDOZYdHzkFgU2RnCULSGzVOWZGx8t3PK+yuVg==", + "version": "3.0.0-next-major-spec.3", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.3.tgz", + "integrity": "sha512-LCrAQqJpGxraMyU2k1Nh1X6Q1dz7a/YhTRRFFrQHOEo+TUT/kRdoUkRDP++e58dO7h9MBN+/hZK5TaqE+/jQiw==", "dependencies": { "@asyncapi/specs": "^6.0.0-next-major-spec.6", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", @@ -861,27 +861,11 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "apps/studio/node_modules/tr46": { - "version": "0.0.3", - "license": "MIT" - }, "apps/studio/node_modules/web-vitals": { "version": "3.3.2", "dev": true, "license": "Apache-2.0" }, - "apps/studio/node_modules/webidl-conversions": { - "version": "3.0.1", - "license": "BSD-2-Clause" - }, - "apps/studio/node_modules/whatwg-url": { - "version": "5.0.0", - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", @@ -1724,22 +1708,6 @@ } } }, - "node_modules/@asyncapi/parser/node_modules/tr46": { - "version": "0.0.3", - "license": "MIT" - }, - "node_modules/@asyncapi/parser/node_modules/webidl-conversions": { - "version": "3.0.1", - "license": "BSD-2-Clause" - }, - "node_modules/@asyncapi/parser/node_modules/whatwg-url": { - "version": "5.0.0", - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/@asyncapi/protobuf-schema-parser": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@asyncapi/protobuf-schema-parser/-/protobuf-schema-parser-3.0.0.tgz", @@ -1792,13 +1760,13 @@ } }, "node_modules/@asyncapi/react-component": { - "version": "1.0.0-next.54", - "resolved": "https://registry.npmjs.org/@asyncapi/react-component/-/react-component-1.0.0-next.54.tgz", - "integrity": "sha512-ign7m7Pt+xQEiYdcA/pABC/Qxpl9lILs3utNTjivEstL5zb2RprQpotHwWmZDLmvbHlmycD3n34xhfoFkRUmHA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@asyncapi/react-component/-/react-component-1.0.2.tgz", + "integrity": "sha512-Betb4RDEsATpKcpw5uG2PeNWViPJIlwGZKx3xPFBpreh9J4nB9SFb7WPddY4Myrbw79/PX6N/KBy+LyiETEDmA==", "dependencies": { "@asyncapi/avro-schema-parser": "3.0.3", "@asyncapi/openapi-schema-parser": "3.0.4", - "@asyncapi/parser": "^3.0.0-next-major-spec.1", + "@asyncapi/parser": "^3.0.0-next-major-spec.3", "@asyncapi/protobuf-schema-parser": "3.0.0", "highlight.js": "^10.7.2", "isomorphic-dompurify": "^0.13.0", @@ -1812,9 +1780,9 @@ } }, "node_modules/@asyncapi/react-component/node_modules/@asyncapi/parser": { - "version": "3.0.0-next-major-spec.1", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.1.tgz", - "integrity": "sha512-nzXwirVYyV8iCmHo4Rhzp1d3NQwOfN6/A3VgplQaKokTuaNcQdbW9c0RrM0f5MGYvAVGF/Uz1E2fWyRF3r/aoQ==", + "version": "3.0.0-next-major-spec.3", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.3.tgz", + "integrity": "sha512-LCrAQqJpGxraMyU2k1Nh1X6Q1dz7a/YhTRRFFrQHOEo+TUT/kRdoUkRDP++e58dO7h9MBN+/hZK5TaqE+/jQiw==", "dependencies": { "@asyncapi/specs": "^6.0.0-next-major-spec.6", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", @@ -1836,9 +1804,9 @@ } }, "node_modules/@asyncapi/react-component/node_modules/@asyncapi/specs": { - "version": "6.0.0-next-major-spec.6", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0-next-major-spec.6.tgz", - "integrity": "sha512-xYiXZetKiAZgZoh2q/sxt+Ceg8bLTK/WSCwtLvlH7JgnjpnOEtCDwKszijmmOJEYdGVSrj0OFXLPrg/dm4JANw==", + "version": "6.0.0-next-major-spec.8", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0-next-major-spec.8.tgz", + "integrity": "sha512-WVhzeJepkqO6abDprz9bk9zR/ESidanQncPP7jFRUJQ71ED4/XQMjaSKLE5MB09eUUZoY5EqoccUQJWfc54SMg==", "dependencies": { "@types/json-schema": "^7.0.11" } @@ -1870,25 +1838,6 @@ "json-pointer": "0.6.2" } }, - "node_modules/@asyncapi/react-component/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "node_modules/@asyncapi/react-component/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/@asyncapi/react-component/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/@asyncapi/specs": { "version": "4.3.1", "dev": true, @@ -15519,25 +15468,6 @@ } } }, - "node_modules/cross-fetch/node_modules/tr46": { - "version": "0.0.3", - "dev": true, - "license": "MIT" - }, - "node_modules/cross-fetch/node_modules/webidl-conversions": { - "version": "3.0.1", - "dev": true, - "license": "BSD-2-Clause" - }, - "node_modules/cross-fetch/node_modules/whatwg-url": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "license": "MIT", @@ -25651,22 +25581,6 @@ "dev": true, "license": "MIT" }, - "node_modules/node-fetch/node_modules/tr46": { - "version": "0.0.3", - "license": "MIT" - }, - "node_modules/node-fetch/node_modules/webidl-conversions": { - "version": "3.0.1", - "license": "BSD-2-Clause" - }, - "node_modules/node-fetch/node_modules/whatwg-url": { - "version": "5.0.0", - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/node-forge": { "version": "1.3.1", "dev": true, @@ -33566,6 +33480,25 @@ "version": "2.3.0", "license": "MIT" }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/whatwg-url/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/whatwg-url/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, "node_modules/which": { "version": "2.0.2", "license": "ISC", @@ -35165,19 +35098,6 @@ "requires": { "whatwg-url": "^5.0.0" } - }, - "tr46": { - "version": "0.0.3" - }, - "webidl-conversions": { - "version": "3.0.1" - }, - "whatwg-url": { - "version": "5.0.0", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } } } }, @@ -35228,13 +35148,13 @@ } }, "@asyncapi/react-component": { - "version": "1.0.0-next.54", - "resolved": "https://registry.npmjs.org/@asyncapi/react-component/-/react-component-1.0.0-next.54.tgz", - "integrity": "sha512-ign7m7Pt+xQEiYdcA/pABC/Qxpl9lILs3utNTjivEstL5zb2RprQpotHwWmZDLmvbHlmycD3n34xhfoFkRUmHA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@asyncapi/react-component/-/react-component-1.0.2.tgz", + "integrity": "sha512-Betb4RDEsATpKcpw5uG2PeNWViPJIlwGZKx3xPFBpreh9J4nB9SFb7WPddY4Myrbw79/PX6N/KBy+LyiETEDmA==", "requires": { "@asyncapi/avro-schema-parser": "3.0.3", "@asyncapi/openapi-schema-parser": "3.0.4", - "@asyncapi/parser": "^3.0.0-next-major-spec.1", + "@asyncapi/parser": "^3.0.0-next-major-spec.3", "@asyncapi/protobuf-schema-parser": "3.0.0", "highlight.js": "^10.7.2", "isomorphic-dompurify": "^0.13.0", @@ -35244,9 +35164,9 @@ }, "dependencies": { "@asyncapi/parser": { - "version": "3.0.0-next-major-spec.1", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.1.tgz", - "integrity": "sha512-nzXwirVYyV8iCmHo4Rhzp1d3NQwOfN6/A3VgplQaKokTuaNcQdbW9c0RrM0f5MGYvAVGF/Uz1E2fWyRF3r/aoQ==", + "version": "3.0.0-next-major-spec.3", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.3.tgz", + "integrity": "sha512-LCrAQqJpGxraMyU2k1Nh1X6Q1dz7a/YhTRRFFrQHOEo+TUT/kRdoUkRDP++e58dO7h9MBN+/hZK5TaqE+/jQiw==", "requires": { "@asyncapi/specs": "^6.0.0-next-major-spec.6", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", @@ -35268,9 +35188,9 @@ } }, "@asyncapi/specs": { - "version": "6.0.0-next-major-spec.6", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0-next-major-spec.6.tgz", - "integrity": "sha512-xYiXZetKiAZgZoh2q/sxt+Ceg8bLTK/WSCwtLvlH7JgnjpnOEtCDwKszijmmOJEYdGVSrj0OFXLPrg/dm4JANw==", + "version": "6.0.0-next-major-spec.8", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0-next-major-spec.8.tgz", + "integrity": "sha512-WVhzeJepkqO6abDprz9bk9zR/ESidanQncPP7jFRUJQ71ED4/XQMjaSKLE5MB09eUUZoY5EqoccUQJWfc54SMg==", "requires": { "@types/json-schema": "^7.0.11" } @@ -35289,25 +35209,6 @@ "@types/json-schema": "^7.0.7", "json-pointer": "0.6.2" } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } } } }, @@ -35333,9 +35234,9 @@ "@asyncapi/nodejs-template": "^1.0.0", "@asyncapi/nodejs-ws-template": "^0.9.33", "@asyncapi/openapi-schema-parser": "^3.0.4", - "@asyncapi/parser": "^3.0.0-next-major-spec.2", + "@asyncapi/parser": "^3.0.0-next-major-spec.3", "@asyncapi/python-paho-template": "^0.2.13", - "@asyncapi/react-component": "^1.0.0-next.54", + "@asyncapi/react-component": "^1.0.2", "@asyncapi/specs": "^6.0.0-next-major-spec.6", "@asyncapi/ts-nats-template": "^0.10.3", "@craco/craco": "^7.1.0", @@ -35395,9 +35296,9 @@ }, "dependencies": { "@asyncapi/parser": { - "version": "3.0.0-next-major-spec.2", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.2.tgz", - "integrity": "sha512-/gJgCYNYlUSDJhySK3IagjiyFfnwEsAZd5rTe396CB+HxJ6yDWDOZYdHzkFgU2RnCULSGzVOWZGx8t3PK+yuVg==", + "version": "3.0.0-next-major-spec.3", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.3.tgz", + "integrity": "sha512-LCrAQqJpGxraMyU2k1Nh1X6Q1dz7a/YhTRRFFrQHOEo+TUT/kRdoUkRDP++e58dO7h9MBN+/hZK5TaqE+/jQiw==", "requires": { "@asyncapi/specs": "^6.0.0-next-major-spec.6", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", @@ -35557,22 +35458,9 @@ "has-flag": "^4.0.0" } }, - "tr46": { - "version": "0.0.3" - }, "web-vitals": { "version": "3.3.2", "dev": true - }, - "webidl-conversions": { - "version": "3.0.1" - }, - "whatwg-url": { - "version": "5.0.0", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } } } }, @@ -44425,22 +44313,6 @@ "requires": { "whatwg-url": "^5.0.0" } - }, - "tr46": { - "version": "0.0.3", - "dev": true - }, - "webidl-conversions": { - "version": "3.0.1", - "dev": true - }, - "whatwg-url": { - "version": "5.0.0", - "dev": true, - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } } } }, @@ -51222,21 +51094,6 @@ "version": "2.6.11", "requires": { "whatwg-url": "^5.0.0" - }, - "dependencies": { - "tr46": { - "version": "0.0.3" - }, - "webidl-conversions": { - "version": "3.0.1" - }, - "whatwg-url": { - "version": "5.0.0", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - } } }, "node-fetch-native": { @@ -56184,6 +56041,27 @@ "whatwg-mimetype": { "version": "2.3.0" }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + }, + "dependencies": { + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + } + } + }, "which": { "version": "2.0.2", "requires": {