@json-to-office/core-docx 6.0.0 → 6.2.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.
@@ -67,6 +67,12 @@ export interface DocxHeadingFact extends QualityFact {
67
67
  kind: 'docx/heading';
68
68
  level: number;
69
69
  previousLevel?: number;
70
+ /**
71
+ * Whether the heading is bound to what follows it, from its own prop or
72
+ * from the style the theme gives its level. Word breaks a page between an
73
+ * unbound heading and its first paragraph without a second thought.
74
+ */
75
+ keepNext: boolean;
70
76
  }
71
77
  /**
72
78
  * A paragraph pinned into a floating frame — the one place in DOCX where the
@@ -245,7 +251,55 @@ export interface DocxSectionChromeFact extends QualityFact {
245
251
  footer: boolean;
246
252
  pageNumber: boolean;
247
253
  }
248
- export type DocxQualityFact = DocxTextFact | DocxChromeSlotFact | DocxSectionChromeFact | DocxTableWidthFact | DocxHeadingFact | DocxFrameTextFact | DocxSvgTextFact | DocxLineBoxFact | DocxPlaceholderFact | DocxBlockSlotFact | DocxThemeFact | DocxTextSizeFact | DocxColorFact | DocxFontFact | DocxChartFact | DocxTableFact;
254
+ /**
255
+ * What a top-level section holds once blocks have expanded: whether anything
256
+ * reaches the page at all, and whether a heading opens it. A profile decides
257
+ * whether either is required; the theme never does.
258
+ */
259
+ export interface DocxSectionFact extends QualityFact {
260
+ kind: 'docx/section';
261
+ index: number;
262
+ /** Paragraphs, list items, table cells, captions — text a reader sees. */
263
+ words: number;
264
+ /** Figures a section carries without words: a chart, a table, an image. */
265
+ exhibits: number;
266
+ headings: number;
267
+ }
268
+ /**
269
+ * The document's outline as a whole: how many headings it carries and whether
270
+ * it offers a table of contents to reach them by.
271
+ */
272
+ export interface DocxOutlineFact extends QualityFact {
273
+ kind: 'docx/outline';
274
+ headings: number;
275
+ contents: boolean;
276
+ }
277
+ /**
278
+ * A drawn image and what is known about the asset behind it. `naturalRatio`
279
+ * is present only when the asset could be read where it stands — a data URI
280
+ * or inline SVG markup. A path is resolved at generation, not here, so a
281
+ * distorted file-backed image is the rendered pass's to catch.
282
+ */
283
+ export interface DocxImageFact extends QualityFact {
284
+ kind: 'docx/image';
285
+ alt?: string;
286
+ /** Whether a caption paragraph follows the image in reading order. */
287
+ captioned: boolean;
288
+ drawnRatio?: number;
289
+ naturalRatio?: number;
290
+ }
291
+ /**
292
+ * How wide a line of body copy runs, in characters. The measure is the
293
+ * section's usable width; the characters are what the body face fits in it.
294
+ */
295
+ export interface DocxMeasureFact extends QualityFact {
296
+ kind: 'docx/measure';
297
+ index: number;
298
+ charactersPerLine: number;
299
+ widthTwips: number;
300
+ fontSizePt: number;
301
+ }
302
+ export type DocxQualityFact = DocxTextFact | DocxSectionFact | DocxOutlineFact | DocxImageFact | DocxMeasureFact | DocxChromeSlotFact | DocxSectionChromeFact | DocxTableWidthFact | DocxHeadingFact | DocxFrameTextFact | DocxSvgTextFact | DocxLineBoxFact | DocxPlaceholderFact | DocxBlockSlotFact | DocxThemeFact | DocxTextSizeFact | DocxColorFact | DocxFontFact | DocxChartFact | DocxTableFact;
249
303
  export interface DocxQualityModel {
250
304
  authored: ReportComponentDefinition;
251
305
  /** Theme context over the expanded tree: every block lowered in place. */
@@ -1 +1 @@
1
- {"version":3,"file":"facts.d.ts","sourceRoot":"","sources":["../../src/quality/facts.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EAErB,KAAK,WAAW,EAEhB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAuB,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAEL,KA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AE,yBAA8B,GACtC,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CA+hBrD"}
@@ -49,37 +49,77 @@ export declare const docxExhibitRequiredRule: QualityRule<DocxQualityModel, Docx
49
49
  */
50
50
  export declare const docxRunningHeadRule: QualityRule<DocxQualityModel, DocxQualityFact>;
51
51
  /**
52
- * An authored size the theme never paints. The theme owns the list its
53
- * styles, its font roles, every step of its scale so a custom theme is
54
- * judged by its own values, and a size a block compiled from its definition
55
- * is never reported: the author has no pointer to patch there. Off until a
56
- * profile turns it on: an editorial layout on any theme sets display sizes by
57
- * hand, and only an archetype decides that a document must keep to the scale.
52
+ * An authored size the theme never paints not a style, not a font role, not
53
+ * a step of its scale. The theme owns the list, so a custom theme is judged
54
+ * by its own values, and a size a block compiled from its definition is never
55
+ * reported: the author has no pointer to patch there. Off until a profile
56
+ * turns it on: an editorial layout on any theme sets display sizes by hand,
57
+ * and only an archetype decides that a document must keep to the scale.
58
58
  */
59
59
  export declare const docxTypeScaleRule: QualityRule<DocxQualityModel, DocxQualityFact>;
60
60
  /**
61
61
  * How many distinct sizes a document paints, blocks included: the count of
62
62
  * what reaches the page rather than of what the author typed. Off until a
63
- * profile turns it on and sets `maximumSizes`: a theme sets no ceiling of
64
- * its own, the ceiling is an archetype convention.
63
+ * profile turns it on and sets `maximumSizes`: a theme sets no ceiling of its
64
+ * own, the ceiling is an archetype convention.
65
65
  */
66
66
  export declare const docxSizeCountRule: QualityRule<DocxQualityModel, DocxQualityFact>;
67
67
  /**
68
68
  * One role at two sizes: a heading level or a paragraph style that is painted
69
- * at more than one size across the document. The theme's size for the role
70
- * is the expected value, and every authored departure from it is reported and
69
+ * at more than one size across the document. The theme's size for the role is
70
+ * the expected value, and every authored departure from it is reported and
71
71
  * repaired to it. A role that is consistently overridden is not drift. Off
72
72
  * until a profile turns it on, for the same reason as `docx/type-scale`,
73
73
  * which yields to this rule on any pointer it reports.
74
74
  */
75
75
  export declare const docxRoleDriftRule: QualityRule<DocxQualityModel, DocxQualityFact>;
76
+ /**
77
+ * How wide a line of body copy runs. Between 45 and 90 characters a reader's
78
+ * eye finds the next line without hunting; outside it, a page is either a
79
+ * ribbon or a wall. The width model is an estimate — an average advance over
80
+ * ordinary English at the body size — so the finding is `estimated` and its
81
+ * bounds are generous.
82
+ */
83
+ export declare const docxBodyMeasureRule: QualityRule<DocxQualityModel, DocxQualityFact>;
84
+ /** A section that renders nothing, and a section no heading opens. */
85
+ export declare const docxSectionContentRule: QualityRule<DocxQualityModel, DocxQualityFact>;
86
+ /**
87
+ * A heading Word may leave at the foot of a page with its first paragraph
88
+ * overleaf. Every bundled theme binds its heading styles, so this fires on a
89
+ * heading that unbinds itself or on a theme that never bound one; the fix is
90
+ * the property Word reads.
91
+ */
92
+ export declare const docxHeadingKeepNextRule: QualityRule<DocxQualityModel, DocxQualityFact>;
93
+ /**
94
+ * A figure a reader cannot name and a screen reader cannot describe. Either
95
+ * answers the question — a caption beside the image, or alt text on it — so
96
+ * the finding stands only when neither does.
97
+ */
98
+ export declare const docxFigureLabelRule: QualityRule<DocxQualityModel, DocxQualityFact>;
99
+ /** An image drawn at an aspect the asset does not have. */
100
+ export declare const docxImageAspectRule: QualityRule<DocxQualityModel, DocxQualityFact>;
101
+ /**
102
+ * A document long enough to be navigated, with no contents to navigate it by.
103
+ * The threshold is the profile's: a memo with four headings needs none, a
104
+ * report with a dozen does.
105
+ */
106
+ export declare const docxContentsRule: QualityRule<DocxQualityModel, DocxQualityFact>;
76
107
  export declare const DOCX_QUALITY_RULES: QualityRulePack<DocxQualityModel, DocxQualityFact>;
77
108
  export declare const DOCX_QUALITY_PROFILES: {
78
109
  readonly 'client-report': {
79
110
  readonly id: "client-report";
80
111
  readonly formats: readonly ["docx"];
81
- readonly 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, no page rendered empty or left half blank under the running head, and at least one chart or table.";
112
+ readonly 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.";
82
113
  readonly rules: {
114
+ readonly 'docx/section-content': {
115
+ readonly enabled: true;
116
+ };
117
+ readonly 'docx/heading-keep-next': {
118
+ readonly enabled: true;
119
+ };
120
+ readonly 'docx/figure-label': {
121
+ readonly enabled: true;
122
+ };
83
123
  readonly 'docx/required-chrome': {
84
124
  readonly parameters: {
85
125
  readonly required: readonly ["takeaway", "source"];
@@ -125,13 +165,34 @@ export declare const DOCX_QUALITY_PROFILES: {
125
165
  readonly 'docx/heading-hierarchy': {
126
166
  readonly severity: "warning";
127
167
  };
168
+ readonly 'docx/section-content': {
169
+ readonly enabled: true;
170
+ };
171
+ readonly 'docx/heading-keep-next': {
172
+ readonly enabled: true;
173
+ };
128
174
  };
129
175
  };
130
176
  readonly 'technical-report': {
131
177
  readonly id: "technical-report";
132
178
  readonly formats: readonly ["docx"];
133
- readonly 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, no page rendered empty or left half blank, and at least one chart or table.";
179
+ readonly 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.";
134
180
  readonly rules: {
181
+ readonly 'docx/section-content': {
182
+ readonly enabled: true;
183
+ };
184
+ readonly 'docx/heading-keep-next': {
185
+ readonly enabled: true;
186
+ };
187
+ readonly 'docx/figure-label': {
188
+ readonly enabled: true;
189
+ };
190
+ readonly 'docx/contents-missing': {
191
+ readonly severity: "warning";
192
+ readonly parameters: {
193
+ readonly minimumHeadings: 8;
194
+ };
195
+ };
135
196
  readonly 'docx/required-chrome': {
136
197
  readonly parameters: {
137
198
  readon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