@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
package/dist/search.js
ADDED
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/search.tsx
|
|
4
|
+
import { useShortcut } from "@publish.os/nextjs/keyboard-shortcuts";
|
|
5
|
+
import { useRouter } from "next/navigation";
|
|
6
|
+
import {
|
|
7
|
+
createContext,
|
|
8
|
+
useCallback,
|
|
9
|
+
useContext,
|
|
10
|
+
useEffect,
|
|
11
|
+
useId,
|
|
12
|
+
useMemo,
|
|
13
|
+
useRef,
|
|
14
|
+
useState
|
|
15
|
+
} from "react";
|
|
16
|
+
import { jsx } from "react/jsx-runtime";
|
|
17
|
+
var EMPTY_SEARCH_OUTPUT = {
|
|
18
|
+
items: [],
|
|
19
|
+
nextOffset: null,
|
|
20
|
+
status: "idle",
|
|
21
|
+
total: 0
|
|
22
|
+
};
|
|
23
|
+
var MAX_SEARCH_QUERY_LENGTH = 128;
|
|
24
|
+
var MAX_SEARCH_RESULTS = 20;
|
|
25
|
+
var DEFAULT_SEARCH_LIMIT = 10;
|
|
26
|
+
var SEARCH_DEBOUNCE_MS = 140;
|
|
27
|
+
var SearchBlockContext = createContext(null);
|
|
28
|
+
function normalizeSearchInput(input) {
|
|
29
|
+
return {
|
|
30
|
+
filters: input.filters,
|
|
31
|
+
limit: Math.min(
|
|
32
|
+
Math.max(1, Math.floor(input.limit ?? DEFAULT_SEARCH_LIMIT)),
|
|
33
|
+
MAX_SEARCH_RESULTS
|
|
34
|
+
),
|
|
35
|
+
offset: Math.max(0, Math.floor(input.offset ?? 0)),
|
|
36
|
+
q: input.q.trim().slice(0, MAX_SEARCH_QUERY_LENGTH)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function inactiveIndexMessage() {
|
|
40
|
+
return {
|
|
41
|
+
items: [],
|
|
42
|
+
message: "Building search index...",
|
|
43
|
+
nextOffset: null,
|
|
44
|
+
status: "building",
|
|
45
|
+
total: 0
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
var SEARCH_STATUS_URL = "/pagefind/publishos-search-status.json";
|
|
49
|
+
var PAGEFIND_URL = "/pagefind/pagefind.js";
|
|
50
|
+
var pagefindModulePromise = null;
|
|
51
|
+
async function fetchSearchStatus(signal) {
|
|
52
|
+
const response = await fetch(SEARCH_STATUS_URL, {
|
|
53
|
+
cache: "no-store",
|
|
54
|
+
signal
|
|
55
|
+
}).catch((error) => {
|
|
56
|
+
if (error instanceof DOMException && error.name === "AbortError") {
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
});
|
|
61
|
+
if (!response?.ok) return null;
|
|
62
|
+
return await response.json();
|
|
63
|
+
}
|
|
64
|
+
async function loadPagefind() {
|
|
65
|
+
pagefindModulePromise ??= new Function("src", "return import(src)")(PAGEFIND_URL).then(async (mod) => {
|
|
66
|
+
const pagefind = mod;
|
|
67
|
+
await pagefind.options?.({ bundlePath: "/pagefind/" });
|
|
68
|
+
await pagefind.init?.();
|
|
69
|
+
return pagefind;
|
|
70
|
+
});
|
|
71
|
+
return pagefindModulePromise;
|
|
72
|
+
}
|
|
73
|
+
function pagefindFilters(filters) {
|
|
74
|
+
if (!filters) return void 0;
|
|
75
|
+
const entries = Object.entries({
|
|
76
|
+
author: filters.author,
|
|
77
|
+
group: filters.group,
|
|
78
|
+
tag: filters.tag
|
|
79
|
+
}).filter((entry) => Boolean(entry[1]));
|
|
80
|
+
return entries.length > 0 ? Object.fromEntries(entries) : void 0;
|
|
81
|
+
}
|
|
82
|
+
function titleForResult(data) {
|
|
83
|
+
return data.meta?.title ?? data.sub_results?.find((subResult) => subResult.title)?.title ?? data.url;
|
|
84
|
+
}
|
|
85
|
+
function toSearchResult({
|
|
86
|
+
data,
|
|
87
|
+
fallbackId,
|
|
88
|
+
score
|
|
89
|
+
}) {
|
|
90
|
+
const title = titleForResult(data);
|
|
91
|
+
const excerpt = data.excerpt ?? "";
|
|
92
|
+
return {
|
|
93
|
+
excerpt,
|
|
94
|
+
id: data.url || fallbackId,
|
|
95
|
+
meta: data.meta ?? {},
|
|
96
|
+
plainExcerpt: data.plain_excerpt ?? excerpt.replace(/<[^>]*>/g, ""),
|
|
97
|
+
score,
|
|
98
|
+
subResults: (data.sub_results ?? []).map((result) => ({
|
|
99
|
+
excerpt: result.excerpt ?? "",
|
|
100
|
+
plainExcerpt: (result.excerpt ?? "").replace(/<[^>]*>/g, ""),
|
|
101
|
+
title: result.title ?? title,
|
|
102
|
+
url: result.url ?? data.url
|
|
103
|
+
})),
|
|
104
|
+
title,
|
|
105
|
+
url: data.url
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function statusOutput(status) {
|
|
109
|
+
if (status.status === "ready" || status.status === void 0) return null;
|
|
110
|
+
if (status.status === "empty") {
|
|
111
|
+
return {
|
|
112
|
+
items: [],
|
|
113
|
+
message: "No searchable pages are available.",
|
|
114
|
+
nextOffset: null,
|
|
115
|
+
status: "ready",
|
|
116
|
+
total: 0
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
if (status.status === "building") {
|
|
120
|
+
return {
|
|
121
|
+
items: [],
|
|
122
|
+
message: status.message ?? "Building search index...",
|
|
123
|
+
nextOffset: null,
|
|
124
|
+
status: "building",
|
|
125
|
+
total: 0
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
if (status.status === "stale") {
|
|
129
|
+
return {
|
|
130
|
+
items: [],
|
|
131
|
+
message: status.message ?? "Updating search index...",
|
|
132
|
+
nextOffset: null,
|
|
133
|
+
status: "stale",
|
|
134
|
+
total: 0
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
if (status.status === "error") {
|
|
138
|
+
return {
|
|
139
|
+
items: [],
|
|
140
|
+
message: status.message ?? "Search is temporarily unavailable",
|
|
141
|
+
nextOffset: null,
|
|
142
|
+
status: "error",
|
|
143
|
+
total: 0
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
async function runPagefindSearch(input) {
|
|
149
|
+
const normalized = normalizeSearchInput(input);
|
|
150
|
+
if (!normalized.q) {
|
|
151
|
+
return EMPTY_SEARCH_OUTPUT;
|
|
152
|
+
}
|
|
153
|
+
const status = await fetchSearchStatus(input.signal);
|
|
154
|
+
const blockedByStatus = status ? statusOutput(status) : null;
|
|
155
|
+
if (blockedByStatus) return blockedByStatus;
|
|
156
|
+
const pagefind = await loadPagefind();
|
|
157
|
+
const limit = normalized.limit ?? DEFAULT_SEARCH_LIMIT;
|
|
158
|
+
const offset = normalized.offset ?? 0;
|
|
159
|
+
const result = await pagefind.search(normalized.q, {
|
|
160
|
+
filters: pagefindFilters(normalized.filters),
|
|
161
|
+
limit,
|
|
162
|
+
offset
|
|
163
|
+
});
|
|
164
|
+
if (!result) return EMPTY_SEARCH_OUTPUT;
|
|
165
|
+
const items = await Promise.all(
|
|
166
|
+
result.results.map(
|
|
167
|
+
async (pagefindResult) => toSearchResult({
|
|
168
|
+
data: await pagefindResult.data(),
|
|
169
|
+
fallbackId: pagefindResult.id,
|
|
170
|
+
score: pagefindResult.score
|
|
171
|
+
})
|
|
172
|
+
)
|
|
173
|
+
);
|
|
174
|
+
const total = result.unfilteredResultCount ?? items.length;
|
|
175
|
+
const nextOffset = offset + limit < total ? offset + limit : null;
|
|
176
|
+
return {
|
|
177
|
+
items,
|
|
178
|
+
nextOffset,
|
|
179
|
+
status: "ready",
|
|
180
|
+
total
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
async function search(input) {
|
|
184
|
+
const normalized = normalizeSearchInput(input);
|
|
185
|
+
if (!normalized.q) {
|
|
186
|
+
return EMPTY_SEARCH_OUTPUT;
|
|
187
|
+
}
|
|
188
|
+
try {
|
|
189
|
+
return await runPagefindSearch(normalized);
|
|
190
|
+
} catch (error) {
|
|
191
|
+
if (error instanceof DOMException && error.name === "AbortError") {
|
|
192
|
+
return EMPTY_SEARCH_OUTPUT;
|
|
193
|
+
}
|
|
194
|
+
return inactiveIndexMessage();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function useSearch(input) {
|
|
198
|
+
const { filters, limit, offset, q } = input;
|
|
199
|
+
const stableInput = useMemo(
|
|
200
|
+
() => normalizeSearchInput({ filters, limit, offset, q }),
|
|
201
|
+
[filters, limit, offset, q]
|
|
202
|
+
);
|
|
203
|
+
const [output, setOutput] = useState(EMPTY_SEARCH_OUTPUT);
|
|
204
|
+
const requestId = useRef(0);
|
|
205
|
+
useEffect(() => {
|
|
206
|
+
const nextRequestId = requestId.current + 1;
|
|
207
|
+
requestId.current = nextRequestId;
|
|
208
|
+
if (!stableInput.q) {
|
|
209
|
+
setOutput(EMPTY_SEARCH_OUTPUT);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
const controller = new AbortController();
|
|
213
|
+
const timer = window.setTimeout(() => {
|
|
214
|
+
setOutput((current) => ({ ...current, status: "idle" }));
|
|
215
|
+
runPagefindSearch({ ...stableInput, signal: controller.signal }).then((result) => {
|
|
216
|
+
if (requestId.current !== nextRequestId) return;
|
|
217
|
+
setOutput(result);
|
|
218
|
+
}).catch((error) => {
|
|
219
|
+
if (requestId.current !== nextRequestId) return;
|
|
220
|
+
if (error instanceof DOMException && error.name === "AbortError") {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
setOutput(inactiveIndexMessage());
|
|
224
|
+
});
|
|
225
|
+
}, SEARCH_DEBOUNCE_MS);
|
|
226
|
+
return () => {
|
|
227
|
+
window.clearTimeout(timer);
|
|
228
|
+
controller.abort();
|
|
229
|
+
};
|
|
230
|
+
}, [stableInput]);
|
|
231
|
+
return output;
|
|
232
|
+
}
|
|
233
|
+
function useSearchBlock() {
|
|
234
|
+
const value = useContext(SearchBlockContext);
|
|
235
|
+
if (!value) {
|
|
236
|
+
throw new Error("useSearchBlock must be used inside <Search.Root>.");
|
|
237
|
+
}
|
|
238
|
+
return value;
|
|
239
|
+
}
|
|
240
|
+
function SearchProvider({
|
|
241
|
+
children,
|
|
242
|
+
defaultOpen = false,
|
|
243
|
+
limit = DEFAULT_SEARCH_LIMIT,
|
|
244
|
+
onOpenChange,
|
|
245
|
+
open: controlledOpen,
|
|
246
|
+
shortcut = "mod+k",
|
|
247
|
+
variant = "desktop"
|
|
248
|
+
}) {
|
|
249
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
250
|
+
const [query, setQuery] = useState("");
|
|
251
|
+
const [isTyping, setIsTyping] = useState(false);
|
|
252
|
+
const [selectedValue, setSelectedValue] = useState("");
|
|
253
|
+
const typingTimer = useRef(null);
|
|
254
|
+
const inputRef = useRef(null);
|
|
255
|
+
const listRef = useRef(null);
|
|
256
|
+
const router = useRouter();
|
|
257
|
+
const inputId = useId();
|
|
258
|
+
const listId = useId();
|
|
259
|
+
const open = controlledOpen ?? uncontrolledOpen;
|
|
260
|
+
const output = useSearch({ limit, q: query });
|
|
261
|
+
const [displayResults, setDisplayResults] = useState([]);
|
|
262
|
+
const selectedResult = displayResults.find((result) => result.id === selectedValue) ?? displayResults[0];
|
|
263
|
+
const selectedResultId = selectedResult?.id ?? "";
|
|
264
|
+
const loading = Boolean(query.trim()) && !isTyping && output.status === "idle";
|
|
265
|
+
const setOpen = useCallback(
|
|
266
|
+
(nextOpen) => {
|
|
267
|
+
if (controlledOpen === void 0) {
|
|
268
|
+
setUncontrolledOpen(nextOpen);
|
|
269
|
+
}
|
|
270
|
+
onOpenChange?.(nextOpen);
|
|
271
|
+
if (!nextOpen) {
|
|
272
|
+
setQuery("");
|
|
273
|
+
setSelectedValue("");
|
|
274
|
+
setIsTyping(false);
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
[controlledOpen, onOpenChange]
|
|
278
|
+
);
|
|
279
|
+
const setQueryValue = useCallback((value) => {
|
|
280
|
+
setQuery(value);
|
|
281
|
+
}, []);
|
|
282
|
+
const handleInputChange = useCallback((value) => {
|
|
283
|
+
setQuery(value);
|
|
284
|
+
setIsTyping(true);
|
|
285
|
+
if (typingTimer.current !== null) {
|
|
286
|
+
window.clearTimeout(typingTimer.current);
|
|
287
|
+
}
|
|
288
|
+
typingTimer.current = window.setTimeout(() => {
|
|
289
|
+
setIsTyping(false);
|
|
290
|
+
typingTimer.current = null;
|
|
291
|
+
}, SEARCH_DEBOUNCE_MS);
|
|
292
|
+
}, []);
|
|
293
|
+
const navigateToResult = useCallback(
|
|
294
|
+
(result) => {
|
|
295
|
+
setOpen(false);
|
|
296
|
+
router.push(result.url);
|
|
297
|
+
},
|
|
298
|
+
[router, setOpen]
|
|
299
|
+
);
|
|
300
|
+
useEffect(() => {
|
|
301
|
+
if (!open) return;
|
|
302
|
+
const frame = window.requestAnimationFrame(() => {
|
|
303
|
+
inputRef.current?.focus();
|
|
304
|
+
});
|
|
305
|
+
return () => window.cancelAnimationFrame(frame);
|
|
306
|
+
}, [open]);
|
|
307
|
+
useShortcut(shortcut, () => setOpen(true), {
|
|
308
|
+
description: "Open search",
|
|
309
|
+
group: "Search",
|
|
310
|
+
priority: 100
|
|
311
|
+
});
|
|
312
|
+
useEffect(() => {
|
|
313
|
+
if (!query.trim()) {
|
|
314
|
+
setDisplayResults([]);
|
|
315
|
+
setSelectedValue("");
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
if (isTyping || loading) return;
|
|
319
|
+
if (output.status === "ready") {
|
|
320
|
+
setDisplayResults(output.items);
|
|
321
|
+
setSelectedValue(output.items[0]?.id ?? "");
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
if (output.status === "building" || output.status === "stale" || output.status === "error") {
|
|
325
|
+
setDisplayResults([]);
|
|
326
|
+
setSelectedValue("");
|
|
327
|
+
}
|
|
328
|
+
}, [isTyping, loading, output.items, output.status, query]);
|
|
329
|
+
useEffect(
|
|
330
|
+
() => () => {
|
|
331
|
+
if (typingTimer.current !== null) {
|
|
332
|
+
window.clearTimeout(typingTimer.current);
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
[]
|
|
336
|
+
);
|
|
337
|
+
const contextValue = useMemo(
|
|
338
|
+
() => ({
|
|
339
|
+
actions: {
|
|
340
|
+
handleInputChange,
|
|
341
|
+
navigateToResult,
|
|
342
|
+
setOpen,
|
|
343
|
+
setQuery: setQueryValue,
|
|
344
|
+
setSelectedValue
|
|
345
|
+
},
|
|
346
|
+
meta: {
|
|
347
|
+
inputId,
|
|
348
|
+
inputRef,
|
|
349
|
+
listId,
|
|
350
|
+
listRef,
|
|
351
|
+
shortcut,
|
|
352
|
+
variant
|
|
353
|
+
},
|
|
354
|
+
state: {
|
|
355
|
+
displayResults,
|
|
356
|
+
isTyping,
|
|
357
|
+
loading,
|
|
358
|
+
message: output.message,
|
|
359
|
+
open,
|
|
360
|
+
query,
|
|
361
|
+
selectedValue: selectedResultId,
|
|
362
|
+
status: output.status,
|
|
363
|
+
total: output.total
|
|
364
|
+
}
|
|
365
|
+
}),
|
|
366
|
+
[
|
|
367
|
+
displayResults,
|
|
368
|
+
handleInputChange,
|
|
369
|
+
inputId,
|
|
370
|
+
isTyping,
|
|
371
|
+
listId,
|
|
372
|
+
loading,
|
|
373
|
+
navigateToResult,
|
|
374
|
+
open,
|
|
375
|
+
output.message,
|
|
376
|
+
output.status,
|
|
377
|
+
output.total,
|
|
378
|
+
query,
|
|
379
|
+
selectedResultId,
|
|
380
|
+
setOpen,
|
|
381
|
+
setQueryValue,
|
|
382
|
+
shortcut,
|
|
383
|
+
variant
|
|
384
|
+
]
|
|
385
|
+
);
|
|
386
|
+
return /* @__PURE__ */ jsx(SearchBlockContext.Provider, { value: contextValue, children });
|
|
387
|
+
}
|
|
388
|
+
export {
|
|
389
|
+
SearchProvider,
|
|
390
|
+
search,
|
|
391
|
+
useSearch,
|
|
392
|
+
useSearchBlock
|
|
393
|
+
};
|
package/dist/types.cjs
CHANGED
|
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
6
10
|
var __copyProps = (to, from, except, desc) => {
|
|
7
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
12
|
for (let key of __getOwnPropNames(from))
|
|
@@ -15,4 +19,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
15
19
|
|
|
16
20
|
// src/types.ts
|
|
17
21
|
var types_exports = {};
|
|
22
|
+
__export(types_exports, {
|
|
23
|
+
__publishOsTypesModule: () => __publishOsTypesModule
|
|
24
|
+
});
|
|
18
25
|
module.exports = __toCommonJS(types_exports);
|
|
26
|
+
var __publishOsTypesModule = true;
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
__publishOsTypesModule
|
|
30
|
+
});
|
package/dist/types.d.cts
CHANGED
|
@@ -1,11 +1,103 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
type SearchInput = {
|
|
4
|
+
filters?: {
|
|
5
|
+
author?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
tag?: string;
|
|
8
|
+
};
|
|
9
|
+
limit?: number;
|
|
10
|
+
offset?: number;
|
|
11
|
+
q: string;
|
|
12
|
+
};
|
|
13
|
+
type SearchStatus = "idle" | "building" | "stale" | "ready" | "error";
|
|
14
|
+
type SearchSubResult = {
|
|
15
|
+
excerpt: string;
|
|
16
|
+
plainExcerpt: string;
|
|
17
|
+
title: string;
|
|
18
|
+
url: string;
|
|
19
|
+
};
|
|
20
|
+
type SearchResult = {
|
|
21
|
+
excerpt: string;
|
|
22
|
+
id: string;
|
|
23
|
+
meta: {
|
|
24
|
+
author?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
group?: string;
|
|
27
|
+
image?: string;
|
|
28
|
+
nodeId?: string;
|
|
29
|
+
path?: string;
|
|
30
|
+
publishedAt?: string;
|
|
31
|
+
section?: string;
|
|
32
|
+
tags?: string;
|
|
33
|
+
title?: string;
|
|
34
|
+
updatedAt?: string;
|
|
35
|
+
};
|
|
36
|
+
plainExcerpt: string;
|
|
37
|
+
score?: number;
|
|
38
|
+
subResults: SearchSubResult[];
|
|
39
|
+
title: string;
|
|
40
|
+
url: string;
|
|
41
|
+
};
|
|
42
|
+
type SearchOutput = {
|
|
43
|
+
items: SearchResult[];
|
|
44
|
+
message?: string;
|
|
45
|
+
nextOffset: number | null;
|
|
46
|
+
status: SearchStatus;
|
|
47
|
+
total: number;
|
|
48
|
+
};
|
|
49
|
+
type SearchBlockVariant = "desktop" | "mobile";
|
|
50
|
+
type SearchBlockState = {
|
|
51
|
+
displayResults: SearchResult[];
|
|
52
|
+
isTyping: boolean;
|
|
53
|
+
loading: boolean;
|
|
54
|
+
message?: string;
|
|
55
|
+
open: boolean;
|
|
56
|
+
query: string;
|
|
57
|
+
selectedValue: string;
|
|
58
|
+
status: SearchStatus;
|
|
59
|
+
total: number;
|
|
60
|
+
};
|
|
61
|
+
type SearchBlockActions = {
|
|
62
|
+
handleInputChange(value: string): void;
|
|
63
|
+
navigateToResult(result: SearchResult): void;
|
|
64
|
+
setOpen(open: boolean): void;
|
|
65
|
+
setQuery(value: string): void;
|
|
66
|
+
setSelectedValue(id: string): void;
|
|
67
|
+
};
|
|
68
|
+
type SearchBlockMeta = {
|
|
69
|
+
inputId: string;
|
|
70
|
+
inputRef: RefObject<HTMLInputElement | null>;
|
|
71
|
+
listId: string;
|
|
72
|
+
listRef: RefObject<HTMLDivElement | null>;
|
|
73
|
+
shortcut: string;
|
|
74
|
+
variant: SearchBlockVariant;
|
|
75
|
+
};
|
|
76
|
+
type SearchBlockContextValue = {
|
|
77
|
+
actions: SearchBlockActions;
|
|
78
|
+
meta: SearchBlockMeta;
|
|
79
|
+
state: SearchBlockState;
|
|
80
|
+
};
|
|
81
|
+
|
|
1
82
|
type Heading = {
|
|
2
83
|
id: string;
|
|
3
84
|
depth: number;
|
|
4
85
|
text: string;
|
|
5
86
|
};
|
|
6
87
|
type SiteData = {
|
|
7
|
-
|
|
88
|
+
name: string;
|
|
8
89
|
description?: string;
|
|
90
|
+
url?: string;
|
|
91
|
+
og?: OgMetadata;
|
|
92
|
+
};
|
|
93
|
+
type OgImageMetadata = string | {
|
|
94
|
+
src: string;
|
|
95
|
+
alt?: string;
|
|
96
|
+
};
|
|
97
|
+
type OgMetadata = {
|
|
98
|
+
title?: string;
|
|
99
|
+
description?: string;
|
|
100
|
+
image?: OgImageMetadata;
|
|
9
101
|
};
|
|
10
102
|
type Author = {
|
|
11
103
|
id?: string;
|
|
@@ -16,7 +108,6 @@ type Author = {
|
|
|
16
108
|
};
|
|
17
109
|
type PageStatus = "published" | "draft" | "archived";
|
|
18
110
|
type PageFrontmatter = {
|
|
19
|
-
id: string;
|
|
20
111
|
title: string;
|
|
21
112
|
slug?: string;
|
|
22
113
|
description?: string;
|
|
@@ -28,7 +119,7 @@ type PageFrontmatter = {
|
|
|
28
119
|
[key: string]: unknown;
|
|
29
120
|
};
|
|
30
121
|
type PageData<TMeta extends Record<string, unknown> = Record<string, unknown>> = {
|
|
31
|
-
|
|
122
|
+
fileID: string;
|
|
32
123
|
group: string;
|
|
33
124
|
slug: string;
|
|
34
125
|
path: string;
|
|
@@ -39,6 +130,7 @@ type PageData<TMeta extends Record<string, unknown> = Record<string, unknown>> =
|
|
|
39
130
|
updatedAt?: string;
|
|
40
131
|
authors: Author[];
|
|
41
132
|
tags: string[];
|
|
133
|
+
og?: OgMetadata;
|
|
42
134
|
meta: TMeta;
|
|
43
135
|
body: string;
|
|
44
136
|
};
|
|
@@ -47,7 +139,7 @@ type PageSummary<TMeta extends Record<string, unknown> = Record<string, unknown>
|
|
|
47
139
|
};
|
|
48
140
|
type PageNode = {
|
|
49
141
|
type: "page";
|
|
50
|
-
|
|
142
|
+
fileID: string;
|
|
51
143
|
title: string;
|
|
52
144
|
path: string;
|
|
53
145
|
group: string;
|
|
@@ -57,6 +149,7 @@ type PageNode = {
|
|
|
57
149
|
updatedAt?: string;
|
|
58
150
|
authors: Author[];
|
|
59
151
|
tags?: string[];
|
|
152
|
+
og?: OgMetadata;
|
|
60
153
|
meta: Record<string, unknown>;
|
|
61
154
|
};
|
|
62
155
|
type SectionNode = {
|
|
@@ -71,6 +164,7 @@ type FolderNode = {
|
|
|
71
164
|
type: "folder";
|
|
72
165
|
id: string;
|
|
73
166
|
title: string;
|
|
167
|
+
path?: string;
|
|
74
168
|
group?: string;
|
|
75
169
|
children: TreeNode[];
|
|
76
170
|
};
|
|
@@ -87,16 +181,26 @@ type NavSection = SectionNode;
|
|
|
87
181
|
type NavFolder = FolderNode;
|
|
88
182
|
type NavItem = TreeNode;
|
|
89
183
|
type RouteRecord = {
|
|
90
|
-
|
|
184
|
+
fileID: string;
|
|
91
185
|
slug: string;
|
|
92
186
|
path: string;
|
|
93
187
|
group: string;
|
|
94
188
|
};
|
|
189
|
+
type ResolvedAttribution = {
|
|
190
|
+
enabled: false;
|
|
191
|
+
} | {
|
|
192
|
+
enabled: true;
|
|
193
|
+
variant: "publish-dev";
|
|
194
|
+
label?: string;
|
|
195
|
+
hrefLabel?: string;
|
|
196
|
+
href: string;
|
|
197
|
+
};
|
|
95
198
|
type GroupManifest = {
|
|
96
199
|
key: string;
|
|
97
200
|
title: string;
|
|
98
201
|
path: string;
|
|
99
|
-
|
|
202
|
+
ancestry?: string[];
|
|
203
|
+
meta?: Record<string, unknown>;
|
|
100
204
|
tree: TreeNode[];
|
|
101
205
|
pages: PageData[];
|
|
102
206
|
};
|
|
@@ -106,12 +210,16 @@ type ManifestLike = {
|
|
|
106
210
|
routes: RouteRecord[];
|
|
107
211
|
pages: PageData[];
|
|
108
212
|
tree: TreeNode[];
|
|
213
|
+
attribution?: Record<string, ResolvedAttribution>;
|
|
109
214
|
contentHash: string;
|
|
110
215
|
};
|
|
111
216
|
type RootLayoutProps = {
|
|
112
217
|
children: React.ReactNode;
|
|
113
218
|
site: SiteData;
|
|
114
219
|
tree: TreeNode[];
|
|
220
|
+
currentPath?: string;
|
|
221
|
+
currentGroup?: GroupContext;
|
|
222
|
+
activeGroups?: readonly GroupContext[];
|
|
115
223
|
};
|
|
116
224
|
type RootPageProps = {
|
|
117
225
|
site: SiteData;
|
|
@@ -140,5 +248,22 @@ type IndexPageProps = {
|
|
|
140
248
|
currentPath: string;
|
|
141
249
|
group: string;
|
|
142
250
|
};
|
|
251
|
+
type ThemeMode = "system" | "light" | "dark";
|
|
252
|
+
type GroupForcedMode = "light" | "dark" | "none";
|
|
253
|
+
type GroupContext = {
|
|
254
|
+
key: string;
|
|
255
|
+
title: string;
|
|
256
|
+
path: string;
|
|
257
|
+
ancestry: readonly string[];
|
|
258
|
+
hasThemeCss: boolean;
|
|
259
|
+
hasFontScope: boolean;
|
|
260
|
+
defaultMode?: ThemeMode;
|
|
261
|
+
forcedMode?: GroupForcedMode;
|
|
262
|
+
resolvedForcedMode?: "light" | "dark";
|
|
263
|
+
escapesForcedMode?: boolean;
|
|
264
|
+
meta?: Record<string, unknown>;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
declare const __publishOsTypesModule = true;
|
|
143
268
|
|
|
144
|
-
export type
|
|
269
|
+
export { type Author, type FolderNode, type GroupContext, type GroupForcedMode, type GroupManifest, type Heading, type IndexPageProps, type LayoutProps, type LinkNode, type ManifestLike, type NavFolder, type NavItem, type NavLink, type NavPage, type NavSection, type OgImageMetadata, type OgMetadata, type PageData, type PageFrontmatter, type PageNode, type PageProps, type PageStatus, type PageSummary, type ResolvedAttribution, type RootLayoutProps, type RootPageProps, type RouteRecord, type SearchBlockActions, type SearchBlockContextValue, type SearchBlockMeta, type SearchBlockState, type SearchBlockVariant, type SearchInput, type SearchOutput, type SearchResult, type SearchStatus, type SearchSubResult, type SectionNode, type SiteData, type ThemeMode, type TreeNode, __publishOsTypesModule };
|