domma-cms 1.47.2 → 1.47.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.47.3] - 2026-11-08
4
+
5
+ - **Security: `{{field}}` in a block template escapes `'` as well**, so a value printed inside a single-quoted attribute cannot end it (`escapeHtmlText()` in markdown.js escaped `"` only).
6
+
3
7
  ## [1.47.2] - 2026-11-08
4
8
 
5
9
  - **Security: a shortcode parameter can no longer close the attribute it is written into.** `[card class=…]` (and `[box]`, which builds on it) was pushed into `class="…"` unescaped, and `[animate]`, `[ambient]`, `[grid]`/`[col]` and the hero's blobs built class names from parameters as written (`animate-${type}`, `gap-${gap}`, `grid-cols-${cols}`, `col-span-${span}`). A quote in one added attributes of its own - a `data-config` that site.js acts on, for one. The class is now escaped and class-building parameters keep to letters, digits, `_` and `-` (`classToken()` in markdown.js).
@@ -30,6 +30,8 @@ Code was treated as the truth. Where docs disagree with it, the disagreement is
30
30
  | Plugin | Tier | Version | In one line |
31
31
  |---|---|---|---|
32
32
  | `advent-calendar` | paid (giftable) | 1.0.0 | A calendar of 1 to 31 doors, one opening each day: an advent calendar or a countdown to a launch or event. Behind each door a message, picture, link and a code (shared, unique from a list, or a single-use Shop code), never sent before its day; codes limited per visitor and per connection. |
33
+ | `ai-site-builder` | paid (hosted sites only, in the Pro plan) | 0.6.2 | Site Builder - "Dot": build and change a site by asking in plain words, with the site's own pages, blocks, menus, forms, collections and theme; every change a draft to preview, publish or undo. Never on self-hosted sites. |
34
+ | `ai-tool-builder` | paid (hosted sites only, £59 a month) | 0.1.4 | Tool Builder - "Daisy": describe a Tool and it is written, checked on a test copy of a site, shown as a picture, then reviewed by a person at Domma before it reaches the site. Never a copy of a Tool Domma has. Never on self-hosted sites. |
33
35
  | `anagram` | paid (giftable) | 1.0.0 | Word puzzles against the clock: unscramble the letters (any other real word of the same letters counts too) or climb a word ladder one letter at a time. Random rounds each go, or a daily set everyone shares. Skip and hints for a time penalty, leaderboards, personal best, Share, export and import. |
34
36
  | `analytics-pro` | paid | 2.3.4 | Visitors, visits and page views: where visitors came from (sources, campaigns, channels, country and city by GeoIP), IP addresses, each visit's pages in order, devices and browsers, busiest times and a live view. Cookieless. Several display styles, CSV/JSON export and a printable report. |
35
37
  | `backup-pro` | paid | 0.1.4 | A site's own view of the backups Domma keeps of it: how they stand, every backup, Back up now, restore of the whole site or chosen collections, pages or media after a safety backup, downloads without secrets, and Activity - every backup, restore and change, including Domma's own, named and never hidden. Needs a site run by Domma. |
