wiki-formant 0.114.0 → 0.116.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/dist/base.css CHANGED
@@ -272,6 +272,17 @@ tbody > tr:nth-child(even) > :is(th, td):not(.chart *) { background-image: linea
272
272
 
273
273
  .page-refs { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; overflow: hidden; background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-radius); }
274
274
  .page-refs > li + li { border-top: 1px solid var(--ui-border); }
275
+ /* A row of the list: the page's name against the age of its last change, the
276
+ whole row the link. The box was drawn here and the row left to each wiki, so
277
+ three of them restated the same flex line and a fourth, styling none, ran a
278
+ name into its date. A long name is cut rather than push the date off a
279
+ phone's width, and the date keeps its width, or it wraps to a word a line. */
280
+ .page-ref { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; padding: 0.625rem var(--ui-pad); color: inherit; text-decoration: none; transition: background-color 150ms; }
281
+ .page-ref:hover { background: var(--ui-surface-2); }
282
+ .page-ref-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 150ms; }
283
+ .page-ref:hover .page-ref-title { color: var(--ui-accent); }
284
+ .page-ref-time { flex-shrink: 0; font-size: var(--ui-small); color: var(--ui-muted); }
285
+ .page-refs-empty { color: var(--ui-muted); }
275
286
 
276
287
  .see-also-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
277
288
  .see-also-item { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; padding: 0.75rem; background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-radius); color: inherit; text-decoration: none; transition: border-color 150ms; }
package/dist/store.js CHANGED
@@ -61,8 +61,10 @@ export function wikiStore(o) {
61
61
  /** A page with how many revisions it has, which every article's foot states. */
62
62
  const get = (tagPath, slug) => one(`SELECT ${COLUMNS}, ${REVISION_COUNT} FROM ${PAGE} p WHERE "siteId" = $1 AND "tagPath" = $2 AND slug = $3`, site, tagPath, slug);
63
63
  const getById = (id) => one(`SELECT ${COLUMNS}, ${REVISION_COUNT} FROM ${PAGE} p WHERE "siteId" = $1 AND id = $2`, site, id);
64
+ // A title in natural order: every run of digits is padded to ten, so guide 10 follows guide 9 rather than guide 1.
65
+ const BY_TITLE = `regexp_replace(regexp_replace(title, '([0-9]+)', '0000000000\\1', 'g'), '0*([0-9]{10})', '\\1', 'g'), title`;
64
66
  const ORDER = {
65
- title: 'title ASC',
67
+ title: BY_TITLE,
66
68
  recent: '"updatedAt" DESC',
67
69
  // A post or an event is as recent as the day it is about.
68
70
  date: `NULLIF(metadata->>'date', '') DESC NULLS LAST, "updatedAt" DESC`,
@@ -74,7 +76,7 @@ export function wikiStore(o) {
74
76
  /** Every page under a category, by title: the card that lists a subcategory's articles. */
75
77
  const subtree = (tagPath) => rows(`SELECT "tagPath", slug, title FROM ${PAGE} p
76
78
  WHERE "siteId" = $1 AND "tagPath" LIKE $2 AND slug <> '' AND NOT ${hiddenSql('$3')}
77
- ORDER BY title ASC`, site, `${escapeLikeTerm(tagPath)}/%`, hidden);
79
+ ORDER BY ${BY_TITLE}`, site, `${escapeLikeTerm(tagPath)}/%`, hidden);
78
80
  /**
79
81
  * The newest pages. One that names a path gets that path, hidden or not; one
80
82
  * that names none is asking what changed on the wiki, and the answer is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wiki-formant",
3
- "version": "0.114.0",
3
+ "version": "0.116.0",
4
4
  "description": "The portable half of a wiki: derived taxonomy and facet controls, a version-negotiating MCP transport, markdown twins, block rendering, a rich-text editor engine, conditional-GET plumbing, and the headers and CSP every origin sends.",
5
5
  "type": "module",
6
6
  "license": "MIT",