@takazudo/zfb-runtime 0.1.0-next.74 → 0.1.0-next.76

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 (44) hide show
  1. package/dist/client-router/events.d.ts +0 -1
  2. package/dist/client-router/events.js.map +1 -1
  3. package/dist/client-router/index.d.ts +2 -3
  4. package/dist/client-router/index.js +2 -1
  5. package/dist/client-router/index.js.map +1 -1
  6. package/dist/client-router/prefetch.d.ts +0 -1
  7. package/dist/client-router/prefetch.js.map +1 -1
  8. package/dist/client-router/router.d.ts +2 -2
  9. package/dist/client-router/router.js +80 -2
  10. package/dist/client-router/router.js.map +1 -1
  11. package/dist/client-router/swap-functions.d.ts +0 -1
  12. package/dist/client-router/swap-functions.js.map +1 -1
  13. package/dist/client-router/types.d.ts +4 -1
  14. package/dist/client-router/types.js.map +1 -1
  15. package/dist/client-router.d.ts +18 -2
  16. package/dist/client-router.js +11 -1
  17. package/dist/client-router.js.map +1 -1
  18. package/dist/framework.d.ts +0 -1
  19. package/dist/framework.js.map +1 -1
  20. package/dist/index.d.ts +2 -3
  21. package/dist/index.js +1 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/router.d.ts +0 -1
  24. package/dist/router.js.map +1 -1
  25. package/dist/server.d.ts +0 -1
  26. package/dist/server.js.map +1 -1
  27. package/dist/snapshot.d.ts +0 -1
  28. package/dist/snapshot.js.map +1 -1
  29. package/dist/view-transitions.d.ts +0 -1
  30. package/dist/view-transitions.js.map +1 -1
  31. package/package.json +3 -3
  32. package/dist/client-router/events.d.ts.map +0 -1
  33. package/dist/client-router/index.d.ts.map +0 -1
  34. package/dist/client-router/prefetch.d.ts.map +0 -1
  35. package/dist/client-router/router.d.ts.map +0 -1
  36. package/dist/client-router/swap-functions.d.ts.map +0 -1
  37. package/dist/client-router/types.d.ts.map +0 -1
  38. package/dist/client-router.d.ts.map +0 -1
  39. package/dist/framework.d.ts.map +0 -1
  40. package/dist/index.d.ts.map +0 -1
  41. package/dist/router.d.ts.map +0 -1
  42. package/dist/server.d.ts.map +0 -1
  43. package/dist/snapshot.d.ts.map +0 -1
  44. package/dist/view-transitions.d.ts.map +0 -1
@@ -39,4 +39,3 @@ export declare const updateScrollPosition: (positions: {
39
39
  }) => void;
40
40
  export declare function doSwap(afterPreparation: BeforeEvent, viewTransition: ViewTransition, afterDispatch?: () => Promise<void>): Promise<TransitionBeforeSwapEvent>;
41
41
  export {};
42
- //# sourceMappingURL=events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/client-router/events.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAG3C,MAAM,CAAC,MAAM,6BAA6B,GAAG,wBAAwB,CAAC;AACtE,MAAM,CAAC,MAAM,4BAA4B,GAAG,uBAAuB,CAAC;AACpE,MAAM,CAAC,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AACxD,MAAM,CAAC,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AACtD,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC;AACpD,MAAM,CAAC,MAAM,6BAA6B,GAAG,wBAAwB,CAAC;AAOtE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACtF,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAY,SAAQ,KAAK;IACpB,IAAI,CAAM;IACnB,EAAE,CAAM;IACR,SAAS,CAAqB;IACrB,cAAc,CAAuB;IACrC,aAAa,CAAsB;IACnC,IAAI,CAAM;IACnB,WAAW,CAAW;IACb,MAAM,CAAc;IAE7B,YACE,IAAY,EACZ,aAAoC,EACpC,IAAS,EACT,E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AY,CAAC,uBAAuB,CAAC,CAAC;YACtC,IAAI,KAAK,CAAC,cAAc,KAAK,UAAU,EAAE,CAAC;gBACxC,2FAA2F;gBAC3F,oBAAoB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,qDAAqD;AACrD,+DAA+D;AAC/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAA+C,EAAE,EAAE;IACtF,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO,CAAC,iBAAiB,GAAG,QAAQ,CAAC;QACrC,OAAO,CAAC,YAAY,CAAC,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,GAAG,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,gBAA6B,EAC7B,cAA8B,EAC9B,aAAmC;IAEnC,MAAM,KAAK,GAAG,IAAI,yBAAyB,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;IAC9E,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,aAAa,EAAE,CAAC;IACxB,CAAC;IACD,KAAK,CAAC,IAAI,EAAE,CAAC;IACb,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/// <reference lib=\"dom\" />\nimport { swap } from \"./swap-functions.js\";\nimport type { Direction, NavigationTypeString } from \"./types.js\";\n\nexport const TRANSITION_BEFORE_PREPARATION = \"zfb:before-preparation\";\nexport const TRANSITION_AFTER_PREPARATION = \"zfb:after-preparation\";\nexport const TRANSITION_BEFORE_SWAP = \"zfb:before-swap\";\nexport const TRANSITION_AFTER_SWAP = \"zfb:after-swap\";\nexport const TRANSITION_PAGE_LOAD = \"zfb:page-load\";\nexport const TRANSITION_NAVIGATION_ABORTED = \"zfb:navigation-aborted\";\n\ntype Events =\n | \"zfb:after-preparation\"\n | \"zfb:after-swap\"\n | \"zfb:page-load\"\n | \"zfb:navigation-aborted\";\nexport const triggerEvent = (name: Events) => document.dispatchEvent(new Event(name));\nexport const onPageLoad = () => triggerEvent(\"zfb:page-load\");\n\n/*\n * Common stuff\n */\nclass BeforeEvent extends Event {\n readonly from: URL;\n to: URL;\n direction: Direction | string;\n readonly navigationType: NavigationTypeString;\n readonly sourceElement: Element | undefined;\n readonly info: any;\n newDocument: Document;\n readonly signal: AbortSignal;\n\n constructor(\n type: string,\n eventInitDict: EventInit | undefined,\n from: URL,\n to: URL,\n direction: Direction | string,\n navigationType: NavigationTypeString,\n sourceElement: Element | undefined,\n info: any,\n newDocument: Document,\n signal: AbortSignal,\n ) {\n super(type, eventInitDict);\n this.from = from;\n this.to = to;\n this.direction = direction;\n this.navigationType = navigationType;\n this.sourceElement = sourceElement;\n this.info = info;\n this.newDocument = newDocument;\n this.signal = signal;\n\n Object.defineProperties(this, {\n from: { enumerable: true },\n to: { enumerable: true, writable: true },\n direction: { enumerable: true, writable: true },\n navigationType: { enumerable: true },\n sourceElement: { enumerable: true },\n info: { enumerable: true },\n newDocument: { enumerable: true, writable: true },\n signal: { enumerable: true },\n });\n }\n}\n\n/*\n * TransitionBeforePreparationEvent\n\n */\nexport const isTransitionBeforePreparationEvent = (\n value: any,\n): value is TransitionBeforePreparationEvent =>\n typeof value === \"object\" && value !== null && value.type === TRANSITION_BEFORE_PREPARATION;\nexport class TransitionBeforePreparationEvent extends BeforeEvent {\n formData: FormData | undefined;\n loader: () => Promise<void>;\n constructor(\n from: URL,\n to: URL,\n direction: Direction | string,\n navigationType: NavigationTypeString,\n sourceElement: Element | undefined,\n info: any,\n newDocument: Document,\n signal: AbortSignal,\n formData: FormData | undefined,\n loader: (event: TransitionBeforePreparationEvent) => Promise<void>,\n ) {\n super(\n TRANSITION_BEFORE_PREPARATION,\n { cancelable: true },\n from,\n to,\n direction,\n navigationType,\n sourceElement,\n info,\n newDocument,\n signal,\n );\n this.formData = formData;\n this.loader = loader.bind(this, this);\n Object.defineProperties(this, {\n formData: { enumerable: true },\n loader: { enumerable: true, writable: true },\n });\n }\n}\n\n/*\n * TransitionBeforeSwapEvent\n */\nexport const isTransitionBeforeSwapEvent = (value: any): value is TransitionBeforeSwapEvent =>\n typeof value === \"object\" && value !== null && value.type === TRANSITION_BEFORE_SWAP;\nexport class TransitionBeforeSwapEvent extends BeforeEvent {\n override readonly direction: Direction | string;\n readonly viewTransition: ViewTransition;\n swap: () => void;\n\n constructor(afterPreparation: BeforeEvent, viewTransition: ViewTransition) {\n super(\n TRANSITION_BEFORE_SWAP,\n undefined,\n afterPreparation.from,\n afterPreparation.to,\n afterPreparation.direction,\n afterPreparation.navigationType,\n afterPreparation.sourceElement,\n afterPreparation.info,\n afterPreparation.newDocument,\n afterPreparation.signal,\n );\n this.direction = afterPreparation.direction;\n this.viewTransition = viewTransition;\n this.swap = () => swap(this.newDocument);\n\n Object.defineProperties(this, {\n direction: { enumerable: true },\n viewTransition: { enumerable: true },\n swap: { enumerable: true, writable: true },\n });\n }\n}\n\nexport async function doPreparation(\n from: URL,\n to: URL,\n direction: Direction | string,\n navigationType: NavigationTypeString,\n sourceElement: Element | undefined,\n info: any,\n signal: AbortSignal,\n formData: FormData | undefined,\n defaultLoader: (event: TransitionBeforePreparationEvent) => Promise<void>,\n) {\n const event = new TransitionBeforePreparationEvent(\n from,\n to,\n direction,\n navigationType,\n sourceElement,\n info,\n window.document,\n signal,\n formData,\n defaultLoader,\n );\n if (document.dispatchEvent(event)) {\n await event.loader();\n if (!event.defaultPrevented) {\n triggerEvent(\"zfb:after-preparation\");\n if (event.navigationType !== \"traverse\") {\n // save the current scroll position before we change the DOM and transition to the new page\n updateScrollPosition({ scrollX, scrollY });\n }\n }\n }\n return event;\n}\n\n// only update history entries that are managed by us\n// leave other entries alone and do not accidentally add state.\nexport const updateScrollPosition = (positions: { scrollX: number; scrollY: number }) => {\n if (history.state) {\n history.scrollRestoration = \"manual\";\n history.replaceState({ ...history.state, ...positions }, \"\");\n }\n};\n\nexport async function doSwap(\n afterPreparation: BeforeEvent,\n viewTransition: ViewTransition,\n afterDispatch?: () => Promise<void>,\n) {\n const event = new TransitionBeforeSwapEvent(afterPreparation, viewTransition);\n document.dispatchEvent(event);\n if (afterDispatch) {\n await afterDispatch();\n }\n event.swap();\n return event;\n}\n"]}
@@ -1,9 +1,8 @@
1
1
  export { ClientRouter, type ClientRouterProps } from "../client-router.js";
2
2
  export { TRANSITION_BEFORE_PREPARATION, TRANSITION_AFTER_PREPARATION, TRANSITION_BEFORE_SWAP, TRANSITION_AFTER_SWAP, TRANSITION_PAGE_LOAD, TRANSITION_NAVIGATION_ABORTED, TransitionBeforePreparationEvent, TransitionBeforeSwapEvent, isTransitionBeforePreparationEvent, isTransitionBeforeSwapEvent, } from "./events.js";
3
- export type { Direction, Fallback, NavigationTypeString, Options } from "./types.js";
3
+ export type { Direction, Fallback, NavigationTypeString, Options, SyncHistoryEntryOptions, } from "./types.js";
4
4
  export { swapFunctions, swap } from "./swap-functions.js";
5
- export { navigate, supportsViewTransitions, transitionEnabledOnThisPage, init } from "./router.js";
5
+ export { navigate, supportsViewTransitions, transitionEnabledOnThisPage, init, syncHistoryEntry, } from "./router.js";
6
6
  export type { InitOptions } from "./router.js";
7
7
  export { prefetch, init as prefetchInit } from "./prefetch.js";
8
8
  export type { PrefetchStrategy, PrefetchInitOptions, PrefetchOptions } from "./prefetch.js";
9
- //# sourceMappingURL=index.d.ts.map
@@ -9,7 +9,8 @@ export { swapFunctions, swap } from "./swap-functions.js";
9
9
  // - W3C1: `supportsViewTransitions`, `transitionEnabledOnThisPage`.
10
10
  // - W3C2: `navigate()` (public navigation entry).
11
11
  // - W3C3: `init()` (idempotent bootstrap: registers click + form intercept listeners).
12
- export { navigate, supportsViewTransitions, transitionEnabledOnThisPage, init } from "./router.js";
12
+ // - W2 (#1377): `syncHistoryEntry()` (history bookkeeping without navigation).
13
+ export { navigate, supportsViewTransitions, transitionEnabledOnThisPage, init, syncHistoryEntry, } from "./router.js";
13
14
  // Prefetch public surface (#276).
14
15
  // `init` from prefetch.ts is re-exported as `prefetchInit` to avoid colliding
