@takazudo/zudo-doc 3.3.0 → 4.1.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 (423) hide show
  1. package/CHANGELOG.md +51 -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 -10
  14. package/dist/chrome/derive.js +53 -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 +68 -0
  20. package/dist/code-syntax/code-block-enhancer-script.d.ts +4 -0
  21. package/dist/code-syntax/code-block-enhancer-script.js +7 -4
  22. package/dist/code-syntax/code-block-enhancer.d.ts +2 -2
  23. package/dist/code-syntax/code-block-enhancer.js +1 -3
  24. package/dist/code-syntax/index.d.ts +5 -5
  25. package/dist/code-syntax/index.js +4 -13
  26. package/dist/code-syntax/mermaid-init-script.d.ts +1 -22
  27. package/dist/code-syntax/mermaid-init-script.js +0 -2
  28. package/dist/code-syntax/mermaid-init.d.ts +0 -1
  29. package/dist/code-syntax/mermaid-init.js +3 -4
  30. package/dist/code-syntax/tabs-init.d.ts +0 -1
  31. package/dist/code-syntax/tabs-init.js +1 -3
  32. package/dist/code-syntax/tabs.d.ts +0 -1
  33. package/dist/code-syntax/tabs.js +1 -3
  34. package/dist/color-scheme-utils.d.ts +71 -3
  35. package/dist/color-scheme-utils.js +137 -0
  36. package/dist/color-schemes-defaults/index.js +13 -0
  37. package/dist/config/component-tokens.d.ts +1 -1
  38. package/dist/config/component-tokens.js +104 -5
  39. package/dist/config.d.ts +28 -12
  40. package/dist/config.js +11 -2
  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 +45 -40
  47. package/dist/design-token-panel-bootstrap.js +98 -21
  48. package/dist/design-token-panel-config/index.js +1 -4
  49. package/dist/doc-body-end-islands/design-token-panel-island.d.ts +15 -0
  50. package/dist/doc-body-end-islands/design-token-panel-island.js +31 -0
  51. package/dist/doc-body-end-islands/index.d.ts +39 -17
  52. package/dist/doc-body-end-islands/index.js +13 -21
  53. package/dist/doc-body-end-islands/theme-pack-switcher-island.d.ts +37 -0
  54. package/dist/doc-body-end-islands/theme-pack-switcher-island.js +18 -0
  55. package/dist/doc-content-header/index.js +1 -1
  56. package/dist/doc-history-area/index.d.ts +10 -4
  57. package/dist/doc-history-area/index.js +3 -2
  58. package/dist/doc-metainfo-area/index.d.ts +1 -0
  59. package/dist/doc-page-props/index.d.ts +7 -23
  60. package/dist/doc-page-renderer/index.d.ts +1 -0
  61. package/dist/doc-page-renderer/index.js +1 -0
  62. package/dist/doc-page-shell/index.js +19 -12
  63. package/dist/doc-pager/index.js +1 -1
  64. package/dist/doc-route-entries/index.d.ts +2 -2
  65. package/dist/doclayout/doc-layout-with-defaults.js +4 -4
  66. package/dist/doclayout/doc-layout.d.ts +8 -0
  67. package/dist/doclayout/doc-layout.js +10 -1
  68. package/dist/docs-schema/index.js +1 -5
  69. package/dist/eject/index.d.ts +16 -0
  70. package/dist/eject/index.js +122 -28
  71. package/dist/extract-headings/index.d.ts +5 -8
  72. package/dist/extract-headings/index.js +2 -9
  73. package/dist/factory-context/index.d.ts +42 -4
  74. package/dist/features.css +80 -45
  75. package/dist/footer/footer.js +1 -0
  76. package/dist/head-with-defaults/index.d.ts +2 -0
  77. package/dist/head-with-defaults/index.js +16 -0
  78. package/dist/header/header.d.ts +10 -5
  79. package/dist/header/header.js +45 -5
  80. package/dist/header/index.d.ts +1 -1
  81. package/dist/header/types.d.ts +30 -1
  82. package/dist/header-with-defaults/index.js +1 -0
  83. package/dist/home-page/index.d.ts +2 -0
  84. package/dist/home-page/index.js +11 -5
  85. package/dist/home-page/prepare-home-data.js +1 -1
  86. package/dist/locale-merge/index.d.ts +9 -14
  87. package/dist/locale-merge/index.js +6 -4
  88. package/dist/mdx-components/index.js +4 -4
  89. package/dist/plugins/claude-resources.d.ts +1 -0
  90. package/dist/plugins/claude-resources.js +4 -2
  91. package/dist/plugins/doc-history.js +1 -1
  92. package/dist/{integrations → plugins/internal}/claude-resources/index.d.ts +1 -16
  93. package/dist/{integrations → plugins/internal}/claude-resources/index.js +0 -9
  94. package/dist/{integrations → plugins/internal}/doc-history/index.d.ts +0 -17
  95. package/dist/{integrations → plugins/internal}/doc-history/index.js +0 -4
  96. package/dist/{integrations → plugins/internal}/doc-history/pre-build.d.ts +2 -4
  97. package/dist/plugins/internal/llms-txt/index.d.ts +7 -0
  98. package/dist/{integrations → plugins/internal}/llms-txt/load.d.ts +1 -1
  99. package/dist/{integrations → plugins/internal}/llms-txt/load.js +2 -2
  100. package/dist/{integrations → plugins/internal}/llms-txt/strip.d.ts +2 -3
  101. package/dist/{integrations → plugins/internal}/llms-txt/strip.js +1 -1
  102. package/dist/{integrations → plugins/internal}/llms-txt/types.d.ts +13 -22
  103. package/dist/{integrations → plugins/internal}/search-index/collect.js +1 -1
  104. package/dist/plugins/internal/theme-packs/copy.d.ts +32 -0
  105. package/dist/plugins/internal/theme-packs/copy.js +45 -0
  106. package/dist/plugins/internal/theme-packs/dev-middleware.d.ts +22 -0
  107. package/dist/plugins/internal/theme-packs/dev-middleware.js +80 -0
  108. package/dist/plugins/internal/theme-packs/index.d.ts +6 -0
  109. package/dist/plugins/internal/theme-packs/index.js +9 -0
  110. package/dist/plugins/internal/theme-packs/resolve.d.ts +17 -0
  111. package/dist/plugins/internal/theme-packs/resolve.js +17 -0
  112. package/dist/plugins/internal/theme-packs/types.d.ts +22 -0
  113. package/dist/plugins/internal/theme-packs/types.js +0 -0
  114. package/dist/plugins/llms-txt.js +1 -1
  115. package/dist/plugins/routes.js +11 -1
  116. package/dist/plugins/search-index.js +1 -1
  117. package/dist/plugins/theme-packs.d.ts +3 -0
  118. package/dist/plugins/theme-packs.js +40 -0
  119. package/dist/preset.d.ts +19 -14
  120. package/dist/preset.js +24 -9
  121. package/dist/route-context/index.js +4 -6
  122. package/dist/route-enumerators/index.d.ts +6 -18
  123. package/dist/route-enumerators/index.js +8 -6
  124. package/dist/routes/404.js +3 -1
  125. package/dist/routes/_chrome.js +2 -2
  126. package/dist/routes/_context.d.ts +7 -3
  127. package/dist/routes/_context.js +2 -0
  128. package/dist/routes/_docs-helpers.js +9 -21
  129. package/dist/safelist.css +1 -1
  130. package/dist/settings.d.ts +27 -12
  131. package/dist/sidebar-toggle-island/index.js +1 -0
  132. package/dist/sidebar-tree/build-tree.d.ts +3 -4
  133. package/dist/sidebar-tree/build-tree.js +4 -3
  134. package/dist/sidebar-tree/index.d.ts +2 -2
  135. package/dist/sidebar-tree/types.d.ts +6 -17
  136. package/dist/site-tree-nav-island/index.d.ts +3 -1
  137. package/dist/site-tree-nav-island/index.js +17 -5
  138. package/dist/site-tree-nav-island/state.d.ts +4 -0
  139. package/dist/site-tree-nav-island/state.js +10 -0
  140. package/dist/tag-helpers/index.d.ts +6 -13
  141. package/dist/tag-helpers/index.js +5 -23
  142. package/dist/tag-pages/index.d.ts +8 -21
  143. package/dist/tag-pages/index.js +14 -10
  144. package/dist/tags-audit.d.ts +16 -44
  145. package/dist/tags-audit.js +9 -172
  146. package/dist/theme/color-scheme-provider.d.ts +2 -3
  147. package/dist/theme/color-scheme-provider.js +2 -10
  148. package/dist/theme/index.d.ts +1 -4
  149. package/dist/theme/index.js +2 -30
  150. package/dist/theme/theme-pack-provider.d.ts +42 -0
  151. package/dist/theme/theme-pack-provider.js +75 -0
  152. package/dist/theme-cli/apply.d.ts +16 -0
  153. package/dist/theme-cli/apply.js +61 -0
  154. package/dist/theme-cli/config-io.d.ts +15 -0
  155. package/dist/theme-cli/config-io.js +51 -0
  156. package/dist/theme-cli/config-rewriter.d.ts +21 -0
  157. package/dist/theme-cli/config-rewriter.js +141 -0
  158. package/dist/theme-cli/config-scanner.d.ts +63 -0
  159. package/dist/theme-cli/config-scanner.js +288 -0
  160. package/dist/theme-cli/index.d.ts +7 -0
  161. package/dist/theme-cli/index.js +38 -0
  162. package/dist/theme-cli/list.d.ts +27 -0
  163. package/dist/theme-cli/list.js +64 -0
  164. package/dist/theme-cli/provenance.d.ts +17 -0
  165. package/dist/theme-cli/provenance.js +35 -0
  166. package/dist/theme-cli/registry.d.ts +14 -0
  167. package/dist/theme-cli/registry.js +13 -0
  168. package/dist/theme-pack-dialog/dialog-state.d.ts +25 -0
  169. package/dist/theme-pack-dialog/dialog-state.js +40 -0
  170. package/dist/theme-pack-dialog/index.d.ts +5 -0
  171. package/dist/theme-pack-dialog/index.js +152 -0
  172. package/dist/theme-pack-dialog/theme-pack-card.d.ts +25 -0
  173. package/dist/theme-pack-dialog/theme-pack-card.js +72 -0
  174. package/dist/theme-pack-switcher/index.d.ts +49 -0
  175. package/dist/theme-pack-switcher/index.js +205 -0
  176. package/dist/theme-pack-switcher/switcher-state.d.ts +56 -0
  177. package/dist/theme-pack-switcher/switcher-state.js +43 -0
  178. package/dist/theme-pack-switcher/theme-pack-sync.d.ts +85 -0
  179. package/dist/theme-pack-switcher/theme-pack-sync.js +121 -0
  180. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-400-latin.woff2 +0 -0
  181. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-700-latin.woff2 +0 -0
  182. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-italic-400-latin.woff2 +0 -0
  183. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-italic-700-latin.woff2 +0 -0
  184. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegibleMono-italic-latin.woff2 +0 -0
  185. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegibleMono-latin.woff2 +0 -0
  186. package/dist/theme-packs/beacon/fonts/OFL.txt +94 -0
  187. package/dist/theme-packs/beacon/meta.json +37 -0
  188. package/dist/theme-packs/beacon/pack.css +442 -0
  189. package/dist/theme-packs/broadsheet/fonts/CourierPrime-400-latin.woff2 +0 -0
  190. package/dist/theme-packs/broadsheet/fonts/CourierPrime-700-latin.woff2 +0 -0
  191. package/dist/theme-packs/broadsheet/fonts/OFL.txt +95 -0
  192. package/dist/theme-packs/broadsheet/fonts/PlayfairDisplay-italic-latin.woff2 +0 -0
  193. package/dist/theme-packs/broadsheet/fonts/PlayfairDisplay-latin.woff2 +0 -0
  194. package/dist/theme-packs/broadsheet/fonts/SourceSerif4-italic-latin.woff2 +0 -0
  195. package/dist/theme-packs/broadsheet/fonts/SourceSerif4-latin.woff2 +0 -0
  196. package/dist/theme-packs/broadsheet/meta.json +38 -0
  197. package/dist/theme-packs/broadsheet/pack.css +448 -0
  198. package/dist/theme-packs/brutalist/fonts/ArchivoBlack-latin.woff2 +0 -0
  199. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  200. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  201. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-700-latin.woff2 +0 -0
  202. package/dist/theme-packs/brutalist/fonts/OFL.txt +95 -0
  203. package/dist/theme-packs/brutalist/fonts/SpaceGrotesk-latin.woff2 +0 -0
  204. package/dist/theme-packs/brutalist/meta.json +38 -0
  205. package/dist/theme-packs/brutalist/pack.css +546 -0
  206. package/dist/theme-packs/default/meta.json +37 -0
  207. package/dist/theme-packs/drift/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  208. package/dist/theme-packs/drift/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  209. package/dist/theme-packs/drift/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  210. package/dist/theme-packs/drift/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  211. package/dist/theme-packs/drift/fonts/IBMPlexSans-italic-latin.woff2 +0 -0
  212. package/dist/theme-packs/drift/fonts/IBMPlexSans-latin-ext.woff2 +0 -0
  213. package/dist/theme-packs/drift/fonts/IBMPlexSans-latin.woff2 +0 -0
  214. package/dist/theme-packs/drift/fonts/OFL.txt +93 -0
  215. package/dist/theme-packs/drift/meta.json +37 -0
  216. package/dist/theme-packs/drift/pack.css +478 -0
  217. package/dist/theme-packs/fjord/fonts/Inter-latin-ext.woff2 +0 -0
  218. package/dist/theme-packs/fjord/fonts/Inter-latin.woff2 +0 -0
  219. package/dist/theme-packs/fjord/fonts/JetBrainsMono-latin-ext.woff2 +0 -0
  220. package/dist/theme-packs/fjord/fonts/JetBrainsMono-latin.woff2 +0 -0
  221. package/dist/theme-packs/fjord/fonts/OFL.txt +94 -0
  222. package/dist/theme-packs/fjord/meta.json +37 -0
  223. package/dist/theme-packs/fjord/pack.css +375 -0
  224. package/dist/theme-packs/foundry/fonts/Inter-latin-ext.woff2 +0 -0
  225. package/dist/theme-packs/foundry/fonts/Inter-latin.woff2 +0 -0
  226. package/dist/theme-packs/foundry/fonts/OFL.txt +93 -0
  227. package/dist/theme-packs/foundry/meta.json +37 -0
  228. package/dist/theme-packs/foundry/pack.css +202 -0
  229. package/dist/theme-packs/futura-editorial/fonts/Jost-latin.woff2 +0 -0
  230. package/dist/theme-packs/futura-editorial/fonts/NotoSans-italic-latin.woff2 +0 -0
  231. package/dist/theme-packs/futura-editorial/fonts/NotoSans-latin.woff2 +0 -0
  232. package/dist/theme-packs/futura-editorial/fonts/OFL.txt +95 -0
  233. package/dist/theme-packs/futura-editorial/fonts/SpaceMono-400-latin.woff2 +0 -0
  234. package/dist/theme-packs/futura-editorial/fonts/SpaceMono-700-latin.woff2 +0 -0
  235. package/dist/theme-packs/futura-editorial/meta.json +38 -0
  236. package/dist/theme-packs/futura-editorial/pack.css +313 -0
  237. package/dist/theme-packs/hearth/fonts/Fraunces-italic-latin.woff2 +0 -0
  238. package/dist/theme-packs/hearth/fonts/Fraunces-latin.woff2 +0 -0
  239. package/dist/theme-packs/hearth/fonts/Nunito-latin.woff2 +0 -0
  240. package/dist/theme-packs/hearth/fonts/OFL.txt +95 -0
  241. package/dist/theme-packs/hearth/fonts/SplineSansMono-latin.woff2 +0 -0
  242. package/dist/theme-packs/hearth/meta.json +38 -0
  243. package/dist/theme-packs/hearth/pack.css +385 -0
  244. package/dist/theme-packs/hollow/fonts/OFL.txt +94 -0
  245. package/dist/theme-packs/hollow/fonts/SpaceGrotesk-latin.woff2 +0 -0
  246. package/dist/theme-packs/hollow/fonts/SpaceMono-400-italic-latin.woff2 +0 -0
  247. package/dist/theme-packs/hollow/fonts/SpaceMono-400-latin.woff2 +0 -0
  248. package/dist/theme-packs/hollow/fonts/SpaceMono-700-latin.woff2 +0 -0
  249. package/dist/theme-packs/hollow/meta.json +37 -0
  250. package/dist/theme-packs/hollow/pack.css +428 -0
  251. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-ext-italic.woff2 +0 -0
  252. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-ext.woff2 +0 -0
  253. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-italic.woff2 +0 -0
  254. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin.woff2 +0 -0
  255. package/dist/theme-packs/ledger/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  256. package/dist/theme-packs/ledger/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  257. package/dist/theme-packs/ledger/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  258. package/dist/theme-packs/ledger/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  259. package/dist/theme-packs/ledger/fonts/OFL.txt +94 -0
  260. package/dist/theme-packs/ledger/meta.json +37 -0
  261. package/dist/theme-packs/ledger/pack.css +463 -0
  262. package/dist/theme-packs/manuscript/fonts/CourierPrime-400-latin-ext.woff2 +0 -0
  263. package/dist/theme-packs/manuscript/fonts/CourierPrime-400-latin.woff2 +0 -0
  264. package/dist/theme-packs/manuscript/fonts/CourierPrime-700-latin-ext.woff2 +0 -0
  265. package/dist/theme-packs/manuscript/fonts/CourierPrime-700-latin.woff2 +0 -0
  266. package/dist/theme-packs/manuscript/fonts/EBGaramond-latin-italic.woff2 +0 -0
  267. package/dist/theme-packs/manuscript/fonts/EBGaramond-latin.woff2 +0 -0
  268. package/dist/theme-packs/manuscript/fonts/OFL.txt +94 -0
  269. package/dist/theme-packs/manuscript/meta.json +37 -0
  270. package/dist/theme-packs/manuscript/pack.css +376 -0
  271. package/dist/theme-packs/matcha/fonts/MPLUS1Code-latin.woff2 +0 -0
  272. package/dist/theme-packs/matcha/fonts/OFL.txt +95 -0
  273. package/dist/theme-packs/matcha/fonts/ShipporiMincho-500-latin.woff2 +0 -0
  274. package/dist/theme-packs/matcha/fonts/ShipporiMincho-700-latin.woff2 +0 -0
  275. package/dist/theme-packs/matcha/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  276. package/dist/theme-packs/matcha/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  277. package/dist/theme-packs/matcha/meta.json +38 -0
  278. package/dist/theme-packs/matcha/pack.css +409 -0
  279. package/dist/theme-packs/nocturne/fonts/CormorantGaramond-italic-latin.woff2 +0 -0
  280. package/dist/theme-packs/nocturne/fonts/CormorantGaramond-latin.woff2 +0 -0
  281. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  282. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  283. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-italic-latin.woff2 +0 -0
  284. package/dist/theme-packs/nocturne/fonts/Manrope-latin.woff2 +0 -0
  285. package/dist/theme-packs/nocturne/fonts/OFL.txt +95 -0
  286. package/dist/theme-packs/nocturne/meta.json +38 -0
  287. package/dist/theme-packs/nocturne/pack.css +502 -0
  288. package/dist/theme-packs/observatory/fonts/JosefinSans-latin.woff2 +0 -0
  289. package/dist/theme-packs/observatory/fonts/Jost-italic-latin.woff2 +0 -0
  290. package/dist/theme-packs/observatory/fonts/Jost-latin.woff2 +0 -0
  291. package/dist/theme-packs/observatory/fonts/OFL.txt +95 -0
  292. package/dist/theme-packs/observatory/fonts/SpaceMono-400-latin.woff2 +0 -0
  293. package/dist/theme-packs/observatory/fonts/SpaceMono-700-latin.woff2 +0 -0
  294. package/dist/theme-packs/observatory/fonts/SpaceMono-italic-latin.woff2 +0 -0
  295. package/dist/theme-packs/observatory/meta.json +38 -0
  296. package/dist/theme-packs/observatory/pack.css +728 -0
  297. package/dist/theme-packs/onyx/fonts/CormorantGaramond-italic-latin.woff2 +0 -0
  298. package/dist/theme-packs/onyx/fonts/CormorantGaramond-latin.woff2 +0 -0
  299. package/dist/theme-packs/onyx/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  300. package/dist/theme-packs/onyx/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  301. package/dist/theme-packs/onyx/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  302. package/dist/theme-packs/onyx/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  303. package/dist/theme-packs/onyx/fonts/Jost-latin.woff2 +0 -0
  304. package/dist/theme-packs/onyx/fonts/OFL.txt +95 -0
  305. package/dist/theme-packs/onyx/meta.json +38 -0
  306. package/dist/theme-packs/onyx/pack.css +497 -0
  307. package/dist/theme-packs/phosphor/fonts/JetBrainsMono-latin-ext.woff2 +0 -0
  308. package/dist/theme-packs/phosphor/fonts/JetBrainsMono-latin.woff2 +0 -0
  309. package/dist/theme-packs/phosphor/fonts/OFL.txt +94 -0
  310. package/dist/theme-packs/phosphor/fonts/VT323-latin-ext.woff2 +0 -0
  311. package/dist/theme-packs/phosphor/fonts/VT323-latin.woff2 +0 -0
  312. package/dist/theme-packs/phosphor/meta.json +38 -0
  313. package/dist/theme-packs/phosphor/pack.css +493 -0
  314. package/dist/theme-packs/solar/fonts/OFL.txt +94 -0
  315. package/dist/theme-packs/solar/fonts/SourceCodePro-italic-latin.woff2 +0 -0
  316. package/dist/theme-packs/solar/fonts/SourceCodePro-latin.woff2 +0 -0
  317. package/dist/theme-packs/solar/fonts/SourceSans3-italic-latin.woff2 +0 -0
  318. package/dist/theme-packs/solar/fonts/SourceSans3-latin.woff2 +0 -0
  319. package/dist/theme-packs/solar/meta.json +37 -0
  320. package/dist/theme-packs/solar/pack.css +380 -0
  321. package/dist/theme-packs/sumi/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  322. package/dist/theme-packs/sumi/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  323. package/dist/theme-packs/sumi/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  324. package/dist/theme-packs/sumi/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  325. package/dist/theme-packs/sumi/fonts/OFL.txt +95 -0
  326. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-600-latin.woff2 +0 -0
  327. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-700-latin.woff2 +0 -0
  328. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-800-latin.woff2 +0 -0
  329. package/dist/theme-packs/sumi/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  330. package/dist/theme-packs/sumi/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  331. package/dist/theme-packs/sumi/meta.json +38 -0
  332. package/dist/theme-packs/sumi/pack.css +502 -0
  333. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  334. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  335. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-600-latin.woff2 +0 -0
  336. package/dist/theme-packs/swissgrid/fonts/Inter-latin-ext.woff2 +0 -0
  337. package/dist/theme-packs/swissgrid/fonts/Inter-latin.woff2 +0 -0
  338. package/dist/theme-packs/swissgrid/fonts/InterTight-latin.woff2 +0 -0
  339. package/dist/theme-packs/swissgrid/fonts/OFL.txt +95 -0
  340. package/dist/theme-packs/swissgrid/meta.json +38 -0
  341. package/dist/theme-packs/swissgrid/pack.css +518 -0
  342. package/dist/theme-packs/washi/fonts/MPlus1Code-400-latin.woff2 +0 -0
  343. package/dist/theme-packs/washi/fonts/MPlus1Code-500-latin.woff2 +0 -0
  344. package/dist/theme-packs/washi/fonts/OFL.txt +95 -0
  345. package/dist/theme-packs/washi/fonts/ShipporiMincho-500-latin.woff2 +0 -0
  346. package/dist/theme-packs/washi/fonts/ShipporiMincho-600-latin.woff2 +0 -0
  347. package/dist/theme-packs/washi/fonts/ShipporiMincho-700-latin.woff2 +0 -0
  348. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  349. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  350. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-700-latin.woff2 +0 -0
  351. package/dist/theme-packs/washi/meta.json +38 -0
  352. package/dist/theme-packs/washi/pack.css +479 -0
  353. package/dist/theme-packs-registry/index.d.ts +5 -0
  354. package/dist/theme-packs-registry/index.js +30 -0
  355. package/dist/theme-packs-registry/load-registry.d.ts +23 -0
  356. package/dist/theme-packs-registry/load-registry.js +64 -0
  357. package/dist/theme-packs-registry/meta-schema.d.ts +70 -0
  358. package/dist/theme-packs-registry/meta-schema.js +38 -0
  359. package/dist/theme-packs-registry/resolve-enabled-packs.d.ts +25 -0
  360. package/dist/theme-packs-registry/resolve-enabled-packs.js +43 -0
  361. package/dist/theme-packs-registry/token-manifest.d.ts +19 -0
  362. package/dist/theme-packs-registry/token-manifest.js +57 -0
  363. package/dist/theme-packs-registry/validator.d.ts +35 -0
  364. package/dist/theme-packs-registry/validator.js +284 -0
  365. package/dist/theme-toggle/color-scheme-sync.d.ts +2 -4
  366. package/dist/toc/mobile-toc.js +1 -1
  367. package/dist/versions-page/index.d.ts +2 -2
  368. package/dist/versions-page/index.js +8 -8
  369. package/eject/breadcrumb/breadcrumb.tsx +4 -4
  370. package/eject/breadcrumb/find-path.ts +2 -2
  371. package/eject/breadcrumb/index.ts +1 -1
  372. package/eject/breadcrumb/types.ts +0 -6
  373. package/eject/code-group/index.tsx +2 -2
  374. package/eject/doc-history/index.tsx +1 -1
  375. package/eject/doc-pager/index.tsx +1 -1
  376. package/eject/footer/footer.tsx +1 -0
  377. package/eject/header/header.tsx +86 -21
  378. package/eject/header/index.ts +3 -0
  379. package/eject/header/types.ts +39 -1
  380. package/eject/sidebar-toggle-island/index.tsx +7 -1
  381. package/eject/site-tree-nav-island/index.tsx +15 -3
  382. package/eject/site-tree-nav-island/state.ts +9 -0
  383. package/eject/theme-toggle/color-scheme-sync.ts +2 -4
  384. package/eject/toc/mobile-toc.tsx +9 -1
  385. package/package.json +35 -29
  386. package/routes-src/404.tsx +4 -1
  387. package/routes-src/_chrome.tsx +6 -5
  388. package/routes-src/_context.ts +4 -0
  389. package/routes-src/_docs-helpers.ts +9 -29
  390. package/routes-src/_virtual.d.ts +4 -0
  391. package/virtual-modules.d.ts +4 -0
  392. package/zfb-config-shim.d.ts +40 -18
  393. package/dist/integrations/llms-txt/index.d.ts +0 -33
  394. package/dist/theme/color-tweak-export-modal.d.ts +0 -16
  395. package/dist/theme/color-tweak-export-modal.js +0 -138
  396. package/dist/theme/design-token-serde.d.ts +0 -183
  397. package/dist/theme/design-token-serde.js +0 -346
  398. package/dist/theme/design-token-types.d.ts +0 -13
  399. package/dist/theme/design-token-types.js +0 -6
  400. package/dist/theme/iframe-bridge.d.ts +0 -42
  401. package/dist/theme/iframe-bridge.js +0 -72
  402. /package/dist/{integrations → plugins/internal}/claude-resources/escape-for-mdx.d.ts +0 -0
  403. /package/dist/{integrations → plugins/internal}/claude-resources/escape-for-mdx.js +0 -0
  404. /package/dist/{integrations → plugins/internal}/claude-resources/generate.d.ts +0 -0
  405. /package/dist/{integrations → plugins/internal}/claude-resources/generate.js +0 -0
  406. /package/dist/{integrations → plugins/internal}/doc-history/pre-build.js +0 -0
  407. /package/dist/{integrations → plugins/internal}/llms-txt/dev-middleware.d.ts +0 -0
  408. /package/dist/{integrations → plugins/internal}/llms-txt/dev-middleware.js +0 -0
  409. /package/dist/{integrations → plugins/internal}/llms-txt/emit.d.ts +0 -0
  410. /package/dist/{integrations → plugins/internal}/llms-txt/emit.js +0 -0
  411. /package/dist/{integrations → plugins/internal}/llms-txt/generate.d.ts +0 -0
  412. /package/dist/{integrations → plugins/internal}/llms-txt/generate.js +0 -0
  413. /package/dist/{integrations → plugins/internal}/llms-txt/index.js +0 -0
  414. /package/dist/{integrations → plugins/internal}/llms-txt/types.js +0 -0
  415. /package/dist/{integrations → plugins/internal}/search-index/build-emitter.d.ts +0 -0
  416. /package/dist/{integrations → plugins/internal}/search-index/build-emitter.js +0 -0
  417. /package/dist/{integrations → plugins/internal}/search-index/collect.d.ts +0 -0
  418. /package/dist/{integrations → plugins/internal}/search-index/dev-middleware.d.ts +0 -0
  419. /package/dist/{integrations → plugins/internal}/search-index/dev-middleware.js +0 -0
  420. /package/dist/{integrations → plugins/internal}/search-index/index.d.ts +0 -0
  421. /package/dist/{integrations → plugins/internal}/search-index/index.js +0 -0
  422. /package/dist/{integrations → plugins/internal}/search-index/types.d.ts +0 -0
  423. /package/dist/{integrations → plugins/internal}/search-index/types.js +0 -0
