wiki-formant 0.115.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.
Files changed (2) hide show
  1. package/dist/store.js +4 -2
  2. package/package.json +1 -1
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.115.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",