@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.
Files changed (131) hide show
  1. package/bin/commands/uploads/cleanup.js +2 -0
  2. package/dist/{app-L1UPUArB.js → app-C-jxWmAV.js} +12421 -12033
  3. package/dist/app-DqHzOwL5.js +6 -0
  4. package/dist/client/.vite/manifest.json +3 -3
  5. package/dist/client/_assets/client-CGf2m3qp.css +2 -0
  6. package/dist/client/_assets/{client-B0MvB2r0.js → client-DWy1LEEk.js} +2 -2
  7. package/dist/client/_assets/{client-auth-CwwuucF_.js → client-auth-Blg-a5Ep.js} +365 -345
  8. package/dist/{env-CoSe-1y4.js → env-OHRKGcMj.js} +1 -1
  9. package/dist/{export-DLukCOO3.js → export-C2DIB7mm.js} +34 -9
  10. package/dist/{github-api-UD4u_7fa.js → github-api-BgSiE71w.js} +1 -1
  11. package/dist/{github-app-DeX6Td1O.js → github-app-BbklkFmU.js} +1 -1
  12. package/dist/{github-sync-BeDecPen.js → github-sync-7XQ5ZM6z.js} +3 -3
  13. package/dist/{github-sync-BtHY2AST.js → github-sync-BEFCfLKK.js} +3 -3
  14. package/dist/index.js +5 -5
  15. package/dist/node.js +6 -6
  16. package/dist/{url-XF0GbKGO.js → url-BMYO-Zlt.js} +42 -2
  17. package/package.json +1 -1
  18. package/src/__tests__/bin/uploads-cleanup.test.ts +2 -0
  19. package/src/client/__tests__/compose-bridge.test.ts +105 -0
  20. package/src/client/__tests__/hydrate-partial.test.ts +27 -0
  21. package/src/client/__tests__/note-expand.test.ts +130 -0
  22. package/src/client/archive-nav.js +2 -1
  23. package/src/client/audio-player.ts +7 -3
  24. package/src/client/components/__tests__/compose-format-convert.test.ts +357 -0
  25. package/src/client/components/__tests__/jant-compose-dialog.test.ts +313 -0
  26. package/src/client/components/__tests__/jant-compose-editor.test.ts +2 -0
  27. package/src/client/components/__tests__/jant-compose-fullscreen.test.ts +2 -0
  28. package/src/client/components/__tests__/jant-settings-avatar.test.ts +5 -2
  29. package/src/client/components/__tests__/jant-settings-general.test.ts +55 -8
  30. package/src/client/components/compose-format-convert.ts +255 -0
  31. package/src/client/components/compose-types.ts +2 -0
  32. package/src/client/components/jant-compose-dialog.ts +110 -44
  33. package/src/client/components/jant-compose-editor.ts +64 -11
  34. package/src/client/components/jant-settings-general.ts +56 -18
  35. package/src/client/components/settings-types.ts +11 -0
  36. package/src/client/compose-bridge.ts +17 -0
  37. package/src/client/feed-video-player.ts +1 -1
  38. package/src/client/hydrate-partial.ts +25 -0
  39. package/src/client/note-expand.ts +63 -0
  40. package/src/client/settings-bridge.ts +3 -0
  41. package/src/client/tiptap/__tests__/mark-exit.test.ts +99 -0
  42. package/src/client/tiptap/bubble-menu.ts +37 -4
  43. package/src/client.ts +1 -0
  44. package/src/db/migrations/0026_absent_rhodey.sql +14 -0
  45. package/src/db/migrations/meta/0026_snapshot.json +2511 -0
  46. package/src/db/migrations/meta/_journal.json +7 -0
  47. package/src/db/migrations/pg/0024_high_violations.sql +14 -0
  48. package/src/db/migrations/pg/meta/0024_snapshot.json +3204 -0
  49. package/src/db/migrations/pg/meta/_journal.json +7 -0
  50. package/src/db/pg/schema.ts +36 -0
  51. package/src/db/schema.ts +36 -0
  52. package/src/i18n/__tests__/middleware.test.ts +46 -0
  53. package/src/i18n/locales/public/en.po +41 -0
  54. package/src/i18n/locales/public/en.ts +1 -1
  55. package/src/i18n/locales/public/zh-Hans.po +41 -0
  56. package/src/i18n/locales/public/zh-Hans.ts +1 -1
  57. package/src/i18n/locales/public/zh-Hant.po +41 -0
  58. package/src/i18n/locales/public/zh-Hant.ts +1 -1
  59. package/src/i18n/locales/settings/en.po +37 -22
  60. package/src/i18n/locales/settings/en.ts +1 -1
  61. package/src/i18n/locales/settings/zh-Hans.po +37 -22
  62. package/src/i18n/locales/settings/zh-Hans.ts +1 -1
  63. package/src/i18n/locales/settings/zh-Hant.po +37 -22
  64. package/src/i18n/locales/settings/zh-Hant.ts +1 -1
  65. package/src/i18n/middleware.ts +17 -8
  66. package/src/i18n/supported-locales.ts +5 -4
  67. package/src/lib/__tests__/markdown-to-tiptap.test.ts +1 -1
  68. package/src/lib/__tests__/markdown.test.ts +1 -1
  69. package/src/lib/__tests__/summary.test.ts +87 -0
  70. package/src/lib/__tests__/timeline.test.ts +48 -1
  71. package/src/lib/__tests__/tiptap-render.test.ts +4 -4
  72. package/src/lib/__tests__/url.test.ts +44 -0
  73. package/src/lib/__tests__/view.test.ts +168 -1
  74. package/src/lib/ids.ts +1 -0
  75. package/src/lib/navigation.ts +1 -0
  76. package/src/lib/resolve-config.ts +3 -2
  77. package/src/lib/summary.ts +42 -3
  78. package/src/lib/tiptap-render.ts +6 -2
  79. package/src/lib/upload.ts +16 -2
  80. package/src/lib/url.ts +41 -0
  81. package/src/lib/view.ts +102 -40
  82. package/src/preset.css +7 -1
  83. package/src/routes/api/__tests__/settings.test.ts +1 -4
  84. package/src/routes/api/__tests__/upload.test.ts +2 -0
  85. package/src/routes/api/internal/__tests__/uploads.test.ts +86 -0
  86. package/src/routes/api/internal/sites.ts +44 -1
  87. package/src/routes/api/public/__tests__/archive.test.ts +66 -0
  88. package/src/routes/api/public/archive.ts +22 -6
  89. package/src/routes/api/settings.ts +2 -1
  90. package/src/routes/api/telegram.ts +2 -1
  91. package/src/routes/auth/__tests__/setup.test.ts +14 -0
  92. package/src/routes/dash/__tests__/settings-avatar.test.ts +35 -17
  93. package/src/routes/dash/custom-urls.tsx +1 -1
  94. package/src/routes/dash/settings.tsx +23 -7
  95. package/src/routes/pages/__tests__/archive-params.test.ts +135 -0
  96. package/src/routes/pages/archive.tsx +116 -20
  97. package/src/routes/pages/collections.tsx +1 -0
  98. package/src/services/__tests__/media.test.ts +274 -30
  99. package/src/services/__tests__/post.test.ts +81 -0
  100. package/src/services/__tests__/settings.test.ts +55 -0
  101. package/src/services/bootstrap.ts +7 -0
  102. package/src/services/export-theme/assets/client-site.js +1 -1
  103. package/src/services/export-theme/layouts/_default/baseof.html +2 -1
  104. package/src/services/export-theme/styles/main.css +49 -15
  105. package/src/services/media.ts +199 -42
  106. package/src/services/post.ts +22 -2
  107. package/src/services/search.ts +4 -4
  108. package/src/services/settings.ts +49 -15
  109. package/src/services/upload-session.ts +28 -0
  110. package/src/styles/tokens.css +7 -5
  111. package/src/styles/ui.css +163 -34
  112. package/src/types/bindings.ts +1 -0
  113. package/src/types/config.ts +14 -1
  114. package/src/types/props.ts +3 -0
  115. package/src/ui/compose/ComposeDialog.tsx +13 -0
  116. package/src/ui/dash/settings/AccountMenuContent.tsx +0 -39
  117. package/src/ui/dash/settings/GeneralContent.tsx +38 -4
  118. package/src/ui/dash/settings/SettingsDirectory.tsx +26 -1
  119. package/src/ui/dash/settings/SettingsRootContent.tsx +46 -1
  120. package/src/ui/dash/settings/__tests__/SettingsRootContent.test.tsx +55 -0
  121. package/src/ui/feed/NoteCard.tsx +54 -5
  122. package/src/ui/feed/__tests__/timeline-cards.test.ts +73 -0
  123. package/src/ui/layouts/BaseLayout.tsx +1 -0
  124. package/src/ui/layouts/__tests__/BaseLayout.test.tsx +13 -0
  125. package/src/ui/pages/ArchivePage.tsx +89 -6
  126. package/src/ui/pages/CollectionsPage.tsx +7 -1
  127. package/src/ui/pages/__tests__/ArchivePage.test.tsx +37 -0
  128. package/src/ui/shared/CollectionDirectory.tsx +13 -3
  129. package/src/ui/shared/CollectionsManager.tsx +3 -0
  130. package/dist/app-C1QgMNRY.js +0 -6
  131. 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
- item.url.startsWith("http://") || item.url.startsWith("https://");
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={toPublicHref(item.url, sitePathPrefix)}
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>
@@ -1,6 +0,0 @@
1
- import "./url-XF0GbKGO.js";
2
- import { t as createApp } from "./app-L1UPUArB.js";
3
- import "./export-DLukCOO3.js";
4
- import "./env-CoSe-1y4.js";
5
- import "./github-sync-BtHY2AST.js";
6
- export { createApp };