@json-to-office/core-docx 6.4.1 → 6.8.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.
@@ -13,6 +13,7 @@
13
13
  * same IR, which is what makes the IR comparable, cacheable and snapshottable.
14
14
  */
15
15
  /// <reference types="node" />
16
+ /// <reference types="node" />
16
17
  import type { GenerationWarning, ServicesConfig } from '@json-to-office/shared';
17
18
  import type { FontRuntimeOpts } from '@json-to-office/shared';
18
19
  import { compileDocument, type UnsupportedComponent } from '../ir/compiler';
@@ -1 +1 @@
1
- {"version":3,"file":"generateFromIr.d.ts","sourceRoot":"","sources":["../../src/core/generateFromIr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAU9D,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAKlE,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC3C,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,KAAK,CA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;;;OAQG;IACH,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC,iEAAiE;IACjE,QAAQ,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;CAChE;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED;;;;;GAKG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,SAAgB,IAAI,0BAA0B;IAC9C,SAAgB,UAAU,EAAE,SAAS,oBAAoB,EAAE,CAAC;gBAEhD,UAAU,EAAE,SAAS,oBAAoB,EAAE;CAiBxD;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,QAAQ,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,UAAU,CAAC,CAAC;IACzD,WAAW,EAAE,oBAAoB,EAAE,CAAC;CACrC;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,yBAAyB,EACnC,OAAO,GAAE,uBAA4B,EACrC,SAAS,CAAC,EAAE,iBAAiB,EAAE,GAC9B,OAAO,CAAC,YAAY,CAAC,CAOvB;AA0GD,0EAA0E;AAC1E,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,yBAAyB,EACnC,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,sBAAsB,CAAC,CAcjC"}
@@ -12,6 +12,7 @@
12
12
  * it part of the contract again.
13
13
  */
14
14
  /// <reference types="node" />
15
+ /// <reference types="node" />
15
16
  import { ComponentDefinition, ReportProps, ReportComponentDefinition } from '../types';
16
17
  import { ThemeConfig } from '../styles';
17
18
  import type { ServicesConfig, FontRuntimeOpts } from '@json-to-office/shared';
@@ -1 +1 @@
1
- {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src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,GAC1B,wBAAwB,CAE1B;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,GAAG,mBAAmB,GAAG,yBAAyB,EACpE,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,MAAM,CAAC,CAGjB;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,MAAM,GAAG,mBAAmB,GAAG,yBAAyB,EACpE,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAKf;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAErE;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;CAS7B,CAAC"}
@@ -11,6 +11,7 @@
11
11
  * and embedded once.
12
12
  */
13
13
  /// <reference types="node" />
14
+ /// <reference types="node" />
14
15
  import type { ComponentDefinition } from '../types';
15
16
  export interface LoadedImage {
16
17
  bytes: Buffer;
@@ -27,9 +28,14 @@ export interface LoadedImage {
27
28
  *
28
29
  * A source that could not be loaded is absent rather than recorded as an
29
30
  * error: the compiler reports it against the component's own path, which is
30
- * more use than an error attached to a URL.
31
+ * more use than an error attached to a URL. Why it failed is kept beside the
32
+ * images, so that report can say — and so a source that was tried and failed
33
+ * can be told from one the walk never reached.
31
34
  */
32
- export type ImageResources = ReadonlyMap<string, LoadedImage>;
35
+ export interface ImageResources extends ReadonlyMap<string, LoadedImage> {
36
+ /** What each source that did not load threw. */
37
+ readonly failures?: ReadonlyMap<string, unknown>;
38
+ }
33
39
  /** Load every image source in `components`, following nested content. */
34
40
  export declare function loadImageResources(components: Iterable<ComponentDefinition | undefined>): Promise<ImageResources>;
35
41
  //# sourceMappingURL=imageResources.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"imageResources.d.ts","sourceRoot":"","sources":["../../src/core/imageResources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;;AAMH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAOpD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C;AAED;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAE9D,yEAAyE;AACzE,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,QAAQ,CAAC,mBAAmB,GAAG,SAAS,CAAC,GACpD,OAAO,CAAC,cAAc,CAAC,CAyBzB"}
1
+ {"version":3,"file":"imageResources.d.ts","sourceRoot":"","sources":["../../src/core/imageResources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;;;AAMH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAOpD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAe,SAAQ,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC;IACtE,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClD;AAED,yEAAyE;AACzE,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,QAAQ,CAAC,mBAAmB,GAAG,SAAS,CAAC,GACpD,OAAO,CAAC,cAAc,CAAC,CA2BzB"}
package/dist/index.js CHANGED
@@ -2670,9 +2670,7 @@ async function downloadImageFromUrl(url) {
2670
2670
  });
2671
2671
  clearTimeout(timeoutId);
2672
2672
  if (!response.ok) {
2673
- throw new Error(
2674
- `Failed to download image: HTTP ${response.status} ${response.statusText}`
2675
- );
2673
+ throw new Error(`HTTP ${response.status} ${response.statusText}`);
2676
2674
  }
2677
2675
  const contentType = response.headers.get("content-type") || void 0;
2678
2676
  const arrayBuffer = await response.arrayBuffer();
@@ -2684,9 +2682,9 @@ async function downloadImageFromUrl(url) {
2684
2682
  "Failed to download image: Request timeout after 10 seconds"
2685
2683
  );
2686
2684
  }
2687
- throw new Error(`Failed to download image from ${url}: ${error.message}`);
2685
+ throw new Error(`Failed to download image: ${error.message}`);
2688
2686
  }
2689
- throw new Error(`Failed to download image from ${url}: Unknown error`);
2687
+ throw new Error("Failed to download image: Unknown error");
2690
2688
  }
2691
2689
  }
