From 725f15c5fbe654fad6e5b304b15b04c319254efe Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Wed, 30 Nov 2022 22:44:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8A=A0=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/[...slug].js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/[...slug].js b/pages/[...slug].js index 64f3f113..63eb5e51 100644 --- a/pages/[...slug].js +++ b/pages/[...slug].js @@ -21,7 +21,7 @@ const Slug = props => { const router = Router.useRouter() // ๆ–‡็ซ ้”๐Ÿ” - const [lock, setLock] = React.useState(true) + const [lock, setLock] = React.useState(post?.password && post?.password !== '') React.useEffect(() => { if (post?.password && post?.password !== '') { From de6e9b49594026b9e7beb4182b0d60431327ba7e Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Wed, 30 Nov 2022 23:09:12 +0800 Subject: [PATCH 2/3] fix mermaid. --- components/PrismMac.js | 34 ++++++++++++++++------------------ styles/prism-mac-style.css | 5 +++++ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/components/PrismMac.js b/components/PrismMac.js index 2ec44618..1aab0ddc 100644 --- a/components/PrismMac.js +++ b/components/PrismMac.js @@ -55,33 +55,18 @@ function renderPrismMac() { }) } - setTimeout(() => { - // Add pre-mac element for Mac Style UI - if (codeToolBars) { - Array.from(codeToolBars).forEach(item => { - const existPreMac = item.getElementsByClassName('pre-mac') - if (existPreMac.length < codeToolBars.length) { - const preMac = document.createElement('div') - preMac.classList.add('pre-mac') - preMac.innerHTML = '' - item?.appendChild(preMac, item) - } - }) - } - }, 10) - // ๆ”ฏๆŒ Mermaid const mermaids = document.querySelectorAll('.notion-code .language-mermaid') if (mermaids) { for (const e of mermaids) { - e.parentElement.parentElement.classList.remove('code-toolbar') + e.parentElement.classList.remove('code-toolbar') const chart = e.firstChild.textContent if (e.firstElementChild) { - e.parentElement.parentElement.remove() + e.parentElement.remove() continue } if (chart) { - e.parentElement.parentElement.innerHTML = `
${chart}
` + e.parentElement.innerHTML = `
${chart}
` } } } @@ -102,6 +87,19 @@ function renderPrismMac() { } catch (err) { console.log('ไปฃ็ ๆธฒๆŸ“', err) } + + // Add pre-mac element for Mac Style UI + if (codeToolBars) { + Array.from(codeToolBars).forEach(item => { + const existPreMac = item.getElementsByClassName('pre-mac') + if (existPreMac.length < codeToolBars.length) { + const preMac = document.createElement('div') + preMac.classList.add('pre-mac') + preMac.innerHTML = '' + item?.appendChild(preMac, item) + } + }) + } } export default PrismMac diff --git a/styles/prism-mac-style.css b/styles/prism-mac-style.css index 8efcf150..9f2c5098 100644 --- a/styles/prism-mac-style.css +++ b/styles/prism-mac-style.css @@ -67,4 +67,9 @@ pre[class*='language-'] { .notion-code-copy{ display: none; +} + +pre[class*="language-mermaid"] { + background: transparent !important; + @apply dark:bg-gray-200 !important; } \ No newline at end of file From 6f8cc2f25061f5428393e8252bac68e8b0e045ad Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Thu, 1 Dec 2022 09:46:05 +0800 Subject: [PATCH 3/3] V3.6.1 --- .env.local | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.local b/.env.local index 8b04d2c7..48bf046f 100644 --- a/.env.local +++ b/.env.local @@ -1,2 +1,2 @@ # ็Žฏๅขƒๅ˜้‡ @see https://www.nextjs.cn/docs/basic-features/environment-variables -NEXT_PUBLIC_VERSION=3.6.0 \ No newline at end of file +NEXT_PUBLIC_VERSION=3.6.1 \ No newline at end of file diff --git a/package.json b/package.json index bed8a9a4..d111033e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "notion-next", - "version": "3.6.0", + "version": "3.6.1", "homepage": "https://github.com/tangly1024/NotionNext.git", "license": "MIT", "repository": {