wiki-formant 0.65.0 → 0.65.1

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.
@@ -57,6 +57,9 @@ export declare const SEARCH_GAPS: Gap;
57
57
  /** What a stats page can be narrowed to: one value each, every one applied. */
58
58
  export declare const STATS_FILTERS: readonly ["page", "entry", "source", "country", "device"];
59
59
  export type StatsFilter = Partial<Record<(typeof STATS_FILTERS)[number], string>>;
60
+ /** A count as a stats page prints it. Here, not in the `'use client'` figures, because
61
+ * `Stats` calls it on the server, where a client module's export is only a reference. */
62
+ export declare const count: (n: number) => string;
60
63
  export interface DigestOptions {
61
64
  site?: string;
62
65
  /** How far back, in whole days from now; `Infinity` for all time. */
package/dist/analytics.js CHANGED
@@ -149,6 +149,9 @@ export async function collect(request, { sql, defer, site, rateLimit: limit = BE
149
149
  export const SEARCH_GAPS = { event: 'Search Query', prop: 'q', where: { results: '0', surface: 'wiki' } };
150
150
  /** What a stats page can be narrowed to: one value each, every one applied. */
151
151
  export const STATS_FILTERS = ['page', 'entry', 'source', 'country', 'device'];
152
+ /** A count as a stats page prints it. Here, not in the `'use client'` figures, because
153
+ * `Stats` calls it on the server, where a client module's export is only a reference. */
154
+ export const count = (n) => n.toLocaleString('en');
152
155
  /**
153
156
  * Each filter as a test on one visit. A page, country or device is any of the
154
157
  * visit's views; an entry page or a source is its first. `(none)` is no source.
@@ -1,6 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
- import type { Digest } from './analytics.js';
3
- export declare const count: (n: number) => string;
2
+ import { type Digest } from './analytics.js';
4
3
  /**
5
4
  * The figures as `.stats-figures button[aria-pressed]`, each with its change
6
5
  * as `.stats-delta[data-better]` for a stylesheet to colour, and the pressed one per
@@ -7,8 +7,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
7
7
  // component and hands it the digest, which is plain JSON.
8
8
  import { startAuthentication, startRegistration } from '@simplewebauthn/browser';
9
9
  import { useMemo, useState } from 'react';
10
+ import { count } from './analytics.js';
10
11
  import { TimeChart, stepDecimals } from './chart.js';
11
- export const count = (n) => n.toLocaleString('en');
12
12
  // Whole seconds and percentages, unless an axis tick's step needs more to tell it from the next.
13
13
  const places = (step) => (step ? stepDecimals(step) : 0);
14
14
  const duration = (s, step) => (s < 60 ? `${s.toFixed(places(step))}s` : `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`);
package/dist/stats.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { STATS_FILTERS } from './analytics.js';
3
- import { PasskeyButton, PasskeySignOut, StatsFigures, count } from './stats-figures.js';
2
+ import { STATS_FILTERS, count } from './analytics.js';
3
+ import { PasskeyButton, PasskeySignOut, StatsFigures } from './stats-figures.js';
4
4
  /** The windows the stats page offers, in days; `Infinity` is all time. */
5
5
  const STATS_RANGES = [1, 7, 30, 90, 365, Infinity];
6
6
  /** A window as its `?days=` value. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wiki-formant",
3
- "version": "0.65.0",
3
+ "version": "0.65.1",
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",