@@ -6,25 +6,17 @@
6
6
  *
7
7
  * `bootstrapDesignTokenPanel` is a callable that configures zdtp's panel and
8
8
  * wires its lifecycle hooks to zfb's navigation events via
9
- * `setLifecycleAdapter()`. Projects import it with their own PanelConfig
10
- * DATA — which stays project-side (or, since #2658, the PACKAGE-DEFAULT data
11
- * from `@takazudo/zudo-doc/design-token-panel-config`).
9
+ * `setLifecycleAdapter()`. It receives a mode-scoped PanelConfig builder —
10
+ * either a project override or the package default from
11
+ * `@takazudo/zudo-doc/design-token-panel-config`.
12
12
  *
13
- * Two calling shapes (both supported):
13
+ * The current call shape is a mode-scoped builder. It rebuilds the panel per
14
+ * light/dark mode on every `color-scheme-changed` toggle:
14
15
  *
15
- * // Mode-scoped builder — rebuilds the panel per light/dark mode on every
16
- * // `color-scheme-changed` toggle:
17
16
  * import { bootstrapDesignTokenPanel } from "@takazudo/zudo-doc/design-token-panel-bootstrap";
18
17
  * import { buildDesignTokenPanelConfig } from "@/config/design-token-panel-config";
19
18
  * bootstrapDesignTokenPanel(buildDesignTokenPanelConfig);
