@jant/core 0.6.7 → 0.6.9
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/bin/commands/uploads/cleanup.js +2 -0
- package/dist/{app-L1UPUArB.js → app-C-jxWmAV.js} +12421 -12033
- package/dist/app-DqHzOwL5.js +6 -0
- package/dist/client/.vite/manifest.json +3 -3
- package/dist/client/_assets/client-CGf2m3qp.css +2 -0
- package/dist/client/_assets/{client-B0MvB2r0.js → client-DWy1LEEk.js} +2 -2
- package/dist/client/_assets/{client-auth-CwwuucF_.js → client-auth-Blg-a5Ep.js} +365 -345
- package/dist/{env-CoSe-1y4.js → env-OHRKGcMj.js} +1 -1
- package/dist/{export-DLukCOO3.js → export-C2DIB7mm.js} +34 -9
- package/dist/{github-api-UD4u_7fa.js → github-api-BgSiE71w.js} +1 -1
- package/dist/{github-app-DeX6Td1O.js → github-app-BbklkFmU.js} +1 -1
- package/dist/{github-sync-BeDecPen.js → github-sync-7XQ5ZM6z.js} +3 -3
- package/dist/{github-sync-BtHY2AST.js → github-sync-BEFCfLKK.js} +3 -3
- package/dist/index.js +5 -5
- package/dist/node.js +6 -6
- package/dist/{url-XF0GbKGO.js → url-BMYO-Zlt.js} +42 -2
- package/package.json +1 -1
- package/src/__tests__/bin/uploads-cleanup.test.ts +2 -0
- package/src/client/__tests__/compose-bridge.test.ts +105 -0
- package/src/client/__tests__/hydrate-partial.test.ts +27 -0
- package/src/client/__tests__/note-expand.test.ts +130 -0
- package/src/client/archive-nav.js +2 -1
- package/src/client/audio-player.ts +7 -3
- package/src/client/components/__tests__/compose-format-convert.test.ts +357 -0
- package/src/client/components/__tests__/jant-compose-dialog.test.ts +313 -0
- package/src/client/components/__tests__/jant-compose-editor.test.ts +2 -0
- package/src/client/components/__tests__/jant-compose-fullscreen.test.ts +2 -0
- package/src/client/components/__tests__/jant-settings-avatar.test.ts +5 -2
- package/src/client/components/__tests__/jant-settings-general.test.ts +55 -8
- package/src/client/components/compose-format-convert.ts +255 -0
- package/src/client/components/compose-types.ts +2 -0
- package/src/client/components/jant-compose-dialog.ts +110 -44
- package/src/client/components/jant-compose-editor.ts +64 -11
- package/src/client/components/jant-settings-general.ts +56 -18
- package/src/client/components/settings-types.ts +11 -0
- package/src/client/compose-bridge.ts +17 -0
- package/src/client/feed-video-player.ts +1 -1
- package/src/client/hydrate-partial.ts +25 -0
- package/src/client/note-expand.ts +63 -0
- package/src/client/settings-bridge.ts +3 -0
- package/src/client/tiptap/__tests__/mark-exit.test.ts +99 -0
- package/src/client/tiptap/bubble-menu.ts +37 -4
- package/src/client.ts +1 -0
- package/src/db/migrations/0026_absent_rhodey.sql +14 -0
- package/src/db/migrations/meta/0026_snapshot.json +2511 -0
- package/src/db/migrations/meta/_journal.json +7 -0
- package/src/db/migrations/pg/0024_high_violations.sql +14 -0
- package/src/db/migrations/pg/meta/0024_snapshot.json +3204 -0
- package/src/db/migrations/pg/meta/_journal.json +7 -0
- package/src/db/pg/schema.ts +36 -0
- package/src/db/schema.ts +36 -0
- package/src/i18n/__tests__/middleware.test.ts +46 -0
- package/src/i18n/locales/public/en.po +41 -0
- package/src/i18n/locales/public/en.ts +1 -1
- package/src/i18n/locales/public/zh-Hans.po +41 -0
- package/src/i18n/locales/public/zh-Hans.ts +1 -1
- package/src/i18n/locales/public/zh-Hant.po +41 -0
- package/src/i18n/locales/public/zh-Hant.ts +1 -1
- package/src/i18n/locales/settings/en.po +37 -22
- package/src/i18n/locales/settings/en.ts +1 -1
- package/src/i18n/locales/settings/zh-Hans.po +37 -22
- package/src/i18n/locales/settings/zh-Hans.ts +1 -1
- package/src/i18n/locales/settings/zh-Hant.po +37 -22
- package/src/i18n/locales/settings/zh-Hant.ts +1 -1
- package/src/i18n/middleware.ts +17 -8
- package/src/i18n/supported-locales.ts +5 -4
- package/src/lib/__tests__/markdown-to-tiptap.test.ts +1 -1
- package/src/lib/__tests__/markdown.test.ts +1 -1
- package/src/lib/__tests__/summary.test.ts +87 -0
- package/src/lib/__tests__/timeline.test.ts +48 -1
- package/src/lib/__tests__/tiptap-render.test.ts +4 -4
- package/src/lib/__tests__/url.test.ts +44 -0
- package/src/lib/__tests__/view.test.ts +168 -1
- package/src/lib/ids.ts +1 -0
- package/src/lib/navigation.ts +1 -0
- package/src/lib/resolve-config.ts +3 -2
- package/src/lib/summary.ts +42 -3
- package/src/lib/tiptap-render.ts +6 -2
- package/src/lib/upload.ts +16 -2
- package/src/lib/url.ts +41 -0
- package/src/lib/view.ts +102 -40
- package/src/preset.css +7 -1
- package/src/routes/api/__tests__/settings.test.ts +1 -4
- package/src/routes/api/__tests__/upload.test.ts +2 -0
- package/src/routes/api/internal/__tests__/uploads.test.ts +86 -0
- package/src/routes/api/internal/sites.ts +44 -1
- package/src/routes/api/public/__tests__/archive.test.ts +66 -0
- package/src/routes/api/public/archive.ts +22 -6
- package/src/routes/api/settings.ts +2 -1
- package/src/routes/api/telegram.ts +2 -1
- package/src/routes/auth/__tests__/setup.test.ts +14 -0
- package/src/routes/dash/__tests__/settings-avatar.test.ts +35 -17
- package/src/routes/dash/custom-urls.tsx +1 -1
- package/src/routes/dash/settings.tsx +23 -7
- package/src/routes/pages/__tests__/archive-params.test.ts +135 -0
- package/src/routes/pages/archive.tsx +116 -20
- package/src/routes/pages/collections.tsx +1 -0
- package/src/services/__tests__/media.test.ts +274 -30
- package/src/services/__tests__/post.test.ts +81 -0
- package/src/services/__tests__/settings.test.ts +55 -0
- package/src/services/bootstrap.ts +7 -0
- package/src/services/export-theme/assets/client-site.js +1 -1
- package/src/services/export-theme/layouts/_default/baseof.html +2 -1
- package/src/services/export-theme/styles/main.css +49 -15
- package/src/services/media.ts +199 -42
- package/src/services/post.ts +22 -2
- package/src/services/search.ts +4 -4
- package/src/services/settings.ts +49 -15
- package/src/services/upload-session.ts +28 -0
- package/src/styles/tokens.css +7 -5
- package/src/styles/ui.css +163 -34
- package/src/types/bindings.ts +1 -0
- package/src/types/config.ts +14 -1
- package/src/types/props.ts +3 -0
- package/src/ui/compose/ComposeDialog.tsx +13 -0
- package/src/ui/dash/settings/AccountMenuContent.tsx +0 -39
- package/src/ui/dash/settings/GeneralContent.tsx +38 -4
- package/src/ui/dash/settings/SettingsDirectory.tsx +26 -1
- package/src/ui/dash/settings/SettingsRootContent.tsx +46 -1
- package/src/ui/dash/settings/__tests__/SettingsRootContent.test.tsx +55 -0
- package/src/ui/feed/NoteCard.tsx +54 -5
- package/src/ui/feed/__tests__/timeline-cards.test.ts +73 -0
- package/src/ui/layouts/BaseLayout.tsx +1 -0
- package/src/ui/layouts/__tests__/BaseLayout.test.tsx +13 -0
- package/src/ui/pages/ArchivePage.tsx +89 -6
- package/src/ui/pages/CollectionsPage.tsx +7 -1
- package/src/ui/pages/__tests__/ArchivePage.test.tsx +37 -0
- package/src/ui/shared/CollectionDirectory.tsx +13 -3
- package/src/ui/shared/CollectionsManager.tsx +3 -0
- package/dist/app-C1QgMNRY.js +0 -6
- package/dist/client/_assets/client-BMPMuwvV.css +0 -2
|
@@ -69,4 +69,41 @@ describe("ArchivePage", () => {
|
|
|
69
69
|
|
|
70
70
|
expect(html).toContain('title="Published on Mar 30, 2026 at 20:00"');
|
|
71
71
|
});
|
|
72
|
+
|
|
73
|
+
it("renders the collection filter alongside the thread filter", () => {
|
|
74
|
+
const html = renderArchivePage({
|
|
75
|
+
availableCollections: [{ slug: "tech", title: "Tech" }],
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
expect(html).toContain('id="af-collection"');
|
|
79
|
+
expect(html).toContain('id="af-thread"');
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it("renders the thread filter with all options", () => {
|
|
83
|
+
const html = renderArchivePage();
|
|
84
|
+
|
|
85
|
+
expect(html).toContain('id="af-thread"');
|
|
86
|
+
expect(html).toContain("All posts");
|
|
87
|
+
expect(html).toContain("Threads");
|
|
88
|
+
expect(html).toContain("Single posts");
|
|
89
|
+
expect(html).toContain("replies=any");
|
|
90
|
+
expect(html).toContain("replies=none");
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("serializes visibility latest_hidden as the hidden URL alias", () => {
|
|
94
|
+
const html = renderArchivePage({
|
|
95
|
+
isAuthenticated: true,
|
|
96
|
+
filters: { visibility: "latest_hidden" },
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
expect(html).toContain("visibility=hidden");
|
|
100
|
+
expect(html).not.toContain("visibility=latest_hidden");
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("marks the thread filter active when filtering single posts", () => {
|
|
104
|
+
const html = renderArchivePage({ filters: { hasReplies: false } });
|
|
105
|
+
|
|
106
|
+
expect(html).toContain("archive-chip-active");
|
|
107
|
+
expect(html).toContain("Single posts");
|
|
108
|
+
});
|
|
72
109
|
});
|
|
@@ -6,12 +6,13 @@ import { getCollectionSelectionPath } from "../../lib/collection-paths.js";
|
|
|
6
6
|
import { getDividerCollectionGroup } from "../../lib/collection-groups.js";
|
|
7
7
|
import { render as renderMarkdown } from "../../lib/markdown.js";
|
|
8
8
|
import { formatRelativeAge, toISOString } from "../../lib/time.js";
|
|
9
|
-
import { toPublicHref, toPublicPath } from "../../lib/url.js";
|
|
9
|
+
import { toPublicHref, toPublicPath, toSameSitePath } from "../../lib/url.js";
|
|
10
10
|
|
|
11
11
|
export interface CollectionDirectoryProps {
|
|
12
12
|
items: CollectionDirectoryItem[];
|
|
13
13
|
emptyMessage?: string;
|
|
14
14
|
sitePathPrefix?: string;
|
|
15
|
+
siteOrigin?: string;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const hasDirectoryContent = (items: CollectionDirectoryItem[]) =>
|
|
@@ -112,6 +113,7 @@ export const CollectionDirectory: FC<CollectionDirectoryProps> = ({
|
|
|
112
113
|
items,
|
|
113
114
|
emptyMessage,
|
|
114
115
|
sitePathPrefix = "",
|
|
116
|
+
siteOrigin = "",
|
|
115
117
|
}) => {
|
|
116
118
|
const { i18n } = useLingui();
|
|
117
119
|
|
|
@@ -173,8 +175,16 @@ export const CollectionDirectory: FC<CollectionDirectoryProps> = ({
|
|
|
173
175
|
|
|
174
176
|
if (item.type === "link" && item.label && item.url) {
|
|
175
177
|
const sequence = sequenceLabels[index];
|
|
178
|
+
// A full URL pointing at this site's own origin is really internal,
|
|
179
|
+
// so render it without external-link affordances.
|
|
180
|
+
const sameSitePath = toSameSitePath(item.url, siteOrigin);
|
|
181
|
+
const linkHref =
|
|
182
|
+
sameSitePath !== null
|
|
183
|
+
? toPublicHref(sameSitePath, sitePathPrefix)
|
|
184
|
+
: toPublicHref(item.url, sitePathPrefix);
|
|
176
185
|
const isExternal =
|
|
177
|
-
|
|
186
|
+
sameSitePath === null &&
|
|
187
|
+
(item.url.startsWith("http://") || item.url.startsWith("https://"));
|
|
178
188
|
|
|
179
189
|
return (
|
|
180
190
|
<div
|
|
@@ -187,7 +197,7 @@ export const CollectionDirectory: FC<CollectionDirectoryProps> = ({
|
|
|
187
197
|
</span>
|
|
188
198
|
<div class="collection-directory-title-row">
|
|
189
199
|
<a
|
|
190
|
-
href={
|
|
200
|
+
href={linkHref}
|
|
191
201
|
class="collection-directory-title-link"
|
|
192
202
|
{...(isExternal
|
|
193
203
|
? { target: "_blank", rel: "noopener noreferrer" }
|
|
@@ -16,11 +16,13 @@ const escapeJson = (data: unknown) =>
|
|
|
16
16
|
export interface CollectionsManagerProps {
|
|
17
17
|
items: CollectionDirectoryItem[];
|
|
18
18
|
sitePathPrefix?: string;
|
|
19
|
+
siteOrigin?: string;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export const CollectionsManager: FC<CollectionsManagerProps> = ({
|
|
22
23
|
items,
|
|
23
24
|
sitePathPrefix = "",
|
|
25
|
+
siteOrigin = "",
|
|
24
26
|
}) => {
|
|
25
27
|
const { i18n } = useLingui();
|
|
26
28
|
const collectionsHref = toPublicPath(
|
|
@@ -315,6 +317,7 @@ export const CollectionsManager: FC<CollectionsManagerProps> = ({
|
|
|
315
317
|
items={items}
|
|
316
318
|
emptyMessage={labels.emptyState}
|
|
317
319
|
sitePathPrefix={sitePathPrefix}
|
|
320
|
+
siteOrigin={siteOrigin}
|
|
318
321
|
/>
|
|
319
322
|
</jant-collections-manager>
|
|
320
323
|
</div>
|