diff --git a/src/uix/eidos/components/words/words-activate.svelte b/src/uix/eidos/components/words/words-activate.svelte index 8b1810e19..168e06d93 100644 --- a/src/uix/eidos/components/words/words-activate.svelte +++ b/src/uix/eidos/components/words/words-activate.svelte @@ -28,11 +28,15 @@ let { api, content, - dom + dom, + enabled = true }: { api: ProviderSnippetProps; content: HTMLElement; dom: ActiveDom; + /** When false (preview / read-only) block activation is off: no + * click-to-select and the active-block outline is cleared. */ + enabled?: boolean; } = $props(); // Build the MATERIALIZED-PATH id of the clicked block: walk the DOM up @@ -52,7 +56,7 @@ } $effect(() => { - if (!content) return; + if (!content || !enabled) return; const onPointerDown = (e: Event) => { const target = e.target as HTMLElement | null; if (!target) return; @@ -76,6 +80,7 @@ // are unique, so we match the LAST segment. The segment count is the // nesting depth → `data-words-depth`. $effect(() => { + const on = enabled; // re-run (and clear) when activation is turned off const idPath = api.activeBlockId; // Touch `html` so this effect re-runs after each re-render and // re-stamps the (freshly recreated) element. @@ -88,7 +93,8 @@ prev.removeAttribute('data-words-active'); prev.removeAttribute('data-words-depth'); } - if (!idPath) return; + // Preview / read-only: stamps cleared above, never re-applied. + if (!on || !idPath) return; const segments = idPath.split('/').filter(Boolean); const localId = segments[segments.length - 1]; if (!localId) return; diff --git a/src/uix/eidos/components/words/words-block-gutter.svelte b/src/uix/eidos/components/words/words-block-gutter.svelte index 59d8dd2b8..cd9a717db 100644 --- a/src/uix/eidos/components/words/words-block-gutter.svelte +++ b/src/uix/eidos/components/words/words-block-gutter.svelte @@ -314,11 +314,11 @@ {#if (show || menuOpen) && rect} {#if inGutter || menuOpen} -
+ + {/if}