@json-to-office/core-docx 6.8.1 → 7.0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/blocks/document.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAMlB,sBAAsB,EAEtB,KAAK,qBAAqB,EAG3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC1E,YAAY,EACV,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAO7C,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACnC,eAAO,MAAM,iBAAiB,+BAAyB,CAAC;AAExD,0EAA0E;AAC1E,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,OAAO,GAAG,kBAAkB,EAAE,CA0B3E;AAED,qFAAqF;AACrF,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,GAAG,CAuCL;AAED,2EAA2E;AAC3E,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOxB;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,WAAW,EAClB,KAAK,GAAE,OAAO,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G;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,OAAO,GAAG,kBAAkB,EAAE,CA0B3E;AAED,qFAAqF;AACrF,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,GAAG,CAuCL;AAED,2EAA2E;AAC3E,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOxB;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,WAAW,EAClB,KAAK,GAAE,OAAO,CAAC,qBAAqB,CAAM,EAC1C,OAAO,GAAE,SAAS,kBAAkB,EAAkC,GACrE,kBAAkB,CAWpB;AAED,wBAAgB,YAAY,CAAC,CAAC,EAC5B,QAAQ,EAAE,CAAC,EACX,KAAK,EAAE,WAAW,GACjB,cAAc,CAAC,CAAC,CAAC,CAkBnB;AAoJD,8EAA8E;AAC9E,wBAAsB,uBAAuB,CAAC,CAAC,EAC7C,QAAQ,EAAE,CAAC,EACX,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,EAC5D,QAAQ,GAAE,WAAW,CAAC,MAAM,CAAa,GACxC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG;IAAE,SAAS,EAAE,CAAC,CAAA;CAAE,CAAC,CAgD/C"}
@@ -25,8 +25,8 @@ export interface ThemeContextOptions {
25
25
  * Theme lookup for the base `props.theme` name. The plugin builder passes
26
26
  * its own (customThemes → doc-named built-in → constructor-supplied theme →
27
27
  * built-in); omit it to use customThemes → built-in. `authored` is true when
28
- * the name came from the document's own `props.theme` (not the 'minimal'
29
- * fallback), so the lookup can honor an explicitly doc-named built-in
28
+ * the name came from the document's own `props.theme` (not the
29
+ * 'consulting' default), so the lookup can honor an explicitly doc-named built-in
30
30
  * without the constructor theme being shadowed for unnamed docs (#141).
31
31
  */
32
32
  resolveNamedTheme?: (name: string, warnings: GenerationWarning[] | undefined, authored: boolean) => ThemeConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"generationContext.d.ts","sourceRoot":"","sources":["../../src/core/generationContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAMhC,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAA;KAAE,CAAC;IAC9C,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,CAClB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,iBAAiB,EAAE,GAAG,SAAS,EACzC,QAAQ,EAAE,OAAO,KACd,WAAW,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,2EAA2E;IAC3E,QAAQ,EAAE,yBAAyB,CAAC;IACpC,KAAK,EAAE,WAAW,CAAC;IACnB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;CACnB;AAoBD,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,yBAAyB,EACrC,OAAO,GAAE,mBAAwB,GAChC,sBAAsB,CA8DxB"}
1
+ {"version":3,"file":"generationContext.d.ts","sourceRoot":"","sources":["../../src/core/generationContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAMhC,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAA;KAAE,CAAC;IAC9C,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,CAClB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,iBAAiB,EAAE,GAAG,SAAS,EACzC,QAAQ,EAAE,OAAO,KACd,WAAW,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,2EAA2E;IAC3E,QAAQ,EAAE,yBAAyB,CAAC;IACpC,KAAK,EAAE,WAAW,CAAC;IACnB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;CACnB;AAoBD,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,yBAAyB,EACrC,OAAO,GAAE,mBAAwB,GAChC,sBAAsB,CA+DxB"}
package/dist/index.d.ts CHANGED
@@ -28,6 +28,6 @@ export { examples, getExample, getExampleNames, loadJsonExample, } from './templ
28
28
  export { runExample } from './utils/exampleRunner';
29
29
  import './components/index';
30
30
  export type { ChartGenerationResult, } from './components/highcharts';
31
- export { createComponent, createVersion, createDocumentGenerator, validateComponentProps, validateDocument, cleanComponentProps, ComponentValidationError, UnknownPreservedComponentError, generatePluginDocumentSchema, exportPluginSchema, generateComponentSchemas, mergeSchemas, type CustomComponent, type ComponentVersion, type ComponentVersionMap, type RenderFunction, type RenderContext as ComponentRenderContext, type DocumentGenerator, type DocumentGeneratorOptions, type GenerateOptions, type GenerateFileOptions, type BufferGenerationResult, type FileGenerationResult, type StandardDefinitionResult, type ValidationResult, type ValidationError, type ExtractCustomComponentType, type CustomComponentUnion, type ExtendedComponentDefinition, type ExtendedReportComponent, type InferCustomComponents, } from './plugin/index';
31
+ export { createComponent, createVersion, createDocumentGenerator, validateComponentProps, validateDocument, cleanComponentProps, ComponentValidationError, UnknownPreservedComponentError, generatePluginDocumentSchema, exportPluginSchema, generateComponentSchemas, mergeSchemas, type CustomComponent, type ComponentVersion, type ComponentVersionMap, type RenderFunction, type RenderContext as ComponentRenderContext, type DocumentGenerator, type DocumentGeneratorOptions, type GenerateOptions, type GenerateFileOptions, type BufferGenerationResult, type FileGenerationResult, type StandardDefinitionResult, type QualityPreparationResult, type ValidationResult, type ValidationError, type ExtractCustomComponentType, type CustomComponentUnion, type ExtendedComponentDefinition, type ExtendedReportComponent, type InferCustomComponents, } from './plugin/index';
32
32
  export type { PluginComponent, PluginRenderFunction, PluginValidationError, PluginValidationResult, } from './types/plugin';
33
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAID,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,2BAA2B,EAC3B,iBAAiB,IAAI,qBAAqB,EAC1C,KAAK,oBAAoB,GAC1B,MAA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,gBAAgB,EACrB,KAAK,eAAe,EAGpB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,GAC3B,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1389,7 +1389,8 @@ var init_consulting_docx_theme = __esm({
1389
1389
  },
1390
1390
  stat: {
1391
1391
  face: "heading",
1392
- weight: 700,
1392
+ size: 22,
1393
+ weight: 400,
1393
1394
  color: "accent",
1394
1395
  lineHeight: 1
1395
1396
  },
@@ -1696,7 +1697,7 @@ var init_themes = __esm({
1696
1697
  getTheme = (themeName) => {
1697
1698
  return themes[themeName];
1698
1699
  };
1699
- getThemeWithFallback = (themeName, fallbackTheme = "minimal") => {
1700
+ getThemeWithFallback = (themeName, fallbackTheme = "consulting") => {
1700
1701
  const theme = getTheme(themeName) || getTheme(fallbackTheme);
1701
1702
  if (!theme) {
1702
1703
  throw new Error(
@@ -1729,7 +1730,7 @@ function resolveTheme(theme, themeName) {
1729
1730
  if (themeName) {
1730
1731
  return getTheme(themeName);
1731
1732
  }
1732
- return getTheme("minimal");
1733
+ return getTheme("consulting");
1733
1734
  }
1734
1735
  function resolveFontFamily(theme, fontRef) {
1735
1736
  if (!theme?.fonts?.body?.family) {
@@ -6843,7 +6844,12 @@ function resolveColors(entries, at, deps) {
6843
6844
  init_themes();
6844
6845
  init_colorUtils();
6845
6846
  init_styleHelpers();
6846
- import { capsFormatting, synthesizeFamilyName } from "@json-to-office/shared";
6847
+ import {
6848
+ capsFormatting,
6849
+ designCanvas,
6850
+ synthesizeFamilyName,
6851
+ typeScaleSizes
6852
+ } from "@json-to-office/shared";
6847
6853
  var RIGHT_MARGIN_TAB_TWIPS = 9026 * 2;
6848
6854
  var STATISTIC_NUMBER_STYLE_ID = "StatisticNumber";
6849
6855
  var STATISTIC_DESCRIPTION_STYLE_ID = "StatisticDescription";
@@ -6852,6 +6858,27 @@ var STATISTIC_SIZE_POINTS = {
6852
6858
  medium: 28,
6853
6859
  large: 40
6854
6860
  };
6861
+ function statisticSizes(theme, size) {
6862
+ const sizeOf = (style) => {
6863
+ const value = theme.styles?.[style]?.size;
6864
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
6865
+ };
6866
+ const role = sizeOf("stat");
6867
+ const medium = sizeOf(STATISTIC_NUMBER_STYLE_ID) ?? role ?? STATISTIC_SIZE_POINTS.medium;
6868
+ const scale = role === void 0 ? void 0 : theme.typography?.scale?.[designCanvas("docx", theme.page?.size)];
6869
+ const steps = scale ? typeScaleSizes(scale) : [];
6870
+ const below = [...steps].reverse().find((step) => step < medium - 0.01);
6871
+ const above = steps.find((step) => step > medium + 0.01);
6872
+ const number = size === "small" ? role !== void 0 && below !== void 0 ? below : STATISTIC_SIZE_POINTS.small : size === "large" ? role !== void 0 && above !== void 0 ? above : STATISTIC_SIZE_POINTS.large : medium;
6873
+ const label = sizeOf("label");
6874
+ return {
6875
+ number,
6876
+ medium,
6877
+ // Half-points in the document, floored at 6pt.
6878
+ suffix: label ?? Math.max(12, Math.round(number)) / 2,
6879
+ description: sizeOf(STATISTIC_DESCRIPTION_STYLE_ID) ?? label ?? 10
6880
+ };
6881
+ }
6855
6882
  function getStyleSafe(theme, styleName) {
6856
6883
  return theme.styles && Object.hasOwn(theme.styles, styleName) ? theme.styles[styleName] : void 0;
6857
6884
  }
@@ -7027,8 +7054,8 @@ function chromeRun(fontProps, theme, sizeHalfPoints) {
7027
7054
  ...fontProps.italic !== void 0 && { italic: fontProps.italic }
7028
7055
  };
7029
7056
  }
7030
- function createDocumentStyles(themeNameOrObject = "minimal", language) {
7031
- const theme = typeof themeNameOrObject === "string" ? getTheme(themeNameOrObject) || getTheme("minimal") : themeNameOrObject;
7057
+ function createDocumentStyles(themeNameOrObject = "consulting", language) {
7058
+ const theme = typeof themeNameOrObject === "string" ? getTheme(themeNameOrObject) || getTheme("consulting") : themeNameOrObject;
7032
7059
  const paragraphStyles = [
7033
7060
  // Normal body text style
7034
7061
  {
@@ -7499,14 +7526,19 @@ function createDocumentStyles(themeNameOrObject = "minimal", language) {
7499
7526
  };
7500
7527
  }
7501
7528
  function createStatisticStyles(theme) {
7529
+ const sizes = statisticSizes(theme, "medium");
7530
+ const stat = theme.styles?.stat;
7531
+ const faces = ["heading", "body", "mono", "light"];
7532
+ const face = faces.find((candidate) => candidate === stat?.font) ?? "heading";
7533
+ const weight = typeof stat?.fontWeight === "number" ? stat.fontWeight : void 0;
7502
7534
  const definitions = [
7503
7535
  {
7504
7536
  id: STATISTIC_NUMBER_STYLE_ID,
7505
7537
  name: "Statistic Number",
7506
- font: "heading",
7507
- sizePoints: STATISTIC_SIZE_POINTS.medium,
7508
- color: theme.colors.primary,
7509
- bold: true,
7538
+ font: face,
7539
+ sizePoints: sizes.medium,
7540
+ color: typeof stat?.color === "string" ? stat.color : theme.colors.primary,
7541
+ bold: weight === void 0 ? true : weight >= 600,
7510
7542
  // Space above separates the figure from whatever preceded it; none below,
7511
7543
  // because the description is the other half of the same block.
7512
7544
  spacing: { before: 12, after: 0 },
@@ -7519,7 +7551,7 @@ function createStatisticStyles(theme) {
7519
7551
  id: STATISTIC_DESCRIPTION_STYLE_ID,
7520
7552
  name: "Statistic Description",
7521
7553
  font: "body",
7522
- sizePoints: 10,
7554
+ sizePoints: sizes.description,
7523
7555
  color: theme.colors.textMuted,
7524
7556
  bold: false,
7525
7557
  spacing: { before: 0, after: 12 },
@@ -10091,9 +10123,10 @@ function compileStatistic(component, scope) {
10091
10123
  );
10092
10124
  }
10093
10125
  const text = (value) => normalizeUnicodeText(String(value ?? ""));
10094
- const numberPoints = STATISTIC_SIZE_POINTS[String(props.size)] ?? STATISTIC_SIZE_POINTS.medium;
10095
- const resized = numberPoints !== STATISTIC_SIZE_POINTS.medium;
10096
- const suffixHalfPoints = Math.max(12, Math.round(numberPoints));
10126
+ const sizes = statisticSizes(ctx.theme, props.size);
10127
+ const numberPoints = sizes.number;
10128
+ const resized = numberPoints !== sizes.medium;
10129
+ const suffixHalfPoints = Math.round(sizes.suffix * 2);
10097
10130
  const numberRuns = [];
10098
10131
  const numberText = text(props.number);
10099
10132
  if (numberText) {
@@ -12384,10 +12417,10 @@ import {
12384
12417
  } from "@json-to-office/quality";
12385
12418
  import { DEFAULT_DOCX_RENDERER_ID as DEFAULT_DOCX_RENDERER_ID2 } from "@json-to-office/shared-docx";
12386
12419
  import {
12387
- designCanvas as designCanvas2,
12420
+ designCanvas as designCanvas3,
12388
12421
  designColors as designColors2,
12389
12422
  resolveDesignColor as resolveDesignColor2,
12390
- typeScaleSizes
12423
+ typeScaleSizes as typeScaleSizes2
12391
12424
  } from "@json-to-office/shared";
12392
12425
 
12393
12426
  // src/core/generationContext.ts
@@ -12443,7 +12476,7 @@ function applyThemeOverrides(theme, overrides) {
12443
12476
  // src/themes/design-system.ts
12444
12477
  init_defaults();
12445
12478
  import {
12446
- designCanvas,
12479
+ designCanvas as designCanvas2,
12447
12480
  resolveMotif,
12448
12481
  resolveTypeRoles,
12449
12482
  validateDesignColors
@@ -12453,7 +12486,7 @@ function resolveDocxDesignSystem(theme) {
12453
12486
  const motif = resolveMotif(theme.motif);
12454
12487
  if (!theme.typography && !theme.spacing)
12455
12488
  return motif === theme.motif ? theme : withMotif(theme, motif);
12456
- const canvas = designCanvas("docx", theme.page.size);
12489
+ const canvas = designCanvas2("docx", theme.page.size);
12457
12490
  const roles = resolveTypeRoles(theme, canvas, theme.fonts.body.size ?? 11);
12458
12491
  const styles = { ...theme.styles };
12459
12492
  for (const [name, role] of Object.entries(roles)) {
@@ -12538,7 +12571,7 @@ function resolveThemeContext(documentIn, options = {}) {
12538
12571
  }
12539
12572
  const document = documentIn.props === void 0 ? { ...documentIn, props: {} } : documentIn;
12540
12573
  const authoredThemeName = document.props.theme || void 0;
12541
- const baseThemeName = authoredThemeName ?? "minimal";
12574
+ const baseThemeName = authoredThemeName ?? "consulting";
12542
12575
  let theme = resolveNamedTheme ? resolveNamedTheme(
12543
12576
  baseThemeName,
12544
12577
  warnings,
@@ -12902,7 +12935,8 @@ async function expandBlocksWithPlugins(document, theme, plugins, render, preserv
12902
12935
  document: second.standard,
12903
12936
  preserved: first.preserved,
12904
12937
  sourceMap: evaluator.sourceMap,
12905
- blocks: evaluator.blocks
12938
+ blocks: evaluator.blocks,
12939
+ pluginOutputs: evaluator.pluginOutputs
12906
12940
  };
12907
12941
  }
12908
12942
 
@@ -13713,10 +13747,7 @@ function textSizeFact(node, props, path4, typography, role) {
13713
13747
  };
13714
13748
  }
13715
13749
  function statisticSizeFacts(props, path4, typography) {
13716
- const named = STATISTIC_SIZE_POINTS[String(props.size)];
13717
- const styled = (id) => finiteNumber(asRecord2(typography.styles[id])?.size);
13718
- const numberPoints = named ?? STATISTIC_SIZE_POINTS.medium;
13719
- const painted = props.size === "small" || props.size === "large" ? numberPoints : styled("StatisticNumber") ?? numberPoints;
13750
+ const sizes = statisticSizes(typography.theme, props.size);
13720
13751
  const present = (value) => value !== void 0 && value !== null && String(value).trim() !== "";
13721
13752
  const facts = [];
13722
13753
  const add = (suffix, role, fontSizePt) => facts.push({
@@ -13727,19 +13758,11 @@ function statisticSizeFacts(props, path4, typography) {
13727
13758
  fontSizePt,
13728
13759
  authored: false
13729
13760
  });
13730
- if (present(props.number)) add("number", "statistic", painted);
13761
+ if (present(props.number)) add("number", "statistic", sizes.number);
13731
13762
  if (present(props.unit) || present(props.trend) || present(props.trendValue))
13732
- add(
13733
- "suffix",
13734
- "statistic-suffix",
13735
- Math.max(12, Math.round(numberPoints)) / 2
13736
- );
13763
+ add("suffix", "statistic-suffix", sizes.suffix);
13737
13764
  if (present(props.description))
13738
- add(
13739
- "description",
13740
- "statistic-description",
13741
- styled("StatisticDescription") ?? 10
13742
- );
13765
+ add("description", "statistic-description", sizes.description);
13743
13766
  return facts;
13744
13767
  }
13745
13768
  function tocSizeFacts(props, path4, typography) {
@@ -13841,8 +13864,8 @@ function prepareDocxQualityDocument(document, options = {}) {
13841
13864
  fonts: options.fonts,
13842
13865
  warnings: options.warnings
13843
13866
  });
13844
- const expanded = expandBlocks(themed.document, themed.theme);
13845
- const context = expanded.blocks.length > 0 ? { ...themed, document: expanded.document } : themed;
13867
+ const expanded = options.expanded ?? expandBlocks(themed.document, themed.theme);
13868
+ const context = options.expanded !== void 0 || expanded.blocks.length > 0 ? { ...themed, document: expanded.document } : themed;
13846
13869
  const resolved = resolveDocumentTree(context.document, context.theme);
13847
13870
  const basePage = pageBox(resolved.theme, context.themeName);
13848
13871
  const typography = {
@@ -13854,7 +13877,7 @@ function prepareDocxQualityDocument(document, options = {}) {
13854
13877
  let previousHeadingLevel;
13855
13878
  const authoredPath = (path4) => toAuthoredPointer(
13856
13879
  themed.sourceMap ?? {},
13857
- toAuthoredPointer(expanded.sourceMap, path4)
13880
+ toAuthoredPointer(expanded.sourceMap, path4, expanded.pluginOutputs)
13858
13881
  );
13859
13882
  const addFact = (raw) => {
13860
13883
  const fact = {
@@ -13993,7 +14016,7 @@ function prepareDocxQualityDocument(document, options = {}) {
13993
14016
  );
13994
14017
  if (size) roleSizesPt[key] = size.fontSizePt;
13995
14018
  }
13996
- const scale = resolved.theme.typography?.scale?.[designCanvas2("docx", resolved.theme.page?.size)];
14019
+ const scale = resolved.theme.typography?.scale?.[designCanvas3("docx", resolved.theme.page?.size)];
13997
14020
  const typeScalePt = [
13998
14021
  .../* @__PURE__ */ new Set([
13999
14022
  ...Object.values(roleSizesPt),
@@ -14001,7 +14024,7 @@ function prepareDocxQualityDocument(document, options = {}) {
14001
14024
  const size = resolveFontSize(resolved.theme, role);
14002
14025
  return size === void 0 ? [] : [size];
14003
14026
  }),
14004
- ...scale ? typeScaleSizes(scale) : []
14027
+ ...scale ? typeScaleSizes2(scale) : []
14005
14028
  ])
14006
14029
  ].sort((a, b) => a - b);
14007
14030
  addFact({
@@ -14157,6 +14180,7 @@ function prepareDocxQualityDocument(document, options = {}) {
14157
14180
  for (const fact of svgTextFacts(props, path4)) addFact(fact);
14158
14181
  const drawn = drawnRatio(props);
14159
14182
  const natural = readableRatio(props);
14183
+ const authored = authoredPropsAt(path4);
14160
14184
  addFact({
14161
14185
  id: `docx:image:${path4}`,
14162
14186
  kind: "docx/image",
@@ -14164,7 +14188,13 @@ function prepareDocxQualityDocument(document, options = {}) {
14164
14188
  ...typeof props.alt === "string" && props.alt.trim() !== "" && { alt: props.alt },
14165
14189
  captioned: isCaptioned(facts, authoredPath(path4)),
14166
14190
  ...drawn !== void 0 && { drawnRatio: drawn },
14167
- ...natural !== void 0 && { naturalRatio: natural }
14191
+ ...natural !== void 0 && { naturalRatio: natural },
14192
+ ...authoredPath(path4) === path4 && finiteNumber(authored?.width) !== void 0 && finiteNumber(authored?.height) !== void 0 && {
14193
+ authoredSizePx: {
14194
+ width: authored.width,
14195
+ height: authored.height
14196
+ }
14197
+ }
14168
14198
  });
14169
14199
  }
14170
14200
  if (node.name === "heading") {
@@ -14730,6 +14760,8 @@ import {
14730
14760
  // src/quality/rules.ts
14731
14761
  import {
14732
14762
  chartInfoDesignFindings,
14763
+ configurationLabel,
14764
+ configurationSource,
14733
14765
  DEFAULT_MAXIMUM_CHART_SERIES,
14734
14766
  DEFAULT_MAXIMUM_PIE_SLICES,
14735
14767
  fontCountFinding,
@@ -15329,18 +15361,21 @@ var docxRequiredChromeRule = {
15329
15361
  if (required.length === 0) return [];
15330
15362
  return facts.filter(
15331
15363
  (fact) => fact.kind === "docx/chrome-slot"
15332
- ).filter((fact) => required.includes(fact.role) && !fact.present).map((fact) => ({
15333
- path: fact.path,
15334
- relatedPaths: [fact.invocation],
15335
- message: `${fact.block} states no ${fact.role} in its "${fact.slot}" slot; the ${profile?.id ?? "selected"} profile expects one on every ${fact.block}.`,
15336
- suggestion: `Fill the "${fact.slot}" slot. The theme already styles it.`,
15337
- context: { block: fact.block, slot: fact.slot, role: fact.role },
15338
- evidence: {
15339
- actual: "empty",
15340
- expected: fact.role,
15341
- values: { source: "profile", required }
15342
- }
15343
- }));
15364
+ ).filter((fact) => required.includes(fact.role) && !fact.present).map((fact) => {
15365
+ const source = configurationSource(configuration, "required");
15366
+ return {
15367
+ path: fact.path,
15368
+ relatedPaths: [fact.invocation],
15369
+ message: `${fact.block} states no ${fact.role} in its "${fact.slot}" slot; ${configurationLabel(source, profile)} expects one on every ${fact.block}.`,
15370
+ suggestion: `Fill the "${fact.slot}" slot. The theme already styles it.`,
15371
+ context: { block: fact.block, slot: fact.slot, role: fact.role },
15372
+ evidence: {
15373
+ actual: "empty",
15374
+ expected: fact.role,
15375
+ values: { source, required }
15376
+ }
15377
+ };
15378
+ });
15344
15379
  }
15345
15380
  };
15346
15381
  var docxExhibitRequiredRule = {
@@ -15401,16 +15436,21 @@ var docxRunningHeadRule = {
15401
15436
  const missing = required.filter((part) => !fact[part]);
15402
15437
  if (missing.length === 0) return [];
15403
15438
  const parts = missing.map((part) => part === "pageNumber" ? "page-number field" : part).join(", ");
15439
+ const source = configurationSource(
15440
+ configuration,
15441
+ "required",
15442
+ "fromSection"
15443
+ );
15404
15444
  return [
15405
15445
  {
15406
15446
  path: fact.path,
15407
- message: `Section ${fact.index + 1} carries no ${parts}; the ${profile?.id ?? "selected"} profile expects a running head on every section after the cover.`,
15447
+ message: `Section ${fact.index + 1} carries no ${parts}; ${configurationLabel(source, profile)} expects a running head ` + (from === 0 ? "on every section." : `on every section from section ${from + 1} on.`),
15408
15448
  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.",
15409
15449
  context: { section: fact.index, missing },
15410
15450
  evidence: {
15411
15451
  actual: required.filter((part) => fact[part]),
15412
15452
  expected: required,
15413
- values: { source: "profile", fromSection: from }
15453
+ values: { source, fromSection: from }
15414
15454
  }
15415
15455
  }
15416
15456
  ];
@@ -15467,13 +15507,16 @@ var docxSizeCountRule = {
15467
15507
  formats: ["docx"],
15468
15508
  defaultEnabled: false,
15469
15509
  defaultParameters: { maximumSizes: 8 },
15470
- evaluate: ({ facts, configuration, profile }) => sizeCountFinding(
15471
- paintedSizes(facts),
15472
- numberParameter(configuration.parameters, "maximumSizes", 8),
15473
- themeFact(facts)?.path ?? "/props",
15474
- profile?.id,
15475
- DOCX_TYPE_VOCABULARY
15476
- )
15510
+ evaluate: ({ facts, configuration, profile }) => {
15511
+ const source = configurationSource(configuration, "maximumSizes");
15512
+ return sizeCountFinding(
15513
+ paintedSizes(facts),
15514
+ numberParameter(configuration.parameters, "maximumSizes", 8),
15515
+ themeFact(facts)?.path ?? "/props",
15516
+ { source, label: configurationLabel(source, profile) },
15517
+ DOCX_TYPE_VOCABULARY
15518
+ );
15519
+ }
15477
15520
  };
15478
15521
  var docxRoleDriftRule = {
15479
15522
  id: "docx/role-drift",
@@ -15530,7 +15573,12 @@ var docxBodyMeasureRule = {
15530
15573
  actual: fact.charactersPerLine,
15531
15574
  expected: wide ? maximum : minimum,
15532
15575
  unit: "characters",
15533
- values: { source: "profile" }
15576
+ values: {
15577
+ source: configurationSource(
15578
+ configuration,
15579
+ wide ? "maximumCharacters" : "minimumCharacters"
15580
+ )
15581
+ }
15534
15582
  }
15535
15583
  };
15536
15584
  });
@@ -15578,7 +15626,12 @@ var docxSectionContentRule = {
15578
15626
  actual: 0,
15579
15627
  expected: 1,
15580
15628
  unit: "headings",
15581
- values: { source: "profile" }
15629
+ values: {
15630
+ source: configurationSource(
15631
+ configuration,
15632
+ "minimumWordsForHeading"
15633
+ )
15634
+ }
15582
15635
  }
15583
15636
  }
15584
15637
  ];
@@ -15595,7 +15648,7 @@ var docxHeadingKeepNextRule = {
15595
15648
  defaultCertainty: "deterministic",
15596
15649
  formats: ["docx"],
15597
15650
  defaultEnabled: false,
15598
- evaluate: ({ facts }) => facts.filter(
15651
+ evaluate: ({ facts, configuration }) => facts.filter(
15599
15652
  (fact) => fact.kind === "docx/heading" && !fact.keepNext
15600
15653
  ).map((fact) => {
15601
15654
  const heading = /\/props\/level$/.test(fact.path) ? fact.path.replace(/\/props\/level$/, "") : void 0;
@@ -15604,7 +15657,7 @@ var docxHeadingKeepNextRule = {
15604
15657
  message: "This heading is not bound to the content under it: a page break can leave it alone at the foot of a page.",
15605
15658
  suggestion: heading ? "Set keepNext on the heading, or give the theme\u2019s heading style keepNext so every level is bound." : "Give the theme\u2019s heading style keepNext, or set it in the block definition that draws this heading.",
15606
15659
  context: { level: fact.level },
15607
- evidence: { values: { source: "profile" } },
15660
+ evidence: { values: { source: configurationSource(configuration) } },
15608
15661
  ...heading && {
15609
15662
  fixes: [
15610
15663
  {
@@ -15657,7 +15710,20 @@ var docxImageAspectRule = {
15657
15710
  {
15658
15711
  path: fact.path,
15659
15712
  drawn: fact.drawnRatio,
15660
- natural: fact.naturalRatio
15713
+ natural: fact.naturalRatio,
15714
+ ...fact.authoredSizePx && {
15715
+ sides: {
15716
+ width: {
15717
+ path: `${fact.path}/props/width`,
15718
+ value: fact.authoredSizePx.width
15719
+ },
15720
+ height: {
15721
+ path: `${fact.path}/props/height`,
15722
+ value: fact.authoredSizePx.height
15723
+ },
15724
+ decimals: 0
15725
+ }
15726
+ }
15661
15727
  },
15662
15728
  "page",
15663
15729
  tolerance
@@ -15686,17 +15752,18 @@ var docxContentsRule = {
15686
15752
  (fact) => fact.kind === "docx/outline"
15687
15753
  );
15688
15754
  if (!outline || outline.contents || outline.headings < minimum) return [];
15755
+ const source = configurationSource(configuration, "minimumHeadings");
15689
15756
  return [
15690
15757
  {
15691
15758
  path: outline.path,
15692
- message: `The document carries ${outline.headings} headings and no table of contents; the ${profile?.id ?? "selected"} profile expects one from ${minimum}.`,
15759
+ message: `The document carries ${outline.headings} headings and no table of contents; ${configurationLabel(source, profile)} expects one from ${minimum}.`,
15693
15760
  suggestion: "Add a `toc` component after the cover. Word fills it from the headings already there.",
15694
15761
  context: { headings: outline.headings, minimum },
15695
15762
  evidence: {
15696
15763
  actual: outline.headings,
15697
15764
  expected: minimum,
15698
15765
  unit: "headings",
15699
- values: { source: "profile" }
15766
+ values: { source }
15700
15767
  }
15701
15768
  }
15702
15769
  ];
@@ -15741,7 +15808,7 @@ var DOCX_QUALITY_PROFILES = {
15741
15808
  "client-report": {
15742
15809
  id: "client-report",
15743
15810
  formats: ["docx"],
15744
- 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.",
15811
+ 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 nine 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.",
15745
15812
  rules: {
15746
15813
  "docx/required-chrome": {
15747
15814
  parameters: { required: ["takeaway", "source"] }
@@ -15754,14 +15821,15 @@ var DOCX_QUALITY_PROFILES = {
15754
15821
  },
15755
15822
  "docx/heading-hierarchy": { severity: "warning" },
15756
15823
  "docx/type-scale": { enabled: true },
15757
- // Measured 2026-09-15 with statistics, lists and contents counted: a
15758
- // client report built from the house blocks paints up to eleven sizes —
15759
- // body, heading 1 and 2, subtitle, display, table cells and headers,
15760
- // source and chrome, and the kpi-row's figure, its unit and its label
15761
- // (28, 14 and 10pt, or 20 and 10 in a row of four). Every one of the
15762
- // reports of the #360 checkpoint and the #409 verification set came in
15763
- // at eleven or fewer; a size past the house set is an ad-hoc one.
15764
- "docx/size-count": { enabled: true, parameters: { maximumSizes: 11 } },
15824
+ // Measured 2026-09-16 with statistics, lists and contents counted, once
15825
+ // a statistic paints in the theme's roles (#454): a client report built
15826
+ // from the house blocks paints up to nine sizes 8 (source, chrome),
15827
+ // 9 (labels, the kpi-row's unit and caption), 9.5 (table cells), 10.5
15828
+ // (body), 12.5 and 16 (headings), 13 (subtitle), 18 (a four-up kpi
15829
+ // figure) and 22 (display, the kpi figure). The 155 client reports of
15830
+ // the checkpoint, host-study and verification runs came in at nine or
15831
+ // fewer; a size past the house set is an ad-hoc one.
15832
+ "docx/size-count": { enabled: true, parameters: { maximumSizes: 9 } },
15765
15833
  "docx/role-drift": { enabled: true },
15766
15834
  // The report blocks place every figure in a captioned block, so a page
15767
15835
  // with no text under the running head is a stray break or an empty
@@ -17811,7 +17879,7 @@ function createBuilderImpl(state) {
17811
17879
  }
17812
17880
  return new Set(list);
17813
17881
  }
17814
- async function expandDocument(document, options) {
17882
+ async function expandDocument(document, options, provenance = false) {
17815
17883
  const preserveSet = resolvePreserveSet(options);
17816
17884
  const rootIn = document;
17817
17885
  const internalDocument = rootIn.props === void 0 ? { ...rootIn, props: {} } : rootIn;
@@ -17871,7 +17939,7 @@ function createBuilderImpl(state) {
17871
17939
  warnings,
17872
17940
  resolveNamedTheme: resolveDocumentTheme
17873
17941
  });
17874
- if (modedRoot.props.blocks !== void 0) {
17942
+ if (modedRoot.props.blocks !== void 0 || provenance) {
17875
17943
  const expanded = await expandBlocksWithPlugins(
17876
17944
  modedRoot,
17877
17945
  modedTheme,
@@ -17919,6 +17987,7 @@ function createBuilderImpl(state) {
17919
17987
  modedDoc: modedDoc2,
17920
17988
  sourceMap: expanded.sourceMap,
17921
17989
  blockPaths: expanded.blocks,
17990
+ pluginOutputs: expanded.pluginOutputs,
17922
17991
  warnings,
17923
17992
  preserveSet,
17924
17993
  processed: {
@@ -17967,8 +18036,64 @@ function createBuilderImpl(state) {
17967
18036
  throw error;
17968
18037
  }
17969
18038
  }
18039
+ async function prepareQuality(document, options) {
18040
+ const {
18041
+ modedRoot,
18042
+ modedTheme,
18043
+ themeName,
18044
+ modedDoc,
18045
+ sourceMap,
18046
+ blockPaths,
18047
+ pluginOutputs,
18048
+ warnings
18049
+ } = await expandDocument(document, options, true);
18050
+ const prepared = prepareDocxQualityDocument(
18051
+ document,
18052
+ {
18053
+ context: { document: modedRoot, theme: modedTheme, themeName },
18054
+ expanded: {
18055
+ document: modedDoc,
18056
+ sourceMap: sourceMap ?? {},
18057
+ blocks: blockPaths ?? [],
18058
+ ...pluginOutputs && { pluginOutputs }
18059
+ },
18060
+ customThemes: state.customThemes,
18061
+ fonts: state.fonts,
18062
+ renderer: options?.renderer ?? state.renderer ?? modedRoot.renderer,
18063
+ warnings
18064
+ }
18065
+ );
18066
+ return { prepared, warnings: warnings.length > 0 ? warnings : null };
18067
+ }
18068
+ async function generateBufferFromPrepared(prepared, options) {
18069
+ const { context } = prepared.model;
18070
+ const warnings = [];
18071
+ const baseDir = options?.baseDir ?? state.baseDir;
18072
+ const deterministic = options?.deterministic ?? state.deterministic;
18073
+ const generatedAt = options?.generatedAt ?? state.generatedAt;
18074
+ const renderer = options?.renderer ?? state.renderer ?? prepared.renderer;
18075
+ const { buffer } = await generateBufferViaIr(context.document, {
18076
+ context,
18077
+ prepared,
18078
+ ...state.services ? { services: state.services } : {},
18079
+ ...state.fonts ? { fonts: state.fonts } : {},
18080
+ ...baseDir !== void 0 ? { baseDir } : {},
18081
+ ...deterministic !== void 0 ? { deterministic } : {},
18082
+ ...generatedAt !== void 0 ? { generatedAt } : {},
18083
+ ...renderer !== void 0 ? { renderer } : {},
18084
+ warnings
18085
+ });
18086
+ return {
18087
+ buffer,
18088
+ warnings: warnings.length > 0 ? warnings : null,
18089
+ standardDefinition: context.document,
18090
+ preservedDefinition: void 0
18091
+ };
18092
+ }
17970
18093
  async function generateBuffer(document, options) {
17971
18094
  try {
18095
+ const reused = options?.prepared && resolvePreserveSet(options) === void 0 ? options.prepared : void 0;
18096
+ if (reused) return await generateBufferFromPrepared(reused, options);
17972
18097
  const {
17973
18098
  modedRoot,
17974
18099
  modedTheme,
@@ -18098,6 +18223,7 @@ function createBuilderImpl(state) {
18098
18223
  generateBuffer,
18099
18224
  generateFile,
18100
18225
  expandStandardDefinition,
18226
+ prepareQuality,
18101
18227
  getComponentNames,
18102
18228
  validate,
18103
18229
  generateSchema,