@jant/core 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/dist/app.d.ts +34 -0
  2. package/dist/app.d.ts.map +1 -0
  3. package/dist/app.js +474 -0
  4. package/dist/assets/datastar.min.js +1775 -0
  5. package/dist/auth.d.ts +23 -0
  6. package/dist/auth.d.ts.map +1 -0
  7. package/dist/auth.js +34 -0
  8. package/{src/client.ts → dist/client.d.ts} +1 -1
  9. package/dist/client.d.ts.map +1 -0
  10. package/dist/client.js +4 -0
  11. package/dist/db/index.d.ts +10 -0
  12. package/dist/db/index.d.ts.map +1 -0
  13. package/dist/db/index.js +10 -0
  14. package/dist/db/schema.d.ts +1507 -0
  15. package/dist/db/schema.d.ts.map +1 -0
  16. package/dist/db/schema.js +183 -0
  17. package/{src/i18n/Trans.tsx → dist/i18n/Trans.d.ts} +4 -10
  18. package/dist/i18n/Trans.d.ts.map +1 -0
  19. package/dist/i18n/Trans.js +24 -0
  20. package/dist/i18n/context.d.ts +69 -0
  21. package/dist/i18n/context.d.ts.map +1 -0
  22. package/dist/i18n/context.js +61 -0
  23. package/dist/i18n/detect.d.ts +31 -0
  24. package/dist/i18n/detect.d.ts.map +1 -0
  25. package/dist/i18n/detect.js +77 -0
  26. package/{src/i18n/i18n.ts → dist/i18n/i18n.d.ts} +5 -25
  27. package/dist/i18n/i18n.d.ts.map +1 -0
  28. package/dist/i18n/i18n.js +55 -0
  29. package/dist/i18n/index.d.ts +41 -0
  30. package/dist/i18n/index.d.ts.map +1 -0
  31. package/{src/i18n/index.ts → dist/i18n/index.js} +3 -24
  32. package/dist/i18n/locales/en.d.ts +3 -0
  33. package/dist/i18n/locales/en.d.ts.map +1 -0
  34. package/dist/i18n/locales/en.js +1 -0
  35. package/dist/i18n/locales/zh-Hans.d.ts +3 -0
  36. package/dist/i18n/locales/zh-Hans.d.ts.map +1 -0
  37. package/dist/i18n/locales/zh-Hans.js +1 -0
  38. package/dist/i18n/locales/zh-Hant.d.ts +3 -0
  39. package/dist/i18n/locales/zh-Hant.d.ts.map +1 -0
  40. package/dist/i18n/locales/zh-Hant.js +1 -0
  41. package/dist/i18n/locales.d.ts +11 -0
  42. package/dist/i18n/locales.d.ts.map +1 -0
  43. package/dist/i18n/locales.js +13 -0
  44. package/dist/i18n/middleware.d.ts +24 -0
  45. package/dist/i18n/middleware.d.ts.map +1 -0
  46. package/dist/i18n/middleware.js +41 -0
  47. package/dist/index.d.ts +16 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/{src/index.ts → dist/index.js} +1 -28
  50. package/dist/lib/assets.d.ts +19 -0
  51. package/dist/lib/assets.d.ts.map +1 -0
  52. package/dist/lib/assets.js +33 -0
  53. package/dist/lib/constants.d.ts +36 -0
  54. package/dist/lib/constants.d.ts.map +1 -0
  55. package/dist/lib/constants.js +50 -0
  56. package/{src/lib/image.ts → dist/lib/image.d.ts} +13 -47
  57. package/dist/lib/image.d.ts.map +1 -0
  58. package/dist/lib/image.js +77 -0
  59. package/{src/lib/index.ts → dist/lib/index.d.ts} +1 -1
  60. package/dist/lib/index.d.ts.map +1 -0
  61. package/dist/lib/index.js +7 -0
  62. package/dist/lib/markdown.d.ts +60 -0
  63. package/dist/lib/markdown.d.ts.map +1 -0
  64. package/{src/lib/markdown.ts → dist/lib/markdown.js} +16 -26
  65. package/dist/lib/schemas.d.ts +113 -0
  66. package/dist/lib/schemas.d.ts.map +1 -0
  67. package/dist/lib/schemas.js +71 -0
  68. package/dist/lib/sqid.d.ts +60 -0
  69. package/dist/lib/sqid.d.ts.map +1 -0
  70. package/{src/lib/sqid.ts → dist/lib/sqid.js} +15 -22
  71. package/dist/lib/sse.d.ts +95 -0
  72. package/dist/lib/sse.d.ts.map +1 -0
  73. package/dist/lib/sse.js +81 -0
  74. package/dist/lib/time.d.ts +90 -0
  75. package/dist/lib/time.d.ts.map +1 -0
  76. package/{src/lib/time.ts → dist/lib/time.js} +20 -33
  77. package/{src/lib/url.ts → dist/lib/url.d.ts} +5 -30
  78. package/dist/lib/url.d.ts.map +1 -0
  79. package/dist/lib/url.js +89 -0
  80. package/dist/middleware/auth.d.ts +24 -0
  81. package/dist/middleware/auth.d.ts.map +1 -0
  82. package/dist/middleware/auth.js +52 -0
  83. package/dist/routes/api/posts.d.ts +13 -0
  84. package/dist/routes/api/posts.d.ts.map +1 -0
  85. package/dist/routes/api/posts.js +124 -0
  86. package/dist/routes/api/search.d.ts +13 -0
  87. package/dist/routes/api/search.d.ts.map +1 -0
  88. package/dist/routes/api/search.js +49 -0
  89. package/dist/routes/api/upload.d.ts +16 -0
  90. package/dist/routes/api/upload.d.ts.map +1 -0
  91. package/dist/routes/api/upload.js +227 -0
  92. package/dist/routes/dash/collections.d.ts +13 -0
  93. package/dist/routes/dash/collections.d.ts.map +1 -0
  94. package/dist/routes/dash/collections.js +512 -0
  95. package/dist/routes/dash/index.d.ts +15 -0
  96. package/dist/routes/dash/index.d.ts.map +1 -0
  97. package/dist/routes/dash/index.js +117 -0
  98. package/dist/routes/dash/media.d.ts +16 -0
  99. package/dist/routes/dash/media.d.ts.map +1 -0
  100. package/dist/routes/dash/media.js +589 -0
  101. package/dist/routes/dash/pages.d.ts +15 -0
  102. package/dist/routes/dash/pages.d.ts.map +1 -0
  103. package/dist/routes/dash/pages.js +290 -0
  104. package/dist/routes/dash/posts.d.ts +13 -0
  105. package/dist/routes/dash/posts.d.ts.map +1 -0
  106. package/dist/routes/dash/posts.js +226 -0
  107. package/dist/routes/dash/redirects.d.ts +13 -0
  108. package/dist/routes/dash/redirects.d.ts.map +1 -0
  109. package/dist/routes/dash/redirects.js +237 -0
  110. package/dist/routes/dash/settings.d.ts +13 -0
  111. package/dist/routes/dash/settings.d.ts.map +1 -0
  112. package/dist/routes/dash/settings.js +154 -0
  113. package/dist/routes/feed/rss.d.ts +13 -0
  114. package/dist/routes/feed/rss.d.ts.map +1 -0
  115. package/dist/routes/feed/rss.js +95 -0
  116. package/dist/routes/feed/sitemap.d.ts +13 -0
  117. package/dist/routes/feed/sitemap.d.ts.map +1 -0
  118. package/dist/routes/feed/sitemap.js +59 -0
  119. package/dist/routes/pages/archive.d.ts +15 -0
  120. package/dist/routes/pages/archive.d.ts.map +1 -0
  121. package/dist/routes/pages/archive.js +255 -0
  122. package/dist/routes/pages/collection.d.ts +13 -0
  123. package/dist/routes/pages/collection.d.ts.map +1 -0
  124. package/dist/routes/pages/collection.js +93 -0
  125. package/dist/routes/pages/home.d.ts +13 -0
  126. package/dist/routes/pages/home.d.ts.map +1 -0
  127. package/dist/routes/pages/home.js +122 -0
  128. package/dist/routes/pages/page.d.ts +15 -0
  129. package/dist/routes/pages/page.d.ts.map +1 -0
  130. package/dist/routes/pages/page.js +69 -0
  131. package/dist/routes/pages/post.d.ts +13 -0
  132. package/dist/routes/pages/post.d.ts.map +1 -0
  133. package/dist/routes/pages/post.js +90 -0
  134. package/dist/routes/pages/search.d.ts +13 -0
  135. package/dist/routes/pages/search.d.ts.map +1 -0
  136. package/dist/routes/pages/search.js +180 -0
  137. package/dist/services/collection.d.ts +31 -0
  138. package/dist/services/collection.d.ts.map +1 -0
  139. package/dist/services/collection.js +108 -0
  140. package/dist/services/index.d.ts +28 -0
  141. package/dist/services/index.d.ts.map +1 -0
  142. package/dist/services/index.js +20 -0
  143. package/dist/services/media.d.ts +27 -0
  144. package/dist/services/media.d.ts.map +1 -0
  145. package/dist/services/media.js +62 -0
  146. package/dist/services/post.d.ts +31 -0
  147. package/dist/services/post.d.ts.map +1 -0
  148. package/dist/services/post.js +191 -0
  149. package/dist/services/redirect.d.ts +15 -0
  150. package/dist/services/redirect.d.ts.map +1 -0
  151. package/dist/services/redirect.js +48 -0
  152. package/dist/services/search.d.ts +26 -0
  153. package/dist/services/search.d.ts.map +1 -0
  154. package/dist/services/search.js +61 -0
  155. package/dist/services/settings.d.ts +17 -0
  156. package/dist/services/settings.d.ts.map +1 -0
  157. package/dist/services/settings.js +65 -0
  158. package/dist/theme/components/ActionButtons.d.ts +43 -0
  159. package/dist/theme/components/ActionButtons.d.ts.map +1 -0
  160. package/dist/theme/components/ActionButtons.js +50 -0
  161. package/dist/theme/components/CrudPageHeader.d.ts +23 -0
  162. package/dist/theme/components/CrudPageHeader.d.ts.map +1 -0
  163. package/dist/theme/components/CrudPageHeader.js +22 -0
  164. package/dist/theme/components/DangerZone.d.ts +36 -0
  165. package/dist/theme/components/DangerZone.d.ts.map +1 -0
  166. package/dist/theme/components/DangerZone.js +39 -0
  167. package/dist/theme/components/EmptyState.d.ts +27 -0
  168. package/dist/theme/components/EmptyState.d.ts.map +1 -0
  169. package/dist/theme/components/EmptyState.js +27 -0
  170. package/dist/theme/components/ListItemRow.d.ts +15 -0
  171. package/dist/theme/components/ListItemRow.d.ts.map +1 -0
  172. package/dist/theme/components/ListItemRow.js +21 -0
  173. package/dist/theme/components/PageForm.d.ts +14 -0
  174. package/dist/theme/components/PageForm.d.ts.map +1 -0
  175. package/dist/theme/components/PageForm.js +173 -0
  176. package/dist/theme/components/Pagination.d.ts +46 -0
  177. package/dist/theme/components/Pagination.d.ts.map +1 -0
  178. package/dist/theme/components/Pagination.js +159 -0
  179. package/dist/theme/components/PostForm.d.ts +12 -0
  180. package/dist/theme/components/PostForm.d.ts.map +1 -0
  181. package/dist/theme/components/PostForm.js +230 -0
  182. package/dist/theme/components/PostList.d.ts +10 -0
  183. package/dist/theme/components/PostList.d.ts.map +1 -0
  184. package/dist/theme/components/PostList.js +73 -0
  185. package/dist/theme/components/ThreadView.d.ts +15 -0
  186. package/dist/theme/components/ThreadView.d.ts.map +1 -0
  187. package/dist/theme/components/ThreadView.js +111 -0
  188. package/dist/theme/components/TypeBadge.d.ts +12 -0
  189. package/dist/theme/components/TypeBadge.d.ts.map +1 -0
  190. package/dist/theme/components/TypeBadge.js +39 -0
  191. package/dist/theme/components/VisibilityBadge.d.ts +12 -0
  192. package/dist/theme/components/VisibilityBadge.d.ts.map +1 -0
  193. package/dist/theme/components/VisibilityBadge.js +37 -0
  194. package/{src/theme/components/index.ts → dist/theme/components/index.d.ts} +1 -0
  195. package/dist/theme/components/index.d.ts.map +1 -0
  196. package/dist/theme/components/index.js +12 -0
  197. package/dist/theme/index.d.ts +21 -0
  198. package/dist/theme/index.d.ts.map +1 -0
  199. package/{src/theme/index.ts → dist/theme/index.js} +1 -4
  200. package/dist/theme/layouts/BaseLayout.d.ts +16 -0
  201. package/dist/theme/layouts/BaseLayout.d.ts.map +1 -0
  202. package/dist/theme/layouts/BaseLayout.js +58 -0
  203. package/dist/theme/layouts/DashLayout.d.ts +15 -0
  204. package/dist/theme/layouts/DashLayout.d.ts.map +1 -0
  205. package/dist/theme/layouts/DashLayout.js +139 -0
  206. package/{src/theme/layouts/index.ts → dist/theme/layouts/index.d.ts} +1 -0
  207. package/dist/theme/layouts/index.d.ts.map +1 -0
  208. package/dist/theme/layouts/index.js +2 -0
  209. package/dist/theme/styles/main.css +2 -0
  210. package/dist/types.d.ts +179 -0
  211. package/dist/types.d.ts.map +1 -0
  212. package/dist/types.js +19 -0
  213. package/package.json +26 -26
  214. package/drizzle.config.ts +0 -10
  215. package/lingui.config.ts +0 -16
  216. package/src/app.tsx +0 -377
  217. package/src/assets/datastar.min.js +0 -8
  218. package/src/auth.ts +0 -38
  219. package/src/db/index.ts +0 -14
  220. package/src/db/migrations/0000_solid_moon_knight.sql +0 -118
  221. package/src/db/migrations/0001_add_search_fts.sql +0 -40
  222. package/src/db/migrations/0002_collection_path.sql +0 -2
  223. package/src/db/migrations/0003_collection_path_nullable.sql +0 -21
  224. package/src/db/migrations/0004_media_uuid.sql +0 -35
  225. package/src/db/migrations/meta/0000_snapshot.json +0 -784
  226. package/src/db/migrations/meta/_journal.json +0 -41
  227. package/src/db/schema.ts +0 -159
  228. package/src/i18n/EXAMPLES.md +0 -235
  229. package/src/i18n/README.md +0 -296
  230. package/src/i18n/context.tsx +0 -101
  231. package/src/i18n/detect.ts +0 -100
  232. package/src/i18n/locales/en.po +0 -875
  233. package/src/i18n/locales/en.ts +0 -1
  234. package/src/i18n/locales/zh-Hans.po +0 -875
  235. package/src/i18n/locales/zh-Hans.ts +0 -1
  236. package/src/i18n/locales/zh-Hant.po +0 -875
  237. package/src/i18n/locales/zh-Hant.ts +0 -1
  238. package/src/i18n/locales.ts +0 -14
  239. package/src/i18n/middleware.ts +0 -59
  240. package/src/lib/assets.ts +0 -47
  241. package/src/lib/constants.ts +0 -67
  242. package/src/lib/schemas.ts +0 -92
  243. package/src/lib/sse.ts +0 -152
  244. package/src/middleware/auth.ts +0 -59
  245. package/src/routes/api/posts.ts +0 -127
  246. package/src/routes/api/search.ts +0 -53
  247. package/src/routes/api/upload.ts +0 -240
  248. package/src/routes/dash/collections.tsx +0 -341
  249. package/src/routes/dash/index.tsx +0 -89
  250. package/src/routes/dash/media.tsx +0 -551
  251. package/src/routes/dash/pages.tsx +0 -245
  252. package/src/routes/dash/posts.tsx +0 -202
  253. package/src/routes/dash/redirects.tsx +0 -155
  254. package/src/routes/dash/settings.tsx +0 -93
  255. package/src/routes/feed/rss.ts +0 -119
  256. package/src/routes/feed/sitemap.ts +0 -75
  257. package/src/routes/pages/archive.tsx +0 -223
  258. package/src/routes/pages/collection.tsx +0 -79
  259. package/src/routes/pages/home.tsx +0 -93
  260. package/src/routes/pages/page.tsx +0 -64
  261. package/src/routes/pages/post.tsx +0 -81
  262. package/src/routes/pages/search.tsx +0 -162
  263. package/src/services/collection.ts +0 -180
  264. package/src/services/index.ts +0 -40
  265. package/src/services/media.ts +0 -97
  266. package/src/services/post.ts +0 -279
  267. package/src/services/redirect.ts +0 -74
  268. package/src/services/search.ts +0 -117
  269. package/src/services/settings.ts +0 -76
  270. package/src/theme/components/ActionButtons.tsx +0 -98
  271. package/src/theme/components/CrudPageHeader.tsx +0 -48
  272. package/src/theme/components/DangerZone.tsx +0 -77
  273. package/src/theme/components/EmptyState.tsx +0 -56
  274. package/src/theme/components/ListItemRow.tsx +0 -24
  275. package/src/theme/components/PageForm.tsx +0 -114
  276. package/src/theme/components/Pagination.tsx +0 -196
  277. package/src/theme/components/PostForm.tsx +0 -122
  278. package/src/theme/components/PostList.tsx +0 -68
  279. package/src/theme/components/ThreadView.tsx +0 -118
  280. package/src/theme/components/TypeBadge.tsx +0 -28
  281. package/src/theme/components/VisibilityBadge.tsx +0 -33
  282. package/src/theme/layouts/BaseLayout.tsx +0 -49
  283. package/src/theme/layouts/DashLayout.tsx +0 -108
  284. package/src/theme/styles/main.css +0 -52
  285. package/src/types.ts +0 -222
  286. package/tsconfig.json +0 -16
  287. package/vite.config.ts +0 -82
  288. package/wrangler.toml +0 -21