15
16
  // with the router's `init` above.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client-router/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,4EAA4E;AAC5E,4EAA4E;AAE5E,mBAAmB;AACnB,OAAO,EAAE,YAAY,EAA0B,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,gCAAgC,EAChC,yBAAyB,EACzB,kCAAkC,EAClC,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE1D,yBAAyB;AACzB,sEAAsE;AACtE,oDAAoD;AACpD,yFAAyF;AACzF,OAAO,EAAE,QAAQ,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGnG,kCAAkC;AAClC,8EAA8E;AAC9E,kCAAkC;AAClC,OAAO,EAAE,QAAQ,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client-router/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,4EAA4E;AAC5E,4EAA4E;AAE5E,mBAAmB;AACnB,OAAO,EAAE,YAAY,EAA0B,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,gCAAgC,EAChC,yBAAyB,EACzB,kCAAkC,EAClC,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AAUrB,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE1D,yBAAyB;AACzB,sEAAsE;AACtE,oDAAoD;AACpD,yFAAyF;AACzF,iFAAiF;AACjF,OAAO,EACL,QAAQ,EACR,uBAAuB,EACvB,2BAA2B,EAC3B,IAAI,EACJ,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAGrB,kCAAkC;AAClC,8EAA8E;AAC9E,kCAAkC;AAClC,OAAO,EAAE,QAAQ,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC","sourcesContent":["// Public API surface for the client-router module.\n// This file is the barrel for @takazudo/zfb-runtime's client-router export.\n// W3D adds the <ClientRouter /> component and ClientRouterProps re-exports.\n\n// Component (W3D).\nexport { ClientRouter, type ClientRouterProps } from \"../client-router.js\";\n\nexport {\n TRANSITION_BEFORE_PREPARATION,\n TRANSITION_AFTER_PREPARATION,\n TRANSITION_BEFORE_SWAP,\n TRANSITION_AFTER_SWAP,\n TRANSITION_PAGE_LOAD,\n TRANSITION_NAVIGATION_ABORTED,\n TransitionBeforePreparationEvent,\n TransitionBeforeSwapEvent,\n isTransitionBeforePreparationEvent,\n isTransitionBeforeSwapEvent,\n} from \"./events.js\";\n\nexport type {\n Direction,\n Fallback,\n NavigationTypeString,\n Options,\n SyncHistoryEntryOptions,\n} from \"./types.js\";\n\nexport { swapFunctions, swap } from \"./swap-functions.js\";\n\n// Router public surface.\n// - W3C1: `supportsViewTransitions`, `transitionEnabledOnThisPage`.\n// - W3C2: `navigate()` (public navigation entry).\n// - W3C3: `init()` (idempotent bootstrap: registers click + form intercept listeners).\n// - W2 (#1377): `syncHistoryEntry()` (history bookkeeping without navigation).\nexport {\n navigate,\n supportsViewTransitions,\n transitionEnabledOnThisPage,\n init,\n syncHistoryEntry,\n} from \"./router.js\";\nexport type { InitOptions } from \"./router.js\";\n\n// Prefetch public surface (#276).\n// `init` from prefetch.ts is re-exported as `prefetchInit` to avoid colliding\n// with the router's `init` above.\nexport { prefetch, init as prefetchInit } from \"./prefetch.js\";\nexport type { PrefetchStrategy, PrefetchInitOptions, PrefetchOptions } from \"./prefetch.js\";\n"]}
@@ -26,4 +26,3 @@ export declare function prefetch(url: string, opts?: PrefetchOptions): void;
26
26
  * is present in the document at init() time, this function is a no-op.
27
27
  */
28
28
  export declare function init(options?: PrefetchInitOptions): void;
29
- //# sourceMappingURL=prefetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prefetch.js","sourceRoot":"","sources":["../../src/client-router/prefetch.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,oCAAoC;AACpC,6CAA6C;AAC7C,EAAE;AACF,8EAA8E;AAC9E,6CAA6C;AAC7C,yCAAyC;AACzC,EAAE;AACF,oCAAoC;AACpC,yCAAyC;AACzC,qDAAqD;AACrD,sFAAsF;AACtF,EAAE;AACF,6EAA6E;AAC7E,uDAAuD;AACvD,wEAAwE;AAcxE,yEAAyE;AACzE,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB,IAAI,eAAe,GAAqB,OAAO,CAAC;AAEhD,uDAAuD;AACvD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;AACrC,kGAAkG;AAClG,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAyB,CAAC;AAElD,0EAA0E;AAC1E,wDAAwD;AACxD,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAEtC,6EAA6E;AAC7E,mDAAmD;AACnD,IAAI,gBAAgB,GAAgC,IAAI,CAAC;AAEzD,gFAAgF;AAChF,6CAA6C;AAC7C,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAmD,CAAC;AAEtF,2EAA2E;AAC3E,yCAAyC;AACzC,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAmD,CAAC;AAEtF;;;GAGG;AACH,MAAM,UAAU,eAAe;IAC7B,WAAW,GAAG,KAAK,CAAC;IACpB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fb-runtime` — prefetch module.\n//\n// Ported from Astro's prefetch module (packages/astro/src/prefetch/index.ts).\n// Source: https://github.com/withastro/astro\n// Issue: Takazudo/zudo-front-builder#276\n//\n// Mechanical renames per W1B §13.5:\n// astro:* event names → zfb:*\n// data-astro-prefetch → data-zfb-prefetch\n// __PREFETCH_DISABLED__ → <meta name=\"zfb-prefetch-disabled\" content=\"true\">\n//\n// DISABLED-FLAG CONTRACT — exact meta tag name and content value are locked:\n// meta[name=\"zfb-prefetch-disabled\"][content=\"true\"]\n// Both this module and sibling sub-issue #272-config pin this verbatim.\n\nexport type PrefetchStrategy = \"hover\" | \"viewport\" | \"load\" | \"tap\";\n\nexport interface PrefetchInitOptions {\n prefetchAll?: boolean;\n defaultStrategy?: PrefetchStrategy;\n}\n\nexport interface PrefetchOptions {\n ignoreSlowConnection?: boolean;\n with?: \"link\" | \"fetch\";\n}\n\n// Module-level state — persists across SPA navigations within a session.\nlet initialized = false;\nlet prefetchAll = false;\nlet defaultStrategy: PrefetchStrategy = \"hover\";\n\n// Set of hrefs that have been successfully prefetched.\nconst prefetched = new Set<string>();\n// Map of in-flight prefetch promises for dedup (also used as the concurrent short-circuit guard).\nconst inFlight = new Map<string, Promise<void>>();\n\n// How long to wait for a <link rel=prefetch>'s load/error before treating\n// the prefetch as settled anyway (see executePrefetch).\nconst LINK_SETTLE_TIMEOUT_MS = 10_000;\n\n// The viewport observer — retained across post-swap re-scans so new elements\n// can be observed without recreating the observer.\nlet viewportObserver: IntersectionObserver | null = null;\n\n// Hover cancel handle — set when a pointerenter idle-callback fires, cleared on\n// pointerleave before the callback executes.\nconst hoverCancelHandles = new Map<Element, ReturnType<typeof setTimeout> | number>();\n\n// Focus cancel handle — set when a focusin idle-callback fires, cleared on\n// focusout before the callback executes.\nconst focusCancelHandles = new Map<Element, ReturnType<typeof setTimeout> | number>();\n\n/**\n * Reset all module-level state. Exported for test isolation only — not part of\n * the public API and not re-exported from any barrel.\n */\nexport function __resetForTests(): void {\n initialized = false;\n prefetchAll = false;\n defaultStrategy = \"hover\";\n prefetched.clear();\n inFlight.clear();\n if (viewportObserver) {\n viewportObserver.disconnect();\n viewportObserver = null;\n }\n hoverCancelHandles.clear();\n focusCancelHandles.clear();\n}\n\n// ---------------------------------------------------------------------------\n// Feature detection\n// ---------------------------------------------------------------------------\n\nfunction supportsLinkPrefetch(): boolean {\n const link = document.createElement(\"link\");\n return link.relList?.supports?.(\"prefetch\") ?? false;\n}\n\nfunction isSlowConnection(): boolean {\n const nav = navigator as Navigator & {\n connection?: { saveData?: boolean; effectiveType?: string };\n };\n return (\n nav.connection?.saveData === true ||\n nav.connection?.effectiveType === \"2g\" ||\n nav.connection?.effectiveType === \"slow-2g\"\n );\n}\n\n// ---------------------------------------------------------------------------\n// Core prefetch logic\n// ---------------------------------------------------------------------------\n\n/**\n * Resolve an href to an absolute URL string keyed against the current origin.\n * Returns null for cross-origin hrefs (these are skipped entirely).\n */\nfunction resolveHref(href: string): string | null {\n try {\n const url = new URL(href, location.href);\n if (url.origin !== location.origin) return null;\n return url.href;\n } catch {\n return null;\n }\n}\n\n/**\n * Execute a single prefetch for the given absolute href.\n * Uses <link rel=\"prefetch\"> (preferred) or fetch() fallback.\n */\nfunction executePrefetch(href: string, opts: PrefetchOptions): Promise<void> {\n const existing = inFlight.get(href);\n if (existing) return existing;\n\n const p: Promise<void> = (async () => {\n try {\n const method = opts.with ?? (supportsLinkPrefetch() ? \"link\" : \"fetch\");\n if (method === \"link\") {\n const link = document.createElement(\"link\");\n link.rel = \"prefetch\";\n link.href = href;\n // Wait for load/error so we only mark success on actual load and allow\n // retry after error — inserting without waiting would mark success\n // immediately even on failure. (Bug: Takazudo/zudo-front-builder#896)\n // Some browsers (e.g. Safari) never fire load/error on rel=prefetch\n // links; without the settle timeout the href would sit in inFlight\n // forever and block every future retry. Timing out counts as\n // success — the resource was requested, which is all prefetch needs.\n await new Promise<void>((resolve, reject) => {\n const timer = setTimeout(() => resolve(), LINK_SETTLE_TIMEOUT_MS);\n link.addEventListener(\n \"load\",\n () => {\n clearTimeout(timer);\n resolve();\n },\n { once: true },\n );\n link.addEventListener(\n \"error\",\n () => {\n clearTimeout(timer);\n // Remove the failed element so retries don't accumulate\n // dead <link> nodes in <head>.\n link.remove();\n reject(new Error(`prefetch link error: ${href}`));\n },\n { once: true },\n );\n document.head.appendChild(link);\n });\n } else {\n await fetch(href, { priority: \"low\" } as RequestInit & { priority?: string });\n }\n prefetched.add(href);\n } finally {\n inFlight.delete(href);\n }\n })();\n\n inFlight.set(href, p);\n return p;\n}\n\n/**\n * Public prefetch function. Idempotent per href.\n */\nexport function prefetch(url: string, opts: PrefetchOptions = {}): void {\n const href = resolveHref(url);\n if (!href) return; // cross-origin — skip\n\n if (opts.ignoreSlowConnection !== true && isSlowConnection()) return;\n\n if (prefetched.has(href) || inFlight.has(href)) return;\n\n executePrefetch(href, opts).catch(() => {});\n}\n\n// ---------------------------------------------------------------------------\n// Shared enter/leave handler factory\n// ---------------------------------------------------------------------------\n\ntype CancelHandleMap = Map<Element, ReturnType<typeof setTimeout> | number>;\n\n/**\n * Returns a pair of [enterHandler, leaveHandler] that queue and cancel an idle\n * prefetch callback, keyed on the supplied per-trigger cancel-handle map.\n *\n * Both the pointer (hover) and focus triggers use identical queue/cancel logic;\n * the only difference between them is which map tracks their pending handles.\n * Parameterising by the map eliminates that duplication.\n */\nfunction makeEnterLeaveHandlers(\n cancelHandles: CancelHandleMap,\n): [enterHandler: (e: Event) => void, leaveHandler: (e: Event) => void] {\n function enterHandler(e: Event): void {\n const link = (e.target as Element).closest(\"a[href]\") as HTMLAnchorElement | null;\n if (!link) return;\n if (!shouldPrefetchLink(link, \"hover\")) return;\n\n // Use requestIdleCallback if available, else a small timeout.\n const fire = () => {\n cancelHandles.delete(link);\n prefetch(link.href);\n };\n\n if (typeof requestIdleCallback !== \"undefined\") {\n const handle = requestIdleCallback(fire);\n cancelHandles.set(link, handle);\n } else {\n const handle = setTimeout(fire, 100);\n cancelHandles.set(link, handle);\n }\n }\n\n function leaveHandler(e: Event): void {\n const link = (e.target as Element).closest(\"a[href]\") as HTMLAnchorElement | null;\n if (!link) return;\n\n const handle = cancelHandles.get(link);\n if (handle === undefined) return;\n\n if (typeof cancelIdleCallback !== \"undefined\") {\n cancelIdleCallback(handle as number);\n } else {\n clearTimeout(handle as ReturnType<typeof setTimeout>);\n }\n cancelHandles.delete(link);\n }\n\n return [enterHandler, leaveHandler];\n}\n\n// ---------------------------------------------------------------------------\n// Trigger: hover (pointerenter / pointerleave)\n// ---------------------------------------------------------------------------\n\nconst [onPointerEnter, onPointerLeave] = makeEnterLeaveHandlers(hoverCancelHandles);\n\n// ---------------------------------------------------------------------------\n// Trigger: focus (focusin / focusout with cancel on focusout)\n// ---------------------------------------------------------------------------\n\nconst [onFocusIn, onFocusOut] = makeEnterLeaveHandlers(focusCancelHandles);\n\n// ---------------------------------------------------------------------------\n// Trigger: tap (touchstart / mousedown)\n// ---------------------------------------------------------------------------\n\nfunction onTap(e: Event): void {\n const link = (e.target as Element).closest(\"a[href]\") as HTMLAnchorElement | null;\n if (!link) return;\n if (!shouldPrefetchLink(link, \"tap\")) return;\n prefetch(link.href);\n}\n\n// ---------------------------------------------------------------------------\n// Trigger: viewport (IntersectionObserver)\n// ---------------------------------------------------------------------------\n\nfunction initViewportObserver(): IntersectionObserver {\n if (viewportObserver) return viewportObserver;\n\n viewportObserver = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n const link = entry.target as HTMLAnchorElement;\n prefetch(link.href);\n // Once observed and in-flight, no need to keep observing.\n viewportObserver?.unobserve(link);\n }\n }\n },\n { threshold: 0 },\n );\n\n return viewportObserver;\n}\n\nfunction observeViewportLinks(): void {\n const observer = initViewportObserver();\n const selector =\n prefetchAll && defaultStrategy === \"viewport\"\n ? \"a[href]:not([data-zfb-prefetch='false'])\"\n : \"a[data-zfb-prefetch='viewport']\";\n\n document.querySelectorAll<HTMLAnchorElement>(selector).forEach((link) => {\n const href = resolveHref(link.href);\n if (href && !prefetched.has(href)) {\n observer.observe(link);\n }\n });\n}\n\n// ---------------------------------------------------------------------------\n// Trigger: load (requestIdleCallback after DOMContentLoaded)\n// ---------------------------------------------------------------------------\n\nfunction prefetchLoadLinks(): void {\n const selector =\n prefetchAll && defaultStrategy === \"load\"\n ? \"a[href]:not([data-zfb-prefetch='false'])\"\n : \"a[data-zfb-prefetch='load']\";\n\n document.querySelectorAll<HTMLAnchorElement>(selector).forEach((link) => {\n const href = resolveHref(link.href);\n if (!href || prefetched.has(href)) return;\n\n if (typeof requestIdleCallback !== \"undefined\") {\n requestIdleCallback(() => prefetch(link.href));\n } else {\n setTimeout(() => prefetch(link.href), 0);\n }\n });\n}\n\n// ---------------------------------------------------------------------------\n// Per-link strategy resolution\n// ---------------------------------------------------------------------------\n\n/**\n * Determine whether a given link should be prefetched for the supplied trigger strategy.\n * Returns false if:\n * - data-zfb-prefetch=\"false\" (always disabled)\n * - The effective strategy for this link doesn't match the active trigger\n */\nfunction shouldPrefetchLink(link: HTMLAnchorElement, triggerStrategy: PrefetchStrategy): boolean {\n const attr = link.dataset[\"zfbPrefetch\"];\n\n // Explicitly disabled.\n if (attr === \"false\") return false;\n\n // Per-link explicit strategy.\n if (attr && attr !== \"false\") {\n return attr === triggerStrategy;\n }\n\n // No explicit attribute — rely on prefetchAll + defaultStrategy.\n if (!prefetchAll) return false;\n\n return defaultStrategy === triggerStrategy;\n}\n\n// ---------------------------------------------------------------------------\n// Post-swap re-scan\n// ---------------------------------------------------------------------------\n\nfunction onAfterSwap(): void {\n // Disconnect the existing observer before re-scanning so detached anchors from\n // the old body are unobserved and don't accumulate across SPA swaps.\n // (Bug: Takazudo/zudo-front-builder#896 — observer leak across SPA swaps)\n if (viewportObserver) {\n viewportObserver.disconnect();\n viewportObserver = null;\n }\n observeViewportLinks();\n prefetchLoadLinks();\n}\n\n// ---------------------------------------------------------------------------\n// init()\n// ---------------------------------------------------------------------------\n\n/**\n * Initialize the prefetch module.\n *\n * Idempotent — multiple calls are safe. The module-level `initialized` flag\n * ensures listeners are registered exactly once.\n *\n * DISABLED-FLAG CONTRACT: if `<meta name=\"zfb-prefetch-disabled\" content=\"true\">`\n * is present in the document at init() time, this function is a no-op.\n */\nexport function init(options?: PrefetchInitOptions): void {\n // Disabled-flag check — exact selector is the contract with #272-config.\n if (document.querySelector('meta[name=\"zfb-prefetch-disabled\"][content=\"true\"]')) {\n return;\n }\n\n if (initialized) return;\n initialized = true;\n\n prefetchAll = options?.prefetchAll ?? false;\n defaultStrategy = options?.defaultStrategy ?? \"hover\";\n\n // Hover + tap — document delegation, picks up SPA-inserted links automatically.\n document.addEventListener(\"pointerenter\", onPointerEnter, { capture: true });\n document.addEventListener(\"pointerleave\", onPointerLeave, { capture: true });\n // Focus — separate cancel map so hover and focus don't share handles.\n document.addEventListener(\"focusin\", onFocusIn, { capture: true });\n document.addEventListener(\"focusout\", onFocusOut, { capture: true });\n document.addEventListener(\"touchstart\", onTap, { capture: true, passive: true });\n document.addEventListener(\"mousedown\", onTap, { capture: true });\n\n // Viewport — observe current links immediately.\n observeViewportLinks();\n\n // Load — queue current links via idle callback.\n const queueLoad = () => prefetchLoadLinks();\n if (document.readyState === \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", queueLoad, { once: true });\n } else {\n queueLoad();\n }\n\n // Post-swap re-scan — re-walk viewport + load links after each SPA navigation.\n document.addEventListener(\"zfb:after-swap\", onAfterSwap);\n}\n"]}
@@ -1,7 +1,8 @@
1
- import type { Fallback, Options } from "./types.js";
1
+ import type { Fallback, Options, SyncHistoryEntryOptions } from "./types.js";
2
2
  export declare const supportsViewTransitions: boolean;
