@takazudo/zudo-doc 3.3.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 (417) hide show
  1. package/CHANGELOG.md +32 -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.d.ts +28 -12
  38. package/dist/config.js +11 -2
  39. package/dist/content/component-map.d.ts +0 -16
  40. package/dist/content/component-map.js +2 -4
  41. package/dist/content/index.d.ts +1 -1
  42. package/dist/content/index.js +2 -3
  43. package/dist/content.css +1 -1
  44. package/dist/design-token-panel-bootstrap.d.ts +45 -40
  45. package/dist/design-token-panel-bootstrap.js +98 -21
  46. package/dist/design-token-panel-config/index.js +1 -4
  47. package/dist/doc-body-end-islands/design-token-panel-island.d.ts +15 -0
  48. package/dist/doc-body-end-islands/design-token-panel-island.js +31 -0
  49. package/dist/doc-body-end-islands/index.d.ts +39 -17
  50. package/dist/doc-body-end-islands/index.js +13 -21
  51. package/dist/doc-body-end-islands/theme-pack-switcher-island.d.ts +37 -0
  52. package/dist/doc-body-end-islands/theme-pack-switcher-island.js +18 -0
  53. package/dist/doc-content-header/index.js +1 -1
  54. package/dist/doc-history-area/index.d.ts +10 -4
  55. package/dist/doc-history-area/index.js +3 -2
  56. package/dist/doc-metainfo-area/index.d.ts +1 -0
  57. package/dist/doc-page-props/index.d.ts +7 -23
  58. package/dist/doc-page-renderer/index.d.ts +1 -0
  59. package/dist/doc-page-renderer/index.js +1 -0
  60. package/dist/doc-page-shell/index.js +19 -12
  61. package/dist/doc-pager/index.js +1 -1
  62. package/dist/doc-route-entries/index.d.ts +2 -2
  63. package/dist/doclayout/doc-layout-with-defaults.js +4 -4
  64. package/dist/doclayout/doc-layout.d.ts +8 -0
  65. package/dist/doclayout/doc-layout.js +10 -1
  66. package/dist/docs-schema/index.js +1 -5
  67. package/dist/eject/index.d.ts +16 -0
  68. package/dist/eject/index.js +122 -28
  69. package/dist/extract-headings/index.d.ts +5 -8
  70. package/dist/extract-headings/index.js +2 -9
  71. package/dist/factory-context/index.d.ts +42 -4
  72. package/dist/features.css +55 -43
  73. package/dist/footer/footer.js +1 -0
  74. package/dist/head-with-defaults/index.d.ts +2 -0
  75. package/dist/head-with-defaults/index.js +16 -0
  76. package/dist/header/header.d.ts +10 -5
  77. package/dist/header/header.js +45 -5
  78. package/dist/header/index.d.ts +1 -1
  79. package/dist/header/types.d.ts +30 -1
  80. package/dist/header-with-defaults/index.js +1 -0
  81. package/dist/home-page/index.d.ts +2 -0
  82. package/dist/home-page/index.js +11 -5
  83. package/dist/home-page/prepare-home-data.js +1 -1
  84. package/dist/locale-merge/index.d.ts +9 -14
  85. package/dist/locale-merge/index.js +6 -4
  86. package/dist/mdx-components/index.js +4 -4
  87. package/dist/plugins/claude-resources.d.ts +1 -0
  88. package/dist/plugins/claude-resources.js +4 -2
  89. package/dist/plugins/doc-history.js +1 -1
  90. package/dist/{integrations → plugins/internal}/claude-resources/index.d.ts +1 -16
  91. package/dist/{integrations → plugins/internal}/claude-resources/index.js +0 -9
  92. package/dist/{integrations → plugins/internal}/doc-history/index.d.ts +0 -17
  93. package/dist/{integrations → plugins/internal}/doc-history/index.js +0 -4
  94. package/dist/{integrations → plugins/internal}/doc-history/pre-build.d.ts +2 -4
  95. package/dist/plugins/internal/llms-txt/index.d.ts +7 -0
  96. package/dist/{integrations → plugins/internal}/llms-txt/load.d.ts +1 -1
  97. package/dist/{integrations → plugins/internal}/llms-txt/load.js +2 -2
  98. package/dist/{integrations → plugins/internal}/llms-txt/strip.d.ts +2 -3
  99. package/dist/{integrations → plugins/internal}/llms-txt/strip.js +1 -1
  100. package/dist/{integrations → plugins/internal}/llms-txt/types.d.ts +13 -22
  101. package/dist/{integrations → plugins/internal}/search-index/collect.js +1 -1
  102. package/dist/plugins/internal/theme-packs/copy.d.ts +32 -0
  103. package/dist/plugins/internal/theme-packs/copy.js +45 -0
  104. package/dist/plugins/internal/theme-packs/dev-middleware.d.ts +22 -0
  105. package/dist/plugins/internal/theme-packs/dev-middleware.js +80 -0
  106. package/dist/plugins/internal/theme-packs/index.d.ts +6 -0
  107. package/dist/plugins/internal/theme-packs/index.js +9 -0
  108. package/dist/plugins/internal/theme-packs/resolve.d.ts +17 -0
  109. package/dist/plugins/internal/theme-packs/resolve.js +17 -0
  110. package/dist/plugins/internal/theme-packs/types.d.ts +22 -0
  111. package/dist/plugins/internal/theme-packs/types.js +0 -0
  112. package/dist/plugins/llms-txt.js +1 -1
  113. package/dist/plugins/routes.js +11 -1
  114. package/dist/plugins/search-index.js +1 -1
  115. package/dist/plugins/theme-packs.d.ts +3 -0
  116. package/dist/plugins/theme-packs.js +40 -0
  117. package/dist/preset.d.ts +19 -14
  118. package/dist/preset.js +24 -9
  119. package/dist/route-context/index.js +4 -6
  120. package/dist/route-enumerators/index.d.ts +6 -18
  121. package/dist/route-enumerators/index.js +8 -6
  122. package/dist/routes/404.js +3 -1
  123. package/dist/routes/_chrome.js +2 -2
  124. package/dist/routes/_context.d.ts +7 -3
  125. package/dist/routes/_context.js +2 -0
  126. package/dist/routes/_docs-helpers.js +9 -21
  127. package/dist/safelist.css +1 -1
  128. package/dist/settings.d.ts +27 -12
  129. package/dist/sidebar-tree/build-tree.d.ts +3 -4
  130. package/dist/sidebar-tree/build-tree.js +4 -3
  131. package/dist/sidebar-tree/index.d.ts +2 -2
  132. package/dist/sidebar-tree/types.d.ts +6 -17
  133. package/dist/site-tree-nav-island/index.d.ts +3 -1
  134. package/dist/site-tree-nav-island/index.js +17 -5
  135. package/dist/site-tree-nav-island/state.d.ts +4 -0
  136. package/dist/site-tree-nav-island/state.js +10 -0
  137. package/dist/tag-helpers/index.d.ts +6 -13
  138. package/dist/tag-helpers/index.js +5 -23
  139. package/dist/tag-pages/index.d.ts +8 -21
  140. package/dist/tag-pages/index.js +14 -10
  141. package/dist/tags-audit.d.ts +16 -44
  142. package/dist/tags-audit.js +9 -172
  143. package/dist/theme/color-scheme-provider.d.ts +2 -3
  144. package/dist/theme/color-scheme-provider.js +2 -10
  145. package/dist/theme/index.d.ts +1 -4
  146. package/dist/theme/index.js +2 -30
  147. package/dist/theme/theme-pack-provider.d.ts +42 -0
  148. package/dist/theme/theme-pack-provider.js +75 -0
  149. package/dist/theme-cli/apply.d.ts +16 -0
  150. package/dist/theme-cli/apply.js +61 -0
  151. package/dist/theme-cli/config-io.d.ts +15 -0
  152. package/dist/theme-cli/config-io.js +51 -0
  153. package/dist/theme-cli/config-rewriter.d.ts +21 -0
  154. package/dist/theme-cli/config-rewriter.js +141 -0
  155. package/dist/theme-cli/config-scanner.d.ts +63 -0
  156. package/dist/theme-cli/config-scanner.js +288 -0
  157. package/dist/theme-cli/index.d.ts +7 -0
  158. package/dist/theme-cli/index.js +38 -0
  159. package/dist/theme-cli/list.d.ts +27 -0
  160. package/dist/theme-cli/list.js +64 -0
  161. package/dist/theme-cli/provenance.d.ts +17 -0
  162. package/dist/theme-cli/provenance.js +35 -0
  163. package/dist/theme-cli/registry.d.ts +14 -0
  164. package/dist/theme-cli/registry.js +13 -0
  165. package/dist/theme-pack-dialog/dialog-state.d.ts +25 -0
  166. package/dist/theme-pack-dialog/dialog-state.js +40 -0
  167. package/dist/theme-pack-dialog/index.d.ts +5 -0
  168. package/dist/theme-pack-dialog/index.js +152 -0
  169. package/dist/theme-pack-dialog/theme-pack-card.d.ts +25 -0
  170. package/dist/theme-pack-dialog/theme-pack-card.js +72 -0
  171. package/dist/theme-pack-switcher/index.d.ts +49 -0
  172. package/dist/theme-pack-switcher/index.js +205 -0
  173. package/dist/theme-pack-switcher/switcher-state.d.ts +56 -0
  174. package/dist/theme-pack-switcher/switcher-state.js +43 -0
  175. package/dist/theme-pack-switcher/theme-pack-sync.d.ts +85 -0
  176. package/dist/theme-pack-switcher/theme-pack-sync.js +121 -0
  177. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-400-latin.woff2 +0 -0
  178. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-700-latin.woff2 +0 -0
  179. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-italic-400-latin.woff2 +0 -0
  180. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-italic-700-latin.woff2 +0 -0
  181. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegibleMono-italic-latin.woff2 +0 -0
  182. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegibleMono-latin.woff2 +0 -0
  183. package/dist/theme-packs/beacon/fonts/OFL.txt +94 -0
  184. package/dist/theme-packs/beacon/meta.json +37 -0
  185. package/dist/theme-packs/beacon/pack.css +442 -0
  186. package/dist/theme-packs/broadsheet/fonts/CourierPrime-400-latin.woff2 +0 -0
  187. package/dist/theme-packs/broadsheet/fonts/CourierPrime-700-latin.woff2 +0 -0
  188. package/dist/theme-packs/broadsheet/fonts/OFL.txt +95 -0
  189. package/dist/theme-packs/broadsheet/fonts/PlayfairDisplay-italic-latin.woff2 +0 -0
  190. package/dist/theme-packs/broadsheet/fonts/PlayfairDisplay-latin.woff2 +0 -0
  191. package/dist/theme-packs/broadsheet/fonts/SourceSerif4-italic-latin.woff2 +0 -0
  192. package/dist/theme-packs/broadsheet/fonts/SourceSerif4-latin.woff2 +0 -0
  193. package/dist/theme-packs/broadsheet/meta.json +38 -0
  194. package/dist/theme-packs/broadsheet/pack.css +448 -0
  195. package/dist/theme-packs/brutalist/fonts/ArchivoBlack-latin.woff2 +0 -0
  196. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  197. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  198. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-700-latin.woff2 +0 -0
  199. package/dist/theme-packs/brutalist/fonts/OFL.txt +95 -0
  200. package/dist/theme-packs/brutalist/fonts/SpaceGrotesk-latin.woff2 +0 -0
  201. package/dist/theme-packs/brutalist/meta.json +38 -0
  202. package/dist/theme-packs/brutalist/pack.css +546 -0
  203. package/dist/theme-packs/default/meta.json +37 -0
  204. package/dist/theme-packs/drift/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  205. package/dist/theme-packs/drift/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  206. package/dist/theme-packs/drift/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  207. package/dist/theme-packs/drift/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  208. package/dist/theme-packs/drift/fonts/IBMPlexSans-italic-latin.woff2 +0 -0
  209. package/dist/theme-packs/drift/fonts/IBMPlexSans-latin-ext.woff2 +0 -0
  210. package/dist/theme-packs/drift/fonts/IBMPlexSans-latin.woff2 +0 -0
  211. package/dist/theme-packs/drift/fonts/OFL.txt +93 -0
  212. package/dist/theme-packs/drift/meta.json +37 -0
  213. package/dist/theme-packs/drift/pack.css +478 -0
  214. package/dist/theme-packs/fjord/fonts/Inter-latin-ext.woff2 +0 -0
  215. package/dist/theme-packs/fjord/fonts/Inter-latin.woff2 +0 -0
  216. package/dist/theme-packs/fjord/fonts/JetBrainsMono-latin-ext.woff2 +0 -0
  217. package/dist/theme-packs/fjord/fonts/JetBrainsMono-latin.woff2 +0 -0
  218. package/dist/theme-packs/fjord/fonts/OFL.txt +94 -0
  219. package/dist/theme-packs/fjord/meta.json +37 -0
  220. package/dist/theme-packs/fjord/pack.css +375 -0
  221. package/dist/theme-packs/foundry/fonts/Inter-latin-ext.woff2 +0 -0
  222. package/dist/theme-packs/foundry/fonts/Inter-latin.woff2 +0 -0
  223. package/dist/theme-packs/foundry/fonts/OFL.txt +93 -0
  224. package/dist/theme-packs/foundry/meta.json +37 -0
  225. package/dist/theme-packs/foundry/pack.css +202 -0
  226. package/dist/theme-packs/futura-editorial/fonts/Jost-latin.woff2 +0 -0
  227. package/dist/theme-packs/futura-editorial/fonts/NotoSans-italic-latin.woff2 +0 -0
  228. package/dist/theme-packs/futura-editorial/fonts/NotoSans-latin.woff2 +0 -0
  229. package/dist/theme-packs/futura-editorial/fonts/OFL.txt +95 -0
  230. package/dist/theme-packs/futura-editorial/fonts/SpaceMono-400-latin.woff2 +0 -0
  231. package/dist/theme-packs/futura-editorial/fonts/SpaceMono-700-latin.woff2 +0 -0
  232. package/dist/theme-packs/futura-editorial/meta.json +38 -0
  233. package/dist/theme-packs/futura-editorial/pack.css +313 -0
  234. package/dist/theme-packs/hearth/fonts/Fraunces-italic-latin.woff2 +0 -0
  235. package/dist/theme-packs/hearth/fonts/Fraunces-latin.woff2 +0 -0
  236. package/dist/theme-packs/hearth/fonts/Nunito-latin.woff2 +0 -0
  237. package/dist/theme-packs/hearth/fonts/OFL.txt +95 -0
  238. package/dist/theme-packs/hearth/fonts/SplineSansMono-latin.woff2 +0 -0
  239. package/dist/theme-packs/hearth/meta.json +38 -0
  240. package/dist/theme-packs/hearth/pack.css +385 -0
  241. package/dist/theme-packs/hollow/fonts/OFL.txt +94 -0
  242. package/dist/theme-packs/hollow/fonts/SpaceGrotesk-latin.woff2 +0 -0
  243. package/dist/theme-packs/hollow/fonts/SpaceMono-400-italic-latin.woff2 +0 -0
  244. package/dist/theme-packs/hollow/fonts/SpaceMono-400-latin.woff2 +0 -0
  245. package/dist/theme-packs/hollow/fonts/SpaceMono-700-latin.woff2 +0 -0
  246. package/dist/theme-packs/hollow/meta.json +37 -0
  247. package/dist/theme-packs/hollow/pack.css +428 -0
  248. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-ext-italic.woff2 +0 -0
  249. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-ext.woff2 +0 -0
  250. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-italic.woff2 +0 -0
  251. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin.woff2 +0 -0
  252. package/dist/theme-packs/ledger/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  253. package/dist/theme-packs/ledger/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  254. package/dist/theme-packs/ledger/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  255. package/dist/theme-packs/ledger/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  256. package/dist/theme-packs/ledger/fonts/OFL.txt +94 -0
  257. package/dist/theme-packs/ledger/meta.json +37 -0
  258. package/dist/theme-packs/ledger/pack.css +463 -0
  259. package/dist/theme-packs/manuscript/fonts/CourierPrime-400-latin-ext.woff2 +0 -0
  260. package/dist/theme-packs/manuscript/fonts/CourierPrime-400-latin.woff2 +0 -0
  261. package/dist/theme-packs/manuscript/fonts/CourierPrime-700-latin-ext.woff2 +0 -0
  262. package/dist/theme-packs/manuscript/fonts/CourierPrime-700-latin.woff2 +0 -0
  263. package/dist/theme-packs/manuscript/fonts/EBGaramond-latin-italic.woff2 +0 -0
  264. package/dist/theme-packs/manuscript/fonts/EBGaramond-latin.woff2 +0 -0
  265. package/dist/theme-packs/manuscript/fonts/OFL.txt +94 -0
  266. package/dist/theme-packs/manuscript/meta.json +37 -0
  267. package/dist/theme-packs/manuscript/pack.css +376 -0
  268. package/dist/theme-packs/matcha/fonts/MPLUS1Code-latin.woff2 +0 -0
  269. package/dist/theme-packs/matcha/fonts/OFL.txt +95 -0
  270. package/dist/theme-packs/matcha/fonts/ShipporiMincho-500-latin.woff2 +0 -0
  271. package/dist/theme-packs/matcha/fonts/ShipporiMincho-700-latin.woff2 +0 -0
  272. package/dist/theme-packs/matcha/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  273. package/dist/theme-packs/matcha/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  274. package/dist/theme-packs/matcha/meta.json +38 -0
  275. package/dist/theme-packs/matcha/pack.css +409 -0
  276. package/dist/theme-packs/nocturne/fonts/CormorantGaramond-italic-latin.woff2 +0 -0
  277. package/dist/theme-packs/nocturne/fonts/CormorantGaramond-latin.woff2 +0 -0
  278. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  279. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  280. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-italic-latin.woff2 +0 -0
  281. package/dist/theme-packs/nocturne/fonts/Manrope-latin.woff2 +0 -0
  282. package/dist/theme-packs/nocturne/fonts/OFL.txt +95 -0
  283. package/dist/theme-packs/nocturne/meta.json +38 -0
  284. package/dist/theme-packs/nocturne/pack.css +502 -0
  285. package/dist/theme-packs/observatory/fonts/JosefinSans-latin.woff2 +0 -0
  286. package/dist/theme-packs/observatory/fonts/Jost-italic-latin.woff2 +0 -0
  287. package/dist/theme-packs/observatory/fonts/Jost-latin.woff2 +0 -0
  288. package/dist/theme-packs/observatory/fonts/OFL.txt +95 -0
  289. package/dist/theme-packs/observatory/fonts/SpaceMono-400-latin.woff2 +0 -0
  290. package/dist/theme-packs/observatory/fonts/SpaceMono-700-latin.woff2 +0 -0
  291. package/dist/theme-packs/observatory/fonts/SpaceMono-italic-latin.woff2 +0 -0
  292. package/dist/theme-packs/observatory/meta.json +38 -0
  293. package/dist/theme-packs/observatory/pack.css +728 -0
  294. package/dist/theme-packs/onyx/fonts/CormorantGaramond-italic-latin.woff2 +0 -0
  295. package/dist/theme-packs/onyx/fonts/CormorantGaramond-latin.woff2 +0 -0
  296. package/dist/theme-packs/onyx/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  297. package/dist/theme-packs/onyx/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  298. package/dist/theme-packs/onyx/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  299. package/dist/theme-packs/onyx/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  300. package/dist/theme-packs/onyx/fonts/Jost-latin.woff2 +0 -0
  301. package/dist/theme-packs/onyx/fonts/OFL.txt +95 -0
  302. package/dist/theme-packs/onyx/meta.json +38 -0
  303. package/dist/theme-packs/onyx/pack.css +497 -0
  304. package/dist/theme-packs/phosphor/fonts/JetBrainsMono-latin-ext.woff2 +0 -0
  305. package/dist/theme-packs/phosphor/fonts/JetBrainsMono-latin.woff2 +0 -0
  306. package/dist/theme-packs/phosphor/fonts/OFL.txt +94 -0
  307. package/dist/theme-packs/phosphor/fonts/VT323-latin-ext.woff2 +0 -0
  308. package/dist/theme-packs/phosphor/fonts/VT323-latin.woff2 +0 -0
  309. package/dist/theme-packs/phosphor/meta.json +38 -0
  310. package/dist/theme-packs/phosphor/pack.css +493 -0
  311. package/dist/theme-packs/solar/fonts/OFL.txt +94 -0
  312. package/dist/theme-packs/solar/fonts/SourceCodePro-italic-latin.woff2 +0 -0
  313. package/dist/theme-packs/solar/fonts/SourceCodePro-latin.woff2 +0 -0
  314. package/dist/theme-packs/solar/fonts/SourceSans3-italic-latin.woff2 +0 -0
  315. package/dist/theme-packs/solar/fonts/SourceSans3-latin.woff2 +0 -0
  316. package/dist/theme-packs/solar/meta.json +37 -0
  317. package/dist/theme-packs/solar/pack.css +380 -0
  318. package/dist/theme-packs/sumi/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  319. package/dist/theme-packs/sumi/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  320. package/dist/theme-packs/sumi/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  321. package/dist/theme-packs/sumi/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  322. package/dist/theme-packs/sumi/fonts/OFL.txt +95 -0
  323. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-600-latin.woff2 +0 -0
  324. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-700-latin.woff2 +0 -0
  325. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-800-latin.woff2 +0 -0
  326. package/dist/theme-packs/sumi/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  327. package/dist/theme-packs/sumi/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  328. package/dist/theme-packs/sumi/meta.json +38 -0
  329. package/dist/theme-packs/sumi/pack.css +502 -0
  330. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  331. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  332. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-600-latin.woff2 +0 -0
  333. package/dist/theme-packs/swissgrid/fonts/Inter-latin-ext.woff2 +0 -0
  334. package/dist/theme-packs/swissgrid/fonts/Inter-latin.woff2 +0 -0
  335. package/dist/theme-packs/swissgrid/fonts/InterTight-latin.woff2 +0 -0
  336. package/dist/theme-packs/swissgrid/fonts/OFL.txt +95 -0
  337. package/dist/theme-packs/swissgrid/meta.json +38 -0
  338. package/dist/theme-packs/swissgrid/pack.css +518 -0
  339. package/dist/theme-packs/washi/fonts/MPlus1Code-400-latin.woff2 +0 -0
  340. package/dist/theme-packs/washi/fonts/MPlus1Code-500-latin.woff2 +0 -0
  341. package/dist/theme-packs/washi/fonts/OFL.txt +95 -0
  342. package/dist/theme-packs/washi/fonts/ShipporiMincho-500-latin.woff2 +0 -0
  343. package/dist/theme-packs/washi/fonts/ShipporiMincho-600-latin.woff2 +0 -0
  344. package/dist/theme-packs/washi/fonts/ShipporiMincho-700-latin.woff2 +0 -0
  345. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  346. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  347. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-700-latin.woff2 +0 -0
  348. package/dist/theme-packs/washi/meta.json +38 -0
  349. package/dist/theme-packs/washi/pack.css +479 -0
  350. package/dist/theme-packs-registry/index.d.ts +5 -0
  351. package/dist/theme-packs-registry/index.js +30 -0
  352. package/dist/theme-packs-registry/load-registry.d.ts +23 -0
  353. package/dist/theme-packs-registry/load-registry.js +64 -0
  354. package/dist/theme-packs-registry/meta-schema.d.ts +70 -0
  355. package/dist/theme-packs-registry/meta-schema.js +38 -0
  356. package/dist/theme-packs-registry/resolve-enabled-packs.d.ts +25 -0
  357. package/dist/theme-packs-registry/resolve-enabled-packs.js +43 -0
  358. package/dist/theme-packs-registry/token-manifest.d.ts +19 -0
  359. package/dist/theme-packs-registry/token-manifest.js +57 -0
  360. package/dist/theme-packs-registry/validator.d.ts +35 -0
  361. package/dist/theme-packs-registry/validator.js +284 -0
  362. package/dist/theme-toggle/color-scheme-sync.d.ts +2 -4
  363. package/dist/versions-page/index.d.ts +2 -2
  364. package/dist/versions-page/index.js +8 -8
  365. package/eject/breadcrumb/breadcrumb.tsx +4 -4
  366. package/eject/breadcrumb/find-path.ts +2 -2
  367. package/eject/breadcrumb/index.ts +1 -1
  368. package/eject/breadcrumb/types.ts +0 -6
  369. package/eject/code-group/index.tsx +2 -2
  370. package/eject/doc-history/index.tsx +1 -1
  371. package/eject/doc-pager/index.tsx +1 -1
  372. package/eject/footer/footer.tsx +1 -0
  373. package/eject/header/header.tsx +86 -21
  374. package/eject/header/index.ts +3 -0
  375. package/eject/header/types.ts +39 -1
  376. package/eject/site-tree-nav-island/index.tsx +15 -3
  377. package/eject/site-tree-nav-island/state.ts +9 -0
  378. package/eject/theme-toggle/color-scheme-sync.ts +2 -4
  379. package/package.json +35 -29
  380. package/routes-src/404.tsx +4 -1
  381. package/routes-src/_chrome.tsx +6 -5
  382. package/routes-src/_context.ts +4 -0
  383. package/routes-src/_docs-helpers.ts +9 -29
  384. package/routes-src/_virtual.d.ts +4 -0
  385. package/virtual-modules.d.ts +4 -0
  386. package/zfb-config-shim.d.ts +40 -18
  387. package/dist/integrations/llms-txt/index.d.ts +0 -33
  388. package/dist/theme/color-tweak-export-modal.d.ts +0 -16
  389. package/dist/theme/color-tweak-export-modal.js +0 -138
  390. package/dist/theme/design-token-serde.d.ts +0 -183
  391. package/dist/theme/design-token-serde.js +0 -346
  392. package/dist/theme/design-token-types.d.ts +0 -13
  393. package/dist/theme/design-token-types.js +0 -6
  394. package/dist/theme/iframe-bridge.d.ts +0 -42
  395. package/dist/theme/iframe-bridge.js +0 -72
  396. /package/dist/{integrations → plugins/internal}/claude-resources/escape-for-mdx.d.ts +0 -0
  397. /package/dist/{integrations → plugins/internal}/claude-resources/escape-for-mdx.js +0 -0
  398. /package/dist/{integrations → plugins/internal}/claude-resources/generate.d.ts +0 -0
  399. /package/dist/{integrations → plugins/internal}/claude-resources/generate.js +0 -0
  400. /package/dist/{integrations → plugins/internal}/doc-history/pre-build.js +0 -0
  401. /package/dist/{integrations → plugins/internal}/llms-txt/dev-middleware.d.ts +0 -0
  402. /package/dist/{integrations → plugins/internal}/llms-txt/dev-middleware.js +0 -0
  403. /package/dist/{integrations → plugins/internal}/llms-txt/emit.d.ts +0 -0
  404. /package/dist/{integrations → plugins/internal}/llms-txt/emit.js +0 -0
  405. /package/dist/{integrations → plugins/internal}/llms-txt/generate.d.ts +0 -0
  406. /package/dist/{integrations → plugins/internal}/llms-txt/generate.js +0 -0
  407. /package/dist/{integrations → plugins/internal}/llms-txt/index.js +0 -0
  408. /package/dist/{integrations → plugins/internal}/llms-txt/types.js +0 -0
  409. /package/dist/{integrations → plugins/internal}/search-index/build-emitter.d.ts +0 -0
  410. /package/dist/{integrations → plugins/internal}/search-index/build-emitter.js +0 -0
  411. /package/dist/{integrations → plugins/internal}/search-index/collect.d.ts +0 -0
  412. /package/dist/{integrations → plugins/internal}/search-index/dev-middleware.d.ts +0 -0
  413. /package/dist/{integrations → plugins/internal}/search-index/dev-middleware.js +0 -0
  414. /package/dist/{integrations → plugins/internal}/search-index/index.d.ts +0 -0
  415. /package/dist/{integrations → plugins/internal}/search-index/index.js +0 -0
  416. /package/dist/{integrations → plugins/internal}/search-index/types.d.ts +0 -0
  417. /package/dist/{integrations → plugins/internal}/search-index/types.js +0 -0
