From a7ca15e5cc852546369d1706f624a775163aa05a Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Fri, 18 Oct 2024 12:23:24 +0800 Subject: feat: test on prosemirror.net --- addon/index.mjs | 1 + addon/manifest.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addon/index.mjs b/addon/index.mjs index d138775..5776a18 100644 --- a/addon/index.mjs +++ b/addon/index.mjs @@ -15,6 +15,7 @@ const blockSelectors = { 'developer.mozilla': '.section-content', 'hackmd.io': '#doc > *', 'www.ptt.cc': '#main-content > span', + 'prosemirror.net': '.ProseMirror > *', } const blockSelector = blockSelectors[url.host] diff --git a/addon/manifest.json b/addon/manifest.json index 93b0b65..b95fd4b 100644 --- a/addon/manifest.json +++ b/addon/manifest.json @@ -14,7 +14,8 @@ "matches": [ "*://developer.mozilla.org/*", "*://hackmd.io/*", - "*://*.ptt.cc/*" + "*://*.ptt.cc/*", + "https://prosemirror.net/examples/*" ], "js": [ "dumbymap.mjs", -- cgit v1.2.3-70-g09d2 From 64a767d64d9dd573742f8d620a92736156072b1b Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Fri, 18 Oct 2024 12:23:51 +0800 Subject: fix: visibility of overlay layout --- src/css/dumbymap.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/css/dumbymap.css b/src/css/dumbymap.css index 53f00ce..b2c5d9b 100644 --- a/src/css/dumbymap.css +++ b/src/css/dumbymap.css @@ -708,13 +708,13 @@ root { } .Showcase { - z-index: 0; + z-index: 1; } .SemanticHtml { pointer-events: none; - z-index: 1; + z-index: 2; } } -- cgit v1.2.3-70-g09d2 From f76555b48a3f6c1956c933e9421cf4aba704fb21 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Fri, 18 Oct 2024 12:24:12 +0800 Subject: feat: improve default selector for htmlHolder --- src/dumbymap.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dumbymap.mjs b/src/dumbymap.mjs index 2879319..1b7c685 100644 --- a/src/dumbymap.mjs +++ b/src/dumbymap.mjs @@ -171,8 +171,8 @@ export const generateMaps = (container, { delete container.dataset.layout /** Prepare Semantic HTML part and blocks of contents inside */ - const htmlHolder = container.querySelector('.SemanticHtml') ?? - Array.from(container.children).find(e => e.id?.includes('main') || e.className.includes('main')) ?? + const htmlHolder = container.querySelector('.SemanticHtml, main, :scope > article') ?? + Array.from(container.children).find(e => e.id?.includes('main') || e.className?.includes?.('main')) ?? Array.from(container.children).sort((a, b) => a.textContent.length < b.textContent.length).at(0) htmlHolder.classList.add('SemanticHtml') -- cgit v1.2.3-70-g09d2