@takazudo/zfb-runtime 0.1.0-next.8 → 0.1.0-next.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +220 -15
  3. package/dist/client-router/events.d.ts +0 -1
  4. package/dist/client-router/events.js +2 -2
  5. package/dist/client-router/events.js.map +1 -1
  6. package/dist/client-router/index.d.ts +2 -3
  7. package/dist/client-router/index.js +2 -2
  8. package/dist/client-router/index.js.map +1 -1
  9. package/dist/client-router/prefetch.d.ts +0 -1
  10. package/dist/client-router/prefetch.js +126 -53
  11. package/dist/client-router/prefetch.js.map +1 -1
  12. package/dist/client-router/router.d.ts +28 -2
  13. package/dist/client-router/router.js +364 -30
  14. package/dist/client-router/router.js.map +1 -1
  15. package/dist/client-router/swap-functions.d.ts +0 -1
  16. package/dist/client-router/swap-functions.js +71 -11
  17. package/dist/client-router/swap-functions.js.map +1 -1
  18. package/dist/client-router/types.d.ts +4 -1
  19. package/dist/client-router/types.js.map +1 -1
  20. package/dist/client-router.d.ts +38 -2
  21. package/dist/client-router.js +56 -20
  22. package/dist/client-router.js.map +1 -1
  23. package/dist/framework.d.ts +0 -1
  24. package/dist/framework.js.map +1 -1
  25. package/dist/index.d.ts +2 -4
  26. package/dist/index.js +13 -4
  27. package/dist/index.js.map +1 -1
  28. package/dist/router.d.ts +32 -2
  29. package/dist/router.js +192 -33
  30. package/dist/router.js.map +1 -1
  31. package/dist/server.d.ts +2 -0
  32. package/dist/server.js +14 -0
  33. package/dist/server.js.map +1 -0
  34. package/dist/snapshot.d.ts +0 -1
  35. package/dist/snapshot.js +3 -2
  36. package/dist/snapshot.js.map +1 -1
  37. package/dist/view-transitions.d.ts +0 -1
  38. package/dist/view-transitions.js.map +1 -1
  39. package/package.json +26 -4
  40. package/dist/client-router/cssesc.d.ts +0 -9
  41. package/dist/client-router/cssesc.d.ts.map +0 -1
  42. package/dist/client-router/cssesc.js +0 -95
  43. package/dist/client-router/cssesc.js.map +0 -1
  44. package/dist/client-router/events.d.ts.map +0 -1
  45. package/dist/client-router/index.d.ts.map +0 -1
  46. package/dist/client-router/prefetch.d.ts.map +0 -1
  47. package/dist/client-router/router.d.ts.map +0 -1
  48. package/dist/client-router/swap-functions.d.ts.map +0 -1
  49. package/dist/client-router/types.d.ts.map +0 -1
  50. package/dist/client-router.d.ts.map +0 -1
  51. package/dist/framework.d.ts.map +0 -1
  52. package/dist/index.d.ts.map +0 -1
  53. package/dist/router.d.ts.map +0 -1
  54. package/dist/snapshot.d.ts.map +0 -1
  55. package/dist/view-transitions.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/client-router/router.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,oCAAoC;AACpC,2EAA2E;AAC3E,0GAA0G;AAC1G,0EAA0E;AAC1E,EAAE;AACF,oCAAoC;AACpC,wCAAwC;AACxC,6CAA6C;AAC7C,yDAAyD;AACzD,uDAAuD;AACvD,kDAAkD;AAClD,qDAAqD;AACrD,mDAAmD;AACnD,EAAE;AACF,0BAA0B;AAC1B,0FAA0F;AAC1F,sEAAsE;AACtE,qFAAqF;AACrF,qFAAqF;AACrF,sEAAsE;AACtE,iFAAiF;AACjF,4EAA4E;AAC5E,qFAAqF;AACrF,uFAAuF;AACvF,4DAA4D;AAC5D,mEAAmE;AACnE,EAAE;AACF,8BAA8B;AAC9B,iCAAiC;AACjC,mCAAmC;AACnC,mFAAmF;AACnF,iFAAiF;AACjF,sEAAsE;AACtE,EAAE;AACF,yBAAyB;AACzB,mDAAmD;AACnD,8BAA8B;AAE9B,OAAO,EACL,aAAa,EACb,MAAM,EACN,UAAU,EACV,YAAY,EACZ,oBAAoB,GAErB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,8EAA8E;AAC9E,0EAA0E;AAC1E,yEAAyE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;IACxB,WAAW,GAAG,IAAI,CAAC;IAEnB,IAAI,CAAC,SAAS;QAAE,OAAO;IACvB,IAAI,CAAC,uBAAuB,IAAI,WAAW,EAAE,KAAK,MAAM;QAAE,OAAO;IAEjE,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAChD,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAA6B,CAAC,CAAC;IAEnE,oGAAoG;IACpG,wDAAwD;AAC1D,CAAC"}