20
19
  *
21
- * // Plain config (back-compat — generated projects on the old shape):
22
- * import { designTokenPanelConfig } from "@/config/design-token-panel-config";
23
- * bootstrapDesignTokenPanel(designTokenPanelConfig);
24
- *
25
- * A plain-config caller gets NO toggle listener (a static config has nothing to
26
- * rebuild), so existing generated projects keep working with zero changes.
27
- *
28
20
  * `DesignTokenPanelBootstrap` (below) is the PACKAGE-OWNED island component
29
21
  * that wires the mode-scoped builder for package-owned routes with no host
30
22
  * config file — the #2658 "Approach (a)" package default. It resolves its
@@ -32,27 +24,25 @@
32
24
  * module the routes plugin registers (`../plugins/routes.ts`): absent a host
33
25
  * `designTokenPanelConfigModule` override, that resolves to
34
26
  * `@takazudo/zudo-doc/design-token-panel-config`'s `buildDesignTokenPanelConfig`.
35
- * `packages/zudo-doc/src/routes/_chrome.tsx` statically imports it so zfb's
36
- * island scanner walks route → `_chrome` → here (mirrors the DocHistory
37
- * #2480 static-import chain). A host that ejects entirely (its own
38
- * `src/lib/*` + `src/components/*`, like the pre-#2658 showcase) never
39
- * reaches this component — it only calls `bootstrapDesignTokenPanel` itself,
40
- * same as always.
27
+ * `packages/zudo-doc/src/chrome/derive.tsx` statically imports it so zfb's
28
+ * island scanner walks route → chrome → derive → here (mirrors the DocHistory
29
+ * #2480 static-import contract). A host that ejects entirely can call
30
+ * `bootstrapDesignTokenPanel` with its own builder, but current package-owned
31
+ * routes use this component directly.
41
32
  *
42
33
  * KNOWN COUPLING: `DesignTokenPanelBootstrap`'s top-level import of
43
34
  * `virtual:zudo-doc-design-token-panel-config` requires the routes plugin
44
35
  * (`settings.packageOwnedRoutes`, default `true`) to be active in the
45
36
  * consuming project, since that plugin is what registers the virtual module.
46
37
  * A project that explicitly sets `packageOwnedRoutes: false` AND wants to
47
- * reuse the bare `bootstrapDesignTokenPanel` export for its own hand-wired
48
- * component (as every current consumer's `src/lib/design-token-panel-bootstrap.ts`
49
- * does) is unaffected — that import graph never reaches `DesignTokenPanelBootstrap`
50
- * — but a `packageOwnedRoutes: false` project must not import
51
- * `DesignTokenPanelBootstrap` itself.
38
+ * reuse the bare `bootstrapDesignTokenPanel` export for its own component is
39
+ * unaffected — that import graph never reaches `DesignTokenPanelBootstrap` —
40
+ * but a `packageOwnedRoutes: false` project must not import the package island
41
+ * component itself.
52
42
  *
53
- * Moved from the host's `src/lib/design-token-panel-bootstrap.ts` as part of
54
- * the package-first migration (S9a zudolab/zudo-doc#2333); mode-scoped rebuild
55
- * wiring added in zudolab/zudo-doc#2610; package-default island added in #2658.
43
+ * Package-first wiring landed in S9a zudolab/zudo-doc#2333; mode-scoped rebuild
44
+ * wiring was added in zudolab/zudo-doc#2610 and the package-default island in
45
+ * #2658.
56
46
  *
57
47
  * CSS is pulled via `@import "@takazudo/zdtp/styles.css"` in the project's
58
48
  * `src/styles/global.css` so the panel chrome lands in the main page CSS
@@ -65,28 +55,43 @@ import { type PanelConfig } from "@takazudo/zdtp";
65
55
  /** Active color-scheme mode, read from `<html data-theme>`. */
66
56
  type ColorSchemeMode = "light" | "dark";
67
57
  /**
68
- * A per-mode PanelConfig factory. Supplied by hosts that want the panel's
69
- * defaults to follow the live light/dark mode (see `buildDesignTokenPanelConfig`
70
- * in the host's `design-token-panel-config.ts`).
58
+ * A per-mode PanelConfig factory. The package default and host overrides use
59
+ * this same shape so panel defaults follow the live light/dark mode.
71
60
  */
72
61
  export type PanelConfigBuilder = (mode: ColorSchemeMode) => PanelConfig;
62
+ /**
63
+ * Theme-pack storage-prefix rule (ADR theme-packs.md Decision 4), enforced
64
+ * CENTRALLY here — never per-builder, so host builders supplied via
65
+ * `designTokenPanelConfigModule` cannot cross-contaminate namespaces even if
66
+ * unaware of packs:
67
+ *
68
+ * - active pack `default` → the builder's `storagePrefix` stays BYTE-UNCHANGED
69
+ * (the existing-user carry-over guarantee: `zudo-doc-tweak` keys keep
70
+ * working on the stock look).
71
+ * - any other pack → `${storagePrefix}--<slug>` (double hyphen avoids
72
+ * colliding with zdtp's own `-open`/version suffixes). zdtp derives every
73
+ * key — including the `${prefix}-open` open-state mirror — from the prefix,
74
+ * so tweaks saved under pack A are invisible under pack B and restored
75
+ * verbatim on switch-back.
76
+ *
77
+ * The `PanelConfigBuilder` signature stays `(mode) => PanelConfig` — this is a
78
+ * post-process of the RETURNED config, not a builder-contract change.
79
+ */
80
+ export declare function withPackScopedStoragePrefix(config: PanelConfig, activePack: string): PanelConfig;
73
81
  /**
74
82
  * Bootstrap zdtp for a project. Configures the panel, drains any pre-hydration
75
83
  * click queue, and wires the zdtp lifecycle adapter to zfb's navigation events
76
84
  * so persisted token overrides re-apply on every soft navigation.
77
85
  *
78
- * When passed a `PanelConfigBuilder`, also wires a `color-scheme-changed`
79
- * listener that rebuilds the panel per light/dark mode (see the toggle sequence
80
- * below). When passed a plain `PanelConfig`, no toggle listener is registered.
81
- *
82
- * Call this once, as a side-effect import from the project's island wrapper
83
- * (`src/components/design-token-panel-bootstrap.tsx`).
86
+ * Wires a `color-scheme-changed` listener that rebuilds the panel per
87
+ * light/dark mode (see the toggle sequence below), and a parallel
88
+ * `theme-pack-changed` listener that rebuilds it per theme pack with a
89
+ * pack-scoped storage prefix (ADR theme-packs.md Decision 4, #2822).
84
90
  *
85
- * @param configOrBuilder - The project's `PanelConfig`, or a `(mode) =>
86
- * PanelConfig` builder for mode-scoped rebuilds. DATA stays project-side in
87
- * `src/config/design-token-panel-config.ts`.
91
+ * @param buildConfig - The project's `(mode) => PanelConfig` builder for
92
+ * mode-scoped rebuilds.
88
93
  */
89
- export declare function bootstrapDesignTokenPanel(configOrBuilder: PanelConfig | PanelConfigBuilder): void;
94
+ export declare function bootstrapDesignTokenPanel(buildConfig: PanelConfigBuilder): void;
90
95
  /**
91
96
  * The package-default `<DesignTokenPanelBootstrap/>` island: mounted (via
92
97
  * `Island({ when: "load" })`, no `ssrFallback` — it renders nothing on either
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  configurePanel,
4
+ reapplyPersistedOverrides,
4
5
  setLifecycleAdapter,
5
6
  showDesignTokenPanel
6
7
  } from "@takazudo/zdtp";
@@ -8,37 +9,112 @@ import {
8
9
  BEFORE_NAVIGATE_EVENT,
9
10
  AFTER_NAVIGATE_EVENT
10
11
  } from "./transitions/page-events.js";
12
+ import {
13
+ DEFAULT_THEME_PACK_SLUG,
14
+ THEME_PACK_CHANGED_EVENT,
15
+ readThemePackFromDom
16
+ } from "./theme-pack-switcher/theme-pack-sync.js";
11
17
  import { buildDesignTokenPanelConfig } from "virtual:zudo-doc-design-token-panel-config";
12
18
  const COLOR_SCHEME_CHANGED_EVENT = "color-scheme-changed";
13
19
  function openStateKey(instancePrefix) {
14
20
  return `${instancePrefix}-open`;
15
21
  }
22
+ function readOpenState(instancePrefix) {
23
+ try {
24
+ return localStorage.getItem(openStateKey(instancePrefix)) === "1";
25
+ } catch {
26
+ return false;
27
+ }
28
+ }
16
29
  function readMode() {
17
30
  return document.documentElement.getAttribute("data-theme") === "dark" ? "dark" : "light";
18
31
  }
19
- function bootstrapDesignTokenPanel(configOrBuilder) {
20
- if (typeof window === "undefined" || typeof document === "undefined") {
32
+ function withPackScopedStoragePrefix(config, activePack) {
33
+ if (activePack === DEFAULT_THEME_PACK_SLUG) return config;
34
+ return { ...config, storagePrefix: `${config.storagePrefix}--${activePack}` };
35
+ }
36
+ function collectDeclaredTokenNames(config) {
37
+ const names = [];
38
+ for (const tab of config.tabs ?? []) {
39
+ for (const tier of tab.tiers ?? []) {
40
+ for (const item of tier.items ?? []) {
41
+ names.push(item.cssVar);
42
+ }
43
+ }
44
+ const baseRoles = tab.colorExtras?.baseRoles;
45
+ if (baseRoles) {
46
+ for (const cssVar of Object.values(baseRoles)) {
47
+ if (typeof cssVar === "string" && cssVar.length > 0) {
48
+ names.push(cssVar);
49
+ }
50
+ }
51
+ }
52
+ }
53
+ return names;
54
+ }
55
+ function clearAppliedTokenOverrides(config) {
56
+ const names = collectDeclaredTokenNames(config);
57
+ if (config.applySink) {
58
+ try {
59
+ config.applySink.clear(names);
60
+ } catch (err) {
61
+ console.warn(
62
+ "[zudo-doc] applySink.clear threw during theme-pack switch; outgoing overrides may linger.",
63
+ err
64
+ );
65
+ }
21
66
  return;
22
67
  }
23
- const isBuilder = typeof configOrBuilder === "function";
24
- const builder = isBuilder ? configOrBuilder : () => configOrBuilder;
25
- let handle = configurePanel(builder(readMode()));
26
- if (isBuilder) {
27
- let pendingMode = readMode();
28
- let timer = null;
29
- window.addEventListener(COLOR_SCHEME_CHANGED_EVENT, () => {
30
- pendingMode = readMode();
31
- if (timer !== null) return;
32
- timer = setTimeout(() => {
33
- timer = null;
34
- const mode = pendingMode;
35
- const wasOpen = localStorage.getItem(openStateKey(handle.instanceId)) === "1";
36
- handle.destroy();
37
- handle = configurePanel(builder(mode));
38
- if (wasOpen) showDesignTokenPanel();
39
- }, 0);
40
- });
68
+ const style = document.documentElement.style;
69
+ for (const name of names) {
70
+ style.removeProperty(name);
71
+ }
72
+ }
73
+ function bootstrapDesignTokenPanel(buildConfig) {
74
+ if (typeof window === "undefined" || typeof document === "undefined") {
75
+ return;
41
76
  }
77
+ let currentConfig = withPackScopedStoragePrefix(
78
+ buildConfig(readMode()),
79
+ readThemePackFromDom()
80
+ );
81
+ let handle = configurePanel(currentConfig);
82
+ let pendingMode = readMode();
83
+ let timer = null;
84
+ window.addEventListener(COLOR_SCHEME_CHANGED_EVENT, () => {
85
+ pendingMode = readMode();
86
+ if (timer !== null) return;
87
+ timer = setTimeout(() => {
88
+ timer = null;
89
+ const mode = pendingMode;
90
+ const wasOpen = readOpenState(handle.instanceId);
91
+ handle.destroy();
92
+ currentConfig = withPackScopedStoragePrefix(
93
+ buildConfig(mode),
94
+ readThemePackFromDom()
95
+ );
96
+ handle = configurePanel(currentConfig);
97
+ if (wasOpen) showDesignTokenPanel();
98
+ }, 0);
99
+ });
100
+ let pendingPack = readThemePackFromDom();
101
+ let packTimer = null;
102
+ window.addEventListener(THEME_PACK_CHANGED_EVENT, () => {
103
+ pendingPack = readThemePackFromDom();
104
+ if (packTimer !== null) return;
105
+ packTimer = setTimeout(() => {
106
+ packTimer = null;
107
+ const pack = pendingPack;
108
+ const wasOpen = readOpenState(handle.instanceId);
109
+ const outgoingConfig = currentConfig;
110
+ handle.destroy();
111
+ clearAppliedTokenOverrides(outgoingConfig);
112
+ currentConfig = withPackScopedStoragePrefix(buildConfig(readMode()), pack);
113
+ handle = configurePanel(currentConfig);
114
+ reapplyPersistedOverrides();
115
+ if (wasOpen) showDesignTokenPanel();
116
+ }, 0);
117
+ });
42
118
  window.__zdtpReadyClicks?.();
43
119
  const adapter = {
44
120
  onBeforeSwap(cb) {
@@ -65,5 +141,6 @@ function DesignTokenPanelBootstrap() {
65
141
  DesignTokenPanelBootstrap.displayName = "DesignTokenPanelBootstrap";
66
142
  export {
67
143
  DesignTokenPanelBootstrap,
68
- bootstrapDesignTokenPanel
144
+ bootstrapDesignTokenPanel,
145
+ withPackScopedStoragePrefix
69
146
  };
@@ -200,10 +200,7 @@ function buildDesignTokenPanelConfig(mode) {
200
200
  // `SCHEMA_V3` constants (#498/#505), which are unrelated to this field.
201
201
  // It is thus a purely descriptive config value with no runtime effect;
202
202
  // set to v3 (a literal, not one of those constants) to match what real
203
- // exports carry. Distinct from the host serde's `DESIGN_TOKEN_SCHEMA`
204
- // (`zudo-doc-design-tokens/v3` — bumped from v2 in #2599 so a stale
205
- // pre-5/3-minimize export resets instead of crashing on import), which
206
- // governs a separate round-trip.
203
+ // exports carry.
207
204
  schemaId: "zudo-design-tokens/v3",
208
205
  exportFilenameBase: "zudo-doc-design-tokens",
209
206
  tabs: [buildPaletteTab(mode), buildColorTab(mode), buildFontTab(), buildSpacingTab(), buildSizeTab()]
@@ -0,0 +1,15 @@
1
+ /** @jsxRuntime automatic */
2
+ /** @jsxImportSource preact */
3
+ import type { JSX } from "preact";
4
+ import type { FactoryComponent } from "../factory-context/index.js";
5
+ export interface DesignTokenPanelIslandDeps {
6
+ designTokenPanel: boolean;
7
+ DesignTokenPanelBootstrap?: FactoryComponent;
8
+ }
9
+ /**
10
+ * Bind the current settings gate to the package-owned bootstrap island.
11
+ * Kept separate from the rest of the package body-end islands so a host
12
+ * BodyEndIslands override can be composed with this package-owned marker
13
+ * without duplicating the other package defaults.
14
+ */
15
+ export declare function createDesignTokenPanelIsland(deps: DesignTokenPanelIslandDeps): () => JSX.Element | null;
@@ -0,0 +1,31 @@
1
+ import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
2
+ import { Island } from "@takazudo/zfb";
3
+ const ZDTP_TOGGLE_SHIM_SRC = `(function(){
4
+ if(window.__zdtpToggleShimInstalled)return;
5
+ window.__zdtpToggleShimInstalled=true;
6
+ var pending=false;
7
+ function shim(){pending=true;}
8
+ window.addEventListener('toggle-design-token-panel',shim);
9
+ window.__zdtpReadyClicks=function(){
10
+ window.removeEventListener('toggle-design-token-panel',shim);
11
+ delete window.__zdtpReadyClicks;
12
+ if(pending){pending=false;window.dispatchEvent(new CustomEvent('toggle-design-token-panel'));}
13
+ };
14
+ })();`;
15
+ function createDesignTokenPanelIsland(deps) {
16
+ const DesignTokenPanelBootstrap = deps.DesignTokenPanelBootstrap;
17
+ function DesignTokenPanelIsland() {
18
+ if (!deps.designTokenPanel || !DesignTokenPanelBootstrap) return null;
19
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
20
+ /* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: ZDTP_TOGGLE_SHIM_SRC } }),
21
+ Island({
22
+ when: "load",
23
+ children: /* @__PURE__ */ jsx(DesignTokenPanelBootstrap, {})
24
+ })
25
+ ] });
26
+ }
27
+ return DesignTokenPanelIsland;
28
+ }
29
+ export {
30
+ createDesignTokenPanelIsland
31
+ };
@@ -2,34 +2,36 @@
2
2
  /** @jsxImportSource preact */
