@jant/core 0.3.25 → 0.3.27
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 +70 -563
- package/dist/auth.js +3 -0
- package/dist/client.js +1 -0
- package/dist/i18n/locales/en.js +1 -1
- package/dist/i18n/locales/zh-Hans.js +1 -1
- package/dist/i18n/locales/zh-Hant.js +1 -1
- package/dist/lib/avatar-upload.js +134 -0
- package/dist/lib/config.js +39 -0
- package/dist/lib/constants.js +10 -10
- package/dist/lib/favicon.js +102 -0
- package/dist/lib/image.js +13 -17
- package/dist/lib/media-helpers.js +2 -2
- package/dist/lib/navigation.js +23 -3
- package/dist/lib/render.js +10 -1
- package/dist/lib/schemas.js +31 -0
- package/dist/lib/timezones.js +388 -0
- package/dist/lib/view.js +1 -1
- package/dist/routes/api/posts.js +1 -1
- package/dist/routes/api/upload.js +3 -3
- package/dist/routes/auth/reset.js +221 -0
- package/dist/routes/auth/setup.js +194 -0
- package/dist/routes/auth/signin.js +176 -0
- package/dist/routes/dash/collections.js +23 -415
- package/dist/routes/dash/media.js +12 -392
- package/dist/routes/dash/pages.js +7 -330
- package/dist/routes/dash/redirects.js +18 -12
- package/dist/routes/dash/settings.js +198 -577
- package/dist/routes/feed/rss.js +2 -1
- package/dist/routes/feed/sitemap.js +4 -2
- package/dist/routes/pages/featured.js +5 -1
- package/dist/routes/pages/home.js +26 -1
- package/dist/routes/pages/latest.js +45 -0
- package/dist/services/post.js +30 -50
- package/dist/types/bindings.js +3 -0
- package/dist/types/config.js +147 -0
- package/dist/types/constants.js +27 -0
- package/dist/types/entities.js +3 -0
- package/dist/types/operations.js +3 -0
- package/dist/types/props.js +3 -0
- package/dist/types/views.js +5 -0
- package/dist/types.js +8 -111
- package/dist/ui/color-themes.js +33 -33
- package/dist/ui/compose/ComposeDialog.js +36 -21
- package/dist/ui/dash/PageForm.js +21 -15
- package/dist/ui/dash/PostForm.js +22 -16
- package/dist/ui/dash/collections/CollectionForm.js +152 -0
- package/dist/ui/dash/collections/CollectionsListContent.js +68 -0
- package/dist/ui/dash/collections/ViewCollectionContent.js +96 -0
- package/dist/ui/dash/media/MediaListContent.js +166 -0
- package/dist/ui/dash/media/ViewMediaContent.js +212 -0
- package/dist/ui/dash/pages/LinkFormContent.js +130 -0
- package/dist/ui/dash/pages/UnifiedPagesContent.js +193 -0
- package/dist/ui/dash/settings/AccountContent.js +209 -0
- package/dist/ui/dash/settings/AppearanceContent.js +259 -0
- package/dist/ui/dash/settings/GeneralContent.js +536 -0
- package/dist/ui/dash/settings/SettingsNav.js +41 -0
- package/dist/ui/font-themes.js +36 -0
- package/dist/ui/layouts/BaseLayout.js +24 -2
- package/dist/ui/layouts/SiteLayout.js +47 -19
- package/package.json +1 -1
- package/src/app.tsx +95 -553
- package/src/auth.ts +4 -1
- package/src/client.ts +1 -0
- package/src/i18n/locales/en.po +240 -175
- package/src/i18n/locales/en.ts +1 -1
- package/src/i18n/locales/zh-Hans.po +240 -175
- package/src/i18n/locales/zh-Hans.ts +1 -1
- package/src/i18n/locales/zh-Hant.po +240 -175
- package/src/i18n/locales/zh-Hant.ts +1 -1
- package/src/lib/__tests__/config.test.ts +192 -0
- package/src/lib/__tests__/favicon.test.ts +151 -0
- package/src/lib/__tests__/image.test.ts +2 -6
- package/src/lib/__tests__/timezones.test.ts +61 -0
- package/src/lib/__tests__/view.test.ts +2 -2
- package/src/lib/avatar-upload.ts +165 -0
- package/src/lib/config.ts +47 -0
- package/src/lib/constants.ts +19 -11
- package/src/lib/favicon.ts +115 -0
- package/src/lib/image.ts +13 -21
- package/src/lib/media-helpers.ts +2 -2
- package/src/lib/navigation.ts +33 -2
- package/src/lib/render.tsx +15 -1
- package/src/lib/schemas.ts +39 -0
- package/src/lib/timezones.ts +325 -0
- package/src/lib/view.ts +1 -1
- package/src/routes/api/posts.ts +1 -1
- package/src/routes/api/upload.ts +2 -3
- package/src/routes/auth/reset.tsx +239 -0
- package/src/routes/auth/setup.tsx +189 -0
- package/src/routes/auth/signin.tsx +163 -0
- package/src/routes/dash/__tests__/settings-avatar.test.ts +89 -0
- package/src/routes/dash/collections.tsx +17 -366
- package/src/routes/dash/media.tsx +12 -414
- package/src/routes/dash/pages.tsx +8 -348
- package/src/routes/dash/redirects.tsx +20 -14
- package/src/routes/dash/settings.tsx +243 -534
- package/src/routes/feed/__tests__/rss.test.ts +141 -0
- package/src/routes/feed/rss.ts +3 -1
- package/src/routes/feed/sitemap.ts +4 -2
- package/src/routes/pages/featured.tsx +7 -1
- package/src/routes/pages/home.tsx +25 -2
- package/src/routes/pages/latest.tsx +59 -0
- package/src/services/post.ts +34 -66
- package/src/styles/components.css +0 -65
- package/src/styles/tokens.css +1 -1
- package/src/styles/ui.css +24 -40
- package/src/types/bindings.ts +30 -0
- package/src/types/config.ts +183 -0
- package/src/types/constants.ts +26 -0
- package/src/types/entities.ts +109 -0
- package/src/types/operations.ts +88 -0
- package/src/types/props.ts +115 -0
- package/src/types/views.ts +172 -0
- package/src/types.ts +8 -644
- package/src/ui/__tests__/font-themes.test.ts +34 -0
- package/src/ui/color-themes.ts +34 -34
- package/src/ui/compose/ComposeDialog.tsx +40 -21
- package/src/ui/dash/PageForm.tsx +25 -19
- package/src/ui/dash/PostForm.tsx +26 -20
- package/src/ui/dash/collections/CollectionForm.tsx +153 -0
- package/src/ui/dash/collections/CollectionsListContent.tsx +85 -0
- package/src/ui/dash/collections/ViewCollectionContent.tsx +92 -0
- package/src/ui/dash/media/MediaListContent.tsx +201 -0
- package/src/ui/dash/media/ViewMediaContent.tsx +208 -0
- package/src/ui/dash/pages/LinkFormContent.tsx +119 -0
- package/src/ui/dash/pages/UnifiedPagesContent.tsx +203 -0
- package/src/ui/dash/settings/AccountContent.tsx +176 -0
- package/src/ui/dash/settings/AppearanceContent.tsx +254 -0
- package/src/ui/dash/settings/GeneralContent.tsx +533 -0
- package/src/ui/dash/settings/SettingsNav.tsx +56 -0
- package/src/ui/font-themes.ts +54 -0
- package/src/ui/layouts/BaseLayout.tsx +17 -0
- package/src/ui/layouts/SiteLayout.tsx +45 -31
|
@@ -5,12 +5,16 @@
|
|
|
5
5
|
* If Context is provided, automatically wraps children with I18nProvider.
|
|
6
6
|
*
|
|
7
7
|
* Uses vite-ssr-components for automatic dev/prod asset path resolution.
|
|
8
|
-
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
8
|
+
*/ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "hono/jsx/jsx-runtime";
|
|
9
9
|
import { Script, Link, ViteClient } from "vite-ssr-components/hono";
|
|
10
10
|
import { I18nProvider } from "../../i18n/index.js";
|
|
11
|
-
export const BaseLayout = ({ title, description, lang, c, toast, children })=>{
|
|
11
|
+
export const BaseLayout = ({ title, description, lang, c, toast, faviconUrl, noindex, children })=>{
|
|
12
12
|
// Read lang from Hono context if available, otherwise use prop or default
|
|
13
13
|
const resolvedLang = lang ?? (c ? c.get("lang") : "en");
|
|
14
|
+
// Read faviconUrl from context when not provided as prop (fixes dashboard favicon)
|
|
15
|
+
const resolvedFaviconUrl = faviconUrl ?? (c ? c.get("faviconUrl") : undefined);
|
|
16
|
+
// Read noindex from context when not provided as prop
|
|
17
|
+
const resolvedNoindex = noindex ?? (c ? c.get("noindex") : undefined);
|
|
14
18
|
// Automatically wrap with I18nProvider if Context is provided
|
|
15
19
|
const content = c ? /*#__PURE__*/ _jsx(I18nProvider, {
|
|
16
20
|
c: c,
|
|
@@ -41,6 +45,24 @@ export const BaseLayout = ({ title, description, lang, c, toast, children })=>{
|
|
|
41
45
|
name: "description",
|
|
42
46
|
content: description
|
|
43
47
|
}),
|
|
48
|
+
resolvedNoindex && /*#__PURE__*/ _jsx("meta", {
|
|
49
|
+
name: "robots",
|
|
50
|
+
content: "noindex, nofollow"
|
|
51
|
+
}),
|
|
52
|
+
resolvedFaviconUrl && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
53
|
+
children: [
|
|
54
|
+
/*#__PURE__*/ _jsx("link", {
|
|
55
|
+
rel: "icon",
|
|
56
|
+
href: "/favicon.ico",
|
|
57
|
+
sizes: "16x16 32x32"
|
|
58
|
+
}),
|
|
59
|
+
/*#__PURE__*/ _jsx("link", {
|
|
60
|
+
rel: "apple-touch-icon",
|
|
61
|
+
href: "/apple-touch-icon.png",
|
|
62
|
+
sizes: "180x180"
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
}),
|
|
44
66
|
/*#__PURE__*/ _jsx(ViteClient, {}),
|
|
45
67
|
/*#__PURE__*/ _jsx(Link, {
|
|
46
68
|
href: "/src/style.css",
|
|
@@ -18,29 +18,37 @@ function HeaderLink({ link }) {
|
|
|
18
18
|
children: link.label
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
export const SiteLayout = ({ siteName, siteDescription, links, currentPath, isAuthenticated, collections, children })=>{
|
|
21
|
+
export const SiteLayout = ({ siteName, siteDescription, links, currentPath, isAuthenticated, collections, homeDefaultView, siteAvatarUrl, showHeaderAvatar, siteFooterHtml, children })=>{
|
|
22
22
|
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
23
|
+
const latestHref = homeDefaultView === "featured" ? "/latest" : "/";
|
|
24
|
+
const featuredHref = homeDefaultView === "featured" ? "/" : "/featured";
|
|
25
|
+
const latestLink = {
|
|
26
|
+
href: latestHref,
|
|
27
|
+
label: $__i18n._({
|
|
28
|
+
id: "wL3cK8",
|
|
29
|
+
message: "Latest"
|
|
30
|
+
})
|
|
31
|
+
};
|
|
32
|
+
const featuredLink = {
|
|
33
|
+
href: featuredHref,
|
|
34
|
+
label: $__i18n._({
|
|
35
|
+
id: "FkMol5",
|
|
36
|
+
message: "Featured"
|
|
37
|
+
})
|
|
38
|
+
};
|
|
39
|
+
// Default view tab comes first
|
|
40
|
+
const browseLinks = homeDefaultView === "featured" ? [
|
|
41
|
+
featuredLink,
|
|
42
|
+
latestLink
|
|
43
|
+
] : [
|
|
44
|
+
latestLink,
|
|
45
|
+
featuredLink
|
|
38
46
|
];
|
|
39
47
|
const searchLabel = $__i18n._({
|
|
40
48
|
id: "A1taO8",
|
|
41
49
|
message: "Search"
|
|
42
50
|
});
|
|
43
|
-
const isHomePage = currentPath === "/" || currentPath === "/featured";
|
|
51
|
+
const isHomePage = currentPath === "/" || currentPath === "/featured" || currentPath === "/latest";
|
|
44
52
|
return /*#__PURE__*/ _jsxs("div", {
|
|
45
53
|
class: "site-page",
|
|
46
54
|
children: [
|
|
@@ -52,10 +60,17 @@ export const SiteLayout = ({ siteName, siteDescription, links, currentPath, isAu
|
|
|
52
60
|
/*#__PURE__*/ _jsxs("div", {
|
|
53
61
|
class: "site-header-top site-header-top-bordered",
|
|
54
62
|
children: [
|
|
55
|
-
/*#__PURE__*/
|
|
63
|
+
/*#__PURE__*/ _jsxs("a", {
|
|
56
64
|
href: "/",
|
|
57
65
|
class: "site-logo",
|
|
58
|
-
children:
|
|
66
|
+
children: [
|
|
67
|
+
showHeaderAvatar && siteAvatarUrl && /*#__PURE__*/ _jsx("img", {
|
|
68
|
+
src: siteAvatarUrl,
|
|
69
|
+
class: "site-logo-avatar",
|
|
70
|
+
alt: ""
|
|
71
|
+
}),
|
|
72
|
+
siteName
|
|
73
|
+
]
|
|
59
74
|
}),
|
|
60
75
|
/*#__PURE__*/ _jsxs("div", {
|
|
61
76
|
class: "site-header-right",
|
|
@@ -133,6 +148,19 @@ export const SiteLayout = ({ siteName, siteDescription, links, currentPath, isAu
|
|
|
133
148
|
})
|
|
134
149
|
})
|
|
135
150
|
}),
|
|
151
|
+
siteFooterHtml && /*#__PURE__*/ _jsx("footer", {
|
|
152
|
+
class: "site-footer",
|
|
153
|
+
"data-footer": true,
|
|
154
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
155
|
+
class: "site-container",
|
|
156
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
157
|
+
class: "prose",
|
|
158
|
+
dangerouslySetInnerHTML: {
|
|
159
|
+
__html: siteFooterHtml
|
|
160
|
+
}
|
|
161
|
+
})
|
|
162
|
+
})
|
|
163
|
+
}),
|
|
136
164
|
isAuthenticated && /*#__PURE__*/ _jsx(ComposeDialog, {
|
|
137
165
|
collections: collections
|
|
138
166
|
})
|