@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.
- package/dist/app.js +22 -3
- package/dist/index.js +3 -4
- package/dist/lib/render.js +1 -1
- package/dist/lib/view.js +1 -1
- package/dist/routes/api/timeline.js +3 -3
- package/dist/routes/pages/archive.js +1 -1
- package/dist/routes/pages/collection.js +1 -1
- package/dist/routes/pages/home.js +1 -1
- package/dist/routes/pages/page.js +1 -1
- package/dist/routes/pages/post.js +1 -1
- package/dist/routes/pages/search.js +1 -1
- package/dist/theme/components/index.js +0 -2
- package/dist/theme/index.js +10 -16
- package/dist/theme/layouts/index.js +0 -1
- package/dist/themes/minimal/MinimalSiteLayout.js +83 -0
- package/dist/themes/minimal/index.js +65 -0
- package/dist/{theme → themes/minimal}/pages/ArchivePage.js +7 -8
- package/dist/{theme → themes/minimal}/pages/CollectionPage.js +7 -5
- package/dist/{theme → themes/minimal}/pages/HomePage.js +2 -3
- package/dist/{theme → themes/minimal}/pages/PostPage.js +5 -6
- package/dist/{theme → themes/minimal}/pages/SearchPage.js +11 -10
- package/dist/{theme → themes/minimal}/pages/SinglePage.js +3 -4
- package/dist/themes/minimal/timeline/ArticleCard.js +36 -0
- package/dist/themes/minimal/timeline/ImageCard.js +67 -0
- package/dist/{theme/components → themes/minimal}/timeline/LinkCard.js +14 -26
- package/dist/{theme/components → themes/minimal}/timeline/NoteCard.js +7 -7
- package/dist/{theme/components → themes/minimal}/timeline/QuoteCard.js +6 -6
- package/dist/{theme/components → themes/minimal}/timeline/ThreadPreview.js +13 -18
- package/dist/themes/minimal/timeline/TimelineFeed.js +48 -0
- package/dist/{theme/components → themes/minimal}/timeline/TimelineItem.js +1 -2
- package/package.json +1 -1
- package/src/app.tsx +26 -3
- package/src/i18n/locales/en.po +47 -47
- package/src/i18n/locales/zh-Hans.po +47 -47
- package/src/i18n/locales/zh-Hant.po +47 -47
- package/src/index.ts +4 -5
- package/src/lib/__tests__/view.test.ts +18 -16
- package/src/lib/render.tsx +1 -1
- package/src/lib/view.ts +1 -1
- package/src/routes/api/timeline.tsx +3 -3
- package/src/routes/pages/archive.tsx +1 -1
- package/src/routes/pages/collection.tsx +1 -1
- package/src/routes/pages/home.tsx +1 -1
- package/src/routes/pages/page.tsx +1 -1
- package/src/routes/pages/post.tsx +1 -1
- package/src/routes/pages/search.tsx +1 -1
- package/src/styles/components.css +0 -54
- package/src/theme/components/index.ts +0 -13
- package/src/theme/index.ts +10 -16
- package/src/theme/layouts/index.ts +0 -1
- package/src/themes/minimal/MinimalSiteLayout.tsx +100 -0
- package/src/themes/minimal/index.ts +83 -0
- package/src/{theme → themes/minimal}/pages/ArchivePage.tsx +8 -11
- package/src/{theme → themes/minimal}/pages/CollectionPage.tsx +6 -6
- package/src/{theme → themes/minimal}/pages/HomePage.tsx +3 -4
- package/src/{theme → themes/minimal}/pages/PostPage.tsx +6 -7
- package/src/{theme → themes/minimal}/pages/SearchPage.tsx +11 -17
- package/src/{theme → themes/minimal}/pages/SinglePage.tsx +4 -5
- package/src/themes/minimal/timeline/ArticleCard.tsx +37 -0
- package/src/themes/minimal/timeline/ImageCard.tsx +63 -0
- package/src/themes/minimal/timeline/LinkCard.tsx +48 -0
- package/src/{theme/components → themes/minimal}/timeline/NoteCard.tsx +10 -9
- package/src/{theme/components → themes/minimal}/timeline/QuoteCard.tsx +9 -8
- package/src/{theme/components → themes/minimal}/timeline/ThreadPreview.tsx +14 -16
- package/src/{theme/components → themes/minimal}/timeline/TimelineFeed.tsx +14 -13
- package/src/{theme/components → themes/minimal}/timeline/TimelineItem.tsx +1 -4
- package/dist/theme/components/timeline/ArticleCard.js +0 -46
- package/dist/theme/components/timeline/ImageCard.js +0 -83
- package/dist/theme/components/timeline/TimelineFeed.js +0 -46
- package/dist/theme/components/timeline/index.js +0 -8
- package/dist/theme/layouts/SiteLayout.js +0 -131
- package/dist/theme/pages/index.js +0 -11
- package/src/theme/components/timeline/ArticleCard.tsx +0 -45
- package/src/theme/components/timeline/ImageCard.tsx +0 -70
- package/src/theme/components/timeline/LinkCard.tsx +0 -59
- package/src/theme/components/timeline/index.ts +0 -8
- package/src/theme/layouts/SiteLayout.tsx +0 -132
- 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
|
-
};
|
package/src/theme/pages/index.ts
DELETED
|
@@ -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";
|