@takazudo/zudo-doc 3.2.0 → 4.0.0

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 (439) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +2 -2
  3. package/bin/tag-cli-config.ts +126 -0
  4. package/bin/tags-audit-runner.ts +60 -76
  5. package/bin/tags-audit.mjs +17 -36
  6. package/bin/tags-suggest-runner.ts +429 -0
  7. package/bin/tags-suggest.mjs +30 -0
  8. package/bin/zudo-doc.mjs +78 -25
  9. package/dist/breadcrumb/breadcrumb.d.ts +4 -4
  10. package/dist/breadcrumb/find-path.d.ts +2 -2
  11. package/dist/breadcrumb/index.d.ts +1 -1
  12. package/dist/breadcrumb/types.d.ts +0 -5
  13. package/dist/chrome/derive.d.ts +16 -4
  14. package/dist/chrome/derive.js +64 -4
  15. package/dist/chrome/index.d.ts +13 -10
  16. package/dist/chrome/index.js +12 -6
  17. package/dist/chrome/primary-slots.d.ts +21 -0
  18. package/dist/chrome/primary-slots.js +59 -0
  19. package/dist/chrome-bindings.d.ts +227 -0
  20. package/dist/chrome-bindings.js +6 -0
  21. package/dist/code-syntax/code-block-enhancer-script.d.ts +4 -0
  22. package/dist/code-syntax/code-block-enhancer-script.js +7 -4
  23. package/dist/code-syntax/code-block-enhancer.d.ts +2 -2
  24. package/dist/code-syntax/code-block-enhancer.js +1 -3
  25. package/dist/code-syntax/index.d.ts +5 -5
  26. package/dist/code-syntax/index.js +4 -13
  27. package/dist/code-syntax/mermaid-init-script.d.ts +1 -22
  28. package/dist/code-syntax/mermaid-init-script.js +0 -2
  29. package/dist/code-syntax/mermaid-init.d.ts +0 -1
  30. package/dist/code-syntax/mermaid-init.js +3 -4
  31. package/dist/code-syntax/tabs-init.d.ts +0 -1
  32. package/dist/code-syntax/tabs-init.js +1 -3
  33. package/dist/code-syntax/tabs.d.ts +0 -1
  34. package/dist/code-syntax/tabs.js +1 -3
  35. package/dist/color-scheme-utils.d.ts +72 -4
  36. package/dist/color-scheme-utils.js +137 -0
  37. package/dist/color-schemes-defaults/index.d.ts +23 -0
  38. package/dist/color-schemes-defaults/index.js +134 -0
  39. package/dist/config.d.ts +459 -0
  40. package/dist/config.js +125 -0
  41. package/dist/content/component-map.d.ts +0 -16
  42. package/dist/content/component-map.js +2 -4
  43. package/dist/content/index.d.ts +1 -1
  44. package/dist/content/index.js +2 -3
  45. package/dist/content.css +1 -1
  46. package/dist/design-token-panel-bootstrap.d.ts +82 -27
  47. package/dist/design-token-panel-bootstrap.js +110 -21
  48. package/dist/design-token-panel-config/index.d.ts +49 -0
  49. package/dist/design-token-panel-config/index.js +211 -0
  50. package/dist/design-token-panel-config/manifest.d.ts +46 -0
  51. package/dist/design-token-panel-config/manifest.js +105 -0
  52. package/dist/directive-vocabulary-defaults/index.d.ts +16 -0
  53. package/dist/directive-vocabulary-defaults/index.js +12 -0
  54. package/dist/doc-body-end-islands/design-token-panel-island.d.ts +15 -0
  55. package/dist/doc-body-end-islands/design-token-panel-island.js +31 -0
  56. package/dist/doc-body-end-islands/index.d.ts +52 -7
  57. package/dist/doc-body-end-islands/index.js +19 -0
  58. package/dist/doc-body-end-islands/theme-pack-switcher-island.d.ts +37 -0
  59. package/dist/doc-body-end-islands/theme-pack-switcher-island.js +18 -0
  60. package/dist/doc-content-header/index.js +1 -1
  61. package/dist/doc-history-area/index.d.ts +10 -4
  62. package/dist/doc-history-area/index.js +3 -2
  63. package/dist/doc-metainfo-area/index.d.ts +1 -0
  64. package/dist/doc-page-props/index.d.ts +7 -23
  65. package/dist/doc-page-renderer/index.d.ts +1 -0
  66. package/dist/doc-page-renderer/index.js +1 -0
  67. package/dist/doc-page-shell/index.js +19 -12
  68. package/dist/doc-pager/index.js +1 -1
  69. package/dist/doc-route-entries/index.d.ts +2 -2
  70. package/dist/doclayout/doc-layout-with-defaults.js +4 -4
  71. package/dist/doclayout/doc-layout.d.ts +8 -0
  72. package/dist/doclayout/doc-layout.js +10 -1
  73. package/dist/docs-schema/index.d.ts +67 -0
  74. package/dist/docs-schema/index.js +43 -0
  75. package/dist/eject/index.d.ts +16 -0
  76. package/dist/eject/index.js +122 -28
  77. package/dist/extract-headings/index.d.ts +5 -8
  78. package/dist/extract-headings/index.js +2 -9
  79. package/dist/factory-context/index.d.ts +56 -4
  80. package/dist/features.css +65 -43
  81. package/dist/find-in-page/find-bar.d.ts +9 -0
  82. package/dist/find-in-page/find-bar.js +114 -0
  83. package/dist/find-in-page/find-in-page.d.ts +17 -0
  84. package/dist/find-in-page/find-in-page.js +131 -0
  85. package/dist/find-in-page/index.d.ts +11 -0
  86. package/dist/find-in-page/index.js +49 -0
  87. package/dist/footer/footer.js +1 -0
  88. package/dist/frontmatter-preview-defaults/index.d.ts +16 -0
  89. package/dist/frontmatter-preview-defaults/index.js +25 -0
  90. package/dist/head-with-defaults/index.d.ts +2 -0
  91. package/dist/head-with-defaults/index.js +16 -0
  92. package/dist/header/header.d.ts +10 -5
  93. package/dist/header/header.js +45 -5
  94. package/dist/header/index.d.ts +1 -1
  95. package/dist/header/types.d.ts +30 -1
  96. package/dist/header-with-defaults/index.js +1 -0
  97. package/dist/home-page/index.d.ts +2 -0
  98. package/dist/home-page/index.js +11 -5
  99. package/dist/home-page/prepare-home-data.js +1 -1
  100. package/dist/i18n-defaults/index.d.ts +22 -0
  101. package/dist/i18n-defaults/index.js +167 -0
  102. package/dist/locale-merge/index.d.ts +9 -14
  103. package/dist/locale-merge/index.js +6 -4
  104. package/dist/mdx-components/index.js +4 -4
  105. package/dist/plugins/claude-resources.d.ts +1 -0
  106. package/dist/plugins/claude-resources.js +4 -2
  107. package/dist/plugins/doc-history.js +1 -1
  108. package/dist/{integrations → plugins/internal}/claude-resources/index.d.ts +1 -16
  109. package/dist/{integrations → plugins/internal}/claude-resources/index.js +0 -9
  110. package/dist/{integrations → plugins/internal}/doc-history/index.d.ts +0 -17
  111. package/dist/{integrations → plugins/internal}/doc-history/index.js +0 -4
  112. package/dist/{integrations → plugins/internal}/doc-history/pre-build.d.ts +2 -4
  113. package/dist/plugins/internal/llms-txt/index.d.ts +7 -0
  114. package/dist/{integrations → plugins/internal}/llms-txt/load.d.ts +1 -1
  115. package/dist/{integrations → plugins/internal}/llms-txt/load.js +2 -2
  116. package/dist/{integrations → plugins/internal}/llms-txt/strip.d.ts +2 -3
  117. package/dist/{integrations → plugins/internal}/llms-txt/strip.js +1 -1
  118. package/dist/{integrations → plugins/internal}/llms-txt/types.d.ts +13 -22
  119. package/dist/{integrations → plugins/internal}/search-index/collect.js +1 -1
  120. package/dist/plugins/internal/theme-packs/copy.d.ts +32 -0
  121. package/dist/plugins/internal/theme-packs/copy.js +45 -0
  122. package/dist/plugins/internal/theme-packs/dev-middleware.d.ts +22 -0
  123. package/dist/plugins/internal/theme-packs/dev-middleware.js +80 -0
  124. package/dist/plugins/internal/theme-packs/index.d.ts +6 -0
  125. package/dist/plugins/internal/theme-packs/index.js +9 -0
  126. package/dist/plugins/internal/theme-packs/resolve.d.ts +17 -0
  127. package/dist/plugins/internal/theme-packs/resolve.js +17 -0
  128. package/dist/plugins/internal/theme-packs/types.d.ts +22 -0
  129. package/dist/plugins/internal/theme-packs/types.js +0 -0
  130. package/dist/plugins/llms-txt.js +1 -1
  131. package/dist/plugins/routes.js +55 -21
  132. package/dist/plugins/search-index.js +1 -1
  133. package/dist/plugins/theme-packs.d.ts +3 -0
  134. package/dist/plugins/theme-packs.js +40 -0
  135. package/dist/preset.d.ts +28 -14
  136. package/dist/preset.js +24 -9
  137. package/dist/route-context/index.js +4 -6
  138. package/dist/route-enumerators/index.d.ts +6 -18
  139. package/dist/route-enumerators/index.js +8 -6
  140. package/dist/routes/404.js +3 -1
  141. package/dist/routes/_chrome.js +3 -2
  142. package/dist/routes/_context.d.ts +7 -3
  143. package/dist/routes/_context.js +2 -0
  144. package/dist/routes/_docs-helpers.js +9 -21
  145. package/dist/safelist.css +1 -1
  146. package/dist/settings.d.ts +64 -12
  147. package/dist/sidebar-tree/build-tree.d.ts +3 -4
  148. package/dist/sidebar-tree/build-tree.js +4 -3
  149. package/dist/sidebar-tree/index.d.ts +2 -2
  150. package/dist/sidebar-tree/types.d.ts +6 -17
  151. package/dist/site-tree-nav-island/index.d.ts +3 -1
  152. package/dist/site-tree-nav-island/index.js +17 -5
  153. package/dist/site-tree-nav-island/state.d.ts +4 -0
  154. package/dist/site-tree-nav-island/state.js +10 -0
  155. package/dist/tag-helpers/index.d.ts +6 -13
  156. package/dist/tag-helpers/index.js +5 -23
  157. package/dist/tag-pages/index.d.ts +8 -21
  158. package/dist/tag-pages/index.js +14 -10
  159. package/dist/tags-audit.d.ts +16 -44
  160. package/dist/tags-audit.js +9 -172
  161. package/dist/theme/color-scheme-provider.d.ts +2 -3
  162. package/dist/theme/color-scheme-provider.js +2 -10
  163. package/dist/theme/index.d.ts +1 -4
  164. package/dist/theme/index.js +2 -30
  165. package/dist/theme/theme-pack-provider.d.ts +42 -0
  166. package/dist/theme/theme-pack-provider.js +75 -0
  167. package/dist/theme-cli/apply.d.ts +16 -0
  168. package/dist/theme-cli/apply.js +61 -0
  169. package/dist/theme-cli/config-io.d.ts +15 -0
  170. package/dist/theme-cli/config-io.js +51 -0
  171. package/dist/theme-cli/config-rewriter.d.ts +21 -0
  172. package/dist/theme-cli/config-rewriter.js +141 -0
  173. package/dist/theme-cli/config-scanner.d.ts +63 -0
  174. package/dist/theme-cli/config-scanner.js +288 -0
  175. package/dist/theme-cli/index.d.ts +7 -0
  176. package/dist/theme-cli/index.js +38 -0
  177. package/dist/theme-cli/list.d.ts +27 -0
  178. package/dist/theme-cli/list.js +64 -0
  179. package/dist/theme-cli/provenance.d.ts +17 -0
  180. package/dist/theme-cli/provenance.js +35 -0
  181. package/dist/theme-cli/registry.d.ts +14 -0
  182. package/dist/theme-cli/registry.js +13 -0
  183. package/dist/theme-pack-dialog/dialog-state.d.ts +25 -0
  184. package/dist/theme-pack-dialog/dialog-state.js +40 -0
  185. package/dist/theme-pack-dialog/index.d.ts +5 -0
  186. package/dist/theme-pack-dialog/index.js +152 -0
  187. package/dist/theme-pack-dialog/theme-pack-card.d.ts +25 -0
  188. package/dist/theme-pack-dialog/theme-pack-card.js +72 -0
  189. package/dist/theme-pack-switcher/index.d.ts +49 -0
  190. package/dist/theme-pack-switcher/index.js +205 -0
  191. package/dist/theme-pack-switcher/switcher-state.d.ts +56 -0
  192. package/dist/theme-pack-switcher/switcher-state.js +43 -0
  193. package/dist/theme-pack-switcher/theme-pack-sync.d.ts +85 -0
  194. package/dist/theme-pack-switcher/theme-pack-sync.js +121 -0
  195. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-400-latin.woff2 +0 -0
  196. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-700-latin.woff2 +0 -0
  197. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-italic-400-latin.woff2 +0 -0
  198. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-italic-700-latin.woff2 +0 -0
  199. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegibleMono-italic-latin.woff2 +0 -0
  200. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegibleMono-latin.woff2 +0 -0
  201. package/dist/theme-packs/beacon/fonts/OFL.txt +94 -0
  202. package/dist/theme-packs/beacon/meta.json +37 -0
  203. package/dist/theme-packs/beacon/pack.css +442 -0
  204. package/dist/theme-packs/broadsheet/fonts/CourierPrime-400-latin.woff2 +0 -0
  205. package/dist/theme-packs/broadsheet/fonts/CourierPrime-700-latin.woff2 +0 -0
  206. package/dist/theme-packs/broadsheet/fonts/OFL.txt +95 -0
  207. package/dist/theme-packs/broadsheet/fonts/PlayfairDisplay-italic-latin.woff2 +0 -0
  208. package/dist/theme-packs/broadsheet/fonts/PlayfairDisplay-latin.woff2 +0 -0
  209. package/dist/theme-packs/broadsheet/fonts/SourceSerif4-italic-latin.woff2 +0 -0
  210. package/dist/theme-packs/broadsheet/fonts/SourceSerif4-latin.woff2 +0 -0
  211. package/dist/theme-packs/broadsheet/meta.json +38 -0
  212. package/dist/theme-packs/broadsheet/pack.css +448 -0
  213. package/dist/theme-packs/brutalist/fonts/ArchivoBlack-latin.woff2 +0 -0
  214. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  215. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  216. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-700-latin.woff2 +0 -0
  217. package/dist/theme-packs/brutalist/fonts/OFL.txt +95 -0
  218. package/dist/theme-packs/brutalist/fonts/SpaceGrotesk-latin.woff2 +0 -0
  219. package/dist/theme-packs/brutalist/meta.json +38 -0
  220. package/dist/theme-packs/brutalist/pack.css +546 -0
  221. package/dist/theme-packs/default/meta.json +37 -0
  222. package/dist/theme-packs/drift/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  223. package/dist/theme-packs/drift/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  224. package/dist/theme-packs/drift/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  225. package/dist/theme-packs/drift/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  226. package/dist/theme-packs/drift/fonts/IBMPlexSans-italic-latin.woff2 +0 -0
  227. package/dist/theme-packs/drift/fonts/IBMPlexSans-latin-ext.woff2 +0 -0
  228. package/dist/theme-packs/drift/fonts/IBMPlexSans-latin.woff2 +0 -0
  229. package/dist/theme-packs/drift/fonts/OFL.txt +93 -0
  230. package/dist/theme-packs/drift/meta.json +37 -0
  231. package/dist/theme-packs/drift/pack.css +478 -0
  232. package/dist/theme-packs/fjord/fonts/Inter-latin-ext.woff2 +0 -0
  233. package/dist/theme-packs/fjord/fonts/Inter-latin.woff2 +0 -0
  234. package/dist/theme-packs/fjord/fonts/JetBrainsMono-latin-ext.woff2 +0 -0
  235. package/dist/theme-packs/fjord/fonts/JetBrainsMono-latin.woff2 +0 -0
  236. package/dist/theme-packs/fjord/fonts/OFL.txt +94 -0
  237. package/dist/theme-packs/fjord/meta.json +37 -0
  238. package/dist/theme-packs/fjord/pack.css +375 -0
  239. package/dist/theme-packs/foundry/fonts/Inter-latin-ext.woff2 +0 -0
  240. package/dist/theme-packs/foundry/fonts/Inter-latin.woff2 +0 -0
  241. package/dist/theme-packs/foundry/fonts/OFL.txt +93 -0
  242. package/dist/theme-packs/foundry/meta.json +37 -0
  243. package/dist/theme-packs/foundry/pack.css +202 -0
  244. package/dist/theme-packs/futura-editorial/fonts/Jost-latin.woff2 +0 -0
  245. package/dist/theme-packs/futura-editorial/fonts/NotoSans-italic-latin.woff2 +0 -0
  246. package/dist/theme-packs/futura-editorial/fonts/NotoSans-latin.woff2 +0 -0
  247. package/dist/theme-packs/futura-editorial/fonts/OFL.txt +95 -0
  248. package/dist/theme-packs/futura-editorial/fonts/SpaceMono-400-latin.woff2 +0 -0
  249. package/dist/theme-packs/futura-editorial/fonts/SpaceMono-700-latin.woff2 +0 -0
  250. package/dist/theme-packs/futura-editorial/meta.json +38 -0
  251. package/dist/theme-packs/futura-editorial/pack.css +313 -0
  252. package/dist/theme-packs/hearth/fonts/Fraunces-italic-latin.woff2 +0 -0
  253. package/dist/theme-packs/hearth/fonts/Fraunces-latin.woff2 +0 -0
  254. package/dist/theme-packs/hearth/fonts/Nunito-latin.woff2 +0 -0
  255. package/dist/theme-packs/hearth/fonts/OFL.txt +95 -0
  256. package/dist/theme-packs/hearth/fonts/SplineSansMono-latin.woff2 +0 -0
  257. package/dist/theme-packs/hearth/meta.json +38 -0
  258. package/dist/theme-packs/hearth/pack.css +385 -0
  259. package/dist/theme-packs/hollow/fonts/OFL.txt +94 -0
  260. package/dist/theme-packs/hollow/fonts/SpaceGrotesk-latin.woff2 +0 -0
  261. package/dist/theme-packs/hollow/fonts/SpaceMono-400-italic-latin.woff2 +0 -0
  262. package/dist/theme-packs/hollow/fonts/SpaceMono-400-latin.woff2 +0 -0
  263. package/dist/theme-packs/hollow/fonts/SpaceMono-700-latin.woff2 +0 -0
  264. package/dist/theme-packs/hollow/meta.json +37 -0
  265. package/dist/theme-packs/hollow/pack.css +428 -0
  266. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-ext-italic.woff2 +0 -0
  267. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-ext.woff2 +0 -0
  268. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-italic.woff2 +0 -0
  269. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin.woff2 +0 -0
  270. package/dist/theme-packs/ledger/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  271. package/dist/theme-packs/ledger/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  272. package/dist/theme-packs/ledger/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  273. package/dist/theme-packs/ledger/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  274. package/dist/theme-packs/ledger/fonts/OFL.txt +94 -0
  275. package/dist/theme-packs/ledger/meta.json +37 -0
  276. package/dist/theme-packs/ledger/pack.css +463 -0
  277. package/dist/theme-packs/manuscript/fonts/CourierPrime-400-latin-ext.woff2 +0 -0
  278. package/dist/theme-packs/manuscript/fonts/CourierPrime-400-latin.woff2 +0 -0
  279. package/dist/theme-packs/manuscript/fonts/CourierPrime-700-latin-ext.woff2 +0 -0
  280. package/dist/theme-packs/manuscript/fonts/CourierPrime-700-latin.woff2 +0 -0
  281. package/dist/theme-packs/manuscript/fonts/EBGaramond-latin-italic.woff2 +0 -0
  282. package/dist/theme-packs/manuscript/fonts/EBGaramond-latin.woff2 +0 -0
  283. package/dist/theme-packs/manuscript/fonts/OFL.txt +94 -0
  284. package/dist/theme-packs/manuscript/meta.json +37 -0
  285. package/dist/theme-packs/manuscript/pack.css +376 -0
  286. package/dist/theme-packs/matcha/fonts/MPLUS1Code-latin.woff2 +0 -0
  287. package/dist/theme-packs/matcha/fonts/OFL.txt +95 -0
  288. package/dist/theme-packs/matcha/fonts/ShipporiMincho-500-latin.woff2 +0 -0
  289. package/dist/theme-packs/matcha/fonts/ShipporiMincho-700-latin.woff2 +0 -0
  290. package/dist/theme-packs/matcha/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  291. package/dist/theme-packs/matcha/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  292. package/dist/theme-packs/matcha/meta.json +38 -0
  293. package/dist/theme-packs/matcha/pack.css +409 -0
  294. package/dist/theme-packs/nocturne/fonts/CormorantGaramond-italic-latin.woff2 +0 -0
  295. package/dist/theme-packs/nocturne/fonts/CormorantGaramond-latin.woff2 +0 -0
  296. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  297. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  298. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-italic-latin.woff2 +0 -0
  299. package/dist/theme-packs/nocturne/fonts/Manrope-latin.woff2 +0 -0
  300. package/dist/theme-packs/nocturne/fonts/OFL.txt +95 -0
  301. package/dist/theme-packs/nocturne/meta.json +38 -0
  302. package/dist/theme-packs/nocturne/pack.css +502 -0
  303. package/dist/theme-packs/observatory/fonts/JosefinSans-latin.woff2 +0 -0
  304. package/dist/theme-packs/observatory/fonts/Jost-italic-latin.woff2 +0 -0
  305. package/dist/theme-packs/observatory/fonts/Jost-latin.woff2 +0 -0
  306. package/dist/theme-packs/observatory/fonts/OFL.txt +95 -0
  307. package/dist/theme-packs/observatory/fonts/SpaceMono-400-latin.woff2 +0 -0
  308. package/dist/theme-packs/observatory/fonts/SpaceMono-700-latin.woff2 +0 -0
  309. package/dist/theme-packs/observatory/fonts/SpaceMono-italic-latin.woff2 +0 -0
  310. package/dist/theme-packs/observatory/meta.json +38 -0
  311. package/dist/theme-packs/observatory/pack.css +728 -0
  312. package/dist/theme-packs/onyx/fonts/CormorantGaramond-italic-latin.woff2 +0 -0
  313. package/dist/theme-packs/onyx/fonts/CormorantGaramond-latin.woff2 +0 -0
  314. package/dist/theme-packs/onyx/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  315. package/dist/theme-packs/onyx/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  316. package/dist/theme-packs/onyx/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  317. package/dist/theme-packs/onyx/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  318. package/dist/theme-packs/onyx/fonts/Jost-latin.woff2 +0 -0
  319. package/dist/theme-packs/onyx/fonts/OFL.txt +95 -0
  320. package/dist/theme-packs/onyx/meta.json +38 -0
  321. package/dist/theme-packs/onyx/pack.css +497 -0
  322. package/dist/theme-packs/phosphor/fonts/JetBrainsMono-latin-ext.woff2 +0 -0
  323. package/dist/theme-packs/phosphor/fonts/JetBrainsMono-latin.woff2 +0 -0
  324. package/dist/theme-packs/phosphor/fonts/OFL.txt +94 -0
  325. package/dist/theme-packs/phosphor/fonts/VT323-latin-ext.woff2 +0 -0
  326. package/dist/theme-packs/phosphor/fonts/VT323-latin.woff2 +0 -0
  327. package/dist/theme-packs/phosphor/meta.json +38 -0
  328. package/dist/theme-packs/phosphor/pack.css +493 -0
  329. package/dist/theme-packs/solar/fonts/OFL.txt +94 -0
  330. package/dist/theme-packs/solar/fonts/SourceCodePro-italic-latin.woff2 +0 -0
  331. package/dist/theme-packs/solar/fonts/SourceCodePro-latin.woff2 +0 -0
  332. package/dist/theme-packs/solar/fonts/SourceSans3-italic-latin.woff2 +0 -0
  333. package/dist/theme-packs/solar/fonts/SourceSans3-latin.woff2 +0 -0
  334. package/dist/theme-packs/solar/meta.json +37 -0
  335. package/dist/theme-packs/solar/pack.css +380 -0
  336. package/dist/theme-packs/sumi/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  337. package/dist/theme-packs/sumi/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  338. package/dist/theme-packs/sumi/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  339. package/dist/theme-packs/sumi/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  340. package/dist/theme-packs/sumi/fonts/OFL.txt +95 -0
  341. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-600-latin.woff2 +0 -0
  342. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-700-latin.woff2 +0 -0
  343. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-800-latin.woff2 +0 -0
  344. package/dist/theme-packs/sumi/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  345. package/dist/theme-packs/sumi/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  346. package/dist/theme-packs/sumi/meta.json +38 -0
  347. package/dist/theme-packs/sumi/pack.css +502 -0
  348. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  349. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  350. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-600-latin.woff2 +0 -0
  351. package/dist/theme-packs/swissgrid/fonts/Inter-latin-ext.woff2 +0 -0
  352. package/dist/theme-packs/swissgrid/fonts/Inter-latin.woff2 +0 -0
  353. package/dist/theme-packs/swissgrid/fonts/InterTight-latin.woff2 +0 -0
  354. package/dist/theme-packs/swissgrid/fonts/OFL.txt +95 -0
  355. package/dist/theme-packs/swissgrid/meta.json +38 -0
  356. package/dist/theme-packs/swissgrid/pack.css +518 -0
  357. package/dist/theme-packs/washi/fonts/MPlus1Code-400-latin.woff2 +0 -0
  358. package/dist/theme-packs/washi/fonts/MPlus1Code-500-latin.woff2 +0 -0
  359. package/dist/theme-packs/washi/fonts/OFL.txt +95 -0
  360. package/dist/theme-packs/washi/fonts/ShipporiMincho-500-latin.woff2 +0 -0
  361. package/dist/theme-packs/washi/fonts/ShipporiMincho-600-latin.woff2 +0 -0
  362. package/dist/theme-packs/washi/fonts/ShipporiMincho-700-latin.woff2 +0 -0
  363. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  364. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  365. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-700-latin.woff2 +0 -0
  366. package/dist/theme-packs/washi/meta.json +38 -0
  367. package/dist/theme-packs/washi/pack.css +479 -0
  368. package/dist/theme-packs-registry/index.d.ts +5 -0
  369. package/dist/theme-packs-registry/index.js +30 -0
  370. package/dist/theme-packs-registry/load-registry.d.ts +23 -0
  371. package/dist/theme-packs-registry/load-registry.js +64 -0
  372. package/dist/theme-packs-registry/meta-schema.d.ts +70 -0
  373. package/dist/theme-packs-registry/meta-schema.js +38 -0
  374. package/dist/theme-packs-registry/resolve-enabled-packs.d.ts +25 -0
  375. package/dist/theme-packs-registry/resolve-enabled-packs.js +43 -0
  376. package/dist/theme-packs-registry/token-manifest.d.ts +19 -0
  377. package/dist/theme-packs-registry/token-manifest.js +57 -0
  378. package/dist/theme-packs-registry/validator.d.ts +35 -0
  379. package/dist/theme-packs-registry/validator.js +284 -0
  380. package/dist/theme-toggle/color-scheme-sync.d.ts +2 -4
  381. package/dist/theme.css +319 -0
  382. package/dist/versions-page/index.d.ts +2 -2
  383. package/dist/versions-page/index.js +8 -8
  384. package/dist/z-index-defaults/index.d.ts +45 -0
  385. package/dist/z-index-defaults/index.js +34 -0
  386. package/eject/breadcrumb/breadcrumb.tsx +4 -4
  387. package/eject/breadcrumb/find-path.ts +2 -2
  388. package/eject/breadcrumb/index.ts +1 -1
  389. package/eject/breadcrumb/types.ts +0 -6
  390. package/eject/code-group/index.tsx +2 -2
  391. package/eject/doc-history/index.tsx +1 -1
  392. package/eject/doc-pager/index.tsx +1 -1
  393. package/eject/footer/footer.tsx +1 -0
  394. package/eject/header/header.tsx +86 -21
  395. package/eject/header/index.ts +3 -0
  396. package/eject/header/types.ts +39 -1
  397. package/eject/site-tree-nav-island/index.tsx +15 -3
  398. package/eject/site-tree-nav-island/state.ts +9 -0
  399. package/eject/theme-toggle/color-scheme-sync.ts +2 -4
  400. package/package.json +82 -29
  401. package/routes-src/404.tsx +4 -1
  402. package/routes-src/_chrome.tsx +31 -8
  403. package/routes-src/_context.ts +4 -0
  404. package/routes-src/_docs-helpers.ts +9 -29
  405. package/routes-src/_virtual.d.ts +38 -2
  406. package/tsconfig.base.json +29 -0
  407. package/virtual-modules.d.ts +83 -0
  408. package/zfb-config-shim.d.ts +210 -0
  409. package/dist/integrations/llms-txt/index.d.ts +0 -33
  410. package/dist/theme/color-tweak-export-modal.d.ts +0 -16
  411. package/dist/theme/color-tweak-export-modal.js +0 -138
  412. package/dist/theme/design-token-serde.d.ts +0 -183
  413. package/dist/theme/design-token-serde.js +0 -346
  414. package/dist/theme/design-token-types.d.ts +0 -13
  415. package/dist/theme/design-token-types.js +0 -6
  416. package/dist/theme/iframe-bridge.d.ts +0 -42
  417. package/dist/theme/iframe-bridge.js +0 -72
  418. /package/dist/{integrations → plugins/internal}/claude-resources/escape-for-mdx.d.ts +0 -0
  419. /package/dist/{integrations → plugins/internal}/claude-resources/escape-for-mdx.js +0 -0
  420. /package/dist/{integrations → plugins/internal}/claude-resources/generate.d.ts +0 -0
  421. /package/dist/{integrations → plugins/internal}/claude-resources/generate.js +0 -0
  422. /package/dist/{integrations → plugins/internal}/doc-history/pre-build.js +0 -0
  423. /package/dist/{integrations → plugins/internal}/llms-txt/dev-middleware.d.ts +0 -0
  424. /package/dist/{integrations → plugins/internal}/llms-txt/dev-middleware.js +0 -0
  425. /package/dist/{integrations → plugins/internal}/llms-txt/emit.d.ts +0 -0
  426. /package/dist/{integrations → plugins/internal}/llms-txt/emit.js +0 -0
  427. /package/dist/{integrations → plugins/internal}/llms-txt/generate.d.ts +0 -0
  428. /package/dist/{integrations → plugins/internal}/llms-txt/generate.js +0 -0
  429. /package/dist/{integrations → plugins/internal}/llms-txt/index.js +0 -0
  430. /package/dist/{integrations → plugins/internal}/llms-txt/types.js +0 -0
  431. /package/dist/{integrations → plugins/internal}/search-index/build-emitter.d.ts +0 -0
  432. /package/dist/{integrations → plugins/internal}/search-index/build-emitter.js +0 -0
  433. /package/dist/{integrations → plugins/internal}/search-index/collect.d.ts +0 -0
  434. /package/dist/{integrations → plugins/internal}/search-index/dev-middleware.d.ts +0 -0
  435. /package/dist/{integrations → plugins/internal}/search-index/dev-middleware.js +0 -0
  436. /package/dist/{integrations → plugins/internal}/search-index/index.d.ts +0 -0
  437. /package/dist/{integrations → plugins/internal}/search-index/index.js +0 -0
  438. /package/dist/{integrations → plugins/internal}/search-index/types.d.ts +0 -0
  439. /package/dist/{integrations → plugins/internal}/search-index/types.js +0 -0
