@jant/core 0.3.21 → 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 +23 -4
- package/dist/index.js +11 -4
- package/dist/lib/feed.js +112 -0
- package/dist/lib/navigation.js +9 -9
- package/dist/lib/render.js +48 -0
- package/dist/lib/theme-components.js +18 -18
- package/dist/lib/view.js +228 -0
- package/dist/routes/api/timeline.js +22 -18
- package/dist/routes/feed/rss.js +34 -78
- package/dist/routes/feed/sitemap.js +11 -26
- package/dist/routes/pages/archive.js +18 -195
- package/dist/routes/pages/collection.js +16 -70
- package/dist/routes/pages/home.js +25 -47
- package/dist/routes/pages/page.js +15 -27
- package/dist/routes/pages/post.js +25 -79
- package/dist/routes/pages/search.js +20 -130
- package/dist/theme/components/MediaGallery.js +10 -10
- package/dist/theme/components/index.js +0 -2
- package/dist/theme/index.js +10 -13
- 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/themes/minimal/pages/ArchivePage.js +156 -0
- package/dist/themes/minimal/pages/CollectionPage.js +65 -0
- package/dist/themes/minimal/pages/HomePage.js +25 -0
- package/dist/themes/minimal/pages/PostPage.js +47 -0
- package/dist/themes/minimal/pages/SearchPage.js +121 -0
- package/dist/themes/minimal/pages/SinglePage.js +22 -0
- package/dist/themes/minimal/timeline/ArticleCard.js +36 -0
- package/dist/themes/minimal/timeline/ImageCard.js +67 -0
- package/dist/themes/minimal/timeline/LinkCard.js +47 -0
- package/dist/themes/minimal/timeline/NoteCard.js +34 -0
- package/dist/{theme/components → themes/minimal}/timeline/QuoteCard.js +9 -12
- package/dist/themes/minimal/timeline/ThreadPreview.js +46 -0
- package/dist/themes/minimal/timeline/TimelineFeed.js +48 -0
- package/dist/themes/minimal/timeline/TimelineItem.js +44 -0
- package/package.json +2 -1
- package/src/app.tsx +27 -4
- package/src/i18n/locales/en.po +53 -53
- package/src/i18n/locales/zh-Hans.po +53 -53
- package/src/i18n/locales/zh-Hant.po +53 -53
- package/src/index.ts +54 -6
- package/src/lib/__tests__/theme-components.test.ts +33 -14
- package/src/lib/__tests__/view.test.ts +377 -0
- package/src/lib/feed.ts +148 -0
- package/src/lib/navigation.ts +11 -11
- package/src/lib/render.tsx +67 -0
- package/src/lib/theme-components.ts +27 -35
- package/src/lib/view.ts +318 -0
- package/src/routes/api/__tests__/timeline.test.ts +3 -3
- package/src/routes/api/timeline.tsx +34 -27
- package/src/routes/feed/rss.ts +47 -94
- package/src/routes/feed/sitemap.ts +8 -30
- package/src/routes/pages/archive.tsx +24 -209
- package/src/routes/pages/collection.tsx +19 -75
- package/src/routes/pages/home.tsx +42 -76
- package/src/routes/pages/page.tsx +17 -28
- package/src/routes/pages/post.tsx +28 -86
- package/src/routes/pages/search.tsx +29 -151
- package/src/services/search.ts +2 -8
- package/src/styles/components.css +0 -54
- package/src/theme/components/MediaGallery.tsx +12 -12
- package/src/theme/components/index.ts +0 -12
- package/src/theme/index.ts +11 -13
- package/src/theme/layouts/index.ts +1 -1
- package/src/themes/minimal/MinimalSiteLayout.tsx +100 -0
- package/src/themes/minimal/index.ts +83 -0
- package/src/themes/minimal/pages/ArchivePage.tsx +157 -0
- package/src/themes/minimal/pages/CollectionPage.tsx +60 -0
- package/src/themes/minimal/pages/HomePage.tsx +41 -0
- package/src/themes/minimal/pages/PostPage.tsx +43 -0
- package/src/themes/minimal/pages/SearchPage.tsx +122 -0
- package/src/themes/minimal/pages/SinglePage.tsx +23 -0
- 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/themes/minimal/timeline/NoteCard.tsx +35 -0
- package/src/{theme/components → themes/minimal}/timeline/QuoteCard.tsx +11 -17
- package/src/themes/minimal/timeline/ThreadPreview.tsx +47 -0
- package/src/{theme/components → themes/minimal}/timeline/TimelineFeed.tsx +20 -15
- package/src/themes/minimal/timeline/TimelineItem.tsx +75 -0
- package/src/types.ts +262 -38
- package/dist/theme/components/timeline/ArticleCard.js +0 -50
- package/dist/theme/components/timeline/ImageCard.js +0 -86
- package/dist/theme/components/timeline/LinkCard.js +0 -62
- package/dist/theme/components/timeline/NoteCard.js +0 -37
- package/dist/theme/components/timeline/ThreadPreview.js +0 -52
- package/dist/theme/components/timeline/TimelineFeed.js +0 -43
- package/dist/theme/components/timeline/TimelineItem.js +0 -25
- package/dist/theme/components/timeline/index.js +0 -8
- package/dist/theme/layouts/SiteLayout.js +0 -160
- package/src/theme/components/timeline/ArticleCard.tsx +0 -57
- package/src/theme/components/timeline/ImageCard.tsx +0 -80
- package/src/theme/components/timeline/LinkCard.tsx +0 -66
- package/src/theme/components/timeline/NoteCard.tsx +0 -41
- package/src/theme/components/timeline/ThreadPreview.tsx +0 -49
- package/src/theme/components/timeline/TimelineItem.tsx +0 -39
- package/src/theme/components/timeline/index.ts +0 -8
- package/src/theme/layouts/SiteLayout.tsx +0 -184
|
@@ -14,9 +14,9 @@ msgstr ""
|
|
|
14
14
|
"Plural-Forms: \n"
|
|
15
15
|
|
|
16
16
|
#. @context: Archive post reply indicator - plural
|
|
17
|
-
#: src/
|
|
18
|
-
msgid "{count} replies"
|
|
19
|
-
msgstr "{count} 條回覆"
|
|
17
|
+
#: src/theme/pages/ArchivePage.tsx:168
|
|
18
|
+
#~ msgid "{count} replies"
|
|
19
|
+
#~ msgstr "{count} 條回覆"
|
|
20
20
|
|
|
21
21
|
#. @context: Navigation link
|
|
22
22
|
#: src/routes/dash/collections.tsx:282
|
|
@@ -24,9 +24,9 @@ msgid "← Back to Collections"
|
|
|
24
24
|
msgstr "← 返回收藏夾"
|
|
25
25
|
|
|
26
26
|
#. @context: Archive post reply indicator - single
|
|
27
|
-
#: src/
|
|
28
|
-
msgid "1 reply"
|
|
29
|
-
msgstr "1 條回覆"
|
|
27
|
+
#: src/theme/pages/ArchivePage.tsx:163
|
|
28
|
+
#~ msgid "1 reply"
|
|
29
|
+
#~ msgstr "1 條回覆"
|
|
30
30
|
|
|
31
31
|
#. @context: Redirect type option
|
|
32
32
|
#: src/routes/dash/redirects.tsx:146
|
|
@@ -49,7 +49,7 @@ msgid "Add Media"
|
|
|
49
49
|
msgstr "添加媒體"
|
|
50
50
|
|
|
51
51
|
#. @context: Archive filter - all types
|
|
52
|
-
#: src/
|
|
52
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:90
|
|
53
53
|
msgid "All"
|
|
54
54
|
msgstr "所有"
|
|
55
55
|
|
|
@@ -59,7 +59,7 @@ msgid "Appearance"
|
|
|
59
59
|
msgstr "外觀"
|
|
60
60
|
|
|
61
61
|
#. @context: Archive page title
|
|
62
|
-
#: src/
|
|
62
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:76
|
|
63
63
|
msgid "Archive"
|
|
64
64
|
msgstr "檔案館"
|
|
65
65
|
|
|
@@ -71,14 +71,14 @@ msgstr ""
|
|
|
71
71
|
#. @context: Post type badge - article
|
|
72
72
|
#. @context: Post type label - article
|
|
73
73
|
#. @context: Post type option
|
|
74
|
-
#: src/routes/pages/archive.tsx:28
|
|
75
74
|
#: src/theme/components/PostForm.tsx:74
|
|
76
75
|
#: src/theme/components/TypeBadge.tsx:20
|
|
76
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:17
|
|
77
77
|
msgid "Article"
|
|
78
78
|
msgstr "文章"
|
|
79
79
|
|
|
80
80
|
#. @context: Post type label plural - articles
|
|
81
|
-
#: src/
|
|
81
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:42
|
|
82
82
|
msgid "Articles"
|
|
83
83
|
msgstr "文章"
|
|
84
84
|
|
|
@@ -137,7 +137,7 @@ msgid "Color theme"
|
|
|
137
137
|
msgstr "顏色主題"
|
|
138
138
|
|
|
139
139
|
#. @context: Setup form submit button
|
|
140
|
-
#: src/app.tsx:
|
|
140
|
+
#: src/app.tsx:277
|
|
141
141
|
msgid "Complete Setup"
|
|
142
142
|
msgstr "完成設置"
|
|
143
143
|
|
|
@@ -147,7 +147,7 @@ msgid "Confirm New Password"
|
|
|
147
147
|
msgstr "確認新密碼"
|
|
148
148
|
|
|
149
149
|
#. @context: Password reset form field
|
|
150
|
-
#: src/app.tsx:
|
|
150
|
+
#: src/app.tsx:538
|
|
151
151
|
msgid "Confirm Password"
|
|
152
152
|
msgstr "確認密碼"
|
|
153
153
|
|
|
@@ -186,7 +186,7 @@ msgid "Create Redirect"
|
|
|
186
186
|
msgstr "建立重定向"
|
|
187
187
|
|
|
188
188
|
#. @context: Setup page description
|
|
189
|
-
#: src/app.tsx:
|
|
189
|
+
#: src/app.tsx:217
|
|
190
190
|
msgid "Create your admin account."
|
|
191
191
|
msgstr "建立您的管理員帳戶。"
|
|
192
192
|
|
|
@@ -252,7 +252,7 @@ msgid "Deleting this media will remove it permanently from storage."
|
|
|
252
252
|
msgstr "刪除此媒體將永久從存儲中移除它。"
|
|
253
253
|
|
|
254
254
|
#. @context: Hint shown on signin page when demo credentials are pre-filled
|
|
255
|
-
#: src/app.tsx:
|
|
255
|
+
#: src/app.tsx:376
|
|
256
256
|
msgid "Demo account pre-filled. Just click Sign In."
|
|
257
257
|
msgstr "示範帳戶已預填。只需點擊登入。"
|
|
258
258
|
|
|
@@ -333,13 +333,13 @@ msgstr "編輯文章"
|
|
|
333
333
|
|
|
334
334
|
#. @context: Setup/signin form field - email
|
|
335
335
|
#. @context: Setup/signin form field - email
|
|
336
|
-
#: src/app.tsx:
|
|
337
|
-
#: src/app.tsx:
|
|
336
|
+
#: src/app.tsx:247
|
|
337
|
+
#: src/app.tsx:391
|
|
338
338
|
msgid "Email"
|
|
339
339
|
msgstr "電子郵件"
|
|
340
340
|
|
|
341
341
|
#. @context: Password reset page description
|
|
342
|
-
#: src/app.tsx:
|
|
342
|
+
#: src/app.tsx:507
|
|
343
343
|
msgid "Enter your new password."
|
|
344
344
|
msgstr "請輸入您的新密碼。"
|
|
345
345
|
|
|
@@ -351,12 +351,12 @@ msgid "Featured"
|
|
|
351
351
|
msgstr "精選"
|
|
352
352
|
|
|
353
353
|
#. @context: Search results count - multiple
|
|
354
|
-
#: src/
|
|
354
|
+
#: src/themes/minimal/pages/SearchPage.tsx:73
|
|
355
355
|
msgid "Found {count} results"
|
|
356
356
|
msgstr "找到 {count} 個結果"
|
|
357
357
|
|
|
358
358
|
#. @context: Search results count - single
|
|
359
|
-
#: src/
|
|
359
|
+
#: src/themes/minimal/pages/SearchPage.tsx:69
|
|
360
360
|
msgid "Found 1 result"
|
|
361
361
|
msgstr "找到 1 個結果"
|
|
362
362
|
|
|
@@ -375,14 +375,14 @@ msgstr "一般設定"
|
|
|
375
375
|
#. @context: Post type badge - image
|
|
376
376
|
#. @context: Post type label - image
|
|
377
377
|
#. @context: Post type option
|
|
378
|
-
#: src/routes/pages/archive.tsx:37
|
|
379
378
|
#: src/theme/components/PostForm.tsx:83
|
|
380
379
|
#: src/theme/components/TypeBadge.tsx:29
|
|
380
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:26
|
|
381
381
|
msgid "Image"
|
|
382
382
|
msgstr "圖片"
|
|
383
383
|
|
|
384
384
|
#. @context: Post type label plural - images
|
|
385
|
-
#: src/
|
|
385
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:54
|
|
386
386
|
msgid "Images"
|
|
387
387
|
msgstr "圖片"
|
|
388
388
|
|
|
@@ -392,7 +392,7 @@ msgid "Images are automatically optimized: resized to max 1920px, converted to W
|
|
|
392
392
|
msgstr "圖片會自動優化:調整大小至最大 1920 像素,轉換為 WebP 格式,並去除元數據。"
|
|
393
393
|
|
|
394
394
|
#. @context: Password reset error heading
|
|
395
|
-
#: src/app.tsx:
|
|
395
|
+
#: src/app.tsx:582
|
|
396
396
|
msgid "Invalid or Expired Link"
|
|
397
397
|
msgstr "無效或已過期的連結"
|
|
398
398
|
|
|
@@ -409,21 +409,21 @@ msgstr "語言"
|
|
|
409
409
|
#. @context: Post type badge - link
|
|
410
410
|
#. @context: Post type label - link
|
|
411
411
|
#. @context: Post type option
|
|
412
|
-
#: src/routes/pages/archive.tsx:32
|
|
413
412
|
#: src/theme/components/PostForm.tsx:77
|
|
414
413
|
#: src/theme/components/TypeBadge.tsx:24
|
|
414
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:21
|
|
415
415
|
msgid "Link"
|
|
416
416
|
msgstr "連結"
|
|
417
417
|
|
|
418
418
|
#. @context: Post type label plural - links
|
|
419
|
-
#: src/
|
|
419
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:46
|
|
420
420
|
msgid "Links"
|
|
421
421
|
msgstr "連結"
|
|
422
422
|
|
|
423
423
|
#. @context: Button to load more posts in timeline
|
|
424
424
|
#. @context: Pagination button - load more items
|
|
425
425
|
#: src/theme/components/Pagination.tsx:103
|
|
426
|
-
#: src/
|
|
426
|
+
#: src/themes/minimal/timeline/TimelineFeed.tsx:48
|
|
427
427
|
msgid "Load more"
|
|
428
428
|
msgstr "載入更多"
|
|
429
429
|
|
|
@@ -500,7 +500,7 @@ msgstr "新頁面"
|
|
|
500
500
|
|
|
501
501
|
#. @context: Password form field
|
|
502
502
|
#. @context: Password reset form field
|
|
503
|
-
#: src/app.tsx:
|
|
503
|
+
#: src/app.tsx:522
|
|
504
504
|
#: src/routes/dash/settings.tsx:442
|
|
505
505
|
msgid "New Password"
|
|
506
506
|
msgstr "新密碼"
|
|
@@ -551,21 +551,21 @@ msgid "No pages yet."
|
|
|
551
551
|
msgstr "尚未有頁面。"
|
|
552
552
|
|
|
553
553
|
#. @context: Archive empty state
|
|
554
|
-
#: src/
|
|
554
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:110
|
|
555
555
|
msgid "No posts found."
|
|
556
556
|
msgstr "未找到任何帖子。"
|
|
557
557
|
|
|
558
558
|
#. @context: Empty state message
|
|
559
559
|
#. @context: Empty state message
|
|
560
560
|
#: src/routes/dash/collections.tsx:243
|
|
561
|
-
#: src/
|
|
561
|
+
#: src/themes/minimal/pages/CollectionPage.tsx:29
|
|
562
562
|
msgid "No posts in this collection."
|
|
563
563
|
msgstr "此集合中沒有帖子。"
|
|
564
564
|
|
|
565
565
|
#. @context: Empty state message on home page
|
|
566
566
|
#. @context: Empty state message when no posts exist
|
|
567
|
-
#: src/routes/pages/home.tsx:42
|
|
568
567
|
#: src/theme/components/PostList.tsx:25
|
|
568
|
+
#: src/themes/minimal/pages/HomePage.tsx:26
|
|
569
569
|
msgid "No posts yet."
|
|
570
570
|
msgstr "尚未有帖子。"
|
|
571
571
|
|
|
@@ -575,21 +575,21 @@ msgid "No redirects configured."
|
|
|
575
575
|
msgstr "未配置任何重定向。"
|
|
576
576
|
|
|
577
577
|
#. @context: Search empty results
|
|
578
|
-
#: src/
|
|
578
|
+
#: src/themes/minimal/pages/SearchPage.tsx:64
|
|
579
579
|
msgid "No results found."
|
|
580
580
|
msgstr "未找到結果。"
|
|
581
581
|
|
|
582
582
|
#. @context: Post type badge - note
|
|
583
583
|
#. @context: Post type label - note
|
|
584
584
|
#. @context: Post type option
|
|
585
|
-
#: src/routes/pages/archive.tsx:27
|
|
586
585
|
#: src/theme/components/PostForm.tsx:71
|
|
587
586
|
#: src/theme/components/TypeBadge.tsx:19
|
|
587
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:16
|
|
588
588
|
msgid "Note"
|
|
589
589
|
msgstr "備註"
|
|
590
590
|
|
|
591
591
|
#. @context: Post type label plural - notes
|
|
592
|
-
#: src/
|
|
592
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:38
|
|
593
593
|
msgid "Notes"
|
|
594
594
|
msgstr "筆記"
|
|
595
595
|
|
|
@@ -597,8 +597,8 @@ msgstr "筆記"
|
|
|
597
597
|
#. @context: Post type badge - page
|
|
598
598
|
#. @context: Post type label - page
|
|
599
599
|
#: src/routes/dash/pages.tsx:125
|
|
600
|
-
#: src/routes/pages/archive.tsx:41
|
|
601
600
|
#: src/theme/components/TypeBadge.tsx:33
|
|
601
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:30
|
|
602
602
|
msgid "Page"
|
|
603
603
|
msgstr "頁面"
|
|
604
604
|
|
|
@@ -621,15 +621,15 @@ msgstr "頁面標題..."
|
|
|
621
621
|
#. @context: Pages main heading
|
|
622
622
|
#. @context: Post type label plural - pages
|
|
623
623
|
#: src/routes/dash/pages.tsx:36
|
|
624
|
-
#: src/routes/pages/archive.tsx:69
|
|
625
624
|
#: src/theme/layouts/DashLayout.tsx:96
|
|
625
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:58
|
|
626
626
|
msgid "Pages"
|
|
627
627
|
msgstr "頁面"
|
|
628
628
|
|
|
629
629
|
#. @context: Setup/signin form field - password
|
|
630
630
|
#. @context: Setup/signin form field - password
|
|
631
|
-
#: src/app.tsx:
|
|
632
|
-
#: src/app.tsx:
|
|
631
|
+
#: src/app.tsx:262
|
|
632
|
+
#: src/app.tsx:400
|
|
633
633
|
msgid "Password"
|
|
634
634
|
msgstr "密碼"
|
|
635
635
|
|
|
@@ -645,8 +645,8 @@ msgstr "路徑(例如 /archive)或完整網址(例如 https://example.com
|
|
|
645
645
|
|
|
646
646
|
#. @context: Link to individual post in thread
|
|
647
647
|
#. @context: Link to permanent URL of post
|
|
648
|
-
#: src/routes/pages/post.tsx:56
|
|
649
648
|
#: src/theme/components/ThreadView.tsx:68
|
|
649
|
+
#: src/themes/minimal/pages/PostPage.tsx:35
|
|
650
650
|
msgid "Permalink"
|
|
651
651
|
msgstr "永久鏈接"
|
|
652
652
|
|
|
@@ -697,9 +697,9 @@ msgstr "上一頁"
|
|
|
697
697
|
#. @context: Loading text shown on submit button while request is in progress
|
|
698
698
|
#. @context: Loading text shown on submit button while request is in progress
|
|
699
699
|
#. @context: Upload status - processing
|
|
700
|
-
#: src/app.tsx:
|
|
701
|
-
#: src/app.tsx:
|
|
702
|
-
#: src/app.tsx:
|
|
700
|
+
#: src/app.tsx:283
|
|
701
|
+
#: src/app.tsx:420
|
|
702
|
+
#: src/app.tsx:560
|
|
703
703
|
#: src/routes/dash/collections.tsx:178
|
|
704
704
|
#: src/routes/dash/collections.tsx:357
|
|
705
705
|
#: src/routes/dash/media.tsx:119
|
|
@@ -753,14 +753,14 @@ msgstr "安靜(正常)"
|
|
|
753
753
|
#. @context: Post type badge - quote
|
|
754
754
|
#. @context: Post type label - quote
|
|
755
755
|
#. @context: Post type option
|
|
756
|
-
#: src/routes/pages/archive.tsx:33
|
|
757
756
|
#: src/theme/components/PostForm.tsx:80
|
|
758
757
|
#: src/theme/components/TypeBadge.tsx:25
|
|
758
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:22
|
|
759
759
|
msgid "Quote"
|
|
760
760
|
msgstr "引用"
|
|
761
761
|
|
|
762
762
|
#. @context: Post type label plural - quotes
|
|
763
|
-
#: src/
|
|
763
|
+
#: src/themes/minimal/pages/ArchivePage.tsx:50
|
|
764
764
|
msgid "Quotes"
|
|
765
765
|
msgstr "引用"
|
|
766
766
|
|
|
@@ -780,8 +780,8 @@ msgstr "移除"
|
|
|
780
780
|
|
|
781
781
|
#. @context: Password reset form submit button
|
|
782
782
|
#. @context: Password reset page heading
|
|
783
|
-
#: src/app.tsx:
|
|
784
|
-
#: src/app.tsx:
|
|
783
|
+
#: src/app.tsx:501
|
|
784
|
+
#: src/app.tsx:554
|
|
785
785
|
msgid "Reset Password"
|
|
786
786
|
msgstr "重設密碼"
|
|
787
787
|
|
|
@@ -802,13 +802,13 @@ msgstr "保存設定"
|
|
|
802
802
|
|
|
803
803
|
#. @context: Search page title
|
|
804
804
|
#. @context: Search submit button
|
|
805
|
-
#: src/
|
|
806
|
-
#: src/
|
|
805
|
+
#: src/themes/minimal/pages/SearchPage.tsx:21
|
|
806
|
+
#: src/themes/minimal/pages/SearchPage.tsx:46
|
|
807
807
|
msgid "Search"
|
|
808
808
|
msgstr "搜尋"
|
|
809
809
|
|
|
810
810
|
#. @context: Search input placeholder
|
|
811
|
-
#: src/
|
|
811
|
+
#: src/themes/minimal/pages/SearchPage.tsx:38
|
|
812
812
|
msgid "Search posts..."
|
|
813
813
|
msgstr "搜尋帖子..."
|
|
814
814
|
|
|
@@ -830,14 +830,14 @@ msgstr "設定"
|
|
|
830
830
|
|
|
831
831
|
#. @context: Link to show remaining thread replies
|
|
832
832
|
#. placeholder {0}: remainingCount === 1 ? "reply" : "replies"
|
|
833
|
-
#: src/
|
|
833
|
+
#: src/themes/minimal/timeline/ThreadPreview.tsx:37
|
|
834
834
|
msgid "Show {remainingCount} more {0}"
|
|
835
835
|
msgstr "顯示 {remainingCount} 個更多 {0}"
|
|
836
836
|
|
|
837
837
|
#. @context: Sign in form submit button
|
|
838
838
|
#. @context: Sign in page heading
|
|
839
|
-
#: src/app.tsx:
|
|
840
|
-
#: src/app.tsx:
|
|
839
|
+
#: src/app.tsx:367
|
|
840
|
+
#: src/app.tsx:414
|
|
841
841
|
msgid "Sign In"
|
|
842
842
|
msgstr "登入"
|
|
843
843
|
|
|
@@ -894,7 +894,7 @@ msgid "The URL path for this page. Use lowercase letters, numbers, and hyphens."
|
|
|
894
894
|
msgstr "此頁面的 URL 路徑。使用小寫字母、數字和連字符。"
|
|
895
895
|
|
|
896
896
|
#. @context: Password reset error description
|
|
897
|
-
#: src/app.tsx:
|
|
897
|
+
#: src/app.tsx:590
|
|
898
898
|
msgid "This password reset link is invalid or has expired. Please generate a new one."
|
|
899
899
|
msgstr "此密碼重設連結無效或已過期。請生成一個新的連結。"
|
|
900
900
|
|
|
@@ -1033,7 +1033,7 @@ msgid "Visibility"
|
|
|
1033
1033
|
msgstr "可見性"
|
|
1034
1034
|
|
|
1035
1035
|
#. @context: Setup page welcome heading
|
|
1036
|
-
#: src/app.tsx:
|
|
1036
|
+
#: src/app.tsx:211
|
|
1037
1037
|
msgid "Welcome to Jant"
|
|
1038
1038
|
msgstr "歡迎來到 Jant"
|
|
1039
1039
|
|
|
@@ -1048,6 +1048,6 @@ msgid "What's this collection about?"
|
|
|
1048
1048
|
msgstr "這個收藏是關於什麼的?"
|
|
1049
1049
|
|
|
1050
1050
|
#. @context: Setup form field - user name
|
|
1051
|
-
#: src/app.tsx:
|
|
1051
|
+
#: src/app.tsx:232
|
|
1052
1052
|
msgid "Your Name"
|
|
1053
1053
|
msgstr "您的姓名"
|
package/src/index.ts
CHANGED
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { createApp as _createApp } from "./app.js";
|
|
8
|
-
|
|
9
7
|
// Main app factory
|
|
10
8
|
export { createApp } from "./app.js";
|
|
11
9
|
export type { App, AppVariables } from "./app.js";
|
|
12
10
|
|
|
13
|
-
//
|
|
11
|
+
// Default theme
|
|
12
|
+
export { theme as minimalTheme } from "./themes/minimal/index.js";
|
|
13
|
+
export type { ThemeOptions as MinimalThemeOptions } from "./themes/minimal/index.js";
|
|
14
|
+
|
|
15
|
+
// Types
|
|
14
16
|
export type {
|
|
15
17
|
PostType,
|
|
16
18
|
Visibility,
|
|
@@ -29,10 +31,31 @@ export type {
|
|
|
29
31
|
JantConfig,
|
|
30
32
|
JantTheme,
|
|
31
33
|
ThemeComponents,
|
|
34
|
+
// View Model types (for theme authors)
|
|
35
|
+
PostView,
|
|
36
|
+
MediaView,
|
|
37
|
+
NavLinkView,
|
|
38
|
+
SearchResultView,
|
|
39
|
+
TimelineItemView,
|
|
40
|
+
ArchiveGroup,
|
|
41
|
+
// Timeline types
|
|
32
42
|
TimelineCardProps,
|
|
33
43
|
ThreadPreviewProps,
|
|
34
|
-
TimelineItemData,
|
|
35
44
|
TimelineFeedProps,
|
|
45
|
+
// Site layout
|
|
46
|
+
SiteLayoutProps,
|
|
47
|
+
// Page-level props (for theme authors)
|
|
48
|
+
HomePageProps,
|
|
49
|
+
PostPageProps,
|
|
50
|
+
SinglePageProps,
|
|
51
|
+
ArchivePageProps,
|
|
52
|
+
SearchPageProps,
|
|
53
|
+
CollectionPageProps,
|
|
54
|
+
// Feed types (for theme authors)
|
|
55
|
+
FeedData,
|
|
56
|
+
SitemapData,
|
|
57
|
+
// Search
|
|
58
|
+
SearchResult,
|
|
36
59
|
} from "./types.js";
|
|
37
60
|
|
|
38
61
|
export {
|
|
@@ -48,5 +71,30 @@ export * as sqid from "./lib/sqid.js";
|
|
|
48
71
|
export * as url from "./lib/url.js";
|
|
49
72
|
export * as markdown from "./lib/markdown.js";
|
|
50
73
|
|
|
51
|
-
//
|
|
52
|
-
export
|
|
74
|
+
// View Model conversion utilities (for advanced theme use)
|
|
75
|
+
export {
|
|
76
|
+
createMediaContext,
|
|
77
|
+
toPostView,
|
|
78
|
+
toPostViews,
|
|
79
|
+
toMediaView,
|
|
80
|
+
toNavLinkView,
|
|
81
|
+
toNavLinkViews,
|
|
82
|
+
toSearchResultView,
|
|
83
|
+
toArchiveGroups,
|
|
84
|
+
} from "./lib/view.js";
|
|
85
|
+
export type { MediaContext } from "./lib/view.js";
|
|
86
|
+
|
|
87
|
+
// Render helper (for theme authors adding custom routes)
|
|
88
|
+
export { renderPublicPage } from "./lib/render.js";
|
|
89
|
+
export type { RenderPublicPageOptions } from "./lib/render.js";
|
|
90
|
+
|
|
91
|
+
// Navigation helper (for theme authors)
|
|
92
|
+
export { getNavigationData } from "./lib/navigation.js";
|
|
93
|
+
export type { NavigationData } from "./lib/navigation.js";
|
|
94
|
+
|
|
95
|
+
// Default feed renderers (for theme authors to extend)
|
|
96
|
+
export {
|
|
97
|
+
defaultRssRenderer,
|
|
98
|
+
defaultAtomRenderer,
|
|
99
|
+
defaultSitemapRenderer,
|
|
100
|
+
} from "./lib/feed.js";
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
resolveCardComponent,
|
|
4
|
-
resolveThreadPreview,
|
|
5
|
-
resolveTimelineFeed,
|
|
6
|
-
} from "../theme-components.js";
|
|
2
|
+
import { resolveCardComponent, resolveComponent } from "../theme-components.js";
|
|
7
3
|
import type {
|
|
8
4
|
ThemeComponents,
|
|
9
5
|
TimelineCardProps,
|
|
10
6
|
ThreadPreviewProps,
|
|
11
7
|
TimelineFeedProps,
|
|
12
8
|
PostType,
|
|
9
|
+
HomePageProps,
|
|
13
10
|
} from "../../types.js";
|
|
14
11
|
import type { FC } from "hono/jsx";
|
|
15
12
|
|
|
@@ -21,6 +18,7 @@ const MockQuoteCard: FC<TimelineCardProps> = () => null;
|
|
|
21
18
|
const MockImageCard: FC<TimelineCardProps> = () => null;
|
|
22
19
|
const MockThreadPreview: FC<ThreadPreviewProps> = () => null;
|
|
23
20
|
const MockTimelineFeed: FC<TimelineFeedProps> = () => null;
|
|
21
|
+
const MockHomePage: FC<HomePageProps> = () => null;
|
|
24
22
|
|
|
25
23
|
const DEFAULT_CARD_MAP: Record<PostType, FC<TimelineCardProps>> = {
|
|
26
24
|
note: MockNoteCard,
|
|
@@ -79,29 +77,50 @@ describe("theme-components", () => {
|
|
|
79
77
|
});
|
|
80
78
|
});
|
|
81
79
|
|
|
82
|
-
describe("
|
|
80
|
+
describe("resolveComponent", () => {
|
|
83
81
|
it("returns default ThreadPreview when no override", () => {
|
|
84
|
-
expect(
|
|
82
|
+
expect(resolveComponent("ThreadPreview", MockThreadPreview)).toBe(
|
|
83
|
+
MockThreadPreview,
|
|
84
|
+
);
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
it("returns theme override when provided", () => {
|
|
87
|
+
it("returns theme override for ThreadPreview when provided", () => {
|
|
88
88
|
const Custom: FC<ThreadPreviewProps> = () => null;
|
|
89
89
|
expect(
|
|
90
|
-
|
|
90
|
+
resolveComponent("ThreadPreview", MockThreadPreview, {
|
|
91
|
+
ThreadPreview: Custom,
|
|
92
|
+
}),
|
|
91
93
|
).toBe(Custom);
|
|
92
94
|
});
|
|
93
|
-
});
|
|
94
95
|
|
|
95
|
-
describe("resolveTimelineFeed", () => {
|
|
96
96
|
it("returns default TimelineFeed when no override", () => {
|
|
97
|
-
expect(
|
|
97
|
+
expect(resolveComponent("TimelineFeed", MockTimelineFeed)).toBe(
|
|
98
|
+
MockTimelineFeed,
|
|
99
|
+
);
|
|
98
100
|
});
|
|
99
101
|
|
|
100
|
-
it("returns theme override when provided", () => {
|
|
102
|
+
it("returns theme override for TimelineFeed when provided", () => {
|
|
101
103
|
const Custom: FC<TimelineFeedProps> = () => null;
|
|
102
104
|
expect(
|
|
103
|
-
|
|
105
|
+
resolveComponent("TimelineFeed", MockTimelineFeed, {
|
|
106
|
+
TimelineFeed: Custom,
|
|
107
|
+
}),
|
|
104
108
|
).toBe(Custom);
|
|
105
109
|
});
|
|
110
|
+
|
|
111
|
+
it("returns default HomePage when no override", () => {
|
|
112
|
+
expect(resolveComponent("HomePage", MockHomePage)).toBe(MockHomePage);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("returns theme override for HomePage when provided", () => {
|
|
116
|
+
const Custom: FC<HomePageProps> = () => null;
|
|
117
|
+
expect(
|
|
118
|
+
resolveComponent("HomePage", MockHomePage, { HomePage: Custom }),
|
|
119
|
+
).toBe(Custom);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it("returns default when theme has empty overrides", () => {
|
|
123
|
+
expect(resolveComponent("HomePage", MockHomePage, {})).toBe(MockHomePage);
|
|
124
|
+
});
|
|
106
125
|
});
|
|
107
126
|
});
|