2692
2690
  function resolveImageSource(props) {
@@ -6221,6 +6219,7 @@ async function loadImageResources(components) {
6221
6219
  const sources = /* @__PURE__ */ new Set();
6222
6220
  for (const component of components) collectSources(component, sources);
6223
6221
  const loaded = /* @__PURE__ */ new Map();
6222
+ const failures = /* @__PURE__ */ new Map();
6224
6223
  await Promise.all(
6225
6224
  [...sources].map(async (source) => {
6226
6225
  try {
@@ -6231,11 +6230,12 @@ async function loadImageResources(components) {
6231
6230
  ...result.contentType ? { contentType: result.contentType } : {},
6232
6231
  ...intrinsic ? { intrinsic } : {}
6233
6232
  });
6234
- } catch {
6233
+ } catch (error) {
6234
+ failures.set(source, error);
6235
6235
  }
6236
6236
  })
6237
6237
  );
6238
- return loaded;
6238
+ return Object.assign(loaded, { failures });
6239
6239
  }
6240
6240
  function readIntrinsic(bytes, source) {
6241
6241
  try {
@@ -6305,7 +6305,8 @@ function collectCellSource(content, out) {
6305
6305
  // src/ir/compiler.ts
6306
6306
  init_colorUtils();
6307
6307
  import {
6308
- FeatureRequirementCollector
6308
+ FeatureRequirementCollector,
6309
+ assetUnreadableError
6309
6310
  } from "@json-to-office/shared/rendering";
6310
6311
  import { capsFormatting as capsFormatting2, synthesizeFamilyName as synthesizeFamilyName2 } from "@json-to-office/shared";
6311
6312
  import {
@@ -9291,7 +9292,7 @@ function compileChromeImage(component, scope) {
9291
9292
  }
9292
9293
  const loaded = ctx.images.get(source);
9293
9294
  if (!loaded) {
9294
- throw new Error(`Failed to load image from ${source.substring(0, 50)}`);
9295
+ throw unreadableImage(source, ctx) ?? new Error(`Failed to load image from ${source.substring(0, 50)}`);
9295
9296
  }
9296
9297
  const mediaType = detectImageType(source, loaded.contentType);
9297
9298
  if (mediaType === "svg") ctx.features.require("svg-images", path4);
@@ -10900,6 +10901,10 @@ function visualPlacementPixels(props, canvas, reference) {
10900
10901
  );
10901
10902
  }
10902
10903
  var UNLOWERED_IMAGE_PROPS = ["comment"];
10904
+ function unreadableImage(source, ctx) {
10905
+ const { failures } = ctx.images;
10906
+ return failures?.has(source) ? assetUnreadableError(source, failures.get(source)) : void 0;
10907
+ }
10903
10908
  function compileImage2(component, scope) {
10904
10909
  const { ctx, path: path4 } = scope;
10905
10910
  const props = component.props ?? {};
@@ -10916,7 +10921,9 @@ function compileImage2(component, scope) {
10916
10921
  );
10917
10922
  }
10918
10923
  const loaded = ctx.images.get(source);
10919
- if (!loaded) throw new Error(`Failed to load image from ${source}`);
10924
+ if (!loaded) {
10925
+ throw unreadableImage(source, ctx) ?? new Error(`Failed to load image from ${source}`);
10926
+ }
10920
10927
  const mediaType = detectImageType(source, loaded.contentType);
10921
10928
  if (mediaType === "svg") ctx.features.require("svg-images", path4);
10922
10929
  if (typeof props.alt === "string" && props.alt) {
@@ -13686,6 +13693,55 @@ function textSizeFact(node, props, path4, typography, role) {
13686
13693
  ...size.authored && { sizePath: `${path4}/props/font/size` }
13687
13694
  };
13688
13695
  }
13696
+ function statisticSizeFacts(props, path4, typography) {
13697
+ const named = STATISTIC_SIZE_POINTS[String(props.size)];
13698
+ const styled = (id) => finiteNumber(asRecord2(typography.styles[id])?.size);
13699
+ const numberPoints = named ?? STATISTIC_SIZE_POINTS.medium;
13700
+ const painted = props.size === "small" || props.size === "large" ? numberPoints : styled("StatisticNumber") ?? numberPoints;
13701
+ const present = (value) => value !== void 0 && value !== null && String(value).trim() !== "";
13702
+ const facts = [];
13703
+ const add = (suffix, role, fontSizePt) => facts.push({
13704
+ id: `docx:text-size:${path4}:${suffix}`,
13705
+ kind: "docx/text-size",
13706
+ path: path4,
13707
+ role,
13708
+ fontSizePt,
13709
+ authored: false
13710
+ });
13711
+ if (present(props.number)) add("number", "statistic", painted);
13712
+ if (present(props.unit) || present(props.trend) || present(props.trendValue))
13713
+ add(
13714
+ "suffix",
13715
+ "statistic-suffix",
13716
+ Math.max(12, Math.round(numberPoints)) / 2
13717
+ );
13718
+ if (present(props.description))
13719
+ add(
13720
+ "description",
13721
+ "statistic-description",
13722
+ styled("StatisticDescription") ?? 10
13723
+ );
13724
+ return facts;
13725
+ }
13726
+ function tocSizeFacts(props, path4, typography) {
13727
+ const depth = asRecord2(props.depth);
13728
+ const from = finiteNumber(depth?.from) ?? 1;
13729
+ const to = finiteNumber(depth?.to) ?? 3;
13730
+ const facts = [];
13731
+ for (let level = from; level <= to; level++) {
13732
+ const size = finiteNumber(asRecord2(typography.styles[`TOC${level}`])?.size);
13733
+ if (size === void 0) continue;
13734
+ facts.push({
13735
+ id: `docx:text-size:${path4}:toc${level}`,
13736
+ kind: "docx/text-size",
13737
+ path: path4,
13738
+ role: `toc${level}`,
13739
+ fontSizePt: size,
13740
+ authored: false
13741
+ });
13742
+ }
13743
+ return facts;
13744
+ }
13689
13745
  function tableTextSizeFacts(props, authored, path4, typography, page) {
13690
13746
  const facts = [];
13691
13747
  const sizeOf = (holder) => finiteNumber(asRecord2(asRecord2(holder)?.font)?.size);
@@ -13899,6 +13955,16 @@ function prepareDocxQualityDocument(document, options = {}) {
13899
13955
  (value) => `#${resolveDesignColor2(value, visualColors)}`
13900
13956
  ) ?? SERIES_COLOR_TOKENS.filter((token) => paletteHexes[token] !== void 0);
13901
13957
  const authoredPropsAt = (pointer) => asRecord2(asRecord2(nodeAtPointer(context.document, pointer))?.props);
13958
+ const ownSize = (fact) => {
13959
+ if (!fact?.sizePath) return fact;
13960
+ const written = finiteNumber(
13961
+ asRecord2(authoredPropsAt(fact.path)?.font)?.size
13962
+ );
13963
+ if (written !== void 0) return fact;
13964
+ const inherited2 = { ...fact, authored: false };
13965
+ delete inherited2.sizePath;
13966
+ return inherited2;
13967
+ };
13902
13968
  const roleSizesPt = {};
13903
13969
  for (const key of Object.keys(typography.styles)) {
13904
13970
  const size = effectiveFontSize(
@@ -14052,10 +14118,22 @@ function prepareDocxQualityDocument(document, options = {}) {
14052
14118
  const fact = lineBoxFact(node, props, path4, typography, context.document);
14053
14119
  if (fact) addFact(fact);
14054
14120
  if (typeof props.text === "string" && props.text.trim() !== "") {
14055
- const fact2 = textSizeFact(node, props, path4, typography);
14121
+ const fact2 = ownSize(textSizeFact(node, props, path4, typography));
14056
14122
  if (fact2) addFact({ ...fact2, generated: authoredPath(path4) !== path4 });
14057
14123
  }
14058
14124
  }
14125
+ if (node.name === "list" && Array.isArray(props.items) && props.items.length > 0) {
14126
+ const fact = ownSize(textSizeFact(node, props, path4, typography, "list"));
14127
+ if (fact) addFact({ ...fact, generated: authoredPath(path4) !== path4 });
14128
+ }
14129
+ if (node.name === "statistic") {
14130
+ for (const fact of statisticSizeFacts(props, path4, typography))
14131
+ addFact({ ...fact, generated: authoredPath(path4) !== path4 });
14132
+ }
14133
+ if (node.name === "toc") {
14134
+ for (const fact of tocSizeFacts(props, path4, typography))
14135
+ addFact({ ...fact, generated: authoredPath(path4) !== path4 });
14136
+ }
14059
14137
  if (node.name === "image" || node.name === "visual") {
14060
14138
  for (const fact of svgTextFacts(props, path4)) addFact(fact);
14061
14139
  const drawn = drawnRatio(props);
@@ -14080,6 +14158,7 @@ function prepareDocxQualityDocument(document, options = {}) {
14080
14158
  kind: "docx/heading",
14081
14159
  path: `${path4}/props/level`,
14082
14160
  level,
14161
+ generated: authoredPath(path4) !== path4,
14083
14162
  keepNext: props.keepNext === true || props.keepNext === void 0 && styleKeepNext === true,
14084
14163
  ...previousHeadingLevel !== void 0 && {
14085
14164
  previousLevel: previousHeadingLevel
@@ -14120,7 +14199,10 @@ function prepareDocxQualityDocument(document, options = {}) {
14120
14199
  index,
14121
14200
  words: texts.filter((fact) => bodyRoles.has(fact.role)).reduce((total, fact) => total + wordsOf(fact.text), 0),
14122
14201
  exhibits: own.filter((fact) => exhibitKinds.has(fact.kind)).length,
14123
- headings: texts.filter((fact) => fact.role === "heading").length
14202
+ headings: texts.filter((fact) => fact.role === "heading").length,
14203
+ // Anything the reader sees on the section's own pages: a heading, a
14204
+ // contents field, body copy. Running heads repeat onto any page.
14205
+ rendersText: texts.some((fact) => fact.role !== "chrome")
14124
14206
  });
14125
14207
  if (hasColumnsComponent(rec)) return;
14126
14208
  const page = pageBox(
@@ -14196,10 +14278,15 @@ function isCaptioned(facts, image) {
14196
14278
  return facts.some((fact) => {
14197
14279
  if (fact.kind !== "docx/text") return false;
14198
14280
  const text = fact;
14199
- const near = siblingOf(text.path) === siblingOf(image) || text.path.startsWith(`${image}/`) || image.startsWith(`${text.path}/`);
14281
+ const node = text.path.replace(/\/props(?:\/.*)?$/, "");
14282
+ const beside = siblingOf(node) === siblingOf(image) && Math.abs(indexIn(node) - indexIn(image)) === 1;
14283
+ const near = beside || text.path.startsWith(`${image}/`) || image.startsWith(`${node}/`);
14200
14284
  return near && (text.role === "caption" || CAPTION_LABEL.test(text.text));
14201
14285
  });
14202
14286
  }
14287
+ function indexIn(pointer) {
14288
+ return Number(pointer.slice(pointer.lastIndexOf("/") + 1));
14289
+ }
14203
14290
  function siblingOf(pointer) {
14204
14291
  return pointer.slice(0, pointer.lastIndexOf("/"));
14205
14292
  }
@@ -14719,14 +14806,18 @@ var docxHeadingHierarchyRule = {
14719
14806
  },
14720
14807
  // The fact path already addresses `.../props/level`; RFC 6902
14721
14808
  // `add` replaces an existing member, so this works whether the
14722
- // level was explicit or defaulted.
14723
- fixes: [
14724
- {
14725
- op: "add",
14726
- path: fact.path,
14727
- value: previousLevel + 1
14728
- }
14729
- ]
14809
+ // level was explicit or defaulted. A block's heading maps to the
14810
+ // invocation or a slot instead, and an `add` there would replace
14811
+ // the block itself: its level is the definition's to change.
14812
+ ...!fact.generated && {
14813
+ fixes: [
14814
+ {
14815
+ op: "add",
14816
+ path: fact.path,
14817
+ value: previousLevel + 1
14818
+ }
14819
+ ]
14820
+ }
14730
14821
  }
14731
14822
  ];
14732
14823
  })
@@ -15224,7 +15315,12 @@ var docxRequiredChromeRule = {
15224
15315
  relatedPaths: [fact.invocation],
15225
15316
  message: `${fact.block} states no ${fact.role} in its "${fact.slot}" slot; the ${profile?.id ?? "selected"} profile expects one on every ${fact.block}.`,
15226
15317
  suggestion: `Fill the "${fact.slot}" slot. The theme already styles it.`,
15227
- context: { block: fact.block, slot: fact.slot, role: fact.role }
15318
+ context: { block: fact.block, slot: fact.slot, role: fact.role },
15319
+ evidence: {
15320
+ actual: "empty",
15321
+ expected: fact.role,
15322
+ values: { source: "profile", required }
15323
+ }
15228
15324
  }));
15229
15325
  }
15230
15326
  };
@@ -15291,7 +15387,12 @@ var docxRunningHeadRule = {
15291
15387
  path: fact.path,
15292
15388
  message: `Section ${fact.index + 1} carries no ${parts}; the ${profile?.id ?? "selected"} profile expects a running head on every section after the cover.`,
15293
15389
  suggestion: "Invoke a running-head block at the top of the first body section: its section effect fills every later section with the title and n / N.",
15294
- context: { section: fact.index, missing }
15390
+ context: { section: fact.index, missing },
15391
+ evidence: {
15392
+ actual: required.filter((part) => fact[part]),
15393
+ expected: required,
15394
+ values: { source: "profile", fromSection: from }
15395
+ }
15295
15396
  }
15296
15397
  ];
