@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.
Files changed (241) hide show
  1. package/dist/app.js +4 -0
  2. package/dist/client.js +1 -0
  3. package/dist/db/schema.js +13 -0
  4. package/dist/i18n/locales/en.js +1 -1
  5. package/dist/i18n/locales/zh-Hans.js +1 -1
  6. package/dist/i18n/locales/zh-Hant.js +1 -1
  7. package/dist/lib/image.js +3 -3
  8. package/dist/lib/media-helpers.js +43 -0
  9. package/dist/lib/nav-reorder.js +27 -0
  10. package/dist/lib/navigation.js +35 -0
  11. package/dist/lib/theme-components.js +49 -0
  12. package/dist/routes/api/timeline.js +115 -0
  13. package/dist/routes/api/upload.js +9 -5
  14. package/dist/routes/dash/navigation.js +274 -0
  15. package/dist/routes/pages/archive.js +14 -27
  16. package/dist/routes/pages/collection.js +10 -19
  17. package/dist/routes/pages/home.js +83 -126
  18. package/dist/routes/pages/page.js +19 -38
  19. package/dist/routes/pages/post.js +38 -51
  20. package/dist/routes/pages/search.js +13 -26
  21. package/dist/services/index.js +3 -1
  22. package/dist/services/media.js +1 -1
  23. package/dist/services/navigation.js +115 -0
  24. package/dist/services/post.js +26 -1
  25. package/dist/theme/components/PostList.js +5 -0
  26. package/dist/theme/components/index.js +2 -0
  27. package/dist/theme/components/timeline/ArticleCard.js +50 -0
  28. package/dist/theme/components/timeline/ImageCard.js +86 -0
  29. package/dist/theme/components/timeline/LinkCard.js +62 -0
  30. package/dist/theme/components/timeline/NoteCard.js +37 -0
  31. package/dist/theme/components/timeline/QuoteCard.js +51 -0
  32. package/dist/theme/components/timeline/ThreadPreview.js +52 -0
  33. package/dist/theme/components/timeline/TimelineFeed.js +43 -0
  34. package/dist/theme/components/timeline/TimelineItem.js +25 -0
  35. package/dist/theme/components/timeline/index.js +8 -0
  36. package/dist/theme/layouts/DashLayout.js +8 -0
  37. package/dist/theme/layouts/SiteLayout.js +160 -0
  38. package/dist/theme/layouts/index.js +1 -0
  39. package/dist/types/sortablejs.d.js +5 -0
  40. package/package.json +3 -2
  41. package/src/__tests__/helpers/db.ts +10 -0
  42. package/src/app.tsx +4 -0
  43. package/src/client.ts +1 -0
  44. package/src/db/migrations/0003_add_navigation_links.sql +8 -0
  45. package/src/db/migrations/meta/0003_snapshot.json +821 -0
  46. package/src/db/migrations/meta/_journal.json +14 -0
  47. package/src/db/schema.ts +13 -0
  48. package/src/i18n/locales/en.po +100 -32
  49. package/src/i18n/locales/en.ts +1 -1
  50. package/src/i18n/locales/zh-Hans.po +102 -55
  51. package/src/i18n/locales/zh-Hans.ts +1 -1
  52. package/src/i18n/locales/zh-Hant.po +102 -55
  53. package/src/i18n/locales/zh-Hant.ts +1 -1
  54. package/src/index.ts +5 -0
  55. package/src/lib/__tests__/theme-components.test.ts +107 -0
  56. package/src/lib/image.ts +3 -3
  57. package/src/lib/media-helpers.ts +54 -0
  58. package/src/lib/nav-reorder.ts +26 -0
  59. package/src/lib/navigation.ts +46 -0
  60. package/src/lib/theme-components.ts +76 -0
  61. package/src/routes/api/__tests__/posts.test.ts +8 -8
  62. package/src/routes/api/__tests__/timeline.test.ts +242 -0
  63. package/src/routes/api/timeline.tsx +145 -0
  64. package/src/routes/api/upload.ts +9 -5
  65. package/src/routes/dash/navigation.tsx +306 -0
  66. package/src/routes/pages/archive.tsx +15 -23
  67. package/src/routes/pages/collection.tsx +8 -15
  68. package/src/routes/pages/home.tsx +111 -122
  69. package/src/routes/pages/page.tsx +17 -30
  70. package/src/routes/pages/post.tsx +33 -42
  71. package/src/routes/pages/search.tsx +18 -22
  72. package/src/services/__tests__/media.test.ts +34 -7
  73. package/src/services/__tests__/navigation.test.ts +213 -0
  74. package/src/services/__tests__/post-timeline.test.ts +220 -0
  75. package/src/services/index.ts +7 -0
  76. package/src/services/media.ts +2 -1
  77. package/src/services/navigation.ts +165 -0
  78. package/src/services/post.ts +48 -1
  79. package/src/styles/components.css +59 -0
  80. package/src/theme/components/PostList.tsx +7 -0
  81. package/src/theme/components/index.ts +12 -0
  82. package/src/theme/components/timeline/ArticleCard.tsx +57 -0
  83. package/src/theme/components/timeline/ImageCard.tsx +80 -0
  84. package/src/theme/components/timeline/LinkCard.tsx +66 -0
  85. package/src/theme/components/timeline/NoteCard.tsx +41 -0
  86. package/src/theme/components/timeline/QuoteCard.tsx +55 -0
  87. package/src/theme/components/timeline/ThreadPreview.tsx +49 -0
  88. package/src/theme/components/timeline/TimelineFeed.tsx +52 -0
  89. package/src/theme/components/timeline/TimelineItem.tsx +39 -0
  90. package/src/theme/components/timeline/index.ts +8 -0
  91. package/src/theme/layouts/DashLayout.tsx +10 -0
  92. package/src/theme/layouts/SiteLayout.tsx +184 -0
  93. package/src/theme/layouts/index.ts +1 -0
  94. package/src/types/sortablejs.d.ts +23 -0
  95. package/src/types.ts +61 -0
  96. package/dist/app.d.ts +0 -38
  97. package/dist/app.d.ts.map +0 -1
  98. package/dist/auth.d.ts +0 -25
  99. package/dist/auth.d.ts.map +0 -1
  100. package/dist/db/index.d.ts +0 -10
  101. package/dist/db/index.d.ts.map +0 -1
  102. package/dist/db/schema.d.ts +0 -1543
  103. package/dist/db/schema.d.ts.map +0 -1
  104. package/dist/i18n/Trans.d.ts +0 -25
  105. package/dist/i18n/Trans.d.ts.map +0 -1
  106. package/dist/i18n/context.d.ts +0 -69
  107. package/dist/i18n/context.d.ts.map +0 -1
  108. package/dist/i18n/detect.d.ts +0 -20
  109. package/dist/i18n/detect.d.ts.map +0 -1
  110. package/dist/i18n/i18n.d.ts +0 -32
  111. package/dist/i18n/i18n.d.ts.map +0 -1
  112. package/dist/i18n/index.d.ts +0 -41
  113. package/dist/i18n/index.d.ts.map +0 -1
  114. package/dist/i18n/locales/en.d.ts +0 -3
  115. package/dist/i18n/locales/en.d.ts.map +0 -1
  116. package/dist/i18n/locales/zh-Hans.d.ts +0 -3
  117. package/dist/i18n/locales/zh-Hans.d.ts.map +0 -1
  118. package/dist/i18n/locales/zh-Hant.d.ts +0 -3
  119. package/dist/i18n/locales/zh-Hant.d.ts.map +0 -1
  120. package/dist/i18n/locales.d.ts +0 -11
  121. package/dist/i18n/locales.d.ts.map +0 -1
  122. package/dist/i18n/middleware.d.ts +0 -21
  123. package/dist/i18n/middleware.d.ts.map +0 -1
  124. package/dist/index.d.ts +0 -16
  125. package/dist/index.d.ts.map +0 -1
  126. package/dist/lib/config.d.ts +0 -83
  127. package/dist/lib/config.d.ts.map +0 -1
  128. package/dist/lib/constants.d.ts +0 -37
  129. package/dist/lib/constants.d.ts.map +0 -1
  130. package/dist/lib/image.d.ts +0 -73
  131. package/dist/lib/image.d.ts.map +0 -1
  132. package/dist/lib/index.d.ts +0 -9
  133. package/dist/lib/index.d.ts.map +0 -1
  134. package/dist/lib/markdown.d.ts +0 -60
  135. package/dist/lib/markdown.d.ts.map +0 -1
  136. package/dist/lib/schemas.d.ts +0 -130
  137. package/dist/lib/schemas.d.ts.map +0 -1
  138. package/dist/lib/sqid.d.ts +0 -60
  139. package/dist/lib/sqid.d.ts.map +0 -1
  140. package/dist/lib/sse.d.ts +0 -192
  141. package/dist/lib/sse.d.ts.map +0 -1
  142. package/dist/lib/theme.d.ts +0 -44
  143. package/dist/lib/theme.d.ts.map +0 -1
  144. package/dist/lib/time.d.ts +0 -90
  145. package/dist/lib/time.d.ts.map +0 -1
  146. package/dist/lib/url.d.ts +0 -82
  147. package/dist/lib/url.d.ts.map +0 -1
  148. package/dist/middleware/auth.d.ts +0 -24
  149. package/dist/middleware/auth.d.ts.map +0 -1
  150. package/dist/middleware/onboarding.d.ts +0 -26
  151. package/dist/middleware/onboarding.d.ts.map +0 -1
  152. package/dist/routes/api/posts.d.ts +0 -13
  153. package/dist/routes/api/posts.d.ts.map +0 -1
  154. package/dist/routes/api/search.d.ts +0 -13
  155. package/dist/routes/api/search.d.ts.map +0 -1
  156. package/dist/routes/api/upload.d.ts +0 -16
  157. package/dist/routes/api/upload.d.ts.map +0 -1
  158. package/dist/routes/dash/collections.d.ts +0 -13
  159. package/dist/routes/dash/collections.d.ts.map +0 -1
  160. package/dist/routes/dash/index.d.ts +0 -15
  161. package/dist/routes/dash/index.d.ts.map +0 -1
  162. package/dist/routes/dash/media.d.ts +0 -16
  163. package/dist/routes/dash/media.d.ts.map +0 -1
  164. package/dist/routes/dash/pages.d.ts +0 -15
  165. package/dist/routes/dash/pages.d.ts.map +0 -1
  166. package/dist/routes/dash/posts.d.ts +0 -13
  167. package/dist/routes/dash/posts.d.ts.map +0 -1
  168. package/dist/routes/dash/redirects.d.ts +0 -13
  169. package/dist/routes/dash/redirects.d.ts.map +0 -1
  170. package/dist/routes/dash/settings.d.ts +0 -15
  171. package/dist/routes/dash/settings.d.ts.map +0 -1
  172. package/dist/routes/feed/rss.d.ts +0 -13
  173. package/dist/routes/feed/rss.d.ts.map +0 -1
  174. package/dist/routes/feed/sitemap.d.ts +0 -13
  175. package/dist/routes/feed/sitemap.d.ts.map +0 -1
  176. package/dist/routes/pages/archive.d.ts +0 -15
  177. package/dist/routes/pages/archive.d.ts.map +0 -1
  178. package/dist/routes/pages/collection.d.ts +0 -13
  179. package/dist/routes/pages/collection.d.ts.map +0 -1
  180. package/dist/routes/pages/home.d.ts +0 -13
  181. package/dist/routes/pages/home.d.ts.map +0 -1
  182. package/dist/routes/pages/page.d.ts +0 -15
  183. package/dist/routes/pages/page.d.ts.map +0 -1
  184. package/dist/routes/pages/post.d.ts +0 -13
  185. package/dist/routes/pages/post.d.ts.map +0 -1
  186. package/dist/routes/pages/search.d.ts +0 -13
  187. package/dist/routes/pages/search.d.ts.map +0 -1
  188. package/dist/services/collection.d.ts +0 -32
  189. package/dist/services/collection.d.ts.map +0 -1
  190. package/dist/services/index.d.ts +0 -28
  191. package/dist/services/index.d.ts.map +0 -1
  192. package/dist/services/media.d.ts +0 -34
  193. package/dist/services/media.d.ts.map +0 -1
  194. package/dist/services/post.d.ts +0 -31
  195. package/dist/services/post.d.ts.map +0 -1
  196. package/dist/services/redirect.d.ts +0 -15
  197. package/dist/services/redirect.d.ts.map +0 -1
  198. package/dist/services/search.d.ts +0 -26
  199. package/dist/services/search.d.ts.map +0 -1
  200. package/dist/services/settings.d.ts +0 -18
  201. package/dist/services/settings.d.ts.map +0 -1
  202. package/dist/theme/color-themes.d.ts +0 -30
  203. package/dist/theme/color-themes.d.ts.map +0 -1
  204. package/dist/theme/components/ActionButtons.d.ts +0 -43
  205. package/dist/theme/components/ActionButtons.d.ts.map +0 -1
  206. package/dist/theme/components/CrudPageHeader.d.ts +0 -23
  207. package/dist/theme/components/CrudPageHeader.d.ts.map +0 -1
  208. package/dist/theme/components/DangerZone.d.ts +0 -36
  209. package/dist/theme/components/DangerZone.d.ts.map +0 -1
  210. package/dist/theme/components/EmptyState.d.ts +0 -27
  211. package/dist/theme/components/EmptyState.d.ts.map +0 -1
  212. package/dist/theme/components/ListItemRow.d.ts +0 -15
  213. package/dist/theme/components/ListItemRow.d.ts.map +0 -1
  214. package/dist/theme/components/MediaGallery.d.ts +0 -13
  215. package/dist/theme/components/MediaGallery.d.ts.map +0 -1
  216. package/dist/theme/components/PageForm.d.ts +0 -14
  217. package/dist/theme/components/PageForm.d.ts.map +0 -1
  218. package/dist/theme/components/Pagination.d.ts +0 -46
  219. package/dist/theme/components/Pagination.d.ts.map +0 -1
  220. package/dist/theme/components/PostForm.d.ts +0 -16
  221. package/dist/theme/components/PostForm.d.ts.map +0 -1
  222. package/dist/theme/components/PostList.d.ts +0 -10
  223. package/dist/theme/components/PostList.d.ts.map +0 -1
  224. package/dist/theme/components/ThreadView.d.ts +0 -15
  225. package/dist/theme/components/ThreadView.d.ts.map +0 -1
  226. package/dist/theme/components/TypeBadge.d.ts +0 -12
  227. package/dist/theme/components/TypeBadge.d.ts.map +0 -1
  228. package/dist/theme/components/VisibilityBadge.d.ts +0 -12
  229. package/dist/theme/components/VisibilityBadge.d.ts.map +0 -1
  230. package/dist/theme/components/index.d.ts +0 -14
  231. package/dist/theme/components/index.d.ts.map +0 -1
  232. package/dist/theme/index.d.ts +0 -21
  233. package/dist/theme/index.d.ts.map +0 -1
  234. package/dist/theme/layouts/BaseLayout.d.ts +0 -23
  235. package/dist/theme/layouts/BaseLayout.d.ts.map +0 -1
  236. package/dist/theme/layouts/DashLayout.d.ts +0 -17
  237. package/dist/theme/layouts/DashLayout.d.ts.map +0 -1
  238. package/dist/theme/layouts/index.d.ts +0 -3
  239. package/dist/theme/layouts/index.d.ts.map +0 -1
  240. package/dist/types.d.ts +0 -237
  241. package/dist/types.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBhB,CAAC;AAMH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAchB,CAAC;AAMH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOtB,CAAC;AAMH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY3B,CAAC;AAMF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMpB,CAAC;AAMH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAInB,CAAC;AAOH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWf,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWlB,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBlB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOvB,CAAC"}
