@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,110 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
// src/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
classGroups: {
|
|
9
|
-
z: [
|
|
10
|
-
"z-content",
|
|
11
|
-
"z-nav",
|
|
12
|
-
"z-overlay",
|
|
13
|
-
"z-modal",
|
|
14
|
-
"z-search",
|
|
15
|
-
"z-toast",
|
|
16
|
-
"z-progress"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
function cn(...inputs) {
|
|
22
|
-
return twMerge(clsx(inputs));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// src/utils/heading-ids.ts
|
|
26
|
-
import { isValidElement } from "react";
|
|
27
|
-
var SELF_CLOSING_TAG_RE = new RegExp("<[^>]+/>", "g");
|
|
28
|
-
var PAIRED_TAG_RE = /<\/?\w[^>]*>/g;
|
|
29
|
-
var MDX_BOLD_RE = /\*\*(.*?)\*\*/g;
|
|
30
|
-
var MDX_ITALIC_RE = /\*(.*?)\*/g;
|
|
31
|
-
var MDX_UNDERLINE_BOLD_RE = /__(.*?)__/g;
|
|
32
|
-
var MDX_UNDERLINE_ITALIC_RE = /_(.*?)_/g;
|
|
33
|
-
var MDX_STRIKETHROUGH_RE = /~~(.*?)~~/g;
|
|
34
|
-
var MDX_INLINE_CODE_RE = /`(.*?)`/g;
|
|
35
|
-
var MDX_LINK_RE = /\[(.*?)\]\(.*?\)/g;
|
|
36
|
-
var NON_ALPHANUMERIC_RE = /[^a-z0-9]+/g;
|
|
37
|
-
var LEADING_TRAILING_HYPHEN_RE = /^-+|-+$/g;
|
|
38
|
-
var LEADING_DIGIT_RE = /^(\d)/;
|
|
39
|
-
var HEADING_RE = /^(#{1,6})[ \t]+(.+?)\s*#*\s*$/gm;
|
|
40
|
-
var FENCED_CODE_RE = /```[\s\S]*?```|~~~[\s\S]*?~~~/g;
|
|
41
|
-
function extractText(node) {
|
|
42
|
-
if (typeof node === "string") return node;
|
|
43
|
-
if (typeof node === "number") return String(node);
|
|
44
|
-
if (node == null || typeof node === "boolean") return "";
|
|
45
|
-
if (Array.isArray(node)) {
|
|
46
|
-
return node.map(extractText).join("");
|
|
47
|
-
}
|
|
48
|
-
if (isValidElement(node)) {
|
|
49
|
-
const element = node;
|
|
50
|
-
return element.props.children === void 0 ? "" : extractText(element.props.children);
|
|
51
|
-
}
|
|
52
|
-
return "";
|
|
53
|
-
}
|
|
54
|
-
function cleanHeadingText(input) {
|
|
55
|
-
const text = typeof input === "string" ? input : extractText(input);
|
|
56
|
-
return text.replace(SELF_CLOSING_TAG_RE, "").replace(PAIRED_TAG_RE, "").replace(MDX_BOLD_RE, "$1").replace(MDX_ITALIC_RE, "$1").replace(MDX_UNDERLINE_BOLD_RE, "$1").replace(MDX_UNDERLINE_ITALIC_RE, "$1").replace(MDX_STRIKETHROUGH_RE, "$1").replace(MDX_INLINE_CODE_RE, "$1").replace(MDX_LINK_RE, "$1").trim();
|
|
57
|
-
}
|
|
58
|
-
function slugify(text) {
|
|
59
|
-
return text.toLowerCase().replace(NON_ALPHANUMERIC_RE, "-").replace(LEADING_TRAILING_HYPHEN_RE, "").replace(LEADING_DIGIT_RE, "id-$1");
|
|
60
|
-
}
|
|
61
|
-
function headingToHTMLId(input) {
|
|
62
|
-
try {
|
|
63
|
-
const id = slugify(cleanHeadingText(input));
|
|
64
|
-
return id || "empty-heading";
|
|
65
|
-
} catch {
|
|
66
|
-
return "empty-heading";
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
function createHeadingIdGenerator() {
|
|
70
|
-
const usedIds = /* @__PURE__ */ new Map();
|
|
71
|
-
return (input) => {
|
|
72
|
-
const baseId = headingToHTMLId(input);
|
|
73
|
-
if (baseId === "empty-heading") return baseId;
|
|
74
|
-
const count = usedIds.get(baseId) ?? 0;
|
|
75
|
-
usedIds.set(baseId, count + 1);
|
|
76
|
-
return count === 0 ? baseId : `${baseId}-${count}`;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
function extractMdxHeadings(content = "", levels) {
|
|
80
|
-
const [minDepth, maxDepth] = levels;
|
|
81
|
-
const headingId = createHeadingIdGenerator();
|
|
82
|
-
const headings = [];
|
|
83
|
-
const searchableContent = content.replace(FENCED_CODE_RE, "");
|
|
84
|
-
HEADING_RE.lastIndex = 0;
|
|
85
|
-
while (true) {
|
|
86
|
-
const match = HEADING_RE.exec(searchableContent);
|
|
87
|
-
if (!match) break;
|
|
88
|
-
const marker = match[1];
|
|
89
|
-
const rawText = match[2];
|
|
90
|
-
if (!marker || !rawText) continue;
|
|
91
|
-
const level = marker.length;
|
|
92
|
-
const text = cleanHeadingText(rawText);
|
|
93
|
-
const id = headingId(rawText);
|
|
94
|
-
if (!text || id === "empty-heading") continue;
|
|
95
|
-
if (level < minDepth || level > maxDepth) continue;
|
|
96
|
-
headings.push({ id, level, text });
|
|
97
|
-
}
|
|
98
|
-
return headings;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// src/kernel/components/blocks/toc.tsx
|
|
3
|
+
// src/components/block/navigation/toc.tsx
|
|
4
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
5
|
+
import {
|
|
6
|
+
extractMdxHeadings
|
|
7
|
+
} from "@publish.os/nextjs/utils/heading-ids";
|
|
102
8
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
103
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
104
|
-
var DEFAULT_LEVELS = [2, 3]
|
|
105
|
-
var ACTIVATION_OFFSET = 96;
|
|
106
|
-
var BOTTOM_THRESHOLD = 2;
|
|
107
|
-
var SCROLL_KEYS = /* @__PURE__ */ new Set([
|
|
10
|
+
var DEFAULT_LEVELS = [2, 3], ACTIVATION_OFFSET = 96, BOTTOM_THRESHOLD = 2, SCROLL_KEYS = /* @__PURE__ */ new Set([
|
|
108
11
|
" ",
|
|
109
12
|
"ArrowDown",
|
|
110
13
|
"ArrowUp",
|
|
@@ -114,81 +17,66 @@ var SCROLL_KEYS = /* @__PURE__ */ new Set([
|
|
|
114
17
|
"PageUp"
|
|
115
18
|
]);
|
|
116
19
|
function documentIsAtBottom() {
|
|
117
|
-
|
|
20
|
+
let root = document.documentElement;
|
|
118
21
|
return Math.ceil(window.scrollY + window.innerHeight) >= root.scrollHeight - BOTTOM_THRESHOLD;
|
|
119
22
|
}
|
|
120
23
|
function resolveActiveHeading(elements) {
|
|
121
24
|
if (documentIsAtBottom()) return elements.at(-1)?.id ?? "";
|
|
122
25
|
let nextActiveId = elements[0]?.id ?? "";
|
|
123
|
-
for (
|
|
124
|
-
if (element.getBoundingClientRect().top <= ACTIVATION_OFFSET)
|
|
26
|
+
for (let element of elements)
|
|
27
|
+
if (element.getBoundingClientRect().top <= ACTIVATION_OFFSET)
|
|
125
28
|
nextActiveId = element.id;
|
|
126
|
-
|
|
29
|
+
else
|
|
127
30
|
break;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
31
|
return nextActiveId;
|
|
131
32
|
}
|
|
132
33
|
function useTocActiveState(headingIds) {
|
|
133
|
-
|
|
134
|
-
const [indicatorStyle, setIndicatorStyle] = useState({
|
|
34
|
+
let [activeId, setActiveId] = useState(""), [indicatorStyle, setIndicatorStyle] = useState({
|
|
135
35
|
height: 0,
|
|
136
36
|
transform: 0
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
});
|
|
142
|
-
const clickedIdRef = useRef(null);
|
|
143
|
-
const contentRef = useRef(null);
|
|
144
|
-
const frameRef = useRef(null);
|
|
145
|
-
const viewportRef = useRef(null);
|
|
146
|
-
const clearClickedId = useCallback(() => {
|
|
37
|
+
}), [scrollMask, setScrollMask] = useState({
|
|
38
|
+
bottom: !1,
|
|
39
|
+
top: !1
|
|
40
|
+
}), clickedIdRef = useRef(null), contentRef = useRef(null), frameRef = useRef(null), viewportRef = useRef(null), clearClickedId = useCallback(() => {
|
|
147
41
|
clickedIdRef.current = null;
|
|
148
|
-
}, [])
|
|
149
|
-
const updateActiveHeading = useCallback(() => {
|
|
42
|
+
}, []), updateActiveHeading = useCallback(() => {
|
|
150
43
|
if (clickedIdRef.current) {
|
|
151
44
|
setActiveId(
|
|
152
45
|
(current) => current === clickedIdRef.current ? current : clickedIdRef.current ?? ""
|
|
153
46
|
);
|
|
154
47
|
return;
|
|
155
48
|
}
|
|
156
|
-
|
|
49
|
+
let elements = headingIds.map((id) => document.getElementById(id)).filter((element) => !!element);
|
|
157
50
|
if (elements.length === 0) return;
|
|
158
|
-
|
|
51
|
+
let nextActiveId = resolveActiveHeading(elements);
|
|
159
52
|
setActiveId(
|
|
160
53
|
(current) => current === nextActiveId ? current : nextActiveId
|
|
161
54
|
);
|
|
162
|
-
}, [headingIds])
|
|
163
|
-
|
|
164
|
-
const container = contentRef.current;
|
|
55
|
+
}, [headingIds]), updateIndicator = useCallback(() => {
|
|
56
|
+
let container = contentRef.current;
|
|
165
57
|
if (!container || !activeId) {
|
|
166
58
|
setIndicatorStyle({ height: 0, transform: 0 });
|
|
167
59
|
return;
|
|
168
60
|
}
|
|
169
|
-
|
|
61
|
+
let activeLink = Array.from(
|
|
170
62
|
container.querySelectorAll("[data-toc-link]")
|
|
171
63
|
).find((link) => link.dataset.tocId === activeId);
|
|
172
64
|
if (!activeLink) {
|
|
173
65
|
setIndicatorStyle({ height: 0, transform: 0 });
|
|
174
66
|
return;
|
|
175
67
|
}
|
|
176
|
-
|
|
177
|
-
const activeRect = activeLink.getBoundingClientRect();
|
|
178
|
-
const nextStyle = {
|
|
68
|
+
let containerRect = container.getBoundingClientRect(), activeRect = activeLink.getBoundingClientRect(), nextStyle = {
|
|
179
69
|
height: activeRect.height,
|
|
180
70
|
transform: activeRect.top - containerRect.top
|
|
181
71
|
};
|
|
182
72
|
setIndicatorStyle(
|
|
183
73
|
(current) => current.height === nextStyle.height && current.transform === nextStyle.transform ? current : nextStyle
|
|
184
74
|
);
|
|
185
|
-
}, [activeId])
|
|
186
|
-
const updateViewport = useCallback(() => {
|
|
75
|
+
}, [activeId]), updateViewport = useCallback(() => {
|
|
187
76
|
updateIndicator();
|
|
188
|
-
|
|
77
|
+
let viewport = viewportRef.current;
|
|
189
78
|
if (!viewport) return;
|
|
190
|
-
|
|
191
|
-
const nextMask = {
|
|
79
|
+
let hasOverflow = viewport.scrollHeight > viewport.clientHeight + 1, nextMask = {
|
|
192
80
|
bottom: hasOverflow && viewport.scrollTop + viewport.clientHeight < viewport.scrollHeight - 1,
|
|
193
81
|
top: hasOverflow && viewport.scrollTop > 0
|
|
194
82
|
};
|
|
@@ -197,43 +85,21 @@ function useTocActiveState(headingIds) {
|
|
|
197
85
|
);
|
|
198
86
|
}, [updateIndicator]);
|
|
199
87
|
useEffect(() => {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
|
-
const handleKeyDown = (event) => {
|
|
209
|
-
if (SCROLL_KEYS.has(event.key)) clearClickedId();
|
|
88
|
+
let scheduleUpdate = () => {
|
|
89
|
+
frameRef.current === null && (frameRef.current = window.requestAnimationFrame(() => {
|
|
90
|
+
frameRef.current = null, updateActiveHeading(), updateViewport();
|
|
91
|
+
}));
|
|
92
|
+
}, handleKeyDown = (event) => {
|
|
93
|
+
SCROLL_KEYS.has(event.key) && clearClickedId();
|
|
210
94
|
};
|
|
211
|
-
scheduleUpdate()
|
|
212
|
-
|
|
213
|
-
window.addEventListener("resize", scheduleUpdate);
|
|
214
|
-
window.addEventListener("hashchange", scheduleUpdate);
|
|
215
|
-
window.addEventListener("wheel", clearClickedId, { passive: true });
|
|
216
|
-
window.addEventListener("touchstart", clearClickedId, { passive: true });
|
|
217
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
218
|
-
return () => {
|
|
219
|
-
window.removeEventListener("scroll", scheduleUpdate);
|
|
220
|
-
window.removeEventListener("resize", scheduleUpdate);
|
|
221
|
-
window.removeEventListener("hashchange", scheduleUpdate);
|
|
222
|
-
window.removeEventListener("wheel", clearClickedId);
|
|
223
|
-
window.removeEventListener("touchstart", clearClickedId);
|
|
224
|
-
window.removeEventListener("keydown", handleKeyDown);
|
|
225
|
-
if (frameRef.current !== null) {
|
|
226
|
-
window.cancelAnimationFrame(frameRef.current);
|
|
227
|
-
frameRef.current = null;
|
|
228
|
-
}
|
|
95
|
+
return scheduleUpdate(), window.addEventListener("scroll", scheduleUpdate, { passive: !0 }), window.addEventListener("resize", scheduleUpdate), window.addEventListener("hashchange", scheduleUpdate), window.addEventListener("wheel", clearClickedId, { passive: !0 }), window.addEventListener("touchstart", clearClickedId, { passive: !0 }), window.addEventListener("keydown", handleKeyDown), () => {
|
|
96
|
+
window.removeEventListener("scroll", scheduleUpdate), window.removeEventListener("resize", scheduleUpdate), window.removeEventListener("hashchange", scheduleUpdate), window.removeEventListener("wheel", clearClickedId), window.removeEventListener("touchstart", clearClickedId), window.removeEventListener("keydown", handleKeyDown), frameRef.current !== null && (window.cancelAnimationFrame(frameRef.current), frameRef.current = null);
|
|
229
97
|
};
|
|
230
|
-
}, [clearClickedId, updateActiveHeading, updateViewport])
|
|
231
|
-
useEffect(() => {
|
|
98
|
+
}, [clearClickedId, updateActiveHeading, updateViewport]), useEffect(() => {
|
|
232
99
|
updateViewport();
|
|
233
100
|
}, [updateViewport]);
|
|
234
|
-
|
|
235
|
-
clickedIdRef.current = id;
|
|
236
|
-
setActiveId(id);
|
|
101
|
+
let handleTocClick = useCallback((id) => {
|
|
102
|
+
clickedIdRef.current = id, setActiveId(id);
|
|
237
103
|
}, []);
|
|
238
104
|
return {
|
|
239
105
|
activeId,
|
|
@@ -246,15 +112,13 @@ function useTocActiveState(headingIds) {
|
|
|
246
112
|
};
|
|
247
113
|
}
|
|
248
114
|
function Toc({ className, content, levels = DEFAULT_LEVELS }) {
|
|
249
|
-
|
|
115
|
+
let headings = useMemo(
|
|
250
116
|
() => extractMdxHeadings(content, levels),
|
|
251
117
|
[content, levels]
|
|
252
|
-
)
|
|
253
|
-
const headingIds = useMemo(
|
|
118
|
+
), headingIds = useMemo(
|
|
254
119
|
() => headings.map((heading) => heading.id),
|
|
255
120
|
[headings]
|
|
256
|
-
)
|
|
257
|
-
const {
|
|
121
|
+
), {
|
|
258
122
|
activeId,
|
|
259
123
|
contentRef,
|
|
260
124
|
handleTocClick,
|
|
@@ -264,7 +128,7 @@ function Toc({ className, content, levels = DEFAULT_LEVELS }) {
|
|
|
264
128
|
viewportRef
|
|
265
129
|
} = useTocActiveState(headingIds);
|
|
266
130
|
if (headings.length <= 1) return null;
|
|
267
|
-
|
|
131
|
+
let maskImage = scrollMask.top || scrollMask.bottom ? `linear-gradient(to bottom, ${scrollMask.top ? "transparent, black 14px" : "black 0, black 14px"}, ${scrollMask.bottom ? "black calc(100% - 14px), transparent" : "black calc(100% - 14px), black 100%"})` : void 0;
|
|
268
132
|
return /* @__PURE__ */ jsxs("nav", { "aria-label": "On this page", className: cn("text-sm", className), children: [
|
|
269
133
|
/* @__PURE__ */ jsx("p", { className: "mb-3 px-3 text-[11px] font-semibold uppercase leading-none tracking-wide text-foreground-3", children: "On this page" }),
|
|
270
134
|
/* @__PURE__ */ jsx(
|
|
@@ -292,7 +156,7 @@ function Toc({ className, content, levels = DEFAULT_LEVELS }) {
|
|
|
292
156
|
}
|
|
293
157
|
),
|
|
294
158
|
/* @__PURE__ */ jsx("ol", { className: "flex min-w-0 flex-col gap-0.5 pl-3", children: headings.map((heading, index) => {
|
|
295
|
-
|
|
159
|
+
let active = activeId === heading.id;
|
|
296
160
|
return /* @__PURE__ */ jsx(
|
|
297
161
|
"li",
|
|
298
162
|
{
|
|
@@ -305,7 +169,7 @@ function Toc({ className, content, levels = DEFAULT_LEVELS }) {
|
|
|
305
169
|
{
|
|
306
170
|
"aria-current": active ? "location" : void 0,
|
|
307
171
|
className: cn(
|
|
308
|
-
"block rounded-button px-2 py-1 text-[13px] leading-snug text-foreground-3 no-underline transition-[background-color,color,font-weight] duration-200 hover:bg-surface-hover hover:text-foreground-1 hover:no-underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-
|
|
172
|
+
"block rounded-button px-2 py-1 text-[13px] leading-snug text-foreground-3 no-underline transition-[background-color,color,font-weight] duration-200 hover:bg-surface-hover hover:text-foreground-1 hover:no-underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-stroke",
|
|
309
173
|
active && "bg-surface-active font-medium text-accent-1 shadow-xs"
|
|
310
174
|
),
|
|
311
175
|
"data-state": active ? "heading-active" : void 0,
|
|
@@ -1,33 +1,12 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import {
|
|
3
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
4
|
-
var twMerge = extendTailwindMerge({
|
|
5
|
-
extend: {
|
|
6
|
-
classGroups: {
|
|
7
|
-
z: [
|
|
8
|
-
"z-content",
|
|
9
|
-
"z-nav",
|
|
10
|
-
"z-overlay",
|
|
11
|
-
"z-modal",
|
|
12
|
-
"z-search",
|
|
13
|
-
"z-toast",
|
|
14
|
-
"z-progress"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
function cn(...inputs) {
|
|
20
|
-
return twMerge(clsx(inputs));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// src/kernel/components/mdx/components/blockquote.tsx
|
|
1
|
+
// src/components/mdx/blockquote.tsx
|
|
2
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
24
3
|
import { jsx } from "react/jsx-runtime";
|
|
25
4
|
function Blockquote({ className, ...props }) {
|
|
26
5
|
return /* @__PURE__ */ jsx(
|
|
27
6
|
"blockquote",
|
|
28
7
|
{
|
|
29
8
|
className: cn(
|
|
30
|
-
"my-6 border-l-2 border-
|
|
9
|
+
"my-6 border-l-2 border-typography-quote-stroke pl-4 text-sm leading-7 text-typography-quote-foreground",
|
|
31
10
|
className
|
|
32
11
|
),
|
|
33
12
|
...props
|
|
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
|
|
6
6
|
declare const calloutVariants: (props?: ({
|
|
7
|
-
color?: "
|
|
7
|
+
color?: "default" | "accent" | "danger" | "info" | "success" | "warning" | null | undefined;
|
|
8
8
|
variant?: "outline" | "soft" | "solid" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
type CalloutProps = VariantProps<typeof calloutVariants> & {
|
|
@@ -1,53 +1,23 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import {
|
|
3
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
4
|
-
var twMerge = extendTailwindMerge({
|
|
5
|
-
extend: {
|
|
6
|
-
classGroups: {
|
|
7
|
-
z: [
|
|
8
|
-
"z-content",
|
|
9
|
-
"z-nav",
|
|
10
|
-
"z-overlay",
|
|
11
|
-
"z-modal",
|
|
12
|
-
"z-search",
|
|
13
|
-
"z-toast",
|
|
14
|
-
"z-progress"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
function cn(...inputs) {
|
|
20
|
-
return twMerge(clsx(inputs));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// src/kernel/components/mdx/components/callout.tsx
|
|
1
|
+
// src/components/mdx/callout.tsx
|
|
2
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
24
3
|
import { cva } from "class-variance-authority";
|
|
25
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
5
|
var calloutVariants = cva(
|
|
27
|
-
"my-6 rounded-callout border p-4 text-sm leading-6 [--callout-
|
|
6
|
+
"my-6 rounded-callout border p-4 text-sm leading-6 [--callout-emphasis-foreground:var(--typography-heading-foreground)] [--callout-foreground:var(--typography-body-foreground)] [--callout-solid-foreground:var(--surface-1)] [--callout-solid-surface:var(--foreground-1)] [--callout-stroke:var(--typography-rule-stroke)] [--callout-surface:var(--surface-2)] [--callout-title-foreground:var(--typography-heading-foreground)]",
|
|
28
7
|
{
|
|
29
8
|
variants: {
|
|
30
9
|
color: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
lime: "[--callout-color:var(--lime-10,oklch(55%_0.14_125))]",
|
|
38
|
-
navy: "[--callout-color:var(--navy-10,oklch(34%_0.12_265))]",
|
|
39
|
-
orange: "[--callout-color:var(--orange-10,oklch(58%_0.16_55))]",
|
|
40
|
-
pink: "[--callout-color:var(--pink-10,oklch(55%_0.18_350))]",
|
|
41
|
-
purple: "[--callout-color:var(--purple-10,oklch(48%_0.18_300))]",
|
|
42
|
-
red: "[--callout-color:var(--red-10,oklch(52%_0.18_30))]",
|
|
43
|
-
teal: "[--callout-color:var(--teal-10,oklch(48%_0.12_185))]",
|
|
44
|
-
white: "[--callout-color:var(--surface-1)] [--callout-solid-fg:var(--foreground-1)]",
|
|
45
|
-
yellow: "[--callout-color:var(--yellow-10,oklch(62%_0.14_90))]"
|
|
10
|
+
accent: "[--callout-emphasis-foreground:var(--accent-1)] [--callout-solid-foreground:var(--accent-1-foreground)] [--callout-solid-surface:var(--accent-1)] [--callout-stroke:var(--accent-3-stroke)] [--callout-surface:var(--accent-3)]",
|
|
11
|
+
danger: "[--callout-emphasis-foreground:var(--danger-1100)] [--callout-foreground:var(--danger-1100)] [--callout-solid-foreground:var(--danger-100)] [--callout-solid-surface:var(--danger-900)] [--callout-stroke:var(--danger-600)] [--callout-surface:var(--danger-200)]",
|
|
12
|
+
default: "",
|
|
13
|
+
info: "[--callout-emphasis-foreground:var(--info-1100)] [--callout-foreground:var(--info-1100)] [--callout-solid-foreground:var(--info-100)] [--callout-solid-surface:var(--info-900)] [--callout-stroke:var(--info-600)] [--callout-surface:var(--info-200)]",
|
|
14
|
+
success: "[--callout-emphasis-foreground:var(--success-1100)] [--callout-foreground:var(--success-1100)] [--callout-solid-foreground:var(--success-100)] [--callout-solid-surface:var(--success-900)] [--callout-stroke:var(--success-600)] [--callout-surface:var(--success-200)]",
|
|
15
|
+
warning: "[--callout-emphasis-foreground:var(--warning-1100)] [--callout-foreground:var(--warning-1100)] [--callout-solid-foreground:var(--warning-100)] [--callout-solid-surface:var(--warning-900)] [--callout-stroke:var(--warning-600)] [--callout-surface:var(--warning-200)]"
|
|
46
16
|
},
|
|
47
17
|
variant: {
|
|
48
|
-
outline: "border-[var(--callout-
|
|
49
|
-
soft: "border-[var(--callout-
|
|
50
|
-
solid: "border-[var(--callout-solid)] bg-[var(--callout-solid)] text-[var(--callout-solid-
|
|
18
|
+
outline: "border-[var(--callout-stroke)] bg-transparent text-[var(--callout-foreground)]",
|
|
19
|
+
soft: "border-[var(--callout-stroke)] bg-[var(--callout-surface)] text-[var(--callout-foreground)]",
|
|
20
|
+
solid: "border-[var(--callout-solid-surface)] bg-[var(--callout-solid-surface)] text-[var(--callout-solid-foreground)]"
|
|
51
21
|
}
|
|
52
22
|
},
|
|
53
23
|
defaultVariants: {
|
|
@@ -64,9 +34,7 @@ function Callout({
|
|
|
64
34
|
title,
|
|
65
35
|
variant
|
|
66
36
|
}) {
|
|
67
|
-
|
|
68
|
-
const hasIcon = icon !== void 0 && icon !== null && icon !== false;
|
|
69
|
-
const hasTitle = title !== void 0 && title !== null && title !== false;
|
|
37
|
+
let resolvedVariant = variant ?? "soft", hasIcon = icon != null && icon !== !1, hasTitle = title != null && title !== !1;
|
|
70
38
|
return /* @__PURE__ */ jsx(
|
|
71
39
|
"aside",
|
|
72
40
|
{
|
|
@@ -80,7 +48,7 @@ function Callout({
|
|
|
80
48
|
"aria-hidden": "true",
|
|
81
49
|
className: cn(
|
|
82
50
|
"mt-[0.1875rem] flex size-4 shrink-0 items-center justify-center",
|
|
83
|
-
resolvedVariant === "solid" ? "text-inherit" : "text-[var(--callout-
|
|
51
|
+
resolvedVariant === "solid" ? "text-inherit" : "text-[var(--callout-emphasis-foreground)]",
|
|
84
52
|
"[&_svg]:size-4 [&_svg]:shrink-0"
|
|
85
53
|
),
|
|
86
54
|
children: icon
|
|
@@ -92,7 +60,7 @@ function Callout({
|
|
|
92
60
|
{
|
|
93
61
|
className: cn(
|
|
94
62
|
"font-medium",
|
|
95
|
-
resolvedVariant === "solid" ? "text-inherit" : "text-[var(--callout-title)]"
|
|
63
|
+
resolvedVariant === "solid" ? "text-inherit" : "text-[var(--callout-title-foreground)]"
|
|
96
64
|
),
|
|
97
65
|
children: title
|
|
98
66
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import { Pre } from "
|
|
1
|
+
// src/components/mdx/code-block.tsx
|
|
2
|
+
import { Pre } from "@publish.os/nextjs/kernel/components/mdx/components/pre";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
function CodeBlock({
|
|
5
5
|
children,
|
|
@@ -1,32 +1,14 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import {
|
|
3
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
4
|
-
var twMerge = extendTailwindMerge({
|
|
5
|
-
extend: {
|
|
6
|
-
classGroups: {
|
|
7
|
-
z: [
|
|
8
|
-
"z-content",
|
|
9
|
-
"z-nav",
|
|
10
|
-
"z-overlay",
|
|
11
|
-
"z-modal",
|
|
12
|
-
"z-search",
|
|
13
|
-
"z-toast",
|
|
14
|
-
"z-progress"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
function cn(...inputs) {
|
|
20
|
-
return twMerge(clsx(inputs));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// src/kernel/components/mdx/components/figure-caption.tsx
|
|
1
|
+
// src/components/mdx/figure-caption.tsx
|
|
2
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
24
3
|
import { jsx } from "react/jsx-runtime";
|
|
25
4
|
function FigureCaption({ className, ...props }) {
|
|
26
5
|
return /* @__PURE__ */ jsx(
|
|
27
6
|
"figcaption",
|
|
28
7
|
{
|
|
29
|
-
className: cn(
|
|
8
|
+
className: cn(
|
|
9
|
+
"mt-2 text-sm leading-6 text-typography-caption-foreground",
|
|
10
|
+
className
|
|
11
|
+
),
|
|
30
12
|
...props
|
|
31
13
|
}
|
|
32
14
|
);
|
|
@@ -1,29 +1,6 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import { FigureCaption } from "
|
|
3
|
-
|
|
4
|
-
// src/utils/cn.ts
|
|
5
|
-
import { clsx } from "clsx";
|
|
6
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
7
|
-
var twMerge = extendTailwindMerge({
|
|
8
|
-
extend: {
|
|
9
|
-
classGroups: {
|
|
10
|
-
z: [
|
|
11
|
-
"z-content",
|
|
12
|
-
"z-nav",
|
|
13
|
-
"z-overlay",
|
|
14
|
-
"z-modal",
|
|
15
|
-
"z-search",
|
|
16
|
-
"z-toast",
|
|
17
|
-
"z-progress"
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
function cn(...inputs) {
|
|
23
|
-
return twMerge(clsx(inputs));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// src/kernel/components/mdx/components/figure.tsx
|
|
1
|
+
// src/components/mdx/figure.tsx
|
|
2
|
+
import { FigureCaption } from "@publish.os/nextjs/kernel/components/mdx/components/figure-caption";
|
|
3
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
27
4
|
import { Children, isValidElement } from "react";
|
|
28
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
29
6
|
function Figure({
|
|
@@ -32,18 +9,14 @@ function Figure({
|
|
|
32
9
|
className,
|
|
33
10
|
...props
|
|
34
11
|
}) {
|
|
35
|
-
let authoredCaption = caption;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
authoredCaption = child.props.children;
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
12
|
+
let authoredCaption = caption, mediaChildren = [];
|
|
13
|
+
return Children.forEach(children, (child) => {
|
|
14
|
+
if (isValidElement(child) && child.type === "figcaption") {
|
|
15
|
+
authoredCaption = child.props.children;
|
|
16
|
+
return;
|
|
43
17
|
}
|
|
44
18
|
mediaChildren.push(child);
|
|
45
|
-
})
|
|
46
|
-
return /* @__PURE__ */ jsxs("figure", { className: cn("not-markdown-prose my-8", className), ...props, children: [
|
|
19
|
+
}), /* @__PURE__ */ jsxs("figure", { className: cn("not-markdown-prose my-8", className), ...props, children: [
|
|
47
20
|
/* @__PURE__ */ jsx("div", { className: "flex flex-col items-center gap-3", children: mediaChildren }),
|
|
48
21
|
authoredCaption ? /* @__PURE__ */ jsx(FigureCaption, { className: "mx-auto max-w-prose text-center", children: authoredCaption }) : null
|
|
49
22
|
] });
|
|
@@ -1,33 +1,12 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import {
|
|
3
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
4
|
-
var twMerge = extendTailwindMerge({
|
|
5
|
-
extend: {
|
|
6
|
-
classGroups: {
|
|
7
|
-
z: [
|
|
8
|
-
"z-content",
|
|
9
|
-
"z-nav",
|
|
10
|
-
"z-overlay",
|
|
11
|
-
"z-modal",
|
|
12
|
-
"z-search",
|
|
13
|
-
"z-toast",
|
|
14
|
-
"z-progress"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
function cn(...inputs) {
|
|
20
|
-
return twMerge(clsx(inputs));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// src/kernel/components/mdx/components/footnotes.tsx
|
|
1
|
+
// src/components/mdx/footnotes.tsx
|
|
2
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
24
3
|
import { jsx } from "react/jsx-runtime";
|
|
25
4
|
function Footnotes({ className, ...props }) {
|
|
26
5
|
return /* @__PURE__ */ jsx(
|
|
27
6
|
"section",
|
|
28
7
|
{
|
|
29
8
|
className: cn(
|
|
30
|
-
"mt-10 border-t border-stroke
|
|
9
|
+
"mt-10 border-t border-typography-rule-stroke pt-6 text-sm leading-6 text-typography-caption-foreground",
|
|
31
10
|
className
|
|
32
11
|
),
|
|
33
12
|
...props
|