@vectoriox/iox-ui 5.149.0 → 5.151.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.
@@ -165,6 +165,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
165
165
  readonly arranges: readonly [];
166
166
  readonly moves: readonly [];
167
167
  readonly say: readonly [];
168
+ readonly sayHe: readonly [];
168
169
  };
169
170
  readonly column: {
170
171
  readonly never: readonly [];
@@ -252,6 +253,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
252
253
  readonly arranges: readonly [];
253
254
  readonly moves: readonly [];
254
255
  readonly say: readonly [];
256
+ readonly sayHe: readonly [];
255
257
  };
256
258
  readonly column: {
257
259
  readonly never: readonly [];
@@ -340,6 +342,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
340
342
  readonly arranges: readonly [];
341
343
  readonly moves: readonly [];
342
344
  readonly say: readonly [];
345
+ readonly sayHe: readonly [];
343
346
  };
344
347
  readonly column: {
345
348
  readonly never: readonly [];
@@ -429,6 +432,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
429
432
  readonly arranges: readonly [];
430
433
  readonly moves: readonly [];
431
434
  readonly say: readonly [];
435
+ readonly sayHe: readonly [];
432
436
  };
433
437
  readonly column: {
434
438
  readonly never: readonly [];
@@ -508,6 +512,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
508
512
  readonly arranges: readonly [];
509
513
  readonly moves: readonly [];
510
514
  readonly say: readonly [];
515
+ readonly sayHe: readonly [];
511
516
  };
512
517
  readonly column: {
513
518
  readonly never: readonly [];
@@ -589,6 +594,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
589
594
  readonly arranges: readonly [];
590
595
  readonly moves: readonly [];
591
596
  readonly say: readonly [];
597
+ readonly sayHe: readonly [];
592
598
  };
593
599
  readonly column: {
594
600
  readonly never: readonly [];
@@ -669,6 +675,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
669
675
  readonly arranges: readonly [];
670
676
  readonly moves: readonly [];
671
677
  readonly say: readonly [];
678
+ readonly sayHe: readonly [];
672
679
  };
673
680
  readonly column: {
674
681
  readonly never: readonly [];
@@ -750,6 +757,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
750
757
  readonly arranges: readonly [];
751
758
  readonly moves: readonly [];
752
759
  readonly say: readonly [];
760
+ readonly sayHe: readonly [];
753
761
  };
754
762
  readonly column: {
755
763
  readonly never: readonly [];
@@ -830,6 +838,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
830
838
  readonly arranges: readonly ["fan", "tilted"];
831
839
  readonly moves: readonly [];
832
840
  readonly say: readonly ["Trust and care are shown straight: nothing leans, nothing is fanned like a hand of cards."];
841
+ readonly sayHe: readonly ["אמון וטיפול מציגים ישר: שום דבר לא מוטה, שום דבר לא פרוש כמו קלפים ביד."];
833
842
  };
834
843
  readonly column: {
835
844
  readonly never: readonly ["wide"];
@@ -920,6 +929,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
920
929
  readonly arranges: readonly [];
921
930
  readonly moves: readonly [];
922
931
  readonly say: readonly [];
932
+ readonly sayHe: readonly [];
923
933
  };
924
934
  readonly column: {
925
935
  readonly never: readonly [];
@@ -1004,6 +1014,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1004
1014
  readonly arranges: readonly [];
1005
1015
  readonly moves: readonly [];
1006
1016
  readonly say: readonly [];
1017
+ readonly sayHe: readonly [];
1007
1018
  };
1008
1019
  readonly column: {
1009
1020
  readonly never: readonly [];
@@ -1089,6 +1100,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1089
1100
  readonly arranges: readonly [];
1090
1101
  readonly moves: readonly [];
1091
1102
  readonly say: readonly [];
1103
+ readonly sayHe: readonly [];
1092
1104
  };
1093
1105
  readonly column: {
1094
1106
  readonly never: readonly [];
@@ -1170,6 +1182,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1170
1182
  readonly arranges: readonly ["deck", "fan", "tilted"];
1171
1183
  readonly moves: readonly ["auto", "page"];
1172
1184
  readonly say: readonly ["People who come for care or advice read at their own pace: nothing turns by itself, nothing to flick through.", "Trust and care are shown straight: nothing leans, nothing is fanned like a hand of cards."];
1185
+ readonly sayHe: readonly ["מי שמגיע לטיפול או לייעוץ קורא בקצב שלו: שום דבר לא מתחלף מעצמו, אין מה לדפדף.", "אמון וטיפול מציגים ישר: שום דבר לא מוטה, שום דבר לא פרוש כמו קלפים ביד."];
1173
1186
  };
