From e3666ecc8c1b503e2ffa754b11384b67b6d0bebe Mon Sep 17 00:00:00 2001 From: SurajTade Date: Sat, 5 Oct 2024 22:24:05 +0530 Subject: [PATCH 1/6] fix:#907: sidebar broken in playground --- library/src/containers/AsyncApi/Layout.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/library/src/containers/AsyncApi/Layout.tsx b/library/src/containers/AsyncApi/Layout.tsx index 5bf6bac3..8f842884 100644 --- a/library/src/containers/AsyncApi/Layout.tsx +++ b/library/src/containers/AsyncApi/Layout.tsx @@ -25,20 +25,12 @@ const AsyncApiLayout: React.FunctionComponent = ({ config, error = null, }) => { - const [observerClassName, setObserverClassName] = useState('container:xl'); - const { ref } = useResizeObserver({ onResize: ({ width }) => { requestAnimationFrame(() => { if (width === undefined) { return; } - - const possibleClassName = - width <= 1280 ? 'container:xl' : 'container:base'; - if (possibleClassName !== observerClassName) { - setObserverClassName(possibleClassName); - } }); }, }); @@ -49,7 +41,7 @@ const AsyncApiLayout: React.FunctionComponent = ({
From 6e2585d72eef51a48a9d5aef891df90aac85ecd2 Mon Sep 17 00:00:00 2001 From: surajTade <101720866+surajTade@users.noreply.github.com> Date: Sat, 5 Oct 2024 22:32:12 +0530 Subject: [PATCH 2/6] removed unused useState import --- library/src/containers/AsyncApi/Layout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/containers/AsyncApi/Layout.tsx b/library/src/containers/AsyncApi/Layout.tsx index 8f842884..39378400 100644 --- a/library/src/containers/AsyncApi/Layout.tsx +++ b/library/src/containers/AsyncApi/Layout.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React from 'react'; import { AsyncAPIDocumentInterface } from '@asyncapi/parser'; import useResizeObserver from 'use-resize-observer'; From 06b669111f698e65f17c1e7d7946f71ba5d7c842 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 03:18:38 +0200 Subject: [PATCH 3/6] chore(deps): bump next from 14.1.1 to 14.2.10 (#1047) --- package-lock.json | 112 ++++++++++++++++++++++------------------ playground/package.json | 2 +- 2 files changed, 62 insertions(+), 52 deletions(-) diff --git a/package-lock.json b/package-lock.json index 582e88a9..6571612b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3554,9 +3554,9 @@ } }, "node_modules/@next/env": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.1.1.tgz", - "integrity": "sha512-7CnQyD5G8shHxQIIg3c7/pSeYFeMhsNbpU/bmvH7ZnDql7mNRgg8O2JZrhrc/soFnfBnKP4/xXNiiSIPn2w8gA==" + "version": "14.2.10", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.10.tgz", + "integrity": "sha512-dZIu93Bf5LUtluBXIv4woQw2cZVZ2DJTjax5/5DOs3lzEOeKLy7GxRSr4caK9/SCPdaW6bCgpye6+n4Dh9oJPw==" }, "node_modules/@next/eslint-plugin-next": { "version": "14.2.2", @@ -3568,9 +3568,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.1.1.tgz", - "integrity": "sha512-yDjSFKQKTIjyT7cFv+DqQfW5jsD+tVxXTckSe1KIouKk75t1qZmj/mV3wzdmFb0XHVGtyRjDMulfVG8uCKemOQ==", + "version": "14.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.10.tgz", + "integrity": "sha512-V3z10NV+cvMAfxQUMhKgfQnPbjw+Ew3cnr64b0lr8MDiBJs3eLnM6RpGC46nhfMZsiXgQngCJKWGTC/yDcgrDQ==", "cpu": [ "arm64" ], @@ -3583,9 +3583,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.1.tgz", - "integrity": "sha512-KCQmBL0CmFmN8D64FHIZVD9I4ugQsDBBEJKiblXGgwn7wBCSe8N4Dx47sdzl4JAg39IkSN5NNrr8AniXLMb3aw==", + "version": "14.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.10.tgz", + "integrity": "sha512-Y0TC+FXbFUQ2MQgimJ/7Ina2mXIKhE7F+GUe1SgnzRmwFY3hX2z8nyVCxE82I2RicspdkZnSWMn4oTjIKz4uzA==", "cpu": [ "x64" ], @@ -3598,9 +3598,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.1.tgz", - "integrity": "sha512-YDQfbWyW0JMKhJf/T4eyFr4b3tceTorQ5w2n7I0mNVTFOvu6CGEzfwT3RSAQGTi/FFMTFcuspPec/7dFHuP7Eg==", + "version": "14.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.10.tgz", + "integrity": "sha512-ZfQ7yOy5zyskSj9rFpa0Yd7gkrBnJTkYVSya95hX3zeBG9E55Z6OTNPn1j2BTFWvOVVj65C3T+qsjOyVI9DQpA==", "cpu": [ "arm64" ], @@ -3613,9 +3613,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.1.tgz", - "integrity": "sha512-fiuN/OG6sNGRN/bRFxRvV5LyzLB8gaL8cbDH5o3mEiVwfcMzyE5T//ilMmaTrnA8HLMS6hoz4cHOu6Qcp9vxgQ==", + "version": "14.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.10.tgz", + "integrity": "sha512-n2i5o3y2jpBfXFRxDREr342BGIQCJbdAUi/K4q6Env3aSx8erM9VuKXHw5KNROK9ejFSPf0LhoSkU/ZiNdacpQ==", "cpu": [ "arm64" ], @@ -3628,9 +3628,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.1.tgz", - "integrity": "sha512-rv6AAdEXoezjbdfp3ouMuVqeLjE1Bin0AuE6qxE6V9g3Giz5/R3xpocHoAi7CufRR+lnkuUjRBn05SYJ83oKNQ==", + "version": "14.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.10.tgz", + "integrity": "sha512-GXvajAWh2woTT0GKEDlkVhFNxhJS/XdDmrVHrPOA83pLzlGPQnixqxD8u3bBB9oATBKB//5e4vpACnx5Vaxdqg==", "cpu": [ "x64" ], @@ -3643,9 +3643,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.1.tgz", - "integrity": "sha512-YAZLGsaNeChSrpz/G7MxO3TIBLaMN8QWMr3X8bt6rCvKovwU7GqQlDu99WdvF33kI8ZahvcdbFsy4jAFzFX7og==", + "version": "14.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.10.tgz", + "integrity": "sha512-opFFN5B0SnO+HTz4Wq4HaylXGFV+iHrVxd3YvREUX9K+xfc4ePbRrxqOuPOFjtSuiVouwe6uLeDtabjEIbkmDA==", "cpu": [ "x64" ], @@ -3658,9 +3658,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.1.tgz", - "integrity": "sha512-1L4mUYPBMvVDMZg1inUYyPvFSduot0g73hgfD9CODgbr4xiTYe0VOMTZzaRqYJYBA9mana0x4eaAaypmWo1r5A==", + "version": "14.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.10.tgz", + "integrity": "sha512-9NUzZuR8WiXTvv+EiU/MXdcQ1XUvFixbLIMNQiVHuzs7ZIFrJDLJDaOF1KaqttoTujpcxljM/RNAOmw1GhPPQQ==", "cpu": [ "arm64" ], @@ -3673,9 +3673,9 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.1.tgz", - "integrity": "sha512-jvIE9tsuj9vpbbXlR5YxrghRfMuG0Qm/nZ/1KDHc+y6FpnZ/apsgh+G6t15vefU0zp3WSpTMIdXRUsNl/7RSuw==", + "version": "14.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.10.tgz", + "integrity": "sha512-fr3aEbSd1GeW3YUMBkWAu4hcdjZ6g4NBl1uku4gAn661tcxd1bHs1THWYzdsbTRLcCKLjrDZlNp6j2HTfrw+Bg==", "cpu": [ "ia32" ], @@ -3688,9 +3688,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.1.tgz", - "integrity": "sha512-S6K6EHDU5+1KrBDLko7/c1MNy/Ya73pIAmvKeFwsF4RmBFJSO7/7YeD4FnZ4iBdzE69PpQ4sOMU9ORKeNuxe8A==", + "version": "14.2.10", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.10.tgz", + "integrity": "sha512-UjeVoRGKNL2zfbcQ6fscmgjBAS/inHBh63mjIlfPg/NG8Yn2ztqylXt5qilYb6hoHIwaU2ogHknHWWmahJjgZQ==", "cpu": [ "x64" ], @@ -5049,18 +5049,24 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/@swc/counter": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==" + }, "node_modules/@swc/helpers": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz", - "integrity": "sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.5.tgz", + "integrity": "sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==", "dependencies": { + "@swc/counter": "^0.1.3", "tslib": "^2.4.0" } }, "node_modules/@swc/helpers/node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" }, "node_modules/@tailwindcss/typography": { "version": "0.4.1", @@ -17804,12 +17810,12 @@ "dev": true }, "node_modules/next": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/next/-/next-14.1.1.tgz", - "integrity": "sha512-McrGJqlGSHeaz2yTRPkEucxQKe5Zq7uPwyeHNmJaZNY4wx9E9QdxmTp310agFRoMuIYgQrCrT3petg13fSVOww==", + "version": "14.2.10", + "resolved": "https://registry.npmjs.org/next/-/next-14.2.10.tgz", + "integrity": "sha512-sDDExXnh33cY3RkS9JuFEKaS4HmlWmDKP1VJioucCG6z5KuA008DPsDZOzi8UfqEk3Ii+2NCQSJrfbEWtZZfww==", "dependencies": { - "@next/env": "14.1.1", - "@swc/helpers": "0.5.2", + "@next/env": "14.2.10", + "@swc/helpers": "0.5.5", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", "graceful-fs": "^4.2.11", @@ -17823,18 +17829,19 @@ "node": ">=18.17.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "14.1.1", - "@next/swc-darwin-x64": "14.1.1", - "@next/swc-linux-arm64-gnu": "14.1.1", - "@next/swc-linux-arm64-musl": "14.1.1", - "@next/swc-linux-x64-gnu": "14.1.1", - "@next/swc-linux-x64-musl": "14.1.1", - "@next/swc-win32-arm64-msvc": "14.1.1", - "@next/swc-win32-ia32-msvc": "14.1.1", - "@next/swc-win32-x64-msvc": "14.1.1" + "@next/swc-darwin-arm64": "14.2.10", + "@next/swc-darwin-x64": "14.2.10", + "@next/swc-linux-arm64-gnu": "14.2.10", + "@next/swc-linux-arm64-musl": "14.2.10", + "@next/swc-linux-x64-gnu": "14.2.10", + "@next/swc-linux-x64-musl": "14.2.10", + "@next/swc-win32-arm64-msvc": "14.2.10", + "@next/swc-win32-ia32-msvc": "14.2.10", + "@next/swc-win32-x64-msvc": "14.2.10" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.41.2", "react": "^18.2.0", "react-dom": "^18.2.0", "sass": "^1.3.0" @@ -17843,6 +17850,9 @@ "@opentelemetry/api": { "optional": true }, + "@playwright/test": { + "optional": true + }, "sass": { "optional": true } @@ -27468,7 +27478,7 @@ "@codemirror/lang-yaml": "^6.0.0", "@uiw/codemirror-theme-material": "^4.21.24", "@uiw/react-codemirror": "^4.21.24", - "next": "14.1.1", + "next": "14.2.10", "react": "^18", "react-dom": "^18", "react-split": "^2.0.14", diff --git a/playground/package.json b/playground/package.json index 33ed03e0..5c367a0a 100644 --- a/playground/package.json +++ b/playground/package.json @@ -10,7 +10,7 @@ "@codemirror/lang-yaml": "^6.0.0", "@uiw/codemirror-theme-material": "^4.21.24", "@uiw/react-codemirror": "^4.21.24", - "next": "14.1.1", + "next": "14.2.10", "react": "^18", "react-dom": "^18", "react-split": "^2.0.14", From 5ffc2a39dc25164ba1ed559f6faad4ca7541f51e Mon Sep 17 00:00:00 2001 From: SurajTade Date: Wed, 9 Oct 2024 20:51:19 +0530 Subject: [PATCH 4/6] applied suggested changes to sidebar broken --- library/src/containers/Sidebar/Sidebar.tsx | 2 +- library/src/styles/default.css | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/library/src/containers/Sidebar/Sidebar.tsx b/library/src/containers/Sidebar/Sidebar.tsx index a834a2b4..ac94278d 100644 --- a/library/src/containers/Sidebar/Sidebar.tsx +++ b/library/src/containers/Sidebar/Sidebar.tsx @@ -119,7 +119,7 @@ export const Sidebar: React.FunctionComponent = () => { >
diff --git a/library/src/styles/default.css b/library/src/styles/default.css index d8201088..702a73d1 100644 --- a/library/src/styles/default.css +++ b/library/src/styles/default.css @@ -13,15 +13,20 @@ @apply lg:relative lg:block lg:w-64 lg:h-auto; } + .container\:xl .sidebar--wrapper{ + @apply xl:w-full + @apply sm:w-full + } + .container\:base .sidebar--content { @apply lg:w-56; } - .container\:xl .sidebar--content { + /* .container\:xl .sidebar--content { @apply absolute; left: 50%; transform: translate(-50%, 0); - } + } */ .container\:base .panel-item { @apply 2xl:flex; From 96d91591520c453119822408620da66240e8d062 Mon Sep 17 00:00:00 2001 From: SurajTade Date: Wed, 9 Oct 2024 20:57:09 +0530 Subject: [PATCH 5/6] applied suggested changes to sidebar broken --- library/src/containers/Sidebar/Sidebar.tsx | 2 +- library/src/styles/default.css | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/library/src/containers/Sidebar/Sidebar.tsx b/library/src/containers/Sidebar/Sidebar.tsx index a834a2b4..ac94278d 100644 --- a/library/src/containers/Sidebar/Sidebar.tsx +++ b/library/src/containers/Sidebar/Sidebar.tsx @@ -119,7 +119,7 @@ export const Sidebar: React.FunctionComponent = () => { >
diff --git a/library/src/styles/default.css b/library/src/styles/default.css index d8201088..9bff2ab9 100644 --- a/library/src/styles/default.css +++ b/library/src/styles/default.css @@ -13,15 +13,20 @@ @apply lg:relative lg:block lg:w-64 lg:h-auto; } + .container\:xl .sidebar--wrapper{ + @apply xl:w-full + @apply sm:w-full + } + .container\:base .sidebar--content { @apply lg:w-56; } - .container\:xl .sidebar--content { + /*.container\:xl .sidebar--content { @apply absolute; left: 50%; transform: translate(-50%, 0); - } + }*/ .container\:base .panel-item { @apply 2xl:flex; From 2a2219799fb31767a26ab7e2c7c7458b614794f4 Mon Sep 17 00:00:00 2001 From: acethecreator Date: Mon, 14 Oct 2024 14:02:10 +0100 Subject: [PATCH 6/6] undo layout file changes --- library/src/containers/AsyncApi/Layout.tsx | 12 ++++++++++-- library/src/styles/default.css | 9 ++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/library/src/containers/AsyncApi/Layout.tsx b/library/src/containers/AsyncApi/Layout.tsx index 39378400..5bf6bac3 100644 --- a/library/src/containers/AsyncApi/Layout.tsx +++ b/library/src/containers/AsyncApi/Layout.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useState } from 'react'; import { AsyncAPIDocumentInterface } from '@asyncapi/parser'; import useResizeObserver from 'use-resize-observer'; @@ -25,12 +25,20 @@ const AsyncApiLayout: React.FunctionComponent = ({ config, error = null, }) => { + const [observerClassName, setObserverClassName] = useState('container:xl'); + const { ref } = useResizeObserver({ onResize: ({ width }) => { requestAnimationFrame(() => { if (width === undefined) { return; } + + const possibleClassName = + width <= 1280 ? 'container:xl' : 'container:base'; + if (possibleClassName !== observerClassName) { + setObserverClassName(possibleClassName); + } }); }, }); @@ -41,7 +49,7 @@ const AsyncApiLayout: React.FunctionComponent = ({
diff --git a/library/src/styles/default.css b/library/src/styles/default.css index b75d40aa..75e8f4ef 100644 --- a/library/src/styles/default.css +++ b/library/src/styles/default.css @@ -14,13 +14,8 @@ } .container\:xl .sidebar--wrapper{ - @apply xl:w-full - @apply sm:w-full - } - - .container\:xl .sidebar--wrapper{ - @apply xl:w-full - @apply sm:w-full + @apply xl:w-full; + @apply sm:w-full; } .container\:base .sidebar--content {