1
+ {"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/client-router/router.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,oCAAoC;AACpC,2EAA2E;AAC3E,0GAA0G;AAC1G,0EAA0E;AAC1E,EAAE;AACF,oCAAoC;AACpC,wCAAwC;AACxC,6CAA6C;AAC7C,yDAAyD;AACzD,uDAAuD;AACvD,kDAAkD;AAClD,qDAAqD;AACrD,mDAAmD;AACnD,EAAE;AACF,0BAA0B;AAC1B,0FAA0F;AAC1F,sEAAsE;AACtE,qFAAqF;AACrF,qFAAqF;AACrF,sEAAsE;AACtE,iFAAiF;AACjF,4EAA4E;AAC5E,qFAAqF;AACrF,uFAAuF;AACvF,4DAA4D;AAC5D,wFAAwF;AACxF,yFAAyF;AACzF,EAAE;AACF,8BAA8B;AAC9B,iCAAiC;AACjC,mCAAmC;AACnC,mFAAmF;AACnF,iFAAiF;AACjF,sEAAsE;AACtE,EAAE;AACF,4DAA4D;AAC5D,wFAAwF;AACxF,oDAAoD;AACpD,oFAAoF;AACpF,EAAE;AACF,kDAAkD;AAClD,wFAAwF;AACxF,2EAA2E;AAC3E,oFAAoF;AACpF,uFAAuF;AACvF,qFAAqF;AACrF,0FAA0F;AAC1F,uFAAuF;AACvF,0FAA0F;AAC1F,iFAAiF;AAEjF,OAAO,EACL,aAAa,EACb,MAAM,EACN,UAAU,EACV,YAAY,EACZ,oBAAoB,GAErB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oB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AAG,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC3C,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC/B,MAAM,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC9B,CAAC;IAED,EAAE,CAAC,cAAc,EAAE,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC;AAOD,iFAAiF;AACjF,qFAAqF;AACrF,IAAI,WAAW,GAAG,KAAK,CAAC;AAExB;;;;;GAKG;AACH,MAAM,UAAU,IAAI,CAAC,QAAsB;IACzC,IAAI,WAAW;QAAE,OAAO;IAExB,0EAA0E;IAC1E,yEAAyE;IACzE,8EAA8E;IAC9E,IAAI,CAAC,SAAS;QAAE,OAAO;IACvB,IAAI,CAAC,uBAAuB,IAAI,WAAW,EAAE,KAAK,MAAM;QAAE,OAAO;IAEjE,WAAW,GAAG,IAAI,CAAC;IAEnB,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAChD,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAA6B,CAAC,CAAC;IAEnE,oGAAoG;IACpG,wDAAwD;AAC1D,CAAC","sourcesContent":["/// <reference lib=\"dom\" />\n/// <reference lib=\"dom.iterable\" />\n// Ported from Astro transitions/router.ts (transition orchestration half).\n// Source: https://raw.githubusercontent.com/withastro/astro/main/packages/astro/src/transitions/router.ts\n// Issue: zudolab/zudo-doc#1516 (W3C1), parent epic zudolab/zudo-doc#1510.\n//\n// Mechanical renames per W1B §13.5:\n// astro:* event names → zfb:*\n// data-astro-* attributes → data-zfb-*\n// astro-view-transitions-* → zfb-view-transitions-*\n// .astro-route-announcer → .zfb-route-announcer\n// dataset.astroExec → dataset.zfbExec\n// dataset.astroHistory → dataset.zfbHistory\n// dataset.astroRerun → dataset.zfbRerun\n//\n// Named-cause deviations:\n// - `internalFetchHeaders` import dropped; replaced with `{}` (W1B §13.5 — zfb adapters\n// do not currently expose a per-fetch internal-headers contract).\n// - `prepareForClientOnlyComponents` dropped entirely (W1B §13.5 / W3C2 — DEV-only\n// iframe trick that compensates for Vite per-component CSS injection on hydrate;\n// not applicable to zfb islands which inject CSS via the bundle).\n// - `import.meta.env.SSR` access uses `(import.meta as any).env?.SSR` (no Vite\n// ambient types in zfb-runtime tsconfig — same workaround used in W3B).\n// - `inBrowser` evaluates to `typeof document !== \"undefined\"` rather than relying\n// on the SSR flag, because the runtime package serves both server- and client-side\n// code; same observable behavior in browser and on SSR.\n// - `announce()` was a TODO stub at W1B port time; W3C3 implemented it and #1063 gave\n// its 60ms timer explicit lifecycle ownership — see the route-announcer block below.\n//\n// W3C2 additions (this file):\n// - `navigate()` public entry.\n// - `onPopState`, `onScrollEnd`.\n// - Top-level `if (inBrowser)` initialization block (seeds `currentHistoryIndex`\n// from `history.state`, registers popstate / load / scrollend listeners, and\n// marks already-executed scripts with `dataset[\"zfbExec\"] = \"\"`).\n//\n// W3C1 items deferred to — and since implemented in — W3C3:\n// - `announce()` route-announcer implementation (see the route-announcer block below;\n// timer lifecycle ownership hardened in #1063).\n// - Click + form intercept (see `handleClick` / `handleSubmit` / `init()` below).\n//\n// zfb-only additions (no Astro upstream — #1076):\n// - `onPageShow` pageshow/bfcache re-sync, registered inside the init block alongside\n// popstate/load/scrollend. Verified against live Astro `main`: neither\n// `transitions/router.ts` nor `ClientRouter.astro` has any pageshow/`persisted`\n// handler, so this is original design, not a port. WebKit serves Back after an SPA\n// route change from the bfcache without re-evaluating this module, desyncing the\n// tracked `currentHistoryIndex` from the live history stack; `onPageShow` re-seeds it\n// (and restores scroll) on a persisted restore — see the `onPageShow` block below.\n// - `derivePopDirection` hardens the popstate forward/back calc against an unchanged or\n// missing/NaN `state.index` that a bfcache restore can leave behind (#1076).\n\nimport {\n doPreparation,\n doSwap,\n onPageLoad,\n triggerEvent,\n updateScrollPosition,\n type TransitionBeforePreparationEvent,\n} from \"./events.js\";\nimport { detectScriptExecuted } from \"./swap-functions.js\";\nimport type { Direction, Fallback, Options, SyncHistoryEntryOptions } from \"./types.js\";\n// Island re-bootstrap and deferred-cancel after body swap (W1B §12.2, §12.5).\n// mountNewIslands() is called after runScripts() and before onPageLoad().\n// cancelPendingIslands() is called before doSwap() so deferred callbacks\n// (rIC/IntersectionObserver) do not fire against orphan elements.\nimport { cancelPendingIslands, mountNewIslands, unmountIslands } from \"@takazudo/zfb/runtime\";\n\ntype State = {\n index: number;\n scrollX: number;\n scrollY: number;\n};\ntype Navigation = { controller: AbortController };\ntype Transition = {\n // The view transitions object (API and simulation)\n viewTransition?: ViewTransition;\n // Simulation: Whether transition was skipped\n transitionSkipped: boolean;\n // Simulation: The resolve function of the finished promise\n viewTransitionFinished?: () => void;\n};\n\n// Adapter-specific internal fetch headers. zfb adapters do not currently expose this\n// contract — the empty object preserves the call-shape so the loop in fetchHTML is a\n// no-op until/unless an adapter wires this up.\nconst internalFetchHeaders: Record<string, string> = {};\n\n// Detect browser context. Astro uses `import.meta.env.SSR === false` (Vite-injected).\n// The zfb-runtime tsconfig has no Vite ambient types; checking for `document` is\n// behaviorally identical and avoids a Vite type dependency.\nconst inBrowser = typeof document !== \"undefined\";\n\nexport const supportsViewTransitions = inBrowser && !!document.startViewTransition;\n\nexport const transitionEnabledOnThisPage = () =>\n inBrowser && !!document.querySelector('[name=\"zfb-view-transitions-enabled\"]');\n\n// A same-page Back/Forward traversal (two history entries sharing pathname +\n// search) is served from the live DOM by the fast-path in transition() — no\n// re-fetch, no re-swap, no lifecycle events. A per-request SSR page\n// (`prerender = false`) whose server output can differ between two visits to\n// the SAME url opts back INTO the fetch by emitting\n// <meta name=\"zfb-traverse-refetch\" content=\"true\"> (via <ClientRouter\n// traverseRefetch />); skipping the fetch on such a page would pin the stale\n// first-render content. Read from the CURRENT document — for a same-page\n// traverse the current document IS the target page. Mirrors the\n// zfb-prefetch-disabled meta reader. (#1376)\nconst traverseRefetchOptedOut = () =>\n inBrowser && !!document.querySelector('meta[name=\"zfb-traverse-refetch\"][content=\"true\"]');\n\nconst samePage = (thisLocation: URL, otherLocation: URL) =>\n thisLocation.pathname === otherLocation.pathname && thisLocation.search === otherLocation.search;\n\n// The previous navigation that might still be in processing\nlet mostRecentNavigation: Navigation | undefined;\n// The previous transition that might still be in processing\nlet mostRecentTransition: Transition | undefined;\n// When we traverse the history, the window.location is already set to the new location.\n// This variable tells us where we came from\nlet originalLocation: URL;\n\n// Route announcer — ported from Astro's announce(). Each navigation appends a fresh\n// aria-live <div> (after removing any prior announcer, so exactly one ever exists) and\n// writes the new page title into it 60ms later, so screen readers announce the new page.\n//\n// zfb deviation from Astro / design decision for #1063 (timer lifecycle ownership):\n// - The 60ms timer id is stored and cleared when a newer navigation supersedes a\n// still-pending announcement, so a superseded page's title is never written to a\n// now-detached announcer. (Astro leaves the timer fire-and-forget.)\n// - The previous announcer is removed before a new one is appended, so they never\n// accumulate. We deliberately do NOT *reuse* one element across navigations (which\n// #1063 floated): a reused live region is detached and re-inserted into the a11y\n// tree on every body swap, and a repeated title would be a no-op text write — both\n// make re-announcement unreliable across screen readers. Creating a fresh empty\n// element and writing text 60ms later is Astro's proven, reliable announce trigger.\n//\n// The 60ms delay is Astro's magic number: screen readers need to see the element change\n// and may miss it if it happens too quickly.\nlet announceTimer: number | undefined;\n\nconst announce = () => {\n // A newer navigation supersedes any still-pending announcement: cancel the old\n // timer so it can't write a now-stale title after this navigation's swap.\n if (announceTimer !== undefined) window.clearTimeout(announceTimer);\n\n // Keep exactly one announcer: drop any leftover from a prior navigation that the\n // body swap did not already detach.\n document.querySelector(\".zfb-route-announcer\")?.remove();\n const div = document.createElement(\"div\");\n div.setAttribute(\"aria-live\", \"assertive\");\n div.setAttribute(\"aria-atomic\", \"true\");\n div.className = \"zfb-route-announcer\";\n document.body.append(div);\n\n announceTimer = window.setTimeout(() => {\n announceTimer = undefined;\n // This timer can outlive its document context — a test-env teardown\n // (vitest/happy-dom) or a real page unload removes `document` (and\n // `location`) before the 60ms elapses. `typeof` is safe even when the\n // global is gone, so bail out instead of throwing an unhandled\n // ReferenceError (#1061); the announcement is moot once the page is gone.\n // Both globals the callback dereferences are checked, not just `document`.\n if (typeof document === \"undefined\" || typeof location === \"undefined\") return;\n const title = document.title || document.querySelector(\"h1\")?.textContent || location.pathname;\n div.textContent = title;\n }, 60);\n};\n\nconst PERSIST_ATTR = \"data-zfb-transition-persist\";\n\nconst attrValueSelector = (attr: string, value: string): string =>\n value === \"\" ? `[${attr}=\"\"]` : `[${attr}=${CSS.escape(value)}]`;\n\nconst querySelectorWithAttrValue = (\n root: ParentNode,\n selectorPrefix: string,\n attr: string,\n value: string,\n): Element | null => {\n const escapedMatch = root.querySelector(`${selectorPrefix}${attrValueSelector(attr, value)}`);\n if (escapedMatch) return escapedMatch;\n return (\n Array.from(root.querySelectorAll(`${selectorPrefix}[${attr}]`)).find(\n (el) => el.getAttribute(attr) === value,\n ) ?? null\n );\n};\nconst DIRECTION_ATTR = \"data-zfb-transition\";\nconst OLD_NEW_ATTR = \"data-zfb-transition-fallback\";\n\nlet parser: DOMParser;\n\n// The History API does not tell you if navigation is forward or back, so\n// you can figure it using an index. On pushState the index is incremented so you\n// can use that to determine popstate if going forward or back.\nlet currentHistoryIndex = 0;\n\nif (inBrowser) {\n if (history.state) {\n // Here we reloaded a page with history state\n // (e.g. history navigation from non-transition page or browser reload)\n currentHistoryIndex = history.state.index;\n scrollTo({ left: history.state.scrollX, top: history.state.scrollY });\n } else if (transitionEnabledOnThisPage()) {\n // This page is loaded from the browser address bar or via a link from extern,\n // it needs a state in the history\n history.replaceState({ index: currentHistoryIndex, scrollX, scrollY }, \"\");\n history.scrollRestoration = \"manual\";\n }\n}\n\n// returns the contents of the page or null if the router can't deal with it.\nasync function fetchHTML(\n href: string,\n init?: RequestInit,\n): Promise<null | { html: string; redirected?: string; mediaType: DOMParserSupportedType }> {\n try {\n // Apply adapter-specific headers for internal fetches\n const headers = new Headers(init?.headers);\n for (const [key, value] of Object.entries(internalFetchHeaders) as [string, string][]) {\n headers.set(key, value);\n }\n const res = await fetch(href, { ...init, headers });\n const contentType = res.headers.get(\"content-type\") ?? \"\";\n // drop potential charset (+ other name/value pairs) as parser needs the mediaType\n const mediaType = contentType.split(\";\", 1)[0]!.trim();\n // the DOMParser can handle two types of HTML\n if (mediaType !== \"text/html\" && mediaType !== \"application/xhtml+xml\") {\n // everything else (e.g. audio/mp3) will be handled by the browser but not by us\n return null;\n }\n const html = await res.text();\n // exactOptionalPropertyTypes: true forbids assigning `undefined` to a `redirected?: string`\n // slot, so omit the property when not redirected instead of setting it to undefined.\n return res.redirected ? { html, redirected: res.url, mediaType } : { html, mediaType };\n } catch {\n // can't fetch, let someone else deal with it.\n return null;\n }\n}\n\nexport function getFallback(): Fallback {\n const el = document.querySelector('[name=\"zfb-view-transitions-fallback\"]');\n if (el) {\n // Astro casts `content` straight to Fallback; harden against an arbitrary/typo'd\n // attribute value by validating against the known set and defaulting to \"animate\".\n const content = el.getAttribute(\"content\");\n if (content === \"none\" || content === \"animate\" || content === \"swap\") {\n return content;\n }\n }\n return \"animate\";\n}\n\n// Upper bound (ms) for waiting on a single external <script>'s load/error in\n// runScripts(). Not an Astro upstream value — added so a slow/broken external\n// script can never hang the transition indefinitely.\nconst EXTERNAL_SCRIPT_WAIT_TIMEOUT = 5000;\n\nfunction runScripts() {\n let wait = Promise.resolve();\n let needsWaitForInlineModuleScript = false;\n // The original code made the assumption that all inline scripts are directly executed when inserted into the DOM.\n // This is not true for inline module scripts, which are deferred but still executed in order.\n // inline module scripts cannot be awaited for with onload.\n // Thus to be able to wait for the execution of all scripts, we make sure that the last inline module script\n // is always followed by an external module script\n for (const script of document.getElementsByTagName(\"script\")) {\n script.dataset[\"zfbExec\"] === undefined &&\n script.getAttribute(\"type\") === \"module\" &&\n (needsWaitForInlineModuleScript = script.getAttribute(\"src\") === null);\n }\n needsWaitForInlineModuleScript &&\n document.body.insertAdjacentHTML(\n \"beforeend\",\n `<script type=\"module\" src=\"data:application/javascript,\"/>`,\n );\n\n for (const script of document.getElementsByTagName(\"script\")) {\n if (script.dataset[\"zfbExec\"] === \"\") continue;\n const type = script.getAttribute(\"type\");\n if (type && type !== \"module\" && type !== \"text/javascript\") continue;\n const newScript = document.createElement(\"script\");\n newScript.innerHTML = script.innerHTML;\n for (const attr of script.attributes) {\n if (attr.name === \"src\") {\n // Astro awaits onload/onerror with no upper bound; a slow or broken\n // external <script> would then hang the whole transition. Race the\n // load against a timeout so the transition can always proceed.\n const p = new Promise<void>((r) => {\n let timer: ReturnType<typeof setTimeout>;\n const done = () => {\n clearTimeout(timer);\n r();\n };\n newScript.onload = newScript.onerror = done;\n timer = setTimeout(done, EXTERNAL_SCRIPT_WAIT_TIMEOUT);\n });\n wait = wait.then(() => p as any);\n }\n newScript.setAttribute(attr.name, attr.value);\n }\n newScript.dataset[\"zfbExec\"] = \"\";\n script.replaceWith(newScript);\n }\n return wait;\n}\n\n// Add a new entry to the browser history. This also sets the new page in the browser address bar.\n// Sets the scroll position according to the hash fragment of the new location.\nconst moveToLocation = (\n to: URL,\n from: URL,\n options: Options,\n pageTitleForBrowserHistory: string,\n historyState?: State,\n // True when transition() already committed a history entry for THIS\n // navigation before the swap ran (the WebKit-workaround early commit\n // below). `to` here may differ from that committed entry's URL if a\n // `zfb:before-swap` listener mutated `event.to` (writable per Astro\n // parity) after the early commit already ran — in that case we must\n // REPLACE the already-committed entry instead of pushing a second one, or\n // a single navigation would leave two history entries (a phantom Back\n // stop). #1398.\n historyCommittedEarly = false,\n) => {\n const intraPage = samePage(from, to);\n\n const targetPageTitle = document.title;\n document.title = pageTitleForBrowserHistory;\n\n let scrolledToTop = false;\n if (to.href !== location.href && !historyState) {\n if (options.history === \"replace\" || historyCommittedEarly) {\n // Astro reads current.index/scrollX/scrollY directly; `history.state` can be\n // null (page entered without a transition state), which would throw a\n // TypeError. Fall back to a synthesized state from the tracked index/scroll.\n const current = history.state ?? {\n index: currentHistoryIndex,\n scrollX,\n scrollY,\n };\n history.replaceState(\n {\n ...options.state,\n index: current.index,\n scrollX: current.scrollX,\n scrollY: current.scrollY,\n },\n \"\",\n to.href,\n );\n } else {\n history.pushState(\n { ...options.state, index: ++currentHistoryIndex, scrollX: 0, scrollY: 0 },\n \"\",\n to.href,\n );\n }\n }\n document.title = targetPageTitle;\n // now we are on the new page for non-history navigation!\n // (with history navigation page change happens before popstate is fired)\n originalLocation = to;\n\n // freshly loaded pages start from the top\n if (!intraPage) {\n scrollTo({ left: 0, top: 0, behavior: \"instant\" });\n scrolledToTop = true;\n }\n\n if (historyState) {\n // Raw-History consumers may push partial/empty state (`{}`), so the tracked\n // scroll fields can be absent or non-finite. Never scrollTo(undefined, …) —\n // leave scroll where it is rather than jumping to (0,0). #1376.\n if (Number.isFinite(historyState.scrollX) && Number.isFinite(historyState.scrollY)) {\n scrollTo(historyState.scrollX, historyState.scrollY);\n }\n } else {\n if (to.hash) {\n // because we are already on the target page ...\n // ... what comes next is an intra-page navigation\n // that won't reload the page but instead scroll to the fragment\n history.scrollRestoration = \"auto\";\n const savedState = history.state;\n location.href = to.href; // this kills the history state on Firefox\n if (!history.state) {\n history.replaceState(savedState, \"\"); // this restores the history state\n if (intraPage) {\n window.dispatchEvent(new PopStateEvent(\"popstate\"));\n }\n }\n } else {\n if (!scrolledToTop) {\n scrollTo({ left: 0, top: 0, behavior: \"instant\" });\n }\n }\n history.scrollRestoration = \"manual\";\n }\n};\n\nlet syncHistoryEntryOnServerWarned = false;\n\n/**\n * Write a router-managed history entry (push or replace) WITHOUT any\n * navigation, DOM, or lifecycle side effect. This is the supported path for\n * consumers deep-linking transient UI state (dialogs/modals, a photo\n * viewer's `/photos/<slug>/` URL). Hand-rolled raw `history.pushState`\n * desyncs `originalLocation` and the index bookkeeping that popstate\n * direction detection ({@link derivePopDirection}) and the same-page\n * traverse fast-path depend on; `navigate()` can't be used instead because\n * it forces a fetch. See #1377 / #1374.\n *\n * Never scrolls the viewport itself — but the entry it writes IS stamped\n * with the CURRENT scroll position (`scrollX`/`scrollY` at call time), not\n * `(0, 0)` (issue #1398). This matters only for a later Forward-traversal\n * back to this entry: the same-page traverse fast-path restores whatever\n * scroll position was stamped on the entry, so a same-page push (e.g.\n * opening a dialog) does not snap the underlying page to the top when the\n * dialog is later reopened via Forward.\n *\n * @param url - The URL to write. Cross-origin URLs throw rather than\n * silently falling back to a full-page load.\n * @param options.replace - Use `history.replaceState` instead of\n * `history.pushState` (no new Back-button entry). Default: push.\n * @param options.state - Merged into the entry's `history.state`; the\n * router's own bookkeeping keys (`index`, `scrollX`, `scrollY`) always win\n * on a colliding key.\n */\nexport function syncHistoryEntry(url: string | URL, options: SyncHistoryEntryOptions = {}): void {\n // SSR guard: no window/history to touch. Mirror navigate()'s server no-op +\n // one-time console warning. Checked at call time via `typeof document` (not the\n // module-eval `inBrowser` const) so the branch is reachable and behavior is\n // identical in a real environment (document is always present in a browser).\n if (typeof document === \"undefined\") {\n if (!syncHistoryEntryOnServerWarned) {\n // instantiate an error for the stacktrace to show to user.\n const warning = new Error(\n \"syncHistoryEntry() was called during a server side render. This may be unintentional as it is expected to be called in response to a client-side user interaction. Please make sure that your usage is correct.\",\n );\n warning.name = \"Warning\";\n // biome-ignore lint/suspicious/noConsole: allowed\n console.warn(warning);\n syncHistoryEntryOnServerWarned = true;\n }\n return;\n }\n\n const to = new URL(url, location.href);\n\n // Cross-origin is not ours to manage. The History API would throw a native\n // SecurityError for a cross-origin URL, but we guard explicitly so the failure\n // is a clear, documented contract violation rather than an opaque platform\n // error — and never a silent full-page load. #1377.\n if (to.origin !== location.origin) {\n throw new Error(\n `syncHistoryEntry(): refusing to write a cross-origin history entry for \"${to.href}\" (current origin: ${location.origin}).`,\n );\n }\n\n if (options.replace) {\n // Replace keeps the current entry's index. A consumer migrating from raw\n // history.pushState may have left a missing/invalid index, so fall back to\n // the tracked index rather than stamping NaN/undefined.\n const current = history.state;\n const index =\n current != null && Number.isFinite(current.index) ? current.index : currentHistoryIndex;\n history.replaceState(\n {\n ...options.state,\n index,\n scrollX: Number.isFinite(current?.scrollX) ? current.scrollX : scrollX,\n scrollY: Number.isFinite(current?.scrollY) ? current.scrollY : scrollY,\n },\n \"\",\n to.href,\n );\n } else {\n // Persist the CURRENT (outgoing) entry's latest scroll before pushing, so a\n // later Back restoration can't lose scroll that `scrollend` hasn't flushed\n // yet — the same guard transition() applies before a non-traverse push.\n updateScrollPosition({ scrollX, scrollY });\n // Stamp the CURRENT scroll on the freshly-pushed entry too — NOT (0,0).\n // This is a same-page push (dialog/photo-viewer pattern): the underlying\n // page never actually scrolled anywhere, it just gained an overlay. A\n // (0,0)-stamped entry would make the traverse fast-path (moveToLocation's\n // historyState branch below) scrollTo(0,0) when this entry is later\n // Forward-reopened, snapping the page to the top under the reopened\n // dialog. #1398.\n history.pushState(\n { ...options.state, index: ++currentHistoryIndex, scrollX, scrollY },\n \"\",\n to.href,\n );\n }\n\n // Always re-point originalLocation so the next transition()/onPopState uses the\n // correct \"from\" URL. Skipping this is exactly what makes a raw pushState\n // desync the router (a same-page Back would miss the traverse fast path).\n originalLocation = to;\n}\n\nfunction preloadStyleLinks(newDocument: Document) {\n const links: Promise<any>[] = [];\n for (const el of newDocument.querySelectorAll(\"head link[rel=stylesheet]\")) {\n const persistId = el.getAttribute(PERSIST_ATTR);\n const href = el.getAttribute(\"href\");\n const existingSelectors = [\n persistId !== null ? attrValueSelector(PERSIST_ATTR, persistId) : null,\n href !== null ? `link[rel=stylesheet]${attrValueSelector(\"href\", href)}` : null,\n ].filter((selector): selector is string => selector !== null);\n const existingLink =\n (existingSelectors.length ? document.querySelector(existingSelectors.join(\", \")) : null) ??\n (persistId !== null\n ? querySelectorWithAttrValue(document, \"\", PERSIST_ATTR, persistId)\n : null) ??\n (href !== null\n ? querySelectorWithAttrValue(document, \"link[rel=stylesheet]\", \"href\", href)\n : null);\n\n // Do not preload links that are already on the page.\n if (href !== null && !existingLink) {\n const c = document.createElement(\"link\");\n c.setAttribute(\"rel\", \"preload\");\n c.setAttribute(\"as\", \"style\");\n c.setAttribute(\"href\", href);\n links.push(\n new Promise<any>((resolve) => {\n [\"load\", \"error\"].forEach((evName) => c.addEventListener(evName, resolve));\n document.head.append(c);\n }),\n );\n }\n }\n return links;\n}\n\n// replace head and body of the windows document with contents from newDocument\n// if !popstate, update the history entry and scroll position according to toLocation\n// if popState is given, this holds the scroll position for history navigation\n// if fallback === \"animate\" then simulate view transitions\nasync function updateDOM(\n preparationEvent: TransitionBeforePreparationEvent,\n options: Options,\n currentTransition: Transition,\n historyState?: State,\n fallback?: Fallback,\n // Forwarded to moveToLocation() — see its parameter doc. #1398.\n historyCommittedEarly = false,\n) {\n async function animate(phase: string) {\n function isInfinite(animation: Animation) {\n const effect = animation.effect;\n if (!effect || !(effect instanceof KeyframeEffect) || !effect.target) return false;\n const style = window.getComputedStyle(effect.target, effect.pseudoElement);\n return style.animationIterationCount === \"infinite\";\n }\n const currentAnimations = document.getAnimations();\n // Trigger view transition animations waiting for data-zfb-transition-fallback\n document.documentElement.setAttribute(OLD_NEW_ATTR, phase);\n const nextAnimations = document.getAnimations();\n const newAnimations = nextAnimations.filter(\n (a) => !currentAnimations.includes(a) && !isInfinite(a),\n );\n // Wait for all new animations to finish (resolved or rejected).\n // Do not reject on canceled ones.\n return Promise.allSettled(newAnimations.map((a) => a.finished));\n }\n\n const animateFallbackOld = async () => {\n if (\n fallback === \"animate\" &&\n !currentTransition.transitionSkipped &&\n !preparationEvent.signal.aborted\n ) {\n try {\n await animate(\"old\");\n } catch {\n // animate might reject as a consequence of a call to skipTransition()\n // ignored on purpose\n }\n }\n };\n\n const pageTitleForBrowserHistory = document.title; // document.title will be overridden by swap()\n // Cancel deferred-hydration callbacks for old-body islands before the swap\n // so rIC / IntersectionObserver fires do not run against orphan elements.\n // Called before doSwap() which dispatches `zfb:before-swap` then mutates the DOM.\n cancelPendingIslands();\n // Unmount mounted islands on the OLD body before the swap so Preact/React\n // trees receive render(null, element) / root.unmount() and their useEffect\n // cleanups fire. Must happen after cancelPendingIslands() and before doSwap()\n // so document.body still points to the old body.\n //\n // Pass the incoming body so unmountIslands can SKIP islands that swapBodyElement\n // will lift into the new body (a persisted marker matched on both sides). Those\n // nodes are physically moved, not discarded, so their component instance and\n // state must survive the swap — unmounting them here would empty the container\n // before the lift and defeat data-zfb-transition-persist entirely (issue #1389).\n unmountIslands(document.body, preparationEvent.newDocument.body);\n const swapEvent = await doSwap(\n preparationEvent,\n currentTransition.viewTransition!,\n animateFallbackOld,\n );\n moveToLocation(\n swapEvent.to,\n swapEvent.from,\n options,\n pageTitleForBrowserHistory,\n historyState,\n historyCommittedEarly,\n );\n triggerEvent(\"zfb:after-swap\");\n\n // Resolve the finished promise of the simulation's ViewTransition.\n // For 'animate', wait for the new-page animation to complete first.\n // For other fallback modes (e.g. 'swap'), resolve immediately — no animation needed.\n if (fallback === \"animate\" && !currentTransition.transitionSkipped && !swapEvent.signal.aborted) {\n animate(\"new\").finally(() => currentTransition.viewTransitionFinished!());\n } else {\n currentTransition.viewTransitionFinished?.();\n }\n}\n\nfunction abortAndRecreateMostRecentNavigation(): Navigation {\n mostRecentNavigation?.controller.abort();\n return (mostRecentNavigation = {\n controller: new AbortController(),\n });\n}\n\nasync function transition(\n direction: Direction,\n from: URL,\n to: URL,\n options: Options,\n historyState?: State,\n hasUAVisualTransition = false,\n) {\n // The most recent navigation always has precedence\n // Yes, there can be several navigation instances as the user can click links\n // while we fetch content or simulate view transitions. Even synchronous creations are possible\n // e.g. by calling navigate() from a transition event.\n // Invariant: all but the most recent navigation are already aborted.\n\n const currentNavigation = abortAndRecreateMostRecentNavigation();\n\n // not ours\n if (!transitionEnabledOnThisPage() || location.origin !== to.origin) {\n if (currentNavigation === mostRecentNavigation) mostRecentNavigation = undefined;\n location.href = to.href;\n return;\n }\n\n const navigationType = historyState\n ? \"traverse\"\n : options.history === \"replace\"\n ? \"replace\"\n : \"push\";\n\n if (navigationType !== \"traverse\") {\n updateScrollPosition({ scrollX, scrollY });\n }\n if (samePage(from, to) && !options.formData) {\n if (\n // Same-page Back/Forward: serve from the live DOM (no re-fetch/re-swap)\n // unless this page opted back into the fetch (per-request SSR). #1374/#1376.\n (navigationType === \"traverse\" && !traverseRefetchOptedOut()) ||\n (direction !== \"back\" && to.hash) ||\n (direction === \"back\" && from.hash)\n ) {\n moveToLocation(to, from, options, document.title, historyState);\n if (currentNavigation === mostRecentNavigation) mostRecentNavigation = undefined;\n return;\n }\n }\n\n const prepEvent = await doPreparation(\n from,\n to,\n direction,\n navigationType,\n options.sourceElement,\n options.info,\n currentNavigation!.controller.signal,\n options.formData,\n defaultLoader,\n );\n if (prepEvent.defaultPrevented || prepEvent.signal.aborted) {\n if (currentNavigation === mostRecentNavigation) mostRecentNavigation = undefined;\n triggerEvent(\"zfb:navigation-aborted\");\n if (!prepEvent.signal.aborted) {\n // not aborted -> delegate to browser\n location.href = to.href;\n }\n // and / or exit\n return;\n }\n\n async function defaultLoader(preparationEvent: TransitionBeforePreparationEvent) {\n const href = preparationEvent.to.href;\n const init: RequestInit = { signal: preparationEvent.signal };\n if (preparationEvent.formData) {\n init.method = \"POST\";\n const form =\n preparationEvent.sourceElement instanceof HTMLFormElement\n ? preparationEvent.sourceElement\n : preparationEvent.sourceElement instanceof HTMLElement &&\n \"form\" in preparationEvent.sourceElement\n ? (preparationEvent.sourceElement.form as HTMLFormElement)\n : preparationEvent.sourceElement?.closest(\"form\");\n // Form elements without enctype explicitly set default to application/x-www-form-urlencoded.\n // In order to maintain compatibility with Astro 4.x, we need to check the value of enctype\n // on the attributes property rather than accessing .enctype directly. Astro 5.x may\n // introduce defaulting to application/x-www-form-urlencoded as a breaking change, and then\n // we can access .enctype directly.\n //\n // Note: getNamedItem can return null in real life, even if TypeScript doesn't think so, hence\n // the ?.\n // `form` can be null (closest() miss, or a form-less form-associated\n // element) — `!= null` covers both null and undefined so Reflect.get\n // is never invoked on a non-element receiver (\"Illegal invocation\").\n init.body =\n form != null &&\n Reflect.get(HTMLFormElement.prototype, \"attributes\", form).getNamedItem(\"enctype\")\n ?.value === \"application/x-www-form-urlencoded\"\n ? new URLSearchParams(preparationEvent.formData as any)\n : preparationEvent.formData;\n }\n const response = await fetchHTML(href, init);\n // If there is a problem fetching the new page, just do an MPA navigation to it.\n if (response === null) {\n preparationEvent.preventDefault();\n return;\n }\n // if there was a redirection, show the final URL in the browser's address bar\n if (response.redirected) {\n const redirectedTo = new URL(response.redirected);\n // but do not redirect cross origin\n if (redirectedTo.origin !== preparationEvent.to.origin) {\n preparationEvent.preventDefault();\n return;\n }\n // preserve fragment\n const fragment = preparationEvent.to.hash;\n preparationEvent.to = redirectedTo;\n preparationEvent.to.hash = fragment;\n }\n\n parser ??= new DOMParser();\n\n preparationEvent.newDocument = parser.parseFromString(response.html, response.mediaType);\n // The next line might look like a hack,\n // but it is actually necessary as noscript elements\n // and their contents are returned as markup by the parser,\n // see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString\n preparationEvent.newDocument.querySelectorAll(\"noscript\").forEach((el) => el.remove());\n\n // If ClientRouter is not enabled on the incoming page, do a full page load to it.\n // Unless this was a form submission, in which case we do not want to trigger another mutation.\n if (\n !preparationEvent.newDocument.querySelector('[name=\"zfb-view-transitions-enabled\"]') &&\n !preparationEvent.formData\n ) {\n preparationEvent.preventDefault();\n return;\n }\n\n const links = preloadStyleLinks(preparationEvent.newDocument);\n links.length && !preparationEvent.signal.aborted && (await Promise.all(links));\n\n // W3C2: prepareForClientOnlyComponents() goes here. Astro's DEV-only iframe\n // trick that hoists Vite per-component CSS for client:only islands does not\n // apply to zfb (W1B §13.5 — zfb islands inject CSS via the bundle), so the\n // call is intentionally absent rather than stubbed.\n }\n async function abortAndRecreateMostRecentTransition(): Promise<Transition> {\n if (mostRecentTransition) {\n if (mostRecentTransition.viewTransition) {\n try {\n mostRecentTransition.viewTransition.skipTransition();\n } catch {\n // might throw AbortError DOMException. Ignored on purpose.\n }\n try {\n // UpdateCallbackDone might already been settled, i.e. if the previous transition finished updating the DOM.\n // Could not take long, we wait for it to avoid parallel updates\n // (which are very unlikely as long as swap() is not async).\n await mostRecentTransition.viewTransition.updateCallbackDone;\n } catch {\n // There was an error in the update callback of the transition which we cancel.\n // Ignored on purpose\n }\n }\n }\n return (mostRecentTransition = { transitionSkipped: false });\n }\n\n const currentTransition = await abortAndRecreateMostRecentTransition();\n\n if (prepEvent.signal.aborted) {\n if (currentNavigation === mostRecentNavigation) mostRecentNavigation = undefined;\n return;\n }\n\n document.documentElement.setAttribute(DIRECTION_ATTR, prepEvent.direction);\n\n // Commit the SPA history entry BEFORE the transition's update callback runs.\n //\n // WebKit (all iOS browsers, incl. iOS Chrome) does not reliably commit a\n // distinct back/forward history entry when history.pushState() is issued\n // *inside* the document.startViewTransition() update callback: the URL bar\n // updates but no new entry is created, so a single Back press falls off the\n // site to the browser home (zudolab/zzmod#662). Committing the entry here —\n // outside the transition's update callback — makes WebKit create it; Chromium\n // is unaffected either way. moveToLocation() (called later from updateDOM,\n // inside the callback) then no-ops its own push/replace via the\n // `to.href !== location.href` guard, since location is already at the\n // committed URL, so currentHistoryIndex is not double-advanced.\n //\n // We use prepEvent.to (redirects are already resolved into it during\n // preparation) and write before the swap, while document.title is still the\n // old page's title — so the back entry keeps the correct (old-page) title\n // without needing moveToLocation's title juggle. Writing here also covers the\n // non-VT fallback path below in one place.\n //\n // Traverse (popstate) navigations carry historyState: the browser has already\n // moved, so they must NOT create a new entry here.\n //\n // Tracks whether this block ran (push OR replace) so moveToLocation (called\n // later, from updateDOM) knows a commit already happened for THIS navigation\n // — see moveToLocation's `historyCommittedEarly` parameter doc. #1398.\n let historyCommittedEarly = false;\n if (!historyState && prepEvent.to.href !== location.href) {\n historyCommittedEarly = true;\n if (options.history === \"replace\") {\n // Mirror of the moveToLocation replace-path guard: `history.state` can be\n // null here too (page entered without a transition state), so synthesize a\n // state from the tracked index/scroll instead of dereferencing null.\n const current = history.state ?? {\n index: currentHistoryIndex,\n scrollX,\n scrollY,\n };\n history.replaceState(\n {\n ...options.state,\n index: current.index,\n scrollX: current.scrollX,\n scrollY: current.scrollY,\n },\n \"\",\n prepEvent.to.href,\n );\n } else {\n history.pushState(\n { ...options.state, index: ++currentHistoryIndex, scrollX: 0, scrollY: 0 },\n \"\",\n prepEvent.to.href,\n );\n }\n }\n\n if (supportsViewTransitions && !hasUAVisualTransition) {\n // This automatically cancels any previous transition\n // We also already took care that the earlier update callback got through\n currentTransition.viewTransition = document.startViewTransition(\n async () =>\n await updateDOM(\n prepEvent,\n options,\n currentTransition,\n historyState,\n undefined,\n historyCommittedEarly,\n ),\n );\n } else {\n // Simulation mode requires a bit more manual work.\n // Also used when PopStateEvent.hasUAVisualTransition indicates the browser already\n // provided a visual transition (e.g. Safari swipe gesture) — in that case, fallback\n // is \"swap\" to skip animations.\n const updateDone = (async () => {\n // Immediately paused to set up the ViewTransition object for Fallback mode\n await Promise.resolve(); // hop through the micro task queue\n await updateDOM(\n prepEvent,\n options,\n currentTransition,\n historyState,\n hasUAVisualTransition ? \"swap\" : getFallback(),\n historyCommittedEarly,\n );\n return undefined;\n })();\n\n // When the updateDone promise is settled,\n // we have run and awaited all swap functions and the after-swap event\n // This qualifies for \"updateCallbackDone\".\n //\n // For the build in ViewTransition, \"ready\" settles shortly after \"updateCallbackDone\",\n // i.e. after all pseudo elements are created and the animation is about to start.\n // In simulation mode the \"old\" animation starts before swap,\n // the \"new\" animation starts after swap. That is not really comparable.\n // Thus we go with \"very, very shortly after updateCallbackDone\" and make both equal.\n //\n // \"finished\" resolves after all animations are done.\n\n currentTransition.viewTransition = {\n updateCallbackDone: updateDone, // this is about correct\n ready: updateDone, // good enough\n // Finished promise could have been done better: finished rejects iff updateDone does.\n // Our simulation always resolves, never rejects.\n finished: new Promise((r) => (currentTransition.viewTransitionFinished = r as () => void)), // see end of updateDOM\n skipTransition: () => {\n currentTransition.transitionSkipped = true;\n // This cancels all animations of the simulation\n document.documentElement.removeAttribute(OLD_NEW_ATTR);\n },\n types: new Set<string>(), // empty by default\n };\n }\n // In earlier versions was then'ed on viewTransition.ready which would not execute\n // if the visual part of the transition has errors or was skipped\n currentTransition.viewTransition?.updateCallbackDone.finally(async () => {\n await runScripts();\n // Mount new island markers introduced by the body swap. Fire-and-forget;\n // each island's scheduleHydrate call is async (idle / visible). Called after\n // runScripts() so any new mountIslands() registration from inline scripts in\n // the new page has already run. Called before onPageLoad() per W1B §12.2.\n mountNewIslands();\n onPageLoad();\n announce();\n });\n // finished.ready and finished.finally are the same for the simulation but not\n // necessarily for native view transition, where finished rejects when updateCallbackDone does.\n currentTransition.viewTransition?.finished.finally(() => {\n // exactOptionalPropertyTypes: true forbids assigning `undefined` to an optional\n // `viewTransition?: ViewTransition` slot — `delete` is the equivalent reset.\n delete currentTransition.viewTransition;\n if (currentTransition === mostRecentTransition) mostRecentTransition = undefined;\n if (currentNavigation === mostRecentNavigation) mostRecentNavigation = undefined;\n document.documentElement.removeAttribute(DIRECTION_ATTR);\n document.documentElement.removeAttribute(OLD_NEW_ATTR);\n });\n try {\n // Compatibility:\n // In an earlier version we awaited viewTransition.ready, which includes animation setup.\n // Scripts that depend on the view transition pseudo elements should hook on viewTransition.ready.\n await currentTransition.viewTransition?.updateCallbackDone;\n } catch (e) {\n // This log doesn't make it worse than before, where we got error messages about uncaught exceptions, which can't be caught when the trigger was a click or history traversal.\n // Needs more investigation on root causes if errors still occur sporadically\n const err = e as Error;\n // biome-ignore lint/suspicious/noConsole: allowed\n console.log(\"[zfb]\", err.name, err.message, err.stack);\n }\n}\n\nlet navigateOnServerWarned = false;\n\nexport async function navigate(href: string, options?: Options) {\n if (inBrowser === false) {\n if (!navigateOnServerWarned) {\n // instantiate an error for the stacktrace to show to user.\n const warning = new Error(\n \"The view transitions client API was called during a server side render. This may be unintentional as the navigate() function is expected to be called in response to user interactions. Please make sure that your usage is correct.\",\n );\n warning.name = \"Warning\";\n // biome-ignore lint/suspicious/noConsole: allowed\n console.warn(warning);\n navigateOnServerWarned = true;\n }\n return;\n }\n if (!supportsViewTransitions && getFallback() === \"none\") {\n const url = new URL(href, location.href);\n // Honor the history option on the full-load fallback path: \"replace\"\n // must not leave a back-button entry, so use location.replace().\n if (options?.history === \"replace\") {\n location.replace(url.href);\n } else {\n location.href = url.href;\n }\n return;\n }\n await transition(\"forward\", originalLocation, new URL(href, location.href), options ?? {});\n}\n\nfunction onPopState(ev: PopStateEvent) {\n if (!transitionEnabledOnThisPage() && ev.state) {\n // The current page doesn't have View Transitions enabled\n // but the page we navigate to does (because it set the state).\n // Do a full page refresh to reload the client-side router from the new page.\n location.reload();\n return;\n }\n\n // History entries without state are created by the browser (e.g. for hash links)\n // Our view transition entries always have state.\n // Just ignore stateless entries.\n // The browser will handle navigation fine without our help\n if (ev.state === null) {\n return;\n }\n const state: State = history.state;\n const nextIndex = state.index;\n const direction: Direction = derivePopDirection(nextIndex, currentHistoryIndex);\n // Only advance the tracked index when the entry carries a usable index.\n // After a bfcache restore the index can be missing/NaN; clobbering the\n // tracked value with NaN would poison every subsequent direction calc, so\n // keep the last known-good index in that case (see derivePopDirection).\n if (Number.isFinite(nextIndex)) {\n currentHistoryIndex = nextIndex;\n }\n transition(\n direction,\n originalLocation,\n new URL(location.href),\n {},\n state,\n ev.hasUAVisualTransition,\n );\n}\n\n// Decide forward vs back from the popped entry's index against the last\n// tracked index. Two desync cases a WebKit bfcache restore can produce:\n// - missing / NaN `next` (restored entry lost its index): handled explicitly\n// below — we cannot prove a forward move, so treat it as \"back\" (the safe\n// default; a forward misclassification is what makes Back skip to the wrong\n// page).\n// - `next === current` (index unchanged after a desync/replace): falls out of\n// the `>` comparison as \"back\" — not a forward navigation.\nfunction derivePopDirection(nextIndex: number, trackedIndex: number): Direction {\n if (!Number.isFinite(nextIndex)) return \"back\";\n return nextIndex > trackedIndex ? \"forward\" : \"back\";\n}\n\nconst onScrollEnd = () => {\n // NOTE: our \"popstate\" event handler may call `pushState()` or\n // `replaceState()` and then `scrollTo()`, which will fire \"scroll\" and\n // \"scrollend\" events. To avoid redundant work and expensive calls to\n // `replaceState()`, we simply check that the values are different before\n // updating.\n if (history.state && (scrollX !== history.state.scrollX || scrollY !== history.state.scrollY)) {\n updateScrollPosition({ scrollX, scrollY });\n }\n};\n\n// zfb-only addition (no Astro upstream — see file header \"zfb-only additions\").\n// WebKit serves Back navigations after an SPA route change from the bfcache:\n// the page is restored without re-evaluating this module, so the init-block\n// seed below (which sets `currentHistoryIndex` from `history.state.index`)\n// never re-runs and the tracked index can desync from the live history stack.\n// A desynced index makes onPopState's direction calc misfire, so Back skips an\n// entry. On a persisted (bfcache) restore we re-seed the tracked index and the\n// `originalLocation` \"from\" URL from the live state, and restore scroll —\n// mirroring the init-block seed. This is a no-op on a normal load (`persisted`\n// falsy/absent) and idempotent (re-seeding from the same state twice changes\n// nothing and fires no transition).\nconst onPageShow = (ev: PageTransitionEvent) => {\n // Normal (non-bfcache) loads already ran the init-block seed; leave them be.\n if (!ev.persisted) return;\n // The init block sets `originalLocation` and `currentHistoryIndex` together;\n // re-sync both here so the next transition() gets the correct `from` URL\n // (a stale `originalLocation` would feed onPopState the wrong origin).\n originalLocation = new URL(location.href);\n const index = history.state?.index;\n if (Number.isFinite(index)) {\n currentHistoryIndex = index;\n }\n if (history.state) {\n scrollTo({ left: history.state.scrollX, top: history.state.scrollY });\n }\n};\n\n// initialization\nif (inBrowser) {\n if (supportsViewTransitions || getFallback() !== \"none\") {\n originalLocation = new URL(location.href);\n addEventListener(\"popstate\", onPopState);\n addEventListener(\"load\", onPageLoad);\n // Re-sync the tracked history index + scroll on a WebKit bfcache restore;\n // a no-op on normal loads. See onPageShow above.\n addEventListener(\"pageshow\", onPageShow);\n // There's not a good way to record scroll position before a history back\n // navigation, so we will record it when the user has stopped scrolling.\n if (\"onscrollend\" in window) addEventListener(\"scrollend\", onScrollEnd);\n else {\n // Keep track of state between intervals\n let intervalId: number | undefined, lastY: number, lastX: number, lastIndex: State[\"index\"];\n const scrollInterval = () => {\n // The interval can outlive its document context — a test-env teardown or a\n // real page unload removes window/history before the 50ms tick. `typeof`\n // never throws even when the global is gone: stop the interval and bail\n // rather than dereferencing a torn-down global (the #1061 bug class; #1063).\n // In a real browser these globals always exist, so this path is test-env\n // only. clearInterval may itself be mid-teardown, so guard the call too.\n if (typeof window === \"undefined\" || typeof history === \"undefined\") {\n if (typeof clearInterval === \"function\") clearInterval(intervalId);\n intervalId = undefined;\n return;\n }\n // Check the index to see if a popstate event was fired\n if (lastIndex !== history.state?.index) {\n clearInterval(intervalId);\n intervalId = undefined;\n return;\n }\n // Check if the user stopped scrolling\n if (lastY === scrollY && lastX === scrollX) {\n // Cancel the interval and update scroll positions\n clearInterval(intervalId);\n intervalId = undefined;\n onScrollEnd();\n return;\n } else {\n ((lastY = scrollY), (lastX = scrollX));\n }\n };\n // We can't know when or how often scroll events fire, so we'll just use them to start intervals\n addEventListener(\n \"scroll\",\n () => {\n if (intervalId !== undefined) return;\n ((lastIndex = history.state?.index), (lastY = scrollY), (lastX = scrollX));\n intervalId = window.setInterval(scrollInterval, 50);\n },\n { passive: true },\n );\n }\n }\n for (const script of document.getElementsByTagName(\"script\")) {\n detectScriptExecuted(script);\n script.dataset[\"zfbExec\"] = \"\";\n }\n}\n\n// ---- W3C3: click + form intercept, public idempotent init() ----\n\n// Returns true when the modifier-key combo or mouse button means \"open in new tab / download\".\n// Matches Astro's `leavesWindow` helper in ClientRouter.astro.\nconst leavesWindow = (ev: MouseEvent): boolean =>\n (ev.button !== undefined && ev.button !== 0) || // non-left-click\n ev.metaKey || // new tab (Mac)\n ev.ctrlKey || // new tab (Windows/Linux)\n ev.altKey || // download\n ev.shiftKey; // new window\n\n// Track the last clicked element that will leave the window so form submit can check it.\nlet lastClickedElementLeavingWindow: EventTarget | null = null;\n\nfunction handleClick(ev: MouseEvent): void {\n let link: EventTarget | null = ev.target;\n\n // Record whether this click will leave the window (used by form submit handler).\n lastClickedElementLeavingWindow = leavesWindow(ev) ? link : null;\n\n // Shadow DOM: prefer composedPath target over ev.target.\n if (ev.composed) {\n link = ev.composedPath()[0] ?? link;\n }\n\n // Walk up to the nearest <a>, <area>, or <svg:a>.\n if (link instanceof Element) {\n link = link.closest(\"a, area\");\n }\n\n if (\n !(link instanceof HTMLAnchorElement) &&\n !(link instanceof SVGAElement) &&\n !(link instanceof HTMLAreaElement)\n ) {\n return;\n }\n\n const linkEl = link as HTMLAnchorElement | SVGAElement | HTMLAreaElement;\n const linkTarget =\n linkEl instanceof HTMLElement ? linkEl.target : (linkEl as SVGAElement).target.baseVal;\n const href = linkEl instanceof HTMLElement ? linkEl.href : (linkEl as SVGAElement).href.baseVal;\n\n if (!href) return;\n\n const origin = new URL(href, location.href).origin;\n\n if (\n // data-zfb-reload: caller wants a full browser reload, not a SPA transition.\n (linkEl as HTMLElement).dataset[\"zfbReload\"] !== undefined ||\n // download attribute: let browser handle download.\n linkEl.hasAttribute(\"download\") ||\n // Non-self target opens in a new context — skip.\n (linkTarget && linkTarget !== \"_self\") ||\n // Cross-origin: not ours to handle.\n origin !== location.origin ||\n // Modifier key / non-left-click combo: user wants new tab / window / download.\n lastClickedElementLeavingWindow !== null ||\n // Another handler already handled this event.\n ev.defaultPrevented\n ) {\n return;\n }\n\n ev.preventDefault();\n navigate(href, {\n // data-zfb-history=\"replace\" opts a link into replaceState instead of pushState.\n history: (linkEl as HTMLElement).dataset[\"zfbHistory\"] === \"replace\" ? \"replace\" : \"auto\",\n sourceElement: linkEl,\n });\n}\n\nfunction handleSubmit(ev: SubmitEvent): void {\n const el = ev.target as HTMLElement;\n const submitter = ev.submitter as HTMLElement | null;\n\n // If the submit was triggered by a modifier-key click, treat as normal browser submit.\n const clickedWithKeys = submitter !== null && submitter === lastClickedElementLeavingWindow;\n lastClickedElementLeavingWindow = null;\n\n if (\n el.tagName !== \"FORM\" ||\n ev.defaultPrevented ||\n el.dataset[\"zfbReload\"] !== undefined ||\n clickedWithKeys\n ) {\n return;\n }\n\n const form = el as HTMLFormElement;\n const formData = new FormData(form, submitter ?? undefined);\n\n // form.action / form.method can be shadowed by <input name=\"action\"> / <input name=\"method\">,\n // so fall back to getAttribute() when the property is not a string. (Astro's comment.)\n const formAction = typeof form.action === \"string\" ? form.action : form.getAttribute(\"action\");\n const formMethod = typeof form.method === \"string\" ? form.method : form.getAttribute(\"method\");\n\n // Resolve action: submitter formaction attr overrides form action, fallback to current path.\n let action = submitter?.getAttribute(\"formaction\") ?? formAction ?? location.pathname;\n // Resolve method: submitter formmethod attr overrides form method, fallback to \"get\".\n const method = submitter?.getAttribute(\"formmethod\") ?? formMethod ?? \"get\";\n\n // The \"dialog\" method is a special keyword used within <dialog> elements —\n // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-method\n if (method === \"dialog\" || location.origin !== new URL(action, location.href).origin) {\n // No SPA transition in these cases — let browser handle it.\n return;\n }\n\n const options: import(\"./types.js\").Options = { sourceElement: submitter ?? form };\n if (method === \"get\") {\n const params = new URLSearchParams(formData as any);\n const url = new URL(action, location.href);\n url.search = params.toString();\n action = url.toString();\n } else {\n options.formData = formData;\n }\n\n ev.preventDefault();\n navigate(action, options);\n}\n\nexport interface InitOptions {\n /** Reserved for forward-compat with Astro's prefetch integration. Ignored in v1. */\n prefetchAll?: boolean;\n}\n\n// Guard flag — ensures click + submit listeners are registered only once even if\n// init() is called multiple times (e.g. two <ClientRouter> mounts on the same page).\nlet initialized = false;\n\n/**\n * Wire up the client-router's click and form-submit intercepts.\n * Safe to call multiple times — subsequent calls are no-ops (idempotent).\n *\n * @param _options - Forward-compat hook matching Astro's init() signature. Ignored in v1.\n */\nexport function init(_options?: InitOptions): void {\n if (initialized) return;\n\n // Latch the guard only AFTER the early-return guards below: an ineligible\n // early call (no browser, or fallback \"none\") must not permanently latch\n // `initialized`, or a later legitimately-eligible init() would no-op forever.\n if (!inBrowser) return;\n if (!supportsViewTransitions && getFallback() === \"none\") return;\n\n initialized = true;\n\n document.addEventListener(\"click\", handleClick);\n document.addEventListener(\"submit\", handleSubmit as EventListener);\n\n // Prefetch hook intentionally omitted from v1 — see https://github.com/zudolab/zudo-doc/issues/1527\n // (Followup tracker for porting Astro prefetch module).\n}\n"]}
@@ -19,4 +19,3 @@ export declare const swapFunctions: {
19
19
  saveFocus: () => (() => void);
20
20
  };
