@jant/core 0.3.22 → 0.3.23

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.
Files changed (78) hide show
  1. package/dist/app.js +22 -3
  2. package/dist/index.js +3 -4
  3. package/dist/lib/render.js +1 -1
  4. package/dist/lib/view.js +1 -1
  5. package/dist/routes/api/timeline.js +3 -3
  6. package/dist/routes/pages/archive.js +1 -1
  7. package/dist/routes/pages/collection.js +1 -1
  8. package/dist/routes/pages/home.js +1 -1
  9. package/dist/routes/pages/page.js +1 -1
  10. package/dist/routes/pages/post.js +1 -1
  11. package/dist/routes/pages/search.js +1 -1
  12. package/dist/theme/components/index.js +0 -2
  13. package/dist/theme/index.js +10 -16
  14. package/dist/theme/layouts/index.js +0 -1
  15. package/dist/themes/minimal/MinimalSiteLayout.js +83 -0
  16. package/dist/themes/minimal/index.js +65 -0
  17. package/dist/{theme → themes/minimal}/pages/ArchivePage.js +7 -8
  18. package/dist/{theme → themes/minimal}/pages/CollectionPage.js +7 -5
  19. package/dist/{theme → themes/minimal}/pages/HomePage.js +2 -3
  20. package/dist/{theme → themes/minimal}/pages/PostPage.js +5 -6
  21. package/dist/{theme → themes/minimal}/pages/SearchPage.js +11 -10
  22. package/dist/{theme → themes/minimal}/pages/SinglePage.js +3 -4
  23. package/dist/themes/minimal/timeline/ArticleCard.js +36 -0
  24. package/dist/themes/minimal/timeline/ImageCard.js +67 -0
  25. package/dist/{theme/components → themes/minimal}/timeline/LinkCard.js +14 -26
  26. package/dist/{theme/components → themes/minimal}/timeline/NoteCard.js +7 -7
  27. package/dist/{theme/components → themes/minimal}/timeline/QuoteCard.js +6 -6
  28. package/dist/{theme/components → themes/minimal}/timeline/ThreadPreview.js +13 -18
  29. package/dist/themes/minimal/timeline/TimelineFeed.js +48 -0
  30. package/dist/{theme/components → themes/minimal}/timeline/TimelineItem.js +1 -2
  31. package/package.json +1 -1
  32. package/src/app.tsx +26 -3
  33. package/src/i18n/locales/en.po +47 -47
  34. package/src/i18n/locales/zh-Hans.po +47 -47
  35. package/src/i18n/locales/zh-Hant.po +47 -47
  36. package/src/index.ts +4 -5
  37. package/src/lib/__tests__/view.test.ts +18 -16
  38. package/src/lib/render.tsx +1 -1
  39. package/src/lib/view.ts +1 -1
  40. package/src/routes/api/timeline.tsx +3 -3
  41. package/src/routes/pages/archive.tsx +1 -1
  42. package/src/routes/pages/collection.tsx +1 -1
  43. package/src/routes/pages/home.tsx +1 -1
  44. package/src/routes/pages/page.tsx +1 -1
  45. package/src/routes/pages/post.tsx +1 -1
  46. package/src/routes/pages/search.tsx +1 -1
  47. package/src/styles/components.css +0 -54
  48. package/src/theme/components/index.ts +0 -13
  49. package/src/theme/index.ts +10 -16
  50. package/src/theme/layouts/index.ts +0 -1
  51. package/src/themes/minimal/MinimalSiteLayout.tsx +100 -0
  52. package/src/themes/minimal/index.ts +83 -0
  53. package/src/{theme → themes/minimal}/pages/ArchivePage.tsx +8 -11
  54. package/src/{theme → themes/minimal}/pages/CollectionPage.tsx +6 -6
  55. package/src/{theme → themes/minimal}/pages/HomePage.tsx +3 -4
  56. package/src/{theme → themes/minimal}/pages/PostPage.tsx +6 -7
  57. package/src/{theme → themes/minimal}/pages/SearchPage.tsx +11 -17
  58. package/src/{theme → themes/minimal}/pages/SinglePage.tsx +4 -5
  59. package/src/themes/minimal/timeline/ArticleCard.tsx +37 -0
  60. package/src/themes/minimal/timeline/ImageCard.tsx +63 -0
  61. package/src/themes/minimal/timeline/LinkCard.tsx +48 -0
  62. package/src/{theme/components → themes/minimal}/timeline/NoteCard.tsx +10 -9
  63. package/src/{theme/components → themes/minimal}/timeline/QuoteCard.tsx +9 -8
  64. package/src/{theme/components → themes/minimal}/timeline/ThreadPreview.tsx +14 -16
  65. package/src/{theme/components → themes/minimal}/timeline/TimelineFeed.tsx +14 -13
  66. package/src/{theme/components → themes/minimal}/timeline/TimelineItem.tsx +1 -4
  67. package/dist/theme/components/timeline/ArticleCard.js +0 -46
  68. package/dist/theme/components/timeline/ImageCard.js +0 -83
  69. package/dist/theme/components/timeline/TimelineFeed.js +0 -46
  70. package/dist/theme/components/timeline/index.js +0 -8
  71. package/dist/theme/layouts/SiteLayout.js +0 -131
  72. package/dist/theme/pages/index.js +0 -11
  73. package/src/theme/components/timeline/ArticleCard.tsx +0 -45
  74. package/src/theme/components/timeline/ImageCard.tsx +0 -70
  75. package/src/theme/components/timeline/LinkCard.tsx +0 -59
  76. package/src/theme/components/timeline/index.ts +0 -8
  77. package/src/theme/layouts/SiteLayout.tsx +0 -132
  78. package/src/theme/pages/index.ts +0 -13
