@takazudo/zudo-doc 5.28.2 → 6.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 (456) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +49 -16
  3. package/bin/gen-z-index.mjs +18 -18
  4. package/dist/agent-docs/identity.d.ts +4 -0
  5. package/dist/agent-docs/identity.js +24 -0
  6. package/dist/agent-docs/index.d.ts +5 -0
  7. package/dist/agent-docs/index.js +5 -0
  8. package/dist/agent-docs/limits.d.ts +11 -0
  9. package/dist/agent-docs/limits.js +24 -0
  10. package/dist/agent-docs/search.d.ts +14 -0
  11. package/dist/agent-docs/search.js +82 -0
  12. package/dist/agent-docs/tokenize.d.ts +2 -0
  13. package/dist/agent-docs/tokenize.js +22 -0
  14. package/dist/agent-docs/types.d.ts +68 -0
  15. package/dist/agent-docs/types.js +0 -0
  16. package/dist/ai-chat-modal/index.d.ts +1 -4
  17. package/dist/ai-chat-modal/index.js +183 -123
  18. package/dist/asset-components/asset-card.d.ts +1 -2
  19. package/dist/asset-components/asset-card.js +12 -12
  20. package/dist/asset-components/asset-code.d.ts +1 -2
  21. package/dist/asset-components/asset-code.js +10 -10
  22. package/dist/asset-components/shared.d.ts +3 -4
  23. package/dist/asset-components/shared.js +4 -4
  24. package/dist/asset-index-page/body.d.ts +5 -6
  25. package/dist/asset-index-page/body.js +6 -6
  26. package/dist/asset-index-page/index.d.ts +1 -2
  27. package/dist/asset-index-page/index.js +1 -1
  28. package/dist/asset-page/body.d.ts +5 -9
  29. package/dist/asset-page/body.js +3 -3
  30. package/dist/asset-page/components.d.ts +16 -17
  31. package/dist/asset-page/components.js +10 -9
  32. package/dist/asset-page/index.d.ts +1 -2
  33. package/dist/asset-page/index.js +1 -1
  34. package/dist/auto-logo/index.d.ts +1 -2
  35. package/dist/auto-logo/index.js +2 -2
  36. package/dist/body-foot-util/body-foot-util-area.d.ts +3 -4
  37. package/dist/body-foot-util/body-foot-util-area.js +1 -2
  38. package/dist/body-foot-util/edit-link.d.ts +2 -3
  39. package/dist/body-foot-util/edit-link.js +1 -2
  40. package/dist/breadcrumb/breadcrumb.d.ts +6 -6
  41. package/dist/breadcrumb/breadcrumb.js +3 -4
  42. package/dist/category-nav/index.d.ts +1 -2
  43. package/dist/category-nav/index.js +11 -5
  44. package/dist/category-tree-nav/index.d.ts +1 -2
  45. package/dist/category-tree-nav/index.js +3 -3
  46. package/dist/chrome/derive.d.ts +18 -27
  47. package/dist/chrome/derive.js +47 -29
  48. package/dist/chrome/index.d.ts +5 -5
  49. package/dist/chrome/index.js +1 -1
  50. package/dist/chrome/island-data.d.ts +4 -0
  51. package/dist/chrome/island-data.js +52 -0
  52. package/dist/chrome/primary-slots.d.ts +2 -3
  53. package/dist/chrome-bindings.d.ts +28 -22
  54. package/dist/code-group/index.d.ts +3 -4
  55. package/dist/code-group/index.js +3 -7
  56. package/dist/code-syntax/code-block-enhancer.d.ts +1 -2
  57. package/dist/code-syntax/code-block-enhancer.js +2 -2
  58. package/dist/code-syntax/mermaid-init.d.ts +1 -2
  59. package/dist/code-syntax/mermaid-init.js +5 -2
  60. package/dist/code-syntax/tabs-init-script.js +1 -1
  61. package/dist/code-syntax/tabs-init.d.ts +1 -2
  62. package/dist/code-syntax/tabs-init.js +2 -2
  63. package/dist/code-syntax/tabs.d.ts +6 -6
  64. package/dist/code-syntax/tabs.js +8 -8
  65. package/dist/compiled.css +2933 -2943
  66. package/dist/config-assertions/index.d.ts +13 -0
  67. package/dist/config-assertions/index.js +14 -0
  68. package/dist/config.d.ts +36 -17
  69. package/dist/config.js +23 -95
  70. package/dist/content/content-blockquote.d.ts +2 -3
  71. package/dist/content/content-blockquote.js +3 -3
  72. package/dist/content/content-code.d.ts +3 -4
  73. package/dist/content/content-code.js +5 -5
  74. package/dist/content/content-link.d.ts +3 -4
  75. package/dist/content/content-link.js +10 -10
  76. package/dist/content/content-ol.d.ts +2 -3
  77. package/dist/content/content-ol.js +5 -4
  78. package/dist/content/content-paragraph.d.ts +2 -3
  79. package/dist/content/content-paragraph.js +1 -1
  80. package/dist/content/content-strong.d.ts +2 -3
  81. package/dist/content/content-strong.js +3 -3
  82. package/dist/content/content-table.d.ts +2 -3
  83. package/dist/content/content-table.js +4 -4
  84. package/dist/content/content-ul.d.ts +2 -3
  85. package/dist/content/content-ul.js +4 -4
  86. package/dist/content/heading-h2.d.ts +2 -3
  87. package/dist/content/heading-h2.js +4 -4
  88. package/dist/content/heading-h3.d.ts +2 -3
  89. package/dist/content/heading-h3.js +4 -4
  90. package/dist/content/heading-h4.d.ts +2 -3
  91. package/dist/content/heading-h4.js +4 -4
  92. package/dist/content-admonition/index.d.ts +3 -4
  93. package/dist/content-admonition/index.js +2 -2
  94. package/dist/content.css +35 -33
  95. package/dist/design-token-panel-bootstrap-controller.d.ts +178 -0
  96. package/dist/design-token-panel-bootstrap-controller.js +359 -0
  97. package/dist/design-token-panel-bootstrap-island.d.ts +5 -0
  98. package/dist/design-token-panel-bootstrap-island.js +19 -0
  99. package/dist/design-token-panel-bootstrap.d.ts +5 -195
  100. package/dist/design-token-panel-bootstrap.js +3 -288
  101. package/dist/desktop-sidebar-toggle-island/index.d.ts +2 -7
  102. package/dist/desktop-sidebar-toggle-island/index.js +2 -58
  103. package/dist/desktop-sidebar-toggle-island/island.d.ts +4 -0
  104. package/dist/desktop-sidebar-toggle-island/island.js +43 -0
  105. package/dist/desktop-sidebar-toggle-island/storage.d.ts +4 -0
  106. package/dist/desktop-sidebar-toggle-island/storage.js +29 -0
  107. package/dist/desktop-toc-toggle-island/index.d.ts +2 -7
  108. package/dist/desktop-toc-toggle-island/index.js +2 -58
  109. package/dist/desktop-toc-toggle-island/island.d.ts +4 -0
  110. package/dist/desktop-toc-toggle-island/island.js +43 -0
  111. package/dist/desktop-toc-toggle-island/storage.d.ts +4 -0
  112. package/dist/desktop-toc-toggle-island/storage.js +29 -0
  113. package/dist/details/details.d.ts +3 -4
  114. package/dist/details/details.js +1 -1
  115. package/dist/doc-body-end/index.d.ts +1 -2
  116. package/dist/doc-body-end/index.js +1 -1
  117. package/dist/doc-body-end-islands/design-token-panel-island.d.ts +2 -2
  118. package/dist/doc-body-end-islands/design-token-panel-island.js +3 -7
  119. package/dist/doc-body-end-islands/index.d.ts +4 -21
  120. package/dist/doc-body-end-islands/index.js +5 -3
  121. package/dist/doc-body-end-islands/theme-pack-switcher-island.d.ts +3 -13
  122. package/dist/doc-body-end-islands/theme-pack-switcher-island.js +11 -13
  123. package/dist/doc-content-header/index.d.ts +1 -2
  124. package/dist/doc-content-header/index.js +1 -1
  125. package/dist/doc-history/index.d.ts +1 -1
  126. package/dist/doc-history/index.js +166 -141
  127. package/dist/doc-history-area/index.d.ts +6 -4
  128. package/dist/doc-history-area/index.js +17 -16
  129. package/dist/doc-metainfo-area/index.d.ts +2 -3
  130. package/dist/doc-metainfo-area/index.js +1 -1
  131. package/dist/doc-page-renderer/index.d.ts +13 -7
  132. package/dist/doc-page-renderer/index.js +10 -1
  133. package/dist/doc-page-shell/index.d.ts +20 -7
  134. package/dist/doc-page-shell/index.js +17 -6
  135. package/dist/doc-pager/index.d.ts +1 -2
  136. package/dist/doc-pager/index.js +3 -3
  137. package/dist/doc-tags-area/index.d.ts +2 -3
  138. package/dist/doc-tags-area/index.js +1 -1
  139. package/dist/doclayout/doc-layout-with-defaults.d.ts +9 -9
  140. package/dist/doclayout/doc-layout-with-defaults.js +5 -15
  141. package/dist/doclayout/doc-layout.d.ts +26 -27
  142. package/dist/doclayout/doc-layout.js +23 -14
  143. package/dist/docs-schema/index.d.ts +4 -0
  144. package/dist/docs-schema/index.js +1 -0
  145. package/dist/extract-headings/index.js +43 -12
  146. package/dist/factory-context/index.d.ts +22 -19
  147. package/dist/features.css +70 -8
  148. package/dist/find-in-page/find-bar.d.ts +4 -2
  149. package/dist/find-in-page/find-bar.js +58 -69
  150. package/dist/find-in-page/index.d.ts +2 -8
  151. package/dist/find-in-page/index.js +33 -30
  152. package/dist/footer/footer.d.ts +3 -4
  153. package/dist/footer/footer.js +3 -3
  154. package/dist/footer-with-defaults/index.d.ts +2 -3
  155. package/dist/footer-with-defaults/index.js +1 -1
  156. package/dist/frontmatter-preview-defaults/index.js +1 -0
  157. package/dist/head/doc-head.d.ts +1 -1
  158. package/dist/head/doc-head.js +24 -32
  159. package/dist/head/og-tags.d.ts +1 -1
  160. package/dist/head/og-tags.js +8 -7
  161. package/dist/head/twitter-card.d.ts +1 -1
  162. package/dist/head/twitter-card.js +1 -1
  163. package/dist/head-with-defaults/index.d.ts +7 -2
  164. package/dist/head-with-defaults/index.js +46 -32
  165. package/dist/header/header.d.ts +8 -8
  166. package/dist/header/header.js +9 -11
  167. package/dist/header/types.d.ts +7 -7
  168. package/dist/header-with-defaults/index.d.ts +1 -2
  169. package/dist/header-with-defaults/index.js +18 -8
  170. package/dist/home-intro/index.d.ts +2 -5
  171. package/dist/home-intro/index.js +7 -5
  172. package/dist/home-intro/prepare.js +4 -3
  173. package/dist/home-page/index.d.ts +3 -3
  174. package/dist/home-page/index.js +19 -17
  175. package/dist/html-preview-wrapper/highlighted-code.d.ts +3 -4
  176. package/dist/html-preview-wrapper/highlighted-code.js +19 -17
  177. package/dist/html-preview-wrapper/html-preview-wrapper.d.ts +4 -25
  178. package/dist/html-preview-wrapper/html-preview-wrapper.js +2 -87
  179. package/dist/html-preview-wrapper/html-preview.d.ts +3 -10
  180. package/dist/html-preview-wrapper/html-preview.js +13 -37
  181. package/dist/html-preview-wrapper/index.d.ts +2 -1
  182. package/dist/html-preview-wrapper/index.js +1 -1
  183. package/dist/html-preview-wrapper/preview-base.d.ts +3 -5
  184. package/dist/html-preview-wrapper/preview-base.js +56 -59
  185. package/dist/html-preview-wrapper/wrapper.d.ts +20 -0
  186. package/dist/html-preview-wrapper/wrapper.js +37 -0
  187. package/dist/hydration-pending.d.ts +3 -5
  188. package/dist/hydration-pending.js +7 -5
  189. package/dist/i18n-version/language-switcher.d.ts +5 -32
  190. package/dist/i18n-version/language-switcher.js +5 -106
  191. package/dist/i18n-version/switcher-generated-scripts.d.ts +2 -0
  192. package/dist/i18n-version/switcher-generated-scripts.js +107 -0
  193. package/dist/i18n-version/switcher-url-state.d.ts +76 -0
  194. package/dist/i18n-version/switcher-url-state.js +103 -0
  195. package/dist/i18n-version/version-banner.d.ts +2 -3
  196. package/dist/i18n-version/version-banner.js +1 -1
  197. package/dist/i18n-version/version-switcher.d.ts +5 -50
  198. package/dist/i18n-version/version-switcher.js +5 -157
  199. package/dist/icons/index.d.ts +18 -19
  200. package/dist/icons/index.js +17 -33
  201. package/dist/image-enlarge/index.d.ts +1 -10
  202. package/dist/image-enlarge/index.js +80 -55
  203. package/dist/image-enlarge/public.d.ts +2 -0
  204. package/dist/image-enlarge/public.js +6 -0
  205. package/dist/image-enlarge/ssr-fallback.d.ts +2 -0
  206. package/dist/image-enlarge/ssr-fallback.js +8 -0
  207. package/dist/index.d.ts +11 -4
  208. package/dist/inline-version-switcher/index.d.ts +1 -2
  209. package/dist/inline-version-switcher/index.js +1 -1
  210. package/dist/island-types/index.d.ts +2 -2
  211. package/dist/island-types/index.js +1 -5
  212. package/dist/math-block/index.d.ts +4 -7
  213. package/dist/math-block/index.js +5 -5
  214. package/dist/mcp/handler.d.ts +8 -0
  215. package/dist/mcp/handler.js +129 -0
  216. package/dist/mcp/index.d.ts +4 -0
  217. package/dist/mcp/index.js +7 -0
  218. package/dist/mcp/loader.d.ts +19 -0
  219. package/dist/mcp/loader.js +202 -0
  220. package/dist/mdx-components/index.js +40 -108
  221. package/dist/mermaid-enlarge/index.d.ts +1 -8
  222. package/dist/mermaid-enlarge/index.js +174 -158
  223. package/dist/mermaid-enlarge/public.d.ts +2 -0
  224. package/dist/mermaid-enlarge/public.js +6 -0
  225. package/dist/mermaid-enlarge/ssr-fallback.d.ts +2 -0
  226. package/dist/mermaid-enlarge/ssr-fallback.js +8 -0
  227. package/dist/metainfo/doc-metainfo.d.ts +2 -3
  228. package/dist/metainfo/doc-metainfo.js +1 -4
  229. package/dist/metainfo/doc-tags.d.ts +2 -3
  230. package/dist/metainfo/doc-tags.js +1 -1
  231. package/dist/metainfo/frontmatter-preview.d.ts +3 -4
  232. package/dist/metainfo/frontmatter-preview.js +1 -1
  233. package/dist/nav-data-prep/index.js +6 -4
  234. package/dist/nav-indexing/category-nav.d.ts +2 -3
  235. package/dist/nav-indexing/category-nav.js +1 -2
  236. package/dist/nav-indexing/category-tree-nav.d.ts +2 -3
  237. package/dist/nav-indexing/category-tree-nav.js +1 -1
  238. package/dist/nav-indexing/doc-card-grid.d.ts +2 -3
  239. package/dist/nav-indexing/doc-card-grid.js +1 -2
  240. package/dist/nav-indexing/docs-sitemap.d.ts +2 -3
  241. package/dist/nav-indexing/docs-sitemap.js +2 -2
  242. package/dist/nav-indexing/index.d.ts +1 -1
  243. package/dist/nav-indexing/nav-card-grid.d.ts +2 -3
  244. package/dist/nav-indexing/nav-card-grid.js +1 -2
  245. package/dist/nav-indexing/note-tray-index-parts/card-list.d.ts +1 -2
  246. package/dist/nav-indexing/note-tray-index-parts/card-list.js +4 -4
  247. package/dist/nav-indexing/note-tray-index-parts/date-line.d.ts +2 -3
  248. package/dist/nav-indexing/note-tray-index-parts/date-line.js +1 -1
  249. package/dist/nav-indexing/note-tray-index-parts/index-list.d.ts +1 -2
  250. package/dist/nav-indexing/note-tray-index-parts/index-list.js +2 -2
  251. package/dist/nav-indexing/note-tray-index-parts/timeline.d.ts +1 -2
  252. package/dist/nav-indexing/note-tray-index-parts/timeline.js +2 -2
  253. package/dist/nav-indexing/note-tray-index.d.ts +1 -2
  254. package/dist/nav-indexing/note-tray-index.js +1 -1
  255. package/dist/nav-indexing/site-tree-nav-demo.d.ts +2 -3
  256. package/dist/nav-indexing/site-tree-nav-demo.js +2 -2
  257. package/dist/nav-indexing/tag-nav.d.ts +1 -2
  258. package/dist/nav-indexing/tag-nav.js +1 -1
  259. package/dist/nav-indexing/types.d.ts +2 -2
  260. package/dist/nav-indexing/versions-page-content.d.ts +2 -3
  261. package/dist/nav-indexing/versions-page-content.js +8 -8
  262. package/dist/note-tray-index/index.d.ts +1 -2
  263. package/dist/note-tray-index/index.js +1 -1
  264. package/dist/page-loading/page-loading-overlay.d.ts +1 -2
  265. package/dist/page-loading/page-loading-overlay.js +3 -5
  266. package/dist/plugins/agent-export.d.ts +3 -0
  267. package/dist/plugins/agent-export.js +34 -0
  268. package/dist/plugins/internal/agent-export/chunk.d.ts +5 -0
  269. package/dist/plugins/internal/agent-export/chunk.js +90 -0
  270. package/dist/plugins/internal/agent-export/index.d.ts +24 -0
  271. package/dist/plugins/internal/agent-export/index.js +123 -0
  272. package/dist/plugins/internal/agent-export/normalize.d.ts +5 -0
  273. package/dist/plugins/internal/agent-export/normalize.js +73 -0
  274. package/dist/plugins/internal/llms-txt/dev-middleware.d.ts +6 -0
  275. package/dist/plugins/internal/llms-txt/dev-middleware.js +8 -3
  276. package/dist/plugins/internal/llms-txt/emit.js +23 -6
  277. package/dist/plugins/internal/llms-txt/generate.d.ts +7 -1
  278. package/dist/plugins/internal/llms-txt/generate.js +9 -2
  279. package/dist/plugins/internal/llms-txt/load.d.ts +2 -0
  280. package/dist/plugins/internal/llms-txt/load.js +20 -4
  281. package/dist/plugins/internal/llms-txt/types.d.ts +10 -0
  282. package/dist/plugins/routes.js +4 -0
  283. package/dist/preset.d.ts +19 -9
  284. package/dist/preset.js +20 -1
  285. package/dist/route-context-payload/index.js +1 -1
  286. package/dist/routes/404.d.ts +2 -3
  287. package/dist/routes/404.js +1 -1
  288. package/dist/routes/_chrome.d.ts +5 -5
  289. package/dist/routes/_chrome.js +7 -2
  290. package/dist/routes/_context.d.ts +4 -4
  291. package/dist/routes/_design-token-panel-bootstrap.d.ts +1 -4
  292. package/dist/routes/_design-token-panel-bootstrap.js +9 -1
  293. package/dist/routes/docs-slug.d.ts +2 -3
  294. package/dist/routes/docs-tags-index.d.ts +2 -3
  295. package/dist/routes/docs-tags-index.js +1 -1
  296. package/dist/routes/docs-tags-tag.d.ts +2 -3
  297. package/dist/routes/docs-tags-tag.js +1 -1
  298. package/dist/routes/docs-versions.d.ts +2 -3
  299. package/dist/routes/docs-versions.js +1 -1
  300. package/dist/routes/files-path.d.ts +2 -3
  301. package/dist/routes/files-path.js +1 -1
  302. package/dist/routes/index.d.ts +2 -3
  303. package/dist/routes/index.js +1 -1
  304. package/dist/routes/locale-docs-slug.d.ts +2 -3
  305. package/dist/routes/locale-docs-tags-index.d.ts +2 -3
  306. package/dist/routes/locale-docs-tags-index.js +1 -1
  307. package/dist/routes/locale-docs-tags-tag.d.ts +2 -3
  308. package/dist/routes/locale-docs-tags-tag.js +1 -1
  309. package/dist/routes/locale-docs-versions.d.ts +2 -3
  310. package/dist/routes/locale-docs-versions.js +1 -1
  311. package/dist/routes/locale-files-path.d.ts +2 -3
  312. package/dist/routes/locale-files-path.js +1 -1
  313. package/dist/routes/locale-index.d.ts +2 -3
  314. package/dist/routes/locale-index.js +1 -1
  315. package/dist/routes/mcp.d.ts +5 -0
  316. package/dist/routes/mcp.js +25 -0
  317. package/dist/routes/v-docs-slug.d.ts +2 -3
  318. package/dist/routes/v-locale-docs-slug.d.ts +2 -3
  319. package/dist/search-widget/index.d.ts +1 -2
  320. package/dist/search-widget/index.js +4 -7
  321. package/dist/search-widget-script/generated-script.js +12 -5
  322. package/dist/settings-defaults.d.ts +2 -0
  323. package/dist/settings-defaults.js +93 -0
  324. package/dist/settings.d.ts +8 -2
  325. package/dist/sidebar/index.d.ts +1 -1
  326. package/dist/sidebar/sidebar.d.ts +12 -44
  327. package/dist/sidebar/sidebar.js +4 -3
  328. package/dist/sidebar/types.d.ts +14 -0
  329. package/dist/sidebar-prepaint/index.d.ts +1 -2
  330. package/dist/sidebar-prepaint/index.js +4 -6
  331. package/dist/sidebar-resizer/sidebar-resizer-init.d.ts +2 -3
  332. package/dist/sidebar-resizer/sidebar-resizer-init.js +3 -3
  333. package/dist/sidebar-toggle-island/index.d.ts +8 -11
  334. package/dist/sidebar-toggle-island/index.js +75 -62
  335. package/dist/sidebar-tree/build-tree.js +5 -6
  336. package/dist/sidebar-tree/types.d.ts +2 -0
  337. package/dist/sidebar-tree-island/index.d.ts +4 -19
  338. package/dist/sidebar-tree-island/index.js +782 -436
  339. package/dist/sidebar-tree-island/scope-state.d.ts +38 -0
  340. package/dist/sidebar-tree-island/scope-state.js +151 -0
  341. package/dist/sidebar-tree-island/sidebar-scroll-preserve.js +6 -2
  342. package/dist/sidebar-utils/index.d.ts +17 -19
  343. package/dist/sidebar-utils/index.js +100 -3
  344. package/dist/sidebar-utils/scope.d.ts +11 -0
  345. package/dist/sidebar-utils/scope.js +67 -0
  346. package/dist/sidebar-with-defaults/index.d.ts +1 -2
  347. package/dist/sidebar-with-defaults/index.js +19 -18
  348. package/dist/site-schema/nav-tree.js +15 -15
  349. package/dist/site-schema/types.d.ts +1 -0
  350. package/dist/site-tree-nav/index.d.ts +2 -3
  351. package/dist/site-tree-nav/index.js +11 -12
  352. package/dist/site-tree-nav/normalize-island-props.d.ts +16 -0
  353. package/dist/site-tree-nav/normalize-island-props.js +122 -0
  354. package/dist/site-tree-nav-island/index.d.ts +3 -3
  355. package/dist/site-tree-nav-island/index.js +243 -144
  356. package/dist/smart-break/index.d.ts +3 -4
  357. package/dist/smart-break/index.js +1 -1
  358. package/dist/tab-item/tab-item.d.ts +3 -4
  359. package/dist/tab-item/tab-item.js +1 -1
  360. package/dist/tag-pages/index.d.ts +3 -3
  361. package/dist/tag-pages/index.js +10 -10
  362. package/dist/theme/color-scheme-provider.d.ts +3 -3
  363. package/dist/theme/color-scheme-provider.js +3 -3
  364. package/dist/theme/theme-pack-provider.d.ts +1 -1
  365. package/dist/theme/theme-pack-provider.js +3 -3
  366. package/dist/theme/theme-toggle.d.ts +2 -3
  367. package/dist/theme/theme-toggle.js +1 -1
  368. package/dist/theme-pack-dialog/index.d.ts +1 -1
  369. package/dist/theme-pack-dialog/index.js +69 -75
  370. package/dist/theme-pack-dialog/theme-pack-card.d.ts +3 -4
  371. package/dist/theme-pack-dialog/theme-pack-card.js +19 -17
  372. package/dist/theme-pack-switcher/index.d.ts +4 -5
  373. package/dist/theme-pack-switcher/index.js +52 -49
  374. package/dist/theme-toggle/index.d.ts +1 -1
  375. package/dist/theme-toggle/index.js +154 -167
  376. package/dist/theme.css +47 -121
  377. package/dist/toc/mobile-toc.d.ts +3 -5
  378. package/dist/toc/mobile-toc.js +29 -27
  379. package/dist/toc/toc.d.ts +3 -4
  380. package/dist/toc/toc.js +18 -18
  381. package/dist/toc/use-active-heading.d.ts +5 -4
  382. package/dist/toc/use-active-heading.js +36 -30
  383. package/dist/toc-prepaint/index.d.ts +1 -2
  384. package/dist/toc-prepaint/index.js +4 -6
  385. package/dist/transitions/nested-island-props-refresh.d.ts +3 -16
  386. package/dist/transitions/nested-island-props-refresh.js +133 -151
  387. package/dist/transitions/page-events.d.ts +8 -13
  388. package/dist/tree-nav-shared/index.d.ts +4 -5
  389. package/dist/tree-nav-shared/index.js +6 -7
  390. package/dist/use-modal-dialog/index.d.ts +9 -63
  391. package/dist/use-modal-dialog/index.js +41 -59
  392. package/dist/versions-page/index.d.ts +3 -3
  393. package/dist/versions-page/index.js +5 -5
  394. package/dist/wind/index.d.ts +5 -0
  395. package/dist/wind/index.js +169 -0
  396. package/dist/wind.json +498 -0
  397. package/dist/z-index-defaults/index.d.ts +4 -4
  398. package/dist/zdtp-loader.d.ts +7 -0
  399. package/dist/zdtp-loader.js +8 -0
  400. package/eject/asset-components/asset-card.tsx +14 -16
  401. package/eject/asset-components/asset-code.tsx +10 -12
  402. package/eject/asset-components/shared.tsx +5 -7
  403. package/eject/breadcrumb/breadcrumb.tsx +15 -16
  404. package/eject/code-group/index.tsx +4 -10
  405. package/eject/content-admonition/index.tsx +5 -6
  406. package/eject/desktop-sidebar-toggle-island/index.ts +4 -0
  407. package/eject/desktop-sidebar-toggle-island/island.tsx +50 -0
  408. package/eject/desktop-sidebar-toggle-island/storage.ts +27 -0
  409. package/eject/details/details.tsx +3 -5
  410. package/eject/doc-history/index.tsx +193 -179
  411. package/eject/doc-pager/index.tsx +3 -4
  412. package/eject/footer/footer.tsx +7 -9
  413. package/eject/header/header.tsx +42 -54
  414. package/eject/header/nav-overflow-script.ts +1 -1
  415. package/eject/header/types.ts +12 -13
  416. package/eject/image-enlarge/index.tsx +84 -69
  417. package/eject/image-enlarge/public.ts +2 -0
  418. package/eject/image-enlarge/ssr-fallback.tsx +7 -0
  419. package/eject/page-loading/page-loading-overlay.tsx +8 -15
  420. package/eject/sidebar/index.ts +1 -0
  421. package/eject/sidebar/sidebar.tsx +16 -97
  422. package/eject/sidebar/types.ts +15 -0
  423. package/eject/sidebar-toggle-island/index.tsx +103 -102
  424. package/eject/sidebar-tree-island/index.tsx +827 -615
  425. package/eject/sidebar-tree-island/scope-state.ts +154 -0
  426. package/eject/sidebar-tree-island/sidebar-scroll-preserve.ts +8 -2
  427. package/eject/site-tree-nav-island/index.tsx +349 -222
  428. package/eject/tab-item/tab-item.tsx +2 -4
  429. package/eject/theme-toggle/hydration-pending.ts +6 -10
  430. package/eject/theme-toggle/index.tsx +133 -173
  431. package/eject/toc/mobile-toc.tsx +27 -31
  432. package/eject/toc/toc.tsx +21 -24
  433. package/eject/toc/use-active-heading.ts +43 -38
  434. package/package.json +40 -22
  435. package/routes-src/404.tsx +2 -3
  436. package/routes-src/_chrome.tsx +7 -2
  437. package/routes-src/_design-token-panel-bootstrap.tsx +1 -63
  438. package/routes-src/docs-slug.tsx +2 -3
  439. package/routes-src/docs-tags-index.tsx +2 -3
  440. package/routes-src/docs-tags-tag.tsx +2 -3
  441. package/routes-src/docs-versions.tsx +2 -3
  442. package/routes-src/files-path.tsx +2 -4
  443. package/routes-src/index.tsx +2 -3
  444. package/routes-src/locale-docs-slug.tsx +2 -3
  445. package/routes-src/locale-docs-tags-index.tsx +2 -3
  446. package/routes-src/locale-docs-tags-tag.tsx +2 -3
  447. package/routes-src/locale-docs-versions.tsx +2 -3
  448. package/routes-src/locale-files-path.tsx +2 -4
  449. package/routes-src/locale-index.tsx +2 -3
  450. package/routes-src/mcp.tsx +25 -0
  451. package/routes-src/v-docs-slug.tsx +2 -3
  452. package/routes-src/v-locale-docs-slug.tsx +2 -3
  453. package/tsconfig.base.json +1 -1
  454. package/dist/safelist.css +0 -2
  455. package/dist/theme-no-reset.css +0 -379
  456. package/eject/desktop-sidebar-toggle-island/index.tsx +0 -110
