@jant/core 0.6.15 → 0.6.16

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 (112) hide show
  1. package/bin/commands/import-site.js +7 -0
  2. package/dist/app-C75Zc8dD.js +6 -0
  3. package/dist/{app-C-oi_t8W.js → app-C7_4oab9.js} +480 -196
  4. package/dist/client/.vite/manifest.json +8 -8
  5. package/dist/client/_assets/chunks/{url-pLre2DM_.js → url-CU9pEbk5.js} +1 -1
  6. package/dist/client/_assets/{client-DxY5BFe8.js → client-Bq0vre8Y.js} +3 -3
  7. package/dist/client/_assets/client-D3VZyG4L.css +2 -0
  8. package/dist/client/_assets/{client-auth-CakPESv9.js → client-auth-F2rb9WfF.js} +1015 -977
  9. package/dist/{env-OHRKGcMj.js → env-BPYViDJJ.js} +1 -1
  10. package/dist/{export-CsFx6F_M.js → export-Dl5KCiEs.js} +93 -7
  11. package/dist/{github-api-BgSiE71w.js → github-api-BNF35Lkx.js} +1 -1
  12. package/dist/{github-app-BbklkFmU.js → github-app-DdiD-bC4.js} +1 -1
  13. package/dist/{github-sync-ppWXN3jb.js → github-sync-Bqg62IvV.js} +3 -3
  14. package/dist/{github-sync-Cq1pzzOI.js → github-sync-HdK2EgvJ.js} +3 -3
  15. package/dist/index.js +5 -5
  16. package/dist/node.js +6 -6
  17. package/dist/{url-BMYO-Zlt.js → url-CbLAtlZe.js} +517 -12
  18. package/package.json +1 -1
  19. package/src/__tests__/mise-config.test.ts +22 -0
  20. package/src/client/__tests__/compose-bridge.test.ts +252 -2
  21. package/src/client/__tests__/compose-shortcuts.test.ts +20 -0
  22. package/src/client/__tests__/toast.test.ts +65 -1
  23. package/src/client/components/__tests__/compose-format-convert.test.ts +0 -19
  24. package/src/client/components/__tests__/jant-command-palette.test.ts +51 -0
  25. package/src/client/components/__tests__/jant-compose-dialog.test.ts +2015 -318
  26. package/src/client/components/__tests__/jant-compose-editor.test.ts +53 -62
  27. package/src/client/components/__tests__/jant-compose-fullscreen.test.ts +35 -89
  28. package/src/client/components/compose-format-convert.ts +5 -1
  29. package/src/client/components/compose-types.ts +47 -3
  30. package/src/client/components/jant-command-palette.ts +12 -6
  31. package/src/client/components/jant-compose-dialog.ts +1464 -680
  32. package/src/client/components/jant-compose-editor.ts +225 -93
  33. package/src/client/components/jant-compose-fullscreen.ts +3 -5
  34. package/src/client/components/jant-post-menu.ts +91 -21
  35. package/src/client/compose-bridge.ts +143 -122
  36. package/src/client/compose-launch.ts +13 -0
  37. package/src/client/compose-shortcuts.ts +5 -1
  38. package/src/client/post-refresh.ts +135 -0
  39. package/src/client/tiptap/__tests__/link-input-rules.test.ts +121 -0
  40. package/src/client/tiptap/link-input-rules.ts +4 -4
  41. package/src/client/toast.ts +130 -38
  42. package/src/db/__tests__/backfill-thread-activity.test.ts +234 -0
  43. package/src/db/__tests__/thread-activity.test.ts +113 -0
  44. package/src/db/backfills/0005_split_thread_activity_from_quiet_replies.sql +68 -0
  45. package/src/db/migrations/0031_many_ego.sql +3 -0
  46. package/src/db/migrations/meta/0031_snapshot.json +2562 -0
  47. package/src/db/migrations/meta/_journal.json +7 -0
  48. package/src/db/migrations/pg/0029_rare_hairball.sql +3 -0
  49. package/src/db/migrations/pg/meta/0029_snapshot.json +3289 -0
  50. package/src/db/migrations/pg/meta/_journal.json +7 -0
  51. package/src/db/pg/schema.ts +18 -0
  52. package/src/db/schema.ts +20 -0
  53. package/src/db/thread-activity.ts +101 -0
  54. package/src/i18n/locales/public/en.po +89 -21
  55. package/src/i18n/locales/public/en.ts +1 -1
  56. package/src/i18n/locales/public/zh-Hans.po +88 -20
  57. package/src/i18n/locales/public/zh-Hans.ts +1 -1
  58. package/src/i18n/locales/public/zh-Hant.po +88 -20
  59. package/src/i18n/locales/public/zh-Hant.ts +1 -1
  60. package/src/lib/__tests__/feed.test.ts +168 -0
  61. package/src/lib/__tests__/markdown.test.ts +16 -0
  62. package/src/lib/__tests__/slug.test.ts +18 -0
  63. package/src/lib/__tests__/translit.test.ts +87 -0
  64. package/src/lib/__tests__/url.test.ts +53 -0
  65. package/src/lib/feed.ts +113 -11
  66. package/src/lib/hugo-markdown.ts +5 -0
  67. package/src/lib/link-preview.ts +25 -0
  68. package/src/lib/markdown-manager.ts +6 -1
  69. package/src/lib/post-display.ts +42 -9
  70. package/src/lib/timeline.ts +39 -9
  71. package/src/lib/tiptap-render.ts +4 -2
  72. package/src/lib/translit.ts +288 -0
  73. package/src/lib/url.ts +123 -12
  74. package/src/lib/view.ts +28 -0
  75. package/src/routes/api/__tests__/palette.test.ts +44 -0
  76. package/src/routes/api/posts.ts +13 -9
  77. package/src/routes/api/public/__tests__/posts.test.ts +38 -0
  78. package/src/routes/api/public/posts.ts +7 -0
  79. package/src/routes/compose.tsx +6 -2
  80. package/src/routes/feed/__tests__/sitemap.test.ts +68 -1
  81. package/src/routes/pages/__tests__/archive-params.test.ts +292 -0
  82. package/src/routes/pages/__tests__/featured.test.ts +6 -2
  83. package/src/routes/pages/__tests__/preview.test.ts +3 -1
  84. package/src/routes/pages/archive.tsx +65 -17
  85. package/src/routes/pages/page.tsx +5 -2
  86. package/src/services/__tests__/collection.test.ts +32 -1
  87. package/src/services/__tests__/post-timeline.test.ts +142 -11
  88. package/src/services/__tests__/post.test.ts +277 -0
  89. package/src/services/collection.ts +8 -10
  90. package/src/services/export-theme/assets/client-site.css +1 -1
  91. package/src/services/export.ts +3 -5
  92. package/src/services/path.ts +4 -1
  93. package/src/services/post.ts +297 -100
  94. package/src/services/search.ts +9 -0
  95. package/src/styles/components.css +0 -14
  96. package/src/styles/site-media.css +4 -4
  97. package/src/styles/tokens.css +62 -1
  98. package/src/styles/ui.css +1363 -1283
  99. package/src/types/entities.ts +5 -0
  100. package/src/types/props.ts +12 -0
  101. package/src/types/views.ts +6 -0
  102. package/src/ui/compose/ComposeDialog.tsx +17 -17
  103. package/src/ui/feed/LinkPreview.tsx +2 -7
  104. package/src/ui/feed/PostStatusBadges.tsx +42 -3
  105. package/src/ui/pages/ArchivePage.tsx +131 -24
  106. package/src/ui/pages/__tests__/ArchivePage.test.tsx +63 -0
  107. package/src/ui/shared/DraftPreviewBar.tsx +25 -9
  108. package/src/ui/shared/PostFooter.tsx +35 -12
  109. package/src/ui/shared/custom-icons.ts +5 -0
  110. package/src/ui/shared/post-article-attributes.ts +6 -0
  111. package/dist/app-BxCOR3Uc.js +0 -6
  112. package/dist/client/_assets/client-B_eGKN5p.css +0 -2
