@publish.os/nextjs 0.0.1-alpha.5 → 0.0.1-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -5
- package/compiler-assets/nextjs/defaults/app/globals.css +6 -0
- package/compiler-assets/nextjs/defaults/group/layout.tsx +23 -0
- package/compiler-assets/nextjs/defaults/group/leaf.tsx +48 -0
- package/compiler-assets/nextjs/defaults/group/page.tsx +50 -0
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +45 -0
- package/compiler-assets/nextjs/defaults/project/postcss.config.mjs +5 -0
- package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +41 -0
- package/compiler-assets/nextjs/defaults/root/css/animation.css +90 -0
- package/compiler-assets/nextjs/defaults/root/css/components/dialog.css +21 -0
- package/compiler-assets/nextjs/defaults/root/css/components/drawer.css +21 -0
- package/compiler-assets/nextjs/defaults/root/css/components/menu.css +23 -0
- package/compiler-assets/nextjs/defaults/root/css/components/navigation-menu.css +25 -0
- package/compiler-assets/nextjs/defaults/root/css/components/popover.css +17 -0
- package/compiler-assets/nextjs/defaults/root/css/components/select.css +23 -0
- package/compiler-assets/nextjs/defaults/root/css/components/toast.css +19 -0
- package/compiler-assets/nextjs/defaults/root/css/components/tooltip.css +15 -0
- package/compiler-assets/nextjs/defaults/root/css/layout.css +22 -0
- package/compiler-assets/nextjs/defaults/root/css/media.css +81 -0
- package/compiler-assets/nextjs/defaults/root/css/radius.css +49 -0
- package/compiler-assets/nextjs/defaults/root/css/scrollbar.css +43 -0
- package/compiler-assets/nextjs/defaults/root/css/shadow.css +145 -0
- package/compiler-assets/nextjs/defaults/root/css/typography.css +607 -0
- package/compiler-assets/nextjs/defaults/root/css/zindex.css +39 -0
- package/compiler-assets/nextjs/defaults/root/globals.css +191 -0
- package/compiler-assets/nextjs/defaults/root/layout.tsx +19 -0
- package/compiler-assets/nextjs/defaults/root/page.tsx +61 -0
- package/compiler-assets/nextjs/defaults/root/theme.css +50 -0
- package/compiler-assets/nextjs/defaults/source/_internal/logger.ts +21 -0
- package/compiler-assets/nextjs/shims/generated-group-layout.tsx +19 -0
- package/compiler-assets/nextjs/shims/generated-group-page.tsx +18 -0
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +21 -0
- package/compiler-assets/nextjs/shims/global-layout.tsx +134 -0
- package/compiler-assets/nextjs/shims/markdown-route.ts +29 -0
- package/compiler-assets/nextjs/shims/og-image-route.ts +18 -0
- package/compiler-assets/nextjs/shims/powered-by-footer.tsx +40 -0
- package/compiler-assets/nextjs/shims/providers.tsx +13 -0
- package/compiler-assets/nextjs/shims/proxy.ts +317 -0
- package/compiler-assets/nextjs/shims/publish-os-theme-provider.tsx +77 -0
- package/compiler-assets/nextjs/shims/root-page.tsx +13 -0
- package/compiler-assets/nextjs/shims/theme-defaults.css +177 -0
- package/dist/{kernel/components/ui/button.d.cts → button-CFdx-ohV.d.ts} +1 -3
- package/dist/cache/tags.js +6 -14
- package/dist/compiler.d.ts +100 -0
- package/dist/compiler.js +13379 -0
- package/dist/config/createNextConfig.d.ts +2 -1
- package/dist/config/createNextConfig.js +16 -12
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +2 -0
- package/dist/index.d.ts +303 -15
- package/dist/index.js +30 -1196
- package/dist/kernel/components/blocks/AgentActions.d.ts +9 -3
- package/dist/kernel/components/blocks/AgentActions.js +114 -200
- package/dist/kernel/components/blocks/animated-icon-swap.js +4 -25
- package/dist/kernel/components/blocks/color-palette.js +107 -157
- package/dist/kernel/components/blocks/design-system-preview.d.ts +38 -6
- package/dist/kernel/components/blocks/design-system-preview.js +44 -52
- package/dist/kernel/components/blocks/link-playground.js +23 -71
- package/dist/kernel/components/blocks/logo-block.js +19 -48
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +1 -1
- package/dist/kernel/components/blocks/nav-breadcrumb.js +28 -52
- package/dist/kernel/components/blocks/navbar.d.ts +1 -1
- package/dist/kernel/components/blocks/navbar.js +14 -41
- package/dist/kernel/components/blocks/navigation-progress-playground.js +56 -149
- package/dist/kernel/components/blocks/navigation-progress.js +53 -157
- package/dist/kernel/components/blocks/next-prev.d.ts +1 -1
- package/dist/kernel/components/blocks/next-prev.js +16 -42
- package/dist/kernel/components/blocks/page-list.d.ts +1 -1
- package/dist/kernel/components/blocks/page-list.js +11 -16
- package/dist/kernel/components/blocks/search.d.ts +13 -2
- package/dist/kernel/components/blocks/search.js +116 -247
- package/dist/kernel/components/blocks/sidebar-node.d.ts +2 -2
- package/dist/kernel/components/blocks/sidebar-node.js +56 -95
- package/dist/kernel/components/blocks/sidebar.d.ts +5 -23
- package/dist/kernel/components/blocks/sidebar.js +35 -103
- package/dist/kernel/components/blocks/theme-toggle.d.ts +7 -3
- package/dist/kernel/components/blocks/theme-toggle.js +2 -2
- package/dist/kernel/components/blocks/toc.js +42 -178
- package/dist/kernel/components/mdx/components/blockquote.js +3 -24
- package/dist/kernel/components/mdx/components/callout.d.ts +1 -1
- package/dist/kernel/components/mdx/components/callout.js +15 -47
- package/dist/kernel/components/mdx/components/code-block.js +2 -2
- package/dist/kernel/components/mdx/components/figure-caption.js +6 -24
- package/dist/kernel/components/mdx/components/figure.js +9 -36
- package/dist/kernel/components/mdx/components/footnotes.js +3 -24
- package/dist/kernel/components/mdx/components/heading-copy-link.js +13 -37
- package/dist/kernel/components/mdx/components/heading.d.ts +8 -3
- package/dist/kernel/components/mdx/components/heading.js +32 -116
- package/dist/kernel/components/mdx/components/hr.d.ts +5 -3
- package/dist/kernel/components/mdx/components/hr.js +2 -2
- package/dist/kernel/components/mdx/components/image-zoom.js +2 -3
- package/dist/kernel/components/mdx/components/image.js +23 -63
- package/dist/kernel/components/mdx/components/inline-code.js +3 -24
- package/dist/kernel/components/mdx/components/kbd.d.ts +9 -4
- package/dist/kernel/components/mdx/components/kbd.js +2 -2
- package/dist/kernel/components/mdx/components/link.d.ts +1 -2
- package/dist/kernel/components/mdx/components/link.js +2 -2
- package/dist/kernel/components/mdx/components/paragraph.js +13 -41
- package/dist/kernel/components/mdx/components/pre.js +3 -24
- package/dist/kernel/components/mdx/components/strikethrough.js +6 -24
- package/dist/kernel/components/mdx/components/table.js +2 -2
- package/dist/kernel/components/mdx/components/task-list.js +6 -28
- package/dist/kernel/components/mdx/components/video-player.js +53 -88
- package/dist/kernel/components/mdx/components/video.js +27 -75
- package/dist/kernel/components/mdx/error-boundary.d.ts +1 -1
- package/dist/kernel/components/mdx/error-boundary.js +12 -15
- package/dist/kernel/components/mdx/error-fallback.js +4 -4
- package/dist/kernel/components/mdx/mdx.d.ts +68 -11
- package/dist/kernel/components/mdx/mdx.js +29 -29
- package/dist/kernel/components/mdx/rehype-heading-ids.js +11 -67
- package/dist/kernel/components/mdx/types.d.ts +1 -1
- package/dist/kernel/components/ui/accordion.js +3 -26
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +26 -8
- package/dist/kernel/components/ui/breadcrumb-trail.js +32 -79
- package/dist/kernel/components/ui/breadcrumb.d.ts +2 -6
- package/dist/kernel/components/ui/breadcrumb.js +21 -70
- package/dist/kernel/components/ui/button-group.d.ts +4 -3
- package/dist/kernel/components/ui/button-group.js +7 -30
- package/dist/kernel/components/ui/button.js +13 -36
- package/dist/kernel/components/ui/card.d.ts +2 -2
- package/dist/kernel/components/ui/card.js +2 -23
- package/dist/kernel/components/ui/dialog.d.ts +9 -9
- package/dist/kernel/components/ui/dialog.js +15 -33
- package/dist/kernel/components/ui/drawer.d.ts +10 -10
- package/dist/kernel/components/ui/drawer.js +15 -33
- package/dist/kernel/components/ui/input.js +6 -30
- package/dist/kernel/components/ui/kbd.js +10 -31
- package/dist/kernel/components/ui/link.d.ts +1 -1
- package/dist/kernel/components/ui/link.js +53 -104
- package/dist/kernel/components/ui/menu.d.ts +21 -21
- package/dist/kernel/components/ui/menu.js +14 -36
- package/dist/kernel/components/ui/meta-key.d.ts +9 -4
- package/dist/kernel/components/ui/meta-key.js +2 -2
- package/dist/kernel/components/ui/navigation-menu.d.ts +14 -14
- package/dist/kernel/components/ui/navigation-menu.js +9 -30
- package/dist/kernel/components/ui/popover.d.ts +10 -10
- package/dist/kernel/components/ui/popover.js +13 -34
- package/dist/kernel/components/ui/progress.js +2 -25
- package/dist/kernel/components/ui/scroll-area.js +39 -118
- package/dist/kernel/components/ui/select.d.ts +15 -15
- package/dist/kernel/components/ui/select.js +19 -35
- package/dist/kernel/components/ui/separator.js +2 -25
- package/dist/kernel/components/ui/table.js +2 -23
- package/dist/kernel/components/ui/tabs.js +39 -99
- package/dist/kernel/components/ui/tag.d.ts +2 -2
- package/dist/kernel/components/ui/tag.js +4 -25
- package/dist/kernel/components/ui/text.d.ts +2 -2
- package/dist/kernel/components/ui/text.js +112 -131
- package/dist/kernel/components/ui/theme-toggle.d.ts +18 -4
- package/dist/kernel/components/ui/theme-toggle.js +18 -44
- package/dist/kernel/components/ui/toast.d.ts +10 -10
- package/dist/kernel/components/ui/toast.js +13 -35
- package/dist/kernel/components/ui/tooltip.d.ts +8 -8
- package/dist/kernel/components/ui/tooltip.js +9 -30
- package/dist/kernel/defaults.registry.d.ts +61 -70
- package/dist/kernel/defaults.registry.js +61 -69
- package/dist/kernel/framework-icons.d.ts +1 -0
- package/dist/kernel/framework-icons.js +39 -0
- package/dist/kernel/routes/agent/markdown.js +36 -65
- package/dist/kernel/routes/layouts/group.d.ts +1 -1
- package/dist/kernel/routes/layouts/group.js +20 -109
- package/dist/kernel/routes/metadata/feed.d.ts +1 -2
- package/dist/kernel/routes/metadata/feed.js +46 -127
- package/dist/kernel/routes/metadata/llms.d.ts +1 -2
- package/dist/kernel/routes/metadata/llms.js +42 -120
- package/dist/kernel/routes/metadata/og-image.d.ts +11 -1
- package/dist/kernel/routes/metadata/og-image.js +264 -198
- package/dist/kernel/routes/metadata/robots.d.ts +1 -2
- package/dist/kernel/routes/metadata/robots.js +21 -90
- package/dist/kernel/routes/metadata/sitemap.d.ts +1 -2
- package/dist/kernel/routes/metadata/sitemap.js +36 -102
- package/dist/kernel/routes/pages/group.d.ts +1 -1
- package/dist/kernel/routes/pages/group.js +42 -137
- package/dist/kernel/routes/pages/leaf.d.ts +1 -1
- package/dist/kernel/routes/pages/leaf.js +74 -213
- package/dist/kernel/routes/pages/root.d.ts +1 -1
- package/dist/kernel/routes/pages/root.js +37 -108
- package/dist/keyboard-shortcuts.js +69 -141
- package/dist/{kernel/components/ui/link.d.cts → link-CYaCRDb6.d.ts} +9 -5
- package/dist/resolvers/manifest-resolver.d.ts +3 -3
- package/dist/resolvers/manifest-resolver.js +15 -21
- package/dist/{kernel/routes/metadata/og-image.d.cts → route-metadata-og-image-BeKKFHg7.d.ts} +12 -16
- package/dist/search.d.ts +81 -4
- package/dist/search.js +124 -195
- package/dist/{kernel/components/blocks/sidebar.d.cts → sidebar-types-Bgchdfd6.d.ts} +2 -10
- package/dist/theme-scope.d.ts +15 -0
- package/dist/theme-scope.js +23 -0
- package/dist/types-B_b3C0U6.d.ts +63 -0
- package/dist/types-CIwwieNw.d.ts +127 -0
- package/dist/types-DHBm7-j6.d.ts +57 -0
- package/dist/types-sM2g9nW0.d.ts +12 -0
- package/dist/types.d.ts +0 -1
- package/dist/types.js +1 -1
- package/dist/utils/cn.d.ts +5 -9
- package/dist/utils/cn.js +13 -7
- package/dist/utils/heading-ids.js +20 -47
- package/dist/utils/pretty-date.js +7 -13
- package/init/seed/minimal/publish.os/assets/logo/publish-dev-logo.dark.png +0 -0
- package/init/seed/minimal/publish.os/assets/logo/publish-dev-logo.png +0 -0
- package/init/seed/minimal/publish.os/docs/content/get-started.mdx +54 -0
- package/init/seed/minimal/publish.os/docs/content/groups.mdx +31 -0
- package/init/seed/minimal/publish.os/docs/content/theme.mdx +64 -0
- package/init/seed/minimal/publish.os/publish.os.config.json +21 -0
- package/init/seed/minimal/publish.os/theme.css +47 -0
- package/init/seed/minimal/seed.json +13 -0
- package/package.json +470 -40
- package/release/{package.json → app/lucide/package.json} +14 -7
- package/release/app/lucide/pnpm-lock.yaml.template +2905 -0
- package/release/app/lucide/pnpm-workspace.yaml +11 -0
- package/release/app/phosphor/package.json +30 -0
- package/release/app/phosphor/pnpm-lock.yaml.template +2908 -0
- package/release/app/phosphor/pnpm-workspace.yaml +11 -0
- package/release/app/tabler/package.json +30 -0
- package/release/app/tabler/pnpm-lock.yaml.template +2911 -0
- package/release/app/tabler/pnpm-workspace.yaml +11 -0
- package/release/compiler/package.json +20 -0
- package/release/compiler/pnpm-lock.yaml.template +2432 -0
- package/release/compiler/pnpm-workspace.yaml +11 -0
- package/release/release.json +31 -7
- package/dist/cache/tags.cjs +0 -79
- package/dist/cache/tags.d.cts +0 -13
- package/dist/config/createNextConfig.cjs +0 -52
- package/dist/config/createNextConfig.d.cts +0 -8
- package/dist/config.cjs +0 -78
- package/dist/config.d.cts +0 -101
- package/dist/config.d.ts +0 -101
- package/dist/config.js +0 -48
- package/dist/index.cjs +0 -1266
- package/dist/index.d.cts +0 -18
- package/dist/kernel/components/blocks/AgentActions.cjs +0 -425
- package/dist/kernel/components/blocks/AgentActions.d.cts +0 -52
- package/dist/kernel/components/blocks/animated-icon-swap.cjs +0 -101
- package/dist/kernel/components/blocks/animated-icon-swap.d.cts +0 -16
- package/dist/kernel/components/blocks/color-palette.cjs +0 -413
- package/dist/kernel/components/blocks/color-palette.d.cts +0 -7
- package/dist/kernel/components/blocks/design-system-preview.cjs +0 -593
- package/dist/kernel/components/blocks/design-system-preview.d.cts +0 -29
- package/dist/kernel/components/blocks/link-playground.cjs +0 -816
- package/dist/kernel/components/blocks/link-playground.d.cts +0 -5
- package/dist/kernel/components/blocks/logo-block.cjs +0 -156
- package/dist/kernel/components/blocks/logo-block.d.cts +0 -21
- package/dist/kernel/components/blocks/nav-breadcrumb.cjs +0 -122
- package/dist/kernel/components/blocks/nav-breadcrumb.d.cts +0 -11
- package/dist/kernel/components/blocks/navbar.cjs +0 -154
- package/dist/kernel/components/blocks/navbar.d.cts +0 -16
- package/dist/kernel/components/blocks/navigation-progress-playground.cjs +0 -735
- package/dist/kernel/components/blocks/navigation-progress-playground.d.cts +0 -5
- package/dist/kernel/components/blocks/navigation-progress.cjs +0 -270
- package/dist/kernel/components/blocks/navigation-progress.d.cts +0 -16
- package/dist/kernel/components/blocks/next-prev.cjs +0 -142
- package/dist/kernel/components/blocks/next-prev.d.cts +0 -11
- package/dist/kernel/components/blocks/page-list.cjs +0 -59
- package/dist/kernel/components/blocks/page-list.d.cts +0 -11
- package/dist/kernel/components/blocks/search.cjs +0 -717
- package/dist/kernel/components/blocks/search.d.cts +0 -77
- package/dist/kernel/components/blocks/sidebar-node.cjs +0 -309
- package/dist/kernel/components/blocks/sidebar-node.d.cts +0 -8
- package/dist/kernel/components/blocks/sidebar.cjs +0 -317
- package/dist/kernel/components/blocks/theme-toggle.cjs +0 -31
- package/dist/kernel/components/blocks/theme-toggle.d.cts +0 -6
- package/dist/kernel/components/blocks/toc.cjs +0 -356
- package/dist/kernel/components/blocks/toc.d.cts +0 -10
- package/dist/kernel/components/mdx/components/blockquote.cjs +0 -66
- package/dist/kernel/components/mdx/components/blockquote.d.cts +0 -6
- package/dist/kernel/components/mdx/components/callout.cjs +0 -137
- package/dist/kernel/components/mdx/components/callout.d.cts +0 -18
- package/dist/kernel/components/mdx/components/code-block.cjs +0 -39
- package/dist/kernel/components/mdx/components/code-block.d.cts +0 -9
- package/dist/kernel/components/mdx/components/figure-caption.cjs +0 -63
- package/dist/kernel/components/mdx/components/figure-caption.d.cts +0 -6
- package/dist/kernel/components/mdx/components/figure.cjs +0 -78
- package/dist/kernel/components/mdx/components/figure.d.cts +0 -10
- package/dist/kernel/components/mdx/components/footnotes.cjs +0 -66
- package/dist/kernel/components/mdx/components/footnotes.d.cts +0 -6
- package/dist/kernel/components/mdx/components/heading-copy-link.cjs +0 -108
- package/dist/kernel/components/mdx/components/heading-copy-link.d.cts +0 -23
- package/dist/kernel/components/mdx/components/heading.cjs +0 -166
- package/dist/kernel/components/mdx/components/heading.d.cts +0 -8
- package/dist/kernel/components/mdx/components/hr.cjs +0 -34
- package/dist/kernel/components/mdx/components/hr.d.cts +0 -9
- package/dist/kernel/components/mdx/components/image-zoom.cjs +0 -49
- package/dist/kernel/components/mdx/components/image-zoom.d.cts +0 -10
- package/dist/kernel/components/mdx/components/image.cjs +0 -192
- package/dist/kernel/components/mdx/components/image.d.cts +0 -21
- package/dist/kernel/components/mdx/components/inline-code.cjs +0 -66
- package/dist/kernel/components/mdx/components/inline-code.d.cts +0 -6
- package/dist/kernel/components/mdx/components/kbd.cjs +0 -34
- package/dist/kernel/components/mdx/components/kbd.d.cts +0 -10
- package/dist/kernel/components/mdx/components/link.cjs +0 -49
- package/dist/kernel/components/mdx/components/link.d.cts +0 -11
- package/dist/kernel/components/mdx/components/paragraph.cjs +0 -87
- package/dist/kernel/components/mdx/components/paragraph.d.cts +0 -5
- package/dist/kernel/components/mdx/components/pre.cjs +0 -66
- package/dist/kernel/components/mdx/components/pre.d.cts +0 -6
- package/dist/kernel/components/mdx/components/strikethrough.cjs +0 -63
- package/dist/kernel/components/mdx/components/strikethrough.d.cts +0 -6
- package/dist/kernel/components/mdx/components/table.cjs +0 -59
- package/dist/kernel/components/mdx/components/table.d.cts +0 -10
- package/dist/kernel/components/mdx/components/task-list.cjs +0 -88
- package/dist/kernel/components/mdx/components/task-list.d.cts +0 -8
- package/dist/kernel/components/mdx/components/video-player.cjs +0 -173
- package/dist/kernel/components/mdx/components/video-player.d.cts +0 -18
- package/dist/kernel/components/mdx/components/video.cjs +0 -185
- package/dist/kernel/components/mdx/components/video.d.cts +0 -15
- package/dist/kernel/components/mdx/error-boundary.cjs +0 -62
- package/dist/kernel/components/mdx/error-boundary.d.cts +0 -8
- package/dist/kernel/components/mdx/error-fallback.cjs +0 -58
- package/dist/kernel/components/mdx/error-fallback.d.cts +0 -9
- package/dist/kernel/components/mdx/mdx.cjs +0 -141
- package/dist/kernel/components/mdx/mdx.d.cts +0 -22
- package/dist/kernel/components/mdx/rehype-heading-ids.cjs +0 -113
- package/dist/kernel/components/mdx/rehype-heading-ids.d.cts +0 -10
- package/dist/kernel/components/mdx/types.cjs +0 -18
- package/dist/kernel/components/mdx/types.d.cts +0 -18
- package/dist/kernel/components/ui/accordion.cjs +0 -104
- package/dist/kernel/components/ui/accordion.d.cts +0 -16
- package/dist/kernel/components/ui/breadcrumb-trail.cjs +0 -238
- package/dist/kernel/components/ui/breadcrumb-trail.d.cts +0 -13
- package/dist/kernel/components/ui/breadcrumb.cjs +0 -399
- package/dist/kernel/components/ui/breadcrumb.d.cts +0 -52
- package/dist/kernel/components/ui/button-group.cjs +0 -143
- package/dist/kernel/components/ui/button-group.d.cts +0 -19
- package/dist/kernel/components/ui/button.cjs +0 -139
- package/dist/kernel/components/ui/card.cjs +0 -133
- package/dist/kernel/components/ui/card.d.cts +0 -17
- package/dist/kernel/components/ui/dialog.cjs +0 -149
- package/dist/kernel/components/ui/dialog.d.cts +0 -22
- package/dist/kernel/components/ui/drawer.cjs +0 -163
- package/dist/kernel/components/ui/drawer.d.cts +0 -24
- package/dist/kernel/components/ui/input.cjs +0 -96
- package/dist/kernel/components/ui/input.d.cts +0 -18
- package/dist/kernel/components/ui/kbd.cjs +0 -105
- package/dist/kernel/components/ui/kbd.d.cts +0 -13
- package/dist/kernel/components/ui/link.cjs +0 -253
- package/dist/kernel/components/ui/menu.cjs +0 -301
- package/dist/kernel/components/ui/menu.d.cts +0 -70
- package/dist/kernel/components/ui/meta-key.cjs +0 -34
- package/dist/kernel/components/ui/meta-key.d.cts +0 -12
- package/dist/kernel/components/ui/navigation-menu.cjs +0 -253
- package/dist/kernel/components/ui/navigation-menu.d.cts +0 -47
- package/dist/kernel/components/ui/popover.cjs +0 -168
- package/dist/kernel/components/ui/popover.d.cts +0 -24
- package/dist/kernel/components/ui/progress.cjs +0 -112
- package/dist/kernel/components/ui/progress.d.cts +0 -16
- package/dist/kernel/components/ui/scroll-area.cjs +0 -413
- package/dist/kernel/components/ui/scroll-area.d.cts +0 -58
- package/dist/kernel/components/ui/select.cjs +0 -244
- package/dist/kernel/components/ui/select.d.cts +0 -40
- package/dist/kernel/components/ui/separator.cjs +0 -73
- package/dist/kernel/components/ui/separator.d.cts +0 -8
- package/dist/kernel/components/ui/table.cjs +0 -131
- package/dist/kernel/components/ui/table.d.cts +0 -11
- package/dist/kernel/components/ui/tabs.cjs +0 -450
- package/dist/kernel/components/ui/tabs.d.cts +0 -82
- package/dist/kernel/components/ui/tag.cjs +0 -104
- package/dist/kernel/components/ui/tag.d.cts +0 -14
- package/dist/kernel/components/ui/text.cjs +0 -184
- package/dist/kernel/components/ui/text.d.cts +0 -17
- package/dist/kernel/components/ui/theme-toggle.cjs +0 -108
- package/dist/kernel/components/ui/theme-toggle.d.cts +0 -10
- package/dist/kernel/components/ui/toast.cjs +0 -154
- package/dist/kernel/components/ui/toast.d.cts +0 -26
- package/dist/kernel/components/ui/tooltip.cjs +0 -127
- package/dist/kernel/components/ui/tooltip.d.cts +0 -20
- package/dist/kernel/defaults.registry.cjs +0 -541
- package/dist/kernel/defaults.registry.d.cts +0 -469
- package/dist/kernel/routes/agent/markdown.cjs +0 -202
- package/dist/kernel/routes/agent/markdown.d.cts +0 -58
- package/dist/kernel/routes/layouts/group.cjs +0 -181
- package/dist/kernel/routes/layouts/group.d.cts +0 -20
- package/dist/kernel/routes/metadata/feed.cjs +0 -293
- package/dist/kernel/routes/metadata/feed.d.cts +0 -20
- package/dist/kernel/routes/metadata/llms.cjs +0 -239
- package/dist/kernel/routes/metadata/llms.d.cts +0 -26
- package/dist/kernel/routes/metadata/og-image.cjs +0 -630
- package/dist/kernel/routes/metadata/robots.cjs +0 -148
- package/dist/kernel/routes/metadata/robots.d.cts +0 -6
- package/dist/kernel/routes/metadata/sitemap.cjs +0 -192
- package/dist/kernel/routes/metadata/sitemap.d.cts +0 -8
- package/dist/kernel/routes/pages/group.cjs +0 -263
- package/dist/kernel/routes/pages/group.d.cts +0 -17
- package/dist/kernel/routes/pages/leaf.cjs +0 -421
- package/dist/kernel/routes/pages/leaf.d.cts +0 -36
- package/dist/kernel/routes/pages/root.cjs +0 -229
- package/dist/kernel/routes/pages/root.d.cts +0 -16
- package/dist/keyboard-shortcuts.cjs +0 -345
- package/dist/keyboard-shortcuts.d.cts +0 -34
- package/dist/resolvers/manifest-resolver.cjs +0 -111
- package/dist/resolvers/manifest-resolver.d.cts +0 -13
- package/dist/search.cjs +0 -411
- package/dist/search.d.cts +0 -20
- package/dist/types.cjs +0 -30
- package/dist/types.d.cts +0 -269
- package/dist/utils/cn.cjs +0 -49
- package/dist/utils/cn.d.cts +0 -15
- package/dist/utils/heading-ids.cjs +0 -119
- package/dist/utils/heading-ids.d.cts +0 -15
- package/dist/utils/pretty-date.cjs +0 -55
- package/dist/utils/pretty-date.d.cts +0 -6
- package/release/pnpm-lock.yaml +0 -1215
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
// src/
|
|
4
|
-
import { buttonVariants } from "
|
|
3
|
+
// src/components/block/search.tsx
|
|
4
|
+
import { buttonVariants } from "@publish.os/nextjs/kernel/components/ui/button";
|
|
5
5
|
import {
|
|
6
6
|
Dialog,
|
|
7
7
|
DialogBackdrop,
|
|
@@ -11,45 +11,22 @@ import {
|
|
|
11
11
|
DialogPortal,
|
|
12
12
|
DialogTitle,
|
|
13
13
|
DialogTrigger
|
|
14
|
-
} from "
|
|
15
|
-
import { Input } from "
|
|
16
|
-
import { Kbd } from "
|
|
14
|
+
} from "@publish.os/nextjs/kernel/components/ui/dialog";
|
|
15
|
+
import { Input } from "@publish.os/nextjs/kernel/components/ui/input";
|
|
16
|
+
import { Kbd } from "@publish.os/nextjs/kernel/components/ui/kbd";
|
|
17
17
|
import {
|
|
18
18
|
Progress,
|
|
19
19
|
ProgressIndicator,
|
|
20
20
|
ProgressTrack
|
|
21
|
-
} from "
|
|
22
|
-
import { ScrollArea } from "
|
|
21
|
+
} from "@publish.os/nextjs/kernel/components/ui/progress";
|
|
22
|
+
import { ScrollArea } from "@publish.os/nextjs/kernel/components/ui/scroll-area";
|
|
23
|
+
import { FrameworkSearchIcon as SearchIcon } from "@publish.os/nextjs/kernel/framework-icons";
|
|
23
24
|
import { formatShortcut } from "@publish.os/nextjs/keyboard-shortcuts";
|
|
24
25
|
import {
|
|
25
26
|
SearchProvider,
|
|
26
27
|
useSearchBlock
|
|
27
28
|
} from "@publish.os/nextjs/search";
|
|
28
|
-
|
|
29
|
-
// src/utils/cn.ts
|
|
30
|
-
import { clsx } from "clsx";
|
|
31
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
32
|
-
var twMerge = extendTailwindMerge({
|
|
33
|
-
extend: {
|
|
34
|
-
classGroups: {
|
|
35
|
-
z: [
|
|
36
|
-
"z-content",
|
|
37
|
-
"z-nav",
|
|
38
|
-
"z-overlay",
|
|
39
|
-
"z-modal",
|
|
40
|
-
"z-search",
|
|
41
|
-
"z-toast",
|
|
42
|
-
"z-progress"
|
|
43
|
-
]
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
function cn(...inputs) {
|
|
48
|
-
return twMerge(clsx(inputs));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// src/kernel/components/blocks/search.tsx
|
|
52
|
-
import { Search as SearchIcon } from "lucide-react";
|
|
29
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
53
30
|
import NextLink from "next/link";
|
|
54
31
|
import {
|
|
55
32
|
cloneElement,
|
|
@@ -60,12 +37,7 @@ import {
|
|
|
60
37
|
useState
|
|
61
38
|
} from "react";
|
|
62
39
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
63
|
-
var SEARCH_ROW_HEIGHT = 58
|
|
64
|
-
var SEARCH_ROW_WITH_DESCRIPTION_HEIGHT = 72;
|
|
65
|
-
var SEARCH_RESULTS_PADDING = 16;
|
|
66
|
-
var SEARCH_RESULTS_MAX_HEIGHT = 360;
|
|
67
|
-
var SEARCH_RESULT_SNIPPET_LENGTH = 180;
|
|
68
|
-
var searchProgressConfig = {
|
|
40
|
+
var SEARCH_ROW_HEIGHT = 58, SEARCH_ROW_WITH_DESCRIPTION_HEIGHT = 72, SEARCH_RESULTS_PADDING = 16, SEARCH_RESULTS_MAX_HEIGHT = 360, SEARCH_RESULT_SNIPPET_LENGTH = 180, searchProgressConfig = {
|
|
69
41
|
completeDelay: 100,
|
|
70
42
|
exitDuration: 150,
|
|
71
43
|
fastPhaseEnd: 25,
|
|
@@ -75,78 +47,45 @@ var searchProgressConfig = {
|
|
|
75
47
|
targetProgress: 95
|
|
76
48
|
};
|
|
77
49
|
function SearchProgressBar({ className }) {
|
|
78
|
-
|
|
50
|
+
let {
|
|
79
51
|
state: { isTyping, loading, status }
|
|
80
|
-
} = useSearchBlock()
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const cleanupTimer = useRef(null);
|
|
85
|
-
const progressRef = useRef(0);
|
|
86
|
-
const active = loading || status === "building" || status === "stale";
|
|
87
|
-
const setProgressValue = useCallback((value) => {
|
|
88
|
-
progressRef.current = value;
|
|
89
|
-
setProgress(value);
|
|
90
|
-
}, []);
|
|
91
|
-
const cleanup = useCallback(() => {
|
|
92
|
-
if (animationFrame.current !== null) {
|
|
93
|
-
window.cancelAnimationFrame(animationFrame.current);
|
|
94
|
-
animationFrame.current = null;
|
|
95
|
-
}
|
|
96
|
-
if (cleanupTimer.current) {
|
|
97
|
-
window.clearTimeout(cleanupTimer.current);
|
|
98
|
-
cleanupTimer.current = null;
|
|
99
|
-
}
|
|
52
|
+
} = useSearchBlock(), [progress, setProgress] = useState(0), [isExiting, setIsExiting] = useState(!1), animationFrame = useRef(null), cleanupTimer = useRef(null), progressRef = useRef(0), active = loading || status === "building" || status === "stale", setProgressValue = useCallback((value) => {
|
|
53
|
+
progressRef.current = value, setProgress(value);
|
|
54
|
+
}, []), cleanup = useCallback(() => {
|
|
55
|
+
animationFrame.current !== null && (window.cancelAnimationFrame(animationFrame.current), animationFrame.current = null), cleanupTimer.current && (window.clearTimeout(cleanupTimer.current), cleanupTimer.current = null);
|
|
100
56
|
}, []);
|
|
101
57
|
useEffect(() => {
|
|
102
58
|
if (isTyping) {
|
|
103
|
-
cleanup();
|
|
104
|
-
setProgressValue(0);
|
|
105
|
-
setIsExiting(false);
|
|
59
|
+
cleanup(), setProgressValue(0), setIsExiting(!1);
|
|
106
60
|
return;
|
|
107
61
|
}
|
|
108
62
|
if (!active) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
cleanupTimer.current = window.setTimeout(() => {
|
|
115
|
-
setProgressValue(0);
|
|
116
|
-
setIsExiting(false);
|
|
117
|
-
cleanupTimer.current = null;
|
|
118
|
-
}, searchProgressConfig.exitDuration);
|
|
119
|
-
}, searchProgressConfig.completeDelay);
|
|
120
|
-
}
|
|
63
|
+
progressRef.current > 0 && (cleanup(), setProgressValue(100), cleanupTimer.current = window.setTimeout(() => {
|
|
64
|
+
setIsExiting(!0), cleanupTimer.current = window.setTimeout(() => {
|
|
65
|
+
setProgressValue(0), setIsExiting(!1), cleanupTimer.current = null;
|
|
66
|
+
}, searchProgressConfig.exitDuration);
|
|
67
|
+
}, searchProgressConfig.completeDelay));
|
|
121
68
|
return;
|
|
122
69
|
}
|
|
123
|
-
cleanup();
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
const animate = (now) => {
|
|
128
|
-
const elapsed = now - start;
|
|
129
|
-
let progressValue;
|
|
130
|
-
if (elapsed < searchProgressConfig.minDuration) {
|
|
70
|
+
cleanup(), setIsExiting(!1), setProgressValue(searchProgressConfig.initialProgress);
|
|
71
|
+
let start = performance.now(), animate = (now) => {
|
|
72
|
+
let elapsed = now - start, progressValue;
|
|
73
|
+
if (elapsed < searchProgressConfig.minDuration)
|
|
131
74
|
progressValue = searchProgressConfig.initialProgress + elapsed / searchProgressConfig.minDuration * (searchProgressConfig.fastPhaseEnd - searchProgressConfig.initialProgress);
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const normalizedTime = Math.min(
|
|
75
|
+
else {
|
|
76
|
+
let remainingProgress = searchProgressConfig.targetProgress - searchProgressConfig.fastPhaseEnd, easedTime = 1 - (1 - Math.min(
|
|
135
77
|
1,
|
|
136
78
|
(elapsed - searchProgressConfig.minDuration) / (searchProgressConfig.maxDuration - searchProgressConfig.minDuration)
|
|
137
|
-
);
|
|
138
|
-
const easedTime = 1 - (1 - normalizedTime) ** 3;
|
|
79
|
+
)) ** 3;
|
|
139
80
|
progressValue = searchProgressConfig.fastPhaseEnd + easedTime * remainingProgress;
|
|
140
81
|
}
|
|
141
82
|
setProgressValue(
|
|
142
83
|
Math.min(searchProgressConfig.targetProgress, progressValue)
|
|
143
|
-
);
|
|
144
|
-
animationFrame.current = window.requestAnimationFrame(animate);
|
|
84
|
+
), animationFrame.current = window.requestAnimationFrame(animate);
|
|
145
85
|
};
|
|
146
|
-
animationFrame.current = window.requestAnimationFrame(animate);
|
|
147
|
-
return cleanup;
|
|
86
|
+
return animationFrame.current = window.requestAnimationFrame(animate), cleanup;
|
|
148
87
|
}, [active, cleanup, isTyping, setProgressValue]);
|
|
149
|
-
|
|
88
|
+
let isVisible = progress > 0;
|
|
150
89
|
return /* @__PURE__ */ jsx(
|
|
151
90
|
Progress,
|
|
152
91
|
{
|
|
@@ -175,7 +114,7 @@ function RootDialogFrame({
|
|
|
175
114
|
children,
|
|
176
115
|
className
|
|
177
116
|
}) {
|
|
178
|
-
|
|
117
|
+
let {
|
|
179
118
|
actions: { setOpen },
|
|
180
119
|
meta: { variant },
|
|
181
120
|
state: { open }
|
|
@@ -186,40 +125,35 @@ function Root({ children, className, ...providerProps }) {
|
|
|
186
125
|
return /* @__PURE__ */ jsx(SearchProvider, { ...providerProps, children: /* @__PURE__ */ jsx(RootDialogFrame, { className, children }) });
|
|
187
126
|
}
|
|
188
127
|
function Trigger({
|
|
189
|
-
asChild =
|
|
128
|
+
asChild = !1,
|
|
190
129
|
children,
|
|
191
130
|
className,
|
|
192
131
|
icon,
|
|
193
132
|
placeholder = "Search...",
|
|
194
133
|
shortcut,
|
|
195
134
|
shortcutClassName,
|
|
196
|
-
showIcon =
|
|
197
|
-
showShortcut =
|
|
135
|
+
showIcon = !0,
|
|
136
|
+
showShortcut = !0,
|
|
198
137
|
size = "sm",
|
|
199
138
|
variant = "outline"
|
|
200
139
|
}) {
|
|
201
|
-
|
|
140
|
+
let {
|
|
202
141
|
meta: { inputId, shortcut: registeredShortcut },
|
|
203
142
|
state: { open }
|
|
204
|
-
} = useSearchBlock()
|
|
205
|
-
const visibleShortcut = shortcut ?? registeredShortcut;
|
|
206
|
-
const shortcutTokens = useMemo(
|
|
143
|
+
} = useSearchBlock(), visibleShortcut = shortcut ?? registeredShortcut, shortcutTokens = useMemo(
|
|
207
144
|
() => formatShortcut(visibleShortcut),
|
|
208
145
|
[visibleShortcut]
|
|
209
146
|
);
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
{
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
return /* @__PURE__ */ jsxs(
|
|
147
|
+
return asChild && children ? /* @__PURE__ */ jsx(
|
|
148
|
+
DialogTrigger,
|
|
149
|
+
{
|
|
150
|
+
render: cloneElement(children, {
|
|
151
|
+
"aria-controls": inputId,
|
|
152
|
+
"aria-expanded": open,
|
|
153
|
+
className: cn(children.props.className, className)
|
|
154
|
+
})
|
|
155
|
+
}
|
|
156
|
+
) : /* @__PURE__ */ jsxs(
|
|
223
157
|
DialogTrigger,
|
|
224
158
|
{
|
|
225
159
|
"aria-controls": inputId,
|
|
@@ -255,11 +189,11 @@ function DialogContent({
|
|
|
255
189
|
description = "Search this site and navigate to a result.",
|
|
256
190
|
title = "Search"
|
|
257
191
|
}) {
|
|
258
|
-
|
|
192
|
+
let {
|
|
259
193
|
meta: { variant }
|
|
260
194
|
} = useSearchBlock();
|
|
261
195
|
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
262
|
-
/* @__PURE__ */ jsx(DialogBackdrop, { className: "bg-
|
|
196
|
+
/* @__PURE__ */ jsx(DialogBackdrop, { className: "bg-backdrop backdrop-blur-[2px]" }),
|
|
263
197
|
/* @__PURE__ */ jsxs(
|
|
264
198
|
DialogPopup,
|
|
265
199
|
{
|
|
@@ -283,42 +217,36 @@ function SearchInputField({
|
|
|
283
217
|
closeLabel = "ESC",
|
|
284
218
|
placeholder = "Search docs...",
|
|
285
219
|
rootClassName,
|
|
286
|
-
showCloseShortcut =
|
|
220
|
+
showCloseShortcut = !0
|
|
287
221
|
}) {
|
|
288
|
-
|
|
222
|
+
let {
|
|
289
223
|
actions: { handleInputChange, navigateToResult, setOpen, setSelectedValue },
|
|
290
224
|
meta: { inputId, inputRef, listId },
|
|
291
225
|
state: { displayResults, query, selectedValue }
|
|
292
|
-
} = useSearchBlock()
|
|
293
|
-
const closeDisplayLabel = typeof closeLabel === "string" ? closeLabel.toUpperCase() : closeLabel;
|
|
294
|
-
const selectedIndex2 = Math.max(
|
|
226
|
+
} = useSearchBlock(), closeDisplayLabel = typeof closeLabel == "string" ? closeLabel.toUpperCase() : closeLabel, selectedIndex2 = Math.max(
|
|
295
227
|
0,
|
|
296
228
|
displayResults.findIndex((result) => result.id === selectedValue)
|
|
297
|
-
)
|
|
298
|
-
const selectedOptionId = displayResults.length > 0 ? resultOptionId(listId, selectedIndex2) : void 0;
|
|
299
|
-
const handleKeyDown = (event) => {
|
|
229
|
+
), selectedOptionId = displayResults.length > 0 ? resultOptionId(listId, selectedIndex2) : void 0, handleKeyDown = (event) => {
|
|
300
230
|
if (event.key === "Escape") {
|
|
301
|
-
event.preventDefault();
|
|
302
|
-
setOpen(false);
|
|
231
|
+
event.preventDefault(), setOpen(!1);
|
|
303
232
|
return;
|
|
304
233
|
}
|
|
305
234
|
if (event.key === "ArrowDown") {
|
|
306
235
|
event.preventDefault();
|
|
307
|
-
|
|
308
|
-
|
|
236
|
+
let next = displayResults[Math.min(selectedIndex2 + 1, displayResults.length - 1)];
|
|
237
|
+
next && setSelectedValue(next.id);
|
|
309
238
|
return;
|
|
310
239
|
}
|
|
311
240
|
if (event.key === "ArrowUp") {
|
|
312
241
|
event.preventDefault();
|
|
313
|
-
|
|
314
|
-
|
|
242
|
+
let next = displayResults[Math.max(selectedIndex2 - 1, 0)];
|
|
243
|
+
next && setSelectedValue(next.id);
|
|
315
244
|
return;
|
|
316
245
|
}
|
|
317
246
|
if (event.key === "Enter") {
|
|
318
|
-
|
|
247
|
+
let selected = displayResults[selectedIndex2];
|
|
319
248
|
if (!selected) return;
|
|
320
|
-
event.preventDefault();
|
|
321
|
-
navigateToResult(selected);
|
|
249
|
+
event.preventDefault(), navigateToResult(selected);
|
|
322
250
|
}
|
|
323
251
|
};
|
|
324
252
|
return /* @__PURE__ */ jsxs(
|
|
@@ -345,7 +273,7 @@ function SearchInputField({
|
|
|
345
273
|
placeholder,
|
|
346
274
|
ref: inputRef,
|
|
347
275
|
role: "combobox",
|
|
348
|
-
spellCheck:
|
|
276
|
+
spellCheck: !1,
|
|
349
277
|
type: "text",
|
|
350
278
|
value: query
|
|
351
279
|
}
|
|
@@ -369,7 +297,7 @@ function SearchResults({
|
|
|
369
297
|
className,
|
|
370
298
|
emptyText = "No results found."
|
|
371
299
|
}) {
|
|
372
|
-
|
|
300
|
+
let {
|
|
373
301
|
actions: { navigateToResult, setOpen, setSelectedValue },
|
|
374
302
|
meta: { listId, listRef },
|
|
375
303
|
state: {
|
|
@@ -381,34 +309,21 @@ function SearchResults({
|
|
|
381
309
|
selectedValue,
|
|
382
310
|
status
|
|
383
311
|
}
|
|
384
|
-
} = useSearchBlock()
|
|
385
|
-
const hasQuery = query.trim().length > 0;
|
|
386
|
-
const showResults = displayResults.length > 0;
|
|
387
|
-
const statusMessage = message ?? statusLabel(status);
|
|
388
|
-
const showStatusPanel = hasQuery && !isTyping && !loading && !showResults && (status === "building" || status === "stale" || status === "error");
|
|
389
|
-
const showEmptyPanel = hasQuery && !isTyping && !loading && !showResults && !showStatusPanel && status === "ready";
|
|
390
|
-
const showPanel = showResults || showStatusPanel || showEmptyPanel;
|
|
391
|
-
const resultRowHeight = displayResults.some(
|
|
312
|
+
} = useSearchBlock(), hasQuery = query.trim().length > 0, showResults = displayResults.length > 0, statusMessage = message ?? statusLabel(status), showStatusPanel = hasQuery && !isTyping && !loading && !showResults && (status === "building" || status === "stale" || status === "error"), showEmptyPanel = hasQuery && !isTyping && !loading && !showResults && !showStatusPanel && status === "ready", showPanel = showResults || showStatusPanel || showEmptyPanel, resultRowHeight = displayResults.some(
|
|
392
313
|
(result) => resultSnippet({ query, result })
|
|
393
|
-
) ? SEARCH_ROW_WITH_DESCRIPTION_HEIGHT : SEARCH_ROW_HEIGHT;
|
|
394
|
-
|
|
395
|
-
const resultsAreScrollable = fullResultsHeight > SEARCH_RESULTS_MAX_HEIGHT;
|
|
396
|
-
const resultsHeight = Math.min(fullResultsHeight, SEARCH_RESULTS_MAX_HEIGHT);
|
|
397
|
-
const panelHeight = showResults ? resultsHeight : showStatusPanel || showEmptyPanel ? 144 : 0;
|
|
398
|
-
const containerDuration = showResults ? Math.min(320, 150 + displayResults.length * 18) : 180;
|
|
399
|
-
useEffect(() => {
|
|
314
|
+
) ? SEARCH_ROW_WITH_DESCRIPTION_HEIGHT : SEARCH_ROW_HEIGHT, fullResultsHeight = displayResults.length * resultRowHeight + SEARCH_RESULTS_PADDING, resultsAreScrollable = fullResultsHeight > SEARCH_RESULTS_MAX_HEIGHT, resultsHeight = Math.min(fullResultsHeight, SEARCH_RESULTS_MAX_HEIGHT), panelHeight = showResults ? resultsHeight : showStatusPanel || showEmptyPanel ? 144 : 0, containerDuration = showResults ? Math.min(320, 150 + displayResults.length * 18) : 180;
|
|
315
|
+
return useEffect(() => {
|
|
400
316
|
if (!selectedValue || !showResults) return;
|
|
401
|
-
|
|
402
|
-
|
|
317
|
+
let frame = window.requestAnimationFrame(() => {
|
|
318
|
+
let index = selectedIndex(displayResults, selectedValue);
|
|
403
319
|
document.getElementById(resultOptionId(listId, index))?.scrollIntoView({ block: "nearest" });
|
|
404
320
|
});
|
|
405
321
|
return () => window.cancelAnimationFrame(frame);
|
|
406
|
-
}, [displayResults, listId, selectedValue, showResults])
|
|
407
|
-
return /* @__PURE__ */ jsx(
|
|
322
|
+
}, [displayResults, listId, selectedValue, showResults]), /* @__PURE__ */ jsx(
|
|
408
323
|
"div",
|
|
409
324
|
{
|
|
410
325
|
className: cn(
|
|
411
|
-
"relative grid rounded-b-[inherit] bg-surface-1 transition-[grid-template-rows,opacity] ease-[cubic-bezier(0.4,0,0.2,1)] before:pointer-events-none before:absolute before:inset-x-0 before:top-0 before:z-
|
|
326
|
+
"relative grid rounded-b-[inherit] bg-surface-1 transition-[grid-template-rows,opacity] ease-[cubic-bezier(0.4,0,0.2,1)] before:pointer-events-none before:absolute before:inset-x-0 before:top-0 before:z-content before:h-px before:bg-stroke-3 before:transition-opacity motion-reduce:transition-none",
|
|
412
327
|
showPanel ? "opacity-100" : "opacity-0",
|
|
413
328
|
showPanel ? "before:opacity-100" : "before:opacity-0",
|
|
414
329
|
className
|
|
@@ -447,7 +362,7 @@ function SearchResults({
|
|
|
447
362
|
ScrollArea,
|
|
448
363
|
{
|
|
449
364
|
className: "h-full",
|
|
450
|
-
mask: resultsAreScrollable ? { height: 40, triggerSize: 32 } :
|
|
365
|
+
mask: resultsAreScrollable ? { height: 40, triggerSize: 32 } : !1,
|
|
451
366
|
scrollbar: resultsAreScrollable,
|
|
452
367
|
variant: "gradient",
|
|
453
368
|
children: /* @__PURE__ */ jsx(
|
|
@@ -459,23 +374,21 @@ function SearchResults({
|
|
|
459
374
|
ref: listRef,
|
|
460
375
|
role: "listbox",
|
|
461
376
|
children: displayResults.map((result, index) => {
|
|
462
|
-
|
|
377
|
+
let snippet = resultSnippet({ query, result });
|
|
463
378
|
return /* @__PURE__ */ jsxs(
|
|
464
379
|
NextLink,
|
|
465
380
|
{
|
|
466
381
|
"aria-selected": result.id === selectedValue,
|
|
467
382
|
className: cn(
|
|
468
383
|
"block min-h-[58px] min-w-0 overflow-hidden rounded-[max(calc(var(--radius-dialog)_-_0.25rem),0px)] px-3 py-2 text-left transition-colors",
|
|
469
|
-
"focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-focus-
|
|
384
|
+
"focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-focus-stroke",
|
|
470
385
|
result.id === selectedValue ? "bg-surface-active text-foreground-1" : "text-foreground-2"
|
|
471
386
|
),
|
|
472
387
|
href: result.url,
|
|
473
388
|
id: resultOptionId(listId, index),
|
|
474
|
-
onClick: () => setOpen(
|
|
389
|
+
onClick: () => setOpen(!1),
|
|
475
390
|
onKeyDown: (event) => {
|
|
476
|
-
|
|
477
|
-
event.preventDefault();
|
|
478
|
-
navigateToResult(result);
|
|
391
|
+
event.key === "Enter" && (event.preventDefault(), navigateToResult(result));
|
|
479
392
|
},
|
|
480
393
|
onMouseEnter: () => setSelectedValue(result.id),
|
|
481
394
|
onMouseMove: () => setSelectedValue(result.id),
|
|
@@ -504,10 +417,7 @@ function SearchResults({
|
|
|
504
417
|
);
|
|
505
418
|
}
|
|
506
419
|
function statusLabel(status) {
|
|
507
|
-
|
|
508
|
-
if (status === "stale") return "Updating search index...";
|
|
509
|
-
if (status === "error") return "Search is temporarily unavailable";
|
|
510
|
-
return "Searching...";
|
|
420
|
+
return status === "building" ? "Building search index..." : status === "stale" ? "Updating search index..." : status === "error" ? "Search is temporarily unavailable" : "Searching...";
|
|
511
421
|
}
|
|
512
422
|
function resultOptionId(listId, index) {
|
|
513
423
|
return `${listId}-result-${index}`;
|
|
@@ -519,128 +429,87 @@ function selectedIndex(results, selectedValue) {
|
|
|
519
429
|
);
|
|
520
430
|
}
|
|
521
431
|
function cleanResultPath(url) {
|
|
522
|
-
|
|
523
|
-
return path || "/";
|
|
432
|
+
return (url.split("#")[0]?.replace(/^\/+|\/+$/g, "") ?? "") || "/";
|
|
524
433
|
}
|
|
525
434
|
function resultSubtitle(result) {
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
if (section && path && !path.startsWith(section)) {
|
|
529
|
-
return `${section} / ${path}`;
|
|
530
|
-
}
|
|
531
|
-
return path || section || result.url;
|
|
435
|
+
let section = result.meta.section ?? result.meta.group, path = cleanResultPath(result.meta.path ?? result.url);
|
|
436
|
+
return section && path && !path.startsWith(section) ? `${section} / ${path}` : path || section || result.url;
|
|
532
437
|
}
|
|
533
438
|
function normalizedSnippetText(text) {
|
|
534
439
|
return (text ?? "").replace(/\s+/g, " ").trim();
|
|
535
440
|
}
|
|
536
441
|
function queryMatches(text, query) {
|
|
537
|
-
|
|
538
|
-
if (!normalizedQuery) return
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
return normalizedQuery.split(/\s+/).filter((term) => term.length > 1).some((term) => lower.includes(term));
|
|
442
|
+
let normalizedQuery = query.trim().toLowerCase();
|
|
443
|
+
if (!normalizedQuery) return !1;
|
|
444
|
+
let lower = text.toLowerCase();
|
|
445
|
+
return lower.includes(normalizedQuery) ? !0 : normalizedQuery.split(/\s+/).filter((term) => term.length > 1).some((term) => lower.includes(term));
|
|
542
446
|
}
|
|
543
447
|
function firstMatchIndex(text, query) {
|
|
544
|
-
|
|
448
|
+
let normalizedQuery = query.trim().toLowerCase();
|
|
545
449
|
if (!normalizedQuery) return -1;
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
if (phraseIndex >= 0) return phraseIndex;
|
|
549
|
-
return normalizedQuery.split(/\s+/).filter((term) => term.length > 1).map((term) => lower.indexOf(term)).filter((index) => index >= 0).sort((left, right) => left - right)[0] ?? -1;
|
|
450
|
+
let lower = text.toLowerCase(), phraseIndex = lower.indexOf(normalizedQuery);
|
|
451
|
+
return phraseIndex >= 0 ? phraseIndex : normalizedQuery.split(/\s+/).filter((term) => term.length > 1).map((term) => lower.indexOf(term)).filter((index) => index >= 0).sort((left, right) => left - right)[0] ?? -1;
|
|
550
452
|
}
|
|
551
453
|
function contextualSnippet({
|
|
552
454
|
length = SEARCH_RESULT_SNIPPET_LENGTH,
|
|
553
455
|
query,
|
|
554
456
|
text
|
|
555
457
|
}) {
|
|
556
|
-
|
|
458
|
+
let normalizedText = normalizedSnippetText(text);
|
|
557
459
|
if (normalizedText.length <= length) return normalizedText;
|
|
558
|
-
|
|
460
|
+
let matchIndex = firstMatchIndex(normalizedText, query);
|
|
559
461
|
if (matchIndex < 0) return `${normalizedText.slice(0, length).trimEnd()}...`;
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
start = Math.max(0, end - length);
|
|
565
|
-
}
|
|
566
|
-
if (start > 0) {
|
|
567
|
-
const nextSpace = normalizedText.indexOf(" ", start);
|
|
568
|
-
if (nextSpace > start && nextSpace < matchIndex) {
|
|
569
|
-
start = nextSpace + 1;
|
|
570
|
-
}
|
|
462
|
+
let halfLength = Math.floor(length / 2), start = Math.max(0, matchIndex - halfLength), end = Math.min(normalizedText.length, start + length);
|
|
463
|
+
if (end - start < length && (start = Math.max(0, end - length)), start > 0) {
|
|
464
|
+
let nextSpace = normalizedText.indexOf(" ", start);
|
|
465
|
+
nextSpace > start && nextSpace < matchIndex && (start = nextSpace + 1);
|
|
571
466
|
}
|
|
572
467
|
if (end < normalizedText.length) {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
end = previousSpace;
|
|
576
|
-
}
|
|
468
|
+
let previousSpace = normalizedText.lastIndexOf(" ", end);
|
|
469
|
+
previousSpace > matchIndex && (end = previousSpace);
|
|
577
470
|
}
|
|
578
|
-
|
|
579
|
-
const suffix = end < normalizedText.length ? " ..." : "";
|
|
471
|
+
let prefix = start > 0 ? "... " : "", suffix = end < normalizedText.length ? " ..." : "";
|
|
580
472
|
return `${prefix}${normalizedText.slice(start, end).trim()}${suffix}`;
|
|
581
473
|
}
|
|
582
474
|
function resultSnippet({
|
|
583
475
|
query,
|
|
584
476
|
result
|
|
585
477
|
}) {
|
|
586
|
-
|
|
587
|
-
if (description && queryMatches(description, query))
|
|
478
|
+
let description = normalizedSnippetText(result.meta.description);
|
|
479
|
+
if (description && queryMatches(description, query))
|
|
588
480
|
return contextualSnippet({ query, text: description });
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
if (excerpt) {
|
|
592
|
-
return contextualSnippet({ query, text: excerpt });
|
|
593
|
-
}
|
|
594
|
-
return description ? contextualSnippet({ query, text: description }) : "";
|
|
481
|
+
let excerpt = normalizedSnippetText(result.plainExcerpt);
|
|
482
|
+
return excerpt ? contextualSnippet({ query, text: excerpt }) : description ? contextualSnippet({ query, text: description }) : "";
|
|
595
483
|
}
|
|
596
484
|
function HighlightedText({ query, text }) {
|
|
597
|
-
|
|
485
|
+
let normalizedQuery = query.trim().toLowerCase();
|
|
598
486
|
if (!normalizedQuery) return text;
|
|
599
|
-
|
|
600
|
-
const phraseStart = lower.indexOf(normalizedQuery);
|
|
601
|
-
const terms = phraseStart >= 0 ? [normalizedQuery] : normalizedQuery.split(/\s+/).filter((term) => term.length > 1);
|
|
487
|
+
let lower = text.toLowerCase(), terms = lower.indexOf(normalizedQuery) >= 0 ? [normalizedQuery] : normalizedQuery.split(/\s+/).filter((term) => term.length > 1);
|
|
602
488
|
if (terms.length === 0) return text;
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
termRanges.push({ end: start + term.length, start });
|
|
608
|
-
start = lower.indexOf(term, start + term.length);
|
|
609
|
-
}
|
|
489
|
+
let ranges = terms.flatMap((term) => {
|
|
490
|
+
let termRanges = [], start = lower.indexOf(term);
|
|
491
|
+
for (; start >= 0; )
|
|
492
|
+
termRanges.push({ end: start + term.length, start }), start = lower.indexOf(term, start + term.length);
|
|
610
493
|
return termRanges;
|
|
611
|
-
}).sort((left, right) => left.start - right.start);
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
if (previous && range.start <= previous.end) {
|
|
616
|
-
previous.end = Math.max(previous.end, range.end);
|
|
617
|
-
} else {
|
|
618
|
-
mergedRanges.push({ ...range });
|
|
619
|
-
}
|
|
494
|
+
}).sort((left, right) => left.start - right.start), mergedRanges = [];
|
|
495
|
+
for (let range of ranges) {
|
|
496
|
+
let previous = mergedRanges.at(-1);
|
|
497
|
+
previous && range.start <= previous.end ? previous.end = Math.max(previous.end, range.end) : mergedRanges.push({ ...range });
|
|
620
498
|
}
|
|
621
499
|
if (mergedRanges.length === 0) return text;
|
|
622
|
-
|
|
623
|
-
let
|
|
624
|
-
|
|
625
|
-
if (range.start > cursor) {
|
|
626
|
-
parts.push(text.slice(cursor, range.start));
|
|
627
|
-
}
|
|
628
|
-
parts.push(
|
|
500
|
+
let parts = [], cursor = 0;
|
|
501
|
+
for (let range of mergedRanges)
|
|
502
|
+
range.start > cursor && parts.push(text.slice(cursor, range.start)), parts.push(
|
|
629
503
|
/* @__PURE__ */ jsx(
|
|
630
504
|
"mark",
|
|
631
505
|
{
|
|
632
|
-
className: "rounded-[1px] bg-accent-
|
|
506
|
+
className: "rounded-[1px] bg-accent-2 text-accent-1",
|
|
633
507
|
children: text.slice(range.start, range.end)
|
|
634
508
|
},
|
|
635
509
|
`${range.start}-${range.end}`
|
|
636
510
|
)
|
|
637
|
-
);
|
|
638
|
-
|
|
639
|
-
}
|
|
640
|
-
if (cursor < text.length) {
|
|
641
|
-
parts.push(text.slice(cursor));
|
|
642
|
-
}
|
|
643
|
-
return /* @__PURE__ */ jsx(Fragment, { children: parts });
|
|
511
|
+
), cursor = range.end;
|
|
512
|
+
return cursor < text.length && parts.push(text.slice(cursor)), /* @__PURE__ */ jsx(Fragment, { children: parts });
|
|
644
513
|
}
|
|
645
514
|
function Command({ children, className } = {}) {
|
|
646
515
|
return /* @__PURE__ */ jsx(
|
|
@@ -652,7 +521,7 @@ function Command({ children, className } = {}) {
|
|
|
652
521
|
),
|
|
653
522
|
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
654
523
|
/* @__PURE__ */ jsx(SearchInputField, {}),
|
|
655
|
-
/* @__PURE__ */ jsx(SearchProgressBar, { className: "absolute inset-x-0 top-12 z-
|
|
524
|
+
/* @__PURE__ */ jsx(SearchProgressBar, { className: "absolute inset-x-0 top-12 z-content" }),
|
|
656
525
|
/* @__PURE__ */ jsx(SearchResults, {})
|
|
657
526
|
] })
|
|
658
527
|
}
|
|
@@ -666,7 +535,7 @@ function DefaultDesktop({ children, ...rootProps }) {
|
|
|
666
535
|
}
|
|
667
536
|
function DefaultMobile({ children, ...rootProps }) {
|
|
668
537
|
return /* @__PURE__ */ jsx(Root, { variant: "mobile", ...rootProps, children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
669
|
-
/* @__PURE__ */ jsx(Trigger, { showShortcut:
|
|
538
|
+
/* @__PURE__ */ jsx(Trigger, { showShortcut: !1 }),
|
|
670
539
|
/* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(Command, {}) })
|
|
671
540
|
] }) });
|
|
672
541
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { SidebarNodePrimitiveProps } from '
|
|
3
|
-
import '@publish.os/nextjs/types';
|
|
2
|
+
import { S as SidebarNodePrimitiveProps } from '../../../sidebar-types-Bgchdfd6.js';
|
|
4
3
|
import 'react';
|
|
4
|
+
import '../../../types-DHBm7-j6.js';
|
|
5
5
|
|
|
6
6
|
declare function SidebarNode({ activeState, activeItemRef, children, contentId, depth, expanded, href, isExpandable, node, onLinkClick, onToggle, parentExpanded, title, }: SidebarNodePrimitiveProps): react_jsx_runtime.JSX.Element | null;
|
|
7
7
|
|