@jant/core 0.3.6 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +11 -21
- package/dist/client.js +1 -0
- package/dist/db/schema.js +15 -0
- package/dist/i18n/locales/en.js +1 -1
- package/dist/i18n/locales/zh-Hans.js +1 -1
- package/dist/i18n/locales/zh-Hant.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/image.js +3 -3
- package/dist/lib/media-helpers.js +43 -0
- package/dist/lib/nav-reorder.js +27 -0
- package/dist/lib/navigation.js +35 -0
- package/dist/lib/schemas.js +32 -2
- package/dist/lib/sse.js +7 -8
- package/dist/lib/theme-components.js +49 -0
- package/dist/routes/api/posts.js +101 -5
- package/dist/routes/api/timeline.js +115 -0
- package/dist/routes/api/upload.js +9 -5
- package/dist/routes/dash/media.js +38 -0
- package/dist/routes/dash/navigation.js +274 -0
- package/dist/routes/dash/posts.js +45 -6
- package/dist/routes/feed/rss.js +10 -1
- package/dist/routes/pages/archive.js +14 -27
- package/dist/routes/pages/collection.js +10 -19
- package/dist/routes/pages/home.js +88 -98
- package/dist/routes/pages/page.js +19 -38
- package/dist/routes/pages/post.js +61 -48
- package/dist/routes/pages/search.js +13 -26
- package/dist/services/collection.js +13 -0
- package/dist/services/index.js +3 -1
- package/dist/services/media.js +55 -2
- package/dist/services/navigation.js +115 -0
- package/dist/services/post.js +26 -1
- package/dist/theme/components/MediaGallery.js +107 -0
- package/dist/theme/components/PostForm.js +158 -2
- package/dist/theme/components/PostList.js +5 -0
- package/dist/theme/components/index.js +3 -0
- package/dist/theme/components/timeline/ArticleCard.js +50 -0
- package/dist/theme/components/timeline/ImageCard.js +86 -0
- package/dist/theme/components/timeline/LinkCard.js +62 -0
- package/dist/theme/components/timeline/NoteCard.js +37 -0
- package/dist/theme/components/timeline/QuoteCard.js +51 -0
- package/dist/theme/components/timeline/ThreadPreview.js +52 -0
- package/dist/theme/components/timeline/TimelineFeed.js +43 -0
- package/dist/theme/components/timeline/TimelineItem.js +25 -0
- package/dist/theme/components/timeline/index.js +8 -0
- package/dist/theme/layouts/DashLayout.js +8 -0
- package/dist/theme/layouts/SiteLayout.js +160 -0
- package/dist/theme/layouts/index.js +1 -0
- package/dist/types/sortablejs.d.js +5 -0
- package/dist/types.js +27 -0
- package/package.json +3 -2
- package/src/__tests__/helpers/app.ts +6 -1
- package/src/__tests__/helpers/db.ts +20 -0
- package/src/app.tsx +11 -25
- package/src/client.ts +1 -0
- package/src/db/migrations/0002_add_media_attachments.sql +3 -0
- package/src/db/migrations/0003_add_navigation_links.sql +8 -0
- package/src/db/migrations/meta/0003_snapshot.json +821 -0
- package/src/db/migrations/meta/_journal.json +14 -0
- package/src/db/schema.ts +15 -0
- package/src/i18n/locales/en.po +170 -58
- package/src/i18n/locales/en.ts +1 -1
- package/src/i18n/locales/zh-Hans.po +162 -71
- package/src/i18n/locales/zh-Hans.ts +1 -1
- package/src/i18n/locales/zh-Hant.po +162 -71
- package/src/i18n/locales/zh-Hant.ts +1 -1
- package/src/index.ts +13 -1
- package/src/lib/__tests__/schemas.test.ts +89 -1
- package/src/lib/__tests__/sse.test.ts +13 -1
- package/src/lib/__tests__/theme-components.test.ts +107 -0
- package/src/lib/image.ts +3 -3
- package/src/lib/media-helpers.ts +54 -0
- package/src/lib/nav-reorder.ts +26 -0
- package/src/lib/navigation.ts +46 -0
- package/src/lib/schemas.ts +47 -1
- package/src/lib/sse.ts +10 -11
- package/src/lib/theme-components.ts +76 -0
- package/src/routes/api/__tests__/posts.test.ts +239 -0
- package/src/routes/api/__tests__/timeline.test.ts +242 -0
- package/src/routes/api/posts.ts +134 -5
- package/src/routes/api/timeline.tsx +145 -0
- package/src/routes/api/upload.ts +9 -5
- package/src/routes/dash/media.tsx +50 -0
- package/src/routes/dash/navigation.tsx +306 -0
- package/src/routes/dash/posts.tsx +79 -7
- package/src/routes/feed/rss.ts +14 -1
- package/src/routes/pages/archive.tsx +15 -23
- package/src/routes/pages/collection.tsx +8 -15
- package/src/routes/pages/home.tsx +121 -88
- package/src/routes/pages/page.tsx +17 -30
- package/src/routes/pages/post.tsx +64 -40
- package/src/routes/pages/search.tsx +18 -22
- package/src/services/__tests__/collection.test.ts +102 -0
- package/src/services/__tests__/media.test.ts +282 -7
- package/src/services/__tests__/navigation.test.ts +213 -0
- package/src/services/__tests__/post-timeline.test.ts +220 -0
- package/src/services/collection.ts +19 -0
- package/src/services/index.ts +7 -0
- package/src/services/media.ts +78 -2
- package/src/services/navigation.ts +165 -0
- package/src/services/post.ts +48 -1
- package/src/styles/components.css +59 -0
- package/src/theme/components/MediaGallery.tsx +128 -0
- package/src/theme/components/PostForm.tsx +170 -2
- package/src/theme/components/PostList.tsx +7 -0
- package/src/theme/components/index.ts +13 -0
- package/src/theme/components/timeline/ArticleCard.tsx +57 -0
- package/src/theme/components/timeline/ImageCard.tsx +80 -0
- package/src/theme/components/timeline/LinkCard.tsx +66 -0
- package/src/theme/components/timeline/NoteCard.tsx +41 -0
- package/src/theme/components/timeline/QuoteCard.tsx +55 -0
- package/src/theme/components/timeline/ThreadPreview.tsx +49 -0
- package/src/theme/components/timeline/TimelineFeed.tsx +52 -0
- package/src/theme/components/timeline/TimelineItem.tsx +39 -0
- package/src/theme/components/timeline/index.ts +8 -0
- package/src/theme/layouts/DashLayout.tsx +10 -0
- package/src/theme/layouts/SiteLayout.tsx +184 -0
- package/src/theme/layouts/index.ts +1 -0
- package/src/types/sortablejs.d.ts +23 -0
- package/src/types.ts +97 -0
- package/dist/app.d.ts +0 -38
- package/dist/app.d.ts.map +0 -1
- package/dist/auth.d.ts +0 -25
- package/dist/auth.d.ts.map +0 -1
- package/dist/db/index.d.ts +0 -10
- package/dist/db/index.d.ts.map +0 -1
- package/dist/db/schema.d.ts +0 -1507
- package/dist/db/schema.d.ts.map +0 -1
- package/dist/i18n/Trans.d.ts +0 -25
- package/dist/i18n/Trans.d.ts.map +0 -1
- package/dist/i18n/context.d.ts +0 -69
- package/dist/i18n/context.d.ts.map +0 -1
- package/dist/i18n/detect.d.ts +0 -20
- package/dist/i18n/detect.d.ts.map +0 -1
- package/dist/i18n/i18n.d.ts +0 -32
- package/dist/i18n/i18n.d.ts.map +0 -1
- package/dist/i18n/index.d.ts +0 -41
- package/dist/i18n/index.d.ts.map +0 -1
- package/dist/i18n/locales/en.d.ts +0 -3
- package/dist/i18n/locales/en.d.ts.map +0 -1
- package/dist/i18n/locales/zh-Hans.d.ts +0 -3
- package/dist/i18n/locales/zh-Hans.d.ts.map +0 -1
- package/dist/i18n/locales/zh-Hant.d.ts +0 -3
- package/dist/i18n/locales/zh-Hant.d.ts.map +0 -1
- package/dist/i18n/locales.d.ts +0 -11
- package/dist/i18n/locales.d.ts.map +0 -1
- package/dist/i18n/middleware.d.ts +0 -21
- package/dist/i18n/middleware.d.ts.map +0 -1
- package/dist/index.d.ts +0 -16
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/config.d.ts +0 -83
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/constants.d.ts +0 -37
- package/dist/lib/constants.d.ts.map +0 -1
- package/dist/lib/image.d.ts +0 -73
- package/dist/lib/image.d.ts.map +0 -1
- package/dist/lib/index.d.ts +0 -9
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/markdown.d.ts +0 -60
- package/dist/lib/markdown.d.ts.map +0 -1
- package/dist/lib/schemas.d.ts +0 -113
- package/dist/lib/schemas.d.ts.map +0 -1
- package/dist/lib/sqid.d.ts +0 -60
- package/dist/lib/sqid.d.ts.map +0 -1
- package/dist/lib/sse.d.ts +0 -192
- package/dist/lib/sse.d.ts.map +0 -1
- package/dist/lib/theme.d.ts +0 -44
- package/dist/lib/theme.d.ts.map +0 -1
- package/dist/lib/time.d.ts +0 -90
- package/dist/lib/time.d.ts.map +0 -1
- package/dist/lib/url.d.ts +0 -82
- package/dist/lib/url.d.ts.map +0 -1
- package/dist/middleware/auth.d.ts +0 -24
- package/dist/middleware/auth.d.ts.map +0 -1
- package/dist/middleware/onboarding.d.ts +0 -26
- package/dist/middleware/onboarding.d.ts.map +0 -1
- package/dist/routes/api/posts.d.ts +0 -13
- package/dist/routes/api/posts.d.ts.map +0 -1
- package/dist/routes/api/search.d.ts +0 -13
- package/dist/routes/api/search.d.ts.map +0 -1
- package/dist/routes/api/upload.d.ts +0 -16
- package/dist/routes/api/upload.d.ts.map +0 -1
- package/dist/routes/dash/collections.d.ts +0 -13
- package/dist/routes/dash/collections.d.ts.map +0 -1
- package/dist/routes/dash/index.d.ts +0 -15
- package/dist/routes/dash/index.d.ts.map +0 -1
- package/dist/routes/dash/media.d.ts +0 -16
- package/dist/routes/dash/media.d.ts.map +0 -1
- package/dist/routes/dash/pages.d.ts +0 -15
- package/dist/routes/dash/pages.d.ts.map +0 -1
- package/dist/routes/dash/posts.d.ts +0 -13
- package/dist/routes/dash/posts.d.ts.map +0 -1
- package/dist/routes/dash/redirects.d.ts +0 -13
- package/dist/routes/dash/redirects.d.ts.map +0 -1
- package/dist/routes/dash/settings.d.ts +0 -15
- package/dist/routes/dash/settings.d.ts.map +0 -1
- package/dist/routes/feed/rss.d.ts +0 -13
- package/dist/routes/feed/rss.d.ts.map +0 -1
- package/dist/routes/feed/sitemap.d.ts +0 -13
- package/dist/routes/feed/sitemap.d.ts.map +0 -1
- package/dist/routes/pages/archive.d.ts +0 -15
- package/dist/routes/pages/archive.d.ts.map +0 -1
- package/dist/routes/pages/collection.d.ts +0 -13
- package/dist/routes/pages/collection.d.ts.map +0 -1
- package/dist/routes/pages/home.d.ts +0 -13
- package/dist/routes/pages/home.d.ts.map +0 -1
- package/dist/routes/pages/page.d.ts +0 -15
- package/dist/routes/pages/page.d.ts.map +0 -1
- package/dist/routes/pages/post.d.ts +0 -13
- package/dist/routes/pages/post.d.ts.map +0 -1
- package/dist/routes/pages/search.d.ts +0 -13
- package/dist/routes/pages/search.d.ts.map +0 -1
- package/dist/services/collection.d.ts +0 -31
- package/dist/services/collection.d.ts.map +0 -1
- package/dist/services/index.d.ts +0 -28
- package/dist/services/index.d.ts.map +0 -1
- package/dist/services/media.d.ts +0 -27
- package/dist/services/media.d.ts.map +0 -1
- package/dist/services/post.d.ts +0 -31
- package/dist/services/post.d.ts.map +0 -1
- package/dist/services/redirect.d.ts +0 -15
- package/dist/services/redirect.d.ts.map +0 -1
- package/dist/services/search.d.ts +0 -26
- package/dist/services/search.d.ts.map +0 -1
- package/dist/services/settings.d.ts +0 -18
- package/dist/services/settings.d.ts.map +0 -1
- package/dist/theme/color-themes.d.ts +0 -30
- package/dist/theme/color-themes.d.ts.map +0 -1
- package/dist/theme/components/ActionButtons.d.ts +0 -43
- package/dist/theme/components/ActionButtons.d.ts.map +0 -1
- package/dist/theme/components/CrudPageHeader.d.ts +0 -23
- package/dist/theme/components/CrudPageHeader.d.ts.map +0 -1
- package/dist/theme/components/DangerZone.d.ts +0 -36
- package/dist/theme/components/DangerZone.d.ts.map +0 -1
- package/dist/theme/components/EmptyState.d.ts +0 -27
- package/dist/theme/components/EmptyState.d.ts.map +0 -1
- package/dist/theme/components/ListItemRow.d.ts +0 -15
- package/dist/theme/components/ListItemRow.d.ts.map +0 -1
- package/dist/theme/components/PageForm.d.ts +0 -14
- package/dist/theme/components/PageForm.d.ts.map +0 -1
- package/dist/theme/components/Pagination.d.ts +0 -46
- package/dist/theme/components/Pagination.d.ts.map +0 -1
- package/dist/theme/components/PostForm.d.ts +0 -11
- package/dist/theme/components/PostForm.d.ts.map +0 -1
- package/dist/theme/components/PostList.d.ts +0 -10
- package/dist/theme/components/PostList.d.ts.map +0 -1
- package/dist/theme/components/ThreadView.d.ts +0 -15
- package/dist/theme/components/ThreadView.d.ts.map +0 -1
- package/dist/theme/components/TypeBadge.d.ts +0 -12
- package/dist/theme/components/TypeBadge.d.ts.map +0 -1
- package/dist/theme/components/VisibilityBadge.d.ts +0 -12
- package/dist/theme/components/VisibilityBadge.d.ts.map +0 -1
- package/dist/theme/components/index.d.ts +0 -13
- package/dist/theme/components/index.d.ts.map +0 -1
- package/dist/theme/index.d.ts +0 -21
- package/dist/theme/index.d.ts.map +0 -1
- package/dist/theme/layouts/BaseLayout.d.ts +0 -23
- package/dist/theme/layouts/BaseLayout.d.ts.map +0 -1
- package/dist/theme/layouts/DashLayout.d.ts +0 -17
- package/dist/theme/layouts/DashLayout.d.ts.map +0 -1
- package/dist/theme/layouts/index.d.ts +0 -3
- package/dist/theme/layouts/index.d.ts.map +0 -1
- package/dist/types.d.ts +0 -213
- package/dist/types.d.ts.map +0 -1
package/dist/db/schema.d.ts.map
DELETED
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYhB,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"}
|
package/dist/i18n/Trans.d.ts
DELETED
|
@@ -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
|
package/dist/i18n/Trans.d.ts.map
DELETED
|
@@ -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"}
|
package/dist/i18n/context.d.ts
DELETED
|
@@ -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"}
|
package/dist/i18n/detect.d.ts
DELETED
|
@@ -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"}
|
package/dist/i18n/i18n.d.ts
DELETED
|
@@ -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
|
package/dist/i18n/i18n.d.ts.map
DELETED
|
@@ -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"}
|
package/dist/i18n/index.d.ts
DELETED
|
@@ -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
|
package/dist/i18n/index.d.ts.map
DELETED
|
@@ -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 +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,EAA47K,QAAQ,CAAC"}
|
|
@@ -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,EAAk/H,QAAQ,CAAC"}
|
|
@@ -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,EAAsgI,QAAQ,CAAC"}
|
package/dist/i18n/locales.d.ts
DELETED
|
@@ -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, Collection, PostCollection, Redirect, Setting, CreatePost, UpdatePost, JantConfig, JantTheme, ThemeComponents, } from "./types.js";
|
|
9
|
-
export { POST_TYPES, VISIBILITY_LEVELS } 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
|
package/dist/index.d.ts.map
DELETED
|
@@ -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,UAAU,EACV,cAAc,EACd,QAAQ,EACR,OAAO,EACP,UAAU,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG3D,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"}
|
package/dist/lib/config.d.ts
DELETED
|
@@ -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
|
package/dist/lib/config.d.ts.map
DELETED
|
@@ -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"}
|
package/dist/lib/constants.d.ts
DELETED
|
@@ -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"}
|
package/dist/lib/image.d.ts
DELETED
|
@@ -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
|
package/dist/lib/image.d.ts.map
DELETED
|
@@ -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"}
|
package/dist/lib/index.d.ts
DELETED
package/dist/lib/index.d.ts.map
DELETED
|
@@ -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"}
|
package/dist/lib/markdown.d.ts
DELETED
|
@@ -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"}
|