1174
1187
  readonly column: {
1175
1188
  readonly never: readonly ["wide"];
@@ -1255,6 +1268,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1255
1268
  readonly arranges: readonly ["deck", "fan", "tilted"];
1256
1269
  readonly moves: readonly ["auto", "page"];
1257
1270
  readonly say: readonly ["People who come for care or advice read at their own pace: nothing turns by itself, nothing to flick through.", "Trust and care are shown straight: nothing leans, nothing is fanned like a hand of cards."];
1271
+ readonly sayHe: readonly ["מי שמגיע לטיפול או לייעוץ קורא בקצב שלו: שום דבר לא מתחלף מעצמו, אין מה לדפדף.", "אמון וטיפול מציגים ישר: שום דבר לא מוטה, שום דבר לא פרוש כמו קלפים ביד."];
1258
1272
  };
1259
1273
  readonly column: {
1260
1274
  readonly never: readonly ["wide"];
@@ -1341,6 +1355,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1341
1355
  readonly arranges: readonly ["deck", "fan", "tilted"];
1342
1356
  readonly moves: readonly ["auto", "page"];
1343
1357
  readonly say: readonly ["People who come for care or advice read at their own pace: nothing turns by itself, nothing to flick through.", "Trust and care are shown straight: nothing leans, nothing is fanned like a hand of cards."];
1358
+ readonly sayHe: readonly ["מי שמגיע לטיפול או לייעוץ קורא בקצב שלו: שום דבר לא מתחלף מעצמו, אין מה לדפדף.", "אמון וטיפול מציגים ישר: שום דבר לא מוטה, שום דבר לא פרוש כמו קלפים ביד."];
1344
1359
  };
1345
1360
  readonly column: {
1346
1361
  readonly never: readonly ["wide"];
@@ -1425,6 +1440,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1425
1440
  readonly arranges: readonly ["fan", "tilted"];
1426
1441
  readonly moves: readonly [];
1427
1442
  readonly say: readonly ["Trust and care are shown straight: nothing leans, nothing is fanned like a hand of cards."];
1443
+ readonly sayHe: readonly ["אמון וטיפול מציגים ישר: שום דבר לא מוטה, שום דבר לא פרוש כמו קלפים ביד."];
1428
1444
  };
1429
1445
  readonly column: {
1430
1446
  readonly never: readonly ["wide"];
@@ -1505,6 +1521,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1505
1521
  readonly arranges: readonly [];
1506
1522
  readonly moves: readonly [];
1507
1523
  readonly say: readonly [];
1524
+ readonly sayHe: readonly [];
1508
1525
  };
1509
1526
  readonly column: {
1510
1527
  readonly never: readonly [];
@@ -1592,6 +1609,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1592
1609
  readonly arranges: readonly [];
1593
1610
  readonly moves: readonly [];
1594
1611
  readonly say: readonly [];
1612
+ readonly sayHe: readonly [];
1595
1613
  };
1596
1614
  readonly column: {
1597
1615
  readonly never: readonly [];
@@ -1676,6 +1694,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1676
1694
  readonly arranges: readonly [];
1677
1695
  readonly moves: readonly [];
1678
1696
  readonly say: readonly [];
1697
+ readonly sayHe: readonly [];
1679
1698
  };
1680
1699
  readonly column: {
1681
1700
  readonly never: readonly [];
@@ -1760,6 +1779,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1760
1779
  readonly arranges: readonly [];
1761
1780
  readonly moves: readonly [];
1762
1781
  readonly say: readonly [];
1782
+ readonly sayHe: readonly [];
1763
1783
  };
1764
1784
  readonly column: {
1765
1785
  readonly never: readonly [];
@@ -1839,6 +1859,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1839
1859
  readonly arranges: readonly [];
1840
1860
  readonly moves: readonly [];
1841
1861
  readonly say: readonly [];
1862
+ readonly sayHe: readonly [];
1842
1863
  };
1843
1864
  readonly column: {
1844
1865
  readonly never: readonly [];
@@ -1919,6 +1940,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1919
1940
  readonly arranges: readonly [];
1920
1941
  readonly moves: readonly [];
1921
1942
  readonly say: readonly [];
1943
+ readonly sayHe: readonly [];
1922
1944
  };
1923
1945
  readonly column: {
1924
1946
  readonly never: readonly [];
@@ -1999,6 +2021,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1999
2021
  readonly arranges: readonly ["deck", "fan", "tilted"];
2000
2022
  readonly moves: readonly [];
2001
2023
  readonly say: readonly ["A deck reads as a game; advice and causes are read, not flicked.", "Trust and care are shown straight: nothing leans, nothing is fanned like a hand of cards."];
2024
+ readonly sayHe: readonly ["חפיסה נראית כמו משחק; על ייעוץ ועל מטרות קוראים, לא מדפדפים.", "אמון וטיפול מציגים ישר: שום דבר לא מוטה, שום דבר לא פרוש כמו קלפים ביד."];
2002
2025
  };