@@ -1724,6 +1726,37 @@ From `dcms-marketplace/docs/security-plan.md` (2026-09-26; all phases built and
1724
1726
 
1725
1727
  ## Marketplace Plugins
1726
1728
 
1729
+ ### Site Builder (`ai-site-builder`) - "Dot"
1730
+
1731
+ Tier: paid (closed source), **hosted sites only** (`hostedOnly: true`; a self-hosted site refuses to install or load it) · Included in the **Pro** plan, not sold alone · Version: 0.6.2 · Permission: `ai-builder`
1732
+
1733
+ The AI in Site Builder is called **Dot** ("Dot, your Site Builder"). A site owner asks for changes in plain words and Dot makes them with the site's own content types. Dot says plainly that it is AI, never claims to be a person, and only works on the website: general questions, emails and other writing are politely turned down, and nothing in the conversation can change those rules.
1734
+
1735
+ **Features**
1736
+ - Plain-word requests: new pages, rewrites, a warmer look, menu changes, forms, collections, blocks, blog posts and products (where the site has them). One short question when something that matters is unclear.
1737
+ - Drafts first: every change waits under **Changes** to preview, publish or undo; Dot never claims something is live.
1738
+ - Build a whole site: a few questions (business, audience, feel) and a plan shown before anything is built.
1739
+ - Conversations with their own changes, saved prompts, site memory and references; a monthly allowance of words (25,000 on Pro), shown on the screen.
1740
+ - Missing Tools: Dot says which Tool would do it rather than faking it with pages, and points to Tool Builder for Tools Domma does not have.
1741
+ - Works through the person's own permissions: what they may not edit, Dot may not edit for them.
1742
+
1743
+ **Where:** Admin sidebar **Site Builder** (`#/plugins/ai-site-builder`); the model runs on the Manager (`site-manager/services/aiBuilder.js`, system prompt in `aiBuilderTools.js`). Guide: Documentation > Tools > Site Builder; manual chapter `/spaces/domma-cms-user-manual/site-builder`; tutorial `/tutorials/build-a-page-by-asking-dot`.
1744
+
1745
+ ### Tool Builder (`ai-tool-builder`) - "Daisy"
1746
+
1747
+ Tier: paid (closed source), **hosted sites only** (`hostedOnly: true`) · **£59 a month**, a separate Tool (not in a plan) · Version: 0.1.4 · Permission: `tool-builder`
1748
+
1749
+ The AI in Tool Builder is called **Daisy** ("Daisy, your Tool Builder"). A site owner describes a Tool and Daisy writes it as a walled-off plugin (`tb-<site>-<name>`), checks it and sends it to Domma for review. Daisy says plainly that it is AI, only builds Tools, and never builds a Tool Domma already has: it names the Tool that does the job instead.
1750
+
1751
+ **Features**
1752
+ - New Tool: a name and a description in plain words; one short question when something that matters is unclear. Two new Tools a month; changes to a site's Tools are included.
1753
+ - Checks on every change: code rules, a real boot of a test copy of a site, its screen opened in a browser and its tests run; a picture of how it looks.
1754
+ - Review by a person at Domma (by the next working day) before release; approved versions are kept and an earlier one can be put back.
1755
+ - Never a copy: a name matching a Tool Domma has (or one the site already built) is refused before any build is counted, with the reason in the New Tool form ("Domma already has Invoices…", 0.1.4); the model is given the list of every Tool Domma has, rescanned every 10 minutes.
1756
+ - Ownership: the idea and the Tool's data are the client's; Domma writes, holds and licenses the code.
1757
+
1758
+ **Where:** Admin sidebar **Tool Builder** (`#/plugins/ai-tool-builder`); the build loop, checks and release run on the Manager (`tools/ai-tool-builder/`, `site-manager/services/toolBuilder.js`); staff review at Site Manager > Tool reviews. Guide: Documentation > Tools > Tool Builder; manual chapter `/spaces/domma-cms-user-manual/tool-builder`; tutorial `/tutorials/make-a-tool-of-your-own-with-daisy`.
1759
+
1727
1760
  ### Analytics Pro (`analytics-pro`)
1728
1761
 
1729
1762
  Tier: paid (closed source) · Version: 2.3.2 · Requires: no MongoDB (hits kept in `data/hits.jsonl`); no `minCmsVersion` declared; no `requires` · Uses: none declared · Permission: `analytics-pro` (View), granted to `admin` (2.3.0)
@@ -1840,6 +1873,8 @@ Everything in the free Blog, plus several separate blogs on one site - each with
1840
1873
  - `align`: wide, full, center, left, right. Admin "Insert media" slideover builds these.
1841
1874
  - Post editor **Insert shortcode** (0.7.0): a searchable picker over the admin's own shortcode registry (`insertMenuGroups()` / `insertShortcodeByName()` from `admin/js/lib/shortcode-insert.js`), so posts get the page editor's forms and builders (card, timeline, scribe, image); Blog Pro's media group leads and opens Insert media. The content box also gets the page editor's right-click menu (edit the shortcode under the cursor, Insert…).
1842
1875
  - Featured media on posts: a video/audio link leads the post in place of its picture; cards borrow the provider thumbnail.
1876
+ - **Pin to the top** (Blog Pro 0.8.0): a post editor box puts a post first on a blog's front page and makes it the Featured header's post (and `[blog-featured]` with no slug); archives stay in date order; publishers only.
1877
+ - **After every post** (Blog Pro 0.8.1): a per-blog or default setting (`postFooter`, Markdown and shortcodes, up to 8,000 characters) shown under every post in every layout; admin-only.
1843
1878
  - Link metadata and thumbnails fetched once server-side (SSRF-guarded), cached in `data/media/` (30 days; failures retried after 6 hours).
1844
1879
  - Per-blog settings: posts per page, RSS length, comments, hold for approval, post layout, listing display, readers can switch display, in-page search/filter, related posts, author pages, authors index, index header, author page header, authors index style, transition, reveal, hover.
1845
1880
  - Sitemap source `blog-pro` (every blog's index and public posts).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domma-cms",
3
- "version": "1.47.2",
3
+ "version": "1.47.3",
4
4
  "description": "File-based CMS powered by Domma and Fastify. Run npx domma-cms my-site to create a new project.",
5
5
  "type": "module",
6
6
  "main": "server/server.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "note": "Written by `make sync-free-tier` in dcms-marketplace. Do not edit these plugins here - edit them there and sync.",
3
- "source": "dcms-marketplace@f7fadbe",
3
+ "source": "dcms-marketplace@2611cf2",
4
4
  "plugins": {
5
5
  "blog": {
6
6
  "version": "1.10.3",
@@ -234,10 +234,10 @@
234
234
  }
235
235
  },
236
236
  "shopping-cart": {
237
- "version": "1.7.3",
237
+ "version": "1.7.4",
238
238
  "files": {
239
- "CHANGELOG.md": "9eb6067eff204d178cb58f4acb22191fce03ec84440fddf0515fa595a00fe19e",
240
- "CLAUDE.md": "8c6678338cbfaddff1a0d2a70dcc8f59518b4a6a3d2d10ca4e190b9d892f857a",
239
+ "CHANGELOG.md": "0dd30ec7fde5f4b1c5a5743852d925eb849f764e7de8971b3fc2e2e34b948983",
240
+ "CLAUDE.md": "9e62730419a01b05e70559fea238b8334a6f46ebed27a5943d7b477abfcce9a1",
241
241
  "admin/css/index.css": "cdd7790511deef162ad30e299b4512d289583e978ba3b87d65945cdf1da3cdda",
242
242
  "admin/lib/chart.js": "b01ce5cfac773c8df8efccab50b67d3dfa99fbead0037d817553db4a6688d4d6",
243
243
  "admin/lib/drafts.js": "9e71b939f6c98d5c25875f35b02c367a5e89e0d2c6d084d6a4de0c71128930a2",
@@ -246,7 +246,7 @@
246
246
  "admin/templates/shop.html": "c5bb03f1f7cbabfbd8202f3533783eb1848103755b1ba25fdcf1fd8e9478cb8e",
247
247
  "admin/views/orders.js": "11a4f9d1db5b6c849b136d97b97e44821bcac21b617281dda58809b442c8645e",
248
248
  "admin/views/overview.js": "02241e75976cfa759d6ba738dd13ca0bd2bcb760d66a5f184becc2e472807efc",
249
- "admin/views/products.js": "b35893d85b92db0048459431258f2a235b1f0824b3601bebc5e5d94fdcc0d10f",
249
+ "admin/views/products.js": "8944645e5e264b0bce5fbd483fbc694ba9df0999db288f2ee202b513ba619c99",
250
250
  "admin/views/sales.js": "001c08963e26df72f43d2357bbcc5a0f54f74f9d22bca319c23a28a50f40c124",
251
251
  "admin/views/settings.js": "5bec0fc307abe935858e24697acb5cfae7f4dcac945afc1f6185da982c121e22",
252
252
  "admin/views/shop.js": "b28390b8aacde1c2d395cdf92902ec655075061bbd8dd5ca0df53db851f5051c",
@@ -267,13 +267,13 @@
267
267
  "lib/shop.js": "baa5dfc4e410210e8ba13678997ee5752eb2ebe72fc4d3e449465d29b60b458d",
268
268
  "lib/summary.js": "ff947ccf0f63cc3095946612460f3ea7ff742803395802179b3ccd66fe961dfa",
269
269
  "plugin.js": "650025fefd7426ffc8334807c3e88c6496067350479e2551efcf61d53c74b630",
270
- "plugin.json": "d057fe23713c879e1f4172261244b2d2311e89754685a73de5ab9870643af3ec",
270
+ "plugin.json": "ed9dd04c57e12d722fe6ea0d8642c9ea2c07b785b0ac6a18ca64f6408893fbcb",
271
271
  "plugin.public.js": "d4304e85895f7e8e2397e64cc7a8e118e94b65c2f271369f880d92e7d32f83f8",
272
272
  "public/account.js": "5f644016c098c7879c59948d662f5997cb61680996204ecb7897baab8945d434",
273
273
  "public/cart.js": "7338141392ec653ff616eb75688d2a2ad08cff8427d7020d381f540be0037b73",
274
274
  "public/lib/money.js": "d22b2b6f80dde6f7887b69e24188c05ea93c02217aba639b5331aa3bd616f4fc",
275
275
  "public/lib/orders.js": "e18d054bf385e9c15544628c81ad7746179eea74c33dbcce42dd2525f3fa210e",
276
- "public/lib/products.js": "65a033b4b03c1b6d9cd7035e6be4c3fe47c7ad309dc14c4d417b6ac0fc10e2f4",
276
+ "public/lib/products.js": "ace3b66b3a5033c061c01bef86c8529ba91449bcb47f7be4fbada072a9c63e1e",
277
277
  "public/lib/session.js": "4f71e98818a52cf2321c8dc57e33e5591deb04ebb2c0bea19dd6758827719a08",
278
278
  "public/samples/candle-2.svg": "aca5691b9168467caf6feb7622ab154ee92504be8b887ac6c818db22476e7bed",
279
279
  "public/samples/candle.svg": "ef75e95a53ce13e88928004c6f1290c45a1094765e2ba741ae1fc55d404b881f",
@@ -287,7 +287,7 @@
287
287
  "public/samples/tee.svg": "287a82d7fc00acb1543b3209927ae20dcbe3d4b2a2b3de03574ab0c463385f3c",
288
288
  "public/samples/tote-2.svg": "9c7f41cc57866e71973e413a6c87f46be48f7488d3490ceea58e24559c334813",
289
289
  "public/samples/tote.svg": "01de817a32c8d3d8ea47ff491049f439ca3e4d4fce943dbdc62a4187139e016c",
290
- "public/shop.css": "173ad430069f64581aaf3520b8f4273ec87e30e81cb4db454987226fdd097ded",
290
+ "public/shop.css": "ac42d386b014556e175b12164cf4ff2fbdcf7b273c32ed7f55da7cc1f43c103b",
291
291
  "roles/shop-customer.json": "3f3366c536c9fbf2b2ce146bb3090b008d5fbfe22752e764eb8e5a1de9cd611c",
292
292
  "templates/shop.html": "4649e57d23458833a157799dc80141824eb0f658d96734bd1859c68e0ba9a8b9",
293
293
  "tests/accounts.test.js": "79b0e91e4310d076960b2a768ada02185b6cf05cab83052ee825b13978e0a9dc",
@@ -295,7 +295,7 @@
295
295
  "tests/commission.test.js": "fbc4cf83e0ed6446a09e57e4ff37a9608c81947c633c78ac6049eb0aedf6cb58",
296
296
  "tests/drafts.test.js": "2dec0cfeadd6df1d3b90f3fd8bce1f33762811eb6e94cd7325bcb8ec31edac42",
297
297
  "tests/email.test.js": "2190b6dd7cc9afad99d2170f002343fe3dad306aa14ac718428e5df0be54ded1",
298
- "tests/pure.test.js": "7fd8db1d18fbd2dcac899eaff5ee19d30f8b806bd6f342b89259413d5f205c18",
298
+ "tests/pure.test.js": "d124ed192b0148965558c563dce87acfd84d6c63fc475bc1e4ff2313dab62db8",
299
299
  "tests/refunds.test.js": "0ae06afca3cf9fd1fe89f1fbc63b3676216c79e174dbcb83788180c01d078366",
300
300
  "tests/sales.test.js": "9025bc608b04bcc14f5bb2c98b4f7c35de99f3ddab4ffa59772d045795bf2cb7",
301
301
  "tests/seo.test.js": "1d0b77409bd65faf803af303531c7653a151b4ffd615bab4fb1708efabd670de"
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.7.4] - 2026-11-08
4
+ - The product list counts options without pluralising their name: "Units: 2 options", not "2 unitss" (`optionsText` in public/lib/products.js).
5
+ - The receipt's Download buttons (and [buy-button] links) are readable on every theme: their text is the theme's own on-primary colour (`--dm-primary-text`), and the site's content-link colour no longer paints over it (it made them primary text on a primary button).
6
+
3
7
  ## [1.7.3] - 2026-11-08
4
8
  - An order's extension facts show only words and numbers, with readable names ("keys short: 2"): Shop Pro's bookkeeping (counted, granted) showed raw.
5
9
  - Needs you says an option is sold out ("Imperial sold out") rather than ": 0".
@@ -93,6 +93,9 @@ A cached page can show a stale stock flag until it is re-rendered; checkout re-p
93
93
 
94
94
  - Storefront CSS tokens are defined on `body`, not `:root`: themes set --dm-* on body's dm-theme-* class.
95
95
  - The site's own input/link styles reach the storefront: see the "reach in here" block at the end of shop.css.
96
+ - Text on the accent is `--shop-accent-ink` = the theme's `--dm-primary-text` (never a fixed #fff). A link drawn as a button
97
+ needs its colour in the `@layer shop-ink` block: core site.css colours content links with an !important rule of
98
+ specificity 0,8,5, and only a layered !important beats it without a selector arms race.
96
99
  - `siteBase()` uses `request.host` (with the port); `request.hostname` drops it under Fastify 5.
97
100
  - A test site on a non-standard port needs `site.baseUrl` for Stripe/PayPal return addresses behind a proxy, and
98
101
  emails have no links to the order until it (or a real sign-in) gives the site a trusted address (1.6.1).
@@ -20,7 +20,7 @@
20
20
  import {api, ask, claims, entriesOf, soon, esc, getCurrency, money, moneyIn, moneyOut, mountPanels, openPanel, refreshBadge, store, wireRows} from '../lib/kit.js';
21
21
  import {NEW_KEY, PRODUCT_DRAFTS_KEY, adoptAsNew, draftDiffers, draftKey, draftValues, productDraftQuestion, readMap, replaceNewDraftQuestion,
22
22
  stableJson, withDraft} from '../lib/drafts.js';
23
- import {STATUS_LABEL, cleanProduct, priceRange, slugify, totalStock} from '/plugins/shopping-cart/public/lib/products.js';
23
+ import {STATUS_LABEL, cleanProduct, optionsText, priceRange, slugify, totalStock} from '/plugins/shopping-cart/public/lib/products.js';
24
24
 
25
25
  const FILTERS = [
26
26
  {key: 'all', label: 'All', match: (p) => p.status !== 'archived'},
@@ -90,7 +90,7 @@ export async function mount(root, ctx) {
90
90
  img: p.images?.[0] || '',
91
91
  featured: Boolean(p.featured),
92
92
  unsaved: kept.has(e.id),
93
- meta: [p.category, p.variants?.length ? `${p.variants.length} ${(p.optionName || 'option').toLowerCase()}s` : '', p.sku].filter(Boolean).join(' · ') || ' ',
93
+ meta: [p.category, optionsText(p), p.sku].filter(Boolean).join(' · ') || ' ',
94
94
  stockText: stock === null ? '∞' : `${stock} in stock`,
95
95
  stockTone: stock === null ? 'is-muted' : stock === 0 ? 'is-danger' : stock <= low ? 'is-warning' : '',
96
96
  statusLabel: STATUS_LABEL[p.status],
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shopping-cart",
3
3
  "displayName": "Shopping Cart",
4
- "version": "1.7.3",
4
+ "version": "1.7.4",
5
5
  "tier": "free",
6
6
  "description": "Sell from your site: products with options, stock and pictures, a storefront and a cart that follows shoppers from page to page, and checkout with Stripe, PayPal or payment offline. Orders to fulfil in the sidebar, refunds from the order.",
7
7
  "author": "Domma CMS",
@@ -194,6 +194,20 @@ export function priceRange(product) {
194
194
  return {min: Math.min(...prices), max: Math.max(...prices)};
195
195
  }
196
196
 
197
+ /**
198
+ * How many options a product has, for the admin's product list: "Size: 2
199
+ * options", or "2 options" when the option has no name of its own. The name is
200
+ * shown as typed and never pluralised - owners write "Size" as often as "Sizes"
201
+ * or "Units", and adding an "s" gave "2 unitss". '' when there are none.
202
+ */
203
+ export function optionsText(product) {
204
+ const count = product?.variants?.length || 0;
205
+ if (!count) return '';
206
+ const counted = `${count} ${count === 1 ? 'option' : 'options'}`;
207
+ const name = String(product.optionName || '').trim();
208
+ return !name || /^options?$/i.test(name) ? counted : `${name}: ${counted}`;
209
+ }
210
+
197
211
  /**
198
212
  * The fields a shopper may see. Never the cost of anything internal: no
199
213
  * position, no SKU-level stock numbers beyond "how many can I buy".
@@ -14,7 +14,11 @@
14
14
 
15
15
  body {
16
16
  --shop-accent: var(--dm-primary, #4f46e5);
17
- --shop-accent-ink: #fff;
17
+ /* Text on the accent: the theme's own on-primary colour (every Domma theme
18
+ sets --dm-primary-text - dark on a pale primary, white on a deep one).
19
+ A theme without it gets the browser's contrast pick where it has
20
+ contrast-color() (the @supports below), else white. */
21
+ --shop-accent-ink: var(--dm-primary-text, #fff);
18
22
  --shop-bg: var(--dm-surface, #fff);
19
23
  --shop-page: var(--dm-background, var(--shop-bg));
20
24
  --shop-text: var(--dm-text, #16181d);
@@ -31,6 +35,9 @@ body {
31
35
  --shop-shadow-lift: 0 2px 4px rgba(0, 0, 0, .06), 0 18px 40px -16px rgba(0, 0, 0, .35);
32
36
  --shop-ease: cubic-bezier(.2, .8, .2, 1);
33
37
  }
38
+ @supports (color: contrast-color(red)) {
39
+ body { --shop-accent-ink: var(--dm-primary-text, contrast-color(var(--shop-accent))); }
40
+ }
34
41
 
35
42
  .shop-page { padding-top: 1.5rem; padding-bottom: 4rem; color: var(--shop-text); }
36
43
  .shop-page h1, .shop-page h2, .shop-page h3 { color: var(--shop-text); }
@@ -411,7 +418,19 @@ html.shop-locked { overflow: hidden; }
411
418
  .shop-page .shop-qty input, .shop-drawer .shop-qty input, .shop-search input {
412
419
  background: transparent !important; border: 0 !important; box-shadow: none !important; outline: 0; padding-left: 0; padding-right: 0; margin: 0; min-height: 0; }
413
420
  .shop-card-title a, .shop-card-title a:hover, .shop-line-name, .shop-crumbs a, .shop-quick { text-decoration: none !important; }
414
- .shop-r-get, .shop-r-get:hover, .shop-r-get:visited { color: var(--shop-accent-ink) !important; text-decoration: none !important; }
421
+ .shop-r-get, .shop-r-get:hover, .shop-r-get:visited { text-decoration: none !important; }
422
+ /* Links drawn as buttons keep the ink. The CMS's site.css colours every content
423
+ link with `html body .page-body a[href]:not(...)` + !important (specificity
424
+ 0,8,5), which turned these into primary text on a primary button - the
425
+ receipt's washed-out Download. An !important declaration in a cascade layer
426
+ beats every unlayered !important one whatever its specificity, so this is
427
+ the one place that wins without a selector arms race. */
428
+ @layer shop-ink {
429
+ .shop-r-get, .shop-r-get:hover, .shop-r-get:visited,
430
+ .shop-buy-button, .shop-buy-button:hover, .shop-buy-button:visited,
431
+ .shop-quick.is-link:hover, .shop-quick.is-link:focus-visible { color: var(--shop-accent-ink) !important; }
432
+ .shop-quick.is-link { color: var(--shop-text) !important; }
433
+ }
415
434
  .shop-card-title a:hover { color: var(--shop-accent); }
416
435
 
417
436
  @media (max-width: 640px) {
@@ -2,7 +2,7 @@ import {test} from 'node:test';
2
2
  import assert from 'node:assert/strict';
3
3
  import {createHmac} from 'node:crypto';
4
4
  import {formatMoney, fromMinor, includedTax, percentOf, toMinor} from '../public/lib/money.js';
5
- import {available, cleanProduct, priceRange, publicProduct, slugify, unitPrice} from '../public/lib/products.js';
5
+ import {available, cleanProduct, optionsText, priceRange, publicProduct, slugify, unitPrice} from '../public/lib/products.js';
6
6
  import {canMove, cleanCheckout} from '../public/lib/orders.js';
7
7
  import {cleanCharges, cleanCustomLines, cleanLines, priceBasket} from '../lib/pricing.js';
8
8
  import {paypalPaid, stripeCreateSession, stripeForm, stripeLineItems, stripeRefund, stripeSessionPaid, stripeVerify} from '../lib/payments.js';
@@ -48,6 +48,17 @@ test('products: cleaned, slugged, variants and stock', () => {
48
48
  assert.deepEqual(cleanProduct({name: 'A', price: 1, images: ['javascript:alert(1)', '/media/a.jpg']}).data.images, ['/media/a.jpg']);
49
49
  });
50
50
 
51
+ test('products: the admin list counts options without pluralising their name', () => {
52
+ const two = [{id: 'a'}, {id: 'b'}];
53
+ assert.equal(optionsText({optionName: 'Units', variants: two}), 'Units: 2 options', 'not "2 unitss"');
54
+ assert.equal(optionsText({optionName: 'Sizes', variants: two}), 'Sizes: 2 options', 'not "2 sizess"');
55
+ assert.equal(optionsText({optionName: 'Size', variants: [{id: 'a'}]}), 'Size: 1 option');
56
+ assert.equal(optionsText({optionName: '', variants: two}), '2 options');
57
+ assert.equal(optionsText({optionName: 'Option', variants: two}), '2 options', 'no "Option: 2 options"');
58
+ assert.equal(optionsText({optionName: 'Size', variants: []}), '');
59
+ assert.equal(optionsText({}), '');
60
+ });
61
+
51
62
  test('orders: moves, checkout cleaning', () => {
52
63
  assert.ok(canMove('paid', 'fulfilled'));
53
64
  assert.ok(!canMove('cancelled', 'paid'));
@@ -93,11 +93,13 @@ export function inertShortcodes(html) {
93
93
  }
94
94
 
95
95
  function escapeHtmlText(str) {
96
+ // ' too: a block template may print {{field}} inside a single-quoted attribute.
96
97
  return String(str ?? '')
97
98
  .replace(/&/g, '&amp;')
98
99
  .replace(/</g, '&lt;')
99
100
  .replace(/>/g, '&gt;')
100
- .replace(/"/g, '&quot;');
101
+ .replace(/"/g, '&quot;')
102
+ .replace(/'/g, '&#39;');
101
103
  }
102
104
 
103
105
  /**