From 80ea06be287815fcbf4c56347cf6661cdaebeb82 Mon Sep 17 00:00:00 2001 From: Bobby Kolev Date: Fri, 20 Dec 2024 15:53:58 +0200 Subject: [PATCH 1/4] 0.0.2 (#23) --- package-lock.json | 4 ++-- package.json | 32 +------------------------------- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4d256bf..a83a672 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@alkemio/documentation", - "version": "0.0.1", + "version": "0.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@alkemio/documentation", - "version": "0.0.1", + "version": "0.0.2", "license": "EUPL-1.2", "dependencies": { "next": "^14.2.5", diff --git a/package.json b/package.json index e457885..a14c60f 100644 --- a/package.json +++ b/package.json @@ -1,31 +1 @@ -{ - "name": "@alkemio/documentation", - "version": "0.0.1", - "description": "Alkemio platform documentation", - "author": "Alkemio Foundation", - "repository": { - "type": "git", - "url": "https://github.com/alkem-io/documentation" - }, - "license": "EUPL-1.2", - "scripts": { - "dev": "next -p 3010", - "build": "next build", - "start": "next start -p 3010", - "export": "next export" - }, - "dependencies": { - "next": "^14.2.5", - "nextra": "^2.13.4", - "nextra-theme-docs": "^2.13.4", - "react": "^18.3.1", - "react-dom": "^18.3.1" - }, - "engines": { - "node": ">=20.9.0", - "npm": ">=10" - }, - "volta": { - "node": "20.13.1" - } -} +{"name":"@alkemio/documentation","version":"0.0.2","description":"Alkemio platform documentation","author":"Alkemio Foundation","repository":{"type":"git","url":"https://github.com/alkem-io/documentation"},"license":"EUPL-1.2","scripts":{"dev":"next -p 3010","build":"next build","start":"next start -p 3010","export":"next export"},"dependencies":{"next":"^14.2.5","nextra":"^2.13.4","nextra-theme-docs":"^2.13.4","react":"^18.3.1","react-dom":"^18.3.1"},"engines":{"node":">=20.9.0","npm":">=10"},"volta":{"node":"20.13.1"}} \ No newline at end of file From be5c63010b28f7a71fcd97adbf6051e49b867398 Mon Sep 17 00:00:00 2001 From: Francesco Date: Mon, 13 Jan 2025 11:23:00 +0100 Subject: [PATCH 2/4] typed a space in community-management.en --- pages/features/community-management.en-US.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/features/community-management.en-US.mdx b/pages/features/community-management.en-US.mdx index 6010d54..44fe55f 100644 --- a/pages/features/community-management.en-US.mdx +++ b/pages/features/community-management.en-US.mdx @@ -12,7 +12,7 @@ If you haven't yet, make sure to [set up your space first](/getting-started/crea ## Features for Community Management -You have rallied the community into one place. Now what? +You have rallied the community into one place. Now what? Besides some descriptive information, it is key to engage and guide your community when they land on the platform. **Three key functionalities** that can help you with this are the following: From 23c8276bd4878c08fab76b0c62620d1e7b521276 Mon Sep 17 00:00:00 2001 From: Francesco Date: Mon, 13 Jan 2025 13:24:17 +0100 Subject: [PATCH 3/4] 0.0.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a83a672..10de902 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@alkemio/documentation", - "version": "0.0.2", + "version": "0.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@alkemio/documentation", - "version": "0.0.2", + "version": "0.0.3", "license": "EUPL-1.2", "dependencies": { "next": "^14.2.5", diff --git a/package.json b/package.json index a14c60f..c0a08fc 100644 --- a/package.json +++ b/package.json @@ -1 +1 @@ -{"name":"@alkemio/documentation","version":"0.0.2","description":"Alkemio platform documentation","author":"Alkemio Foundation","repository":{"type":"git","url":"https://github.com/alkem-io/documentation"},"license":"EUPL-1.2","scripts":{"dev":"next -p 3010","build":"next build","start":"next start -p 3010","export":"next export"},"dependencies":{"next":"^14.2.5","nextra":"^2.13.4","nextra-theme-docs":"^2.13.4","react":"^18.3.1","react-dom":"^18.3.1"},"engines":{"node":">=20.9.0","npm":">=10"},"volta":{"node":"20.13.1"}} \ No newline at end of file +{"name":"@alkemio/documentation","version":"0.0.3","description":"Alkemio platform documentation","author":"Alkemio Foundation","repository":{"type":"git","url":"https://github.com/alkem-io/documentation"},"license":"EUPL-1.2","scripts":{"dev":"next -p 3010","build":"next build","start":"next start -p 3010","export":"next export"},"dependencies":{"next":"^14.2.5","nextra":"^2.13.4","nextra-theme-docs":"^2.13.4","react":"^18.3.1","react-dom":"^18.3.1"},"engines":{"node":">=20.9.0","npm":">=10"},"volta":{"node":"20.13.1"}} \ No newline at end of file From a5b266fef1f0556e695d1cd33628f1f6182106cb Mon Sep 17 00:00:00 2001 From: Bobby Kolev Date: Tue, 11 Feb 2025 16:27:46 +0200 Subject: [PATCH 4/4] Revert back the full page scroll logic + fix infinite scroll updates (#45) * Revert back to no internal scroll. * 0.1.1 * Bump the update height threshold * Bump the update height threshold --- components/iframeCommunication.js | 9 +++++--- package-lock.json | 4 ++-- package.json | 2 +- pages/_app.js | 11 +++++----- styles.css | 34 +------------------------------ 5 files changed, 15 insertions(+), 45 deletions(-) diff --git a/components/iframeCommunication.js b/components/iframeCommunication.js index 4ce025f..8db9c78 100644 --- a/components/iframeCommunication.js +++ b/components/iframeCommunication.js @@ -1,6 +1,8 @@ import { useEffect, useRef } from 'react'; import { useRouter } from 'next/router'; +const HEIGHT_DIFFERENCE_THRESHOLD = 130; // ~30 locally and 122 on Sandbox (Donna PC) + const allowedOrigins = ['https://alkem.io', 'https://dev-alkem.io', 'https://acc-alkem.io', 'https://sandbox-alkem.io', 'http://localhost:3000']; const isOriginValid = (origin) => allowedOrigins.includes(origin); @@ -40,14 +42,16 @@ const IframeCommunication = () => { const sendPageHeight = () => { const pageHeight = document.documentElement.scrollHeight || document.body.scrollHeight; + console.log('Scroll change new/old: ', pageHeight, lastHeight.current); // Only send if there's a meaningful difference in height - if (Math.abs(pageHeight - lastHeight.current) > 40) { + if (Math.abs(pageHeight - lastHeight.current) > HEIGHT_DIFFERENCE_THRESHOLD) { lastHeight.current = pageHeight; // Debounce the message to avoid excessive calls clearTimeout(debounceTimeout.current); debounceTimeout.current = setTimeout(() => { + console.log('Scroll change SENT: ', pageHeight, lastHeight.current); sendMessageToParent({ type: SupportedMessageTypes.PageHeight, height: pageHeight }); }, 50); } @@ -55,9 +59,8 @@ const IframeCommunication = () => { useEffect(() => { - // Send initial page height and path + // Send path sendMessageToParent({ type: SupportedMessageTypes.PageChange, url: router.pathname }); - sendPageHeight(); // Observe changes to the body size const resizeObserver = new ResizeObserver(sendPageHeight); diff --git a/package-lock.json b/package-lock.json index b45f2f2..3eb45d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@alkemio/documentation", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@alkemio/documentation", - "version": "0.1.0", + "version": "0.1.1", "license": "EUPL-1.2", "dependencies": { "next": "^14.2.5", diff --git a/package.json b/package.json index 463be9f..f01b079 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@alkemio/documentation", - "version": "0.1.0", + "version": "0.1.1", "description": "Alkemio platform documentation", "author": "Alkemio Foundation", "repository": { diff --git a/pages/_app.js b/pages/_app.js index 99049f1..8a9ba4e 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -4,12 +4,11 @@ import IframeCommunication from '../components/iframeCommunication'; export default function MyApp({ Component, pageProps }) { useEffect(() => { - if (typeof window === 'undefined') return; - if (window.self !== window.top) { - document.body.classList.add("in-iframe"); - } else { - document.body.classList.remove("in-iframe"); - } + try { + if (window.self === window.top) { + document.body.classList.add("not-in-iframe"); + } + } catch (e) {} }, []); return ( diff --git a/styles.css b/styles.css index 3eae42b..15851b3 100644 --- a/styles.css +++ b/styles.css @@ -1,43 +1,11 @@ -html, body { - height: 100vh; - max-height: 100vh; - overflow: hidden; -} - body { font-family: 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; overflow-y: hidden; } -body:not(.in-iframe) { +body.not-in-iframe { overflow-y: auto; } -.main-content { - flex: 1; - height: 100%; - max-height: 100vh; - overflow-y: auto; /* Zorgt ervoor dat de inhoud in de iframe kan scrollen */ - padding: 20px; - background: white; -} - -iframe { - width: 100%; - height: 100vh !important; /* Zorgt dat de iframe altijd de volle hoogte krijgt */ - overflow-y: auto !important; /* Voorkomt dat de iframe-inhoud wordt afgesneden */ - border: none; -} - -body.in-iframe { - overflow-y: auto !important; - height: auto !important; - max-height: 100vh !important; -} -body.in-iframe .main-content { - overflow-y: auto !important; - height: auto !important; - max-height: 100vh !important; -}