@jant/core 1.2.0 → 1.3.0

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 (147) hide show
  1. package/bin/commands/site/import.js +2 -1
  2. package/dist/{app-CbOZ2Irh.js → app-C8dETvgL.js} +1429 -681
  3. package/dist/client/.vite/manifest.json +72 -83
  4. package/dist/client/_assets/chunks/{confirm-CMe01lne.js → confirm-BQebcuNB.js} +1 -1
  5. package/dist/client/_assets/chunks/{create-editor-hWapNE40.js → create-editor-B8KuszlS.js} +38 -38
  6. package/dist/client/_assets/chunks/footnote-rail-DUrqz0Py.js +2 -0
  7. package/dist/client/_assets/chunks/{jant-locale-picker-2L4rkDaz.js → jant-locale-picker-CLq0iKDH.js} +1 -1
  8. package/dist/client/_assets/chunks/lit-BN4mrI3j.js +2 -0
  9. package/dist/client/_assets/chunks/{settings-paths-BBVT8zKj.js → settings-paths-_fry4yWW.js} +1 -1
  10. package/dist/client/_assets/chunks/{slug-format-BuCPjSrB.js → slug-format-bcJ2ozr4.js} +1 -1
  11. package/dist/client/_assets/chunks/{sortable-list-DJXwkaOv.js → sortable-list-Bz2Na2E9.js} +2 -2
  12. package/dist/client/_assets/chunks/{unsafe-html-CWos3v6N.js → unsafe-html-OJ9m154w.js} +1 -1
  13. package/dist/client/_assets/chunks/unsafe-svg-DVJ4NPcb.js +1 -0
  14. package/dist/client/_assets/{client-D8Rrsd73.css → client-CoNHvipV.css} +1 -1
  15. package/dist/client/_assets/{client-auth-CsUGM718.js → client-auth-CbnZkLJ6.js} +99 -129
  16. package/dist/client/_assets/client-author-2WYBkgni.css +2 -0
  17. package/dist/client/_assets/{client-compose-BB4U7Wz0.js → client-compose-DYtDlYm-.js} +248 -244
  18. package/dist/client/_assets/{client-manage-CI9-eh-8.js → client-manage-BODyYP5Z.js} +157 -157
  19. package/dist/client/_assets/client-pq6sVS7y.js +354 -0
  20. package/dist/client/_assets/{client-settings-BnGPuqwc.js → client-settings-DDpe_tXJ.js} +166 -166
  21. package/dist/client/_assets/client-share-B9OsXx9p.js +149 -0
  22. package/dist/{constants-DEgyqWDl.js → constants-C2CdWAqt.js} +55 -5
  23. package/dist/index.js +1 -1
  24. package/dist/node.js +2 -2
  25. package/package.json +2 -1
  26. package/src/client/components/compose-types.ts +5 -1
  27. package/src/client/components/jant-compose-dialog.ts +25 -4
  28. package/src/client/components/jant-media-lightbox.ts +18 -3
  29. package/src/client/components/jant-nav-manager.ts +2 -0
  30. package/src/client/components/jant-post-menu.ts +42 -89
  31. package/src/client/components/nav-manager-types.ts +2 -0
  32. package/src/client/components/settings-types.ts +1 -1
  33. package/src/client/list-views.ts +382 -0
  34. package/src/client/media-lightbox-events.ts +12 -0
  35. package/src/client/runtime-paths.ts +12 -0
  36. package/src/client/share-capture.ts +63 -0
  37. package/src/client/share-launch.ts +36 -9
  38. package/src/client/tiptap/create-editor.ts +4 -0
  39. package/src/client/tiptap/embed-node.ts +3 -1
  40. package/src/client/tiptap/html-block-node.ts +3 -1
  41. package/src/client/tiptap/image-node.ts +3 -1
  42. package/src/client/view-confirm.ts +32 -4
  43. package/src/client.ts +1 -0
  44. package/src/db/migrations/0037_round_post.sql +16 -0
  45. package/src/db/migrations/0038_flashy_changeling.sql +15 -0
  46. package/src/db/migrations/0039_mixed_sister_grimm.sql +1 -0
  47. package/src/db/migrations/meta/0037_snapshot.json +2932 -0
  48. package/src/db/migrations/meta/0038_snapshot.json +2924 -0
  49. package/src/db/migrations/meta/0039_snapshot.json +2931 -0
  50. package/src/db/migrations/meta/_journal.json +21 -0
  51. package/src/db/migrations/pg/0035_flimsy_outlaw_kid.sql +3 -0
  52. package/src/db/migrations/pg/0036_milky_wolverine.sql +5 -0
  53. package/src/db/migrations/pg/0037_fuzzy_hammerhead.sql +1 -0
  54. package/src/db/migrations/pg/meta/0035_snapshot.json +3773 -0
  55. package/src/db/migrations/pg/meta/0036_snapshot.json +3766 -0
  56. package/src/db/migrations/pg/meta/0037_snapshot.json +3772 -0
  57. package/src/db/migrations/pg/meta/_journal.json +21 -0
  58. package/src/db/pg/schema.ts +1 -0
  59. package/src/db/post-visibility.ts +37 -6
  60. package/src/db/schema.ts +5 -2
  61. package/src/i18n/locales/glossary.zh-Hans.yml +4 -0
  62. package/src/i18n/locales/glossary.zh-Hant.yml +4 -0
  63. package/src/i18n/locales/public/en.po +21 -7
  64. package/src/i18n/locales/public/en.ts +1 -1
  65. package/src/i18n/locales/public/zh-Hans.po +20 -6
  66. package/src/i18n/locales/public/zh-Hans.ts +1 -1
  67. package/src/i18n/locales/public/zh-Hant.po +20 -6
  68. package/src/i18n/locales/public/zh-Hant.ts +1 -1
  69. package/src/i18n/locales/settings/en.po +10 -0
  70. package/src/i18n/locales/settings/en.ts +1 -1
  71. package/src/i18n/locales/settings/zh-Hans.po +10 -0
  72. package/src/i18n/locales/settings/zh-Hans.ts +1 -1
  73. package/src/i18n/locales/settings/zh-Hant.po +10 -0
  74. package/src/i18n/locales/settings/zh-Hant.ts +1 -1
  75. package/src/lib/api-public-posts.ts +10 -0
  76. package/src/lib/feed-policy.ts +2 -2
  77. package/src/lib/filter-dimensions.ts +11 -4
  78. package/src/lib/hugo-markdown.ts +7 -0
  79. package/src/lib/icons.ts +2 -0
  80. package/src/lib/link-preview.ts +499 -0
  81. package/src/lib/list-views.ts +117 -0
  82. package/src/lib/markdown-manager.ts +40 -1
  83. package/src/lib/navigation.ts +1 -1
  84. package/src/lib/share-card.ts +4 -3
  85. package/src/lib/thread-query.ts +6 -2
  86. package/src/lib/timeline.ts +12 -11
  87. package/src/lib/url-fetch.ts +291 -74
  88. package/src/lib/view-buffer.ts +2 -2
  89. package/src/lib/view-counting.ts +7 -6
  90. package/src/lib/view-token.ts +29 -7
  91. package/src/lib/view.ts +17 -0
  92. package/src/middleware/view-counter.ts +10 -5
  93. package/src/preset.css +5 -3
  94. package/src/routes/api/search.ts +1 -1
  95. package/src/routes/dash/settings.tsx +1 -1
  96. package/src/routes/feed/sitemap.ts +1 -1
  97. package/src/routes/pages/archive.tsx +25 -19
  98. package/src/routes/pages/collection.tsx +3 -3
  99. package/src/routes/pages/page.tsx +16 -4
  100. package/src/routes/pages/search.tsx +3 -3
  101. package/src/routes/view-confirm.ts +23 -15
  102. package/src/services/collection.ts +1 -1
  103. package/src/services/export-theme/assets/client-site.js +19 -19
  104. package/src/services/export-theme/layouts/archive/list.html +4 -2
  105. package/src/services/export-theme/layouts/partials/collection-members.html +4 -3
  106. package/src/services/export-theme/layouts/partials/featured-members.html +3 -3
  107. package/src/services/export-theme/layouts/partials/head.html +2 -0
  108. package/src/services/export-theme/layouts/partials/latest-members.html +4 -4
  109. package/src/services/export-theme/layouts/partials/post-card.html +1 -9
  110. package/src/services/export-theme/layouts/partials/reply.html +1 -9
  111. package/src/services/export-theme/layouts/partials/smart-collection-members.html +4 -3
  112. package/src/services/export-theme/layouts/post/list.html +1 -9
  113. package/src/services/export-theme/styles/main.css +2 -26
  114. package/src/services/export.ts +10 -3
  115. package/src/services/mcp.ts +5 -5
  116. package/src/services/navigation.ts +9 -4
  117. package/src/services/post.ts +102 -112
  118. package/src/services/search.ts +22 -7
  119. package/src/services/smart-collection.ts +3 -3
  120. package/src/services/stats.ts +12 -5
  121. package/src/services/thread.ts +6 -2
  122. package/src/styles/components-author.css +69 -7
  123. package/src/styles/tokens.css +28 -29
  124. package/src/styles/ui-author.css +140 -353
  125. package/src/styles/ui.css +34 -32
  126. package/src/types/constants.ts +68 -4
  127. package/src/types/entities.ts +1 -0
  128. package/src/types/views.ts +2 -0
  129. package/src/ui/compose/ComposeDialog.tsx +20 -1
  130. package/src/ui/dash/StatusBadge.tsx +11 -0
  131. package/src/ui/dash/appearance/FontThemeContent.tsx +1 -1
  132. package/src/ui/dash/appearance/NavigationContent.tsx +8 -0
  133. package/src/ui/dash/settings/StatsContent.tsx +29 -29
  134. package/src/ui/feed/LinkCard.tsx +19 -2
  135. package/src/ui/feed/PostStatusBadges.tsx +19 -3
  136. package/src/ui/feed/TimelineFeed.tsx +3 -0
  137. package/src/ui/font-themes.ts +32 -15
  138. package/src/ui/pages/ArchivePage.tsx +1 -0
  139. package/src/ui/shared/PostFooter.tsx +1 -22
  140. package/src/ui/shared/custom-icons.ts +5 -5
  141. package/dist/client/_assets/chunks/footnote-rail-9zwl6jtV.js +0 -2
  142. package/dist/client/_assets/chunks/lit-Bw_voPoW.js +0 -2
  143. package/dist/client/_assets/chunks/runtime-paths-y0_gHowM.js +0 -1
  144. package/dist/client/_assets/chunks/unsafe-svg-CUrgo4Xg.js +0 -1
  145. package/dist/client/_assets/client-BO8GOFfT.js +0 -354
  146. package/dist/client/_assets/client-author-QPm1whbO.css +0 -2
  147. package/dist/client/_assets/client-share-C59mOLJ1.js +0 -149
