reamkit 1.32.0 → 1.33.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.
Files changed (157) hide show
  1. package/README.md +5 -4
  2. package/dist/esm/core/bidi/algorithm.js +2 -2
  3. package/dist/esm/core/bidi/char-types.js +1 -1
  4. package/dist/esm/core/bidi/index.js +3 -3
  5. package/dist/esm/core/bytes.js +1 -1
  6. package/dist/esm/core/converter/facade.js +3 -2
  7. package/dist/esm/core/converter/ream.js +12 -5
  8. package/dist/esm/core/crypto/asn1.js +2 -2
  9. package/dist/esm/core/crypto/cms.js +5 -3
  10. package/dist/esm/core/crypto/index.js +2 -1
  11. package/dist/esm/core/crypto/offcrypto.js +64 -19
  12. package/dist/esm/core/crypto/primitives.js +16 -16
  13. package/dist/esm/core/document-model/index.d.ts +1 -1
  14. package/dist/esm/core/document-model/types.d.ts +174 -2
  15. package/dist/esm/core/drawingml/chart-geometry.d.ts +45 -17
  16. package/dist/esm/core/drawingml/chart-geometry.js +1090 -257
  17. package/dist/esm/core/drawingml/chart-parser.d.ts +24 -1
  18. package/dist/esm/core/drawingml/chart-parser.js +334 -41
  19. package/dist/esm/core/drawingml/chart-text.d.ts +41 -0
  20. package/dist/esm/core/drawingml/chart-text.js +93 -0
  21. package/dist/esm/core/drawingml/colors.js +5 -5
  22. package/dist/esm/core/drawingml/diagram/layout-engine.js +1 -4
  23. package/dist/esm/core/drawingml/diagram/run.js +2 -1
  24. package/dist/esm/core/drawingml/preset-geometry.js +4 -6
  25. package/dist/esm/core/drawingml/shape-render.js +1 -1
  26. package/dist/esm/core/drawingml/text-warp.js +4 -16
  27. package/dist/esm/core/drawingml/theme-parser.js +14 -8
  28. package/dist/esm/core/font/arabic-joining.js +2 -2
  29. package/dist/esm/core/font/binary-reader.js +2 -0
  30. package/dist/esm/core/font/font-registry.js +1 -0
  31. package/dist/esm/core/font/ligatures.js +1 -1
  32. package/dist/esm/core/font/opentype-layout.js +11 -5
  33. package/dist/esm/core/font/ttf-build.js +6 -10
  34. package/dist/esm/core/font/ttf-parser.js +2 -1
  35. package/dist/esm/core/font/ttf-subset.js +8 -8
  36. package/dist/esm/core/fonts/families.js +1 -1
  37. package/dist/esm/core/fonts/remote-fonts.js +4 -4
  38. package/dist/esm/core/hyphenation/index.js +1 -1
  39. package/dist/esm/core/images.js +8 -8
  40. package/dist/esm/core/ir/loss.js +1 -0
  41. package/dist/esm/core/line-breaker/cjk.js +1 -1
  42. package/dist/esm/core/line-breaker/index.js +4 -3
  43. package/dist/esm/core/links.js +1 -1
  44. package/dist/esm/core/lzw.js +1 -1
  45. package/dist/esm/core/metafile/blit.js +1 -1
  46. package/dist/esm/core/metafile/emf.js +5 -7
  47. package/dist/esm/core/metafile/picture.js +1 -1
  48. package/dist/esm/core/metafile/symbol-fonts.js +7 -7
  49. package/dist/esm/core/metafile/wmf.js +5 -7
  50. package/dist/esm/core/number-format.d.ts +40 -15
  51. package/dist/esm/core/number-format.js +284 -79
  52. package/dist/esm/core/numbering/index.js +3 -2
  53. package/dist/esm/core/ole/cfb.js +4 -4
  54. package/dist/esm/core/ole/escher-blip.js +1 -1
  55. package/dist/esm/core/opc/index.js +5 -4
  56. package/dist/esm/core/opc/package.js +3 -1
  57. package/dist/esm/core/opc/tag-scan.d.ts +15 -0
  58. package/dist/esm/core/opc/tag-scan.js +41 -0
  59. package/dist/esm/core/opc/xml-entities.js +40 -3
  60. package/dist/esm/core/outline.js +1 -1
  61. package/dist/esm/core/png-encode.js +3 -3
  62. package/dist/esm/core/po-helpers.js +1 -1
  63. package/dist/esm/core/spreadsheet-model/types.d.ts +6 -0
  64. package/dist/esm/core/style-cascade/index.js +4 -3
  65. package/dist/esm/core/tiff.js +3 -1
  66. package/dist/esm/excel/activex-parser.js +1 -1
  67. package/dist/esm/excel/conditional-format.js +7 -7
  68. package/dist/esm/excel/formula/functions.js +45 -18
  69. package/dist/esm/excel/formula/index.js +3 -3
  70. package/dist/esm/excel/formula/lexer.js +2 -2
  71. package/dist/esm/excel/formula/parser.js +4 -3
  72. package/dist/esm/excel/formula/value.js +1 -1
  73. package/dist/esm/excel/index.js +7 -6
  74. package/dist/esm/excel/print-model.js +18 -7
  75. package/dist/esm/excel/printer-settings.js +6 -7
  76. package/dist/esm/excel/rich-value.js +1 -1
  77. package/dist/esm/excel/sheet-shape-parser.js +4 -2
  78. package/dist/esm/excel/sheet-to-flow.js +13 -11
  79. package/dist/esm/excel/styles-parser.js +5 -3
  80. package/dist/esm/excel/tint.js +5 -5
  81. package/dist/esm/excel/vml-drawing.js +3 -3
  82. package/dist/esm/excel/worksheet-parser.js +5 -5
  83. package/dist/esm/excel/xls/biff-chart.js +1 -3
  84. package/dist/esm/excel/xls/biff-reader.js +10 -11
  85. package/dist/esm/excel/xls/xls-reader.js +1 -1
  86. package/dist/esm/excel/xlsx-reader.js +56 -9
  87. package/dist/esm/excel/xlsx-to-pdf.js +1 -1
  88. package/dist/esm/excel/xlsx-writer.js +2 -2
  89. package/dist/esm/html/html-writer.js +18 -10
  90. package/dist/esm/layout/line-paint.js +1 -1
  91. package/dist/esm/layout/math-layout.js +5 -8
  92. package/dist/esm/layout/styled-layout.js +104 -32
  93. package/dist/esm/layout/turned-section.js +2 -2
  94. package/dist/esm/markdown/markdown-writer.js +59 -8
  95. package/dist/esm/pdf/encryption.js +9 -9
  96. package/dist/esm/pdf/icc-profile.js +2 -2
  97. package/dist/esm/pdf/index.js +3 -2
  98. package/dist/esm/pdf/objects.js +7 -0
  99. package/dist/esm/pdf/serialize.js +1 -1
  100. package/dist/esm/pdf/struct-tree.js +3 -1
  101. package/dist/esm/pdf/styled-page-emitter.js +23 -15
  102. package/dist/esm/pdf/styled-page-renderer.js +9 -5
  103. package/dist/esm/pdf-reader/annot-draw.js +5 -5
  104. package/dist/esm/pdf-reader/annots.js +3 -1
  105. package/dist/esm/pdf-reader/ccitt.js +2 -1
  106. package/dist/esm/pdf-reader/cff-outline.js +1 -4
  107. package/dist/esm/pdf-reader/content.js +13 -15
  108. package/dist/esm/pdf-reader/decrypt.js +5 -4
  109. package/dist/esm/pdf-reader/document.js +6 -2
  110. package/dist/esm/pdf-reader/encodings.js +1 -1
  111. package/dist/esm/pdf-reader/flow-build.js +4 -6
  112. package/dist/esm/pdf-reader/font.js +4 -4
  113. package/dist/esm/pdf-reader/function.js +8 -7
  114. package/dist/esm/pdf-reader/icc.js +1 -1
  115. package/dist/esm/pdf-reader/images.js +1 -1
  116. package/dist/esm/pdf-reader/jbig2.js +36 -38
  117. package/dist/esm/pdf-reader/jpeg.js +14 -13
  118. package/dist/esm/pdf-reader/layout.js +13 -10
  119. package/dist/esm/pdf-reader/lexer.js +2 -1
  120. package/dist/esm/pdf-reader/math-rows.js +2 -2
  121. package/dist/esm/pdf-reader/optional-content.js +1 -1
  122. package/dist/esm/pdf-reader/page-numbers.js +1 -1
  123. package/dist/esm/pdf-reader/pattern-tint.js +1 -2
  124. package/dist/esm/pdf-reader/reader.js +2 -2
  125. package/dist/esm/pdf-reader/struct-tree.js +1 -1
  126. package/dist/esm/pdf-reader/tagged.js +3 -2
  127. package/dist/esm/pdf-reader/text.js +2 -2
  128. package/dist/esm/pdf-reader/type1-outline.js +1 -3
  129. package/dist/esm/pptx/embedded-fonts.js +3 -5
  130. package/dist/esm/pptx/placeholder-cascade.js +1 -1
  131. package/dist/esm/pptx/ppt/ppt-reader.js +5 -4
  132. package/dist/esm/pptx/ppt/ppt-text.js +9 -10
  133. package/dist/esm/pptx/pptx-reader.js +6 -5
  134. package/dist/esm/pptx/preset-table-styles.js +1 -1
  135. package/dist/esm/pptx/slide-parser.js +6 -4
  136. package/dist/esm/pptx/sp-helpers.js +1 -1
  137. package/dist/esm/pptx/table-style.js +2 -1
  138. package/dist/esm/svg/svg-writer.js +1 -1
  139. package/dist/esm/word/doc/doc-reader.js +2 -2
  140. package/dist/esm/word/doc/doc-text.js +20 -22
  141. package/dist/esm/word/document-parser.js +27 -22
  142. package/dist/esm/word/docx-reader.js +15 -10
  143. package/dist/esm/word/docx-to-pdf.js +6 -6
  144. package/dist/esm/word/docx-writer.js +10 -6
  145. package/dist/esm/word/drawing-parser.js +18 -18
  146. package/dist/esm/word/font-table.js +90 -11
  147. package/dist/esm/word/index.js +6 -5
  148. package/dist/esm/word/numbering-parser.js +5 -4
  149. package/dist/esm/word/omml-parser.js +1 -1
  150. package/dist/esm/word/paragraph-properties.js +11 -10
  151. package/dist/esm/word/run-properties.js +4 -4
  152. package/dist/esm/word/settings-parser.js +2 -1
  153. package/dist/esm/word/shading.js +1 -1
  154. package/dist/esm/word/styles-parser.js +5 -4
  155. package/dist/esm/word/table-parser.js +4 -4
  156. package/dist/esm/word/theme-fonts.js +1 -1
  157. package/package.json +10 -4
