@publish.os/nextjs 0.0.1-alpha.2 → 0.0.1-alpha.4
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.
- package/README.md +3 -9
- package/dist/cache/tags.cjs +3 -0
- package/dist/cache/tags.d.cts +1 -0
- package/dist/cache/tags.d.ts +1 -0
- package/dist/cache/tags.js +3 -0
- package/dist/config.cjs +78 -0
- package/dist/config.d.cts +101 -0
- package/dist/config.d.ts +101 -0
- package/dist/config.js +48 -0
- package/dist/index.cjs +1043 -124
- package/dist/index.d.cts +11 -7
- package/dist/index.d.ts +11 -7
- package/dist/index.js +1031 -111
- package/dist/kernel/components/blocks/AgentActions.cjs +425 -0
- package/dist/kernel/components/blocks/AgentActions.d.cts +52 -0
- package/dist/kernel/components/blocks/AgentActions.d.ts +52 -0
- package/dist/kernel/components/blocks/AgentActions.js +429 -0
- package/dist/kernel/components/blocks/animated-icon-swap.cjs +101 -0
- package/dist/kernel/components/blocks/animated-icon-swap.d.cts +16 -0
- package/dist/kernel/components/blocks/animated-icon-swap.d.ts +16 -0
- package/dist/kernel/components/blocks/animated-icon-swap.js +74 -0
- package/dist/kernel/components/blocks/color-palette.cjs +413 -0
- package/dist/kernel/components/blocks/color-palette.d.cts +7 -0
- package/dist/kernel/components/blocks/color-palette.d.ts +7 -0
- package/dist/kernel/components/blocks/color-palette.js +407 -0
- package/dist/kernel/components/blocks/design-system-preview.cjs +592 -0
- package/dist/kernel/components/blocks/design-system-preview.d.cts +29 -0
- package/dist/kernel/components/blocks/design-system-preview.d.ts +29 -0
- package/dist/kernel/components/blocks/design-system-preview.js +655 -0
- package/dist/kernel/components/blocks/link-playground.cjs +816 -0
- package/dist/kernel/components/blocks/link-playground.d.cts +5 -0
- package/dist/kernel/components/blocks/link-playground.d.ts +5 -0
- package/dist/kernel/components/blocks/link-playground.js +792 -0
- package/dist/kernel/components/blocks/logo-block.cjs +156 -0
- package/dist/kernel/components/blocks/logo-block.d.cts +21 -0
- package/dist/kernel/components/blocks/logo-block.d.ts +21 -0
- package/dist/kernel/components/blocks/logo-block.js +129 -0
- package/dist/{components → kernel/components/blocks}/nav-breadcrumb.cjs +19 -38
- package/dist/kernel/components/blocks/nav-breadcrumb.d.cts +11 -0
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +11 -0
- package/dist/{components → kernel/components/blocks}/nav-breadcrumb.js +22 -30
- package/dist/kernel/components/blocks/navbar.cjs +154 -0
- package/dist/kernel/components/blocks/navbar.d.cts +16 -0
- package/dist/kernel/components/blocks/navbar.d.ts +16 -0
- package/dist/kernel/components/blocks/navbar.js +122 -0
- package/dist/kernel/components/blocks/navigation-progress-playground.cjs +735 -0
- package/dist/kernel/components/blocks/navigation-progress-playground.d.cts +5 -0
- package/dist/kernel/components/blocks/navigation-progress-playground.d.ts +5 -0
- package/dist/kernel/components/blocks/navigation-progress-playground.js +722 -0
- package/dist/kernel/components/blocks/navigation-progress.cjs +270 -0
- package/dist/kernel/components/blocks/navigation-progress.d.cts +16 -0
- package/dist/kernel/components/blocks/navigation-progress.d.ts +16 -0
- package/dist/kernel/components/blocks/navigation-progress.js +249 -0
- package/dist/kernel/components/blocks/next-prev.cjs +142 -0
- package/dist/kernel/components/blocks/next-prev.d.cts +11 -0
- package/dist/kernel/components/blocks/next-prev.d.ts +11 -0
- package/dist/kernel/components/blocks/next-prev.js +105 -0
- package/dist/{components → kernel/components/blocks}/page-list.cjs +7 -16
- package/dist/{components → kernel/components/blocks}/page-list.d.cts +1 -1
- package/dist/{components → kernel/components/blocks}/page-list.d.ts +1 -1
- package/dist/{components → kernel/components/blocks}/page-list.js +6 -5
- package/dist/kernel/components/blocks/search.cjs +717 -0
- package/dist/kernel/components/blocks/search.d.cts +77 -0
- package/dist/kernel/components/blocks/search.d.ts +77 -0
- package/dist/kernel/components/blocks/search.js +697 -0
- package/dist/kernel/components/blocks/sidebar-node.cjs +309 -0
- package/dist/kernel/components/blocks/sidebar-node.d.cts +8 -0
- package/dist/kernel/components/blocks/sidebar-node.d.ts +8 -0
- package/dist/kernel/components/blocks/sidebar-node.js +272 -0
- package/dist/kernel/components/blocks/sidebar.cjs +317 -0
- package/dist/kernel/components/blocks/sidebar.d.cts +33 -0
- package/dist/kernel/components/blocks/sidebar.d.ts +33 -0
- package/dist/kernel/components/blocks/sidebar.js +302 -0
- package/dist/kernel/components/blocks/theme-toggle.cjs +31 -0
- package/dist/kernel/components/blocks/theme-toggle.d.cts +6 -0
- package/dist/kernel/components/blocks/theme-toggle.d.ts +6 -0
- package/dist/kernel/components/blocks/theme-toggle.js +7 -0
- package/dist/kernel/components/blocks/toc.cjs +356 -0
- package/dist/kernel/components/blocks/toc.d.cts +10 -0
- package/dist/kernel/components/blocks/toc.d.ts +10 -0
- package/dist/kernel/components/blocks/toc.js +330 -0
- package/dist/kernel/components/mdx/components/blockquote.cjs +66 -0
- package/dist/kernel/components/mdx/components/blockquote.d.cts +6 -0
- package/dist/kernel/components/mdx/components/blockquote.d.ts +6 -0
- package/dist/kernel/components/mdx/components/blockquote.js +39 -0
- package/dist/kernel/components/mdx/components/callout.cjs +137 -0
- package/dist/kernel/components/mdx/components/callout.d.cts +18 -0
- package/dist/kernel/components/mdx/components/callout.d.ts +18 -0
- package/dist/kernel/components/mdx/components/callout.js +109 -0
- package/dist/kernel/components/mdx/components/code-block.cjs +39 -0
- package/dist/kernel/components/mdx/components/code-block.d.cts +9 -0
- package/dist/kernel/components/mdx/components/code-block.d.ts +9 -0
- package/dist/kernel/components/mdx/components/code-block.js +14 -0
- package/dist/kernel/components/mdx/components/figure-caption.cjs +63 -0
- package/dist/kernel/components/mdx/components/figure-caption.d.cts +6 -0
- package/dist/kernel/components/mdx/components/figure-caption.d.ts +6 -0
- package/dist/kernel/components/mdx/components/figure-caption.js +36 -0
- package/dist/kernel/components/mdx/components/figure.cjs +78 -0
- package/dist/kernel/components/mdx/components/figure.d.cts +10 -0
- package/dist/kernel/components/mdx/components/figure.d.ts +10 -0
- package/dist/kernel/components/mdx/components/figure.js +53 -0
- package/dist/kernel/components/mdx/components/footnotes.cjs +66 -0
- package/dist/kernel/components/mdx/components/footnotes.d.cts +6 -0
- package/dist/kernel/components/mdx/components/footnotes.d.ts +6 -0
- package/dist/kernel/components/mdx/components/footnotes.js +39 -0
- package/dist/kernel/components/mdx/components/heading-copy-link.cjs +108 -0
- package/dist/kernel/components/mdx/components/heading-copy-link.d.cts +23 -0
- package/dist/kernel/components/mdx/components/heading-copy-link.d.ts +23 -0
- package/dist/kernel/components/mdx/components/heading-copy-link.js +81 -0
- package/dist/kernel/components/mdx/components/heading.cjs +166 -0
- package/dist/kernel/components/mdx/components/heading.d.cts +8 -0
- package/dist/kernel/components/mdx/components/heading.d.ts +8 -0
- package/dist/kernel/components/mdx/components/heading.js +144 -0
- package/dist/kernel/components/mdx/components/hr.cjs +34 -0
- package/dist/kernel/components/mdx/components/hr.d.cts +9 -0
- package/dist/kernel/components/mdx/components/hr.d.ts +9 -0
- package/dist/kernel/components/mdx/components/hr.js +9 -0
- package/dist/kernel/components/mdx/components/image-zoom.cjs +49 -0
- package/dist/kernel/components/mdx/components/image-zoom.d.cts +10 -0
- package/dist/kernel/components/mdx/components/image-zoom.d.ts +10 -0
- package/dist/kernel/components/mdx/components/image-zoom.js +15 -0
- package/dist/kernel/components/mdx/components/image.cjs +192 -0
- package/dist/kernel/components/mdx/components/image.d.cts +21 -0
- package/dist/kernel/components/mdx/components/image.d.ts +21 -0
- package/dist/kernel/components/mdx/components/image.js +157 -0
- package/dist/kernel/components/mdx/components/inline-code.cjs +66 -0
- package/dist/kernel/components/mdx/components/inline-code.d.cts +6 -0
- package/dist/kernel/components/mdx/components/inline-code.d.ts +6 -0
- package/dist/kernel/components/mdx/components/inline-code.js +39 -0
- package/dist/kernel/components/mdx/components/kbd.cjs +34 -0
- package/dist/kernel/components/mdx/components/kbd.d.cts +10 -0
- package/dist/kernel/components/mdx/components/kbd.d.ts +10 -0
- package/dist/kernel/components/mdx/components/kbd.js +9 -0
- package/dist/{components/providers.cjs → kernel/components/mdx/components/link.cjs} +20 -15
- package/dist/kernel/components/mdx/components/link.d.cts +11 -0
- package/dist/kernel/components/mdx/components/link.d.ts +11 -0
- package/dist/kernel/components/mdx/components/link.js +26 -0
- package/dist/kernel/components/mdx/components/paragraph.cjs +87 -0
- package/dist/kernel/components/mdx/components/paragraph.d.cts +5 -0
- package/dist/kernel/components/mdx/components/paragraph.d.ts +5 -0
- package/dist/kernel/components/mdx/components/paragraph.js +60 -0
- package/dist/kernel/components/mdx/components/pre.cjs +66 -0
- package/dist/kernel/components/mdx/components/pre.d.cts +6 -0
- package/dist/kernel/components/mdx/components/pre.d.ts +6 -0
- package/dist/kernel/components/mdx/components/pre.js +39 -0
- package/dist/kernel/components/mdx/components/strikethrough.cjs +63 -0
- package/dist/kernel/components/mdx/components/strikethrough.d.cts +6 -0
- package/dist/kernel/components/mdx/components/strikethrough.d.ts +6 -0
- package/dist/kernel/components/mdx/components/strikethrough.js +36 -0
- package/dist/kernel/components/mdx/components/table.cjs +59 -0
- package/dist/kernel/components/mdx/components/table.d.cts +10 -0
- package/dist/kernel/components/mdx/components/table.d.ts +10 -0
- package/dist/kernel/components/mdx/components/table.js +36 -0
- package/dist/kernel/components/mdx/components/task-list.cjs +88 -0
- package/dist/kernel/components/mdx/components/task-list.d.cts +8 -0
- package/dist/kernel/components/mdx/components/task-list.d.ts +8 -0
- package/dist/kernel/components/mdx/components/task-list.js +60 -0
- package/dist/kernel/components/mdx/components/video-player.cjs +173 -0
- package/dist/kernel/components/mdx/components/video-player.d.cts +18 -0
- package/dist/kernel/components/mdx/components/video-player.d.ts +18 -0
- package/dist/kernel/components/mdx/components/video-player.js +147 -0
- package/dist/kernel/components/mdx/components/video.cjs +185 -0
- package/dist/kernel/components/mdx/components/video.d.cts +15 -0
- package/dist/kernel/components/mdx/components/video.d.ts +15 -0
- package/dist/kernel/components/mdx/components/video.js +162 -0
- package/dist/kernel/components/mdx/error-boundary.cjs +62 -0
- package/dist/{mdx → kernel/components/mdx}/error-boundary.d.cts +3 -8
- package/dist/{mdx → kernel/components/mdx}/error-boundary.d.ts +3 -8
- package/dist/kernel/components/mdx/error-boundary.js +38 -0
- package/dist/{mdx → kernel/components/mdx}/error-fallback.cjs +8 -8
- package/dist/{mdx → kernel/components/mdx}/error-fallback.js +8 -8
- package/dist/kernel/components/mdx/mdx.cjs +141 -0
- package/dist/kernel/components/mdx/mdx.d.cts +22 -0
- package/dist/kernel/components/mdx/mdx.d.ts +22 -0
- package/dist/kernel/components/mdx/mdx.js +109 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.cjs +113 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.d.cts +10 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +10 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.js +86 -0
- package/dist/kernel/components/mdx/types.cjs +18 -0
- package/dist/kernel/components/mdx/types.d.cts +18 -0
- package/dist/kernel/components/mdx/types.d.ts +18 -0
- package/dist/kernel/components/mdx/types.js +0 -0
- package/dist/kernel/components/ui/accordion.cjs +104 -0
- package/dist/kernel/components/ui/accordion.d.cts +16 -0
- package/dist/kernel/components/ui/accordion.d.ts +16 -0
- package/dist/kernel/components/ui/accordion.js +76 -0
- package/dist/kernel/components/ui/badge.cjs +75 -0
- package/dist/kernel/components/ui/badge.d.cts +12 -0
- package/dist/kernel/components/ui/badge.d.ts +12 -0
- package/dist/kernel/components/ui/badge.js +47 -0
- package/dist/kernel/components/ui/breadcrumb-trail.cjs +238 -0
- package/dist/kernel/components/ui/breadcrumb-trail.d.cts +13 -0
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +13 -0
- package/dist/kernel/components/ui/breadcrumb-trail.js +225 -0
- package/dist/kernel/components/ui/breadcrumb.cjs +399 -0
- package/dist/kernel/components/ui/breadcrumb.d.cts +52 -0
- package/dist/kernel/components/ui/breadcrumb.d.ts +52 -0
- package/dist/kernel/components/ui/breadcrumb.js +365 -0
- package/dist/kernel/components/ui/button-group.cjs +144 -0
- package/dist/kernel/components/ui/button-group.d.cts +19 -0
- package/dist/kernel/components/ui/button-group.d.ts +19 -0
- package/dist/kernel/components/ui/button-group.js +116 -0
- package/dist/kernel/components/ui/button.cjs +147 -0
- package/dist/kernel/components/ui/button.d.cts +23 -0
- package/dist/kernel/components/ui/button.d.ts +23 -0
- package/dist/kernel/components/ui/button.js +121 -0
- package/dist/kernel/components/ui/card.cjs +133 -0
- package/dist/kernel/components/ui/card.d.cts +17 -0
- package/dist/kernel/components/ui/card.d.ts +17 -0
- package/dist/kernel/components/ui/card.js +101 -0
- package/dist/kernel/components/ui/dialog.cjs +149 -0
- package/dist/kernel/components/ui/dialog.d.cts +22 -0
- package/dist/kernel/components/ui/dialog.d.ts +22 -0
- package/dist/kernel/components/ui/dialog.js +118 -0
- package/dist/kernel/components/ui/drawer.cjs +163 -0
- package/dist/kernel/components/ui/drawer.d.cts +24 -0
- package/dist/kernel/components/ui/drawer.d.ts +24 -0
- package/dist/kernel/components/ui/drawer.js +131 -0
- package/dist/kernel/components/ui/input.cjs +96 -0
- package/dist/kernel/components/ui/input.d.cts +18 -0
- package/dist/kernel/components/ui/input.d.ts +18 -0
- package/dist/kernel/components/ui/input.js +70 -0
- package/dist/kernel/components/ui/kbd.cjs +105 -0
- package/dist/kernel/components/ui/kbd.d.cts +13 -0
- package/dist/kernel/components/ui/kbd.d.ts +13 -0
- package/dist/kernel/components/ui/kbd.js +77 -0
- package/dist/kernel/components/ui/link.cjs +253 -0
- package/dist/kernel/components/ui/link.d.cts +31 -0
- package/dist/kernel/components/ui/link.d.ts +31 -0
- package/dist/kernel/components/ui/link.js +217 -0
- package/dist/kernel/components/ui/menu.cjs +301 -0
- package/dist/kernel/components/ui/menu.d.cts +70 -0
- package/dist/kernel/components/ui/menu.d.ts +70 -0
- package/dist/kernel/components/ui/menu.js +256 -0
- package/dist/kernel/components/ui/meta-key.cjs +34 -0
- package/dist/kernel/components/ui/meta-key.d.cts +12 -0
- package/dist/kernel/components/ui/meta-key.d.ts +12 -0
- package/dist/kernel/components/ui/meta-key.js +9 -0
- package/dist/kernel/components/ui/navigation-menu.cjs +253 -0
- package/dist/kernel/components/ui/navigation-menu.d.cts +47 -0
- package/dist/kernel/components/ui/navigation-menu.d.ts +47 -0
- package/dist/kernel/components/ui/navigation-menu.js +216 -0
- package/dist/kernel/components/ui/popover.cjs +168 -0
- package/dist/kernel/components/ui/popover.d.cts +24 -0
- package/dist/kernel/components/ui/popover.d.ts +24 -0
- package/dist/kernel/components/ui/popover.js +136 -0
- package/dist/kernel/components/ui/progress.cjs +112 -0
- package/dist/kernel/components/ui/progress.d.cts +16 -0
- package/dist/kernel/components/ui/progress.d.ts +16 -0
- package/dist/kernel/components/ui/progress.js +84 -0
- package/dist/kernel/components/ui/scroll-area.cjs +413 -0
- package/dist/kernel/components/ui/scroll-area.d.cts +58 -0
- package/dist/kernel/components/ui/scroll-area.d.ts +58 -0
- package/dist/kernel/components/ui/scroll-area.js +390 -0
- package/dist/kernel/components/ui/select.cjs +244 -0
- package/dist/kernel/components/ui/select.d.cts +40 -0
- package/dist/kernel/components/ui/select.d.ts +40 -0
- package/dist/kernel/components/ui/select.js +205 -0
- package/dist/kernel/components/ui/separator.cjs +73 -0
- package/dist/kernel/components/ui/separator.d.cts +8 -0
- package/dist/kernel/components/ui/separator.d.ts +8 -0
- package/dist/kernel/components/ui/separator.js +48 -0
- package/dist/kernel/components/ui/table.cjs +131 -0
- package/dist/kernel/components/ui/table.d.cts +11 -0
- package/dist/kernel/components/ui/table.d.ts +11 -0
- package/dist/kernel/components/ui/table.js +99 -0
- package/dist/kernel/components/ui/tabs.cjs +450 -0
- package/dist/kernel/components/ui/tabs.d.cts +82 -0
- package/dist/kernel/components/ui/tabs.d.ts +82 -0
- package/dist/kernel/components/ui/tabs.js +409 -0
- package/dist/kernel/components/ui/text.cjs +184 -0
- package/dist/kernel/components/ui/text.d.cts +17 -0
- package/dist/kernel/components/ui/text.d.ts +17 -0
- package/dist/kernel/components/ui/text.js +156 -0
- package/dist/kernel/components/ui/theme-toggle.cjs +108 -0
- package/dist/kernel/components/ui/theme-toggle.d.cts +10 -0
- package/dist/kernel/components/ui/theme-toggle.d.ts +10 -0
- package/dist/kernel/components/ui/theme-toggle.js +84 -0
- package/dist/kernel/components/ui/toast.cjs +154 -0
- package/dist/kernel/components/ui/toast.d.cts +26 -0
- package/dist/kernel/components/ui/toast.d.ts +26 -0
- package/dist/kernel/components/ui/toast.js +120 -0
- package/dist/kernel/components/ui/tooltip.cjs +127 -0
- package/dist/kernel/components/ui/tooltip.d.cts +20 -0
- package/dist/kernel/components/ui/tooltip.d.ts +20 -0
- package/dist/kernel/components/ui/tooltip.js +97 -0
- package/dist/kernel/defaults.registry.cjs +541 -0
- package/dist/kernel/defaults.registry.d.cts +469 -0
- package/dist/kernel/defaults.registry.d.ts +469 -0
- package/dist/kernel/defaults.registry.js +516 -0
- package/dist/kernel/routes/agent/markdown.cjs +202 -0
- package/dist/kernel/routes/agent/markdown.d.cts +58 -0
- package/dist/kernel/routes/agent/markdown.d.ts +58 -0
- package/dist/kernel/routes/agent/markdown.js +174 -0
- package/dist/{layouts → kernel/routes/layouts}/group.cjs +39 -15
- package/dist/kernel/routes/layouts/group.d.cts +20 -0
- package/dist/kernel/routes/layouts/group.d.ts +20 -0
- package/dist/{layouts → kernel/routes/layouts}/group.js +39 -15
- package/dist/kernel/routes/metadata/feed.cjs +293 -0
- package/dist/kernel/routes/metadata/feed.d.cts +20 -0
- package/dist/kernel/routes/metadata/feed.d.ts +20 -0
- package/dist/kernel/routes/metadata/feed.js +265 -0
- package/dist/kernel/routes/metadata/llms.cjs +239 -0
- package/dist/kernel/routes/metadata/llms.d.cts +26 -0
- package/dist/kernel/routes/metadata/llms.d.ts +26 -0
- package/dist/kernel/routes/metadata/llms.js +211 -0
- package/dist/kernel/routes/metadata/og-image.cjs +630 -0
- package/dist/kernel/routes/metadata/og-image.d.cts +62 -0
- package/dist/kernel/routes/metadata/og-image.d.ts +62 -0
- package/dist/kernel/routes/metadata/og-image.js +604 -0
- package/dist/{routes → kernel/routes/metadata}/robots.cjs +59 -5
- package/dist/{routes → kernel/routes/metadata}/robots.d.cts +2 -1
- package/dist/{routes → kernel/routes/metadata}/robots.d.ts +2 -1
- package/dist/kernel/routes/metadata/robots.js +123 -0
- package/dist/kernel/routes/metadata/sitemap.cjs +192 -0
- package/dist/kernel/routes/metadata/sitemap.d.cts +8 -0
- package/dist/kernel/routes/metadata/sitemap.d.ts +8 -0
- package/dist/kernel/routes/metadata/sitemap.js +166 -0
- package/dist/{pages → kernel/routes/pages}/group.cjs +107 -6
- package/dist/{pages → kernel/routes/pages}/group.d.cts +4 -2
- package/dist/{pages → kernel/routes/pages}/group.d.ts +4 -2
- package/dist/{pages → kernel/routes/pages}/group.js +107 -6
- package/dist/kernel/routes/pages/leaf.cjs +421 -0
- package/dist/kernel/routes/pages/leaf.d.cts +36 -0
- package/dist/kernel/routes/pages/leaf.d.ts +36 -0
- package/dist/kernel/routes/pages/leaf.js +397 -0
- package/dist/{pages → kernel/routes/pages}/root.cjs +108 -6
- package/dist/{pages → kernel/routes/pages}/root.d.cts +4 -2
- package/dist/{pages → kernel/routes/pages}/root.d.ts +4 -2
- package/dist/kernel/routes/pages/root.js +203 -0
- package/dist/keyboard-shortcuts.cjs +345 -0
- package/dist/keyboard-shortcuts.d.cts +34 -0
- package/dist/keyboard-shortcuts.d.ts +34 -0
- package/dist/keyboard-shortcuts.js +326 -0
- package/dist/resolvers/manifest-resolver.cjs +7 -3
- package/dist/resolvers/manifest-resolver.d.cts +2 -2
- package/dist/resolvers/manifest-resolver.d.ts +2 -2
- package/dist/resolvers/manifest-resolver.js +7 -3
- package/dist/search.cjs +411 -0
- package/dist/search.d.cts +20 -0
- package/dist/search.d.ts +20 -0
- package/dist/search.js +393 -0
- package/dist/types.cjs +12 -0
- package/dist/types.d.cts +132 -7
- package/dist/types.d.ts +132 -7
- package/dist/types.js +5 -0
- package/dist/utils/heading-ids.cjs +119 -0
- package/dist/utils/heading-ids.d.cts +15 -0
- package/dist/utils/heading-ids.d.ts +15 -0
- package/dist/utils/heading-ids.js +90 -0
- package/package.json +59 -38
- package/release/package.json +23 -0
- package/release/pnpm-lock.yaml +1192 -0
- package/release/release.json +39 -0
- package/dist/components/color-palette.cjs +0 -408
- package/dist/components/color-palette.d.cts +0 -5
- package/dist/components/color-palette.d.ts +0 -5
- package/dist/components/color-palette.js +0 -388
- package/dist/components/nav-breadcrumb.d.cts +0 -9
- package/dist/components/nav-breadcrumb.d.ts +0 -9
- package/dist/components/providers.d.cts +0 -8
- package/dist/components/providers.d.ts +0 -8
- package/dist/components/providers.js +0 -20
- package/dist/components/site-header.cjs +0 -302
- package/dist/components/site-header.d.cts +0 -12
- package/dist/components/site-header.d.ts +0 -12
- package/dist/components/site-header.js +0 -268
- package/dist/components/theme-toggle.cjs +0 -147
- package/dist/components/theme-toggle.d.cts +0 -5
- package/dist/components/theme-toggle.d.ts +0 -5
- package/dist/components/theme-toggle.js +0 -123
- package/dist/layouts/group.d.cts +0 -15
- package/dist/layouts/group.d.ts +0 -15
- package/dist/mdx/error-boundary.cjs +0 -94
- package/dist/mdx/error-boundary.js +0 -70
- package/dist/mdx/mdx.cjs +0 -182
- package/dist/mdx/mdx.d.cts +0 -10
- package/dist/mdx/mdx.d.ts +0 -10
- package/dist/mdx/mdx.js +0 -147
- package/dist/pages/leaf.cjs +0 -203
- package/dist/pages/leaf.d.cts +0 -23
- package/dist/pages/leaf.d.ts +0 -23
- package/dist/pages/leaf.js +0 -176
- package/dist/pages/root.js +0 -101
- package/dist/routes/llms.cjs +0 -101
- package/dist/routes/llms.d.cts +0 -7
- package/dist/routes/llms.d.ts +0 -7
- package/dist/routes/llms.js +0 -76
- package/dist/routes/robots.js +0 -69
- package/dist/routes/sitemap.cjs +0 -108
- package/dist/routes/sitemap.d.cts +0 -5
- package/dist/routes/sitemap.d.ts +0 -5
- package/dist/routes/sitemap.js +0 -83
- /package/dist/{mdx → kernel/components/mdx}/error-fallback.d.cts +0 -0
- /package/dist/{mdx → kernel/components/mdx}/error-fallback.d.ts +0 -0
|
@@ -0,0 +1,717 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/kernel/components/blocks/search.tsx
|
|
32
|
+
var search_exports = {};
|
|
33
|
+
__export(search_exports, {
|
|
34
|
+
Command: () => Command,
|
|
35
|
+
DefaultDesktop: () => DefaultDesktop,
|
|
36
|
+
DefaultMobile: () => DefaultMobile,
|
|
37
|
+
Dialog: () => DialogContent,
|
|
38
|
+
Input: () => SearchInputField,
|
|
39
|
+
Progress: () => SearchProgressBar,
|
|
40
|
+
Results: () => SearchResults,
|
|
41
|
+
Root: () => Root,
|
|
42
|
+
Search: () => Search,
|
|
43
|
+
Trigger: () => Trigger
|
|
44
|
+
});
|
|
45
|
+
module.exports = __toCommonJS(search_exports);
|
|
46
|
+
var import_button = require("../ui/button.js");
|
|
47
|
+
var import_dialog = require("../ui/dialog.js");
|
|
48
|
+
var import_input = require("../ui/input.js");
|
|
49
|
+
var import_kbd = require("../ui/kbd.js");
|
|
50
|
+
var import_progress = require("../ui/progress.js");
|
|
51
|
+
var import_scroll_area = require("../ui/scroll-area.js");
|
|
52
|
+
var import_keyboard_shortcuts = require("@publish.os/nextjs/keyboard-shortcuts");
|
|
53
|
+
var import_search = require("@publish.os/nextjs/search");
|
|
54
|
+
|
|
55
|
+
// src/utils/cn.ts
|
|
56
|
+
var import_clsx = require("clsx");
|
|
57
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
58
|
+
var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
|
|
59
|
+
extend: {
|
|
60
|
+
classGroups: {
|
|
61
|
+
z: [
|
|
62
|
+
"z-content",
|
|
63
|
+
"z-nav",
|
|
64
|
+
"z-overlay",
|
|
65
|
+
"z-modal",
|
|
66
|
+
"z-search",
|
|
67
|
+
"z-toast",
|
|
68
|
+
"z-progress"
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
function cn(...inputs) {
|
|
74
|
+
return twMerge((0, import_clsx.clsx)(inputs));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// src/kernel/components/blocks/search.tsx
|
|
78
|
+
var import_lucide_react = require("lucide-react");
|
|
79
|
+
var import_link = __toESM(require("next/link"), 1);
|
|
80
|
+
var import_react = require("react");
|
|
81
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
82
|
+
var SEARCH_ROW_HEIGHT = 58;
|
|
83
|
+
var SEARCH_ROW_WITH_DESCRIPTION_HEIGHT = 72;
|
|
84
|
+
var SEARCH_RESULTS_PADDING = 16;
|
|
85
|
+
var SEARCH_RESULTS_MAX_HEIGHT = 360;
|
|
86
|
+
var SEARCH_RESULT_SNIPPET_LENGTH = 180;
|
|
87
|
+
var searchProgressConfig = {
|
|
88
|
+
completeDelay: 100,
|
|
89
|
+
exitDuration: 150,
|
|
90
|
+
fastPhaseEnd: 25,
|
|
91
|
+
initialProgress: 5,
|
|
92
|
+
maxDuration: 5e3,
|
|
93
|
+
minDuration: 50,
|
|
94
|
+
targetProgress: 95
|
|
95
|
+
};
|
|
96
|
+
function SearchProgressBar({ className }) {
|
|
97
|
+
const {
|
|
98
|
+
state: { isTyping, loading, status }
|
|
99
|
+
} = (0, import_search.useSearchBlock)();
|
|
100
|
+
const [progress, setProgress] = (0, import_react.useState)(0);
|
|
101
|
+
const [isExiting, setIsExiting] = (0, import_react.useState)(false);
|
|
102
|
+
const animationFrame = (0, import_react.useRef)(null);
|
|
103
|
+
const cleanupTimer = (0, import_react.useRef)(null);
|
|
104
|
+
const progressRef = (0, import_react.useRef)(0);
|
|
105
|
+
const active = loading || status === "building" || status === "stale";
|
|
106
|
+
const setProgressValue = (0, import_react.useCallback)((value) => {
|
|
107
|
+
progressRef.current = value;
|
|
108
|
+
setProgress(value);
|
|
109
|
+
}, []);
|
|
110
|
+
const cleanup = (0, import_react.useCallback)(() => {
|
|
111
|
+
if (animationFrame.current !== null) {
|
|
112
|
+
window.cancelAnimationFrame(animationFrame.current);
|
|
113
|
+
animationFrame.current = null;
|
|
114
|
+
}
|
|
115
|
+
if (cleanupTimer.current) {
|
|
116
|
+
window.clearTimeout(cleanupTimer.current);
|
|
117
|
+
cleanupTimer.current = null;
|
|
118
|
+
}
|
|
119
|
+
}, []);
|
|
120
|
+
(0, import_react.useEffect)(() => {
|
|
121
|
+
if (isTyping) {
|
|
122
|
+
cleanup();
|
|
123
|
+
setProgressValue(0);
|
|
124
|
+
setIsExiting(false);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (!active) {
|
|
128
|
+
if (progressRef.current > 0) {
|
|
129
|
+
cleanup();
|
|
130
|
+
setProgressValue(100);
|
|
131
|
+
cleanupTimer.current = window.setTimeout(() => {
|
|
132
|
+
setIsExiting(true);
|
|
133
|
+
cleanupTimer.current = window.setTimeout(() => {
|
|
134
|
+
setProgressValue(0);
|
|
135
|
+
setIsExiting(false);
|
|
136
|
+
cleanupTimer.current = null;
|
|
137
|
+
}, searchProgressConfig.exitDuration);
|
|
138
|
+
}, searchProgressConfig.completeDelay);
|
|
139
|
+
}
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
cleanup();
|
|
143
|
+
setIsExiting(false);
|
|
144
|
+
setProgressValue(searchProgressConfig.initialProgress);
|
|
145
|
+
const start = performance.now();
|
|
146
|
+
const animate = (now) => {
|
|
147
|
+
const elapsed = now - start;
|
|
148
|
+
let progressValue;
|
|
149
|
+
if (elapsed < searchProgressConfig.minDuration) {
|
|
150
|
+
progressValue = searchProgressConfig.initialProgress + elapsed / searchProgressConfig.minDuration * (searchProgressConfig.fastPhaseEnd - searchProgressConfig.initialProgress);
|
|
151
|
+
} else {
|
|
152
|
+
const remainingProgress = searchProgressConfig.targetProgress - searchProgressConfig.fastPhaseEnd;
|
|
153
|
+
const normalizedTime = Math.min(
|
|
154
|
+
1,
|
|
155
|
+
(elapsed - searchProgressConfig.minDuration) / (searchProgressConfig.maxDuration - searchProgressConfig.minDuration)
|
|
156
|
+
);
|
|
157
|
+
const easedTime = 1 - (1 - normalizedTime) ** 3;
|
|
158
|
+
progressValue = searchProgressConfig.fastPhaseEnd + easedTime * remainingProgress;
|
|
159
|
+
}
|
|
160
|
+
setProgressValue(
|
|
161
|
+
Math.min(searchProgressConfig.targetProgress, progressValue)
|
|
162
|
+
);
|
|
163
|
+
animationFrame.current = window.requestAnimationFrame(animate);
|
|
164
|
+
};
|
|
165
|
+
animationFrame.current = window.requestAnimationFrame(animate);
|
|
166
|
+
return cleanup;
|
|
167
|
+
}, [active, cleanup, isTyping, setProgressValue]);
|
|
168
|
+
const isVisible = progress > 0;
|
|
169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
170
|
+
import_progress.Progress,
|
|
171
|
+
{
|
|
172
|
+
"aria-hidden": !isVisible,
|
|
173
|
+
className: cn(
|
|
174
|
+
"pointer-events-none h-[1.5px] overflow-hidden opacity-75 transition-opacity duration-300",
|
|
175
|
+
isVisible ? "opacity-100" : "opacity-0",
|
|
176
|
+
className
|
|
177
|
+
),
|
|
178
|
+
value: isVisible ? progress : null,
|
|
179
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_progress.ProgressTrack, { className: "h-full rounded-none bg-transparent", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
180
|
+
import_progress.ProgressIndicator,
|
|
181
|
+
{
|
|
182
|
+
className: "h-full w-full rounded-none bg-accent-1",
|
|
183
|
+
style: {
|
|
184
|
+
transform: isExiting ? "scaleX(0)" : `scaleX(${Math.max(0, Math.min(100, progress)) / 100})`,
|
|
185
|
+
transformOrigin: isExiting ? "right" : "left",
|
|
186
|
+
transition: isExiting ? `transform ${searchProgressConfig.exitDuration}ms cubic-bezier(.18,.66,.89,.35)` : "transform 200ms cubic-bezier(.04,.06,0,.61)"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
) })
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
function RootDialogFrame({
|
|
194
|
+
children,
|
|
195
|
+
className
|
|
196
|
+
}) {
|
|
197
|
+
const {
|
|
198
|
+
actions: { setOpen },
|
|
199
|
+
meta: { variant },
|
|
200
|
+
state: { open }
|
|
201
|
+
} = (0, import_search.useSearchBlock)();
|
|
202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, { onOpenChange: setOpen, open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className, "data-search-root": "", "data-variant": variant, children }) });
|
|
203
|
+
}
|
|
204
|
+
function Root({ children, className, ...providerProps }) {
|
|
205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_search.SearchProvider, { ...providerProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RootDialogFrame, { className, children }) });
|
|
206
|
+
}
|
|
207
|
+
function Trigger({
|
|
208
|
+
asChild = false,
|
|
209
|
+
children,
|
|
210
|
+
className,
|
|
211
|
+
icon,
|
|
212
|
+
placeholder = "Search...",
|
|
213
|
+
shortcut,
|
|
214
|
+
shortcutClassName,
|
|
215
|
+
showIcon = true,
|
|
216
|
+
showShortcut = true,
|
|
217
|
+
size = "sm",
|
|
218
|
+
variant = "outline"
|
|
219
|
+
}) {
|
|
220
|
+
const {
|
|
221
|
+
meta: { inputId, shortcut: registeredShortcut },
|
|
222
|
+
state: { open }
|
|
223
|
+
} = (0, import_search.useSearchBlock)();
|
|
224
|
+
const visibleShortcut = shortcut ?? registeredShortcut;
|
|
225
|
+
const shortcutTokens = (0, import_react.useMemo)(
|
|
226
|
+
() => (0, import_keyboard_shortcuts.formatShortcut)(visibleShortcut),
|
|
227
|
+
[visibleShortcut]
|
|
228
|
+
);
|
|
229
|
+
if (asChild && children) {
|
|
230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
231
|
+
import_dialog.DialogTrigger,
|
|
232
|
+
{
|
|
233
|
+
render: (0, import_react.cloneElement)(children, {
|
|
234
|
+
"aria-controls": inputId,
|
|
235
|
+
"aria-expanded": open,
|
|
236
|
+
className: cn(children.props.className, className)
|
|
237
|
+
})
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
242
|
+
import_dialog.DialogTrigger,
|
|
243
|
+
{
|
|
244
|
+
"aria-controls": inputId,
|
|
245
|
+
"aria-expanded": open,
|
|
246
|
+
"aria-label": "Open search",
|
|
247
|
+
className: cn(
|
|
248
|
+
(0, import_button.buttonVariants)({ size, variant }),
|
|
249
|
+
"justify-start gap-2 px-2.5 text-foreground-3",
|
|
250
|
+
"hover:text-foreground-1",
|
|
251
|
+
className
|
|
252
|
+
),
|
|
253
|
+
children: [
|
|
254
|
+
showIcon ? icon ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Search, { "aria-hidden": "true", size: 16 }) : null,
|
|
255
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "min-w-0 flex-1 truncate text-left", children: placeholder }),
|
|
256
|
+
showShortcut ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
257
|
+
"span",
|
|
258
|
+
{
|
|
259
|
+
"aria-hidden": "true",
|
|
260
|
+
className: cn(
|
|
261
|
+
"hidden shrink-0 items-center gap-1 md:inline-flex",
|
|
262
|
+
shortcutClassName
|
|
263
|
+
),
|
|
264
|
+
children: shortcutTokens.map((token) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_kbd.Kbd, { size: "xs", children: token }, token))
|
|
265
|
+
}
|
|
266
|
+
) : null
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
function DialogContent({
|
|
272
|
+
children,
|
|
273
|
+
className,
|
|
274
|
+
description = "Search this site and navigate to a result.",
|
|
275
|
+
title = "Search"
|
|
276
|
+
}) {
|
|
277
|
+
const {
|
|
278
|
+
meta: { variant }
|
|
279
|
+
} = (0, import_search.useSearchBlock)();
|
|
280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogPortal, { children: [
|
|
281
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogBackdrop, { className: "bg-overlay-background backdrop-blur-[2px]" }),
|
|
282
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
283
|
+
import_dialog.DialogPopup,
|
|
284
|
+
{
|
|
285
|
+
className: cn(
|
|
286
|
+
"top-[12dvh] flex max-h-[min(42rem,82dvh)] w-[min(92vw,575px)] translate-y-0 flex-col overflow-hidden p-0 shadow-xl",
|
|
287
|
+
variant === "mobile" && "bottom-auto left-1/2 top-[8dvh] h-auto max-h-[86dvh] w-[min(94vw,575px)] max-w-none -translate-x-1/2 translate-y-0",
|
|
288
|
+
className
|
|
289
|
+
),
|
|
290
|
+
children: [
|
|
291
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, { className: "sr-only", children: title }),
|
|
292
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogDescription, { className: "sr-only", children: description }),
|
|
293
|
+
children
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
)
|
|
297
|
+
] });
|
|
298
|
+
}
|
|
299
|
+
function SearchInputField({
|
|
300
|
+
className,
|
|
301
|
+
closeClassName,
|
|
302
|
+
closeLabel = "ESC",
|
|
303
|
+
placeholder = "Search docs...",
|
|
304
|
+
rootClassName,
|
|
305
|
+
showCloseShortcut = true
|
|
306
|
+
}) {
|
|
307
|
+
const {
|
|
308
|
+
actions: { handleInputChange, navigateToResult, setOpen, setSelectedValue },
|
|
309
|
+
meta: { inputId, inputRef, listId },
|
|
310
|
+
state: { displayResults, query, selectedValue }
|
|
311
|
+
} = (0, import_search.useSearchBlock)();
|
|
312
|
+
const closeDisplayLabel = typeof closeLabel === "string" ? closeLabel.toUpperCase() : closeLabel;
|
|
313
|
+
const selectedIndex2 = Math.max(
|
|
314
|
+
0,
|
|
315
|
+
displayResults.findIndex((result) => result.id === selectedValue)
|
|
316
|
+
);
|
|
317
|
+
const selectedOptionId = displayResults.length > 0 ? resultOptionId(listId, selectedIndex2) : void 0;
|
|
318
|
+
const handleKeyDown = (event) => {
|
|
319
|
+
if (event.key === "Escape") {
|
|
320
|
+
event.preventDefault();
|
|
321
|
+
setOpen(false);
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
if (event.key === "ArrowDown") {
|
|
325
|
+
event.preventDefault();
|
|
326
|
+
const next = displayResults[Math.min(selectedIndex2 + 1, displayResults.length - 1)];
|
|
327
|
+
if (next) setSelectedValue(next.id);
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
if (event.key === "ArrowUp") {
|
|
331
|
+
event.preventDefault();
|
|
332
|
+
const next = displayResults[Math.max(selectedIndex2 - 1, 0)];
|
|
333
|
+
if (next) setSelectedValue(next.id);
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
if (event.key === "Enter") {
|
|
337
|
+
const selected = displayResults[selectedIndex2];
|
|
338
|
+
if (!selected) return;
|
|
339
|
+
event.preventDefault();
|
|
340
|
+
navigateToResult(selected);
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
344
|
+
"div",
|
|
345
|
+
{
|
|
346
|
+
className: cn("relative rounded-t-[inherit] bg-surface-1", rootClassName),
|
|
347
|
+
children: [
|
|
348
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
349
|
+
import_input.Input,
|
|
350
|
+
{
|
|
351
|
+
"aria-activedescendant": selectedOptionId,
|
|
352
|
+
"aria-autocomplete": "list",
|
|
353
|
+
"aria-controls": listId,
|
|
354
|
+
"aria-expanded": displayResults.length > 0,
|
|
355
|
+
autoComplete: "off",
|
|
356
|
+
className: cn(
|
|
357
|
+
"supports-[caret-color:var(--accent-1)]:caret-(--accent-1)",
|
|
358
|
+
"h-12 rounded-none border-0 bg-transparent px-4 pr-16 text-sm shadow-none outline-none focus:border-transparent focus-visible:outline-0",
|
|
359
|
+
className
|
|
360
|
+
),
|
|
361
|
+
id: inputId,
|
|
362
|
+
onChange: (event) => handleInputChange(event.currentTarget.value),
|
|
363
|
+
onKeyDown: handleKeyDown,
|
|
364
|
+
placeholder,
|
|
365
|
+
ref: inputRef,
|
|
366
|
+
role: "combobox",
|
|
367
|
+
spellCheck: false,
|
|
368
|
+
type: "text",
|
|
369
|
+
value: query
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
showCloseShortcut ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
373
|
+
import_dialog.DialogClose,
|
|
374
|
+
{
|
|
375
|
+
"aria-label": "Close search",
|
|
376
|
+
className: cn(
|
|
377
|
+
"absolute right-3 top-1/2 size-auto -translate-y-1/2 bg-transparent p-0 text-foreground-3 hover:bg-transparent hover:text-foreground-1",
|
|
378
|
+
closeClassName
|
|
379
|
+
),
|
|
380
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_kbd.Kbd, { className: "text-foreground-2", size: "sm", children: closeDisplayLabel })
|
|
381
|
+
}
|
|
382
|
+
) : null
|
|
383
|
+
]
|
|
384
|
+
}
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
function SearchResults({
|
|
388
|
+
className,
|
|
389
|
+
emptyText = "No results found."
|
|
390
|
+
}) {
|
|
391
|
+
const {
|
|
392
|
+
actions: { navigateToResult, setOpen, setSelectedValue },
|
|
393
|
+
meta: { listId, listRef },
|
|
394
|
+
state: {
|
|
395
|
+
displayResults,
|
|
396
|
+
isTyping,
|
|
397
|
+
loading,
|
|
398
|
+
message,
|
|
399
|
+
query,
|
|
400
|
+
selectedValue,
|
|
401
|
+
status
|
|
402
|
+
}
|
|
403
|
+
} = (0, import_search.useSearchBlock)();
|
|
404
|
+
const hasQuery = query.trim().length > 0;
|
|
405
|
+
const showResults = displayResults.length > 0;
|
|
406
|
+
const statusMessage = message ?? statusLabel(status);
|
|
407
|
+
const showStatusPanel = hasQuery && !isTyping && !loading && !showResults && (status === "building" || status === "stale" || status === "error");
|
|
408
|
+
const showEmptyPanel = hasQuery && !isTyping && !loading && !showResults && !showStatusPanel && status === "ready";
|
|
409
|
+
const showPanel = showResults || showStatusPanel || showEmptyPanel;
|
|
410
|
+
const resultRowHeight = displayResults.some(
|
|
411
|
+
(result) => resultSnippet({ query, result })
|
|
412
|
+
) ? SEARCH_ROW_WITH_DESCRIPTION_HEIGHT : SEARCH_ROW_HEIGHT;
|
|
413
|
+
const fullResultsHeight = displayResults.length * resultRowHeight + SEARCH_RESULTS_PADDING;
|
|
414
|
+
const resultsAreScrollable = fullResultsHeight > SEARCH_RESULTS_MAX_HEIGHT;
|
|
415
|
+
const resultsHeight = Math.min(fullResultsHeight, SEARCH_RESULTS_MAX_HEIGHT);
|
|
416
|
+
const panelHeight = showResults ? resultsHeight : showStatusPanel || showEmptyPanel ? 144 : 0;
|
|
417
|
+
const containerDuration = showResults ? Math.min(320, 150 + displayResults.length * 18) : 180;
|
|
418
|
+
(0, import_react.useEffect)(() => {
|
|
419
|
+
if (!selectedValue || !showResults) return;
|
|
420
|
+
const frame = window.requestAnimationFrame(() => {
|
|
421
|
+
const index = selectedIndex(displayResults, selectedValue);
|
|
422
|
+
document.getElementById(resultOptionId(listId, index))?.scrollIntoView({ block: "nearest" });
|
|
423
|
+
});
|
|
424
|
+
return () => window.cancelAnimationFrame(frame);
|
|
425
|
+
}, [displayResults, listId, selectedValue, showResults]);
|
|
426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
427
|
+
"div",
|
|
428
|
+
{
|
|
429
|
+
className: cn(
|
|
430
|
+
"relative grid rounded-b-[inherit] bg-surface-1 transition-[grid-template-rows,opacity] ease-[cubic-bezier(0.4,0,0.2,1)] before:pointer-events-none before:absolute before:inset-x-0 before:top-0 before:z-10 before:h-px before:bg-stroke-3 before:transition-opacity motion-reduce:transition-none",
|
|
431
|
+
showPanel ? "opacity-100" : "opacity-0",
|
|
432
|
+
showPanel ? "before:opacity-100" : "before:opacity-0",
|
|
433
|
+
className
|
|
434
|
+
),
|
|
435
|
+
style: {
|
|
436
|
+
gridTemplateRows: `${panelHeight}px`,
|
|
437
|
+
transitionDuration: `${containerDuration}ms`
|
|
438
|
+
},
|
|
439
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-h-0 overflow-hidden", children: [
|
|
440
|
+
showStatusPanel ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
441
|
+
"div",
|
|
442
|
+
{
|
|
443
|
+
"aria-live": "polite",
|
|
444
|
+
className: "flex h-full items-center justify-center px-6 py-10 text-center text-sm",
|
|
445
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "max-w-full text-foreground-2", children: statusMessage })
|
|
446
|
+
}
|
|
447
|
+
) : null,
|
|
448
|
+
showEmptyPanel ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
449
|
+
"div",
|
|
450
|
+
{
|
|
451
|
+
"aria-live": "polite",
|
|
452
|
+
className: "flex h-full items-center justify-center px-6 py-10 text-center text-sm",
|
|
453
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "max-w-full text-base text-foreground-2", children: [
|
|
454
|
+
emptyText.replace(/\.$/, ""),
|
|
455
|
+
" for",
|
|
456
|
+
" ",
|
|
457
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "inline-block max-w-full truncate align-bottom font-medium text-foreground-1", children: [
|
|
458
|
+
'"',
|
|
459
|
+
query.trim(),
|
|
460
|
+
'"'
|
|
461
|
+
] })
|
|
462
|
+
] })
|
|
463
|
+
}
|
|
464
|
+
) : null,
|
|
465
|
+
showResults ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-full", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
466
|
+
import_scroll_area.ScrollArea,
|
|
467
|
+
{
|
|
468
|
+
className: "h-full",
|
|
469
|
+
mask: resultsAreScrollable ? { height: 40, triggerSize: 32 } : false,
|
|
470
|
+
scrollbar: resultsAreScrollable,
|
|
471
|
+
variant: "gradient",
|
|
472
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
473
|
+
"div",
|
|
474
|
+
{
|
|
475
|
+
"aria-label": "Search results",
|
|
476
|
+
className: "p-2",
|
|
477
|
+
id: listId,
|
|
478
|
+
ref: listRef,
|
|
479
|
+
role: "listbox",
|
|
480
|
+
children: displayResults.map((result, index) => {
|
|
481
|
+
const snippet = resultSnippet({ query, result });
|
|
482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
483
|
+
import_link.default,
|
|
484
|
+
{
|
|
485
|
+
"aria-selected": result.id === selectedValue,
|
|
486
|
+
className: cn(
|
|
487
|
+
"block min-h-[58px] min-w-0 overflow-hidden rounded-[max(calc(var(--radius-dialog)_-_0.25rem),0px)] px-3 py-2 text-left transition-colors",
|
|
488
|
+
"focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-focus-ring",
|
|
489
|
+
result.id === selectedValue ? "bg-surface-active text-foreground-1" : "text-foreground-2"
|
|
490
|
+
),
|
|
491
|
+
href: result.url,
|
|
492
|
+
id: resultOptionId(listId, index),
|
|
493
|
+
onClick: () => setOpen(false),
|
|
494
|
+
onKeyDown: (event) => {
|
|
495
|
+
if (event.key !== "Enter") return;
|
|
496
|
+
event.preventDefault();
|
|
497
|
+
navigateToResult(result);
|
|
498
|
+
},
|
|
499
|
+
onMouseEnter: () => setSelectedValue(result.id),
|
|
500
|
+
onMouseMove: () => setSelectedValue(result.id),
|
|
501
|
+
role: "option",
|
|
502
|
+
children: [
|
|
503
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block truncate break-all text-xs leading-4 text-foreground-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
504
|
+
HighlightedText,
|
|
505
|
+
{
|
|
506
|
+
text: resultSubtitle(result),
|
|
507
|
+
query
|
|
508
|
+
}
|
|
509
|
+
) }),
|
|
510
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "line-clamp-1 break-all text-sm font-medium", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HighlightedText, { text: result.title, query }) }),
|
|
511
|
+
snippet ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "mt-1 line-clamp-2 break-words text-xs leading-4 text-foreground-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HighlightedText, { text: snippet, query }) }) : null
|
|
512
|
+
]
|
|
513
|
+
},
|
|
514
|
+
result.id
|
|
515
|
+
);
|
|
516
|
+
})
|
|
517
|
+
}
|
|
518
|
+
)
|
|
519
|
+
}
|
|
520
|
+
) }) : null
|
|
521
|
+
] })
|
|
522
|
+
}
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
function statusLabel(status) {
|
|
526
|
+
if (status === "building") return "Building search index...";
|
|
527
|
+
if (status === "stale") return "Updating search index...";
|
|
528
|
+
if (status === "error") return "Search is temporarily unavailable";
|
|
529
|
+
return "Searching...";
|
|
530
|
+
}
|
|
531
|
+
function resultOptionId(listId, index) {
|
|
532
|
+
return `${listId}-result-${index}`;
|
|
533
|
+
}
|
|
534
|
+
function selectedIndex(results, selectedValue) {
|
|
535
|
+
return Math.max(
|
|
536
|
+
0,
|
|
537
|
+
results.findIndex((result) => result.id === selectedValue)
|
|
538
|
+
);
|
|
539
|
+
}
|
|
540
|
+
function cleanResultPath(url) {
|
|
541
|
+
const path = url.split("#")[0]?.replace(/^\/+|\/+$/g, "") ?? "";
|
|
542
|
+
return path || "/";
|
|
543
|
+
}
|
|
544
|
+
function resultSubtitle(result) {
|
|
545
|
+
const section = result.meta.section ?? result.meta.group;
|
|
546
|
+
const path = cleanResultPath(result.meta.path ?? result.url);
|
|
547
|
+
if (section && path && !path.startsWith(section)) {
|
|
548
|
+
return `${section} / ${path}`;
|
|
549
|
+
}
|
|
550
|
+
return path || section || result.url;
|
|
551
|
+
}
|
|
552
|
+
function normalizedSnippetText(text) {
|
|
553
|
+
return (text ?? "").replace(/\s+/g, " ").trim();
|
|
554
|
+
}
|
|
555
|
+
function queryMatches(text, query) {
|
|
556
|
+
const normalizedQuery = query.trim().toLowerCase();
|
|
557
|
+
if (!normalizedQuery) return false;
|
|
558
|
+
const lower = text.toLowerCase();
|
|
559
|
+
if (lower.includes(normalizedQuery)) return true;
|
|
560
|
+
return normalizedQuery.split(/\s+/).filter((term) => term.length > 1).some((term) => lower.includes(term));
|
|
561
|
+
}
|
|
562
|
+
function firstMatchIndex(text, query) {
|
|
563
|
+
const normalizedQuery = query.trim().toLowerCase();
|
|
564
|
+
if (!normalizedQuery) return -1;
|
|
565
|
+
const lower = text.toLowerCase();
|
|
566
|
+
const phraseIndex = lower.indexOf(normalizedQuery);
|
|
567
|
+
if (phraseIndex >= 0) return phraseIndex;
|
|
568
|
+
return normalizedQuery.split(/\s+/).filter((term) => term.length > 1).map((term) => lower.indexOf(term)).filter((index) => index >= 0).sort((left, right) => left - right)[0] ?? -1;
|
|
569
|
+
}
|
|
570
|
+
function contextualSnippet({
|
|
571
|
+
length = SEARCH_RESULT_SNIPPET_LENGTH,
|
|
572
|
+
query,
|
|
573
|
+
text
|
|
574
|
+
}) {
|
|
575
|
+
const normalizedText = normalizedSnippetText(text);
|
|
576
|
+
if (normalizedText.length <= length) return normalizedText;
|
|
577
|
+
const matchIndex = firstMatchIndex(normalizedText, query);
|
|
578
|
+
if (matchIndex < 0) return `${normalizedText.slice(0, length).trimEnd()}...`;
|
|
579
|
+
const halfLength = Math.floor(length / 2);
|
|
580
|
+
let start = Math.max(0, matchIndex - halfLength);
|
|
581
|
+
let end = Math.min(normalizedText.length, start + length);
|
|
582
|
+
if (end - start < length) {
|
|
583
|
+
start = Math.max(0, end - length);
|
|
584
|
+
}
|
|
585
|
+
if (start > 0) {
|
|
586
|
+
const nextSpace = normalizedText.indexOf(" ", start);
|
|
587
|
+
if (nextSpace > start && nextSpace < matchIndex) {
|
|
588
|
+
start = nextSpace + 1;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
if (end < normalizedText.length) {
|
|
592
|
+
const previousSpace = normalizedText.lastIndexOf(" ", end);
|
|
593
|
+
if (previousSpace > matchIndex) {
|
|
594
|
+
end = previousSpace;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
const prefix = start > 0 ? "... " : "";
|
|
598
|
+
const suffix = end < normalizedText.length ? " ..." : "";
|
|
599
|
+
return `${prefix}${normalizedText.slice(start, end).trim()}${suffix}`;
|
|
600
|
+
}
|
|
601
|
+
function resultSnippet({
|
|
602
|
+
query,
|
|
603
|
+
result
|
|
604
|
+
}) {
|
|
605
|
+
const description = normalizedSnippetText(result.meta.description);
|
|
606
|
+
if (description && queryMatches(description, query)) {
|
|
607
|
+
return contextualSnippet({ query, text: description });
|
|
608
|
+
}
|
|
609
|
+
const excerpt = normalizedSnippetText(result.plainExcerpt);
|
|
610
|
+
if (excerpt) {
|
|
611
|
+
return contextualSnippet({ query, text: excerpt });
|
|
612
|
+
}
|
|
613
|
+
return description ? contextualSnippet({ query, text: description }) : "";
|
|
614
|
+
}
|
|
615
|
+
function HighlightedText({ query, text }) {
|
|
616
|
+
const normalizedQuery = query.trim().toLowerCase();
|
|
617
|
+
if (!normalizedQuery) return text;
|
|
618
|
+
const lower = text.toLowerCase();
|
|
619
|
+
const phraseStart = lower.indexOf(normalizedQuery);
|
|
620
|
+
const terms = phraseStart >= 0 ? [normalizedQuery] : normalizedQuery.split(/\s+/).filter((term) => term.length > 1);
|
|
621
|
+
if (terms.length === 0) return text;
|
|
622
|
+
const ranges = terms.flatMap((term) => {
|
|
623
|
+
const termRanges = [];
|
|
624
|
+
let start = lower.indexOf(term);
|
|
625
|
+
while (start >= 0) {
|
|
626
|
+
termRanges.push({ end: start + term.length, start });
|
|
627
|
+
start = lower.indexOf(term, start + term.length);
|
|
628
|
+
}
|
|
629
|
+
return termRanges;
|
|
630
|
+
}).sort((left, right) => left.start - right.start);
|
|
631
|
+
const mergedRanges = [];
|
|
632
|
+
for (const range of ranges) {
|
|
633
|
+
const previous = mergedRanges.at(-1);
|
|
634
|
+
if (previous && range.start <= previous.end) {
|
|
635
|
+
previous.end = Math.max(previous.end, range.end);
|
|
636
|
+
} else {
|
|
637
|
+
mergedRanges.push({ ...range });
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
if (mergedRanges.length === 0) return text;
|
|
641
|
+
const parts = [];
|
|
642
|
+
let cursor = 0;
|
|
643
|
+
for (const range of mergedRanges) {
|
|
644
|
+
if (range.start > cursor) {
|
|
645
|
+
parts.push(text.slice(cursor, range.start));
|
|
646
|
+
}
|
|
647
|
+
parts.push(
|
|
648
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
649
|
+
"mark",
|
|
650
|
+
{
|
|
651
|
+
className: "rounded-[1px] bg-accent-soft text-accent-1",
|
|
652
|
+
children: text.slice(range.start, range.end)
|
|
653
|
+
},
|
|
654
|
+
`${range.start}-${range.end}`
|
|
655
|
+
)
|
|
656
|
+
);
|
|
657
|
+
cursor = range.end;
|
|
658
|
+
}
|
|
659
|
+
if (cursor < text.length) {
|
|
660
|
+
parts.push(text.slice(cursor));
|
|
661
|
+
}
|
|
662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: parts });
|
|
663
|
+
}
|
|
664
|
+
function Command({ children, className } = {}) {
|
|
665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
666
|
+
"div",
|
|
667
|
+
{
|
|
668
|
+
className: cn(
|
|
669
|
+
"relative overflow-hidden rounded-dialog bg-surface-1 text-foreground-1",
|
|
670
|
+
className
|
|
671
|
+
),
|
|
672
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
673
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SearchInputField, {}),
|
|
674
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SearchProgressBar, { className: "absolute inset-x-0 top-12 z-10" }),
|
|
675
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SearchResults, {})
|
|
676
|
+
] })
|
|
677
|
+
}
|
|
678
|
+
);
|
|
679
|
+
}
|
|
680
|
+
function DefaultDesktop({ children, ...rootProps }) {
|
|
681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root, { variant: "desktop", ...rootProps, children: children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
682
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Trigger, {}),
|
|
683
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Command, {}) })
|
|
684
|
+
] }) });
|
|
685
|
+
}
|
|
686
|
+
function DefaultMobile({ children, ...rootProps }) {
|
|
687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root, { variant: "mobile", ...rootProps, children: children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
688
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Trigger, { showShortcut: false }),
|
|
689
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Command, {}) })
|
|
690
|
+
] }) });
|
|
691
|
+
}
|
|
692
|
+
var Search = {
|
|
693
|
+
Command,
|
|
694
|
+
DefaultDesktop,
|
|
695
|
+
DefaultMobile,
|
|
696
|
+
DesktopDialog: DialogContent,
|
|
697
|
+
Dialog: DialogContent,
|
|
698
|
+
Input: SearchInputField,
|
|
699
|
+
MobileDialog: DialogContent,
|
|
700
|
+
Progress: SearchProgressBar,
|
|
701
|
+
Results: SearchResults,
|
|
702
|
+
Root,
|
|
703
|
+
Trigger
|
|
704
|
+
};
|
|
705
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
706
|
+
0 && (module.exports = {
|
|
707
|
+
Command,
|
|
708
|
+
DefaultDesktop,
|
|
709
|
+
DefaultMobile,
|
|
710
|
+
Dialog,
|
|
711
|
+
Input,
|
|
712
|
+
Progress,
|
|
713
|
+
Results,
|
|
714
|
+
Root,
|
|
715
|
+
Search,
|
|
716
|
+
Trigger
|
|
717
|
+
});
|