@@ -54,8 +54,11 @@ interface RawSearchRow {
54
54
  rating: number | null;
55
55
  reply_to_id: string | null;
56
56
  thread_id: string;
57
+ /** SQLite returns 0/1, Postgres a boolean. */
58
+ quiet_reply: number | boolean | null;
57
59
  published_at: number | null;
58
60
  last_activity_at: number | null;
61
+ thread_updated_at: number | null;
59
62
  created_at: number;
60
63
  updated_at: number;
61
64
  rank: number;
@@ -92,9 +95,15 @@ function mapRow(row: RawSearchRow): SearchResult {
92
95
  previewProvider: null,
93
96
  replyToId: row.reply_to_id,
94
97
  threadId: row.thread_id,
98
+ quietReply: Boolean(row.quiet_reply),
95
99
  publishedAt: row.published_at,
96
100
  lastActivityAt:
97
101
  row.last_activity_at ?? row.published_at ?? row.updated_at,
102
+ threadUpdatedAt:
103
+ row.thread_updated_at ??
104
+ row.last_activity_at ??
105
+ row.published_at ??
106
+ row.updated_at,
98
107
  createdAt: row.created_at,
99
108
  updatedAt: row.updated_at,
100
109
  },
@@ -481,20 +481,6 @@ svg[stroke-width].icon-fine {
481
481
  }
482
482
  }
