@jant/core 0.10.0 → 0.11.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/db/execute-file.js +1 -1
- package/bin/commands/db/export.js +1 -1
- package/bin/commands/migrate.js +4 -4
- package/bin/commands/posts/rebuild-html.js +1 -1
- package/bin/commands/reset-password.js +1 -1
- package/bin/commands/search/reindex.js +1 -1
- package/bin/commands/setup.js +4 -2
- package/bin/commands/site/export.js +3 -0
- package/bin/commands/site/import.js +178 -91
- package/bin/commands/site/pull-media.js +3 -2
- package/bin/commands/site/snapshot/export.js +3 -1
- package/bin/commands/site/snapshot/import.js +3 -2
- package/bin/commands/start.js +44 -0
- package/bin/commands/telegram/register-webhooks.js +1 -1
- package/bin/commands/uploads/cleanup.js +48 -9
- package/bin/jant.js +39 -4
- package/bin/lib/import-sources.js +151 -0
- package/bin/lib/node-env.js +14 -9
- package/bin/lib/runtime-target.js +1 -1
- package/bin/lib/site-pull-media.js +56 -4
- package/bin/lib/site-snapshot.js +39 -2
- package/bin/lib/sql-export.js +66 -10
- package/dist/{app-DIVtyB4m.js → app-jQI4OPRe.js} +5055 -4448
- package/dist/client/.vite/manifest.json +38 -38
- package/dist/client/_assets/chunks/{create-editor-B-m7X7S5.js → create-editor-5Y49x7h5.js} +2 -2
- package/dist/client/_assets/chunks/{footnote-rail-CmeoVtnU.js → footnote-rail-BJwswtVQ.js} +1 -1
- package/dist/client/_assets/chunks/{settings-paths-C-ZZBTau.js → settings-paths-h6RjIe3C.js} +2 -2
- package/dist/client/_assets/chunks/{slug-format-BcIsNKz-.js → slug-format-Dsi0e9Xn.js} +1 -1
- package/dist/client/_assets/chunks/{slugify-373citbs.js → slugify-DlHLyUHS.js} +1 -1
- package/dist/client/_assets/chunks/sortable-list-DYMcJrlS.js +2 -0
- package/dist/client/_assets/chunks/unsafe-svg-DxrzM_Gb.js +2 -0
- package/dist/client/_assets/client-52vQhZAv.js +296 -0
- package/dist/client/_assets/client-BaqmpPQ-.css +2 -0
- package/dist/client/_assets/{client-auth-BpkkKTsV.js → client-auth-BDcCR6u1.js} +2 -2
- package/dist/client/_assets/client-author-CGVvrNZ8.css +2 -0
- package/dist/client/_assets/{client-compose-C-DXzcFR.js → client-compose-CzEwT5qX.js} +4 -4
- package/dist/client/_assets/{client-manage-BfT7ht4M.js → client-manage-CF7x21L4.js} +37 -37
- package/dist/client/_assets/{client-settings-CGR_nZ78.js → client-settings-DIM44Zqh.js} +2 -2
- package/dist/{url-CKlGzvdN.js → constants-DEgyqWDl.js} +340 -1
- package/dist/index.d.ts +44 -0
- package/dist/index.js +33 -1
- package/dist/node.js +57 -13
- package/package.json +13 -18
- package/src/__tests__/api-docs.test.ts +168 -1
- package/src/__tests__/bin/import-sources.test.ts +85 -0
- package/src/__tests__/bin/uploads-cleanup.test.ts +66 -26
- package/src/__tests__/cli-commands.test.ts +40 -0
- package/src/__tests__/config-docs.test.ts +119 -16
- package/src/__tests__/custom-url-redirects.test.ts +108 -0
- package/src/__tests__/export-collection-custom-urls.test.ts +69 -0
- package/src/__tests__/export-docs.test.ts +113 -41
- package/src/__tests__/export-feed-ids.test.ts +1 -0
- package/src/__tests__/export-format-version.test.ts +88 -0
- package/src/__tests__/export-hugo-build.test.ts +139 -4
- package/src/__tests__/export-import-roundtrip.test.ts +2 -1
- package/src/__tests__/export-service.test.ts +42 -13
- package/src/__tests__/export-smart-collection.test.ts +1 -1
- package/src/__tests__/feed-docs.test.ts +287 -21
- package/src/__tests__/feed-reply-addresses.test.ts +100 -0
- package/src/__tests__/feeds-disabled.test.ts +98 -0
- package/src/__tests__/fixtures/export-format/1.json +76 -0
- package/src/__tests__/fixtures/export-format/2.json +80 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/README.md +130 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/2thjq/_index.md +25 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/2u5e5/_index.md +35 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/41q27/0x4nv/index.md +18 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/41q27/_index.md +44 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/41q27/faqyt/index.md +30 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/41q27/the-potting-mix-guide-i-keep-rereading/index.md +20 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/5kayp/_index.md +23 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/5ynfs/_index.md +31 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/5ynfs/hu597/index.md +21 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/_index.md +5 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/a-night-heron-field-guide-for-my-walk-folder/_index.md +31 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/a-quiet-saturday-after-a-busy-week/_index.md +36 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/archive/_index.md +8 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/are-na-is-the-only-bookmark-pile-i-still-revisit/_index.md +30 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/bought-too-many-lemons-again/_index.md +37 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/city-walks/_index.md +12 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/cleanshot-for-screenshots-ocr-and-screen-recording-on-the-mac/_index.md +33 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/cleanshotmac-shang-de-jie-tu-ocr-lu-ping-gong-ju/_index.md +32 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/co344/_index.md +25 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/collections/_index.md +5 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/current-tea-rotation/_index.md +34 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/derek-sivers-still-writes-the-kind-of-internet-i-want-more-of/_index.md +30 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/desk-but-better/_index.md +25 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/e0kcg/_index.md +22 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/egi3c/_index.md +24 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/evf9j/_index.md +152 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/featured/_index.md +8 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/from-basho/_index.md +25 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/from-epictetus/_index.md +25 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/from-marcus-aurelius/_index.md +25 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/from-seneca/_index.md +26 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/from-thoreau/_index.md +25 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/gkbvv/2cl6d/index.md +18 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/gkbvv/3zqv7/index.md +30 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/gkbvv/5oxsv/index.md +18 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/gkbvv/_index.md +39 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/gwob9/_index.md +25 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/home-cooking/_index.md +12 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/hz729/_index.md +24 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/inaturalist-ai-zi-ran-she-qu/_index.md +44 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/j4v0q/_index.md +35 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/k278t/_index.md +25 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/k4eee/_index.md +22 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/k5vh8/_index.md +32 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/k5vh8/a-reading-log-idea-i-might-steal/index.md +20 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/k5vh8/a83qu/index.md +18 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/k5vh8/from-seneca-5hibo/index.md +21 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/kan-qi-lai-bi-jiao-ku-de-gong-si-men/_index.md +41 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/l2m7y/_index.md +29 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/lan-ya-yao-kong-qi-chuang-shang-yue-du-de-fan-ye-shen-qi/_index.md +57 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/mynoise-for-rainy-afternoons/_index.md +30 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/n09le/_index.md +23 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/ni-fu-jin-de-wei-ji-bai-ke-tiao-mu/_index.md +42 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/nts-archives-are-good-cleaning-music/_index.md +30 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/qgfcu/_index.md +32 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/qgfcu/c91j0/index.md +18 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/qgfcu/qyucy/index.md +18 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/qgfcu/wsgck/index.md +18 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/rain-makes-my-neighborhood-look-better/_index.md +46 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/reading-notes/_index.md +12 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/s4r3e/_index.md +25 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/serious-eats-on-tomato-and-egg-soup/_index.md +30 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/te812/_index.md +44 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/te812/cxiu6/index.md +18 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/te812/t77ms/index.md +18 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/te812/the-soup-trick-i-always-forget/index.md +20 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/telk3/_index.md +30 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/telk3/from-thoreau-pawt2/index.md +21 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/the-five-minute-reset-is-still-the-best-habit-i-have/_index.md +36 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/the-hallway-light-took-12-minutes-and-3-months/_index.md +32 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/the-recurse-center-manual-is-weirdly-calming/_index.md +30 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/tiny-projects/_index.md +12 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/tong-wang-xing-fu-zhi-lu/_index.md +68 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/tou-ma-yan-jiang-ju-le-bu-chu-ti-yan/_index.md +62 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/useful-links/_index.md +12 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/weekend-notes/_index.md +12 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/content/what-i-actually-use-my-notebook-for/_index.md +52 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/data/jant.toml +124 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/hugo.toml +45 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/_redirects +25 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/40bc6cd1f12e-med_01kn8jtq3penf98tfq4gzmh9g9.png +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01kn8jtx8qenf98tm9ahxr48sw.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01kn8jv0jdenf98tp6qr9zgjjc.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01kn8jv452enf98trbkwrvhvgd.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01kn8jvb16enf98txp7p0pf5ge.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01kn8jve5nenf98tzap11gpxzr.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01kn8jvq58enf98v538w5vsqp4.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01kn8jvsaeenf98v6ct4gjzppc.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01kn8jw26cenf98vc7k0ppz5k8.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m313q1hme4e8cmby77dn66yy.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m313q2w7e4e8cmc20036yh66.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m313q7d2e4e8cmdeqjmyafby.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m313q887e4e8cmdjssych7yh.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167jx2f6ct88pkz45j3ycp-poster.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167jx2f6ct88pkz45j3ycp.mp4 +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167mbdf6ct88pr4ga1b9kf-poster.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167mbdf6ct88pr4ga1b9kf.mp4 +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167nsvf6ct88q1anhz4svb-poster.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167nsvf6ct88q1anhz4svb.mp4 +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167qaxf6ct88qfndwzxx83-poster.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167qaxf6ct88qfndwzxx83.mp4 +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167sm0f6ct88qw5brtsgcw.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167tf8f6ct88r169s51j49.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167vaaf6ct88rbx5ztenwb.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167w51f6ct88rp19pybkw1.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167x0nf6ct88rzajb84tw3.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167xxbf6ct88s5t2300bjk.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167yq5f6ct88s9pjwt5fxg.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/static/media/med_01m3167zg4f6ct88sge8jp28ja.webp +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/themes/jant/static/apple-touch-icon.png +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/themes/jant/static/custom.css +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/themes/jant/static/favicon.ico +0 -0
- package/src/__tests__/fixtures/releases/0.10.0/site-export/wrangler.jsonc +24 -0
- package/src/__tests__/fixtures/releases/0.10.0/snapshot/db.sql +322 -0
- package/src/__tests__/fixtures/releases/0.10.0/snapshot/meta.json +11 -0
- package/src/__tests__/helpers/app.ts +6 -1
- package/src/__tests__/helpers/export-fixtures.ts +1 -0
- package/src/__tests__/import-refused-aliases.test.ts +98 -0
- package/src/__tests__/import-site-command.test.ts +73 -8
- package/src/__tests__/public-types.test.ts +64 -0
- package/src/__tests__/release-fixtures.test.ts +79 -24
- package/src/__tests__/release-version.test.ts +84 -0
- package/src/__tests__/site-pull-media.test.ts +48 -0
- package/src/__tests__/snapshot-tables.test.ts +37 -0
- package/src/__tests__/sql-export.test.ts +21 -1
- package/src/__tests__/stored-file-headers.test.ts +94 -0
- package/src/__tests__/template-deploy-workflow.test.ts +101 -0
- package/src/__tests__/theme-docs.test.ts +113 -24
- package/src/__tests__/toolchain-versions.test.ts +54 -0
- package/src/__tests__/trailing-slash-redirect.test.ts +61 -0
- package/src/__tests__/vite-config-graph.test.ts +98 -0
- package/src/app.tsx +89 -66
- package/src/client/__tests__/compose-bridge-image-upload.test.ts +1 -0
- package/src/client/__tests__/compose-bridge.test.ts +87 -0
- package/src/client/__tests__/compose-shortcuts.test.ts +4 -4
- package/src/client/__tests__/footnote-rail.test.ts +1 -1
- package/src/client/__tests__/lazy-entries.test.ts +1 -1
- package/src/client/__tests__/media-scroll-hint.test.ts +2 -2
- package/src/client/avatar-upload.ts +10 -10
- package/src/client/components/__tests__/jant-compose-dialog.test.ts +295 -4
- package/src/client/components/__tests__/jant-compose-editor.test.ts +34 -0
- package/src/client/components/__tests__/jant-settings-general.test.ts +0 -32
- package/src/client/components/compose-types.ts +14 -0
- package/src/client/components/jant-compose-dialog.ts +96 -41
- package/src/client/components/jant-compose-editor.ts +21 -4
- package/src/client/components/jant-config-editor.ts +4 -6
- package/src/client/components/jant-media-lightbox.ts +4 -4
- package/src/client/components/jant-settings-general.ts +0 -4
- package/src/client/components/nav-manager-types.ts +6 -5
- package/src/client/compose-bridge.ts +15 -4
- package/src/client/compose-launch.ts +4 -6
- package/src/client/compose-shortcuts.ts +1 -1
- package/src/client/footnote-rail.ts +1 -1
- package/src/client/lazy-entries.ts +1 -1
- package/src/client/media-scroll-hint.ts +2 -2
- package/src/client/tiptap/__tests__/markdown-clipboard.test.ts +55 -0
- package/src/client/tiptap/markdown-clipboard.ts +50 -2
- package/src/client/upload-session.ts +7 -6
- package/src/db/__tests__/backfill-external-redirects.test.ts +59 -0
- package/src/db/__tests__/backfill-featured-discover.test.ts +56 -0
- package/src/db/backfills/0007_restore_external_redirect_scheme.sql +20 -0
- package/src/db/backfills/0008_turn_off_featured_only_discover.sql +11 -0
- package/src/i18n/locales/public/en.po +46 -48
- package/src/i18n/locales/public/en.ts +1 -1
- package/src/i18n/locales/public/zh-Hans.po +45 -46
- package/src/i18n/locales/public/zh-Hans.ts +1 -1
- package/src/i18n/locales/public/zh-Hant.po +45 -46
- package/src/i18n/locales/public/zh-Hant.ts +1 -1
- package/src/i18n/locales/settings/en.po +15 -29
- package/src/i18n/locales/settings/en.ts +1 -1
- package/src/i18n/locales/settings/zh-Hans.po +15 -29
- package/src/i18n/locales/settings/zh-Hans.ts +1 -1
- package/src/i18n/locales/settings/zh-Hant.po +15 -29
- package/src/i18n/locales/settings/zh-Hant.ts +1 -1
- package/src/index.ts +43 -2
- package/src/lib/__tests__/api-settings.test.ts +3 -3
- package/src/lib/__tests__/constants.test.ts +10 -0
- package/src/lib/__tests__/discover.test.ts +8 -9
- package/src/lib/__tests__/env-values.test.ts +125 -0
- package/src/lib/__tests__/feed-path.test.ts +29 -0
- package/src/lib/__tests__/feed.test.ts +50 -22
- package/src/lib/__tests__/filter-dimensions.test.ts +22 -8
- package/src/lib/__tests__/post-list-cursor.test.ts +0 -10
- package/src/lib/__tests__/rate-limit.test.ts +22 -7
- package/src/lib/__tests__/resolve-config.test.ts +5 -3
- package/src/lib/__tests__/schemas.test.ts +72 -23
- package/src/lib/__tests__/slugify.test.ts +9 -0
- package/src/lib/__tests__/startup-config.test.ts +12 -0
- package/src/lib/__tests__/storage-s3.test.ts +214 -0
- package/src/lib/__tests__/theme.test.ts +20 -1
- package/src/lib/__tests__/time.test.ts +56 -0
- package/src/lib/__tests__/timeline.test.ts +46 -0
- package/src/lib/__tests__/url-fetch.test.ts +65 -1
- package/src/lib/__tests__/url.test.ts +60 -1
- package/src/lib/api-nav-items.ts +16 -20
- package/src/lib/api-post-input.ts +34 -1
- package/src/lib/api-posts.ts +125 -23
- package/src/lib/api-public-posts.ts +28 -37
- package/src/lib/api-search.ts +49 -2
- package/src/lib/api-settings.ts +159 -54
- package/src/lib/api-threads.ts +34 -11
- package/src/lib/constants.ts +6 -0
- package/src/lib/discover.ts +7 -23
- package/src/lib/env-values.ts +140 -0
- package/src/lib/env.ts +203 -12
- package/src/lib/feed-path.ts +8 -2
- package/src/lib/feed-policy.ts +110 -7
- package/src/lib/feed.ts +69 -25
- package/src/lib/filter-dimensions.ts +17 -10
- package/src/lib/github-sync-site-config.ts +1 -0
- package/src/lib/hugo-markdown.ts +5 -6
- package/src/lib/navigation.ts +4 -1
- package/src/lib/post-list-cursor.ts +33 -29
- package/src/lib/public-storage.ts +43 -0
- package/src/lib/rate-limit.ts +31 -16
- package/src/lib/render.tsx +5 -0
- package/src/lib/resolve-config.ts +16 -19
- package/src/lib/schemas.ts +248 -180
- package/src/lib/slugify.ts +6 -1
- package/src/lib/sse.ts +1 -1
- package/src/lib/startup-config.ts +20 -1
- package/src/lib/theme.ts +8 -5
- package/src/lib/thread-fold.ts +6 -0
- package/src/lib/thread-query.ts +19 -24
- package/src/lib/time.ts +137 -17
- package/src/lib/timeline.ts +56 -13
- package/src/lib/url-fetch.ts +141 -40
- package/src/lib/url.ts +86 -1
- package/src/middleware/__tests__/auth.test.ts +27 -0
- package/src/middleware/__tests__/cors.test.ts +54 -0
- package/src/middleware/__tests__/cross-origin.test.ts +149 -0
- package/src/middleware/__tests__/public-content-access.test.ts +2 -42
- package/src/middleware/auth.ts +34 -3
- package/src/middleware/cors.ts +4 -4
- package/src/middleware/cross-origin.ts +124 -0
- package/src/middleware/error-handler.ts +7 -0
- package/src/middleware/public-content-access.ts +3 -26
- package/src/middleware/secure-headers.ts +8 -2
- package/src/node/__tests__/cli-migrate.test.ts +2 -2
- package/src/node/__tests__/cli-runtime-target.test.ts +13 -2
- package/src/node/__tests__/cli-site-snapshot.test.ts +57 -0
- package/src/node/__tests__/cli-snapshot-meta.test.ts +11 -1
- package/src/node/__tests__/cli-sql-export.test.ts +25 -1
- package/src/node/__tests__/cli-start.test.ts +66 -0
- package/src/node/__tests__/request-handler.test.ts +37 -0
- package/src/node/__tests__/runtime.test.ts +56 -1
- package/src/node/request-handler.ts +58 -5
- package/src/node/runtime.ts +37 -11
- package/src/preset.css +3 -3
- package/src/routes/__tests__/compose.test.ts +84 -0
- package/src/routes/api/__tests__/collections.test.ts +68 -0
- package/src/routes/api/__tests__/mcp.test.ts +164 -9
- package/src/routes/api/__tests__/media.test.ts +9 -1
- package/src/routes/api/__tests__/nav-items.test.ts +27 -1
- package/src/routes/api/__tests__/posts.test.ts +269 -78
- package/src/routes/api/__tests__/search.test.ts +17 -4
- package/src/routes/api/__tests__/settings.test.ts +119 -85
- package/src/routes/api/__tests__/telegram.test.ts +11 -6
- package/src/routes/api/__tests__/threads.test.ts +11 -0
- package/src/routes/api/__tests__/upload-response.test.ts +48 -0
- package/src/routes/api/__tests__/uploads.test.ts +35 -2
- package/src/routes/api/collections.ts +3 -3
- package/src/routes/api/custom-urls.ts +2 -1
- package/src/routes/api/export.ts +1 -0
- package/src/routes/api/internal/__tests__/post-body-html.test.ts +19 -0
- package/src/routes/api/internal/__tests__/uploads.test.ts +2 -0
- package/src/routes/api/internal/sites.ts +16 -4
- package/src/routes/api/mcp.ts +1 -0
- package/src/routes/api/media.ts +7 -8
- package/src/routes/api/nav-items.ts +2 -1
- package/src/routes/api/posts.ts +18 -24
- package/src/routes/api/public/__tests__/posts.test.ts +15 -0
- package/src/routes/api/public/__tests__/threads-collections.test.ts +12 -45
- package/src/routes/api/public/__tests__/threads.test.ts +41 -9
- package/src/routes/api/public/posts.ts +2 -2
- package/src/routes/api/public/threads.ts +16 -26
- package/src/routes/api/search.ts +7 -41
- package/src/routes/api/settings.ts +32 -28
- package/src/routes/api/smart-collections.ts +6 -1
- package/src/routes/api/threads.ts +25 -26
- package/src/routes/api/upload.ts +6 -21
- package/src/routes/api/uploads.ts +14 -20
- package/src/routes/auth/__tests__/dev.test.ts +16 -13
- package/src/routes/auth/__tests__/hosted-sso.test.ts +51 -0
- package/src/routes/auth/__tests__/setup-auth.test.ts +2 -0
- package/src/routes/auth/__tests__/setup-discover.test.ts +2 -0
- package/src/routes/auth/__tests__/setup-flow.test.ts +32 -0
- package/src/routes/auth/__tests__/setup-rate-limit.test.ts +72 -0
- package/src/routes/auth/__tests__/setup-steps.test.ts +2 -0
- package/src/routes/auth/__tests__/signin.test.ts +167 -2
- package/src/routes/auth/dev.ts +4 -6
- package/src/routes/auth/hosted-sso.ts +9 -6
- package/src/routes/auth/setup.tsx +35 -5
- package/src/routes/auth/signin.tsx +96 -1
- package/src/routes/compose.tsx +47 -47
- package/src/routes/dash/__tests__/settings-avatar.test.ts +59 -4
- package/src/routes/dash/__tests__/settings-demo-locks.test.ts +147 -0
- package/src/routes/dash/custom-urls.tsx +2 -0
- package/src/routes/dash/settings.tsx +79 -32
- package/src/routes/feed/__tests__/feed.test.ts +93 -3
- package/src/routes/feed/__tests__/sitemap.test.ts +42 -0
- package/src/routes/feed/feed.ts +128 -175
- package/src/routes/feed/sitemap.ts +9 -7
- package/src/routes/pages/__tests__/archive-years.test.ts +45 -0
- package/src/routes/pages/__tests__/collection-routing.test.ts +40 -0
- package/src/routes/pages/__tests__/collections.test.ts +3 -0
- package/src/routes/pages/__tests__/language-routing.test.ts +31 -0
- package/src/routes/pages/__tests__/post-page-round-trips.test.ts +34 -2
- package/src/routes/pages/__tests__/search.test.ts +5 -2
- package/src/routes/pages/__tests__/thread-gap.test.ts +207 -0
- package/src/routes/pages/archive.tsx +33 -94
- package/src/routes/pages/brand.tsx +1 -0
- package/src/routes/pages/collection.tsx +13 -84
- package/src/routes/pages/collections.tsx +2 -0
- package/src/routes/pages/featured.tsx +7 -2
- package/src/routes/pages/home.tsx +1 -0
- package/src/routes/pages/latest.tsx +6 -2
- package/src/routes/pages/new.tsx +1 -0
- package/src/routes/pages/page.tsx +73 -47
- package/src/routes/pages/search.tsx +5 -3
- package/src/routes/pages/smart-collection.tsx +11 -70
- package/src/routes/pages/subscribe.tsx +1 -0
- package/src/routes/pages/theme-sample.tsx +1 -0
- package/src/runtime/__tests__/readiness.test.ts +16 -0
- package/src/runtime/cloudflare.ts +2 -3
- package/src/runtime/index.ts +3 -1
- package/src/runtime/node.ts +3 -5
- package/src/runtime/readiness.ts +5 -0
- package/src/services/__tests__/auth.test.ts +115 -0
- package/src/services/__tests__/collection.test.ts +9 -0
- package/src/services/__tests__/github-sync-webhook.test.ts +78 -0
- package/src/services/__tests__/hosted-handoff.test.ts +208 -1
- package/src/services/__tests__/media.test.ts +47 -27
- package/src/services/__tests__/navigation.test.ts +67 -15
- package/src/services/__tests__/post.test.ts +103 -56
- package/src/services/__tests__/search.test.ts +38 -0
- package/src/services/__tests__/settings.test.ts +2 -14
- package/src/services/__tests__/smart-collection.test.ts +2 -2
- package/src/services/__tests__/telegram-ingest.test.ts +113 -0
- package/src/services/__tests__/thread.test.ts +26 -11
- package/src/services/auth.ts +36 -4
- package/src/services/collection.ts +46 -5
- package/src/services/custom-url.ts +11 -4
- package/src/services/export-theme/assets/client-site.css +1 -1
- package/src/services/export-theme/assets/client-site.js +2 -2
- package/src/services/export-theme/layouts/_default/baseof.html +1 -1
- package/src/services/export-theme/layouts/collection/single.html +1 -1
- package/src/services/export-theme/layouts/partials/featured-thread.html +8 -1
- package/src/services/export-theme/layouts/partials/head.html +1 -1
- package/src/services/export-theme/layouts/partials/media-gallery.html +6 -3
- package/src/services/export-theme/layouts/smart_collection/list.html +1 -1
- package/src/services/export-theme/styles/main.css +3 -3
- package/src/services/export.ts +68 -19
- package/src/services/github-sync.ts +10 -10
- package/src/services/hosted-handoff.ts +106 -6
- package/src/services/index.ts +3 -1
- package/src/services/language.ts +33 -0
- package/src/services/mcp.ts +176 -438
- package/src/services/media.ts +69 -21
- package/src/services/navigation.ts +19 -4
- package/src/services/path.ts +45 -3
- package/src/services/post.ts +329 -214
- package/src/services/search.ts +22 -3
- package/src/services/settings.ts +36 -3
- package/src/services/site-admin.ts +1 -0
- package/src/services/smart-collection.ts +10 -3
- package/src/services/telegram.ts +23 -6
- package/src/services/thread.ts +11 -3
- package/src/services/upload-session.ts +14 -15
- package/src/styles/components.css +2 -2
- package/src/styles/site-media.css +2 -2
- package/src/styles/tokens.css +19 -22
- package/src/styles/ui-author.css +73 -94
- package/src/styles/ui.css +62 -62
- package/src/types/app-context.ts +5 -1
- package/src/types/bindings.ts +11 -0
- package/src/types/config.ts +4 -4
- package/src/types/constants.ts +20 -0
- package/src/types/props.ts +34 -8
- package/src/types/views.ts +28 -13
- package/src/ui/color-themes.ts +6 -5
- package/src/ui/dash/settings/GeneralContent.tsx +0 -22
- package/src/ui/dash/settings/__tests__/GeneralContent.test.tsx +0 -21
- package/src/ui/feed/CuratedThreadPreview.tsx +7 -2
- package/src/ui/feed/LinkCard.tsx +1 -2
- package/src/ui/feed/NoteCard.tsx +1 -2
- package/src/ui/feed/QuoteCard.tsx +2 -2
- package/src/ui/feed/ThreadPreview.tsx +6 -6
- package/src/ui/feed/TimelineFeed.tsx +1 -7
- package/src/ui/feed/__tests__/thread-preview.test.ts +123 -10
- package/src/ui/feed/__tests__/timeline-cards.test.ts +18 -1
- package/src/ui/layouts/BaseLayout.tsx +5 -0
- package/src/ui/pages/ArchivePage.tsx +1 -1
- package/src/ui/pages/BrandPage.tsx +1 -1
- package/src/ui/pages/CollectionPage.tsx +0 -1
- package/src/ui/pages/CollectionsPage.tsx +2 -2
- package/src/ui/pages/ComposePage.tsx +1 -1
- package/src/ui/pages/FeaturedPage.tsx +1 -1
- package/src/ui/pages/HomePage.tsx +1 -1
- package/src/ui/pages/PostPage.tsx +1 -1
- package/src/ui/pages/SearchPage.tsx +1 -1
- package/src/ui/pages/SmartCollectionPage.tsx +2 -3
- package/src/ui/pages/SubscribePage.tsx +1 -1
- package/src/ui/pages/ThemeSamplePage.tsx +1 -1
- package/src/ui/shared/MediaGallery.tsx +1 -1
- package/src/vendor/datastar.js +9 -1956
- package/src/vendor/datastar.js.map +4 -4
- package/dist/client/_assets/chunks/sortable-list-BJyd-LXE.js +0 -2
- package/dist/client/_assets/chunks/unsafe-svg-DU_DNMy5.js +0 -2
- package/dist/client/_assets/client-D4AT9Iqr.js +0 -295
- package/dist/client/_assets/client-DRuw7XCt.css +0 -2
- package/dist/client/_assets/client-author-DQ8R-8KR.css +0 -2
|
@@ -66,7 +66,6 @@ function createProps(
|
|
|
66
66
|
submitUrl: "https://jant.me/discover/submit",
|
|
67
67
|
declaredMode: "latest" as const,
|
|
68
68
|
publicPostCount: 5,
|
|
69
|
-
featuredPostCount: 2,
|
|
70
69
|
established: true,
|
|
71
70
|
minPublicPosts: 1,
|
|
72
71
|
firstReadMaxHours: 6,
|
|
@@ -228,7 +227,6 @@ describe("GeneralContent", () => {
|
|
|
228
227
|
discoverStatus: {
|
|
229
228
|
...createProps(false).discoverStatus,
|
|
230
229
|
publicPostCount: 0,
|
|
231
|
-
featuredPostCount: 0,
|
|
232
230
|
established: false,
|
|
233
231
|
},
|
|
234
232
|
}),
|
|
@@ -239,20 +237,6 @@ describe("GeneralContent", () => {
|
|
|
239
237
|
);
|
|
240
238
|
});
|
|
241
239
|
|
|
242
|
-
it("says a featured-only feed has nothing to carry", async () => {
|
|
243
|
-
const html = await renderGeneralContent(
|
|
244
|
-
createProps(false, {
|
|
245
|
-
discoverStatus: {
|
|
246
|
-
...createProps(false).discoverStatus,
|
|
247
|
-
declaredMode: "featured" as const,
|
|
248
|
-
featuredPostCount: 0,
|
|
249
|
-
},
|
|
250
|
-
}),
|
|
251
|
-
);
|
|
252
|
-
|
|
253
|
-
expect(html).toContain("no post is marked Featured");
|
|
254
|
-
});
|
|
255
|
-
|
|
256
240
|
it("offers the manual form only when the announcement failed", async () => {
|
|
257
241
|
const html = await renderGeneralContent(
|
|
258
242
|
createProps(false, {
|
|
@@ -265,7 +249,6 @@ describe("GeneralContent", () => {
|
|
|
265
249
|
submitUrl: "https://jant.me/discover/submit",
|
|
266
250
|
declaredMode: "latest",
|
|
267
251
|
publicPostCount: 5,
|
|
268
|
-
featuredPostCount: 2,
|
|
269
252
|
established: true,
|
|
270
253
|
minPublicPosts: 1,
|
|
271
254
|
firstReadMaxHours: 6,
|
|
@@ -295,7 +278,6 @@ describe("GeneralContent", () => {
|
|
|
295
278
|
submitUrl: "https://jant.me/discover/submit",
|
|
296
279
|
declaredMode: "latest",
|
|
297
280
|
publicPostCount: 5,
|
|
298
|
-
featuredPostCount: 2,
|
|
299
281
|
established: true,
|
|
300
282
|
minPublicPosts: 1,
|
|
301
283
|
firstReadMaxHours: 6,
|
|
@@ -323,7 +305,6 @@ describe("GeneralContent", () => {
|
|
|
323
305
|
submitUrl: "https://jant.me/discover/submit",
|
|
324
306
|
declaredMode: "none",
|
|
325
307
|
publicPostCount: 5,
|
|
326
|
-
featuredPostCount: 2,
|
|
327
308
|
established: true,
|
|
328
309
|
minPublicPosts: 1,
|
|
329
310
|
firstReadMaxHours: 6,
|
|
@@ -357,7 +338,6 @@ describe("GeneralContent", () => {
|
|
|
357
338
|
submitUrl: "https://jant.me/discover/submit",
|
|
358
339
|
declaredMode: "latest",
|
|
359
340
|
publicPostCount: 5,
|
|
360
|
-
featuredPostCount: 2,
|
|
361
341
|
established: true,
|
|
362
342
|
minPublicPosts: 1,
|
|
363
343
|
firstReadMaxHours: 6,
|
|
@@ -389,7 +369,6 @@ describe("GeneralContent", () => {
|
|
|
389
369
|
submitUrl: "https://jant.me/discover/submit",
|
|
390
370
|
declaredMode: "latest",
|
|
391
371
|
publicPostCount: 5,
|
|
392
|
-
featuredPostCount: 2,
|
|
393
372
|
established: true,
|
|
394
373
|
minPublicPosts: 1,
|
|
395
374
|
firstReadMaxHours: 6,
|
|
@@ -42,12 +42,17 @@ export const CuratedThreadPreview: FC<CuratedThreadPreviewProps> = ({
|
|
|
42
42
|
return (
|
|
43
43
|
<div class="thread-group thread-group-preview thread-group-curated">
|
|
44
44
|
{segments.map((segment, index) => [
|
|
45
|
-
|
|
45
|
+
// The gap opens the first post it hides — the rule in
|
|
46
|
+
// `lib/thread-fold.ts` — and appears on the same condition as
|
|
47
|
+
// `ThreadPreview`'s: something is hidden and that post is known. No
|
|
48
|
+
// other post stands in for it; one deleted between the two reads
|
|
49
|
+
// leaves the gap out for one render.
|
|
50
|
+
segment.hiddenBeforeCount > 0 && segment.gapHref ? (
|
|
46
51
|
<div
|
|
47
52
|
key={`gap-${segment.post.id}`}
|
|
48
53
|
class="thread-item thread-item-gap"
|
|
49
54
|
>
|
|
50
|
-
<a href={segment.
|
|
55
|
+
<a href={segment.gapHref} class="thread-gap-link">
|
|
51
56
|
{i18n._(
|
|
52
57
|
msg({
|
|
53
58
|
message:
|
package/src/ui/feed/LinkCard.tsx
CHANGED
|
@@ -134,8 +134,7 @@ export const LinkCard: FC<TimelineCardProps> = ({
|
|
|
134
134
|
|
|
135
135
|
return (
|
|
136
136
|
<article
|
|
137
|
-
class={articleClass}
|
|
138
|
-
{...(isDetail ? { "data-page": "post" } : {})}
|
|
137
|
+
class={`${articleClass}${isDetail ? " post-detail" : ""}`}
|
|
139
138
|
{...getPostArticleAttributes(post)}
|
|
140
139
|
>
|
|
141
140
|
{!isCompact && !display?.hideStatusBadges && (
|
package/src/ui/feed/NoteCard.tsx
CHANGED
|
@@ -86,8 +86,7 @@ export const NoteCard: FC<TimelineCardProps> = ({
|
|
|
86
86
|
|
|
87
87
|
return (
|
|
88
88
|
<article
|
|
89
|
-
class={`h-entry post-menu-target${isCompact ? " feed-compact" : isDetail ? " py-6" : ""}`}
|
|
90
|
-
{...(isDetail ? { "data-page": "post" } : {})}
|
|
89
|
+
class={`h-entry post-menu-target${isCompact ? " feed-compact" : isDetail ? " post-detail py-6" : ""}`}
|
|
91
90
|
{...getPostArticleAttributes(post)}
|
|
92
91
|
>
|
|
93
92
|
{!isCompact && !display?.hideStatusBadges && (
|
|
@@ -41,8 +41,7 @@ export const QuoteCard: FC<TimelineCardProps> = ({
|
|
|
41
41
|
|
|
42
42
|
return (
|
|
43
43
|
<article
|
|
44
|
-
class={articleClass}
|
|
45
|
-
{...(isDetail ? { "data-page": "post" } : {})}
|
|
44
|
+
class={`${articleClass}${isDetail ? " post-detail" : ""}`}
|
|
46
45
|
{...getPostArticleAttributes(post)}
|
|
47
46
|
>
|
|
48
47
|
{!isCompact && !display?.hideStatusBadges && (
|
|
@@ -58,6 +57,7 @@ export const QuoteCard: FC<TimelineCardProps> = ({
|
|
|
58
57
|
{post.quoteText && (
|
|
59
58
|
<blockquote
|
|
60
59
|
class={`feed-quote${isCompact ? "" : " feed-quote-card"}`}
|
|
60
|
+
data-post-quote
|
|
61
61
|
>
|
|
62
62
|
{!isCompact && <DecorativeQuoteMark class="feed-quote-mark" />}
|
|
63
63
|
<div
|
|
@@ -77,10 +77,6 @@ export const ThreadPreview: FC<ThreadPreviewProps> = ({
|
|
|
77
77
|
);
|
|
78
78
|
const renderedLeadingReplies = fold.leadingReplies;
|
|
79
79
|
const renderedTrailingReplies = fold.trailingReplies;
|
|
80
|
-
// The gap opens the first post it hides — the rule in `lib/thread-fold.ts`,
|
|
81
|
-
// which the feed follows too. The fallback only covers a gap target that
|
|
82
|
-
// went unpublished between the count and the fetch.
|
|
83
|
-
const gapLinkHref = gapHref ?? latestReply.permalink;
|
|
84
80
|
|
|
85
81
|
// Always render the collapsible shell + toggle: the cap and fade are a
|
|
86
82
|
// constant "this is context" affordance. The toggle's *initial* visibility
|
|
@@ -112,10 +108,14 @@ export const ThreadPreview: FC<ThreadPreviewProps> = ({
|
|
|
112
108
|
</div>
|
|
113
109
|
));
|
|
114
110
|
|
|
111
|
+
// The gap opens the first post it hides — the rule in `lib/thread-fold.ts`
|
|
112
|
+
// — and appears on the same condition as the feed's: something is hidden and
|
|
113
|
+
// that post is known. No other post stands in for it; a reply unpublished
|
|
114
|
+
// between the count and the fetch leaves the gap out for one render.
|
|
115
115
|
const gapItem =
|
|
116
|
-
hiddenCount > 0 ? (
|
|
116
|
+
hiddenCount > 0 && gapHref ? (
|
|
117
117
|
<div class="thread-item thread-item-gap">
|
|
118
|
-
<a href={
|
|
118
|
+
<a href={gapHref} class="thread-gap-link">
|
|
119
119
|
{hiddenPostsLabel}
|
|
120
120
|
</a>
|
|
121
121
|
</div>
|
|
@@ -25,13 +25,7 @@ export const TimelineFeedItemContent: FC<TimelineFeedItemContentProps> = ({
|
|
|
25
25
|
return item.curatedThread ? (
|
|
26
26
|
<CuratedThreadPreview curatedThread={item.curatedThread} />
|
|
27
27
|
) : item.threadPreview ? (
|
|
28
|
-
<ThreadPreview
|
|
29
|
-
rootPost={item.post}
|
|
30
|
-
leadingReplies={item.threadPreview.leadingReplies}
|
|
31
|
-
trailingReplies={item.threadPreview.trailingReplies}
|
|
32
|
-
latestReply={item.threadPreview.latestReply}
|
|
33
|
-
totalReplyCount={item.threadPreview.totalReplyCount}
|
|
34
|
-
/>
|
|
28
|
+
<ThreadPreview rootPost={item.post} {...item.threadPreview} />
|
|
35
29
|
) : (
|
|
36
30
|
<TimelineItem item={item} />
|
|
37
31
|
);
|
|
@@ -204,6 +204,7 @@ describe("thread preview fold", () => {
|
|
|
204
204
|
leadingReplies: [secondReply],
|
|
205
205
|
trailingReplies: [],
|
|
206
206
|
latestReply,
|
|
207
|
+
gapHref: null,
|
|
207
208
|
totalReplyCount: 3,
|
|
208
209
|
}),
|
|
209
210
|
);
|
|
@@ -248,6 +249,7 @@ describe("thread preview fold", () => {
|
|
|
248
249
|
bodyHtml: "<p>Latest</p>",
|
|
249
250
|
isLastInThread: true,
|
|
250
251
|
}),
|
|
252
|
+
gapHref: "/post-3",
|
|
251
253
|
totalReplyCount: 4,
|
|
252
254
|
}),
|
|
253
255
|
);
|
|
@@ -276,6 +278,7 @@ describe("thread preview fold", () => {
|
|
|
276
278
|
leadingReplies: [reply(2), reply(3)],
|
|
277
279
|
trailingReplies: [reply(6), reply(7)],
|
|
278
280
|
latestReply: reply(8),
|
|
281
|
+
gapHref: "/post-4",
|
|
279
282
|
totalReplyCount: 7,
|
|
280
283
|
}),
|
|
281
284
|
);
|
|
@@ -312,6 +315,7 @@ describe("thread preview fold", () => {
|
|
|
312
315
|
bodyHtml: "<p>Latest</p>",
|
|
313
316
|
isLastInThread: true,
|
|
314
317
|
}),
|
|
318
|
+
gapHref: null,
|
|
315
319
|
totalReplyCount: 1,
|
|
316
320
|
}),
|
|
317
321
|
);
|
|
@@ -342,6 +346,7 @@ describe("thread preview fold", () => {
|
|
|
342
346
|
bodyHtml: "<p>Latest</p>",
|
|
343
347
|
isLastInThread: true,
|
|
344
348
|
}),
|
|
349
|
+
gapHref: null,
|
|
345
350
|
totalReplyCount: 1,
|
|
346
351
|
}),
|
|
347
352
|
);
|
|
@@ -374,6 +379,7 @@ describe("thread preview fold", () => {
|
|
|
374
379
|
bodyHtml: "<p>Latest</p>",
|
|
375
380
|
isLastInThread: true,
|
|
376
381
|
}),
|
|
382
|
+
gapHref: null,
|
|
377
383
|
totalReplyCount: 2,
|
|
378
384
|
}),
|
|
379
385
|
);
|
|
@@ -428,8 +434,9 @@ describe("thread preview fold", () => {
|
|
|
428
434
|
|
|
429
435
|
// The gap target comes from the service, one rank past the leading window.
|
|
430
436
|
// It can be missing where the count and the fetch disagree — a reply
|
|
431
|
-
// unpublished between them
|
|
432
|
-
|
|
437
|
+
// unpublished between them. The feed then leaves the gap out, and so does
|
|
438
|
+
// the site: no post on screen stands in for the ones hidden.
|
|
439
|
+
it("leaves the gap out when no gap target arrives", () => {
|
|
433
440
|
const html = renderWithI18n(() =>
|
|
434
441
|
ThreadPreview({
|
|
435
442
|
rootPost: createPostView({ bodyHtml: "<p>Root</p>" }),
|
|
@@ -449,13 +456,13 @@ describe("thread preview fold", () => {
|
|
|
449
456
|
bodyHtml: "<p>Latest</p>",
|
|
450
457
|
isLastInThread: true,
|
|
451
458
|
}),
|
|
459
|
+
gapHref: null,
|
|
452
460
|
totalReplyCount: 3,
|
|
453
461
|
}),
|
|
454
462
|
);
|
|
455
463
|
|
|
456
|
-
expect(html).
|
|
457
|
-
|
|
458
|
-
);
|
|
464
|
+
expect(html).toContain("<p>Penultimate</p>");
|
|
465
|
+
expect(html).not.toContain("thread-item-gap");
|
|
459
466
|
});
|
|
460
467
|
|
|
461
468
|
it("renders curated thread previews without a collapsible context shell", () => {
|
|
@@ -467,7 +474,9 @@ describe("thread preview fold", () => {
|
|
|
467
474
|
curatedThread: {
|
|
468
475
|
rootPost: post,
|
|
469
476
|
showContextRatings: false,
|
|
470
|
-
segments: [
|
|
477
|
+
segments: [
|
|
478
|
+
{ post, hiddenBeforeCount: 0, gapHref: null, highlighted: true },
|
|
479
|
+
],
|
|
471
480
|
},
|
|
472
481
|
}),
|
|
473
482
|
);
|
|
@@ -489,6 +498,7 @@ describe("thread preview fold", () => {
|
|
|
489
498
|
{
|
|
490
499
|
post: articlePost,
|
|
491
500
|
hiddenBeforeCount: 0,
|
|
501
|
+
gapHref: null,
|
|
492
502
|
highlighted: true,
|
|
493
503
|
},
|
|
494
504
|
],
|
|
@@ -528,8 +538,18 @@ describe("thread preview fold", () => {
|
|
|
528
538
|
rootPost: root,
|
|
529
539
|
showContextRatings: true,
|
|
530
540
|
segments: [
|
|
531
|
-
{
|
|
532
|
-
|
|
541
|
+
{
|
|
542
|
+
post: root,
|
|
543
|
+
hiddenBeforeCount: 0,
|
|
544
|
+
gapHref: null,
|
|
545
|
+
highlighted: false,
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
post: reply,
|
|
549
|
+
hiddenBeforeCount: 0,
|
|
550
|
+
gapHref: null,
|
|
551
|
+
highlighted: true,
|
|
552
|
+
},
|
|
533
553
|
],
|
|
534
554
|
},
|
|
535
555
|
}),
|
|
@@ -561,8 +581,18 @@ describe("thread preview fold", () => {
|
|
|
561
581
|
rootPost: featured,
|
|
562
582
|
showContextRatings: false,
|
|
563
583
|
segments: [
|
|
564
|
-
{
|
|
565
|
-
|
|
584
|
+
{
|
|
585
|
+
post: featured,
|
|
586
|
+
hiddenBeforeCount: 0,
|
|
587
|
+
gapHref: null,
|
|
588
|
+
highlighted: true,
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
post: context,
|
|
592
|
+
hiddenBeforeCount: 0,
|
|
593
|
+
gapHref: null,
|
|
594
|
+
highlighted: false,
|
|
595
|
+
},
|
|
566
596
|
],
|
|
567
597
|
},
|
|
568
598
|
}),
|
|
@@ -572,6 +602,89 @@ describe("thread preview fold", () => {
|
|
|
572
602
|
expect(html).toContain("thread-item-curated");
|
|
573
603
|
expect(html).toContain("thread-item-context");
|
|
574
604
|
});
|
|
605
|
+
|
|
606
|
+
it("points a curated gap at the first post it hides", () => {
|
|
607
|
+
const root = createPostView({
|
|
608
|
+
id: "post-root",
|
|
609
|
+
slug: "post-root",
|
|
610
|
+
permalink: "/post-root",
|
|
611
|
+
});
|
|
612
|
+
const featured = createPostView({
|
|
613
|
+
id: "post-4",
|
|
614
|
+
slug: "post-4",
|
|
615
|
+
permalink: "/post-4",
|
|
616
|
+
isLastInThread: true,
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
const html = renderWithI18n(() =>
|
|
620
|
+
CuratedThreadPreview({
|
|
621
|
+
curatedThread: {
|
|
622
|
+
rootPost: root,
|
|
623
|
+
showContextRatings: false,
|
|
624
|
+
segments: [
|
|
625
|
+
{
|
|
626
|
+
post: root,
|
|
627
|
+
hiddenBeforeCount: 0,
|
|
628
|
+
gapHref: null,
|
|
629
|
+
highlighted: false,
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
post: featured,
|
|
633
|
+
hiddenBeforeCount: 3,
|
|
634
|
+
gapHref: "/post-1",
|
|
635
|
+
highlighted: true,
|
|
636
|
+
},
|
|
637
|
+
],
|
|
638
|
+
},
|
|
639
|
+
}),
|
|
640
|
+
);
|
|
641
|
+
|
|
642
|
+
expect(html).toContain(
|
|
643
|
+
'<a href="/post-1" class="thread-gap-link">3 hidden posts</a>',
|
|
644
|
+
);
|
|
645
|
+
});
|
|
646
|
+
|
|
647
|
+
// The target is read beside the posts shown, so it can go missing — a post
|
|
648
|
+
// deleted between the two reads. No other post stands in for it.
|
|
649
|
+
it("leaves a curated gap out when no target arrives", () => {
|
|
650
|
+
const root = createPostView({
|
|
651
|
+
id: "post-root",
|
|
652
|
+
slug: "post-root",
|
|
653
|
+
permalink: "/post-root",
|
|
654
|
+
});
|
|
655
|
+
const featured = createPostView({
|
|
656
|
+
id: "post-4",
|
|
657
|
+
slug: "post-4",
|
|
658
|
+
permalink: "/post-4",
|
|
659
|
+
isLastInThread: true,
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
const html = renderWithI18n(() =>
|
|
663
|
+
CuratedThreadPreview({
|
|
664
|
+
curatedThread: {
|
|
665
|
+
rootPost: root,
|
|
666
|
+
showContextRatings: false,
|
|
667
|
+
segments: [
|
|
668
|
+
{
|
|
669
|
+
post: root,
|
|
670
|
+
hiddenBeforeCount: 0,
|
|
671
|
+
gapHref: null,
|
|
672
|
+
highlighted: false,
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
post: featured,
|
|
676
|
+
hiddenBeforeCount: 1,
|
|
677
|
+
gapHref: null,
|
|
678
|
+
highlighted: true,
|
|
679
|
+
},
|
|
680
|
+
],
|
|
681
|
+
},
|
|
682
|
+
}),
|
|
683
|
+
);
|
|
684
|
+
|
|
685
|
+
expect(html).not.toContain("thread-gap-link");
|
|
686
|
+
expect(html).toContain("thread-item-curated");
|
|
687
|
+
});
|
|
575
688
|
});
|
|
576
689
|
|
|
577
690
|
describe("threadContextAssumesOverflow", () => {
|
|
@@ -588,7 +588,7 @@ describe("timeline cards", () => {
|
|
|
588
588
|
);
|
|
589
589
|
|
|
590
590
|
expect(presetCss).toContain(
|
|
591
|
-
|
|
591
|
+
"[data-post]:not(.post-detail) [data-post-body].prose",
|
|
592
592
|
);
|
|
593
593
|
expect(presetCss).toMatch(
|
|
594
594
|
/:where\(h1,\s*h2\)\s*\{[\s\S]*font-size:\s*calc\(var\(--type-content-body\) \* 1\.12\);/,
|
|
@@ -1029,4 +1029,21 @@ describe("timeline cards", () => {
|
|
|
1029
1029
|
expect(pinned).not.toContain("post-status-private");
|
|
1030
1030
|
expect(pinned).not.toContain("post-status-draft");
|
|
1031
1031
|
});
|
|
1032
|
+
|
|
1033
|
+
// The theme hooks mark each part once: a rule on [data-post-media] used to
|
|
1034
|
+
// match both the card's wrapper and the gallery row inside it.
|
|
1035
|
+
it("marks a post's media once and a quote's quoted text", () => {
|
|
1036
|
+
for (const card of [
|
|
1037
|
+
NoteCard({ post: createPostView({ format: "note" }), mode: "feed" }),
|
|
1038
|
+
LinkCard({ post: createPostView({ format: "link" }), mode: "detail" }),
|
|
1039
|
+
QuoteCard({ post: createPostView({ format: "quote" }), mode: "feed" }),
|
|
1040
|
+
]) {
|
|
1041
|
+
const html = renderWithI18n(card);
|
|
1042
|
+
expect(html.match(/data-post-media/g)).toHaveLength(1);
|
|
1043
|
+
}
|
|
1044
|
+
const quoteHtml = renderWithI18n(
|
|
1045
|
+
QuoteCard({ post: createPostView({ format: "quote" }), mode: "feed" }),
|
|
1046
|
+
);
|
|
1047
|
+
expect(quoteHtml).toMatch(/<blockquote[^>]*data-post-quote/);
|
|
1048
|
+
});
|
|
1032
1049
|
});
|
|
@@ -12,6 +12,7 @@ import type { FC, PropsWithChildren } from "hono/jsx";
|
|
|
12
12
|
import type { Context } from "hono";
|
|
13
13
|
import { raw } from "hono/utils/html";
|
|
14
14
|
import { escapeHtml } from "../../lib/html.js";
|
|
15
|
+
import type { PageName } from "../../types/constants.js";
|
|
15
16
|
import { msg } from "@lingui/core/macro";
|
|
16
17
|
import {
|
|
17
18
|
getPreconnectHints,
|
|
@@ -65,6 +66,8 @@ export interface PageFeedLink {
|
|
|
65
66
|
|
|
66
67
|
export interface BaseLayoutProps {
|
|
67
68
|
title: string;
|
|
69
|
+
/** Written to `<body data-page>`; left off pages outside the public set. */
|
|
70
|
+
page?: PageName;
|
|
68
71
|
description?: string;
|
|
69
72
|
lang?: string;
|
|
70
73
|
c?: Context;
|
|
@@ -133,6 +136,7 @@ export interface BaseLayoutProps {
|
|
|
133
136
|
|
|
134
137
|
export const BaseLayout: FC<PropsWithChildren<BaseLayoutProps>> = ({
|
|
135
138
|
title,
|
|
139
|
+
page,
|
|
136
140
|
description,
|
|
137
141
|
lang,
|
|
138
142
|
c,
|
|
@@ -601,6 +605,7 @@ export const BaseLayout: FC<PropsWithChildren<BaseLayoutProps>> = ({
|
|
|
601
605
|
</head>
|
|
602
606
|
<body
|
|
603
607
|
class="bg-background text-foreground antialiased"
|
|
608
|
+
{...(page ? { "data-page": page } : {})}
|
|
604
609
|
{...(isAuthenticated ? { "data-authenticated": true } : {})}
|
|
605
610
|
>
|
|
606
611
|
{content}
|
|
@@ -1368,7 +1368,7 @@ export const ArchivePage: FC<ArchivePageProps> = ({
|
|
|
1368
1368
|
const countSummary = `${totalCount} ${countRemainder}`;
|
|
1369
1369
|
|
|
1370
1370
|
return (
|
|
1371
|
-
<div class="py-6"
|
|
1371
|
+
<div class="py-6">
|
|
1372
1372
|
<header class="archive-page-header page-intro">
|
|
1373
1373
|
<div class="page-intro-title-row">
|
|
1374
1374
|
<h1 class="page-intro-title">{i18n._(ARCHIVE_ALL_POSTS_LABEL)}</h1>
|
|
@@ -169,7 +169,6 @@ export const CollectionPage: FC<CollectionPageProps> = ({
|
|
|
169
169
|
return (
|
|
170
170
|
<div
|
|
171
171
|
class="py-6"
|
|
172
|
-
data-page="collection"
|
|
173
172
|
data-collection-mode={isAggregate ? "aggregate" : "single"}
|
|
174
173
|
data-collection-id={isAggregate ? undefined : primaryCollection.id}
|
|
175
174
|
data-collection-slugs={collections
|
|
@@ -30,7 +30,7 @@ export const CollectionsPage: FC<CollectionsPageProps> = ({
|
|
|
30
30
|
|
|
31
31
|
if (isAuthenticated) {
|
|
32
32
|
return (
|
|
33
|
-
<div class="py-6"
|
|
33
|
+
<div class="py-6">
|
|
34
34
|
<CollectionsManager
|
|
35
35
|
items={items}
|
|
36
36
|
navigationCollectionIds={navigationCollectionIds}
|
|
@@ -43,7 +43,7 @@ export const CollectionsPage: FC<CollectionsPageProps> = ({
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
return (
|
|
46
|
-
<div class="py-6"
|
|
46
|
+
<div class="py-6">
|
|
47
47
|
<div class="collections-page-shell">
|
|
48
48
|
<header class="collections-page-header">
|
|
49
49
|
<div class="collections-page-heading page-intro">
|
|
@@ -32,7 +32,7 @@ export const ComposePage: FC<ComposePageProps> = ({
|
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<section class="compose-page"
|
|
35
|
+
<section class="compose-page">
|
|
36
36
|
<div class="compose-page-shell">
|
|
37
37
|
<div class="compose-page-intro">
|
|
38
38
|
<div class="compose-page-intro-row">
|
|
@@ -73,7 +73,7 @@ const ThreadDetail: FC<{
|
|
|
73
73
|
currentIndex >= 0 ? threadPosts.slice(currentIndex) : threadPosts;
|
|
74
74
|
|
|
75
75
|
return (
|
|
76
|
-
<div class="thread-group thread-group-detail"
|
|
76
|
+
<div class="thread-group thread-group-detail">
|
|
77
77
|
{ancestors.length > 0 && (
|
|
78
78
|
<>
|
|
79
79
|
<div
|
|
@@ -106,9 +106,8 @@ export const SmartCollectionPage: FC<SmartCollectionPageProps> = ({
|
|
|
106
106
|
return (
|
|
107
107
|
<div
|
|
108
108
|
class="py-6"
|
|
109
|
-
//
|
|
110
|
-
// hook for anything that needs to tell the two apart.
|
|
111
|
-
data-page="collection"
|
|
109
|
+
// `data-page` on <body> says "collection", as for any collection; this
|
|
110
|
+
// is the hook for anything that needs to tell the two apart.
|
|
112
111
|
data-smart-collection={smartCollection.slug}
|
|
113
112
|
data-collection-mode="smart"
|
|
114
113
|
>
|
|
@@ -717,7 +717,7 @@ export function ThemeSamplePage({
|
|
|
717
717
|
};
|
|
718
718
|
|
|
719
719
|
return (
|
|
720
|
-
<div class="theme-sample-page py-6"
|
|
720
|
+
<div class="theme-sample-page py-6">
|
|
721
721
|
<header class="theme-sample-header mb-8 flex flex-col gap-4">
|
|
722
722
|
<div class="flex flex-col gap-2">
|
|
723
723
|
<p class="text-sm uppercase tracking-[0.18em] text-muted-foreground">
|
|
@@ -348,7 +348,7 @@ export const MediaGallery: FC<MediaGalleryProps> = ({
|
|
|
348
348
|
{hasGalleryItems && (
|
|
349
349
|
<div class={`mt-3 ${singleVisual ? "" : "media-gallery-scroll-wrap"}`}>
|
|
350
350
|
<div
|
|
351
|
-
data-
|
|
351
|
+
data-media-gallery
|
|
352
352
|
data-lightbox-group={
|
|
353
353
|
lightboxItems.length > 0
|
|
354
354
|
? JSON.stringify(lightboxItems)
|