diff --git a/README.md b/README.md index 6a39545..1630312 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ export default defineNuxtPlugin(() => { - **Order:** sanitize first, expand/hydrate last. `JournalPostBody` and `JournalCategoryHeader` call `expandEmbeds(renderJournalBody(...))` / `expandEmbeds(sanitizeJournalHtml(...))` and wire `useJournalEmbedHydration`. The payload transforms (`toPostView`, `CategoryPage.vue`) only sanitize, so the SSR payload carries the clean `
` markup. - **SSR static fallback & CLS reservation:** For client-hydrated providers (`component` or `mount`, without `renderSsr`), `expandEmbeds` preserves the SSR fallback `` + `
` intact, adds `journal-embed journal-embed--`, and applies validated `aspect-ratio` / `min-height` inline styles. Before swapping in the hydrated widget on the client, `hydrateEmbedFigure` measures the fallback box height and sets `min-height` to prevent cumulative layout shift (CLS). - **Lazy hydration, `prefers-reduced-motion`, and resilience:** `useJournalEmbedHydration` observes each validated `
` with `IntersectionObserver` (default `rootMargin: '200px'`), passes a reactive `reducedMotion` ref synced with `window.matchMedia('(prefers-reduced-motion: reduce)')`, mounts Vue async components via `createVNode` + `render` inheriting `nuxtApp.vueApp._context` (so i18n, router, and Pinia work inside hydrated embeds) or invokes `mount(el, ctx)`, and cleans up on unmount or HTML updates. If dynamic import or mount throws, the error is caught and the SSR static fallback DOM remains intact. -- **Styles:** `.journal-embed--youtube` and iframe embeds default to a `16 / 9` full-width frame; custom embeds render their fallback image, `
`, and `.journal-embed__stage` naturally, adding `.journal-embed--hydrated` once mounted. +- **Styles:** `.journal-embed--youtube` and iframe embeds default to a `16 / 9` full-width frame; custom embeds render their fallback image, `
`, and `.journal-embed__stage` naturally, adding `.journal-embed--hydrated` once mounted. Inside `.journal-post-body`, `
` / `
`, `
` / ``, table `` / ``, and `