@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
package/dist/search.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
// src/search.tsx
|
|
3
|
+
// src/modules/search/search.tsx
|
|
4
4
|
import { useShortcut } from "@publish.os/nextjs/keyboard-shortcuts";
|
|
5
5
|
import { useRouter } from "next/navigation";
|
|
6
6
|
import {
|
|
@@ -19,12 +19,7 @@ var EMPTY_SEARCH_OUTPUT = {
|
|
|
19
19
|
nextOffset: null,
|
|
20
20
|
status: "idle",
|
|
21
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);
|
|
22
|
+
}, MAX_SEARCH_QUERY_LENGTH = 128, MAX_SEARCH_RESULTS = 20, DEFAULT_SEARCH_LIMIT = 10, SEARCH_DEBOUNCE_MS = 140, SearchBlockContext = createContext(null);
|
|
28
23
|
function normalizeSearchInput(input) {
|
|
29
24
|
return {
|
|
30
25
|
filters: input.filters,
|
|
@@ -45,38 +40,53 @@ function inactiveIndexMessage() {
|
|
|
45
40
|
total: 0
|
|
46
41
|
};
|
|
47
42
|
}
|
|
48
|
-
var SEARCH_STATUS_URL = "/pagefind/
|
|
49
|
-
var PAGEFIND_URL = "/pagefind/pagefind.js";
|
|
50
|
-
var pagefindModulePromise = null;
|
|
43
|
+
var SEARCH_STATUS_URL = "/pagefind/pagefind-entry.json", PAGEFIND_URL = "/pagefind/pagefind.js", pagefindModulePromise = null, activeIndex;
|
|
51
44
|
async function fetchSearchStatus(signal) {
|
|
52
|
-
|
|
45
|
+
let response = await fetch(SEARCH_STATUS_URL, {
|
|
53
46
|
cache: "no-store",
|
|
54
47
|
signal
|
|
55
48
|
}).catch((error) => {
|
|
56
|
-
if (error instanceof DOMException && error.name === "AbortError")
|
|
49
|
+
if (error instanceof DOMException && error.name === "AbortError")
|
|
57
50
|
throw error;
|
|
58
|
-
}
|
|
59
51
|
return null;
|
|
60
52
|
});
|
|
61
|
-
|
|
62
|
-
return await response.json();
|
|
53
|
+
return response?.ok ? (await response.json()).publishos ?? null : null;
|
|
63
54
|
}
|
|
64
55
|
async function loadPagefind() {
|
|
65
|
-
pagefindModulePromise ??= new Function("src", "return import(src)")(PAGEFIND_URL)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
56
|
+
return pagefindModulePromise ??= new Function("src", "return import(src)")(PAGEFIND_URL), pagefindModulePromise;
|
|
57
|
+
}
|
|
58
|
+
async function withPagefindIndex(revision, run) {
|
|
59
|
+
let release = async (index) => {
|
|
60
|
+
index.retired && index.readers === 0 && await (await index.instance).destroy();
|
|
61
|
+
};
|
|
62
|
+
if (!activeIndex || activeIndex.revision !== revision) {
|
|
63
|
+
let previous = activeIndex;
|
|
64
|
+
activeIndex = {
|
|
65
|
+
revision,
|
|
66
|
+
readers: 0,
|
|
67
|
+
retired: !1,
|
|
68
|
+
instance: loadPagefind().then(async (module) => {
|
|
69
|
+
let instance = module.createInstance({ bundlePath: "/pagefind/" });
|
|
70
|
+
return await instance.init?.(), instance;
|
|
71
|
+
})
|
|
72
|
+
}, previous && (previous.retired = !0, release(previous).catch(() => {
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
let selected = activeIndex;
|
|
76
|
+
selected.readers += 1;
|
|
77
|
+
try {
|
|
78
|
+
return await run(await selected.instance);
|
|
79
|
+
} finally {
|
|
80
|
+
selected.readers -= 1, await release(selected);
|
|
81
|
+
}
|
|
72
82
|
}
|
|
73
83
|
function pagefindFilters(filters) {
|
|
74
|
-
if (!filters) return
|
|
75
|
-
|
|
84
|
+
if (!filters) return;
|
|
85
|
+
let entries = Object.entries({
|
|
76
86
|
author: filters.author,
|
|
77
87
|
group: filters.group,
|
|
78
88
|
tag: filters.tag
|
|
79
|
-
}).filter((entry) =>
|
|
89
|
+
}).filter((entry) => !!entry[1]);
|
|
80
90
|
return entries.length > 0 ? Object.fromEntries(entries) : void 0;
|
|
81
91
|
}
|
|
82
92
|
function titleForResult(data) {
|
|
@@ -87,8 +97,7 @@ function toSearchResult({
|
|
|
87
97
|
fallbackId,
|
|
88
98
|
score
|
|
89
99
|
}) {
|
|
90
|
-
|
|
91
|
-
const excerpt = data.excerpt ?? "";
|
|
100
|
+
let title = titleForResult(data), excerpt = data.excerpt ?? "";
|
|
92
101
|
return {
|
|
93
102
|
excerpt,
|
|
94
103
|
id: data.url || fallbackId,
|
|
@@ -106,235 +115,155 @@ function toSearchResult({
|
|
|
106
115
|
};
|
|
107
116
|
}
|
|
108
117
|
function statusOutput(status) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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;
|
|
118
|
+
return status.status === "ready" || status.status === void 0 ? null : status.status === "empty" ? {
|
|
119
|
+
items: [],
|
|
120
|
+
message: "No searchable pages are available.",
|
|
121
|
+
nextOffset: null,
|
|
122
|
+
status: "ready",
|
|
123
|
+
total: 0
|
|
124
|
+
} : status.status === "building" ? {
|
|
125
|
+
items: [],
|
|
126
|
+
message: status.message ?? "Building search index...",
|
|
127
|
+
nextOffset: null,
|
|
128
|
+
status: "building",
|
|
129
|
+
total: 0
|
|
130
|
+
} : status.status === "stale" ? {
|
|
131
|
+
items: [],
|
|
132
|
+
message: status.message ?? "Updating search index...",
|
|
133
|
+
nextOffset: null,
|
|
134
|
+
status: "stale",
|
|
135
|
+
total: 0
|
|
136
|
+
} : status.status === "error" ? {
|
|
137
|
+
items: [],
|
|
138
|
+
message: status.message ?? "Search is temporarily unavailable",
|
|
139
|
+
nextOffset: null,
|
|
140
|
+
status: "error",
|
|
141
|
+
total: 0
|
|
142
|
+
} : null;
|
|
147
143
|
}
|
|
148
144
|
async function runPagefindSearch(input) {
|
|
149
|
-
|
|
150
|
-
if (!normalized.q)
|
|
145
|
+
let normalized = normalizeSearchInput(input);
|
|
146
|
+
if (!normalized.q)
|
|
151
147
|
return EMPTY_SEARCH_OUTPUT;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
148
|
+
let status = await fetchSearchStatus(input.signal), blockedByStatus = status ? statusOutput(status) : null;
|
|
149
|
+
return blockedByStatus || await withPagefindIndex(status?.revision, async (pagefind) => {
|
|
150
|
+
let limit = normalized.limit ?? DEFAULT_SEARCH_LIMIT, offset = normalized.offset ?? 0, result = await pagefind.search(normalized.q, {
|
|
151
|
+
filters: pagefindFilters(normalized.filters),
|
|
152
|
+
limit,
|
|
153
|
+
offset
|
|
154
|
+
});
|
|
155
|
+
if (!result) return EMPTY_SEARCH_OUTPUT;
|
|
156
|
+
let items = await Promise.all(
|
|
157
|
+
result.results.map(
|
|
158
|
+
async (pagefindResult) => toSearchResult({
|
|
159
|
+
data: await pagefindResult.data(),
|
|
160
|
+
fallbackId: pagefindResult.id,
|
|
161
|
+
score: pagefindResult.score
|
|
162
|
+
})
|
|
163
|
+
)
|
|
164
|
+
), total = result.unfilteredResultCount ?? items.length, nextOffset = offset + limit < total ? offset + limit : null;
|
|
165
|
+
return {
|
|
166
|
+
items,
|
|
167
|
+
nextOffset,
|
|
168
|
+
status: "ready",
|
|
169
|
+
total
|
|
170
|
+
};
|
|
163
171
|
});
|
|
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
172
|
}
|
|
183
173
|
async function search(input) {
|
|
184
|
-
|
|
185
|
-
if (!normalized.q)
|
|
174
|
+
let normalized = normalizeSearchInput(input);
|
|
175
|
+
if (!normalized.q)
|
|
186
176
|
return EMPTY_SEARCH_OUTPUT;
|
|
187
|
-
}
|
|
188
177
|
try {
|
|
189
178
|
return await runPagefindSearch(normalized);
|
|
190
179
|
} catch (error) {
|
|
191
|
-
|
|
192
|
-
return EMPTY_SEARCH_OUTPUT;
|
|
193
|
-
}
|
|
194
|
-
return inactiveIndexMessage();
|
|
180
|
+
return error instanceof DOMException && error.name === "AbortError" ? EMPTY_SEARCH_OUTPUT : inactiveIndexMessage();
|
|
195
181
|
}
|
|
196
182
|
}
|
|
197
183
|
function useSearch(input) {
|
|
198
|
-
|
|
199
|
-
const stableInput = useMemo(
|
|
184
|
+
let { filters, limit, offset, q } = input, stableInput = useMemo(
|
|
200
185
|
() => normalizeSearchInput({ filters, limit, offset, q }),
|
|
201
186
|
[filters, limit, offset, q]
|
|
202
|
-
);
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
const nextRequestId = requestId.current + 1;
|
|
207
|
-
requestId.current = nextRequestId;
|
|
208
|
-
if (!stableInput.q) {
|
|
187
|
+
), [output, setOutput] = useState(EMPTY_SEARCH_OUTPUT), requestId = useRef(0);
|
|
188
|
+
return useEffect(() => {
|
|
189
|
+
let nextRequestId = requestId.current + 1;
|
|
190
|
+
if (requestId.current = nextRequestId, !stableInput.q) {
|
|
209
191
|
setOutput(EMPTY_SEARCH_OUTPUT);
|
|
210
192
|
return;
|
|
211
193
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
runPagefindSearch({ ...stableInput, signal: controller.signal }).then((result) => {
|
|
216
|
-
if (requestId.current !== nextRequestId) return;
|
|
217
|
-
setOutput(result);
|
|
194
|
+
let controller = new AbortController(), timer = window.setTimeout(() => {
|
|
195
|
+
setOutput((current) => ({ ...current, status: "idle" })), runPagefindSearch({ ...stableInput, signal: controller.signal }).then((result) => {
|
|
196
|
+
requestId.current === nextRequestId && setOutput(result);
|
|
218
197
|
}).catch((error) => {
|
|
219
|
-
|
|
220
|
-
if (error instanceof DOMException && error.name === "AbortError") {
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
setOutput(inactiveIndexMessage());
|
|
198
|
+
requestId.current === nextRequestId && (error instanceof DOMException && error.name === "AbortError" || setOutput(inactiveIndexMessage()));
|
|
224
199
|
});
|
|
225
200
|
}, SEARCH_DEBOUNCE_MS);
|
|
226
201
|
return () => {
|
|
227
|
-
window.clearTimeout(timer);
|
|
228
|
-
controller.abort();
|
|
202
|
+
window.clearTimeout(timer), controller.abort();
|
|
229
203
|
};
|
|
230
|
-
}, [stableInput]);
|
|
231
|
-
return output;
|
|
204
|
+
}, [stableInput]), output;
|
|
232
205
|
}
|
|
233
206
|
function useSearchBlock() {
|
|
234
|
-
|
|
235
|
-
if (!value)
|
|
207
|
+
let value = useContext(SearchBlockContext);
|
|
208
|
+
if (!value)
|
|
236
209
|
throw new Error("useSearchBlock must be used inside <Search.Root>.");
|
|
237
|
-
}
|
|
238
210
|
return value;
|
|
239
211
|
}
|
|
240
212
|
function SearchProvider({
|
|
241
213
|
children,
|
|
242
|
-
defaultOpen =
|
|
214
|
+
defaultOpen = !1,
|
|
243
215
|
limit = DEFAULT_SEARCH_LIMIT,
|
|
244
216
|
onOpenChange,
|
|
245
217
|
open: controlledOpen,
|
|
246
218
|
shortcut = "mod+k",
|
|
247
219
|
variant = "desktop"
|
|
248
220
|
}) {
|
|
249
|
-
|
|
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(
|
|
221
|
+
let [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen), [query, setQuery] = useState(""), [isTyping, setIsTyping] = useState(!1), [selectedValue, setSelectedValue] = useState(""), typingTimer = useRef(null), inputRef = useRef(null), listRef = useRef(null), router = useRouter(), inputId = useId(), listId = useId(), open = controlledOpen ?? uncontrolledOpen, output = useSearch({ limit, q: query }), [displayResults, setDisplayResults] = useState([]), selectedResultId = (displayResults.find((result) => result.id === selectedValue) ?? displayResults[0])?.id ?? "", loading = !!query.trim() && !isTyping && output.status === "idle", setOpen = useCallback(
|
|
266
222
|
(nextOpen) => {
|
|
267
|
-
|
|
268
|
-
setUncontrolledOpen(nextOpen);
|
|
269
|
-
}
|
|
270
|
-
onOpenChange?.(nextOpen);
|
|
271
|
-
if (!nextOpen) {
|
|
272
|
-
setQuery("");
|
|
273
|
-
setSelectedValue("");
|
|
274
|
-
setIsTyping(false);
|
|
275
|
-
}
|
|
223
|
+
controlledOpen === void 0 && setUncontrolledOpen(nextOpen), onOpenChange?.(nextOpen), nextOpen || (setQuery(""), setSelectedValue(""), setIsTyping(!1));
|
|
276
224
|
},
|
|
277
225
|
[controlledOpen, onOpenChange]
|
|
278
|
-
)
|
|
279
|
-
const setQueryValue = useCallback((value) => {
|
|
280
|
-
setQuery(value);
|
|
281
|
-
}, []);
|
|
282
|
-
const handleInputChange = useCallback((value) => {
|
|
226
|
+
), setQueryValue = useCallback((value) => {
|
|
283
227
|
setQuery(value);
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
typingTimer.current = window.setTimeout(() => {
|
|
289
|
-
setIsTyping(false);
|
|
290
|
-
typingTimer.current = null;
|
|
228
|
+
}, []), handleInputChange = useCallback((value) => {
|
|
229
|
+
setQuery(value), setIsTyping(!0), typingTimer.current !== null && window.clearTimeout(typingTimer.current), typingTimer.current = window.setTimeout(() => {
|
|
230
|
+
setIsTyping(!1), typingTimer.current = null;
|
|
291
231
|
}, SEARCH_DEBOUNCE_MS);
|
|
292
|
-
}, [])
|
|
293
|
-
const navigateToResult = useCallback(
|
|
232
|
+
}, []), navigateToResult = useCallback(
|
|
294
233
|
(result) => {
|
|
295
|
-
setOpen(
|
|
296
|
-
router.push(result.url);
|
|
234
|
+
setOpen(!1), router.push(result.url);
|
|
297
235
|
},
|
|
298
236
|
[router, setOpen]
|
|
299
237
|
);
|
|
300
238
|
useEffect(() => {
|
|
301
239
|
if (!open) return;
|
|
302
|
-
|
|
240
|
+
let frame = window.requestAnimationFrame(() => {
|
|
303
241
|
inputRef.current?.focus();
|
|
304
242
|
});
|
|
305
243
|
return () => window.cancelAnimationFrame(frame);
|
|
306
|
-
}, [open])
|
|
307
|
-
useShortcut(shortcut, () => setOpen(true), {
|
|
244
|
+
}, [open]), useShortcut(shortcut, () => setOpen(!0), {
|
|
308
245
|
description: "Open search",
|
|
309
246
|
group: "Search",
|
|
310
247
|
priority: 100
|
|
311
|
-
})
|
|
312
|
-
useEffect(() => {
|
|
248
|
+
}), useEffect(() => {
|
|
313
249
|
if (!query.trim()) {
|
|
314
|
-
setDisplayResults([]);
|
|
315
|
-
setSelectedValue("");
|
|
250
|
+
setDisplayResults([]), setSelectedValue("");
|
|
316
251
|
return;
|
|
317
252
|
}
|
|
318
|
-
if (isTyping || loading)
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
if (output.status === "building" || output.status === "stale" || output.status === "error") {
|
|
325
|
-
setDisplayResults([]);
|
|
326
|
-
setSelectedValue("");
|
|
253
|
+
if (!(isTyping || loading)) {
|
|
254
|
+
if (output.status === "ready") {
|
|
255
|
+
setDisplayResults(output.items), setSelectedValue(output.items[0]?.id ?? "");
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
(output.status === "building" || output.status === "stale" || output.status === "error") && (setDisplayResults([]), setSelectedValue(""));
|
|
327
259
|
}
|
|
328
|
-
}, [isTyping, loading, output.items, output.status, query])
|
|
329
|
-
useEffect(
|
|
260
|
+
}, [isTyping, loading, output.items, output.status, query]), useEffect(
|
|
330
261
|
() => () => {
|
|
331
|
-
|
|
332
|
-
window.clearTimeout(typingTimer.current);
|
|
333
|
-
}
|
|
262
|
+
typingTimer.current !== null && window.clearTimeout(typingTimer.current);
|
|
334
263
|
},
|
|
335
264
|
[]
|
|
336
265
|
);
|
|
337
|
-
|
|
266
|
+
let contextValue = useMemo(
|
|
338
267
|
() => ({
|
|
339
268
|
actions: {
|
|
340
269
|
handleInputChange,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { TreeNode } from '@publish.os/nextjs/types';
|
|
3
1
|
import { Ref, ReactNode, MouseEvent } from 'react';
|
|
2
|
+
import { T as TreeNode } from './types-DHBm7-j6.js';
|
|
4
3
|
|
|
5
4
|
type SidebarTreeNode = TreeNode & {
|
|
6
5
|
children?: SidebarTreeNode[];
|
|
@@ -22,12 +21,5 @@ type SidebarNodePrimitiveProps = {
|
|
|
22
21
|
parentExpanded: boolean;
|
|
23
22
|
title: string;
|
|
24
23
|
};
|
|
25
|
-
type SidebarProps = {
|
|
26
|
-
className?: string;
|
|
27
|
-
currentPath?: string;
|
|
28
|
-
title?: ReactNode;
|
|
29
|
-
tree: SidebarTreeNode[];
|
|
30
|
-
};
|
|
31
|
-
declare function Sidebar({ className, currentPath, title, tree }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
32
24
|
|
|
33
|
-
export {
|
|
25
|
+
export type { SidebarNodePrimitiveProps as S, SidebarTreeNode as a, SidebarActiveState as b, SidebarDepth as c };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type ThemeScopeProps = Readonly<{
|
|
5
|
+
"data-group": string;
|
|
6
|
+
"data-theme-root": "";
|
|
7
|
+
}>;
|
|
8
|
+
type ThemeScopeProviderProps = Readonly<{
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
group?: string;
|
|
11
|
+
}>;
|
|
12
|
+
declare function ThemeScopeProvider({ children, group, }: ThemeScopeProviderProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare function useThemeScope(): ThemeScopeProps;
|
|
14
|
+
|
|
15
|
+
export { type ThemeScopeProps, ThemeScopeProvider, type ThemeScopeProviderProps, useThemeScope };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/lib/theme/theme-scope.tsx
|
|
4
|
+
import { createContext, use } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
var ROOT_SCOPE = Object.freeze({
|
|
7
|
+
"data-group": "",
|
|
8
|
+
"data-theme-root": ""
|
|
9
|
+
}), ThemeGroupContext = createContext("");
|
|
10
|
+
function ThemeScopeProvider({
|
|
11
|
+
children,
|
|
12
|
+
group
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsx(ThemeGroupContext, { value: group ?? "", children });
|
|
15
|
+
}
|
|
16
|
+
function useThemeScope() {
|
|
17
|
+
let group = use(ThemeGroupContext);
|
|
18
|
+
return group ? { "data-group": group, "data-theme-root": "" } : ROOT_SCOPE;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
ThemeScopeProvider,
|
|
22
|
+
useThemeScope
|
|
23
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
type SiteData = {
|
|
2
|
+
name: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
og?: OgMetadata;
|
|
6
|
+
};
|
|
7
|
+
type OgImageMetadata = string | {
|
|
8
|
+
src: string;
|
|
9
|
+
alt?: string;
|
|
10
|
+
};
|
|
11
|
+
type OgMetadata = {
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
image?: OgImageMetadata;
|
|
15
|
+
};
|
|
16
|
+
type Author = {
|
|
17
|
+
id?: string;
|
|
18
|
+
name: string;
|
|
19
|
+
handle?: string;
|
|
20
|
+
avatar?: string;
|
|
21
|
+
url?: string;
|
|
22
|
+
};
|
|
23
|
+
type PageStatus = "published" | "draft" | "archived";
|
|
24
|
+
type PageNode = {
|
|
25
|
+
type: "page";
|
|
26
|
+
fileID: string;
|
|
27
|
+
title: string;
|
|
28
|
+
path: string;
|
|
29
|
+
group: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
status: PageStatus;
|
|
32
|
+
publishedAt?: string;
|
|
33
|
+
updatedAt?: string;
|
|
34
|
+
authors: Author[];
|
|
35
|
+
tags?: string[];
|
|
36
|
+
og?: OgMetadata;
|
|
37
|
+
meta: Record<string, unknown>;
|
|
38
|
+
};
|
|
39
|
+
type SectionNode = {
|
|
40
|
+
type: "section";
|
|
41
|
+
id: string;
|
|
42
|
+
title: string;
|
|
43
|
+
path?: string;
|
|
44
|
+
group?: string;
|
|
45
|
+
children: TreeNode[];
|
|
46
|
+
};
|
|
47
|
+
type FolderNode = {
|
|
48
|
+
type: "folder";
|
|
49
|
+
id: string;
|
|
50
|
+
title: string;
|
|
51
|
+
path?: string;
|
|
52
|
+
group?: string;
|
|
53
|
+
children: TreeNode[];
|
|
54
|
+
};
|
|
55
|
+
type LinkNode = {
|
|
56
|
+
type: "link";
|
|
57
|
+
id: string;
|
|
58
|
+
title: string;
|
|
59
|
+
href: string;
|
|
60
|
+
};
|
|
61
|
+
type TreeNode = PageNode | SectionNode | FolderNode | LinkNode;
|
|
62
|
+
|
|
63
|
+
export type { SiteData as S, TreeNode as T };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
type SiteData = {
|
|
2
|
+
name: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
og?: OgMetadata;
|
|
6
|
+
};
|
|
7
|
+
type OgImageMetadata = string | {
|
|
8
|
+
src: string;
|
|
9
|
+
alt?: string;
|
|
10
|
+
};
|
|
11
|
+
type OgMetadata = {
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
image?: OgImageMetadata;
|
|
15
|
+
};
|
|
16
|
+
type Author = {
|
|
17
|
+
id?: string;
|
|
18
|
+
name: string;
|
|
19
|
+
handle?: string;
|
|
20
|
+
avatar?: string;
|
|
21
|
+
url?: string;
|
|
22
|
+
};
|
|
23
|
+
type PageStatus = "published" | "draft" | "archived";
|
|
24
|
+
type PageData<TMeta extends Record<string, unknown> = Record<string, unknown>> = {
|
|
25
|
+
fileID: string;
|
|
26
|
+
group: string;
|
|
27
|
+
slug: string;
|
|
28
|
+
path: string;
|
|
29
|
+
title: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
status: PageStatus;
|
|
32
|
+
publishedAt?: string;
|
|
33
|
+
updatedAt?: string;
|
|
34
|
+
authors: Author[];
|
|
35
|
+
tags: string[];
|
|
36
|
+
og?: OgMetadata;
|
|
37
|
+
meta: TMeta;
|
|
38
|
+
body: string;
|
|
39
|
+
};
|
|
40
|
+
type PageNode = {
|
|
41
|
+
type: "page";
|
|
42
|
+
fileID: string;
|
|
43
|
+
title: string;
|
|
44
|
+
path: string;
|
|
45
|
+
group: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
status: PageStatus;
|
|
48
|
+
publishedAt?: string;
|
|
49
|
+
updatedAt?: string;
|
|
50
|
+
authors: Author[];
|
|
51
|
+
tags?: string[];
|
|
52
|
+
og?: OgMetadata;
|
|
53
|
+
meta: Record<string, unknown>;
|
|
54
|
+
};
|
|
55
|
+
type SectionNode = {
|
|
56
|
+
type: "section";
|
|
57
|
+
id: string;
|
|
58
|
+
title: string;
|
|
59
|
+
path?: string;
|
|
60
|
+
group?: string;
|
|
61
|
+
children: TreeNode[];
|
|
62
|
+
};
|
|
63
|
+
type FolderNode = {
|
|
64
|
+
type: "folder";
|
|
65
|
+
id: string;
|
|
66
|
+
title: string;
|
|
67
|
+
path?: string;
|
|
68
|
+
group?: string;
|
|
69
|
+
children: TreeNode[];
|
|
70
|
+
};
|
|
71
|
+
type LinkNode = {
|
|
72
|
+
type: "link";
|
|
73
|
+
id: string;
|
|
74
|
+
title: string;
|
|
75
|
+
href: string;
|
|
76
|
+
};
|
|
77
|
+
type TreeNode = PageNode | SectionNode | FolderNode | LinkNode;
|
|
78
|
+
type RouteRecord = {
|
|
79
|
+
fileID: string;
|
|
80
|
+
slug: string;
|
|
81
|
+
path: string;
|
|
82
|
+
group: string;
|
|
83
|
+
};
|
|
84
|
+
type ResolvedAttribution = {
|
|
85
|
+
enabled: false;
|
|
86
|
+
} | {
|
|
87
|
+
enabled: true;
|
|
88
|
+
variant: "publish-dev";
|
|
89
|
+
label?: string;
|
|
90
|
+
hrefLabel?: string;
|
|
91
|
+
href: string;
|
|
92
|
+
};
|
|
93
|
+
type GroupManifest = {
|
|
94
|
+
key: string;
|
|
95
|
+
title: string;
|
|
96
|
+
path: string;
|
|
97
|
+
ancestry?: string[];
|
|
98
|
+
meta?: Record<string, unknown>;
|
|
99
|
+
tree: TreeNode[];
|
|
100
|
+
pages: PageData[];
|
|
101
|
+
};
|
|
102
|
+
type ManifestLike = {
|
|
103
|
+
site: SiteData;
|
|
104
|
+
groups: Record<string, GroupManifest>;
|
|
105
|
+
routes: RouteRecord[];
|
|
106
|
+
pages: PageData[];
|
|
107
|
+
tree: TreeNode[];
|
|
108
|
+
attribution?: Record<string, ResolvedAttribution>;
|
|
109
|
+
contentHash: string;
|
|
110
|
+
};
|
|
111
|
+
type LayoutProps = {
|
|
112
|
+
children: React.ReactNode;
|
|
113
|
+
site: SiteData;
|
|
114
|
+
tree: TreeNode[];
|
|
115
|
+
node: TreeNode;
|
|
116
|
+
currentPath: string;
|
|
117
|
+
group: string;
|
|
118
|
+
};
|
|
119
|
+
type IndexPageProps = {
|
|
120
|
+
site: SiteData;
|
|
121
|
+
tree: TreeNode[];
|
|
122
|
+
node: TreeNode;
|
|
123
|
+
currentPath: string;
|
|
124
|
+
group: string;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export type { IndexPageProps as I, LayoutProps as L, ManifestLike as M, PageStatus as P };
|