@@ -1,132 +0,0 @@
1
- /**
2
- * Site Layout
3
- *
4
- * Two-column layout for public pages with sidebar navigation.
5
- * On mobile, uses a slide-out drawer menu.
6
- */
7
-
8
- import type { FC, PropsWithChildren } from "hono/jsx";
9
- import type { NavLinkView, SiteLayoutProps } from "../../types.js";
10
-
11
- /**
12
- * Render navigation links with dot indicator for active state.
13
- */
14
- function NavLinks({ links }: { links: NavLinkView[] }) {
15
- return (
16
- <>
17
- {links.map((link) => (
18
- <a
19
- key={link.id}
20
- href={link.url}
21
- class={`text-sm flex items-center gap-2 py-0.5 ${
22
- link.isActive
23
- ? "text-primary font-medium"
24
- : "text-muted-foreground hover:text-foreground"
25
- }`}
26
- {...(link.isExternal
27
- ? { target: "_blank", rel: "noopener noreferrer" }
28
- : {})}
29
- >
30
- <span
31
- class={`size-1.5 rounded-full shrink-0 ${link.isActive ? "bg-primary" : "bg-transparent"}`}
32
- />
33
- {link.label}
34
- {link.isExternal && <span class="ml-1 text-xs opacity-50">↗</span>}
35
- </a>
36
- ))}
37
- </>
38
- );
39
- }
40
-
41
- export const SiteLayout: FC<PropsWithChildren<SiteLayoutProps>> = ({
42
- siteName,
43
- links,
44
- children,
45
- }) => {
46
- return (
47
- <div
48
- class="container py-8 md:flex md:gap-12"
49
- data-signals={JSON.stringify({ _drawerOpen: false })}
50
- >
51
- {/* Mobile header with hamburger */}
52
- <div class="flex items-center justify-between mb-6 md:hidden">
53
- <a href="/" class="text-xl font-semibold">
54
- {siteName}
55
- </a>
56
- <button
57
- data-on:click="$_drawerOpen = true"
58
- class="p-2 -mr-2 text-muted-foreground hover:text-foreground"
59
- aria-label="Open menu"
60
- >
61
- <svg
62
- class="size-5"
63
- fill="none"
64
- viewBox="0 0 24 24"
65
- stroke-width="1.5"
66
- stroke="currentColor"
67
- >
68
- <path
69
- stroke-linecap="round"
70
- stroke-linejoin="round"
71
- d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"
72
- />
73
- </svg>
74
- </button>
75
- </div>
76
-
77
- {/* Mobile drawer backdrop */}
78
- <div
79
- class="fixed inset-0 bg-black/50 z-40 opacity-0 pointer-events-none transition-opacity duration-300 ease-in-out md:hidden"
80
- data-class="{'opacity-100 pointer-events-auto': $_drawerOpen, 'opacity-0 pointer-events-none': !$_drawerOpen}"
81
- data-on:click="$_drawerOpen = false"
82
- />
83
-
84
- {/* Mobile drawer panel */}
85
- <aside
86
- class="fixed inset-y-0 left-0 w-64 bg-background z-50 p-6 overflow-y-auto shadow-lg -translate-x-full transition-transform duration-300 ease-in-out md:hidden"
87
- data-class="{'translate-x-0': $_drawerOpen, '-translate-x-full': !$_drawerOpen}"
88
- >
89
- <div class="flex items-center justify-between mb-8">
90
- <a href="/" class="text-xl font-semibold">
91
- {siteName}
92
- </a>
93
- <button
94
- data-on:click="$_drawerOpen = false"
95
- class="p-2 -mr-2 text-muted-foreground hover:text-foreground"
96
- aria-label="Close menu"
97
- >
98
- <svg
99
- class="size-5"
100
- fill="none"
101
- viewBox="0 0 24 24"
102
- stroke-width="1.5"
103
- stroke="currentColor"
104
- >
105
- <path
106
- stroke-linecap="round"
107
- stroke-linejoin="round"
108
- d="M6 18L18 6M6 6l12 12"
109
- />
110
- </svg>
111
- </button>
112
- </div>
113
- <nav class="flex flex-col gap-0.5">
114
- <NavLinks links={links} />
115
- </nav>
116
- </aside>
117
-
118
- {/* Desktop sidebar */}
119
- <aside class="hidden md:block md:w-48 md:shrink-0 md:sticky md:top-8 md:self-start">
120
- <a href="/" class="text-xl font-semibold block mb-20">
121
- {siteName}
122
- </a>
123
- <nav class="flex flex-col gap-0.5">
124
- <NavLinks links={links} />
125
- </nav>
126
- </aside>
127
-
128
- {/* Main content */}
129
- <main class="flex-1 min-w-0">{children}</main>
130
- </div>
131
- );
132
- };
@@ -1,13 +0,0 @@
1
- /**
2
- * Default Page Components
3
- *
4
- * These are the built-in page components that render each public page.
5
- * Theme authors can import these to wrap/extend them.
6
- */
7
-
8
- export { HomePage } from "./HomePage.js";
9
- export { PostPage } from "./PostPage.js";
10
- export { SinglePage } from "./SinglePage.js";
11
- export { ArchivePage } from "./ArchivePage.js";
12
- export { SearchPage } from "./SearchPage.js";
13
- export { CollectionPage } from "./CollectionPage.js";