3
3
  import type { JSX } from "preact";
4
4
  import type { FactoryComponent } from "../factory-context/index.js";
5
- /** The `settings` subset this factory reads — the four package-island flags.
5
+ import type { ThemePackSwitcherProps } from "../theme-pack-switcher/index.js";
6
+ /** The `settings` subset this factory reads — the package feature flags.
6
7
  * A structural subset so the host can pass its full `Settings` object. */
7
8
  export interface BodyEndIslandsSettings {
8
9
  aiAssistant: boolean;
9
10
  imageEnlarge: boolean;
10
11
  mermaid: boolean;
11
12
  /** Gates the pure-SSR `<PageLoadingOverlay/>` mount (zudolab/zudo-doc#2482),
12
- * mirroring the host gate and `enableClientRouter`'s on package-owned routes.
13
- * Optional so adding it is NOT a breaking change for external callers that
14
- * construct this documented subset — this is an exported package subpath API.
15
- * `undefined` is treated as `false` (no overlay) at the mount site, preserving
16
- * pre-#2482 behavior; internal callers always pass the full `Settings`. */
17
- dynamicPageTransition?: boolean;
18
- /** Gates the `DesignTokenPanelBootstrap` island mount (#2658). Optional for
19
- * the same external-caller-compat reason as `dynamicPageTransition` above.
20
- * `undefined` is treated as `false` (no panel island). Even when `true`,
21
- * nothing mounts unless `deps.DesignTokenPanelBootstrap` was also supplied
22
- * — see {@link BodyEndIslandsDeps}. */
23
- designTokenPanel?: boolean;
13
+ * mirroring the host gate and `enableClientRouter` on package-owned routes. */
14
+ dynamicPageTransition: boolean;
15
+ /** Gates the `DesignTokenPanelBootstrap` island mount (#2658). Even when
16
+ * `true`, nothing mounts unless `deps.DesignTokenPanelBootstrap` was also
17
+ * supplied — see {@link BodyEndIslandsDeps}. */
18
+ designTokenPanel: boolean;
24
19
  /**
25
- * Gates the `FindInPageInit` island mount (zudolab/zudo-doc#2689). Optional
26
- * for the same external-caller-compat reason as `dynamicPageTransition`/
27
- * `designTokenPanel` above. `undefined` is treated as `false` (no island).
20
+ * Gates the `FindInPageInit` island mount (zudolab/zudo-doc#2689).
28
21
  * Controls the PACKAGE-DEFAULT `BodyEndIslands` slot only — a host that
29
22
  * overrides the `BodyEndIslands` chrome binding must mount `FindInPageInit`
30
23
  * itself.
31
24
  */
32
- findInPage?: boolean;
25
+ findInPage: boolean;
26
+ /**
27
+ * Gates the `ThemePackSwitcher` flyout island mount (ADR
28
+ * `docs/adr/theme-packs.md` Decision 7; #2821). Optional — the field is
29
+ * optional on the host `Settings` census too (default `false`). Even when
30
+ * `true`, nothing mounts unless `deps.themePackSwitcherProps` AND
31
+ * `deps.ThemePackSwitcher` were also supplied — see
32
+ * {@link BodyEndIslandsDeps}.
33
+ */
34
+ themePackSwitcher?: boolean;
33
35
  }