@@ -49,6 +49,8 @@ import { LANGUAGE_SWITCHER_INIT_SCRIPT } from "../i18n-version/language-switcher
49
49
  import { VERSION_SWITCHER_REWIRE_SCRIPT } from "../i18n-version/version-switcher.js";
50
50
  import type {
51
51
  HeaderNavItem,
52
+ HeaderRightComponentProps,
53
+ HeaderRightComponentRegistry,
52
54
  HeaderRightItem,
53
55
  Locale,
54
56
  } from "./types.js";
@@ -137,10 +139,9 @@ export interface HeaderProps {
137
139
  search?: ComponentChildren;
138
140
 
139
141
  /**
140
- * When provided, emits `data-zfb-transition-persist={persistKey}` on the
142
+ * Emits `data-zfb-transition-persist={persistKey}` on the
141
143
  * `<header>` element so zfb's client-router preserves DOM-node identity
142
- * across same-locale View Transition swaps. Omit to disable persist
143
- * (back-compat default — the header is re-rendered on every swap).
144
+ * across same-locale View Transition swaps.
144
145
  *
145
146
  * **Locale keying**: callers MUST key by locale (e.g. `"header-en"`,
146
147
  * `"header-ja"`). Cross-locale swaps must NOT share the same key; a
@@ -156,7 +157,7 @@ export interface HeaderProps {
156
157
  * for consistency, matching the Astro reference implementation
157
158
  * (zudolab/zudo-doc#1546).
158
159
  */
159
- persistKey?: string;
160
+ persistKey: string;
160
161
 
161
162
  /** Site-name string shown in the logo anchor (host `settings.siteName`). */
162
163
  siteName: string;
@@ -175,6 +176,13 @@ export interface HeaderProps {
175
176
  */
176
177
  headerRightItems: HeaderRightItem[];
177
178
 
179
+ /**
180
+ * Host-callable renderers for project-owned component names. The registry is
181
+ * carried through `chromeBindingsModule`; it is never part of the serialized
182
+ * settings payload. Package built-in names are reserved.
183
+ */
184
+ headerRightComponents?: HeaderRightComponentRegistry;
185
+
178
186
  /**
179
187
  * Whether the host has a `colorMode` config. Required because the
180
188
  * `theme-toggle` right-item is two-gated: the filter drops it when
@@ -253,6 +261,7 @@ export function Header(props: HeaderProps): JSX.Element {
253
261
  siteName,
254
262
  headerNav,
255
263
  headerRightItems,
264
+ headerRightComponents,
256
265
  colorModeEnabled,
257
266
  hasLocales,
258
267
  hasVersions,
@@ -267,14 +276,15 @@ export function Header(props: HeaderProps): JSX.Element {
267
276
  const matchPath = pathForMatch(pathWithoutBase, lang, i18n.defaultLocale);
268
277
 
269
278
  const activeNavPath = computeActiveNavPath(headerNav, matchPath);
279
+ const rightItemDispatch = createRightItemDispatch(headerRightComponents);
270
280
 
271
281
  return (
272
282
  <header
273
283
  class="sticky top-0 z-toolbar flex h-[3.5rem] items-center border-b border-muted bg-surface px-hsp-lg"
274
284
  data-header
275
285
  // Strategy B persist (zudolab/zudo-doc#1546): the header now carries
276
- // data-zfb-transition-persist when a locale-keyed persistKey is
277
- // supplied (e.g. "header-en" / "header-ja"). Cross-locale swaps use
286
+ // data-zfb-transition-persist with a locale-keyed persistKey
287
+ // (e.g. "header-en" / "header-ja"). Cross-locale swaps use
278
288
  // different keys, so the router replaces the header element entirely,
279
289
  // re-rendering the locale toggle anchors and all locale-specific SSR
280
290
  // content with fresh markup. Same-locale swaps share the key and
@@ -303,7 +313,6 @@ export function Header(props: HeaderProps): JSX.Element {
303
313
  // LANGUAGE_SWITCHER_INIT_SCRIPT recomputes each anchor's href from
304
314
  // window.location on AFTER_NAVIGATE_EVENT, same as the controls above
305
315
  // (zudolab/zudo-doc#2551).
306
- // Omit persistKey to fall back to the old repaint-on-every-swap path.
307
316
  data-zfb-transition-persist={persistKey}
308
317
  >
309
318
  {sidebarToggle ?? (
@@ -371,6 +380,7 @@ export function Header(props: HeaderProps): JSX.Element {
371
380
  colorModeEnabled,
372
381
  hasLocales,
373
382
  },
383
+ rightItemDispatch,
374
384
  ))}
375
385
  </div>
376
386
 
@@ -513,17 +523,7 @@ function renderNavItem(
513
523
  );
514
524
  }
515
525
 
516
- interface RightItemContext {
517
- lang: Locale | undefined;
518
- githubRepoUrl: string | null;
519
- githubLabel: string;
520
- themeToggle: ComponentChildren;
521
- languageSwitcher: ComponentChildren;
522
- versionSwitcher: ComponentChildren;
523
- search: ComponentChildren;
524
- colorModeEnabled: boolean;
525
- hasLocales: boolean;
526
- }
526
+ type RightItemContext = Omit<HeaderRightComponentProps, "item" | "index">;
527
527
 
528
528
  /**
529
529
  * Shared trigger-button shell for header-right items that dispatch a
@@ -591,7 +591,15 @@ type RightItemHandler = (
591
591
 
592
592
  // Dispatch table keyed by `${type}:${trigger|component}`, or just `type`
593
593
  // for link/html items that carry no sub-type discriminant.
594
- const RIGHT_ITEM_DISPATCH: Record<string, RightItemHandler> = {
594
+ const BUILTIN_COMPONENT_NAMES = [
595
+ "theme-toggle",
596
+ "language-switcher",
597
+ "version-switcher",
598
+ "github-link",
599
+ "search",
600
+ ] as const;
601
+
602
+ const BASE_RIGHT_ITEM_DISPATCH: Readonly<Record<string, RightItemHandler>> = {
595
603
  "trigger:design-token-panel": (_item, index) => (
596
604
  <TriggerButton
597
605
  index={index}
@@ -737,10 +745,55 @@ const RIGHT_ITEM_DISPATCH: Record<string, RightItemHandler> = {
737
745
  },
738
746
  };
739
747
 
748
+ /**
749
+ * Compose the immutable package dispatch table with host-callable component
750
+ * entries. Built-ins are reserved: a host collision is almost certainly a
751
+ * typo or an attempted override, so reject it rather than silently changing
752
+ * package markup. Runtime callable checks keep JavaScript/untyped consumers on
753
+ * the same contract as TypeScript callers.
754
+ */
755
+ function createRightItemDispatch(
756
+ hostRegistry: HeaderRightComponentRegistry | undefined,
757
+ ): ReadonlyMap<string, RightItemHandler> {
758
+ const dispatch = new Map<string, RightItemHandler>(
759
+ Object.entries(BASE_RIGHT_ITEM_DISPATCH),
760
+ );
761
+ if (hostRegistry === undefined) return dispatch;
762
+
763
+ for (const [name, component] of Object.entries(hostRegistry)) {
764
+ if (BUILTIN_COMPONENT_NAMES.includes(name as typeof BUILTIN_COMPONENT_NAMES[number])) {
765
+ throw new Error(
766
+ `[zudo-doc] Duplicate header-right component name "${name}" at ` +
767
+ `chromeBindings.headerRightComponents[${JSON.stringify(name)}]: built-in names are reserved and ` +
768
+ `cannot be shadowed. Remove this registry entry or choose a project-owned name.`,
769
+ );
770
+ }
771
+ if (typeof component !== "function") {
772
+ throw new TypeError(
773
+ `[zudo-doc] Invalid header-right component "${name}" at ` +
774
+ `chromeBindings.headerRightComponents[${JSON.stringify(name)}]: expected a callable renderer.`,
775
+ );
776
+ }
777
+
778
+ dispatch.set(`component:${name}`, (item, index, ctx) => {
779
+ if (item.type !== "component") return null;
780
+ const CustomComponent = component;
781
+ return (
782
+ <SlotWrapper index={index}>
783
+ <CustomComponent item={item} index={index} {...ctx} />
784
+ </SlotWrapper>
785
+ );
786
+ });
787
+ }
788
+
789
+ return dispatch;
790
+ }
791
+
740
792
  function renderRightItem(
741
793
  item: HeaderRightItem,
742
794
  index: number,
743
795
  ctx: RightItemContext,
796
+ dispatch: ReadonlyMap<string, RightItemHandler>,
744
797
  ): VNode | null {
745
798
  const key =
746
799
  item.type === "trigger"
@@ -748,6 +801,18 @@ function renderRightItem(
748
801
  : item.type === "component"
749
802
  ? `component:${item.component}`
750
803
  : item.type;
751
- const handler = RIGHT_ITEM_DISPATCH[key];
752
- return handler ? handler(item, index, ctx) : null;
804
+ const handler = dispatch.get(key);
805
+ if (handler) return handler(item, index, ctx);
806
+
807
+ if (item.type === "component") {
808
+ throw new Error(
809
+ `[zudo-doc] Unknown header-right component "${item.component}" at ` +
810
+ `Header.headerRightItems[${index}].component. Register a callable renderer as ` +
811
+ `chromeBindings.headerRightComponents["${item.component}"] through ` +
812
+ `settings.chromeBindingsModule, or use a built-in name: ` +
813
+ `${BUILTIN_COMPONENT_NAMES.join(", ")}.`,
814
+ );
815
+ }
816
+
817
+ return null;
753
818
  }
@@ -14,8 +14,11 @@ export type {
14
14
  Locale,
15
15
  HeaderNavChildItem,
16
16
  HeaderNavItem,
17
+ HeaderRightBuiltinComponentName,
17
18
  HeaderRightComponentItem,
18
19
  HeaderRightComponentName,
20
+ HeaderRightComponentProps,
21
+ HeaderRightComponentRegistry,
19
22
  HeaderRightHtmlItem,
20
23
  HeaderRightItem,
21
24
  HeaderRightLinkItem,
@@ -11,6 +11,8 @@
11
11
  // downstream consumers may continue to use the v2 types until the v2
12
12
  // package itself widens them. Changes here are v2 breaking changes.
13
13
 
14
+ import type { ComponentChildren } from "preact";
15
+
14
16
  /**
15
17
  * Locale code as seen by the header. Widened from the host's literal
16
18
  * union (`"en" | "ja" | …`) to plain `string` at the v2 boundary so the
@@ -30,13 +32,22 @@ export interface HeaderNavItem extends HeaderNavChildItem {
30
32
  children?: HeaderNavChildItem[];
31
33
  }
32
34
 
33
- export type HeaderRightComponentName =
35
+ export type HeaderRightBuiltinComponentName =
34
36
  | "theme-toggle"
35
37
  | "language-switcher"
36
38
  | "version-switcher"
37
39
  | "github-link"
38
40
  | "search";
39
41
 
42
+ /**
43
+ * A serializable name resolved against the package built-ins plus the host's
44
+ * `headerRightComponents` chrome-binding registry. The intersection preserves
45
+ * built-in autocomplete while allowing project-owned names.
46
+ */
47
+ export type HeaderRightComponentName =
48
+ | HeaderRightBuiltinComponentName
49
+ | (string & {});
50
+
40
51
  export type HeaderRightTriggerName = "design-token-panel" | "ai-chat";
41
52
 
42
53
  export interface HeaderRightComponentItem {
@@ -44,6 +55,33 @@ export interface HeaderRightComponentItem {
44
55
  component: HeaderRightComponentName;
45
56
  }
46
57
 
58
+ /**
59
+ * Exact props passed to a host `headerRightComponents` renderer. They mirror
60
+ * the existing header-right dispatch context; no callable enters the
61
+ * serialized {@link HeaderRightComponentItem}.
62
+ */
63
+ export interface HeaderRightComponentProps {
64
+ /** The serialized item that selected this renderer. */
65
+ item: HeaderRightComponentItem;
66
+ /** Zero-based position in the rendered `headerRightItems` array. */
67
+ index: number;
68
+ lang: Locale | undefined;
69
+ githubRepoUrl: string | null;
70
+ githubLabel: string;
71
+ themeToggle: ComponentChildren;
72
+ languageSwitcher: ComponentChildren;
73
+ versionSwitcher: ComponentChildren;
74
+ search: ComponentChildren;
75
+ colorModeEnabled: boolean;
76
+ hasLocales: boolean;
77
+ }
78
+
79
+ /** A callable-only host registry keyed by serialized component name. */
80
+ export type HeaderRightComponentRegistry = Record<
81
+ string,
82
+ (props: HeaderRightComponentProps) => ComponentChildren
83
+ >;
84
+
47
85
  export interface HeaderRightTriggerItem {
48
86
  type: "trigger";
49
87
  trigger: HeaderRightTriggerName;
@@ -8,6 +8,7 @@ import { useState } from "preact/hooks";
8
8
  import type { SidebarNavNode } from "../sidebar/types.js";
9
9
  import { INDENT, connectorLeft, ConnectorLines, CategoryLinkIcon } from "../tree-nav-shared/index.js";
10
10
  import { ChevronRight } from "../icons/index.js";
11
+ import { initialCategoryOpenState, toggleCategoryOpenState } from "./state.js";
11
12
 
12
13
  // site-tree-nav uses wider padding than the narrow sidebar
13
14
  const SITE_BASE_PAD = "clamp(0.5rem, 0.8vw, 1rem)";
@@ -39,6 +40,8 @@ export interface SiteTreeNavProps {
39
40
  ariaLabel?: string;
40
41
  categoryOrder?: string[];
41
42
  categoryIgnore?: string[];
43
+ /** Root-category slugs that should start collapsed. */
44
+ initiallyCollapsedCategorySlugs?: string[];
42
45
  }
43
46
 
44
47
  export function SiteTreeNav({
@@ -46,6 +49,7 @@ export function SiteTreeNav({
46
49
  ariaLabel = "Site index",
47
50
  categoryOrder,
48
51
  categoryIgnore,
52
+ initiallyCollapsedCategorySlugs,
49
53
  }: SiteTreeNavProps) {
50
54
  let processedTree = tree;
51
55
  if (categoryIgnore) {
@@ -55,6 +59,7 @@ export function SiteTreeNav({
55
59
  if (categoryOrder) {
56
60
  processedTree = reorderTree(processedTree, categoryOrder);
57
61
  }
62
+ const initiallyCollapsed = new Set(initiallyCollapsedCategorySlugs);
58
63
  return (
59
64
  <nav
60
65
  aria-label={ariaLabel}
@@ -67,7 +72,12 @@ export function SiteTreeNav({
67
72
  {processedTree.map((node) => (
68
73
  <div key={node.slug} className="min-w-0 border border-muted pl-hsp-sm py-vsp-2xs">
69
74
  {node.children.length > 0 ? (
70
- <CategoryNode node={node} depth={0} isLast={true} />
75
+ <CategoryNode
76
+ node={node}
77
+ depth={0}
78
+ isLast={true}
79
+ initiallyCollapsed={initiallyCollapsed.has(node.slug)}
80
+ />
71
81
  ) : (
72
82
  <LeafNode node={node} depth={0} isLast={true} />
73
83
  )}
@@ -107,13 +117,15 @@ function CategoryNode({
107
117
  node,
108
118
  depth,
109
119
  isLast,
120
+ initiallyCollapsed = false,
110
121
  }: {
111
122
  node: SidebarNavNode;
112
123
  depth: number;
113
124
  isLast: boolean;
125
+ initiallyCollapsed?: boolean;
114
126
  }) {
115
- const [open, setOpen] = useState(true);
116
- const toggle = () => setOpen((prev) => !prev);
127
+ const [open, setOpen] = useState(() => initialCategoryOpenState(initiallyCollapsed));
128
+ const toggle = () => setOpen(toggleCategoryOpenState);
117
129
  const paddingLeft = padLeft(depth);
118
130
 
119
131
  return (
@@ -0,0 +1,9 @@
1
+ /** Derive the one-time open state used when a category mounts. */
2
+ export function initialCategoryOpenState(initiallyCollapsed: boolean): boolean {
3
+ return !initiallyCollapsed;
4
+ }
5
+
6
+ /** Toggle a mounted category without coupling later state to its initial input. */
7
+ export function toggleCategoryOpenState(open: boolean): boolean {
8
+ return !open;
9
+ }
@@ -41,10 +41,8 @@ export function readColorSchemeFromDom(
41
41
  * `color-scheme-changed` window event.
42
42
  *
43
43
  * Tweak-state reconciliation is intentionally NOT done here (#2037). The zdtp
44
- * panel owns its own storage lifecycle: it persists the unified tweak envelope
45
- * under `zudo-doc-tweak-state-v4` (auto-migrating the legacy
46
- * `zudo-doc-tweak-state-v3` / `-v2` / `zudo-doc-tweak-state` (v1) keys into
47
- * it), and its own `color-scheme-changed` listener clears applied inline
44
+ * panel owns its own storage lifecycle and current persisted-state contract;
45
+ * its own `color-scheme-changed` listener clears applied inline
48
46
  * styles and re-seeds the color slice from the newly active scheme. An
49
47
  * earlier version of this function deleted `zudo-doc-tweak-state` + `-v2` on
50
48
  * every toggle, which (a) targeted stale keys after zdtp moved to v3 — so it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takazudo/zudo-doc",
3
- "version": "3.2.0",
3
+ "version": "4.0.0",
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",
@@ -107,26 +107,10 @@
107
107
  "types": "./dist/transitions/index.d.ts",
108
108
  "default": "./dist/transitions/index.js"
109
109
  },
110
- "./integrations/doc-history": {
111
- "types": "./dist/integrations/doc-history/index.d.ts",
112
- "default": "./dist/integrations/doc-history/index.js"
113
- },
114
- "./integrations/llms-txt": {
115
- "types": "./dist/integrations/llms-txt/index.d.ts",
116
- "default": "./dist/integrations/llms-txt/index.js"
117
- },
118
110
  "./integrations/changelog": {
119
111
  "types": "./dist/integrations/changelog/index.d.ts",
120
112
  "default": "./dist/integrations/changelog/index.js"
121
113
  },
122
- "./integrations/search-index": {
123
- "types": "./dist/integrations/search-index/index.d.ts",
124
- "default": "./dist/integrations/search-index/index.js"
125
- },
126
- "./integrations/claude-resources": {
127
- "types": "./dist/integrations/claude-resources/index.d.ts",
128
- "default": "./dist/integrations/claude-resources/index.js"
129
- },
130
114
  "./content": {
131
115
  "types": "./dist/content/index.d.ts",
132
116
  "default": "./dist/content/index.js"
@@ -195,6 +179,10 @@
195
179
  "types": "./dist/plugins/routes.d.ts",
196
180
  "default": "./dist/plugins/routes.js"
197
181
  },
182
+ "./plugins/theme-packs": {
183
+ "types": "./dist/plugins/theme-packs.d.ts",
184
+ "default": "./dist/plugins/theme-packs.js"
185
+ },
198
186
  "./content-admonition": {
199
187
  "types": "./dist/content-admonition/index.d.ts",
200
188
  "default": "./dist/content-admonition/index.js"
@@ -227,15 +215,23 @@
227
215
  "types": "./dist/chrome/index.d.ts",
228
216
  "default": "./dist/chrome/index.js"
229
217
  },
218
+ "./chrome-bindings": {
219
+ "types": "./dist/chrome-bindings.d.ts",
220
+ "default": "./dist/chrome-bindings.js"
221
+ },
230
222
  "./home-page": {
231
223
  "types": "./dist/home-page/index.d.ts",
232
224
  "default": "./dist/home-page/index.js"
233
225
  },
226
+ "./theme.css": "./dist/theme.css",
234
227
  "./safelist.css": "./dist/safelist.css",
235
- "./safelist": "./dist/safelist.css",
236
228
  "./content.css": "./dist/content.css",
237
229
  "./page-loading.css": "./dist/page-loading.css",
238
230
  "./features.css": "./dist/features.css",
231
+ "./theme-packs/*": "./dist/theme-packs/*",
232
+ "./tsconfig.base.json": "./tsconfig.base.json",
233
+ "./zfb-config-shim.d.ts": "./zfb-config-shim.d.ts",
234
+ "./virtual-modules.d.ts": "./virtual-modules.d.ts",
239
235
  "./tags-audit": {
240
236
  "types": "./dist/tags-audit.d.ts",
241
237
  "default": "./dist/tags-audit.js"
@@ -248,6 +244,10 @@
248
244
  "types": "./dist/design-token-panel-bootstrap.d.ts",
249
245
  "default": "./dist/design-token-panel-bootstrap.js"
250
246
  },
247
+ "./design-token-panel-config": {
248
+ "types": "./dist/design-token-panel-config/index.d.ts",
249
+ "default": "./dist/design-token-panel-config/index.js"
250
+ },
251
251
  "./render-markdown": {
252
252
  "types": "./dist/render-markdown/index.d.ts",
253
253
  "default": "./dist/render-markdown/index.js"
@@ -316,6 +316,10 @@
316
316
  "types": "./dist/ai-chat-modal/index.d.ts",
317
317
  "default": "./dist/ai-chat-modal/index.js"
318
318
  },
319
+ "./find-in-page": {
320
+ "types": "./dist/find-in-page/index.d.ts",
321
+ "default": "./dist/find-in-page/index.js"
322
+ },
319
323
  "./doc-history": {
320
324
  "types": "./dist/doc-history/index.d.ts",
321
325
  "default": "./dist/doc-history/index.js"
@@ -531,12 +535,45 @@
531
535
  "./sidebar-active-slug": {
532
536
  "types": "./dist/sidebar-active-slug/index.d.ts",
533
537
  "default": "./dist/sidebar-active-slug/index.js"
538
+ },
539
+ "./i18n-defaults": {
540
+ "types": "./dist/i18n-defaults/index.d.ts",
541
+ "default": "./dist/i18n-defaults/index.js"
542
+ },
543
+ "./color-schemes-defaults": {
544
+ "types": "./dist/color-schemes-defaults/index.d.ts",
545
+ "default": "./dist/color-schemes-defaults/index.js"
546
+ },
547
+ "./docs-schema": {
548
+ "types": "./dist/docs-schema/index.d.ts",
549
+ "default": "./dist/docs-schema/index.js"
550
+ },
551
+ "./z-index-defaults": {
552
+ "types": "./dist/z-index-defaults/index.d.ts",
553
+ "default": "./dist/z-index-defaults/index.js"
554
+ },
555
+ "./frontmatter-preview-defaults": {
556
+ "types": "./dist/frontmatter-preview-defaults/index.d.ts",
557
+ "default": "./dist/frontmatter-preview-defaults/index.js"
558
+ },
559
+ "./directive-vocabulary-defaults": {
560
+ "types": "./dist/directive-vocabulary-defaults/index.d.ts",
561
+ "default": "./dist/directive-vocabulary-defaults/index.js"
562
+ },
563
+ "./config": {
564
+ "types": "./dist/config.d.ts",
565
+ "default": "./dist/config.js"
566
+ },
567
+ "./theme-cli": {
568
+ "types": "./dist/theme-cli/index.d.ts",
569
+ "default": "./dist/theme-cli/index.js"
534
570
  }
535
571
  },
536
572
  "bin": {
537
573
  "gen-component-tokens": "./bin/gen-component-tokens.mjs",
538
574
  "gen-z-index": "./bin/gen-z-index.mjs",
539
575
  "tags-audit": "./bin/tags-audit.mjs",
576
+ "tags-suggest": "./bin/tags-suggest.mjs",
540
577
  "zudo-doc": "./bin/zudo-doc.mjs"
541
578
  },
542
579
  "files": [
@@ -544,19 +581,23 @@
544
581
  "bin",
545
582
  "eject",
546
583
  "routes-src",
584
+ "tsconfig.base.json",
585
+ "zfb-config-shim.d.ts",
586
+ "virtual-modules.d.ts",
547
587
  "README.md",
548
588
  "CHANGELOG.md"
549
589
  ],
550
590
  "peerDependencies": {
591
+ "@takazudo/zdtp": "^0.4.9",
592
+ "@takazudo/zfb": "^0.1.0-next.87",
593
+ "@takazudo/zfb-md-wasm": "^0.1.0-next.87",
594
+ "@takazudo/zfb-runtime": "^0.1.0-next.87",
595
+ "@takazudo/zudo-doc-history-server": "^4.0.0",
596
+ "diff": "^8.0.0",
597
+ "katex": "^0.16.0",
551
598
  "preact": "^10.29.1",
552
- "@takazudo/zfb": "^0.1.0-next.78",
553
- "@takazudo/zfb-runtime": "^0.1.0-next.78",
554
- "@takazudo/zudo-doc-history-server": "^3.1.0",
555
- "@takazudo/zdtp": "^0.4.5",
556
599
  "shiki": "^4.0.2",
557
- "zod": "^4.3.6",
558
- "katex": "^0.16.0",
559
- "diff": "^8.0.0"
600
+ "zod": "^4.3.6"
560
601
  },
561
602
  "peerDependenciesMeta": {
562
603
  "@takazudo/zudo-doc-history-server": {
@@ -565,6 +606,9 @@
565
606
  "@takazudo/zdtp": {
566
607
  "optional": true
567
608
  },
609
+ "@takazudo/zfb-md-wasm": {
610
+ "optional": true
611
+ },
568
612
  "shiki": {
569
613
  "optional": true
570
614
  },
@@ -576,16 +620,26 @@
576
620
  }
577
621
  },
578
622
  "dependencies": {
623
+ "@inquirer/prompts": "^8.4.2",
579
624
  "fs-extra": "^11.3.0",
580
625
  "gray-matter": "^4.0.3",
581
626
  "minimist": "^1.2.8",
582
- "picocolors": "^1.1.1"
627
+ "picocolors": "^1.1.1",
628
+ "pluralize": "^8.0.0",
629
+ "string-similarity": "^4.0.4",
630
+ "tsx": "^4.21.0"
583
631
  },
584
632
  "devDependencies": {
633
+ "@takazudo/zfb": "0.1.0-next.87",
634
+ "@takazudo/zfb-md-wasm": "0.1.0-next.87",
635
+ "@takazudo/zfb-runtime": "0.1.0-next.87",
585
636
  "@types/fs-extra": "^11.0.4",
586
637
  "@types/minimist": "^1.2.5",
587
638
  "@types/node": "^25.3.5",
639
+ "@types/pluralize": "^0.0.33",
640
+ "@types/string-similarity": "^4.0.2",
588
641
  "cross-env": "^7.0.3",
642
+ "happy-dom": "^20.10.6",
589
643
  "preact": "^10.29.1",
590
644
  "preact-render-to-string": "^6.6.6",
591
645
  "shiki": "^4.0.2",
@@ -593,13 +647,12 @@
593
647
  "typescript": "^5.0.0",
594
648
  "vitest": "^4.1.0",
595
649
  "zod": "^4.3.6",
596
- "@takazudo/zfb": "0.1.0-next.78",
597
- "@takazudo/zfb-runtime": "0.1.0-next.78",
598
- "@takazudo/zudo-doc-history-server": "3.2.0"
650
+ "@takazudo/zudo-doc-history-server": "4.0.0"
599
651
  },
600
652
  "scripts": {
601
653
  "build": "tsup && tsc -p tsconfig.build.json",
602
654
  "dev": "tsup --watch",
655
+ "test:plugin-resolution": "node scripts/check-plugin-resolution.mjs",
603
656
  "test": "vitest run --config vitest.config.ts",
604
657
  "test:slow": "vitest run --config vitest.slow.config.ts",
605
658
  "typecheck": "tsc --noEmit"
@@ -5,7 +5,8 @@
5
5
 
6
6
  import type { JSX } from "preact";
7
7
  import { DocLayoutWithDefaults } from "@takazudo/zudo-doc/doclayout";
8
- import { settings, defaultLocale, withBase } from "./_context.js";
8
+ import { resolveThemePackSsrSlug } from "@takazudo/zudo-doc/theme";
9
+ import { settings, defaultLocale, withBase, themePackRegistry } from "./_context.js";
9
10
  import {
10
11
  HeadWithDefaults,
11
12
  HeaderWithDefaults,
@@ -25,6 +26,8 @@ export default function NotFoundPage(): JSX.Element {
25
26
  title={composeMetaTitle(title)}
26
27
  head={<HeadWithDefaults title={title} />}
27
28
  lang={locale}
29
+ // SSR `data-theme-pack` html attribute (ADR theme-packs.md D3, #2822).
30
+ dataThemePack={resolveThemePackSsrSlug(themePackRegistry, settings)}
28
31
  noindex={true}
29
32
  hideSidebar={true}
30
33
  hideToc={true}
@@ -13,8 +13,14 @@
13
13
  import { routeCtx } from "./_context.js";
14
14
  import { createChrome } from "@takazudo/zudo-doc/chrome";
15
15
  import { DocHistory } from "@takazudo/zudo-doc/doc-history";
16
- import type { ChromeHostBindings } from "@takazudo/zudo-doc/factory-context";
17
16
  import type { DocNavNode } from "./_docs-helpers.js";
17
+ // Imported via the BARE published subpath rather than a relative
18
+ // `../chrome-bindings.js`. This file is copied into consumer projects by the
19
+ // routes-src mechanism (`scripts/copy-routes-src.mjs`), which rewrites relative
20
+ // `../` imports to `@takazudo/zudo-doc/*` specifiers so the copy resolves
21
+ // against this package's `dist/`. Writing the bare specifier here directly
22
+ // keeps the source identical to that rewritten output.
23
+ import { defineChromeBindings } from "@takazudo/zudo-doc/chrome-bindings";
18
24
  // Host-callables channel (#2501): re-exports `settings.chromeBindingsModule`
19
25
  // when the host configured one, else `{}` — see
20
26
  // `plugins/routes.ts` and `docs/adr/route-injection-seam.md`
@@ -31,20 +37,37 @@ import { chromeBindings } from "virtual:zudo-doc-chrome-bindings";
31
37
  // The import MUST stay static — a dynamic/type-only import stops zfb's island
32
38
  // scanner from walking it. SSR output is unchanged: `DocHistoryArea` gates on
33
39
  // `settings.docHistory` and the island is skip-SSR, so binding the real component
34
- // vs the stub is byte-identical. Mirrors the host's `pages/lib/_chrome.ts`.
40
+ // vs the stub is byte-identical. Mirrors the host's `src/chrome-bindings.tsx`.
35
41
  // (The narrow real-island props signature isn't assignable to the structural
36
- // `FactoryComponent`, so cast same as the host.)
42
+ // `FactoryComponent`, so it's widened through `defineChromeBindings` same
43
+ // helper the host uses — which checks `DocHistory` against its real call-side
44
+ // prop contract before performing the widening, restoring the #2674
45
+ // drift-detection check a bare cast would erase.)
37
46
  //
38
- // `...chromeBindings` is spread AFTER the `DocHistory` default so a host that
39
- // configured `chromeBindingsModule` can override ANY slot — including
40
- // DocHistory itself while a host that didn't still gets the #2480 fix for
41
- // free. Note the SSR-presentational-only limitation: a client island defined
47
+ // The statically imported DocHistory is spread AFTER `...chromeBindings` so
48
+ // scanner-safe hydration wins consistently with generated self-contained
49
+ // routes. Hosts can override every other slot; DocHistory customization uses
50
+ // the package island's supported owner path rather than a virtual callable
51
+ // that the scanner cannot register. `chromeBindings` (the virtual re-export) is already
52
+ // erased to the structural `ChromeHostBindings` at its own source, so it is
53
+ // spread as-is rather than run back through `defineChromeBindings` (which
54
+ // cannot recover types `defineChromeBindings` never checked in the first
55
+ // place). Note the SSR-presentational-only limitation: a client island defined
42
56
  // INSIDE the bindings module is not guaranteed to register on injected routes
43
57
  // the way the static `DocHistory` import above is (the virtual re-export sits
44
58
  // outside zfb's static-import scanner reachability graph) — see the ADR.
59
+ //
60
+ // `DesignTokenPanelBootstrap` (#2658) is NOT threaded here: unlike DocHistory
61
+ // (whose derive-level default is a no-op stub), the package-default island IS
62
+ // the derive-level default (`chrome/derive.tsx`'s `deriveBodyEndIslands`,
63
+ // gate-2 fix from the Wave-5 confirm #2659) — so this shim, the locked-manifest
64
+ // self-contained doc stub (#2653), and every other bare `createChrome` caller
65
+ // all get it without explicit wiring. Scanner reachability holds through the
66
+ // static chain route → this shim → `createChrome` → `chrome/derive` →
67
+ // `design-token-panel-bootstrap`.
45
68
  const chrome = createChrome(routeCtx, {
46
- DocHistory: DocHistory as unknown as ChromeHostBindings["DocHistory"],
47
69
  ...chromeBindings,
70
+ ...defineChromeBindings({ DocHistory }),
48
71
  });
49
72
 
50
73
  export const {