diff --git a/bun.lockb b/bun.lockb index c0bfd36..bbcec0f 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 3867916..62fbc22 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^3.1.1", - "svelte": "^5.0.0-next.166", + "svelte": "^5.0.0-next.167", "vite": "^5.3.2" }, "peerDependencies": { diff --git a/src/marker/find-text-ranges.ts b/src/marker/find-text-ranges.ts index 116e955..8ddfc97 100644 --- a/src/marker/find-text-ranges.ts +++ b/src/marker/find-text-ranges.ts @@ -10,9 +10,12 @@ export default function(texts: string[]) { //only text nodes NodeFilter.SHOW_TEXT, //skip blacklisted tags - (node) => - //@ts-ignore - blacklistedTags.includes(node.parentNode?.tagName) || !node.parentNode?.checkVisibility() ? + node => + ( + blacklistedTags.includes((node.parentNode as HTMLElement)?.tagName) || + (node.parentNode as HTMLElement)?.contentEditable == 'true' || + !(node.parentNode as HTMLElement)?.checkVisibility() + ) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT ) diff --git a/src/marker/index.ts b/src/marker/index.ts index 5a267cf..97ff2b1 100644 --- a/src/marker/index.ts +++ b/src/marker/index.ts @@ -32,7 +32,10 @@ export function getCurrentRange(): Range | undefined { if (!selection?.rangeCount) return const range = selection.getRangeAt(0) //ignore contenteditable elements - if (range?.commonAncestorContainer?.parentElement?.hasAttribute('contenteditable')) return + if ( + (range?.commonAncestorContainer?.nodeType == 1 ? range?.commonAncestorContainer as HTMLElement : range?.commonAncestorContainer?.parentElement) + ?.closest('[contenteditable=""], [contenteditable=true]') + ) return return range } diff --git a/src/marker/modern.ts b/src/marker/modern.ts index 1bbba4d..6855275 100644 --- a/src/marker/modern.ts +++ b/src/marker/modern.ts @@ -40,7 +40,7 @@ export function apply(highlights: RaindropHighlight[]) { ::highlight(${cssId}) { all: unset; background-color: color-mix(in srgb, ${colors.get(color!) || color || 'yellow'}, white 60%) !important; - color: color-mix(in srgb, ${colors.get(color!) || color}, black 80%) !important; + color: color-mix(in srgb, ${colors.get(color!) || color || 'yellow'}, black 80%) !important; ${note ? `text-decoration: underline wavy; -webkit-text-decoration: underline wavy;` : ''} text-decoration-thickness: from-font; } diff --git a/src/ui/modal.svelte b/src/ui/modal.svelte index c47786d..efd0a26 100644 --- a/src/ui/modal.svelte +++ b/src/ui/modal.svelte @@ -174,7 +174,6 @@ font-weight: bold; position: sticky; top: 0; - } @supports(animation-timeline: scroll()) { diff --git a/src/ui/toolbar.svelte b/src/ui/toolbar.svelte index 15ea8ef..6b07d7d 100644 --- a/src/ui/toolbar.svelte +++ b/src/ui/toolbar.svelte @@ -297,15 +297,16 @@ display .25s allow-discrete ease-in-out, overlay .25s allow-discrete ease-in-out, box-shadow .25s allow-discrete ease-in-out, - transform .25s allow-discrete ease-in-out, - opacity .25s ease-in-out; + opacity .25s ease-in-out, + left .15s ease-in-out, + top .15s ease-in-out, + right .15s ease-in-out, + bottom .15s ease-in-out; opacity: 0; - transform: translateY(3px); } [open] { opacity: 1; - transform: translateY(0); } dialog:not([open]) { @@ -316,7 +317,6 @@ @starting-style { [open] { opacity: 0; - transform: translateY(-3px); } } \ No newline at end of file diff --git a/test/iframe/embed.html b/test/iframe/embed.html index 9456bf5..88f3ae4 100644 --- a/test/iframe/embed.html +++ b/test/iframe/embed.html @@ -17,7 +17,7 @@

12 Modern CSS One-Line Upgrades | Modern CSS Sometim