@@ -20,10 +20,14 @@ export interface ChartPolyline {
20
20
  readonly strokeHex: string;
21
21
  readonly widthPt: number;
22
22
  }
23
- /** A closed, filled polygon (area-chart bands). Drawn before strokes/labels. */
23
+ /**
24
+ * A closed polygon: area-chart bands, the faces of 3-D bars, a 3-D chart's
25
+ * walls. Drawn before rectangles, strokes and labels; one without a fill is
26
+ * its outline alone.
27
+ */
24
28
  export interface ChartPolygon {
25
29
  readonly points: ReadonlyArray<readonly [number, number]>;
26
- readonly fillHex: string;
30
+ readonly fillHex?: string;
27
31
  readonly strokeHex?: string;
28
32
  readonly widthPt?: number;
29
33
  }
@@ -44,7 +48,7 @@ export interface ChartWedge {
44
48
  /** How a {@link ChartLabel} sits horizontally relative to its anchor point. */
45
49
  export type LabelAlign = 'left' | 'center' | 'right';
46
50
  /** A text label (title, axis tick, category, data value, legend entry). */
47
- export interface ChartLabel {
51
+ export interface ChartLabel extends ChartFont {
48
52
  readonly text: string;
49
53
  /** Anchor point; `align` says how text sits relative to it. */
50
54
  readonly x: number;
@@ -80,6 +84,11 @@ export interface ChartScene {
80
84
  * frame and under the gridlines.
81
85
  */
82
86
  readonly plotBackground?: ChartRect;
87
+ /**
88
+ * §21.2.2.69/§21.2.2.11/§21.2.2.191 — a 3-D chart's floor and walls, drawn
89
+ * over the plot's own fill and under its gridlines.
90
+ */
91
+ readonly walls?: ReadonlyArray<ChartPolygon>;
83
92
  /**
84
93
  * Major gridlines, drawn UNDER the plotted data. Kept apart from the other
85
94
  * polylines because z-order is the whole point: gridlines over the bars strip
@@ -88,12 +97,21 @@ export interface ChartScene {
88
97
  */
89
98
  readonly gridlines?: ReadonlyArray<ChartPolyline>;
90
99
  }
100
+ /**
101
+ * The face a chart's text is set in beyond its size: the family the chart
102
+ * names (absent — the document's own) and its weight and slant.
103
+ */
104
+ export interface ChartFont {
105
+ readonly family?: string;
106
+ readonly bold?: boolean;
107
+ readonly italic?: boolean;
108
+ }
91
109
  /**
92
110
  * Injected text-width measurer: the rendered advance width (points) of `text` at
93
- * `sizePt`. Keeps this module free of any font/PDF dependency, so it is
94
- * unit-testable in isolation.
111
+ * `sizePt`, in `font` when the chart names one. Keeps this module free of any
112
+ * font/PDF dependency, so it is unit-testable in isolation.
95
113
  */
96
- export type MeasureText = (text: string, sizePt: number) => number;
114
+ export type MeasureText = (text: string, sizePt: number, font?: ChartFont) => number;
97
115
  /** Font size (points) for axis ticks, category/data labels and legend text. */
98
116
  export declare const CHART_LABEL_PT = 9;
99
117
  /** Font size (points) for the chart title. */
@@ -119,22 +137,25 @@ export interface Scale {
119
137
  }
120
138
  /**
121
139
  * The scale Excel gives a value axis it is left to choose, measured against
122
- * Excel's own PDF of eight column charts (2026-10-01):
140
+ * Excel's own PDF of its column charts (2026-10-01 and -02):
123
141
  *
124
142
  * - the ends: values all of one sign put the axis's near end at zero —
125
143
  * unless their spread is under a sixth of the largest of them, when it
126
144
  * stops half a spread short of the nearest (93…97 runs from 91) — and the
127
- * far end, like both ends of a range across zero, takes 5% of the spread
128
- * beyond the data before it is rounded out to the step;
145
+ * far end takes 5% of its reach from that near end before it is rounded
146
+ * out to the step. 70…96 reaches 100.8 and runs 0…120 by 20, where 5% of
147
+ * the data's own spread stopped at 97.3 and ran it 0…100 by 10. Both ends
148
+ * of a range across zero take 5% of the spread;
129
149
  * - the step: the smallest 1, 2 or 5 × 10ⁿ that leaves at most ten intervals
130
150
  * (`maxIntervals`), whatever the chart's height — 3 750 runs 0…4 000 by 500
131
151
  * on a 150pt chart as on a 400pt one. Only an axis too short to hold the
132
152
  * labels asks for fewer, and the caller says so.
133
153
  *
134
- * Every case of the probe lands where Excel puts it: −1…1.2 on −1.5…1.5 by
154
+ * Every case of the probes lands where Excel puts it: −1…1.2 on −1.5…1.5 by
135
155
  * 0.5, 0.3…4.7 on 0…5 by 0.5, 120…950 on 0…1 000 by 100, 0.012…0.047 on
136
- * 0…0.05 by 0.005. Heckbert's nice numbers with a budget of ticks by height
137
- * stepped the budget chart by 1 000 and started 93…97 at zero.
156
+ * 0…0.05 by 0.005, 1E-150…3E-150 on 0…3.5E-150. Heckbert's nice numbers with
157
+ * a budget of ticks by height stepped the budget chart by 1 000 and started
158
+ * 93…97 at zero.
138
159
  *
139
160
  * @param dataMin The smallest value to cover.
140
161
  * @param dataMax The largest value to cover.
@@ -143,14 +164,21 @@ export interface Scale {
143
164
  */
144
165
  export declare function niceScale(dataMin: number, dataMax: number, maxIntervals?: number): Scale;
145
166
  /**
146
- * Format an axis tick value, choosing decimal places from the tick `step` so
147
- * `0.25`-spaced ticks read `0.25` while integer steps drop the fraction.
167
+ * A value-axis tick as Excel labels it under General. An axis is not a cell:
168
+ * its General gives every label nine characters, the sign among them, on an
169
+ * axis 150pt or 500pt long, upright or lying alike — Excel's own PDF of 44
170
+ * axes (2026-10-01 and -02). Within them it is the cells' rule
171
+ * ({@link generalRenderings}): the number as it is where it fits (0.25 — we
172
+ * wrote 0.3 on an axis stepped by 0.25 — 500000000, −50000000, 0.0000003),
173
+ * else the finest of it rounded or in scientific notation (0.1234568,
174
+ * −0.123457, 123456771, 1E+09, 1.235E+09, −1.23E+09, 1.235E-05, 5E-151).
175
+ * Places counted from the step and written by `toFixed` threw past a hundred
176
+ * of them, which a step of 1E-150 asked for.
148
177
  *
149
- * @param v The tick value.
150
- * @param step The tick spacing (from {@link niceScale}).
178
+ * @param v The tick value.
151
179
  * @returns The label text.
152
180
  */
153
- export declare function formatTick(v: number, step: number): string;
181
+ export declare function formatTick(v: number): string;
154
182
  export declare function buildBarScene(chart: Chart, wPt: number, hPt: number, measure: MeasureText): ChartScene;
155
183
  /**
156
184
  * The name a series shows in the legend: its own `c:tx`, or Excel's positional