@takazudo/zudo-doc 2.2.0 → 2.2.2

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.
@@ -1,6 +1,9 @@
1
1
  import { routeCtx } from "./_context.js";
2
2
  import { createChrome } from "../chrome/index.js";
3
- const chrome = createChrome(routeCtx);
3
+ import { DocHistory } from "../doc-history/index.js";
4
+ const chrome = createChrome(routeCtx, {
5
+ DocHistory
6
+ });
4
7
  const {
5
8
  composeMetaTitle,
6
9
  HeadWithDefaults,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takazudo/zudo-doc",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "type": "module",
5
5
  "description": "zudo-doc framework primitives layer that sits on top of zfb's engine — sidebar, theme, TOC, breadcrumb, layouts, head injection, View Transitions, SSR-skip wrappers (per ADR-003).",
6
6
  "license": "MIT",
@@ -528,9 +528,9 @@
528
528
  ],
529
529
  "peerDependencies": {
530
530
  "preact": "^10.29.1",
531
- "@takazudo/zfb": "^0.1.0-next.72",
532
- "@takazudo/zfb-runtime": "^0.1.0-next.72",
533
- "@takazudo/zudo-doc-history-server": "^2.1.2",
531
+ "@takazudo/zfb": "^0.1.0-next.74",
532
+ "@takazudo/zfb-runtime": "^0.1.0-next.74",
533
+ "@takazudo/zudo-doc-history-server": "^2.2.1",
534
534
  "@takazudo/zdtp": "^0.4.2",
535
535
  "shiki": "^4.0.2",
536
536
  "zod": "^4.3.6",
@@ -572,8 +572,8 @@
572
572
  "typescript": "^5.0.0",
573
573
  "vitest": "^4.1.0",
574
574
  "zod": "^4.3.6",
575
- "@takazudo/zfb": "0.1.0-next.72",
576
- "@takazudo/zfb-runtime": "0.1.0-next.72"
575
+ "@takazudo/zfb": "0.1.0-next.74",
576
+ "@takazudo/zfb-runtime": "0.1.0-next.74"
577
577
  },
578
578
  "scripts": {
579
579
  "build": "tsup && tsc -p tsconfig.build.json",
@@ -4,17 +4,33 @@
4
4
  // The chrome wiring was PROMOTED to the public, shared
5
5
  // `createChrome(context, hostBindings)` builder
6
6
  // (`@takazudo/zudo-doc/chrome`, CTX #2423). This module is now just the seam
7
- // that calls it ONCE with the reconstructed route context and NO host bindings
8
- // so every host-bound slot resolves to its package-default stub and the
9
- // injected package-routes render is byte-identical to before. The host
10
- // (HOSTCOLLAPSE wave) will call `createChrome` directly with real bindings.
7
+ // that calls it ONCE with the reconstructed route context and the single
8
+ // DocHistory host binding needed for island registration (see below) every
9
+ // OTHER host-bound slot resolves to its package-default stub, so the injected
10
+ // package-routes render stays byte-identical. The host (HOSTCOLLAPSE wave) will
11
+ // call `createChrome` directly with its full real bindings.
11
12
 
12
13
  import { routeCtx } from "./_context.js";
13
14
  import { createChrome } from "@takazudo/zudo-doc/chrome";
15
+ import { DocHistory } from "@takazudo/zudo-doc/doc-history";
16
+ import type { ChromeHostBindings } from "@takazudo/zudo-doc/factory-context";
14
17
  import type { DocNavNode } from "./_docs-helpers.js";
15
18
 
16
- // Empty host bindings → package-default stubs (byte-identical injected path).
17
- const chrome = createChrome(routeCtx);
19
+ // Island-scanner contract (load-bearing): the injected doc routes reach the real
20
+ // DocHistory client island ONLY through this static import → `createChrome`
21
+ // hostBindings chain (docs-slug.tsx → _chrome.tsx → DocHistory). Without it,
22
+ // `deriveDocHistorySlot` falls back to the no-op stub, the SSR marker
23
+ // `data-zfb-island-skip-ssr="DocHistory"` has no matching registry entry, and the
24
+ // History button never hydrates under `packageOwnedRoutes` (zudolab/zudo-doc#2480).
25
+ // The import MUST stay static — a dynamic/type-only import stops zfb's island
26
+ // scanner from walking it. SSR output is unchanged: `DocHistoryArea` gates on
27
+ // `settings.docHistory` and the island is skip-SSR, so binding the real component
28
+ // vs the stub is byte-identical. Mirrors the host's `pages/lib/_chrome.ts`.
29
+ // (The narrow real-island props signature isn't assignable to the structural
30
+ // `FactoryComponent`, so cast — same as the host.)
31
+ const chrome = createChrome(routeCtx, {
32
+ DocHistory: DocHistory as unknown as ChromeHostBindings["DocHistory"],
33
+ });
18
34
 
19
35
  export const {
20
36
  composeMetaTitle,