@publish.os/nextjs 0.0.1-alpha.2 → 0.0.1-alpha.3
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/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 +1039 -123
- package/dist/index.d.cts +11 -7
- package/dist/index.d.ts +11 -7
- package/dist/index.js +1027 -110
- 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 +208 -0
- package/dist/kernel/routes/agent/markdown.d.cts +59 -0
- package/dist/kernel/routes/agent/markdown.d.ts +59 -0
- package/dist/kernel/routes/agent/markdown.js +180 -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 +297 -0
- package/dist/kernel/routes/metadata/feed.d.cts +21 -0
- package/dist/kernel/routes/metadata/feed.d.ts +21 -0
- package/dist/kernel/routes/metadata/feed.js +269 -0
- package/dist/kernel/routes/metadata/llms.cjs +234 -0
- package/dist/kernel/routes/metadata/llms.d.cts +27 -0
- package/dist/kernel/routes/metadata/llms.d.ts +27 -0
- package/dist/kernel/routes/metadata/llms.js +206 -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 +48 -4
- 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 +113 -0
- package/dist/kernel/routes/metadata/sitemap.cjs +182 -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 +156 -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 +36 -39
- 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,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/kernel/components/blocks/navigation-progress.tsx
|
|
22
|
+
var navigation_progress_exports = {};
|
|
23
|
+
__export(navigation_progress_exports, {
|
|
24
|
+
NavigationProgressBar: () => NavigationProgressBar,
|
|
25
|
+
navigationProgressConfig: () => navigationProgressConfig
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(navigation_progress_exports);
|
|
28
|
+
var import_progress = require("../ui/progress.js");
|
|
29
|
+
|
|
30
|
+
// src/utils/cn.ts
|
|
31
|
+
var import_clsx = require("clsx");
|
|
32
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
33
|
+
var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
|
|
34
|
+
extend: {
|
|
35
|
+
classGroups: {
|
|
36
|
+
z: [
|
|
37
|
+
"z-content",
|
|
38
|
+
"z-nav",
|
|
39
|
+
"z-overlay",
|
|
40
|
+
"z-modal",
|
|
41
|
+
"z-search",
|
|
42
|
+
"z-toast",
|
|
43
|
+
"z-progress"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
function cn(...inputs) {
|
|
49
|
+
return twMerge((0, import_clsx.clsx)(inputs));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/kernel/components/blocks/navigation-progress.tsx
|
|
53
|
+
var import_navigation = require("next/navigation");
|
|
54
|
+
var import_react = require("react");
|
|
55
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
56
|
+
var navigationProgressConfig = {
|
|
57
|
+
initialProgress: 0,
|
|
58
|
+
targetProgress: 98,
|
|
59
|
+
fastPhaseEnd: 38,
|
|
60
|
+
minDuration: 48,
|
|
61
|
+
maxDuration: 1800,
|
|
62
|
+
completeDuration: 320,
|
|
63
|
+
exitDuration: 188,
|
|
64
|
+
settleDelay: 80,
|
|
65
|
+
timeout: 8e3
|
|
66
|
+
};
|
|
67
|
+
function normalizePath(path) {
|
|
68
|
+
const normalized = path.replace(/\/+$/, "");
|
|
69
|
+
return normalized || "/";
|
|
70
|
+
}
|
|
71
|
+
function normalizeHref(href) {
|
|
72
|
+
const [pathWithSearch = ""] = href.split("#");
|
|
73
|
+
const [path = "", search = ""] = pathWithSearch.split("?");
|
|
74
|
+
const normalizedPath = normalizePath(path);
|
|
75
|
+
return search ? `${normalizedPath}?${search}` : normalizedPath;
|
|
76
|
+
}
|
|
77
|
+
function shouldShowProgressFor(fromPath, toPath) {
|
|
78
|
+
if (!fromPath.trim() || !toPath.trim()) return false;
|
|
79
|
+
if (/^(mailto:|tel:|sms:)/i.test(toPath)) return false;
|
|
80
|
+
if (toPath.startsWith("#")) return false;
|
|
81
|
+
if (toPath.startsWith("/_next/") || toPath.startsWith("/static/")) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return normalizeHref(fromPath) !== normalizeHref(toPath);
|
|
85
|
+
}
|
|
86
|
+
function useNavigationProgress() {
|
|
87
|
+
const [progress, setProgress] = (0, import_react.useState)(0);
|
|
88
|
+
const [isExiting, setIsExiting] = (0, import_react.useState)(false);
|
|
89
|
+
const pathname = (0, import_navigation.usePathname)() || "/";
|
|
90
|
+
const searchParams = (0, import_navigation.useSearchParams)();
|
|
91
|
+
const currentUrl = `${pathname}${searchParams.size ? `?${searchParams}` : ""}`;
|
|
92
|
+
const navigation = (0, import_react.useRef)(null);
|
|
93
|
+
const animationFrame = (0, import_react.useRef)(null);
|
|
94
|
+
const completionTimer = (0, import_react.useRef)(null);
|
|
95
|
+
const cleanupTimer = (0, import_react.useRef)(null);
|
|
96
|
+
const previousUrl = (0, import_react.useRef)("");
|
|
97
|
+
const cleanup = (0, import_react.useCallback)(() => {
|
|
98
|
+
if (animationFrame.current !== null) {
|
|
99
|
+
cancelAnimationFrame(animationFrame.current);
|
|
100
|
+
}
|
|
101
|
+
if (completionTimer.current) clearTimeout(completionTimer.current);
|
|
102
|
+
if (cleanupTimer.current) clearTimeout(cleanupTimer.current);
|
|
103
|
+
if (navigation.current?.timeoutId) {
|
|
104
|
+
clearTimeout(navigation.current.timeoutId);
|
|
105
|
+
}
|
|
106
|
+
animationFrame.current = null;
|
|
107
|
+
completionTimer.current = null;
|
|
108
|
+
cleanupTimer.current = null;
|
|
109
|
+
navigation.current = null;
|
|
110
|
+
}, []);
|
|
111
|
+
const completeNavigation = (0, import_react.useCallback)(() => {
|
|
112
|
+
if (!navigation.current) return;
|
|
113
|
+
if (animationFrame.current !== null) {
|
|
114
|
+
cancelAnimationFrame(animationFrame.current);
|
|
115
|
+
animationFrame.current = null;
|
|
116
|
+
}
|
|
117
|
+
if (completionTimer.current) {
|
|
118
|
+
clearTimeout(completionTimer.current);
|
|
119
|
+
completionTimer.current = null;
|
|
120
|
+
}
|
|
121
|
+
if (cleanupTimer.current) {
|
|
122
|
+
clearTimeout(cleanupTimer.current);
|
|
123
|
+
cleanupTimer.current = null;
|
|
124
|
+
}
|
|
125
|
+
if (navigation.current.timeoutId) {
|
|
126
|
+
clearTimeout(navigation.current.timeoutId);
|
|
127
|
+
navigation.current.timeoutId = null;
|
|
128
|
+
}
|
|
129
|
+
setProgress(100);
|
|
130
|
+
cleanupTimer.current = setTimeout(() => {
|
|
131
|
+
if (!navigation.current) return;
|
|
132
|
+
setIsExiting(true);
|
|
133
|
+
cleanupTimer.current = setTimeout(() => {
|
|
134
|
+
setProgress(0);
|
|
135
|
+
setIsExiting(false);
|
|
136
|
+
navigation.current = null;
|
|
137
|
+
cleanupTimer.current = null;
|
|
138
|
+
}, navigationProgressConfig.exitDuration);
|
|
139
|
+
}, navigationProgressConfig.completeDuration);
|
|
140
|
+
}, []);
|
|
141
|
+
const reset = (0, import_react.useCallback)(() => {
|
|
142
|
+
cleanup();
|
|
143
|
+
setProgress(0);
|
|
144
|
+
setIsExiting(false);
|
|
145
|
+
}, [cleanup]);
|
|
146
|
+
const startNavigation = (0, import_react.useCallback)(
|
|
147
|
+
(fromPath, toPath) => {
|
|
148
|
+
if (!shouldShowProgressFor(fromPath, toPath)) return;
|
|
149
|
+
const normalizedTarget = normalizeHref(toPath);
|
|
150
|
+
if (navigation.current?.targetPath === normalizedTarget) return;
|
|
151
|
+
cleanup();
|
|
152
|
+
setIsExiting(false);
|
|
153
|
+
setProgress(navigationProgressConfig.initialProgress);
|
|
154
|
+
const timeoutId = setTimeout(() => {
|
|
155
|
+
completeNavigation();
|
|
156
|
+
}, navigationProgressConfig.timeout);
|
|
157
|
+
const startTime = Date.now();
|
|
158
|
+
navigation.current = {
|
|
159
|
+
startTime,
|
|
160
|
+
targetPath: normalizedTarget,
|
|
161
|
+
timeoutId
|
|
162
|
+
};
|
|
163
|
+
const animate = () => {
|
|
164
|
+
if (!navigation.current) return;
|
|
165
|
+
const elapsed = Date.now() - startTime;
|
|
166
|
+
let progressValue;
|
|
167
|
+
if (elapsed < navigationProgressConfig.minDuration) {
|
|
168
|
+
progressValue = navigationProgressConfig.initialProgress + elapsed / navigationProgressConfig.minDuration * (navigationProgressConfig.fastPhaseEnd - navigationProgressConfig.initialProgress);
|
|
169
|
+
} else {
|
|
170
|
+
const remainingProgress = navigationProgressConfig.targetProgress - navigationProgressConfig.fastPhaseEnd;
|
|
171
|
+
const normalizedTime = Math.min(
|
|
172
|
+
1,
|
|
173
|
+
(elapsed - navigationProgressConfig.minDuration) / (navigationProgressConfig.maxDuration - navigationProgressConfig.minDuration)
|
|
174
|
+
);
|
|
175
|
+
const easedTime = 1 - (1 - normalizedTime) ** 3;
|
|
176
|
+
progressValue = navigationProgressConfig.fastPhaseEnd + easedTime * remainingProgress;
|
|
177
|
+
}
|
|
178
|
+
setProgress(
|
|
179
|
+
Math.min(navigationProgressConfig.targetProgress, progressValue)
|
|
180
|
+
);
|
|
181
|
+
animationFrame.current = requestAnimationFrame(animate);
|
|
182
|
+
};
|
|
183
|
+
animationFrame.current = requestAnimationFrame(animate);
|
|
184
|
+
},
|
|
185
|
+
[cleanup, completeNavigation]
|
|
186
|
+
);
|
|
187
|
+
(0, import_react.useEffect)(() => {
|
|
188
|
+
if (!previousUrl.current) {
|
|
189
|
+
previousUrl.current = currentUrl;
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (navigation.current && currentUrl !== previousUrl.current) {
|
|
193
|
+
if (completionTimer.current) clearTimeout(completionTimer.current);
|
|
194
|
+
completionTimer.current = setTimeout(() => {
|
|
195
|
+
completionTimer.current = null;
|
|
196
|
+
completeNavigation();
|
|
197
|
+
}, navigationProgressConfig.settleDelay);
|
|
198
|
+
}
|
|
199
|
+
previousUrl.current = currentUrl;
|
|
200
|
+
}, [completeNavigation, currentUrl]);
|
|
201
|
+
(0, import_react.useEffect)(() => {
|
|
202
|
+
const handleClick = (event) => {
|
|
203
|
+
if (event.button !== 0) return;
|
|
204
|
+
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const target = event.target;
|
|
208
|
+
if (!(target instanceof Element)) return;
|
|
209
|
+
if (target.closest("button, input, select, textarea, [role='button']")) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
const anchor = target.closest("a");
|
|
213
|
+
if (!anchor?.href) return;
|
|
214
|
+
if (anchor.target && anchor.target !== "_self") return;
|
|
215
|
+
if (anchor.hasAttribute("download")) return;
|
|
216
|
+
try {
|
|
217
|
+
const url = new URL(anchor.href, window.location.origin);
|
|
218
|
+
if (url.origin !== window.location.origin) return;
|
|
219
|
+
const targetPath = `${url.pathname}${url.search}`;
|
|
220
|
+
startNavigation(currentUrl, targetPath);
|
|
221
|
+
} catch {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
document.addEventListener("click", handleClick);
|
|
226
|
+
return () => document.removeEventListener("click", handleClick);
|
|
227
|
+
}, [currentUrl, startNavigation]);
|
|
228
|
+
(0, import_react.useEffect)(() => reset, [reset]);
|
|
229
|
+
return { isExiting, progress };
|
|
230
|
+
}
|
|
231
|
+
function NavigationProgressContent() {
|
|
232
|
+
const { isExiting, progress } = useNavigationProgress();
|
|
233
|
+
const isVisible = progress > 0;
|
|
234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
235
|
+
import_progress.Progress,
|
|
236
|
+
{
|
|
237
|
+
"aria-label": "Page navigation",
|
|
238
|
+
className: cn(
|
|
239
|
+
"pointer-events-none fixed left-0 right-0 top-0 z-progress overflow-hidden transition-opacity duration-300",
|
|
240
|
+
isVisible ? "opacity-100" : "opacity-0"
|
|
241
|
+
),
|
|
242
|
+
style: {
|
|
243
|
+
height: "var(--progress-bar-height, 2px)"
|
|
244
|
+
},
|
|
245
|
+
value: isVisible ? progress : null,
|
|
246
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_progress.ProgressTrack, { className: "h-full rounded-none bg-progress-bar-background", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
247
|
+
import_progress.ProgressIndicator,
|
|
248
|
+
{
|
|
249
|
+
className: cn(
|
|
250
|
+
"h-full w-full rounded-none bg-progress-bar-fill",
|
|
251
|
+
progress === 0 && "scale-x-0"
|
|
252
|
+
),
|
|
253
|
+
style: {
|
|
254
|
+
transform: isExiting ? "scaleX(0)" : `scaleX(${Math.max(0, Math.min(100, progress)) / 100})`,
|
|
255
|
+
transformOrigin: isExiting ? "right" : "left",
|
|
256
|
+
transition: isExiting ? `transform ${navigationProgressConfig.exitDuration}ms var(--animation-ease-progress-exit)` : `transform ${navigationProgressConfig.completeDuration}ms var(--animation-ease-progress)`
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
) })
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
function NavigationProgressBar() {
|
|
264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NavigationProgressContent, {}) });
|
|
265
|
+
}
|
|
266
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
267
|
+
0 && (module.exports = {
|
|
268
|
+
NavigationProgressBar,
|
|
269
|
+
navigationProgressConfig
|
|
270
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
declare const navigationProgressConfig: {
|
|
4
|
+
initialProgress: number;
|
|
5
|
+
targetProgress: number;
|
|
6
|
+
fastPhaseEnd: number;
|
|
7
|
+
minDuration: number;
|
|
8
|
+
maxDuration: number;
|
|
9
|
+
completeDuration: number;
|
|
10
|
+
exitDuration: number;
|
|
11
|
+
settleDelay: number;
|
|
12
|
+
timeout: number;
|
|
13
|
+
};
|
|
14
|
+
declare function NavigationProgressBar(): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { NavigationProgressBar, navigationProgressConfig };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
declare const navigationProgressConfig: {
|
|
4
|
+
initialProgress: number;
|
|
5
|
+
targetProgress: number;
|
|
6
|
+
fastPhaseEnd: number;
|
|
7
|
+
minDuration: number;
|
|
8
|
+
maxDuration: number;
|
|
9
|
+
completeDuration: number;
|
|
10
|
+
exitDuration: number;
|
|
11
|
+
settleDelay: number;
|
|
12
|
+
timeout: number;
|
|
13
|
+
};
|
|
14
|
+
declare function NavigationProgressBar(): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { NavigationProgressBar, navigationProgressConfig };
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/kernel/components/blocks/navigation-progress.tsx
|
|
4
|
+
import {
|
|
5
|
+
Progress,
|
|
6
|
+
ProgressIndicator,
|
|
7
|
+
ProgressTrack
|
|
8
|
+
} from "../ui/progress.js";
|
|
9
|
+
|
|
10
|
+
// src/utils/cn.ts
|
|
11
|
+
import { clsx } from "clsx";
|
|
12
|
+
import { extendTailwindMerge } from "tailwind-merge";
|
|
13
|
+
var twMerge = extendTailwindMerge({
|
|
14
|
+
extend: {
|
|
15
|
+
classGroups: {
|
|
16
|
+
z: [
|
|
17
|
+
"z-content",
|
|
18
|
+
"z-nav",
|
|
19
|
+
"z-overlay",
|
|
20
|
+
"z-modal",
|
|
21
|
+
"z-search",
|
|
22
|
+
"z-toast",
|
|
23
|
+
"z-progress"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
function cn(...inputs) {
|
|
29
|
+
return twMerge(clsx(inputs));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// src/kernel/components/blocks/navigation-progress.tsx
|
|
33
|
+
import { usePathname, useSearchParams } from "next/navigation";
|
|
34
|
+
import { Suspense, useCallback, useEffect, useRef, useState } from "react";
|
|
35
|
+
import { jsx } from "react/jsx-runtime";
|
|
36
|
+
var navigationProgressConfig = {
|
|
37
|
+
initialProgress: 0,
|
|
38
|
+
targetProgress: 98,
|
|
39
|
+
fastPhaseEnd: 38,
|
|
40
|
+
minDuration: 48,
|
|
41
|
+
maxDuration: 1800,
|
|
42
|
+
completeDuration: 320,
|
|
43
|
+
exitDuration: 188,
|
|
44
|
+
settleDelay: 80,
|
|
45
|
+
timeout: 8e3
|
|
46
|
+
};
|
|
47
|
+
function normalizePath(path) {
|
|
48
|
+
const normalized = path.replace(/\/+$/, "");
|
|
49
|
+
return normalized || "/";
|
|
50
|
+
}
|
|
51
|
+
function normalizeHref(href) {
|
|
52
|
+
const [pathWithSearch = ""] = href.split("#");
|
|
53
|
+
const [path = "", search = ""] = pathWithSearch.split("?");
|
|
54
|
+
const normalizedPath = normalizePath(path);
|
|
55
|
+
return search ? `${normalizedPath}?${search}` : normalizedPath;
|
|
56
|
+
}
|
|
57
|
+
function shouldShowProgressFor(fromPath, toPath) {
|
|
58
|
+
if (!fromPath.trim() || !toPath.trim()) return false;
|
|
59
|
+
if (/^(mailto:|tel:|sms:)/i.test(toPath)) return false;
|
|
60
|
+
if (toPath.startsWith("#")) return false;
|
|
61
|
+
if (toPath.startsWith("/_next/") || toPath.startsWith("/static/")) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return normalizeHref(fromPath) !== normalizeHref(toPath);
|
|
65
|
+
}
|
|
66
|
+
function useNavigationProgress() {
|
|
67
|
+
const [progress, setProgress] = useState(0);
|
|
68
|
+
const [isExiting, setIsExiting] = useState(false);
|
|
69
|
+
const pathname = usePathname() || "/";
|
|
70
|
+
const searchParams = useSearchParams();
|
|
71
|
+
const currentUrl = `${pathname}${searchParams.size ? `?${searchParams}` : ""}`;
|
|
72
|
+
const navigation = useRef(null);
|
|
73
|
+
const animationFrame = useRef(null);
|
|
74
|
+
const completionTimer = useRef(null);
|
|
75
|
+
const cleanupTimer = useRef(null);
|
|
76
|
+
const previousUrl = useRef("");
|
|
77
|
+
const cleanup = useCallback(() => {
|
|
78
|
+
if (animationFrame.current !== null) {
|
|
79
|
+
cancelAnimationFrame(animationFrame.current);
|
|
80
|
+
}
|
|
81
|
+
if (completionTimer.current) clearTimeout(completionTimer.current);
|
|
82
|
+
if (cleanupTimer.current) clearTimeout(cleanupTimer.current);
|
|
83
|
+
if (navigation.current?.timeoutId) {
|
|
84
|
+
clearTimeout(navigation.current.timeoutId);
|
|
85
|
+
}
|
|
86
|
+
animationFrame.current = null;
|
|
87
|
+
completionTimer.current = null;
|
|
88
|
+
cleanupTimer.current = null;
|
|
89
|
+
navigation.current = null;
|
|
90
|
+
}, []);
|
|
91
|
+
const completeNavigation = useCallback(() => {
|
|
92
|
+
if (!navigation.current) return;
|
|
93
|
+
if (animationFrame.current !== null) {
|
|
94
|
+
cancelAnimationFrame(animationFrame.current);
|
|
95
|
+
animationFrame.current = null;
|
|
96
|
+
}
|
|
97
|
+
if (completionTimer.current) {
|
|
98
|
+
clearTimeout(completionTimer.current);
|
|
99
|
+
completionTimer.current = null;
|
|
100
|
+
}
|
|
101
|
+
if (cleanupTimer.current) {
|
|
102
|
+
clearTimeout(cleanupTimer.current);
|
|
103
|
+
cleanupTimer.current = null;
|
|
104
|
+
}
|
|
105
|
+
if (navigation.current.timeoutId) {
|
|
106
|
+
clearTimeout(navigation.current.timeoutId);
|
|
107
|
+
navigation.current.timeoutId = null;
|
|
108
|
+
}
|
|
109
|
+
setProgress(100);
|
|
110
|
+
cleanupTimer.current = setTimeout(() => {
|
|
111
|
+
if (!navigation.current) return;
|
|
112
|
+
setIsExiting(true);
|
|
113
|
+
cleanupTimer.current = setTimeout(() => {
|
|
114
|
+
setProgress(0);
|
|
115
|
+
setIsExiting(false);
|
|
116
|
+
navigation.current = null;
|
|
117
|
+
cleanupTimer.current = null;
|
|
118
|
+
}, navigationProgressConfig.exitDuration);
|
|
119
|
+
}, navigationProgressConfig.completeDuration);
|
|
120
|
+
}, []);
|
|
121
|
+
const reset = useCallback(() => {
|
|
122
|
+
cleanup();
|
|
123
|
+
setProgress(0);
|
|
124
|
+
setIsExiting(false);
|
|
125
|
+
}, [cleanup]);
|
|
126
|
+
const startNavigation = useCallback(
|
|
127
|
+
(fromPath, toPath) => {
|
|
128
|
+
if (!shouldShowProgressFor(fromPath, toPath)) return;
|
|
129
|
+
const normalizedTarget = normalizeHref(toPath);
|
|
130
|
+
if (navigation.current?.targetPath === normalizedTarget) return;
|
|
131
|
+
cleanup();
|
|
132
|
+
setIsExiting(false);
|
|
133
|
+
setProgress(navigationProgressConfig.initialProgress);
|
|
134
|
+
const timeoutId = setTimeout(() => {
|
|
135
|
+
completeNavigation();
|
|
136
|
+
}, navigationProgressConfig.timeout);
|
|
137
|
+
const startTime = Date.now();
|
|
138
|
+
navigation.current = {
|
|
139
|
+
startTime,
|
|
140
|
+
targetPath: normalizedTarget,
|
|
141
|
+
timeoutId
|
|
142
|
+
};
|
|
143
|
+
const animate = () => {
|
|
144
|
+
if (!navigation.current) return;
|
|
145
|
+
const elapsed = Date.now() - startTime;
|
|
146
|
+
let progressValue;
|
|
147
|
+
if (elapsed < navigationProgressConfig.minDuration) {
|
|
148
|
+
progressValue = navigationProgressConfig.initialProgress + elapsed / navigationProgressConfig.minDuration * (navigationProgressConfig.fastPhaseEnd - navigationProgressConfig.initialProgress);
|
|
149
|
+
} else {
|
|
150
|
+
const remainingProgress = navigationProgressConfig.targetProgress - navigationProgressConfig.fastPhaseEnd;
|
|
151
|
+
const normalizedTime = Math.min(
|
|
152
|
+
1,
|
|
153
|
+
(elapsed - navigationProgressConfig.minDuration) / (navigationProgressConfig.maxDuration - navigationProgressConfig.minDuration)
|
|
154
|
+
);
|
|
155
|
+
const easedTime = 1 - (1 - normalizedTime) ** 3;
|
|
156
|
+
progressValue = navigationProgressConfig.fastPhaseEnd + easedTime * remainingProgress;
|
|
157
|
+
}
|
|
158
|
+
setProgress(
|
|
159
|
+
Math.min(navigationProgressConfig.targetProgress, progressValue)
|
|
160
|
+
);
|
|
161
|
+
animationFrame.current = requestAnimationFrame(animate);
|
|
162
|
+
};
|
|
163
|
+
animationFrame.current = requestAnimationFrame(animate);
|
|
164
|
+
},
|
|
165
|
+
[cleanup, completeNavigation]
|
|
166
|
+
);
|
|
167
|
+
useEffect(() => {
|
|
168
|
+
if (!previousUrl.current) {
|
|
169
|
+
previousUrl.current = currentUrl;
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (navigation.current && currentUrl !== previousUrl.current) {
|
|
173
|
+
if (completionTimer.current) clearTimeout(completionTimer.current);
|
|
174
|
+
completionTimer.current = setTimeout(() => {
|
|
175
|
+
completionTimer.current = null;
|
|
176
|
+
completeNavigation();
|
|
177
|
+
}, navigationProgressConfig.settleDelay);
|
|
178
|
+
}
|
|
179
|
+
previousUrl.current = currentUrl;
|
|
180
|
+
}, [completeNavigation, currentUrl]);
|
|
181
|
+
useEffect(() => {
|
|
182
|
+
const handleClick = (event) => {
|
|
183
|
+
if (event.button !== 0) return;
|
|
184
|
+
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const target = event.target;
|
|
188
|
+
if (!(target instanceof Element)) return;
|
|
189
|
+
if (target.closest("button, input, select, textarea, [role='button']")) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const anchor = target.closest("a");
|
|
193
|
+
if (!anchor?.href) return;
|
|
194
|
+
if (anchor.target && anchor.target !== "_self") return;
|
|
195
|
+
if (anchor.hasAttribute("download")) return;
|
|
196
|
+
try {
|
|
197
|
+
const url = new URL(anchor.href, window.location.origin);
|
|
198
|
+
if (url.origin !== window.location.origin) return;
|
|
199
|
+
const targetPath = `${url.pathname}${url.search}`;
|
|
200
|
+
startNavigation(currentUrl, targetPath);
|
|
201
|
+
} catch {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
document.addEventListener("click", handleClick);
|
|
206
|
+
return () => document.removeEventListener("click", handleClick);
|
|
207
|
+
}, [currentUrl, startNavigation]);
|
|
208
|
+
useEffect(() => reset, [reset]);
|
|
209
|
+
return { isExiting, progress };
|
|
210
|
+
}
|
|
211
|
+
function NavigationProgressContent() {
|
|
212
|
+
const { isExiting, progress } = useNavigationProgress();
|
|
213
|
+
const isVisible = progress > 0;
|
|
214
|
+
return /* @__PURE__ */ jsx(
|
|
215
|
+
Progress,
|
|
216
|
+
{
|
|
217
|
+
"aria-label": "Page navigation",
|
|
218
|
+
className: cn(
|
|
219
|
+
"pointer-events-none fixed left-0 right-0 top-0 z-progress overflow-hidden transition-opacity duration-300",
|
|
220
|
+
isVisible ? "opacity-100" : "opacity-0"
|
|
221
|
+
),
|
|
222
|
+
style: {
|
|
223
|
+
height: "var(--progress-bar-height, 2px)"
|
|
224
|
+
},
|
|
225
|
+
value: isVisible ? progress : null,
|
|
226
|
+
children: /* @__PURE__ */ jsx(ProgressTrack, { className: "h-full rounded-none bg-progress-bar-background", children: /* @__PURE__ */ jsx(
|
|
227
|
+
ProgressIndicator,
|
|
228
|
+
{
|
|
229
|
+
className: cn(
|
|
230
|
+
"h-full w-full rounded-none bg-progress-bar-fill",
|
|
231
|
+
progress === 0 && "scale-x-0"
|
|
232
|
+
),
|
|
233
|
+
style: {
|
|
234
|
+
transform: isExiting ? "scaleX(0)" : `scaleX(${Math.max(0, Math.min(100, progress)) / 100})`,
|
|
235
|
+
transformOrigin: isExiting ? "right" : "left",
|
|
236
|
+
transition: isExiting ? `transform ${navigationProgressConfig.exitDuration}ms var(--animation-ease-progress-exit)` : `transform ${navigationProgressConfig.completeDuration}ms var(--animation-ease-progress)`
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
) })
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
function NavigationProgressBar() {
|
|
244
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(NavigationProgressContent, {}) });
|
|
245
|
+
}
|
|
246
|
+
export {
|
|
247
|
+
NavigationProgressBar,
|
|
248
|
+
navigationProgressConfig
|
|
249
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/kernel/components/blocks/next-prev.tsx
|
|
31
|
+
var next_prev_exports = {};
|
|
32
|
+
__export(next_prev_exports, {
|
|
33
|
+
NextPrev: () => NextPrev
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(next_prev_exports);
|
|
36
|
+
|
|
37
|
+
// src/utils/cn.ts
|
|
38
|
+
var import_clsx = require("clsx");
|
|
39
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
40
|
+
var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
|
|
41
|
+
extend: {
|
|
42
|
+
classGroups: {
|
|
43
|
+
z: [
|
|
44
|
+
"z-content",
|
|
45
|
+
"z-nav",
|
|
46
|
+
"z-overlay",
|
|
47
|
+
"z-modal",
|
|
48
|
+
"z-search",
|
|
49
|
+
"z-toast",
|
|
50
|
+
"z-progress"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
function cn(...inputs) {
|
|
56
|
+
return twMerge((0, import_clsx.clsx)(inputs));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// src/kernel/components/blocks/next-prev.tsx
|
|
60
|
+
var import_lucide_react = require("lucide-react");
|
|
61
|
+
var import_link = __toESM(require("next/link"), 1);
|
|
62
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
63
|
+
function pageNodes(nodes) {
|
|
64
|
+
return nodes.flatMap((node) => {
|
|
65
|
+
if (node.type === "page") return [node];
|
|
66
|
+
if (node.type === "section" || node.type === "folder") {
|
|
67
|
+
return pageNodes(node.children);
|
|
68
|
+
}
|
|
69
|
+
return [];
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function DirectionIcon({ direction }) {
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "shrink-0 text-foreground-3 transition-colors duration-200 group-hover/next-prev:text-foreground-2", children: direction === "previous" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronLeft, { "aria-hidden": "true", size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronRight, { "aria-hidden": "true", size: 14 }) });
|
|
74
|
+
}
|
|
75
|
+
function NavigationCard({
|
|
76
|
+
direction,
|
|
77
|
+
page
|
|
78
|
+
}) {
|
|
79
|
+
const isNext = direction === "next";
|
|
80
|
+
const label = isNext ? "Next" : "Previous";
|
|
81
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
82
|
+
import_link.default,
|
|
83
|
+
{
|
|
84
|
+
className: cn(
|
|
85
|
+
"group/next-prev grid min-h-24 w-full min-w-0 overflow-hidden rounded-card border border-stroke-3 bg-surface-1 p-px text-left text-foreground-1 no-underline shadow-xs transition-[border-color,box-shadow] duration-200 hover:text-foreground-1 hover:no-underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring [&_*]:!no-underline",
|
|
86
|
+
isNext && "md:text-right"
|
|
87
|
+
),
|
|
88
|
+
href: page.path,
|
|
89
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
className: cn(
|
|
93
|
+
"flex h-full w-full flex-col gap-2 rounded-[max(calc(var(--radius-card)-1px),0px)] p-4 transition-colors duration-300 group-hover/next-prev:bg-surface-hover group-active/next-prev:bg-surface-active",
|
|
94
|
+
isNext ? "items-start md:items-end" : "items-start"
|
|
95
|
+
),
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
98
|
+
"span",
|
|
99
|
+
{
|
|
100
|
+
className: cn(
|
|
101
|
+
"flex w-full items-center gap-1.5",
|
|
102
|
+
isNext && "md:justify-end"
|
|
103
|
+
),
|
|
104
|
+
children: [
|
|
105
|
+
!isNext && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DirectionIcon, { direction }),
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs font-medium leading-none text-foreground-3 transition-colors duration-200", children: label }),
|
|
107
|
+
isNext && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DirectionIcon, { direction })
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "line-clamp-2 text-sm font-medium leading-6 text-foreground-1 transition-colors duration-200", children: page.title })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
function NextPrev({ className, currentPath, tree }) {
|
|
119
|
+
const pages = pageNodes(tree);
|
|
120
|
+
const index = pages.findIndex((page) => page.path === currentPath);
|
|
121
|
+
const previous = index > 0 ? pages[index - 1] : null;
|
|
122
|
+
const next = index >= 0 ? pages[index + 1] : null;
|
|
123
|
+
const hasBoth = Boolean(previous && next);
|
|
124
|
+
if (!previous && !next) return null;
|
|
125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { "aria-label": "Previous and next pages", className, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
className: cn(
|
|
129
|
+
"grid gap-4 border-t border-stroke-3 pt-6",
|
|
130
|
+
hasBoth && "md:grid-cols-2"
|
|
131
|
+
),
|
|
132
|
+
children: [
|
|
133
|
+
previous ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NavigationCard, { direction: "previous", page: previous }) : null,
|
|
134
|
+
next ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NavigationCard, { direction: "next", page: next }) : null
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
) });
|
|
138
|
+
}
|
|
139
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
140
|
+
0 && (module.exports = {
|
|
141
|
+
NextPrev
|
|
142
|
+
});
|