21
21
  export declare const swap: (doc: Document) => void;
22
- //# sourceMappingURL=swap-functions.d.ts.map
@@ -6,7 +6,22 @@
6
6
  // contract). vueScopedStyleId is intentionally KEPT verbatim per W2A §2.8 (the W3B
7
7
  // issue body's "DELETE" instruction is overridden by W2A's reclassification).
8
8
  const PERSIST_ATTR = "data-zfb-transition-persist";
9
+ // Cross-package "needs-remount" flag written onto a persisted island whose props
10
+ // changed across the swap. @takazudo/zfb's mountNewIslands consumes it — the
11
+ // island mounted-map lives in that separate package, so a DOM attribute is the
12
+ // only channel the two packages share. Namespaced under data-zfb-* like every
13
+ // other zfb marker so it can't collide with a bare attribute a consumer sets on
14
+ // the same island root. Replaces the opaque `ssr` attribute the original Astro
15
+ // port set here but nothing consumed — zfb islands are marker divs, not
16
+ // <astro-island> custom elements. See client-router/port-spec.md §12.3 / #1389.
17
+ const ISLAND_REMOUNT_ATTR = "data-zfb-island-remount";
9
18
  const NON_OVERRIDABLE_ZFB_ATTRS = ["data-zfb-transition", "data-zfb-transition-fallback"];