@@ -586,10 +586,21 @@
586
586
  gap: 0.35rem;
587
587
  }
588
588
 
589
+ /*
590
+ * The row's icon lines up with the page heading and the section labels.
591
+ * Its hover and focus surface reaches `--settings-directory-item-bleed`
592
+ * into the frame's start gutter, which is there for things that hang
593
+ * outside the column, so the icon never sits on the surface's edge. The
594
+ * end gutter is only 5% on phones, so the end side stays in the column.
595
+ */
589
596
  .settings-directory-item {
590
- @apply flex items-center w-full text-left;
597
+ --settings-directory-item-bleed: 0.85rem;
598
+ @apply flex items-center text-left;
599
+ width: calc(100% + var(--settings-directory-item-bleed));
600
+ margin-inline-start: calc(-1 * var(--settings-directory-item-bleed));
591
601
  gap: 0.68rem;
592
- padding: 0.85rem 0.6rem 0.85rem 0;
602
+ padding-block: 0.85rem;
603
+ padding-inline: var(--settings-directory-item-bleed) 0.6rem;
593
604
  border: none;
594
605
  border-radius: 0.85rem;
595
606
  background: transparent;
@@ -924,8 +935,10 @@
924
935
  }
925
936
  @media (max-width: 699px) {
926
937
  .settings-directory-item {
938
+ --settings-directory-item-bleed: 0.75rem;
927
939
  gap: 0.62rem;
928
- padding: 0.78rem 0.52rem 0.78rem 0;
940
+ padding-block: 0.78rem;
941
+ padding-inline-end: 0.52rem;
929
942
  border-radius: 0.8rem;
930
943
  }
931
944
 
@@ -1695,22 +1708,71 @@
1695
1708
  color: var(--primary);
1696
1709
  }
