frameboard 0.21.0 → 0.22.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.
package/dist/cli.js CHANGED
@@ -9482,7 +9482,7 @@ async function isDirectory(path) {
9482
9482
  }
9483
9483
  }
9484
9484
  // package.json
9485
- var version$1 = "0.21.0";
9485
+ var version$1 = "0.22.0";
9486
9486
  var dependencies = { "playwright-core": "1.64.1" };
9487
9487
  // src/shared/version.ts
9488
9488
  const version = version$1;
@@ -27851,15 +27851,22 @@ function sheetBase(sheet) {
27851
27851
  return dirname(sheet.path);
27852
27852
  }
27853
27853
  // src/server/checks/rule.ts
27854
- /** A finding at `error` unless the rule asks for `warning`. */
27855
- function finding(rule, fields) {
27856
- return {
27857
- rule,
27858
- severity: fields.severity ?? "error",
27859
- frame: fields.frame,
27860
- path: fields.path,
27861
- message: fields.message,
27862
- location: fields.location ?? null
27854
+ /**
27855
+ * Builds findings for the rules `docs` declares, each at the level its doc
27856
+ * sets, so a module reports only the rules it documents.
27857
+ */
27858
+ function findingFor(docs) {
27859
+ return (rule, fields) => {
27860
+ const doc = docs.find((candidate) => candidate.id === rule);
27861
+ if (!doc) throw new Error(`No rule doc declares ${rule}`);
27862
+ return {
27863
+ rule,
27864
+ severity: doc.severity,
27865
+ frame: fields.frame,
27866
+ path: fields.path,
27867
+ message: fields.message,
27868
+ location: fields.location ?? null
27869
+ };
27863
27870
  };
27864
27871
  }
27865
27872
  /** One finding as `path:line:column rule message`, as `check` and the hook print it. */
@@ -27870,8 +27877,10 @@ function formatFinding(finding) {
27870
27877
  const THEME_RULES = [{
27871
27878
  id: "theme",
27872
27879
  tier: "selector",
27880
+ severity: "error",
27873
27881
  description: "A frame setting literal colors defines the other theme too, through a [data-theme] selector, a prefers-color-scheme query, or light-dark()"
27874
27882
  }];
27883
+ const finding$9 = findingFor(THEME_RULES);
27875
27884
  const COLOR_PROPERTIES$1 = /^(color|background(-color|-image)?|border(-(top|right|bottom|left|block|inline)(-(start|end))?)?(-color)?|outline(-color)?|fill|stroke|box-shadow|text-shadow|caret-color|accent-color|text-decoration(-color)?|column-rule(-color)?)$/i;
27876
27885
  const COLOR_FUNCTION = /\b(rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\(/i;
27877
27886
  const HEX_COLOR = /#[0-9a-f]{3,8}\b/i;
@@ -27881,7 +27890,7 @@ function checkTheme(source) {
27881
27890
  const { firstColor, bothThemes } = readThemeColors(source);
27882
27891
  if (!firstColor || bothThemes) return [];
27883
27892
  const { path, location } = firstColor;
27884
- return [finding("theme", {
27893
+ return [finding$9("theme", {
27885
27894
  frame: source.ref,
27886
27895
  path,
27887
27896
  message: "The frame sets its own colors for one theme alone. Define the other through [data-theme] or prefers-color-scheme, or take the colors from token variables.",
@@ -39349,8 +39358,10 @@ function describe$6(images) {
39349
39358
  const CUSTOM_PROPERTY_RULES = [{
39350
39359
  id: "unknown-token",
39351
39360
  tier: "exact",
39361
+ severity: "warning",
39352
39362
  description: "A var() with no fallback names a custom property no token sheet, frame sheet, or style attribute declares"
39353
39363
  }];
39364
+ const finding$8 = findingFor(CUSTOM_PROPERTY_RULES);
39354
39365
  /** A `var()` naming its property, with no fallback after a comma. */
39355
39366
  const BARE_VAR = /var\(\s*(--[\w-]+)\s*\)/g;
39356
39367
  /**
@@ -39358,6 +39369,9 @@ const BARE_VAR = /var\(\s*(--[\w-]+)\s*\)/g;
39358
39369
  * and style attributes whose name nothing declares. A token sheet's own
39359
39370
  * references are the board's to answer for, so only its declarations count.
39360
39371
  * A property a script sets reads as unknown, which a fallback silences.
39372
+ * A linked sheet's rule matching no element in the frame stays quiet, since a
39373
+ * site sheet styles other pages. The frame's own `<style>` keeps reporting,
39374
+ * since its theme and state rules match elements no static tree marks.
39361
39375
  */
39362
39376
  function checkUnknownTokens(source, tokens) {
39363
39377
  const declared = /* @__PURE__ */ new Set();
@@ -39371,6 +39385,7 @@ function checkUnknownTokens(source, tokens) {
39371
39385
  root.walkDecls((node) => {
39372
39386
  if (node.prop.startsWith("--")) declared.add(node.prop);
39373
39387
  if (sheet.origin === "token") return;
39388
+ if (sheet.origin === "linked" && matchesNothing(node, source.elements)) return;
39374
39389
  for (const name of bareVars(node.value)) uses.push({
39375
39390
  name,
39376
39391
  path: boardPath(source.root, sheet.path),
@@ -39393,13 +39408,26 @@ function checkUnknownTokens(source, tokens) {
39393
39408
  });
39394
39409
  });
39395
39410
  }
39396
- return uses.filter((use) => !declared.has(use.name)).map((use) => finding("unknown-token", {
39411
+ return uses.filter((use) => !declared.has(use.name)).map((use) => finding$8("unknown-token", {
39397
39412
  frame: source.ref,
39398
39413
  path: use.path,
39399
39414
  message: `var(${use.name}) names a custom property nothing declares, so the declaration resolves to nothing. Use a token the project's tokens.css declares, or give it a fallback, such as var(${use.name}, red).`,
39400
39415
  location: use.location
39401
39416
  }));
39402
39417
  }
39418
+ /**
39419
+ * Whether `node` sits in a rule none of whose selectors matches an element.
39420
+ * A declaration outside a rule, or a selector the check cannot match
39421
+ * statically, counts as matching, so the use still reports.
39422
+ */
39423
+ function matchesNothing(node, elements) {
39424
+ const rule = node.parent;
39425
+ if (rule?.type !== "rule" || !styles(rule)) return false;
39426
+ return rule.selectors.every((selector) => {
39427
+ const matches = compileSelector(selector);
39428
+ return matches !== null && !elements.some(matches);
39429
+ });
39430
+ }
39403
39431
  function bareVars(value) {
39404
39432
  return [...new Set([...value.matchAll(BARE_VAR)].map((match) => match[1] ?? ""))];
39405
39433
  }
@@ -39415,20 +39443,24 @@ const FONT_RULES = [
39415
39443
  {
39416
39444
  id: "default-font",
39417
39445
  tier: "selector",
39446
+ severity: "warning",
39418
39447
  description: "Every text element reaches a font-family, so the browser's default font never renders"
39419
39448
  },
39420
39449
  {
39421
39450
  id: "generic-font",
39422
39451
  tier: "selector",
39452
+ severity: "warning",
39423
39453
  description: "No text element renders in a generic family such as sans-serif or monospace as its first choice"
39424
39454
  },
39425
39455
  {
39426
39456
  id: "allowed-fonts",
39427
39457
  tier: "selector",
39458
+ severity: "error",
39428
39459
  configKey: "allowedFonts",
39429
39460
  description: "Every text element's first family is one of the project's allowed fonts"
39430
39461
  }
39431
39462
  ];
39463
+ const finding$7 = findingFor(FONT_RULES);
39432
39464
  const GENERIC_FAMILIES = /* @__PURE__ */ new Set([
39433
39465
  "serif",
39434
39466
  "sans-serif",
@@ -39471,7 +39503,7 @@ function checkFonts(source, cascade, config) {
39471
39503
  else if (allowed && !allowed.includes(family.toLowerCase())) push(unlisted, family, element);
39472
39504
  }
39473
39505
  const path = boardPath(source.root, source.path);
39474
- const at = (rule, elements, message) => finding(rule, {
39506
+ const at = (rule, elements, message) => finding$7(rule, {
39475
39507
  frame: source.ref,
39476
39508
  path,
39477
39509
  message: `${message} ${described(elements)}`,
@@ -39505,19 +39537,23 @@ const LINK_RULES = [
39505
39537
  {
39506
39538
  id: "outside-link",
39507
39539
  tier: "exact",
39540
+ severity: "error",
39508
39541
  description: "A frame loads files from its own page folder and its project's assets/ folder alone, never from a sibling page or the server root"
39509
39542
  },
39510
39543
  {
39511
39544
  id: "network",
39512
39545
  tier: "exact",
39546
+ severity: "error",
39513
39547
  description: "A frame loads nothing over the network, while a navigation link passes"
39514
39548
  },
39515
39549
  {
39516
39550
  id: "missing-file",
39517
39551
  tier: "exact",
39552
+ severity: "error",
39518
39553
  description: "Every local file a frame loads exists"
39519
39554
  }
39520
39555
  ];
39556
+ const finding$6 = findingFor(LINK_RULES);
39521
39557
  /**
39522
39558
  * The attributes that load a resource, by element. An `a href` navigates
39523
39559
  * rather than loads, so it is left out.
@@ -39593,16 +39629,16 @@ function judge(source, load) {
39593
39629
  path: load.path,
39594
39630
  location: load.location
39595
39631
  };
39596
- if (hasScheme(url)) return [finding("network", {
39632
+ if (hasScheme(url)) return [finding$6("network", {
39597
39633
  ...fields,
39598
39634
  message: `${load.via} loads ${url} over the network. Save the file into the page folder or the project's assets/ and link it there.`
39599
39635
  })];
39600
39636
  const target = localTarget(url, load.base);
39601
- if (target === null || !allowed(source, target)) return [finding("outside-link", {
39637
+ if (target === null || !allowed(source, target)) return [finding$6("outside-link", {
39602
39638
  ...fields,
39603
39639
  message: `${load.via} loads ${url}, outside this page's folder and the project's assets/. Move the file into one of them.`
39604
39640
  })];
39605
- if (!existsSync(target)) return [finding("missing-file", {
39641
+ if (!existsSync(target)) return [finding$6("missing-file", {
39606
39642
  ...fields,
39607
39643
  message: `${load.via} loads ${url}, which does not exist.`
39608
39644
  })];
@@ -39657,34 +39693,41 @@ const STRUCTURE_RULES = [
39657
39693
  {
39658
39694
  id: "naming",
39659
39695
  tier: "exact",
39696
+ severity: "error",
39660
39697
  description: "A page or frame name uses letters, digits, dots, dashes, and underscores, opening with a letter or digit, at most 64 characters"
39661
39698
  },
39662
39699
  {
39663
39700
  id: "dot-folder",
39664
39701
  tier: "exact",
39702
+ severity: "error",
39665
39703
  description: "No folder in a project opens with a dot, since the board never shows it"
39666
39704
  },
39667
39705
  {
39668
39706
  id: "head-body",
39669
39707
  tier: "exact",
39708
+ severity: "error",
39670
39709
  description: "A frame stating <head> states <body> too"
39671
39710
  },
39672
39711
  {
39673
39712
  id: "table-tbody",
39674
39713
  tier: "exact",
39714
+ severity: "error",
39675
39715
  description: "A table holding rows states its <tbody>, since the browser adds one the file does not hold"
39676
39716
  },
39677
39717
  {
39678
39718
  id: "malformed-tag",
39679
39719
  tier: "exact",
39720
+ severity: "error",
39680
39721
  description: "A tag or attribute the HTML tokenizer cannot read as written, such as a quote ending an attribute early, which the browser recovers from silently"
39681
39722
  },
39682
39723
  {
39683
39724
  id: "nesting",
39684
39725
  tier: "exact",
39726
+ severity: "error",
39685
39727
  description: "The browser rebuilds the tree the file writes, adding an element it never opens, closing one it never closed, or moving one out of a table"
39686
39728
  }
39687
39729
  ];
39730
+ const finding$5 = findingFor(STRUCTURE_RULES);
39688
39731
  /**
39689
39732
  * Elements a parser may imply with no start tag in a valid file. A `tbody`
39690
39733
  * is `table-tbody`'s to report.
@@ -39747,12 +39790,12 @@ const MALFORMED = {
39747
39790
  function checkNaming(target, path) {
39748
39791
  const ref = `${target.project}/${target.page}/${target.name}`;
39749
39792
  const findings = [];
39750
- if (!isValidName(target.page) || isReservedPageName(target.page)) findings.push(finding("naming", {
39793
+ if (!isValidName(target.page) || isReservedPageName(target.page)) findings.push(finding$5("naming", {
39751
39794
  frame: ref,
39752
39795
  path,
39753
39796
  message: `Page name ${target.page} is not valid. Use letters, digits, dots, dashes, and underscores, opening with a letter or digit.`
39754
39797
  }));
39755
- if (!isValidName(target.name)) findings.push(finding("naming", {
39798
+ if (!isValidName(target.name)) findings.push(finding$5("naming", {
39756
39799
  frame: ref,
39757
39800
  path,
39758
39801
  message: `Frame name ${target.name} is not valid. Use letters, digits, dots, dashes, and underscores, opening with a letter or digit.`
@@ -39761,7 +39804,7 @@ function checkNaming(target, path) {
39761
39804
  }
39762
39805
  /** `dot-folder`, over a project's folder names. */
39763
39806
  function checkDotFolders(root, projectDir, folders) {
39764
- return folders.filter((name) => name.startsWith(".")).map((name) => finding("dot-folder", {
39807
+ return folders.filter((name) => name.startsWith(".")).map((name) => finding$5("dot-folder", {
39765
39808
  frame: null,
39766
39809
  path: boardPath(root, `${projectDir}/${name}`),
39767
39810
  message: `Folder ${name} opens with a dot, so the board never shows it. Rename it or move it out of the project.`
@@ -39773,13 +39816,13 @@ function checkMarkup(source) {
39773
39816
  const findings = [];
39774
39817
  const head = source.elements.find((element) => element.name === "head");
39775
39818
  const body = source.elements.find((element) => element.name === "body");
39776
- if (head && startTagLocation(head) && !(body && startTagLocation(body))) findings.push(finding("head-body", {
39819
+ if (head && startTagLocation(head) && !(body && startTagLocation(body))) findings.push(finding$5("head-body", {
39777
39820
  frame: source.ref,
39778
39821
  path,
39779
39822
  message: "The frame states <head> and no <body>. Wrap the visible content in <body>.",
39780
39823
  location: startTagLocation(head)
39781
39824
  }));
39782
- for (const table of source.elements.filter(isTable)) if (table.children.some((child) => child.type === "tag" && child.name === "tbody" && !child.sourceCodeLocation?.startTag)) findings.push(finding("table-tbody", {
39825
+ for (const table of source.elements.filter(isTable)) if (table.children.some((child) => child.type === "tag" && child.name === "tbody" && !child.sourceCodeLocation?.startTag)) findings.push(finding$5("table-tbody", {
39783
39826
  frame: source.ref,
39784
39827
  path,
39785
39828
  message: "This table holds rows with no <tbody>, so the browser adds one the file does not hold. State the <tbody>.",
@@ -39806,7 +39849,7 @@ function checkMalformedTags(source) {
39806
39849
  if (reported.has(tag)) continue;
39807
39850
  reported.add(tag);
39808
39851
  }
39809
- findings.push(finding("malformed-tag", {
39852
+ findings.push(finding$5("malformed-tag", {
39810
39853
  frame: source.ref,
39811
39854
  path,
39812
39855
  message: `${tag ? `<${tag.name}> raises ${error.code}` : error.code}. ${message}`,
@@ -39824,7 +39867,7 @@ function checkMalformedTags(source) {
39824
39867
  function checkNesting(source) {
39825
39868
  const path = boardPath(source.root, source.path);
39826
39869
  const findings = [];
39827
- const report = (message, location) => findings.push(finding("nesting", {
39870
+ const report = (message, location) => findings.push(finding$5("nesting", {
39828
39871
  frame: source.ref,
39829
39872
  path,
39830
39873
  message,
@@ -39883,16 +39926,18 @@ function isTable(element) {
39883
39926
  const UPPERCASE_RULES = [{
39884
39927
  id: "uppercase",
39885
39928
  tier: "selector",
39929
+ severity: "warning",
39886
39930
  configKey: "noUppercase",
39887
39931
  description: "No text is set in capitals, through text-transform: uppercase or a word of more than three capital letters"
39888
39932
  }];
39933
+ const finding$4 = findingFor(UPPERCASE_RULES);
39889
39934
  const CAPITALS = /(?<![\p{L}\p{N}])\p{Lu}{4,}(?![\p{L}\p{N}])/u;
39890
39935
  /** `uppercase`, which runs only when the project sets `noUppercase`. */
39891
39936
  function checkUppercase(source, cascade) {
39892
39937
  const capitalized = textElements(source).filter((element) => cascade.textTransform(element) === "uppercase" || ownText$1(element).some((text) => CAPITALS.test(text)));
39893
39938
  const first = capitalized[0];
39894
39939
  if (!first) return [];
39895
- return [finding("uppercase", {
39940
+ return [finding$4("uppercase", {
39896
39941
  frame: source.ref,
39897
39942
  path: boardPath(source.root, source.path),
39898
39943
  message: `Text is set in capitals, which the project does not allow. Write it in sentence case. ${described(capitalized)}`,
@@ -39968,8 +40013,10 @@ function isRecord(value) {
39968
40013
  const DECLARATION_RULES = [{
39969
40014
  id: "dropped-declaration",
39970
40015
  tier: "browser",
40016
+ severity: "warning",
39971
40017
  description: "A declaration the page's own CSS parser drops, being a misspelled property, a value it cannot read, or a sheet that stops parsing"
39972
40018
  }];
40019
+ const finding$3 = findingFor(DECLARATION_RULES);
39973
40020
  /**
39974
40021
  * At-rules whose blocks hold descriptors rather than properties, which
39975
40022
  * `CSS.supports` cannot answer, and `@supports`, whose block is a
@@ -39978,6 +40025,8 @@ const DECLARATION_RULES = [{
39978
40025
  const SKIPPED_BLOCKS = /^(font-face|property|page|counter-style|font-palette-values|supports)$/i;
39979
40026
  /** Prefixes for engines the board never renders in. */
39980
40027
  const FOREIGN_PREFIX = /^-(moz|ms|o)-/i;
40028
+ /** The one engine prefix the board renders, which a build tool writes beside the standard property as a fallback. */
40029
+ const FALLBACK_PREFIX = /^-webkit-/i;
39981
40030
  /**
39982
40031
  * `dropped-declaration`, one finding per declaration in the frame's own
39983
40032
  * sheets and style attributes that the open page's `CSS.supports` refuses,
@@ -39992,7 +40041,7 @@ async function checkDeclarations(page, source) {
39992
40041
  const path = boardPath(source.root, sheet.path);
39993
40042
  const text = sheet.origin === "style" ? source.html : sheet.css;
39994
40043
  const { root, errors } = parseSheet$1(sheet.css);
39995
- for (const error of errors) findings.push(finding("dropped-declaration", {
40044
+ for (const error of errors) findings.push(finding$3("dropped-declaration", {
39996
40045
  frame: source.ref,
39997
40046
  path,
39998
40047
  message: breakMessage(error),
@@ -40031,7 +40080,7 @@ async function checkDeclarations(page, source) {
40031
40080
  const supported = await page.evaluate((pairs) => pairs.map(([property, value]) => CSS.supports(property, value)), written.map((each) => [each.property, each.value]));
40032
40081
  written.forEach((each, index) => {
40033
40082
  if (supported[index]) return;
40034
- findings.push(finding("dropped-declaration", {
40083
+ findings.push(finding$3("dropped-declaration", {
40035
40084
  frame: source.ref,
40036
40085
  path: each.path,
40037
40086
  message: `The browser drops ${each.property}: ${each.value}, since it reads no such property or no such value for it. Check the spelling of both, and the unit of a length, such as 12px.`,
@@ -40042,9 +40091,16 @@ async function checkDeclarations(page, source) {
40042
40091
  }
40043
40092
  function checkable(node) {
40044
40093
  if (node.prop.startsWith("--") || FOREIGN_PREFIX.test(node.prop)) return false;
40094
+ if (isFallback(node)) return false;
40045
40095
  for (let parent = node.parent; parent; parent = parent.parent) if (parent.type === "atrule" && SKIPPED_BLOCKS.test(parent.name)) return false;
40046
40096
  return true;
40047
40097
  }
40098
+ /** A prefixed declaration whose standard property sits in the same rule. */
40099
+ function isFallback(node) {
40100
+ if (!FALLBACK_PREFIX.test(node.prop)) return false;
40101
+ const standard = node.prop.replace(FALLBACK_PREFIX, "").toLowerCase();
40102
+ return node.parent?.some((sibling) => sibling.type === "decl" && sibling.prop.toLowerCase() === standard) ?? false;
40103
+ }
40048
40104
  /** What to tell the agent about a break, by the cure its kind takes. */
40049
40105
  function breakMessage(error) {
40050
40106
  if (error.reason.startsWith("Unknown word")) return `The browser drops this declaration, since it reads no property and value in it (${error.reason}). Check for a missing colon between the two.`;
@@ -40060,9 +40116,11 @@ function syntaxLocation(text, sheet, error) {
40060
40116
  const FONT_SIZE_RULES = [{
40061
40117
  id: "min-font-size",
40062
40118
  tier: "browser",
40119
+ severity: "warning",
40063
40120
  configKey: "minFontSize",
40064
40121
  description: "Text renders smaller than the project sets as its minimum size in pixels"
40065
40122
  }];
40123
+ const finding$2 = findingFor(FONT_SIZE_RULES);
40066
40124
  /**
40067
40125
  * Reports text under `minFontSize` pixels, naming the smallest element and
40068
40126
  * how many more fall under, at most one finding per frame.
@@ -40073,7 +40131,7 @@ async function checkFontSize(page, target, minFontSize) {
40073
40131
  const smallest = under.reduce((least, text) => text.size < least.size ? text : least);
40074
40132
  const others = under.length - 1;
40075
40133
  const rest = others === 0 ? "" : `, and ${others} more ${others === 1 ? "element is" : "elements are"} under it`;
40076
- return [finding("min-font-size", {
40134
+ return [finding$2("min-font-size", {
40077
40135
  frame: target.ref,
40078
40136
  path: target.path,
40079
40137
  message: `${target.ref} sets text at ${smallest.size} px in <${smallest.tag}> at element ${smallest.index}, under the project's ${minFontSize} px minimum${rest}.`
@@ -40275,19 +40333,23 @@ const LAYOUT_RULES = [
40275
40333
  {
40276
40334
  id: "clipped",
40277
40335
  tier: "browser",
40336
+ severity: "error",
40278
40337
  description: "Content reaches past the box the frame renders at, so the board cuts it off"
40279
40338
  },
40280
40339
  {
40281
40340
  id: "scrollbar",
40282
40341
  tier: "browser",
40342
+ severity: "warning",
40283
40343
  description: "An element inside the frame scrolls by more than a pixel, showing a scrollbar in the design"
40284
40344
  },
40285
40345
  {
40286
40346
  id: "viewport",
40287
40347
  tier: "browser",
40348
+ severity: "warning",
40288
40349
  description: "Content sizes itself off the viewport height rather than holding a height of its own, a warning since a full-height screen does it on purpose"
40289
40350
  }
40290
40351
  ];
40352
+ const finding$1 = findingFor(LAYOUT_RULES);
40291
40353
  /**
40292
40354
  * The slack a reading takes before it counts, so a subpixel edge rounding up
40293
40355
  * is never a finding. One pixel matches what the groundwork spike measured.
@@ -40331,7 +40393,7 @@ function clipped(target, read) {
40331
40393
  if (!tall && !wide) return null;
40332
40394
  const past = shown.filter((box) => tall && box.bottom > height + SLACK_PX || wide && box.right > width + SLACK_PX);
40333
40395
  const reach = [tall ? `${bottom} px tall in its ${height} px height` : null, wide ? `${right} px wide in its ${width} px width` : null].filter((part) => part !== null).join(" and ");
40334
- return finding("clipped", {
40396
+ return finding$1("clipped", {
40335
40397
  frame: target.ref,
40336
40398
  path: target.path,
40337
40399
  message: `${target.ref} is ${reach}, so the board cuts it off${offenders(past, "past the box")}. ${clippedAdvice(tall, wide, width)}`
@@ -40347,7 +40409,7 @@ function scrollbar(target, read) {
40347
40409
  const [first] = scrolling;
40348
40410
  if (!first) return null;
40349
40411
  const by = Math.max(first.overflowX, first.overflowY);
40350
- return finding("scrollbar", {
40412
+ return finding$1("scrollbar", {
40351
40413
  frame: target.ref,
40352
40414
  path: target.path,
40353
40415
  message: `${target.ref} scrolls inside ${element(first)}, whose content is ${by} px past its box${more(scrolling.length - 1, "scrolls", "scroll")}. Size it to its content, or set overflow to hidden.`
@@ -40357,10 +40419,9 @@ function viewport(target, atBox, atTall, boxRead, tallRead) {
40357
40419
  if (atTall <= atBox + SLACK_PX) return null;
40358
40420
  const before = new Map(boxRead.boxes.map((box) => [box.index, box.height]));
40359
40421
  const grown = tallRead.boxes.filter((box) => box.height > (before.get(box.index) ?? box.height) + SLACK_PX);
40360
- return finding("viewport", {
40422
+ return finding$1("viewport", {
40361
40423
  frame: target.ref,
40362
40424
  path: target.path,
40363
- severity: "warning",
40364
40425
  message: `${target.ref} grows with the viewport, measuring ${atBox} px at its ${target.box.height} px height and ${atTall} px at twice that${offenders(grown, "growing")}. Give it a height of its own unless it is a full-height screen on purpose.`
40365
40426
  });
40366
40427
  }
@@ -40487,8 +40548,10 @@ function readLayout() {
40487
40548
  const OUTRANKED_RULES = [{
40488
40549
  id: "outranked",
40489
40550
  tier: "selector",
40551
+ severity: "warning",
40490
40552
  description: "An agent's write changed a rule in the frame's own <style> that an element's unchanged style attribute also sets, so that element keeps its inline value, which may be the developer's hand edit. A warning the server raises against the bytes the write replaced, so the hook never reports it."
40491
40553
  }];
40554
+ const finding = findingFor(OUTRANKED_RULES);
40492
40555
  const SIDES = [
40493
40556
  "top",
40494
40557
  "right",
@@ -40598,7 +40661,6 @@ function checkOutranked(before, after) {
40598
40661
  return [finding("outranked", {
40599
40662
  frame: after.ref,
40600
40663
  path: boardPath(after.root, after.path),
40601
- severity: "warning",
40602
40664
  message: `This write changed the ${first.selector} rule, but <${first.element.name}> at element ${first.index} sets ${first.property} in its style attribute, which outranks every rule${others}. The style attribute may hold a value the developer set by hand, so change it too only if the new value should reach that element.`,
40603
40665
  location: attributeLocation(first.element, "style")
40604
40666
  })];
@@ -41443,7 +41505,7 @@ function renderDocs(docs) {
41443
41505
  section("Exit codes", table(Object.entries(docs.exitCodes))),
41444
41506
  section("Records", [`${INDENT}${Object.keys(docs.records).join(", ")}`, `${INDENT}Run frameboard docs --json for each record's JSON schema.`]),
41445
41507
  section("Content format", formatLines(docs.contentFormat)),
41446
- section("Check rules", docs.checks.rules.map((rule) => `${INDENT}${rule.id} ${rule.tier}${rule.configKey ? `, on with checks.${rule.configKey}` : ""}. ${rule.description}`))
41508
+ section("Check rules", docs.checks.rules.map((rule) => `${INDENT}${rule.id} ${rule.severity}, ${rule.tier}${rule.configKey ? `, on with checks.${rule.configKey}` : ""}. ${rule.description}`))
41447
41509
  ].join("\n\n");
41448
41510
  }
41449
41511
  function section(heading, lines) {