19
+ // Consumers extend the preserve-set via <meta name="zfb-preserve-html-attrs"
20
+ // content="data-theme data-sidebar-hidden …">, emitted by
21
+ // <ClientRouter preserveHtmlAttrs={[…]} />. Without it, a runtime <html>
22
+ // attribute set from a persisted island is wiped on every swap. See
23
+ // client-router/port-spec.md deviation #11 and Takazudo/zudo-front-builder#1103.
24
+ const PRESERVE_ATTRS_META_NAME = "zfb-preserve-html-attrs";
10
25
  const knownVueScopedStyles = new Map();
11
26
  const scriptsAlreadyRan = new Set();
12
27
  export function detectScriptExecuted(script) {
@@ -32,16 +47,45 @@ export function deselectScripts(doc) {
32
47
  }
33
48
  }
34
49
  }
50
+ /*
51
+ * Read the consumer-configured preserve-list from the live document's
52
+ * <meta name="zfb-preserve-html-attrs"> tag. The list is a site-wide, static
53
+ * contract (the tag is rendered on every page, so it is present on both the
54
+ * current and incoming documents); reading the live document is sufficient.
55
+ * Returns [] when the tag is absent.
56
+ */
57
+ function consumerPreservedAttrs() {
58
+ const content = document
59
+ .querySelector(`meta[name="${PRESERVE_ATTRS_META_NAME}"]`)
60
+ ?.getAttribute("content");
61
+ // Attribute names are ASCII-case-insensitive and the DOM exposes them
62
+ // lowercased, so normalize the list to match (NON_OVERRIDABLE_ZFB_ATTRS is
63
+ // already lowercase). Without this, a mixed-case entry would silently never
64
+ // match the live attribute name.
65
+ return content ? content.toLowerCase().split(/\s+/).filter(Boolean) : [];
66
+ }
67
+ const attrValueSelector = (attr, value) => value === "" ? `[${attr}=""]` : `[${attr}=${CSS.escape(value)}]`;
68
+ const querySelectorWithAttrValue = (root, selectorPrefix, attr, value) => {
69
+ const escapedMatch = root.querySelector(`${selectorPrefix}${attrValueSelector(attr, value)}`);
70
+ if (escapedMatch)
71
+ return escapedMatch;
72
+ return (Array.from(root.querySelectorAll(`${selectorPrefix}[${attr}]`)).find((el) => el.getAttribute(attr) === value) ?? null);
73
+ };
35
74
  /*
36
75
  * swap attributes of the html element
37
76
  * delete all attributes from the current document
38
77
  * insert all attributes from doc
39
- * reinsert all original attributes that are referenced in NON_OVERRIDABLE_ZFB_ATTRS'
78
+ * reinsert all original attributes whose name is in the preserve-set:
79
+ * NON_OVERRIDABLE_ZFB_ATTRS (transition-internal) ∪ the consumer preserve-list.
80
+ * Preserved attributes are re-applied last, so a runtime value on the current
81
+ * root wins over the incoming document's default (e.g. a localStorage-driven
82
+ * data-theme). See client-router/port-spec.md deviation #11 / #1103.
40
83
  */