@@ -1,3 +1,4 @@
1
+ import { parseFragment } from "parse5";
1
2
  const SLUGIFY_STRIPPED = new Set(
2
3
  "!\"#$%&'()*+,./:;<=>?@[\\]^`{|}~".split("")
3
4
  );
@@ -84,7 +85,33 @@ function stripInlineMarkdown(raw) {
84
85
  masked += raw[i];
85
86
  i++;
86
87
  }
87
- return masked.replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/(?<![A-Za-z0-9])__([^_]+)__(?![A-Za-z0-9])/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/(?<![A-Za-z0-9])_([^_]+)_(?![A-Za-z0-9])/g, "$1").replace(/\uE000(\d+)\uE001/g, (_match, index) => protectedText[Number(index)] ?? "").trim();
88
+ return masked.replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/(?<![A-Za-z0-9])__([^_]+)__(?![A-Za-z0-9])/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/(?<![A-Za-z0-9])_([^_]+)_(?![A-Za-z0-9])/g, "$1").replace(/&#(?:[0-9]{1,7}|[xX][0-9a-fA-F]{1,6});|&[A-Za-z][A-Za-z0-9]{1,31};/g, decodeCharacterReference).replace(/\uE000(\d+)\uE001/g, (_match, index) => protectedText[Number(index)] ?? "").trim();
89
+ }
90
+ function decodeCharacterReference(reference) {
91
+ if (reference.startsWith("&#")) {
92
+ const hex = reference[2]?.toLowerCase() === "x";
93
+ const value = Number.parseInt(reference.slice(hex ? 3 : 2, -1), hex ? 16 : 10);
94
+ if (value === 0 || value > 1114111 || value >= 55296 && value <= 57343 || value < 32 && ![9, 10, 13].includes(value) || value >= 127 && value <= 159) {
95
+ return "\uFFFD";
96
+ }
97
+ return String.fromCodePoint(value);
98
+ }
99
+ let invalid = false;
100
+ const fragment = parseFragment(reference, { onParseError: () => {
101
+ invalid = true;
102
+ } });
103
+ if (invalid) return reference;
104
+ return fragment.childNodes.map((node) => node.nodeName === "#text" && "value" in node ? node.value : "").join("");
105
+ }
106
+ function openingFence(line) {
107
+ const match = /^ {0,3}(`{3,}|~{3,})(.*)$/.exec(line);
108
+ if (!match || match[1]?.startsWith("`") && match[2]?.includes("`")) return null;
109
+ return match[1] ?? null;
110
+ }
111
+ function closesFence(line, opener) {
112
+ const match = /^ {0,3}(`{3,}|~{3,})[ \t\r]*$/.exec(line);
113
+ const run = match?.[1];
114
+ return run !== void 0 && run[0] === opener[0] && run.length >= opener.length;
88
115
  }