483
483
 
484
- .toast-copy {
485
- @apply shrink-0 translate-y-0.5 cursor-pointer rounded-sm p-0 border-0 bg-transparent;
486
- color: var(--color-muted-foreground);
487
- transition: color 0.15s;
488
-
489
- &:hover {
490
- color: var(--color-foreground);
491
- }
492
-
493
- > svg {
494
- @apply size-3.5;
495
- }
496
- }
497
-
498
484
  .toast-out {
499
485
  animation: toast-out 0.3s ease-in forwards;
500
486
  }
@@ -203,8 +203,8 @@
203
203
  display: flex;
204
204
  align-items: center;
205
205
  gap: 2px;
206
- height: 44px;
207
- padding: 0 6px;
206
+ height: 50px;
207
+ padding: 0 6px 6px;
208
208
  box-sizing: border-box;
209
209
  background: linear-gradient(to top, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0));
210
210
  pointer-events: none;
@@ -426,8 +426,8 @@
426
426
  @media (hover: none), (pointer: coarse) {
427
427
  .media-lightbox-short-frame-contained {
428
428
  display: grid;
429
- grid-template-rows: minmax(0, 1fr) 44px;
430
- height: calc(var(--media-lightbox-short-height) + 44px);
429
+ grid-template-rows: minmax(0, 1fr) 50px;
430
+ height: calc(var(--media-lightbox-short-height) + 50px);
431
431
  }
432
432
 
433
433
  .media-lightbox-short-controls {
@@ -203,7 +203,30 @@
203
203
  );
204
204
  --site-threadline: var(--border);
205
205
  --site-page-bg: var(--background);
206
+ /* Despite the name, this is the page colour and ~60 rules use it that way —
207
+ including three that use it as *text* on a dark button. It cannot be
208
+ lifted without repainting the whole site; `--site-raised-bg` below is the
209
+ one that actually means "above the page". Read this as
210
+ "--site-default-surface" until the call sites are triaged. */
206
211
  --site-elevated-bg: var(--background);
212
+ /* What sits *above* the page: dialogs, popovers, menus, sheets. On a light
213
+ page this is the page colour, because the separating is done by the
214
+ backdrop dim and the drop shadows — both black over white. Neither works
215
+ on a dark page: 30% black over `#110f0d` composites to `#0c0b09`, and a
216
+ black shadow on near-black is nothing at all, which left the compose
217
+ dialog at 1.03:1 against its own backdrop. So in dark mode this lifts
218
+ instead (see the dark blocks below). Elevation there is lightness, not
219
+ shadow. */
220
+ --site-raised-bg: var(--site-page-bg);
221
+ /* The edge of a raised layer. On a light page the fill already separates and
222
+ this is just a hairline; on a dark one it does most of the work, because
223
+ the fill has almost no room to lift into. Same formula as
224
+ `--compose-control-border` in light so nothing moves there. */
225
+ --site-raised-border: color-mix(
226
+ in srgb,
227
+ var(--site-column-outline) 68%,
228
+ transparent
229
+ );
207
230
  --site-nav-hover-bg: var(--accent);
208
231
  --site-text-primary: var(--foreground);
209
232
  --site-text-secondary: var(--muted-foreground);
@@ -350,7 +373,10 @@
350
373
  var(--site-accent) 16%,
351
374
  transparent
352
375
  );