41
84
  export function swapRootAttributes(newDoc) {
42
85
  const currentRoot = document.documentElement;
43
- const nonOverridableZfbAttributes = [...currentRoot.attributes].filter(({ name }) => (currentRoot.removeAttribute(name), NON_OVERRIDABLE_ZFB_ATTRS.includes(name)));
44
- [...newDoc.documentElement.attributes, ...nonOverridableZfbAttributes].forEach(({ name, value }) => currentRoot.setAttribute(name, value));
86
+ const preserve = new Set([...NON_OVERRIDABLE_ZFB_ATTRS, ...consumerPreservedAttrs()]);
87
+ const preservedAttributes = [...currentRoot.attributes].filter(({ name }) => (currentRoot.removeAttribute(name), preserve.has(name)));
88
+ [...newDoc.documentElement.attributes, ...preservedAttributes].forEach(({ name, value }) => currentRoot.setAttribute(name, value));
45
89
  }
46
90
  /*
47
91
  * make the old head look like the new one
@@ -88,7 +132,7 @@ export function swapBodyElement(newElement, oldElement) {
88
132
  : null;
89
133
  for (const el of oldElement.querySelectorAll(`[${PERSIST_ATTR}]`)) {
90
134
  const id = el.getAttribute(PERSIST_ATTR);
91
- const newEl = newElement.querySelector(`[${PERSIST_ATTR}="${id}"]`);
135
+ const newEl = id !== null ? querySelectorWithAttrValue(newElement, "", PERSIST_ATTR, id) : null;
92
136
  if (!newEl)
93
137
  continue; // no matching target — leave in old body to be discarded
94
138
  persistPairs.push({ old: el, newTarget: newEl });
@@ -110,13 +154,25 @@ export function swapBodyElement(newElement, oldElement) {
110
154
  else {
111
155
  newTarget.replaceWith(el);
112
156
  }
113
- // For islands, copy over the props to allow them to re-render
157
+ // Persist-props hybrid path (port-spec §12.3.1 hybrid case / §12.3.2): the
158
+ // persisted island survived the lift with its live component instance, but
159
+ // the incoming page carries different props. Refresh data-props on the
160
+ // surviving node and flag it with ISLAND_REMOUNT_ATTR. That flag is the
161
+ // cross-package "needs-remount" signal consumed by @takazudo/zfb's
162
+ // mountNewIslands (clearMountedForRemount): it can't be an in-memory queue
163
+ // because the islands runtime's mounted-map lives in a different package, so
164
+ // the flagged DOM node itself is the queue. mountNewIslands unmounts the
165
+ // stale instance and re-mounts against this node with the new data-props.
114
166
  if (newTarget.matches("[data-zfb-island]") &&
115
167
  shouldCopyProps(el) &&
116
168
  !isSameProps(el, newTarget)) {
117
- el.setAttribute("ssr", "");
169
+ el.setAttribute(ISLAND_REMOUNT_ATTR, "");
118
170
  // zfb island wrapper writes SSR props to data-props, not props (different attribute, not just renamed).
119
- el.setAttribute("data-props", newTarget.getAttribute("data-props"));
171
+ const np = newTarget.getAttribute("data-props");
172
+ if (np !== null)
173
+ el.setAttribute("data-props", np);
174
+ else
175
+ el.removeAttribute("data-props");
120
176
  }
121
177
  }
122
178
  // This will upgrade any Declarative Shadow DOM in the new body.
@@ -185,13 +241,15 @@ export const vueScopedStyleId = (el) => {
185
241
  // either because it has the data attribute or because replacing it would cause avoidable FOUC.
186
242
  const persistedHeadElement = (el, newDoc) => {
187
243
  const id = el.getAttribute(PERSIST_ATTR);
188
- const newEl = id && newDoc.head.querySelector(`[${PERSIST_ATTR}="${id}"]`);
244
+ const newEl = id !== null ? querySelectorWithAttrValue(newDoc.head, "", PERSIST_ATTR, id) : null;
189
245
  if (newEl) {
190
246
  return newEl;
191
247
  }
192
248
  if (el.matches("link[rel=stylesheet]")) {
193
249
  const href = el.getAttribute("href");
194
- return newDoc.head.querySelector(`link[rel=stylesheet][href="${href}"]`);
250
+ return href !== null
251
+ ? querySelectorWithAttrValue(newDoc.head, "link[rel=stylesheet]", "href", href)
252
+ : null;
195
253
  }
196
254
  // In dev mode, Vite injects <style data-vite-dev-id="..."> elements whose
197
255
  // textContent may later be transformed (especially Vue's `:deep()` → `[data-v-xxx]`).
@@ -204,7 +262,7 @@ const persistedHeadElement = (el, newDoc) => {
204
262
  if (import.meta.env?.DEV && el instanceof HTMLStyleElement) {
205
263
  const viteDevId = vueScopedStyleId(el);
206
264
  if (viteDevId) {
207
- return newDoc.head.querySelector(`style[data-vite-dev-id="${viteDevId}"]`);
265
+ return querySelectorWithAttrValue(newDoc.head, "style", "data-vite-dev-id", viteDevId);
208
266
  }
209
267
  }
210
268
  // Preserve inline <style> elements with identical content across navigations.
@@ -222,7 +280,9 @@ const persistedHeadElement = (el, newDoc) => {
222
280
  // Preserve font preload links across navigations to avoid re-fetching cached fonts.
223
281
  if (el.matches("link[rel=preload][as=font]")) {
224
282
  const href = el.getAttribute("href");
225
- return newDoc.head.querySelector(`link[rel=preload][as=font][href="${href}"]`);
283
+ return href !== null
284
+ ? querySelectorWithAttrValue(newDoc.head, "link[rel=preload][as=font]", "href", href)
285
+ : null;
226
286
  }
227
287
  return null;
228
288
  };
@@ -1 +1 @@
1
- {"version":3,"file":"swap-functions.js","sourceRoot":"","sources":["../../src/client-router/swap-functions.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,oCAAoC;AACpC,+EAA+E;AAC/E,mFAAmF;AACnF,2FAA2F;AAC3F,mFAAmF;AACnF,8EAA8E;AAQ9E,MAAM,YAAY,GAAG,6BAA6B,CAAC;AAEnD,MAAM,yBAAyB,GAAG,CAAC,qBAAqB,EAAE,8BAA8B,CAAC,CAAC;AAE1F,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAA4B,CAAC;AAEjE,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;AAC5C,MAAM,UAAU,oBAAoB,CAAC,MAAyB;IAC5D,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,WAAY,CAAC;IACvF,IAAI,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5C,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,GAAa;IAC3C,KAAK,MAAM,EAAE,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;QAC7B;QACE,sEAAsE;QACtE,CAAC,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC;YAClC,gDAAgD;YAChD,oB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,IAAI,GAAG,CAAC,GAAa,EAAE,EAAE;IACpC,eAAe,CAAC,GAAG,CAAC,CAAC;IACrB,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACxB,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACtB,MAAM,oBAAoB,GAAG,SAAS,EAAE,CAAC;IACzC,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzC,oBAAoB,EAAE,CAAC;AACzB,CAAC,CAAC","sourcesContent":["/// <reference lib=\"dom\" />\n/// <reference lib=\"dom.iterable\" />\n// Ported verbatim from Astro transitions/swap-functions.ts. Mechanical renames\n// applied per W1B §13.4 (data-astro-* → data-zfb-*, dataset.astro* → dataset.zfb*,\n// astro-island element-name branch → data-zfb-island marker per W1B §12.3 island-lifecycle\n// contract). vueScopedStyleId is intentionally KEPT verbatim per W2A §2.8 (the W3B\n// issue body's \"DELETE\" instruction is overridden by W2A's reclassification).\n\nexport type SavedFocus = {\n activeElement: HTMLElement | null;\n start?: number | null;\n end?: number | null;\n};\n\nconst PERSIST_ATTR = \"data-zfb-transition-persist\";\n\n// Cross-package \"needs-remount\" flag written onto a persisted island whose props\n// changed across the swap. @takazudo/zfb's mountNewIslands consumes it — the\n// island mounted-map lives in that separate package, so a DOM attribute is the\n// only channel the two packages share. Namespaced under data-zfb-* like every\n// other zfb marker so it can't collide with a bare attribute a consumer sets on\n// the same island root. Replaces the opaque `ssr` attribute the original Astro\n// port set here but nothing consumed — zfb islands are marker divs, not\n// <astro-island> custom elements. See client-router/port-spec.md §12.3 / #1389.\nconst ISLAND_REMOUNT_ATTR = \"data-zfb-island-remount\";\n\nconst NON_OVERRIDABLE_ZFB_ATTRS = [\"data-zfb-transition\", \"data-zfb-transition-fallback\"];\n\n// Consumers extend the preserve-set via <meta name=\"zfb-preserve-html-attrs\"\n// content=\"data-theme data-sidebar-hidden …\">, emitted by\n// <ClientRouter preserveHtmlAttrs={[…]} />. Without it, a runtime <html>\n// attribute set from a persisted island is wiped on every swap. See\n// client-router/port-spec.md deviation #11 and Takazudo/zudo-front-builder#1103.\nconst PRESERVE_ATTRS_META_NAME = \"zfb-preserve-html-attrs\";\n\nconst knownVueScopedStyles = new Map<string, HTMLStyleElement>();\n\nconst scriptsAlreadyRan = new Set<string>();\nexport function detectScriptExecuted(script: HTMLScriptElement) {\n const key = script.src ? new URL(script.src, location.href).href : script.textContent!;\n if (scriptsAlreadyRan.has(key)) return true;\n scriptsAlreadyRan.add(key);\n return false;\n}\n\n/*\n * \tMark new scripts that should not execute\n */\nexport function deselectScripts(doc: Document) {\n for (const s2 of doc.scripts) {\n if (\n // Check if the script should be rerun regardless of it being the same\n !s2.hasAttribute(\"data-zfb-rerun\") &&\n // Check if the script has already been executed\n detectScriptExecuted(s2)\n ) {\n // the old script is in the new document and doesn't have the rerun attribute\n // we mark it as executed to prevent re-execution\n s2.dataset[\"zfbExec\"] = \"\";\n }\n }\n}\n\n/*\n * Read the consumer-configured preserve-list from the live document's\n * <meta name=\"zfb-preserve-html-attrs\"> tag. The list is a site-wide, static\n * contract (the tag is rendered on every page, so it is present on both the\n * current and incoming documents); reading the live document is sufficient.\n * Returns [] when the tag is absent.\n */\nfunction consumerPreservedAttrs(): string[] {\n const content = document\n .querySelector(`meta[name=\"${PRESERVE_ATTRS_META_NAME}\"]`)\n ?.getAttribute(\"content\");\n // Attribute names are ASCII-case-insensitive and the DOM exposes them\n // lowercased, so normalize the list to match (NON_OVERRIDABLE_ZFB_ATTRS is\n // already lowercase). Without this, a mixed-case entry would silently never\n // match the live attribute name.\n return content ? content.toLowerCase().split(/\\s+/).filter(Boolean) : [];\n}\n\nconst attrValueSelector = (attr: string, value: string): string =>\n value === \"\" ? `[${attr}=\"\"]` : `[${attr}=${CSS.escape(value)}]`;\n\nconst querySelectorWithAttrValue = (\n root: ParentNode,\n selectorPrefix: string,\n attr: string,\n value: string,\n): Element | null => {\n const escapedMatch = root.querySelector(`${selectorPrefix}${attrValueSelector(attr, value)}`);\n if (escapedMatch) return escapedMatch;\n return (\n Array.from(root.querySelectorAll(`${selectorPrefix}[${attr}]`)).find(\n (el) => el.getAttribute(attr) === value,\n ) ?? null\n );\n};\n\n/*\n * swap attributes of the html element\n * delete all attributes from the current document\n * insert all attributes from doc\n * reinsert all original attributes whose name is in the preserve-set:\n * NON_OVERRIDABLE_ZFB_ATTRS (transition-internal) ∪ the consumer preserve-list.\n * Preserved attributes are re-applied last, so a runtime value on the current\n * root wins over the incoming document's default (e.g. a localStorage-driven\n * data-theme). See client-router/port-spec.md deviation #11 / #1103.\n */\nexport function swapRootAttributes(newDoc: Document) {\n const currentRoot = document.documentElement;\n const preserve = new Set([...NON_OVERRIDABLE_ZFB_ATTRS, ...consumerPreservedAttrs()]);\n const preservedAttributes = [...currentRoot.attributes].filter(\n ({ name }) => (currentRoot.removeAttribute(name), preserve.has(name)),\n );\n [...newDoc.documentElement.attributes, ...preservedAttributes].forEach(({ name, value }) =>\n currentRoot.setAttribute(name, value),\n );\n}\n\n/*\n * make the old head look like the new one\n */\nexport function swapHeadElements(doc: Document) {\n for (const el of Array.from(document.head.children)) {\n const newEl = persistedHeadElement(el as HTMLElement, doc);\n // If the element exists in the document already, remove it\n // from the new document and leave the current node alone\n if (newEl) {\n newEl.remove();\n } else {\n if ((import.meta as any).env?.DEV && el instanceof HTMLStyleElement) {\n // In DEV mode, keep updated Vue scoped styles for later reuse\n const viteDevId = vueScopedStyleId(el);\n viteDevId && knownVueScopedStyles.set(viteDevId, el);\n }\n // If the element does not exist in the new document, remove the element from current the head.\n el.remove();\n }\n }\n\n // Everything left in the new head is new, append it all.\n if ((import.meta as any).env?.DEV) {\n // In DEV mode, replace known Vue scoped styles with the versions we remembered\n [...doc.head.children].forEach((child) => {\n document.head.append(knownVueScopedStyles.get((child as any).dataset?.viteDevId) || child);\n });\n } else {\n document.head.append(...doc.head.children);\n }\n}\n\nexport function swapBodyElement(newElement: Element, oldElement: Element) {\n // Lift persist elements to <html> before the body swap so they stay in the DOM\n // throughout replaceWith(). This prevents Safari from losing WebGL context on\n // <canvas> elements due to brief DOM detachment. Uses moveBefore() where available\n // (Chrome 133+) for zero-detachment atomic moves.\n const persistPairs: { old: Element; newTarget: Element }[] = [];\n const docEl = oldElement.ownerDocument.documentElement;\n\n // moveBefore() is not yet in TypeScript's DOM lib, feature-detect and wrap.\n const moveBefore: ((parent: Node, node: Node, child: Node | null) => void) | null =\n typeof (docEl as any).moveBefore === \"function\"\n ? (parent, node, child) => (parent as any).moveBefore(node, child)\n : null;\n\n for (const el of oldElement.querySelectorAll(`[${PERSIST_ATTR}]`)) {\n const id = el.getAttribute(PERSIST_ATTR);\n const newEl = id !== null ? querySelectorWithAttrValue(newElement, \"\", PERSIST_ATTR, id) : null;\n if (!newEl) continue; // no matching target — leave in old body to be discarded\n persistPairs.push({ old: el, newTarget: newEl });\n if (moveBefore) {\n moveBefore(docEl, el, null);\n } else {\n docEl.appendChild(el);\n }\n }\n\n // this will reset scroll Position\n oldElement.replaceWith(newElement);\n\n // Move persist elements into the new body at the position of their targets\n for (const { old: el, newTarget } of persistPairs) {\n if (moveBefore) {\n moveBefore(newTarget.parentNode!, el, newTarget);\n newTarget.remove();\n } else {\n newTarget.replaceWith(el);\n }\n // Persist-props hybrid path (port-spec §12.3.1 hybrid case / §12.3.2): the\n // persisted island survived the lift with its live component instance, but\n // the incoming page carries different props. Refresh data-props on the\n // surviving node and flag it with ISLAND_REMOUNT_ATTR. That flag is the\n // cross-package \"needs-remount\" signal consumed by @takazudo/zfb's\n // mountNewIslands (clearMountedForRemount): it can't be an in-memory queue\n // because the islands runtime's mounted-map lives in a different package, so\n // the flagged DOM node itself is the queue. mountNewIslands unmounts the\n // stale instance and re-mounts against this node with the new data-props.\n if (\n newTarget.matches(\"[data-zfb-island]\") &&\n shouldCopyProps(el as HTMLElement) &&\n !isSameProps(el, newTarget)\n ) {\n el.setAttribute(ISLAND_REMOUNT_ATTR, \"\");\n // zfb island wrapper writes SSR props to data-props, not props (different attribute, not just renamed).\n const np = newTarget.getAttribute(\"data-props\");\n if (np !== null) el.setAttribute(\"data-props\", np);\n else el.removeAttribute(\"data-props\");\n }\n }\n\n // This will upgrade any Declarative Shadow DOM in the new body.\n attachShadowRoots(newElement);\n}\n\n/**\n * Attach Shadow DOM roots for templates with the declarative `shadowrootmode` attribute.\n * @see https://web.dev/articles/declarative-shadow-dom#polyfill\n * @param root DOM subtree to attach shadow roots within.\n */\nfunction attachShadowRoots(root: Element | ShadowRoot) {\n root.querySelectorAll<HTMLTemplateElement>(\"template[shadowrootmode]\").forEach((template) => {\n const mode = template.getAttribute(\"shadowrootmode\");\n const parent = template.parentNode;\n if ((mode === \"closed\" || mode === \"open\") && parent instanceof HTMLElement) {\n // Skip if shadow root already exists (e.g., from transition-persisted elements)\n if (parent.shadowRoot) {\n template.remove();\n return;\n }\n const shadowRoot = parent.attachShadow({ mode });\n shadowRoot.appendChild(template.content);\n template.remove();\n attachShadowRoots(shadowRoot);\n }\n });\n}\n\nexport const saveFocus = (): (() => void) => {\n const activeElement = document.activeElement as HTMLElement;\n // The element that currently has the focus is part of a DOM tree\n // that will survive the transition to the new document.\n // Save the element and the cursor position\n if (activeElement?.closest(`[${PERSIST_ATTR}]`)) {\n if (activeElement instanceof HTMLInputElement || activeElement instanceof HTMLTextAreaElement) {\n const start = activeElement.selectionStart;\n const end = activeElement.selectionEnd;\n return () => restoreFocus({ activeElement, start, end });\n }\n return () => restoreFocus({ activeElement });\n } else {\n return () => restoreFocus({ activeElement: null });\n }\n};\n\nexport const restoreFocus = ({ activeElement, start, end }: SavedFocus) => {\n if (activeElement) {\n activeElement.focus();\n if (activeElement instanceof HTMLInputElement || activeElement instanceof HTMLTextAreaElement) {\n if (typeof start === \"number\") activeElement.selectionStart = start;\n if (typeof end === \"number\") activeElement.selectionEnd = end;\n }\n }\n};\n\nexport const vueScopedStyleId = (el: HTMLStyleElement): string => {\n const viteDevId = el.dataset[\"viteDevId\"] || \"\";\n\n const url = new URL(viteDevId, location.href);\n return url.searchParams.get(\"vue\") !== null &&\n url.searchParams.get(\"type\") === \"style\" &&\n url.searchParams.has(\"scoped\")\n ? viteDevId\n : \"\";\n};\n\n// Check for a head element that should persist and returns it,\n// either because it has the data attribute or because replacing it would cause avoidable FOUC.\nconst persistedHeadElement = (el: HTMLElement, newDoc: Document): Element | null => {\n const id = el.getAttribute(PERSIST_ATTR);\n const newEl = id !== null ? querySelectorWithAttrValue(newDoc.head, \"\", PERSIST_ATTR, id) : null;\n if (newEl) {\n return newEl;\n }\n if (el.matches(\"link[rel=stylesheet]\")) {\n const href = el.getAttribute(\"href\");\n return href !== null\n ? querySelectorWithAttrValue(newDoc.head, \"link[rel=stylesheet]\", \"href\", href)\n : null;\n }\n // In dev mode, Vite injects <style data-vite-dev-id=\"...\"> elements whose\n // textContent may later be transformed (especially Vue's `:deep()` → `[data-v-xxx]`).\n // Match these by their stable dev ID so the already-transformed style is preserved\n // across ClientRouter soft navigations instead of being replaced by the raw version.\n // There are other ids that can't be preserved and need a refresh, like Uno's /__uno.css,\n // which keeps the same id, but with different contents.\n // To avoid enumerating all exceptions, we only apply the auto-persist logic to elements\n // that look like Vue's dev styles.\n if ((import.meta as any).env?.DEV && el instanceof HTMLStyleElement) {\n const viteDevId = vueScopedStyleId(el);\n if (viteDevId) {\n return querySelectorWithAttrValue(newDoc.head, \"style\", \"data-vite-dev-id\", viteDevId);\n }\n }\n // Preserve inline <style> elements with identical content across navigations.\n // This prevents unnecessary removal and re-insertion of styles (e.g. @font-face\n // declarations from <Font>), which would cause the browser to re-evaluate them\n // and trigger a flash of unstyled text (FOUT).\n if (el.tagName === \"STYLE\" && el.textContent) {\n const styles = newDoc.head.querySelectorAll(\"style\");\n for (const s of styles) {\n if (s.textContent === el.textContent) {\n return s;\n }\n }\n }\n // Preserve font preload links across navigations to avoid re-fetching cached fonts.\n if (el.matches(\"link[rel=preload][as=font]\")) {\n const href = el.getAttribute(\"href\");\n return href !== null\n ? querySelectorWithAttrValue(newDoc.head, \"link[rel=preload][as=font]\", \"href\", href)\n : null;\n }\n return null;\n};\n\nconst shouldCopyProps = (el: HTMLElement): boolean => {\n const persistProps = el.dataset[\"zfbTransitionPersistProps\"];\n return persistProps == null || persistProps === \"false\";\n};\n\nconst isSameProps = (oldEl: Element, newEl: Element) => {\n // zfb island wrapper writes SSR props to data-props, not props (different attribute, not just renamed).\n return oldEl.getAttribute(\"data-props\") === newEl.getAttribute(\"data-props\");\n};\n\nexport const swapFunctions = {\n deselectScripts,\n swapRootAttributes,\n swapHeadElements,\n swapBodyElement,\n saveFocus,\n};\n\nexport const swap = (doc: Document) => {\n deselectScripts(doc);\n swapRootAttributes(doc);\n swapHeadElements(doc);\n const restoreFocusFunction = saveFocus();\n swapBodyElement(doc.body, document.body);\n restoreFocusFunction();\n};\n"]}
@@ -8,4 +8,7 @@ export type Options = {
8
8
  formData?: FormData;
9
9
  sourceElement?: Element;
10
10
  };
11
- //# sourceMappingURL=types.d.ts.map
11
+ export type SyncHistoryEntryOptions = {
12
+ replace?: boolean;
13
+ state?: any;
14
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/client-router/types.ts"],"names":[],"mappings":"AAAA,2BAA2B"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/client-router/types.ts"],"names":[],"mappings":"AAAA,2BAA2B","sourcesContent":["/// <reference lib=\"dom\" />\nexport type Fallback = \"none\" | \"animate\" | \"swap\";\nexport type Direction = \"forward\" | \"back\";\nexport type NavigationTypeString = \"push\" | \"replace\" | \"traverse\";\nexport type Options = {\n history?: \"auto\" | \"push\" | \"replace\";\n info?: any;\n state?: any;\n formData?: FormData;\n sourceElement?: Element; // more than HTMLElement, e.g. SVGAElement\n};\n\n// Public options for syncHistoryEntry() (#1377).\nexport type SyncHistoryEntryOptions = {\n // Replace the current history entry instead of pushing a new one.\n replace?: boolean;\n // Consumer state merged into the entry; the router's bookkeeping keys\n // (index/scrollX/scrollY) always take precedence over colliding keys.\n state?: any;\n};\n"]}
@@ -6,6 +6,43 @@ export interface ClientRouterProps {
6
6
  * (hover) by calling prefetchInit({ prefetchAll: true }) once on the client.
7
7
  */
8
8
  prefetchAll?: boolean;
9
+ /**
10
+ * Extra `<html>` attribute names to preserve across SPA swaps. By default the
11
+ * client router copies the incoming server-rendered document's `<html>`
12
+ * attributes onto the live root, dropping any current attribute that isn't
13
+ * internal to the transition machinery — so a *runtime* attribute a consumer
14
+ * sets from a persisted island (e.g. `data-theme` or `data-sidebar-hidden`
15
+ * driven from `localStorage`) is lost on every navigation. List those names
16
+ * here and the router re-applies their current value after each swap. Emitted
17
+ * as a `<meta name="zfb-preserve-html-attrs">` tag that `swapRootAttributes`
18
+ * reads at swap time.
19
+ *
20
+ * Mount with the **same list on every page** that participates in SPA
21
+ * navigation: the preserve-list is read from the *current* (outgoing) page's
22
+ * meta at swap time, so a page that omits an entry drops that attribute when
23
+ * navigating away from it. Names are matched case-insensitively (DOM attribute
24
+ * names are lowercased). For dynamic/computed cases, mutate
25
+ * `event.newDocument.documentElement` in a `zfb:before-swap` listener instead.
26
+ * @see https://github.com/Takazudo/zudo-front-builder/issues/1103
27
+ */
28
+ preserveHtmlAttrs?: string[];
29
+ /**
30
+ * Opt this page OUT of the same-page traverse fast-path (default `false` —
31
+ * fast-path ON). By default a Back/Forward traversal between two history
32
+ * entries sharing the same `pathname + search` is served instantly from the
33
+ * live DOM — no re-fetch, no re-swap, so island/client state is preserved.
34
+ *
35
+ * Set this on a **per-request SSR page** (`prerender = false`) whose
36
+ * server-rendered content can legitimately differ between two visits to the
37
+ * same URL: with the fast-path skipped such a traverse would pin the stale
38
+ * first-render content. Emitted as
39
+ * `<meta name="zfb-traverse-refetch" content="true">`, which the router reads
40
+ * on the current (target) page to force the fetch back on. Mount with the
41
+ * **same value on every page** that participates in SPA navigation, mirroring
42
+ * the `preserveHtmlAttrs` guidance.
43
+ * @see https://github.com/Takazudo/zudo-front-builder/issues/1376
44
+ */
45
+ traverseRefetch?: boolean;
9
46
  }
10
47
  /**
11
48
  * Public element shape for each node returned by `<ClientRouter />`.
@@ -32,5 +69,4 @@ export type ClientRouterElement = {
32
69
  * <ClientRouter fallback="animate" />
33
70
  * ```
34
71
  */
35
- export declare function ClientRouter({ fallback, prefetchAll: prefetchAllProp, }?: ClientRouterProps): readonly ClientRouterElement[];
36
- //# sourceMappingURL=client-router.d.ts.map
72
+ export declare function ClientRouter({ fallback, prefetchAll: prefetchAllProp, preserveHtmlAttrs, traverseRefetch, }?: ClientRouterProps): readonly ClientRouterElement[];