34
36
  /** Dependencies injected by `_chrome.tsx` (carries the virtual-module settings). */
35
37
  export interface BodyEndIslandsDeps {
@@ -47,6 +49,20 @@ export interface BodyEndIslandsDeps {
47
49
  * not a crash.
48
50
  */
49
51
  DesignTokenPanelBootstrap?: FactoryComponent;
52
+ /**
53
+ * SSR props for the theme-pack switcher flyout (#2821) — derived from
54
+ * `ctx.themePackRegistry` by `chrome/derive.tsx` (only the chrome-derive
55
+ * path knows the registry). `null`/omitted renders the feature inert even
56
+ * when `settings.themePackSwitcher` is `true`.
57
+ */
58
+ themePackSwitcherProps?: ThemePackSwitcherProps | null;
59
+ /**
60
+ * The real `ThemePackSwitcher` island component (#2821), injected by
61
+ * `chrome/derive.tsx` (which statically imports it — the island-scanner
62
+ * reachability chain, mirroring `DesignTokenPanelBootstrap` above).
63
+ * Omitted means no switcher island mounts — a safe no-op, not a crash.
64
+ */
65
+ ThemePackSwitcher?: FactoryComponent;
50
66
  }
51
67
  /** Props for the produced `BodyEndIslands` component. */
52
68
  export interface BodyEndIslandsProps {
@@ -59,4 +75,10 @@ export interface BodyEndIslandsProps {
59
75
  */
60
76
  aiChatBodyLabel?: string;
61
77
  }
78
+ /**
79
+ * Build the package-default `BodyEndIslands` component bound to the host's
80
+ * serializable `settings` flags. The produced component matches the
81
+ * `createDocBodyEnd` `BodyEndIslands` slot contract
82
+ * (`(props: { basePath: string }) => JSX.Element`).
83
+ */
62
84
  export declare function createBodyEndIslands(deps: BodyEndIslandsDeps): (props: BodyEndIslandsProps) => JSX.Element;
@@ -5,22 +5,20 @@ import { ImageEnlarge, ImageEnlargeSsrFallback } from "../image-enlarge/index.js
5
5
  import { MermaidEnlarge, MermaidEnlargeSsrFallback } from "../mermaid-enlarge/index.js";
6
6
  import { FindInPageInit } from "../find-in-page/index.js";
7
7
  import { PageLoadingOverlay } from "../page-loading/index.js";
8
+ import { createDesignTokenPanelIsland } from "./design-token-panel-island.js";
9
+ import { createThemePackSwitcherIsland } from "./theme-pack-switcher-island.js";
8
10
  const DEFAULT_AI_CHAT_BODY_LABEL = "Ask a question about the documentation.";
9
- const ZDTP_TOGGLE_SHIM_SRC = `(function(){
10
- if(window.__zdtpToggleShimInstalled)return;
11
- window.__zdtpToggleShimInstalled=true;
12
- var pending=false;
13
- function shim(){pending=true;}
14
- window.addEventListener('toggle-design-token-panel',shim);
15
- window.__zdtpReadyClicks=function(){
16
- window.removeEventListener('toggle-design-token-panel',shim);
17
- delete window.__zdtpReadyClicks;
18
- if(pending){pending=false;window.dispatchEvent(new CustomEvent('toggle-design-token-panel'));}
19
- };
20
- })();`;
21
11
  function createBodyEndIslands(deps) {
22
12
  const { settings } = deps;
23
- const DesignTokenPanelBootstrap = deps.DesignTokenPanelBootstrap;
13
+ const DesignTokenPanelIsland = createDesignTokenPanelIsland({
14
+ designTokenPanel: settings.designTokenPanel,
15
+ DesignTokenPanelBootstrap: deps.DesignTokenPanelBootstrap
16
+ });
17
+ const ThemePackSwitcherIsland = createThemePackSwitcherIsland({
18
+ themePackSwitcher: settings.themePackSwitcher === true,
19
+ themePackSwitcherProps: deps.themePackSwitcherProps ?? null,
20
+ ThemePackSwitcher: deps.ThemePackSwitcher
21
+ });
24
22
  function BodyEndIslands({
25
23
  basePath,
26
24
  aiChatBodyLabel = DEFAULT_AI_CHAT_BODY_LABEL
@@ -42,20 +40,14 @@ function createBodyEndIslands(deps) {
42
40
  ssrFallback: /* @__PURE__ */ jsx(MermaidEnlargeSsrFallback, {}),
43
41
  children: /* @__PURE__ */ jsx(MermaidEnlarge, {})
44
42
  }) : null;
45
- const designTokenPanelBootstrap = settings.designTokenPanel && DesignTokenPanelBootstrap ? /* @__PURE__ */ jsxs(Fragment, { children: [
46
- /* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: ZDTP_TOGGLE_SHIM_SRC } }),
47
- Island({
48
- when: "load",
49
- children: /* @__PURE__ */ jsx(DesignTokenPanelBootstrap, {})
50
- })
51
- ] }) : null;
52
43
  const findInPageInit = settings.findInPage ? Island({
53
44
  when: "load",
54
45
  children: /* @__PURE__ */ jsx(FindInPageInit, {})
55
46
  }) : null;
56
47
  return /* @__PURE__ */ jsxs(Fragment, { children: [
57
48
  settings.dynamicPageTransition ? /* @__PURE__ */ jsx(PageLoadingOverlay, {}) : null,
58
- designTokenPanelBootstrap,
49
+ /* @__PURE__ */ jsx(DesignTokenPanelIsland, {}),
50
+ /* @__PURE__ */ jsx(ThemePackSwitcherIsland, {}),
59
51
  findInPageInit,
60
52
  aiAssistant,
61
53
  imageEnlarge,
@@ -0,0 +1,37 @@
1
+ /** @jsxRuntime automatic */
2
+ /** @jsxImportSource preact */
3
+ import type { JSX } from "preact";
4
+ import type { FactoryComponent } from "../factory-context/index.js";
5
+ import type { ThemePackSwitcherProps } from "../theme-pack-switcher/index.js";
6
+ export interface ThemePackSwitcherIslandDeps {
7
+ /** The `settings.themePackSwitcher` gate (default `false`). */
8
+ themePackSwitcher: boolean;
9
+ /**
10
+ * SSR props derived from `ctx.themePackRegistry` by
11
+ * `chrome/derive.tsx` (ADR theme-packs.md Decision 7 "Switcher data
12
+ * flow"). `null` means the registry was not threaded
13
+ * (`themePackRegistry: null`) — the whole feature renders inert even when
14
+ * the settings gate is on.
15
+ */
16
+ themePackSwitcherProps: ThemePackSwitcherProps | null;
17
+ /**
18
+ * The real `ThemePackSwitcher` island component. Injected (not imported
19
+ * here) mirroring `design-token-panel-island.tsx`'s shape: the props above
20
+ * only exist on the chrome-derive path, so `chrome/derive.tsx` supplies the
21
+ * statically imported package component as the default for every
22
+ * `createChrome` consumer (route → chrome → derive → component is the
23
+ * island-scanner reachability chain — the #2480 lesson). Omitted means no
24
+ * island mounts even when the gate is on — a safe no-op, not a crash.
25
+ */
26
+ ThemePackSwitcher?: FactoryComponent;
27
+ }
28
+ /**
29
+ * Bind the settings gate + the SSR-derived props to the theme-pack switcher
30
+ * flyout island mount (`Island({ when: "load" })` — the island SSRs its
31
+ * launcher markup and hydrates at load; its serializable props ride the
32
+ * marker's `data-props` JSON). Kept separate from the rest of the package
33
+ * body-end islands so a host BodyEndIslands override can be composed with
34
+ * this package-owned mount without duplicating the other package defaults
35
+ * (the `design-token-panel-island.tsx` pattern).
36
+ */
37
+ export declare function createThemePackSwitcherIsland(deps: ThemePackSwitcherIslandDeps): () => JSX.Element | null;
@@ -0,0 +1,18 @@
1
+ import { Fragment, jsx } from "preact/jsx-runtime";
2
+ import { Island } from "@takazudo/zfb";
3
+ function createThemePackSwitcherIsland(deps) {
4
+ const ThemePackSwitcher = deps.ThemePackSwitcher;
5
+ function ThemePackSwitcherIsland() {
6
+ if (!deps.themePackSwitcher || deps.themePackSwitcherProps === null || !ThemePackSwitcher) {
7
+ return null;
8
+ }
9
+ return /* @__PURE__ */ jsx(Fragment, { children: Island({
10
+ when: "load",
11
+ children: /* @__PURE__ */ jsx(ThemePackSwitcher, { ...deps.themePackSwitcherProps })
12
+ }) });
13
+ }
14
+ return ThemePackSwitcherIsland;
15
+ }
16
+ export {
17
+ createThemePackSwitcherIsland
18
+ };
@@ -37,7 +37,7 @@ function createDocContentHeader(ctx) {
37
37
  children: t("doc.fallbackNotice", locale)
38
38
  }
39
39
  ),
40
- entry.data.description && /* @__PURE__ */ jsx("p", { class: "mb-vsp-lg text-title text-muted", children: entry.data.description }),
40
+ entry.data.description && /* @__PURE__ */ jsx("p", { class: "mb-vsp-lg text-title text-muted", "data-doc-description": true, children: entry.data.description }),
41
41
  /* @__PURE__ */ jsx(
42
42
  FrontmatterPreview,
43
43
  {
@@ -8,8 +8,8 @@ export interface DocHistoryMetaEntry {
8
8
  author: string;
9
9
  createdDate: string;
10
10
  updatedDate: string;
11
- /** Source file extension (".mdx" | ".md") — optional in older manifests. */
12
- ext?: string;
11
+ /** Source file extension recorded by the current build-time manifest. */
12
+ ext: ".mdx" | ".md";
13
13
  }
14
14
  /** Settings subset read by the DocHistoryArea factory. */
15
15
  export interface DocHistoryAreaSettings {
@@ -36,12 +36,18 @@ export interface DocHistoryAreaProps {
36
36
  /**
37
37
  * Raw zfb entry slug (relative path without extension), e.g.
38
38
  * "getting-started/intro" or "getting-started/index". Appended with
39
- * the source extension from the build-time manifest (".mdx" fallback)
40
- * to form the file path passed to buildGitHubSourceUrl.
39
+ * the source extension from the build-time manifest to form the file path
40
+ * passed to buildGitHubSourceUrl.
41
41
  * Omit for auto-index pages (no underlying MDX file) — sourceUrl
42
42
  * will be suppressed automatically.
43
43
  */
44
44
  entrySlug?: string;
45
+ /**
46
+ * Source extension from the current content entry. Used only when the file
47
+ * has no manifest metadata yet (for example, an untracked file or a build
48
+ * with `SKIP_DOC_HISTORY=1`). A present manifest owns its required `ext`.
49
+ */
50
+ sourceFileExt?: ".mdx" | ".md";
45
51
  /**
46
52
  * Content directory for the active locale, e.g. "src/content/docs"
47
53
  * or "src/content/docs-ja". Combined with entrySlug to build the
@@ -22,6 +22,7 @@ function createDocHistoryArea(ctx) {
22
22
  slug,
23
23
  locale,
24
24
  entrySlug,
25
+ sourceFileExt,
25
26
  contentDir,
26
27
  isFallback
27
28
  }) {
@@ -62,8 +63,8 @@ function createDocHistoryArea(ctx) {
62
63
  )
63
64
  });
64
65
  const utilSettings = settings.bodyFootUtilArea;
65
- const sourceExt = meta?.ext ?? ".mdx";
66
- const sourceUrl = utilSettings && utilSettings.viewSourceLink && entrySlug && contentDir ? buildGitHubSourceUrl(contentDir, entrySlug + sourceExt) : null;
66
+ const sourceExt = meta ? meta.ext : sourceFileExt;
67
+ const sourceUrl = utilSettings && utilSettings.viewSourceLink && entrySlug && sourceExt && contentDir ? buildGitHubSourceUrl(contentDir, entrySlug + sourceExt) : null;
67
68
  const viewSourceLabel = t("doc.viewSource", locale);
68
69
  void historyLabel;
69
70
  return /* @__PURE__ */ jsx(
@@ -8,6 +8,7 @@ export interface DocHistoryMetaEntry {
8
8
  author: string;
9
9
  createdDate: string;
10
10
  updatedDate: string;
11
+ ext: ".mdx" | ".md";
11
12
  }
12
13
  /** Settings subset read by the DocMetainfoArea factory. */
13
14
  export interface DocMetainfoAreaSettings {