1697
1710
 
1711
+ /* One slot per point, its bar 70% of the slot's width. The slot is the
1712
+ hover target, so a short bar is as easy to point at as a tall one, and
1713
+ `padding-top` keeps room for the label above the tallest bar. */
1698
1714
  .settings-stats-chart {
1699
- display: block;
1715
+ @apply flex items-end;
1716
+ box-sizing: border-box;
1700
1717
  width: 100%;
1701
- height: 9rem;
1718
+ height: 10.5rem;
1719
+ padding-top: 1.5rem;
1720
+ }
1721
+
1722
+ .settings-stats-slot {
1723
+ @apply relative flex items-end;
1724
+ flex: 1 1 0;
1725
+ min-width: 0;
1726
+ height: 100%;
1702
1727
  }
1703
1728
 
1704
1729
  .settings-stats-bar {
1705
- fill: currentColor;
1730
+ display: block;
1731
+ width: 70%;
1732
+ height: var(--stats-height, 0%);
1733
+ margin: 0 auto;
1734
+ background: currentColor;
1706
1735
  opacity: 0.8;
1707
1736
  transition: opacity 150ms ease;
1708
1737
  }
1709
1738
 
1710
- .settings-stats-bar:hover {
1739
+ .settings-stats-slot:hover .settings-stats-bar {
1711
1740
  opacity: 1;
1712
1741
  }
1713
1742
 
1743
+ /* The point and its count, above the bar of the hovered slot. The first
1744
+ and last slots keep theirs inside the chart. */
1745
+ .settings-stats-slot[data-label]:hover::after {
1746
+ content: attr(data-label);
1747
+ position: absolute;
1748
+ left: 50%;
1749
+ bottom: calc(var(--stats-height, 0%) + 0.3rem);
1750
+ z-index: 1;
1751
+ transform: translateX(-50%);
1752
+ padding: 0.1rem 0.4rem;
1753
+ border: 1px solid var(--border);
1754
+ border-radius: var(--radius-sm, 0.375rem);
1755
+ background: var(--site-page-bg);
1756
+ font-family: var(--font-ui);
1757
+ font-size: var(--type-xs);
1758
+ font-variant-numeric: tabular-nums;
1759
+ line-height: 1.4;
1760
+ white-space: nowrap;
1761
+ color: var(--foreground);
1762
+ pointer-events: none;
1763
+ }
1764
+
1765
+ .settings-stats-slot:first-child:hover::after {
1766
+ left: 0;
1767
+ transform: none;
1768
+ }
1769
+
1770
+ .settings-stats-slot:last-child:hover::after {
1771
+ left: auto;
1772
+ right: 0;
1773
+ transform: none;
1774
+ }
1775
+
1714
1776
  /* The baseline under the bars. It starts where the record does: the chart
1715
1777
  sets `--stats-start` to the share of the window that was never counted. */
1716
1778
  .settings-stats-axis {
@@ -143,10 +143,11 @@
143
143
  --type-heading-leading: 1.2;
144
144
  /*
145
145
  * Semibold, not medium: a heading has to outweigh bold body text, and the
146
- * CJK serif faces have no 500 — Songti SC resolves 500 to Regular and 600
147
- * to Bold, so medium headings came out lighter than the <strong> runs
148
- * beneath them. Latin faces with a 500 (New York, Literata, Source Sans)
149
- * step up half a weight. Tufte opts back out to Regular, its own look.
146
+ * Latin faces with a 500 (New York, Literata, Source Sans) would step up
147
+ * only half a weight. A page in Chinese, Japanese or Korean sets both
148
+ * weights to medium instead (`getCjkFontCssVariables` in
149
+ * ui/font-themes.ts): its serif faces have no 500 or 600 and would turn
150
+ * semibold into Bold. Tufte opts back out to Regular, its own look.
150
151
  */
151
152
  --type-heading-weight: var(--fw-semibold);
152
153
  --type-heading-tracking: 0;
@@ -276,6 +277,10 @@
276
277
  it: hover states in navigation and menus, cards in the feed, code
277
278
  blocks. */
278
279
  --site-subtle-bg: var(--accent);
280
+ /* Behind a linked site's icon. Nothing on a light page; on a dark one a
281
+ light tile, because many icons are a black mark on transparency and
282
+ would vanish into the page. */
283
+ --site-link-icon-backdrop: transparent;
279
284
  --site-text-primary: var(--foreground);
280
285
  --site-text-secondary: var(--muted-foreground);
281
286
  --site-reading-title: color-mix(
@@ -348,11 +353,15 @@
348
353
  var(--site-reading-heading) 86%,
349
354
  var(--site-reading-body)
350
355
  );
356
+ /* Fills for blocks inside authored text are tints over transparent, never
357
+ mixes with `--site-page-bg`. On the page the two render the same pixel,
358
+ but text is also set on other paper: the composer is a raised sheet, and a
359
+ fill mixed with the page shows there as a dark patch or not at all. */
351
360
  --site-code-bg: color-mix(in srgb, var(--site-reading-meta) 12%, transparent);
352
361
  --site-code-block-bg: color-mix(
353
362
  in srgb,
354
- var(--site-page-bg) 94%,
355
- var(--site-subtle-bg)
363
+ var(--site-subtle-bg) 6%,
364
+ transparent
356
365
  );
357
366
  --site-code-block-border: color-mix(
358
367
  in srgb,
@@ -378,7 +387,7 @@
378
387
  --site-blockquote-bg: color-mix(
379
388
  in srgb,
380
389
  var(--site-feed-quote-tint) 62%,
381
- var(--site-page-bg)
390
+ transparent
382
391
  );
383
392
  --site-blockquote-text: color-mix(
384
393
  in oklch,
@@ -388,7 +397,7 @@
388
397
  --site-summary-blockquote-bg: color-mix(
389
398
  in srgb,
390
399
  var(--site-feed-quote-tint) 42%,
391
- var(--site-page-bg)
400
+ transparent
392
401
  );
393
402
  --site-reading-blockquote-rail: color-mix(
394
403
  in srgb,
@@ -398,7 +407,7 @@
398
407
  --site-reading-blockquote-bg: color-mix(
399
408
  in srgb,
400
409
  var(--site-accent) 6%,
401
- var(--site-page-bg)
410
+ transparent
402
411
  );
403
412
  --site-thread-context-bg: color-mix(
404
413
  in srgb,
@@ -450,26 +459,6 @@
450
459
  var(--site-text-secondary) 72%,
451
460
  var(--compose-paper-bg)
452
461
  );
453
- --compose-blockquote-rail: color-mix(
454
- in srgb,
455
- var(--site-accent) 24%,
456
- var(--compose-control-border)
457
- );
458
- --compose-blockquote-bg: color-mix(
459
- in srgb,
460
- var(--compose-control-bg) 56%,
461
- var(--compose-paper-bg)
462
- );
463
- --compose-blockquote-bg-focus: color-mix(
464
- in srgb,
465
- var(--compose-control-bg-strong) 70%,
466
- var(--compose-paper-bg)
467
- );
468
- --compose-blockquote-text: color-mix(
469
- in srgb,
470
- var(--site-text-primary) 88%,
471
- var(--site-text-secondary)
472
- );
473
462
  --compose-floating-bg: color-mix(
474
463
  in srgb,
475
464
  var(--compose-paper-bg) 94%,
@@ -607,6 +596,11 @@
607
596
  var(--site-raised-bg) 78%,
608
597
  var(--foreground)
609
598
  );
599
+ --site-link-icon-backdrop: color-mix(
600
+ in oklab,
601
+ var(--foreground) 88%,
602
+ transparent
603
+ );
610
604
  }
611
605
  }
612
606
 
@@ -653,6 +647,11 @@
653
647
  var(--site-raised-bg) 78%,
654
648
  var(--foreground)
655
649
  );
650
+ --site-link-icon-backdrop: color-mix(
651
+ in oklab,
652
+ var(--foreground) 88%,
653
+ transparent
654
+ );
656
655
  }
657
656
 
658
657
  @media (max-width: 699px), (hover: none) and (pointer: coarse) {