@jant/core 1.1.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.
- package/bin/commands/site/import.js +2 -1
- package/bin/lib/site-snapshot.js +10 -0
- package/dist/{app-CKQ9PqAr.js → app-C8dETvgL.js} +9267 -5697
- package/dist/client/.vite/manifest.json +82 -93
- package/dist/client/_assets/chunks/{confirm-CMe01lne.js → confirm-BQebcuNB.js} +1 -1
- package/dist/client/_assets/chunks/{create-editor-BQkrw8Ax.js → create-editor-B8KuszlS.js} +38 -38
- package/dist/client/_assets/chunks/footnote-rail-DUrqz0Py.js +2 -0
- package/dist/client/_assets/chunks/{jant-locale-picker-2L4rkDaz.js → jant-locale-picker-CLq0iKDH.js} +1 -1
- package/dist/client/_assets/chunks/lit-BN4mrI3j.js +2 -0
- package/dist/client/_assets/chunks/{settings-paths-B0bNUaih.js → settings-paths-_fry4yWW.js} +1 -1
- package/dist/client/_assets/chunks/{slug-format-CYmQE5ln.js → slug-format-bcJ2ozr4.js} +1 -1
- package/dist/client/_assets/chunks/sortable-list-Bz2Na2E9.js +2 -0
- package/dist/client/_assets/chunks/types-DrYFqJH2.js +1 -0
- package/dist/client/_assets/chunks/{unsafe-html-CWos3v6N.js → unsafe-html-OJ9m154w.js} +1 -1
- package/dist/client/_assets/chunks/unsafe-svg-DVJ4NPcb.js +1 -0
- package/dist/client/_assets/client-CoNHvipV.css +2 -0
- package/dist/client/_assets/{client-auth-CG55rWb5.js → client-auth-CbnZkLJ6.js} +99 -129
- package/dist/client/_assets/{client-author-CGVvrNZ8.css → client-author-2WYBkgni.css} +1 -1
- package/dist/client/_assets/client-compose-DYtDlYm-.js +2008 -0
- package/dist/client/_assets/{client-manage-DnYdQAhf.js → client-manage-BODyYP5Z.js} +157 -157
- package/dist/client/_assets/client-pq6sVS7y.js +354 -0
- package/dist/client/_assets/{client-settings-CHgsIqXJ.js → client-settings-DDpe_tXJ.js} +166 -166
- package/dist/client/_assets/client-share-B9OsXx9p.js +149 -0
- package/dist/{constants-DEgyqWDl.js → constants-C2CdWAqt.js} +55 -5
- package/dist/index.js +1 -1
- package/dist/node.js +3 -2
- package/package.json +2 -1
- package/src/app.tsx +9 -0
- package/src/client/components/compose-types.ts +6 -1
- package/src/client/components/jant-compose-dialog.ts +26 -4
- package/src/client/components/jant-compose-editor.ts +30 -0
- package/src/client/components/jant-compose-fullscreen.ts +1 -0
- package/src/client/components/jant-media-lightbox.ts +18 -3
- package/src/client/components/jant-nav-manager.ts +2 -0
- package/src/client/components/jant-post-menu.ts +42 -89
- package/src/client/components/nav-manager-types.ts +2 -0
- package/src/client/components/settings-types.ts +1 -1
- package/src/client/compose-bridge.ts +61 -1
- package/src/client/feed-video-player.ts +6 -0
- package/src/client/list-views.ts +382 -0
- package/src/client/media-lightbox-events.ts +12 -0
- package/src/client/runtime-paths.ts +12 -0
- package/src/client/share-capture.ts +63 -0
- package/src/client/share-launch.ts +36 -9
- package/src/client/tiptap/bubble-menu.ts +25 -2
- package/src/client/tiptap/create-editor.ts +6 -0
- package/src/client/tiptap/embed-node.ts +3 -1
- package/src/client/tiptap/extensions.ts +4 -0
- package/src/client/tiptap/html-block-node.ts +3 -1
- package/src/client/tiptap/image-node.ts +3 -1
- package/src/client/video-processor.ts +106 -52
- package/src/client/view-confirm.ts +136 -0
- package/src/client.ts +2 -0
- package/src/db/migrations/0035_brainy_next_avengers.sql +9 -0
- package/src/db/migrations/0036_gorgeous_smasher.sql +7 -0
- package/src/db/migrations/0037_round_post.sql +16 -0
- package/src/db/migrations/0038_flashy_changeling.sql +15 -0
- package/src/db/migrations/0039_mixed_sister_grimm.sql +1 -0
- package/src/db/migrations/meta/0035_snapshot.json +2877 -0
- package/src/db/migrations/meta/0036_snapshot.json +2924 -0
- package/src/db/migrations/meta/0037_snapshot.json +2932 -0
- package/src/db/migrations/meta/0038_snapshot.json +2924 -0
- package/src/db/migrations/meta/0039_snapshot.json +2931 -0
- package/src/db/migrations/meta/_journal.json +35 -0
- package/src/db/migrations/pg/0033_cute_magdalene.sql +10 -0
- package/src/db/migrations/pg/0034_material_agent_brand.sql +8 -0
- package/src/db/migrations/pg/0035_flimsy_outlaw_kid.sql +3 -0
- package/src/db/migrations/pg/0036_milky_wolverine.sql +5 -0
- package/src/db/migrations/pg/0037_fuzzy_hammerhead.sql +1 -0
- package/src/db/migrations/pg/meta/0033_snapshot.json +3719 -0
- package/src/db/migrations/pg/meta/0034_snapshot.json +3766 -0
- package/src/db/migrations/pg/meta/0035_snapshot.json +3773 -0
- package/src/db/migrations/pg/meta/0036_snapshot.json +3766 -0
- package/src/db/migrations/pg/meta/0037_snapshot.json +3772 -0
- package/src/db/migrations/pg/meta/_journal.json +35 -0
- package/src/db/pg/schema.ts +41 -0
- package/src/db/post-visibility.ts +37 -6
- package/src/db/schema.ts +64 -0
- package/src/i18n/locales/glossary.zh-Hans.yml +4 -0
- package/src/i18n/locales/glossary.zh-Hant.yml +4 -0
- package/src/i18n/locales/public/en.po +26 -7
- package/src/i18n/locales/public/en.ts +1 -1
- package/src/i18n/locales/public/zh-Hans.po +25 -6
- package/src/i18n/locales/public/zh-Hans.ts +1 -1
- package/src/i18n/locales/public/zh-Hant.po +25 -6
- package/src/i18n/locales/public/zh-Hant.ts +1 -1
- package/src/i18n/locales/settings/en.po +159 -0
- package/src/i18n/locales/settings/en.ts +1 -1
- package/src/i18n/locales/settings/zh-Hans.po +159 -0
- package/src/i18n/locales/settings/zh-Hans.ts +1 -1
- package/src/i18n/locales/settings/zh-Hant.po +159 -0
- package/src/i18n/locales/settings/zh-Hant.ts +1 -1
- package/src/lib/api-public-posts.ts +10 -0
- package/src/lib/env.ts +20 -0
- package/src/lib/feed-policy.ts +2 -2
- package/src/lib/filter-dimensions.ts +11 -4
- package/src/lib/github-app-state.ts +1 -1
- package/src/lib/github-app.ts +183 -1
- package/src/lib/hugo-markdown.ts +7 -0
- package/src/lib/icons.ts +2 -0
- package/src/lib/link-preview.ts +499 -0
- package/src/lib/list-views.ts +117 -0
- package/src/lib/markdown-manager.ts +169 -2
- package/src/lib/navigation.ts +1 -1
- package/src/lib/post-meta.ts +13 -3
- package/src/lib/referrer-aliases.ts +311 -0
- package/src/lib/render.tsx +10 -0
- package/src/lib/resolve-config.ts +14 -0
- package/src/lib/share-card.ts +4 -3
- package/src/lib/summary.ts +152 -54
- package/src/lib/thread-query.ts +6 -2
- package/src/lib/timeline.ts +12 -11
- package/src/lib/tiptap-render.ts +1 -0
- package/src/lib/upload.ts +21 -1
- package/src/lib/url-fetch.ts +291 -74
- package/src/lib/video-playback.ts +55 -0
- package/src/lib/view-buffer.ts +201 -0
- package/src/lib/view-counting.ts +540 -0
- package/src/lib/view-token.ts +199 -0
- package/src/lib/view.ts +30 -1
- package/src/middleware/view-counter.ts +145 -0
- package/src/node/runtime.ts +4 -0
- package/src/preset.css +36 -17
- package/src/routes/api/media.ts +21 -3
- package/src/routes/api/search.ts +1 -1
- package/src/routes/dash/settings.tsx +434 -169
- package/src/routes/feed/sitemap.ts +1 -1
- package/src/routes/pages/archive.tsx +26 -19
- package/src/routes/pages/collection.tsx +9 -3
- package/src/routes/pages/collections.tsx +1 -0
- package/src/routes/pages/featured.tsx +1 -0
- package/src/routes/pages/home.tsx +1 -0
- package/src/routes/pages/page.tsx +18 -3
- package/src/routes/pages/search.tsx +3 -3
- package/src/routes/pages/smart-collection.tsx +2 -0
- package/src/routes/pages/subscribe.tsx +1 -0
- package/src/routes/view-confirm.ts +71 -0
- package/src/services/collection.ts +1 -1
- package/src/services/export-theme/assets/client-site.js +19 -19
- package/src/services/export-theme/layouts/archive/list.html +4 -2
- package/src/services/export-theme/layouts/partials/collection-members.html +4 -3
- package/src/services/export-theme/layouts/partials/featured-members.html +3 -3
- package/src/services/export-theme/layouts/partials/head.html +2 -0
- package/src/services/export-theme/layouts/partials/latest-members.html +4 -4
- package/src/services/export-theme/layouts/partials/post-card.html +1 -9
- package/src/services/export-theme/layouts/partials/reply.html +1 -9
- package/src/services/export-theme/layouts/partials/smart-collection-members.html +4 -3
- package/src/services/export-theme/layouts/post/list.html +1 -9
- package/src/services/export-theme/styles/main.css +41 -47
- package/src/services/export.ts +12 -3
- package/src/services/index.ts +17 -0
- package/src/services/mcp.ts +36 -6
- package/src/services/media.ts +63 -0
- package/src/services/navigation.ts +9 -4
- package/src/services/post.ts +102 -112
- package/src/services/search.ts +22 -7
- package/src/services/smart-collection.ts +3 -3
- package/src/services/stats.ts +1137 -0
- package/src/services/thread.ts +6 -2
- package/src/styles/components-author.css +242 -3
- package/src/styles/components.css +11 -3
- package/src/styles/tokens.css +89 -55
- package/src/styles/ui-author.css +140 -353
- package/src/styles/ui.css +90 -45
- package/src/types/app-context.ts +9 -0
- package/src/types/bindings.ts +5 -0
- package/src/types/config.ts +54 -0
- package/src/types/constants.ts +68 -4
- package/src/types/entities.ts +1 -0
- package/src/types/views.ts +8 -0
- package/src/ui/compose/ComposeDialog.tsx +26 -1
- package/src/ui/dash/StatusBadge.tsx +11 -0
- package/src/ui/dash/appearance/FontThemeContent.tsx +1 -1
- package/src/ui/dash/appearance/NavigationContent.tsx +8 -0
- package/src/ui/dash/settings/SettingsRootContent.tsx +24 -6
- package/src/ui/dash/settings/StatsContent.tsx +855 -0
- package/src/ui/feed/LinkCard.tsx +19 -2
- package/src/ui/feed/PostStatusBadges.tsx +19 -3
- package/src/ui/feed/TimelineFeed.tsx +3 -0
- package/src/ui/font-themes.ts +56 -6
- package/src/ui/layouts/BaseLayout.tsx +4 -2
- package/src/ui/layouts/SiteLayout.tsx +8 -3
- package/src/ui/pages/ArchivePage.tsx +1 -0
- package/src/ui/shared/MediaGallery.tsx +19 -3
- package/src/ui/shared/PostFooter.tsx +1 -22
- package/src/ui/shared/custom-icons.ts +5 -5
- package/dist/client/_assets/chunks/footnote-rail-B08scyhW.js +0 -2
- package/dist/client/_assets/chunks/lit-Bw_voPoW.js +0 -2
- package/dist/client/_assets/chunks/runtime-paths-y0_gHowM.js +0 -1
- package/dist/client/_assets/chunks/sortable-list-t11Ma1Ek.js +0 -2
- package/dist/client/_assets/chunks/types-D5iF3H1a.js +0 -1
- package/dist/client/_assets/chunks/unsafe-svg-DZl-yjas.js +0 -1
- package/dist/client/_assets/client-B0-s9sqx.css +0 -2
- package/dist/client/_assets/client-Dp46QSht.js +0 -354
- package/dist/client/_assets/client-compose-DkUTuavR.js +0 -2004
- package/dist/client/_assets/client-share-C59mOLJ1.js +0 -149
package/src/services/thread.ts
CHANGED
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
type PostFilterSelection,
|
|
22
22
|
} from "../lib/filter-dimensions.js";
|
|
23
23
|
import { foldReplyWindows, type ThreadFold } from "../lib/thread-fold.js";
|
|
24
|
+
import { isOpenableByReader } from "../types/constants.js";
|
|
24
25
|
import type {
|
|
25
26
|
CollectionSortOrder,
|
|
26
27
|
Post,
|
|
@@ -263,6 +264,9 @@ export function createThreadService(deps: {
|
|
|
263
264
|
if (reader && visibility === "private") {
|
|
264
265
|
throw new ValidationError("Private posts aren't listed here.");
|
|
265
266
|
}
|
|
267
|
+
if (reader && visibility === "unlisted") {
|
|
268
|
+
throw new ValidationError("Unlisted posts aren't listed here.");
|
|
269
|
+
}
|
|
266
270
|
if (
|
|
267
271
|
visibility === "featured" &&
|
|
268
272
|
query.sort !== undefined &&
|
|
@@ -273,7 +277,7 @@ export function createThreadService(deps: {
|
|
|
273
277
|
|
|
274
278
|
const base = {
|
|
275
279
|
status: reader ? ("published" as const) : (query.status ?? "published"),
|
|
276
|
-
|
|
280
|
+
listedForReader: reader,
|
|
277
281
|
excludeLatestHidden:
|
|
278
282
|
reader && visibility === undefined && !query.includeHidden,
|
|
279
283
|
lang: query.lang,
|
|
@@ -344,7 +348,7 @@ export function createThreadService(deps: {
|
|
|
344
348
|
if (!root) return null;
|
|
345
349
|
if (
|
|
346
350
|
audience === "reader" &&
|
|
347
|
-
(root.status !== "published" || root.visibility
|
|
351
|
+
(root.status !== "published" || !isOpenableByReader(root.visibility))
|
|
348
352
|
) {
|
|
349
353
|
return null;
|
|
350
354
|
}
|
|
@@ -535,7 +535,10 @@
|
|
|
535
535
|
opacity: 0.5;
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
+
/* The current page's name is the one piece that can be long (a post's
|
|
539
|
+
derived title); it takes the rest of the line and is cut, never wrapped. */
|
|
538
540
|
.dash-breadcrumb-current {
|
|
541
|
+
@apply flex-1 min-w-0 truncate;
|
|
539
542
|
color: var(--color-foreground);
|
|
540
543
|
font-weight: var(--fw-medium);
|
|
541
544
|
}
|
|
@@ -583,10 +586,21 @@
|
|
|
583
586
|
gap: 0.35rem;
|
|
584
587
|
}
|
|
585
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
|
+
*/
|
|
586
596
|
.settings-directory-item {
|
|
587
|
-
|
|
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));
|
|
588
601
|
gap: 0.68rem;
|
|
589
|
-
padding: 0.85rem
|
|
602
|
+
padding-block: 0.85rem;
|
|
603
|
+
padding-inline: var(--settings-directory-item-bleed) 0.6rem;
|
|
590
604
|
border: none;
|
|
591
605
|
border-radius: 0.85rem;
|
|
592
606
|
background: transparent;
|
|
@@ -921,8 +935,10 @@
|
|
|
921
935
|
}
|
|
922
936
|
@media (max-width: 699px) {
|
|
923
937
|
.settings-directory-item {
|
|
938
|
+
--settings-directory-item-bleed: 0.75rem;
|
|
924
939
|
gap: 0.62rem;
|
|
925
|
-
padding: 0.78rem
|
|
940
|
+
padding-block: 0.78rem;
|
|
941
|
+
padding-inline-end: 0.52rem;
|
|
926
942
|
border-radius: 0.8rem;
|
|
927
943
|
}
|
|
928
944
|
|
|
@@ -1619,4 +1635,227 @@
|
|
|
1619
1635
|
.skel-section-lg {
|
|
1620
1636
|
min-height: 300px;
|
|
1621
1637
|
}
|
|
1638
|
+
|
|
1639
|
+
/* ---------------------------------------------------------------------- */
|
|
1640
|
+
/* Stats page: a window switch, a bar chart, two lists, one switch */
|
|
1641
|
+
/* ---------------------------------------------------------------------- */
|
|
1642
|
+
|
|
1643
|
+
.settings-stats {
|
|
1644
|
+
@apply flex flex-col;
|
|
1645
|
+
gap: 2rem;
|
|
1646
|
+
max-width: var(--form-max-width);
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
.settings-stats-header {
|
|
1650
|
+
@apply flex flex-wrap items-baseline justify-between;
|
|
1651
|
+
gap: 0.75rem 1.5rem;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
.settings-stats-title {
|
|
1655
|
+
@apply flex flex-wrap items-baseline;
|
|
1656
|
+
gap: 0.5rem;
|
|
1657
|
+
margin: 0;
|
|
1658
|
+
font-size: var(--type-title);
|
|
1659
|
+
font-weight: var(--fw-semibold);
|
|
1660
|
+
line-height: var(--type-heading-leading);
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
/* A page's name on its own stats page: at most two lines, then cut. An
|
|
1664
|
+
untitled note is named by its opening words, which can run long. */
|
|
1665
|
+
.settings-stats-title-name {
|
|
1666
|
+
display: -webkit-box;
|
|
1667
|
+
-webkit-box-orient: vertical;
|
|
1668
|
+
-webkit-line-clamp: 2;
|
|
1669
|
+
overflow: hidden;
|
|
1670
|
+
overflow-wrap: anywhere;
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
.settings-stats-windows {
|
|
1674
|
+
@apply flex;
|
|
1675
|
+
gap: 0.25rem;
|
|
1676
|
+
font-family: var(--font-ui);
|
|
1677
|
+
font-size: var(--type-sm);
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
.settings-stats-window {
|
|
1681
|
+
padding: 0.25rem 0.6rem;
|
|
1682
|
+
border-radius: 999px;
|
|
1683
|
+
color: var(--site-text-secondary);
|
|
1684
|
+
text-decoration: none;
|
|
1685
|
+
transition:
|
|
1686
|
+
color 150ms ease,
|
|
1687
|
+
background-color 150ms ease;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
.settings-stats-window:hover {
|
|
1691
|
+
color: var(--foreground);
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
.settings-stats-window[aria-current="page"] {
|
|
1695
|
+
color: var(--foreground);
|
|
1696
|
+
background: var(--muted);
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
.settings-stats-total {
|
|
1700
|
+
margin: 0;
|
|
1701
|
+
font-family: var(--font-ui);
|
|
1702
|
+
font-size: var(--type-subtitle);
|
|
1703
|
+
font-weight: var(--fw-medium);
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
.settings-stats-figure {
|
|
1707
|
+
margin: 0;
|
|
1708
|
+
color: var(--primary);
|
|
1709
|
+
}
|
|
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. */
|
|
1714
|
+
.settings-stats-chart {
|
|
1715
|
+
@apply flex items-end;
|
|
1716
|
+
box-sizing: border-box;
|
|
1717
|
+
width: 100%;
|
|
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%;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
.settings-stats-bar {
|
|
1730
|
+
display: block;
|
|
1731
|
+
width: 70%;
|
|
1732
|
+
height: var(--stats-height, 0%);
|
|
1733
|
+
margin: 0 auto;
|
|
1734
|
+
background: currentColor;
|
|
1735
|
+
opacity: 0.8;
|
|
1736
|
+
transition: opacity 150ms ease;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
.settings-stats-slot:hover .settings-stats-bar {
|
|
1740
|
+
opacity: 1;
|
|
1741
|
+
}
|
|
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
|
+
|
|
1776
|
+
/* The baseline under the bars. It starts where the record does: the chart
|
|
1777
|
+
sets `--stats-start` to the share of the window that was never counted. */
|
|
1778
|
+
.settings-stats-axis {
|
|
1779
|
+
@apply flex justify-between;
|
|
1780
|
+
margin-left: var(--stats-start, 0%);
|
|
1781
|
+
padding-top: 0.35rem;
|
|
1782
|
+
border-top: 1px solid var(--border);
|
|
1783
|
+
font-family: var(--font-ui);
|
|
1784
|
+
font-size: var(--type-xs);
|
|
1785
|
+
color: var(--site-text-secondary);
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
.settings-stats-axis > span {
|
|
1789
|
+
white-space: nowrap;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
/* Today's date alone, under the end of the baseline. */
|
|
1793
|
+
.settings-stats-axis-single {
|
|
1794
|
+
@apply justify-end;
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
.settings-stats-section {
|
|
1798
|
+
@apply flex flex-col;
|
|
1799
|
+
gap: 0.5rem;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
.settings-stats-heading {
|
|
1803
|
+
margin: 0;
|
|
1804
|
+
font-family: var(--font-ui);
|
|
1805
|
+
font-size: var(--type-xs);
|
|
1806
|
+
font-weight: var(--fw-medium);
|
|
1807
|
+
letter-spacing: 0.02em;
|
|
1808
|
+
color: var(--site-text-secondary);
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
.settings-stats-list {
|
|
1812
|
+
@apply flex flex-col;
|
|
1813
|
+
gap: 0.125rem;
|
|
1814
|
+
margin: 0;
|
|
1815
|
+
padding: 0;
|
|
1816
|
+
list-style: none;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
/* A ranked row. The bar behind it is its share of the window's total,
|
|
1820
|
+
set by the row as `--stats-share`; the text sits on top of it. */
|
|
1821
|
+
.settings-stats-row {
|
|
1822
|
+
@apply flex items-center;
|
|
1823
|
+
gap: 0.75rem;
|
|
1824
|
+
padding: 0.45rem 0.625rem;
|
|
1825
|
+
border-radius: var(--radius-sm, 0.375rem);
|
|
1826
|
+
background: linear-gradient(
|
|
1827
|
+
to right,
|
|
1828
|
+
var(--muted) var(--stats-share, 0%),
|
|
1829
|
+
transparent var(--stats-share, 0%)
|
|
1830
|
+
);
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
.settings-stats-rank {
|
|
1834
|
+
flex: none;
|
|
1835
|
+
min-width: 1.25rem;
|
|
1836
|
+
font-family: var(--font-ui);
|
|
1837
|
+
font-size: var(--type-sm);
|
|
1838
|
+
font-variant-numeric: tabular-nums;
|
|
1839
|
+
text-align: right;
|
|
1840
|
+
color: var(--site-text-secondary);
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
.settings-stats-label {
|
|
1844
|
+
@apply flex-1 min-w-0 truncate;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
.settings-stats-link {
|
|
1848
|
+
color: inherit;
|
|
1849
|
+
text-decoration: none;
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
.settings-stats-link:hover {
|
|
1853
|
+
text-decoration: underline;
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
.settings-stats-count {
|
|
1857
|
+
font-family: var(--font-ui);
|
|
1858
|
+
font-variant-numeric: tabular-nums;
|
|
1859
|
+
color: var(--site-text-secondary);
|
|
1860
|
+
}
|
|
1622
1861
|
}
|
|
@@ -10,14 +10,22 @@
|
|
|
10
10
|
* see the note in `style-author.css`.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
/*
|
|
13
|
+
/* Highlighted text in a post */
|
|
14
14
|
mark {
|
|
15
|
-
background-color: var(--site-
|
|
16
|
-
color: var(--site-
|
|
15
|
+
background-color: var(--site-highlight-bg);
|
|
16
|
+
color: var(--site-highlight-color);
|
|
17
17
|
border-radius: 2px;
|
|
18
18
|
padding: 0 2px;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/* Search result highlight. The search page renders snippets, never post
|
|
22
|
+
HTML, so every mark on it is a match. */
|
|
23
|
+
.search-page mark,
|
|
24
|
+
.search-snippet mark {
|
|
25
|
+
background-color: var(--site-search-mark-bg);
|
|
26
|
+
color: var(--site-search-mark-color);
|
|
27
|
+
}
|
|
28
|
+
|
|
21
29
|
/* Config Editor — a quiet utility list, not a stack of nested cards. */
|
|
22
30
|
@layer components {
|
|
23
31
|
jant-config-editor {
|
package/src/styles/tokens.css
CHANGED
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
* otherwise drop the text to the OS last-resort font.
|
|
18
18
|
*/
|
|
19
19
|
--font-cjk-serif-fallback:
|
|
20
|
-
"Songti SC",
|
|
21
|
-
"Songti TC",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"Noto Serif
|
|
20
|
+
"Songti SC", "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC",
|
|
21
|
+
STSong, SimSun, "Songti TC", "Noto Serif TC", "Noto Serif CJK TC",
|
|
22
|
+
"Source Han Serif TC", PMingLiU, MingLiU, "Hiragino Mincho ProN",
|
|
23
|
+
"Hiragino Mincho Pro", "Yu Mincho", YuMincho, "Noto Serif JP",
|
|
24
|
+
"Noto Serif CJK JP", "MS PMincho", "MS Mincho", Batang, "Noto Serif KR",
|
|
25
|
+
"Noto Serif CJK KR", NanumMyeongjo;
|
|
25
26
|
--font-cjk-sans-fallback:
|
|
26
27
|
"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
|
|
27
28
|
"Noto Sans CJK SC", "PingFang TC", "Hiragino Sans CNS",
|
|
@@ -97,8 +98,14 @@
|
|
|
97
98
|
/* Content reading tokens — desktop maps to core scale,
|
|
98
99
|
mobile overrides below cap sizes for small screens.
|
|
99
100
|
--type-content-scale uniformly scales all content sizes
|
|
100
|
-
without affecting UI controls.
|
|
101
|
-
|
|
101
|
+
without affecting UI controls.
|
|
102
|
+
|
|
103
|
+
0.81 puts the body at 17px (21px × 0.81). Latin reading surfaces run
|
|
104
|
+
17–21 (Ghost 17–19, Substack 20, Medium 21); Chinese ones settle on 17
|
|
105
|
+
(sspai, Apple), since a Han glyph fills its em where Latin lowercase
|
|
106
|
+
fills half, so the same px reads a size larger. 18 was tried and read
|
|
107
|
+
as big on a 13-inch laptop. Titles and headings keep their ratios. */
|
|
108
|
+
--type-content-scale: 0.81;
|
|
102
109
|
--type-content-display: calc(var(--type-display) * var(--type-content-scale));
|
|
103
110
|
--type-content-title: calc(var(--type-title) * var(--type-content-scale));
|
|
104
111
|
--type-content-subtitle: calc(
|
|
@@ -126,12 +133,25 @@
|
|
|
126
133
|
--type-thread-context-meta: var(--type-sm);
|
|
127
134
|
--feed-note-title-size: calc(var(--type-content-body) * 1.36);
|
|
128
135
|
--feed-note-title-leading: var(--type-heading-leading);
|
|
136
|
+
/*
|
|
137
|
+
* Reading rhythm. A page in Chinese, Japanese or Korean raises both
|
|
138
|
+
* leadings (`getCjkFontCssVariables` in ui/font-themes.ts): Han glyphs fill
|
|
139
|
+
* the em box, so the same line-height packs CJK lines tighter than Latin.
|
|
140
|
+
*/
|
|
129
141
|
--type-body-leading: 1.7;
|
|
130
142
|
--type-display-leading: 1.15;
|
|
131
|
-
--type-heading-leading: 1.
|
|
132
|
-
|
|
143
|
+
--type-heading-leading: 1.2;
|
|
144
|
+
/*
|
|
145
|
+
* Semibold, not medium: a heading has to outweigh bold body text, and the
|
|
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.
|
|
151
|
+
*/
|
|
152
|
+
--type-heading-weight: var(--fw-semibold);
|
|
133
153
|
--type-heading-tracking: 0;
|
|
134
|
-
--type-display-weight: var(--fw-
|
|
154
|
+
--type-display-weight: var(--fw-semibold);
|
|
135
155
|
--type-display-tracking: 0;
|
|
136
156
|
--type-label-weight: var(--fw-medium);
|
|
137
157
|
--type-label-tracking: 0.08em;
|
|
@@ -152,15 +172,16 @@
|
|
|
152
172
|
*
|
|
153
173
|
* `--layout-reading-width` is the reading column a post's text actually
|
|
154
174
|
* gets. It tracks the proportion while the gutter exists, then keeps a
|
|
155
|
-
* measure of its own instead of going
|
|
156
|
-
* up with body copy — the text blocks
|
|
157
|
-
* (MediaGallery `getSingleVisualWidth`), a link
|
|
158
|
-
* that centers over the column — reads this one.
|
|
159
|
-
* consumers capped on the proportion and quietly
|
|
160
|
-
* 700px and 1024px.
|
|
175
|
+
* measure of its own, `--layout-reading-measure`, instead of going
|
|
176
|
+
* full-width. Anything that must line up with body copy — the text blocks
|
|
177
|
+
* in preset.css, a lone image (MediaGallery `getSingleVisualWidth`), a link
|
|
178
|
+
* preview, the feed divider that centers over the column — reads this one.
|
|
179
|
+
* Before it existed those consumers capped on the proportion and quietly
|
|
180
|
+
* outgrew the text between 700px and 1024px.
|
|
161
181
|
*/
|
|
162
182
|
--layout-content-width: 55%;
|
|
163
183
|
--layout-reading-width: var(--layout-content-width);
|
|
184
|
+
--layout-reading-measure: 35rem;
|
|
164
185
|
--layout-sidenote-width: 50%;
|
|
165
186
|
--layout-sidenote-gap: 10%;
|
|
166
187
|
--layout-sidenote-margin: -60%;
|
|
@@ -256,6 +277,10 @@
|
|
|
256
277
|
it: hover states in navigation and menus, cards in the feed, code
|
|
257
278
|
blocks. */
|
|
258
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;
|
|
259
284
|
--site-text-primary: var(--foreground);
|
|
260
285
|
--site-text-secondary: var(--muted-foreground);
|
|
261
286
|
--site-reading-title: color-mix(
|
|
@@ -328,11 +353,15 @@
|
|
|
328
353
|
var(--site-reading-heading) 86%,
|
|
329
354
|
var(--site-reading-body)
|
|
330
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. */
|
|
331
360
|
--site-code-bg: color-mix(in srgb, var(--site-reading-meta) 12%, transparent);
|
|
332
361
|
--site-code-block-bg: color-mix(
|
|
333
362
|
in srgb,
|
|
334
|
-
var(--site-
|
|
335
|
-
|
|
363
|
+
var(--site-subtle-bg) 6%,
|
|
364
|
+
transparent
|
|
336
365
|
);
|
|
337
366
|
--site-code-block-border: color-mix(
|
|
338
367
|
in srgb,
|
|
@@ -358,7 +387,7 @@
|
|
|
358
387
|
--site-blockquote-bg: color-mix(
|
|
359
388
|
in srgb,
|
|
360
389
|
var(--site-feed-quote-tint) 62%,
|
|
361
|
-
|
|
390
|
+
transparent
|
|
362
391
|
);
|
|
363
392
|
--site-blockquote-text: color-mix(
|
|
364
393
|
in oklch,
|
|
@@ -368,7 +397,7 @@
|
|
|
368
397
|
--site-summary-blockquote-bg: color-mix(
|
|
369
398
|
in srgb,
|
|
370
399
|
var(--site-feed-quote-tint) 42%,
|
|
371
|
-
|
|
400
|
+
transparent
|
|
372
401
|
);
|
|
373
402
|
--site-reading-blockquote-rail: color-mix(
|
|
374
403
|
in srgb,
|
|
@@ -378,7 +407,7 @@
|
|
|
378
407
|
--site-reading-blockquote-bg: color-mix(
|
|
379
408
|
in srgb,
|
|
380
409
|
var(--site-accent) 6%,
|
|
381
|
-
|
|
410
|
+
transparent
|
|
382
411
|
);
|
|
383
412
|
--site-thread-context-bg: color-mix(
|
|
384
413
|
in srgb,
|
|
@@ -430,26 +459,6 @@
|
|
|
430
459
|
var(--site-text-secondary) 72%,
|
|
431
460
|
var(--compose-paper-bg)
|
|
432
461
|
);
|
|
433
|
-
--compose-blockquote-rail: color-mix(
|
|
434
|
-
in srgb,
|
|
435
|
-
var(--site-accent) 24%,
|
|
436
|
-
var(--compose-control-border)
|
|
437
|
-
);
|
|
438
|
-
--compose-blockquote-bg: color-mix(
|
|
439
|
-
in srgb,
|
|
440
|
-
var(--compose-control-bg) 56%,
|
|
441
|
-
var(--compose-paper-bg)
|
|
442
|
-
);
|
|
443
|
-
--compose-blockquote-bg-focus: color-mix(
|
|
444
|
-
in srgb,
|
|
445
|
-
var(--compose-control-bg-strong) 70%,
|
|
446
|
-
var(--compose-paper-bg)
|
|
447
|
-
);
|
|
448
|
-
--compose-blockquote-text: color-mix(
|
|
449
|
-
in srgb,
|
|
450
|
-
var(--site-text-primary) 88%,
|
|
451
|
-
var(--site-text-secondary)
|
|
452
|
-
);
|
|
453
462
|
--compose-floating-bg: color-mix(
|
|
454
463
|
in srgb,
|
|
455
464
|
var(--compose-paper-bg) 94%,
|
|
@@ -460,6 +469,11 @@
|
|
|
460
469
|
--site-search-mark-bg: oklch(0.92 0.14 90 / 0.55);
|
|
461
470
|
--site-search-mark-color: oklch(0.35 0.09 70);
|
|
462
471
|
|
|
472
|
+
/* Highlighted text in posts (`==text==`). Follows each theme's search
|
|
473
|
+
colors until a theme sets it, and every theme sets those on :root. */
|
|
474
|
+
--site-highlight-bg: var(--site-search-mark-bg);
|
|
475
|
+
--site-highlight-color: var(--site-search-mark-color);
|
|
476
|
+
|
|
463
477
|
/* Admin */
|
|
464
478
|
--dash-bg: oklch(0.97 0.005 80);
|
|
465
479
|
--dash-card-radius: 10px;
|
|
@@ -477,19 +491,22 @@
|
|
|
477
491
|
* dialog.
|
|
478
492
|
*
|
|
479
493
|
* 480px Header hamburger; the composer's post-meta pill sheds its words.
|
|
480
|
-
* 580px Nav collapse tier-sm (hides the 3rd inline link).
|
|
481
494
|
* 640px Media grid and lightbox chrome.
|
|
482
495
|
* 700px THE PHONE SWITCH. Below it the layout is a phone's: the composer
|
|
483
496
|
* is a full-screen sheet, the compose FAB appears, page gutters and
|
|
484
497
|
* the content type scale go narrow. Written `max-width: 699px` on
|
|
485
498
|
* the phone side and `min-width: 700px` on the desktop side, so the
|
|
486
499
|
* two never both match at 700px itself.
|
|
487
|
-
*
|
|
488
|
-
*
|
|
489
|
-
*
|
|
500
|
+
* 960px The full-screen composer tightens its padding and title sizes.
|
|
501
|
+
* 1024px Tufte two-column → single-column, and the page frame narrows to
|
|
502
|
+
* the reading column (see the note below).
|
|
490
503
|
* 1079px Collections sidebar drops out.
|
|
491
504
|
* 1200px Header search collapses to an icon.
|
|
492
505
|
*
|
|
506
|
+
* The header's nav links are not on this list: they collapse into More by the
|
|
507
|
+
* header's own width (`@container site-header` in ui.css), because the same
|
|
508
|
+
* viewport gives a reader page a narrower header than a settings page.
|
|
509
|
+
*
|
|
493
510
|
* Touch is NOT a width. Thumb-sized controls and always-visible affordances
|
|
494
511
|
* belong to `(hover: none) and (pointer: coarse)`, which is what actually
|
|
495
512
|
* catches a phone or a tablet; a narrow desktop window is still a mouse.
|
|
@@ -505,17 +522,19 @@
|
|
|
505
522
|
/* Tufte two-column → single-column collapse.
|
|
506
523
|
*
|
|
507
524
|
* There is no room for a 45% sidenote gutter here, so page shells go
|
|
508
|
-
* full-width — but the reading column does not follow them. It keeps
|
|
509
|
-
* measure
|
|
510
|
-
* link previews, the feed divider) tracks that through
|
|
511
|
-
* `--layout-reading-width` rather than restating the number.
|
|
525
|
+
* full-width — but the reading column does not follow them. It keeps
|
|
526
|
+
* `--layout-reading-measure`, and everything sized to the text (preset.css
|
|
527
|
+
* blocks, single images, link previews, the feed divider) tracks that through
|
|
528
|
+
* `--layout-reading-width` rather than restating the number. The page frame
|
|
529
|
+
* narrows to the same measure and centers (ui.css), so the column has no
|
|
530
|
+
* leftover width piled up on its right.
|
|
512
531
|
*
|
|
513
532
|
* Keep this breakpoint in sync with the sidenote float→inline collapse
|
|
514
533
|
* (ui.css). They are one layout switch; do not let them drift apart. */
|
|
515
534
|
@media (max-width: 1024px) {
|
|
516
535
|
:root {
|
|
517
536
|
--layout-content-width: 100%;
|
|
518
|
-
--layout-reading-width: min(100%,
|
|
537
|
+
--layout-reading-width: min(100%, var(--layout-reading-measure));
|
|
519
538
|
}
|
|
520
539
|
}
|
|
521
540
|
|
|
@@ -577,6 +596,11 @@
|
|
|
577
596
|
var(--site-raised-bg) 78%,
|
|
578
597
|
var(--foreground)
|
|
579
598
|
);
|
|
599
|
+
--site-link-icon-backdrop: color-mix(
|
|
600
|
+
in oklab,
|
|
601
|
+
var(--foreground) 88%,
|
|
602
|
+
transparent
|
|
603
|
+
);
|
|
580
604
|
}
|
|
581
605
|
}
|
|
582
606
|
|
|
@@ -623,19 +647,29 @@
|
|
|
623
647
|
var(--site-raised-bg) 78%,
|
|
624
648
|
var(--foreground)
|
|
625
649
|
);
|
|
650
|
+
--site-link-icon-backdrop: color-mix(
|
|
651
|
+
in oklab,
|
|
652
|
+
var(--foreground) 88%,
|
|
653
|
+
transparent
|
|
654
|
+
);
|
|
626
655
|
}
|
|
627
656
|
|
|
628
657
|
@media (max-width: 699px), (hover: none) and (pointer: coarse) {
|
|
629
658
|
:root {
|
|
630
659
|
/* Content layer — tighter scale for mobile reading.
|
|
660
|
+
Body keeps the desktop size; the headings sit closer to it than
|
|
661
|
+
desktop's 2.7 / 2.1 / 1.8 rem so a title fits a phone line.
|
|
631
662
|
Ratio ≈ 1.88 : 1.42 : 1.15 : 1 (display:title:subtitle:body).
|
|
632
|
-
At 15px root × 0.
|
|
663
|
+
At 15px root × 0.81 content-scale: 32 / 24.2 / 19.6 / 17px.
|
|
633
664
|
Body is floored to a 16px minimum below (max()) for readability;
|
|
634
665
|
the floor still yields to calc() when the user zooms the root up. */
|
|
635
|
-
--type-content-display: calc(2.
|
|
636
|
-
--type-content-title: calc(1.
|
|
637
|
-
--type-content-subtitle: calc(1.
|
|
638
|
-
--type-content-body: max(
|
|
666
|
+
--type-content-display: calc(2.63rem * var(--type-content-scale));
|
|
667
|
+
--type-content-title: calc(1.99rem * var(--type-content-scale));
|
|
668
|
+
--type-content-subtitle: calc(1.61rem * var(--type-content-scale));
|
|
669
|
+
--type-content-body: max(
|
|
670
|
+
16px,
|
|
671
|
+
calc(var(--type-body) * var(--type-content-scale))
|
|
672
|
+
);
|
|
639
673
|
|
|
640
674
|
/* UI layer — pixel floors for touch targets */
|
|
641
675
|
--type-ui-title: max(16px, var(--type-secondary));
|