@@ -0,0 +1,230 @@
1
+ /**
2
+ * Post Creation/Edit Form
3
+ */ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
4
+ import { useLingui } from "../../i18n/index.js";
5
+ export const PostForm = ({ post, action, method = "post" })=>{
6
+ const { t } = useLingui();
7
+ const isEdit = !!post;
8
+ return /*#__PURE__*/ _jsxs("form", {
9
+ method: method,
10
+ action: action,
11
+ class: "flex flex-col gap-4",
12
+ children: [
13
+ /*#__PURE__*/ _jsxs("div", {
14
+ class: "field",
15
+ children: [
16
+ /*#__PURE__*/ _jsx("label", {
17
+ class: "label",
18
+ children: t({
19
+ message: "Type",
20
+ comment: "@context: Post form field - post type"
21
+ })
22
+ }),
23
+ /*#__PURE__*/ _jsxs("select", {
24
+ name: "type",
25
+ class: "select",
26
+ required: true,
27
+ children: [
28
+ /*#__PURE__*/ _jsx("option", {
29
+ value: "note",
30
+ selected: post?.type === "note",
31
+ children: t({
32
+ message: "Note",
33
+ comment: "@context: Post type option"
34
+ })
35
+ }),
36
+ /*#__PURE__*/ _jsx("option", {
37
+ value: "article",
38
+ selected: post?.type === "article",
39
+ children: t({
40
+ message: "Article",
41
+ comment: "@context: Post type option"
42
+ })
43
+ }),
44
+ /*#__PURE__*/ _jsx("option", {
45
+ value: "link",
46
+ selected: post?.type === "link",
47
+ children: t({
48
+ message: "Link",
49
+ comment: "@context: Post type option"
50
+ })
51
+ }),
52
+ /*#__PURE__*/ _jsx("option", {
53
+ value: "quote",
54
+ selected: post?.type === "quote",
55
+ children: t({
56
+ message: "Quote",
57
+ comment: "@context: Post type option"
58
+ })
59
+ }),
60
+ /*#__PURE__*/ _jsx("option", {
61
+ value: "image",
62
+ selected: post?.type === "image",
63
+ children: t({
64
+ message: "Image",
65
+ comment: "@context: Post type option"
66
+ })
67
+ })
68
+ ]
69
+ })
70
+ ]
71
+ }),
72
+ /*#__PURE__*/ _jsxs("div", {
73
+ class: "field",
74
+ children: [
75
+ /*#__PURE__*/ _jsx("label", {
76
+ class: "label",
77
+ children: t({
78
+ message: "Title (optional)",
79
+ comment: "@context: Post form field"
80
+ })
81
+ }),
82
+ /*#__PURE__*/ _jsx("input", {
83
+ type: "text",
84
+ name: "title",
85
+ class: "input",
86
+ placeholder: t({
87
+ message: "Post title...",
88
+ comment: "@context: Post title placeholder"
89
+ }),
90
+ value: post?.title ?? ""
91
+ })
92
+ ]
93
+ }),
94
+ /*#__PURE__*/ _jsxs("div", {
95
+ class: "field",
96
+ children: [
97
+ /*#__PURE__*/ _jsx("label", {
98
+ class: "label",
99
+ children: t({
100
+ message: "Content",
101
+ comment: "@context: Post form field"
102
+ })
103
+ }),
104
+ /*#__PURE__*/ _jsx("textarea", {
105
+ name: "content",
106
+ class: "textarea min-h-32",
107
+ placeholder: t({
108
+ message: "What's on your mind?",
109
+ comment: "@context: Post content placeholder"
110
+ }),
111
+ required: true,
112
+ children: post?.content ?? ""
113
+ })
114
+ ]
115
+ }),
116
+ /*#__PURE__*/ _jsxs("div", {
117
+ class: "field",
118
+ children: [
119
+ /*#__PURE__*/ _jsx("label", {
120
+ class: "label",
121
+ children: t({
122
+ message: "Source URL (optional)",
123
+ comment: "@context: Post form field"
124
+ })
125
+ }),
126
+ /*#__PURE__*/ _jsx("input", {
127
+ type: "url",
128
+ name: "sourceUrl",
129
+ class: "input",
130
+ placeholder: "https://...",
131
+ value: post?.sourceUrl ?? ""
132
+ })
133
+ ]
134
+ }),
135
+ /*#__PURE__*/ _jsxs("div", {
136
+ class: "field",
137
+ children: [
138
+ /*#__PURE__*/ _jsx("label", {
139
+ class: "label",
140
+ children: t({
141
+ message: "Visibility",
142
+ comment: "@context: Post form field"
143
+ })
144
+ }),
145
+ /*#__PURE__*/ _jsxs("select", {
146
+ name: "visibility",
147
+ class: "select",
148
+ children: [
149
+ /*#__PURE__*/ _jsx("option", {
150
+ value: "quiet",
151
+ selected: post?.visibility === "quiet" || !post,
152
+ children: t({
153
+ message: "Quiet (normal)",
154
+ comment: "@context: Post visibility option"
155
+ })
156
+ }),
157
+ /*#__PURE__*/ _jsx("option", {
158
+ value: "featured",
159
+ selected: post?.visibility === "featured",
160
+ children: t({
161
+ message: "Featured",
162
+ comment: "@context: Post visibility option"
163
+ })
164
+ }),
165
+ /*#__PURE__*/ _jsx("option", {
166
+ value: "unlisted",
167
+ selected: post?.visibility === "unlisted",
168
+ children: t({
169
+ message: "Unlisted",
170
+ comment: "@context: Post visibility option"
171
+ })
172
+ }),
173
+ /*#__PURE__*/ _jsx("option", {
174
+ value: "draft",
175
+ selected: post?.visibility === "draft",
176
+ children: t({
177
+ message: "Draft",
178
+ comment: "@context: Post visibility option"
179
+ })
180
+ })
181
+ ]
182
+ })
183
+ ]
184
+ }),
185
+ /*#__PURE__*/ _jsxs("div", {
186
+ class: "field",
187
+ children: [
188
+ /*#__PURE__*/ _jsx("label", {
189
+ class: "label",
190
+ children: t({
191
+ message: "Custom Path (optional)",
192
+ comment: "@context: Post form field"
193
+ })
194
+ }),
195
+ /*#__PURE__*/ _jsx("input", {
196
+ type: "text",
197
+ name: "path",
198
+ class: "input",
199
+ placeholder: "my-custom-url",
200
+ value: post?.path ?? ""
201
+ })
202
+ ]
203
+ }),
204
+ /*#__PURE__*/ _jsxs("div", {
205
+ class: "flex gap-2",
206
+ children: [
207
+ /*#__PURE__*/ _jsx("button", {
208
+ type: "submit",
209
+ class: "btn",
210
+ children: isEdit ? t({
211
+ message: "Update",
212
+ comment: "@context: Button to update existing post"
213
+ }) : t({
214
+ message: "Publish",
215
+ comment: "@context: Button to publish new post"
216
+ })
217
+ }),
218
+ /*#__PURE__*/ _jsx("a", {
219
+ href: "/dash/posts",
220
+ class: "btn-outline",
221
+ children: t({
222
+ message: "Cancel",
223
+ comment: "@context: Button to cancel form"
224
+ })
225
+ })
226
+ ]
227
+ })
228
+ ]
229
+ });
230
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Post List Component
3
+ */
4
+ import type { FC } from "hono/jsx";
5
+ import type { Post } from "../../types.js";
6
+ export interface PostListProps {
7
+ posts: Post[];
8
+ }
9
+ export declare const PostList: FC<PostListProps>;
10
+ //# sourceMappingURL=PostList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PostList.d.ts","sourceRoot":"","sources":["../../../src/theme/components/PostList.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAS3C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAgDtC,CAAC"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Post List Component
3
+ */ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
4
+ import { useLingui } from "../../i18n/index.js";
5
+ import * as sqid from "../../lib/sqid.js";
6
+ import * as time from "../../lib/time.js";
7
+ import { VisibilityBadge } from "./VisibilityBadge.js";
8
+ import { TypeBadge } from "./TypeBadge.js";
9
+ import { EmptyState } from "./EmptyState.js";
10
+ import { ListItemRow } from "./ListItemRow.js";
11
+ import { ActionButtons } from "./ActionButtons.js";
12
+ export const PostList = ({ posts })=>{
13
+ const { t } = useLingui();
14
+ if (posts.length === 0) {
15
+ return /*#__PURE__*/ _jsx(EmptyState, {
16
+ message: t({
17
+ message: "No posts yet.",
18
+ comment: "@context: Empty state message when no posts exist"
19
+ }),
20
+ ctaText: t({
21
+ message: "Create your first post",
22
+ comment: "@context: Button in empty state to create first post"
23
+ }),
24
+ ctaHref: "/dash/posts/new"
25
+ });
26
+ }
27
+ return /*#__PURE__*/ _jsx("div", {
28
+ class: "flex flex-col divide-y",
29
+ children: posts.map((post)=>/*#__PURE__*/ _jsxs(ListItemRow, {
30
+ actions: /*#__PURE__*/ _jsx(ActionButtons, {
31
+ editHref: `/dash/posts/${sqid.encode(post.id)}/edit`,
32
+ editLabel: t({
33
+ message: "Edit",
34
+ comment: "@context: Button to edit post"
35
+ }),
36
+ viewHref: `/p/${sqid.encode(post.id)}`,
37
+ viewLabel: t({
38
+ message: "View",
39
+ comment: "@context: Button to view post on public site"
40
+ })
41
+ }),
42
+ children: [
43
+ /*#__PURE__*/ _jsxs("div", {
44
+ class: "flex items-center gap-2 mb-1",
45
+ children: [
46
+ /*#__PURE__*/ _jsx(TypeBadge, {
47
+ type: post.type
48
+ }),
49
+ /*#__PURE__*/ _jsx(VisibilityBadge, {
50
+ visibility: post.visibility
51
+ }),
52
+ /*#__PURE__*/ _jsx("span", {
53
+ class: "text-xs text-muted-foreground",
54
+ children: time.formatDate(post.publishedAt)
55
+ })
56
+ ]
57
+ }),
58
+ /*#__PURE__*/ _jsx("a", {
59
+ href: `/dash/posts/${sqid.encode(post.id)}`,
60
+ class: "font-medium hover:underline",
61
+ children: post.title || post.content?.slice(0, 60) || t({
62
+ message: "Untitled",
63
+ comment: "@context: Default title for untitled post"
64
+ })
65
+ }),
66
+ post.content && !post.title && /*#__PURE__*/ _jsx("p", {
67
+ class: "text-sm text-muted-foreground mt-1 line-clamp-2",
68
+ children: post.content.slice(0, 120)
69
+ })
70
+ ]
71
+ }, post.id))
72
+ });
73
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Thread View Component
3
+ *
4
+ * Displays a thread of posts with reply chain visualization
5
+ */
6
+ import type { FC } from "hono/jsx";
7
+ import type { Post } from "../../types.js";
8
+ export interface ThreadViewProps {
9
+ /** All posts in the thread, ordered by createdAt */
10
+ posts: Post[];
11
+ /** ID of the currently viewed post (to highlight) */
12
+ currentPostId: number;
13
+ }
14
+ export declare const ThreadView: FC<ThreadViewProps>;
15
+ //# sourceMappingURL=ThreadView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThreadView.d.ts","sourceRoot":"","sources":["../../../src/theme/components/ThreadView.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAI3C,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,qDAAqD;IACrD,aAAa,EAAE,MAAM,CAAC;CACvB;AAoDD,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAgD1C,CAAC"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Thread View Component
3
+ *
4
+ * Displays a thread of posts with reply chain visualization
5
+ */ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
6
+ import { useLingui } from "../../i18n/index.js";
7
+ import * as sqid from "../../lib/sqid.js";
8
+ import * as time from "../../lib/time.js";
9
+ const ThreadPost = ({ post, isCurrent, isRoot })=>{
10
+ const { t } = useLingui();
11
+ return /*#__PURE__*/ _jsxs("article", {
12
+ id: `post-${post.id}`,
13
+ class: `h-entry p-4 rounded-lg border ${isCurrent ? "border-primary bg-primary/5 ring-2 ring-primary/20" : "border-border hover:border-muted-foreground/30"}`,
14
+ children: [
15
+ post.title && /*#__PURE__*/ _jsx("h2", {
16
+ class: "p-name text-lg font-medium mb-2",
17
+ children: /*#__PURE__*/ _jsx("a", {
18
+ href: `/p/${sqid.encode(post.id)}`,
19
+ class: "u-url hover:underline",
20
+ children: post.title
21
+ })
22
+ }),
23
+ /*#__PURE__*/ _jsx("div", {
24
+ class: "e-content prose prose-sm",
25
+ dangerouslySetInnerHTML: {
26
+ __html: post.contentHtml || ""
27
+ }
28
+ }),
29
+ /*#__PURE__*/ _jsxs("footer", {
30
+ class: "mt-3 flex items-center gap-3 text-sm text-muted-foreground",
31
+ children: [
32
+ /*#__PURE__*/ _jsx("time", {
33
+ class: "dt-published",
34
+ datetime: time.toISOString(post.publishedAt),
35
+ children: time.formatDate(post.publishedAt)
36
+ }),
37
+ isRoot && /*#__PURE__*/ _jsx("span", {
38
+ class: "text-xs",
39
+ children: t({
40
+ message: "Thread start",
41
+ comment: "@context: Thread view indicator - first post in thread"
42
+ })
43
+ }),
44
+ !isCurrent && /*#__PURE__*/ _jsx("a", {
45
+ href: `/p/${sqid.encode(post.id)}`,
46
+ class: "text-xs hover:underline",
47
+ children: t({
48
+ message: "Permalink",
49
+ comment: "@context: Link to individual post in thread"
50
+ })
51
+ })
52
+ ]
53
+ })
54
+ ]
55
+ });
56
+ };
57
+ export const ThreadView = ({ posts, currentPostId })=>{
58
+ const { t } = useLingui();
59
+ if (posts.length === 0) {
60
+ return null;
61
+ }
62
+ const rootPost = posts[0];
63
+ const isThread = posts.length > 1;
64
+ // Single post, no thread
65
+ if (!isThread) {
66
+ return(// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- Early return for empty array at line 73 guarantees posts[0] exists
67
+ /*#__PURE__*/ _jsx(ThreadPost, {
68
+ post: rootPost,
69
+ isCurrent: true,
70
+ isRoot: false
71
+ }));
72
+ }
73
+ const threadLabel = posts.length === 1 ? t({
74
+ message: "Thread with 1 post",
75
+ comment: "@context: Thread view header - single post"
76
+ }) : t({
77
+ message: "Thread with {count} posts",
78
+ comment: "@context: Thread view header - multiple posts",
79
+ values: {
80
+ count: String(posts.length)
81
+ }
82
+ });
83
+ return /*#__PURE__*/ _jsxs("div", {
84
+ class: "thread-view",
85
+ children: [
86
+ /*#__PURE__*/ _jsx("div", {
87
+ class: "mb-4 text-sm text-muted-foreground",
88
+ children: threadLabel
89
+ }),
90
+ /*#__PURE__*/ _jsx("div", {
91
+ class: "flex flex-col gap-3",
92
+ children: posts.map((post, index)=>/*#__PURE__*/ _jsxs("div", {
93
+ class: "relative",
94
+ children: [
95
+ index > 0 && /*#__PURE__*/ _jsx("div", {
96
+ class: "absolute left-6 -top-3 w-0.5 h-3 bg-border"
97
+ }),
98
+ index < posts.length - 1 && /*#__PURE__*/ _jsx("div", {
99
+ class: "absolute left-6 -bottom-3 w-0.5 h-3 bg-border"
100
+ }),
101
+ /*#__PURE__*/ _jsx(ThreadPost, {
102
+ post: post,
103
+ isCurrent: post.id === currentPostId,
104
+ isRoot: index === 0
105
+ })
106
+ ]
107
+ }, post.id))
108
+ })
109
+ ]
110
+ });
111
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Type Badge Component
3
+ *
4
+ * Displays a badge indicating the type of a post (note, article, link, etc.)
5
+ */
6
+ import type { FC } from "hono/jsx";
7
+ import type { PostType } from "../../types.js";
8
+ export interface TypeBadgeProps {
9
+ type: PostType;
10
+ }
11
+ export declare const TypeBadge: FC<TypeBadgeProps>;
12
+ //# sourceMappingURL=TypeBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeBadge.d.ts","sourceRoot":"","sources":["../../../src/theme/components/TypeBadge.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAaxC,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Type Badge Component
3
+ *
4
+ * Displays a badge indicating the type of a post (note, article, link, etc.)
5
+ */ import { jsx as _jsx } from "hono/jsx/jsx-runtime";
6
+ import { useLingui } from "../../i18n/index.js";
7
+ export const TypeBadge = ({ type })=>{
8
+ const { t } = useLingui();
9
+ const labels = {
10
+ note: t({
11
+ message: "Note",
12
+ comment: "@context: Post type badge - note"
13
+ }),
14
+ article: t({
15
+ message: "Article",
16
+ comment: "@context: Post type badge - article"
17
+ }),
18
+ link: t({
19
+ message: "Link",
20
+ comment: "@context: Post type badge - link"
21
+ }),
22
+ quote: t({
23
+ message: "Quote",
24
+ comment: "@context: Post type badge - quote"
25
+ }),
26
+ image: t({
27
+ message: "Image",
28
+ comment: "@context: Post type badge - image"
29
+ }),
30
+ page: t({
31
+ message: "Page",
32
+ comment: "@context: Post type badge - page"
33
+ })
34
+ };
35
+ return /*#__PURE__*/ _jsx("span", {
36
+ class: "badge-outline",
37
+ children: labels[type]
38
+ });
39
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Visibility Badge Component
3
+ *
4
+ * Displays a badge indicating the visibility level of a post
5
+ */
6
+ import type { FC } from "hono/jsx";
7
+ import type { Visibility } from "../../types.js";
8
+ export interface VisibilityBadgeProps {
9
+ visibility: Visibility;
10
+ }
11
+ export declare const VisibilityBadge: FC<VisibilityBadgeProps>;
12
+ //# sourceMappingURL=VisibilityBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisibilityBadge.d.ts","sourceRoot":"","sources":["../../../src/theme/components/VisibilityBadge.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAkBpD,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Visibility Badge Component
3
+ *
4
+ * Displays a badge indicating the visibility level of a post
5
+ */ import { jsx as _jsx } from "hono/jsx/jsx-runtime";
6
+ import { useLingui } from "../../i18n/index.js";
7
+ export const VisibilityBadge = ({ visibility })=>{
8
+ const { t } = useLingui();
9
+ const variants = {
10
+ featured: "badge-primary",
11
+ quiet: "badge-secondary",
12
+ unlisted: "badge-outline",
13
+ draft: "badge-outline"
14
+ };
15
+ const labels = {
16
+ featured: t({
17
+ message: "Featured",
18
+ comment: "@context: Post visibility badge - featured"
19
+ }),
20
+ quiet: t({
21
+ message: "Quiet",
22
+ comment: "@context: Post visibility badge - normal"
23
+ }),
24
+ unlisted: t({
25
+ message: "Unlisted",
26
+ comment: "@context: Post visibility badge - unlisted"
27
+ }),
28
+ draft: t({
29
+ message: "Draft",
30
+ comment: "@context: Post visibility badge - draft"
31
+ })
32
+ };
33
+ return /*#__PURE__*/ _jsx("span", {
34
+ class: variants[visibility],
35
+ children: labels[visibility]
36
+ });
37
+ };
@@ -10,3 +10,4 @@ export { PostList, type PostListProps } from "./PostList.js";
10
10
  export { ThreadView, type ThreadViewProps } from "./ThreadView.js";
11
11
  export { TypeBadge, type TypeBadgeProps } from "./TypeBadge.js";
12
12
  export { VisibilityBadge, type VisibilityBadgeProps } from "./VisibilityBadge.js";
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3I,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,12 @@
1
+ export { ActionButtons } from "./ActionButtons.js";
2
+ export { CrudPageHeader } from "./CrudPageHeader.js";
3
+ export { DangerZone } from "./DangerZone.js";
4
+ export { EmptyState } from "./EmptyState.js";
5
+ export { ListItemRow } from "./ListItemRow.js";
6
+ export { PageForm } from "./PageForm.js";
7
+ export { Pagination, LoadMore, PagePagination } from "./Pagination.js";
8
+ export { PostForm } from "./PostForm.js";
9
+ export { PostList } from "./PostList.js";
10
+ export { ThreadView } from "./ThreadView.js";
11
+ export { TypeBadge } from "./TypeBadge.js";
12
+ export { VisibilityBadge } from "./VisibilityBadge.js";
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Jant Theme Components
3
+ *
4
+ * These components can be imported for wrapping/extending:
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { PostCard } from "@jant/core/theme";
9
+ *
10
+ * export function MyPostCard(props) {
11
+ * return (
12
+ * <div class="my-wrapper">
13
+ * <PostCard {...props} />
14
+ * </div>
15
+ * );
16
+ * }
17
+ * ```
18
+ */
19
+ export * from "./layouts/index.js";
20
+ export * from "./components/index.js";
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,cAAc,oBAAoB,CAAC;AAGnC,cAAc,uBAAuB,CAAC"}
@@ -15,10 +15,7 @@
15
15
  * );
16
16
  * }
17
17
  * ```
18
- */
19
-
20
- // Layout components
18
+ */ // Layout components
21
19
  export * from "./layouts/index.js";
22
-
23
20
  // UI components
24
21
  export * from "./components/index.js";
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Base HTML Layout
3
+ *
4
+ * Provides the HTML shell with meta tags, styles, and scripts.
5
+ * If Context is provided, automatically wraps children with I18nProvider.
6
+ */
7
+ import type { FC, PropsWithChildren } from "hono/jsx";
8
+ import type { Context } from "hono";
9
+ export interface BaseLayoutProps {
10
+ title: string;
11
+ description?: string;
12
+ lang?: string;
13
+ c?: Context;
14
+ }
15
+ export declare const BaseLayout: FC<PropsWithChildren<BaseLayoutProps>>;
16
+ //# sourceMappingURL=BaseLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseLayout.d.ts","sourceRoot":"","sources":["../../../src/theme/layouts/BaseLayout.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAIpC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,CAAC,EAAE,OAAO,CAAC;CACb;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,eAAe,CAAC,CA6B7D,CAAC"}