@@ -1,25 +0,0 @@
1
- /**
2
- * Trans Component for Hono JSX
3
- *
4
- * Simple implementation that just renders children directly.
5
- * For complex translations with embedded JSX, use the t() function with placeholders.
6
- */
7
- import type { FC, PropsWithChildren } from "hono/jsx";
8
- export interface TransProps extends PropsWithChildren {
9
- comment?: string;
10
- id?: string;
11
- }
12
- /**
13
- * Trans component - renders children as-is
14
- * Note: This is a simplified implementation. For translations with embedded JSX,
15
- * it's recommended to use t() with placeholders instead.
16
- *
17
- * @example
18
- * ```tsx
19
- * <Trans comment="@context: Help text">
20
- * Visit the <a href="/docs">documentation</a>
21
- * </Trans>
22
- * ```
23
- */
24
- export declare const Trans: FC<TransProps>;
25
- //# sourceMappingURL=Trans.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Trans.d.ts","sourceRoot":"","sources":["../../src/i18n/Trans.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEtD,MAAM,WAAW,UAAW,SAAQ,iBAAiB;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAIhC,CAAC"}
@@ -1,69 +0,0 @@
1
- /**
2
- * Hono JSX i18n Context System
3
- *
4
- * Mimics React's Context API for Hono JSX to provide i18n without prop drilling
5
- */
6
- import type { Context } from "hono";
7
- import type { FC, PropsWithChildren } from "hono/jsx";
8
- import type { I18n } from "@lingui/core";
9
- /**
10
- * Message descriptor that accepts both pre-macro (without id) and post-macro (with id) formats
11
- * This allows TypeScript to accept t({ message, comment }) before macro transformation
12
- */
13
- type TranslationDescriptor = {
14
- id?: string;
15
- message: string;
16
- comment?: string;
17
- values?: Record<string, any>;
18
- };
19
- /**
20
- * I18nProvider - wraps your app to provide i18n context
21
- *
22
- * @example
23
- * ```tsx
24
- * import { I18nProvider } from "../i18n/index.js";
25
- *
26
- * return c.html(
27
- * <I18nProvider c={c}>
28
- * <YourApp />
29
- * </I18nProvider>
30
- * );
31
- * ```
32
- */
33
- export interface I18nProviderProps extends PropsWithChildren {
34
- c: Context;
35
- }
36
- export declare const I18nProvider: FC<I18nProviderProps>;
37
- /**
38
- * useLingui hook - get i18n instance and translation function
39
- * Mimics @lingui/react's useLingui() API
40
- *
41
- * @example
42
- * ```tsx
43
- * import { t } from "@lingui/core/macro";
44
- * import { useLingui } from "../i18n/index.js";
45
- *
46
- * function MyComponent() {
47
- * const { t: _ } = useLingui(); // Use _ to avoid conflict with macro
48
- *
49
- * return (
50
- * <div>
51
- * <h1>{_(t({ message: "Dashboard", comment: "@context: Page title" }))}</h1>
52
- * </div>
53
- * );
54
- * }
55
- * ```
56
- *
57
- * Or use the i18n instance directly:
58
- * ```tsx
59
- * const { i18n } = useLingui();
60
- * i18n._(t({ message: "Dashboard", comment: "@context: Page title" }))
61
- * ```
62
- */
63
- export declare function useLingui(): {
64
- i18n: I18n;
65
- t: (descriptor: TranslationDescriptor) => string;
66
- _: (descriptor: TranslationDescriptor) => string;
67
- };
68
- export {};
69
- //# sourceMappingURL=context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/i18n/context.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAqB,MAAM,cAAc,CAAC;AAG5D;;;GAGG;AACH,KAAK,qBAAqB,GAAG;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B,CAAC;AAKF;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,CAAC,EAAE,OAAO,CAAC;CACZ;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAM9C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,SAAS;;oBAQQ,qBAAqB;oBAArB,qBAAqB;EAYrD"}
@@ -1,20 +0,0 @@
1
- /**
2
- * Language Detection Utilities
3
- */
4
- import { type Locale } from "./locales.js";
5
- /**
6
- * Get display name for a language code
7
- */
8
- export declare function getLanguageDisplayName(locale: Locale): string;
9
- /**
10
- * Get all supported languages with display names
11
- */
12
- export declare function getSupportedLanguages(): Array<{
13
- code: Locale;
14
- name: string;
15
- }>;
16
- /**
17
- * Check if a language code is valid
18
- */
19
- export declare function isValidLanguage(lang: unknown): lang is Locale;
20
- //# sourceMappingURL=detect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/i18n/detect.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAqB,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAE9D;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAO7D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAK7E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,MAAM,CAE7D"}
@@ -1,32 +0,0 @@
1
- /**
2
- * i18n Runtime using @lingui/core
3
- *
4
- * The SWC Lingui plugin adds hash-based IDs to t() calls when imports come
5
- * from @lingui/react/macro. The runtimeConfigModule setting rewrites those
6
- * imports to our custom Hono JSX implementation at build time.
7
- */
8
- import { I18n } from "@lingui/core";
9
- import { locales, baseLocale, isLocale, type Locale } from "./locales.js";
10
- export { locales, baseLocale, isLocale, type Locale };
11
- export type { I18n };
12
- /**
13
- * Create a new i18n instance for a specific locale.
14
- * IMPORTANT: In Cloudflare Workers (concurrent environment), we must create
15
- * a new instance per request to avoid race conditions. Never use a global instance!
16
- */
17
- export declare function createI18n(locale: Locale): I18n;
18
- /**
19
- * Helper to get the per-request i18n instance from Hono context.
20
- * Use this in route handlers.
21
- *
22
- * @example
23
- * import { msg } from "@lingui/core/macro";
24
- * import { getI18n } from "../i18n/index.js";
25
- *
26
- * const i18n = getI18n(c);
27
- * const title = i18n._(msg({ message: "Dashboard", comment: "@context: Page title" }));
28
- */
29
- export declare function getI18n(c: {
30
- get(key: "i18n"): I18n;
31
- }): I18n;
32
- //# sourceMappingURL=i18n.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/i18n/i18n.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAK1E,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;AAGtD,YAAY,EAAE,IAAI,EAAE,CAAC;AASrB;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAU/C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE;IAAE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,CAE3D"}
@@ -1,41 +0,0 @@
1
- /**
2
- * i18n Module
3
- *
4
- * IMPORTANT: This module is designed for concurrent environments (Cloudflare Workers).
5
- * We create a new i18n instance per request to avoid race conditions.
6
- *
7
- * This is a custom implementation compatible with Hono JSX (SSR), not React.
8
- * It provides a React-like API using Lingui macros with a custom context system.
9
- *
10
- * Usage:
11
- * ```tsx
12
- * import { useLingui, Trans, I18nProvider } from "../i18n/index.js";
13
- *
14
- * // Wrap your app in I18nProvider (automatically done by BaseLayout when c is provided)
15
- * c.html(
16
- * <I18nProvider c={c}>
17
- * <MyApp />
18
- * </I18nProvider>
19
- * );
20
- *
21
- * // Inside components, use useLingui() hook
22
- * function MyApp() {
23
- * const { t } = useLingui();
24
- *
25
- * return (
26
- * <div>
27
- * <h1>{t({ message: "Dashboard", comment: "@context: Page title" })}</h1>
28
- * <Trans comment="@context: Help text">
29
- * Read the <a href="/docs">documentation</a>
30
- * </Trans>
31
- * </div>
32
- * );
33
- * }
34
- * ```
35
- */
36
- export { createI18n, getI18n, locales, baseLocale, isLocale, type Locale, type I18n, } from "./i18n.js";
37
- export { I18nProvider, useLingui } from "./context.js";
38
- export { Trans } from "./Trans.js";
39
- export { isValidLanguage, getLanguageDisplayName, getSupportedLanguages, } from "./detect.js";
40
- export { i18nMiddleware } from "./middleware.js";
41
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,EACL,UAAU,EACV,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,KAAK,MAAM,EACX,KAAK,IAAI,GACV,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Messages } from "@lingui/core";
2
- export declare const messages: Messages;
3
- //# sourceMappingURL=en.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/i18n/locales/en.ts"],"names":[],"mappings":"AAAkB,OAAO,KAAI,EAAC,QAAQ,EAAC,MAAI,cAAc,CAAC;AAAA,eAAO,MAAM,QAAQ,EAA6tL,QAAQ,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Messages } from "@lingui/core";
2
- export declare const messages: Messages;
3
- //# sourceMappingURL=zh-Hans.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"zh-Hans.d.ts","sourceRoot":"","sources":["../../../src/i18n/locales/zh-Hans.ts"],"names":[],"mappings":"AAAkB,OAAO,KAAI,EAAC,QAAQ,EAAC,MAAI,cAAc,CAAC;AAAA,eAAO,MAAM,QAAQ,EAAmxI,QAAQ,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Messages } from "@lingui/core";
2
- export declare const messages: Messages;
3
- //# sourceMappingURL=zh-Hant.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"zh-Hant.d.ts","sourceRoot":"","sources":["../../../src/i18n/locales/zh-Hant.ts"],"names":[],"mappings":"AAAkB,OAAO,KAAI,EAAC,QAAQ,EAAC,MAAI,cAAc,CAAC;AAAA,eAAO,MAAM,QAAQ,EAAuyI,QAAQ,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Centralized locale configuration
3
- */
4
- export declare const locales: readonly ["en", "zh-Hans", "zh-Hant"];
5
- export type Locale = (typeof locales)[number];
6
- export declare const baseLocale: Locale;
7
- /**
8
- * Check if a value is a valid locale
9
- */
10
- export declare function isLocale(value: unknown): value is Locale;
11
- //# sourceMappingURL=locales.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../src/i18n/locales.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,OAAO,uCAAwC,CAAC;AAC7D,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9C,eAAO,MAAM,UAAU,EAAE,MAAa,CAAC;AAEvC;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD"}
@@ -1,21 +0,0 @@
1
- /**
2
- * i18n Hono Middleware
3
- */
4
- import type { MiddlewareHandler } from "hono";
5
- import type { I18n } from "@lingui/core";
6
- import { type Locale } from "./i18n.js";
7
- declare module "hono" {
8
- interface ContextVariableMap {
9
- lang: Locale;
10
- i18n: I18n;
11
- }
12
- }
13
- /**
14
- * Hono middleware for internationalization.
15
- * Creates a per-request i18n instance to avoid race conditions in concurrent environments.
16
- *
17
- * Language is determined by the database SITE_LANGUAGE setting (single source of truth).
18
- * Falls back to the default locale (en) if not set.
19
- */
20
- export declare function i18nMiddleware(): MiddlewareHandler;
21
- //# sourceMappingURL=middleware.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/i18n/middleware.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAoC,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAG1E,OAAO,QAAQ,MAAM,CAAC;IACpB,UAAU,kBAAkB;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,IAAI,CAAC;KACZ;CACF;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,iBAAiB,CAuBlD"}
package/dist/index.d.ts DELETED
@@ -1,16 +0,0 @@
1
- /**
2
- * Jant - A microblog system
3
- *
4
- * @packageDocumentation
5
- */
6
- export { createApp } from "./app.js";
7
- export type { App, AppVariables } from "./app.js";
8
- export type { PostType, Visibility, Bindings, Post, Media, MediaAttachment, PostWithMedia, Collection, PostCollection, Redirect, Setting, CreatePost, UpdatePost, JantConfig, JantTheme, ThemeComponents, } from "./types.js";
9
- export { POST_TYPES, VISIBILITY_LEVELS, MAX_MEDIA_ATTACHMENTS, POST_TYPE_MEDIA_RULES, } from "./types.js";
10
- export * as time from "./lib/time.js";
11
- export * as sqid from "./lib/sqid.js";
12
- export * as url from "./lib/url.js";
13
- export * as markdown from "./lib/markdown.js";
14
- declare const _default: import("./app.js").App;
15
- export default _default;
16
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGlD,YAAY,EACV,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,eAAe,EACf,aAAa,EACb,UAAU,EACV,cAAc,EACd,QAAQ,EACR,OAAO,EACP,UAAU,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;;AAG9C,wBAA4B"}
@@ -1,83 +0,0 @@
1
- /**
2
- * Unified Configuration System
3
- *
4
- * Provides a flexible configuration system with two priority modes:
5
- * - User-configurable (envOnly: false): Database > Environment > Default
6
- * - Environment-only (envOnly: true): Environment > Default
7
- *
8
- * All configuration fields are defined in CONFIG_FIELDS (types.ts).
9
- */
10
- import type { Context } from "hono";
11
- import { type ConfigKey } from "../types.js";
12
- /**
13
- * Get the fallback value for a config key (ENV > Default), skipping the database.
14
- * Used for placeholder values in forms where the DB value is shown separately.
15
- *
16
- * @param c - Hono context
17
- * @param key - Configuration key from CONFIG_FIELDS
18
- * @returns Fallback value from environment or default
19
- *
20
- * @example
21
- * ```typescript
22
- * const placeholder = getConfigFallback(c, "SITE_NAME");
23
- * // Returns: c.env.SITE_NAME ?? "Jant"
24
- * ```
25
- */
26
- export declare function getConfigFallback(c: Context, key: ConfigKey): string;
27
- /**
28
- * Generic configuration getter that respects priority settings
29
- *
30
- * @param c - Hono context
31
- * @param key - Configuration key from CONFIG_FIELDS
32
- * @returns Configuration value following the defined priority
33
- *
34
- * @example
35
- * ```typescript
36
- * // For user-configurable configs (SITE_NAME):
37
- * // Returns: (DB: SITE_NAME) ?? c.env.SITE_NAME ?? "Jant"
38
- *
39
- * // For environment-only configs (SITE_URL):
40
- * // Returns: c.env.SITE_URL ?? ""
41
- * ```
42
- */
43
- export declare function getConfig(c: Context, key: ConfigKey): Promise<string>;
44
- /**
45
- * Get site name with fallback chain: DB > ENV > Default
46
- *
47
- * @param c - Hono context
48
- * @returns Site name
49
- *
50
- * @example
51
- * ```typescript
52
- * const siteName = await getSiteName(c);
53
- * // Returns: (DB: SITE_NAME) ?? c.env.SITE_NAME ?? "Jant"
54
- * ```
55
- */
56
- export declare function getSiteName(c: Context): Promise<string>;
57
- /**
58
- * Get site description with fallback chain: DB > ENV > Default
59
- *
60
- * @param c - Hono context
61
- * @returns Site description
62
- *
63
- * @example
64
- * ```typescript
65
- * const description = await getSiteDescription(c);
66
- * // Returns: (DB: SITE_DESCRIPTION) ?? c.env.SITE_DESCRIPTION ?? "A microblog powered by Jant"
67
- * ```
68
- */
69
- export declare function getSiteDescription(c: Context): Promise<string>;
70
- /**
71
- * Get site language with fallback chain: DB > ENV > Default
72
- *
73
- * @param c - Hono context
74
- * @returns Site language code
75
- *
76
- * @example
77
- * ```typescript
78
- * const lang = await getSiteLanguage(c);
79
- * // Returns: (DB: SITE_LANGUAGE) ?? c.env.SITE_LANGUAGE ?? "en"
80
- * ```
81
- */
82
- export declare function getSiteLanguage(c: Context): Promise<string>;
83
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,GAAG,MAAM,CAKpE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAqB3E;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7D;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAEjE"}
@@ -1,37 +0,0 @@
1
- /**
2
- * Application Constants
3
- */
4
- /**
5
- * Reserved URL paths that cannot be used for pages
6
- */
7
- export declare const RESERVED_PATHS: readonly ["featured", "signin", "signout", "setup", "dash", "api", "feed", "search", "archive", "notes", "articles", "links", "quotes", "media", "pages", "reset", "p", "c", "static", "assets", "health"];
8
- export type ReservedPath = (typeof RESERVED_PATHS)[number];
9
- /**
10
- * Check if a path is reserved
11
- */
12
- export declare function isReservedPath(path: string): boolean;
13
- /**
14
- * Default pagination size
15
- */
16
- export declare const DEFAULT_PAGE_SIZE = 100;
17
- /**
18
- * Settings keys (match environment variable naming)
19
- */
20
- export declare const SETTINGS_KEYS: {
21
- readonly ONBOARDING_STATUS: "ONBOARDING_STATUS";
22
- readonly SITE_NAME: "SITE_NAME";
23
- readonly SITE_DESCRIPTION: "SITE_DESCRIPTION";
24
- readonly SITE_LANGUAGE: "SITE_LANGUAGE";
25
- readonly THEME: "THEME";
26
- readonly PASSWORD_RESET_TOKEN: "PASSWORD_RESET_TOKEN";
27
- };
28
- export type SettingsKey = (typeof SETTINGS_KEYS)[keyof typeof SETTINGS_KEYS];
29
- /**
30
- * Onboarding status values
31
- */
32
- export declare const ONBOARDING_STATUS: {
33
- readonly PENDING: "pending";
34
- readonly COMPLETED: "completed";
35
- };
36
- export type OnboardingStatus = (typeof ONBOARDING_STATUS)[keyof typeof ONBOARDING_STATUS];
37
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc,4MAsBjB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGpD;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;CAOhB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;CAGpB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC"}
@@ -1,73 +0,0 @@
1
- /**
2
- * Image URL utilities
3
- *
4
- * Provides helpers for generating image URLs with optional transformations.
5
- */
6
- /**
7
- * Options for image transformations
8
- */
9
- export interface ImageOptions {
10
- /** Target width in pixels */
11
- width?: number;
12
- /** Target height in pixels */
13
- height?: number;
14
- /** Quality (1-100) */
15
- quality?: number;
16
- /** Output format */
17
- format?: "webp" | "avif" | "auto";
18
- /** Fit mode for resizing */
19
- fit?: "cover" | "contain" | "scale-down";
20
- }
21
- /**
22
- * Generates an image URL with optional transformations.
23
- *
24
- * If `transformUrl` is provided and options are specified, returns a transformed image URL.
25
- * Otherwise, returns the original URL unchanged.
26
- *
27
- * Compatible with:
28
- * - Cloudflare Image Transformations (`/cdn-cgi/image/...`)
29
- * - imgproxy
30
- * - Cloudinary
31
- * - Any service with similar URL-based transformation API
32
- *
33
- * @param originalUrl - The original image URL
34
- * @param transformUrl - The base URL for transformations (e.g., `https://example.com/cdn-cgi/image`)
35
- * @param options - Transformation options (width, height, quality, format, fit)
36
- * @returns The transformed URL or original URL if transformations are not configured
37
- *
38
- * @example
39
- * ```ts
40
- * // Without transform URL - returns original
41
- * getImageUrl("/media/abc123", undefined, { width: 200 });
42
- * // Returns: "/media/abc123"
43
- *
44
- * // With transform URL - returns transformed
45
- * getImageUrl("/media/abc123", "https://example.com/cdn-cgi/image", { width: 200, quality: 80 });
46
- * // Returns: "https://example.com/cdn-cgi/image/width=200,quality=80/https://example.com/media/abc123"
47
- * ```
48
- */
49
- export declare function getImageUrl(originalUrl: string, transformUrl?: string, options?: ImageOptions): string;
50
- /**
51
- * Generates a media URL using UUIDv7-based paths.
52
- *
53
- * Returns a public URL for a media file. If `r2PublicUrl` is set, uses that directly
54
- * with the r2Key. Otherwise, generates a `/media/{id}.{ext}` URL.
55
- *
56
- * @param mediaId - The UUIDv7 database ID of the media
57
- * @param r2Key - The R2 storage key (used to extract extension)
58
- * @param r2PublicUrl - Optional R2 public URL for direct CDN access
59
- * @returns The public URL for the media file
60
- *
61
- * @example
62
- * ```ts
63
- * // Without R2 public URL - uses UUID with extension
64
- * getMediaUrl("01902a9f-1a2b-7c3d-8e4f-5a6b7c8d9e0f", "uploads/file.webp");
65
- * // Returns: "/media/01902a9f-1a2b-7c3d-8e4f-5a6b7c8d9e0f.webp"
66
- *
67
- * // With R2 public URL - uses direct CDN
68
- * getMediaUrl("01902a9f-1a2b-7c3d-8e4f-5a6b7c8d9e0f", "uploads/file.webp", "https://cdn.example.com");
69
- * // Returns: "https://cdn.example.com/uploads/file.webp"
70
- * ```
71
- */
72
- export declare function getMediaUrl(mediaId: string, r2Key: string, r2PublicUrl?: string): string;
73
- //# sourceMappingURL=image.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/lib/image.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,4BAA4B;IAC5B,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,YAAY,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,WAAW,CACzB,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,YAAY,GACrB,MAAM,CAiBR;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAOR"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Utility Functions
3
- */
4
- export * from "./constants.js";
5
- export * as sqid from "./sqid.js";
6
- export * as time from "./time.js";
7
- export * as url from "./url.js";
8
- export * as markdown from "./markdown.js";
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC"}
@@ -1,60 +0,0 @@
1
- /**
2
- * Markdown Rendering
3
- *
4
- * Uses marked with minimal configuration
5
- */
6
- /**
7
- * Renders Markdown content to HTML using the marked library.
8
- *
9
- * Configured with GitHub Flavored Markdown (GFM) support and line breaks enabled.
10
- * Uses synchronous parsing for simplicity and consistency in server-side rendering.
11
- *
12
- * @param markdown - The Markdown string to convert to HTML
13
- * @returns The rendered HTML string
14
- *
15
- * @example
16
- * ```ts
17
- * const html = render("# Hello\n\nThis is **bold** text.");
18
- * // Returns: "<h1>Hello</h1>\n<p>This is <strong>bold</strong> text.</p>"
19
- * ```
20
- */
21
- export declare function render(markdown: string): string;
22
- /**
23
- * Converts Markdown to plain text by stripping all formatting syntax.
24
- *
25
- * Removes Markdown syntax including headers, bold, italic, links, images, code blocks,
26
- * blockquotes, lists, and converts newlines to spaces. Useful for generating text excerpts,
27
- * meta descriptions, or search indexes.
28
- *
29
- * @param markdown - The Markdown string to convert to plain text
30
- * @returns The plain text string with all Markdown syntax removed
31
- *
32
- * @example
33
- * ```ts
34
- * const plain = toPlainText("## Hello\n\nThis is **bold** and [a link](url).");
35
- * // Returns: "Hello This is bold and a link."
36
- * ```
37
- */
38
- export declare function toPlainText(markdown: string): string;
39
- /**
40
- * Extracts a title from Markdown content by taking the first sentence or line.
41
- *
42
- * Converts Markdown to plain text first, then takes the first sentence (split by `.!?`)
43
- * or truncates to the specified maximum length. Useful for generating automatic titles
44
- * from post content when no explicit title is provided.
45
- *
46
- * @param markdown - The Markdown string to extract a title from
47
- * @param maxLength - Maximum length of the extracted title (default: 120)
48
- * @returns The extracted title string, with "..." appended if truncated
49
- *
50
- * @example
51
- * ```ts
52
- * const title = extractTitle("This is the first sentence. And another one.", 50);
53
- * // Returns: "This is the first sentence"
54
- *
55
- * const title = extractTitle("A very long sentence that exceeds the maximum length...", 30);
56
- * // Returns: "A very long sentence that ex..."
57
- * ```
58
- */
59
- export declare function extractTitle(markdown: string, maxLength?: number): string;
60
- //# sourceMappingURL=markdown.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/lib/markdown.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAYpD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,SAAM,GAAG,MAAM,CAStE"}