wiki-formant 0.64.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.
- package/README.md +1 -1
- package/dist/analytics.d.ts +3 -0
- package/dist/analytics.js +3 -0
- package/dist/base.css +24 -2
- package/dist/stats-figures.d.ts +1 -2
- package/dist/stats-figures.js +1 -1
- package/dist/stats.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1028,7 +1028,7 @@ the site's stylesheet gives them and the box a look.
|
|
|
1028
1028
|
|
|
1029
1029
|
## Base stylesheet
|
|
1030
1030
|
|
|
1031
|
-
`wiki-formant/base.css` is the layout the package's markup does not work without, and nothing else: columns that stack until there is room, stored tab panels that show one at a time, a copy button pinned to its block's corner and visible on focus and on touch, a table's scroll box, the stats block's grid, the code-tab strip, the banner's row and the infobox's wrapping, the breadcrumb row, the `aria-sort` arrow as a mask over `currentColor`, the stats page's grid and bars, and the chart's height and pinned buttons. It also carries the shape and motion of the primitives every site re-implemented and forked — `.spinner` (a `currentColor` ring sized by `--spinner-size`), `.skeleton`'s pulse, `.empty-state`, the wrap rule for long tokens in inline `code` — and the reduced-motion guard none of them had. No colour and no scale, so a design system's own rules override it at equal specificity.
|
|
1031
|
+
`wiki-formant/base.css` is the layout the package's markup does not work without, and nothing else: columns that stack until there is room, stored tab panels that show one at a time, a copy button pinned to its block's corner and visible on focus and on touch, a table's scroll box, the stats block's grid, the code-tab strip, the banner's row and the infobox's wrapping, the breadcrumb row, the `aria-sort` arrow as a mask over `currentColor`, the stats page's grid and bars, and the chart's height and pinned buttons. It also carries the shape and motion of the primitives every site re-implemented and forked — `.spinner` (a `currentColor` ring sized by `--spinner-size`), `.skeleton`'s pulse, `.empty-state`, the wrap rule for long tokens in inline `code` — and the reduced-motion guard none of them had. No colour and no scale, so a design system's own rules override it at equal specificity. The one set of tokens it declares is the page frame every site lays out by: `--content-width` (72rem, gutters inside), `--sidebar-width` (18rem) and `--page-pad` (16 / 24 / 32px at base / 640 / 1024). They sit in the components layer, so a site never restates them in `@theme`, which would lose; an element that must differ sets its own.
|
|
1032
1032
|
|
|
1033
1033
|
```css
|
|
1034
1034
|
@import "wiki-formant/base.css" layer(components);
|
package/dist/analytics.d.ts
CHANGED
|
@@ -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.
|
package/dist/base.css
CHANGED
|
@@ -11,6 +11,25 @@
|
|
|
11
11
|
panel showed at once; one never received the utility classes ColumnsView
|
|
12
12
|
used to emit, so two of its four alignments did nothing. */
|
|
13
13
|
|
|
14
|
+
/* ---- the page frame ---------------------------------------------------------
|
|
15
|
+
The three numbers every site's page is laid out by, and the one exception to
|
|
16
|
+
"no design token": they are the frame, not a look, and four sites restating
|
|
17
|
+
them is how one of them came to draw an 80rem page while the rest drew 72.
|
|
18
|
+
The column is 72rem with its gutters inside it, the rail 18rem, and the
|
|
19
|
+
gutter 16 / 24 / 32px at base / 640 / 1024, the header, column and footer
|
|
20
|
+
reading the same one so they line up. STRUCTURE.md D8 is the spec.
|
|
21
|
+
|
|
22
|
+
This file loads into the components layer, which outranks Tailwind's theme
|
|
23
|
+
layer: a site does not restate these in `@theme`, and one that must differ
|
|
24
|
+
sets the property on the element that differs. */
|
|
25
|
+
:root {
|
|
26
|
+
--content-width: 72rem;
|
|
27
|
+
--sidebar-width: 18rem;
|
|
28
|
+
--page-pad: 1rem;
|
|
29
|
+
}
|
|
30
|
+
@media (min-width: 40rem) { :root { --page-pad: 1.5rem; } }
|
|
31
|
+
@media (min-width: 64rem) { :root { --page-pad: 2rem; } }
|
|
32
|
+
|
|
14
33
|
/* ---- ColumnsView ----------------------------------------------------------
|
|
15
34
|
Stacked until there is room for a row. `data-gap` and `data-align` replace
|
|
16
35
|
the Tailwind utilities the view used to emit, which only reached a site whose
|
|
@@ -93,7 +112,7 @@
|
|
|
93
112
|
position: sticky;
|
|
94
113
|
top: var(--rail-top, 0px);
|
|
95
114
|
flex-shrink: 0;
|
|
96
|
-
width: var(--sidebar-width
|
|
115
|
+
width: var(--sidebar-width);
|
|
97
116
|
height: calc(100dvh - var(--rail-top, 0px));
|
|
98
117
|
overflow: hidden;
|
|
99
118
|
border-inline-end: var(--rail-border, none);
|
|
@@ -109,7 +128,7 @@ html[data-sidebar='closed'] .wiki-sidebar { width: 0; }
|
|
|
109
128
|
.wiki-sidebar__scroll {
|
|
110
129
|
display: flex;
|
|
111
130
|
flex-direction: column;
|
|
112
|
-
width: var(--sidebar-width
|
|
131
|
+
width: var(--sidebar-width);
|
|
113
132
|
height: 100%;
|
|
114
133
|
overflow-y: auto;
|
|
115
134
|
}
|
|
@@ -148,6 +167,9 @@ html[data-sidebar='closed'] .wiki-sidebar { width: 0; }
|
|
|
148
167
|
.code-tabs-btn { cursor: pointer; }
|
|
149
168
|
.editorial-banner { display: flex; }
|
|
150
169
|
.infobox { overflow-wrap: anywhere; }
|
|
170
|
+
/* A link grid's description is prose, so it stops at the site's measure: it
|
|
171
|
+
sits outside the article's prose box, and on radix.wiki ran 709px. */
|
|
172
|
+
.link-grid-group-description { max-width: var(--measure); }
|
|
151
173
|
.infobox-series { display: flex; flex-direction: column; }
|
|
152
174
|
.heading-anchor,
|
|
153
175
|
.ref-backlink,
|
package/dist/stats-figures.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type
|
|
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
|
package/dist/stats-figures.js
CHANGED
|
@@ -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
|
|
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.
|
|
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",
|