353
- --compose-paper-bg: var(--site-page-bg);
376
+ /* The composer is a floating sheet in every mode but one, so its paper is
377
+ the raised surface. `.compose-page` — the full-page `/new` composer, which
378
+ *is* the page — puts this back to `--site-page-bg` locally. */
379
+ --compose-paper-bg: var(--site-raised-bg);
354
380
  --compose-control-bg: color-mix(
355
381
  in srgb,
356
382
  var(--site-nav-hover-bg) 72%,
@@ -366,6 +392,15 @@
366
392
  var(--site-column-outline) 68%,
367
393
  transparent
368
394
  );
395
+ /* The tools row sits directly under the sentence being written, so its icons
396
+ stay a step behind the body's own muted ink and only come forward when
397
+ pointed at or switched on. 72% keeps the faded state above the 3:1
398
+ non-text contrast floor. */
399
+ --compose-tool-ink: color-mix(
400
+ in srgb,
401
+ var(--site-text-secondary) 72%,
402
+ var(--compose-paper-bg)
403
+ );
369
404
  --compose-blockquote-rail: color-mix(
370
405
  in srgb,
371
406
  var(--site-accent) 24%,
@@ -471,6 +506,16 @@
471
506
  --search-mark-bg: oklch(0.45 0.1 85 / 0.5);
472
507
  --search-mark-color: oklch(0.92 0.08 90);
473
508
  --dash-bg: oklch(0.2 0.005 80);
509
+ --site-raised-bg: color-mix(
510
+ in oklab,
511
+ var(--background) 88%,
512
+ var(--foreground)
513
+ );
514
+ --site-raised-border: color-mix(
515
+ in oklab,
516
+ var(--site-raised-bg) 78%,
517
+ var(--foreground)
518
+ );
474
519
  }
475
520
  }
476
521
 
@@ -501,6 +546,22 @@
501
546
  --search-mark-bg: oklch(0.45 0.1 85 / 0.5);
502
547
  --search-mark-color: oklch(0.92 0.08 90);
503
548
  --dash-bg: oklch(0.2 0.005 80);
549
+ /* 12% of the foreground mixed into the page. The headroom here is small and
550
+ bounded: `--site-divider` sits 1.36:1 above the page, and a surface lifted
551
+ past it would swallow every hairline drawn on it. 12% lands at 1.24:1 —
552
+ most of the range that exists, with the dividers still on top of it. */
553
+ --site-raised-bg: color-mix(
554
+ in oklab,
555
+ var(--background) 88%,
556
+ var(--foreground)
557
+ );
558
+ /* Carries the separation the fill cannot: 12% of lift is most of the room
559
+ the palette has, so the edge has to say the rest. */
560
+ --site-raised-border: color-mix(
561
+ in oklab,
562
+ var(--site-raised-bg) 78%,
563
+ var(--foreground)
564
+ );
504
565
  }
505
566
 
506
567
  @media (max-width: 760px), (hover: none) and (pointer: coarse) {