3
3
  export declare const transitionEnabledOnThisPage: () => boolean;
4
4
  export declare function getFallback(): Fallback;
5
+ export declare function syncHistoryEntry(url: string | URL, options?: SyncHistoryEntryOptions): void;
5
6
  export declare function navigate(href: string, options?: Options): Promise<void>;
6
7
  export interface InitOptions {
7
8
  /** Reserved for forward-compat with Astro's prefetch integration. Ignored in v1. */
@@ -14,4 +15,3 @@ export interface InitOptions {
14
15
  * @param _options - Forward-compat hook matching Astro's init() signature. Ignored in v1.
15
16
  */
16
17
  export declare function init(_options?: InitOptions): void;
17
- //# sourceMappingURL=router.d.ts.map
@@ -66,6 +66,17 @@ const internalFetchHeaders = {};
66
66
  const inBrowser = typeof document !== "undefined";
67
67
  export const supportsViewTransitions = inBrowser && !!document.startViewTransition;
68
68
  export const transitionEnabledOnThisPage = () => inBrowser && !!document.querySelector('[name="zfb-view-transitions-enabled"]');
69
+ // A same-page Back/Forward traversal (two history entries sharing pathname +
70
+ // search) is served from the live DOM by the fast-path in transition() — no
71
+ // re-fetch, no re-swap, no lifecycle events. A per-request SSR page
72
+ // (`prerender = false`) whose server output can differ between two visits to
73
+ // the SAME url opts back INTO the fetch by emitting
74
+ // <meta name="zfb-traverse-refetch" content="true"> (via <ClientRouter
75
+ // traverseRefetch />); skipping the fetch on such a page would pin the stale
76
+ // first-render content. Read from the CURRENT document — for a same-page
77
+ // traverse the current document IS the target page. Mirrors the
78
+ // zfb-prefetch-disabled meta reader. (#1376)
79
+ const traverseRefetchOptedOut = () => inBrowser && !!document.querySelector('meta[name="zfb-traverse-refetch"][content="true"]');
69
80
  const samePage = (thisLocation, otherLocation) => thisLocation.pathname === otherLocation.pathname && thisLocation.search === otherLocation.search;
70
81
  // The previous navigation that might still be in processing
71
82
  let mostRecentNavigation;
@@ -268,7 +279,12 @@ const moveToLocation = (to, from, options, pageTitleForBrowserHistory, historySt
268
279
  scrolledToTop = true;
269
280
  }
270
281
  if (historyState) {
271
- scrollTo(historyState.scrollX, historyState.scrollY);
282
+ // Raw-History consumers may push partial/empty state (`{}`), so the tracked
283
+ // scroll fields can be absent or non-finite. Never scrollTo(undefined, …) —
284
+ // leave scroll where it is rather than jumping to (0,0). #1376.
285
+ if (Number.isFinite(historyState.scrollX) && Number.isFinite(historyState.scrollY)) {
286
+ scrollTo(historyState.scrollX, historyState.scrollY);
287
+ }
272
288
  }
273
289
  else {
274
290
  if (to.hash) {
@@ -293,6 +309,63 @@ const moveToLocation = (to, from, options, pageTitleForBrowserHistory, historySt
293
309
  history.scrollRestoration = "manual";
294
310
  }
295
311
  };
312
+ let syncHistoryEntryOnServerWarned = false;
313
+ // Public: write a router-managed history entry (push or replace) WITHOUT any
314
+ // navigation, DOM, scroll, or lifecycle side effect. This is the supported path
315
+ // for consumers deep-linking transient UI state (dialogs/modals, a photo
316
+ // viewer's /photos/<slug>/ URL). Hand-rolled raw history.pushState desyncs
317
+ // `originalLocation` and the index bookkeeping that popstate direction detection
318
+ // (derivePopDirection) and the same-page traverse fast-path depend on; navigate()
319
+ // can't be used because it forces a fetch. See #1377 / #1374.
320
+ export function syncHistoryEntry(url, options = {}) {
321
+ // SSR guard: no window/history to touch. Mirror navigate()'s server no-op +
322
+ // one-time console warning. Checked at call time via `typeof document` (not the
323
+ // module-eval `inBrowser` const) so the branch is reachable and behavior is
324
+ // identical in a real environment (document is always present in a browser).
325
+ if (typeof document === "undefined") {
326
+ if (!syncHistoryEntryOnServerWarned) {
327
+ // instantiate an error for the stacktrace to show to user.
328
+ const warning = new Error("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.");
329
+ warning.name = "Warning";
330
+ // biome-ignore lint/suspicious/noConsole: allowed
331
+ console.warn(warning);
332
+ syncHistoryEntryOnServerWarned = true;
333
+ }
334
+ return;
335
+ }
336
+ const to = new URL(url, location.href);
337
+ // Cross-origin is not ours to manage. The History API would throw a native
338
+ // SecurityError for a cross-origin URL, but we guard explicitly so the failure
339
+ // is a clear, documented contract violation rather than an opaque platform
340
+ // error — and never a silent full-page load. #1377.
341
+ if (to.origin !== location.origin) {
342
+ throw new Error(`syncHistoryEntry(): refusing to write a cross-origin history entry for "${to.href}" (current origin: ${location.origin}).`);
343
+ }
344
+ if (options.replace) {
345
+ // Replace keeps the current entry's index. A consumer migrating from raw
346
+ // history.pushState may have left a missing/invalid index, so fall back to
347
+ // the tracked index rather than stamping NaN/undefined.
348
+ const current = history.state;
349
+ const index = current != null && Number.isFinite(current.index) ? current.index : currentHistoryIndex;
350
+ history.replaceState({
351
+ ...options.state,
352
+ index,
353
+ scrollX: Number.isFinite(current?.scrollX) ? current.scrollX : scrollX,
354
+ scrollY: Number.isFinite(current?.scrollY) ? current.scrollY : scrollY,
355
+ }, "", to.href);
356
+ }
357
+ else {
358
+ // Persist the CURRENT (outgoing) entry's latest scroll before pushing, so a
359
+ // later Back restoration can't lose scroll that `scrollend` hasn't flushed
360
+ // yet — the same guard transition() applies before a non-traverse push.
361
+ updateScrollPosition({ scrollX, scrollY });
362
+ history.pushState({ ...options.state, index: ++currentHistoryIndex, scrollX: 0, scrollY: 0 }, "", to.href);
363
+ }
364
+ // Always re-point originalLocation so the next transition()/onPopState uses the
365
+ // correct "from" URL. Skipping this is exactly what makes a raw pushState
366
+ // desync the router (a same-page Back would miss the traverse fast path).
367
+ originalLocation = to;
368
+ }
296
369
  function preloadStyleLinks(newDocument) {
297
370
  const links = [];
298
371
  for (const el of newDocument.querySelectorAll("head link[rel=stylesheet]")) {
@@ -397,7 +470,12 @@ async function transition(direction, from, to, options, historyState, hasUAVisua
397
470
  updateScrollPosition({ scrollX, scrollY });
398
471
  }
399
472
  if (samePage(from, to) && !options.formData) {
400
- if ((direction !== "back" && to.hash) || (direction === "back" && from.hash)) {
473
+ if (
474
+ // Same-page Back/Forward: serve from the live DOM (no re-fetch/re-swap)
475
+ // unless this page opted back into the fetch (per-request SSR). #1374/#1376.
476
+ (navigationType === "traverse" && !traverseRefetchOptedOut()) ||
477
+ (direction !== "back" && to.hash) ||
478
+ (direction === "back" && from.hash)) {
401
479
  moveToLocation(to, from, options, document.title, historyState);
402
480
  if (currentNavigation === mostRecentNavigation)
403
481
  mostRecentNavigation = undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/client-router/router.ts"],"names":[],"mappings":"AAAA,2BAA2B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AAW,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\";\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) => {\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\") {\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// Public: write a router-managed history entry (push or replace) WITHOUT any\n// navigation, DOM, scroll, or lifecycle side effect. This is the supported path\n// for consumers deep-linking transient UI state (dialogs/modals, a photo\n// viewer's /photos/<slug>/ URL). Hand-rolled raw history.pushState desyncs\n// `originalLocation` and the index bookkeeping that popstate direction detection\n// (derivePopDirection) and the same-page traverse fast-path depend on; navigate()\n// can't be used because it forces a fetch. See #1377 / #1374.\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 history.pushState(\n { ...options.state, index: ++currentHistoryIndex, scrollX: 0, scrollY: 0 },\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 // Do not preload links that are already on the page.\n if (\n !document.querySelector(\n `[${PERSIST_ATTR}=\"${el.getAttribute(\n PERSIST_ATTR,\n )}\"], link[rel=stylesheet][href=\"${el.getAttribute(\"href\")}\"]`,\n )\n ) {\n const c = document.createElement(\"link\");\n c.setAttribute(\"rel\", \"preload\");\n c.setAttribute(\"as\", \"style\");\n c.setAttribute(\"href\", el.getAttribute(\"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) {\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 unmountIslands();\n const swapEvent = await doSwap(\n preparationEvent,\n currentTransition.viewTransition!,\n animateFallbackOld,\n );\n moveToLocation(swapEvent.to, swapEvent.from, options, pageTitleForBrowserHistory, historyState);\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 if (!historyState && prepEvent.to.href !== location.href) {\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 () => await updateDOM(prepEvent, options, currentTransition, historyState),\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 );\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
@@ -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,6EAA6E;AAC7E,0DAA0D;AAC1D,yEAAyE;AACzE,oEAAoE;AACpE,iFAAiF;AACjF,MAAM,wBAAwB,GAAG,yBAAyB,CAAC;AAE3D,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,IAA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/>\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\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\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 = newElement.querySelector(`[${PERSIST_ATTR}=\"${id}\"]`);\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 // For islands, copy over the props to allow them to re-render\n if (\n newTarget.matches(\"[data-zfb-island]\") &&\n shouldCopyProps(el as HTMLElement) &&\n !isSameProps(el, newTarget)\n ) {\n el.setAttribute(\"ssr\", \"\");\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 && newDoc.head.querySelector(`[${PERSIST_ATTR}=\"${id}\"]`);\n if (newEl) {\n return newEl;\n }\n if (el.matches(\"link[rel=stylesheet]\")) {\n const href = el.getAttribute(\"href\");\n return newDoc.head.querySelector(`link[rel=stylesheet][href=\"${href}\"]`);\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 newDoc.head.querySelector(`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 newDoc.head.querySelector(`link[rel=preload][as=font][href=\"${href}\"]`);\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"]}
@@ -26,6 +26,23 @@ export interface ClientRouterProps {
26
26
  * @see https://github.com/Takazudo/zudo-front-builder/issues/1103
27
27
  */
28
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;
29
46
  }
30
47
  /**
31
48
  * Public element shape for each node returned by `<ClientRouter />`.
@@ -52,5 +69,4 @@ export type ClientRouterElement = {
52
69
  * <ClientRouter fallback="animate" />
53
70
  * ```
54
71
  */
55
- export declare function ClientRouter({ fallback, prefetchAll: prefetchAllProp, preserveHtmlAttrs, }?: ClientRouterProps): readonly ClientRouterElement[];
56
- //# sourceMappingURL=client-router.d.ts.map
72
+ export declare function ClientRouter({ fallback, prefetchAll: prefetchAllProp, preserveHtmlAttrs, traverseRefetch, }?: ClientRouterProps): readonly ClientRouterElement[];
@@ -98,7 +98,7 @@ const announcerCss = `
98
98
  * <ClientRouter fallback="animate" />
99
99
  * ```
100
100
  */
101
- export function ClientRouter({ fallback = "animate", prefetchAll: prefetchAllProp = false, preserveHtmlAttrs = [], } = {}) {
101
+ export function ClientRouter({ fallback = "animate", prefetchAll: prefetchAllProp = false, preserveHtmlAttrs = [], traverseRefetch = false, } = {}) {
102
102
  // Bootstrap prefetch exactly once on the client when prefetchAll is true.
103
103
  // The initialized flag inside prefetchInit() provides a second safety layer
104
104
  // in case of concurrent hydration or manual callers (#276).
@@ -138,6 +138,16 @@ export function ClientRouter({ fallback = "animate", prefetchAll: prefetchAllPro
138
138
  if (preserveList.length > 0) {
139
139
  nodes.push(makeVNode("meta", { name: "zfb-preserve-html-attrs", content: preserveList.join(" ") }, "zfb-preserve-html-attrs"));
140
140
  }
141
+ // Traverse-refetch opt-out meta (#1376). A same-page Back/Forward traversal
142
+ // skips the re-fetch/re-swap by default (the router's traverse fast-path);
143
+ // this meta opts a per-request SSR page (`prerender = false`) back INTO the
144
+ // fetch, since skipping it would pin stale server-rendered content. Emitted
145
+ // only when opted in, so non-opt-in output stays byte-identical. Same
146
+ // conditional-emission shape as the prefetch-disabled / preserve-html-attrs
147
+ // metas; the router reads meta[name="zfb-traverse-refetch"][content="true"].
148
+ if (traverseRefetch) {
149
+ nodes.push(makeVNode("meta", { name: "zfb-traverse-refetch", content: "true" }, "zfb-traverse-refetch"));
150
+ }
141
151
  return nodes;
142
152
  }
143
153
  //# sourceMappingURL=client-router.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client-router.js","sourceRoot":"","sources":["../src/client-router.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,EAAE;AACF,wDAAwD;AACxD,uDAAuD;AACvD,yEAAyE;AACzE,EAAE;AACF,2DAA2D;AAC3D,2EAA2E;AAC3E,6EAA6E;AAC7E,2EAA2E;AAC3E,+EAA+E;AAC/E,iFAAiF;AACjF,2DAA2D;AAC3D,EAAE;AACF,sDAAsD;AACtD,+EAA+E;AAC/E,4EAA4E;AAC5E,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,8EAA8E;AAC9E,2EAA2E;AAC3E,iFAAiF;AACjF,gFAAgF;AAChF,iFAAiF;AACjF,gFAAgF;AAChF,4CAA4C;AAC5C,EAAE;AACF,6EAA6E;AAC7E,iFAAiF;AACjF,wEAAwE;AACxE,mEAAmE;AACnE,wEAAwE;AACxE,EAAE;AACF,uEAAuE;AACvE,iDAAiD;AAEjD,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC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AAM,EAAE,EAAE,gBAAgB,CAAC;QAC9F,kEAAkE;QAClE,SAAS,CACP,MAAM,EACN,EAAE,IAAI,EAAE,+BAA+B,EAAE,OAAO,EAAE,QAAQ,EAAE,EAC5D,iBAAiB,CAClB;KACF,CAAC;IAEF,kEAAkE;IAClE,mEAAmE;IACnE,0EAA0E;IAC1E,iFAAiF;IACjF,gDAAgD;IAChD,EAAE;IACF,yEAAyE;IACzE,+EAA+E;IAC/E,iBAAiB;IACjB,EAAE;IACF,wEAAwE;IACxE,0DAA0D;IAC1D,IAAK,UAAyD,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,EAAE,CAAC;QAChG,KAAK,CAAC,IAAI,CACR,SAAS,CACP,MAAM,EACN,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,EAAE,EAClD,uBAAuB,CACxB,CACF,CAAC;IACJ,CAAC;IAED,iFAAiF;IACjF,kFAAkF;IAClF,iFAAiF;IACjF,+EAA+E;IAC/E,iFAAiF;IACjF,MAAM,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvD,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,KAAK,CAAC,IAAI,CACR,SAAS,CACP,MAAM,EACN,EAAE,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EACpE,yBAAyB,CAC1B,CACF,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"client-router.js","sourceRoot":"","sources":["../src/client-router.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,EAAE;AACF,wDAAwD;AACxD,uDAAuD;AACvD,yEAAyE;AACzE,EAAE;AACF,2DAA2D;AAC3D,2EAA2E;AAC3E,6EAA6E;AAC7E,2EAA2E;AAC3E,+EAA+E;AAC/E,iFAAiF;AACjF,2DAA2D;AAC3D,EA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,CACP,MAAM,EACN,EAAE,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EACpE,yBAAyB,CAC1B,CACF,CAAC;IACJ,CAAC;IAED,4EAA4E;IAC5E,2EAA2E;IAC3E,4EAA4E;IAC5E,4EAA4E;IAC5E,sEAAsE;IACtE,4EAA4E;IAC5E,6EAA6E;IAC7E,IAAI,eAAe,EAAE,CAAC;QACpB,KAAK,CAAC,IAAI,CACR,SAAS,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,sBAAsB,CAAC,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// `@takazudo/zfb-runtime` — `<ClientRouter />` component.\n//\n// Ported from Astro's `ClientRouter.astro` (155 lines).\n// Source: packages/astro/components/ClientRouter.astro\n// Issue: zudolab/zudo-doc#1519 (W3D), parent epic zudolab/zudo-doc#1510.\n//\n// Named-cause deviation — inline script split (W1B §13.6):\n// Astro's <script> block is processed by Vite at build time as a bundled\n// module with virtual-module imports (`astro:transitions/client`). The zfb\n// port emits meta tags + global styles from the JSX component, while the\n// click/form intercepts live in `client-router/router.ts` and are registered\n// via `init()`. The component calls `init()` as a side effect on first import.\n// No inline <script> dangerouslySetInnerHTML is emitted.\n//\n// Framework-agnostic element minting (no JSX syntax):\n// `@takazudo/zfb-runtime` does not depend on a framework runtime. Head nodes\n// are minted by calling `jsx` from `react/jsx-runtime` directly — NOT JSX\n// syntax, so this stays a plain `.ts` file with no tsconfig JSX changes. The\n// engine alias-rewrites `react/jsx-runtime` → `preact/jsx-runtime` in Preact\n// mode (bundler.rs ~2886) and resolves it natively in React mode, so the same\n// call mints a real element for whichever framework the project configured.\n// The previous approach (a hand-rolled `{ type, props, key, constructor:\n// undefined }` object literal — the Preact diff-path sentinel) only worked for\n// Preact: React's renderer rejects such an object as a child with React error\n// #31 (\"Objects are not valid as a React child\"), because a real React element\n// carries `$$typeof: Symbol.for(\"react.element\")` a literal cannot fake. Same\n// migration as `Island` in @takazudo/zfb.\n//\n// The component renders three base sibling elements to <head> (plus optional\n// metas emitted conditionally — see `prefetchDisabled` and `preserveHtmlAttrs`):\n// 1. A <style> tag with the `.zfb-route-announcer` ARIA helper class.\n// 2. <meta name=\"zfb-view-transitions-enabled\" content=\"true\" />\n// 3. <meta name=\"zfb-view-transitions-fallback\" content={fallback} />\n//\n// The route-announcer <div> is injected into <body> by `announce()` in\n// `client-router/router.ts` on every navigation.\n\nimport { jsx } from \"react/jsx-runtime\";\n\nimport { init } from \"./client-router/router.js\";\nimport { init as prefetchInit } from \"./client-router/prefetch.js\";\n\n// Side-effect: wire click + submit intercepts on first import of this component.\n// Guarded by the idempotent `initialized` flag in router.ts — safe for multiple\n// <ClientRouter /> mounts and HMR re-runs. (W3C3 init idempotency.)\nif (typeof document !== \"undefined\") {\n init();\n}\n\n// Module-level guard: prefetch bootstrap is triggered at most once per module\n// lifetime even if <ClientRouter prefetchAll /> is mounted multiple times (#276).\nlet prefetchBootstrapped = false;\n\nexport interface ClientRouterProps {\n /** Fallback animation strategy when native View Transitions are not supported. */\n fallback?: \"none\" | \"animate\" | \"swap\";\n /**\n * When true, opts every same-origin link into the default prefetch strategy\n * (hover) by calling prefetchInit({ prefetchAll: true }) once on the client.\n */\n prefetchAll?: boolean;\n /**\n * Extra `<html>` attribute names to preserve across SPA swaps. By default the\n * client router copies the incoming server-rendered document's `<html>`\n * attributes onto the live root, dropping any current attribute that isn't\n * internal to the transition machinery — so a *runtime* attribute a consumer\n * sets from a persisted island (e.g. `data-theme` or `data-sidebar-hidden`\n * driven from `localStorage`) is lost on every navigation. List those names\n * here and the router re-applies their current value after each swap. Emitted\n * as a `<meta name=\"zfb-preserve-html-attrs\">` tag that `swapRootAttributes`\n * reads at swap time.\n *\n * Mount with the **same list on every page** that participates in SPA\n * navigation: the preserve-list is read from the *current* (outgoing) page's\n * meta at swap time, so a page that omits an entry drops that attribute when\n * navigating away from it. Names are matched case-insensitively (DOM attribute\n * names are lowercased). For dynamic/computed cases, mutate\n * `event.newDocument.documentElement` in a `zfb:before-swap` listener instead.\n * @see https://github.com/Takazudo/zudo-front-builder/issues/1103\n */\n preserveHtmlAttrs?: string[];\n /**\n * Opt this page OUT of the same-page traverse fast-path (default `false` —\n * fast-path ON). By default a Back/Forward traversal between two history\n * entries sharing the same `pathname + search` is served instantly from the\n * live DOM — no re-fetch, no re-swap, so island/client state is preserved.\n *\n * Set this on a **per-request SSR page** (`prerender = false`) whose\n * server-rendered content can legitimately differ between two visits to the\n * same URL: with the fast-path skipped such a traverse would pin the stale\n * first-render content. Emitted as\n * `<meta name=\"zfb-traverse-refetch\" content=\"true\">`, which the router reads\n * on the current (target) page to force the fetch back on. Mount with the\n * **same value on every page** that participates in SPA navigation, mirroring\n * the `preserveHtmlAttrs` guidance.\n * @see https://github.com/Takazudo/zudo-front-builder/issues/1376\n */\n traverseRefetch?: boolean;\n}\n\n/**\n * Public element shape for each node returned by `<ClientRouter />`.\n * Structural type — intentionally matches the Preact/React VNode object shape\n * so consumers do not type-infer through the internal representation.\n */\nexport type ClientRouterElement = {\n readonly type: string;\n readonly props: Readonly<Record<string, unknown>>;\n readonly key: unknown;\n};\n\n/**\n * Mint a head element through the per-project JSX runtime.\n *\n * Calls `jsx` from `react/jsx-runtime` (alias-rewritten to\n * `preact/jsx-runtime` in Preact mode by the engine, native in React mode)\n * so the returned value is a real element for whichever framework the\n * project configured — NOT a hand-rolled `{ type, props, key }` literal,\n * which only Preact accepts and which makes React throw error #31. A stable\n * `key` is passed because `ClientRouter()` returns these nodes in a plain\n * array (React warns about keyless list children otherwise). Mirrors the\n * `Island` migration in `@takazudo/zfb`.\n */\nfunction makeVNode(type: string, props: Record<string, unknown>, key: string): ClientRouterElement {\n // `jsx`'s `type` param is typed `ElementType` (string-literal intrinsic\n // tags or component types), which rejects an arbitrary runtime `string`.\n // The tag is dynamic here, so cast to the factory's own first-param type —\n // robust whether the engine aliases `jsx` to react or preact at build time.\n return jsx(type as Parameters<typeof jsx>[0], props, key) as unknown as ClientRouterElement;\n}\n\n// CSS for the route-announcer element. Ported verbatim from Astro's\n// `<style is:global>` block in ClientRouter.astro (lines 11–23), renaming\n// `.astro-route-announcer` → `.zfb-route-announcer` per W1B §5.\n// This is a global (non-scoped) <style> because the announcer <div> is\n// appended to document.body at runtime, outside any Preact-controlled subtree.\nconst announcerCss = `\n.zfb-route-announcer {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tclip: rect(0 0 0 0);\n\tclip-path: inset(50%);\n\toverflow: hidden;\n\twhite-space: nowrap;\n\twidth: 1px;\n\theight: 1px;\n}\n`;\n\n/**\n * `<ClientRouter />` — SPA soft-swap navigation with View Transition animations.\n *\n * Mount once in your page `<head>`. Emits the opt-in meta tags and the global\n * `.zfb-route-announcer` stylesheet that the route-announcer ARIA div needs.\n * Click and form-submit intercepts are registered as a side effect of importing\n * this component (idempotent — safe to mount multiple times).\n *\n * @example\n * ```tsx\n * import { ClientRouter } from \"@takazudo/zfb-runtime\";\n * // In your page <head>:\n * <ClientRouter fallback=\"animate\" />\n * ```\n */\nexport function ClientRouter({\n fallback = \"animate\",\n prefetchAll: prefetchAllProp = false,\n preserveHtmlAttrs = [],\n traverseRefetch = false,\n}: ClientRouterProps = {}): readonly ClientRouterElement[] {\n // Bootstrap prefetch exactly once on the client when prefetchAll is true.\n // The initialized flag inside prefetchInit() provides a second safety layer\n // in case of concurrent hydration or manual callers (#276).\n if (typeof document !== \"undefined\" && prefetchAllProp && !prefetchBootstrapped) {\n prefetchBootstrapped = true;\n prefetchInit({ prefetchAll: true });\n }\n\n const nodes: ClientRouterElement[] = [\n // Global styles for the ARIA route-announcer div injected into <body>.\n makeVNode(\"style\", { dangerouslySetInnerHTML: { __html: announcerCss } }, \"zfb-vt-style\"),\n // Opt-in meta tag: router checks for this to decide whether to intercept navigations.\n makeVNode(\"meta\", { name: \"zfb-view-transitions-enabled\", content: \"true\" }, \"zfb-vt-enabled\"),\n // Fallback strategy meta tag: read by getFallback() in router.ts.\n makeVNode(\n \"meta\",\n { name: \"zfb-view-transitions-fallback\", content: fallback },\n \"zfb-vt-fallback\",\n ),\n ];\n\n // Prefetch-disabled meta tag (#277): emitted when the bundler set\n // `globalThis.__zfb.prefetchDisabled = true` (from `zfb.config.ts`\n // `prefetch: { disabled: true }`). The sibling prefetch-core module reads\n // `document.querySelector('meta[name=\"zfb-prefetch-disabled\"][content=\"true\"]')`\n // at `init()` time and short-circuits if found.\n //\n // The flag is site-wide and static — set once at bundle-emit time, never\n // per-page. This meta tag appears on every page that mounts `<ClientRouter />`\n // or not at all.\n //\n // Pin the contract verbatim — the attribute names and content value are\n // shared with the sibling prefetch-core sub-issue (#276).\n if ((globalThis as { __zfb?: { prefetchDisabled?: boolean } }).__zfb?.prefetchDisabled === true) {\n nodes.push(\n makeVNode(\n \"meta\",\n { name: \"zfb-prefetch-disabled\", content: \"true\" },\n \"zfb-prefetch-disabled\",\n ),\n );\n }\n\n // Consumer-extensible <html> attribute preserve-list (#1103). swapRootAttributes\n // reads this meta and re-applies the listed attributes' runtime values after each\n // swap, so persisted-island state on <html> (data-theme, data-sidebar-hidden, …)\n // survives navigation. Emitted only when non-empty, so non-opt-in output stays\n // byte-identical. Same conditional-emission shape as the prefetch-disabled meta.\n const preserveList = preserveHtmlAttrs.filter(Boolean);\n if (preserveList.length > 0) {\n nodes.push(\n makeVNode(\n \"meta\",\n { name: \"zfb-preserve-html-attrs\", content: preserveList.join(\" \") },\n \"zfb-preserve-html-attrs\",\n ),\n );\n }\n\n // Traverse-refetch opt-out meta (#1376). A same-page Back/Forward traversal\n // skips the re-fetch/re-swap by default (the router's traverse fast-path);\n // this meta opts a per-request SSR page (`prerender = false`) back INTO the\n // fetch, since skipping it would pin stale server-rendered content. Emitted\n // only when opted in, so non-opt-in output stays byte-identical. Same\n // conditional-emission shape as the prefetch-disabled / preserve-html-attrs\n // metas; the router reads meta[name=\"zfb-traverse-refetch\"][content=\"true\"].\n if (traverseRefetch) {\n nodes.push(\n makeVNode(\"meta\", { name: \"zfb-traverse-refetch\", content: \"true\" }, \"zfb-traverse-refetch\"),\n );\n }\n\n return nodes;\n}\n"]}
@@ -14,4 +14,3 @@ export interface FrameworkAdapter {
14
14
  */
15
15
  renderToString: (vnode: unknown) => string;
16
16
  }
17
- //# sourceMappingURL=framework.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"framework.js","sourceRoot":"","sources":["../src/framework.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,wEAAwE;AACxE,iEAAiE;AACjE,wEAAwE;AACxE,8DAA8D;AAC9D,EAAE;AACF,0EAA0E;AAC1E,0EAA0E;AAC1E,2EAA2E;AAC3E,8EAA8E;AAC9E,EAAE;AACF,0EAA0E;AAC1E,kEAAkE;AAClE,4EAA4E"}
1
+ {"version":3,"file":"framework.js","sourceRoot":"","sources":["../src/framework.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,wEAAwE;AACxE,iEAAiE;AACjE,wEAAwE;AACxE,8DAA8D;AAC9D,EAAE;AACF,0EAA0E;AAC1E,0EAA0E;AAC1E,2EAA2E;AAC3E,8EAA8E;AAC9E,EAAE;AACF,0EAA0E;AAC1E,kEAAkE;AAClE,4EAA4E","sourcesContent":["// `@takazudo/zfb-runtime` — framework adapter contract.\n//\n// The runtime is JSX-runtime-agnostic: it never imports preact or react\n// directly. Instead, the caller of [`createPageRouter`] passes a\n// [`FrameworkAdapter`] that pins how a JSX vnode (the value returned by\n// a page module's `default` export) becomes a string of HTML.\n//\n// This mirrors ADR-002's framework-adapter pattern on the Rust side — the\n// runtime owns the page-module evaluation lifecycle, the adapter owns the\n// JSX-runtime-specific render call. Wave 2 (T6) wires the embedded V8 host\n// with an adapter built on `preact-render-to-string` (or `react-dom/server`).\n//\n// BCI-5: `hydrate` reservation field removed — it was never called by the\n// runtime and no real consumer set it; adding it back when a real\n// implementation exists is a smaller change than carrying dead API surface.\n\n/**\n * Pluggable per-framework SSR contract.\n *\n * `renderToString` takes whatever shape the framework's JSX pragma\n * produces (Preact's VNode, React's element, etc.) and returns a string\n * of HTML. The runtime treats both the input and the return value as\n * opaque — it neither inspects the vnode nor escapes the output.\n */\nexport interface FrameworkAdapter {\n /**\n * Render a JSX vnode to an HTML string. Must be synchronous; SSR\n * happens inside a Hono request handler that resolves the response\n * body in one step.\n */\n renderToString: (vnode: unknown) => string;\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -3,11 +3,10 @@ export type { FrameworkAdapter } from "./framework.js";
3
3
  export type { ContentSnapshot, EntrySnapshot } from "./snapshot.js";
4
4
  export { ViewTransitions, type ViewTransitionsElement } from "./view-transitions.js";
5
5
  export { ClientRouter, type ClientRouterProps } from "./client-router.js";
6
- export { navigate, supportsViewTransitions, transitionEnabledOnThisPage, } from "./client-router/router.js";
6
+ export { navigate, supportsViewTransitions, transitionEnabledOnThisPage, syncHistoryEntry, } from "./client-router/router.js";
7
7
  export { prefetch, init as prefetchInit } from "./client-router/prefetch.js";
8
8
  export type { PrefetchStrategy, PrefetchInitOptions, PrefetchOptions, } from "./client-router/prefetch.js";
9
9
  export { TRANSITION_BEFORE_PREPARATION, TRANSITION_AFTER_PREPARATION, TRANSITION_BEFORE_SWAP, TRANSITION_AFTER_SWAP, TRANSITION_PAGE_LOAD, TRANSITION_NAVIGATION_ABORTED, TransitionBeforePreparationEvent, TransitionBeforeSwapEvent, isTransitionBeforePreparationEvent, isTransitionBeforeSwapEvent, } from "./client-router/events.js";
10
10
  export { swapFunctions, swap } from "./client-router/swap-functions.js";
11
- export type { Direction, Fallback, NavigationTypeString, Options } from "./client-router/types.js";
11
+ export type { Direction, Fallback, NavigationTypeString, Options, SyncHistoryEntryOptions, } from "./client-router/types.js";
12
12
  export type { ZfbPlugin, ZfbPluginLogger, ZfbBuildHookContext, ZfbDevMiddlewareContext, ZfbDevMiddlewareHandler, ZfbDevMiddlewareRequest, ZfbDevMiddlewareResponse, ZfbRouteEntry, ZfbRouteManifest, ZfbSetupContext, ZfbVirtualModuleLoader, } from "@takazudo/zfb/plugins";
13
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ export { ViewTransitions } from "./view-transitions.js";
28
28
  // Client-router public surface (W3D — mirrors @takazudo/zfb-runtime/client-router barrel).
29
29
  // See W1B §2 for the full public API spec.
30
30
  export { ClientRouter } from "./client-router.js";
31
- export { navigate, supportsViewTransitions, transitionEnabledOnThisPage, } from "./client-router/router.js";
31
+ export { navigate, supportsViewTransitions, transitionEnabledOnThisPage, syncHistoryEntry, } from "./client-router/router.js";
32
32
  // Prefetch public surface (#276).
33
33
  // `init` from prefetch.ts is re-exported as `prefetchInit` to avoid collision
34
34
  // with the router's `init`.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,0EAA0E;AAC1E,oEAAoE;AACpE,2EAA2E;AAC3E,qEAAqE;AACrE,2EAA2E;AAC3E,mFAAmF;AACnF,sEAAsE;AACtE,0EAA0E;AAC1E,qEAAqE;AACrE,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,EAAE;AACF,qEAAqE;AACrE,EAAE;AACF,sCAAsC;AACtC,oBAAoB;AACpB,4EAA4E;AAC5E,iFAAiF;AACjF,QAAQ;AACR,EAAE;AACF,sCAAsC;AACtC,EAAE;AACF,wEAAwE;AAWxE,OAAO,EAAE,eAAe,EAA+B,MAAM,uBAAuB,CAAC;AAErF,2FAA2F;AAC3F,2CAA2C;AAC3C,OAAO,EAAE,YAAY,EAA0B,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EACL,QAAQ,EACR,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAEnC,kCAAkC;AAClC,8EAA8E;A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,EAChC,yBAAyB,EACzB,kCAAkC,EAClC,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC","sourcesContent":["// Public entry point for `@takazudo/zfb-runtime`.\n//\n// This is the **client-safe** barrel: everything re-exported here must be\n// bundleable for `--platform=browser` without pulling a server-only\n// dependency. In particular `createPageRouter` (and the Hono server router\n// it builds) is intentionally NOT re-exported here — it lives at the\n// server-only subpath `@takazudo/zfb-runtime/server`. Re-exporting it from\n// this barrel makes any island that does `import ... from \"@takazudo/zfb-runtime\"`\n// drag `hono` into the browser graph, which esbuild must then resolve\n// (issue #1298). The page-router *types* below are `export type` only, so\n// esbuild strips them and no runtime edge to `./router.js` survives.\n//\n// Worker bundles produced by T3 import the server subpath and invoke\n// `createPageRouter` once, at module top, to obtain the fetch handler:\n//\n// import { createPageRouter } from \"@takazudo/zfb-runtime/server\";\n//\n// const router = createPageRouter({\n// pages: [...],\n// contentSnapshot: __ZFB_CONTENT_SNAPSHOT__, // embedded by the bundler\n// framework: { renderToString: render }, // preact-render-to-string etc.\n// });\n//\n// export default { fetch: router };\n//\n// The README documents the bundle shape T6 (embedded V8 host) consumes.\n\nexport type {\n CreatePageRouterOptions,\n PageDefinition,\n PageHeading,\n PageModule,\n PageRouter,\n} from \"./router.js\";\nexport type { FrameworkAdapter } from \"./framework.js\";\nexport type { ContentSnapshot, EntrySnapshot } from \"./snapshot.js\";\nexport { ViewTransitions, type ViewTransitionsElement } from \"./view-transitions.js\";\n\n// Client-router public surface (W3D — mirrors @takazudo/zfb-runtime/client-router barrel).\n// See W1B §2 for the full public API spec.\nexport { ClientRouter, type ClientRouterProps } from \"./client-router.js\";\nexport {\n navigate,\n supportsViewTransitions,\n transitionEnabledOnThisPage,\n syncHistoryEntry,\n} from \"./client-router/router.js\";\n\n// Prefetch public surface (#276).\n// `init` from prefetch.ts is re-exported as `prefetchInit` to avoid collision\n// with the router's `init`.\nexport { prefetch, init as prefetchInit } from \"./client-router/prefetch.js\";\nexport type {\n PrefetchStrategy,\n PrefetchInitOptions,\n PrefetchOptions,\n} from \"./client-router/prefetch.js\";\nexport {\n TRANSITION_BEFORE_PREPARATION,\n TRANSITION_AFTER_PREPARATION,\n TRANSITION_BEFORE_SWAP,\n TRANSITION_AFTER_SWAP,\n TRANSITION_PAGE_LOAD,\n TRANSITION_NAVIGATION_ABORTED,\n TransitionBeforePreparationEvent,\n TransitionBeforeSwapEvent,\n isTransitionBeforePreparationEvent,\n isTransitionBeforeSwapEvent,\n} from \"./client-router/events.js\";\nexport { swapFunctions, swap } from \"./client-router/swap-functions.js\";\nexport type {\n Direction,\n Fallback,\n NavigationTypeString,\n Options,\n SyncHistoryEntryOptions,\n} from \"./client-router/types.js\";\n\n// Plugin lifecycle types (#255). The runtime package re-exports the\n// `@takazudo/zfb/plugins` surface so consumers writing plugins from a\n// project that only depends on `@takazudo/zfb-runtime` can still\n// import the canonical types (e.g. `import type { ZfbPlugin } from\n// \"@takazudo/zfb-runtime\"`).\nexport type {\n ZfbPlugin,\n ZfbPluginLogger,\n ZfbBuildHookContext,\n ZfbDevMiddlewareContext,\n ZfbDevMiddlewareHandler,\n ZfbDevMiddlewareRequest,\n ZfbDevMiddlewareResponse,\n ZfbRouteEntry,\n ZfbRouteManifest,\n ZfbSetupContext,\n ZfbVirtualModuleLoader,\n} from \"@takazudo/zfb/plugins\";\n"]}
package/dist/router.d.ts CHANGED
@@ -111,4 +111,3 @@ export type PageRouter = (request: Request) => Promise<Response>;
111
111
  * directly.
112
112
  */
113
113
  export declare function createPageRouter(opts: CreatePageRouterOptions): PageRouter;
114
- //# sourceMappingURL=router.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.js","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,EAAE;AACF,wEAAwE;AACxE,mCAAmC;AACnC,EAAE;AACF,oDAAoD;AACpD,0DAA0D;AAC1D,8EA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CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,yBAAyB,CAAC,KAAa;IAC9C,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,+DAA+D;IAC/D,gEAAgE;IAChE,yBAAyB;IACzB,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/D,uEAAuE;IACvE,IAAI,gCAAgC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,2EAA2E;IAC3E,IAAI,4BAA4B,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,gCAAgC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// `@takazudo/zfb-runtime` — Hono-based page router.\n//\n// `createPageRouter` is the JS-side entry point for ADR-007's SSG-first\n// architecture. The pipeline goes:\n//\n// user pages/ + content/ + layouts/ + components/\n// → esbuild bundle (T3) // single ESM file\n// → embedded V8 host (T6) // same WinterCG surface as CF Workers\n// → createPageRouter({ pages, contentSnapshot, framework })\n// → (request) => Promise<Response>\n//\n// The bundle's Worker entry point shape is documented in the package\n// README. The contract is intentionally minimal: one factory call returns\n// one fetch handler. Hono is an implementation detail — callers should\n// not depend on the Hono types leaking through. The exposed surface is\n// the four types here plus the `createPageRouter` function.\n//\n// Side effect on init: registers the supplied `ContentSnapshot` with\n// `zfb/content`'s module-level snapshot bridge so any page module\n// importing `getCollection(\"...\")` resolves from memory rather than\n// touching the Node `fs` API (the Worker runtime has no `fs`).\n//\n// ## Synthetic `__paths__` endpoint\n//\n// The Rust build pipeline needs to evaluate non-literal `paths()` exports\n// (e.g. those that `await import(\"@takazudo/zfb/content\")` and call `getCollection`)\n// at runtime against the running embedded host. The router exposes a\n// synthetic internal endpoint:\n//\n// GET /__paths__/<percent-encoded-route-key>\n//\n// When a page registered at `route` has a `paths` export, the handler calls\n// it and returns the JSON-serialized array as `application/json`. If the\n// `paths` export is missing or throws, the response is a descriptive 500.\n// This endpoint is only meant for the build pipeline — it is safe to leave\n// registered in production because no user-authored route should start with\n// `/__paths__/` (the build pipeline rejects any route that conflicts).\n\nimport { Hono } from \"hono\";\nimport { setContentSnapshot } from \"@takazudo/zfb/content\";\n\nimport type { FrameworkAdapter } from \"./framework.js\";\nimport type { ContentSnapshot } from \"./snapshot.js\";\n\n// ---------------------------------------------------------------------------\n// Public types\n// ---------------------------------------------------------------------------\n\n/**\n * Heading metadata emitted by the MDX `headings` export (T4). Cross-ref:\n * `crates/zfb-content/src/mdx_jsx_emit.rs`. Optional on the page-module\n * shape — non-MDX pages won't carry it.\n */\nexport interface PageHeading {\n readonly depth: number;\n readonly slug: string;\n readonly text: string;\n}\n\n/**\n * The shape every page module must export.\n *\n * - `default`: the JSX page component. Called with the props returned by\n * `getStaticProps` (if exported) or the `props` from the matching\n * `paths()` entry (for dynamic routes). The return value is fed straight\n * to the framework adapter's `renderToString`.\n * - `prerender`: literal `false` opts a route OUT of build-time SSG (T5\n * contract). The page router still serves it under the embedded V8 host\n * so dev mode behaves identically; SSG callers filter the route list before\n * driving the renderer.\n * - `contentType`: optional override for non-HTML routes (e.g.\n * `application/xml` for `rss.xml.tsx`). Default is\n * `text/html; charset=utf-8`. Cross-ref shipped #49.\n * - `headings`: optional list emitted by MDX (T4).\n * - `paths`: optional dynamic-route enumerator. Called at build time by\n * the `__paths__` synthetic endpoint to produce the concrete URL list\n * for this route template. May be async. Returns an array of\n * `{ params, props? }` objects identical in shape to the Astro/zfb\n * `paths()` contract.\n * **Evaluated once per router instance** — the result is memoised and\n * shared across the `/__paths__` handler and all per-page render\n * requests. This matches the build-time-enumerator contract: every\n * entry rendered within a single build sees the same paths() snapshot.\n * Dev mode is safe because each file-save triggers a fresh bundle,\n * which creates a new router instance with a clean memo.\n * - `getStaticProps`: optional async function for static routes that need\n * to fetch data at build/render time. Called once per request (before\n * `default`). Must return `{ props: Record<string, unknown> }`. The\n * returned `props` are spread into the `default` component's props.\n */\nexport interface PageModule {\n readonly default: (props: Record<string, unknown>) => unknown;\n readonly prerender?: boolean;\n readonly contentType?: string;\n readonly headings?: readonly PageHeading[];\n readonly paths?: () => unknown[] | Promise<unknown[]>;\n readonly getStaticProps?: () => Promise<{ props: Record<string, unknown> }>;\n}\n\n/**\n * One page registered with the router.\n *\n * `route` is a Hono path pattern (e.g. `/`, `/blog/:slug`,\n * `/blog/page/:page`). `module` is a thunk so the bundle can use code\n * splitting if it wants to — today the bundler emits everything as one\n * ESM file and the thunk simply returns the already-loaded module.\n */\nexport interface PageDefinition {\n readonly route: string;\n readonly module: () => Promise<PageModule>;\n}\n\n/** Options accepted by [`createPageRouter`]. */\nexport interface CreatePageRouterOptions {\n /** Pages to register. Order does not affect routing — Hono dispatches by path. */\n readonly pages: readonly PageDefinition[];\n /**\n * In-memory content snapshot. Embedded into the bundle by T3; the\n * router hands it to `zfb/content` so user pages reading content via\n * `getCollection(...)` resolve synchronously from memory.\n */\n readonly contentSnapshot: ContentSnapshot;\n /** Framework adapter pinning the SSR call. */\n readonly framework: FrameworkAdapter;\n /**\n * When `true`, the 500 body for render errors includes the full JS stack\n * trace. When `false`, only the message + route are included. When\n * omitted, the runtime checks `globalThis.__zfb.ssrDebug` at request time:\n * that flag is set by the embedded V8 build/dev host (`globals_shim.js`)\n * and is absent on the production Cloudflare Workers runtime.\n *\n * Default is effectively OFF for production (no flag ⇒ message + route only).\n * Useful for explicit injection in unit tests without global mutation.\n */\n readonly includeErrorStack?: boolean;\n}\n\n/**\n * Fetch-handler shape returned by [`createPageRouter`]. Shaped as a plain\n * function (not a Hono `app`) so the consumer's contract is exactly\n * \"Worker-style fetch handler\" with no leaked framework types.\n */\nexport type PageRouter = (request: Request) => Promise<Response>;\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\n/**\n * Default content-type when a page module does not override.\n *\n * Aligned with #49's per-page `contentType` convention: the default\n * served for HTML pages is `text/html; charset=utf-8`. Tests pin this\n * verbatim because the embedded V8 host does NOT auto-set a charset.\n */\nconst DEFAULT_CONTENT_TYPE = \"text/html; charset=utf-8\";\n\n/**\n * Issue #530: prepend `<!doctype html>\\n` to SSR-rendered HTML bodies that\n * lack a doctype declaration, mirroring the guard in\n * `crates/zfb-build/src/renderer.rs::render_one_inner` (issue #524).\n *\n * Gate conditions (all must hold to prepend):\n * 1. `contentType` media-type (before `;`) is `text/html` (case-insensitive).\n * 2. The body, after stripping an optional UTF-8 BOM (U+FEFF) and leading\n * ASCII whitespace, starts with `<html` (case-insensitive) — i.e. it is\n * an `<html>`-rooted document, not XML / JSON / a fragment.\n * 3. The body (same stripped prefix) does NOT already begin with `<!doctype`\n * (case-insensitive).\n *\n * Deliberately NOT shared with the Rust side — duplication of a 5-line guard\n * is the right call rather than introducing a new cross-language boundary.\n */\nfunction ensureHtml5Doctype(body: string, contentType: string): string {\n const mediaType = contentType.split(\";\")[0]?.trim().toLowerCase();\n if (mediaType !== \"text/html\") return body;\n // Strip optional BOM and leading whitespace to inspect the root element.\n const stripped = body.replace(/^/, \"\").trimStart();\n if (!stripped.toLowerCase().startsWith(\"<!doctype\")) {\n if (stripped.toLowerCase().startsWith(\"<html\")) {\n return `<!doctype html>\\n${body}`;\n }\n }\n return body;\n}\n\n/**\n * Evaluate `pathsFn` once per `routeKey`, sharing the result across all\n * concurrent and subsequent callers via a Promise stored in `memo`.\n *\n * Rejections are evicted from the memo so that a transient paths() failure\n * does not permanently poison the cache — the next request retries.\n */\nasync function getOrEvalPaths(\n memo: Map<string, Promise<unknown[]>>,\n routeKey: string,\n pathsFn: () => unknown[] | Promise<unknown[]>,\n): Promise<unknown[]> {\n const existing = memo.get(routeKey);\n if (existing !== undefined) {\n return existing;\n }\n const promise = Promise.resolve(pathsFn()).then(\n (v) => v as unknown[],\n (err) => {\n // Evict on rejection so the next request retries.\n memo.delete(routeKey);\n return Promise.reject(err) as Promise<unknown[]>;\n },\n );\n memo.set(routeKey, promise);\n return promise;\n}\n\n/**\n * Build a page router for the SSG-first architecture (ADR-005).\n *\n * Side effects:\n * 1. Registers `opts.contentSnapshot` with the `zfb/content` module so\n * `getCollection(name)` resolves from memory. Idempotent across\n * calls — the latest snapshot wins (matches the documented dev-mode\n * live-reload contract).\n * 2. Constructs an internal Hono app and registers a GET handler per\n * `pages[i].route`. The handler imports the page module, calls\n * `framework.renderToString(module.default({}))`, and returns the\n * string in a `Response` with the appropriate `Content-Type`.\n *\n * The returned function is a plain `(request) => Promise<Response>` so a\n * Worker entry point can `export default { fetch: createPageRouter(...) }`\n * directly.\n */\nexport function createPageRouter(opts: CreatePageRouterOptions): PageRouter {\n setContentSnapshot(opts.contentSnapshot);\n\n const app = new Hono();\n\n // Build a lookup map: Hono route pattern → PageDefinition, for the\n // `__paths__` synthetic endpoint below. The map is keyed on the `route`\n // string exactly as the caller supplied it (e.g. \"/blog/:slug\").\n const pagesByRoute = new Map<string, PageDefinition>();\n for (const page of opts.pages) {\n pagesByRoute.set(page.route, page);\n }\n\n // Per-router-instance memo for paths() results.\n //\n // Keyed on page.route (e.g. \"/blog/:slug\"). Stores the in-flight or\n // settled Promise so that concurrent requests share one evaluation.\n // Rejections are NOT cached: if paths() throws the Promise is removed\n // from the map so the next request retries rather than re-propagating\n // the same error indefinitely.\n //\n // Production SSR isolates evaluate paths() once per isolate, which\n // matches the documented build-time-enumerator contract. Dev mode is\n // safe because each re-bundle creates a fresh router instance\n // (dev.rs reload_renderer), so stale paths() results never persist\n // across a file-save cycle. Watch-time invalidation is explicitly\n // out of scope per issue #507.\n const pathsMemo = new Map<string, Promise<unknown[]>>();\n\n // Sanity check: a user-authored route that happens to start with\n // `/__paths__` (or a top-level catchall like `/:slug{.+}`) would\n // shadow the synthetic endpoint registered below if Hono dispatched\n // by registration order. We register `/__paths__/:routeKey{.+}` first\n // (see directly below) but still warn on collisions so users do not\n // ship a page that conflicts with the build pipeline's wire format.\n for (const page of opts.pages) {\n if (routeShadowsPathsEndpoint(page.route)) {\n // Use console.warn so the message reaches the host's tail logs\n // without bringing down the worker. The build pipeline's\n // /__paths__ requests still resolve correctly because the\n // synthetic handler is registered first.\n // eslint-disable-next-line no-console\n console.warn(\n `[zfb-runtime] route \"${page.route}\" may shadow the synthetic /__paths__ endpoint; rename the page or use a more specific pattern`,\n );\n }\n }\n\n // -------------------------------------------------------------------------\n // Synthetic `/__paths__/<encoded-route-key>` endpoint.\n //\n // Called by the Rust build pipeline (crates/zfb/src/render_pipeline.rs)\n // to evaluate non-literal `paths()` exports at runtime. The route key is\n // the Hono pattern for the page (e.g. `/blog/:slug`) percent-encoded so\n // it survives in the URL path segment. The response is a JSON array of\n // `{ params, props? }` objects identical to the `paths()` contract.\n //\n // Pattern: `/__paths__/:routeKey{.+}` — the `{.+}` quantifier (Hono's\n // regex-segment syntax) allows slashes inside the route key so\n // `/blog/:slug` decodes correctly from `/__paths__/%2Fblog%2F%3Aslug`.\n //\n // IMPORTANT: this handler is registered BEFORE user routes so a\n // user-authored top-level catchall (e.g. `/:wildcard{.+}`) cannot\n // shadow it — Hono dispatches in registration order.\n // -------------------------------------------------------------------------\n app.get(\"/__paths__/:routeKey{.+}\", async (c) => {\n // Hono's `c.req.param(\"routeKey\")` already URL-decodes the captured\n // segment when it contains a `%`, so a single decode is correct\n // here — no explicit `decodeURIComponent` (that would be a\n // double-decode and break literal `%` characters in route keys).\n const routeKey = c.req.param(\"routeKey\");\n\n const page = pagesByRoute.get(routeKey);\n if (!page) {\n return c.body(\n `[zfb-runtime] /__paths__: no page registered for route key \"${routeKey}\"`,\n 404,\n { \"Content-Type\": \"text/plain; charset=utf-8\" },\n );\n }\n\n const mod = await page.module();\n if (typeof mod.paths !== \"function\") {\n return c.body(\n `[zfb-runtime] /__paths__: page module for \"${routeKey}\" has no paths() export`,\n 404,\n { \"Content-Type\": \"text/plain; charset=utf-8\" },\n );\n }\n\n let result: unknown[];\n try {\n result = await getOrEvalPaths(pathsMemo, routeKey, mod.paths);\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n return c.body(`[zfb-runtime] /__paths__: paths() threw for \"${routeKey}\": ${msg}`, 500, {\n \"Content-Type\": \"text/plain; charset=utf-8\",\n });\n }\n\n return c.body(JSON.stringify(result), 200, {\n \"Content-Type\": \"application/json; charset=utf-8\",\n });\n });\n\n for (const page of opts.pages) {\n // `app.all` (vs `app.get`) so SSR routes whose page handler dispatches\n // by `request.method` (e.g. POST API endpoints like\n // `pages/api/*.tsx`) actually reach the handler. The handler is then\n // responsible for returning a method-appropriate status (e.g. 405 for\n // an unsupported verb). With `app.get` the inner router would 404\n // before the handler ever ran, leaving e.g. `POST /api/foo` looking\n // identical to a missing route.\n app.all(page.route, async (c) => {\n const mod = await page.module();\n if (typeof mod.default !== \"function\") {\n // Surface as a 500 with a well-known message rather than letting\n // Hono swallow the error into a generic body. T6's embedded V8\n // host log-tail / source-map plumbing is what eventually projects\n // page-side errors back to the user's TSX line; until then the\n // pinned message is the contract this layer ships.\n return c.body(\n `[zfb-runtime] page module for \"${page.route}\" did not export a default component`,\n 500,\n { \"Content-Type\": \"text/plain; charset=utf-8\" },\n );\n }\n\n // For dynamic routes that export `paths()`, look up the concrete\n // entry for this URL by matching the URL params against the\n // paths() results. This implements the ADR-002 contract:\n // paths() → [{ params, props? }]\n // render(url) → find matching entry → pass { params, props } to default()\n //\n // For static routes (no `paths()` export, no URL params), we pass\n // an empty object — the component signature has no required props.\n // For dynamic routes whose URL params do not match any paths()\n // entry, we return a 404 rather than rendering with empty props.\n //\n // Whether the route is dynamic is derived from the ROUTE PATTERN,\n // not from the captured params: for an optional catchall\n // (`/docs/:slug{.+}?`), Hono matches the bare `/docs` with NO\n // params captured at all, so `Object.keys(c.req.param())` would\n // be empty and the old gate skipped paths() entirely — rendering\n // with `{}` instead of the entry whose `slug` is `[]`.\n const declaredParams = routeParamSpecs(page.route);\n const rawUrlParams = c.req.param() ?? {};\n const urlParams: Record<string, string> = {};\n for (const [k, v] of Object.entries(rawUrlParams)) {\n // Unmatched optional params may surface as undefined — drop them\n // so \"param absent\" is represented uniformly.\n if (typeof v === \"string\") urlParams[k] = v;\n }\n const isDynamicRoute = declaredParams.length > 0;\n\n let componentInput: Record<string, unknown> = {};\n\n if (isDynamicRoute && typeof mod.paths === \"function\") {\n let pathsResult: unknown;\n try {\n pathsResult = await getOrEvalPaths(pathsMemo, page.route, mod.paths);\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n return c.body(`[zfb-runtime] paths() threw for \"${page.route}\": ${msg}`, 500, {\n \"Content-Type\": \"text/plain; charset=utf-8\",\n });\n }\n\n if (!Array.isArray(pathsResult)) {\n return c.body(`[zfb-runtime] paths() for \"${page.route}\" did not return an array`, 500, {\n \"Content-Type\": \"text/plain; charset=utf-8\",\n });\n }\n\n // Validate each entry's shape per-entry rather than using a bare\n // cast — matches the strictness the Rust pipeline applies on the\n // same wire format. Any malformed entry surfaces as a 500.\n for (const entry of pathsResult) {\n if (!isPathsEntry(entry)) {\n return c.body(\n `[zfb-runtime] paths() for \"${page.route}\" returned an entry without a valid params object`,\n 500,\n { \"Content-Type\": \"text/plain; charset=utf-8\" },\n );\n }\n }\n\n // Find the entry whose params match the URL params for this\n // request. For catchall params (e.g. slug for\n // /docs/[...slug]), Hono returns a slash-joined string (e.g.\n // \"guides/install\"), so we compare against the paths() entry's\n // params.slug joined with \"/\".\n //\n // Matching iterates the params DECLARED by the route pattern so\n // the zero-segment optional-catchall case is covered: when Hono\n // matched `/docs` for `/docs/:slug{.+}?` no `slug` param exists\n // in the URL, and the matching entry is the one whose param is\n // the explicit empty array (`{ slug: [] }`).\n const match = (pathsResult as PathsEntry[]).find((entry) => {\n return declaredParams.every(({ name, optionalCatchall }) => {\n const urlVal = urlParams[name];\n const paramVal = entry.params[name];\n if (urlVal === undefined) {\n // Param absent from the URL: only valid for an optional\n // catchall, and only against the explicit `[]` entry.\n return optionalCatchall && Array.isArray(paramVal) && paramVal.length === 0;\n }\n if (Array.isArray(paramVal)) {\n // catchall: paths() emits slug as string[] but Hono\n // provides it as a \"/\"-joined string\n return paramVal.join(\"/\") === urlVal;\n }\n return String(paramVal) === urlVal;\n });\n });\n\n if (!match) {\n // The URL params do not correspond to any paths() entry —\n // this is the dev-mode equivalent of a build-time miss.\n // Hono's `c.notFound()` returns the framework's default 404,\n // which is cleaner than fabricating an empty-props render.\n return c.notFound();\n }\n\n // Pass the paths() entry's props directly as component props\n // (spread to top level, matching the Astro/zfb convention).\n // Also include `params` so components can access URL params if\n // needed, but individual prop keys from `props` win on collision.\n componentInput = {\n params: match.params,\n ...(match.props ?? {}),\n };\n } else if (!isDynamicRoute && typeof mod.getStaticProps === \"function\") {\n // Static route with `getStaticProps`: call it to fetch build-time\n // data and pass the returned props to the default component. This\n // supports the `export async function getStaticProps()` pattern\n // used by static pages that need to query content collections (e.g.\n // a homepage listing all blog posts via `getCollection(\"blog\")`).\n let staticPropsResult: unknown;\n try {\n staticPropsResult = await mod.getStaticProps();\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n return c.body(`[zfb-runtime] getStaticProps() threw for \"${page.route}\": ${msg}`, 500, {\n \"Content-Type\": \"text/plain; charset=utf-8\",\n });\n }\n if (\n typeof staticPropsResult !== \"object\" ||\n staticPropsResult === null ||\n !(\"props\" in staticPropsResult)\n ) {\n return c.body(\n `[zfb-runtime] getStaticProps() for \"${page.route}\" must return { props: {...} }`,\n 500,\n { \"Content-Type\": \"text/plain; charset=utf-8\" },\n );\n }\n componentInput = (staticPropsResult as { props: Record<string, unknown> }).props;\n }\n\n // `await` so async page modules (e.g. API routes typed as\n // `(): Promise<Response>`) resolve before we inspect the value.\n // For sync pages that return a VNode/string the await is a no-op.\n //\n // Wrapped in a try/catch so that any error thrown by the component\n // or by renderToString surfaces as a descriptive 500 rather than\n // escaping to Hono's generic error handler (which discards the real\n // message). Mirrors the getStaticProps catch above.\n try {\n const result = await mod.default(componentInput);\n // API route short-circuit: a page module that returns a Response\n // directly (e.g. `pages/api/*.tsx` handlers that use Web Fetch\n // primitives instead of returning JSX) is responsible for its own\n // status, headers, and body — return it as-is rather than running\n // it through the framework SSR path. A `return` from inside a\n // `try` does not trigger the `catch`, so this passes through\n // correctly without special-casing.\n if (result instanceof Response) {\n return result;\n }\n // Non-HTML routes (e.g. `sitemap.xml.tsx`, `feed.xml.tsx`) commonly\n // return their body as a pre-serialised `string` instead of a\n // VNode. Routing those through `framework.renderToString` would\n // HTML-escape the angle brackets and ampersands, producing\n // garbage XML. Pass strings through verbatim; only wrap actual\n // VNodes.\n const html = typeof result === \"string\" ? result : opts.framework.renderToString(result);\n const contentType = mod.contentType ?? DEFAULT_CONTENT_TYPE;\n return c.body(ensureHtml5Doctype(html, contentType), 200, { \"Content-Type\": contentType });\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // __zfb.ssrDebug is set only by the embedded V8 build/dev host\n // (globals_shim.js), never by the production Workers runtime.\n const includeStack =\n opts.includeErrorStack ??\n (globalThis as { __zfb?: { ssrDebug?: boolean } }).__zfb?.ssrDebug === true;\n const stack = includeStack && err instanceof Error && err.stack ? `\\n${err.stack}` : \"\";\n return c.body(`[zfb-runtime] render threw for \"${page.route}\": ${msg}${stack}`, 500, {\n \"Content-Type\": \"text/plain; charset=utf-8\",\n });\n }\n });\n }\n\n // Hono's `app.fetch` returns `Response | Promise<Response>`. The\n // public router contract is unconditionally async; using an `async`\n // wrapper (rather than `Promise.resolve(...)`) ensures any\n // synchronous throw inside `app.fetch` is converted to a rejected\n // promise instead of escaping the caller's `await`.\n return async (request) => await app.fetch(request);\n}\n\n/**\n * Shape of one entry produced by a page's `paths()` export. The\n * `params` object is required (every entry needs to identify the URL\n * it represents); `props` is optional (the page may render purely from\n * the URL params).\n */\ninterface PathsEntry {\n readonly params: Record<string, unknown>;\n readonly props?: Record<string, unknown>;\n}\n\n/**\n * Type guard for one `paths()` entry. Mirrors the strictness of the\n * Rust pipeline's `paths()` resolver — every entry must be a non-null\n * object whose `params` is itself a non-null object.\n */\nfunction isPathsEntry(x: unknown): x is PathsEntry {\n if (typeof x !== \"object\" || x === null) return false;\n const params = (x as { params?: unknown }).params;\n return typeof params === \"object\" && params !== null;\n}\n\n/**\n * One param declared by a Hono route pattern. `optionalCatchall` is\n * `true` for the `:name{.+}?` form (file-system `[[...name]]`), whose\n * zero-segment match captures no param at all.\n */\ninterface RouteParamSpec {\n readonly name: string;\n readonly optionalCatchall: boolean;\n}\n\n/**\n * Parse the params declared by a Hono route pattern (the `route` string\n * the build pipeline registers, e.g. `/blog/:slug`, `/docs/:slug{.+}`,\n * `/docs/:slug{.+}?`). Static routes return an empty list.\n *\n * Only the pattern shapes emitted by `bracket_to_hono` (zfb-build) are\n * recognised — `:name`, `:name{.+}`, `:name{.+}?` — which is the entire\n * grammar the file router produces.\n */\nfunction routeParamSpecs(route: string): RouteParamSpec[] {\n const specs: RouteParamSpec[] = [];\n for (const seg of route.split(\"/\")) {\n if (!seg.startsWith(\":\")) continue;\n const optionalCatchall = seg.endsWith(\"?\");\n const body = optionalCatchall ? seg.slice(1, -1) : seg.slice(1);\n const braceIdx = body.indexOf(\"{\");\n const name = braceIdx === -1 ? body : body.slice(0, braceIdx);\n if (name.length > 0) {\n specs.push({ name, optionalCatchall });\n }\n }\n return specs;\n}\n\n/**\n * Heuristic check for user-authored routes that may shadow the\n * synthetic `/__paths__/<encoded-route-key>` endpoint.\n *\n * Returns true when the route literal contains `/__paths__` (an\n * obvious collision) or when its first segment is a Hono catchall\n * (`:name{.+}`, optionally `:name{.+}?`) or a file-system catchall\n * (`[...name]` / `[[...name]]`) at the root — those would match\n * `/__paths__/...` once Hono dispatches to them.\n */\nfunction routeShadowsPathsEndpoint(route: string): boolean {\n if (route.includes(\"/__paths__\")) {\n return true;\n }\n // Strip the leading slash and look at the first segment only —\n // anything deeper cannot match `/__paths__` because the literal\n // first segment differs.\n const firstSeg = route.replace(/^\\/+/, \"\").split(\"/\")[0] ?? \"\";\n // Hono regex-quantifier catchall: `:name{.+}` / optional `:name{.+}?`.\n if (/^:[A-Za-z_][\\w]*\\{\\.[+*]\\}\\??$/.test(firstSeg)) {\n return true;\n }\n // File-system catchall (pre-bracket-to-hono): `[...name]` / `[[...name]]`.\n if (/^\\[\\.\\.\\.[A-Za-z_][\\w]*\\]$/.test(firstSeg)) {\n return true;\n }\n if (/^\\[\\[\\.\\.\\.[A-Za-z_][\\w]*\\]\\]$/.test(firstSeg)) {\n return true;\n }\n return false;\n}\n"]}
package/dist/server.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  export { createPageRouter } from "./router.js";
2
2
  export type { CreatePageRouterOptions, PageDefinition, PageHeading, PageModule, PageRouter, } from "./router.js";
3
- //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,wEAAwE;AACxE,wBAAwB;AACxB,EAAE;AACF,+DAA+D;AAC/D,gCAAgC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,wEAAwE;AACxE,wBAAwB;AACxB,EAAE;AACF,+DAA+D;AAC/D,gCAAgC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["// Server-only entry point for `@takazudo/zfb-runtime` (subpath `/server`).\n//\n// `createPageRouter` builds a Hono app, so importing it pulls `hono` into the\n// module graph. That is fine — even *desirable* — on the SSR / Worker side,\n// but it must never reach a `--platform=browser` island bundle. Keeping the\n// factory behind this dedicated subpath (rather than the client-safe `.`\n// barrel in `./index.ts`) is what lets esbuild bundle an island that imports\n// the bare `@takazudo/zfb-runtime` root without ever needing to resolve\n// `hono` (issue #1298).\n//\n// The zfb SSR emit (`crates/zfb-build/src/bundler.rs`) imports\n// `createPageRouter` from here.\n\nexport { createPageRouter } from \"./router.js\";\nexport type {\n CreatePageRouterOptions,\n PageDefinition,\n PageHeading,\n PageModule,\n PageRouter,\n} from \"./router.js\";\n"]}
@@ -35,4 +35,3 @@ export interface EntrySnapshot {
35
35
  export interface ContentSnapshot {
36
36
  readonly collections: Readonly<Record<string, readonly EntrySnapshot[]>>;
37
37
  }
38
- //# sourceMappingURL=snapshot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../src/snapshot.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,8BAA8B;AAC9B,EAAE;AACF,kFAAkF;AAClF,uEAAuE;AACvE,uEAAuE;AACvE,mFAAmF;AACnF,2EAA2E;AAC3E,6EAA6E;AAC7E,+BAA+B;AAC/B,mEAAmE;AACnE,cAAc;AACd,EAAE;AACF,wEAAwE;AACxE,iEAAiE"}
1
+ {"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../src/snapshot.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,8BAA8B;AAC9B,EAAE;AACF,kFAAkF;AAClF,uEAAuE;AACvE,uEAAuE;AACvE,mFAAmF;AACnF,2EAA2E;AAC3E,6EAA6E;AAC7E,+BAA+B;AAC/B,mEAAmE;AACnE,cAAc;AACd,EAAE;AACF,wEAAwE;AACxE,iEAAiE","sourcesContent":["// `@takazudo/zfb-runtime/snapshot` — TypeScript mirror of the Rust\n// `ContentSnapshot` contract.\n//\n// The canonical shape lives in Rust at `crates/zfb-content/src/content_bridge.rs`\n// (see `ContentSnapshot` and `EntrySnapshot`). The build-time pipeline\n// constructs the snapshot, serializes it to JSON, and embeds it in the\n// Worker bundle that the embedded V8 host loads. At Worker boot the embedded value\n// is handed to [`createPageRouter`] (exported from the server-only subpath\n// `@takazudo/zfb-runtime/server`), which registers it with the `zfb/content`\n// module so user pages calling\n// `getCollection(\"blog\")` resolve from memory rather than from the\n// filesystem.\n//\n// Keep this in sync with the Rust struct. Field names are snake_case to\n// match the JSON serialization (`module_specifier`, `rel_path`).\n\n/**\n * One entry in a content collection, in the shape the JS bridge sees.\n *\n * Mirrors `crates/zfb-content/src/content_bridge.rs::EntrySnapshot`.\n *\n * - `slug`: filename stem (no extension).\n * - `frontmatter`: parsed frontmatter — `null` when the source had none.\n * Type-erased to `unknown` here; user pages narrow via the generic on\n * `getCollection<T>()`.\n * - `body`: markdown body for `.md` / `.mdx` entries; empty string for\n * `.tsx` entries (TSX has no separate markdown body).\n * - `module_specifier`: stable specifier addressing the compiled module\n * (`mdx://collection/slug#hash` / `tsx://collection/slug#hash`). The\n * bridge resolver matches either the full-with-hash form or the\n * no-hash form `mdx://collection/slug`.\n * - `rel_path`: path relative to the collection root, normalized to\n * forward slashes so JSON is platform-stable.\n */\nexport interface EntrySnapshot {\n readonly slug: string;\n readonly frontmatter: unknown;\n readonly body: string;\n readonly module_specifier: string;\n readonly rel_path: string;\n}\n\n/**\n * Point-in-time snapshot of every configured collection.\n *\n * Mirrors `crates/zfb-content/src/content_bridge.rs::ContentSnapshot`.\n *\n * Iteration order is documented as deterministic on the Rust side\n * (collections sorted by name, entries sorted by slug). The snapshot\n * delivered to JS preserves that order via stable JSON serialization.\n */\nexport interface ContentSnapshot {\n readonly collections: Readonly<Record<string, readonly EntrySnapshot[]>>;\n}\n"]}
@@ -31,4 +31,3 @@ export type ViewTransitionsElement = {
31
31
  * documents.
32
32
  */
33
33
  export declare function ViewTransitions(): readonly ViewTransitionsElement[];
34
- //# sourceMappingURL=view-transitions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"view-transitions.js","sourceRoot":"","sources":["../src/view-transitions.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,sFAAsF;AACtF,gDAAgD;AAChD,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,8DAA8D;AAC9D,EAAE;AACF,mEAAmE;AACnE,EAAE;AACF,uEAAuE;AACvE,wEAAwE;AACxE,wEAAwE;AACxE,sFAAsF;AACtF,yEAAyE;AACzE,+DAA+D;AAC/D,2EAA2E;AAC3E,4EAA4E;AAC5E,4EAA4E;AAC5E,wEAAwE;AACxE,oCAAoC;AACpC,EAAE;AACF,2DAA2D;AAC3D,0EAA0E;AAC1E,0EAA0E;AAC1E,2DAA2D;AAa3D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,EAAE,CAAC;AACZ,CAAC"}
1
+ {"version":3,"file":"view-transitions.js","sourceRoot":"","sources":["../src/view-transitions.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,sFAAsF;AACtF,gDAAgD;AAChD,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,8DAA8D;AAC9D,EAAE;AACF,mEAAmE;AACnE,EAAE;AACF,uEAAuE;AACvE,wEAAwE;AACxE,wEAAwE;AACxE,sFAAsF;AACtF,yEAAyE;AACzE,+DAA+D;AAC/D,2EAA2E;AAC3E,4EAA4E;AAC5E,4EAA4E;AAC5E,wEAAwE;AACxE,oCAAoC;AACpC,EAAE;AACF,2DAA2D;AAC3D,0EAA0E;AAC1E,0EAA0E;AAC1E,2DAA2D;AAa3D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["// `@takazudo/zfb-runtime` — `<ViewTransitions />` component (typed no-op).\n//\n// For SPA soft-swap navigation with view-transition animation, use `<ClientRouter />`\n// from this package — see `./client-router.ts`.\n//\n// Originally mirrored Astro's `<ViewTransitions />` integration by injecting\n// (a) a `<meta name=\"view-transition\" content=\"same-origin\">` opt-in tag and\n// (b) an inline client-router IIFE that intercepted same-origin `<a>` clicks\n// and ran navigations through `document.startViewTransition`.\n//\n// Both pieces have since been deleted. The browser story moved on:\n//\n// - The meta-tag opt-in was a temporary experiment during Chromium's\n// cross-document VT spec development. It has been superseded by the\n// `@view-transition { navigation: auto; }` CSS at-rule (per MDN and\n// https://developer.chrome.com/docs/web-platform/view-transitions/cross-document)\n// and is no longer honoured by browsers that ship cross-document VT.\n// - The click-intercept IIFE was actively harmful: it called\n// `event.preventDefault()` and ran `window.location.href = url` inside\n// `document.startViewTransition`. Chromium treats that script reload as\n// EXCLUDED from the `auto` navigation type, so no `::view-transition-*`\n// pseudo-elements ever materialise. The \"router\" prevented the very\n// feature it claimed to enable.\n//\n// Cross-document View Transitions are now opted in via the\n// `@view-transition { navigation: auto; }` CSS at-rule on both the source\n// and destination documents. This component is a typed no-op kept so that\n// existing `<ViewTransitions />` mounts compile unchanged.\n\n/**\n * Public element shape — kept structural so consumers don't infer through\n * either framework's internal VNode type. Matches the shape `Island`\n * returns from `@takazudo/zfb`.\n */\nexport type ViewTransitionsElement = {\n readonly type: string;\n readonly props: Readonly<Record<string, unknown>>;\n readonly key: unknown;\n};\n\n/**\n * `<ViewTransitions />` — DEPRECATED: this component is now a typed\n * no-op. Cross-document View Transitions are opted in via the\n * `@view-transition { navigation: auto; }` CSS at-rule, NOT via this\n * component. Add the at-rule to your top-level stylesheet (outside\n * any `@layer` block — see https://developer.mozilla.org/en-US/docs/Web/CSS/@view-transition).\n *\n * The export is kept so consumers' existing `<ViewTransitions />`\n * mounts compile unchanged.\n *\n * The previous implementation injected an inline router IIFE that\n * called `event.preventDefault()` and `document.startViewTransition`\n * around `window.location.href = url`. That pattern is INCOMPATIBLE\n * with cross-document VT: Chromium treats the script reload as\n * excluded from `auto`, so no `::view-transition-*` pseudo-elements\n * ever materialize. See\n * https://developer.chrome.com/docs/web-platform/view-transitions/cross-document.\n *\n * @deprecated The runtime injection is removed. Use the\n * `@view-transition` CSS at-rule on both source and destination\n * documents.\n */\nexport function ViewTransitions(): readonly ViewTransitionsElement[] {\n return [];\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takazudo/zfb-runtime",
3
- "version": "0.1.0-next.74",
3
+ "version": "0.1.0-next.76",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "JavaScript runtime for zfb static sites — Hono-backed page router, content snapshots, and client-side hydration.",
@@ -75,7 +75,7 @@
75
75
  },
76
76
  "peerDependencies": {
77
77
  "react": "^19.2.3",
78
- "@takazudo/zfb": "0.1.0-next.74"
78
+ "@takazudo/zfb": "0.1.0-next.76"
79
79
  },
80
80
  "peerDependenciesMeta": {
81
81
  "react": {
@@ -89,7 +89,7 @@
89
89
  "react": "^19.2.3",
90
90
  "typescript": "^5.9.0",
91
91
  "vitest": "^2.1.9",
92
- "@takazudo/zfb": "0.1.0-next.74"
92
+ "@takazudo/zfb": "0.1.0-next.76"
93
93
  },
94
94
  "scripts": {
95
95
  "build": "tsc",
@@ -1 +0,0 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/client-router/events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElE,eAAO,MAAM,6BAA6B,2BAA2B,CAAC;AACtE,eAAO,MAAM,4BAA4B,0BAA0B,CAAC;AACpE,eAAO,MAAM,sBAAsB,oBAAoB,CAAC;AACxD,eAAO,MAAM,qBAAqB,mBAAmB,CAAC;AACtD,eAAO,MAAM,oBAAoB,k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G;AACH,wBAAgB,IAAI,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAkCxD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/client-router/router.ts"],"names":[],"mappings":"AA6DA,OAAO,KAAK,EAAa,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAgC/D,eAAO,MAAM,uBAAuB,SAA8C,CAAC;AAEnF,eAAO,MAAM,2BAA2B,eACwC,CAAC;AAmHjF,wBAAgB,WAAW,IAAI,QAAQ,CAWtC;AAsiBD,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,iBA0B7D;AAkRD,MAAM,WAAW,WAAW;IAC1B,oFAAoF;IACpF,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAMD;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,QAAQ,CAAC,EAAE,WAAW,GAAG,IAAI,CAgBjD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"swap-functions.d.ts","sourceRoot":"","sources":["../../src/client-router/swap-functions.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,UAAU,GAAG;IACvB,aAAa,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAgBF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,WAK7D;AAKD,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,QAa5C;AA8BD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,QAAQ,QASlD;AAKD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,QA2B7C;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,QAqDvE;AAyBD,eAAO,MAAM,SAAS,QAAO,CAAC,MAAM,IAAI,CAevC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,+BAA+B,UAAU,SAQrE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,IAAI,gBAAgB,KAAG,MASvD,CAAC;AA0DF,eAAO,MAAM,aAAa;;;;;qBA9FG,CAAC,MAAM,IAAI,CAAC;CAoGxC,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,KAAK,QAAQ,SAOjC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/client-router/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AACnD,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAC3C,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AACnE,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACtC,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-router.d.ts","sourceRoot":"","sources":["../src/client-router.ts"],"names":[],"mappings":"AAqDA,MAAM,WAAW,iBAAiB;IAChC,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;IACvC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;;;;;;;;;;;OAkBG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAClD,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;CACvB,CAAC;AAyCF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAoB,EACpB,WAAW,EAAE,eAAuB,EACpC,iBAAsB,GACvB,GAAE,iBAAsB,GAAG,SAAS,mBAAmB,EAAE,CA6DzD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../src/framework.ts"],"names":[],"mappings":"AAgBA;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;CAC5C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA2BA,YAAY,EACV,uBAAuB,EACvB,cAAc,EACd,WAAW,EACX,UAAU,EACV,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAIrF,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EACL,QAAQ,EACR,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EAAE,QAAQ,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC7E,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,GAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,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AAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACtD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CAC7E;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CAC5C;AAED,gDAAgD;AAChD,MAAM,WAAW,uBAAuB;IACtC,kFAAkF;IAClF,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,8CAA8C;IAC9C,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACrC;;;;;;;;;OASG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAwEjE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,uBAAuB,GAAG,UAAU,CAuT1E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EACV,uBAAuB,EACvB,cAAc,EACd,WAAW,EACX,UAAU,EACV,UAAU,GACX,MAAM,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../src/snapshot.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC,CAAC,CAAC;CAC1E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"view-transitions.d.ts","sourceRoot":"","sources":["../src/view-transitions.ts"],"names":[],"mappings":"AA6BA;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAClD,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,IAAI,SAAS,sBAAsB,EAAE,CAEnE"}