15297
15398
  });
@@ -15339,7 +15440,7 @@ var docxTypeScaleRule = {
15339
15440
  };
15340
15441
  var docxSizeCountRule = {
15341
15442
  id: "docx/size-count",
15342
- description: "More distinct text sizes than maximumSizes allows, blocks included. Off until a profile or policy enables it.",
15443
+ description: "More distinct text sizes across the document than maximumSizes allows, blocks, statistics, lists and contents included; counted per document, which bounds every page. Off until a profile or policy enables it.",
15343
15444
  code: QUALITY_CODES.TYPE_SIZE_COUNT,
15344
15445
  category: "consistency",
15345
15446
  defaultSeverity: "warning",
@@ -15436,7 +15537,7 @@ var docxSectionContentRule = {
15436
15537
  (fact) => fact.kind === "docx/section"
15437
15538
  );
15438
15539
  return sections.flatMap((fact) => {
15439
- if (fact.words === 0 && fact.exhibits === 0)
15540
+ if (!fact.rendersText && fact.exhibits === 0)
15440
15541
  return [
15441
15542
  {
15442
15543
  path: fact.path,
@@ -15548,7 +15649,7 @@ var docxImageAspectRule = {
15548
15649
  };
15549
15650
  var docxContentsRule = {
15550
15651
  id: "docx/contents-missing",
15551
- description: "More headings than minimumHeadings with no table of contents. Off at 0.",
15652
+ description: "minimumHeadings headings or more with no table of contents. Off at 0.",
15552
15653
  code: QUALITY_CODES.CONTENTS_MISSING,
15553
15654
  category: "hierarchy",
15554
15655
  defaultSeverity: "info",
@@ -15621,7 +15722,7 @@ var DOCX_QUALITY_PROFILES = {
15621
15722
  "client-report": {
15622
15723
  id: "client-report",
15623
15724
  formats: ["docx"],
15624
- description: "Client or public-administration report: a running head with page numbers on every section after the cover, a takeaway and a source wherever a block declares them, no heading skipped, every size on the theme scale with at most eight in play, a readable measure, no empty or untitled section, every heading bound to what follows and every figure named, no page rendered empty or left half blank under the running head, and at least one chart or table.",
15725
+ description: "Client or public-administration report: a running head with page numbers on every section after the cover, a takeaway and a source wherever a block declares them, no heading skipped, every size on the theme scale with at most eleven in play, a readable measure, no empty or untitled section, every heading bound to what follows and every figure named, no page rendered empty or left half blank under the running head, and at least one chart or table.",
15625
15726
  rules: {
15626
15727
  "docx/required-chrome": {
15627
15728
  parameters: { required: ["takeaway", "source"] }
@@ -15634,7 +15735,14 @@ var DOCX_QUALITY_PROFILES = {
15634
15735
  },
15635
15736
  "docx/heading-hierarchy": { severity: "warning" },
15636
15737
  "docx/type-scale": { enabled: true },
15637
- "docx/size-count": { enabled: true, parameters: { maximumSizes: 8 } },
15738
+ // Measured 2026-09-15 with statistics, lists and contents counted: a
15739
+ // client report built from the house blocks paints up to eleven sizes —
15740
+ // body, heading 1 and 2, subtitle, display, table cells and headers,
15741
+ // source and chrome, and the kpi-row's figure, its unit and its label
15742
+ // (28, 14 and 10pt, or 20 and 10 in a row of four). Every one of the
15743
+ // reports of the #360 checkpoint and the #409 verification set came in
15744
+ // at eleven or fewer; a size past the house set is an ad-hoc one.
15745
+ "docx/size-count": { enabled: true, parameters: { maximumSizes: 11 } },
15638
15746
  "docx/role-drift": { enabled: true },
15639
15747
  // The report blocks place every figure in a captioned block, so a page
15640
15748
  // with no text under the running head is a stray break or an empty
@@ -15665,7 +15773,7 @@ var DOCX_QUALITY_PROFILES = {
15665
15773
  "technical-report": {
15666
15774
  id: "technical-report",
15667
15775
  formats: ["docx"],
15668
- description: "Technical report or memo: numbered sections under a running head with page numbers on every section after the cover, a source wherever a block declares one, no heading skipped, every size on the theme scale with at most nine in play, a readable measure, no empty or untitled section, every heading bound to what follows, every figure named, a contents page past eight headings, no page rendered empty or left half blank, and at least one chart or table.",
15776
+ description: "Technical report or memo: numbered sections under a running head with page numbers on every section after the cover, a source wherever a block declares one, no heading skipped, every size on the theme scale with at most nine in play, a readable measure, no empty or untitled section, every heading bound to what follows, every figure named, a contents page from eight headings, no page rendered empty or left half blank, and at least one chart or table.",
15669
15777
  rules: {
15670
15778
  // A figure or table in a technical report cites where its numbers come
15671
15779
  // from; the takeaway is the client report's ask, the caption is the
@@ -15679,8 +15787,10 @@ var DOCX_QUALITY_PROFILES = {
15679
15787
  },
15680
15788
  "docx/heading-hierarchy": { severity: "warning" },
15681
15789
  "docx/type-scale": { enabled: true },
15682
- // One more than the client report: the contents list paints TOC2 and
15683
- // the sub-headings paint heading 2.
15790
+ // Measured 2026-09-15: a technical report built from the house blocks
15791
+ // paints eight sizes (no kpi-row; the contents entries at body size),
15792
+ // and every one of the #409 verification set came in at eight or
15793
+ // fewer. Nine leaves room for one deliberate size of the author's.
15684
15794
  "docx/size-count": { enabled: true, parameters: { maximumSizes: 9 } },
15685
15795
  "docx/role-drift": { enabled: true },
15686
15796
  "rendered/empty-page": { severity: "warning" },