@@ -55,6 +55,16 @@ export interface Ramps {
55
55
  export type SemanticKey = "surface" | "muted" | "accent" | "accentHover" | "codeBg" | "codeFg" | "success" | "danger" | "warning" | "info" | "mermaidNodeBg" | "mermaidText" | "mermaidLine" | "mermaidLabelBg" | "mermaidNoteBg" | "chatUserBg" | "chatUserText" | "chatAssistantBg" | "chatAssistantText" | "imageOverlayBg" | "imageOverlayFg" | "matchedKeywordBg" | "matchedKeywordFg";
56
56
  /** Canonical order of the 23 semantic roles — used for `--zd-*` emit. */
57
57
  export declare const SEMANTIC_KEYS: readonly SemanticKey[];
58
+ /**
59
+ * Compact Tier-2 syntax vocabulary. zfb's fixed 18-role renderer taxonomy is
60
+ * intentionally collapsed onto these nine public design decisions; see
61
+ * `ZFB_HIGHLIGHT_ROLE_TO_ZUDO_TOKEN` below.
62
+ */
63
+ export declare const SYNTAX_SEMANTIC_KEYS: readonly ["syntaxComment", "syntaxString", "syntaxNumber", "syntaxKeyword", "syntaxCallable", "syntaxType", "syntaxName", "syntaxInserted", "syntaxDeleted"];
64
+ export type SyntaxSemanticKey = (typeof SYNTAX_SEMANTIC_KEYS)[number];
65
+ /** Existing semantic role inherited when a syntax role has no explicit map. */
66
+ export declare const SYNTAX_SEMANTIC_ALIASES: Readonly<Record<SyntaxSemanticKey, SemanticKey>>;
67
+ export declare const SYNTAX_CSS_NAMES: Readonly<Record<SyntaxSemanticKey, string>>;
58
68
  /** The per-mode wiring: each UI role points at a ramp stop (or literal OKLCH)
59
69
  * via a `RampRef`. Two `ColorScheme`s (light + dark) share `ramps` but carry
60
70
  * their own `ModeMap`. */
@@ -64,6 +74,9 @@ export interface ModeMap {
64
74
  selectionBg: RampRef;
65
75
  selectionFg: RampRef;
66
76
  semantic: Record<SemanticKey, RampRef>;
77
+ /** Syntax-specific overrides. The map is required, while omitted roles
78
+ * inherit the aliases in `SYNTAX_SEMANTIC_ALIASES`. */
79
+ syntax: Partial<Record<SyntaxSemanticKey, RampRef>>;
67
80
  }
68
81
  /** A complete color scheme — shared Tier-1 ramps + per-mode Tier-2 wiring. */
69
82
  export interface ColorScheme {
@@ -75,6 +88,45 @@ export interface ColorScheme {
75
88
  * where a mode needs a different stop (or a per-mode AA-tuned literal). */
76
89
  export declare const SEMANTIC_RAMP_DEFAULTS: Record<SemanticKey, RampRef>;
77
90
  export declare const SEMANTIC_CSS_NAMES: Record<SemanticKey, string>;
91
+ /**
92
+ * Canonical renderer-role contraction shared by native zfb fenced code and
93
+ * `@takazudo/zfb-md-wasm` HTML Preview output. Values name zudo-doc semantic
94
+ * tokens, never palette stops, so renderer/component CSS stays downstream of
95
+ * the theme tier.
96
+ */
97
+ export declare const ZFB_HIGHLIGHT_ROLE_TO_ZUDO_TOKEN: {
98
+ readonly foreground: "codeFg";
99
+ readonly background: "codeBg";
100
+ readonly escape: "syntaxString";
101
+ readonly operator: "codeFg";
102
+ readonly comment: "syntaxComment";
103
+ readonly string: "syntaxString";
104
+ readonly number: "syntaxNumber";
105
+ readonly constant: "syntaxNumber";
106
+ readonly keyword: "syntaxKeyword";
107
+ readonly function: "syntaxCallable";
108
+ readonly type: "syntaxType";
109
+ readonly namespace: "syntaxType";
110
+ readonly property: "syntaxName";
111
+ readonly variable: "syntaxName";
112
+ readonly tag: "syntaxName";
113
+ readonly attribute: "syntaxName";
114
+ readonly punctuation: "codeFg";
115
+ readonly inserted: "syntaxInserted";
116
+ readonly deleted: "syntaxDeleted";
117
+ readonly heading: "syntaxKeyword";
118
+ };
119
+ export type ZfbHighlightRole = keyof typeof ZFB_HIGHLIGHT_ROLE_TO_ZUDO_TOKEN;
120
+ /** Percentage of the inserted/deleted foreground mixed into `codeBg`. */
121
+ export declare const SYNTAX_DIFF_BACKGROUND_MIX_PERCENT = 15;
122
+ /**
123
+ * Component-token values for zfb's inserted/deleted background variables.
124
+ * They deliberately do not create public `--zd-syntax-*-bg` roles.
125
+ */
126
+ export declare const SYNTAX_DIFF_BACKGROUND_CSS: {
127
+ readonly inserted: `color-mix(in srgb, var(${string}) 15%, var(${string}))`;
128
+ readonly deleted: `color-mix(in srgb, var(${string}) 15%, var(${string}))`;
129
+ };
78
130
  /**
79
131
  * Resolve a `RampRef` to a concrete color string against the given `ramps`.
80
132
  * - `{ base: n }` → `ramps.base[n]`
@@ -90,6 +142,21 @@ export declare function resolveRampRef(ref: RampRef, ramps: Ramps): string;
90
142
  /** Resolve every semantic role to a concrete color string via the scheme's
91
143
  * per-mode `map.semantic` wiring. Returns all 23 keys. */
92
144
  export declare function resolveSemanticColors(scheme: ColorScheme): Record<SemanticKey, string>;
145
+ export interface ResolvedSyntaxPalette {
146
+ /** Effective refs retain ramp identity for design-token-panel rows. */
147
+ refs: Record<SyntaxSemanticKey, RampRef>;
148
+ /** Concrete colors used by generated CSS and contrast validation. */
149
+ colors: Record<SyntaxSemanticKey, string>;
150
+ }
151
+ /**
152
+ * Canonical complete syntax resolver. Explicit partial overrides win; missing
153
+ * or invalid overrides inherit the scheme's semantic alias. A defensive
154
+ * `codeFg` / `fg` / first-ramp chain keeps runtime-authored data non-throwing
155
+ * even when it bypasses TypeScript or serde validation.
156
+ */
157
+ export declare function resolveSyntaxPalette(scheme: ColorScheme): ResolvedSyntaxPalette;
158
+ /** Convenience view of the canonical syntax palette's concrete colors. */
159
+ export declare function resolveSyntaxColors(scheme: ColorScheme): Record<SyntaxSemanticKey, string>;
93
160
  export interface TierItem {
94
161
  /** Stable id used as the Record key in persisted state (e.g. `surface`). */
95
162
  id: string;
@@ -120,10 +187,10 @@ export interface TierItem {
120
187
  */
121
188
  export declare function rampRefToPanelDefault(ref: RampRef): string;
122
189
  /**
123
- * Build the 27-row mode-scoped semantic tier's `items` for the design-token
190
+ * Build the 36-row mode-scoped semantic tier's `items` for the design-token
124
191
  * panel, from a single (already mode-resolved) `ColorScheme`: 4 base roles
125
192
  * (`bg`, `fg`, `selection-bg`, `selection-fg`) followed by the 23
126
- * `SEMANTIC_KEYS` rows, in that order. Every row's `default` is
193
+ * `SEMANTIC_KEYS` rows and 9 syntax rows, in that order. Every row's `default` is
127
194
  * `rampRefToPanelDefault` of the scheme's `map` entry for that role — never a
128
195
  * resolved literal color — so the panel's grouped ramp dropdown can decode it
129
196
  * back to a ramp reference (the no-snapping guarantee: a scheme with no
@@ -134,7 +201,7 @@ export declare function buildSemanticTierItems(scheme: ColorScheme): TierItem[];
134
201
  /** Which tiers a `schemeToCssPairs` call emits:
135
202
  * - `"all"` (default) — base roles + `--palette-*` + `--zd-*` semantic
136
203
  * - `"palette"` — only the bare Tier-1 `--palette-*` pairs
137
- * - `"roles"` — base roles + the 23 `--zd-*` semantic pairs
204
+ * - `"roles"` — base roles + the 23 UI and 9 syntax semantic pairs
138
205
  *
139
206
  * The split lets `generateLightDarkCssProperties` emit the shared `--palette-*`
140
207
  * once (bare) while wrapping the per-mode `--zd-*` roles in `light-dark(…)`.
@@ -150,6 +217,7 @@ export type CssEmitScope = "all" | "palette" | "roles";
150
217
  * - Tier-1 ramps: `--palette-base-0..4`, `--palette-accent-0..2`,
151
218
  * `--palette-state-{danger,success,warning,info}`
152
219
  * - the 23 Tier-2 `--zd-{role}` semantic tokens
220
+ * - the 9 Tier-2 `--zd-syntax-*` semantic tokens
153
221
  *
154
222
  * It intentionally does NOT emit the retired `--zd-0..15` slots or `--zd-cursor`.
155
223
  */
@@ -24,6 +24,39 @@ const SEMANTIC_KEYS = [
24
24
  "matchedKeywordBg",
25
25
  "matchedKeywordFg"
26
26
  ];
27
+ const SYNTAX_SEMANTIC_KEYS = [
28
+ "syntaxComment",
29
+ "syntaxString",
30
+ "syntaxNumber",
31
+ "syntaxKeyword",
32
+ "syntaxCallable",
33
+ "syntaxType",
34
+ "syntaxName",
35
+ "syntaxInserted",
36
+ "syntaxDeleted"
37
+ ];
38
+ const SYNTAX_SEMANTIC_ALIASES = {
39
+ syntaxComment: "muted",
40
+ syntaxString: "success",
41
+ syntaxNumber: "warning",
42
+ syntaxKeyword: "accent",
43
+ syntaxCallable: "info",
44
+ syntaxType: "warning",
45
+ syntaxName: "codeFg",
46
+ syntaxInserted: "success",
47
+ syntaxDeleted: "danger"
48
+ };
49
+ const SYNTAX_CSS_NAMES = {
50
+ syntaxComment: "--zd-syntax-comment",
51
+ syntaxString: "--zd-syntax-string",
52
+ syntaxNumber: "--zd-syntax-number",
53
+ syntaxKeyword: "--zd-syntax-keyword",
54
+ syntaxCallable: "--zd-syntax-callable",
55
+ syntaxType: "--zd-syntax-type",
56
+ syntaxName: "--zd-syntax-name",
57
+ syntaxInserted: "--zd-syntax-inserted",
58
+ syntaxDeleted: "--zd-syntax-deleted"
59
+ };
27
60
  const SEMANTIC_RAMP_DEFAULTS = {
28
61
  // Re-pointed for the 5-base / 3-accent minimized ramp (#2602); mirrors the
29
62
  // Default Dark reference wiring (surface/chatAssistantBg/imageOverlayBg merged
@@ -79,6 +112,33 @@ const SEMANTIC_CSS_NAMES = {
79
112
  matchedKeywordBg: "--zd-matched-keyword-bg",
80
113
  matchedKeywordFg: "--zd-matched-keyword-fg"
81
114
  };
115
+ const ZFB_HIGHLIGHT_ROLE_TO_ZUDO_TOKEN = {
116
+ foreground: "codeFg",
117
+ background: "codeBg",
118
+ escape: "syntaxString",
119
+ operator: "codeFg",
120
+ comment: "syntaxComment",
121
+ string: "syntaxString",
122
+ number: "syntaxNumber",
123
+ constant: "syntaxNumber",
124
+ keyword: "syntaxKeyword",
125
+ function: "syntaxCallable",
126
+ type: "syntaxType",
127
+ namespace: "syntaxType",
128
+ property: "syntaxName",
129
+ variable: "syntaxName",
130
+ tag: "syntaxName",
131
+ attribute: "syntaxName",
132
+ punctuation: "codeFg",
133
+ inserted: "syntaxInserted",
134
+ deleted: "syntaxDeleted",
135
+ heading: "syntaxKeyword"
136
+ };
137
+ const SYNTAX_DIFF_BACKGROUND_MIX_PERCENT = 15;
138
+ const SYNTAX_DIFF_BACKGROUND_CSS = {
139
+ inserted: `color-mix(in srgb, var(${SYNTAX_CSS_NAMES.syntaxInserted}) ${SYNTAX_DIFF_BACKGROUND_MIX_PERCENT}%, var(${SEMANTIC_CSS_NAMES.codeBg}))`,
140
+ deleted: `color-mix(in srgb, var(${SYNTAX_CSS_NAMES.syntaxDeleted}) ${SYNTAX_DIFF_BACKGROUND_MIX_PERCENT}%, var(${SEMANTIC_CSS_NAMES.codeBg}))`
141
+ };
82
142
  function resolveRampRef(ref, ramps) {
83
143
  if (typeof ref === "string") return ref;
84
144
  if ("base" in ref) {
@@ -105,6 +165,61 @@ function resolveSemanticColors(scheme) {
105
165
  }
106
166
  return out;
107
167
  }
168
+ function tryResolveRampRef(ref, ramps) {
169
+ if (typeof ref === "string") return ref.trim().length > 0 ? ref : void 0;
170
+ if (!ref || typeof ref !== "object") return void 0;
171
+ const candidate = ref;
172
+ if ("base" in candidate) {
173
+ const index = candidate.base;
174
+ if (typeof index !== "number" || !Number.isInteger(index) || index < 0) return void 0;
175
+ const value = ramps.base[index];
176
+ return typeof value === "string" && value.trim().length > 0 ? value : void 0;
177
+ }
178
+ if ("accent" in candidate) {
179
+ const index = candidate.accent;
180
+ if (typeof index !== "number" || !Number.isInteger(index) || index < 0) return void 0;
181
+ const value = ramps.accent[index];
182
+ return typeof value === "string" && value.trim().length > 0 ? value : void 0;
183
+ }
184
+ if ("state" in candidate) {
185
+ const state = candidate.state;
186
+ if (typeof state !== "string" || !STATE_ROLES.includes(state)) return void 0;
187
+ const value = ramps.state[state];
188
+ return typeof value === "string" && value.trim().length > 0 ? value : void 0;
189
+ }
190
+ return void 0;
191
+ }
192
+ function copyRampRef(ref) {
193
+ return typeof ref === "string" ? ref : { ...ref };
194
+ }
195
+ function resolveSyntaxPalette(scheme) {
196
+ const { ramps, map } = scheme;
197
+ const refs = {};
198
+ const colors = {};
199
+ const emergencyCandidates = [
200
+ map.semantic.codeFg,
201
+ map.fg,
202
+ ramps.base.find((value) => typeof value === "string" && value.trim().length > 0),
203
+ "currentColor"
204
+ ];
205
+ const emergencyRef = emergencyCandidates.find(
206
+ (candidate) => tryResolveRampRef(candidate, ramps) !== void 0
207
+ );
208
+ const emergencyColor = tryResolveRampRef(emergencyRef, ramps) ?? "currentColor";
209
+ for (const key of SYNTAX_SEMANTIC_KEYS) {
210
+ const explicitRef = map.syntax[key];
211
+ const explicitColor = tryResolveRampRef(explicitRef, ramps);
212
+ const inheritedRef = map.semantic[SYNTAX_SEMANTIC_ALIASES[key]];
213
+ const inheritedColor = tryResolveRampRef(inheritedRef, ramps);
214
+ const effectiveRef = explicitColor !== void 0 ? explicitRef : inheritedColor !== void 0 ? inheritedRef : emergencyRef;
215
+ refs[key] = copyRampRef(effectiveRef);
216
+ colors[key] = explicitColor ?? inheritedColor ?? emergencyColor;
217
+ }
218
+ return { refs, colors };
219
+ }
220
+ function resolveSyntaxColors(scheme) {
221
+ return resolveSyntaxPalette(scheme).colors;
222
+ }
108
223
  function rampRefToPanelDefault(ref) {
109
224
  if (typeof ref === "string") return ref;
110
225
  if ("base" in ref) return `base:base-${ref.base}`;
@@ -113,6 +228,7 @@ function rampRefToPanelDefault(ref) {
113
228
  }
114
229
  function buildSemanticTierItems(scheme) {
115
230
  const { map } = scheme;
231
+ const syntax = resolveSyntaxPalette(scheme);
116
232
  const items = [
117
233
  {
118
234
  id: "bg",
@@ -152,6 +268,15 @@ function buildSemanticTierItems(scheme) {
152
268
  type: { kind: "color", format: "oklch" }
153
269
  });
154
270
  }
271
+ for (const key of SYNTAX_SEMANTIC_KEYS) {
272
+ items.push({
273
+ id: key,
274
+ cssVar: SYNTAX_CSS_NAMES[key],
275
+ label: key,
276
+ default: rampRefToPanelDefault(syntax.refs[key]),
277
+ type: { kind: "color", format: "oklch" }
278
+ });
279
+ }
155
280
  return items;
156
281
  }
157
282
  function schemeToCssPairs(scheme, scope = "all") {
@@ -177,6 +302,10 @@ function schemeToCssPairs(scheme, scope = "all") {
177
302
  for (const key of SEMANTIC_KEYS) {
178
303
  pairs.push([SEMANTIC_CSS_NAMES[key], sem[key]]);
179
304
  }
305
+ const syntax = resolveSyntaxColors(scheme);
306
+ for (const key of SYNTAX_SEMANTIC_KEYS) {
307
+ pairs.push([SYNTAX_CSS_NAMES[key], syntax[key]]);
308
+ }
180
309
  }
181
310
  return pairs;
182
311
  }
@@ -212,11 +341,19 @@ export {
212
341
  SEMANTIC_KEYS,
213
342
  SEMANTIC_RAMP_DEFAULTS,
214
343
  STATE_ROLES,
344
+ SYNTAX_CSS_NAMES,
345
+ SYNTAX_DIFF_BACKGROUND_CSS,
346
+ SYNTAX_DIFF_BACKGROUND_MIX_PERCENT,
347
+ SYNTAX_SEMANTIC_ALIASES,
348
+ SYNTAX_SEMANTIC_KEYS,
349
+ ZFB_HIGHLIGHT_ROLE_TO_ZUDO_TOKEN,
215
350
  buildSemanticTierItems,
216
351
  generateCssCustomProperties,
217
352
  generateLightDarkCssProperties,
218
353
  rampRefToPanelDefault,
219
354
  resolveRampRef,
220
355
  resolveSemanticColors,
356
+ resolveSyntaxColors,
357
+ resolveSyntaxPalette,
221
358
  schemeToCssPairs
222
359
  };
@@ -64,6 +64,13 @@ const darkMap = {
64
64
  // the amber bg — matched-keyword at threshold+0.1; carried from #2593.
65
65
  matchedKeywordBg: "oklch(.700 .158 62)",
66
66
  matchedKeywordFg: "oklch(.300 .003 65)"
67
+ },
68
+ // Diff foregrounds are checked against their actual 15% foreground tint on
69
+ // codeBg. The ordinary success/danger aliases are not light enough on that
70
+ // derived dark background, so only these two syntax roles need overrides.
71
+ syntax: {
72
+ syntaxInserted: "oklch(.750 .145 145)",
73
+ syntaxDeleted: "oklch(.820 .100 25)"
67
74
  }
68
75
  };
69
76
  const lightMap = {
@@ -110,6 +117,12 @@ const lightMap = {
110
117
  // Default Dark (an amber-on-white highlight reads identically in both modes).
111
118
  matchedKeywordBg: "oklch(.700 .158 62)",
112
119
  matchedKeywordFg: "oklch(.300 .003 65)"
120
+ },
121
+ // Slightly darker than the shared success/danger aliases so the foregrounds
122
+ // retain >= 4.6:1 on their own 15% tints over the light code background.
123
+ syntax: {
124
+ syntaxInserted: "oklch(.460 .140 145)",
125
+ syntaxDeleted: "oklch(.490 .170 25)"
113
126
  }
114
127
  };
115
128
  const defaultColorSchemes = {
package/dist/config.d.ts CHANGED
@@ -192,8 +192,8 @@ export interface ZudoDocConfig {
192
192
  */
193
193
  tagGovernance?: TagGovernanceMode;
194
194
  /**
195
- * Whether the tag vocabulary is consulted at runtime (alias resolution,
196
- * deprecation filtering, grouped footer). Orthogonal to `tagGovernance`.
195
+ * Whether the canonical tag vocabulary is consulted at runtime (validation
196
+ * and grouped footer rendering). Orthogonal to `tagGovernance`.
197
197
  * The vocabulary ENTRIES are supplied separately via `tagVocabularyEntries`.
198
198
  * @default false
199
199
  */
@@ -229,8 +229,8 @@ export interface ZudoDocConfig {
229
229
  */
230
230
  aiAssistant?: boolean;
231
231
  /**
232
- * Short-circuit `/api/ai-chat` with a fixed "disabled" reply (no API key /
233
- * KV / rate limiter touched).
232
+ * Short-circuit `/api/ai-chat` with a fixed "disabled" reply (no API key,
233
+ * KV/DO binding, or rate limiter touched).
234
234
  * @default false
235
235
  */
236
236
  aiChatDemoMode?: boolean;
@@ -241,8 +241,9 @@ export interface ZudoDocConfig {
241
241
  */
242
242
  aiChatAllowedOrigins?: string[];
243
243
  /**
244
- * Global daily request ceiling across all IPs for `/api/ai-chat`, or `false`
245
- * to disable the ceiling.
244
+ * Exact UTC-day paid-call admission cap across all IPs for `/api/ai-chat`,
245
+ * or `false` to disable it. Admissions are not refunded after provider
246
+ * failure and are not provider-confirmed spend accounting.
246
247
  * @default false
247
248
  */
248
249
  aiChatGlobalDailyLimit?: number | false;
@@ -261,12 +262,6 @@ export interface ZudoDocConfig {
261
262
  * @default 4
262
263
  */
263
264
  tocMaxDepth?: number;
264
- /**
265
- * Heading-ID (anchor) strategy. `"hierarchical"` prefixes each anchor with
266
- * its ancestor chain; `"flat"` is zfb's legacy github-slugger scheme.
267
- * @default "hierarchical"
268
- */
269
- headingIdStrategy?: "flat" | "hierarchical";
270
265
  /**
271
266
  * Enable the draggable sidebar resizer.
272
267
  * @default false
@@ -374,6 +369,27 @@ export interface ZudoDocConfig {
374
369
  * @default undefined (package-default builder is used)
375
370
  */
376
371
  designTokenPanelConfigModule?: string;
372
+ /**
373
+ * Active theme pack slug. "default" is the stock zudo-doc look (no pack
374
+ * stylesheet loaded). Must be a member of the resolved `themePacks` list;
375
+ * an unknown slug fails the build loudly at plugin setup.
376
+ * @default "default"
377
+ */
378
+ themePack?: string;
379
+ /**
380
+ * Mount the bottom-right theme-pack switcher flyout (and its browse-all
381
+ * dialog) on every page.
382
+ * @default false
383
+ */
384
+ themePackSwitcher?: boolean;
385
+ /**
386
+ * Enabled pack slugs, in switcher order. `undefined` = all bundled packs:
387
+ * "default" first, then the bundled registry in canonical
388
+ * (alphabetical-by-slug) order. An explicit list is authoritative — may omit
389
+ * "default", reorder freely; duplicates/unknown slugs fail loudly.
390
+ * @default undefined
391
+ */
392
+ themePacks?: string[];
377
393
  /**
378
394
  * Replace the default docs-frontmatter zod schema builder entirely. When
379
395
  * omitted, `zudoDoc()` builds the default schema
package/dist/config.js CHANGED
@@ -45,11 +45,12 @@ const DEFAULT_SETTINGS = {
45
45
  aiAssistant: false,
46
46
  aiChatDemoMode: false,
47
47
  aiChatAllowedOrigins: [],
48
+ // Exact UTC-day paid-call admission cap; false disables it. An admission is
49
+ // consumed before provider fetch and is not provider-confirmed accounting.
48
50
  aiChatGlobalDailyLimit: false,
49
51
  designTokenPanel: false,
50
52
  tocMinDepth: 2,
51
53
  tocMaxDepth: 4,
52
- headingIdStrategy: "hierarchical",
53
54
  sidebarResizer: false,
54
55
  sidebarToggle: false,
55
56
  imageEnlarge: false,
@@ -65,9 +66,17 @@ const DEFAULT_SETTINGS = {
65
66
  footer: false,
66
67
  headerNav: [],
67
68
  headerRightItems: [{ type: "component", component: "theme-toggle" }],
68
- packageOwnedRoutes: true
69
+ packageOwnedRoutes: true,
70
+ themePack: "default",
71
+ themePackSwitcher: false,
72
+ themePacks: void 0
69
73
  };
70
74
  function zudoDoc(user = {}) {
75
+ if ("headingIdStrategy" in user) {
76
+ throw new TypeError(
77
+ "headingIdStrategy is no longer supported; heading IDs are always hierarchical"
78
+ );
79
+ }
71
80
  const {
72
81
  port,
73
82
  adapter,
@@ -16,22 +16,6 @@ import { ContentCode } from "./content-code.js";
16
16
  * into a larger components object that also includes admonition overrides,
17
17
  * custom shortcodes, etc.) at the Astro page layer.
18
18
  */
19
- export declare const htmlOverrides: {
20
- h2: typeof HeadingH2;
21
- h3: typeof HeadingH3;
22
- h4: typeof HeadingH4;
23
- p: typeof ContentParagraph;
24
- a: typeof ContentLink;
25
- strong: typeof ContentStrong;
26
- blockquote: typeof ContentBlockquote;
27
- ul: typeof ContentUl;
28
- ol: typeof ContentOl;
29
- table: typeof ContentTable;
30
- code: typeof ContentCode;
31
- };
32
- /**
33
- * Alias for `htmlOverrides`. Prefer this name in new consumer code.
34
- */
35
19
  export declare const defaultComponents: {
36
20
  h2: typeof HeadingH2;
37
21
  h3: typeof HeadingH3;
@@ -9,7 +9,7 @@ import { ContentUl } from "./content-ul.js";
9
9
  import { ContentOl } from "./content-ol.js";
10
10
  import { ContentTable } from "./content-table.js";
11
11
  import { ContentCode } from "./content-code.js";
12
- const htmlOverrides = {
12
+ const defaultComponents = {
13
13
  h2: HeadingH2,
14
14
  h3: HeadingH3,
15
15
  h4: HeadingH4,
@@ -22,8 +22,6 @@ const htmlOverrides = {
22
22
  table: ContentTable,
23
23
  code: ContentCode
24
24
  };
25
- const defaultComponents = htmlOverrides;
26
25
  export {
27
- defaultComponents,
28
- htmlOverrides
26
+ defaultComponents
29
27
  };
@@ -26,4 +26,4 @@ export { ContentUl } from "./content-ul.js";
26
26
  export { ContentOl } from "./content-ol.js";
27
27
  export { ContentTable } from "./content-table.js";
28
28
  export { ContentCode } from "./content-code.js";
29
- export { htmlOverrides, defaultComponents } from "./component-map.js";
29
+ export { defaultComponents } from "./component-map.js";
@@ -9,7 +9,7 @@ import { ContentUl } from "./content-ul.js";
9
9
  import { ContentOl } from "./content-ol.js";
10
10
  import { ContentTable } from "./content-table.js";
11
11
  import { ContentCode } from "./content-code.js";
12
- import { htmlOverrides, defaultComponents } from "./component-map.js";
12
+ import { defaultComponents } from "./component-map.js";
13
13
  export {
14
14
  ContentBlockquote,
15
15
  ContentCode,
@@ -22,6 +22,5 @@ export {
22
22
  HeadingH2,
23
23
  HeadingH3,
24
24
  HeadingH4,
25
- defaultComponents,
26
- htmlOverrides
25
+ defaultComponents
27
26
  };
package/dist/content.css CHANGED
@@ -10,7 +10,7 @@
10
10
  * drift). See zudolab/zudo-doc#2188.
11
11
  *
12
12
  * Component-first split: the major elements (h2–h4, p, a, strong, blockquote,
13
- * ul, ol, table) get their VISUALS from the package's `htmlOverrides` Preact
13
+ * ul, ol, table) get their VISUALS from the package's `defaultComponents` Preact
14
14
  * components (Tailwind classes + inline styles), whose utilities ship in
15
15
  * `dist/safelist.css`. This file owns only what those components do NOT emit:
16
16
  * the flow-space vertical rhythm, heading `--flow-space` + tightening, the
@@ -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 → chromederive → 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