2003
2026
  readonly column: {
2004
2027
  readonly never: readonly ["wide"];
@@ -2081,6 +2104,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2081
2104
  readonly arranges: readonly ["deck", "fan", "tilted"];
2082
2105
  readonly moves: readonly [];
2083
2106
  readonly say: readonly ["A deck reads as a game; advice and causes are read, not flicked.", "Trust and care are shown straight: nothing leans, nothing is fanned like a hand of cards."];
2107
+ readonly sayHe: readonly ["חפיסה נראית כמו משחק; על ייעוץ ועל מטרות קוראים, לא מדפדפים.", "אמון וטיפול מציגים ישר: שום דבר לא מוטה, שום דבר לא פרוש כמו קלפים ביד."];
2084
2108
  };
2085
2109
  readonly column: {
2086
2110
  readonly never: readonly ["wide"];
@@ -2157,6 +2181,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2157
2181
  readonly arranges: readonly ["deck", "fan", "tilted"];
2158
2182
  readonly moves: readonly ["auto", "page"];
2159
2183
  readonly say: readonly ["People who come for care or advice read at their own pace: nothing turns by itself, nothing to flick through.", "Trust and care are shown straight: nothing leans, nothing is fanned like a hand of cards."];
2184
+ readonly sayHe: readonly ["מי שמגיע לטיפול או לייעוץ קורא בקצב שלו: שום דבר לא מתחלף מעצמו, אין מה לדפדף.", "אמון וטיפול מציגים ישר: שום דבר לא מוטה, שום דבר לא פרוש כמו קלפים ביד."];
2160
2185
  };
2161
2186
  readonly column: {
2162
2187
  readonly never: readonly ["wide"];
@@ -2244,6 +2269,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2244
2269
  readonly arranges: readonly [];
2245
2270
  readonly moves: readonly [];
2246
2271
  readonly say: readonly [];
2272
+ readonly sayHe: readonly [];
2247
2273
  };
2248
2274
  readonly column: {
2249
2275
  readonly never: readonly [];
@@ -2327,6 +2353,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2327
2353
  readonly arranges: readonly ["deck", "fan", "tilted"];
2328
2354
  readonly moves: readonly [];
2329
2355
  readonly say: readonly ["A deck reads as a game; advice and causes are read, not flicked.", "Trust and care are shown straight: nothing leans, nothing is fanned like a hand of cards."];
2356
+ readonly sayHe: readonly ["חפיסה נראית כמו משחק; על ייעוץ ועל מטרות קוראים, לא מדפדפים.", "אמון וטיפול מציגים ישר: שום דבר לא מוטה, שום דבר לא פרוש כמו קלפים ביד."];
2330
2357
  };
2331
2358
  readonly column: {
2332
2359
  readonly never: readonly ["wide"];
@@ -2403,6 +2430,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2403
2430
  readonly arranges: readonly [];
2404
2431
  readonly moves: readonly [];
2405
2432
  readonly say: readonly [];
2433
+ readonly sayHe: readonly [];
2406
2434
  };
2407
2435
  readonly column: {
2408
2436
  readonly never: readonly [];
@@ -2486,6 +2514,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2486
2514
  readonly arranges: readonly [];
2487
2515
  readonly moves: readonly [];
2488
2516
  readonly say: readonly [];
2517
+ readonly sayHe: readonly [];
2489
2518
  };
2490
2519
  readonly column: {
2491
2520
  readonly never: readonly [];
@@ -2569,6 +2598,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2569
2598
  readonly arranges: readonly [];
2570
2599
  readonly moves: readonly [];
2571
2600
  readonly say: readonly [];
2601
+ readonly sayHe: readonly [];
2572
2602
  };
