@jant/core 0.3.7 → 0.3.8
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 +4 -0
- package/dist/client.js +1 -0
- package/dist/db/schema.js +13 -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/image.js +3 -3
- package/dist/lib/media-helpers.js +43 -0
- package/dist/lib/nav-reorder.js +27 -0
- package/dist/lib/navigation.js +35 -0
- package/dist/lib/theme-components.js +49 -0
- package/dist/routes/api/timeline.js +115 -0
- package/dist/routes/api/upload.js +9 -5
- package/dist/routes/dash/navigation.js +274 -0
- package/dist/routes/pages/archive.js +14 -27
- package/dist/routes/pages/collection.js +10 -19
- package/dist/routes/pages/home.js +83 -126
- package/dist/routes/pages/page.js +19 -38
- package/dist/routes/pages/post.js +38 -51
- package/dist/routes/pages/search.js +13 -26
- package/dist/services/index.js +3 -1
- package/dist/services/media.js +1 -1
- package/dist/services/navigation.js +115 -0
- package/dist/services/post.js +26 -1
- package/dist/theme/components/PostList.js +5 -0
- package/dist/theme/components/index.js +2 -0
- package/dist/theme/components/timeline/ArticleCard.js +50 -0
- package/dist/theme/components/timeline/ImageCard.js +86 -0
- package/dist/theme/components/timeline/LinkCard.js +62 -0
- package/dist/theme/components/timeline/NoteCard.js +37 -0
- package/dist/theme/components/timeline/QuoteCard.js +51 -0
- package/dist/theme/components/timeline/ThreadPreview.js +52 -0
- package/dist/theme/components/timeline/TimelineFeed.js +43 -0
- package/dist/theme/components/timeline/TimelineItem.js +25 -0
- package/dist/theme/components/timeline/index.js +8 -0
- package/dist/theme/layouts/DashLayout.js +8 -0
- package/dist/theme/layouts/SiteLayout.js +160 -0
- package/dist/theme/layouts/index.js +1 -0
- package/dist/types/sortablejs.d.js +5 -0
- package/package.json +3 -2
- package/src/__tests__/helpers/db.ts +10 -0
- package/src/app.tsx +4 -0
- package/src/client.ts +1 -0
- package/src/db/migrations/0003_add_navigation_links.sql +8 -0
- package/src/db/migrations/meta/0003_snapshot.json +821 -0
- package/src/db/migrations/meta/_journal.json +14 -0
- package/src/db/schema.ts +13 -0
- package/src/i18n/locales/en.po +100 -32
- package/src/i18n/locales/en.ts +1 -1
- package/src/i18n/locales/zh-Hans.po +102 -55
- package/src/i18n/locales/zh-Hans.ts +1 -1
- package/src/i18n/locales/zh-Hant.po +102 -55
- package/src/i18n/locales/zh-Hant.ts +1 -1
- package/src/index.ts +5 -0
- package/src/lib/__tests__/theme-components.test.ts +107 -0
- package/src/lib/image.ts +3 -3
- package/src/lib/media-helpers.ts +54 -0
- package/src/lib/nav-reorder.ts +26 -0
- package/src/lib/navigation.ts +46 -0
- package/src/lib/theme-components.ts +76 -0
- package/src/routes/api/__tests__/posts.test.ts +8 -8
- package/src/routes/api/__tests__/timeline.test.ts +242 -0
- package/src/routes/api/timeline.tsx +145 -0
- package/src/routes/api/upload.ts +9 -5
- package/src/routes/dash/navigation.tsx +306 -0
- package/src/routes/pages/archive.tsx +15 -23
- package/src/routes/pages/collection.tsx +8 -15
- package/src/routes/pages/home.tsx +111 -122
- package/src/routes/pages/page.tsx +17 -30
- package/src/routes/pages/post.tsx +33 -42
- package/src/routes/pages/search.tsx +18 -22
- package/src/services/__tests__/media.test.ts +34 -7
- package/src/services/__tests__/navigation.test.ts +213 -0
- package/src/services/__tests__/post-timeline.test.ts +220 -0
- package/src/services/index.ts +7 -0
- package/src/services/media.ts +2 -1
- package/src/services/navigation.ts +165 -0
- package/src/services/post.ts +48 -1
- package/src/styles/components.css +59 -0
- package/src/theme/components/PostList.tsx +7 -0
- package/src/theme/components/index.ts +12 -0
- package/src/theme/components/timeline/ArticleCard.tsx +57 -0
- package/src/theme/components/timeline/ImageCard.tsx +80 -0
- package/src/theme/components/timeline/LinkCard.tsx +66 -0
- package/src/theme/components/timeline/NoteCard.tsx +41 -0
- package/src/theme/components/timeline/QuoteCard.tsx +55 -0
- package/src/theme/components/timeline/ThreadPreview.tsx +49 -0
- package/src/theme/components/timeline/TimelineFeed.tsx +52 -0
- package/src/theme/components/timeline/TimelineItem.tsx +39 -0
- package/src/theme/components/timeline/index.ts +8 -0
- package/src/theme/layouts/DashLayout.tsx +10 -0
- package/src/theme/layouts/SiteLayout.tsx +184 -0
- package/src/theme/layouts/index.ts +1 -0
- package/src/types/sortablejs.d.ts +23 -0
- package/src/types.ts +61 -0
- package/dist/app.d.ts +0 -38
- package/dist/app.d.ts.map +0 -1
- package/dist/auth.d.ts +0 -25
- package/dist/auth.d.ts.map +0 -1
- package/dist/db/index.d.ts +0 -10
- package/dist/db/index.d.ts.map +0 -1
- package/dist/db/schema.d.ts +0 -1543
- package/dist/db/schema.d.ts.map +0 -1
- package/dist/i18n/Trans.d.ts +0 -25
- package/dist/i18n/Trans.d.ts.map +0 -1
- package/dist/i18n/context.d.ts +0 -69
- package/dist/i18n/context.d.ts.map +0 -1
- package/dist/i18n/detect.d.ts +0 -20
- package/dist/i18n/detect.d.ts.map +0 -1
- package/dist/i18n/i18n.d.ts +0 -32
- package/dist/i18n/i18n.d.ts.map +0 -1
- package/dist/i18n/index.d.ts +0 -41
- package/dist/i18n/index.d.ts.map +0 -1
- package/dist/i18n/locales/en.d.ts +0 -3
- package/dist/i18n/locales/en.d.ts.map +0 -1
- package/dist/i18n/locales/zh-Hans.d.ts +0 -3
- package/dist/i18n/locales/zh-Hans.d.ts.map +0 -1
- package/dist/i18n/locales/zh-Hant.d.ts +0 -3
- package/dist/i18n/locales/zh-Hant.d.ts.map +0 -1
- package/dist/i18n/locales.d.ts +0 -11
- package/dist/i18n/locales.d.ts.map +0 -1
- package/dist/i18n/middleware.d.ts +0 -21
- package/dist/i18n/middleware.d.ts.map +0 -1
- package/dist/index.d.ts +0 -16
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/config.d.ts +0 -83
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/constants.d.ts +0 -37
- package/dist/lib/constants.d.ts.map +0 -1
- package/dist/lib/image.d.ts +0 -73
- package/dist/lib/image.d.ts.map +0 -1
- package/dist/lib/index.d.ts +0 -9
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/markdown.d.ts +0 -60
- package/dist/lib/markdown.d.ts.map +0 -1
- package/dist/lib/schemas.d.ts +0 -130
- package/dist/lib/schemas.d.ts.map +0 -1
- package/dist/lib/sqid.d.ts +0 -60
- package/dist/lib/sqid.d.ts.map +0 -1
- package/dist/lib/sse.d.ts +0 -192
- package/dist/lib/sse.d.ts.map +0 -1
- package/dist/lib/theme.d.ts +0 -44
- package/dist/lib/theme.d.ts.map +0 -1
- package/dist/lib/time.d.ts +0 -90
- package/dist/lib/time.d.ts.map +0 -1
- package/dist/lib/url.d.ts +0 -82
- package/dist/lib/url.d.ts.map +0 -1
- package/dist/middleware/auth.d.ts +0 -24
- package/dist/middleware/auth.d.ts.map +0 -1
- package/dist/middleware/onboarding.d.ts +0 -26
- package/dist/middleware/onboarding.d.ts.map +0 -1
- package/dist/routes/api/posts.d.ts +0 -13
- package/dist/routes/api/posts.d.ts.map +0 -1
- package/dist/routes/api/search.d.ts +0 -13
- package/dist/routes/api/search.d.ts.map +0 -1
- package/dist/routes/api/upload.d.ts +0 -16
- package/dist/routes/api/upload.d.ts.map +0 -1
- package/dist/routes/dash/collections.d.ts +0 -13
- package/dist/routes/dash/collections.d.ts.map +0 -1
- package/dist/routes/dash/index.d.ts +0 -15
- package/dist/routes/dash/index.d.ts.map +0 -1
- package/dist/routes/dash/media.d.ts +0 -16
- package/dist/routes/dash/media.d.ts.map +0 -1
- package/dist/routes/dash/pages.d.ts +0 -15
- package/dist/routes/dash/pages.d.ts.map +0 -1
- package/dist/routes/dash/posts.d.ts +0 -13
- package/dist/routes/dash/posts.d.ts.map +0 -1
- package/dist/routes/dash/redirects.d.ts +0 -13
- package/dist/routes/dash/redirects.d.ts.map +0 -1
- package/dist/routes/dash/settings.d.ts +0 -15
- package/dist/routes/dash/settings.d.ts.map +0 -1
- package/dist/routes/feed/rss.d.ts +0 -13
- package/dist/routes/feed/rss.d.ts.map +0 -1
- package/dist/routes/feed/sitemap.d.ts +0 -13
- package/dist/routes/feed/sitemap.d.ts.map +0 -1
- package/dist/routes/pages/archive.d.ts +0 -15
- package/dist/routes/pages/archive.d.ts.map +0 -1
- package/dist/routes/pages/collection.d.ts +0 -13
- package/dist/routes/pages/collection.d.ts.map +0 -1
- package/dist/routes/pages/home.d.ts +0 -13
- package/dist/routes/pages/home.d.ts.map +0 -1
- package/dist/routes/pages/page.d.ts +0 -15
- package/dist/routes/pages/page.d.ts.map +0 -1
- package/dist/routes/pages/post.d.ts +0 -13
- package/dist/routes/pages/post.d.ts.map +0 -1
- package/dist/routes/pages/search.d.ts +0 -13
- package/dist/routes/pages/search.d.ts.map +0 -1
- package/dist/services/collection.d.ts +0 -32
- package/dist/services/collection.d.ts.map +0 -1
- package/dist/services/index.d.ts +0 -28
- package/dist/services/index.d.ts.map +0 -1
- package/dist/services/media.d.ts +0 -34
- package/dist/services/media.d.ts.map +0 -1
- package/dist/services/post.d.ts +0 -31
- package/dist/services/post.d.ts.map +0 -1
- package/dist/services/redirect.d.ts +0 -15
- package/dist/services/redirect.d.ts.map +0 -1
- package/dist/services/search.d.ts +0 -26
- package/dist/services/search.d.ts.map +0 -1
- package/dist/services/settings.d.ts +0 -18
- package/dist/services/settings.d.ts.map +0 -1
- package/dist/theme/color-themes.d.ts +0 -30
- package/dist/theme/color-themes.d.ts.map +0 -1
- package/dist/theme/components/ActionButtons.d.ts +0 -43
- package/dist/theme/components/ActionButtons.d.ts.map +0 -1
- package/dist/theme/components/CrudPageHeader.d.ts +0 -23
- package/dist/theme/components/CrudPageHeader.d.ts.map +0 -1
- package/dist/theme/components/DangerZone.d.ts +0 -36
- package/dist/theme/components/DangerZone.d.ts.map +0 -1
- package/dist/theme/components/EmptyState.d.ts +0 -27
- package/dist/theme/components/EmptyState.d.ts.map +0 -1
- package/dist/theme/components/ListItemRow.d.ts +0 -15
- package/dist/theme/components/ListItemRow.d.ts.map +0 -1
- package/dist/theme/components/MediaGallery.d.ts +0 -13
- package/dist/theme/components/MediaGallery.d.ts.map +0 -1
- package/dist/theme/components/PageForm.d.ts +0 -14
- package/dist/theme/components/PageForm.d.ts.map +0 -1
- package/dist/theme/components/Pagination.d.ts +0 -46
- package/dist/theme/components/Pagination.d.ts.map +0 -1
- package/dist/theme/components/PostForm.d.ts +0 -16
- package/dist/theme/components/PostForm.d.ts.map +0 -1
- package/dist/theme/components/PostList.d.ts +0 -10
- package/dist/theme/components/PostList.d.ts.map +0 -1
- package/dist/theme/components/ThreadView.d.ts +0 -15
- package/dist/theme/components/ThreadView.d.ts.map +0 -1
- package/dist/theme/components/TypeBadge.d.ts +0 -12
- package/dist/theme/components/TypeBadge.d.ts.map +0 -1
- package/dist/theme/components/VisibilityBadge.d.ts +0 -12
- package/dist/theme/components/VisibilityBadge.d.ts.map +0 -1
- package/dist/theme/components/index.d.ts +0 -14
- package/dist/theme/components/index.d.ts.map +0 -1
- package/dist/theme/index.d.ts +0 -21
- package/dist/theme/index.d.ts.map +0 -1
- package/dist/theme/layouts/BaseLayout.d.ts +0 -23
- package/dist/theme/layouts/BaseLayout.d.ts.map +0 -1
- package/dist/theme/layouts/DashLayout.d.ts +0 -17
- package/dist/theme/layouts/DashLayout.d.ts.map +0 -1
- package/dist/theme/layouts/index.d.ts +0 -3
- package/dist/theme/layouts/index.d.ts.map +0 -1
- package/dist/types.d.ts +0 -237
- package/dist/types.d.ts.map +0 -1
package/dist/app.js
CHANGED
|
@@ -24,10 +24,12 @@ import { mediaRoutes as dashMediaRoutes } from "./routes/dash/media.js";
|
|
|
24
24
|
import { settingsRoutes as dashSettingsRoutes } from "./routes/dash/settings.js";
|
|
25
25
|
import { redirectsRoutes as dashRedirectsRoutes } from "./routes/dash/redirects.js";
|
|
26
26
|
import { collectionsRoutes as dashCollectionsRoutes } from "./routes/dash/collections.js";
|
|
27
|
+
import { navigationRoutes as dashNavigationRoutes } from "./routes/dash/navigation.js";
|
|
27
28
|
// Routes - API
|
|
28
29
|
import { postsApiRoutes } from "./routes/api/posts.js";
|
|
29
30
|
import { uploadApiRoutes } from "./routes/api/upload.js";
|
|
30
31
|
import { searchApiRoutes } from "./routes/api/search.js";
|
|
32
|
+
import { timelineApiRoutes } from "./routes/api/timeline.js";
|
|
31
33
|
// Routes - Feed
|
|
32
34
|
import { rssRoutes } from "./routes/feed/rss.js";
|
|
33
35
|
import { sitemapRoutes } from "./routes/feed/sitemap.js";
|
|
@@ -131,6 +133,7 @@ import { getAvailableThemes, buildThemeStyle } from "./lib/theme.js";
|
|
|
131
133
|
});
|
|
132
134
|
// API Routes
|
|
133
135
|
app.route("/api/posts", postsApiRoutes);
|
|
136
|
+
app.route("/api/timeline", timelineApiRoutes);
|
|
134
137
|
// Setup page component
|
|
135
138
|
const SetupContent = ()=>{
|
|
136
139
|
const { i18n: $__i18n, _: $__ } = $_useLingui();
|
|
@@ -626,6 +629,7 @@ import { getAvailableThemes, buildThemeStyle } from "./lib/theme.js";
|
|
|
626
629
|
app.route("/dash/settings", dashSettingsRoutes);
|
|
627
630
|
app.route("/dash/redirects", dashRedirectsRoutes);
|
|
628
631
|
app.route("/dash/collections", dashCollectionsRoutes);
|
|
632
|
+
app.route("/dash/navigation", dashNavigationRoutes);
|
|
629
633
|
// API routes
|
|
630
634
|
app.route("/api/upload", uploadApiRoutes);
|
|
631
635
|
app.route("/api/search", searchApiRoutes);
|
package/dist/client.js
CHANGED
package/dist/db/schema.js
CHANGED
|
@@ -103,6 +103,19 @@ export const redirects = sqliteTable("redirects", {
|
|
|
103
103
|
createdAt: integer("created_at").notNull()
|
|
104
104
|
});
|
|
105
105
|
// =============================================================================
|
|
106
|
+
// Navigation Links
|
|
107
|
+
// =============================================================================
|
|
108
|
+
export const navigationLinks = sqliteTable("navigation_links", {
|
|
109
|
+
id: integer("id").primaryKey({
|
|
110
|
+
autoIncrement: true
|
|
111
|
+
}),
|
|
112
|
+
label: text("label").notNull(),
|
|
113
|
+
url: text("url").notNull(),
|
|
114
|
+
position: integer("position").notNull().default(0),
|
|
115
|
+
createdAt: integer("created_at").notNull(),
|
|
116
|
+
updatedAt: integer("updated_at").notNull()
|
|
117
|
+
});
|
|
118
|
+
// =============================================================================
|
|
106
119
|
// Settings (Key-Value)
|
|
107
120
|
// =============================================================================
|
|
108
121
|
export const settings = sqliteTable("settings", {
|
package/dist/i18n/locales/en.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*eslint-disable*/ export const messages = JSON.parse("{\"+7Wr2a\":[\"Edit: \",[\"title\"]],\"+MACwa\":[\"No collections yet.\"],\"+owNNn\":[\"Posts\"],\"+zy2Nq\":[\"Type\"],\"/0D1Xp\":[\"Edit Collection\"],\"/Rj5P4\":[\"Your Name\"],\"07Epll\":[\"This will theme both your site and your dashboard. All color themes support dark mode.\"],\"0JkyS7\":[\"Create your first page\"],\"0a6MpL\":[\"New Redirect\"],\"1CU1Td\":[\"URL-safe identifier (lowercase, numbers, hyphens)\"],\"1DBGsz\":[\"Notes\"],\"1o+wgo\":[\"e.g. The Verge, John Doe\"],\"2N0qpv\":[\"Post title...\"],\"2fUwEY\":[\"Select Media\"],\"2q/Q7x\":[\"Visibility\"],\"2rJGtU\":[\"Page title...\"],\"3Yvsaz\":[\"302 (Temporary)\"],\"4/SFQS\":[\"View Site\"],\"40TVQj\":[\"Custom Path (optional)\"],\"4KzVT6\":[\"Delete Page\"],\"4b3oEV\":[\"Content\"],\"4mDPGp\":[\"The URL path for this page. Use lowercase letters, numbers, and hyphens.\"],\"6WdDG7\":[\"Page\"],\"6YtxFj\":[\"Name\"],\"7G4SBz\":[\"Page content (Markdown supported)...\"],\"7Mk+/h\":[\"Update Collection\"],\"7Q1KKN\":[\"From Path\"],\"7aECQB\":[\"Invalid or Expired Link\"],\"7nGhhM\":[\"What's on your mind?\"],\"7p5kLi\":[\"Dashboard\"],\"7vhWI8\":[\"New Password\"],\"8ZsakT\":[\"Password\"],\"90Luob\":[[\"count\"],\" replies\"],\"A1taO8\":[\"Search\"],\"AeXO77\":[\"Account\"],\"AyHO4m\":[\"What's this collection about?\"],\"B373X+\":[\"Edit Post\"],\"B495Gs\":[\"Archive\"],\"BjF0Jv\":[\"Lowercase letters, numbers, and hyphens only\"],\"D9Oea+\":[\"Permalink\"],\"DCKkhU\":[\"Current Password\"],\"DHhJ7s\":[\"Previous\"],\"DPfwMq\":[\"Done\"],\"DoJzLz\":[\"Collections\"],\"E80cJw\":[\"Deleting this media will remove it permanently from storage.\"],\"EEYbdt\":[\"Publish\"],\"EGwzOK\":[\"Complete Setup\"],\"EkH9pt\":[\"Update\"],\"FGrimz\":[\"New Post\"],\"FkMol5\":[\"Featured\"],\"Fxf4jq\":[\"Description (optional)\"],\"GA5A5H\":[\"Delete Collection\"],\"GX2VMa\":[\"Create your admin account.\"],\"GbVAnd\":[\"This password reset link is invalid or has expired. Please generate a new one.\"],\"GorKul\":[\"Welcome to Jant\"],\"GrZ6fH\":[\"New Page\"],\"GxkJXS\":[\"Uploading...\"],\"HfyyXl\":[\"My Blog\"],\"HiETwV\":[\"Quiet (normal)\"],\"Hzi9AA\":[\"No posts found.\"],\"I6gXOa\":[\"Path\"],\"I8hDlV\":[\"At least 1 image required for image posts.\"],\"IagCbF\":[\"URL\"],\"J4FNfC\":[\"No posts in this collection.\"],\"JIBC/T\":[\"Supported formats: JPEG, PNG, GIF, WebP, SVG. Max size: 10MB.\"],\"Jed1wB\":[\"Need help? Visit the <0>documentation</0>\"],\"JiP4aa\":[\"Published pages are accessible via their path. Drafts are not visible.\"],\"K9NcLu\":[\"Use this URL to embed the media in your posts.\"],\"KbS2K9\":[\"Reset Password\"],\"KiJn9B\":[\"Note\"],\"L85WcV\":[\"Slug\"],\"LkvLQe\":[\"No pages yet.\"],\"M1RvTd\":[\"Click image to view full size\"],\"M8kJqa\":[\"Drafts\"],\"M9xgHy\":[\"Redirects\"],\"MHrjPM\":[\"Title\"],\"MWBOxm\":[\"Collections (optional)\"],\"MZbQHL\":[\"No results found.\"],\"Mhf/H/\":[\"Create Redirect\"],\"MqghUt\":[\"Search posts...\"],\"N40H+G\":[\"All\"],\"O3oNi5\":[\"Email\"],\"OCNZaU\":[\"The path to redirect from\"],\"ODiSoW\":[\"No posts yet.\"],\"ONWvwQ\":[\"Upload\"],\"Pbm2/N\":[\"Create Collection\"],\"RDjuBN\":[\"Setup\"],\"Rj01Fz\":[\"Links\"],\"RwGhWy\":[\"Thread with \",[\"count\"],\" posts\"],\"SJmfuf\":[\"Site Name\"],\"ST+lN2\":[\"No media uploaded yet.\"],\"Tt5T6+\":[\"Articles\"],\"TxE+Mj\":[\"1 reply\"],\"Tz0i8g\":[\"Settings\"],\"U5v6Gh\":[\"Edit Page\"],\"UDMjsP\":[\"Quick Actions\"],\"UGT5vp\":[\"Save Settings\"],\"VUSy8D\":[\"Search failed. Please try again.\"],\"VhMDMg\":[\"Change Password\"],\"WDcQq9\":[\"Unlisted\"],\"Weq9zb\":[\"General\"],\"WmZ/rP\":[\"To Path\"],\"Y+7JGK\":[\"Create Page\"],\"Z3FXyt\":[\"Loading...\"],\"ZQKLI1\":[\"Danger Zone\"],\"ZhhOwV\":[\"Quote\"],\"aAIQg2\":[\"Appearance\"],\"an5hVd\":[\"Images\"],\"b+/jO6\":[\"301 (Permanent)\"],\"bHYIks\":[\"Sign Out\"],\"biOepV\":[\"← Back to home\"],\"cnGeoo\":[\"Delete\"],\"dEgA5A\":[\"Cancel\"],\"e6Jr7Q\":[\"← Back to Collections\"],\"ePK91l\":[\"Edit\"],\"eWLklq\":[\"Quotes\"],\"eneWvv\":[\"Draft\"],\"er8+x7\":[\"Demo account pre-filled. Just click Sign In.\"],\"f6e0Ry\":[\"Article\"],\"fG7BxZ\":[\"Upload images via the API: POST /api/upload with a file form field.\"],\"fttd2R\":[\"My Collection\"],\"hG89Ed\":[\"Image\"],\"hWOZIv\":[\"Enter your new password.\"],\"hXzOVo\":[\"Next\"],\"he3ygx\":[\"Copy\"],\"iH8pgl\":[\"Back\"],\"ig4hg2\":[\"Let's set up your site.\"],\"jpctdh\":[\"View\"],\"k1ifdL\":[\"Processing...\"],\"mTOYla\":[\"View all posts →\"],\"n1ekoW\":[\"Sign In\"],\"oJFOZk\":[\"Source Name (optional)\"],\"oYPBa0\":[\"Update Page\"],\"p2/GCq\":[\"Confirm Password\"],\"pRhYH2\":[\"Posts in Collection (\",[\"count\"],\")\"],\"pZq3aX\":[\"Upload failed. Please try again.\"],\"qMyM2u\":[\"Source URL (optional)\"],\"qiXmlF\":[\"Add Media\"],\"r1MpXi\":[\"Quiet\"],\"rFmBG3\":[\"Color theme\"],\"rdUucN\":[\"Preview\"],\"rzNUSl\":[\"Thread with 1 post\"],\"sGajR7\":[\"Thread start\"],\"ssqvZi\":[\"Save Profile\"],\"t/YqKh\":[\"Remove\"],\"tfrt7B\":[\"No redirects configured.\"],\"tiq7kl\":[\"Page \",[\"page\"]],\"u2f7vd\":[\"Site Description\"],\"u3wRF+\":[\"Published\"],\"u6Hp4N\":[\"Markdown\"],\"uAQUqI\":[\"Status\"],\"vERlcd\":[\"Profile\"],\"vXIe7J\":[\"Language\"],\"vzU4k9\":[\"New Collection\"],\"wEF6Ix\":[\"The destination path or URL\"],\"wK4OTM\":[\"Title (optional)\"],\"wM5UXj\":[\"Delete Media\"],\"wRR604\":[\"Pages\"],\"wja8aL\":[\"Untitled\"],\"x+doid\":[\"Images are automatically optimized: resized to max 1920px, converted to WebP, and metadata stripped.\"],\"x0mzE0\":[\"Create your first post\"],\"x4RuFo\":[\"Back to home\"],\"xYilR2\":[\"Media\"],\"y28hnO\":[\"Post\"],\"yQ2kGp\":[\"Load more\"],\"yjkELF\":[\"Confirm New Password\"],\"yzF66j\":[\"Link\"],\"z8ajIE\":[\"Found 1 result\"],\"zH6KqE\":[\"Found \",[\"count\"],\" results\"]}");
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"+7Wr2a\":[\"Edit: \",[\"title\"]],\"+MACwa\":[\"No collections yet.\"],\"+bHzpy\":[\"Display text for the link\"],\"+owNNn\":[\"Posts\"],\"+zy2Nq\":[\"Type\"],\"/0D1Xp\":[\"Edit Collection\"],\"/Rj5P4\":[\"Your Name\"],\"07Epll\":[\"This will theme both your site and your dashboard. All color themes support dark mode.\"],\"0JkyS7\":[\"Create your first page\"],\"0a6MpL\":[\"New Redirect\"],\"1CU1Td\":[\"URL-safe identifier (lowercase, numbers, hyphens)\"],\"1DBGsz\":[\"Notes\"],\"1o+wgo\":[\"e.g. The Verge, John Doe\"],\"2N0qpv\":[\"Post title...\"],\"2fUwEY\":[\"Select Media\"],\"2q/Q7x\":[\"Visibility\"],\"2rJGtU\":[\"Page title...\"],\"3Yvsaz\":[\"302 (Temporary)\"],\"4/SFQS\":[\"View Site\"],\"40TVQj\":[\"Custom Path (optional)\"],\"4KzVT6\":[\"Delete Page\"],\"4b3oEV\":[\"Content\"],\"4mDPGp\":[\"The URL path for this page. Use lowercase letters, numbers, and hyphens.\"],\"6WdDG7\":[\"Page\"],\"6YtxFj\":[\"Name\"],\"7G4SBz\":[\"Page content (Markdown supported)...\"],\"7Mk+/h\":[\"Update Collection\"],\"7Q1KKN\":[\"From Path\"],\"7aECQB\":[\"Invalid or Expired Link\"],\"7nGhhM\":[\"What's on your mind?\"],\"7p5kLi\":[\"Dashboard\"],\"7vhWI8\":[\"New Password\"],\"87a/t/\":[\"Label\"],\"8ZsakT\":[\"Password\"],\"90Luob\":[[\"count\"],\" replies\"],\"A1taO8\":[\"Search\"],\"AeXO77\":[\"Account\"],\"AyHO4m\":[\"What's this collection about?\"],\"B373X+\":[\"Edit Post\"],\"B495Gs\":[\"Archive\"],\"BjF0Jv\":[\"Lowercase letters, numbers, and hyphens only\"],\"D9Oea+\":[\"Permalink\"],\"DCKkhU\":[\"Current Password\"],\"DHhJ7s\":[\"Previous\"],\"DPfwMq\":[\"Done\"],\"DoJzLz\":[\"Collections\"],\"E80cJw\":[\"Deleting this media will remove it permanently from storage.\"],\"EEYbdt\":[\"Publish\"],\"EGwzOK\":[\"Complete Setup\"],\"EkH9pt\":[\"Update\"],\"FGrimz\":[\"New Post\"],\"FkMol5\":[\"Featured\"],\"Fxf4jq\":[\"Description (optional)\"],\"GA5A5H\":[\"Delete Collection\"],\"GX2VMa\":[\"Create your admin account.\"],\"GbVAnd\":[\"This password reset link is invalid or has expired. Please generate a new one.\"],\"GorKul\":[\"Welcome to Jant\"],\"GrZ6fH\":[\"New Page\"],\"GxkJXS\":[\"Uploading...\"],\"HfyyXl\":[\"My Blog\"],\"HiETwV\":[\"Quiet (normal)\"],\"Hzi9AA\":[\"No posts found.\"],\"I6gXOa\":[\"Path\"],\"I8hDlV\":[\"At least 1 image required for image posts.\"],\"IUwGEM\":[\"Save Changes\"],\"IagCbF\":[\"URL\"],\"J4FNfC\":[\"No posts in this collection.\"],\"JIBC/T\":[\"Supported formats: JPEG, PNG, GIF, WebP, SVG. Max size: 10MB.\"],\"Jed1wB\":[\"Need help? Visit the <0>documentation</0>\"],\"JiP4aa\":[\"Published pages are accessible via their path. Drafts are not visible.\"],\"K9NcLu\":[\"Use this URL to embed the media in your posts.\"],\"KbS2K9\":[\"Reset Password\"],\"KiJn9B\":[\"Note\"],\"KmGXnO\":[\"Are you sure you want to delete this post? This cannot be undone.\"],\"L85WcV\":[\"Slug\"],\"LkvLQe\":[\"No pages yet.\"],\"M1RvTd\":[\"Click image to view full size\"],\"M8kJqa\":[\"Drafts\"],\"M9xgHy\":[\"Redirects\"],\"MHrjPM\":[\"Title\"],\"MWBOxm\":[\"Collections (optional)\"],\"MZbQHL\":[\"No results found.\"],\"Mhf/H/\":[\"Create Redirect\"],\"MqghUt\":[\"Search posts...\"],\"N40H+G\":[\"All\"],\"O3oNi5\":[\"Email\"],\"OCNZaU\":[\"The path to redirect from\"],\"ODiSoW\":[\"No posts yet.\"],\"ONWvwQ\":[\"Upload\"],\"Pbm2/N\":[\"Create Collection\"],\"QEbNBb\":[\"Path (e.g. /archive) or full URL (e.g. https://example.com)\"],\"RDjuBN\":[\"Setup\"],\"Rj01Fz\":[\"Links\"],\"RwGhWy\":[\"Thread with \",[\"count\"],\" posts\"],\"SJmfuf\":[\"Site Name\"],\"ST+lN2\":[\"No media uploaded yet.\"],\"Tt5T6+\":[\"Articles\"],\"TxE+Mj\":[\"1 reply\"],\"Tz0i8g\":[\"Settings\"],\"U5v6Gh\":[\"Edit Page\"],\"UDMjsP\":[\"Quick Actions\"],\"UGT5vp\":[\"Save Settings\"],\"UxKoFf\":[\"Navigation\"],\"VUSy8D\":[\"Search failed. Please try again.\"],\"VhMDMg\":[\"Change Password\"],\"WDcQq9\":[\"Unlisted\"],\"Weq9zb\":[\"General\"],\"WmZ/rP\":[\"To Path\"],\"Y+7JGK\":[\"Create Page\"],\"Z3FXyt\":[\"Loading...\"],\"ZQKLI1\":[\"Danger Zone\"],\"ZhhOwV\":[\"Quote\"],\"aAIQg2\":[\"Appearance\"],\"aaGV/9\":[\"New Link\"],\"an5hVd\":[\"Images\"],\"b+/jO6\":[\"301 (Permanent)\"],\"bHYIks\":[\"Sign Out\"],\"biOepV\":[\"← Back to home\"],\"cnGeoo\":[\"Delete\"],\"dEgA5A\":[\"Cancel\"],\"e6Jr7Q\":[\"← Back to Collections\"],\"ePK91l\":[\"Edit\"],\"eWLklq\":[\"Quotes\"],\"eneWvv\":[\"Draft\"],\"er8+x7\":[\"Demo account pre-filled. Just click Sign In.\"],\"f6e0Ry\":[\"Article\"],\"fG7BxZ\":[\"Upload images via the API: POST /api/upload with a file form field.\"],\"fttd2R\":[\"My Collection\"],\"gDx5MG\":[\"Edit Link\"],\"hG89Ed\":[\"Image\"],\"hWOZIv\":[\"Enter your new password.\"],\"hXzOVo\":[\"Next\"],\"he3ygx\":[\"Copy\"],\"iH8pgl\":[\"Back\"],\"ig4hg2\":[\"Let's set up your site.\"],\"jpctdh\":[\"View\"],\"k1ifdL\":[\"Processing...\"],\"kd7eBB\":[\"Create Link\"],\"mTOYla\":[\"View all posts →\"],\"n1ekoW\":[\"Sign In\"],\"oJFOZk\":[\"Source Name (optional)\"],\"oYPBa0\":[\"Update Page\"],\"p2/GCq\":[\"Confirm Password\"],\"pRhYH2\":[\"Posts in Collection (\",[\"count\"],\")\"],\"pZq3aX\":[\"Upload failed. Please try again.\"],\"qMyM2u\":[\"Source URL (optional)\"],\"qiXmlF\":[\"Add Media\"],\"r1MpXi\":[\"Quiet\"],\"rFmBG3\":[\"Color theme\"],\"rdUucN\":[\"Preview\"],\"rzNUSl\":[\"Thread with 1 post\"],\"sGajR7\":[\"Thread start\"],\"smzF8S\":[\"Show \",[\"remainingCount\"],\" more \",[\"0\"]],\"ssqvZi\":[\"Save Profile\"],\"t/YqKh\":[\"Remove\"],\"tfrt7B\":[\"No redirects configured.\"],\"tiq7kl\":[\"Page \",[\"page\"]],\"u2f7vd\":[\"Site Description\"],\"u3wRF+\":[\"Published\"],\"u6Hp4N\":[\"Markdown\"],\"uAQUqI\":[\"Status\"],\"vERlcd\":[\"Profile\"],\"vXIe7J\":[\"Language\"],\"vzU4k9\":[\"New Collection\"],\"wEF6Ix\":[\"The destination path or URL\"],\"wK4OTM\":[\"Title (optional)\"],\"wM5UXj\":[\"Delete Media\"],\"wRR604\":[\"Pages\"],\"wdGjkd\":[\"No navigation links configured.\"],\"wja8aL\":[\"Untitled\"],\"x+doid\":[\"Images are automatically optimized: resized to max 1920px, converted to WebP, and metadata stripped.\"],\"x0mzE0\":[\"Create your first post\"],\"x4RuFo\":[\"Back to home\"],\"xYilR2\":[\"Media\"],\"y28hnO\":[\"Post\"],\"yQ2kGp\":[\"Load more\"],\"yjkELF\":[\"Confirm New Password\"],\"yzF66j\":[\"Link\"],\"z8ajIE\":[\"Found 1 result\"],\"zH6KqE\":[\"Found \",[\"count\"],\" results\"]}");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*eslint-disable*/ export const messages = JSON.parse("{\"+7Wr2a\":[\"Edit: \",[\"title\"]],\"+MACwa\":[\"尚未有任何收藏。\"],\"+owNNn\":[\"帖子\"],\"+zy2Nq\":[\"类型\"],\"/0D1Xp\":[\"编辑集合\"],\"/Rj5P4\":[\"您的姓名\"],\"07Epll\":[\"这将为您的网站和仪表板设置主题。所有颜色主题都支持暗黑模式。\"],\"0JkyS7\":[\"创建您的第一页\"],\"0a6MpL\":[\"新重定向\"],\"1CU1Td\":[\"URL安全标识符(小写字母、数字、连字符)\"],\"1DBGsz\":[\"笔记\"],\"1o+wgo\":[\"
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"+7Wr2a\":[\"Edit: \",[\"title\"]],\"+MACwa\":[\"尚未有任何收藏。\"],\"+bHzpy\":[\"链接的显示文本\"],\"+owNNn\":[\"帖子\"],\"+zy2Nq\":[\"类型\"],\"/0D1Xp\":[\"编辑集合\"],\"/Rj5P4\":[\"您的姓名\"],\"07Epll\":[\"这将为您的网站和仪表板设置主题。所有颜色主题都支持暗黑模式。\"],\"0JkyS7\":[\"创建您的第一页\"],\"0a6MpL\":[\"新重定向\"],\"1CU1Td\":[\"URL安全标识符(小写字母、数字、连字符)\"],\"1DBGsz\":[\"笔记\"],\"1o+wgo\":[\"例如:The Verge,John Doe\"],\"2N0qpv\":[\"帖子标题...\"],\"2fUwEY\":[\"选择媒体\"],\"2q/Q7x\":[\"可见性\"],\"2rJGtU\":[\"页面标题...\"],\"3Yvsaz\":[\"302(临时)\"],\"4/SFQS\":[\"查看网站\"],\"40TVQj\":[\"自定义路径(可选)\"],\"4KzVT6\":[\"删除页面\"],\"4b3oEV\":[\"内容\"],\"4mDPGp\":[\"此页面的 URL 路径。使用小写字母、数字和连字符。\"],\"6WdDG7\":[\"页面\"],\"6YtxFj\":[\"姓名\"],\"7G4SBz\":[\"页面内容(支持Markdown)...\"],\"7Mk+/h\":[\"更新收藏夹\"],\"7Q1KKN\":[\"来源路径\"],\"7aECQB\":[\"无效或过期的链接\"],\"7nGhhM\":[\"你在想什么?\"],\"7p5kLi\":[\"仪表板\"],\"7vhWI8\":[\"新密码\"],\"87a/t/\":[\"标签\"],\"8ZsakT\":[\"密码\"],\"90Luob\":[[\"count\"],\" 条回复\"],\"A1taO8\":[\"搜索\"],\"AeXO77\":[\"账户\"],\"AyHO4m\":[\"这个系列是关于什么的?\"],\"B373X+\":[\"编辑帖子\"],\"B495Gs\":[\"档案馆\"],\"BjF0Jv\":[\"仅允许小写字母、数字和连字符\"],\"D9Oea+\":[\"永久链接\"],\"DCKkhU\":[\"当前密码\"],\"DHhJ7s\":[\"上一页\"],\"DPfwMq\":[\"完成\"],\"DoJzLz\":[\"收藏夹\"],\"E80cJw\":[\"删除此媒体将永久从存储中移除。\"],\"EEYbdt\":[\"发布\"],\"EGwzOK\":[\"完成设置\"],\"EkH9pt\":[\"更新\"],\"FGrimz\":[\"新帖子\"],\"FkMol5\":[\"精选\"],\"Fxf4jq\":[\"描述(可选)\"],\"GA5A5H\":[\"删除收藏夹\"],\"GX2VMa\":[\"创建您的管理员账户。\"],\"GbVAnd\":[\"此密码重置链接无效或已过期。请生成一个新的链接。\"],\"GorKul\":[\"欢迎来到Jant\"],\"GrZ6fH\":[\"新页面\"],\"GxkJXS\":[\"上传中...\"],\"HfyyXl\":[\"My Blog\"],\"HiETwV\":[\"安静(正常)\"],\"Hzi9AA\":[\"未找到帖子。\"],\"I6gXOa\":[\"路径\"],\"I8hDlV\":[\"图像帖子至少需要 1 张图片。\"],\"IUwGEM\":[\"保存更改\"],\"IagCbF\":[\"网址\"],\"J4FNfC\":[\"此集合中没有帖子。\"],\"JIBC/T\":[\"Supported formats: JPEG, PNG, GIF, WebP, SVG. Max size: 10MB.\"],\"Jed1wB\":[\"需要帮助吗?访问<0>文档</0>。\"],\"JiP4aa\":[\"已发布的页面可以通过其路径访问。草稿不可见。\"],\"K9NcLu\":[\"使用此 URL 将媒体嵌入到您的帖子中。\"],\"KbS2K9\":[\"重置密码\"],\"KiJn9B\":[\"注意\"],\"KmGXnO\":[\"Are you sure you want to delete this post? This cannot be undone.\"],\"L85WcV\":[\"缩略名\"],\"LkvLQe\":[\"还没有页面。\"],\"M1RvTd\":[\"点击图片查看完整尺寸\"],\"M8kJqa\":[\"草稿\"],\"M9xgHy\":[\"重定向\"],\"MHrjPM\":[\"标题\"],\"MWBOxm\":[\"集合(可选)\"],\"MZbQHL\":[\"未找到结果。\"],\"Mhf/H/\":[\"创建重定向\"],\"MqghUt\":[\"搜索帖子...\"],\"N40H+G\":[\"所有\"],\"O3oNi5\":[\"电子邮件\"],\"OCNZaU\":[\"重定向的路径\"],\"ODiSoW\":[\"还没有帖子。\"],\"ONWvwQ\":[\"上传\"],\"Pbm2/N\":[\"创建集合\"],\"QEbNBb\":[\"路径(例如 /archive)或完整 URL(例如 https://example.com)\"],\"RDjuBN\":[\"Setup\"],\"Rj01Fz\":[\"链接\"],\"RwGhWy\":[\"包含 \",[\"count\"],\" 条帖子的话题\"],\"SJmfuf\":[\"网站名称\"],\"ST+lN2\":[\"尚未上传任何媒体。\"],\"Tt5T6+\":[\"文章\"],\"TxE+Mj\":[\"1 条回复\"],\"Tz0i8g\":[\"设置\"],\"U5v6Gh\":[\"编辑页面\"],\"UDMjsP\":[\"快速操作\"],\"UGT5vp\":[\"保存设置\"],\"UxKoFf\":[\"导航\"],\"VUSy8D\":[\"Search failed. Please try again.\"],\"VhMDMg\":[\"更改密码\"],\"WDcQq9\":[\"未列出\"],\"Weq9zb\":[\"常规\"],\"WmZ/rP\":[\"到路径\"],\"Y+7JGK\":[\"创建页面\"],\"Z3FXyt\":[\"加载中...\"],\"ZQKLI1\":[\"危险区域\"],\"ZhhOwV\":[\"引用\"],\"aAIQg2\":[\"外观\"],\"aaGV/9\":[\"新链接\"],\"an5hVd\":[\"图片\"],\"b+/jO6\":[\"301(永久)\"],\"bHYIks\":[\"登出\"],\"biOepV\":[\"← Back to home\"],\"cnGeoo\":[\"删除\"],\"dEgA5A\":[\"取消\"],\"e6Jr7Q\":[\"← 返回收藏夹\"],\"ePK91l\":[\"编辑\"],\"eWLklq\":[\"引用\"],\"eneWvv\":[\"草稿\"],\"er8+x7\":[\"演示账户已预填。只需点击登录。\"],\"f6e0Ry\":[\"文章\"],\"fG7BxZ\":[\"Upload images via the API: POST /api/upload with a file form field.\"],\"fttd2R\":[\"我的收藏\"],\"gDx5MG\":[\"编辑链接\"],\"hG89Ed\":[\"图像\"],\"hWOZIv\":[\"输入您的新密码。\"],\"hXzOVo\":[\"下一页\"],\"he3ygx\":[\"复制\"],\"iH8pgl\":[\"返回\"],\"ig4hg2\":[\"Let's set up your site.\"],\"jpctdh\":[\"查看\"],\"k1ifdL\":[\"处理中...\"],\"kd7eBB\":[\"创建链接\"],\"mTOYla\":[\"View all posts →\"],\"n1ekoW\":[\"登录\"],\"oJFOZk\":[\"来源名称(可选)\"],\"oYPBa0\":[\"更新页面\"],\"p2/GCq\":[\"确认密码\"],\"pRhYH2\":[\"集合中的帖子 (\",[\"count\"],\")\"],\"pZq3aX\":[\"上传失败。请再试一次。\"],\"qMyM2u\":[\"源网址(可选)\"],\"qiXmlF\":[\"添加媒体\"],\"r1MpXi\":[\"安静\"],\"rFmBG3\":[\"颜色主题\"],\"rdUucN\":[\"预览\"],\"rzNUSl\":[\"包含 1 条帖子的话题\"],\"sGajR7\":[\"线程开始\"],\"smzF8S\":[\"显示 \",[\"remainingCount\"],\" 个更多 \",[\"0\"]],\"ssqvZi\":[\"保存个人资料\"],\"t/YqKh\":[\"移除\"],\"tfrt7B\":[\"未配置重定向。\"],\"tiq7kl\":[\"页面 \",[\"page\"]],\"u2f7vd\":[\"网站描述\"],\"u3wRF+\":[\"已发布\"],\"u6Hp4N\":[\"Markdown\"],\"uAQUqI\":[\"状态\"],\"vERlcd\":[\"个人资料\"],\"vXIe7J\":[\"语言\"],\"vzU4k9\":[\"新收藏\"],\"wEF6Ix\":[\"目标路径或 URL\"],\"wK4OTM\":[\"标题(可选)\"],\"wM5UXj\":[\"删除媒体\"],\"wRR604\":[\"页面\"],\"wdGjkd\":[\"未配置导航链接。\"],\"wja8aL\":[\"无标题\"],\"x+doid\":[\"图像会自动优化:调整大小至最大 1920px,转换为 WebP,并去除元数据。\"],\"x0mzE0\":[\"创建你的第一篇帖子\"],\"x4RuFo\":[\"Back to home\"],\"xYilR2\":[\"媒体\"],\"y28hnO\":[\"帖子\"],\"yQ2kGp\":[\"加载更多\"],\"yjkELF\":[\"确认新密码\"],\"yzF66j\":[\"链接\"],\"z8ajIE\":[\"找到 1 个结果\"],\"zH6KqE\":[\"找到 \",[\"count\"],\" 个结果\"]}");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*eslint-disable*/ export const messages = JSON.parse("{\"+7Wr2a\":[\"Edit: \",[\"title\"]],\"+MACwa\":[\"尚未有任何收藏。\"],\"+owNNn\":[\"文章\"],\"+zy2Nq\":[\"類型\"],\"/0D1Xp\":[\"編輯收藏集\"],\"/Rj5P4\":[\"您的姓名\"],\"07Epll\":[\"這將為您的網站和儀表板設置主題。所有顏色主題都支持深色模式。\"],\"0JkyS7\":[\"建立您的第一個頁面\"],\"0a6MpL\":[\"新重定向\"],\"1CU1Td\":[\"網址安全識別碼(小寫、數字、連字符)\"],\"1DBGsz\":[\"筆記\"],\"1o+wgo\":[\"
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"+7Wr2a\":[\"Edit: \",[\"title\"]],\"+MACwa\":[\"尚未有任何收藏。\"],\"+bHzpy\":[\"顯示連結的文字\"],\"+owNNn\":[\"文章\"],\"+zy2Nq\":[\"類型\"],\"/0D1Xp\":[\"編輯收藏集\"],\"/Rj5P4\":[\"您的姓名\"],\"07Epll\":[\"這將為您的網站和儀表板設置主題。所有顏色主題都支持深色模式。\"],\"0JkyS7\":[\"建立您的第一個頁面\"],\"0a6MpL\":[\"新重定向\"],\"1CU1Td\":[\"網址安全識別碼(小寫、數字、連字符)\"],\"1DBGsz\":[\"筆記\"],\"1o+wgo\":[\"例如:The Verge,約翰·多伊\"],\"2N0qpv\":[\"文章標題...\"],\"2fUwEY\":[\"選擇媒體\"],\"2q/Q7x\":[\"可見性\"],\"2rJGtU\":[\"頁面標題...\"],\"3Yvsaz\":[\"302(臨時)\"],\"4/SFQS\":[\"查看網站\"],\"40TVQj\":[\"自訂路徑(選填)\"],\"4KzVT6\":[\"刪除頁面\"],\"4b3oEV\":[\"內容\"],\"4mDPGp\":[\"此頁面的 URL 路徑。使用小寫字母、數字和連字符。\"],\"6WdDG7\":[\"頁面\"],\"6YtxFj\":[\"名稱\"],\"7G4SBz\":[\"頁面內容(支持Markdown)...\"],\"7Mk+/h\":[\"更新收藏集\"],\"7Q1KKN\":[\"來源路徑\"],\"7aECQB\":[\"無效或已過期的連結\"],\"7nGhhM\":[\"你在想什麼?\"],\"7p5kLi\":[\"儀表板\"],\"7vhWI8\":[\"新密碼\"],\"87a/t/\":[\"標籤\"],\"8ZsakT\":[\"密碼\"],\"90Luob\":[[\"count\"],\" 條回覆\"],\"A1taO8\":[\"搜尋\"],\"AeXO77\":[\"帳戶\"],\"AyHO4m\":[\"這個收藏是關於什麼的?\"],\"B373X+\":[\"編輯文章\"],\"B495Gs\":[\"檔案館\"],\"BjF0Jv\":[\"僅限小寫字母、數字和連字符\"],\"D9Oea+\":[\"永久鏈接\"],\"DCKkhU\":[\"當前密碼\"],\"DHhJ7s\":[\"上一頁\"],\"DPfwMq\":[\"完成\"],\"DoJzLz\":[\"收藏夾\"],\"E80cJw\":[\"刪除此媒體將永久從存儲中移除它。\"],\"EEYbdt\":[\"發佈\"],\"EGwzOK\":[\"完成設置\"],\"EkH9pt\":[\"更新\"],\"FGrimz\":[\"新帖子\"],\"FkMol5\":[\"精選\"],\"Fxf4jq\":[\"描述(可選)\"],\"GA5A5H\":[\"刪除收藏夾\"],\"GX2VMa\":[\"建立您的管理員帳戶。\"],\"GbVAnd\":[\"此密碼重設連結無效或已過期。請生成一個新的連結。\"],\"GorKul\":[\"歡迎來到 Jant\"],\"GrZ6fH\":[\"新頁面\"],\"GxkJXS\":[\"上傳中...\"],\"HfyyXl\":[\"My Blog\"],\"HiETwV\":[\"安靜(正常)\"],\"Hzi9AA\":[\"未找到任何帖子。\"],\"I6gXOa\":[\"路徑\"],\"I8hDlV\":[\"至少需要 1 張圖片才能發佈圖片帖子。\"],\"IUwGEM\":[\"保存更改\"],\"IagCbF\":[\"網址\"],\"J4FNfC\":[\"此集合中沒有帖子。\"],\"JIBC/T\":[\"Supported formats: JPEG, PNG, GIF, WebP, SVG. Max size: 10MB.\"],\"Jed1wB\":[\"需要幫助嗎?請訪問<0>文檔</0>。\"],\"JiP4aa\":[\"已發佈的頁面可以通過其路徑訪問。草稿不可見。\"],\"K9NcLu\":[\"使用此 URL 將媒體嵌入到您的帖子中。\"],\"KbS2K9\":[\"重設密碼\"],\"KiJn9B\":[\"備註\"],\"KmGXnO\":[\"Are you sure you want to delete this post? This cannot be undone.\"],\"L85WcV\":[\"縮略名\"],\"LkvLQe\":[\"尚未有頁面。\"],\"M1RvTd\":[\"點擊圖片以查看完整大小\"],\"M8kJqa\":[\"草稿\"],\"M9xgHy\":[\"重定向\"],\"MHrjPM\":[\"標題\"],\"MWBOxm\":[\"收藏(可選)\"],\"MZbQHL\":[\"未找到結果。\"],\"Mhf/H/\":[\"建立重定向\"],\"MqghUt\":[\"搜尋帖子...\"],\"N40H+G\":[\"所有\"],\"O3oNi5\":[\"電子郵件\"],\"OCNZaU\":[\"重定向來源的路徑\"],\"ODiSoW\":[\"尚未有帖子。\"],\"ONWvwQ\":[\"上傳\"],\"Pbm2/N\":[\"創建收藏夾\"],\"QEbNBb\":[\"路徑(例如 /archive)或完整網址(例如 https://example.com)\"],\"RDjuBN\":[\"Setup\"],\"Rj01Fz\":[\"連結\"],\"RwGhWy\":[\"包含 \",[\"count\"],\" 則帖子的主題\"],\"SJmfuf\":[\"網站名稱\"],\"ST+lN2\":[\"尚未上傳任何媒體。\"],\"Tt5T6+\":[\"文章\"],\"TxE+Mj\":[\"1 條回覆\"],\"Tz0i8g\":[\"設定\"],\"U5v6Gh\":[\"編輯頁面\"],\"UDMjsP\":[\"快速操作\"],\"UGT5vp\":[\"保存設定\"],\"UxKoFf\":[\"導航\"],\"VUSy8D\":[\"Search failed. Please try again.\"],\"VhMDMg\":[\"更改密碼\"],\"WDcQq9\":[\"不公開\"],\"Weq9zb\":[\"一般設定\"],\"WmZ/rP\":[\"到路徑\"],\"Y+7JGK\":[\"創建頁面\"],\"Z3FXyt\":[\"載入中...\"],\"ZQKLI1\":[\"危險區域\"],\"ZhhOwV\":[\"引用\"],\"aAIQg2\":[\"外觀\"],\"aaGV/9\":[\"新連結\"],\"an5hVd\":[\"圖片\"],\"b+/jO6\":[\"301(永久)\"],\"bHYIks\":[\"登出\"],\"biOepV\":[\"← Back to home\"],\"cnGeoo\":[\"刪除\"],\"dEgA5A\":[\"取消\"],\"e6Jr7Q\":[\"← 返回收藏夾\"],\"ePK91l\":[\"編輯\"],\"eWLklq\":[\"引用\"],\"eneWvv\":[\"草稿\"],\"er8+x7\":[\"示範帳戶已預填。只需點擊登入。\"],\"f6e0Ry\":[\"文章\"],\"fG7BxZ\":[\"Upload images via the API: POST /api/upload with a file form field.\"],\"fttd2R\":[\"我的收藏\"],\"gDx5MG\":[\"編輯連結\"],\"hG89Ed\":[\"圖片\"],\"hWOZIv\":[\"請輸入您的新密碼。\"],\"hXzOVo\":[\"下一頁\"],\"he3ygx\":[\"複製\"],\"iH8pgl\":[\"返回\"],\"ig4hg2\":[\"Let's set up your site.\"],\"jpctdh\":[\"查看\"],\"k1ifdL\":[\"處理中...\"],\"kd7eBB\":[\"建立連結\"],\"mTOYla\":[\"View all posts →\"],\"n1ekoW\":[\"登入\"],\"oJFOZk\":[\"來源名稱(選填)\"],\"oYPBa0\":[\"更新頁面\"],\"p2/GCq\":[\"確認密碼\"],\"pRhYH2\":[\"收藏中的帖子 (\",[\"count\"],\")\"],\"pZq3aX\":[\"上傳失敗。請再試一次。\"],\"qMyM2u\":[\"來源網址(選填)\"],\"qiXmlF\":[\"添加媒體\"],\"r1MpXi\":[\"安靜\"],\"rFmBG3\":[\"顏色主題\"],\"rdUucN\":[\"預覽\"],\"rzNUSl\":[\"包含 1 則貼文的主題\"],\"sGajR7\":[\"線程開始\"],\"smzF8S\":[\"顯示 \",[\"remainingCount\"],\" 個更多 \",[\"0\"]],\"ssqvZi\":[\"保存個人資料\"],\"t/YqKh\":[\"移除\"],\"tfrt7B\":[\"未配置任何重定向。\"],\"tiq7kl\":[\"頁面 \",[\"page\"]],\"u2f7vd\":[\"網站描述\"],\"u3wRF+\":[\"已發佈\"],\"u6Hp4N\":[\"Markdown\"],\"uAQUqI\":[\"狀態\"],\"vERlcd\":[\"個人資料\"],\"vXIe7J\":[\"語言\"],\"vzU4k9\":[\"新收藏集\"],\"wEF6Ix\":[\"目的地路徑或 URL\"],\"wK4OTM\":[\"標題(選填)\"],\"wM5UXj\":[\"刪除媒體\"],\"wRR604\":[\"頁面\"],\"wdGjkd\":[\"未配置導航連結。\"],\"wja8aL\":[\"無標題\"],\"x+doid\":[\"圖片會自動優化:調整大小至最大 1920 像素,轉換為 WebP 格式,並去除元數據。\"],\"x0mzE0\":[\"創建你的第一篇帖子\"],\"x4RuFo\":[\"Back to home\"],\"xYilR2\":[\"媒體\"],\"y28hnO\":[\"文章\"],\"yQ2kGp\":[\"載入更多\"],\"yjkELF\":[\"確認新密碼\"],\"yzF66j\":[\"連結\"],\"z8ajIE\":[\"找到 1 個結果\"],\"zH6KqE\":[\"找到 \",[\"count\"],\" 個結果\"]}");
|
package/dist/lib/image.js
CHANGED
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
* @example
|
|
61
61
|
* ```ts
|
|
62
62
|
* // Without R2 public URL - uses UUID with extension
|
|
63
|
-
* getMediaUrl("01902a9f-1a2b-7c3d-8e4f-5a6b7c8d9e0f", "
|
|
63
|
+
* getMediaUrl("01902a9f-1a2b-7c3d-8e4f-5a6b7c8d9e0f", "media/2025/01/01902a9f-1a2b-7c3d-8e4f-5a6b7c8d9e0f.webp");
|
|
64
64
|
* // Returns: "/media/01902a9f-1a2b-7c3d-8e4f-5a6b7c8d9e0f.webp"
|
|
65
65
|
*
|
|
66
66
|
* // With R2 public URL - uses direct CDN
|
|
67
|
-
* getMediaUrl("01902a9f-1a2b-7c3d-8e4f-5a6b7c8d9e0f", "
|
|
68
|
-
* // Returns: "https://cdn.example.com/
|
|
67
|
+
* getMediaUrl("01902a9f-1a2b-7c3d-8e4f-5a6b7c8d9e0f", "media/2025/01/01902a9f-1a2b-7c3d-8e4f-5a6b7c8d9e0f.webp", "https://cdn.example.com");
|
|
68
|
+
* // Returns: "https://cdn.example.com/media/2025/01/01902a9f-1a2b-7c3d-8e4f-5a6b7c8d9e0f.webp"
|
|
69
69
|
* ```
|
|
70
70
|
*/ export function getMediaUrl(mediaId, r2Key, r2PublicUrl) {
|
|
71
71
|
if (r2PublicUrl) {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Media Helper Utilities
|
|
3
|
+
*
|
|
4
|
+
* Shared logic for building MediaAttachment maps from raw media data.
|
|
5
|
+
*/ import { getMediaUrl, getImageUrl } from "./image.js";
|
|
6
|
+
/**
|
|
7
|
+
* Builds a map of post IDs to MediaAttachment arrays from raw media data.
|
|
8
|
+
*
|
|
9
|
+
* Transforms raw Media objects (with R2 keys) into MediaAttachment objects
|
|
10
|
+
* (with public URLs and preview URLs) suitable for rendering.
|
|
11
|
+
*
|
|
12
|
+
* @param rawMediaMap - Map of post IDs to raw Media arrays from the media service
|
|
13
|
+
* @param r2PublicUrl - Optional R2 public URL for direct CDN access
|
|
14
|
+
* @param imageTransformUrl - Optional image transformation service URL
|
|
15
|
+
* @returns Map of post IDs to MediaAttachment arrays
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const rawMediaMap = await services.media.getByPostIds(postIds);
|
|
20
|
+
* const mediaMap = buildMediaMap(rawMediaMap, c.env.R2_PUBLIC_URL, c.env.IMAGE_TRANSFORM_URL);
|
|
21
|
+
* ```
|
|
22
|
+
*/ export function buildMediaMap(rawMediaMap, r2PublicUrl, imageTransformUrl) {
|
|
23
|
+
const mediaMap = new Map();
|
|
24
|
+
for (const [postId, mediaList] of rawMediaMap){
|
|
25
|
+
mediaMap.set(postId, mediaList.map((m)=>({
|
|
26
|
+
id: m.id,
|
|
27
|
+
url: getMediaUrl(m.id, m.r2Key, r2PublicUrl),
|
|
28
|
+
previewUrl: getImageUrl(getMediaUrl(m.id, m.r2Key, r2PublicUrl), imageTransformUrl, {
|
|
29
|
+
width: 400,
|
|
30
|
+
quality: 80,
|
|
31
|
+
format: "auto",
|
|
32
|
+
fit: "cover"
|
|
33
|
+
}),
|
|
34
|
+
alt: m.alt,
|
|
35
|
+
blurhash: m.blurhash,
|
|
36
|
+
width: m.width,
|
|
37
|
+
height: m.height,
|
|
38
|
+
position: m.position,
|
|
39
|
+
mimeType: m.mimeType
|
|
40
|
+
})));
|
|
41
|
+
}
|
|
42
|
+
return mediaMap;
|
|
43
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigation Link Reorder
|
|
3
|
+
*
|
|
4
|
+
* Initializes SortableJS on the navigation links list in the dashboard.
|
|
5
|
+
* Auto-detects the list element and only activates when present.
|
|
6
|
+
*/ import Sortable from "sortablejs";
|
|
7
|
+
const list = document.getElementById("nav-links-list");
|
|
8
|
+
if (list) {
|
|
9
|
+
Sortable.create(list, {
|
|
10
|
+
animation: 150,
|
|
11
|
+
handle: "[data-id]",
|
|
12
|
+
onEnd () {
|
|
13
|
+
const ids = [
|
|
14
|
+
...list.querySelectorAll("[data-id]")
|
|
15
|
+
].map((el)=>Number(el.dataset.id));
|
|
16
|
+
fetch("/dash/navigation/reorder", {
|
|
17
|
+
method: "POST",
|
|
18
|
+
headers: {
|
|
19
|
+
"Content-Type": "application/json"
|
|
20
|
+
},
|
|
21
|
+
body: JSON.stringify({
|
|
22
|
+
ids
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigation Helper
|
|
3
|
+
*
|
|
4
|
+
* Provides shared data fetching for public page navigation.
|
|
5
|
+
*/ import { getSiteName } from "./config.js";
|
|
6
|
+
/**
|
|
7
|
+
* Fetch navigation data for public pages.
|
|
8
|
+
*
|
|
9
|
+
* Ensures default links exist (Home, Archive, RSS) and returns
|
|
10
|
+
* the current path and site name alongside the links.
|
|
11
|
+
*
|
|
12
|
+
* @param c - Hono context
|
|
13
|
+
* @returns Navigation data for SiteLayout
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const navData = await getNavigationData(c);
|
|
18
|
+
* return c.html(
|
|
19
|
+
* <BaseLayout c={c}>
|
|
20
|
+
* <SiteLayout {...navData}>
|
|
21
|
+
* <MyContent />
|
|
22
|
+
* </SiteLayout>
|
|
23
|
+
* </BaseLayout>
|
|
24
|
+
* );
|
|
25
|
+
* ```
|
|
26
|
+
*/ export async function getNavigationData(c) {
|
|
27
|
+
const navigationLinks = await c.var.services.navigationLinks.ensureDefaults();
|
|
28
|
+
const currentPath = new URL(c.req.url).pathname;
|
|
29
|
+
const siteName = await getSiteName(c);
|
|
30
|
+
return {
|
|
31
|
+
navigationLinks,
|
|
32
|
+
currentPath,
|
|
33
|
+
siteName
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme Component Resolution
|
|
3
|
+
*
|
|
4
|
+
* Resolves theme-overridable components, falling back to defaults.
|
|
5
|
+
*/ const THEME_KEY_MAP = {
|
|
6
|
+
note: "NoteCard",
|
|
7
|
+
article: "ArticleCard",
|
|
8
|
+
link: "LinkCard",
|
|
9
|
+
quote: "QuoteCard",
|
|
10
|
+
image: "ImageCard",
|
|
11
|
+
page: "NoteCard"
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the card component for a given post type.
|
|
15
|
+
*
|
|
16
|
+
* Checks theme overrides first, then falls back to the provided default card component.
|
|
17
|
+
*
|
|
18
|
+
* @param type - The post type to resolve a card for
|
|
19
|
+
* @param defaults - Map of post type to default card component
|
|
20
|
+
* @param themeComponents - Optional theme component overrides
|
|
21
|
+
* @returns The resolved card component
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const Card = resolveCardComponent("article", DEFAULT_CARD_MAP, c.var.config.theme?.components);
|
|
26
|
+
* ```
|
|
27
|
+
*/ export function resolveCardComponent(type, defaults, themeComponents) {
|
|
28
|
+
const key = THEME_KEY_MAP[type];
|
|
29
|
+
const override = themeComponents?.[key];
|
|
30
|
+
return override ?? defaults[type];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Resolves the ThreadPreview component.
|
|
34
|
+
*
|
|
35
|
+
* @param defaultComponent - The default ThreadPreview component
|
|
36
|
+
* @param themeComponents - Optional theme component overrides
|
|
37
|
+
* @returns The resolved ThreadPreview component
|
|
38
|
+
*/ export function resolveThreadPreview(defaultComponent, themeComponents) {
|
|
39
|
+
return themeComponents?.ThreadPreview ?? defaultComponent;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Resolves the TimelineFeed component.
|
|
43
|
+
*
|
|
44
|
+
* @param defaultComponent - The default TimelineFeed component
|
|
45
|
+
* @param themeComponents - Optional theme component overrides
|
|
46
|
+
* @returns The resolved TimelineFeed component
|
|
47
|
+
*/ export function resolveTimelineFeed(defaultComponent, themeComponents) {
|
|
48
|
+
return themeComponents?.TimelineFeed ?? defaultComponent;
|
|
49
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { jsx as _jsx } from "hono/jsx/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Timeline API Routes
|
|
4
|
+
*
|
|
5
|
+
* Provides load-more functionality for the timeline feed via SSE.
|
|
6
|
+
*/ import { Hono } from "hono";
|
|
7
|
+
import { sse } from "../../lib/sse.js";
|
|
8
|
+
import { buildMediaMap } from "../../lib/media-helpers.js";
|
|
9
|
+
import { TimelineItem } from "../../theme/components/timeline/TimelineItem.js";
|
|
10
|
+
import { ThreadPreview } from "../../theme/components/timeline/ThreadPreview.js";
|
|
11
|
+
const PAGE_SIZE = 20;
|
|
12
|
+
export const timelineApiRoutes = new Hono();
|
|
13
|
+
timelineApiRoutes.get("/", async (c)=>{
|
|
14
|
+
const cursorParam = c.req.query("cursor");
|
|
15
|
+
const cursor = cursorParam ? parseInt(cursorParam, 10) : undefined;
|
|
16
|
+
if (!cursor || isNaN(cursor)) {
|
|
17
|
+
return c.json({
|
|
18
|
+
error: "cursor parameter required"
|
|
19
|
+
}, 400);
|
|
20
|
+
}
|
|
21
|
+
// Fetch one extra to determine if there are more
|
|
22
|
+
const posts = await c.var.services.posts.list({
|
|
23
|
+
visibility: [
|
|
24
|
+
"featured",
|
|
25
|
+
"quiet"
|
|
26
|
+
],
|
|
27
|
+
excludeReplies: true,
|
|
28
|
+
excludeTypes: [
|
|
29
|
+
"page"
|
|
30
|
+
],
|
|
31
|
+
limit: PAGE_SIZE + 1,
|
|
32
|
+
cursor
|
|
33
|
+
});
|
|
34
|
+
const hasMore = posts.length > PAGE_SIZE;
|
|
35
|
+
const displayPosts = hasMore ? posts.slice(0, PAGE_SIZE) : posts;
|
|
36
|
+
if (displayPosts.length === 0) {
|
|
37
|
+
return sse(c, async (stream)=>{
|
|
38
|
+
stream.remove("#load-more-container");
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
// Build media map
|
|
42
|
+
const postIds = displayPosts.map((p)=>p.id);
|
|
43
|
+
const rawMediaMap = await c.var.services.media.getByPostIds(postIds);
|
|
44
|
+
const r2PublicUrl = c.env.R2_PUBLIC_URL;
|
|
45
|
+
const imageTransformUrl = c.env.IMAGE_TRANSFORM_URL;
|
|
46
|
+
const mediaMap = buildMediaMap(rawMediaMap, r2PublicUrl, imageTransformUrl);
|
|
47
|
+
// Get reply counts to identify thread roots
|
|
48
|
+
const replyCounts = await c.var.services.posts.getReplyCounts(postIds);
|
|
49
|
+
const threadRootIds = postIds.filter((id)=>(replyCounts.get(id) ?? 0) > 0);
|
|
50
|
+
// Get thread previews
|
|
51
|
+
const threadPreviews = await c.var.services.posts.getThreadPreviews(threadRootIds, 3);
|
|
52
|
+
// Load media for preview replies
|
|
53
|
+
const previewReplyIds = [];
|
|
54
|
+
for (const replies of threadPreviews.values()){
|
|
55
|
+
for (const reply of replies){
|
|
56
|
+
previewReplyIds.push(reply.id);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const previewMediaMap = previewReplyIds.length > 0 ? buildMediaMap(await c.var.services.media.getByPostIds(previewReplyIds), r2PublicUrl, imageTransformUrl) : new Map();
|
|
60
|
+
// Assemble timeline items
|
|
61
|
+
const items = displayPosts.map((post)=>{
|
|
62
|
+
const postWithMedia = {
|
|
63
|
+
...post,
|
|
64
|
+
mediaAttachments: mediaMap.get(post.id) ?? []
|
|
65
|
+
};
|
|
66
|
+
const replyCount = replyCounts.get(post.id) ?? 0;
|
|
67
|
+
const previewReplies = threadPreviews.get(post.id);
|
|
68
|
+
if (replyCount > 0 && previewReplies) {
|
|
69
|
+
return {
|
|
70
|
+
post: postWithMedia,
|
|
71
|
+
threadPreview: {
|
|
72
|
+
replies: previewReplies.map((r)=>({
|
|
73
|
+
...r,
|
|
74
|
+
mediaAttachments: previewMediaMap.get(r.id) ?? []
|
|
75
|
+
})),
|
|
76
|
+
totalReplyCount: replyCount
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
post: postWithMedia
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
// Render items to HTML
|
|
85
|
+
const itemsHtml = items.map((item)=>{
|
|
86
|
+
if (item.threadPreview) {
|
|
87
|
+
return /*#__PURE__*/ _jsx(ThreadPreview, {
|
|
88
|
+
rootPost: item.post,
|
|
89
|
+
previewReplies: item.threadPreview.replies,
|
|
90
|
+
totalReplyCount: item.threadPreview.totalReplyCount
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return /*#__PURE__*/ _jsx(TimelineItem, {
|
|
94
|
+
item: item
|
|
95
|
+
});
|
|
96
|
+
}).map((jsx)=>jsx.toString()).join("");
|
|
97
|
+
// Determine next cursor
|
|
98
|
+
const lastPost = displayPosts[displayPosts.length - 1];
|
|
99
|
+
const nextCursor = hasMore && lastPost ? lastPost.id : undefined;
|
|
100
|
+
// Build load-more button HTML
|
|
101
|
+
const loadMoreHtml = nextCursor ? `<div id="load-more-container" class="mt-6 text-center"><button class="btn btn-outline" data-on:click="@get('/api/timeline?cursor=${nextCursor}')">Load more</button></div>` : "";
|
|
102
|
+
return sse(c, async (stream)=>{
|
|
103
|
+
// Append new items to the feed
|
|
104
|
+
stream.patchElements(itemsHtml, {
|
|
105
|
+
mode: "append",
|
|
106
|
+
selector: "#timeline-feed"
|
|
107
|
+
});
|
|
108
|
+
// Replace or remove the load-more container
|
|
109
|
+
if (loadMoreHtml) {
|
|
110
|
+
stream.patchElements(loadMoreHtml);
|
|
111
|
+
} else {
|
|
112
|
+
stream.remove("#load-more-container");
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Supports both JSON and SSE (Datastar) responses.
|
|
6
6
|
*/ import { Hono } from "hono";
|
|
7
7
|
import { html } from "hono/html";
|
|
8
|
+
import { uuidv7 } from "uuidv7";
|
|
8
9
|
import { requireAuthApi } from "../../middleware/auth.js";
|
|
9
10
|
import { getMediaUrl, getImageUrl } from "../../lib/image.js";
|
|
10
11
|
import { sse, dsSignals } from "../../lib/sse.js";
|
|
@@ -138,12 +139,14 @@ uploadApiRoutes.post("/", async (c)=>{
|
|
|
138
139
|
error: "File too large (max 10MB)"
|
|
139
140
|
}, 400);
|
|
140
141
|
}
|
|
141
|
-
// Generate unique filename
|
|
142
|
+
// Generate unique filename using UUIDv7
|
|
142
143
|
const ext = file.name.split(".").pop() || "bin";
|
|
143
|
-
const
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
const
|
|
144
|
+
const id = uuidv7();
|
|
145
|
+
const date = new Date();
|
|
146
|
+
const year = date.getUTCFullYear();
|
|
147
|
+
const month = String(date.getUTCMonth() + 1).padStart(2, "0");
|
|
148
|
+
const filename = `${id}.${ext}`;
|
|
149
|
+
const r2Key = `media/${year}/${month}/${filename}`;
|
|
147
150
|
try {
|
|
148
151
|
// Upload to R2
|
|
149
152
|
await c.env.R2.put(r2Key, file.stream(), {
|
|
@@ -153,6 +156,7 @@ uploadApiRoutes.post("/", async (c)=>{
|
|
|
153
156
|
});
|
|
154
157
|
// Save to database
|
|
155
158
|
const media = await c.var.services.media.create({
|
|
159
|
+
id,
|
|
156
160
|
filename,
|
|
157
161
|
originalName: file.name,
|
|
158
162
|
mimeType: file.type,
|