89
116
  function resolveDepthWindow(rawMin, rawMax) {
90
117
  const min = Math.trunc(Number(rawMin));
@@ -111,7 +138,7 @@ function collectHeadings(body, lo, hi) {
111
138
  const candidate = classifyLines(lines);
112
139
  for (const [index, line] of lines.entries()) {
113
140
  if (candidate[index] !== true) continue;
114
- const match = /^(#{2,6})[ \t]+(.+)$/.exec(line.trim());
141
+ const match = /^ {0,3}(#{2,6})[ \t]+(.+)$/.exec(line);
115
142
  if (!match) continue;
116
143
  const hashes = match[1];
117
144
  const rawText = match[2];
@@ -133,7 +160,7 @@ function findCodeSpanEnd(lines, from, runLength) {
133
160
  for (let lineIndex = from; lineIndex < lines.length; lineIndex++) {
134
161
  const line = lines[lineIndex] ?? "";
135
162
  const trimmed = line.trimStart();
136
- if (trimmed.trim() === "" || ATX_HEADING.test(trimmed) || /^(?:`{3,}|~{3,})/.test(trimmed)) {
163
+ if (trimmed.trim() === "" || ATX_HEADING.test(trimmed) || openingFence(line) !== null) {
137
164
  return null;
138
165
  }
139
166
  for (const match of line.matchAll(/`+/g)) {
@@ -176,18 +203,22 @@ function scanLines(lines, ignoredOpeners) {
176
203
  } else if (exprDepth > 0 || tag !== null) {
177
204
  candidate.push(false);
178
205
  } else {
179
- const fence = /^([`~]{3,})/.exec(trimmed)?.[1];
180
- if (fence !== void 0) {
181
- if (codeFenceOpener === null) {
182
- codeFenceOpener = fence;
183
- } else if (fence[0] === codeFenceOpener[0] && fence.length >= codeFenceOpener.length) {
184
- codeFenceOpener = null;
185
- }
206
+ if (codeFenceOpener !== null) {
207
+ if (closesFence(line, codeFenceOpener)) codeFenceOpener = null;
208
+ candidate.push(false);
209
+ continue;
210
+ }
211
+ const fence = openingFence(line);
212
+ if (fence !== null) {
213
+ codeFenceOpener = fence;
214
+ candidate.push(false);
215
+ continue;
216
+ }
217
+ if (/^(?: {4}| *\t)/.test(line)) {
186
218
  candidate.push(false);
187
219
  continue;
188
220
  }
189
- candidate.push(codeFenceOpener === null);
190
- if (codeFenceOpener !== null) continue;
221
+ candidate.push(true);
191
222
  }
192
223
  for (let i = start; i < line.length; i++) {
193
224
  const ch = line[i] ?? "";
@@ -1,3 +1,4 @@
1
+ import type { Child, Component } from "@takazudo/zfb/zudo-react";
1
2
  import type { LocaleConfig, Settings } from "../settings.js";
2
3
  import type { AssetManifest, ColorScheme, ThemePackRegistry } from "../route-context-payload/types.js";
3
4
  import type { UrlHelpers } from "../url-helpers/index.js";
@@ -43,9 +44,10 @@ export interface FactoryI18n {
43
44
  * reason and a CLAUDE.md entry. All slots are optional so a factory takes only
44
45
  * the ones it needs.
45
46
  *
46
- * Components are typed as the structural `FactoryComponent` (a function
47
- * returning Preact-renderable output) rather than a concrete signature, so the
48
- * type stays node-free and Preact-version-agnostic at the boundary.
47
+ * Components are typed as the structural `FactoryComponent` (a
48
+ * `Component<Record<string, unknown>>`) rather than a concrete signature, so
49
+ * the type stays node-free at the boundary while using zfb's component and
50
+ * child contract.
49
51
  */
50
52
  export interface FactoryComponents {
51
53
  /** Locale-aware category nav wrapper (reads the project's content collection). */
@@ -63,8 +65,8 @@ export interface FactoryComponents {
63
65
  /** PresetGenerator SSR shell (showcase-only; downstream projects stub it). */
64
66
  PresetGenerator?: FactoryComponent;
65
67
  }
66
- /** Any Preact-renderable component — a function returning a VNode/children. */
67
- export type FactoryComponent = (props: Record<string, unknown>) => unknown;
68
+ /** A component receiving the broad props shape used by chrome factories. */
69
+ export type FactoryComponent = Component<Record<string, unknown>>;
68
70
  /**
69
71
  * Opaque per-locale nav-source handle. The host owns the actual content-loader
70
72
  * implementation (it reads project content collections, which cannot live in the
@@ -230,20 +232,21 @@ export interface ChromeHostBindings {
230
232
  /** Body-end islands (bootstrap islands). Default: the package-island subset
231
233
  * derived from `settings` (no host-only client-router / token-panel boots). */
232
234
  BodyEndIslands?: FactoryComponent;
233
- /** DocHistory island. Default: a no-op stub rendering an empty fragment. */
235
+ /** DocHistory server boundary. Default: a no-op stub rendering an empty fragment.
236
+ * Use DocHistoryBoundary from the doc-history-area entrypoint for the package
237
+ * client. Custom boundaries consume ssrFallback server-side and wrap their
238
+ * statically imported client target in a Fragment-wrapped Island. */
234
239
  DocHistory?: FactoryComponent;
235
240
  /**
236
- * Design-token panel bootstrap island (#2658). Default: the PACKAGE-DEFAULT
237
- * `DesignTokenPanelBootstrap` from
238
- * `@takazudo/zudo-doc/design-token-panel-bootstrap`, statically imported by
239
- * `chrome/derive.tsx` (`deriveBodyEndIslands`) so EVERY `createChrome`
240
- * consumer — the injected `routes/_chrome.tsx` path and the locked-manifest
241
- * self-contained doc stub alike — gets the settings-gated panel island with
242
- * no explicit wiring (#2659 gate-2 fix; scanner reachability holds through
243
- * the static route → chrome → derive → bootstrap chain, the #2480
244
- * contract). Supply this slot only to REPLACE the island with a host's own
245
- * bootstrap component. Mounting is still gated on
246
- * `settings.designTokenPanel` inside `createBodyEndIslands` either way.
241
+ * Zero-prop server boundary for the design-token-panel bootstrap. Return a
242
+ * Fragment containing Island({ when: "load", children: <HostBootstrap /> })
243
+ * with a statically imported client target; a raw client component is not
244
+ * a boundary. The package default owns the same fixed-target shape.
245
+ * The package controls settings.designTokenPanel and the toggle shim; it
246
+ * renders this boundary unchanged and never wraps a dynamic Island target.
247
+ * An explicit host boundary wins over configured-route and package defaults,
248
+ * including when designTokenPanelConfigModule suppresses the package default.
249
+ * With designTokenPanel disabled neither this boundary nor the shim mounts.
247
250
  */
248
251
  DesignTokenPanelBootstrap?: FactoryComponent;
249
252
  /** MDX content-component overrides (Details / HtmlPreview / Island /
@@ -264,7 +267,7 @@ export interface ChromeHostBindings {
264
267
  locale: string;
265
268
  isFallback?: boolean;
266
269
  version?: string;
267
- }) => unknown;
270
+ }) => Child;
268
271
  /**
269
272
  * Extra content rendered in the home hero. A RENDERER (not a component).
270
273
  * Default: absent → renders nothing. The `/` home route is never injected
@@ -274,7 +277,7 @@ export interface ChromeHostBindings {
274
277
  */
275
278
  homeExtras?: (args: {
276
279
  locale: string;
277
- }) => unknown;
280
+ }) => Child;
278
281
  }
279
282
  /**
280
283
  * The unified chrome context — the superset that fully wires the page chrome:
package/dist/features.css CHANGED
@@ -3,15 +3,17 @@
3
3
  *
4
4
  * Shipped to consumers as `@takazudo/zudo-doc/features.css` (copied to
5
5
  * `dist/features.css` by scripts/copy-features-css.mjs on build). Provides
6
- * feature CSS that is NOT coupled to a specific Preact island — it is shared
6
+ * feature CSS that is NOT coupled to a specific island — it is shared
7
7
  * across all projects that use @takazudo/zudo-doc regardless of which islands
8
8
  * are active. See zudolab/zudo-doc#2331.
9
9
  *
10
10
  * ── Consumer contract ──────────────────────────────────────────────────────
11
- * The consumer's @theme MUST define the custom properties consumed below:
11
+ * The custom properties consumed below are plain `:root` variables supplied by
12
+ * the zudoDoc() token defaults (`@takazudo/zudo-doc/theme.css`); override them
13
+ * in a `:root` rule after the imports. No consumer `@theme` is involved:
12
14
  * --color-{bg,fg,muted,accent,surface,code-bg,code-fg,success,warning,
13
15
  * matched-keyword-bg,matched-keyword-fg}
14
- * --spacing-{hsp-sm,hsp-2xs,hsp-lg,hsp-md,hsp-xl,vsp-xs,vsp-2xs,vsp-md,vsp-lg,
16
+ * --spacing-{hsp-sm,hsp-2xs,hsp-lg,hsp-md,hsp-xl,vsp-xs,vsp-2xs,vsp-sm,vsp-md,vsp-lg,
15
17
  * icon-sm}
16
18
  * --z-index-{local-1,local-2}
17
19
  * --z-index-toolbar
@@ -27,8 +29,7 @@
27
29
  * --zd-transition-slow
28
30
  * --zd-transition-slower
29
31
  * --default-transition-duration
30
- * All of these are defined by the project's @theme block (which is a
31
- * pre-condition before @importing this file).
32
+ * Import `theme.css` before this file so the defaults are defined.
32
33
  * ─────────────────────────────────────────────────────────────────────────── */
33
34
 
34
35
  /* ========================================
@@ -1001,11 +1002,11 @@ dialog.zd-mermaid-dialog::backdrop {
1001
1002
  *
1002
1003
  * The `body { font-family }` rule below is the CHROME FONT SEAM (#2887): it is
1003
1004
  * why a theme pack's `--font-sans` reaches the header/sidebar/TOC/footer at all.
1004
- * Those surfaces set no font-family of their own, and preflight's `html, :host`
1005
+ * Those surfaces set no font-family of their own, and the reset's `html, :host`
1005
1006
  * rule compiles to a hardcoded literal stack here (no `--default-font-family` is
1006
1007
  * ever defined), so without this rule the token could only ever reach `.zd-content`
1007
- * prose. It works because this block is UNLAYERED and preflight is imported into
1008
- * `layer(zd-preflight)` — see component-tokens.ts for the full rationale.
1008
+ * prose. It works because this block is UNLAYERED and the reset lives in
1009
+ * `@layer zw-reset` — see component-tokens.ts for the full rationale.
1009
1010
  * ========================================================================== */
1010
1011
 
1011
1012
  /* BEGIN --zdc-* chrome component tokens (generated by gen-component-tokens; do not edit by hand) */
@@ -1284,3 +1285,64 @@ html[data-asset-details-hidden]
1284
1285
  [data-zd-asset-tree] details[open] > summary > svg:nth-child(2) {
1285
1286
  display: none;
1286
1287
  }
1288
+
1289
+ /* zfb 3 wind does not compile these relation selectors or effect families.
1290
+ * Keep the component-owned rules unlayered, alongside Tailwind v4 utilities. */
1291
+ .zd-footer-copyright-links a {
1292
+ text-decoration-line: underline;
1293
+ }
1294
+ .zd-footer-copyright-links a:hover,
1295
+ .zd-footer-copyright-links a:focus-visible {
1296
+ color: var(--color-accent);
1297
+ }
1298
+
1299
+ .zd-hide-details-marker::-webkit-details-marker {
1300
+ display: none;
1301
+ }
1302
+
1303
+ .zd-list-items-no-margin li,
1304
+ .zd-breadcrumb-nav-no-margin nav {
1305
+ margin-bottom: 0;
1306
+ }
1307
+
1308
+ .zd-card-links-interactive a {
1309
+ pointer-events: auto;
1310
+ }
1311
+
1312
+ .zd-wrap-anywhere {
1313
+ overflow-wrap: anywhere;
1314
+ }
1315
+
1316
+ /* Search rows own their padding; idle and status content need the same inset. */
1317
+ site-search [data-search-results] > :is([data-search-placeholder], p) {
1318
+ padding-top: var(--spacing-vsp-sm);
1319
+ }
1320
+
1321
+ .zd-search-excerpt-decoration {
1322
+ text-decoration-color: var(--color-muted);
1323
+ }
1324
+
1325
+ .zd-preview-shadow {
1326
+ /* Preserve Tailwind's four transparent shadow layers in computed styles. */
1327
+ box-shadow:
1328
+ 0 0 #0000,
1329
+ 0 0 #0000,
1330
+ 0 0 #0000,
1331
+ 0 0 #0000,
1332
+ 0 1px 3px var(--color-fg);
1333
+ }
1334
+
1335
+ @supports (color: color-mix(in lab, red, red)) {
1336
+ .zd-preview-shadow {
1337
+ box-shadow:
1338
+ 0 0 #0000,
1339
+ 0 0 #0000,
1340
+ 0 0 #0000,
1341
+ 0 0 #0000,
1342
+ 0 1px 3px color-mix(in srgb, var(--color-fg) 8%, transparent);
1343
+ }
1344
+ }
1345
+
1346
+ .zd-theme-pack-active-ring {
1347
+ box-shadow: 0 0 0 2px var(--color-accent);
1348
+ }
@@ -1,9 +1,11 @@
1
+ /** @jsxRuntime automatic */
2
+ import { type ReadonlySignal } from "@takazudo/zfb/zudo-react";
1
3
  import type { FindInPage } from "./find-in-page.js";
2
4
  interface FindBarProps {
3
- visible: boolean;
5
+ visible: ReadonlySignal<boolean>;
4
6
  onClose: () => void;
5
7
  findInPage: FindInPage;
6
8
  containerSelector: string;
7
9
  }
8
- export declare function FindBar({ visible, onClose, findInPage, containerSelector }: FindBarProps): import("preact").JSX.Element | null;
10
+ export declare function FindBar({ visible, onClose, findInPage, containerSelector }: FindBarProps): import("@takazudo/zfb").Description;
9
11
  export {};
@@ -1,84 +1,74 @@
1
- "use client";
2
- import { jsx, jsxs } from "preact/jsx-runtime";
3
- import { useState, useRef, useEffect, useCallback } from "preact/hooks";
1
+ import { jsx, jsxs } from "@takazudo/zfb/zudo-react/jsx-runtime";
2
+ import {
3
+ computed,
4
+ getScope,
5
+ Show,
6
+ signal
7
+ } from "@takazudo/zfb/zudo-react";
4
8
  function toMatchInfo(result) {
5
9
  return result.matches > 0 ? result : null;
6
10
  }
7
11
  function FindBar({ visible, onClose, findInPage, containerSelector }) {
8
- const [query, setQuery] = useState("");
9
- const [matchInfo, setMatchInfo] = useState(null);
10
- const inputRef = useRef(null);
11
- const findInPageRef = useRef(findInPage);
12
- useEffect(() => {
13
- findInPageRef.current = findInPage;
14
- }, [findInPage]);
15
- useEffect(() => {
16
- if (visible) {
17
- inputRef.current?.focus();
18
- inputRef.current?.select();
12
+ const query = signal("");
13
+ const matchInfo = signal(null);
14
+ const inputRef = { current: null };
15
+ const scope = getScope();
16
+ scope.effect(() => {
17
+ if (!visible.value) {
18
+ query.value = "";
19
+ matchInfo.value = null;
20
+ findInPage.stop();
21
+ return;
19
22
  }
20
- }, [visible]);
21
- useEffect(() => {
22
- if (!visible) {
23
- setQuery("");
24
- setMatchInfo(null);
25
- findInPageRef.current.stop();
23
+ const text = query.value;
24
+ const container = document.querySelector(containerSelector);
25
+ if (!text || !(container instanceof HTMLElement)) {
26
+ matchInfo.value = null;
27
+ findInPage.stop();
28
+ return;
26
29
  }
27
- }, [visible]);
28
- const handleFind = useCallback(
29
- (text) => {
30
- const container = document.querySelector(containerSelector);
31
- if (!text || !(container instanceof HTMLElement)) {
32
- setMatchInfo(null);
33
- findInPage.stop();
34
- return;
35
- }
36
- const result = findInPage.find(container, text);
37
- setMatchInfo(toMatchInfo(result));
38
- },
39
- [findInPage, containerSelector]
40
- );
41
- const handleKeyDown = useCallback(
42
- // Plain DOM `KeyboardEvent` — matches the ai-chat-modal onKeyDown
43
- // precedent (`../ai-chat-modal/index.tsx`); Preact's JSX
44
- // `onKeyDown` prop accepts it directly, no React-namespace type needed.
45
- (e) => {
46
- if (e.key === "Escape") {
47
- onClose();
48
- } else if (e.key === "Enter") {
49
- const result = e.shiftKey ? findInPage.prev() : findInPage.next();
50
- setMatchInfo(toMatchInfo(result));
51
- }
52
- },
53
- [onClose, findInPage]
54
- );
55
- if (!visible) return null;
56
- return /* @__PURE__ */ jsxs("div", { className: "fixed top-[3.5rem] right-0 z-dropdown flex items-center gap-hsp-sm py-hsp-xs px-hsp-md bg-surface border-b border-l border-muted rounded-bl-lg shadow-md", children: [
30
+ matchInfo.value = toMatchInfo(findInPage.find(container, text));
31
+ });
32
+ scope.effect(() => {
33
+ if (!visible.value) return;
34
+ inputRef.current?.focus();
35
+ inputRef.current?.select();
36
+ });
37
+ scope.onCleanup(() => findInPage.stop());
38
+ const handleKeyDown = (event) => {
39
+ const keyboard = event;
40
+ if (keyboard.isComposing || event.defaultPrevented) return;
41
+ if (keyboard.key === "Escape") {
42
+ onClose();
43
+ } else if (keyboard.key === "Enter") {
44
+ const result = keyboard.shiftKey ? findInPage.prev() : findInPage.next();
45
+ matchInfo.value = toMatchInfo(result);
46
+ }
47
+ };
48
+ return /* @__PURE__ */ jsx(Show, { when: computed(() => visible.value), children: () => /* @__PURE__ */ jsxs("div", { class: "fixed top-[3.5rem] right-0 z-dropdown flex items-center gap-hsp-sm py-hsp-xs px-hsp-md bg-surface border-b border-l border-muted rounded-bl-lg", children: [
57
49
  /* @__PURE__ */ jsx(
58
50
  "input",
59
51
  {
60
52
  ref: inputRef,
61
- className: "w-[12rem] py-[4px] px-hsp-sm rounded text-small bg-bg border border-muted text-fg outline-none focus:border-accent",
53
+ class: "w-[12rem] py-[4px] px-hsp-sm rounded text-small bg-bg border border-muted text-fg outline-none focus:border-accent",
62
54
  type: "text",
63
- value: query,
55
+ modelValue: query,
64
56
  placeholder: "Find in page...",
65
57
  "aria-label": "Find in page",
66
- onChange: (e) => {
67
- setQuery(e.currentTarget.value);
68
- handleFind(e.currentTarget.value);
69
- },
70
- onKeyDown: handleKeyDown
58
+ "on:keydown": handleKeyDown
71
59
  }
72
60
  ),
73
- /* @__PURE__ */ jsx("span", { className: "text-caption whitespace-nowrap min-w-[3rem] text-center text-fg/60", children: matchInfo ? `${matchInfo.activeMatchOrdinal}/${matchInfo.matches}` : "" }),
61
+ /* @__PURE__ */ jsx("span", { class: "text-caption whitespace-nowrap min-w-[3rem] text-center text-fg/60", children: computed(() => {
62
+ const result = matchInfo.value;
63
+ return result ? `${result.activeMatchOrdinal}/${result.matches}` : "";
64
+ }) }),
74
65
  /* @__PURE__ */ jsx(
75
66
  "button",
76
67
  {
77
68
  type: "button",
78
- className: "py-hsp-2xs px-hsp-sm rounded text-caption bg-bg border border-muted text-fg hover:bg-surface",
79
- onClick: () => {
80
- const result = findInPage.prev();
81
- setMatchInfo(toMatchInfo(result));
69
+ class: "py-hsp-2xs px-hsp-sm rounded text-caption bg-bg border border-muted text-fg hover:bg-surface",
70
+ "on:click": () => {
71
+ matchInfo.value = toMatchInfo(findInPage.prev());
82
72
  },
83
73
  title: "Previous (Shift+Enter)",
84
74
  children: "Prev"
@@ -88,10 +78,9 @@ function FindBar({ visible, onClose, findInPage, containerSelector }) {
88
78
  "button",
89
79
  {
90
80
  type: "button",
91
- className: "py-hsp-2xs px-hsp-sm rounded text-caption bg-bg border border-muted text-fg hover:bg-surface",
92
- onClick: () => {
93
- const result = findInPage.next();
94
- setMatchInfo(toMatchInfo(result));
81
+ class: "py-hsp-2xs px-hsp-sm rounded text-caption bg-bg border border-muted text-fg hover:bg-surface",
82
+ "on:click": () => {
83
+ matchInfo.value = toMatchInfo(findInPage.next());
95
84
  },
96
85
  title: "Next (Enter)",
97
86
  children: "Next"
@@ -101,13 +90,13 @@ function FindBar({ visible, onClose, findInPage, containerSelector }) {
101
90
  "button",
102
91
  {
103
92
  type: "button",
104
- className: "py-hsp-2xs px-hsp-sm rounded text-caption bg-bg border border-muted text-fg hover:bg-surface",
105
- onClick: onClose,
93
+ class: "py-hsp-2xs px-hsp-sm rounded text-caption bg-bg border border-muted text-fg hover:bg-surface",
94
+ "on:click": onClose,
106
95
  title: "Close (Esc)",
107
96
  children: "Close"
108
97
  }
109
98
  )
110
- ] });
99
+ ] }) });
111
100
  }
112
101
  export {
113
102
  FindBar
@@ -1,11 +1,5 @@
1
- import type { JSX } from "preact";
2
- /**
3
- * `displayName` pinned explicitly (matching
4
- * `AiChatModal`/`ImageEnlarge`/`MermaidEnlarge`/`DesignTokenPanelBootstrap`)
5
- * so zfb's `captureComponentName` emits a stable
6
- * `data-zfb-island="FindInPageInit"` marker independent of minification.
7
- */
8
- export declare function FindInPageInit(): JSX.Element | null;
1
+ import type { JSX } from "@takazudo/zfb/zudo-react/jsx-runtime";
2
+ export declare function FindInPageInit(): JSX.Element;
9
3
  export declare namespace FindInPageInit {
10
4
  var displayName: string;
11
5
  }
@@ -1,47 +1,50 @@
1
1
  "use client";
2
- import { jsx } from "preact/jsx-runtime";
3
- import { useState, useEffect, useRef } from "preact/compat";
2
+ import { jsx } from "@takazudo/zfb/zudo-react/jsx-runtime";
3
+ import { computed, getScope, Show, signal } from "@takazudo/zfb/zudo-react";
4
4
  import { FindBar } from "./find-bar.js";
5
5
  import { createFindInPage } from "./find-in-page.js";
6
6
  const CONTENT_SELECTOR = "article.zd-content";
7
+ const BEFORE_PREPARATION_EVENT = "zfb:before-preparation";
7
8
  function FindInPageInit() {
8
- const [isTauri, setIsTauri] = useState(false);
9
- const [visible, setVisible] = useState(false);
10
- const findInPageRef = useRef(createFindInPage());
11
- useEffect(() => {
12
- if (typeof window !== "undefined" && "__TAURI_INTERNALS__" in window) {
13
- setIsTauri(true);
9
+ const isTauri = signal(false);
10
+ const visible = signal(false);
11
+ const findInPage = createFindInPage();
12
+ const scope = getScope();
13
+ scope.onActivate(() => {
14
+ if (typeof window === "undefined" || !("__TAURI_INTERNALS__" in window)) {
15
+ return;
14
16
  }
15
- }, []);
16
- useEffect(() => {
17
- if (!isTauri) return;
18
- const handler = (e) => {
19
- if ((e.metaKey || e.ctrlKey) && e.key === "f") {
20
- e.preventDefault();
21
- setVisible((prev) => !prev);
17
+ isTauri.value = true;
18
+ const handleKeyDown = (event) => {
19
+ const keyboard = event;
20
+ if (keyboard.isComposing || event.defaultPrevented || !(keyboard.metaKey || keyboard.ctrlKey) || keyboard.key !== "f") {
21
+ return;
22
22
  }
23
+ event.preventDefault();
24
+ visible.value = !visible.value;
23
25
  };
24
- document.addEventListener("keydown", handler);
25
- return () => document.removeEventListener("keydown", handler);
26
- }, [isTauri]);
27
- useEffect(() => {
28
- const handler = () => {
29
- findInPageRef.current.stop();
30
- setVisible(false);
26
+ const handleBeforePreparation = () => {
27
+ findInPage.stop();
28
+ visible.value = false;
31
29
  };
32
- document.addEventListener("zfb:before-preparation", handler);
33
- return () => document.removeEventListener("zfb:before-preparation", handler);
34
- }, []);
35
- if (!isTauri) return null;
36
- return /* @__PURE__ */ jsx(
30
+ document.addEventListener("keydown", handleKeyDown);
31
+ document.addEventListener(BEFORE_PREPARATION_EVENT, handleBeforePreparation);
32
+ return () => {
33
+ document.removeEventListener("keydown", handleKeyDown);
34
+ document.removeEventListener(BEFORE_PREPARATION_EVENT, handleBeforePreparation);
35
+ };
36
+ });
37
+ return /* @__PURE__ */ jsx(Show, { when: computed(() => isTauri.value), children: () => /* @__PURE__ */ jsx(
37
38
  FindBar,
38
39
  {
39
40
  visible,
40
- onClose: () => setVisible(false),
41
- findInPage: findInPageRef.current,
41
+ onClose: () => {
42
+ visible.value = false;
43
+ },
44
+ findInPage,
42
45
  containerSelector: CONTENT_SELECTOR
43
46
  }
44
- );
47
+ ) });
45
48
  }
46
49
  FindInPageInit.displayName = "FindInPageInit";
47
50
  export {
@@ -1,6 +1,5 @@
1
1
  /** @jsxRuntime automatic */
2
- /** @jsxImportSource preact */
3
- import type { VNode } from "preact";
2
+ import type { Child } from "@takazudo/zfb/zudo-react";
4
3
  import type { FooterLinkColumn, FooterTagColumn } from "./types.js";
5
4
  export interface FooterProps {
6
5
  /**
@@ -15,7 +14,7 @@ export interface FooterProps {
15
14
  */
16
15
  tagColumns?: FooterTagColumn[];
17
16
  /**
18
- * Copyright HTML. Rendered via `dangerouslySetInnerHTML` so embedded
17
+ * Copyright HTML. Rendered via `rawHtml` so embedded
19
18
  * anchors work. The caller is responsible for the contents.
20
19
  */
21
20
  copyright?: string;
@@ -35,4 +34,4 @@ export interface FooterProps {
35
34
  * configured. The inner content (link grid, copyright) is only emitted
36
35
  * when the respective slots carry data.
37
36
  */
38
- export declare function Footer(props: FooterProps): VNode;
37
+ export declare function Footer(props: FooterProps): Child;
@@ -1,4 +1,4 @@
1
- import { jsx, jsxs } from "preact/jsx-runtime";
1
+ import { jsx, jsxs } from "@takazudo/zfb/zudo-react/jsx-runtime";
2
2
  function Footer(props) {
3
3
  const linkColumns = props.linkColumns ?? [];
4
4
  const tagColumns = props.tagColumns ?? [];
@@ -6,7 +6,7 @@ function Footer(props) {
6
6
  const persistKey = props.persistKey;
7
7
  const hasColumns = linkColumns.length > 0 || tagColumns.length > 0;
8
8
  const hasCopyright = copyright.length > 0;
9
- const copyrightClass = hasColumns ? "text-center text-caption text-muted [&_a]:underline [&_a:hover]:text-accent [&_a:focus-visible]:text-accent mt-vsp-lg border-t border-muted pt-vsp-md" : "text-center text-caption text-muted [&_a]:underline [&_a:hover]:text-accent [&_a:focus-visible]:text-accent";
9
+ const copyrightClass = hasColumns ? "text-center text-caption text-muted zd-footer-copyright-links mt-vsp-lg border-t border-muted pt-vsp-md" : "text-center text-caption text-muted zd-footer-copyright-links";
10
10
  return /* @__PURE__ */ jsx(
11
11
  "footer",
12
12
  {
@@ -68,7 +68,7 @@ function Footer(props) {
68
68
  "div",
69
69
  {
70
70
  class: copyrightClass,
71
- dangerouslySetInnerHTML: { __html: copyright }
71
+ rawHtml: copyright
72
72
  }
73
73
  )
74
74
  ] })
@@ -1,6 +1,5 @@
1
1
  /** @jsxRuntime automatic */
2
- /** @jsxImportSource preact */
3
- import type { VNode } from "preact";
2
+ import type { Child } from "@takazudo/zfb/zudo-react";
4
3
  import type { ChromeContext } from "../factory-context/index.js";
5
4
  import type { Settings } from "../settings.js";
6
5
  /** Tag info returned by the host's `collectTags` (what the factory sees). */
@@ -59,4 +58,4 @@ export interface FooterWithDefaultsSettings {
59
58
  */
60
59
  export declare function createFooterWithDefaults<S extends Settings = Settings>(ctx: ChromeContext<S>): (props: {
61
60
  lang?: string;
62
- }) => VNode;
61
+ }) => Child;
@@ -1,4 +1,4 @@
1
- import { jsx } from "preact/jsx-runtime";
1
+ import { jsx } from "@takazudo/zfb/zudo-react/jsx-runtime";
2
2
  import { Footer } from "../footer/index.js";
3
3
  import { assertChromeContext } from "../chrome/assert-chrome-context.js";
4
4
  function createFooterWithDefaults(ctx) {
@@ -4,6 +4,7 @@ const defaultFrontmatterPreviewIgnoreKeys = [
4
4
  "category",
5
5
  "sidebar_position",
6
6
  "sidebar_label",
7
+ "sidebar_initial_expansion",
7
8
  "tags",
8
9
  "search_exclude",
9
10
  "pagination_next",
@@ -1,4 +1,4 @@
1
- import type { JSX } from "preact";
1
+ import type { JSX } from "@takazudo/zfb/zudo-react/jsx-runtime";
2
2
  import type { HeadProps } from "./types.js";
3
3
  /**
4
4
  * Framework head tag emission. Renders only the meta-tag layer of <head>;