2573
2603
  readonly column: {
2574
2604
  readonly never: readonly [];
@@ -3043,6 +3073,8 @@ interface BusinessTypeLists {
3043
3073
  readonly arranges: ReadonlyArray<string>;
3044
3074
  readonly moves: ReadonlyArray<string>;
3045
3075
  readonly say: ReadonlyArray<string>;
3076
+ /** One Hebrew sentence for each English one (vectoriox/iox-ui#123 — a mended list is said in the owner's words). */
3077
+ readonly sayHe: ReadonlyArray<string>;
3046
3078
  }
3047
3079
  /** Award §0c (AW-D34): the column words a type's pages are never offered (contract harness `businessTypes[].column`,
3048
3080
  * from harness.mjs COLUMN_NEVER) — the layout wire leaves them out and checkLayout mends them (`column-mended`). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-ui",
3
- "version": "5.149.0",
3
+ "version": "5.151.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",
@@ -5,6 +5,7 @@ import { auditDesignContrast, DesignTokenLike } from '@vectoriox/iox-ui/design-c
5
5
  import { ConsentActionType } from '@vectoriox/iox-ui/composite-core';
6
6
  import { collectFormSpec, FORM_CHANNEL_ROLE, FORM_NODE_TYPE, isChannelFilled } from '@vectoriox/iox-ui/forms-core';
7
7
 
8
+ import { findingMessageOf, FindingParams } from './audit-words';
8
9
  import { blocksPublish, ComposedPlaceholder, PlaceholderKind } from './compose-site';
9
10
  import { formAsksPersonalData, isLegalKind, ISRAEL, LegalKind, legalKindBlocks, legalTitle } from './legal';
10
11
  import { navShapeOf } from './nav-shape';
@@ -177,8 +178,12 @@ export interface SiteFinding {
177
178
  check: SiteCheckId;
178
179
  severity: CheckSeverity;
179
180
  code: SiteFindingCode;
180
- /** In plain words, for the screen. */
181
+ /** In plain words, in English — what a screen without the admin's language shows. A screen says it in the admin's
182
+ * language with `findingSentence` (audit-words), from `code` and `params`. */
181
183
  message: string;
184
+ /** The values the finding's sentence names (a page's or an item's name, a count, a route) and its variant — what
185
+ * `findingSentence` / `groupSentence` say it with (vectoriox/iox-ui#109). Absent on a finding an older server wrote. */
186
+ params?: FindingParams;
182
187
  pageId?: string;
183
188
  nodeId?: string;
184
189
  /** The global slot (`header` / `footer`) when it is in a global. */
@@ -342,8 +347,21 @@ interface Ctx {
342
347
  nodeIds: Map<string, string>;
343
348
  }
344
349
 
345
- function add(ctx: Ctx, code: SiteFindingCode, message: string, where: { pageId?: string; nodeId?: string; owner?: string; fact?: string; legal?: string } = {}): void {
346
- ctx.out.push({ check: CHECK_OF[code], severity: FINDING_SEVERITY[code], code, message, ...where });
350
+ type FindingWhere = { pageId?: string; nodeId?: string; owner?: string; fact?: string; legal?: string };
351
+
352
+ /** A finding: its English message from the ONE words table (audit-words), with the values it names. */
353
+ function add(ctx: Ctx, code: SiteFindingCode, params: FindingParams | null, where: FindingWhere = {}): void {
354
+ say(ctx, code, findingMessageOf(code, params ?? {}), params, where);
355
+ }
356
+
357
+ /** A page link to a page the site lacks names that route; a link set to no page says so. */
358
+ function deadLinkParams(label: string, route: string): FindingParams {
359
+ return route ? { variant: 'route', label, route } : { variant: 'unlinked', label };
360
+ }
361
+
362
+ /** A finding whose words are another table's (a store fact: the checkout gate's rule label). */
363
+ function say(ctx: Ctx, code: SiteFindingCode, message: string, params: FindingParams | null, where: FindingWhere): void {
364
+ ctx.out.push({ check: CHECK_OF[code], severity: FINDING_SEVERITY[code], code, message, ...(params && Object.keys(params).length ? { params } : {}), ...where });
347
365
  }
348
366
 
349
367
  /** Every node of a page or a global, with where it lives. */
@@ -357,8 +375,8 @@ function eachNode(snapshot: SiteAuditSnapshot, pages: ReadonlyArray<AuditPage>,
357
375
 
358
376
  function checkNavigation(ctx: Ctx, snapshot: SiteAuditSnapshot): void {
359
377
  const header = snapshot.globals.find(g => g.globalPosition === PatternGlobalPosition.Before);
360
- if (!header) return add(ctx, SiteFindingCode.NoHeader, 'The site has no header, so visitors have no menu to move around with.');
361
- if (!navShapeOf(snapshot.globals)) add(ctx, SiteFindingCode.NoPhoneMenu, 'The header has no phone menu — on a phone its links are hard to reach.', { owner: 'header', nodeId: header.id });
378
+ if (!header) return add(ctx, SiteFindingCode.NoHeader, null);
379
+ if (!navShapeOf(snapshot.globals)) add(ctx, SiteFindingCode.NoPhoneMenu, null, { owner: 'header', nodeId: header.id });
362
380
  }
363
381
 
364
382
  function checkForms(ctx: Ctx, snapshot: SiteAuditSnapshot, pages: ReadonlyArray<AuditPage>): boolean {
@@ -366,14 +384,14 @@ function checkForms(ctx: Ctx, snapshot: SiteAuditSnapshot, pages: ReadonlyArray<
366
384
  eachNode(snapshot, pages, (n, where) => {
367
385
  if (n.type !== FORM_NODE_TYPE) return;
368
386
  const spec = collectFormSpec(n as never);
369
- if (!spec || !nonEmpty(spec.formId)) add(ctx, SiteFindingCode.FormWithoutId, 'A form has no id, so what visitors send is never stored.', { ...where, nodeId: n.id });
387
+ if (!spec || !nonEmpty(spec.formId)) add(ctx, SiteFindingCode.FormWithoutId, null, { ...where, nodeId: n.id });
370
388
  if (spec?.actions.some(a => a.type === EMAIL_DELIVERY) && snapshot.connectors[MAILER] !== true) {
371
- add(ctx, SiteFindingCode.EmailNeedsMailer, 'A form emails what visitors send, but Email is not connected — it is stored and never sent.', { ...where, nodeId: n.id });
389
+ add(ctx, SiteFindingCode.EmailNeedsMailer, null, { ...where, nodeId: n.id });
372
390
  }
373
391
  if (formAsksPersonalData(n)) personal = true;
374
392
  walkSerialized(n.children ?? [], f => {
375
393
  if (f.role === FORM_CHANNEL_ROLE && !isChannelFilled(f.props['href'])) {
376
- add(ctx, SiteFindingCode.EmptyChannel, 'A form\'s second way to reach you has no number or address yet — visitors do not see it until you fill it in.', { ...where, nodeId: f.id });
394
+ add(ctx, SiteFindingCode.EmptyChannel, null, { ...where, nodeId: f.id });
377
395
  }
378
396
  });
379
397
  });
@@ -410,7 +428,7 @@ function checkConsent(ctx: Ctx, snapshot: SiteAuditSnapshot): void {
410
428
  const banners: SerializedNode[] = [];
411
429
  for (const g of snapshot.globals) walkSerialized([g], n => { if (n.type === DIALOG_TYPE && n.props['consentRole'] === true) banners.push(n); });
412
430
  if (snapshot.trackers?.length && !banners.length) {
413
- add(ctx, SiteFindingCode.TrackerWithoutBanner, `${snapshot.trackers.join(', ')} is connected, but the site has no cookie banner — it stays off for every visitor.`);
431
+ add(ctx, SiteFindingCode.TrackerWithoutBanner, { trackers: snapshot.trackers.join(', ') });
414
432
  }
415
433
  for (const banner of banners) {
416
434
  const accept: Pressed[] = [];
@@ -423,9 +441,7 @@ function checkConsent(ctx: Ctx, snapshot: SiteAuditSnapshot): void {
423
441
  const weaker = !reject.length || reject.every(r => LINK_LIKE.has(r.node.type)
424
442
  || !accept.some(a => a.node.type === r.node.type && a.row === r.row));
425
443
  if (weaker) {
426
- add(ctx, SiteFindingCode.ConsentRejectWeaker, !reject.length
427
- ? 'The cookie banner has no Reject beside Accept — refusing must be as easy as accepting.'
428
- : 'The cookie banner\'s Reject is weaker than its Accept — make it the same kind of button, on the same row.', { owner: 'footer', nodeId: banner.id });
444
+ add(ctx, SiteFindingCode.ConsentRejectWeaker, { variant: !reject.length ? 'missing' : 'weaker' }, { owner: 'footer', nodeId: banner.id });
429
445
  }
430
446
  }
431
447
  if (!banners.length) return;
@@ -439,14 +455,14 @@ function checkConsent(ctx: Ctx, snapshot: SiteAuditSnapshot): void {
439
455
  for (const g of snapshot.globals) if (prefs.has(g.id)) walkSerialized([g], n => inBanner.add(n.id));
440
456
  let reopens = false;
441
457
  eachNode(snapshot, snapshot.pages, n => { if (!inBanner.has(n.id) && runs(n, ConsentActionType.OpenPreferences)) reopens = true; });
442
- if (!reopens) add(ctx, SiteFindingCode.NoCookieSettings, 'Nothing on the site reopens the cookie choice — add Cookie settings to the footer so visitors can change their mind.');
458
+ if (!reopens) add(ctx, SiteFindingCode.NoCookieSettings, null);
443
459
  }
444
460
 
445
461
  function checkSeo(ctx: Ctx, pages: ReadonlyArray<AuditPage>): void {
446
462
  for (const page of pages) {
447
463
  const seo = (page.seo ?? {}) as Record<string, unknown>;
448
- if (!seoField(seo['title'], hasContent(page.layout, 'Heading'))) add(ctx, SiteFindingCode.NoTitle, `"${page.name}" has no title for search results.`, { pageId: page.id });
449
- if (!seoField(seo['description'], hasContent(page.layout, 'Text'))) add(ctx, SiteFindingCode.NoDescription, `"${page.name}" has no description for search results.`, { pageId: page.id });
464
+ if (!seoField(seo['title'], hasContent(page.layout, 'Heading'))) add(ctx, SiteFindingCode.NoTitle, { name: page.name }, { pageId: page.id });
465
+ if (!seoField(seo['description'], hasContent(page.layout, 'Text'))) add(ctx, SiteFindingCode.NoDescription, { name: page.name }, { pageId: page.id });
450
466
  }
451
467
  }
452
468
 
@@ -454,27 +470,27 @@ function checkFacts(ctx: Ctx, snapshot: SiteAuditSnapshot, pages: ReadonlyArray<
454
470
  const inScope = (p: { pageId?: string }) => !p.pageId || pages.some(page => page.id === p.pageId);
455
471
  for (const p of (snapshot.placeholders ?? []).filter(p => !p.filled && inScope(p))) {
456
472
  const where = { pageId: p.pageId, nodeId: p.nodeId, ...(p.pageId ? {} : { owner: p.owner }) };
457
- if (p.kind === PlaceholderKind.Fact) add(ctx, SiteFindingCode.ContactMissing, `"${p.text || p.fact}" is not on the site yet — visitors do not see that line until you fill it in.`, where);
458
- else if (blocksPublish(p.kind)) add(ctx, SiteFindingCode.UnfilledFact, `"${p.text || p.kind}" is still blank — fill it in before the site goes live.`, where);
459
- else if (p.kind === PlaceholderKind.Copy) add(ctx, SiteFindingCode.CopyPlaceholder, 'Some words are still the template\'s.', where);
473
+ if (p.kind === PlaceholderKind.Fact) add(ctx, SiteFindingCode.ContactMissing, { text: String(p.text || p.fact) }, where);
474
+ else if (blocksPublish(p.kind)) add(ctx, SiteFindingCode.UnfilledFact, { text: String(p.text || p.kind) }, where);
475
+ else if (p.kind === PlaceholderKind.Copy) add(ctx, SiteFindingCode.CopyPlaceholder, null, where);
460
476
  }
461
- for (const s of snapshot.samples ?? []) add(ctx, SiteFindingCode.SampleItems, `"${s.label ?? s.id}" is a sample — replace or remove it.`, { nodeId: s.id });
477
+ for (const s of snapshot.samples ?? []) add(ctx, SiteFindingCode.SampleItems, { name: s.label ?? s.id }, { nodeId: s.id });
462
478
  // iox-cms#98: what the shop lacks holds only the pages that show the shop — never the Home of a site that also sells.
463
479
  const shopShown = pages.some(pageShowsShop);
464
- for (const s of shopShown ? snapshot.unpricedSamples ?? [] : []) add(ctx, SiteFindingCode.SamplePrice, `"${s.label ?? s.id}" has no price yet — set yours, or remove the sample.`, { nodeId: s.id });
465
- for (const s of shopShown ? snapshot.unstockedSamples ?? [] : []) add(ctx, SiteFindingCode.SampleStock, `"${s.label ?? s.id}" has no stock yet — say how many you have, or remove the sample.`, { nodeId: s.id });
480
+ for (const s of shopShown ? snapshot.unpricedSamples ?? [] : []) add(ctx, SiteFindingCode.SamplePrice, { name: s.label ?? s.id }, { nodeId: s.id });
481
+ for (const s of shopShown ? snapshot.unstockedSamples ?? [] : []) add(ctx, SiteFindingCode.SampleStock, { name: s.label ?? s.id }, { nodeId: s.id });
466
482
  if (snapshot.store?.refusals.length && shopShown && siteSells(snapshot)) {
467
483
  for (const r of snapshot.store.refusals) {
468
484
  const code = STORE_CONTACT_CODES.has(r.code) ? SiteFindingCode.StoreContact : SiteFindingCode.StoreFact;
469
- add(ctx, code, labelIn(r.label, snapshot.store.lang), { fact: r.code });
485
+ say(ctx, code, labelIn(r.label, snapshot.store.lang), null, { fact: r.code });
470
486
  }
471
487
  }
472
- for (const s of (snapshot.stock ?? []).filter(inScope)) add(ctx, SiteFindingCode.StockPhoto, 'A stock photo stands in for one of yours.', { pageId: s.pageId, nodeId: s.nodeId, owner: s.owner });
473
- for (const s of (snapshot.made ?? []).filter(inScope)) add(ctx, SiteFindingCode.MadePicture, 'A picture made with AI stands in for one of yours.', { pageId: s.pageId, nodeId: s.nodeId, owner: s.owner });
474
- for (const s of (snapshot.missing ?? []).filter(inScope)) add(ctx, SiteFindingCode.PictureMissing, 'A picture could not be made for this spot — add one of yours.', { pageId: s.pageId, nodeId: s.nodeId, owner: s.owner });
488
+ for (const s of (snapshot.stock ?? []).filter(inScope)) add(ctx, SiteFindingCode.StockPhoto, null, { pageId: s.pageId, nodeId: s.nodeId, owner: s.owner });
489
+ for (const s of (snapshot.made ?? []).filter(inScope)) add(ctx, SiteFindingCode.MadePicture, null, { pageId: s.pageId, nodeId: s.nodeId, owner: s.owner });
490
+ for (const s of (snapshot.missing ?? []).filter(inScope)) add(ctx, SiteFindingCode.PictureMissing, { variant: 'made' }, { pageId: s.pageId, nodeId: s.nodeId, owner: s.owner });
475
491
  checkLegalPages(ctx, snapshot, pages, personal);
476
492
  if (personal && !legalPageOf(snapshot.pages, LegalKind.Privacy)) {
477
- add(ctx, SiteFindingCode.NoPrivacyPage, 'A form asks for personal details, and the site has no privacy page saying what you do with them.');
493
+ add(ctx, SiteFindingCode.NoPrivacyPage, null);
478
494
  }
479
495
  }
480
496
 
@@ -524,7 +540,7 @@ function checkLegalPages(ctx: Ctx, snapshot: SiteAuditSnapshot, pages: ReadonlyA
524
540
  if (!kind || !legalKindBlocks(kind) || !open.some(p => p.pageId === page.id)) continue;
525
541
  // Warn old: a site from before the law is never held by its accessibility statement.
526
542
  if (kind === LegalKind.Accessibility && !built) continue;
527
- add(ctx, SiteFindingCode.LegalPagePlaceholder, `"${page.name || legalTitle(kind, snapshot.locale)}" still says what belongs there — only you can write it.`, { pageId: page.id, legal: kind });
543
+ add(ctx, SiteFindingCode.LegalPagePlaceholder, { name: page.name || legalTitle(kind, snapshot.locale) }, { pageId: page.id, legal: kind });
528
544
  }
529
545
  }
530
546
 
@@ -532,13 +548,12 @@ function checkAccessibility(ctx: Ctx, snapshot: SiteAuditSnapshot, pages: Readon
532
548
  // AW1 (AW-D14): Israel requires an accessibility statement; a Hebrew site elsewhere is expected to carry one. Block
533
549
  // new, warn old: only a site built with the law is held (`siteBuiltWithLaw`).
534
550
  if (wantsAccessibilityStatement(snapshot) && !legalPageOf(snapshot.pages, LegalKind.Accessibility)) {
535
- const why = isIsraeli(snapshot) ? 'Israel requires one' : 'a Hebrew site is expected to carry one';
536
- if (siteBuiltWithLaw(snapshot)) add(ctx, SiteFindingCode.NoAccessibilityStatement, `The site has no accessibility statement — ${why}. Add a page for it and write what is accessible and who to contact.`);
537
- else add(ctx, SiteFindingCode.AccessibilityStatementAdvised, `The site has no accessibility statement — ${why}. Add a page for it.`);
551
+ const why = { variant: isIsraeli(snapshot) ? 'israel' : 'hebrew' };
552
+ add(ctx, siteBuiltWithLaw(snapshot) ? SiteFindingCode.NoAccessibilityStatement : SiteFindingCode.AccessibilityStatementAdvised, why);
538
553
  }
539
554
  for (const mode of snapshot.design?.modes ?? []) {
540
555
  const failing = auditDesignContrast(snapshot.design!.rows, mode).filter(f => !f.pass);
541
- if (failing.length) add(ctx, SiteFindingCode.LowContrast, `${failing.length} text and background pair(s) are hard to read in ${mode} mode.`);
556
+ if (failing.length) add(ctx, SiteFindingCode.LowContrast, { variant: mode, count: failing.length });
542
557
  }
543
558
  for (const page of pages) {
544
559
  let last = 0;
@@ -548,21 +563,21 @@ function checkAccessibility(ctx: Ctx, snapshot: SiteAuditSnapshot, pages: Readon
548
563
  if (!level) return;
549
564
  const l = Number(level);
550
565
  if (l === 1) h1++;
551
- if (last && l > last + 1) add(ctx, SiteFindingCode.HeadingOrder, `A heading on "${page.name}" skips a level (h${last} → h${l}).`, { pageId: page.id, nodeId: n.id });
566
+ if (last && l > last + 1) add(ctx, SiteFindingCode.HeadingOrder, { variant: 'skip', name: page.name, from: last, to: l }, { pageId: page.id, nodeId: n.id });
552
567
  last = l;
553
568
  });
554
- if (h1 > 1) add(ctx, SiteFindingCode.HeadingOrder, `"${page.name}" has ${h1} main headings (h1); one is clearer.`, { pageId: page.id });
569
+ if (h1 > 1) add(ctx, SiteFindingCode.HeadingOrder, { variant: 'h1', name: page.name, count: h1 }, { pageId: page.id });
555
570
  }
556
571
  const said = new Set((snapshot.missing ?? []).map(s => s.nodeId));
557
572
  eachNode(snapshot, pages, (n, where) => {
558
573
  if (n.type !== 'Image') return;
559
574
  if (!nonEmpty(n.props['src']) && !n.bindings.some(b => b.prop === 'src')) {
560
- if (!said.has(n.id)) add(ctx, SiteFindingCode.PictureMissing, 'A box on this page waits for a picture — add one of yours.', { ...where, nodeId: n.id });
575
+ if (!said.has(n.id)) add(ctx, SiteFindingCode.PictureMissing, { variant: 'box' }, { ...where, nodeId: n.id });
561
576
  return;
562
577
  }
563
578
  const decorative = n.props['alt'] === '' && n.props['decorative'] === true;
564
579
  const bound = n.bindings.some(b => b.prop === 'alt');
565
- if (!decorative && !bound && !nonEmpty(n.props['alt'])) add(ctx, SiteFindingCode.ImageWithoutAlt, 'A picture has no description for people who cannot see it.', { ...where, nodeId: n.id });
580
+ if (!decorative && !bound && !nonEmpty(n.props['alt'])) add(ctx, SiteFindingCode.ImageWithoutAlt, null, { ...where, nodeId: n.id });
566
581
  });
567
582
  }
568
583
 
@@ -572,7 +587,7 @@ function checkTokens(ctx: Ctx, snapshot: SiteAuditSnapshot, pages: ReadonlyArray
572
587
  const maps: Array<Record<string, unknown> | undefined> = [n.styleProps, ...Object.values(n.stateStyles ?? {}), ...Object.values(n.responsive ?? {}).map(l => l?.styleProps)];
573
588
  const literal = maps.some(map => Object.entries(map ?? {}).some(([k, v]) =>
574
589
  COLOUR_TRAITS.test(k) && LITERAL_COLOUR.test(String(v)) && !(k === 'borderColor' && n.styleProps['borderWidth'] === '0px')));
575
- if (literal) add(ctx, SiteFindingCode.LiteralColour, 'An element paints a fixed colour, so a new look will not reach it.', { ...where, nodeId: n.id });
590
+ if (literal) add(ctx, SiteFindingCode.LiteralColour, null, { ...where, nodeId: n.id });
576
591
  });
577
592
  }
578
593
 
@@ -580,7 +595,7 @@ function checkActions(ctx: Ctx, snapshot: SiteAuditSnapshot, pages: ReadonlyArra
580
595
  const routeExists = (route: unknown) => typeof route === 'string' && ctx.routes.some(r => routeMatches(r, route));
581
596
  eachNode(snapshot, pages, (n, where) => {
582
597
  if (LINKING_TYPES.has(n.type) && n.props['linkType'] === PAGE_LINK && !routeExists(n.props['pageRoute'])) {
583
- add(ctx, SiteFindingCode.DeadLink, `"${String(n.props['label'] ?? n.props['content'] ?? n.label ?? n.type)}" links to ${String(n.props['pageRoute'] || 'no page')}, which is not a page of the site.`, { ...where, nodeId: n.id });
598
+ add(ctx, SiteFindingCode.DeadLink, deadLinkParams(String(n.props['label'] ?? n.props['content'] ?? n.label ?? n.type), String(n.props['pageRoute'] ?? '')), { ...where, nodeId: n.id });
584
599
  }
585
600
  for (const ix of (n.interactions ?? []) as Array<{ actions?: Array<{ type?: string; target?: string; params?: Record<string, unknown>; disabled?: boolean }> }>) {
586
601
  for (const action of ix?.actions ?? []) {
@@ -591,17 +606,17 @@ function checkActions(ctx: Ctx, snapshot: SiteAuditSnapshot, pages: ReadonlyArra
591
606
  if (descriptor.target?.required && action.target !== SELF) {
592
607
  const targetType = action.target ? ctx.nodeIds.get(action.target) : undefined;
593
608
  if (!targetType || (types && !types.includes(targetType))) {
594
- add(ctx, SiteFindingCode.DeadDialogTarget, `"${n.label ?? n.type}" opens something that is no longer on the site.`, { ...where, nodeId: n.id });
609
+ add(ctx, SiteFindingCode.DeadDialogTarget, { label: String(n.label ?? n.type) }, { ...where, nodeId: n.id });
595
610
  }
596
611
  }
597
612
  if (action.type === 'navigate' && action.params?.['navigateTo'] === PAGE_LINK && !routeExists(action.params?.['page'])) {
598
- add(ctx, SiteFindingCode.DeadLink, `"${n.label ?? n.type}" goes to a page the site does not have.`, { ...where, nodeId: n.id });
613
+ add(ctx, SiteFindingCode.DeadLink, { variant: 'action', label: String(n.label ?? n.type) }, { ...where, nodeId: n.id });
599
614
  }
600
615
  // A connector the snapshot does not say is usable is not: unknown is never "fine".
601
616
  const connectors = descriptor.connector ? { [descriptor.connector]: snapshot.connectors[descriptor.connector] === true } : {};
602
617
  const availability = resolveActionAvailability(descriptor, { connectors });
603
618
  if (availability.state === 'connector-missing') {
604
- add(ctx, SiteFindingCode.ActionNeedsConnector, `"${n.label ?? n.type}" needs ${availability.connector} connected.`, { ...where, nodeId: n.id });
619
+ add(ctx, SiteFindingCode.ActionNeedsConnector, { label: String(n.label ?? n.type), connector: String(availability.connector) }, { ...where, nodeId: n.id });
605
620
  }
606
621
  }
607
622
  }